Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#23] Tab & TextBox & BottomSheet & FilterBottomSheet #34

Merged
merged 22 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
762c6ba
feat: Tab ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„
ocahs9 Jan 12, 2025
475c340
feat: BottomSheet ํ‹€ ๊ตฌํ˜„
ocahs9 Jan 12, 2025
0f76449
feat: BottomSheet ๋‹ซ๊ธฐ ๋ฒ„ํŠผ ๊ธฐ๋Šฅ ๊ตฌํ˜„
ocahs9 Jan 12, 2025
1b55906
feat: FilterBottom 1์ฐจ ๊ตฌํ˜„
ocahs9 Jan 12, 2025
ff009d2
feat: CheckBoxText ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„
ocahs9 Jan 13, 2025
70ff22b
design: CheckBoxText ํผ๋ธ”๋ฆฌ์‹ฑ
ocahs9 Jan 13, 2025
a7ba48d
feat: DropDownText ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„
ocahs9 Jan 13, 2025
ca726bf
Merge branch 'develop' into feat/#23/TabAndBottomSheet
ocahs9 Jan 13, 2025
e395566
feat: ํ•„ํ„ฐ๋ฐ”ํ…€์‹œํŠธ 1์ฐจ ์™„์„ฑ
ocahs9 Jan 13, 2025
0025bb7
feat: ํ•„ํ„ฐ๋ฐ”ํ…€์‹œํŠธ ๊ตฌํ˜„(๋ฒ„ํŠผ ๊ธฐ๋Šฅ ๊ตฌํ˜„)
ocahs9 Jan 13, 2025
fb0d30a
Merge branch 'develop' of https://github.com/SOPT-all/35-APPJAM-WEB-Cโ€ฆ
ocahs9 Jan 13, 2025
aa315e9
design: ์นฉ ์ถ”๊ฐ€
ocahs9 Jan 14, 2025
fa67218
Merge branch 'develop' into feat/#23/TabAndBottomSheet
ocahs9 Jan 14, 2025
02c5413
feat: filter ๋ฐ์ดํ„ฐ, ํ•จ์ˆ˜ ์ „์—ญํ™”
ocahs9 Jan 14, 2025
c14d83c
refactor: ํ•„ํ„ฐ ๋ฐ”ํ…€ ์‹œํŠธ zustand๋กœ ๋ฆฌํŒฉํ† ๋ง
ocahs9 Jan 14, 2025
1ef698d
bug: depth ๊นŠ์€ symptoms, disease๊ฐ€ ํ™”๋ฉด์— ๋ Œ๋”๋ง ๋˜์ง€ ์•Š๋˜ ๋ฌธ์ œ ํ•ด๊ฒฐ
ocahs9 Jan 14, 2025
f5a8f61
fix: ์“ธ๋ฐ์—†๋Š” ์ „์—ญ ์ƒํƒœ ์ œ๊ฑฐ
ocahs9 Jan 14, 2025
fffa1d0
bug: ์ข…๋ฅ˜์—์„œ ์นฉ ๋ˆŒ๋ €์„ ๋•Œ ์ƒ‰์ด ํ•ด์ œ๋˜์ง€ ์•Š๋˜ ๋ฒ„๊ทธ ํ•ด๊ฒฐ
ocahs9 Jan 14, 2025
8504171
bug: ์™ธ๋ถ€์— ์˜ํ•ด์„œ ๋ณ€ํ•  ์ˆ˜ ์—†๋˜ ๋ฒ„๊ทธ ์ˆ˜์ •
ocahs9 Jan 14, 2025
203aa34
bug: ์•„๋ฌด ์นฉ ์—†์„ ๋•Œ ๊ณต๊ฐ„ ์ฐจ์ง€ํ•˜๋˜ ๋ฒ„๊ทธ ์ˆ˜์ • & ๋ฐ์ดํ„ฐ ์„ธํŒ… ํ…Œ์ŠคํŠธ
ocahs9 Jan 14, 2025
63a320a
Merge branch 'develop' into feat/#23/TabAndBottomSheet
ocahs9 Jan 15, 2025
840000a
fix: ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์ฝ”๋“œ ์ œ๊ฑฐ
ocahs9 Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@
"fix": "safe"
}
},
"a11y": { "useKeyWithClickEvents": "off", "noSvgWithoutTitle": "off", "useButtonType": "off" },
"style": {
"useImportType": {
"level": "off"
},
"noNonNullAssertion": {
"level": "off"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions public/svgs/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/svgs/ic_up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/asset/svg/Check.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

import type { SVGProps } from "react";
const SvgCheck = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
fill="none"
{...props}
>
<path
stroke="#14B5F0"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M20 6 9 17l-5-5"
/>
</svg>
);
export default SvgCheck;
20 changes: 20 additions & 0 deletions src/asset/svg/IcUp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from "react";
import type { SVGProps } from "react";
const SvgIcUp = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={21}
height={20}
fill="none"
{...props}
>
<path
stroke="#717171"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="m15.023 12.5-5-5-5 5"
/>
</svg>
);
export default SvgIcUp;
3 changes: 3 additions & 0 deletions src/asset/svg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export { default as IcMessage } from "./IcMessage";
export { default as IcSearch } from "./IcSearch";
export { default as IcSearchFillter } from "./IcSearchFillter";
export { default as IcSearchFillterBlue } from "./IcSearchFillterBlue";

