@cashdoc/cashdoc-cms-design-system 1.3.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +12 -1
  2. package/dist/index.es.js +4033 -3888
  3. package/dist/index.es.js.map +1 -1
  4. package/dist/index.umd.js +26 -26
  5. package/dist/index.umd.js.map +1 -1
  6. package/dist/src/components/Button/Button.d.ts +5 -3
  7. package/dist/src/components/Checkbox/Checkbox.d.ts +6 -3
  8. package/dist/src/components/DatePicker/DatePicker.d.ts +2 -2
  9. package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +4 -4
  10. package/dist/src/components/Dropdown/Combobox.d.ts +7 -3
  11. package/dist/src/components/Dropdown/Dropdown.d.ts +21 -5
  12. package/dist/src/components/Dropdown/Select.d.ts +8 -3
  13. package/dist/src/components/FileUpload/FileUpload.d.ts +2 -2
  14. package/dist/src/components/ImageUpload/ImageUpload.d.ts +4 -4
  15. package/dist/src/components/LoadingCircle/LoadingCircle.d.ts +2 -2
  16. package/dist/src/components/Modal/ConfirmModal.d.ts +2 -2
  17. package/dist/src/components/Modal/DeleteModal.d.ts +2 -2
  18. package/dist/src/components/Modal/ErrorModal.d.ts +2 -2
  19. package/dist/src/components/Modal/Modal.d.ts +2 -2
  20. package/dist/src/components/Modal/SuccessModal.d.ts +2 -2
  21. package/dist/src/components/Modal/WarningModal.d.ts +2 -2
  22. package/dist/src/components/Pagination/Pagination.d.ts +2 -2
  23. package/dist/src/components/Popover/PopoverMenuItem.d.ts +7 -3
  24. package/dist/src/components/RadioButton/RadioButton.d.ts +5 -3
  25. package/dist/src/components/SideNavigation/SideNavigation.d.ts +6 -6
  26. package/dist/src/components/Switch/Switch.d.ts +56 -4
  27. package/dist/src/components/Table/Table.d.ts +49 -24
  28. package/dist/src/components/TagInput/TagInput.d.ts +20 -3
  29. package/dist/src/components/Text/Text.d.ts +10 -3
  30. package/dist/src/components/TextInput/TextInput.d.ts +15 -3
  31. package/dist/src/components/TimePicker/TimePicker.d.ts +2 -2
  32. package/dist/src/components/ToolTip/ToolTip.d.ts +28 -3
  33. package/dist/src/components/icons/index.d.ts +3 -3
  34. package/dist/style.css +1 -1
  35. package/package.json +15 -12
@@ -2,8 +2,7 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import { ButtonHTMLAttributes } from 'react';
3
3
  import { buttonVariants } from './variants';
4
4
 
5
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
6
- }
5
+ export type ButtonProps = {} & ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>;
7
6
  /**
8
7
  * 사용자의 클릭 동작을 통해 특정 액션을 실행하거나 페이지를 이동시키는 기본적인 컴포넌트입니다.
9
8
  *
@@ -109,5 +108,8 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Va
109
108
  * ## 참고사진
110
109
  * ![](https://raw.githubusercontent.com/AlmSmartDoctor/ccds-screenshots/main/screenshots/Forms/Button/For%20Jsdoc.png?raw=true)
111
110
  */
112
- declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
111
+ declare const Button: import('react').ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
112
+ variant?: "default" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
113
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
114
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & import('react').RefAttributes<HTMLButtonElement>>;
113
115
  export { Button };
@@ -1,10 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
 
3
3
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
- export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
4
+ export type CheckboxProps = {
5
5
  label?: string;
6
6
  id?: string;
7
- }
7
+ } & React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;
8
8
  /**
9
9
  * 사용자가 여러 옵션 중 하나 이상을 선택하거나, 특정 항목의 활성화 상태를 제어할 때 사용하는 컴포넌트입니다.
10
10
  *
@@ -87,4 +87,7 @@ export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof Che
87
87
  * ## 참고사진
88
88
  * ![](https://raw.githubusercontent.com/AlmSmartDoctor/ccds-screenshots/main/screenshots/Forms/Checkbox/For%20Jsdoc.png)
89
89
  */
