@ceed/cds 1.34.0 → 1.35.0
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/components/Accordions/Accordions.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +5 -5
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +7 -17
- package/dist/components/Box/Box.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +1 -0
- package/dist/components/Container/Container.d.ts +6 -1
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist/components/DialogActions/DialogActions.d.ts +1 -0
- package/dist/components/DialogContent/DialogContent.d.ts +1 -0
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FormControl/FormControl.d.ts +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts +1 -0
- package/dist/components/Grid/Grid.d.ts +1 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -2
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
- package/dist/components/InfoSign/InfoSign.d.ts +3 -2
- package/dist/components/Input/Input.d.ts +8 -22
- package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
- package/dist/components/Markdown/Markdown.d.ts +9 -24
- package/dist/components/Menu/Menu.d.ts +2 -1
- package/dist/components/MenuButton/MenuButton.d.ts +10 -8
- package/dist/components/Modal/Modal.d.ts +4 -2
- package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
- package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
- package/dist/components/Navigator/Navigator.d.ts +5 -4
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.d.ts +3 -2
- package/dist/components/SearchBar/SearchBar.d.ts +6 -5
- package/dist/components/SearchBar/index.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +12 -10
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Stack/Stack.d.ts +1 -0
- package/dist/components/Stepper/Stepper.d.ts +2 -1
- package/dist/components/Switch/Switch.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +7 -5
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -20
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -0
- package/dist/components/Uploader/Uploader.d.ts +18 -17
- package/dist/components/data-display/Avatar.md +60 -72
- package/dist/components/data-display/Badge.md +197 -181
- package/dist/components/data-display/Chip.md +164 -142
- package/dist/components/data-display/DataTable.md +843 -338
- package/dist/components/data-display/InfoSign.md +1 -3
- package/dist/components/data-display/Markdown.md +93 -125
- package/dist/components/data-display/Table.md +1453 -1007
- package/dist/components/data-display/Typography.md +113 -116
- package/dist/components/feedback/Alert.md +80 -86
- package/dist/components/feedback/CircularProgress.md +32 -36
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +296 -264
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +63 -4
- package/dist/components/inputs/Autocomplete.md +191 -95
- package/dist/components/inputs/Button.md +83 -83
- package/dist/components/inputs/ButtonGroup.md +195 -185
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +11 -29
- package/dist/components/inputs/CurrencyInput.md +4 -4
- package/dist/components/inputs/DatePicker.md +229 -110
- package/dist/components/inputs/DateRangePicker.md +248 -137
- package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
- package/dist/components/inputs/FormControl.md +75 -69
- package/dist/components/inputs/IconButton.md +229 -205
- package/dist/components/inputs/Input.md +131 -98
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +15 -31
- package/dist/components/inputs/RadioButton.md +320 -256
- package/dist/components/inputs/RadioList.md +66 -50
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +154 -55
- package/dist/components/inputs/Select.md +106 -95
- package/dist/components/inputs/Slider.md +153 -102
- package/dist/components/inputs/Switch.md +193 -138
- package/dist/components/inputs/Textarea.md +15 -20
- package/dist/components/inputs/Uploader/Uploader.md +68 -39
- package/dist/components/layout/Box.md +841 -662
- package/dist/components/layout/Container.md +3 -11
- package/dist/components/layout/Grid.md +480 -394
- package/dist/components/layout/Stack.md +739 -566
- package/dist/components/navigation/Breadcrumbs.md +4 -4
- package/dist/components/navigation/Drawer.md +34 -25
- package/dist/components/navigation/Dropdown.md +745 -408
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +8 -13
- package/dist/components/navigation/Link.md +1 -2
- package/dist/components/navigation/Menu.md +623 -502
- package/dist/components/navigation/MenuButton.md +18 -10
- package/dist/components/navigation/NavigationGroup.md +19 -50
- package/dist/components/navigation/NavigationItem.md +6 -6
- package/dist/components/navigation/Navigator.md +26 -28
- package/dist/components/navigation/Pagination.md +86 -75
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +48 -36
- package/dist/components/surfaces/Accordions.md +89 -172
- package/dist/components/surfaces/Card.md +1094 -709
- package/dist/components/surfaces/Divider.md +562 -412
- package/dist/components/surfaces/Sheet.md +700 -518
- package/dist/guides/ThemeProvider.md +8 -8
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1079 -1052
- package/dist/index.d.ts +2 -1
- package/dist/index.js +725 -690
- package/framer/index.js +1 -1
- package/package.json +32 -35
|
@@ -42,16 +42,23 @@ function MyComponent() {
|
|
|
42
42
|
A simple radio list with three options and a default selection.
|
|
43
43
|
|
|
44
44
|
```tsx
|
|
45
|
-
<RadioList
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
45
|
+
<RadioList
|
|
46
|
+
items={[
|
|
47
|
+
{
|
|
48
|
+
label: "Small",
|
|
49
|
+
value: "sm"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: "Medium",
|
|
53
|
+
value: "md"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "Large",
|
|
57
|
+
value: "lg"
|
|
58
|
+
}
|
|
59
|
+
]}
|
|
60
|
+
defaultValue="md"
|
|
61
|
+
/>
|
|
55
62
|
```
|
|
56
63
|
|
|
57
64
|
## Controlled
|
|
@@ -60,21 +67,19 @@ Use `value` and `onChange` for controlled state management.
|
|
|
60
67
|
|
|
61
68
|
```tsx
|
|
62
69
|
<Stack gap={2}>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
<Typography level="body-sm">Selected: {value}</Typography>
|
|
71
|
+
<RadioList
|
|
72
|
+
items={defaultItems}
|
|
73
|
+
value={value}
|
|
74
|
+
onChange={(e) => setValue((e.target as HTMLInputElement).value)}
|
|
75
|
+
/>
|
|
76
|
+
</Stack>
|
|
66
77
|
```
|
|
67
78
|
|
|
68
79
|
```tsx
|
|
69
80
|
function ControlledExample() {
|
|
70
81
|
const [value, setValue] = React.useState('option1');
|
|
71
|
-
return (
|
|
72
|
-
<RadioList
|
|
73
|
-
items={items}
|
|
74
|
-
value={value}
|
|
75
|
-
onChange={(e) => setValue((e.target as HTMLInputElement).value)}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
82
|
+
return <RadioList items={items} value={value} onChange={(e) => setValue((e.target as HTMLInputElement).value)} />;
|
|
78
83
|
}
|
|
79
84
|
```
|
|
80
85
|
|
|
@@ -103,11 +108,7 @@ Set `orientation="horizontal"` to display options in a row.
|
|
|
103
108
|
```
|
|
104
109
|
|
|
105
110
|
```tsx
|
|
106
|
-
<RadioList
|
|
107
|
-
items={items}
|
|
108
|
-
defaultValue="option1"
|
|
109
|
-
orientation="horizontal"
|
|
110
|
-
/>
|
|
111
|
+
<RadioList items={items} defaultValue="option1" orientation="horizontal" />
|
|
111
112
|
```
|
|
112
113
|
|
|
113
114
|
## Sizes
|
|
@@ -116,25 +117,40 @@ RadioList supports `sm`, `md` (default), and `lg` sizes. The size is applied to
|
|
|
116
117
|
|
|
117
118
|
```tsx
|
|
118
119
|
<Stack gap={3}>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
<Box>
|
|
121
|
+
<Typography
|
|
122
|
+
level="body-sm"
|
|
123
|
+
sx={{
|
|
124
|
+
mb: 1
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
Small
|
|
128
|
+
</Typography>
|
|
129
|
+
<RadioList items={defaultItems} defaultValue="option1" size="sm" />
|
|
130
|
+
</Box>
|
|
131
|
+
<Box>
|
|
132
|
+
<Typography
|
|
133
|
+
level="body-sm"
|
|
134
|
+
sx={{
|
|
135
|
+
mb: 1
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
138
|
+
Medium
|
|
139
|
+
</Typography>
|
|
140
|
+
<RadioList items={defaultItems} defaultValue="option1" size="md" />
|
|
141
|
+
</Box>
|
|
142
|
+
<Box>
|
|
143
|
+
<Typography
|
|
144
|
+
level="body-sm"
|
|
145
|
+
sx={{
|
|
146
|
+
mb: 1
|
|
147
|
+
}}
|
|
148
|
+
>
|
|
149
|
+
Large
|
|
150
|
+
</Typography>
|
|
151
|
+
<RadioList items={defaultItems} defaultValue="option1" size="lg" />
|
|
152
|
+
</Box>
|
|
153
|
+
</Stack>
|
|
138
154
|
```
|
|
139
155
|
|
|
140
156
|
## Colors
|
|
@@ -143,12 +159,12 @@ Five semantic colors are available via the `color` prop.
|
|
|
143
159
|
|
|
144
160
|
```tsx
|
|
145
161
|
<Stack gap={3}>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
</Stack>
|
|
162
|
+
<RadioList items={defaultItems} defaultValue="option1" color="primary" />
|
|
163
|
+
<RadioList items={defaultItems} defaultValue="option1" color="neutral" />
|
|
164
|
+
<RadioList items={defaultItems} defaultValue="option1" color="danger" />
|
|
165
|
+
<RadioList items={defaultItems} defaultValue="option1" color="success" />
|
|
166
|
+
<RadioList items={defaultItems} defaultValue="option1" color="warning" />
|
|
167
|
+
</Stack>
|
|
152
168
|
```
|
|
153
169
|
|
|
154
170
|
## Common Use Cases
|
|
@@ -118,17 +118,32 @@ Use the `columns` prop to arrange tiles in a specific number of columns using a
|
|
|
118
118
|
Combine `flex` and `columns` to create a grid where each tile stretches to fill its column width evenly.
|
|
119
119
|
|
|
120
120
|
```tsx
|
|
121
|
-
<Box
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
<Box
|
|
122
|
+
sx={{
|
|
123
|
+
width: "100%",
|
|
124
|
+
maxWidth: 700
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
<Typography
|
|
128
|
+
level="body-md"
|
|
129
|
+
sx={{
|
|
130
|
+
mb: 2
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
Flex with Columns
|
|
134
|
+
</Typography>
|
|
135
|
+
<RadioTileGroup
|
|
136
|
+
options={optionsWithIcons}
|
|
137
|
+
onChange={handleChange}
|
|
138
|
+
value={selectedValue}
|
|
139
|
+
flex={true}
|
|
140
|
+
columns={3}
|
|
141
|
+
size="md"
|
|
142
|
+
useIndicator={true}
|
|
143
|
+
label="Flex with Columns Example"
|
|
144
|
+
helperText="Items stretch to fill available space and are arranged in 3 columns"
|
|
145
|
+
/>
|
|
146
|
+
</Box>
|
|
132
147
|
```
|
|
133
148
|
|
|
134
149
|
### Vertical Layout
|
|
@@ -136,17 +151,31 @@ Flex with Columns
|
|
|
136
151
|
Set `columns={1}` to stack tiles vertically. This layout is well-suited for list-style selections like pricing plans or step-by-step options.
|
|
137
152
|
|
|
138
153
|
```tsx
|
|
139
|
-
<Box
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
154
|
+
<Box
|
|
155
|
+
sx={{
|
|
156
|
+
width: "100%",
|
|
157
|
+
maxWidth: 400
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
<Typography
|
|
161
|
+
level="body-md"
|
|
162
|
+
sx={{
|
|
163
|
+
mb: 2
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
Vertical Layout (columns: 1)
|
|
167
|
+
</Typography>
|
|
168
|
+
<RadioTileGroup
|
|
169
|
+
options={pricingOptions}
|
|
170
|
+
onChange={handleChange}
|
|
171
|
+
value={selectedValue}
|
|
172
|
+
columns={1}
|
|
173
|
+
size="md"
|
|
174
|
+
useIndicator={true}
|
|
175
|
+
label="Subscription Plans"
|
|
176
|
+
helperText="Select your preferred subscription plan"
|
|
177
|
+
/>
|
|
178
|
+
</Box>
|
|
150
179
|
```
|
|
151
180
|
|
|
152
181
|
## Text Alignment
|
|
@@ -154,30 +183,38 @@ Vertical Layout (columns: 1)
|
|
|
154
183
|
The `textAlign` prop controls the alignment of content inside each tile. The default is `center`. Set it to `start` for left-aligned content.
|
|
155
184
|
|
|
156
185
|
```tsx
|
|
157
|
-
<Box
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
186
|
+
<Box
|
|
187
|
+
sx={{
|
|
188
|
+
display: "flex",
|
|
189
|
+
flexDirection: "column",
|
|
190
|
+
gap: 4,
|
|
191
|
+
width: "100%",
|
|
192
|
+
maxWidth: 700
|
|
193
|
+
}}
|
|
194
|
+
>
|
|
195
|
+
<Box>
|
|
196
|
+
<Typography
|
|
197
|
+
level="body-md"
|
|
198
|
+
sx={{
|
|
199
|
+
mb: 2
|
|
200
|
+
}}
|
|
201
|
+
>
|
|
202
|
+
Center Alignment (default)
|
|
203
|
+
</Typography>
|
|
204
|
+
<RadioTileGroup options={simpleOptions} textAlign="center" useIndicator={true} />
|
|
205
|
+
</Box>
|
|
206
|
+
<Box>
|
|
207
|
+
<Typography
|
|
208
|
+
level="body-md"
|
|
209
|
+
sx={{
|
|
210
|
+
mb: 2
|
|
211
|
+
}}
|
|
212
|
+
>
|
|
213
|
+
Start Alignment
|
|
214
|
+
</Typography>
|
|
215
|
+
<RadioTileGroup options={simpleOptions} textAlign="start" useIndicator={true} />
|
|
216
|
+
</Box>
|
|
217
|
+
</Box>
|
|
181
218
|
```
|
|
182
219
|
|
|
183
220
|
## Sizes
|
|
@@ -185,38 +222,49 @@ The `textAlign` prop controls the alignment of content inside each tile. The def
|
|
|
185
222
|
RadioTileGroup supports three sizes: `sm` (default), `md`, and `lg`. Choose the size that best fits the density of your layout.
|
|
186
223
|
|
|
187
224
|
```tsx
|
|
188
|
-
<Box
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
</Typography>
|
|
217
|
-
<RadioTileGroup options={simpleOptions} size="
|
|
218
|
-
</Box>
|
|
219
|
-
|
|
225
|
+
<Box
|
|
226
|
+
sx={{
|
|
227
|
+
display: "flex",
|
|
228
|
+
flexDirection: "column",
|
|
229
|
+
gap: 4,
|
|
230
|
+
width: "100%",
|
|
231
|
+
maxWidth: 700
|
|
232
|
+
}}
|
|
233
|
+
>
|
|
234
|
+
<Box>
|
|
235
|
+
<Typography
|
|
236
|
+
level="body-md"
|
|
237
|
+
sx={{
|
|
238
|
+
mb: 2
|
|
239
|
+
}}
|
|
240
|
+
>
|
|
241
|
+
Size: sm (default)
|
|
242
|
+
</Typography>
|
|
243
|
+
<RadioTileGroup options={simpleOptions} size="sm" useIndicator={true} />
|
|
244
|
+
</Box>
|
|
245
|
+
<Box>
|
|
246
|
+
<Typography
|
|
247
|
+
level="body-md"
|
|
248
|
+
sx={{
|
|
249
|
+
mb: 2
|
|
250
|
+
}}
|
|
251
|
+
>
|
|
252
|
+
Size: md
|
|
253
|
+
</Typography>
|
|
254
|
+
<RadioTileGroup options={simpleOptions} size="md" useIndicator={true} />
|
|
255
|
+
</Box>
|
|
256
|
+
<Box>
|
|
257
|
+
<Typography
|
|
258
|
+
level="body-md"
|
|
259
|
+
sx={{
|
|
260
|
+
mb: 2
|
|
261
|
+
}}
|
|
262
|
+
>
|
|
263
|
+
Size: lg
|
|
264
|
+
</Typography>
|
|
265
|
+
<RadioTileGroup options={simpleOptions} size="lg" useIndicator={true} />
|
|
266
|
+
</Box>
|
|
267
|
+
</Box>
|
|
220
268
|
```
|
|
221
269
|
|
|
222
270
|
## Icons
|
|
@@ -249,17 +297,22 @@ Add icons to tiles using the `startDecorator` property on each option. Icons hel
|
|
|
249
297
|
Pass `value` and `onChange` to fully control the selected state from the parent component. This is recommended when the selection participates in form state or triggers side effects.
|
|
250
298
|
|
|
251
299
|
```tsx
|
|
252
|
-
<Box
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
300
|
+
<Box
|
|
301
|
+
sx={{
|
|
302
|
+
width: "100%",
|
|
303
|
+
maxWidth: 500
|
|
304
|
+
}}
|
|
305
|
+
>
|
|
306
|
+
<Typography
|
|
307
|
+
level="body-md"
|
|
308
|
+
sx={{
|
|
309
|
+
mb: 1
|
|
310
|
+
}}
|
|
311
|
+
>
|
|
312
|
+
Selected value: {selectedValue}
|
|
313
|
+
</Typography>
|
|
314
|
+
<RadioTileGroup options={simpleOptions} value={selectedValue} onChange={handleChange} />
|
|
315
|
+
</Box>
|
|
263
316
|
```
|
|
264
317
|
|
|
265
318
|
### Uncontrolled
|
|
@@ -267,34 +320,56 @@ Selected value: {selectedValue}
|
|
|
267
320
|
Use `defaultValue` to set an initial selection without managing state externally. The component tracks its own selection internally.
|
|
268
321
|
|
|
269
322
|
```tsx
|
|
270
|
-
<Box
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
</Box>
|
|
323
|
+
<Box
|
|
324
|
+
sx={{
|
|
325
|
+
display: "flex",
|
|
326
|
+
flexDirection: "column",
|
|
327
|
+
gap: 4
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
<Box
|
|
331
|
+
sx={{
|
|
332
|
+
width: "100%",
|
|
333
|
+
maxWidth: 500
|
|
334
|
+
}}
|
|
335
|
+
>
|
|
336
|
+
<Typography
|
|
337
|
+
level="body-md"
|
|
338
|
+
sx={{
|
|
339
|
+
mb: 2
|
|
340
|
+
}}
|
|
341
|
+
>
|
|
342
|
+
Uncontrolled Example (with Indicator)
|
|
343
|
+
</Typography>
|
|
344
|
+
<RadioTileGroup
|
|
345
|
+
options={simpleOptions}
|
|
346
|
+
defaultValue="option2"
|
|
347
|
+
useIndicator={true}
|
|
348
|
+
onChange={(event) => console.log(`Selected value: ${event.target.value}`)}
|
|
349
|
+
/>
|
|
350
|
+
</Box>
|
|
351
|
+
<Box
|
|
352
|
+
sx={{
|
|
353
|
+
width: "100%",
|
|
354
|
+
maxWidth: 500
|
|
355
|
+
}}
|
|
356
|
+
>
|
|
357
|
+
<Typography
|
|
358
|
+
level="body-md"
|
|
359
|
+
sx={{
|
|
360
|
+
mb: 2
|
|
361
|
+
}}
|
|
362
|
+
>
|
|
363
|
+
Uncontrolled Example (without Indicator)
|
|
364
|
+
</Typography>
|
|
365
|
+
<RadioTileGroup
|
|
366
|
+
options={simpleOptions}
|
|
367
|
+
defaultValue="option3"
|
|
368
|
+
useIndicator={false}
|
|
369
|
+
onChange={(event) => console.log(`Selected value: ${event.target.value}`)}
|
|
370
|
+
/>
|
|
371
|
+
</Box>
|
|
372
|
+
</Box>
|
|
298
373
|
```
|
|
299
374
|
|
|
300
375
|
## Disabled State
|
|
@@ -349,18 +424,32 @@ Use the `error` prop to indicate validation errors. Pair it with `helperText` to
|
|
|
349
424
|
Combine `required`, `error`, and `helperText` to build a complete form validation flow. The example below validates that the user has made a selection before submitting.
|
|
350
425
|
|
|
351
426
|
```tsx
|
|
352
|
-
<Stack
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
427
|
+
<Stack
|
|
428
|
+
spacing={2}
|
|
429
|
+
sx={{
|
|
430
|
+
width: "100%",
|
|
431
|
+
maxWidth: 500
|
|
432
|
+
}}
|
|
433
|
+
>
|
|
434
|
+
<RadioTileGroup
|
|
435
|
+
options={simpleOptions}
|
|
436
|
+
value={selectedValue}
|
|
437
|
+
onChange={handleChange}
|
|
438
|
+
label="Choose your preferred option"
|
|
439
|
+
helperText={error ? "Please select an option" : "This selection is required"}
|
|
440
|
+
error={error}
|
|
441
|
+
useIndicator={true}
|
|
442
|
+
required={true}
|
|
443
|
+
/>
|
|
444
|
+
<Box
|
|
445
|
+
sx={{
|
|
446
|
+
display: "flex",
|
|
447
|
+
justifyContent: "flex-end"
|
|
448
|
+
}}
|
|
449
|
+
>
|
|
450
|
+
<Button onClick={handleSubmit}>Submit</Button>
|
|
451
|
+
</Box>
|
|
452
|
+
</Stack>
|
|
364
453
|
```
|
|
365
454
|
|
|
366
455
|
## Common Use Cases
|
|
@@ -387,28 +476,42 @@ import BusinessIcon from '@mui/icons-material/Business';
|
|
|
387
476
|
onChange={(e) => setSelected(e.target.value)}
|
|
388
477
|
size="md"
|
|
389
478
|
useIndicator
|
|
390
|
-
|
|
479
|
+
/>;
|
|
391
480
|
```
|
|
392
481
|
|
|
393
482
|
```tsx
|
|
394
|
-
<Box
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
483
|
+
<Box
|
|
484
|
+
sx={{
|
|
485
|
+
width: "100%",
|
|
486
|
+
maxWidth: 700
|
|
487
|
+
}}
|
|
488
|
+
>
|
|
489
|
+
<RadioTileGroup
|
|
490
|
+
label="배송 방법 선택"
|
|
491
|
+
helperText="배송 방법에 따라 배송비가 달라질 수 있습니다."
|
|
492
|
+
options={[
|
|
493
|
+
{
|
|
494
|
+
value: "standard",
|
|
495
|
+
label: "일반 배송",
|
|
496
|
+
startDecorator: <HomeIcon />
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
value: "express",
|
|
500
|
+
label: "빠른 배송",
|
|
501
|
+
startDecorator: <LocalShippingIcon />
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
value: "business",
|
|
505
|
+
label: "기업 배송",
|
|
506
|
+
startDecorator: <BusinessIcon />
|
|
507
|
+
}
|
|
508
|
+
]}
|
|
509
|
+
onChange={handleChange}
|
|
510
|
+
value={selectedValue}
|
|
511
|
+
size="md"
|
|
512
|
+
useIndicator={true}
|
|
513
|
+
/>
|
|
514
|
+
</Box>
|
|
412
515
|
```
|
|
413
516
|
|
|
414
517
|
### Survey / Preference Selection
|
|
@@ -432,28 +535,42 @@ Present survey options with icons in a multi-column grid for a clear, scannable
|
|
|
432
535
|
```
|
|
433
536
|
|
|
434
537
|
```tsx
|
|
435
|
-
<Box
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
538
|
+
<Box
|
|
539
|
+
sx={{
|
|
540
|
+
width: "100%",
|
|
541
|
+
maxWidth: 700
|
|
542
|
+
}}
|
|
543
|
+
>
|
|
544
|
+
<RadioTileGroup
|
|
545
|
+
label="선호하는 운동 유형을 선택해주세요"
|
|
546
|
+
options={[
|
|
547
|
+
{
|
|
548
|
+
value: "cardio",
|
|
549
|
+
label: "유산소 운동",
|
|
550
|
+
startDecorator: <DirectionsRunIcon />
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
value: "strength",
|
|
554
|
+
label: "근력 운동",
|
|
555
|
+
startDecorator: <FitnessCenterIcon />
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
value: "flexibility",
|
|
559
|
+
label: "유연성 운동",
|
|
560
|
+
startDecorator: <SelfImprovementIcon />
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
value: "balance",
|
|
564
|
+
label: "균형 운동",
|
|
565
|
+
startDecorator: <BalanceIcon />
|
|
566
|
+
}
|
|
567
|
+
]}
|
|
568
|
+
onChange={handleChange}
|
|
569
|
+
value={selectedValue}
|
|
570
|
+
columns={2}
|
|
571
|
+
size="md"
|
|
572
|
+
/>
|
|
573
|
+
</Box>
|
|
457
574
|
```
|
|
458
575
|
|
|
459
576
|
### Pricing Plan Picker
|