@cashdoc/cashdoc-cms-design-system 1.0.12
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.
- package/README.md +125 -0
- package/dist/.gitkeep +0 -0
- package/dist/components/Button/Button.d.ts +127 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +87 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +98 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +93 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/Dropdown/Combobox.d.ts +86 -0
- package/dist/components/Dropdown/Dropdown.d.ts +106 -0
- package/dist/components/Dropdown/Select.d.ts +87 -0
- package/dist/components/Dropdown/index.d.ts +3 -0
- package/dist/components/FileUpload/FileUpload.d.ts +58 -0
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/ImageUpload/ImageUpload.d.ts +154 -0
- package/dist/components/ImageUpload/index.d.ts +2 -0
- package/dist/components/LoadingCircle/LoadingCircle.d.ts +76 -0
- package/dist/components/LoadingCircle/index.d.ts +1 -0
- package/dist/components/Modal/ConfirmModal.d.ts +36 -0
- package/dist/components/Modal/DeleteModal.d.ts +33 -0
- package/dist/components/Modal/ErrorModal.d.ts +32 -0
- package/dist/components/Modal/Modal.d.ts +185 -0
- package/dist/components/Modal/SuccessModal.d.ts +31 -0
- package/dist/components/Modal/WarningModal.d.ts +35 -0
- package/dist/components/Modal/index.d.ts +12 -0
- package/dist/components/Pagination/Pagination.d.ts +106 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +75 -0
- package/dist/components/Popover/PopoverMenuItem.d.ts +36 -0
- package/dist/components/Popover/index.d.ts +3 -0
- package/dist/components/RadioButton/RadioButton.d.ts +84 -0
- package/dist/components/RadioButton/index.d.ts +1 -0
- package/dist/components/SideNavigation/SideNavigation.d.ts +98 -0
- package/dist/components/SideNavigation/index.d.ts +1 -0
- package/dist/components/Switch/Switch.d.ts +71 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +192 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/TagInput/TagInput.d.ts +118 -0
- package/dist/components/TagInput/index.d.ts +1 -0
- package/dist/components/Text/Text.d.ts +71 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/TextInput/TextInput.d.ts +94 -0
- package/dist/components/TextInput/index.d.ts +2 -0
- package/dist/components/TimePicker/TimePicker.d.ts +110 -0
- package/dist/components/TimePicker/index.d.ts +2 -0
- package/dist/components/Toast/Toaster.d.ts +84 -0
- package/dist/components/Toast/index.d.ts +4 -0
- package/dist/components/ToolTip/ToolTip.d.ts +110 -0
- package/dist/components/ToolTip/index.d.ts +2 -0
- package/dist/components/icons/index.d.ts +61 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +5233 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/playwright.config.d.ts +6 -0
- package/dist/src/components/Button/Button.d.ts +113 -0
- package/dist/src/components/Button/index.d.ts +2 -0
- package/dist/src/components/Button/variants.d.ts +18 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +90 -0
- package/dist/src/components/Checkbox/index.d.ts +2 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts +101 -0
- package/dist/src/components/DatePicker/index.d.ts +2 -0
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +96 -0
- package/dist/src/components/DateRangePicker/index.d.ts +2 -0
- package/dist/src/components/Dropdown/Combobox.d.ts +86 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts +107 -0
- package/dist/src/components/Dropdown/Select.d.ts +87 -0
- package/dist/src/components/Dropdown/index.d.ts +4 -0
- package/dist/src/components/Dropdown/variants.d.ts +4 -0
- package/dist/src/components/FileUpload/FileUpload.d.ts +61 -0
- package/dist/src/components/FileUpload/index.d.ts +2 -0
- package/dist/src/components/ImageUpload/ImageUpload.d.ts +157 -0
- package/dist/src/components/ImageUpload/index.d.ts +2 -0
- package/dist/src/components/LoadingCircle/LoadingCircle.d.ts +79 -0
- package/dist/src/components/LoadingCircle/index.d.ts +1 -0
- package/dist/src/components/Modal/ConfirmModal.d.ts +36 -0
- package/dist/src/components/Modal/DeleteModal.d.ts +33 -0
- package/dist/src/components/Modal/ErrorModal.d.ts +32 -0
- package/dist/src/components/Modal/Modal.d.ts +188 -0
- package/dist/src/components/Modal/SuccessModal.d.ts +31 -0
- package/dist/src/components/Modal/WarningModal.d.ts +35 -0
- package/dist/src/components/Modal/index.d.ts +12 -0
- package/dist/src/components/Pagination/Pagination.d.ts +109 -0
- package/dist/src/components/Pagination/index.d.ts +2 -0
- package/dist/src/components/Popover/Popover.d.ts +78 -0
- package/dist/src/components/Popover/PopoverMenuItem.d.ts +34 -0
- package/dist/src/components/Popover/index.d.ts +4 -0
- package/dist/src/components/Popover/variants.d.ts +3 -0
- package/dist/src/components/RadioButton/RadioButton.d.ts +87 -0
- package/dist/src/components/RadioButton/index.d.ts +1 -0
- package/dist/src/components/SideNavigation/SideNavigation.d.ts +101 -0
- package/dist/src/components/SideNavigation/index.d.ts +1 -0
- package/dist/src/components/Switch/Switch.d.ts +74 -0
- package/dist/src/components/Switch/index.d.ts +1 -0
- package/dist/src/components/Table/Table.d.ts +195 -0
- package/dist/src/components/Table/index.d.ts +2 -0
- package/dist/src/components/TagInput/TagInput.d.ts +121 -0
- package/dist/src/components/TagInput/index.d.ts +1 -0
- package/dist/src/components/Text/Text.d.ts +74 -0
- package/dist/src/components/Text/index.d.ts +2 -0
- package/dist/src/components/TextInput/TextInput.d.ts +97 -0
- package/dist/src/components/TextInput/index.d.ts +2 -0
- package/dist/src/components/TimePicker/TimePicker.d.ts +113 -0
- package/dist/src/components/TimePicker/index.d.ts +2 -0
- package/dist/src/components/Toast/Toaster.d.ts +87 -0
- package/dist/src/components/Toast/index.d.ts +4 -0
- package/dist/src/components/ToolTip/ToolTip.d.ts +112 -0
- package/dist/src/components/ToolTip/index.d.ts +2 -0
- package/dist/src/components/icons/index.d.ts +61 -0
- package/dist/src/components/index.d.ts +21 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/utils/cn.d.ts +3 -0
- package/dist/style.css +1 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +99 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SubMenuItem {
|
|
4
|
+
url: string;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
export interface MenuItem {
|
|
8
|
+
url: string;
|
|
9
|
+
title: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
subMenu?: SubMenuItem[];
|
|
12
|
+
}
|
|
13
|
+
export interface SideNavigationProps {
|
|
14
|
+
title?: string;
|
|
15
|
+
menus: MenuItem[];
|
|
16
|
+
selectedUrl: string;
|
|
17
|
+
onMenuClick: (url: string) => void;
|
|
18
|
+
headerSlot?: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ์ดํ๋ฆฌ์ผ์ด์
์ ์ฃผ์ ์น์
๊ฐ ์ด๋์ ๋ด๋นํ๋ ์ผ์ชฝ ์ฌ์ด๋๋ฐ ๋ฉ๋ด ์ปดํฌ๋ํธ์
๋๋ค.
|
|
23
|
+
*
|
|
24
|
+
* {@link SideNavigation}์ ๊ณ์ธตํ ๋ฉ๋ด ๊ตฌ์กฐ(1๋จ๊ณ ๋ฐ ์๋ธ๋ฉ๋ด)๋ฅผ ์ง์ํ๋ฉฐ,
|
|
25
|
+
* ํ์ฌ ์ฌ์ฉ์์ ์์น๋ฅผ ์๊ฐ์ ์ผ๋ก ๊ฐ์กฐํ์ฌ ๋ด๋น๊ฒ์ด์
๋งฅ๋ฝ์ ์ ๊ณตํฉ๋๋ค.
|
|
26
|
+
* ๋คํฌ ํ
๋ง(Dark Theme) ์คํ์ผ๋ก ๊ณ ์ ๋์ด ๋์๋ณด๋ ๋ฐ CMS ๊ด๋ฆฌ ๋๊ตฌ์ ์ ํฉํฉ๋๋ค.
|
|
27
|
+
*
|
|
28
|
+
* Radix UI์ Accordion ์ปดํฌ๋ํธ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๊ตฌํ๋์ด ์๋ธ๋ฉ๋ด์ ํผ์นจ/์ ํ ๋์์ด
|
|
29
|
+
* ๋ถ๋๋ฝ๊ฒ ์ฒ๋ฆฌ๋ฉ๋๋ค.
|
|
30
|
+
*
|
|
31
|
+
* ## When (์ธ์ ์ฌ์ฉํด์ผ ํ๋๊ฐ)
|
|
32
|
+
*
|
|
33
|
+
* **์ฌ์ฉํด์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
34
|
+
* - **๋ฉ์ธ ๋ด๋น๊ฒ์ด์
**: ์๋น์ค์ ํต์ฌ ๊ธฐ๋ฅ์ ์์ ๋
ธ์ถํ๊ณ ์ ๊ทผํด์ผ ํ ๋
|
|
35
|
+
* - **๊ณ์ธต ๊ตฌ์กฐ ๊ด๋ฆฌ**: ๋๋ฉ๋ด์ ๊ทธ์ ์ํ ์๋ฉ๋ด๋ฅผ ๊ตฌ์กฐ์ ์ผ๋ก ๋ณด์ฌ์ค์ผ ํ ๋
|
|
36
|
+
* - **๊ด๋ฆฌ์ ํ์ด์ง**: ๋ค์ํ ๊ด๋ฆฌ ๋๊ตฌ์ ์ค์ ํญ๋ชฉ์ ๋ถ๋ฅํ์ฌ ์ ๊ณตํ ๋
|
|
37
|
+
*
|
|
38
|
+
* **์ฌ์ฉํ์ง ๋ง์์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
39
|
+
* - **๋จ์ ๋งํฌ ๋ชฉ๋ก**: 3-4๊ฐ์ ๋จ์ํ ๋งํฌ๋ผ๋ฉด ์๋จ ๋ด๋น๊ฒ์ด์
(GNB)์ด ๋ ์ ์ ํ ์ ์์ต๋๋ค.
|
|
40
|
+
* - **๋ชจ๋ฐ์ผ ์ ์ฉ ํญ**: ๋ชจ๋ฐ์ผ ์ฑ ์คํ์ผ์ ๋ด๋น๊ฒ์ด์
์ด ํ์ํ๋ค๋ฉด ํ๋จ ํญ ๋ฐ๋ฅผ ๊ณ ๋ คํ์ธ์.
|
|
41
|
+
*
|
|
42
|
+
* ## Layout behavior
|
|
43
|
+
*
|
|
44
|
+
* - **Fixed Width**: ๊ธฐ๋ณธ์ ์ผ๋ก `w-70` (280px)์ ๊ณ ์ ๋๋น๋ฅผ ๊ฐ์ง๋ฉฐ, ์ธ๋ก ์ ์ฒด(h-full)๋ฅผ ์ฐจ์งํฉ๋๋ค.
|
|
45
|
+
* - **Scrollable**: ๋ฉ๋ด ํญ๋ชฉ์ด ๋ง์ ํ๋ฉด ๋์ด๋ฅผ ๋์ด๊ฐ๋ฉด ๋ฉ๋ด ์์ญ ๋ด๋ถ์ ์คํฌ๋กค์ด ๋ฐ์ํฉ๋๋ค.
|
|
46
|
+
* - **Accordion**: ์๋ธ๋ฉ๋ด๊ฐ ์๋ ํญ๋ชฉ ํด๋ฆญ ์ ์๋๋ก ํผ์ณ์ง๋ ์ ๋๋ฉ์ด์
์ด ์ ์ฉ๋ฉ๋๋ค.
|
|
47
|
+
*
|
|
48
|
+
* ## Usage guidelines
|
|
49
|
+
*
|
|
50
|
+
* ### โ
Do (๊ถ์ฅ ์ฌํญ)
|
|
51
|
+
*
|
|
52
|
+
* - **์์ด์ฝ ํ์ฉ**: ๊ฐ ๋๋ฉ๋ด์ ์ ์ ํ ์์ด์ฝ์ ๋ฐฐ์นํ์ฌ ์ฌ์ฉ์๊ฐ ๋ฉ๋ด์ ์ฑ๊ฒฉ์ ๋น ๋ฅด๊ฒ ํ์
ํ๊ฒ ํ์ธ์.
|
|
53
|
+
* - **์ํ ์ฐ๋**: ํ์ฌ ํ์ฑํ๋ ํ์ด์ง์ URL๊ณผ `selectedUrl`์ ์ ํํ ์ผ์น์์ผ ํ์ด๋ผ์ดํธ๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ํ์๋๋๋ก ํ์ธ์.
|
|
54
|
+
* - **์ผ๊ด๋ ๊ทธ๋ฃนํ**: ์ฐ๊ด๋ ๊ธฐ๋ฅ๋ค์ ํ๋์ ๋๋ฉ๋ด ์๋ ์๋ธ๋ฉ๋ด๋ก ๋ฌถ์ด ๋ณต์ก๋๋ฅผ ๋ฎ์ถ์ธ์.
|
|
55
|
+
*
|
|
56
|
+
* ### ๐ซ Don't (์ฃผ์/๊ธ์ง ์ฌํญ)
|
|
57
|
+
*
|
|
58
|
+
* - **๊ณผ๋ํ ๊ณ์ธต**: ์๋ธ๋ฉ๋ด์ ์๋ธ๋ฉ๋ด(3๋จ๊ณ ์ด์)๋ ๊ฐ๊ธ์ ํผํ์ธ์. UI๊ฐ ๋ณต์กํด์ง๊ณ ์ฌ์ฉ์ฑ์ด ๋จ์ด์ง๋๋ค.
|
|
59
|
+
* - **๊ธด ๋ฉ๋ด ๋ช
์นญ**: ์ฌ์ด๋๋ฐ ๋๋น๊ฐ ์ ํ์ ์ด๋ฏ๋ก ๋ฉ๋ด ์ด๋ฆ์ ์งง๊ณ ๋ช
ํํ๊ฒ(๊ฐ๊ธ์ 10์ ์ด๋ด) ์์ฑํ์ธ์.
|
|
60
|
+
*
|
|
61
|
+
* ## Accessibility
|
|
62
|
+
*
|
|
63
|
+
* - **Accordion Support**: ์๋ธ๋ฉ๋ด ์ํ๋ฅผ ์คํฌ๋ฆฐ ๋ฆฌ๋์์ 'ํผ์ณ์ง/์ ํ'์ผ๋ก ์ธ์ํฉ๋๋ค.
|
|
64
|
+
* - **Keyboard Interaction**: `Tab` ํค๋ก ๋ฉ๋ด๋ฅผ ์ด๋ํ๊ณ , `Enter`๋ `Space`๋ก ๋ฉ๋ด๋ฅผ ์ด๊ฑฐ๋ ์ด๋ํ ์ ์์ต๋๋ค.
|
|
65
|
+
*
|
|
66
|
+
* ## Example
|
|
67
|
+
*
|
|
68
|
+
* {@tool snippet}
|
|
69
|
+
* ์๋ธ๋ฉ๋ด๋ฅผ ํฌํจํ ์ฌ์ด๋ ๋ค๋น๊ฒ์ด์
:
|
|
70
|
+
*
|
|
71
|
+
* ```tsx
|
|
72
|
+
* const menus = [
|
|
73
|
+
* { url: '/dashboard', title: 'ํ', icon: <HomeIcon /> },
|
|
74
|
+
* {
|
|
75
|
+
* url: '/contents',
|
|
76
|
+
* title: '์ฝํ
์ธ ๊ด๋ฆฌ',
|
|
77
|
+
* icon: <FileTextIcon />,
|
|
78
|
+
* subMenu: [
|
|
79
|
+
* { url: '/contents/posts', title: '๊ฒ์๊ธ ๋ชฉ๋ก' },
|
|
80
|
+
* { url: '/contents/comments', title: '๋๊ธ ๊ด๋ฆฌ' },
|
|
81
|
+
* ]
|
|
82
|
+
* },
|
|
83
|
+
* ];
|
|
84
|
+
*
|
|
85
|
+
* <SideNavigation
|
|
86
|
+
* menus={menus}
|
|
87
|
+
* selectedUrl="/contents/posts"
|
|
88
|
+
* onMenuClick={(url) => navigate(url)}
|
|
89
|
+
* />
|
|
90
|
+
* ```
|
|
91
|
+
* {@end-tool}
|
|
92
|
+
*
|
|
93
|
+
* See also:
|
|
94
|
+
*
|
|
95
|
+
* - {@link Button}, ๋จ์ ์ก์
์คํ์ ์ํ ์์
|
|
96
|
+
* - {@link Popover}, ํด๋ฆญ ์ ์ผ์์ ์ผ๋ก ๋ํ๋๋ ์ถ๊ฐ ๋ฉ๋ด๊ฐ ํ์ํ ๊ฒฝ์ฐ
|
|
97
|
+
*
|
|
98
|
+
* ## ์ฐธ๊ณ ์ฌ์ง
|
|
99
|
+
* 
|
|
100
|
+
*/
|
|
101
|
+
export declare const SideNavigation: React.ForwardRefExoticComponent<SideNavigationProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SideNavigation';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5
|
+
declare const switchVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "green" | "black" | "blue" | "red" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>, VariantProps<typeof switchVariants> {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* ๋ ๊ฐ์ง ์๋ฐ๋ ์ํ(On/Off, ํ์ฑ/๋นํ์ฑ)๋ฅผ ์ฆ๊ฐ์ ์ผ๋ก ์ ํํ ๋ ์ฌ์ฉํ๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
12
|
+
*
|
|
13
|
+
* {@link Switch}๋ ์ค์ ์ ๋ฑ ์ค์์น์ ๊ฐ์ ์ง๊ด์ ์ธ ์๊ฐ์ ๋ชจ๋ธ์ ์ ๊ณตํ๋ฉฐ,
|
|
14
|
+
* ์ฒดํฌ๋ฐ์ค๋ณด๋ค ๋ '์ฆ๊ฐ์ ์ธ ๋ฐ์'์ ์๋ฏธ๋ฅผ ๊ฐ์ง๋๋ค.
|
|
15
|
+
*
|
|
16
|
+
* Radix UI์ Switch ์ปดํฌ๋ํธ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๊ตฌํ๋์ด ์ ๊ทผ์ฑ๊ณผ ์ ๋๋ฉ์ด์
์ด
|
|
17
|
+
* ์๋์ผ๋ก ์ฒ๋ฆฌ๋ฉ๋๋ค.
|
|
18
|
+
*
|
|
19
|
+
* ## When (์ธ์ ์ฌ์ฉํด์ผ ํ๋๊ฐ)
|
|
20
|
+
*
|
|
21
|
+
* **์ฌ์ฉํด์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
22
|
+
* - **์ฆ๊ฐ์ ์ค์ ๋ฐ์**: ํด๋ฆญ ์ฆ์ ์์คํ
์ค์ ์ด ๋ณ๊ฒฝ๋๊ฑฐ๋ ์ ์ฅ๋์ด์ผ ํ ๋ (์: ๋คํฌ๋ชจ๋ ์ผ๊ธฐ, ์๋ฆผ ์์ ๋์)
|
|
23
|
+
* - **์ํ ์ ํ**: ํน์ ๊ธฐ๋ฅ์ ์ฌ์ฉ ์ฌ๋ถ๋ฅผ ๊ฒฐ์ ํ ๋
|
|
24
|
+
* - **๋จ์ ํ ๊ธ**: ๋ณต์กํ ์
๋ ฅ ์์ด ์ผ๊ณ ๋๋ ํ์๋ง ํ์ํ ๋
|
|
25
|
+
*
|
|
26
|
+
* **์ฌ์ฉํ์ง ๋ง์์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
27
|
+
* - **์ ์ถ ๋ฒํผ ํ์**: ์ฌ๋ฌ ์ ๋ณด๋ฅผ ์
๋ ฅํ๊ณ 'ํ์ธ' ๋ฒํผ์ ๋๋ฌ์ผ ๊ฒฐ๊ณผ๊ฐ ๋ฐ์๋๋ ํผ ๋ด์์๋ `Checkbox`๋ฅผ ์ฌ์ฉํ์ธ์.
|
|
28
|
+
* - **๋ค์ค ์ ํ**: ์ฌ๋ฌ ํญ๋ชฉ ์ค ์ผ๋ถ๋ฅผ ๊ณจ๋ผ์ผ ํ ๋๋ `Checkbox`๊ฐ ๋ ์ ํฉํฉ๋๋ค.
|
|
29
|
+
*
|
|
30
|
+
* ## Layout behavior
|
|
31
|
+
*
|
|
32
|
+
* - **Inline Component**: ์ฃผ๋ณ ํ
์คํธ๋ ๋ค๋ฅธ ์์์ ์์ฐ์ค๋ฝ๊ฒ ์ด์ฐ๋ฌ์ง๋ ์ธ๋ผ์ธ ๋ธ๋ก ํํ์
๋๋ค.
|
|
33
|
+
* - **Thumb Animation**: ํด๋ฆญ ์ ์ค์์น์ '์์ก์ด(Thumb)'๊ฐ ๋ถ๋๋ฝ๊ฒ ์ข์ฐ๋ก ์ด๋ํ๋ฉฐ ์ํ ๋ณํ๋ฅผ ์๊ฐํํฉ๋๋ค.
|
|
34
|
+
*
|
|
35
|
+
* ## Usage guidelines
|
|
36
|
+
*
|
|
37
|
+
* ### โ
Do (๊ถ์ฅ ์ฌํญ)
|
|
38
|
+
*
|
|
39
|
+
* - **๋ช
ํํ ํ์ฌ ์ํ ํ์**: ์์ ๋ณํ(ํ์ vs ์์)๋ฅผ ํตํด ์ผ์ ธ ์๋์ง ๊บผ์ ธ ์๋์ง ํ๋์ ์ ์ ์๊ฒ ํ์ธ์.
|
|
40
|
+
* - **๋ ์ด๋ธ๊ณผ ํจ๊ป ์ฌ์ฉ**: ์ค์์น ์์ ๋ฌด์์ ์ ์ดํ๋์ง ์ค๋ช
ํ๋ ํ
์คํธ๋ฅผ ๋ฐ๋์ ๋ฐฐ์นํ์ธ์.
|
|
41
|
+
*
|
|
42
|
+
* ### ๐ซ Don't (์ฃผ์/๊ธ์ง ์ฌํญ)
|
|
43
|
+
*
|
|
44
|
+
* - **๋ชจํธํ ์๋ฏธ**: ์ํ ์ ํ ํ์ ์ด๋ค ๋ณํ๊ฐ ์๊ธธ์ง ๋ช
ํํ์ง ์์ ๊ฒฝ์ฐ์๋ ์ฌ์ฉ์ ์ง์ํ์ธ์.
|
|
45
|
+
* - **๊ธด ๋๊ธฐ ์๊ฐ**: ์๋ฒ ํต์ ๋ฑ์ผ๋ก ์ธํด ์ํ ๋ฐ์์ ์๊ฐ์ด ๊ฑธ๋ฆฌ๋ ๊ฒฝ์ฐ, ๋ก๋ฉ ์ธ๋์ผ์ดํฐ๋ฅผ ํจ๊ป ๋ณด์ฌ์ฃผ๊ฑฐ๋ ์ฆ์ ๋ฐ์์ ์ฐ์ ์ฒ๋ฆฌํ์ธ์.
|
|
46
|
+
*
|
|
47
|
+
* ## Accessibility
|
|
48
|
+
*
|
|
49
|
+
* - **Keyboard Support**: `Space` ํค๋ฅผ ์ฌ์ฉํ์ฌ ์ํ๋ฅผ ์ ํํ ์ ์์ต๋๋ค.
|
|
50
|
+
* - **Roles**: `role="switch"` ์์ฑ์ ์ฌ์ฉํ์ฌ ์คํฌ๋ฆฐ ๋ฆฌ๋์์ ํ ๊ธ ์ํ๋ฅผ ์ฝ์ด์ค๋๋ค.
|
|
51
|
+
*
|
|
52
|
+
* ## Example
|
|
53
|
+
*
|
|
54
|
+
* {@tool snippet}
|
|
55
|
+
* ๋ ์ด๋ธ๊ณผ ํจ๊ป ์ฌ์ฉํ๋ ๊ธฐ๋ณธ์ ์ธ ์ค์์น:
|
|
56
|
+
*
|
|
57
|
+
* ```tsx
|
|
58
|
+
* <div className="flex items-center gap-2">
|
|
59
|
+
* <Switch id="airplane-mode" />
|
|
60
|
+
* <label htmlFor="airplane-mode">๋นํ๊ธฐ ๋ชจ๋</label>
|
|
61
|
+
* </div>
|
|
62
|
+
* ```
|
|
63
|
+
* {@end-tool}
|
|
64
|
+
*
|
|
65
|
+
* See also:
|
|
66
|
+
*
|
|
67
|
+
* - {@link Checkbox}, ์ ์ถ ์ ๊น์ง ์ํ๋ฅผ ์ ์งํด์ผ ํ๋ ๊ฒฝ์ฐ
|
|
68
|
+
* - {@link RadioButton}, ์ฌ๋ฌ ์ ํ์ง ์ค ํ๋๋ฅผ ๊ณ ๋ฅด๋ ๊ฒฝ์ฐ
|
|
69
|
+
*
|
|
70
|
+
* ## ์ฐธ๊ณ ์ฌ์ง
|
|
71
|
+
* 
|
|
72
|
+
*/
|
|
73
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
74
|
+
export { Switch };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Switch';
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const tableVariants: (props?: ({
|
|
5
|
+
bordered?: boolean | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface TableProps extends React.TableHTMLAttributes<HTMLTableElement>, VariantProps<typeof tableVariants> {
|
|
8
|
+
/** zebra stripe ํจํด ์ ์ฉ ์ฌ๋ถ */
|
|
9
|
+
striped?: boolean;
|
|
10
|
+
/** row hover ํจ๊ณผ ์ ์ฉ ์ฌ๋ถ */
|
|
11
|
+
hoverable?: boolean;
|
|
12
|
+
/** ํ
๋๋ฆฌ ํ์ ์ฌ๋ถ */
|
|
13
|
+
bordered?: boolean;
|
|
14
|
+
/** ์ข์ padding ์ ์ฉ ์ฌ๋ถ */
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ๋ฐ์ดํฐ๋ฅผ ํ๊ณผ ์ด๋ก ๊ตฌ์กฐํํ์ฌ ํ์ํ๋ ํ
์ด๋ธ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
19
|
+
*
|
|
20
|
+
* {@link Table}์ Compound Component ํจํด์ ์ฌ์ฉํ์ฌ ๊ตฌ์ฑ๋๋ฉฐ,
|
|
21
|
+
* TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption
|
|
22
|
+
* ๋ฑ์ ํ์ ์ปดํฌ๋ํธ๋ฅผ ์กฐํฉํ์ฌ ์ ์ฐํ ํ
์ด๋ธ ๋ ์ด์์์ ๋ง๋ค ์ ์์ต๋๋ค.
|
|
23
|
+
*
|
|
24
|
+
* ## When (์ธ์ ์ฌ์ฉํด์ผ ํ๋๊ฐ)
|
|
25
|
+
*
|
|
26
|
+
* **์ฌ์ฉํด์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
27
|
+
* - **๋ฐ์ดํฐ ๋ชฉ๋ก**: ์ฌ์ฉ์ ๋ชฉ๋ก, ์ฃผ๋ฌธ ๋ด์ญ, ์ ํ ๋ฆฌ์คํธ ๋ฑ ๊ตฌ์กฐํ๋ ๋ฐ์ดํฐ๋ฅผ ํ์ํ ๋
|
|
28
|
+
* - **๋น๊ต**: ์ฌ๋ฌ ํญ๋ชฉ์ ์์ฑ์ ๋๋ํ ๋น๊ตํด์ผ ํ ๋
|
|
29
|
+
* - **์ ๋ ฌ ๋ฐ ํํฐ**: ๋ฐ์ดํฐ๋ฅผ ์ ๋ ฌํ๊ฑฐ๋ ํํฐ๋งํด์ ๋ณด์ฌ์ค ๋
|
|
30
|
+
* - **๋๋ ๋ฐ์ดํฐ**: ๋ง์ ์์ ์ ๋ณด๋ฅผ ์กฐ์ง์ ์ผ๋ก ํ์ํด์ผ ํ ๋
|
|
31
|
+
*
|
|
32
|
+
* **์ฌ์ฉํ์ง ๋ง์์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
33
|
+
* - **๋ ์ด์์ ๋ชฉ์ **: ๋จ์ํ ๋ ์ด์์์ ๋ง๋ค๊ธฐ ์ํด์๋ CSS Grid๋ Flexbox๋ฅผ ์ฌ์ฉํ์ธ์.
|
|
34
|
+
* - **์๋ ๋ฐ์ดํฐ**: 2-3๊ฐ์ ๊ฐ๋จํ ์ ๋ณด๋ ๋ฆฌ์คํธ๋ ์นด๋ ํํ๊ฐ ๋ ์ ํฉํ ์ ์์ต๋๋ค.
|
|
35
|
+
* - **๋ณต์กํ ์ธํฐ๋์
**: ๊ฐ ํ๋ง๋ค ๋ง์ ๋ฒํผ์ด๋ ์
๋ ฅ์ด ํ์ํ๋ค๋ฉด ์นด๋ ๋ ์ด์์์ ๊ณ ๋ คํ์ธ์.
|
|
36
|
+
*
|
|
37
|
+
* ## Layout behavior
|
|
38
|
+
*
|
|
39
|
+
* - **Responsive**: ๊ธฐ๋ณธ์ ์ผ๋ก ์คํฌ๋กค ๊ฐ๋ฅํ ์ปจํ
์ด๋๋ก ๋ํ๋์ด ๋ชจ๋ฐ์ผ์์๋ ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค.
|
|
40
|
+
* - **Full Width**: ๋ถ๋ชจ ์ปจํ
์ด๋์ ์ ์ฒด ๋๋น๋ฅผ ์ฐจ์งํฉ๋๋ค.
|
|
41
|
+
* - **Auto Height**: ๋ด์ฉ์ ๋ฐ๋ผ ๋์ด๊ฐ ์๋์ผ๋ก ์กฐ์ ๋ฉ๋๋ค.
|
|
42
|
+
*
|
|
43
|
+
* ## Usage guidelines
|
|
44
|
+
*
|
|
45
|
+
* ### โ
Do (๊ถ์ฅ ์ฌํญ)
|
|
46
|
+
*
|
|
47
|
+
* - **๋ช
ํํ ํค๋**: TableHead๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ ์ด์ ์๋ฏธ๋ฅผ ๋ช
ํํ ํ์ํ์ธ์.
|
|
48
|
+
* - **์ผ๊ด๋ ์ ๋ ฌ**: ์ซ์๋ ์ค๋ฅธ์ชฝ, ํ
์คํธ๋ ์ผ์ชฝ ์ ๋ ฌํ๋ ๊ฒ์ด ์ผ๋ฐ์ ์
๋๋ค.
|
|
49
|
+
* - **์ ์ ํ variant**: ๋ฐ์ดํฐ๊ฐ ๋ง์ ๋๋ `striped`๋ `hoverable`์ ์ฌ์ฉํ์ฌ ๊ฐ๋
์ฑ์ ๋์ด์ธ์.
|
|
50
|
+
* - **Caption ํ์ฉ**: ํ
์ด๋ธ์ ๋ชฉ์ ์ ์ค๋ช
ํ๋ caption์ ์ถ๊ฐํ๋ฉด ์ ๊ทผ์ฑ์ด ํฅ์๋ฉ๋๋ค.
|
|
51
|
+
*
|
|
52
|
+
* ### ๐ซ Don't (์ฃผ์/๊ธ์ง ์ฌํญ)
|
|
53
|
+
*
|
|
54
|
+
* - **๊ณผ๋ํ ์ด**: ๋๋ฌด ๋ง์ ์ด์ ๊ฐ๋
์ฑ์ ํด์นฉ๋๋ค. ์ค์ํ ์ ๋ณด๋ง ํ์ํ์ธ์.
|
|
55
|
+
* - **์ค์ฒฉ ํ
์ด๋ธ**: ํ
์ด๋ธ ์์ ํ
์ด๋ธ์ ๋ฃ์ง ๋ง์ธ์. ๋ณต์ก๋๊ฐ ๊ธ๊ฒฉํ ์ฆ๊ฐํฉ๋๋ค.
|
|
56
|
+
* - **๋น ์
๋จ์ฉ**: ๋น ์
์ด ๋ง์ผ๋ฉด ๋ฐ์ดํฐ ๊ตฌ์กฐ๋ฅผ ๋ค์ ๊ฒํ ํ์ธ์.
|
|
57
|
+
*
|
|
58
|
+
* ## Accessibility
|
|
59
|
+
*
|
|
60
|
+
* - **Semantic HTML**: ์ ์ ํ `<table>`, `<thead>`, `<tbody>`, `<th>`, `<td>` ํ๊ทธ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
|
|
61
|
+
* - **Scope Attribute**: TableHead๋ `scope="col"`์ ์๋์ผ๋ก ๊ฐ์ง๋๋ค.
|
|
62
|
+
* - **ARIA Attributes**: ์ ๋ ฌ, ์ ํ ๋ฑ์ ์ํ๋ `aria-sort`, `aria-selected`๋ก ํํ๋ฉ๋๋ค.
|
|
63
|
+
* - **Caption**: ํ
์ด๋ธ์ ๋ชฉ์ ์ ์ค๋ช
ํ๋ `<caption>`์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
|
|
64
|
+
*
|
|
65
|
+
* ## Example
|
|
66
|
+
*
|
|
67
|
+
* {@tool snippet}
|
|
68
|
+
* ๊ธฐ๋ณธ ํ
์ด๋ธ ์ฌ์ฉ:
|
|
69
|
+
*
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <Table>
|
|
72
|
+
* <TableCaption>์ฌ์ฉ์ ๋ชฉ๋ก</TableCaption>
|
|
73
|
+
* <TableHeader>
|
|
74
|
+
* <TableRow>
|
|
75
|
+
* <TableHead>์ด๋ฆ</TableHead>
|
|
76
|
+
* <TableHead>์ด๋ฉ์ผ</TableHead>
|
|
77
|
+
* <TableHead align="right">์ญํ </TableHead>
|
|
78
|
+
* </TableRow>
|
|
79
|
+
* </TableHeader>
|
|
80
|
+
* <TableBody>
|
|
81
|
+
* <TableRow>
|
|
82
|
+
* <TableCell>ํ๊ธธ๋</TableCell>
|
|
83
|
+
* <TableCell>hong@example.com</TableCell>
|
|
84
|
+
* <TableCell align="right">๊ด๋ฆฌ์</TableCell>
|
|
85
|
+
* </TableRow>
|
|
86
|
+
* </TableBody>
|
|
87
|
+
* </Table>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* Striped ํ
์ด๋ธ:
|
|
91
|
+
*
|
|
92
|
+
* ```tsx
|
|
93
|
+
* <Table striped hoverable>
|
|
94
|
+
* <TableHeader>
|
|
95
|
+
* <TableRow>
|
|
96
|
+
* <TableHead>์ ํ๋ช
</TableHead>
|
|
97
|
+
* <TableHead align="right">๊ฐ๊ฒฉ</TableHead>
|
|
98
|
+
* </TableRow>
|
|
99
|
+
* </TableHeader>
|
|
100
|
+
* <TableBody>
|
|
101
|
+
* {products.map((product) => (
|
|
102
|
+
* <TableRow key={product.id}>
|
|
103
|
+
* <TableCell>{product.name}</TableCell>
|
|
104
|
+
* <TableCell align="right">{product.price}</TableCell>
|
|
105
|
+
* </TableRow>
|
|
106
|
+
* ))}
|
|
107
|
+
* </TableBody>
|
|
108
|
+
* </Table>
|
|
109
|
+
* ```
|
|
110
|
+
* {@end-tool}
|
|
111
|
+
*
|
|
112
|
+
* ## ์ฐธ๊ณ ์ฌ์ง
|
|
113
|
+
* 
|
|
114
|
+
*/
|
|
115
|
+
export declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
|
|
116
|
+
export interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* ํ
์ด๋ธ์ ํค๋ ์น์
์ ์ ์ํ๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
120
|
+
*
|
|
121
|
+
* `<thead>` ํ๊ทธ๋ฅผ ๋ ๋๋งํ๋ฉฐ, ๋ณดํต `TableRow`์ `TableHead`๋ฅผ ํฌํจํ์ฌ
|
|
122
|
+
* ์ด์ ์ ๋ชฉ์ ํ์ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค.
|
|
123
|
+
*/
|
|
124
|
+
export declare const TableHeader: React.ForwardRefExoticComponent<TableHeaderProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
125
|
+
export interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* ํ
์ด๋ธ์ ๋ณธ๋ฌธ ์น์
์ ์ ์ํ๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
129
|
+
*
|
|
130
|
+
* `<tbody>` ํ๊ทธ๋ฅผ ๋ ๋๋งํ๋ฉฐ, ์ค์ ๋ฐ์ดํฐ๊ฐ ํฌํจ๋ `TableRow`์ `TableCell`์
|
|
131
|
+
* ํฌํจํฉ๋๋ค.
|
|
132
|
+
*/
|
|
133
|
+
export declare const TableBody: React.ForwardRefExoticComponent<TableBodyProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
134
|
+
export interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* ํ
์ด๋ธ์ ํธํฐ ์น์
์ ์ ์ํ๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
138
|
+
*
|
|
139
|
+
* `<tfoot>` ํ๊ทธ๋ฅผ ๋ ๋๋งํ๋ฉฐ, ํฉ๊ณ๋ ์์ฝ ์ ๋ณด๋ฅผ ํ์ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค.
|
|
140
|
+
*/
|
|
141
|
+
export declare const TableFooter: React.ForwardRefExoticComponent<TableFooterProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
142
|
+
declare const tableRowVariants: (props?: ({
|
|
143
|
+
hoverable?: boolean | null | undefined;
|
|
144
|
+
selected?: boolean | null | undefined;
|
|
145
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
146
|
+
export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement>, VariantProps<typeof tableRowVariants> {
|
|
147
|
+
/** ์ ํ๋ ํ ํ์ ์ฌ๋ถ */
|
|
148
|
+
selected?: boolean;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* ํ
์ด๋ธ์ ํ(Row)์ ์ ์ํ๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
152
|
+
*
|
|
153
|
+
* `<tr>` ํ๊ทธ๋ฅผ ๋ ๋๋งํ๋ฉฐ, `hoverable`์ด๋ `striped` ์์ฑ์ด `Table` ์ปดํฌ๋ํธ์
|
|
154
|
+
* ์ ์ฉ๋์์ ๋ ์ด์ ๋ฐ๋ฅธ ์คํ์ผ์ ์๋์ผ๋ก ์ ์ฉํฉ๋๋ค.
|
|
155
|
+
*/
|
|
156
|
+
export declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
|
|
157
|
+
export interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
158
|
+
/** ์ ๋ ฌ ๊ฐ๋ฅ ์ฌ๋ถ */
|
|
159
|
+
sortable?: boolean;
|
|
160
|
+
/** ์ ๋ ฌ ๋ฐฉํฅ */
|
|
161
|
+
sortDirection?: "asc" | "desc" | null;
|
|
162
|
+
/** ์ ๋ ฌ ํด๋ฆญ ํธ๋ค๋ฌ */
|
|
163
|
+
onSort?: () => void;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* ํ
์ด๋ธ์ ํค๋ ์
์ ์ ์ํ๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
167
|
+
*
|
|
168
|
+
* `<th>` ํ๊ทธ๋ฅผ ๋ ๋๋งํ๋ฉฐ, ์ด์ ์ ๋ชฉ์ ํ์ํฉ๋๋ค.
|
|
169
|
+
* ์ ๋ ฌ ๊ธฐ๋ฅ(`sortable`)์ ์ง์ํ๋ฉฐ, ์ ๋ ฌ ๋ฐฉํฅ์ ๋ฐ๋ผ ์์ด์ฝ์ ํ์ํ ์ ์์ต๋๋ค.
|
|
170
|
+
*/
|
|
171
|
+
export declare const TableHead: React.ForwardRefExoticComponent<TableHeadProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
172
|
+
declare const tableCellVariants: (props?: ({
|
|
173
|
+
align?: "center" | "right" | "left" | null | undefined;
|
|
174
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
175
|
+
export interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement>, VariantProps<typeof tableCellVariants> {
|
|
176
|
+
/** ํ
์คํธ ์ ๋ ฌ ๋ฐฉ์ */
|
|
177
|
+
align?: "left" | "center" | "right";
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* ํ
์ด๋ธ์ ๋ฐ์ดํฐ ์
์ ์ ์ํ๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
181
|
+
*
|
|
182
|
+
* `<td>` ํ๊ทธ๋ฅผ ๋ ๋๋งํ๋ฉฐ, ์ค์ ๋ฐ์ดํฐ๋ฅผ ํ์ํฉ๋๋ค.
|
|
183
|
+
* ํ
์คํธ ์ ๋ ฌ(`align`)์ ์ค์ ํ ์ ์์ต๋๋ค.
|
|
184
|
+
*/
|
|
185
|
+
export declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
186
|
+
export interface TableCaptionProps extends React.HTMLAttributes<HTMLTableCaptionElement> {
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* ํ
์ด๋ธ์ ์บก์
(์ค๋ช
)์ ์ ์ํ๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
190
|
+
*
|
|
191
|
+
* `<caption>` ํ๊ทธ๋ฅผ ๋ ๋๋งํ๋ฉฐ, ์คํฌ๋ฆฐ ๋ฆฌ๋ ์ฌ์ฉ์์๊ฒ ํ
์ด๋ธ์ ๋ชฉ์ ์
|
|
192
|
+
* ์ค๋ช
ํ๋ ๋ฐ ์ค์ํ ์ญํ ์ ํฉ๋๋ค.
|
|
193
|
+
*/
|
|
194
|
+
export declare const TableCaption: React.ForwardRefExoticComponent<TableCaptionProps & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
195
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption, } from './Table';
|
|
2
|
+
export type { TableProps, TableHeaderProps, TableBodyProps, TableFooterProps, TableRowProps, TableHeadProps, TableCellProps, TableCaptionProps, } from './Table';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const tagInputContainerVariants: (props?: ({
|
|
5
|
+
readOnly?: boolean | null | undefined;
|
|
6
|
+
layout?: "row" | "column" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface TagInputProps extends Omit<VariantProps<typeof tagInputContainerVariants>, "readOnly"> {
|
|
9
|
+
label?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
maxTags?: number;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
value?: string[];
|
|
14
|
+
onChange?: (tags: string[]) => void;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
noLimit?: boolean;
|
|
17
|
+
validateTag?: (tag: string, currentTags: string[]) => boolean | string | undefined;
|
|
18
|
+
className?: string;
|
|
19
|
+
id?: string;
|
|
20
|
+
labelLayout?: "vertical" | "horizontal";
|
|
21
|
+
labelWidth?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ์ฌ์ฉ์๊ฐ ํ
์คํธ๋ฅผ ์
๋ ฅํ์ฌ ์ฌ๋ฌ ๊ฐ์ ํ๊ทธ(ํค์๋) ๋ชฉ๋ก์ ์์ฑํ๊ณ ๊ด๋ฆฌํ ์ ์๋ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
25
|
+
*
|
|
26
|
+
* {@link TagInput}์ ์
๋ ฅ์ฐฝ ๋ด๋ถ์ ์๊ฐ์ ์ธ ํ๊ทธ๋ฅผ ํ์ํ๋ฉฐ,
|
|
27
|
+
* ์ํฐ(Enter) ํค๋ฅผ ํตํด ์๋ก์ด ํ๊ทธ๋ฅผ ์ถ๊ฐํ๊ณ 'x' ๋ฒํผ์ ๋๋ฌ ๊ธฐ์กด ํ๊ทธ๋ฅผ ์ ๊ฑฐํ ์ ์์ต๋๋ค.
|
|
28
|
+
* ์ฃผ๋ก ๊ฒ์๊ธ์ ํ๊ทธ, ๊ฒ์ ํํฐ ์กฐ๊ฑด, ์์ ์ ๋ชฉ๋ก ๋ฑ์ ์
๋ ฅ๋ฐ์ ๋ ์ฌ์ฉ๋ฉ๋๋ค.
|
|
29
|
+
*
|
|
30
|
+
* ## When (์ธ์ ์ฌ์ฉํด์ผ ํ๋๊ฐ)
|
|
31
|
+
*
|
|
32
|
+
* **์ฌ์ฉํด์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
33
|
+
* - **ํค์๋ ์
๋ ฅ**: ๊ฒ์๊ธ์ ํด์ํ๊ทธ๋ ์นดํ
๊ณ ๋ฆฌ๋ฅผ ์
๋ ฅ๋ฐ์ ๋
|
|
34
|
+
* - **๋ค์ค ํญ๋ชฉ ์์ง**: ์ฌ๋ฌ ๊ฐ์ ์ด๋ฉ์ผ ์ฃผ์๋ ์ฌ์ฉ์ ์์ด๋๋ฅผ ํ๊บผ๋ฒ์ ์
๋ ฅ๋ฐ์์ผ ํ ๋
|
|
35
|
+
* - **์ ํ๋ ๊ฐ์์ ํญ๋ชฉ ์ ํ**: ์ต๋ N๊ฐ๊น์ง์ ์กฐ๊ฑด์ ์
๋ ฅ๋ฐ์์ผ ํ ๋ (`maxTags` ํ์ฉ)
|
|
36
|
+
*
|
|
37
|
+
* **์ฌ์ฉํ์ง ๋ง์์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
38
|
+
* - **๋จ์ผ ํ
์คํธ ์
๋ ฅ**: ํ๋์ ๊ฐ๋ง ํ์ํ ๊ฒฝ์ฐ ์ผ๋ฐ `TextInput`์ ์ฌ์ฉํ์ธ์.
|
|
39
|
+
* - **๋ฏธ๋ฆฌ ์ ์๋ ์ต์
**: ๊ณ ์ ๋ ๋ชฉ๋ก์์๋ง ์ ํํด์ผ ํ๋ค๋ฉด `Dropdown`์ด๋ `Combobox`๊ฐ ๋ ์ ํฉํฉ๋๋ค.
|
|
40
|
+
*
|
|
41
|
+
* ## Layout behavior
|
|
42
|
+
*
|
|
43
|
+
* - **Flow Layout**: ํ๊ทธ๋ค์ ๊ฐ๋ก ๋ฐฉํฅ์ผ๋ก ๋์ด๋๋ฉฐ, ๊ณต๊ฐ์ด ๋ถ์กฑํ๋ฉด ์๋์ผ๋ก ๋ค์ ์ค๋ก ๋์ด๊ฐ๋๋ค (`layout="row"`).
|
|
44
|
+
* - **Column Layout**: ํ๊ทธ๋ค์ ์์ง์ผ๋ก ์๊ณ ์ถ์ ๊ฒฝ์ฐ `layout="column"` ์ค์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
|
|
45
|
+
* - **Constraint**: `maxTags`์ ๋๋ฌํ๋ฉด ์ถ๊ฐ ์
๋ ฅ์ด ์ฐจ๋จ๋๋ฉฐ ์๊ฐ์ ์ผ๋ก ์๋ด๋ฉ๋๋ค.
|
|
46
|
+
*
|
|
47
|
+
* ๋ ์ด๋ธ ๋ฐฐ์น๋ `labelLayout` prop์ผ๋ก ์ ์ด๋ฉ๋๋ค:
|
|
48
|
+
* - **vertical** (๊ธฐ๋ณธ๊ฐ): Label์ด ํ๊ทธ ์
๋ ฅ ํ๋ ์์ ์ธ๋ก๋ก ๋ฐฐ์น๋ฉ๋๋ค.
|
|
49
|
+
* - **horizontal**: Label๊ณผ ํ๊ทธ ์
๋ ฅ ํ๋๊ฐ ๊ฐ๋ก๋ก ๋๋ํ ๋ฐฐ์น๋ฉ๋๋ค. `labelWidth`๋ก Label ๋๋น๋ฅผ ์กฐ์ ํ ์ ์์ต๋๋ค (๊ธฐ๋ณธ๊ฐ: 120px).
|
|
50
|
+
*
|
|
51
|
+
* ## Usage guidelines
|
|
52
|
+
*
|
|
53
|
+
* ### โ
Do (๊ถ์ฅ ์ฌํญ)
|
|
54
|
+
*
|
|
55
|
+
* - **์ ํจ์ฑ ๊ฒ์ฌ ํ์ฉ**: `validateTag`๋ฅผ ํตํด ์ด๋ฉ์ผ ํ์ ํ์ธ์ด๋ ๊ธ์ ์ ์ ํ ๋ฑ ๋น์ฆ๋์ค ๋ก์ง์ ์ ์ฉํ์ธ์.
|
|
56
|
+
* - **์ค๋ณต ๋ฐฉ์ง**: ๋์ผํ ํ๊ทธ๊ฐ ์
๋ ฅ๋์ง ์๋๋ก ์๋์ผ๋ก ์ฒ๋ฆฌ๋์ง๋ง, ํ์์ ๋ฐ๋ผ ์ฌ์ฉ์์๊ฒ ์๋ฆผ์ ์ค ์ ์์ต๋๋ค.
|
|
57
|
+
* - **๊ฐ๋ก ๋ฐฐ์น ํ์ฉ**: ํผ์์ ์ฌ๋ฌ ์
๋ ฅ ํ๋๋ฅผ ์ ๋ ฌํ ๋๋ `labelLayout="horizontal"`์ ์ฌ์ฉํ์ฌ ์ผ๊ด๋ ๋ ์ด์์์ ์ ์งํ์ธ์.
|
|
58
|
+
*
|
|
59
|
+
* ### ๐ซ Don't (์ฃผ์/๊ธ์ง ์ฌํญ)
|
|
60
|
+
*
|
|
61
|
+
* - **๋๋ฌด ๊ธด ํ๊ทธ**: ํ๊ทธ ํ๋์ ๋๋ฌด ๊ธด ๋ฌธ์ฅ์ด ๋ค์ด๊ฐ๋ ๊ฒ์ ํผํ์ธ์. ๊ฐ๊ธ์ ๋จ์ด๋ ์งง์ ๊ตฌ๋ฌธ์ผ๋ก ์ ํํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
|
|
62
|
+
* - **๋ณต์กํ ์ธํฐํ์ด์ค**: ํ๊ทธ ๋ด๋ถ์ ๋๋ฌด ๋ง์ ๊ธฐ๋ฅ์ ๋ฃ์ง ๋ง์ธ์. ํ๊ทธ๋ ๊ฐ๋ณ๊ณ ๋น ๋ฅด๊ฒ ํ์ด๋ณผ ์ ์์ด์ผ ํฉ๋๋ค.
|
|
63
|
+
*
|
|
64
|
+
* ## Accessibility
|
|
65
|
+
*
|
|
66
|
+
* - **Keyboard Management**: `Enter`๋ก ์ถ๊ฐ, `Backspace`(๊ตฌํ ์์ ) ๋๋ 'x' ๋ฒํผ ํด๋ฆญ์ผ๋ก ์ญ์ ๊ฐ ๊ฐ๋ฅํฉ๋๋ค.
|
|
67
|
+
* - **Screen Reader**: ์ถ๊ฐ๋ ๊ฐ ํ๊ทธ์ ๋ด์ฉ๊ณผ ์ญ์ ๋ฒํผ์ ์ญํ ์ ์์ฑ์ผ๋ก ์๋ดํฉ๋๋ค.
|
|
68
|
+
*
|
|
69
|
+
* ## Example
|
|
70
|
+
*
|
|
71
|
+
* {@tool snippet}
|
|
72
|
+
* ๊ธฐ๋ณธ์ ์ธ ํ๊ทธ ์
๋ ฅ ์์:
|
|
73
|
+
*
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <TagInput
|
|
76
|
+
* label="๊ฒ์๊ธ ํ๊ทธ"
|
|
77
|
+
* maxTags={5}
|
|
78
|
+
* placeholder="ํ๊ทธ ์
๋ ฅ ํ Enter"
|
|
79
|
+
* value={['React', 'Next.js']}
|
|
80
|
+
* onChange={(tags) => console.log(tags)}
|
|
81
|
+
* />
|
|
82
|
+
* ```
|
|
83
|
+
* {@end-tool}
|
|
84
|
+
*
|
|
85
|
+
* {@tool snippet}
|
|
86
|
+
* ์ปค์คํ
์ ํจ์ฑ ๊ฒ์ฌ๊ฐ ํฌํจ๋ ํ๊ทธ ์
๋ ฅ:
|
|
87
|
+
*
|
|
88
|
+
* ```tsx
|
|
89
|
+
* <TagInput
|
|
90
|
+
* validateTag={(tag) => {
|
|
91
|
+
* if (tag.length < 2) return "ํ๊ทธ๋ 2๊ธ์ ์ด์์ด์ด์ผ ํฉ๋๋ค.";
|
|
92
|
+
* return true;
|
|
93
|
+
* }}
|
|
94
|
+
* />
|
|
95
|
+
* ```
|
|
96
|
+
* {@end-tool}
|
|
97
|
+
*
|
|
98
|
+
* {@tool snippet}
|
|
99
|
+
* ๊ฐ๋ก ๋ฐฐ์น ๋ ์ด์์:
|
|
100
|
+
*
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <TagInput
|
|
103
|
+
* label="ํค์๋"
|
|
104
|
+
* required={true}
|
|
105
|
+
* labelLayout="horizontal"
|
|
106
|
+
* labelWidth="150px"
|
|
107
|
+
* placeholder="ํ๊ทธ ์
๋ ฅ ํ Enter"
|
|
108
|
+
* />
|
|
109
|
+
* ```
|
|
110
|
+
* {@end-tool}
|
|
111
|
+
*
|
|
112
|
+
* See also:
|
|
113
|
+
*
|
|
114
|
+
* - {@link TextInput}, ๋จ์ ํ
์คํธ ์
๋ ฅ์ด ํ์ํ ๊ฒฝ์ฐ
|
|
115
|
+
* - {@link Combobox}, ๋ชฉ๋ก์์ ๊ฒ์ํ์ฌ ํ๊ทธ๋ฅผ ์ถ๊ฐํ๊ณ ์ถ์ ๊ฒฝ์ฐ
|
|
116
|
+
*
|
|
117
|
+
* ## ์ฐธ๊ณ ์ฌ์ง
|
|
118
|
+
* 
|
|
119
|
+
*/
|
|
120
|
+
export declare const TagInput: React.ForwardRefExoticComponent<TagInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
121
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TagInput';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const textVariants: (props?: ({
|
|
5
|
+
variant?: "h2" | "h3" | "body" | "caption" | "h1" | "subtitle" | "emphasis" | "price" | null | undefined;
|
|
6
|
+
align?: "center" | "right" | "left" | null | undefined;
|
|
7
|
+
decoration?: "none" | "underline" | "lineThrough" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export interface TextProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof textVariants> {
|
|
10
|
+
as?: "p" | "span" | "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label";
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ์ผ๊ด๋ ํ์ดํฌ๊ทธ๋ํผ ์์คํ
์ ์ ์ฉํ๊ธฐ ์ํ ํ
์คํธ ์ปดํฌ๋ํธ์
๋๋ค.
|
|
15
|
+
*
|
|
16
|
+
* {@link Text}๋ ์ ๋ชฉ(Heading), ๋ณธ๋ฌธ(Body), ์บก์
(Caption) ๋ฑ ๋ฏธ๋ฆฌ ์ ์๋ ์คํ์ผ์ ์ ๊ณตํ์ฌ
|
|
17
|
+
* ๋์์ธ ์ผ๊ด์ฑ์ ์ ์งํ๊ณ ํ
์คํธ์ ์๋ฏธ์ ๊ตฌ์กฐ(Semantic Structure)๋ฅผ ์ฝ๊ฒ ์ ์ํ ์ ์๊ฒ ํฉ๋๋ค.
|
|
18
|
+
*
|
|
19
|
+
* ## When (์ธ์ ์ฌ์ฉํด์ผ ํ๋๊ฐ)
|
|
20
|
+
*
|
|
21
|
+
* **์ฌ์ฉํด์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
22
|
+
* - **ํ์ด์ง ์ ๋ชฉ ๋ฐ ๋ถ์ ๋ชฉ**: ํ๋ฉด์ ์๊ณ๋ฅผ ๋๋๋ ํ์ดํ์ ์์ฑํ ๋
|
|
23
|
+
* - **๋ณธ๋ฌธ ์ฝํ
์ธ **: ์ผ๋ฐ์ ์ธ ์ค๋ช
๊ธ์ด๋ ๋ฐ์ดํฐ๋ฅผ ํ์ํ ๋
|
|
24
|
+
* - **์บก์
๋ฐ ํํธ**: ๋ถ๊ฐ์ ์ธ ์ค๋ช
์ด๋ ์์ ํฌ๊ธฐ์ ์ ๋ณด๊ฐ ํ์ํ ๋
|
|
25
|
+
* - **์ ํํ๋ ์คํ์ผ**: ํน์ ํฐํธ ๋๊ป๋ ํฌ๊ธฐ๋ฅผ ์์คํ
๊ท์น์ ๋ง์ถฐ ์ ์ฉํด์ผ ํ ๋
|
|
26
|
+
*
|
|
27
|
+
* **์ฌ์ฉํ์ง ๋ง์์ผ ํ๋ ๊ฒฝ์ฐ:**
|
|
28
|
+
* - **๋ณต์กํ ์คํ์ผ๋ง**: ์์คํ
์ ์ ๋ฒ์๋ฅผ ํฌ๊ฒ ๋ฒ์ด๋๋ ํน์ ์คํ์ผ์ ๋ณ๋ CSS ํด๋์ค๋ฅผ ํ์ฉํ์ธ์.
|
|
29
|
+
*
|
|
30
|
+
* ## Layout behavior
|
|
31
|
+
*
|
|
32
|
+
* - **Semantic Tag**: `as` prop์ ํตํด ์ค์ HTML ํ๊ทธ(`h1`, `p`, `span` ๋ฑ)๋ฅผ ๊ฒฐ์ ํ ์ ์์ด SEO์ ์ ๊ทผ์ฑ์ ์ ๋ฆฌํฉ๋๋ค.
|
|
33
|
+
* - **Alignment**: `align` ์์ฑ์ ํตํด ์ผ์ชฝ, ์ค์, ์ค๋ฅธ์ชฝ ์ ๋ ฌ์ ์์ฝ๊ฒ ์กฐ์ ํ ์ ์์ต๋๋ค.
|
|
34
|
+
*
|
|
35
|
+
* ## Usage guidelines
|
|
36
|
+
*
|
|
37
|
+
* ### โ
Do (๊ถ์ฅ ์ฌํญ)
|
|
38
|
+
*
|
|
39
|
+
* - **์๋ฏธ๋ก ์ ํ๊ทธ ์ฌ์ฉ**: ์ ๋ชฉ์๋ `as="h1"`, ๋ณธ๋ฌธ์๋ `as="p"`๋ฅผ ์ฌ์ฉํ๋ ๋ฑ ๋งฅ๋ฝ์ ๋ง๋ ํ๊ทธ๋ฅผ ์ ํํ์ธ์.
|
|
40
|
+
* - **๊ณ์ธต ๊ตฌ์กฐ ์ค์**: ํฐ ์ ๋ชฉ(h1) ์๋์ ์์ ์ ๋ชฉ(h2, h3)์ด ์ค๋๋ก ๋
ผ๋ฆฌ์ ์ธ ํ๋ฆ์ ์ ์งํ์ธ์.
|
|
41
|
+
* - **๋ณํ(Variant) ํ์ฉ**: ํฐํธ ํฌ๊ธฐ์ ๋๊ป๋ฅผ ์ง์ ์กฐ์ ํ๊ธฐ๋ณด๋ค ์ ๊ณต๋๋ `variant`๋ฅผ ์ฐ์ ์ ์ผ๋ก ์ฌ์ฉํ์ธ์.
|
|
42
|
+
*
|
|
43
|
+
* ### ๐ซ Don't (์ฃผ์/๊ธ์ง ์ฌํญ)
|
|
44
|
+
*
|
|
45
|
+
* - **๊ณผ๋ํ ํฐํธ ํฌ๊ธฐ ์ฌ์ฉ**: ๊ฐ๊ธ์ ์์คํ
์์ ์ ์ํ ํฌ๊ธฐ๋ฅผ ๋ฒ์ด๋์ง ์๋๋ก ์ฃผ์ํ์ธ์.
|
|
46
|
+
* - **์๋ฏธ์ ๋ง์ง ์๋ ํ๊ทธ**: ์๊ฐ์ ์ผ๋ก๋ง ํฌ๊ฒ ๋ณด์ด๊ธฐ ์ํด ์ ๋ชฉ ํ๊ทธ๋ฅผ ๋จ์ฉํ์ง ๋ง์ธ์.
|
|
47
|
+
*
|
|
48
|
+
* ## Example
|
|
49
|
+
*
|
|
50
|
+
* {@tool snippet}
|
|
51
|
+
* ๋ค์ํ ์๊ณ์ ํ
์คํธ ๊ตฌ์ฑ:
|
|
52
|
+
*
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <div className="space-y-4">
|
|
55
|
+
* <Text variant="h1" as="h1">๋์๋ณด๋</Text>
|
|
56
|
+
* <Text variant="subtitle">์ค๋์ ์์ฝ ์ ๋ณด์
๋๋ค.</Text>
|
|
57
|
+
* <Text variant="body">
|
|
58
|
+
* ํ์ฌ ํ์ฑํ๋ ์ฌ์ฉ์๋ ์ด 1,234๋ช
์ด๋ฉฐ, ์ด์ ๋๋น 5% ์ฆ๊ฐํ์ต๋๋ค.
|
|
59
|
+
* </Text>
|
|
60
|
+
* <Text variant="caption" align="right">์ต๊ทผ ์
๋ฐ์ดํธ: 2024-01-24</Text>
|
|
61
|
+
* </div>
|
|
62
|
+
* ```
|
|
63
|
+
* {@end-tool}
|
|
64
|
+
*
|
|
65
|
+
* See also:
|
|
66
|
+
*
|
|
67
|
+
* - {@link TextInput}, ์ฌ์ฉ์์ ์
๋ ฅ์ ๋ฐ๋ ํ
์คํธ ํ๋
|
|
68
|
+
* - {@link Button}, ํ
์คํธ๋ฅผ ํฌํจํ๋ ์ก์
์์
|
|
69
|
+
*
|
|
70
|
+
* ## ์ฐธ๊ณ ์ฌ์ง
|
|
71
|
+
* 
|
|
72
|
+
*/
|
|
73
|
+
export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
|
|
74
|
+
export {};
|