diff --git a/apps/timo-web/app/[locale]/(main)/settings/_components/account/SettingsCalendarDisconnectModal.tsx b/apps/timo-web/app/[locale]/(main)/settings/_components/account/SettingsCalendarDisconnectModal.tsx index ac26e8c0..31f6a9d8 100644 --- a/apps/timo-web/app/[locale]/(main)/settings/_components/account/SettingsCalendarDisconnectModal.tsx +++ b/apps/timo-web/app/[locale]/(main)/settings/_components/account/SettingsCalendarDisconnectModal.tsx @@ -1,7 +1,7 @@ "use client"; import timoTimerLogo from "@repo/timo-design-system/assets/images/logo/timo-timer.svg"; -import { ModalButton } from "@repo/timo-design-system/ui"; +import { Button } from "@repo/timo-design-system/ui"; import Image from "next/image"; import type { SettingsProfileLabels } from "@/app/[locale]/(main)/settings/_types/account/profile-type"; @@ -41,19 +41,27 @@ export const SettingsCalendarDisconnectModal = ({ {labels.calendarDisconnectConfirmDescription}

- +
); diff --git a/apps/timo-web/app/[locale]/(main)/settings/_containers/withdrawal/SettingsWithdrawModalContainer.tsx b/apps/timo-web/app/[locale]/(main)/settings/_containers/withdrawal/SettingsWithdrawModalContainer.tsx index 1f43dfba..4ae6e597 100644 --- a/apps/timo-web/app/[locale]/(main)/settings/_containers/withdrawal/SettingsWithdrawModalContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/settings/_containers/withdrawal/SettingsWithdrawModalContainer.tsx @@ -1,7 +1,7 @@ "use client"; import timoTimerLogo from "@repo/timo-design-system/assets/images/logo/timo-timer.svg"; -import { ModalButton } from "@repo/timo-design-system/ui"; +import { Button } from "@repo/timo-design-system/ui"; import Image from "next/image"; import { useTranslations } from "next-intl"; @@ -44,19 +44,27 @@ export const SettingsWithdrawModalContainer = ({ {t("withdrawConfirmDescription")}

- { onWithdraw(); onClose(); }} > {t("withdrawConfirmConfirm")} - - + +
); diff --git a/apps/timo-web/app/[locale]/onboarding/_components/OnboardingButton.tsx b/apps/timo-web/app/[locale]/onboarding/_components/OnboardingButton.tsx index 9c6a6a14..ef4cd131 100644 --- a/apps/timo-web/app/[locale]/onboarding/_components/OnboardingButton.tsx +++ b/apps/timo-web/app/[locale]/onboarding/_components/OnboardingButton.tsx @@ -1,9 +1,9 @@ import { - ChevronLeftIcon, - ChevronSmallRightIcon, + ChevronSmallLeftIcon, + ChevronSmallRightDisableIcon, ChevronSmallRightWhiteIcon, } from "@repo/timo-design-system/icons"; -import { cn } from "@repo/timo-design-system/utils"; +import { Button } from "@repo/timo-design-system/ui"; interface OnboardingButtonProps { variant: "next" | "prev" | "start"; @@ -22,71 +22,54 @@ export const OnboardingButton = ({ }: OnboardingButtonProps) => { if (variant === "prev") { return ( - + {label} + ); } + const isDisabled = disabled || !isActive; + if (variant === "start") { - // TODO: 원래 start 버튼 (항상 활성 스타일) — CalendarConnect 단계 재활성화 시 아래 주석 해제 후 isActive 분기 제거 - // return ( - // - // ); return ( - + {label} + ); } - const isDisabled = disabled || !isActive; - return ( - + {label} + ); }; diff --git a/apps/timo-web/components/tag/CreateTagModalContainer.tsx b/apps/timo-web/components/tag/CreateTagModalContainer.tsx index 6f9a77db..d275d044 100644 --- a/apps/timo-web/components/tag/CreateTagModalContainer.tsx +++ b/apps/timo-web/components/tag/CreateTagModalContainer.tsx @@ -1,7 +1,7 @@ "use client"; import { DeleteIcon } from "@repo/timo-design-system/icons"; -import { CreateButton, TagNameInput } from "@repo/timo-design-system/ui"; +import { Button, TagNameInput } from "@repo/timo-design-system/ui"; import { useTranslations } from "next-intl"; import { useState } from "react"; @@ -81,11 +81,16 @@ export const CreateTagModalContainer = ({
- + > + {t("createTagModal.create")} +
); diff --git a/apps/timo-web/components/timer/TimerCompleteModalPanel.tsx b/apps/timo-web/components/timer/TimerCompleteModalPanel.tsx index babed0f6..c80ff2ea 100644 --- a/apps/timo-web/components/timer/TimerCompleteModalPanel.tsx +++ b/apps/timo-web/components/timer/TimerCompleteModalPanel.tsx @@ -50,7 +50,7 @@ export const TimerCompleteModalPanel = ({ - + {t("completeButton")} diff --git a/apps/timo-web/components/timer/TimerEndModalPanel.tsx b/apps/timo-web/components/timer/TimerEndModalPanel.tsx index b2e57e0d..370284e5 100644 --- a/apps/timo-web/components/timer/TimerEndModalPanel.tsx +++ b/apps/timo-web/components/timer/TimerEndModalPanel.tsx @@ -1,5 +1,5 @@ import timoTimerLogo from "@repo/timo-design-system/assets/images/logo/timo-timer.svg"; -import { Modal, ModalButton } from "@repo/timo-design-system/ui"; +import { Button, Modal } from "@repo/timo-design-system/ui"; import Image from "next/image"; import { useTranslations } from "next-intl"; @@ -22,20 +22,24 @@ export const TimerEndModalPanel = ({ {t("title")} {t("description")} - {t("continueButton")} - - + ); diff --git a/apps/timo-web/components/timer/TimerExtendModalPanel.tsx b/apps/timo-web/components/timer/TimerExtendModalPanel.tsx index 8de4e4be..ca344fbd 100644 --- a/apps/timo-web/components/timer/TimerExtendModalPanel.tsx +++ b/apps/timo-web/components/timer/TimerExtendModalPanel.tsx @@ -1,5 +1,4 @@ -import { Modal, ModalButton } from "@repo/timo-design-system/ui"; -import { cn } from "@repo/timo-design-system/utils"; +import { Button, Modal } from "@repo/timo-design-system/ui"; import { useTranslations } from "next-intl"; import { extendTimerBodyExtendMinutesMax } from "@/generated/endpoints/timer/timer.zod"; @@ -20,8 +19,9 @@ const PRESET_OPTIONS: { { preset: 60, labelKey: "presetOneHour" }, ]; -const CHIP_FOCUS_BORDER_CLASS = - "border-2 border-transparent focus-visible:border-timo-blue-300 outline-none"; +const focusOnMount = (element: HTMLInputElement | null) => { + element?.focus(); +}; export interface TimerExtendModalPanelProps { selectedPreset: ExtendTimePreset | null; @@ -54,26 +54,23 @@ export const TimerExtendModalPanel = ({
{PRESET_OPTIONS.map(({ preset, labelKey }) => ( - + ))} {isCustomSelected ? ( -
+
) : ( - + )}
{canGoBack ? ( - {t("closeButton")} - + ) : ( - + {t("closeButton")} )} - + {t("submitButton")}
diff --git a/apps/timo-web/components/timer/TimerStopModalPanel.tsx b/apps/timo-web/components/timer/TimerStopModalPanel.tsx index 25f7c584..fd0d247a 100644 --- a/apps/timo-web/components/timer/TimerStopModalPanel.tsx +++ b/apps/timo-web/components/timer/TimerStopModalPanel.tsx @@ -1,5 +1,5 @@ import timoTimerLogo from "@repo/timo-design-system/assets/images/logo/timo-timer.svg"; -import { Modal, ModalButton } from "@repo/timo-design-system/ui"; +import { Button, Modal } from "@repo/timo-design-system/ui"; import Image from "next/image"; import { useTranslations } from "next-intl"; @@ -37,12 +37,16 @@ export const TimerStopModalPanel = ({ })} - - {t("continueButton")} - - + {t("continueButton")} + ); diff --git a/apps/timo-web/components/todo-modal/create/CreateTodoModalContent.tsx b/apps/timo-web/components/todo-modal/create/CreateTodoModalContent.tsx index 5bfffce9..32df142c 100644 --- a/apps/timo-web/components/todo-modal/create/CreateTodoModalContent.tsx +++ b/apps/timo-web/components/todo-modal/create/CreateTodoModalContent.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { DeleteIcon } from "@repo/timo-design-system/icons"; -import { CreateButton, TodoToolbar } from "@repo/timo-design-system/ui"; +import { Button, TodoToolbar } from "@repo/timo-design-system/ui"; import { useTranslations } from "next-intl"; import { useState } from "react"; import { useController, useForm } from "react-hook-form"; @@ -222,11 +222,16 @@ export const CreateTodoModalContent = ({ }} /> - + > + {t("createModal.create")} +
diff --git a/packages/timo-design-system/src/components/button/button/Button.stories.tsx b/packages/timo-design-system/src/components/button/button/Button.stories.tsx index 240eec39..d542ac72 100644 --- a/packages/timo-design-system/src/components/button/button/Button.stories.tsx +++ b/packages/timo-design-system/src/components/button/button/Button.stories.tsx @@ -144,6 +144,49 @@ export const WithRightIcon: Story = { ), }; +export const Pressed: Story = { + parameters: { controls: { disable: true } }, + render: () => ( +
+ + + + +
+ ), +}; + export const Layout: Story = { parameters: { controls: { disable: true } }, render: () => ( diff --git a/packages/timo-design-system/src/components/button/button/Button.tsx b/packages/timo-design-system/src/components/button/button/Button.tsx index 04c81eb8..581e2d7b 100644 --- a/packages/timo-design-system/src/components/button/button/Button.tsx +++ b/packages/timo-design-system/src/components/button/button/Button.tsx @@ -17,7 +17,7 @@ const BUTTON_VARIANTS: Record< "border-timo-blue-300 text-timo-blue-300 border bg-white disabled:border-timo-gray-500 disabled:text-timo-gray-700", }, secondary: { - fill: "bg-timo-gray-300 text-timo-gray-900 disabled:text-timo-gray-700", + fill: "bg-timo-gray-300 text-timo-gray-900 disabled:text-timo-gray-700 aria-pressed:border aria-pressed:border-timo-blue-300 aria-pressed:bg-white", outline: "border-timo-gray-500 text-timo-gray-900 border bg-white disabled:text-timo-gray-700", }, diff --git a/packages/timo-design-system/src/components/button/create-button/CreateButton.stories.tsx b/packages/timo-design-system/src/components/button/create-button/CreateButton.stories.tsx deleted file mode 100644 index 36f12114..00000000 --- a/packages/timo-design-system/src/components/button/create-button/CreateButton.stories.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { CreateButton } from "./CreateButton"; - -import type { Meta, StoryObj } from "@storybook/react"; - -const meta = { - title: "Components/CreateButton", - component: CreateButton, - parameters: { - layout: "centered", - }, - argTypes: { - label: { - control: "text", - description: "버튼에 표시될 텍스트", - table: { - type: { summary: "string" }, - }, - }, - disabled: { - control: "boolean", - description: "버튼 비활성화 여부", - table: { - type: { summary: "boolean" }, - defaultValue: { summary: "false" }, - }, - }, - }, -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: { label: "생성하기" }, -}; - -export const Disabled: Story = { - args: { label: "생성하기", disabled: true }, -}; diff --git a/packages/timo-design-system/src/components/button/create-button/CreateButton.tsx b/packages/timo-design-system/src/components/button/create-button/CreateButton.tsx deleted file mode 100644 index 1ae43d93..00000000 --- a/packages/timo-design-system/src/components/button/create-button/CreateButton.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { cn } from "../../../lib"; - -export interface CreateButtonProps { - label: string; - disabled?: boolean; - onClick?: () => void; -} - -export const CreateButton = ({ - label, - disabled = false, - onClick, -}: CreateButtonProps) => { - return ( - - ); -}; diff --git a/packages/timo-design-system/src/components/button/modal-button/ModalButton.stories.tsx b/packages/timo-design-system/src/components/button/modal-button/ModalButton.stories.tsx deleted file mode 100644 index bf575de2..00000000 --- a/packages/timo-design-system/src/components/button/modal-button/ModalButton.stories.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { ModalButton } from "./ModalButton"; - -import type { Meta, StoryObj } from "@storybook/react"; - -const meta = { - title: "Components/Button/ModalButton", - component: ModalButton, - parameters: { - layout: "centered", - }, - argTypes: { - variant: { control: "radio", options: ["fill", "border"] }, - onClick: { action: "clicked" }, - }, - args: { - variant: "fill", - children: "삭제하기", - }, -} satisfies Meta; - -export default meta; -type Story = StoryObj; - -export const AllStates: Story = { - parameters: { controls: { disable: true } }, - render: () => ( -
- 돌아가기 - 삭제하기 -
- ), -}; - -export const CustomWidth: Story = { - parameters: { controls: { disable: true } }, - render: () => ( -
- - 돌아가기 - - - 삭제하기 - -
- ), -}; diff --git a/packages/timo-design-system/src/components/button/modal-button/ModalButton.tsx b/packages/timo-design-system/src/components/button/modal-button/ModalButton.tsx deleted file mode 100644 index 22cb7e31..00000000 --- a/packages/timo-design-system/src/components/button/modal-button/ModalButton.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { cn } from "../../../lib"; - -import type { ButtonHTMLAttributes } from "react"; - -export type ModalButtonVariantTypes = "fill" | "border"; - -const MODAL_BUTTON_VARIANT: Record = { - fill: "bg-timo-blue-300 text-white focus-visible:ring-timo-blue-300 focus-visible:ring-2 focus-visible:ring-offset-2", - border: - "border border-timo-gray-500 text-timo-black focus-visible:border-timo-blue-300", -}; - -export interface ModalButtonProps extends ButtonHTMLAttributes { - variant: ModalButtonVariantTypes; -} - -export const ModalButton = ({ - variant, - className, - children, - ...rest -}: ModalButtonProps) => { - return ( - - ); -}; diff --git a/packages/timo-design-system/src/components/index.ts b/packages/timo-design-system/src/components/index.ts index 4e7cd294..b1120afc 100644 --- a/packages/timo-design-system/src/components/index.ts +++ b/packages/timo-design-system/src/components/index.ts @@ -10,7 +10,6 @@ export { PriorityIcon } from "./priority/priority-icon/PriorityIcon"; export { PrioritySelector } from "./priority/priority-selector/PrioritySelector"; export type { PriorityLevel } from "./priority/priority-selector/PrioritySelector"; export { Button } from "./button/button/Button"; -export { CreateButton } from "./button/create-button/CreateButton"; export { DeleteButton } from "./button/delete-button/DeleteButton"; export { AddTaskButton } from "./button/add-task-button/AddTaskButton"; export { TodayBadge } from "./badge/today-badge/TodayBadge"; @@ -19,7 +18,6 @@ export type { TogglePanelOption } from "./toggle-panel/TogglePanel"; export { PlayButton } from "./button/play-button/PlayButton"; export { TabButton } from "./button/tab-button/TabButton"; export { Toast } from "./toast/Toast"; -export { ModalButton } from "./button/modal-button/ModalButton"; export { Modal } from "./layout/modal/Modal"; export { SidebarButton } from "./button/sidebar-button/SidebarButton"; export { TodayButton } from "./button/today-button/TodayButton"; diff --git a/packages/timo-design-system/src/components/layout/modal/Modal.tsx b/packages/timo-design-system/src/components/layout/modal/Modal.tsx index 4c10ea60..c1e8d96c 100644 --- a/packages/timo-design-system/src/components/layout/modal/Modal.tsx +++ b/packages/timo-design-system/src/components/layout/modal/Modal.tsx @@ -15,7 +15,7 @@ import { import { createPortal } from "react-dom"; import { acquireModalStackIndex, cn, hasOpenFloatingLayer } from "../../../lib"; -import { ModalButton } from "../../button/modal-button/ModalButton"; +import { Button } from "../../button/button/Button"; // tailwind-config theme.css의 --z-index-modal-overlay/--z-index-modal-panel과 동일한 기준값이다. const BASE_OVERLAY_Z_INDEX = 40; @@ -232,20 +232,25 @@ export type ModalBorderButtonProps = ButtonHTMLAttributes; const ModalBorderButton = ({ onClick, className, + children, ...rest }: ModalBorderButtonProps) => { const { close } = useModalContext(); return ( - { onClick?.(e); close(); }} - className={cn("flex-1 px-0", className)} - /> + className={cn("flex-1", className)} + > + {children} + ); }; @@ -254,20 +259,25 @@ export type ModalFillButtonProps = ButtonHTMLAttributes; const ModalFillButton = ({ onClick, className, + children, ...rest }: ModalFillButtonProps) => { const { close } = useModalContext(); return ( - { onClick?.(e); close(); }} - className={cn("flex-1 px-0", className)} - /> + className={cn("flex-1", className)} + > + {children} + ); }; diff --git a/packages/timo-design-system/src/icons/source/chevron-small-right-disable.svg b/packages/timo-design-system/src/icons/source/chevron-small-right-disable.svg new file mode 100644 index 00000000..3f724b29 --- /dev/null +++ b/packages/timo-design-system/src/icons/source/chevron-small-right-disable.svg @@ -0,0 +1,3 @@ + + +