@ceed/ads 1.13.4 → 1.15.0-next.2
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/dist/Overview.md +11 -0
- package/dist/components/Menu/Menu.d.ts +2 -5
- package/dist/components/Stepper/Stepper.d.ts +6 -0
- package/dist/components/data-display/Avatar.md +428 -0
- package/dist/components/data-display/Badge.md +315 -0
- package/dist/components/data-display/Chip.md +301 -0
- package/dist/components/data-display/DataTable.md +452 -0
- package/dist/components/data-display/InfoSign.md +160 -0
- package/dist/components/data-display/Markdown.md +17 -0
- package/dist/components/data-display/Table.md +1330 -0
- package/dist/components/data-display/Tooltip.md +444 -0
- package/dist/components/data-display/Typography.md +271 -0
- package/dist/components/data-display/llms.txt +17 -0
- package/dist/components/feedback/Alert.md +663 -0
- package/dist/components/feedback/Dialog.md +33 -0
- package/dist/components/feedback/Modal.md +39 -0
- package/dist/components/feedback/llms.txt +11 -0
- package/dist/components/inputs/Autocomplete.md +103 -0
- package/dist/components/inputs/Button.md +334 -0
- package/dist/components/inputs/ButtonGroup.md +382 -0
- package/dist/components/inputs/Calendar.md +19 -0
- package/dist/components/inputs/Checkbox.md +649 -0
- package/dist/components/inputs/CurrencyInput.md +91 -0
- package/dist/components/inputs/DatePicker.md +67 -0
- package/dist/components/inputs/DateRangePicker.md +55 -0
- package/dist/components/inputs/FilterMenu.md +210 -0
- package/dist/components/inputs/IconButton.md +361 -0
- package/dist/components/inputs/Input.md +283 -0
- package/dist/components/inputs/MonthPicker.md +72 -0
- package/dist/components/inputs/MonthRangePicker.md +70 -0
- package/dist/components/inputs/PercentageInput.md +116 -0
- package/dist/components/inputs/RadioButton.md +350 -0
- package/dist/components/inputs/RadioTileGroup.md +418 -0
- package/dist/components/inputs/Select.md +56 -0
- package/dist/components/inputs/Switch.md +577 -0
- package/dist/components/inputs/Textarea.md +64 -0
- package/dist/components/inputs/Uploader/Uploader.md +238 -0
- package/dist/components/inputs/Uploader/llms.txt +9 -0
- package/dist/components/inputs/llms.txt +31 -0
- package/dist/components/layout/Box.md +997 -0
- package/dist/components/layout/Container.md +23 -0
- package/dist/components/layout/Grid.md +728 -0
- package/dist/components/layout/Stack.md +937 -0
- package/dist/components/layout/llms.txt +12 -0
- package/dist/components/llms.txt +14 -0
- package/dist/components/navigation/Breadcrumbs.md +51 -0
- package/dist/components/navigation/Dropdown.md +768 -0
- package/dist/components/navigation/IconMenuButton.md +35 -0
- package/dist/components/navigation/InsetDrawer.md +133 -0
- package/dist/components/navigation/Link.md +24 -0
- package/dist/components/navigation/Menu.md +957 -0
- package/dist/components/navigation/MenuButton.md +39 -0
- package/dist/components/navigation/NavigationGroup.md +17 -0
- package/dist/components/navigation/NavigationItem.md +17 -0
- package/dist/components/navigation/Navigator.md +17 -0
- package/dist/components/navigation/Pagination.md +17 -0
- package/dist/components/navigation/ProfileMenu.md +34 -0
- package/dist/components/navigation/Stepper.md +108 -0
- package/dist/components/navigation/Tabs.md +34 -0
- package/dist/components/navigation/llms.txt +22 -0
- package/dist/components/surfaces/Accordions.md +96 -0
- package/dist/components/surfaces/Card.md +786 -0
- package/dist/components/surfaces/Divider.md +762 -0
- package/dist/components/surfaces/Sheet.md +900 -0
- package/dist/components/surfaces/llms.txt +12 -0
- package/dist/index.cjs +22 -10
- package/dist/index.js +22 -10
- package/dist/llms.txt +75 -0
- package/framer/index.js +36 -36
- package/package.json +8 -4
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Uploader
|
|
2
|
+
|
|
3
|
+
Uploader 컴포넌트는 파일 업로드를 위한 컴포넌트입니다. [관련 가이드](https://www.figma.com/design/NoAOnaPiP2H2lzvRhkBnGZ/CDS-v1.1?node-id=2600-3701\&t=WLh4JrGHlzDGMeV4-0)는 figma에서도 확인할 수 있습니다.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<Uploader
|
|
7
|
+
accept=".png"
|
|
8
|
+
maxFileTotalSize={31457280}
|
|
9
|
+
/>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
| Field | Description | Default |
|
|
13
|
+
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
|
|
14
|
+
| accept | \['허용되는 파일의 확장자.', '\`image/\*\` = \`.jpeg,.jpg,.png,.gif,.bmp,.tiff,.svg,.webp,.heic,.ico\`', '\`video/\*\` = \`.mp4,.avi,.mkv,.mov,.wmv,.flv,.webm,.mpeg,.3gp,.m4v\`', '\`audio/\*\` = \`.mp3,.wav,.flac,.aac,.ogg,.m4a,.wma,.aiff,.alac,.midi,.mp4\`'].join('\n\n') | ".png" |
|
|
15
|
+
| label | Uploader에 대한 label | — |
|
|
16
|
+
| error | — | — |
|
|
17
|
+
| disabled | — | — |
|
|
18
|
+
| minCount | upload 해야하는 최소 파일 개수 | — |
|
|
19
|
+
| maxCount | upload 가능한 최대 파일 개수 | — |
|
|
20
|
+
| maxFileSize | upload 가능한 단일 파일 최대 사이즈(MiB) | — |
|
|
21
|
+
| maxFileTotalSize | upload 가능한 최대 사이즈(MiB) | 31457280 |
|
|
22
|
+
| helperText | 모든 안내 메세지/에러 메세지보다 해당 메세지가 우선적으로 보여진다. | — |
|
|
23
|
+
| onChange | — | — |
|
|
24
|
+
| onDelete | — | — |
|
|
25
|
+
|
|
26
|
+
## 기본형
|
|
27
|
+
|
|
28
|
+
필수 속성 값으로 `accept`, `maxFileTotalSize`를 받고, 해당 속성 값들을 바탕으로 기본 `helperText`가 설정됩니다.\
|
|
29
|
+
생성된 `helperText`는 File dropzone 하단에 노출됩니다.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<Uploader
|
|
33
|
+
accept=".png"
|
|
34
|
+
maxFileTotalSize={31457280}
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`label`과 함께 쓰이면 아래와 같은 모습입니다.
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
<Uploader
|
|
42
|
+
accept=".png"
|
|
43
|
+
maxFileTotalSize={31457280}
|
|
44
|
+
label="Click to Upload or drag file"
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Size
|
|
49
|
+
|
|
50
|
+
Size는 `sm`, `md` 두 사이즈를 지원합니다.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<Stack gap={4}>
|
|
54
|
+
<Stack gap={2}>
|
|
55
|
+
<Typography level="title-sm">SM</Typography>
|
|
56
|
+
<Uploader {...args} size="sm" />
|
|
57
|
+
</Stack>
|
|
58
|
+
<Stack gap={2}>
|
|
59
|
+
<Typography level="title-sm">MD</Typography>
|
|
60
|
+
<Uploader {...args} size="md" />
|
|
61
|
+
</Stack>
|
|
62
|
+
</Stack>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Internal validation
|
|
66
|
+
|
|
67
|
+
### Min Count
|
|
68
|
+
|
|
69
|
+
`minCount` 값과 현재 업로드된 상태에 따라서 내부적으로 에러를 발생시킵니다.
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<>
|
|
73
|
+
<form onSubmit={e => {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
console.log('Submitted');
|
|
76
|
+
}}>
|
|
77
|
+
<Stack gap={2}>
|
|
78
|
+
<Uploader {...args} />
|
|
79
|
+
<Button type="submit">Submit</Button>
|
|
80
|
+
</Stack>
|
|
81
|
+
</form>
|
|
82
|
+
</>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Max Count
|
|
86
|
+
|
|
87
|
+
`maxCount` 값과 현재 업로드된 상태에 따라서 내부적으로 에러를 발생시킵니다.\
|
|
88
|
+
아래의 상황에서 두 개 이상의 파일을 업로드 해보세요.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<Uploader
|
|
92
|
+
accept=".png"
|
|
93
|
+
maxFileTotalSize={31457280}
|
|
94
|
+
label="Click to Upload or drag file"
|
|
95
|
+
maxCount={3}
|
|
96
|
+
uploaded={[{
|
|
97
|
+
id: '1',
|
|
98
|
+
name: 'file1.jpg',
|
|
99
|
+
size: 1024
|
|
100
|
+
}, {
|
|
101
|
+
id: '2',
|
|
102
|
+
name: 'file2.jpg',
|
|
103
|
+
size: 0
|
|
104
|
+
}]}
|
|
105
|
+
/>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Accepts
|
|
109
|
+
|
|
110
|
+
`accept` 속성을 이용해 특정 파일 형식만 업로드할 수 있도록 제한할 수 있습니다.\
|
|
111
|
+
파일 확장자 제한을 위한 `accept`값은 필수적으로 받고 있으며, 확장자를 특정해서 사용하거나(`.png,.jpeg,.txt`) `image/*`, `video/*`, `audio/*`와 같은 값을 사용할 수 있습니다.
|
|
112
|
+
|
|
113
|
+
일부 디바이스에선 MIME type을 사용해서 받을 파일을 제한하는 것이 의도와 다른 동작을 일으킬 수 있기 때문에 `image/*`, `video/*`, `audio/*`를 사용하면 내부적으로 특정 확장자 집합과 맵핑됩니다.
|
|
114
|
+
|
|
115
|
+
`image/*` = `.jpeg,.jpg,.png,.gif,.bmp,.tiff,.svg,.webp,.heic,.ico`\
|
|
116
|
+
`video/*` = `.mp4,.avi,.mkv,.mov,.wmv,.flv,.webm,.mpeg,.3gp,.m4v`\
|
|
117
|
+
`audio/*` = `.mp3,.wav,.flac,.aac,.ogg,.m4a,.wma,.aiff,.alac,.midi,.mp4`
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<Uploader
|
|
121
|
+
accept="image/png, image/jpeg, .pdf,.word,.txt,.doc,.docx"
|
|
122
|
+
maxFileTotalSize={31457280}
|
|
123
|
+
/>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### File Size
|
|
127
|
+
|
|
128
|
+
#### Total File Size
|
|
129
|
+
|
|
130
|
+
`maxFileTotalSize`값으로 업로드 가능한 파일의 총 크기를 제한할 수 있습니다. `maxFileTotalSize`는 필수 속성 값입니다.\
|
|
131
|
+
아래의 상황에서 1MB 이상으로 파일을 업로드 해보세요.
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
<Uploader
|
|
135
|
+
accept=".png"
|
|
136
|
+
maxFileTotalSize={1048576}
|
|
137
|
+
label="Click to Upload or drag file"
|
|
138
|
+
size="sm"
|
|
139
|
+
/>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### Indivisual File Size
|
|
143
|
+
|
|
144
|
+
`maxFileSize`값으로 파일 하나의 최대 크기를 제한할 수 있습니다.\
|
|
145
|
+
아래의 상황에서 Total 1MB 이상의 파일도 업로드 해보고, 1MB가 넘는 단일 파일도 업로드 해보세요.
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
<Uploader
|
|
149
|
+
accept="image/*, .txt"
|
|
150
|
+
maxFileTotalSize={31457280}
|
|
151
|
+
label="Click to Upload or drag file"
|
|
152
|
+
size="sm"
|
|
153
|
+
maxFileSize={1048576}
|
|
154
|
+
/>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Error State
|
|
158
|
+
|
|
159
|
+
### External Error
|
|
160
|
+
|
|
161
|
+
`error` prop을 통해 외부에서 에러 상태를 제어할 수 있습니다. 에러 상태일 때 Uploader의 드롭존 테두리가 빨간색으로 변경됩니다.
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
<Uploader
|
|
165
|
+
accept=".png"
|
|
166
|
+
maxFileTotalSize={31457280}
|
|
167
|
+
label="Click to Upload or drag file"
|
|
168
|
+
error
|
|
169
|
+
helperText="This is an error state with custom helper text"
|
|
170
|
+
/>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Validation Errors
|
|
174
|
+
|
|
175
|
+
다양한 검증 규칙을 위반했을 때 자동으로 발생하는 에러들을 확인해보세요:
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
<Stack gap={4}>
|
|
179
|
+
<Stack gap={2}>
|
|
180
|
+
<Typography level="title-sm">Try uploading files that violate validation rules:</Typography>
|
|
181
|
+
<Typography level="body-sm">• Upload a file larger than 500KB (individual file size limit)</Typography>
|
|
182
|
+
<Typography level="body-sm">• Upload multiple files exceeding 1MB total</Typography>
|
|
183
|
+
<Typography level="body-sm">• Upload more than 2 files</Typography>
|
|
184
|
+
<Typography level="body-sm">• Upload non-PNG/JPG files</Typography>
|
|
185
|
+
</Stack>
|
|
186
|
+
<Uploader {...args} />
|
|
187
|
+
</Stack>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Helper Text
|
|
191
|
+
|
|
192
|
+
### Custom Helper Text
|
|
193
|
+
|
|
194
|
+
`helperText` prop을 사용하면 기본 안내 메시지 대신 사용자 정의 메시지를 표시할 수 있습니다.\
|
|
195
|
+
`helperText`가 제공되면 모든 기본 안내 메시지와 에러 메시지보다 우선적으로 표시됩니다.
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
<Stack gap={4}>
|
|
199
|
+
<Stack gap={2}>
|
|
200
|
+
<Typography level="title-sm">Default Helper Text (Generated)</Typography>
|
|
201
|
+
<Uploader {...args} label="Default helper text" accept=".png,.jpg,.pdf" maxFileTotalSize={5 * 1024 * 1024} maxCount={3} />
|
|
202
|
+
</Stack>
|
|
203
|
+
<Stack gap={2}>
|
|
204
|
+
<Typography level="title-sm">Custom Helper Text</Typography>
|
|
205
|
+
<Uploader {...args} label="Custom helper text" accept=".png,.jpg,.pdf" maxFileTotalSize={5 * 1024 * 1024} maxCount={3} helperText="Please upload your profile documents (PNG, JPG, or PDF only)" />
|
|
206
|
+
</Stack>
|
|
207
|
+
<Stack gap={2}>
|
|
208
|
+
<Typography level="title-sm">Error State with Custom Helper Text</Typography>
|
|
209
|
+
<Uploader {...args} label="Error state" accept=".png,.jpg,.pdf" maxFileTotalSize={5 * 1024 * 1024} maxCount={3} error={true} helperText="There was an error processing your files. Please try again." />
|
|
210
|
+
</Stack>
|
|
211
|
+
</Stack>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Validation
|
|
215
|
+
|
|
216
|
+
Uploader 컴포넌트는 다양한 내부 검증 기능을 제공하며, 검증 실패 시 자동으로 에러 메시지를 표시합니다.
|
|
217
|
+
|
|
218
|
+
### Error Messages
|
|
219
|
+
|
|
220
|
+
내부 검증에서 발생하는 에러 메시지들:
|
|
221
|
+
|
|
222
|
+
- **파일 타입 오류**: "Please upload the correct file type."
|
|
223
|
+
- **파일 크기 초과**: "One or more files exceeded the maximum file size. Each file size must be \[크기] or less."
|
|
224
|
+
- **총 파일 크기 초과**: "The total file size exceeds the maximum limit."
|
|
225
|
+
- **파일 개수 초과**: "Exceeded the maximum number of files."
|
|
226
|
+
- **최소 파일 개수 미달**: "Please choose \[개수] files to upload." (form validation 시)
|
|
227
|
+
|
|
228
|
+
### Helper Text Generation
|
|
229
|
+
|
|
230
|
+
`helperText` prop이 제공되지 않으면 다음 정보를 기반으로 자동 생성됩니다:
|
|
231
|
+
|
|
232
|
+
1. **허용 파일 타입**: `accept` prop 기반
|
|
233
|
+
- `image/*`, `video/*`, `audio/*` → "Any image file", "Any video file", "Any audio file"
|
|
234
|
+
- 특정 확장자 → 대문자 확장자명 나열
|
|
235
|
+
2. **최대 파일 크기**: `maxFileTotalSize` prop 기반
|
|
236
|
+
3. **파일 개수 제한**: `maxCount` prop 기반 (있는 경우)
|
|
237
|
+
|
|
238
|
+
**예시**: "PNG, Maximum 30MB, Up to 3 files"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# inputs
|
|
2
|
+
|
|
3
|
+
## Documentation
|
|
4
|
+
|
|
5
|
+
- [Autocomplete](./Autocomplete.md)
|
|
6
|
+
- [Button](./Button.md)
|
|
7
|
+
- [ButtonGroup](./ButtonGroup.md)
|
|
8
|
+
- [Calendar](./Calendar.md)
|
|
9
|
+
- [Checkbox](./Checkbox.md)
|
|
10
|
+
- [CurrencyInput](./CurrencyInput.md)
|
|
11
|
+
- [DatePicker](./DatePicker.md)
|
|
12
|
+
- [DateRangePicker](./DateRangePicker.md)
|
|
13
|
+
- [FilterMenu](./FilterMenu.md)
|
|
14
|
+
- [IconButton](./IconButton.md)
|
|
15
|
+
- [Input](./Input.md)
|
|
16
|
+
- [MonthPicker](./MonthPicker.md)
|
|
17
|
+
- [MonthRangePicker](./MonthRangePicker.md)
|
|
18
|
+
- [PercentageInput](./PercentageInput.md)
|
|
19
|
+
- [Radio](./RadioButton.md)
|
|
20
|
+
- [RadioTileGroup](./RadioTileGroup.md)
|
|
21
|
+
- [Select](./Select.md)
|
|
22
|
+
- [Switch](./Switch.md)
|
|
23
|
+
- [Textarea](./Textarea.md)
|
|
24
|
+
|
|
25
|
+
## Children
|
|
26
|
+
|
|
27
|
+
- [Uploader](./Uploader/llms.txt)
|
|
28
|
+
|
|
29
|
+
## Parent
|
|
30
|
+
|
|
31
|
+
- [Parent](../llms.txt)
|