export { default as Check } from "./Check";
export { default as IcUp } from "./IcUp";
export { default as IcTest } from "./IcTest";
export { default as IcoMessage } from "./IcoMessage";
export { default as IcoSkeleton } from "./IcoSkeleton";
Expand Down
42 changes: 42 additions & 0 deletions src/common/component/BottomSheet/BottomSheet.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { semanticColor } from "@style/styles.css";
import { style } from "@vanilla-extract/css";

export const overlay = style({
position: "absolute",
top: 0,
left: 0,
zIndex: "99",

width: "100%",
height: "100vh",
backgroundColor: "rgba(34, 34, 34, 0.2)",
});

export const bottomSheet = style({
position: "absolute",
bottom: "0",

display: "flex",
flexDirection: "column",
zIndex: "99",

width: "100%",
height: "90vh",
borderRadius: "20px 20px 0px 0px",
backgroundColor: "white",
});

export const bottomTabBar = style({
width: "100%",
height: "24px",
padding: "12px",
display: "flex",
justifyContent: "center",
alignItems: "center",
});

export const bar = style({
width: "8rem",
height: "4px",
backgroundColor: semanticColor.line.heavy,
});
35 changes: 35 additions & 0 deletions src/common/component/BottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {} from "react";
import * as styles from "./BottomSheet.css";

interface BottomSheetPropTypes {
isOpen: boolean;
handleOpen: (isOpen: boolean) => void;
children: JSX.Element; //ReactNode๋Š” ๋ฒ”์œ„๊ฐ€ ๋„ˆ๋ฌด ๋„“์Œ
}

//ํ™”๋ฉด ์ „์ฒด๋ฅผ ์ฐจ์ง€ํ•˜๋Š” ๋ฐ”ํ…€์‹œํŠธ ํ‹€ (children ํ•„์š”)
const BottomSheet = ({ isOpen, children, handleOpen }: BottomSheetPropTypes) => {
if (!isOpen) return;

const handleClose = () => {
handleOpen(false);
};

const handleBottomSheetClick = (event: React.MouseEvent<HTMLDivElement>) => {
event.stopPropagation(); // ์ด๋ฒคํŠธ ์ „ํŒŒ ์ฐจ๋‹จ
};

return (
<div className={styles.overlay} onClick={handleClose} onKeyDown={handleClose}>
<div className={styles.bottomSheet} onClick={handleBottomSheetClick}>
<div className={styles.bottomTabBar}>
<div className={styles.bar} onClick={handleClose} onKeyDown={handleClose} />
</div>

{children}
</div>
</div>
);
};

export default BottomSheet;
9 changes: 4 additions & 5 deletions src/common/component/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React from "react";
import {
button,
ButtonVariants,
icon,
} from "@common/component/Button/styles.css.ts";
import { button, ButtonVariants, icon } from "@common/component/Button/styles.css.ts";

