@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
|
@@ -79,10 +79,19 @@ The `variant` prop controls the visual style of the autocomplete input. Availabl
|
|
|
79
79
|
|
|
80
80
|
```tsx
|
|
81
81
|
<Stack gap={2} p={2}>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
{variants.map((variant) => (
|
|
83
|
+
<Autocomplete
|
|
84
|
+
key={variant}
|
|
85
|
+
variant={variant}
|
|
86
|
+
options={sampleOptions}
|
|
87
|
+
placeholder={variant}
|
|
88
|
+
label={variant}
|
|
89
|
+
sx={{
|
|
90
|
+
maxWidth: 300
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
93
|
+
))}
|
|
94
|
+
</Stack>
|
|
86
95
|
```
|
|
87
96
|
|
|
88
97
|
## Sizes
|
|
@@ -90,14 +99,16 @@ The `variant` prop controls the visual style of the autocomplete input. Availabl
|
|
|
90
99
|
Available size options: `sm`, `md`, `lg`.
|
|
91
100
|
|
|
92
101
|
```tsx
|
|
93
|
-
<div
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<Autocomplete {...args} size="
|
|
100
|
-
|
|
102
|
+
<div
|
|
103
|
+
style={{
|
|
104
|
+
display: "flex",
|
|
105
|
+
gap: "10px"
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
<Autocomplete {...args} size="sm" />
|
|
109
|
+
<Autocomplete {...args} size="md" />
|
|
110
|
+
<Autocomplete {...args} size="lg" />
|
|
111
|
+
</div>
|
|
101
112
|
```
|
|
102
113
|
|
|
103
114
|
## Colors
|
|
@@ -106,10 +117,19 @@ The `color` prop changes the color scheme. Available colors: `primary`, `neutral
|
|
|
106
117
|
|
|
107
118
|
```tsx
|
|
108
119
|
<Stack gap={2} p={2}>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
120
|
+
{colors.map((color) => (
|
|
121
|
+
<Autocomplete
|
|
122
|
+
key={color}
|
|
123
|
+
color={color}
|
|
124
|
+
options={sampleOptions}
|
|
125
|
+
defaultValue="Apple"
|
|
126
|
+
label={color}
|
|
127
|
+
sx={{
|
|
128
|
+
maxWidth: 300
|
|
129
|
+
}}
|
|
130
|
+
/>
|
|
131
|
+
))}
|
|
132
|
+
</Stack>
|
|
113
133
|
```
|
|
114
134
|
|
|
115
135
|
## States
|
|
@@ -133,14 +153,23 @@ Set `error` along with `helperText` to indicate validation failures.
|
|
|
133
153
|
Set `required` to mark the field as required in a form.
|
|
134
154
|
|
|
135
155
|
```tsx
|
|
136
|
-
<Stack
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
<Stack
|
|
157
|
+
gap={3}
|
|
158
|
+
p={2}
|
|
159
|
+
sx={{
|
|
160
|
+
maxWidth: 300
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
<Autocomplete label="Disabled" options={sampleOptions} defaultValue="Apple" disabled />
|
|
164
|
+
<Autocomplete label="Read Only" options={sampleOptions} defaultValue="Banana" readOnly />
|
|
165
|
+
<Autocomplete label="Error" options={sampleOptions} error helperText="This field is required" />
|
|
166
|
+
<Autocomplete
|
|
167
|
+
label="Required"
|
|
168
|
+
options={sampleOptions}
|
|
169
|
+
required
|
|
170
|
+
placeholder="Select a fruit..."
|
|
171
|
+
/>
|
|
172
|
+
</Stack>
|
|
144
173
|
```
|
|
145
174
|
|
|
146
175
|
## Free Solo
|
|
@@ -150,18 +179,30 @@ The `freeSolo` prop allows users to type arbitrary values that are not in the op
|
|
|
150
179
|
> ⚠️ **Known limitation**: The component's internal `handleChange` accesses `newValue.value`, which is `undefined` for raw strings in freeSolo mode. Typed arbitrary values may not propagate correctly through `onChange`. Consider using `onInputChange` as an alternative for capturing free-text input.
|
|
151
180
|
|
|
152
181
|
```tsx
|
|
153
|
-
<Stack
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
182
|
+
<Stack
|
|
183
|
+
gap={2}
|
|
184
|
+
p={2}
|
|
185
|
+
sx={{
|
|
186
|
+
maxWidth: 300
|
|
187
|
+
}}
|
|
188
|
+
>
|
|
189
|
+
<Autocomplete
|
|
190
|
+
label="Free Solo"
|
|
191
|
+
options={sampleOptions}
|
|
192
|
+
freeSolo
|
|
193
|
+
placeholder="Type anything..."
|
|
194
|
+
value={value}
|
|
195
|
+
onChange={(e) => setValue(e.target.value)}
|
|
196
|
+
/>
|
|
197
|
+
<Typography level="body-sm" textColor="text.tertiary">
|
|
198
|
+
Current value: {value ?? "(empty)"}
|
|
199
|
+
</Typography>
|
|
200
|
+
<Typography level="body-xs" textColor="text.tertiary">
|
|
201
|
+
Note: freeSolo allows arbitrary text input. However, the component's onChange handler
|
|
202
|
+
accesses newValue.value which is undefined for raw strings, so typed values may not propagate
|
|
203
|
+
correctly.
|
|
204
|
+
</Typography>
|
|
205
|
+
</Stack>
|
|
165
206
|
```
|
|
166
207
|
|
|
167
208
|
## Disable Clearable
|
|
@@ -186,13 +227,26 @@ Customize the messages shown when there are no matching options or while loading
|
|
|
186
227
|
|
|
187
228
|
```tsx
|
|
188
229
|
<Stack gap={3} direction="row" p={2}>
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
230
|
+
<Autocomplete
|
|
231
|
+
label="Custom No Options Text"
|
|
232
|
+
options={[]}
|
|
233
|
+
noOptionsText="No fruits found — try a different search"
|
|
234
|
+
placeholder="Search fruits..."
|
|
235
|
+
sx={{
|
|
236
|
+
minWidth: 280
|
|
237
|
+
}}
|
|
238
|
+
/>
|
|
239
|
+
<Autocomplete
|
|
240
|
+
label="Custom Loading Text"
|
|
241
|
+
options={[]}
|
|
242
|
+
loading
|
|
243
|
+
loadingText="Fetching fruits from the orchard..."
|
|
244
|
+
placeholder="Loading fruits..."
|
|
245
|
+
sx={{
|
|
246
|
+
minWidth: 280
|
|
247
|
+
}}
|
|
248
|
+
/>
|
|
249
|
+
</Stack>
|
|
196
250
|
```
|
|
197
251
|
|
|
198
252
|
## Multiple Selection
|
|
@@ -200,15 +254,17 @@ Customize the messages shown when there are no matching options or while loading
|
|
|
200
254
|
Enable `multiple` to allow selecting more than one option. Selected values are shown as chips.
|
|
201
255
|
|
|
202
256
|
```tsx
|
|
203
|
-
<div
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
<Autocomplete {...args} size="
|
|
211
|
-
|
|
257
|
+
<div
|
|
258
|
+
style={{
|
|
259
|
+
display: "flex",
|
|
260
|
+
flexDirection: "column",
|
|
261
|
+
gap: "10px"
|
|
262
|
+
}}
|
|
263
|
+
>
|
|
264
|
+
<Autocomplete {...args} size="sm" />
|
|
265
|
+
<Autocomplete {...args} size="md" />
|
|
266
|
+
<Autocomplete {...args} size="lg" />
|
|
267
|
+
</div>
|
|
212
268
|
```
|
|
213
269
|
|
|
214
270
|
### Limit Tags
|
|
@@ -218,18 +274,34 @@ In multiple mode, use `limitTags` to control how many tags are visible before tr
|
|
|
218
274
|
> 💡 The component uses a custom `renderTags` implementation. JoyUI's `limitTags` truncates the array passed to `renderTags`, so tags will be limited, but the default "+N more" indicator text may not appear.
|
|
219
275
|
|
|
220
276
|
```tsx
|
|
221
|
-
<Stack
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
<Stack gap={1}>
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
277
|
+
<Stack
|
|
278
|
+
gap={3}
|
|
279
|
+
p={2}
|
|
280
|
+
sx={{
|
|
281
|
+
maxWidth: 400
|
|
282
|
+
}}
|
|
283
|
+
>
|
|
284
|
+
<Stack gap={1}>
|
|
285
|
+
<Typography level="title-sm">limitTags=2</Typography>
|
|
286
|
+
<Autocomplete
|
|
287
|
+
multiple
|
|
288
|
+
options={sampleOptions}
|
|
289
|
+
defaultValue={["Apple", "Banana", "Cherry", "Date"]}
|
|
290
|
+
limitTags={2}
|
|
291
|
+
label="Limit Tags"
|
|
292
|
+
/>
|
|
293
|
+
</Stack>
|
|
294
|
+
<Stack gap={1}>
|
|
295
|
+
<Typography level="title-sm">filterSelectedOptions</Typography>
|
|
296
|
+
<Autocomplete
|
|
297
|
+
multiple
|
|
298
|
+
options={sampleOptions}
|
|
299
|
+
defaultValue={["Apple", "Banana"]}
|
|
300
|
+
filterSelectedOptions
|
|
301
|
+
label="Filter Selected Options"
|
|
302
|
+
/>
|
|
303
|
+
</Stack>
|
|
304
|
+
</Stack>
|
|
233
305
|
```
|
|
234
306
|
|
|
235
307
|
## Option Groups
|
|
@@ -287,19 +359,34 @@ Options can display a secondary line of text using the `secondaryText` property.
|
|
|
287
359
|
|
|
288
360
|
```tsx
|
|
289
361
|
<Stack gap={4} direction="row" alignItems="flex-start" p={2}>
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
362
|
+
{sizes.map((size) => (
|
|
363
|
+
<Stack key={size} gap={1}>
|
|
364
|
+
<span
|
|
365
|
+
style={{
|
|
366
|
+
color: "#6366f1",
|
|
367
|
+
fontSize: 12
|
|
368
|
+
}}
|
|
369
|
+
>
|
|
370
|
+
{size}
|
|
371
|
+
</span>
|
|
372
|
+
<Autocomplete
|
|
373
|
+
placeholder="Placeholder"
|
|
374
|
+
options={optionsWithSecondaryText}
|
|
375
|
+
value={values[size]}
|
|
376
|
+
onChange={(e) =>
|
|
377
|
+
setValues((prev) => ({
|
|
378
|
+
...prev,
|
|
379
|
+
[size]: e.target.value
|
|
380
|
+
}))
|
|
381
|
+
}
|
|
382
|
+
sx={{
|
|
383
|
+
minWidth: 200
|
|
384
|
+
}}
|
|
385
|
+
size={size}
|
|
386
|
+
/>
|
|
387
|
+
</Stack>
|
|
388
|
+
))}
|
|
389
|
+
</Stack>
|
|
303
390
|
```
|
|
304
391
|
|
|
305
392
|
## Loading State
|
|
@@ -321,24 +408,33 @@ Manage value externally with controlled state.
|
|
|
321
408
|
|
|
322
409
|
```tsx
|
|
323
410
|
<Stack gap={4}>
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
411
|
+
<Autocomplete
|
|
412
|
+
value={value}
|
|
413
|
+
label="Select a brand"
|
|
414
|
+
options={[
|
|
415
|
+
{
|
|
416
|
+
value: "Johnson's baby",
|
|
417
|
+
label: "Johnson's baby",
|
|
418
|
+
startDecorator: <Chip color="success">Active</Chip>,
|
|
419
|
+
endDecorator: <Chip color="neutral">inbound</Chip>
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
value: "Haggis Magic",
|
|
423
|
+
label: "Haggis Magic",
|
|
424
|
+
startDecorator: <Chip color="danger">Terminated</Chip>,
|
|
425
|
+
endDecorator: <Chip color="neutral">outbound</Chip>
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
value: "Hogwarts Magic",
|
|
429
|
+
label: "Hogwarts Magic",
|
|
430
|
+
startDecorator: <Chip color="danger">Magic</Chip>,
|
|
431
|
+
endDecorator: <Chip color="neutral">Muggle</Chip>
|
|
432
|
+
}
|
|
433
|
+
]}
|
|
434
|
+
onChange={(e) => setValue(e.target.value)}
|
|
435
|
+
/>
|
|
436
|
+
<Button onClick={() => setValue("Johnson's baby")}>Set Johnson's baby</Button>
|
|
437
|
+
</Stack>
|
|
342
438
|
```
|
|
343
439
|
|
|
344
440
|
### Uncontrolled
|
|
@@ -6,12 +6,12 @@ Button is the primary interactive element for triggering actions. Built on Joy U
|
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
<>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</>
|
|
9
|
+
{/* @ts-ignore */}
|
|
10
|
+
<Button {...props} startDecorator={<Add />} />
|
|
11
|
+
<IconButton {...props} aria-label="Add">
|
|
12
|
+
<Add />
|
|
13
|
+
</IconButton>
|
|
14
|
+
</>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
| Field | Description | Default |
|
|
@@ -38,10 +38,10 @@ The most basic button usage.
|
|
|
38
38
|
|
|
39
39
|
```tsx
|
|
40
40
|
<>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</>
|
|
41
|
+
<Button {...props} />
|
|
42
|
+
<Button {...props} disabled />
|
|
43
|
+
<Button {...props} loading />
|
|
44
|
+
</>
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
### Disabled State
|
|
@@ -50,19 +50,19 @@ A disabled button cannot be clicked and is visually dimmed.
|
|
|
50
50
|
|
|
51
51
|
```tsx
|
|
52
52
|
<>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</>
|
|
53
|
+
<Button {...props} startDecorator={<Add />} variant="solid">
|
|
54
|
+
Solid
|
|
55
|
+
</Button>
|
|
56
|
+
<Button {...props} startDecorator={<Add />} variant="soft">
|
|
57
|
+
Soft
|
|
58
|
+
</Button>
|
|
59
|
+
<Button {...props} startDecorator={<Add />} variant="outlined">
|
|
60
|
+
Outlined
|
|
61
|
+
</Button>
|
|
62
|
+
<Button {...props} startDecorator={<Add />} variant="plain">
|
|
63
|
+
Plain
|
|
64
|
+
</Button>
|
|
65
|
+
</>
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### Loading State
|
|
@@ -88,19 +88,19 @@ Four visual styles are available to indicate action importance.
|
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
90
90
|
<>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</>
|
|
91
|
+
<Button {...props} variant="solid">
|
|
92
|
+
Solid
|
|
93
|
+
</Button>
|
|
94
|
+
<Button {...props} variant="soft">
|
|
95
|
+
Soft
|
|
96
|
+
</Button>
|
|
97
|
+
<Button {...props} variant="outlined">
|
|
98
|
+
Outlined
|
|
99
|
+
</Button>
|
|
100
|
+
<Button {...props} variant="plain">
|
|
101
|
+
Plain
|
|
102
|
+
</Button>
|
|
103
|
+
</>
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
- **solid**: High-emphasis primary actions (default)
|
|
@@ -114,16 +114,16 @@ Three sizes are available: `sm`, `md` (default), and `lg`.
|
|
|
114
114
|
|
|
115
115
|
```tsx
|
|
116
116
|
<>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</>
|
|
117
|
+
<Button {...props} size="sm">
|
|
118
|
+
Small
|
|
119
|
+
</Button>
|
|
120
|
+
<Button {...props} size="md">
|
|
121
|
+
Medium
|
|
122
|
+
</Button>
|
|
123
|
+
<Button {...props} size="lg">
|
|
124
|
+
Large
|
|
125
|
+
</Button>
|
|
126
|
+
</>
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
### Colors
|
|
@@ -132,22 +132,22 @@ Apply semantic colors to communicate intent.
|
|
|
132
132
|
|
|
133
133
|
```tsx
|
|
134
134
|
<>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</>
|
|
135
|
+
<Button {...props} color="primary">
|
|
136
|
+
Primary
|
|
137
|
+
</Button>
|
|
138
|
+
<Button {...props} color="neutral">
|
|
139
|
+
Neutral
|
|
140
|
+
</Button>
|
|
141
|
+
<Button {...props} color="danger">
|
|
142
|
+
Danger
|
|
143
|
+
</Button>
|
|
144
|
+
<Button {...props} color="success">
|
|
145
|
+
Success
|
|
146
|
+
</Button>
|
|
147
|
+
<Button {...props} color="warning">
|
|
148
|
+
Warning
|
|
149
|
+
</Button>
|
|
150
|
+
</>
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
- **primary**: Main actions (default)
|
|
@@ -162,13 +162,13 @@ Add icons or other elements before or after the button text using `startDecorato
|
|
|
162
162
|
|
|
163
163
|
```tsx
|
|
164
164
|
<>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
</>
|
|
165
|
+
<Button {...props} startDecorator={<Add />}>
|
|
166
|
+
Add to cart
|
|
167
|
+
</Button>
|
|
168
|
+
<Button {...props} endDecorator={<Add />} color="success">
|
|
169
|
+
Go to checkout
|
|
170
|
+
</Button>
|
|
171
|
+
</>
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
### Loading Indicator
|
|
@@ -177,13 +177,13 @@ Customize the loading spinner with the `loadingIndicator` prop.
|
|
|
177
177
|
|
|
178
178
|
```tsx
|
|
179
179
|
<>
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
</>
|
|
180
|
+
<Button {...props} loading>
|
|
181
|
+
Default
|
|
182
|
+
</Button>
|
|
183
|
+
<Button {...props} loading loadingIndicator="Loading…">
|
|
184
|
+
Custom
|
|
185
|
+
</Button>
|
|
186
|
+
</>
|
|
187
187
|
```
|
|
188
188
|
|
|
189
189
|
### Loading Position
|
|
@@ -192,13 +192,13 @@ Control where the loading indicator appears with `loadingPosition`.
|
|
|
192
192
|
|
|
193
193
|
```tsx
|
|
194
194
|
<>
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
</>
|
|
195
|
+
<Button {...props} loading loadingPosition="start">
|
|
196
|
+
Start
|
|
197
|
+
</Button>
|
|
198
|
+
<Button {...props} loading loadingPosition="end" endDecorator={<Add />}>
|
|
199
|
+
End
|
|
200
|
+
</Button>
|
|
201
|
+
</>
|
|
202
202
|
```
|
|
203
203
|
|
|
204
204
|
## Common Use Cases
|