From ccbf837eaa8a5d45534bd3929eae2303d0f66ec4 Mon Sep 17 00:00:00 2001 From: lydiacho Date: Sat, 1 Jun 2024 13:17:55 +0900 Subject: [PATCH 01/17] =?UTF-8?q?feat:=20Callout=20=EC=9E=91=EC=97=85=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/Callout/Callout.tsx | 5 +++++ packages/ui/Callout/index.tsx | 1 + packages/ui/Callout/style.css.ts | 0 3 files changed, 6 insertions(+) create mode 100644 packages/ui/Callout/Callout.tsx create mode 100644 packages/ui/Callout/index.tsx create mode 100644 packages/ui/Callout/style.css.ts diff --git a/packages/ui/Callout/Callout.tsx b/packages/ui/Callout/Callout.tsx new file mode 100644 index 0000000..7f2a146 --- /dev/null +++ b/packages/ui/Callout/Callout.tsx @@ -0,0 +1,5 @@ +function Callout() { + return
Callout
; +} + +export default Callout; diff --git a/packages/ui/Callout/index.tsx b/packages/ui/Callout/index.tsx new file mode 100644 index 0000000..68a8991 --- /dev/null +++ b/packages/ui/Callout/index.tsx @@ -0,0 +1 @@ +export { default } from "./Callout"; diff --git a/packages/ui/Callout/style.css.ts b/packages/ui/Callout/style.css.ts new file mode 100644 index 0000000..e69de29 From ab99352406a557c8fae250f5d7302ae820d00087 Mon Sep 17 00:00:00 2001 From: lydiacho Date: Mon, 3 Jun 2024 18:14:43 +0900 Subject: [PATCH 02/17] =?UTF-8?q?design:=20Callout=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EA=B8=B0=EB=B3=B8=20=EC=8A=A4=ED=83=80?= =?UTF-8?q?=EC=9D=BC=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/Callout/Callout.tsx | 12 +++++++++++- packages/ui/Callout/style.css.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/ui/Callout/Callout.tsx b/packages/ui/Callout/Callout.tsx index 7f2a146..4b23b19 100644 --- a/packages/ui/Callout/Callout.tsx +++ b/packages/ui/Callout/Callout.tsx @@ -1,5 +1,15 @@ +import { IconAlertCircle, IconInfoCircle } from "@sopt-makers/icons"; +import { blueIcon, callout, redIcon, text, yellowIcon } from "./style.css"; + function Callout() { - return
Callout
; + return ( + + ); } export default Callout; diff --git a/packages/ui/Callout/style.css.ts b/packages/ui/Callout/style.css.ts index e69de29..b1d2c00 100644 --- a/packages/ui/Callout/style.css.ts +++ b/packages/ui/Callout/style.css.ts @@ -0,0 +1,30 @@ +import { style } from "@vanilla-extract/css"; +import theme from "../theme.css"; + +export const callout = style({ + display: "flex", + gap: "10px", + padding: "14px 18px", + + border: `1px solid ${theme.colors.red600}`, + borderRadius: "10px", + backgroundColor: theme.colors.redAlpha100, +}); + +export const text = style({ + ...theme.fontsObject.BODY_3_14_M, + color: theme.colors.gray30, +}); + +export const redIcon = style({ + width: 20, + color: theme.colors.red500, +}); +export const blueIcon = style({ + width: 20, + color: theme.colors.blue500, +}); +export const yellowIcon = style({ + width: 20, + color: theme.colors.yellow600, +}); From 4de935a9d19c411bdbf06f0deeb9d4b30f75cf99 Mon Sep 17 00:00:00 2001 From: lydiacho Date: Mon, 3 Jun 2024 19:48:20 +0900 Subject: [PATCH 03/17] =?UTF-8?q?feat:=20constants(=EC=BD=9C=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=83=89=EC=83=81=EB=B3=84=20=ED=83=80=EC=9E=85),?= =?UTF-8?q?=20types=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/Callout/constants.ts | 20 ++++++++++++++++++++ packages/ui/Callout/types.ts | 1 + 2 files changed, 21 insertions(+) create mode 100644 packages/ui/Callout/constants.ts create mode 100644 packages/ui/Callout/types.ts diff --git a/packages/ui/Callout/constants.ts b/packages/ui/Callout/constants.ts new file mode 100644 index 0000000..4401681 --- /dev/null +++ b/packages/ui/Callout/constants.ts @@ -0,0 +1,20 @@ +import theme from "../theme.css"; +import type { CalloutType } from "./types"; + +export const borderColors: Record = { + danger: theme.colors.red600, + information: theme.colors.blueAlpha600, + warning: theme.colors.yellow600, +}; + +export const backgroundColor: Record = { + danger: theme.colors.redAlpha100, + information: theme.colors.blueAlpha100, + warning: "rgba(255,194,52,0.1)", +}; + +export const iconColor: Record = { + danger: theme.colors.red500, + information: theme.colors.blue500, + warning: theme.colors.yellow500, +}; diff --git a/packages/ui/Callout/types.ts b/packages/ui/Callout/types.ts new file mode 100644 index 0000000..887157f --- /dev/null +++ b/packages/ui/Callout/types.ts @@ -0,0 +1 @@ +export type CalloutType = "danger" | "information" | "warning"; From 82b6b0c7517cf759394374788d6414649c04647d Mon Sep 17 00:00:00 2001 From: lydiacho Date: Mon, 3 Jun 2024 23:36:54 +0900 Subject: [PATCH 04/17] =?UTF-8?q?feat:=20Icon=20=ED=83=80=EC=9E=85?= =?UTF-8?q?=EB=B3=84=20=EC=A1=B0=EA=B1=B4=EB=B6=80=20=EB=A0=8C=EB=8D=94?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/Callout/Callout.tsx | 32 +++++++++++++++++++++++++------ packages/ui/Callout/constants.ts | 2 +- packages/ui/Callout/style.css.ts | 33 +++++++++++++++++++++----------- 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/packages/ui/Callout/Callout.tsx b/packages/ui/Callout/Callout.tsx index 4b23b19..a45e488 100644 --- a/packages/ui/Callout/Callout.tsx +++ b/packages/ui/Callout/Callout.tsx @@ -1,13 +1,33 @@ import { IconAlertCircle, IconInfoCircle } from "@sopt-makers/icons"; -import { blueIcon, callout, redIcon, text, yellowIcon } from "./style.css"; +import { callout, icon, sprinkles, text } from "./style.css"; +import type { CalloutType } from "./types"; + +const icons = { + danger: IconAlertCircle, + information: IconInfoCircle, + warning: IconInfoCircle, +}; +interface CalloutProps { + type: CalloutType; + isIcon?: boolean; +} + +function Callout({ type, isIcon }: CalloutProps) { + const Icon = icons[type]; -function Callout() { return ( ); } diff --git a/packages/ui/Callout/constants.ts b/packages/ui/Callout/constants.ts index 4401681..e573a2e 100644 --- a/packages/ui/Callout/constants.ts +++ b/packages/ui/Callout/constants.ts @@ -1,7 +1,7 @@ import theme from "../theme.css"; import type { CalloutType } from "./types"; -export const borderColors: Record = { +export const borderColor: Record = { danger: theme.colors.red600, information: theme.colors.blueAlpha600, warning: theme.colors.yellow600, diff --git a/packages/ui/Callout/style.css.ts b/packages/ui/Callout/style.css.ts index b1d2c00..3fbd8cc 100644 --- a/packages/ui/Callout/style.css.ts +++ b/packages/ui/Callout/style.css.ts @@ -1,30 +1,41 @@ import { style } from "@vanilla-extract/css"; +import { createSprinkles, defineProperties } from "@vanilla-extract/sprinkles"; import theme from "../theme.css"; +import { backgroundColor, borderColor, iconColor } from "./constants"; +// sprinkles +const calloutProperties = defineProperties({ + properties: { + borderColor, + backgroundColor, + }, +}); +const iconProperties = defineProperties({ + properties: { + color: iconColor, + }, +}); +export const sprinkles = createSprinkles(calloutProperties, iconProperties); + +// styles export const callout = style({ display: "flex", gap: "10px", + alignItems: "flex-start", padding: "14px 18px", - border: `1px solid ${theme.colors.red600}`, + border: "1px solid", + borderColor: theme.colors.red600, borderRadius: "10px", backgroundColor: theme.colors.redAlpha100, }); export const text = style({ + textAlign: "left", ...theme.fontsObject.BODY_3_14_M, color: theme.colors.gray30, }); -export const redIcon = style({ - width: 20, - color: theme.colors.red500, -}); -export const blueIcon = style({ - width: 20, - color: theme.colors.blue500, -}); -export const yellowIcon = style({ +export const icon = style({ width: 20, - color: theme.colors.yellow600, }); From 14dc3772a17856041f8d80965045510dce5dd2a4 Mon Sep 17 00:00:00 2001 From: lydiacho Date: Tue, 4 Jun 2024 00:03:47 +0900 Subject: [PATCH 05/17] =?UTF-8?q?feat:=20bd/border=20Color=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=EB=B6=80=20=EB=A0=8C=EB=8D=94=EB=A7=81=20-=20not=20wo?= =?UTF-8?q?rking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/Callout/Callout.tsx | 7 ++++++- packages/ui/Callout/style.css.ts | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/ui/Callout/Callout.tsx b/packages/ui/Callout/Callout.tsx index a45e488..798e4a3 100644 --- a/packages/ui/Callout/Callout.tsx +++ b/packages/ui/Callout/Callout.tsx @@ -16,7 +16,12 @@ function Callout({ type, isIcon }: CalloutProps) { const Icon = icons[type]; return ( -