interface ButtonProps {
width?: string;
label?: string;
leftIcon?: React.ReactNode;
rightIcon?: React.ReactNode;
Expand All @@ -27,6 +24,7 @@ type CombinedButtonProps = ButtonProps & Exclude<ButtonVariants, undefined>;
*/

export const Button = ({
width = "",
label = "Button",
leftIcon,
rightIcon,
Expand All @@ -37,6 +35,7 @@ export const Button = ({
}: CombinedButtonProps) => {
return (
<button
style={{ width: width }}
className={button({ size, variant, disabled })}
disabled={disabled}
onClick={onClick}
Expand Down
1 change: 1 addition & 0 deletions src/common/component/Button/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const button = recipe({
border: `0.1rem solid ${color.primary.blue500}`,
},
},

},
disabled: {
true: {
Expand Down
31 changes: 31 additions & 0 deletions src/common/component/CheckBoxText/CheckBoxText.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { font, semanticColor } from "@style/styles.css";
import { recipe } from "@vanilla-extract/recipes";

export const checkboxText = recipe({
base: [
font.body01,
{
display: "flex",
width: "100%",
height: "44px",
padding: "12px 8px",
alignItems: "flex-start",
gap: "16px",
borderRadius: "9px",
color: semanticColor.text.normal,
},
],

variants: {
isSelected: {
true: {
border: `1px solid ${semanticColor.primary.normal}`,
color: semanticColor.text.heavy,
backgroundColor: "rgba(67, 214, 255, 0.16)",
},
false: {
border: "1px solid white",
},
},
},
});
27 changes: 27 additions & 0 deletions src/common/component/CheckBoxText/CheckBoxText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { checkboxText } from "./CheckBoxText.css";
import { Check } from "@asset/svg";

interface CheckBoxTextPropTypes {
children: string;
isSelected: boolean;
onClick: () => void;
}
const CheckBoxText = ({ children, isSelected, onClick }: CheckBoxTextPropTypes) => {
const handleClickTextBox = () => {
onClick();
};

return (
<div
className={checkboxText({
isSelected: isSelected,
})}
onClick={handleClickTextBox}
>
<span style={{ width: "100%" }}>{children}</span>
{isSelected && <Check width={24} height={24} style={{ position: "relative", bottom: "3" }} />}
</div>
);
};

export default CheckBoxText;
22 changes: 14 additions & 8 deletions src/common/component/Chip/Chip.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
import { useState } from "react";
import { useEffect, useState } from "react";
import { ChipType, chipItem } from "./ChipStyle.css.ts";
import { IcDelete } from "@asset/svg/index";

interface ChipProps {
label: string;
icon?: boolean;
color: "blue" | "gray";
onClick: () => void;
color?: "blue" | "gray";
onClick?: () => void;
isSelected?: boolean;
}

type CombinedChipProps = ChipProps & Exclude<ChipType, undefined>;

const Chip = ({ label, icon = false, color = "blue", onClick }: CombinedChipProps) => {
const [isActive, setIsActive] = useState(false);
const Chip = ({ label, icon = false, color = "blue", onClick, isSelected = false }: CombinedChipProps) => {
const [isActive, setIsActive] = useState(isSelected);

useEffect(() => {
setIsActive(isSelected);
}, [isSelected]);

const handleClick = () => {
if (color === "gray" || size === "large") return;
setIsActive(!isActive);
onClick();
if (color === "gray" || (size === "large" && icon === false)) return;
if (!icon) setIsActive(!isActive);
onClick?.();
};

const size = icon ? "large" : "small";
Expand All @@ -31,6 +36,7 @@ const Chip = ({ label, icon = false, color = "blue", onClick }: CombinedChipProp
{label}
{icon && (
<IcDelete
onClick={() => console.log("first")}
color={color === "gray" ? "#717171" : "#14B5F0"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2) ์—ฌ๊ธฐ ํ™•์ธํ•ด์ฃผ์„ธ์š”!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฐ”๋กœ ๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹ค !

style={{
position: "relative",
Expand Down
5 changes: 3 additions & 2 deletions src/common/component/Chip/ChipStyle.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ export const chipItem = recipe({
// background: color.gray.gray000,
color: color.primary.blue700,
border: `0.1rem solid ${color.primary.blue500}`,
flexShrink: "0",
},
],

variants: {
size: {
small: {
width: "5.8rem",
minWidth: "5.8rem",
height: "3.6rem",
},
large: {
width: "8.2rem",
minWidth: "8.2rem",
height: "4rem",
},
},
Expand Down
52 changes: 52 additions & 0 deletions src/common/component/DropDownText/DropDownText.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { color, font, semanticColor } from "@style/styles.css";
import { style } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";

export const dropdownTextWrapper = style({
display: "flex",
width: "100%",
flexDirection: "column",
});

export const dropdownText = style([
font.body01,
{
display: "flex",
width: "100%",
height: "44px",
padding: "12px 8px",
alignItems: "flex-start",
gap: "16px",
color: semanticColor.text.normal,
borderBottom: `1px solid ${color.gray.gray100}`,
},
]);

export const dropdownContent = style({
display: "flex",
padding: "0.8rem",
width: "100%",
flexDirection: "row",
justifyContent: "flex-start",
gap: "1rem",
alignSelf: "stretch",
backgroundColor: semanticColor.neutral.strong,

flexWrap: "wrap",
});

export const rotateIcon = recipe({
base: {
//transition: "transform 0.3s ease",
},
variants: {
isOpen: {
true: {
transform: "rotate(0deg)",
},
false: {
transform: "rotate(180deg)",
},
},
},
});
Loading
Loading