@ceed/ads 1.35.1 → 1.36.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/README.md +85 -95
- 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/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/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FilterMenu/components/MonthRange.d.ts +11 -0
- package/dist/components/FilterMenu/types.d.ts +5 -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/ProfileMenu/ProfileMenu.d.ts +2 -2
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.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/ThemeProvider/ThemeProvider.d.ts +4 -2
- 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 +101 -104
- 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 -265
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +60 -1
- 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/FilterMenu.md +138 -8
- 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 +82 -60
- 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 +182 -116
- package/dist/components/navigation/Dropdown.md +732 -391
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +550 -378
- package/dist/components/navigation/Link.md +104 -94
- 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/ProfileMenu.md +65 -43
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +209 -183
- 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 +65 -40
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1643 -1550
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1303 -1202
- 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 |
|
|
@@ -36,10 +36,10 @@ The most basic button usage.
|
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
38
|
<>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</>
|
|
39
|
+
<Button {...props} />
|
|
40
|
+
<Button {...props} disabled />
|
|
41
|
+
<Button {...props} loading />
|
|
42
|
+
</>
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
## Disabled Button
|
|
@@ -48,19 +48,19 @@ A disabled button cannot be clicked and is visually dimmed.
|
|
|
48
48
|
|
|
49
49
|
```tsx
|
|
50
50
|
<>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</>
|
|
51
|
+
<Button {...props} startDecorator={<Add />} variant="solid">
|
|
52
|
+
Solid
|
|
53
|
+
</Button>
|
|
54
|
+
<Button {...props} startDecorator={<Add />} variant="soft">
|
|
55
|
+
Soft
|
|
56
|
+
</Button>
|
|
57
|
+
<Button {...props} startDecorator={<Add />} variant="outlined">
|
|
58
|
+
Outlined
|
|
59
|
+
</Button>
|
|
60
|
+
<Button {...props} startDecorator={<Add />} variant="plain">
|
|
61
|
+
Plain
|
|
62
|
+
</Button>
|
|
63
|
+
</>
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Button Loading State
|
|
@@ -84,19 +84,19 @@ Four visual styles are available to indicate action importance.
|
|
|
84
84
|
|
|
85
85
|
```tsx
|
|
86
86
|
<>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
</>
|
|
87
|
+
<Button {...props} variant="solid">
|
|
88
|
+
Solid
|
|
89
|
+
</Button>
|
|
90
|
+
<Button {...props} variant="soft">
|
|
91
|
+
Soft
|
|
92
|
+
</Button>
|
|
93
|
+
<Button {...props} variant="outlined">
|
|
94
|
+
Outlined
|
|
95
|
+
</Button>
|
|
96
|
+
<Button {...props} variant="plain">
|
|
97
|
+
Plain
|
|
98
|
+
</Button>
|
|
99
|
+
</>
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
- **solid**: High-emphasis primary actions (default)
|
|
@@ -110,16 +110,16 @@ Three sizes are available: `sm`, `md` (default), and `lg`.
|
|
|
110
110
|
|
|
111
111
|
```tsx
|
|
112
112
|
<>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</>
|
|
113
|
+
<Button {...props} size="sm">
|
|
114
|
+
Small
|
|
115
|
+
</Button>
|
|
116
|
+
<Button {...props} size="md">
|
|
117
|
+
Medium
|
|
118
|
+
</Button>
|
|
119
|
+
<Button {...props} size="lg">
|
|
120
|
+
Large
|
|
121
|
+
</Button>
|
|
122
|
+
</>
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
## Colors
|
|
@@ -128,22 +128,22 @@ Apply semantic colors to communicate intent.
|
|
|
128
128
|
|
|
129
129
|
```tsx
|
|
130
130
|
<>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
</>
|
|
131
|
+
<Button {...props} color="primary">
|
|
132
|
+
Primary
|
|
133
|
+
</Button>
|
|
134
|
+
<Button {...props} color="neutral">
|
|
135
|
+
Neutral
|
|
136
|
+
</Button>
|
|
137
|
+
<Button {...props} color="danger">
|
|
138
|
+
Danger
|
|
139
|
+
</Button>
|
|
140
|
+
<Button {...props} color="success">
|
|
141
|
+
Success
|
|
142
|
+
</Button>
|
|
143
|
+
<Button {...props} color="warning">
|
|
144
|
+
Warning
|
|
145
|
+
</Button>
|
|
146
|
+
</>
|
|
147
147
|
```
|
|
148
148
|
|
|
149
149
|
- **primary**: Main actions (default)
|
|
@@ -158,13 +158,13 @@ Add icons or other elements before or after the button text using `startDecorato
|
|
|
158
158
|
|
|
159
159
|
```tsx
|
|
160
160
|
<>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
</>
|
|
161
|
+
<Button {...props} startDecorator={<Add />}>
|
|
162
|
+
Add to cart
|
|
163
|
+
</Button>
|
|
164
|
+
<Button {...props} endDecorator={<Add />} color="success">
|
|
165
|
+
Go to checkout
|
|
166
|
+
</Button>
|
|
167
|
+
</>
|
|
168
168
|
```
|
|
169
169
|
|
|
170
170
|
## Loading Indicator Customization
|
|
@@ -173,13 +173,13 @@ Customize the loading spinner with the `loadingIndicator` prop.
|
|
|
173
173
|
|
|
174
174
|
```tsx
|
|
175
175
|
<>
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
</>
|
|
176
|
+
<Button {...props} loading>
|
|
177
|
+
Default
|
|
178
|
+
</Button>
|
|
179
|
+
<Button {...props} loading loadingIndicator="Loading…">
|
|
180
|
+
Custom
|
|
181
|
+
</Button>
|
|
182
|
+
</>
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
## Loading Position
|
|
@@ -188,13 +188,13 @@ Control where the loading indicator appears with `loadingPosition`.
|
|
|
188
188
|
|
|
189
189
|
```tsx
|
|
190
190
|
<>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
</>
|
|
191
|
+
<Button {...props} loading loadingPosition="start">
|
|
192
|
+
Start
|
|
193
|
+
</Button>
|
|
194
|
+
<Button {...props} loading loadingPosition="end" endDecorator={<Add />}>
|
|
195
|
+
End
|
|
196
|
+
</Button>
|
|
197
|
+
</>
|
|
198
198
|
```
|
|
199
199
|
|
|
200
200
|
## Button in Form Submission
|