@ceed/cds 1.13.4 → 1.14.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 +404 -0
- package/dist/components/data-display/Badge.md +315 -0
- package/dist/components/data-display/Chip.md +290 -0
- package/dist/components/data-display/DataTable.md +452 -0
- package/dist/components/data-display/InfoSign.md +153 -0
- package/dist/components/data-display/Markdown.md +17 -0
- package/dist/components/data-display/Table.md +1331 -0
- package/dist/components/data-display/Tooltip.md +444 -0
- package/dist/components/data-display/Typography.md +268 -0
- package/dist/components/data-display/llms.txt +17 -0
- package/dist/components/feedback/Alert.md +647 -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 +380 -0
- package/dist/components/inputs/Calendar.md +19 -0
- package/dist/components/inputs/Checkbox.md +621 -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/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/Select.md +56 -0
- package/dist/components/inputs/Switch.md +570 -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 +29 -0
- package/dist/components/layout/Box.md +998 -0
- package/dist/components/layout/Container.md +23 -0
- package/dist/components/layout/Grid.md +742 -0
- package/dist/components/layout/Stack.md +936 -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/Drawer.md +27 -0
- package/dist/components/navigation/Dropdown.md +756 -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/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 +892 -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 +73 -0
- package/framer/index.js +35 -35
- package/package.json +8 -4
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# Input
|
|
2
|
+
|
|
3
|
+
Input 컴포넌트는 사용자로부터 텍스트 입력을 받기 위한 기본 컴포넌트입니다. 다양한 스타일, 크기 및 기능을 지원합니다.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<Input />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
| Field | Description | Default |
|
|
10
|
+
| --------------------------- | ----------- | ------- |
|
|
11
|
+
| color | — | — |
|
|
12
|
+
| size | — | — |
|
|
13
|
+
| variant | — | — |
|
|
14
|
+
| label | — | — |
|
|
15
|
+
| helperText | — | — |
|
|
16
|
+
| error | — | — |
|
|
17
|
+
| required | — | — |
|
|
18
|
+
| disabled | — | — |
|
|
19
|
+
| value | — | — |
|
|
20
|
+
| defaultValue | — | — |
|
|
21
|
+
| onChange | — | — |
|
|
22
|
+
| name | — | — |
|
|
23
|
+
| placeholder | — | — |
|
|
24
|
+
| type | — | — |
|
|
25
|
+
| startDecorator | — | — |
|
|
26
|
+
| endDecorator | — | — |
|
|
27
|
+
| enableClearable | — | — |
|
|
28
|
+
| disableTogglePasswordButton | — | — |
|
|
29
|
+
| sx | — | — |
|
|
30
|
+
| className | — | — |
|
|
31
|
+
|
|
32
|
+
## 기본형
|
|
33
|
+
|
|
34
|
+
Input의 기본 형태입니다. 사용자의 텍스트 입력을 받는 단일 라인 필드입니다.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<Input />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 변형(Variants)
|
|
41
|
+
|
|
42
|
+
Input은 네 가지 변형을 지원합니다: `solid`, `soft`, `outlined`, `plain`
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
<>
|
|
46
|
+
<Input placeholder="Type in here…" variant="solid" />
|
|
47
|
+
<Input placeholder="Type in here…" variant="soft" />
|
|
48
|
+
<Input placeholder="Type in here…" variant="outlined" />
|
|
49
|
+
<Input placeholder="Type in here…" variant="plain" />
|
|
50
|
+
</>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 크기(Sizes)
|
|
54
|
+
|
|
55
|
+
Input은 세 가지 크기를 지원합니다: `sm`, `md`, `lg`
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<>
|
|
59
|
+
<Input {...args} size="lg" />
|
|
60
|
+
<Input {...args} size="md" />
|
|
61
|
+
<Input {...args} size="sm" />
|
|
62
|
+
</>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 레이블 및 도움말 텍스트
|
|
66
|
+
|
|
67
|
+
Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자에게 추가 정보를 제공할 수 있습니다.
|
|
68
|
+
|
|
69
|
+
### 레이블(Label)
|
|
70
|
+
|
|
71
|
+
`label` 속성을 사용하여 Input 위에 레이블을 표시할 수 있습니다.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
<>
|
|
75
|
+
<Input placeholder="Type in here…" label="Label" />
|
|
76
|
+
</>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 도움말 텍스트(Helper Text)
|
|
80
|
+
|
|
81
|
+
`helperText` 속성을 사용하여 Input 아래에 추가 정보를 제공할 수 있습니다.
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
<>
|
|
85
|
+
<Input placeholder="Type in here…" helperText="I'm helper text" />
|
|
86
|
+
</>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 상태(States)
|
|
90
|
+
|
|
91
|
+
### 비활성화(Disabled)
|
|
92
|
+
|
|
93
|
+
`disabled` 속성을 사용하여 Input을 비활성화할 수 있습니다.
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<Input disabled />
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 오류 상태(Error)
|
|
100
|
+
|
|
101
|
+
`error` 속성을 사용하여 오류 상태를 표시할 수 있습니다.
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
<>
|
|
105
|
+
<Input placeholder="Invalid input" label="label" error />
|
|
106
|
+
</>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 필수 값(Required)
|
|
110
|
+
|
|
111
|
+
`required` 속성을 사용하여 필수 입력 필드임을 표시할 수 있습니다.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<Input
|
|
115
|
+
placeholder="Type in here..."
|
|
116
|
+
helperText="I'm helper text"
|
|
117
|
+
label="Label"
|
|
118
|
+
required
|
|
119
|
+
/>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## 장식자(Decorators)
|
|
123
|
+
|
|
124
|
+
Input 컴포넌트는 `startDecorator`와 `endDecorator` 속성을 통해 입력 필드의 시작과 끝 부분에 아이콘, 버튼 또는 기타 요소를 추가할 수 있습니다.
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
<Stack spacing={3}>
|
|
128
|
+
<Input placeholder="Amount" startDecorator={{
|
|
129
|
+
dollar: '$',
|
|
130
|
+
baht: '฿',
|
|
131
|
+
yen: '¥'
|
|
132
|
+
}[currency]} endDecorator={<React.Fragment>
|
|
133
|
+
<Divider orientation="vertical" />
|
|
134
|
+
<Select variant="plain" value={currency} options={[{
|
|
135
|
+
value: 'dollar',
|
|
136
|
+
label: 'US dollar'
|
|
137
|
+
}, {
|
|
138
|
+
value: 'baht',
|
|
139
|
+
label: 'Thai baht'
|
|
140
|
+
}, {
|
|
141
|
+
value: 'yen',
|
|
142
|
+
label: 'Japanese yen'
|
|
143
|
+
}]} onChange={e => setCurrency(e.target.value!)} slotProps={{
|
|
144
|
+
listbox: {
|
|
145
|
+
variant: 'outlined'
|
|
146
|
+
}
|
|
147
|
+
}} sx={{
|
|
148
|
+
mr: -1.5,
|
|
149
|
+
'&:hover': {
|
|
150
|
+
bgcolor: 'transparent'
|
|
151
|
+
}
|
|
152
|
+
}} />
|
|
153
|
+
</React.Fragment>} sx={{
|
|
154
|
+
width: 300
|
|
155
|
+
}} />
|
|
156
|
+
<Input placeholder="Your location" startDecorator={<Button variant="soft" color="neutral" startDecorator={<LocationOn />}>
|
|
157
|
+
Locate
|
|
158
|
+
</Button>} sx={{
|
|
159
|
+
width: 300
|
|
160
|
+
}} />
|
|
161
|
+
</Stack>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`endDecorator`와 `enableClearable`을 함께 사용하면 다음과 같습니다:
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
<Input
|
|
168
|
+
placeholder="Type in here…"
|
|
169
|
+
label="Label"
|
|
170
|
+
enableClearable
|
|
171
|
+
endDecorator={<Chip color="primary">Hi</Chip>}
|
|
172
|
+
/>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## 지울 수 있는 입력(Clearable Input)
|
|
176
|
+
|
|
177
|
+
`enableClearable` 속성을 사용하여 Input에 내용을 지울 수 있는 버튼을 추가할 수 있습니다.
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
<>
|
|
181
|
+
<Input placeholder="Type in here…" label="Label" enableClearable />
|
|
182
|
+
</>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## 비밀번호 입력(Password Input)
|
|
186
|
+
|
|
187
|
+
`type="password"` 속성을 사용하면 비밀번호 입력 필드가 생성되며, 자동으로 비밀번호 표시/숨김 토글 버튼이 추가됩니다.
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
<Stack spacing={3}>
|
|
191
|
+
<Typography level="body-md">Default password input with toggle button:</Typography>
|
|
192
|
+
<Input {...args} placeholder="Enter password" type="password" label="Password" />
|
|
193
|
+
|
|
194
|
+
<Typography level="body-md">Disabled password input:</Typography>
|
|
195
|
+
<Input {...args} placeholder="Enter password" type="password" label="Disabled Password" disabled />
|
|
196
|
+
|
|
197
|
+
<Typography level="body-md">Password input with toggle button disabled:</Typography>
|
|
198
|
+
<Input {...args} placeholder="Enter password" type="password" label="No Toggle" disableTogglePasswordButton />
|
|
199
|
+
</Stack>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 비밀번호 토글 비활성화
|
|
203
|
+
|
|
204
|
+
비밀번호 입력 필드의 토글 버튼은 `disableTogglePasswordButton` 속성을 사용하여 비활성화할 수 있습니다.
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
<Stack spacing={3}>
|
|
208
|
+
<Typography level="body-md">Default password input with toggle button:</Typography>
|
|
209
|
+
<Input {...args} placeholder="Enter password" type="password" label="Password" />
|
|
210
|
+
|
|
211
|
+
<Typography level="body-md">Disabled password input:</Typography>
|
|
212
|
+
<Input {...args} placeholder="Enter password" type="password" label="Disabled Password" disabled />
|
|
213
|
+
|
|
214
|
+
<Typography level="body-md">Password input with toggle button disabled:</Typography>
|
|
215
|
+
<Input {...args} placeholder="Enter password" type="password" label="No Toggle" disableTogglePasswordButton />
|
|
216
|
+
</Stack>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 비밀번호 입력의 제한 사항
|
|
220
|
+
|
|
221
|
+
비밀번호 입력 필드(`type="password"`)에서는 `endDecorator`를 사용할 수 없습니다. 이는 비밀번호 토글 버튼이 해당 위치를 차지하기 때문입니다.
|
|
222
|
+
|
|
223
|
+
```tsx
|
|
224
|
+
<Stack spacing={3}>
|
|
225
|
+
<Typography level="body-md">When type="password", the endDecorator is not supported:</Typography>
|
|
226
|
+
<Input {...args} placeholder="Enter password" type="password" label="Password with endDecorator (will show warning)" endDecorator={<Chip color="primary">Hi</Chip>} />
|
|
227
|
+
|
|
228
|
+
<Typography level="body-md">The password toggle button takes precedence:</Typography>
|
|
229
|
+
<Input {...args} placeholder="Enter password" type="password" label="Password" />
|
|
230
|
+
</Stack>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## 폼 컨트롤(Form Control)
|
|
234
|
+
|
|
235
|
+
Input 컴포넌트는 `label`, `helperText`, `error` 속성을 조합하여 완전한 폼 컨트롤을 구성할 수 있습니다.
|
|
236
|
+
|
|
237
|
+
```tsx
|
|
238
|
+
<>
|
|
239
|
+
<Input placeholder="Type in here..." helperText="I'm helper text" label="Label" />
|
|
240
|
+
<Input placeholder="Invalid input" helperText="I'm helper text" label="Label" error />
|
|
241
|
+
</>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## 상태 관리
|
|
245
|
+
|
|
246
|
+
### 제어 컴포넌트(Controlled Component)
|
|
247
|
+
|
|
248
|
+
Input은 React의 제어 컴포넌트로 사용할 수 있습니다. `value`와 `onChange` 속성을 사용하여 상태를 관리합니다.
|
|
249
|
+
|
|
250
|
+
```tsx
|
|
251
|
+
<>
|
|
252
|
+
<Input placeholder="Type in here…" label="Label" enableClearable value={value} onChange={handleChange} />
|
|
253
|
+
</>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 비제어 컴포넌트(Uncontrolled Component)
|
|
257
|
+
|
|
258
|
+
`defaultValue` 속성을 사용하여 비제어 컴포넌트로도 사용 가능합니다.
|
|
259
|
+
|
|
260
|
+
## 접근성(Accessibility)
|
|
261
|
+
|
|
262
|
+
Input 컴포넌트는 웹 접근성 표준을 준수합니다:
|
|
263
|
+
|
|
264
|
+
- 적절한 레이블과 연결되어 있습니다.
|
|
265
|
+
- 키보드 탐색이 가능합니다.
|
|
266
|
+
- 오류 상태는 시각적으로 명확하게 표시됩니다.
|
|
267
|
+
|
|
268
|
+
## 테스팅(Testing)
|
|
269
|
+
|
|
270
|
+
### Testing Library 참고사항
|
|
271
|
+
|
|
272
|
+
- `type="password"` 속성을 가진 Input을 Testing Library로 찾을 때는 항상 `textbox` 역할(role)로 찾아야 합니다.
|
|
273
|
+
- 이는 ARIA 명세에 따라 `password` 입력이 특별한 role을 갖지 않고 기본적으로 `textbox` role을 사용하기 때문입니다.
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
// 비밀번호 입력 필드를 찾는 예시
|
|
277
|
+
const passwordInput = screen.getByRole('textbox', { name: /비밀번호/i });
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
**참고 이슈:**
|
|
281
|
+
|
|
282
|
+
- [W3C ARIA: Should there be a role=password?](https://github.com/w3c/aria/issues/935)
|
|
283
|
+
- [Testing Library: How to find password inputs](https://github.com/testing-library/dom-testing-library/issues/567)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# MonthPicker
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<MonthPicker />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
| Field | Description | Default |
|
|
10
|
+
| ------------- | ----------- | ------- |
|
|
11
|
+
| value | — | — |
|
|
12
|
+
| defaultValue | — | — |
|
|
13
|
+
| name | — | — |
|
|
14
|
+
| disabled | — | — |
|
|
15
|
+
| required | — | — |
|
|
16
|
+
| label | — | — |
|
|
17
|
+
| error | — | — |
|
|
18
|
+
| helperText | — | — |
|
|
19
|
+
| minDate | — | — |
|
|
20
|
+
| maxDate | — | — |
|
|
21
|
+
| disableFuture | — | — |
|
|
22
|
+
| disablePast | — | — |
|
|
23
|
+
| format | — | — |
|
|
24
|
+
| onChange | — | — |
|
|
25
|
+
|
|
26
|
+
### Sizes
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<Stack gap={2}>
|
|
30
|
+
<MonthPicker size="sm" />
|
|
31
|
+
<MonthPicker size="md" />
|
|
32
|
+
<MonthPicker size="lg" />
|
|
33
|
+
</Stack>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### WithLabel
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<MonthPicker label="Date" />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### WithHelperText
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
<MonthPicker
|
|
46
|
+
label="Date"
|
|
47
|
+
helperText="Please select a date"
|
|
48
|
+
/>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Error
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<MonthPicker
|
|
55
|
+
label="Date"
|
|
56
|
+
helperText="Please select a date"
|
|
57
|
+
error
|
|
58
|
+
/>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### WithFormats
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<Stack gap={2}>
|
|
65
|
+
<MonthPicker {...args} value={value['YYYY.MM.DD']} label="YYYY.MM.DD" name="YYYY.MM.DD" format="YYYY.MM.DD" onChange={handleChange} />
|
|
66
|
+
<MonthPicker {...args} value={value['YYYY/MM/DD']} label="YYYY/MM/DD" name="YYYY/MM/DD" format="YYYY/MM/DD" onChange={handleChange} />
|
|
67
|
+
<MonthPicker {...args} value={value['MM/DD/YYYY']} label="MM/DD/YYYY" name="MM/DD/YYYY" format="MM/DD/YYYY" onChange={handleChange} />
|
|
68
|
+
<MonthPicker {...args} value={value['YYYY-MM-DD']} label="YYYY-MM-DD" name="YYYY-MM-DD" format="YYYY-MM-DD" onChange={handleChange} />
|
|
69
|
+
<MonthPicker {...args} value={value['DD/MM/YYYY']} label="DD/MM/YYYY" name="DD/MM/YYYY" format="DD/MM/YYYY" onChange={handleChange} />
|
|
70
|
+
<MonthPicker {...args} value={value['DD.MM.YYYY']} label="DD.MM.YYYY" name="DD.MM.YYYY" format="DD.MM.YYYY" onChange={handleChange} />
|
|
71
|
+
</Stack>
|
|
72
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# MonthRangePicker
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<MonthRangePicker />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
| Field | Description | Default |
|
|
10
|
+
| ------------- | ----------- | ------- |
|
|
11
|
+
| value | — | — |
|
|
12
|
+
| defaultValue | — | — |
|
|
13
|
+
| name | — | — |
|
|
14
|
+
| disabled | — | — |
|
|
15
|
+
| required | — | — |
|
|
16
|
+
| label | — | — |
|
|
17
|
+
| error | — | — |
|
|
18
|
+
| helperText | — | — |
|
|
19
|
+
| minDate | — | — |
|
|
20
|
+
| maxDate | — | — |
|
|
21
|
+
| disableFuture | — | — |
|
|
22
|
+
| disablePast | — | — |
|
|
23
|
+
| format | — | — |
|
|
24
|
+
| onChange | — | — |
|
|
25
|
+
|
|
26
|
+
### Sizes
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<Stack gap={2}>
|
|
30
|
+
<MonthRangePicker size="sm" />
|
|
31
|
+
<MonthRangePicker size="md" />
|
|
32
|
+
<MonthRangePicker size="lg" />
|
|
33
|
+
</Stack>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### WithLabel
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<MonthRangePicker label="Month Range" />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### WithHelperText
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
<MonthRangePicker
|
|
46
|
+
label="Month"
|
|
47
|
+
helperText="Please select a month"
|
|
48
|
+
/>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Error
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<MonthRangePicker
|
|
55
|
+
label="Month"
|
|
56
|
+
helperText="Please select a month"
|
|
57
|
+
error
|
|
58
|
+
/>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### WithFormats
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<Stack gap={2}>
|
|
65
|
+
<MonthRangePicker {...args} value={value['YYYY.MM']} label="YYYY.MM" name="YYYY.MM" format="YYYY.MM" onChange={handleChange} />
|
|
66
|
+
<MonthRangePicker {...args} value={value['YYYY/MM']} label="YYYY/MM" name="YYYY/MM" format="YYYY/MM" onChange={handleChange} />
|
|
67
|
+
<MonthRangePicker {...args} value={value['MM/YYYY']} label="MM/YYYY" name="MM/YYYY" format="MM/YYYY" onChange={handleChange} />
|
|
68
|
+
<MonthRangePicker {...args} value={value['YYYY-MM']} label="YYYY-MM" name="YYYY-MM" format="YYYY-MM" onChange={handleChange} />
|
|
69
|
+
</Stack>
|
|
70
|
+
```
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# PercentageInput
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<PercentageInput placeholder="Enter a percentage" />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
| Field | Description | Default |
|
|
10
|
+
| --------------- | ----------- | ------- |
|
|
11
|
+
| value | — | — |
|
|
12
|
+
| defaultValue | — | — |
|
|
13
|
+
| onChange | — | — |
|
|
14
|
+
| name | — | — |
|
|
15
|
+
| label | — | — |
|
|
16
|
+
| disabled | — | — |
|
|
17
|
+
| required | — | — |
|
|
18
|
+
| error | — | — |
|
|
19
|
+
| helperText | — | — |
|
|
20
|
+
| useMinorUnit | — | — |
|
|
21
|
+
| maxDecimalScale | — | — |
|
|
22
|
+
| min | — | — |
|
|
23
|
+
| max | — | — |
|
|
24
|
+
|
|
25
|
+
### Sizes
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<Stack gap={2}>
|
|
29
|
+
<PercentageInput size="sm" label="Small" />
|
|
30
|
+
<PercentageInput size="md" label="Medium" />
|
|
31
|
+
<PercentageInput size="lg" label="Large" />
|
|
32
|
+
</Stack>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Disabled
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<PercentageInput
|
|
39
|
+
placeholder="Enter a percentage"
|
|
40
|
+
disabled
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Error
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
<PercentageInput
|
|
48
|
+
placeholder="Enter a percentage"
|
|
49
|
+
error
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### WithLabel
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
<PercentageInput
|
|
57
|
+
placeholder="Enter a percentage"
|
|
58
|
+
label="Percentage Input"
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### WithHelperText
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
<PercentageInput
|
|
66
|
+
placeholder="Enter a percentage"
|
|
67
|
+
label="Percentage Input"
|
|
68
|
+
helperText="Please enter a percentage"
|
|
69
|
+
/>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### WithErrorText
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
<PercentageInput
|
|
76
|
+
placeholder="Enter a percentage"
|
|
77
|
+
label="Percentage Input"
|
|
78
|
+
helperText="Please enter a percentage"
|
|
79
|
+
error
|
|
80
|
+
/>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Required
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
<PercentageInput
|
|
87
|
+
placeholder="Enter a percentage"
|
|
88
|
+
label="Percentage Input"
|
|
89
|
+
helperText="Please enter a percentage"
|
|
90
|
+
required
|
|
91
|
+
/>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Min
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<PercentageInput
|
|
98
|
+
placeholder="Enter a percentage"
|
|
99
|
+
label="Percentage Input"
|
|
100
|
+
helperText="Please enter a percentage"
|
|
101
|
+
min={10}
|
|
102
|
+
defaultValue={5}
|
|
103
|
+
/>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Max
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
<PercentageInput
|
|
110
|
+
placeholder="Enter a percentage"
|
|
111
|
+
label="Percentage Input"
|
|
112
|
+
helperText="Please enter a percentage"
|
|
113
|
+
max={500}
|
|
114
|
+
defaultValue={5000}
|
|
115
|
+
/>
|
|
116
|
+
```
|