@ceed/ads 1.35.1 → 1.37.0-next.1
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/FilterableCheckboxGroup/FilterableCheckboxGroup.d.ts +1 -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 +2 -2
- package/dist/components/ProfileMenu/ProfileMenu.d.ts +3 -3
- 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 +24 -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 +61 -73
- package/dist/components/data-display/Badge.md +198 -182
- package/dist/components/data-display/Chip.md +165 -143
- 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 +1454 -1008
- package/dist/components/data-display/Tooltip.md +1 -1
- package/dist/components/data-display/Typography.md +101 -104
- package/dist/components/feedback/Alert.md +81 -87
- package/dist/components/feedback/CircularProgress.md +34 -38
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +297 -266
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +60 -1
- package/dist/components/inputs/Autocomplete.md +192 -96
- package/dist/components/inputs/Button.md +85 -85
- package/dist/components/inputs/ButtonGroup.md +197 -187
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +13 -31
- package/dist/components/inputs/CurrencyInput.md +6 -6
- 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 +116 -56
- package/dist/components/inputs/FormControl.md +76 -70
- package/dist/components/inputs/IconButton.md +231 -207
- package/dist/components/inputs/Input.md +133 -100
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +17 -33
- package/dist/components/inputs/RadioButton.md +322 -258
- package/dist/components/inputs/RadioList.md +68 -52
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +82 -60
- package/dist/components/inputs/Select.md +108 -97
- package/dist/components/inputs/Slider.md +155 -104
- package/dist/components/inputs/Switch.md +194 -139
- package/dist/components/inputs/Textarea.md +17 -22
- package/dist/components/inputs/Uploader/Uploader.md +69 -40
- 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 +15 -7
- package/dist/components/navigation/InsetDrawer.md +550 -378
- package/dist/components/navigation/Link.md +104 -94
- package/dist/components/navigation/Menu.md +624 -503
- package/dist/components/navigation/MenuButton.md +19 -11
- 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 +87 -76
- package/dist/components/navigation/ProfileMenu.md +67 -45
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +210 -184
- package/dist/components/surfaces/Accordions.md +90 -173
- package/dist/components/surfaces/Card.md +1096 -711
- 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 +5 -5
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1906 -1690
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1404 -1180
- package/framer/index.js +1 -1
- package/package.json +34 -36
|
@@ -36,11 +36,7 @@ function MyComponent() {
|
|
|
36
36
|
const [selectedValue, setSelectedValue] = useState('option1');
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
|
-
<RadioGroup
|
|
40
|
-
name="example"
|
|
41
|
-
value={selectedValue}
|
|
42
|
-
onChange={(e) => setSelectedValue(e.target.value)}
|
|
43
|
-
>
|
|
39
|
+
<RadioGroup name="example" value={selectedValue} onChange={(e) => setSelectedValue(e.target.value)}>
|
|
44
40
|
<Radio value="option1" label="Option 1" />
|
|
45
41
|
<Radio value="option2" label="Option 2" />
|
|
46
42
|
<Radio value="option3" label="Option 3" />
|
|
@@ -55,29 +51,29 @@ Radio supports four visual variants: `outlined` (default), `soft`, `solid`, and
|
|
|
55
51
|
|
|
56
52
|
```tsx
|
|
57
53
|
<FormControl>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</FormControl>
|
|
54
|
+
<FormLabel>Variants</FormLabel>
|
|
55
|
+
<RadioGroup defaultValue="outlined" name="radio-buttons-group">
|
|
56
|
+
<Radio value="outlined" label="Outlined" variant="outlined" />
|
|
57
|
+
<Radio value="soft" label="Soft" variant="soft" />
|
|
58
|
+
<Radio value="solid" label="Solid" variant="solid" />
|
|
59
|
+
<Radio value="plain" label="Plain" variant="plain" />
|
|
60
|
+
</RadioGroup>
|
|
61
|
+
</FormControl>
|
|
66
62
|
```
|
|
67
63
|
|
|
68
64
|
## Sizes
|
|
69
65
|
|
|
70
|
-
Three size presets are available: `sm
|
|
66
|
+
Three size presets are available: `sm` (default), `md`, and `lg`. Use smaller sizes for compact layouts and larger sizes for touch-friendly interfaces.
|
|
71
67
|
|
|
72
68
|
```tsx
|
|
73
69
|
<FormControl>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</FormControl>
|
|
70
|
+
<FormLabel>Sizes</FormLabel>
|
|
71
|
+
<RadioGroup defaultValue="medium" name="radio-buttons-group">
|
|
72
|
+
<Radio value="small" label="Small" size="sm" />
|
|
73
|
+
<Radio value="medium" label="Medium" size="md" />
|
|
74
|
+
<Radio value="large" label="Large" size="lg" />
|
|
75
|
+
</RadioGroup>
|
|
76
|
+
</FormControl>
|
|
81
77
|
```
|
|
82
78
|
|
|
83
79
|
## Colors
|
|
@@ -86,15 +82,15 @@ Radio supports five semantic colors: `primary`, `neutral`, `danger`, `success`,
|
|
|
86
82
|
|
|
87
83
|
```tsx
|
|
88
84
|
<FormControl>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</FormControl>
|
|
85
|
+
<FormLabel>Colors</FormLabel>
|
|
86
|
+
<RadioGroup defaultValue="medium" name="radio-buttons-group">
|
|
87
|
+
<Radio value="primary" label="Primary" color="primary" />
|
|
88
|
+
<Radio value="neutral" label="Neutral" color="neutral" />
|
|
89
|
+
<Radio value="danger" label="Danger" color="danger" />
|
|
90
|
+
<Radio value="success" label="Success" color="success" />
|
|
91
|
+
<Radio value="warning" label="Warning" color="warning" />
|
|
92
|
+
</RadioGroup>
|
|
93
|
+
</FormControl>
|
|
98
94
|
```
|
|
99
95
|
|
|
100
96
|
## Custom Icons
|
|
@@ -102,43 +98,55 @@ Radio supports five semantic colors: `primary`, `neutral`, `danger`, `success`,
|
|
|
102
98
|
Replace the default radio indicator with custom icons using the `checkedIcon` prop. This is useful for card-style selectors where the selection state needs a distinctive visual treatment.
|
|
103
99
|
|
|
104
100
|
```tsx
|
|
105
|
-
<RadioGroup
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
101
|
+
<RadioGroup
|
|
102
|
+
aria-label="platform"
|
|
103
|
+
defaultValue="Website"
|
|
104
|
+
overlay
|
|
105
|
+
name="platform"
|
|
106
|
+
sx={{
|
|
107
|
+
flexDirection: "row",
|
|
108
|
+
gap: 2,
|
|
109
|
+
[`& .${radioClasses.checked}`]: {
|
|
110
|
+
[`& .${radioClasses.action}`]: {
|
|
111
|
+
inset: -1,
|
|
112
|
+
border: "3px solid",
|
|
113
|
+
borderColor: "primary.500"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
[`& .${radioClasses.radio}`]: {
|
|
117
|
+
display: "contents",
|
|
118
|
+
"& > svg": {
|
|
119
|
+
zIndex: 2,
|
|
120
|
+
position: "absolute",
|
|
121
|
+
top: "-8px",
|
|
122
|
+
right: "-8px",
|
|
123
|
+
bgcolor: "background.surface",
|
|
124
|
+
borderRadius: "50%"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
{["Website", "Documents", "Social Account"].map((value) => (
|
|
130
|
+
<Sheet
|
|
131
|
+
key={value}
|
|
132
|
+
variant="outlined"
|
|
133
|
+
sx={{
|
|
134
|
+
borderRadius: "md",
|
|
135
|
+
boxShadow: "sm",
|
|
136
|
+
display: "flex",
|
|
137
|
+
flexDirection: "column",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
gap: 1.5,
|
|
140
|
+
p: 2,
|
|
141
|
+
minWidth: 120
|
|
142
|
+
}}
|
|
143
|
+
>
|
|
144
|
+
<Radio id={value} value={value} checkedIcon={<CheckCircleRoundedIcon />} />
|
|
145
|
+
<Avatar variant="soft" size="sm" />
|
|
146
|
+
<FormLabel htmlFor={value}>{value}</FormLabel>
|
|
147
|
+
</Sheet>
|
|
148
|
+
))}
|
|
149
|
+
</RadioGroup>
|
|
142
150
|
```
|
|
143
151
|
|
|
144
152
|
## No Icon
|
|
@@ -146,52 +154,69 @@ Replace the default radio indicator with custom icons using the `checkedIcon` pr
|
|
|
146
154
|
Use the `disableIcon` prop to hide the radio indicator entirely. This pattern is commonly used for card-style selectors where the entire card acts as the selectable target, and the selection state is conveyed through border or background styling.
|
|
147
155
|
|
|
148
156
|
```tsx
|
|
149
|
-
<Box
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
157
|
+
<Box
|
|
158
|
+
sx={{
|
|
159
|
+
width: 300
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
162
|
+
<FormLabel
|
|
163
|
+
id="storage-label"
|
|
164
|
+
sx={{
|
|
165
|
+
mb: 2,
|
|
166
|
+
fontWeight: "xl",
|
|
167
|
+
fontSize: "xs",
|
|
168
|
+
letterSpacing: "0.15rem"
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
Storage
|
|
172
|
+
</FormLabel>
|
|
173
|
+
<RadioGroup
|
|
174
|
+
aria-labelledby="storage-label"
|
|
175
|
+
defaultValue="512GB"
|
|
176
|
+
size="lg"
|
|
177
|
+
sx={{
|
|
178
|
+
gap: 1.5
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
{["512GB", "1TB", "2TB"].map((value) => (
|
|
182
|
+
<Sheet
|
|
183
|
+
key={value}
|
|
184
|
+
sx={{
|
|
185
|
+
p: 2,
|
|
186
|
+
borderRadius: "md",
|
|
187
|
+
boxShadow: "sm"
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
<Radio
|
|
191
|
+
label={`${value} SSD storage`}
|
|
192
|
+
overlay
|
|
193
|
+
disableIcon
|
|
194
|
+
value={value}
|
|
195
|
+
slotProps={{
|
|
196
|
+
label: ({ checked }) => ({
|
|
197
|
+
sx: {
|
|
198
|
+
fontWeight: "lg",
|
|
199
|
+
fontSize: "md",
|
|
200
|
+
color: checked ? "text.primary" : "text.secondary"
|
|
201
|
+
}
|
|
202
|
+
}),
|
|
203
|
+
action: ({ checked }) => ({
|
|
204
|
+
sx: (theme) => ({
|
|
205
|
+
...(checked && {
|
|
206
|
+
"--variant-borderWidth": "2px",
|
|
207
|
+
"&&": {
|
|
208
|
+
// && to increase the specificity to win the base :hover styles
|
|
209
|
+
borderColor: theme.vars.palette.primary[500]
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
}}
|
|
215
|
+
/>
|
|
216
|
+
</Sheet>
|
|
217
|
+
))}
|
|
218
|
+
</RadioGroup>
|
|
219
|
+
</Box>
|
|
195
220
|
```
|
|
196
221
|
|
|
197
222
|
## Segmented Controls
|
|
@@ -199,42 +224,60 @@ Storage
|
|
|
199
224
|
Radio buttons can be styled as segmented controls for compact, inline option switching. This pattern works well for toolbar-style controls where horizontal space is limited.
|
|
200
225
|
|
|
201
226
|
```tsx
|
|
202
|
-
<Box
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
227
|
+
<Box
|
|
228
|
+
sx={{
|
|
229
|
+
display: "flex",
|
|
230
|
+
alignItems: "center",
|
|
231
|
+
gap: 2
|
|
232
|
+
}}
|
|
233
|
+
>
|
|
234
|
+
<Typography id="segmented-controls-example" fontWeight="lg" fontSize="sm">
|
|
235
|
+
Justify:
|
|
236
|
+
</Typography>
|
|
237
|
+
<RadioGroup
|
|
238
|
+
orientation="horizontal"
|
|
239
|
+
aria-labelledby="segmented-controls-example"
|
|
240
|
+
name="justify"
|
|
241
|
+
value={justify}
|
|
242
|
+
onChange={(event: React.ChangeEvent<HTMLInputElement>) => setJustify(event.target.value)}
|
|
243
|
+
sx={{
|
|
244
|
+
minHeight: 48,
|
|
245
|
+
padding: "4px",
|
|
246
|
+
borderRadius: "12px",
|
|
247
|
+
bgcolor: "neutral.softBg",
|
|
248
|
+
"--RadioGroup-gap": "4px",
|
|
249
|
+
"--Radio-actionRadius": "8px"
|
|
250
|
+
}}
|
|
251
|
+
>
|
|
252
|
+
{["flex-start", "center", "flex-end"].map((item) => (
|
|
253
|
+
<Radio
|
|
254
|
+
key={item}
|
|
255
|
+
color="neutral"
|
|
256
|
+
value={item}
|
|
257
|
+
disableIcon
|
|
258
|
+
label={item}
|
|
259
|
+
variant="plain"
|
|
260
|
+
sx={{
|
|
261
|
+
px: 2,
|
|
262
|
+
alignItems: "center"
|
|
263
|
+
}}
|
|
264
|
+
slotProps={{
|
|
265
|
+
action: ({ checked }) => ({
|
|
266
|
+
sx: {
|
|
267
|
+
...(checked && {
|
|
268
|
+
bgcolor: "background.surface",
|
|
269
|
+
boxShadow: "sm",
|
|
270
|
+
"&:hover": {
|
|
271
|
+
bgcolor: "background.surface"
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
}
|
|
275
|
+
})
|
|
276
|
+
}}
|
|
277
|
+
/>
|
|
278
|
+
))}
|
|
279
|
+
</RadioGroup>
|
|
280
|
+
</Box>
|
|
238
281
|
```
|
|
239
282
|
|
|
240
283
|
## Product Attributes
|
|
@@ -242,98 +285,132 @@ Radio buttons can be styled as segmented controls for compact, inline option swi
|
|
|
242
285
|
Radio groups can be customized to represent product attributes such as colors and sizes. Using `overlay`, `disableIcon`, and custom `Sheet` containers, you can create rich visual selectors.
|
|
243
286
|
|
|
244
287
|
```tsx
|
|
245
|
-
<Box
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
288
|
+
<Box
|
|
289
|
+
sx={{
|
|
290
|
+
overflow: "auto",
|
|
291
|
+
px: 2
|
|
292
|
+
}}
|
|
293
|
+
>
|
|
294
|
+
<FormLabel
|
|
295
|
+
id="product-color-attribute"
|
|
296
|
+
sx={{
|
|
297
|
+
mb: 1.5,
|
|
298
|
+
fontWeight: "xl",
|
|
299
|
+
textTransform: "uppercase",
|
|
300
|
+
fontSize: "xs",
|
|
301
|
+
letterSpacing: "0.1em"
|
|
302
|
+
}}
|
|
303
|
+
>
|
|
304
|
+
Color
|
|
305
|
+
</FormLabel>
|
|
306
|
+
<RadioGroup
|
|
307
|
+
aria-labelledby="product-color-attribute"
|
|
308
|
+
defaultValue="warning"
|
|
309
|
+
sx={{
|
|
310
|
+
gap: 2,
|
|
311
|
+
flexWrap: "wrap",
|
|
312
|
+
flexDirection: "row"
|
|
313
|
+
}}
|
|
314
|
+
>
|
|
315
|
+
{(["primary", "neutral", "danger", "success", "warning"] as const).map((color) => (
|
|
316
|
+
<Sheet
|
|
317
|
+
key={color}
|
|
318
|
+
sx={{
|
|
319
|
+
position: "relative",
|
|
320
|
+
width: 40,
|
|
321
|
+
height: 40,
|
|
322
|
+
flexShrink: 0,
|
|
323
|
+
bgcolor: `${color}.solidBg`,
|
|
324
|
+
borderRadius: "50%",
|
|
325
|
+
display: "flex",
|
|
326
|
+
alignItems: "center",
|
|
327
|
+
justifyContent: "center"
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
<Radio
|
|
331
|
+
overlay
|
|
332
|
+
variant="solid"
|
|
333
|
+
color={color}
|
|
334
|
+
checkedIcon={<Done fontSize="large" />}
|
|
335
|
+
value={color}
|
|
336
|
+
slotProps={{
|
|
337
|
+
input: {
|
|
338
|
+
"aria-label": color
|
|
339
|
+
},
|
|
340
|
+
radio: {
|
|
341
|
+
sx: {
|
|
342
|
+
display: "contents",
|
|
343
|
+
"--variant-borderWidth": "2px"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}}
|
|
347
|
+
sx={{
|
|
348
|
+
"--joy-focus-outlineOffset": "4px",
|
|
349
|
+
"--joy-palette-focusVisible": (theme) => theme.vars.palette[color][500],
|
|
350
|
+
[`& .${radioClasses.action}.${radioClasses.focusVisible}`]: {
|
|
351
|
+
outlineWidth: "2px"
|
|
352
|
+
}
|
|
353
|
+
}}
|
|
354
|
+
/>
|
|
355
|
+
</Sheet>
|
|
356
|
+
))}
|
|
357
|
+
</RadioGroup>
|
|
358
|
+
<br />
|
|
359
|
+
<FormLabel
|
|
360
|
+
id="product-size-attribute"
|
|
361
|
+
sx={{
|
|
362
|
+
mb: 1.5,
|
|
363
|
+
fontWeight: "xl",
|
|
364
|
+
textTransform: "uppercase",
|
|
365
|
+
fontSize: "xs",
|
|
366
|
+
letterSpacing: "0.1em"
|
|
367
|
+
}}
|
|
368
|
+
>
|
|
369
|
+
Size
|
|
370
|
+
</FormLabel>
|
|
371
|
+
<RadioGroup
|
|
372
|
+
aria-labelledby="product-size-attribute"
|
|
373
|
+
defaultValue="M"
|
|
374
|
+
sx={{
|
|
375
|
+
gap: 2,
|
|
376
|
+
mb: 2,
|
|
377
|
+
flexWrap: "wrap",
|
|
378
|
+
flexDirection: "row"
|
|
379
|
+
}}
|
|
380
|
+
>
|
|
381
|
+
{["XS", "S", "M", "L", "XL"].map((size) => (
|
|
382
|
+
<Sheet
|
|
383
|
+
key={size}
|
|
384
|
+
sx={{
|
|
385
|
+
position: "relative",
|
|
386
|
+
width: 40,
|
|
387
|
+
height: 40,
|
|
388
|
+
flexShrink: 0,
|
|
389
|
+
borderRadius: "50%",
|
|
390
|
+
display: "flex",
|
|
391
|
+
alignItems: "center",
|
|
392
|
+
justifyContent: "center",
|
|
393
|
+
"--joy-focus-outlineOffset": "4px",
|
|
394
|
+
"--joy-palette-focusVisible": (theme) => theme.vars.palette.neutral.outlinedBorder,
|
|
395
|
+
[`& .${radioClasses.checked}`]: {
|
|
396
|
+
[`& .${radioClasses.label}`]: {
|
|
397
|
+
fontWeight: "lg"
|
|
398
|
+
},
|
|
399
|
+
[`& .${radioClasses.action}`]: {
|
|
400
|
+
"--variant-borderWidth": "2px",
|
|
401
|
+
borderColor: "text.secondary"
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
[`& .${radioClasses.action}.${radioClasses.focusVisible}`]: {
|
|
405
|
+
outlineWidth: "2px"
|
|
406
|
+
}
|
|
407
|
+
}}
|
|
408
|
+
>
|
|
409
|
+
<Radio color="neutral" overlay disableIcon value={size} label={size} />
|
|
410
|
+
</Sheet>
|
|
411
|
+
))}
|
|
412
|
+
</RadioGroup>
|
|
413
|
+
</Box>
|
|
337
414
|
```
|
|
338
415
|
|
|
339
416
|
## Survey Questionnaire Form
|
|
@@ -345,11 +422,7 @@ function SurveyQuestion() {
|
|
|
345
422
|
return (
|
|
346
423
|
<FormControl>
|
|
347
424
|
<FormLabel>How satisfied are you with our service?</FormLabel>
|
|
348
|
-
<RadioGroup
|
|
349
|
-
name="satisfaction"
|
|
350
|
-
value={answer}
|
|
351
|
-
onChange={(e) => setAnswer(e.target.value)}
|
|
352
|
-
>
|
|
425
|
+
<RadioGroup name="satisfaction" value={answer} onChange={(e) => setAnswer(e.target.value)}>
|
|
353
426
|
<Radio value="very-satisfied" label="Very Satisfied" color="success" />
|
|
354
427
|
<Radio value="satisfied" label="Satisfied" />
|
|
355
428
|
<Radio value="neutral" label="Neutral" />
|
|
@@ -370,12 +443,7 @@ function PaymentMethodSelector() {
|
|
|
370
443
|
return (
|
|
371
444
|
<FormControl>
|
|
372
445
|
<FormLabel>Payment Method</FormLabel>
|
|
373
|
-
<RadioGroup
|
|
374
|
-
name="payment"
|
|
375
|
-
value={method}
|
|
376
|
-
onChange={(e) => setMethod(e.target.value)}
|
|
377
|
-
sx={{ gap: 1.5 }}
|
|
378
|
-
>
|
|
446
|
+
<RadioGroup name="payment" value={method} onChange={(e) => setMethod(e.target.value)} sx={{ gap: 1.5 }}>
|
|
379
447
|
{[
|
|
380
448
|
{ value: 'credit-card', label: 'Credit Card' },
|
|
381
449
|
{ value: 'bank-transfer', label: 'Bank Transfer' },
|
|
@@ -414,11 +482,7 @@ function ShippingOptions() {
|
|
|
414
482
|
return (
|
|
415
483
|
<FormControl>
|
|
416
484
|
<FormLabel>Shipping Speed</FormLabel>
|
|
417
|
-
<RadioGroup
|
|
418
|
-
name="shipping"
|
|
419
|
-
value={shipping}
|
|
420
|
-
onChange={(e) => setShipping(e.target.value)}
|
|
421
|
-
>
|
|
485
|
+
<RadioGroup name="shipping" value={shipping} onChange={(e) => setShipping(e.target.value)}>
|
|
422
486
|
<Radio value="standard" label="Standard (5-7 business days) - Free" />
|
|
423
487
|
<Radio value="express" label="Express (2-3 business days) - $9.99" />
|
|
424
488
|
<Radio value="overnight" label="Overnight (next day) - $24.99" />
|
|
@@ -481,7 +545,7 @@ function ShippingOptions() {
|
|
|
481
545
|
| `value` | `string` | - | Value attribute for form submission |
|
|
482
546
|
| `name` | `string` | - | Groups radios together for mutual exclusivity |
|
|
483
547
|
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Color scheme |
|
|
484
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'
|
|
548
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'sm'` | Radio button size |
|
|
485
549
|
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'outlined'` | Visual style |
|
|
486
550
|
| `disabled` | `boolean` | `false` | Disables the radio button |
|
|
487
551
|
| `overlay` | `boolean` | `false` | Extends clickable area to parent container |
|