90
- export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
90
+ export declare const Checkbox: React.ForwardRefExoticComponent<{
91
+ label?: string;
92
+ id?: string;
93
+ } & Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface DatePickerProps {
3
+ export type DatePickerProps = {
4
4
  value?: string;
5
5
  onChange?: (date: string) => void;
6
6
  label?: string;
@@ -12,7 +12,7 @@ export interface DatePickerProps {
12
12
  errorMessage?: string;
13
13
  helperText?: string;
14
14
  className?: string;
15
- }
15
+ };
16
16
  /**
17
17
  * 사용자가 달력 인터페이스를 통해 특정 날짜를 선택할 수 있게 하는 컴포넌트입니다.
18
18
  *
@@ -1,16 +1,16 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface DateRange {
3
+ export type DateRange = {
4
4
  start: string;
5
5
  end: string;
6
- }
7
- export interface DateRangePickerProps {
6
+ };
7
+ export type DateRangePickerProps = {
8
8
  value?: DateRange;
9
9
  onChange?: (range: DateRange) => void;
10
10
  startLabel?: string;
11
11
  endLabel?: string;
12
12
  className?: string;
13
- }
13
+ };
14
14
  /**
15
15
  * 사용자가 특정 기간(시작일과 종료일)을 선택할 수 있게 하는 컴포넌트입니다.
16
16
  *
@@ -1,10 +1,10 @@
1
1
  import { DropdownProps } from './Dropdown';
2
2
 
3
- export interface ComboboxProps extends Omit<DropdownProps, "searchable"> {
3
+ export type ComboboxProps = {
4
4
  loading?: boolean;
5
5
  createable?: boolean;
6
6
  onCreateOption?: (value: string) => void;
7
- }
7
+ } & Omit<DropdownProps, "searchable">;
8
8
  /**
9
9
  * 텍스트 입력과 드롭다운 선택 기능이 결합되어, 목록에서 검색하거나 새로운 옵션을 생성할 수 있는 컴포넌트입니다.
10
10
  *
@@ -83,4 +83,8 @@ export interface ComboboxProps extends Omit<DropdownProps, "searchable"> {
83
83
  * - {@link TagInput}, 여러 개의 값을 검색하여 추가해야 할 때
84
84
  * - {@link TextInput}, 단순한 텍스트 입력만 필요한 경우
85
85
  */
86
- export declare const Combobox: import('react').ForwardRefExoticComponent<ComboboxProps & import('react').RefAttributes<HTMLButtonElement>>;
86
+ export declare const Combobox: import('react').ForwardRefExoticComponent<{
87
+ loading?: boolean;
88
+ createable?: boolean;
89
+ onCreateOption?: (value: string) => void;
90
+ } & Omit<DropdownProps, "searchable"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,13 +1,13 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { dropdownTriggerVariants } from './variants';
3
3
 
4
- export interface DropdownOption {
4
+ export type DropdownOption = {
5
5
  value: string;
6
6
  label: string;
7
7
  disabled?: boolean;
8
8
  children?: DropdownOption[];
9
- }
10
- export interface DropdownProps extends VariantProps<typeof dropdownTriggerVariants> {
9
+ };
10
+ export type DropdownProps = {
11
11
  options: DropdownOption[];
12
12
  value?: string;
13
13
  placeholder?: string;
@@ -20,7 +20,7 @@ export interface DropdownProps extends VariantProps<typeof dropdownTriggerVarian
20
20
  multiple?: boolean;
21
21
  maxHeight?: number;
22
22
  defaultOpen?: boolean;
23
- }
23
+ } & VariantProps<typeof dropdownTriggerVariants>;
24
24
  /**
25
25
  * 사용자가 목록에서 하나 또는 여러 개의 옵션을 선택할 수 있게 하는 컴포넌트입니다.
26
26
  *
@@ -105,4 +105,20 @@ export interface DropdownProps extends VariantProps<typeof dropdownTriggerVarian
105
105
  * ## 참고사진
106
106
  * ![](https://raw.githubusercontent.com/AlmSmartDoctor/ccds-screenshots/main/screenshots/Forms/Dropdown/For%20Jsdoc.png?raw=true)
107
107
  */
108
- export declare const Dropdown: import('react').ForwardRefExoticComponent<DropdownProps & import('react').RefAttributes<HTMLButtonElement>>;
108
+ export declare const Dropdown: import('react').ForwardRefExoticComponent<{
109
+ options: DropdownOption[];
110
+ value?: string;
111
+ placeholder?: string;
112
+ onValueChange?: (value: string) => void;
113
+ disabled?: boolean;
114
+ className?: string;
115
+ dropdownClassName?: string;
116
+ searchable?: boolean;
117
+ clearable?: boolean;
118
+ multiple?: boolean;
119
+ maxHeight?: number;
120
+ defaultOpen?: boolean;
121
+ } & VariantProps<(props?: ({
122
+ variant?: "default" | "outline" | "ghost" | null | undefined;
123
+ size?: "default" | "sm" | "lg" | null | undefined;
124
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,11 +1,11 @@
1
1
  import { DropdownProps } from './Dropdown';
2
2
 
3
- export interface SelectProps extends Omit<DropdownProps, "multiple" | "searchable" | "clearable"> {
3
+ export type SelectProps = {
4
4
  label?: string;
5
5
  helperText?: string;
6
6
  error?: string;
7
7
  required?: boolean;
8
- }
8
+ } & Omit<DropdownProps, "multiple" | "searchable" | "clearable">;
9
9
  /**
10
10
  * 사용자에게 레이블, 도움말, 에러 메시지와 함께 단일 선택 드롭다운을 제공하는 컴포넌트입니다.
11
11
  *
@@ -84,4 +84,9 @@ export interface SelectProps extends Omit<DropdownProps, "multiple" | "searchabl
84
84
  * - {@link TextInput}, 텍스트 직접 입력이 필요한 경우
85
85
  * - {@link RadioButton}, 옵션이 적고 한눈에 보여야 하는 경우
86
86
  */
87
- export declare const Select: import('react').ForwardRefExoticComponent<SelectProps & import('react').RefAttributes<HTMLButtonElement>>;
87
+ export declare const Select: import('react').ForwardRefExoticComponent<{
88
+ label?: string;
89
+ helperText?: string;
90
+ error?: string;
91
+ required?: boolean;
92
+ } & Omit<DropdownProps, "searchable" | "clearable" | "multiple"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,6 +1,6 @@
1
1
  import { Accept } from 'react-dropzone';
2
2
 
3
- export interface FileUploadProps {
3
+ export type FileUploadProps = {
4
4
  value?: File[];
5
5
  onChange?: (files: File[]) => void;
6
6
  maxFiles?: number;
@@ -9,7 +9,7 @@ export interface FileUploadProps {
9
9
  disabled?: boolean;
10
10
  className?: string;
11
11
  onError?: (error: string) => void;
12
- }
12
+ };
13
13
  /**
14
14
  * 드래그 앤 드롭 및 클릭을 통해 파일을 업로드할 수 있는 컴포넌트입니다.
15
15
  *
@@ -1,12 +1,12 @@
1
1
  import { Accept } from 'react-dropzone';
2
2
 
3
- export interface ImageMetadata {
3
+ export type ImageMetadata = {
4
4
  width: number;
5
5
  height: number;
6
6
  aspectRatio: number;
7
7
  size: number;
8
- }
9
- export interface ImageUploadProps {
8
+ };
9
+ export type ImageUploadProps = {
10
10
  value?: File[];
11
11
  onChange?: (files: File[]) => void;
12
12
  maxFiles?: number;
@@ -20,7 +20,7 @@ export interface ImageUploadProps {
20
20
  validateImage?: (file: File, metadata: ImageMetadata) => string | null | Promise<string | null>;
21
21
  placeholder?: string;
22
22
  placeholderActive?: string;
23
- }
23
+ };
24
24
  /**
25
25
  * 드래그 앤 드롭 및 클릭을 통해 이미지를 업로드할 수 있는 컴포넌트입니다.
26
26
  *
@@ -1,7 +1,7 @@
1
- interface LoadingCircleProps {
1
+ type LoadingCircleProps = {
2
2
  size?: "sm" | "md" | "lg";
3
3
  className?: string;
4
- }
4
+ };
5
5
  /**
6
6
  * 시스템이 데이터를 처리 중이거나 다음 화면을 준비 중임을 시각적으로 나타내는 인디케이터입니다.
7
7
  *
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface ConfirmModalProps {
3
+ export type ConfirmModalProps = {
4
4
  open: boolean;
5
5
  onOpenChange: (open: boolean) => void;
6
6
  title?: string;
@@ -8,7 +8,7 @@ export interface ConfirmModalProps {
8
8
  confirmText?: string;
9
9
  onConfirm?: () => void;
10
10
  className?: string;
11
- }
11
+ };
12
12
  /**
13
13
  * 사용자에게 특정 작업에 대한 최종 확인을 받기 위한 단순화된 모달 컴포넌트입니다.
14
14
  *
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface DeleteModalProps {
3
+ export type DeleteModalProps = {
4
4
  open: boolean;
5
5
  onOpenChange: (open: boolean) => void;
6
6
  title?: string;
@@ -10,7 +10,7 @@ export interface DeleteModalProps {
10
10
  onConfirm: () => void;
11
11
  onCancel?: () => void;
12
12
  className?: string;
13
- }
13
+ };
14
14
  /**
15
15
  * 데이터를 삭제하거나 영구적인 작업을 수행하기 전, 사용자의 최종 승인을 받기 위한 경고 모달입니다.
16
16
  *
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface ErrorModalProps {
3
+ export type ErrorModalProps = {
4
4
  open: boolean;
5
5
  onOpenChange: (open: boolean) => void;
6
6
  title?: string;
@@ -8,7 +8,7 @@ export interface ErrorModalProps {
8
8
  confirmText?: string;
9
9
  onConfirm?: () => void;
10
10
  className?: string;
11
- }
11
+ };
12
12
  /**
13
13
  * 시스템 오류나 사용자의 잘못된 조작으로 인해 작업이 실패했음을 알리는 모달입니다.
14
14
  *
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface ModalProps {
3
+ export type ModalProps = {
4
4
  open: boolean;
5
5
  onOpenChange: (open: boolean) => void;
6
6
  icon?: React.ReactNode;
@@ -10,7 +10,7 @@ export interface ModalProps {
10
10
  className?: string;
11
11
  showCloseButton?: boolean;
12
12
  size?: "sm" | "md" | "lg";
13
- }
13
+ };
14
14
  /**
15
15
  * 사용자에게 중요한 정보를 표시하거나 입력을 요구하는 오버레이 대화상자입니다.
16
16
  *
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface SuccessModalProps {
3
+ export type SuccessModalProps = {
4
4
  open: boolean;
5
5
  onOpenChange: (open: boolean) => void;
6
6
  title?: string;
@@ -8,7 +8,7 @@ export interface SuccessModalProps {
8
8
  confirmText?: string;
9
9
  onConfirm?: () => void;
10
10
  className?: string;
11
- }
11
+ };
12
12
  /**
13
13
  * 요청한 작업이 성공적으로 완료되었음을 축하하거나 알리는 모달입니다.
14
14
  *
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface WarningModalProps {
3
+ export type WarningModalProps = {
4
4
  open: boolean;
5
5
  onOpenChange: (open: boolean) => void;
6
6
  title?: string;
@@ -10,7 +10,7 @@ export interface WarningModalProps {
10
10
  cancelText?: string;
11
11
  onCancel?: () => void;
12
12
  className?: string;
13
- }
13
+ };
14
14
  /**
15
15
  * 잠재적인 문제를 경고하거나 주의가 필요한 작업을 수행하기 전 사용자의 동의를 구하는 모달입니다.
16
16
  *
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface PaginationProps {
3
+ export type PaginationProps = {
4
4
  currentPage: number;
5
5
  totalPages: number;
6
6
  onPageChange: (page: number) => void;
@@ -8,7 +8,7 @@ export interface PaginationProps {
8
8
  showPrevNext?: boolean;
9
9
  disabled?: boolean;
10
10
  className?: string;
11
- }
11
+ };
12
12
  /**
13
13
  * 사용자가 여러 페이지로 나뉜 콘텐츠를 탐색할 수 있게 하는 페이지네이션 컴포넌트입니다.
14
14
  *
@@ -2,9 +2,9 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import { ButtonHTMLAttributes } from 'react';
3
3
  import { popoverMenuItemVariants } from './variants';
4
4
 
5
- export interface PopoverMenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof popoverMenuItemVariants> {
5
+ export type PopoverMenuItemProps = {
6
6
  icon?: React.ReactNode;
7
- }
7
+ } & ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof popoverMenuItemVariants>;
8
8
  /**
9
9
  * Popover 내부에 배치되는 개별 액션 항목 컴포넌트입니다.
10
10
  *
@@ -30,5 +30,9 @@ export interface PopoverMenuItemProps extends ButtonHTMLAttributes<HTMLButtonEle
30
30
  * </PopoverContent>
31
31
  * ```
32
32
  */
33
- declare const PopoverMenuItem: import('react').ForwardRefExoticComponent<PopoverMenuItemProps & import('react').RefAttributes<HTMLButtonElement>>;
33
+ declare const PopoverMenuItem: import('react').ForwardRefExoticComponent<{
34
+ icon?: React.ReactNode;
35
+ } & ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
36
+ variant?: "default" | "destructive" | null | undefined;
37
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & import('react').RefAttributes<HTMLButtonElement>>;
34
38
  export { PopoverMenuItem };
@@ -81,7 +81,9 @@ declare const radioGroupItemVariants: (props?: ({
81
81
  variant?: "default" | "green" | "black" | "blue" | "red" | null | undefined;
82
82
  size?: "sm" | "lg" | "md" | null | undefined;
83
83
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
84
- export interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitives.Item>, VariantProps<typeof radioGroupItemVariants> {
85
- }
86
- declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
84
+ export type RadioGroupItemProps = {} & React.ComponentPropsWithoutRef<typeof RadioGroupPrimitives.Item> & VariantProps<typeof radioGroupItemVariants>;
85
+ declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitives.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
86
+ variant?: "default" | "green" | "black" | "blue" | "red" | null | undefined;
87
+ size?: "sm" | "lg" | "md" | null | undefined;
88
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
87
89
  export { RadioGroup, RadioGroupItem };
@@ -1,23 +1,23 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export interface SubMenuItem {
3
+ export type SubMenuItem = {
4
4
  url: string;
5
5
  title: string;
6
- }
7
- export interface MenuItem {
6
+ };
7
+ export type MenuItem = {
8
8
  url: string;
9
9
  title: string;
10
10
  icon?: React.ReactNode;
11
11
  subMenu?: SubMenuItem[];
12
- }
13
- export interface SideNavigationProps {
12
+ };
13
+ export type SideNavigationProps = {
14
14
  title?: string;
15
15
  menus: MenuItem[];
16
16
  selectedUrl: string;
17
17
  onMenuClick: (url: string) => void;
18
18
  headerSlot?: React.ReactNode;
19
19
  className?: string;
20
- }
20
+ };
21
21
  /**
22
22
  * 어플리케이션의 주요 섹션 간 이동을 담당하는 왼쪽 사이드바 메뉴 컴포넌트입니다.
23
23
  *
@@ -5,8 +5,23 @@ import * as SwitchPrimitives from "@radix-ui/react-switch";
5
5
  declare const switchVariants: (props?: ({
6
6
  variant?: "default" | "green" | "black" | "blue" | "red" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
- export interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>, VariantProps<typeof switchVariants> {
9
- }
8
+ export type SwitchProps = {
9
+ /**
10
+ * 스위치 트랙의 가로 길이입니다.
11
+ * - `number` 입력 시 px 단위로 처리됩니다. (예: `96`)
12
+ * - `string` 입력 시 CSS 길이값으로 처리됩니다. (예: `8rem`, `120px`)
13
+ * - 최소 길이는 기본 크기(40px)입니다.
14
+ */
15
+ width?: number | string;
16
+ /**
17
+ * 스위치가 켜짐(`checked`) 상태일 때, thumb 반대편(왼쪽 빈 영역)에 표시할 텍스트입니다.
18
+ */
19
+ checkedLabel?: React.ReactNode;
20
+ /**
21
+ * 스위치가 꺼짐(`unchecked`) 상태일 때, thumb 반대편(오른쪽 빈 영역)에 표시할 텍스트입니다.
22
+ */
23
+ uncheckedLabel?: React.ReactNode;
24
+ } & React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & VariantProps<typeof switchVariants>;
10
25
  /**
11
26
  * 두 가지 상반된 상태(On/Off, 활성/비활성)를 즉각적으로 전환할 때 사용하는 컴포넌트입니다.
12
27
  *
@@ -31,13 +46,22 @@ export interface SwitchProps extends React.ComponentPropsWithoutRef<typeof Switc
31
46
  *
32
47
  * - **Inline Component**: 주변 텍스트나 다른 요소와 자연스럽게 어우러지는 인라인 블록 형태입니다.
33
48
  * - **Thumb Animation**: 클릭 시 스위치의 '손잡이(Thumb)'가 부드럽게 좌우로 이동하며 상태 변화를 시각화합니다.
49
+ * - **Adjustable Width**: `width` prop으로 가로 길이를 확장할 수 있으며, 높이(24px)와 thumb 크기(20px)는 고정됩니다.
50
+ * - **Inner State Label**: `checkedLabel`, `uncheckedLabel`을 사용하면 스위치 내부 빈 영역에 상태 텍스트를 표시할 수 있습니다.
51
+ *
52
+ * ## Props (확장 기능)
53
+ *
54
+ * - **width**: 스위치 가로 길이 (`number | string`)
55
+ * - **checkedLabel**: 켜짐 상태에서 왼쪽 빈 영역에 표시할 텍스트 (`ReactNode`)
56
+ * - **uncheckedLabel**: 꺼짐 상태에서 오른쪽 빈 영역에 표시할 텍스트 (`ReactNode`)
34
57
  *
35
58
  * ## Usage guidelines
36
59
  *
37
60
  * ### ✅ Do (권장 사항)
38
61
  *
39
62
  * - **명확한 현재 상태 표시**: 색상 변화(회색 vs 색상)를 통해 켜져 있는지 꺼져 있는지 한눈에 알 수 있게 하세요.
40
- * - **레이블과 함께 사용**: 스위치 옆에 무엇을 제어하는지 설명하는 텍스트를 반드시 배치하세요.
63
+ * - **문맥 레이블 제공**: 스위치가 무엇을 제어하는지 외부 레이블(스위치 텍스트) 또는 내부 상태 텍스트로 명확히 표현하세요.
64
+ * - **텍스트 길이에 맞는 폭 사용**: `checkedLabel`과 `uncheckedLabel` 길이를 고려해 `width` 값을 지정하세요.
41
65
  *
42
66
  * ### 🚫 Don't (주의/금지 사항)
43
67
  *
@@ -60,6 +84,16 @@ export interface SwitchProps extends React.ComponentPropsWithoutRef<typeof Switc
60
84
  * <label htmlFor="airplane-mode">비행기 모드</label>
61
85
  * </div>
62
86
  * ```
87
+ *
88
+ * 내부 상태 텍스트와 가변 길이를 사용하는 스위치:
89
+ *
90
+ * ```tsx
91
+ * <Switch
92
+ * width={96}
93
+ * checkedLabel="노출"
94
+ * uncheckedLabel="미노출"
95
+ * />
96
+ * ```
63
97
  * {@end-tool}
64
98
  *
65
99
  * See also:
@@ -70,5 +104,23 @@ export interface SwitchProps extends React.ComponentPropsWithoutRef<typeof Switc
70
104
  * ## 참고사진
71
105
  * ![](https://raw.githubusercontent.com/AlmSmartDoctor/ccds-screenshots/main/screenshots/Forms/Switch/For%20Jsdoc.png?raw=true)
72
106
  */
73
- declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
107
+ declare const Switch: React.ForwardRefExoticComponent<{
108
+ /**
109
+ * 스위치 트랙의 가로 길이입니다.
110
+ * - `number` 입력 시 px 단위로 처리됩니다. (예: `96`)
111
+ * - `string` 입력 시 CSS 길이값으로 처리됩니다. (예: `8rem`, `120px`)
112
+ * - 최소 길이는 기본 크기(40px)입니다.
113
+ */
114
+ width?: number | string;
115
+ /**
116
+ * 스위치가 켜짐(`checked`) 상태일 때, thumb 반대편(왼쪽 빈 영역)에 표시할 텍스트입니다.
117
+ */
118
+ checkedLabel?: React.ReactNode;
119
+ /**
120
+ * 스위치가 꺼짐(`unchecked`) 상태일 때, thumb 반대편(오른쪽 빈 영역)에 표시할 텍스트입니다.
121
+ */
122
+ uncheckedLabel?: React.ReactNode;
123
+ } & Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
124
+ variant?: "default" | "green" | "black" | "blue" | "red" | null | undefined;
125
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
74
126
  export { Switch };