@utilitywarehouse/hearth-react 0.30.3 → 0.31.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/chunk-52NQJSZ4.cjs +4 -0
- package/dist/chunk-52NQJSZ4.cjs.map +1 -0
- package/dist/chunk-7CV7RBFK.js +4 -0
- package/dist/chunk-7CV7RBFK.js.map +1 -0
- package/dist/chunk-DSRDXNH3.cjs +4 -0
- package/dist/chunk-DSRDXNH3.cjs.map +1 -0
- package/dist/chunk-E37ICSZV.js +4 -0
- package/dist/chunk-E37ICSZV.js.map +1 -0
- package/dist/chunk-ECA6VI7J.js +4 -0
- package/dist/chunk-ECA6VI7J.js.map +1 -0
- package/dist/chunk-EUOX7RSZ.js +4 -0
- package/dist/chunk-EUOX7RSZ.js.map +1 -0
- package/dist/chunk-GDJ3WYMP.cjs +4 -0
- package/dist/chunk-GDJ3WYMP.cjs.map +1 -0
- package/dist/chunk-NJMLALZH.js +4 -0
- package/dist/chunk-NJMLALZH.js.map +1 -0
- package/dist/chunk-OSQTRLPK.js +4 -0
- package/dist/chunk-OSQTRLPK.js.map +1 -0
- package/dist/chunk-PQPP4JZR.cjs +4 -0
- package/dist/chunk-PQPP4JZR.cjs.map +1 -0
- package/dist/chunk-UXOZQAZJ.cjs +4 -0
- package/dist/chunk-UXOZQAZJ.cjs.map +1 -0
- package/dist/chunk-WDLLAQFF.cjs +4 -0
- package/dist/chunk-WDLLAQFF.cjs.map +1 -0
- package/dist/chunk-XPPODAZP.cjs +4 -0
- package/dist/chunk-XPPODAZP.cjs.map +1 -0
- package/dist/chunk-XVV4DBFD.js +4 -0
- package/dist/chunk-XVV4DBFD.js.map +1 -0
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.d.ts +2 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/Menu.props.d.ts +8 -3
- package/dist/components/Menu/Menu.props.d.ts.map +1 -1
- package/dist/components/Menu/MenuContent.cjs +1 -1
- package/dist/components/Menu/MenuContent.cjs.map +1 -1
- package/dist/components/Menu/MenuContent.d.ts +1 -1
- package/dist/components/Menu/MenuContent.d.ts.map +1 -1
- package/dist/components/Menu/MenuContent.js +1 -1
- package/dist/components/Menu/MenuContent.props.d.ts +21 -4
- package/dist/components/Menu/MenuContent.props.d.ts.map +1 -1
- package/dist/components/Menu/MenuItem.cjs +1 -1
- package/dist/components/Menu/MenuItem.cjs.map +1 -1
- package/dist/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuItem.props.d.ts +21 -4
- package/dist/components/Menu/MenuItem.props.d.ts.map +1 -1
- package/dist/components/Menu/MenuTrigger.cjs +1 -1
- package/dist/components/Menu/MenuTrigger.js +1 -1
- package/dist/components/Menu/MenuTrigger.props.d.ts +10 -3
- package/dist/components/Menu/MenuTrigger.props.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.cjs +4 -0
- package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +13 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +4 -0
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.props.cjs +4 -0
- package/dist/components/SegmentedControl/SegmentedControl.props.cjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.props.d.ts +23 -0
- package/dist/components/SegmentedControl/SegmentedControl.props.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.props.js +4 -0
- package/dist/components/SegmentedControl/SegmentedControl.props.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.cjs +4 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.cjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.d.ts +9 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.js +4 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.props.cjs +3 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.props.cjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.props.d.ts +17 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.props.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.props.js +3 -0
- package/dist/components/SegmentedControl/SegmentedControlOption.props.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/public/llms/components/menu.md +161 -33
- package/public/llms/components/segmented-control.md +295 -0
- package/public/llms/docs/getting-started.md +1 -1
- package/public/llms.txt +2 -1
- package/styles.css +1 -1
- package/dist/chunk-7BXFXDDZ.js +0 -4
- package/dist/chunk-7BXFXDDZ.js.map +0 -1
- package/dist/chunk-BCAGQPQD.cjs +0 -4
- package/dist/chunk-BCAGQPQD.cjs.map +0 -1
- package/dist/chunk-GVIVGMOJ.js +0 -4
- package/dist/chunk-GVIVGMOJ.js.map +0 -1
- package/dist/chunk-GVUQYOSO.cjs +0 -4
- package/dist/chunk-GVUQYOSO.cjs.map +0 -1
- package/dist/chunk-K3AF4B5W.cjs +0 -4
- package/dist/chunk-K3AF4B5W.cjs.map +0 -1
- package/dist/chunk-NLZMPDP5.cjs +0 -4
- package/dist/chunk-NLZMPDP5.cjs.map +0 -1
- package/dist/chunk-PRWRW3JD.js +0 -4
- package/dist/chunk-PRWRW3JD.js.map +0 -1
- package/dist/chunk-PXIOYGGU.js +0 -4
- package/dist/chunk-PXIOYGGU.js.map +0 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# SegmentedControl
|
|
2
|
+
|
|
3
|
+
Use a Segmented Control to switch between alternative views of closely related content.
|
|
4
|
+
|
|
5
|
+
- [Usage](#usage)
|
|
6
|
+
- [Sizes](#sizes)
|
|
7
|
+
- [Icons](#icons)
|
|
8
|
+
- [API](#api)
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
<Flex direction="column" gap="400">
|
|
12
|
+
<BodyText as="p" size="md" weight="semibold">
|
|
13
|
+
SM — labels
|
|
14
|
+
</BodyText>
|
|
15
|
+
<SegmentedControl defaultValue={['option-1']} size="sm">
|
|
16
|
+
<SegmentedControlOption value="option-1" label="Label" />
|
|
17
|
+
<SegmentedControlOption value="option-2" label="Label" />
|
|
18
|
+
<SegmentedControlOption value="option-3" label="Label" />
|
|
19
|
+
<SegmentedControlOption value="option-4" label="Label" />
|
|
20
|
+
</SegmentedControl>
|
|
21
|
+
|
|
22
|
+
<BodyText as="p" size="md" weight="semibold">
|
|
23
|
+
MD — labels
|
|
24
|
+
</BodyText>
|
|
25
|
+
<SegmentedControl defaultValue={['option-1']} size="md">
|
|
26
|
+
<SegmentedControlOption value="option-1" label="Label" />
|
|
27
|
+
<SegmentedControlOption value="option-2" label="Label" />
|
|
28
|
+
<SegmentedControlOption value="option-3" label="Label" />
|
|
29
|
+
<SegmentedControlOption value="option-4" label="Label" />
|
|
30
|
+
</SegmentedControl>
|
|
31
|
+
|
|
32
|
+
<BodyText as="p" size="md" weight="semibold">
|
|
33
|
+
SM — icons + labels
|
|
34
|
+
</BodyText>
|
|
35
|
+
<SegmentedControl defaultValue={['gas']} size="sm">
|
|
36
|
+
<SegmentedControlOption value="gas" label="Gas" icon={<GasSmallIcon />} />
|
|
37
|
+
<SegmentedControlOption
|
|
38
|
+
value="electricity"
|
|
39
|
+
label="Electricity"
|
|
40
|
+
icon={<ElectricitySmallIcon />}
|
|
41
|
+
/>
|
|
42
|
+
<SegmentedControlOption value="mobile" label="Mobile" icon={<MobileSmallIcon />} />
|
|
43
|
+
<SegmentedControlOption value="broadband" label="Broadband" icon={<BroadbandSmallIcon />} />
|
|
44
|
+
<SegmentedControlOption value="insurance" label="Insurance" icon={<InsuranceSmallIcon />} />
|
|
45
|
+
<SegmentedControlOption value="cashback" label="Cashback" icon={<CashbackCardSmallIcon />} />
|
|
46
|
+
</SegmentedControl>
|
|
47
|
+
|
|
48
|
+
<BodyText as="p" size="md" weight="semibold">
|
|
49
|
+
MD — icons + labels
|
|
50
|
+
</BodyText>
|
|
51
|
+
<SegmentedControl defaultValue={['gas']} size="md">
|
|
52
|
+
<SegmentedControlOption value="gas" label="Gas" icon={<GasMediumIcon />} />
|
|
53
|
+
<SegmentedControlOption
|
|
54
|
+
value="electricity"
|
|
55
|
+
label="Electricity"
|
|
56
|
+
icon={<ElectricityMediumIcon />}
|
|
57
|
+
/>
|
|
58
|
+
<SegmentedControlOption value="mobile" label="Mobile" icon={<MobileMediumIcon />} />
|
|
59
|
+
<SegmentedControlOption value="broadband" label="Broadband" icon={<BroadbandMediumIcon />} />
|
|
60
|
+
<SegmentedControlOption value="insurance" label="Insurance" icon={<InsuranceMediumIcon />} />
|
|
61
|
+
<SegmentedControlOption value="cashback" label="Cashback" icon={<CashbackCardMediumIcon />} />
|
|
62
|
+
</SegmentedControl>
|
|
63
|
+
|
|
64
|
+
<BodyText as="p" size="md" weight="semibold">
|
|
65
|
+
Disabled
|
|
66
|
+
</BodyText>
|
|
67
|
+
<SegmentedControl defaultValue={['option-1']} size="sm" disabled>
|
|
68
|
+
<SegmentedControlOption value="option-1" label="Label" />
|
|
69
|
+
<SegmentedControlOption value="option-2" label="Label" />
|
|
70
|
+
<SegmentedControlOption value="option-3" label="Label" />
|
|
71
|
+
</SegmentedControl>
|
|
72
|
+
|
|
73
|
+
<BodyText as="p" size="md" weight="semibold">
|
|
74
|
+
Per-option disabled
|
|
75
|
+
</BodyText>
|
|
76
|
+
<SegmentedControl defaultValue={['option-1']} size="sm">
|
|
77
|
+
<SegmentedControlOption value="option-1" label="Label" />
|
|
78
|
+
<SegmentedControlOption value="option-2" label="Label" disabled />
|
|
79
|
+
<SegmentedControlOption value="option-3" label="Label" />
|
|
80
|
+
</SegmentedControl>
|
|
81
|
+
</Flex>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Usage
|
|
85
|
+
|
|
86
|
+
Wrap `SegmentedControlOption` components in a `SegmentedControl`. Each option requires a unique `value`. Always provide a `defaultValue` — a Segmented Control cannot be used without a selected option.
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<SegmentedControl defaultValue={['gas']}>
|
|
90
|
+
<SegmentedControlOption value="gas" label="Gas" />
|
|
91
|
+
<SegmentedControlOption value="electricity" label="Electricity" />
|
|
92
|
+
</SegmentedControl>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<SegmentedControl {...args}>
|
|
97
|
+
<SegmentedControlOption value="option-1" label="Option 1" />
|
|
98
|
+
<SegmentedControlOption value="option-2" label="Option 2" />
|
|
99
|
+
<SegmentedControlOption value="option-3" label="Option 3" />
|
|
100
|
+
<SegmentedControlOption value="option-4" label="Option 4" />
|
|
101
|
+
</SegmentedControl>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Sizes
|
|
105
|
+
|
|
106
|
+
Two sizes are available: `sm` (32px, default) and `md` (48px). The `size` prop is responsive and can be used to display different sizes at different breakpoints.
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
<SegmentedControl size={{ mobile: 'sm', desktop: 'md' }} defaultValue={['gas']}>
|
|
110
|
+
...
|
|
111
|
+
</SegmentedControl>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Icons
|
|
115
|
+
|
|
116
|
+
Use the `icon` prop to display an icon before the label. Use the Small icon variant with `size="sm"` and the Medium icon variant with `size="md"`. Either add icons to all options or none — do not mix.
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
<SegmentedControl defaultValue={['gas']} size="sm">
|
|
120
|
+
<SegmentedControlOption value="gas" label="Gas" icon={<GasSmallIcon />} />
|
|
121
|
+
<SegmentedControlOption value="electricity" label="Electricity" icon={<ElectricitySmallIcon />} />
|
|
122
|
+
</SegmentedControl>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<Flex direction="column" gap="300" alignItems="start">
|
|
127
|
+
<SegmentedControl defaultValue={['gas']} size="sm">
|
|
128
|
+
<SegmentedControlOption value="gas" label="Gas" icon={<GasSmallIcon />} />
|
|
129
|
+
<SegmentedControlOption
|
|
130
|
+
value="electricity"
|
|
131
|
+
label="Electricity"
|
|
132
|
+
icon={<ElectricitySmallIcon />}
|
|
133
|
+
/>
|
|
134
|
+
<SegmentedControlOption value="mobile" label="Mobile" icon={<MobileSmallIcon />} />
|
|
135
|
+
<SegmentedControlOption value="broadband" label="Broadband" icon={<BroadbandSmallIcon />} />
|
|
136
|
+
<SegmentedControlOption value="insurance" label="Insurance" icon={<InsuranceSmallIcon />} />
|
|
137
|
+
<SegmentedControlOption value="cashback" label="Cashback" icon={<CashbackCardSmallIcon />} />
|
|
138
|
+
</SegmentedControl>
|
|
139
|
+
<SegmentedControl defaultValue={['gas']} size="md">
|
|
140
|
+
<SegmentedControlOption value="gas" label="Gas" icon={<GasMediumIcon />} />
|
|
141
|
+
<SegmentedControlOption
|
|
142
|
+
value="electricity"
|
|
143
|
+
label="Electricity"
|
|
144
|
+
icon={<ElectricityMediumIcon />}
|
|
145
|
+
/>
|
|
146
|
+
<SegmentedControlOption value="mobile" label="Mobile" icon={<MobileMediumIcon />} />
|
|
147
|
+
<SegmentedControlOption value="broadband" label="Broadband" icon={<BroadbandMediumIcon />} />
|
|
148
|
+
<SegmentedControlOption value="insurance" label="Insurance" icon={<InsuranceMediumIcon />} />
|
|
149
|
+
<SegmentedControlOption value="cashback" label="Cashback" icon={<CashbackCardMediumIcon />} />
|
|
150
|
+
</SegmentedControl>
|
|
151
|
+
</Flex>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Responsive icon sizes
|
|
155
|
+
|
|
156
|
+
If you need to render different sized icons in conjunction with the responsive `size` prop, use `Box` with display props to show the appropriate icon at each breakpoint.
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
import { GasMediumIcon, GasSmallIcon } from '@utilitywarehouse/hearth-react-icons';
|
|
160
|
+
import { Box, SegmentedControl, SegmentedControlOption } from '@utilitywarehouse/hearth-react';
|
|
161
|
+
|
|
162
|
+
<SegmentedControl defaultValue={['gas']} size={{ mobile: 'sm', desktop: 'md' }}>
|
|
163
|
+
<SegmentedControlOption
|
|
164
|
+
value="gas"
|
|
165
|
+
label="Gas"
|
|
166
|
+
icon={
|
|
167
|
+
<>
|
|
168
|
+
<Box asChild display={{ mobile: 'none', desktop: 'block' }}>
|
|
169
|
+
<GasMediumIcon />
|
|
170
|
+
</Box>
|
|
171
|
+
<Box asChild display={{ desktop: 'none' }}>
|
|
172
|
+
<GasSmallIcon />
|
|
173
|
+
</Box>
|
|
174
|
+
</>
|
|
175
|
+
}
|
|
176
|
+
/>
|
|
177
|
+
</SegmentedControl>;
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
<SegmentedControl defaultValue={['gas']} size={{ mobile: 'sm', desktop: 'md' }}>
|
|
182
|
+
<SegmentedControlOption
|
|
183
|
+
value="gas"
|
|
184
|
+
label="Gas"
|
|
185
|
+
icon={
|
|
186
|
+
<>
|
|
187
|
+
<Box asChild display={{ mobile: 'none', desktop: 'block' }}>
|
|
188
|
+
<GasMediumIcon />
|
|
189
|
+
</Box>
|
|
190
|
+
<Box asChild display={{ desktop: 'none' }}>
|
|
191
|
+
<GasSmallIcon />
|
|
192
|
+
</Box>
|
|
193
|
+
</>
|
|
194
|
+
}
|
|
195
|
+
/>
|
|
196
|
+
<SegmentedControlOption
|
|
197
|
+
value="electricity"
|
|
198
|
+
label="Electricity"
|
|
199
|
+
icon={
|
|
200
|
+
<>
|
|
201
|
+
<Box asChild display={{ mobile: 'none', desktop: 'block' }}>
|
|
202
|
+
<ElectricityMediumIcon />
|
|
203
|
+
</Box>
|
|
204
|
+
<Box asChild display={{ desktop: 'none' }}>
|
|
205
|
+
<ElectricitySmallIcon />
|
|
206
|
+
</Box>
|
|
207
|
+
</>
|
|
208
|
+
}
|
|
209
|
+
/>
|
|
210
|
+
<SegmentedControlOption
|
|
211
|
+
value="mobile"
|
|
212
|
+
label="Mobile"
|
|
213
|
+
icon={
|
|
214
|
+
<>
|
|
215
|
+
<Box asChild display={{ mobile: 'none', desktop: 'block' }}>
|
|
216
|
+
<MobileMediumIcon />
|
|
217
|
+
</Box>
|
|
218
|
+
<Box asChild display={{ desktop: 'none' }}>
|
|
219
|
+
<MobileSmallIcon />
|
|
220
|
+
</Box>
|
|
221
|
+
</>
|
|
222
|
+
}
|
|
223
|
+
/>
|
|
224
|
+
<SegmentedControlOption
|
|
225
|
+
value="broadband"
|
|
226
|
+
label="Broadband"
|
|
227
|
+
icon={
|
|
228
|
+
<>
|
|
229
|
+
<Box asChild display={{ mobile: 'none', desktop: 'block' }}>
|
|
230
|
+
<BroadbandMediumIcon />
|
|
231
|
+
</Box>
|
|
232
|
+
<Box asChild display={{ desktop: 'none' }}>
|
|
233
|
+
<BroadbandSmallIcon />
|
|
234
|
+
</Box>
|
|
235
|
+
</>
|
|
236
|
+
}
|
|
237
|
+
/>
|
|
238
|
+
<SegmentedControlOption
|
|
239
|
+
value="insurance"
|
|
240
|
+
label="Insurance"
|
|
241
|
+
icon={
|
|
242
|
+
<>
|
|
243
|
+
<Box asChild display={{ mobile: 'none', desktop: 'block' }}>
|
|
244
|
+
<InsuranceMediumIcon />
|
|
245
|
+
</Box>
|
|
246
|
+
<Box asChild display={{ desktop: 'none' }}>
|
|
247
|
+
<InsuranceSmallIcon />
|
|
248
|
+
</Box>
|
|
249
|
+
</>
|
|
250
|
+
}
|
|
251
|
+
/>
|
|
252
|
+
<SegmentedControlOption
|
|
253
|
+
value="cashback"
|
|
254
|
+
label="Cashback"
|
|
255
|
+
icon={
|
|
256
|
+
<>
|
|
257
|
+
<Box asChild display={{ mobile: 'none', desktop: 'block' }}>
|
|
258
|
+
<CashbackCardMediumIcon />
|
|
259
|
+
</Box>
|
|
260
|
+
<Box asChild display={{ desktop: 'none' }}>
|
|
261
|
+
<CashbackCardSmallIcon />
|
|
262
|
+
</Box>
|
|
263
|
+
</>
|
|
264
|
+
}
|
|
265
|
+
/>
|
|
266
|
+
</SegmentedControl>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## API
|
|
270
|
+
|
|
271
|
+
This component is based on the [Base UI ToggleGroup primitive](https://base-ui.com/react/components/toggle-group)
|
|
272
|
+
and supports the following common props:
|
|
273
|
+
|
|
274
|
+
- Margin
|
|
275
|
+
|
|
276
|
+
| Prop | Type | Default | Description |
|
|
277
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
278
|
+
| `value` | `readonly string[]` | — | The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. This is the controlled counterpart of `defaultValue`. |
|
|
279
|
+
| `defaultValue` | `(readonly string[] & (string \| number \| readonly string[]))` | — | The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. This is the uncontrolled counterpart of `value`. |
|
|
280
|
+
| `onValueChange` | `((groupValue: string[], eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element \| undefined; }) => void)` | — | Callback fired when the pressed states of the toggle group changes. |
|
|
281
|
+
| `disabled` | `boolean` | `false` | Whether the toggle group should ignore user interaction. |
|
|
282
|
+
| `size` | `Responsive<"sm" \| "md">` | `sm` | Sets the height of the control. `sm` is 32px and `md` is 48px. Accepts a responsive value to display different sizes at different breakpoints. |
|
|
283
|
+
|
|
284
|
+
### SegmentedControlOption API
|
|
285
|
+
|
|
286
|
+
This component is based on the `button` element.
|
|
287
|
+
|
|
288
|
+
| Prop | Type | Default | Description |
|
|
289
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
290
|
+
| `label` | `string` | — | The text label displayed inside the option. |
|
|
291
|
+
| `value` | `string` | — | The value that identifies this option within the SegmentedControl. |
|
|
292
|
+
| `pressed` | `boolean` | — | Whether the toggle button is currently pressed. This is the controlled counterpart of `defaultPressed`. |
|
|
293
|
+
| `defaultPressed` | `boolean` | `false` | Whether the toggle button is currently pressed. This is the uncontrolled counterpart of `pressed`. |
|
|
294
|
+
| `onPressedChange` | `((pressed: boolean, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element \| undefined; }) => void)` | — | Callback fired when the pressed state is changed. |
|
|
295
|
+
| `icon` | `ReactNode` | — | An icon to display before the label. Use the Small icon variant for `size="sm"` and the Medium icon variant for `size="md"`. When using the responsive `size` prop, see the docs for guidance on rendering responsive icons. |
|
package/public/llms.txt
CHANGED
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
- [Label](llms/components/label.md): ```tsx
|
|
73
73
|
- [Link](llms/components/link.md): Links are used to navigate a user to another page or website, another place on the same page, or to open a link in a new tab.
|
|
74
74
|
- [List](llms/components/list.md): The `List` component is a flexible and customizable component for displaying a
|
|
75
|
-
- [Menu](llms/components/menu.md): Use the `Menu` component to present a short list of actions or options in
|
|
75
|
+
- [Menu](llms/components/menu.md): Use the `Menu` component to present a short list of actions or options in
|
|
76
76
|
- [Modal](llms/components/modal.md): A `Modal` overlays content to request a decision or inform users of important information. When
|
|
77
77
|
- [Pagination](llms/components/pagination.md): Use the `Pagination` component to help users navigate through multiple pages of content.
|
|
78
78
|
- [PasswordInput](llms/components/password-input.md): `PasswordInput` is an interactive field that is used to securely collect users passwords.
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
- [RadioGroup](llms/components/radio-group.md): `RadioGroup` provides an accessible way to group and control a set of `Radio`, `RadioTile` or `RadioCard` components, allowing the user to select one option from a set. The `RadioGroup` is responsible for handling the value, helper text, validation status and text, as well as determining the presentation and selection of the items in the list. Follows the [WAI-ARIA Radio Group Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/radio/) for radio groups not contained in a toolbar.
|
|
82
82
|
- [SearchInput](llms/components/search-input.md): `SearchInput` allows users to enter a specific keyword or phrase and obtain results related to the context in which it is placed.
|
|
83
83
|
- [SectionHeader](llms/components/section-header.md): Use the `SectionHeader` component to help define and separate content within a
|
|
84
|
+
- [SegmentedControl](llms/components/segmented-control.md): Use a Segmented Control to switch between alternative views of closely related content.
|
|
84
85
|
- [Select](llms/components/select.md): `Select` enables users to select an option from a list of choices, and generally requires a final submit action to confirm the selection.
|
|
85
86
|
- [Skeleton](llms/components/skeleton.md): `Skeleton` is a collection of components that provide visual placeholders while
|
|
86
87
|
- [Spinner](llms/components/spinner.md): Using a Spinner is a common method for indicating that an asynchronous process is ongoing.
|