@cashdoc/cashdoc-cms-design-system 1.0.12 → 1.0.13

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 (62) hide show
  1. package/README.md +22 -1
  2. package/package.json +25 -4
  3. package/dist/.gitkeep +0 -0
  4. package/dist/components/Button/Button.d.ts +0 -127
  5. package/dist/components/Button/index.d.ts +0 -1
  6. package/dist/components/Checkbox/Checkbox.d.ts +0 -87
  7. package/dist/components/Checkbox/index.d.ts +0 -2
  8. package/dist/components/DatePicker/DatePicker.d.ts +0 -98
  9. package/dist/components/DatePicker/index.d.ts +0 -2
  10. package/dist/components/DateRangePicker/DateRangePicker.d.ts +0 -93
  11. package/dist/components/DateRangePicker/index.d.ts +0 -2
  12. package/dist/components/Dropdown/Combobox.d.ts +0 -86
  13. package/dist/components/Dropdown/Dropdown.d.ts +0 -106
  14. package/dist/components/Dropdown/Select.d.ts +0 -87
  15. package/dist/components/Dropdown/index.d.ts +0 -3
  16. package/dist/components/FileUpload/FileUpload.d.ts +0 -58
  17. package/dist/components/FileUpload/index.d.ts +0 -2
  18. package/dist/components/ImageUpload/ImageUpload.d.ts +0 -154
  19. package/dist/components/ImageUpload/index.d.ts +0 -2
  20. package/dist/components/LoadingCircle/LoadingCircle.d.ts +0 -76
  21. package/dist/components/LoadingCircle/index.d.ts +0 -1
  22. package/dist/components/Modal/ConfirmModal.d.ts +0 -36
  23. package/dist/components/Modal/DeleteModal.d.ts +0 -33
  24. package/dist/components/Modal/ErrorModal.d.ts +0 -32
  25. package/dist/components/Modal/Modal.d.ts +0 -185
  26. package/dist/components/Modal/SuccessModal.d.ts +0 -31
  27. package/dist/components/Modal/WarningModal.d.ts +0 -35
  28. package/dist/components/Modal/index.d.ts +0 -12
  29. package/dist/components/Pagination/Pagination.d.ts +0 -106
  30. package/dist/components/Pagination/index.d.ts +0 -2
  31. package/dist/components/Popover/Popover.d.ts +0 -75
  32. package/dist/components/Popover/PopoverMenuItem.d.ts +0 -36
  33. package/dist/components/Popover/index.d.ts +0 -3
  34. package/dist/components/RadioButton/RadioButton.d.ts +0 -84
  35. package/dist/components/RadioButton/index.d.ts +0 -1
  36. package/dist/components/SideNavigation/SideNavigation.d.ts +0 -98
  37. package/dist/components/SideNavigation/index.d.ts +0 -1
  38. package/dist/components/Switch/Switch.d.ts +0 -71
  39. package/dist/components/Switch/index.d.ts +0 -1
  40. package/dist/components/Table/Table.d.ts +0 -192
  41. package/dist/components/Table/index.d.ts +0 -2
  42. package/dist/components/TagInput/TagInput.d.ts +0 -118
  43. package/dist/components/TagInput/index.d.ts +0 -1
  44. package/dist/components/Text/Text.d.ts +0 -71
  45. package/dist/components/Text/index.d.ts +0 -2
  46. package/dist/components/TextInput/TextInput.d.ts +0 -94
  47. package/dist/components/TextInput/index.d.ts +0 -2
  48. package/dist/components/TimePicker/TimePicker.d.ts +0 -110
  49. package/dist/components/TimePicker/index.d.ts +0 -2
  50. package/dist/components/Toast/Toaster.d.ts +0 -84
  51. package/dist/components/Toast/index.d.ts +0 -4
  52. package/dist/components/ToolTip/ToolTip.d.ts +0 -110
  53. package/dist/components/ToolTip/index.d.ts +0 -2
  54. package/dist/components/icons/index.d.ts +0 -61
  55. package/dist/components/index.d.ts +0 -21
  56. package/dist/index.d.ts +0 -3
  57. package/dist/index.es.js +0 -5233
  58. package/dist/index.es.js.map +0 -1
  59. package/dist/index.umd.js +0 -2
  60. package/dist/index.umd.js.map +0 -1
  61. package/dist/style.css +0 -1
  62. package/dist/utils/cn.d.ts +0 -3
