@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,97 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const textInputVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "error" | null | undefined;
|
|
6
|
+
fullWidth?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof textInputVariants> {
|
|
9
|
+
label?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
helperText?: string;
|
|
14
|
+
showCharCount?: boolean;
|
|
15
|
+
labelLayout?: "vertical" | "horizontal";
|
|
16
|
+
labelWidth?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 사용자로부터 텍스트, 이메일, 숫자 등의 단일 라인 데이터를 입력받는 필드입니다.
|
|
20
|
+
*
|
|
21
|
+
* {@link TextInput}은 가장 기본적인 폼 입력 요소로, label, placeholder, 에러 메시지,
|
|
22
|
+
* helper 텍스트, 글자 수 카운터 등을 통합적으로 제공합니다. 일관된 스타일과 동작으로
|
|
23
|
+
* 사용자 경험을 향상시킵니다.
|
|
24
|
+
*
|
|
25
|
+
* ## When (언제 사용해야 하는가)
|
|
26
|
+
*
|
|
27
|
+
* **사용해야 하는 경우:**
|
|
28
|
+
* - **단일 라인 텍스트 입력**: 이름, 이메일, 전화번호 등 한 줄로 입력 가능한 정보
|
|
29
|
+
* - **특정 타입 입력**: email, password, number, date 등 HTML input type을 활용
|
|
30
|
+
* - **글자 수 제한**: 최대 글자 수를 지정하고 실시간으로 카운터를 표시
|
|
31
|
+
* - **유효성 검증**: 에러 상태와 메시지를 통해 사용자에게 피드백 제공
|
|
32
|
+
* - **필수 입력**: `required` 속성을 사용하여 반드시 입력해야 함을 시각적으로 안내
|
|
33
|
+
*
|
|
34
|
+
* ## Layout behavior
|
|
35
|
+
*
|
|
36
|
+
* TextInput은 기본적으로 부모 요소의 전체 너비(`fullWidth={true}`)를 차지합니다.
|
|
37
|
+
* `fullWidth={false}`로 설정하면 내용에 맞춰 자동으로 조절됩니다.
|
|
38
|
+
*
|
|
39
|
+
* 레이블 배치는 `labelLayout` prop으로 제어됩니다:
|
|
40
|
+
* - **vertical** (기본값): Label이 입력 필드 위에 세로로 배치됩니다.
|
|
41
|
+
* - **horizontal**: Label과 입력 필드가 가로로 나란히 배치됩니다. `labelWidth`로 Label 너비를 조정할 수 있습니다 (기본값: 120px).
|
|
42
|
+
*
|
|
43
|
+
* 구조는 다음 순서로 배치됩니다:
|
|
44
|
+
* 1. **헤더 영역** (있는 경우): label (좌측, 필수 시 * 표시) + 글자 수 카운터 (우측)
|
|
45
|
+
* 2. **입력 필드**: 텍스트 입력 영역
|
|
46
|
+
* 3. **메시지 영역** (있는 경우): errorMessage 또는 helperText
|
|
47
|
+
*
|
|
48
|
+
* 높이는 `h-10` (2.5rem / 40px)로 고정되어 일관된 버튼 높이와 정렬됩니다.
|
|
49
|
+
*
|
|
50
|
+
* ## Usage guidelines
|
|
51
|
+
*
|
|
52
|
+
* ### ✅ Do (권장 사항)
|
|
53
|
+
*
|
|
54
|
+
* - **명확한 label 제공**: 무엇을 입력해야 하는지 명확하게 표시하세요
|
|
55
|
+
* - **필수 여부 명시**: 반드시 입력해야 하는 필드라면 `required` 속성을 활성화하세요.
|
|
56
|
+
* - **가로 배치 활용**: 폼에서 여러 입력 필드를 정렬할 때는 `labelLayout="horizontal"`을 사용하여 일관된 레이아웃을 유지하세요.
|
|
57
|
+
*
|
|
58
|
+
* ## Example
|
|
59
|
+
*
|
|
60
|
+
* {@tool snippet}
|
|
61
|
+
* 레이블과 필수 표시가 포함된 입력 필드:
|
|
62
|
+
*
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <TextInput
|
|
65
|
+
* label="사용자 아이디"
|
|
66
|
+
* required={true}
|
|
67
|
+
* placeholder="아이디를 입력하세요"
|
|
68
|
+
* />
|
|
69
|
+
* ```
|
|
70
|
+
* {@end-tool}
|
|
71
|
+
*
|
|
72
|
+
* {@tool snippet}
|
|
73
|
+
* 가로 배치 레이아웃:
|
|
74
|
+
*
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <TextInput
|
|
77
|
+
* label="상호(법인명)"
|
|
78
|
+
* required={true}
|
|
79
|
+
* labelLayout="horizontal"
|
|
80
|
+
* labelWidth="150px"
|
|
81
|
+
* placeholder="회사명을 입력하세요"
|
|
82
|
+
* />
|
|
83
|
+
* ```
|
|
84
|
+
* {@end-tool}
|
|
85
|
+
*
|
|
86
|
+
* See also:
|
|
87
|
+
*
|
|
88
|
+
* - {@link Textarea}, 여러 줄 텍스트 입력을 위한 컴포넌트
|
|
89
|
+
* - {@link TagInput}, 여러 태그를 입력받는 컴포넌트
|
|
90
|
+
* - {@link DatePicker}, 날짜 선택을 위한 컴포넌트
|
|
91
|
+
* - {@link Dropdown}, 옵션 선택을 위한 컴포넌트
|
|
92
|
+
*
|
|
93
|
+
* ## 참고사진
|
|
94
|
+
* 
|
|
95
|
+
*/
|
|
96
|
+
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TimePickerProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (time: string) => void;
|
|
6
|
+
label?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
format?: "24h" | "12h";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
errorMessage?: string;
|
|
12
|
+
helperText?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
minuteStep?: number;
|
|
15
|
+
showIcon?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 사용자가 시간을 선택할 수 있게 하는 컴포넌트입니다.
|
|
19
|
+
*
|
|
20
|
+
* {@link TimePicker}는 직관적인 스크롤 인터페이스를 통해 시간과 분을 선택할 수 있으며,
|
|
21
|
+
* 24시간 형식과 12시간(AM/PM) 형식을 모두 지원합니다.
|
|
22
|
+
*
|
|
23
|
+
* `@radix-ui/react-popover`를 기반으로 구현되었으며, 사용자가 잘못된 시간을 입력하는 것을 방지합니다.
|
|
24
|
+
*
|
|
25
|
+
* ## When (언제 사용해야 하는가)
|
|
26
|
+
*
|
|
27
|
+
* **사용해야 하는 경우:**
|
|
28
|
+
* - **특정 시간 입력**: 예약 시간, 알림 시간, 업무 시작/종료 시간 등을 선택해야 할 때
|
|
29
|
+
* - **정확한 시간 선택**: 사용자가 직접 타이핑하여 발생할 수 있는 형식 오류를 방지하고 싶을 때
|
|
30
|
+
* - **제한된 간격 선택**: 5분, 10분, 15분 단위로만 선택이 필요한 경우 (minuteStep 사용)
|
|
31
|
+
*
|
|
32
|
+
* **사용하지 말아야 하는 경우:**
|
|
33
|
+
* - **대략적인 시간**: '오전', '오후', '저녁' 등 상대적인 시간 선택이 필요한 경우 `Dropdown`이나 `RadioButton`이 더 적절할 수 있습니다.
|
|
34
|
+
* - **초 단위 정밀도**: 현재는 시간과 분까지만 지원하므로, 초 단위가 필요한 경우 다른 컴포넌트를 고려하세요.
|
|
35
|
+
*
|
|
36
|
+
* ## Layout behavior
|
|
37
|
+
*
|
|
38
|
+
* - **Popover 기반**: 클릭 시 입력창 아래에 시간 선택 팝오버가 나타나며, 화면 공간을 효율적으로 사용합니다.
|
|
39
|
+
* - **스크롤 선택**: 시간과 분을 각각 스크롤하여 선택할 수 있어 직관적입니다.
|
|
40
|
+
* - **Full Width**: `className`을 통해 부모 요소의 너비에 맞게 조절할 수 있습니다.
|
|
41
|
+
*
|
|
42
|
+
* ## Usage guidelines
|
|
43
|
+
*
|
|
44
|
+
* ### ✅ Do (권장 사항)
|
|
45
|
+
*
|
|
46
|
+
* - **적절한 Format**: 사용자가 익숙한 형식(한국: 24시간, 미국: 12시간)을 선택하세요.
|
|
47
|
+
* - **Minute Step 활용**: 일정 간격으로만 선택이 필요한 경우 `minuteStep`을 활용하여 UX를 개선하세요.
|
|
48
|
+
* - **레이블 및 헬퍼 텍스트**: 입력 항목의 용도를 명확히 하고, 필요한 경우 보충 설명을 제공하세요.
|
|
49
|
+
*
|
|
50
|
+
* ### 🚫 Don't (주의/금지 사항)
|
|
51
|
+
*
|
|
52
|
+
* - **Read-only 입력**: 사용자가 직접 타이핑하여 입력하는 기능은 지원하지 않으므로, 반드시 UI를 통해 선택하도록 안내하세요.
|
|
53
|
+
* - **과도한 Step**: `minuteStep`이 너무 크면 정확한 시간을 선택하기 어려울 수 있습니다.
|
|
54
|
+
*
|
|
55
|
+
* ## Accessibility
|
|
56
|
+
*
|
|
57
|
+
* - **Keyboard Navigation**: 팝오버는 키보드로 열고 닫을 수 있으며, `Esc` 키로 취소할 수 있습니다.
|
|
58
|
+
* - **Focus Management**: 시간 선택기가 열려 있는 동안 포커스가 적절히 관리됩니다.
|
|
59
|
+
* - **Aria Labels**: 각 버튼에는 스크린 리더를 위한 적절한 레이블이 포함되어 있습니다.
|
|
60
|
+
*
|
|
61
|
+
* ## Example
|
|
62
|
+
*
|
|
63
|
+
* {@tool snippet}
|
|
64
|
+
* 기본적인 시간 선택 예시 (24시간 형식):
|
|
65
|
+
*
|
|
66
|
+
* ```tsx
|
|
67
|
+
* const [time, setTime] = useState("");
|
|
68
|
+
*
|
|
69
|
+
* <TimePicker
|
|
70
|
+
* label="출근 시간"
|
|
71
|
+
* value={time}
|
|
72
|
+
* onChange={setTime}
|
|
73
|
+
* placeholder="시간을 선택하세요"
|
|
74
|
+
* />
|
|
75
|
+
* ```
|
|
76
|
+
* {@end-tool}
|
|
77
|
+
*
|
|
78
|
+
* {@tool snippet}
|
|
79
|
+
* 12시간 형식 및 15분 단위 선택:
|
|
80
|
+
*
|
|
81
|
+
* ```tsx
|
|
82
|
+
* <TimePicker
|
|
83
|
+
* label="회의 시간"
|
|
84
|
+
* format="12h"
|
|
85
|
+
* minuteStep={15}
|
|
86
|
+
* value="2:30 PM"
|
|
87
|
+
* onChange={setTime}
|
|
88
|
+
* />
|
|
89
|
+
* ```
|
|
90
|
+
* {@end-tool}
|
|
91
|
+
*
|
|
92
|
+
* {@tool snippet}
|
|
93
|
+
* 에러 상태:
|
|
94
|
+
*
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <TimePicker
|
|
97
|
+
* label="마감 시간"
|
|
98
|
+
* error={true}
|
|
99
|
+
* errorMessage="업무 시간(9:00-18:00) 내에서 선택해주세요"
|
|
100
|
+
* />
|
|
101
|
+
* ```
|
|
102
|
+
* {@end-tool}
|
|
103
|
+
*
|
|
104
|
+
* See also:
|
|
105
|
+
*
|
|
106
|
+
* - {@link DatePicker}, 날짜를 선택해야 하는 경우
|
|
107
|
+
* - {@link DateRangePicker}, 날짜 범위를 선택해야 하는 경우
|
|
108
|
+
* - {@link TextInput}, 단순한 텍스트 입력이 필요한 경우
|
|
109
|
+
*
|
|
110
|
+
* ## 참고사진
|
|
111
|
+
* 
|
|
112
|
+
*/
|
|
113
|
+
export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Toaster as Sonner } from 'sonner';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
type ToasterProps = ComponentProps<typeof Sonner>;
|
|
5
|
+
/**
|
|
6
|
+
* 사용자의 액션에 대한 가벼운 피드백을 화면 구석에 일시적으로 표시하는 알림 컴포넌트입니다.
|
|
7
|
+
*
|
|
8
|
+
* {@link Toaster}는 시스템의 상태 변화(성공, 실패, 경고 등)를 비침습적인 방식으로 알립니다.
|
|
9
|
+
* `sonner` 라이브러리를 기반으로 하며, CMS 디자인 가이드에 맞춘 스타일링이 적용되어 있습니다.
|
|
10
|
+
* 어플리케이션 최상위 수준(App.tsx 등)에 한 번만 배치하면 어디서든 `toast()` 함수를 통해 알림을 띄울 수 있습니다.
|
|
11
|
+
*
|
|
12
|
+
* ## When (언제 사용해야 하는가)
|
|
13
|
+
*
|
|
14
|
+
* **사용해야 하는 경우:**
|
|
15
|
+
* - **간단한 결과 알림**: "저장되었습니다", "복사 완료" 등 짧은 피드백
|
|
16
|
+
* - **비파괴적 액션 확인**: 사용자의 흐름을 방해하지 않고 알림만 주고 싶을 때
|
|
17
|
+
* - **백그라운드 작업 완료**: 서버 요청이 성공적으로 처리되었음을 알릴 때
|
|
18
|
+
*
|
|
19
|
+
* **사용하지 말아야 하는 경우:**
|
|
20
|
+
* - **중요한 의사 결정**: 사용자가 반드시 읽고 확인 버튼을 눌러야 하는 내용은 `Modal`을 사용하세요.
|
|
21
|
+
* - **긴 메시지**: 토스트는 수초 후 사라지므로, 읽는 데 시간이 걸리는 긴 텍스트는 부적절합니다.
|
|
22
|
+
* - **에러 세부 정보**: 복잡한 에러 로그나 해결 방법이 포함된 에러는 `Modal`이나 전용 에러 페이지에서 보여주세요.
|
|
23
|
+
*
|
|
24
|
+
* ## Layout behavior
|
|
25
|
+
*
|
|
26
|
+
* - **Floating**: 화면 최상단 레이어에 고정된 위치(기본값: 하단 중앙)에 나타납니다.
|
|
27
|
+
* - **Stacking**: 여러 개의 토스트가 동시에 발생하면 차례대로 쌓여서 표시됩니다.
|
|
28
|
+
* - **Auto-dismiss**: 일정 시간(기본 4초)이 지나면 자동으로 사라집니다.
|
|
29
|
+
*
|
|
30
|
+
* ## Usage guidelines
|
|
31
|
+
*
|
|
32
|
+
* ### ✅ Do (권장 사항)
|
|
33
|
+
*
|
|
34
|
+
* - **명확하고 간결하게**: 핵심만 담은 짧은 문장을 사용하세요. (예: "이미지가 업로드되었습니다")
|
|
35
|
+
* - **적절한 타입 사용**: `toast.success`, `toast.error` 등 상황에 맞는 메서드를 사용하여 색상과 아이콘으로 의미를 전달하세요.
|
|
36
|
+
*
|
|
37
|
+
* ### 🚫 Don't (주의/금지 사항)
|
|
38
|
+
*
|
|
39
|
+
* - **중요 정보 포함**: 토스트는 금방 사라지므로, 계좌번호나 비밀번호 같은 중요 정보를 여기에만 표시해서는 안 됩니다.
|
|
40
|
+
* - **과도한 사용**: 짧은 시간에 너무 많은 토스트가 발생하면 사용자에게 스트레스를 줄 수 있습니다.
|
|
41
|
+
*
|
|
42
|
+
* ## Example
|
|
43
|
+
*
|
|
44
|
+
* {@tool snippet}
|
|
45
|
+
* 최상위 컴포넌트 설정:
|
|
46
|
+
*
|
|
47
|
+
* ```tsx
|
|
48
|
+
* function App() {
|
|
49
|
+
* return (
|
|
50
|
+
* <>
|
|
51
|
+
* <Router />
|
|
52
|
+
* <Toaster />
|
|
53
|
+
* </>
|
|
54
|
+
* );
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
* {@end-tool}
|
|
58
|
+
*
|
|
59
|
+
* {@tool snippet}
|
|
60
|
+
* 다양한 토스트 호출 방법:
|
|
61
|
+
*
|
|
62
|
+
* ```tsx
|
|
63
|
+
* // 기본
|
|
64
|
+
* toast("환영합니다!");
|
|
65
|
+
*
|
|
66
|
+
* // 성공
|
|
67
|
+
* toast.success("저장에 성공했습니다.");
|
|
68
|
+
*
|
|
69
|
+
* // 에러
|
|
70
|
+
* toast.error("서버와의 연결이 원활하지 않습니다.");
|
|
71
|
+
*
|
|
72
|
+
* // 상세 설명 포함
|
|
73
|
+
* toast("알림", {
|
|
74
|
+
* description: "새로운 메시지가 도착했습니다."
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
* {@end-tool}
|
|
78
|
+
*
|
|
79
|
+
* See also:
|
|
80
|
+
*
|
|
81
|
+
* - {@link Modal}, 더 중요하거나 명시적 확인이 필요한 알림
|
|
82
|
+
*
|
|
83
|
+
* ## 참고사진
|
|
84
|
+
* 
|
|
85
|
+
*/
|
|
86
|
+
declare const Toaster: ({ position, ...props }: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export { Toaster };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
export interface ToolTipProps extends Omit<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, "content"> {
|
|
4
|
+
/** 툴팁을 트리거하는 요소 */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** 툴팁에 표시할 내용 */
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
/** 툴팁이 나타날 위치 (기본: "top") */
|
|
9
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
10
|
+
/** 트리거로부터의 거리 (픽셀) (기본: 4) */
|
|
11
|
+
sideOffset?: number;
|
|
12
|
+
/** 트리거와의 정렬 방식 (기본: "center") */
|
|
13
|
+
align?: "start" | "center" | "end";
|
|
14
|
+
/** 마우스 호버 후 툴팁이 나타나기까지의 지연 시간 (밀리초) (기본: 200) */
|
|
15
|
+
delayDuration?: number;
|
|
16
|
+
/** 다른 툴팁에서 빠르게 진입 시 지연 건너뛰기 시간 (밀리초) (기본: 300) */
|
|
17
|
+
skipDelayDuration?: number;
|
|
18
|
+
/** 툴팁 위로 마우스를 이동할 수 있는지 여부 (기본: true) */
|
|
19
|
+
disableHoverableContent?: boolean;
|
|
20
|
+
/** 화살표 표시 여부 (기본: true) */
|
|
21
|
+
showArrow?: boolean;
|
|
22
|
+
/** Controlled 모드: 툴팁 열림 상태 */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
/** Uncontrolled 모드: 초기 열림 상태 */
|
|
25
|
+
defaultOpen?: boolean;
|
|
26
|
+
/** 툴팁 열림 상태 변경 시 콜백 */
|
|
27
|
+
onOpenChange?: (open: boolean) => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 마우스 호버나 포커스 시 간단한 힌트나 설명을 제공하는 툴팁 컴포넌트입니다.
|
|
31
|
+
*
|
|
32
|
+
* {@link ToolTip}은 UI 요소에 대한 추가 정보를 간결하게 제공하여
|
|
33
|
+
* 사용자가 인터페이스를 더 쉽게 이해할 수 있도록 돕습니다.
|
|
34
|
+
*
|
|
35
|
+
* Radix UI의 Tooltip 컴포넌트를 기반으로 구현되어 접근성 기능이
|
|
36
|
+
* 자동으로 처리됩니다.
|
|
37
|
+
*
|
|
38
|
+
* ## When (언제 사용해야 하는가)
|
|
39
|
+
*
|
|
40
|
+
* **사용해야 하는 경우:**
|
|
41
|
+
* - **아이콘 설명**: 텍스트 레이블이 없는 아이콘 버튼의 기능을 설명할 때
|
|
42
|
+
* - **축약된 텍스트**: 말줄임표(...)로 잘린 텍스트의 전체 내용을 보여줄 때
|
|
43
|
+
* - **간단한 힌트**: 입력 필드나 기능에 대한 짧은 도움말을 제공할 때
|
|
44
|
+
* - **추가 정보**: UI 요소의 상태나 제약사항을 간단히 알려줄 때
|
|
45
|
+
*
|
|
46
|
+
* **사용하지 말아야 하는 경우:**
|
|
47
|
+
* - **필수 정보**: 사용자가 반드시 알아야 하는 정보는 본문에 직접 표시하세요.
|
|
48
|
+
* - **복잡한 내용**: 여러 줄의 긴 텍스트나 인터랙티브 요소는 Popover나 Modal을 사용하세요.
|
|
49
|
+
* - **모바일 전용 UI**: 터치 기기에서는 호버가 없으므로 중요한 정보를 툴팁에만 의존하지 마세요.
|
|
50
|
+
*
|
|
51
|
+
* ## Layout behavior
|
|
52
|
+
*
|
|
53
|
+
* - **Positioning**: 트리거 요소를 기준으로 상하좌우 원하는 위치에 배치됩니다. (기본: top)
|
|
54
|
+
* - **Auto-adjustment**: 화면 경계를 벗어나지 않도록 자동으로 위치를 조정합니다.
|
|
55
|
+
* - **Floating**: 다른 UI 요소들 위에 떠 있으며, 레이아웃에 영향을 주지 않습니다.
|
|
56
|
+
* - **Arrow**: 트리거와의 연결을 시각적으로 나타내는 화살표를 선택적으로 표시할 수 있습니다.
|
|
57
|
+
*
|
|
58
|
+
* ## Usage guidelines
|
|
59
|
+
*
|
|
60
|
+
* ### ✅ Do (권장 사항)
|
|
61
|
+
*
|
|
62
|
+
* - **간결한 텍스트**: 한두 줄 이내의 짧은 텍스트로 핵심만 전달하세요.
|
|
63
|
+
* - **적절한 지연**: `delayDuration`을 조절하여 우발적인 호버로 인한 깜빡임을 방지하세요. (기본: 200ms)
|
|
64
|
+
* - **명확한 트리거**: 툴팁이 붙는 요소가 호버 가능함을 사용자가 인지할 수 있도록 하세요.
|
|
65
|
+
*
|
|
66
|
+
* ### 🚫 Don't (주의/금지 사항)
|
|
67
|
+
*
|
|
68
|
+
* - **중요 정보 숨기기**: 필수적인 정보를 툴팁에만 넣지 마세요.
|
|
69
|
+
* - **상호작용 요소**: 툴팁 내부에 클릭 가능한 버튼이나 링크를 넣지 마세요. (Popover 사용 권장)
|
|
70
|
+
* - **과도한 사용**: 모든 요소에 툴팁을 붙이면 오히려 사용성이 떨어집니다.
|
|
71
|
+
*
|
|
72
|
+
* ## Accessibility
|
|
73
|
+
*
|
|
74
|
+
* - **Keyboard Support**: 포커스 가능한 요소에 툴팁이 붙으면 포커스 시 자동으로 표시됩니다.
|
|
75
|
+
* - **ESC Key**: `Esc` 키를 누르면 툴팁이 닫힙니다.
|
|
76
|
+
* - **Screen Readers**: `aria-describedby` 속성이 자동으로 부여되어 스크린 리더가 내용을 읽습니다.
|
|
77
|
+
* - **Touch Devices**: 터치 기기에서는 탭으로 툴팁을 활성화할 수 있습니다.
|
|
78
|
+
*
|
|
79
|
+
* ## Example
|
|
80
|
+
*
|
|
81
|
+
* {@tool snippet}
|
|
82
|
+
* 아이콘 버튼에 툴팁 추가:
|
|
83
|
+
*
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <ToolTip content="설정">
|
|
86
|
+
* <Button variant="ghost" size="icon">
|
|
87
|
+
* <SettingsIcon />
|
|
88
|
+
* </Button>
|
|
89
|
+
* </ToolTip>
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* 위치와 지연 시간 커스터마이징:
|
|
93
|
+
*
|
|
94
|
+
* ```tsx
|
|
95
|
+
* <ToolTip
|
|
96
|
+
* content="이 기능은 프리미엄 사용자만 이용할 수 있습니다"
|
|
97
|
+
* side="bottom"
|
|
98
|
+
* delayDuration={300}
|
|
99
|
+
* >
|
|
100
|
+
* <Button disabled>프리미엄 기능</Button>
|
|
101
|
+
* </ToolTip>
|
|
102
|
+
* ```
|
|
103
|
+
* {@end-tool}
|
|
104
|
+
*
|
|
105
|
+
* See also:
|
|
106
|
+
*
|
|
107
|
+
* - {@link Popover}, 클릭으로 열고 상호작용이 필요한 경우
|
|
108
|
+
* - {@link Modal}, 중요한 정보나 복잡한 작업이 필요한 경우
|
|
109
|
+
* ## 참고사진
|
|
110
|
+
* 
|
|
111
|
+
*/
|
|
112
|
+
export declare const ToolTip: React.ForwardRefExoticComponent<ToolTipProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { default as React, SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
size?: number;
|
|
5
|
+
strokeWidth?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const ChevronDownIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
8
|
+
export declare const ChevronDownFillIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
9
|
+
export declare const ChevronUpIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
10
|
+
export declare const ChevronUpFillIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export declare const ChevronLeftIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
12
|
+
export declare const ChevronLeftFillIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
13
|
+
export declare const ChevronRightIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
14
|
+
export declare const ChevronRightFillIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
15
|
+
export declare const ChevronsLeftIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
16
|
+
export declare const ChevronsRightIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
17
|
+
export declare const ArrowLeftIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
18
|
+
export declare const ArrowRightIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
19
|
+
export declare const MenuIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
20
|
+
export declare const AlignIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
21
|
+
export declare const MessageSquareIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
22
|
+
export declare const MessageSquareTextIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
23
|
+
export declare const MessageCircleIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
24
|
+
export declare const XIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
25
|
+
export declare const CheckIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
26
|
+
export declare const CheckCircleIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
27
|
+
export declare const InfoIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
28
|
+
export declare const ErrorIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
29
|
+
export declare const WarningIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
30
|
+
export declare const HelpIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
31
|
+
export declare const CloseIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
32
|
+
export declare const PlusIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
33
|
+
export declare const PlusCircleIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
34
|
+
export declare const TrashIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
35
|
+
export declare const SaveIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
36
|
+
export declare const SettingsIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
37
|
+
export declare const RefreshIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
38
|
+
export declare const LinkIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
39
|
+
export declare const PinIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
40
|
+
export declare const FileIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
41
|
+
export declare const FileTextIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
42
|
+
export declare const ExcelIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
43
|
+
export declare const FileUploadIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
44
|
+
export declare const ImageUploadIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
45
|
+
export declare const CalendarIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
46
|
+
export declare const UserIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
47
|
+
export declare const UsersIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
48
|
+
export declare const ListIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
49
|
+
export declare const FileImportIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
50
|
+
export declare const FileExportIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
51
|
+
export declare const EditIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
52
|
+
export declare const Edit2Icon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
53
|
+
export declare const TrendingUpIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
54
|
+
export declare const TrendingDownIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
55
|
+
export declare const BarChartIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
56
|
+
export declare const CreditCardIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
57
|
+
export declare const ImageIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
58
|
+
export declare const BookIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
59
|
+
export declare const BookOpenIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
60
|
+
export declare const MedicashIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
61
|
+
export declare const NewBadgeIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './Button';
|
|
2
|
+
export * from './LoadingCircle';
|
|
3
|
+
export * from './Dropdown';
|
|
4
|
+
export * from './icons';
|
|
5
|
+
export * from './Popover';
|
|
6
|
+
export * from './Text';
|
|
7
|
+
export * from './TextInput';
|
|
8
|
+
export * from './DatePicker';
|
|
9
|
+
export * from './DateRangePicker';
|
|
10
|
+
export * from './TimePicker';
|
|
11
|
+
export * from './Switch';
|
|
12
|
+
export * from './RadioButton';
|
|
13
|
+
export * from './SideNavigation';
|
|
14
|
+
export * from './Pagination';
|
|
15
|
+
export * from './Checkbox';
|
|
16
|
+
export * from './Modal';
|
|
17
|
+
export * from './Toast';
|
|
18
|
+
export * from './ToolTip';
|
|
19
|
+
export * from './Table';
|
|
20
|
+
export * from './ImageUpload';
|
|
21
|
+
export * from './FileUpload';
|