@@ -1,185 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- export interface ModalProps {
4
- open: boolean;
5
- onOpenChange: (open: boolean) => void;
6
- icon?: React.ReactNode;
7
- title?: React.ReactNode;
8
- children: React.ReactNode;
9
- footer?: React.ReactNode;
10
- className?: string;
11
- showCloseButton?: boolean;
12
- size?: "sm" | "md" | "lg";
13
- }
14
- /**
15
- * 사용자에게 중요한 정보를 표시하거나 입력을 요구하는 오버레이 대화상자입니다.
16
- *
17
- * {@link Modal}은 사용자의 주의를 집중시켜야 하는 상황에서 사용됩니다.
18
- * 모달이 열리면 배경이 어두워지며, 사용자는 모달과 상호작용하거나 닫기 전까지
19
- * 페이지의 다른 부분과 상호작용할 수 없습니다.
20
- *
21
- * Radix UI의 Dialog 컴포넌트를 기반으로 구현되어 접근성과 키보드 내비게이션이
22
- * 자동으로 처리됩니다.
23
- *
24
- * ## When (언제 사용해야 하는가)
25
- *
26
- * **사용해야 하는 경우:**
27
- * - **중요한 의사 결정**: 삭제, 저장, 제출 등 되돌릴 수 없는 작업 확인
28
- * - **필수 정보 입력**: 다음 단계로 진행하기 전 반드시 입력해야 하는 정보 수집
29
- * - **중요 알림**: 사용자가 반드시 확인해야 하는 에러, 경고, 성공 메시지
30
- * - **간단한 폼**: 페이지 전환 없이 빠르게 정보를 입력받아야 할 때
31
- *
32
- * **사용하지 말아야 하는 경우:**
33
- * - **긴급하지 않은 알림**: Toast 컴포넌트를 사용하세요
34
- * - **복잡한 다단계 폼**: 별도 페이지로 이동하세요
35
- * - **많은 정보 표시**: 페이지 내 섹션으로 구현하세요
36
- * - **비필수 부가 정보**: Popover나 Tooltip을 사용하세요
37
- *
38
- * ## Layout behavior
39
- *
40
- * 모달은 항상 화면 중앙에 고정되며, 배경 오버레이는 전체 화면을 덮습니다.
41
- * 크기는 `size` prop에 따라 결정됩니다:
42
- * - `sm`: 최대 너비 24rem (384px) - 간단한 확인 대화상자
43
- * - `md`: 최대 너비 28rem (448px) - 기본값, 일반적인 폼이나 메시지
44
- * - `lg`: 최대 너비 32rem (512px) - 많은 내용이나 복잡한 폼
45
- *
46
- * 모달의 높이는 콘텐츠에 따라 자동으로 조절되며, 화면을 넘어가면 스크롤이 발생합니다.
47
- *
48
- * ## Usage guidelines
49
- *
50
- * ### ✅ Do (권장 사항)
51
- *
52
- * - **명확한 제목 사용**: 모달의 목적을 한눈에 알 수 있는 제목을 제공하세요
53
- * ```tsx
54
- * <Modal title="항목 삭제">...</Modal> // Good
55
- * <Modal title="확인">...</Modal> // Bad - 너무 모호함
56
- * ```
57
- *
58
- * - **행동 지향적 버튼**: 버튼 레이블은 수행할 동작을 명확히 표현하세요
59
- * ```tsx
60
- * <Button>삭제하기</Button> // Good
61
- * <Button>확인</Button> // Bad - 무엇을 확인하는지 불명확
62
- * ```
63
- *
64
- * - **적절한 크기 선택**: 콘텐츠 양에 맞는 size를 선택하세요
65
- * - **명확한 닫기 방법**: X 버튼, 취소 버튼, 배경 클릭 중 최소 하나는 제공하세요
66
- * - **중요도에 따른 변형**: ConfirmModal, SuccessModal, ErrorModal 등 사용
67
- *
68
- * ### 🚫 Don't (주의/금지 사항)
69
- *
70
- * - **모달 위에 모달을 띄우지 마세요** - UX가 복잡해지고 혼란스러워집니다
71
- * - **긴 스크롤이 필요한 콘텐츠는 피하세요** - 별도 페이지로 이동하는 것이 좋습니다
72
- * - **자동으로 모달을 열지 마세요** - 사용자의 명시적 동작(클릭 등) 후에만 열어야 합니다
73
- * - **모달 없이도 작업 가능한 경우** - 불필요하게 모달을 사용하지 마세요
74
- * - **모바일에서 큰 모달(lg) 사용 지양** - 화면을 거의 다 차지하므로 페이지 이동 권장
75
- *
76
- * ## Accessibility
77
- *
78
- * 이 컴포넌트는 WAI-ARIA Dialog 패턴을 따릅니다:
79
- *
80
- * - **키보드 내비게이션**:
81
- * - `Esc`: 모달 닫기
82
- * - `Tab`: 모달 내부 포커스 순환 (모달 외부로 나가지 않음)
83
- * - 모달이 열리면 첫 번째 포커스 가능한 요소로 자동 포커스
84
- *
85
- * - **스크린 리더**:
86
- * - `role="dialog"`: 대화상자임을 인식
87
- * - `aria-labelledby`: title이 모달의 레이블로 연결됨
88
- * - `aria-describedby`: children 콘텐츠가 설명으로 연결됨
89
- *
90
- * - **포커스 트랩**: 모달이 열려있는 동안 포커스가 모달 내부에서만 순환합니다
91
- * - **배경 스크롤 방지**: 모달이 열리면 body 스크롤이 자동으로 비활성화됩니다
92
- *
93
- * ## Example
94
- *
95
- * {@tool snippet}
96
- * 기본적인 확인 모달 예시:
97
- *
98
- * ```tsx
99
- * function DeleteConfirmDialog() {
100
- * const [open, setOpen] = useState(false);
101
- *
102
- * return (
103
- * <>
104
- * <Button onClick={() => setOpen(true)}>삭제</Button>
105
- * <Modal
106
- * open={open}
107
- * onOpenChange={setOpen}
108
- * title="항목 삭제"
109
- * footer={
110
- * <div className="flex gap-2">
111
- * <Button onClick={() => setOpen(false)} variant="outline">
112
- * 취소
113
- * </Button>
114
- * <Button onClick={handleDelete} variant="destructive">
115
- * 삭제하기
116
- * </Button>
117
- * </div>
118
- * }
119
- * >
120
- * 이 항목을 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.
121
- * </Modal>
122
- * </>
123
- * );
124
- * }
125
- * ```
126
- * {@end-tool}
127
- *
128
- * {@tool snippet}
129
- * 성공 아이콘이 포함된 모달 예시:
130
- *
131
- * ```tsx
132
- * <Modal
133
- * open={open}
134
- * onOpenChange={setOpen}
135
- * icon={<CheckCircle className="w-12 h-12 text-green-500" />}
136
- * title="저장 완료"
137
- * footer={
138
- * <Button onClick={() => setOpen(false)} className="w-full">
139
- * 확인
140
- * </Button>
141
- * }
142
- * >
143
- * 데이터가 성공적으로 저장되었습니다.
144
- * </Modal>
145
- * ```
146
- * {@end-tool}
147
- *
148
- * {@tool snippet}
149
- * 큰 크기의 폼 모달 예시:
150
- *
151
- * ```tsx
152
- * <Modal
153
- * open={open}
154
- * onOpenChange={setOpen}
155
- * title="새 사용자 추가"
156
- * size="lg"
157
- * footer={
158
- * <div className="flex justify-end gap-2">
159
- * <Button variant="outline" onClick={() => setOpen(false)}>
160
- * 취소
161
- * </Button>
162
- * <Button onClick={handleSubmit}>저장</Button>
163
- * </div>
164
- * }
165
- * >
166
- * <form className="space-y-4">
167
- * <TextInput label="이름" required />
168
- * <TextInput label="이메일" type="email" required />
169
- * <TextInput label="전화번호" />
170
- * </form>
171
- * </Modal>
172
- * ```
173
- * {@end-tool}
174
- *
175
- * See also:
176
- *
177
- * - {@link ConfirmModal}, 간단한 확인 모달을 위한 사전 구성된 변형
178
- * - {@link SuccessModal}, 성공 메시지를 표시하는 모달
179
- * - {@link ErrorModal}, 에러 메시지를 표시하는 모달
180
- * - {@link WarningModal}, 경고 메시지를 표시하는 모달
181
- * - {@link DeleteModal}, 삭제 확인을 위한 모달
182
- * - {@link Toast}, 긴급하지 않은 알림을 위한 컴포넌트
183
- * - {@link Popover}, 비필수 부가 정보를 표시하는 컴포넌트
184
- */
185
- export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,31 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- export interface SuccessModalProps {
4
- open: boolean;
5
- onOpenChange: (open: boolean) => void;
6
- title?: string;
7
- message: React.ReactNode;
8
- confirmText?: string;
9
- onConfirm?: () => void;
10
- className?: string;
11
- }
12
- /**
13
- * 요청한 작업이 성공적으로 완료되었음을 축하하거나 알리는 모달입니다.
14
- *
15
- * {@link SuccessModal}은 초록색 체크 아이콘을 통해 긍정적인 결과를 전달합니다.
16
- * 단순한 Toast 알림보다 더 강조된 확인이 필요할 때 사용됩니다.
17
- *
18
- * ## When (언제 사용해야 하는가)
19
- *
20
- * **사용해야 하는 경우:**
21
- * - **중요 작업 완료**: 회원가입 완료, 대규모 데이터 처리 완료 등
22
- * - **영구적 저장 완료**: 중요한 설정이나 게시글이 성공적으로 서버에 저장되었을 때
23
- *
24
- * ## Usage guidelines
25
- *
26
- * ### ✅ Do (권장 사항)
27
- *
28
- * - **긍정적인 피드백**: "처리가 완료되었습니다" 보다는 "성공적으로 저장되었습니다"와 같이 명확한 피드백을 제공하세요.
29
- * - **후속 조치 안내**: 필요한 경우 다음 단계로 무엇을 해야 하는지(예: 리스트로 이동 등) 메시지에 포함하세요.
30
- */
31
- export declare const SuccessModal: React.ForwardRefExoticComponent<SuccessModalProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,35 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- export interface WarningModalProps {
4
- open: boolean;
5
- onOpenChange: (open: boolean) => void;
6
- title?: string;
7
- message: React.ReactNode;
8
- confirmText?: string;
9
- onConfirm?: () => void;
10
- cancelText?: string;
11
- onCancel?: () => void;
12
- className?: string;
13
- }
14
- /**
15
- * 잠재적인 문제를 경고하거나 주의가 필요한 작업을 수행하기 전 사용자의 동의를 구하는 모달입니다.
16
- *
17
- * {@link WarningModal}은 주황색 경고 아이콘을 통해 주의를 환기시킵니다.
18
- * 완전한 파괴적 액션(삭제)은 아니지만, 데이터 변경이나 시스템 설정 변경 등
19
- * 신중함이 필요한 상황에서 사용됩니다.
20
- *
21
- * ## When (언제 사용해야 하는가)
22
- *
23
- * **사용해야 하는 경우:**
24
- * - **데이터 변경**: 기존 정보를 대량으로 수정하거나 업데이트할 때
25
- * - **민감한 설정 변경**: 시스템 동작에 영향을 줄 수 있는 설정을 변경할 때
26
- * - **동작 확인**: 예기치 않은 부작용이 발생할 수 있는 기능을 실행할 때
27
- *
28
- * ## Usage guidelines
29
- *
30
- * ### ✅ Do (권장 사항)
31
- *
32
- * - **위험성 명시**: 이 작업을 실행했을 때 어떤 결과가 초래될 수 있는지 명확히 설명하세요.
33
- * - **취소 옵션 제공**: 사용자가 마음을 바꿀 수 있도록 명확한 취소 버튼을 함께 배치하세요.
34
- */
35
- export declare const WarningModal: React.ForwardRefExoticComponent<WarningModalProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,12 +0,0 @@
1
- export { Modal } from './Modal';
2
- export type { ModalProps } from './Modal';
3
- export { ConfirmModal } from './ConfirmModal';
4
- export type { ConfirmModalProps } from './ConfirmModal';
5
- export { DeleteModal } from './DeleteModal';
6
- export type { DeleteModalProps } from './DeleteModal';
7
- export { ErrorModal } from './ErrorModal';
8
- export type { ErrorModalProps } from './ErrorModal';
9
- export { WarningModal } from './WarningModal';
10
- export type { WarningModalProps } from './WarningModal';
11
- export { SuccessModal } from './SuccessModal';
12
- export type { SuccessModalProps } from './SuccessModal';
@@ -1,106 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- export interface PaginationProps {
4
- currentPage: number;
5
- totalPages: number;
6
- onPageChange: (page: number) => void;
7
- siblingCount?: number;
8
- showPrevNext?: boolean;
9
- disabled?: boolean;
10
- className?: string;
11
- }
12
- /**
13
- * 사용자가 여러 페이지로 나뉜 콘텐츠를 탐색할 수 있게 하는 페이지네이션 컴포넌트입니다.
14
- *
15
- * {@link Pagination}은 이전/다음 버튼과 페이지 번호를 제공하며,
16
- * 많은 페이지가 있을 때 중간 페이지를 생략(ellipsis)하여 UI를 깔끔하게 유지합니다.
17
- *
18
- * ## When (언제 사용해야 하는가)
19
- *
20
- * **사용해야 하는 경우:**
21
- * - **긴 목록**: 많은 항목을 여러 페이지로 나누어 표시할 때
22
- * - **검색 결과**: 검색 결과가 여러 페이지에 걸쳐 있을 때
23
- * - **데이터 테이블**: 대량의 데이터를 페이지 단위로 보여줄 때
24
- * - **명확한 페이지 구분**: 사용자가 특정 페이지로 직접 이동할 필요가 있을 때
25
- *
26
- * **사용하지 말아야 하는 경우:**
27
- * - **무한 스크롤**: 지속적으로 콘텐츠가 로드되는 피드 형태가 더 적절한 경우
28
- * - **적은 항목**: 한 페이지에 모두 표시할 수 있는 소량의 데이터
29
- * - **단계별 프로세스**: 순차적인 단계를 나타낼 때는 Stepper 컴포넌트 사용
30
- *
31
- * ## Layout behavior
32
- *
33
- * - **Responsive**: 모바일에서는 siblingCount를 줄여 더 적은 페이지 번호를 표시하는 것을 권장
34
- * - **Centered**: 일반적으로 페이지 하단 중앙에 배치
35
- * - **Ellipsis**: 많은 페이지가 있을 때 자동으로 중간 페이지를 생략 (...으로 표시)
36
- *
37
- * ## Usage guidelines
38
- *
39
- * ### ✅ Do (권장 사항)
40
- *
41
- * - **적절한 페이지당 항목 수**: 10-50개 사이가 적절 (콘텐츠 유형에 따라 조정)
42
- * - **현재 페이지 명확히 표시**: 활성 페이지는 시각적으로 구분되어야 함
43
- * - **충분한 클릭 영역**: 모바일에서도 쉽게 탭할 수 있도록 버튼 크기 유지
44
- * - **첫/마지막 페이지 비활성화**: 이동할 수 없는 경우 버튼을 비활성화하여 명확히 표시
45
- *
46
- * ### 🚫 Don't (주의/금지 사항)
47
- *
48
- * - **너무 많은 페이지 번호**: siblingCount를 너무 크게 설정하지 마세요
49
- * - **불명확한 상태**: 로딩 중이거나 에러 상태일 때도 적절한 피드백 제공 필요
50
- *
51
- * ## Accessibility
52
- *
53
- * - **ARIA Labels**: 각 버튼에 명확한 레이블 제공 (aria-label, aria-current)
54
- * - **Keyboard Navigation**: Tab 키로 버튼 간 이동, Enter/Space로 페이지 변경
55
- * - **Screen Reader**: 현재 페이지와 전체 페이지 수를 읽어주도록 설정
56
- * - **Disabled State**: 비활성화된 버튼은 포커스할 수 없도록 처리
57
- *
58
- * ## Example
59
- *
60
- * {@tool snippet}
61
- * 기본적인 페이지네이션 사용:
62
- *
63
- * ```tsx
64
- * const [currentPage, setCurrentPage] = useState(1);
65
- * const totalPages = 10;
66
- *
67
- * <Pagination
68
- * currentPage={currentPage}
69
- * totalPages={totalPages}
70
- * onPageChange={setCurrentPage}
71
- * />
72
- * ```
73
- * {@end-tool}
74
- *
75
- * {@tool snippet}
76
- * 많은 페이지와 커스텀 siblingCount:
77
- *
78
- * ```tsx
79
- * <Pagination
80
- * currentPage={25}
81
- * totalPages={100}
82
- * siblingCount={2}
83
- * onPageChange={handlePageChange}
84
- * />
85
- * // 결과: 1 ... 23 24 25 26 27 ... 100
86
- * ```
87
- * {@end-tool}
88
- *
89
- * {@tool snippet}
90
- * 비활성화 상태:
91
- *
92
- * ```tsx
93
- * <Pagination
94
- * currentPage={5}
95
- * totalPages={10}
96
- * onPageChange={handlePageChange}
97
- * disabled={isLoading}
98
- * />
99
- * ```
100
- * {@end-tool}
101
- *
102
- * See also:
103
- *
104
- * - {@link Button}, 단일 버튼 컴포넌트
105
- */
106
- export declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,2 +0,0 @@
1
- export { Pagination } from './Pagination';
2
- export type { PaginationProps } from './Pagination';
@@ -1,75 +0,0 @@
1
- import * as PopoverPrimitive from "@radix-ui/react-popover";
2
- /**
3
- * 특정 요소 근처에 부가적인 정보나 컨트롤을 표시하는 플로팅 컴포넌트입니다.
4
- *
5
- * {@link Popover}는 사용자가 버튼이나 아이콘을 클릭했을 때 나타나며,
6
- * 기존 화면의 맥락을 유지하면서 추가적인 작업(메뉴 선택, 상세 정보 확인 등)을 수행할 수 있게 합니다.
7
- *
8
- * Radix UI의 Popover 컴포넌트를 기반으로 구현되어 포커스 트랩, 키보드 내비게이션 등이
9
- * 자동으로 처리됩니다.
10
- *
11
- * ## When (언제 사용해야 하는가)
12
- *
13
- * **사용해야 하는 경우:**
14
- * - **맥락 기반 메뉴**: '더 보기' 버튼 클릭 시 나타나는 관리 기능(수정, 삭제 등)
15
- * - **상세 정보 표시**: 아이콘 클릭 시 해당 항목에 대한 간단한 설명이나 데이터를 보여줄 때
16
- * - **간단한 설정**: 필터 옵션이나 정렬 기준을 선택할 때
17
- *
18
- * **사용하지 말아야 하는 경우:**
19
- * - **중요한 의사 결정**: 사용자의 주의를 완전히 집중시켜야 하는 작업은 `Modal`을 사용하세요.
20
- * - **단순 힌트**: 마우스 호버 시에만 짧게 보여주는 정보는 Tooltip을 사용하세요.
21
- * - **입력 폼**: 복잡한 입력이 필요한 경우 모달이나 별도 페이지가 더 적합할 수 있습니다.
22
- *
23
- * ## Layout behavior
24
- *
25
- * - **Anchor Positioning**: 트리거(버튼 등)를 기준으로 상하좌우 적절한 위치에 자동으로 배치됩니다.
26
- * - **Overlay**: 다른 UI 요소들 위에 겹쳐서 나타나며, 배경(Overlay)을 생성하지 않아 뒤쪽 화면을 볼 수 있습니다.
27
- * - **Size**: 콘텐츠의 양에 따라 크기가 결정되지만, `min-w-[200px]`의 최소 너비를 가집니다.
28
- *
29
- * ## Usage guidelines
30
- *
31
- * ### ✅ Do (권장 사항)
32
- *
33
- * - **명확한 트리거**: 사용자가 무엇을 클릭하면 팝오버가 열릴지 명확히 인지할 수 있는 버튼이나 아이콘을 사용하세요.
34
- * - **적절한 배치**: `align` 속성을 조절하여 팝오버가 화면 밖으로 나가지 않도록 관리하세요. (기본값: 'end')
35
- *
36
- * ### 🚫 Don't (주의/금지 사항)
37
- *
38
- * - **너무 많은 정보**: 팝오버는 빠르고 간단한 상호작용을 위한 것입니다. 너무 많은 내용을 담지 마세요.
39
- * - **비정상적인 닫기**: 팝오버 외부를 클릭하거나 `Esc`를 누르면 자연스럽게 닫히도록 기본 동작을 유지하세요.
40
- *
41
- * ## Accessibility
42
- *
43
- * - **Keyboard Interaction**: `Space`나 `Enter`로 열고, `Esc`로 닫으며, 팝오버 내부에서 `Tab` 키로 내비게이션이 가능합니다.
44
- * - **Aria Attributes**: `aria-expanded`, `aria-controls` 등의 속성이 자동으로 부여됩니다.
45
- *
46
- * ## Example
47
- *
48
- * {@tool snippet}
49
- * 버튼 클릭 시 상세 정보를 보여주는 팝오버:
50
- *
51
- * ```tsx
52
- * <Popover>
53
- * <PopoverTrigger asChild>
54
- * <Button variant="ghost">상세 정보</Button>
55
- * </PopoverTrigger>
56
- * <PopoverContent>
57
- * <div className="p-4">
58
- * <h4 className="font-bold">계정 상태</h4>
59
- * <p className="text-sm">현재 활성화된 계정입니다.</p>
60
- * </div>
61
- * </PopoverContent>
62
- * </Popover>
63
- * ```
64
- * {@end-tool}
65
- *
66
- * See also:
67
- *
68
- * - {@link Modal}, 더 중요하거나 복잡한 상호작용이 필요한 경우
69
- * - {@link Dropdown}, 정해진 리스트에서 값을 선택하는 것이 주 목적인 경우
70
- * - {@link PopoverMenuItem}, 팝오버 내부의 메뉴 항목을 구성할 때
71
- */
72
- declare const Popover: import('react').FC<PopoverPrimitive.PopoverProps>;
73
- declare const PopoverTrigger: import('react').ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
74
- declare const PopoverContent: import('react').ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
75
- export { Popover, PopoverTrigger, PopoverContent };
@@ -1,36 +0,0 @@
1
- import { VariantProps } from 'class-variance-authority';
2
- import { ButtonHTMLAttributes } from 'react';
3
-
4
- declare const popoverMenuItemVariants: (props?: ({
5
- variant?: "default" | "destructive" | null | undefined;
6
- } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
- export interface PopoverMenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof popoverMenuItemVariants> {
8
- icon?: React.ReactNode;
9
- }
10
- /**
11
- * Popover 내부에 배치되는 개별 액션 항목 컴포넌트입니다.
12
- *
13
- * {@link PopoverMenuItem}은 아이콘과 텍스트가 결합된 형태의 메뉴 버튼으로,
14
- * 일관된 패딩, 폰트, 호버 효과를 제공합니다.
15
- *
16
- * ## Example
17
- *
18
- * ```tsx
19
- * <PopoverContent>
20
- * <div className="flex flex-col gap-1">
21
- * <PopoverMenuItem icon={<EditIcon />} onClick={handleEdit}>
22
- * 수정하기
23
- * </PopoverMenuItem>
24
- * <PopoverMenuItem
25
- * variant="destructive"
26
- * icon={<TrashIcon />}
27
- * onClick={handleDelete}
28
- * >
29
- * 삭제하기
30
- * </PopoverMenuItem>
31
- * </div>
32
- * </PopoverContent>
33
- * ```
34
- */
35
- declare const PopoverMenuItem: import('react').ForwardRefExoticComponent<PopoverMenuItemProps & import('react').RefAttributes<HTMLButtonElement>>;
36
- export { PopoverMenuItem, popoverMenuItemVariants };
@@ -1,3 +0,0 @@
1
- export { Popover, PopoverTrigger, PopoverContent } from './Popover';
2
- export { PopoverMenuItem, popoverMenuItemVariants } from './PopoverMenuItem';
3
- export type { PopoverMenuItemProps } from './PopoverMenuItem';
@@ -1,84 +0,0 @@
1
- import { default as React } from 'react';
2
- import { VariantProps } from 'class-variance-authority';
3
-
4
- import * as RadioGroupPrimitives from "@radix-ui/react-radio-group";
5
- /**
6
- * 상호 배타적인 옵션 목록 중 단 하나만을 선택해야 할 때 사용하는 컴포넌트입니다.
7
- *
8
- * {@link RadioGroup}은 여러 개의 {@link RadioGroupItem}을 포함하는 컨테이너이며,
9
- * 한 번에 하나의 아이템만 선택될 수 있도록 상태를 관리합니다.
10
- *
11
- * Radix UI의 Radio Group 컴포넌트를 기반으로 구현되어 방향키를 이용한 내비게이션 등
12
- * 표준 라디오 그룹 동작을 지원합니다.
13
- *
14
- * ## When (언제 사용해야 하는가)
15
- *
16
- * **사용해야 하는 경우:**
17
- * - **단일 선택**: 성별 선택, 배송 방법 선택 등 여러 옵션 중 하나만 골라야 할 때
18
- * - **옵션 노출**: 모든 선택지가 사용자에게 한눈에 보여야 할 때 (옵션이 5개 이하인 경우 권장)
19
- *
20
- * **사용하지 말아야 하는 경우:**
21
- * - **다중 선택**: 여러 개를 동시에 선택할 수 있어야 하는 경우 `Checkbox`를 사용하세요.
22
- * - **옵션이 많은 경우**: 선택지가 5-6개를 넘어간다면 화면 공간을 위해 `Dropdown`을 사용하는 것이 좋습니다.
23
- * - **독립적 On/Off**: 단순히 하나의 항목을 켜고 끄는 것이라면 `Checkbox`나 `Switch`가 더 적절합니다.
24
- *
25
- * ## Layout behavior
26
- *
27
- * - **asChild**: `asChild` 속성을 사용하면 기본 렌더링 요소 대신 자식 요소를 렌더링하고 속성을 병합합니다.
28
- * 커스텀 컴포넌트나 다른 라이브러리와 연동할 때 유용합니다.
29
- *
30
- * ## Accessibility
31
- *
32
- * - **Keyboard Navigation**: `Tab` 키로 그룹에 진입한 후, 화살표 키(`Up`, `Down`, `Left`, `Right`)를 사용하여 옵션 간 이동 및 선택이 가능합니다.
33
- * - **Roles**: `role="radiogroup"` 및 `role="radio"` 속성이 자동으로 부여됩니다.
34
- *
35
- * ## Example
36
- *
37
- * {@tool snippet}
38
- * 기본적인 라디오 그룹 사용 예시:
39
- *
40
- * ```tsx
41
- * <RadioGroup defaultValue="apple" onValueChange={(val) => console.log(val)}>
42
- * <div className="flex items-center gap-2">
43
- * <RadioGroupItem value="apple" id="apple" />
44
- * <label htmlFor="apple">사과</label>
45
- * </div>
46
- * <div className="flex items-center gap-2">
47
- * <RadioGroupItem value="banana" id="banana" />
48
- * <label htmlFor="banana">바나나</label>
49
- * </div>
50
- * </RadioGroup>
51
- * ```
52
- * {@end-tool}
53
- *
54
- * {@tool snippet}
55
- * `asChild`를 사용한 커스텀 렌더링 예시:
56
- *
57
- * ```tsx
58
- * <RadioGroup asChild>
59
- * <section className="my-custom-group">
60
- * <RadioGroupItem asChild value="custom">
61
- * <button type="button" className="custom-radio-trigger">
62
- * 커스텀 라디오
63
- * </button>
64
- * </RadioGroupItem>
65
- * </section>
66
- * </RadioGroup>
67
- * ```
68
- * {@end-tool}
69
- *
70
- * See also:
71
- *
72
- * - {@link Checkbox}, 다중 선택이 필요한 경우
73
- * - {@link Dropdown}, 옵션이 많아 리스트로 숨겨야 하는 경우
74
- * - {@link Switch}, 단순 활성화/비활성화를 토글할 때
75
- */
76
- declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitives.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
77
- declare const radioGroupItemVariants: (props?: ({
78
- variant?: "default" | "green" | "black" | "blue" | "red" | null | undefined;
79
- size?: "sm" | "lg" | "md" | null | undefined;
80
- } & import('class-variance-authority/types').ClassProp) | undefined) => string;
81
- export interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitives.Item>, VariantProps<typeof radioGroupItemVariants> {
82
- }
83
- declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
84
- export { RadioGroup, RadioGroupItem };
@@ -1 +0,0 @@
1
- export * from './RadioButton';