@coinbase/cds-mcp-server 8.37.1 → 8.38.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/CHANGELOG.md +8 -0
- package/mcp-docs/mobile/components/Combobox.txt +52 -0
- package/mcp-docs/mobile/components/DateInput.txt +5 -5
- package/mcp-docs/mobile/components/DatePicker.txt +205 -40
- package/mcp-docs/mobile/components/SelectAlpha.txt +44 -0
- package/mcp-docs/mobile/components/SelectChipAlpha.txt +1 -0
- package/mcp-docs/mobile/components/TextInput.txt +52 -25
- package/mcp-docs/mobile/components/Toast.txt +324 -60
- package/mcp-docs/web/components/Combobox.txt +52 -0
- package/mcp-docs/web/components/DateInput.txt +5 -5
- package/mcp-docs/web/components/DatePicker.txt +240 -67
- package/mcp-docs/web/components/SelectAlpha.txt +44 -0
- package/mcp-docs/web/components/SelectChipAlpha.txt +1 -0
- package/mcp-docs/web/components/TextInput.txt +65 -76
- package/mcp-docs/web/components/Toast.txt +325 -61
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.38.1 ((1/15/2026, 10:22 AM PST))
|
|
12
|
+
|
|
13
|
+
This is an artificial version bump with no new change.
|
|
14
|
+
|
|
15
|
+
## 8.38.0 ((1/14/2026, 01:30 PM PST))
|
|
16
|
+
|
|
17
|
+
This is an artificial version bump with no new change.
|
|
18
|
+
|
|
11
19
|
## 8.37.1 ((1/14/2026, 12:37 PM PST))
|
|
12
20
|
|
|
13
21
|
This is an artificial version bump with no new change.
|
|
@@ -133,6 +133,57 @@ function HelperTextExample() {
|
|
|
133
133
|
}
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
### Borderless
|
|
137
|
+
|
|
138
|
+
You can remove the border from the combobox control by setting `bordered` to `false`.
|
|
139
|
+
|
|
140
|
+
```jsx
|
|
141
|
+
function BorderlessExample() {
|
|
142
|
+
const singleSelectOptions = [
|
|
143
|
+
{ value: null, label: 'Remove selection' },
|
|
144
|
+
{ value: 'apple', label: 'Apple' },
|
|
145
|
+
{ value: 'banana', label: 'Banana' },
|
|
146
|
+
{ value: 'cherry', label: 'Cherry' },
|
|
147
|
+
{ value: 'date', label: 'Date' },
|
|
148
|
+
];
|
|
149
|
+
|
|
150
|
+
const fruitOptions = [
|
|
151
|
+
{ value: 'apple', label: 'Apple' },
|
|
152
|
+
{ value: 'banana', label: 'Banana' },
|
|
153
|
+
{ value: 'cherry', label: 'Cherry' },
|
|
154
|
+
{ value: 'date', label: 'Date' },
|
|
155
|
+
{ value: 'elderberry', label: 'Elderberry' },
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
const [singleValue, setSingleValue] = useState('apple');
|
|
159
|
+
const { value: multiValue, onChange: multiOnChange } = useMultiSelect({
|
|
160
|
+
initialValue: ['apple'],
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<VStack gap={4}>
|
|
165
|
+
<Combobox
|
|
166
|
+
bordered={false}
|
|
167
|
+
label="Borderless single select"
|
|
168
|
+
onChange={setSingleValue}
|
|
169
|
+
options={singleSelectOptions}
|
|
170
|
+
placeholder="Search fruits..."
|
|
171
|
+
value={singleValue}
|
|
172
|
+
/>
|
|
173
|
+
<Combobox
|
|
174
|
+
bordered={false}
|
|
175
|
+
label="Borderless multi select"
|
|
176
|
+
onChange={multiOnChange}
|
|
177
|
+
options={fruitOptions}
|
|
178
|
+
placeholder="Search fruits..."
|
|
179
|
+
type="multi"
|
|
180
|
+
value={multiValue}
|
|
181
|
+
/>
|
|
182
|
+
</VStack>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
136
187
|
## Props
|
|
137
188
|
|
|
138
189
|
| Prop | Type | Required | Default | Description |
|
|
@@ -150,6 +201,7 @@ function HelperTextExample() {
|
|
|
150
201
|
| `SelectOptionGroupComponent` | `SelectOptionGroupComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render group headers |
|
|
151
202
|
| `accessibilityRoles` | `{ option?: AccessibilityRole; } \| undefined` | No | `-` | Accessibility roles for dropdown elements |
|
|
152
203
|
| `accessory` | `ReactElement<CellAccessoryProps, string \| JSXElementConstructor<any>>` | No | `-` | - |
|
|
204
|
+
| `bordered` | `boolean` | No | `true` | Add a border around all sides of the box. Determines if the control should have a default border. |
|
|
153
205
|
| `clearAllLabel` | `string` | No | `-` | Label for the Clear All option in multi-select mode |
|
|
154
206
|
| `closeButtonLabel` | `string` | No | `-` | Label for close button when combobox is open (mobile only) |
|
|
155
207
|
| `compact` | `boolean` | No | `-` | Whether to use compact styling for the select |
|
|
@@ -292,20 +292,20 @@ function Example() {
|
|
|
292
292
|
|
|
293
293
|
return (
|
|
294
294
|
<DateInput
|
|
295
|
+
accessibilityLabel="Birthdate"
|
|
295
296
|
date={date}
|
|
296
297
|
error={error}
|
|
297
|
-
|
|
298
|
-
onErrorDate={setError}
|
|
299
|
-
label="Birthdate"
|
|
298
|
+
invalidDateError="Please enter a valid date"
|
|
300
299
|
labelNode={
|
|
301
300
|
<HStack alignItems="center" gap={1}>
|
|
302
301
|
<InputLabel>Birthdate</InputLabel>
|
|
303
302
|
<Tooltip content="This will be visible to other users.">
|
|
304
|
-
<Icon
|
|
303
|
+
<Icon color="fgMuted" name="info" size="xs" />
|
|
305
304
|
</Tooltip>
|
|
306
305
|
</HStack>
|
|
307
306
|
}
|
|
308
|
-
|
|
307
|
+
onChangeDate={setDate}
|
|
308
|
+
onErrorDate={setError}
|
|
309
309
|
/>
|
|
310
310
|
);
|
|
311
311
|
}
|
|
@@ -38,9 +38,11 @@ function Example() {
|
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
####
|
|
41
|
+
#### Validation
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
##### Invalid dates
|
|
44
|
+
|
|
45
|
+
Always provide the `invalidDateError` prop for when users type an impossible date like 99/99/2000.
|
|
44
46
|
|
|
45
47
|
```jsx
|
|
46
48
|
function Example() {
|
|
@@ -54,47 +56,66 @@ function Example() {
|
|
|
54
56
|
onChangeDate={setDate}
|
|
55
57
|
onErrorDate={setError}
|
|
56
58
|
label="Birthdate"
|
|
57
|
-
labelNode={
|
|
58
|
-
<HStack alignItems="center" gap={1}>
|
|
59
|
-
<InputLabel>Birthdate</InputLabel>
|
|
60
|
-
<Tooltip content="This will be visible to other users.">
|
|
61
|
-
<Icon color="fgMuted" name="info" size="xs" />
|
|
62
|
-
</Tooltip>
|
|
63
|
-
</HStack>
|
|
64
|
-
}
|
|
65
|
-
calendarIconButtonAccessibilityLabel="Birthdate calendar"
|
|
66
|
-
nextArrowAccessibilityLabel="Next month"
|
|
67
|
-
previousArrowAccessibilityLabel="Previous month"
|
|
68
|
-
helperTextErrorIconAccessibilityLabel="Error"
|
|
69
59
|
invalidDateError="Please enter a valid date"
|
|
70
60
|
/>
|
|
71
61
|
);
|
|
72
62
|
}
|
|
73
63
|
```
|
|
74
64
|
|
|
75
|
-
|
|
65
|
+
##### Minimum and maximum dates
|
|
76
66
|
|
|
77
|
-
|
|
67
|
+
Make sure to provide the `disabledDateError` prop when providing `minDate`, `maxDate`, or `disabledDates` props. Navigation to dates before the `minDate` and after the `maxDate` is disabled.
|
|
78
68
|
|
|
79
69
|
```jsx
|
|
80
70
|
function Example() {
|
|
81
71
|
const [date, setDate] = useState(null);
|
|
82
72
|
const [error, setError] = useState(null);
|
|
83
73
|
|
|
74
|
+
const today = new Date(new Date().setHours(0, 0, 0, 0));
|
|
75
|
+
const lastMonth15th = new Date(today.getFullYear(), today.getMonth() - 1, 15);
|
|
76
|
+
const nextMonth15th = new Date(today.getFullYear(), today.getMonth() + 1, 15);
|
|
77
|
+
|
|
84
78
|
return (
|
|
85
79
|
<DatePicker
|
|
86
80
|
date={date}
|
|
87
81
|
error={error}
|
|
88
82
|
onChangeDate={setDate}
|
|
89
83
|
onErrorDate={setError}
|
|
84
|
+
minDate={lastMonth15th}
|
|
85
|
+
maxDate={nextMonth15th}
|
|
90
86
|
label="Birthdate"
|
|
91
87
|
invalidDateError="Please enter a valid date"
|
|
88
|
+
disabledDateError="Date unavailable"
|
|
92
89
|
/>
|
|
93
90
|
);
|
|
94
91
|
}
|
|
95
92
|
```
|
|
96
93
|
|
|
97
|
-
|
|
94
|
+
##### Required field
|
|
95
|
+
|
|
96
|
+
Make sure to provide the `requiredError` prop when setting the `required` prop to true. The `requiredError` will be displayed if a user blurs the input, without a date selected, after having typed into it.
|
|
97
|
+
|
|
98
|
+
```jsx
|
|
99
|
+
function Example() {
|
|
100
|
+
const [date, setDate] = useState(null);
|
|
101
|
+
const [error, setError] = useState(null);
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<DatePicker
|
|
105
|
+
required
|
|
106
|
+
date={date}
|
|
107
|
+
error={error}
|
|
108
|
+
onChangeDate={setDate}
|
|
109
|
+
onErrorDate={setError}
|
|
110
|
+
label="Birthdate"
|
|
111
|
+
invalidDateError="Please enter a valid date"
|
|
112
|
+
requiredError="This field is required"
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
##### Custom validation
|
|
98
119
|
|
|
99
120
|
The DatePicker handles common error states internally, and calls `onErrorDate` when the validity / error state changes.
|
|
100
121
|
|
|
@@ -122,7 +143,7 @@ function Example() {
|
|
|
122
143
|
}
|
|
123
144
|
```
|
|
124
145
|
|
|
125
|
-
|
|
146
|
+
### Accessibility
|
|
126
147
|
|
|
127
148
|
Always provide the accessibility label props and all necessary error props. See the Accessibility section under the Guidelines tab at the top of the page for more info.
|
|
128
149
|
|
|
@@ -152,7 +173,7 @@ function Example() {
|
|
|
152
173
|
}
|
|
153
174
|
```
|
|
154
175
|
|
|
155
|
-
|
|
176
|
+
### Localization
|
|
156
177
|
|
|
157
178
|
The date format is automatically adjusted to the `LocaleContext`. Check `LocaleProvider` usage below.
|
|
158
179
|
|
|
@@ -176,36 +197,67 @@ function Example() {
|
|
|
176
197
|
}
|
|
177
198
|
```
|
|
178
199
|
|
|
179
|
-
|
|
200
|
+
### Styling
|
|
180
201
|
|
|
181
|
-
|
|
202
|
+
DatePicker supports the same styling functionality as [DateInput](/components/other/DateInput/).
|
|
182
203
|
|
|
183
|
-
|
|
204
|
+
#### Compact
|
|
205
|
+
|
|
206
|
+
Use the `compact` prop for a smaller input size.
|
|
184
207
|
|
|
185
208
|
```jsx
|
|
186
209
|
function Example() {
|
|
187
210
|
const [date, setDate] = useState(null);
|
|
188
211
|
const [error, setError] = useState(null);
|
|
189
212
|
|
|
190
|
-
|
|
213
|
+
return (
|
|
214
|
+
<VStack gap={3}>
|
|
215
|
+
<DatePicker
|
|
216
|
+
date={date}
|
|
217
|
+
error={error}
|
|
218
|
+
onChangeDate={setDate}
|
|
219
|
+
onErrorDate={setError}
|
|
220
|
+
label="Default size"
|
|
221
|
+
invalidDateError="Please enter a valid date"
|
|
222
|
+
/>
|
|
223
|
+
<DatePicker
|
|
224
|
+
compact
|
|
225
|
+
date={date}
|
|
226
|
+
error={error}
|
|
227
|
+
onChangeDate={setDate}
|
|
228
|
+
onErrorDate={setError}
|
|
229
|
+
label="Compact size"
|
|
230
|
+
invalidDateError="Please enter a valid date"
|
|
231
|
+
/>
|
|
232
|
+
</VStack>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
#### Disabled
|
|
238
|
+
|
|
239
|
+
```jsx
|
|
240
|
+
function Example() {
|
|
241
|
+
const [date, setDate] = useState(new Date());
|
|
242
|
+
const [error, setError] = useState(null);
|
|
191
243
|
|
|
192
244
|
return (
|
|
193
245
|
<DatePicker
|
|
246
|
+
disabled
|
|
194
247
|
date={date}
|
|
195
248
|
error={error}
|
|
196
249
|
onChangeDate={setDate}
|
|
197
250
|
onErrorDate={setError}
|
|
198
|
-
|
|
199
|
-
label="Birthdate"
|
|
251
|
+
label="Disabled picker"
|
|
200
252
|
invalidDateError="Please enter a valid date"
|
|
201
253
|
/>
|
|
202
254
|
);
|
|
203
255
|
}
|
|
204
256
|
```
|
|
205
257
|
|
|
206
|
-
####
|
|
258
|
+
#### Helper text
|
|
207
259
|
|
|
208
|
-
|
|
260
|
+
Use the `helperText` prop to provide additional context below the input.
|
|
209
261
|
|
|
210
262
|
```jsx
|
|
211
263
|
function Example() {
|
|
@@ -214,31 +266,144 @@ function Example() {
|
|
|
214
266
|
|
|
215
267
|
return (
|
|
216
268
|
<DatePicker
|
|
217
|
-
required
|
|
218
269
|
date={date}
|
|
219
270
|
error={error}
|
|
220
271
|
onChangeDate={setDate}
|
|
221
272
|
onErrorDate={setError}
|
|
222
|
-
label="
|
|
273
|
+
label="Start date"
|
|
274
|
+
helperText="Select when you'd like to begin"
|
|
223
275
|
invalidDateError="Please enter a valid date"
|
|
224
|
-
requiredError="This field is required"
|
|
225
276
|
/>
|
|
226
277
|
);
|
|
227
278
|
}
|
|
228
279
|
```
|
|
229
280
|
|
|
230
|
-
####
|
|
281
|
+
#### Label
|
|
231
282
|
|
|
232
|
-
|
|
283
|
+
If you need to render a custom label (e.g. a label with a tooltip), you can use the `labelNode` prop.
|
|
233
284
|
|
|
234
285
|
```jsx
|
|
235
286
|
function Example() {
|
|
236
287
|
const [date, setDate] = useState(null);
|
|
237
288
|
const [error, setError] = useState(null);
|
|
238
289
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
290
|
+
return (
|
|
291
|
+
<VStack gap={2}>
|
|
292
|
+
<DatePicker
|
|
293
|
+
accessibilityLabel="Birthdate"
|
|
294
|
+
calendarIconButtonAccessibilityLabel="Birthdate calendar"
|
|
295
|
+
date={date}
|
|
296
|
+
error={error}
|
|
297
|
+
helperTextErrorIconAccessibilityLabel="Error"
|
|
298
|
+
invalidDateError="Please enter a valid date"
|
|
299
|
+
labelNode={
|
|
300
|
+
<HStack alignItems="center" gap={1}>
|
|
301
|
+
<InputLabel>Birthdate</InputLabel>
|
|
302
|
+
<Tooltip content="This will be visible to other users.">
|
|
303
|
+
<Icon color="fgMuted" name="info" size="xs" />
|
|
304
|
+
</Tooltip>
|
|
305
|
+
</HStack>
|
|
306
|
+
}
|
|
307
|
+
nextArrowAccessibilityLabel="Next month"
|
|
308
|
+
onChangeDate={setDate}
|
|
309
|
+
onErrorDate={setError}
|
|
310
|
+
previousArrowAccessibilityLabel="Previous month"
|
|
311
|
+
/>
|
|
312
|
+
<DatePicker
|
|
313
|
+
required
|
|
314
|
+
accessibilityLabel="Event date"
|
|
315
|
+
date={date}
|
|
316
|
+
error={error}
|
|
317
|
+
invalidDateError="Please enter a valid date"
|
|
318
|
+
labelNode={
|
|
319
|
+
<HStack alignItems="center" gap={0.5}>
|
|
320
|
+
<InputLabel>Event date</InputLabel>
|
|
321
|
+
<Text color="fgNegative" font="label1">
|
|
322
|
+
*
|
|
323
|
+
</Text>
|
|
324
|
+
</HStack>
|
|
325
|
+
}
|
|
326
|
+
onChangeDate={setDate}
|
|
327
|
+
onErrorDate={setError}
|
|
328
|
+
requiredError="This field is required"
|
|
329
|
+
/>
|
|
330
|
+
</VStack>
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
##### Label Variant
|
|
336
|
+
|
|
337
|
+
Use the `labelVariant` prop to position the label inside the input.
|
|
338
|
+
|
|
339
|
+
```jsx
|
|
340
|
+
function Example() {
|
|
341
|
+
const [date, setDate] = useState(null);
|
|
342
|
+
const [error, setError] = useState(null);
|
|
343
|
+
|
|
344
|
+
return (
|
|
345
|
+
<VStack gap={3}>
|
|
346
|
+
<DatePicker
|
|
347
|
+
date={date}
|
|
348
|
+
error={error}
|
|
349
|
+
onChangeDate={setDate}
|
|
350
|
+
onErrorDate={setError}
|
|
351
|
+
label="Default label"
|
|
352
|
+
invalidDateError="Please enter a valid date"
|
|
353
|
+
/>
|
|
354
|
+
<DatePicker
|
|
355
|
+
date={date}
|
|
356
|
+
error={error}
|
|
357
|
+
onChangeDate={setDate}
|
|
358
|
+
onErrorDate={setError}
|
|
359
|
+
label="Inside label"
|
|
360
|
+
labelVariant="inside"
|
|
361
|
+
invalidDateError="Please enter a valid date"
|
|
362
|
+
/>
|
|
363
|
+
<DatePicker
|
|
364
|
+
compact
|
|
365
|
+
date={date}
|
|
366
|
+
error={error}
|
|
367
|
+
onChangeDate={setDate}
|
|
368
|
+
onErrorDate={setError}
|
|
369
|
+
label="Compact inside label"
|
|
370
|
+
labelVariant="inside"
|
|
371
|
+
invalidDateError="Please enter a valid date"
|
|
372
|
+
/>
|
|
373
|
+
<DatePicker
|
|
374
|
+
accessibilityLabel="Event date"
|
|
375
|
+
date={date}
|
|
376
|
+
error={error}
|
|
377
|
+
invalidDateError="Please enter a valid date"
|
|
378
|
+
labelVariant="inside"
|
|
379
|
+
labelNode={
|
|
380
|
+
<HStack alignItems="center" gap={1}>
|
|
381
|
+
<InputLabel paddingY={0}>Event date</InputLabel>
|
|
382
|
+
<Text color="fgMuted" font="legal">
|
|
383
|
+
(optional)
|
|
384
|
+
</Text>
|
|
385
|
+
</HStack>
|
|
386
|
+
}
|
|
387
|
+
onChangeDate={setDate}
|
|
388
|
+
onErrorDate={setError}
|
|
389
|
+
/>
|
|
390
|
+
</VStack>
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
#### Seeding the date
|
|
396
|
+
|
|
397
|
+
Defaults to today when undefined.
|
|
398
|
+
|
|
399
|
+
On mobile the `seedDate` prop is the default date that the react-native-date-picker keyboard control will open to when there is no selected date value.
|
|
400
|
+
|
|
401
|
+
```jsx
|
|
402
|
+
function Example() {
|
|
403
|
+
const [date, setDate] = useState(null);
|
|
404
|
+
const [error, setError] = useState(null);
|
|
405
|
+
|
|
406
|
+
const seedDate = new Date('11/16/1991');
|
|
242
407
|
|
|
243
408
|
return (
|
|
244
409
|
<DatePicker
|
|
@@ -246,17 +411,17 @@ function Example() {
|
|
|
246
411
|
error={error}
|
|
247
412
|
onChangeDate={setDate}
|
|
248
413
|
onErrorDate={setError}
|
|
249
|
-
|
|
250
|
-
maxDate={nextMonth15th}
|
|
414
|
+
seedDate={seedDate}
|
|
251
415
|
label="Birthdate"
|
|
252
416
|
invalidDateError="Please enter a valid date"
|
|
253
|
-
disabledDateError="Date unavailable"
|
|
254
417
|
/>
|
|
255
418
|
);
|
|
256
419
|
}
|
|
257
420
|
```
|
|
258
421
|
|
|
259
|
-
|
|
422
|
+
### Composed Examples
|
|
423
|
+
|
|
424
|
+
#### Date range selector
|
|
260
425
|
|
|
261
426
|
This is a complex example using many different props. We use multiple DatePickers together to allow a user to select a date range.
|
|
262
427
|
|
|
@@ -358,7 +523,7 @@ function Example() {
|
|
|
358
523
|
}
|
|
359
524
|
```
|
|
360
525
|
|
|
361
|
-
|
|
526
|
+
### Event Lifecycle
|
|
362
527
|
|
|
363
528
|
- Selecting a date with the native picker (mobile) or Calendar (web):
|
|
364
529
|
|
|
@@ -1206,6 +1206,49 @@ function StressTestExample() {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
```
|
|
1208
1208
|
|
|
1209
|
+
### Borderless
|
|
1210
|
+
|
|
1211
|
+
You can remove the border from the select control by setting `bordered` to `false`. Now Select will only show a border when focused.
|
|
1212
|
+
|
|
1213
|
+
```jsx
|
|
1214
|
+
function BorderlessExample() {
|
|
1215
|
+
const [singleValue, setSingleValue] = useState('1');
|
|
1216
|
+
const { value: multiValue, onChange: multiOnChange } = useMultiSelect({
|
|
1217
|
+
initialValue: ['1', '2'],
|
|
1218
|
+
});
|
|
1219
|
+
|
|
1220
|
+
const options = [
|
|
1221
|
+
{ value: '1', label: 'Option 1' },
|
|
1222
|
+
{ value: '2', label: 'Option 2' },
|
|
1223
|
+
{ value: '3', label: 'Option 3' },
|
|
1224
|
+
{ value: '4', label: 'Option 4' },
|
|
1225
|
+
];
|
|
1226
|
+
|
|
1227
|
+
return (
|
|
1228
|
+
<VStack gap={4}>
|
|
1229
|
+
<Select
|
|
1230
|
+
bordered={false}
|
|
1231
|
+
label="Borderless single select"
|
|
1232
|
+
value={singleValue}
|
|
1233
|
+
onChange={setSingleValue}
|
|
1234
|
+
options={options}
|
|
1235
|
+
placeholder="Select an option"
|
|
1236
|
+
/>
|
|
1237
|
+
|
|
1238
|
+
<Select
|
|
1239
|
+
bordered={false}
|
|
1240
|
+
type="multi"
|
|
1241
|
+
label="Borderless multi select"
|
|
1242
|
+
value={multiValue}
|
|
1243
|
+
onChange={multiOnChange}
|
|
1244
|
+
options={options}
|
|
1245
|
+
placeholder="Select options"
|
|
1246
|
+
/>
|
|
1247
|
+
</VStack>
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
```
|
|
1251
|
+
|
|
1209
1252
|
### Custom styles
|
|
1210
1253
|
|
|
1211
1254
|
You can use custom styles on the various subcomponents in Select.
|
|
@@ -1390,6 +1433,7 @@ function CustomComponentExamples() {
|
|
|
1390
1433
|
| `SelectOptionGroupComponent` | `SelectOptionGroupComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render group headers |
|
|
1391
1434
|
| `accessibilityRoles` | `{ option?: AccessibilityRole; } \| undefined` | No | `-` | Accessibility roles for dropdown elements |
|
|
1392
1435
|
| `accessory` | `ReactElement<CellAccessoryProps, string \| JSXElementConstructor<any>>` | No | `-` | - |
|
|
1436
|
+
| `bordered` | `boolean` | No | `true` | Add a border around all sides of the box. Determines if the control should have a default border. |
|
|
1393
1437
|
| `clearAllLabel` | `string` | No | `-` | Label for the Clear All option in multi-select mode |
|
|
1394
1438
|
| `compact` | `boolean` | No | `-` | Whether to use compact styling for the select |
|
|
1395
1439
|
| `defaultOpen` | `boolean` | No | `-` | Initial open state when component mounts (uncontrolled mode) |
|
|
@@ -475,6 +475,7 @@ function ExampleDisabled() {
|
|
|
475
475
|
| `SelectOptionGroupComponent` | `SelectOptionGroupComponent<Type, SelectOptionValue>` | No | `-` | Custom component to render group headers |
|
|
476
476
|
| `accessibilityRoles` | `{ option?: AccessibilityRole; } \| undefined` | No | `-` | Accessibility roles for dropdown elements |
|
|
477
477
|
| `accessory` | `ReactElement<CellAccessoryProps, string \| JSXElementConstructor<any>>` | No | `-` | - |
|
|
478
|
+
| `bordered` | `boolean` | No | `true` | Add a border around all sides of the box. Determines if the control should have a default border. |
|
|
478
479
|
| `clearAllLabel` | `string` | No | `-` | Label for the Clear All option in multi-select mode |
|
|
479
480
|
| `compact` | `boolean` | No | `-` | Whether to use compact styling for the select |
|
|
480
481
|
| `defaultOpen` | `boolean` | No | `-` | Initial open state when component mounts (uncontrolled mode) |
|
|
@@ -103,10 +103,11 @@ It's also advised you always format `helperText` with `Error: ${errorMessage}`.
|
|
|
103
103
|
<TextInput label="Label" placeholder="Placeholder" />
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
#### Borderless
|
|
106
|
+
#### Borderless
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
with a TypeAhead component.
|
|
108
|
+
:::warning
|
|
109
|
+
You should not use a borderless TextInput alone. It should be used with a TypeAhead component.
|
|
110
|
+
:::
|
|
110
111
|
|
|
111
112
|
```jsx
|
|
112
113
|
<HStack padding={2}>
|
|
@@ -334,18 +335,54 @@ When using the `inside` label variant, you should always include a `placeholder`
|
|
|
334
335
|
If you need to render a custom label (e.g. a label with a tooltip), you can use the `labelNode` prop.
|
|
335
336
|
|
|
336
337
|
```jsx
|
|
337
|
-
<
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
<
|
|
342
|
-
|
|
343
|
-
<
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
338
|
+
<VStack gap={2}>
|
|
339
|
+
<TextInput
|
|
340
|
+
accessibilityLabel="Display name"
|
|
341
|
+
labelNode={
|
|
342
|
+
<HStack alignItems="center" gap={1}>
|
|
343
|
+
<InputLabel>Display name</InputLabel>
|
|
344
|
+
<Tooltip content="This will be visible to other users.">
|
|
345
|
+
<Icon active color="fg" name="info" size="xs" />
|
|
346
|
+
</Tooltip>
|
|
347
|
+
</HStack>
|
|
348
|
+
}
|
|
349
|
+
placeholder="Satoshi Nakamoto"
|
|
350
|
+
/>
|
|
351
|
+
<TextInput
|
|
352
|
+
accessibilityLabel="Amount"
|
|
353
|
+
compact
|
|
354
|
+
labelNode={
|
|
355
|
+
<HStack alignItems="center" gap={0.5}>
|
|
356
|
+
<InputLabel>Amount</InputLabel>
|
|
357
|
+
<Text color="fgNegative" font="label1">
|
|
358
|
+
*
|
|
359
|
+
</Text>
|
|
360
|
+
</HStack>
|
|
361
|
+
}
|
|
362
|
+
placeholder="0.00"
|
|
363
|
+
suffix="USD"
|
|
364
|
+
/>
|
|
365
|
+
<TextInput
|
|
366
|
+
accessibilityLabel="Bio"
|
|
367
|
+
labelVariant="inside"
|
|
368
|
+
labelNode={
|
|
369
|
+
<HStack alignItems="center" gap={1}>
|
|
370
|
+
<InputLabel paddingY={0}>Bio</InputLabel>
|
|
371
|
+
<Text color="fgMuted" font="legal">
|
|
372
|
+
(optional)
|
|
373
|
+
</Text>
|
|
374
|
+
</HStack>
|
|
375
|
+
}
|
|
376
|
+
placeholder="Tell us about yourself"
|
|
377
|
+
/>
|
|
378
|
+
<TextInput
|
|
379
|
+
accessibilityLabel="Notes"
|
|
380
|
+
labelVariant="inside"
|
|
381
|
+
labelNode={<InputLabel paddingY={0}>Notes</InputLabel>}
|
|
382
|
+
placeholder="Add a note"
|
|
383
|
+
start={<InputIcon name="pencil" />}
|
|
384
|
+
/>
|
|
385
|
+
</VStack>
|
|
349
386
|
```
|
|
350
387
|
|
|
351
388
|
### Example of Input Objects placed at the End
|
|
@@ -608,16 +645,6 @@ function testExample() {
|
|
|
608
645
|
}
|
|
609
646
|
```
|
|
610
647
|
|
|
611
|
-
### Date Picker Example
|
|
612
|
-
|
|
613
|
-
You can construct a DatePicker using TextInput
|
|
614
|
-
|
|
615
|
-
```jsx
|
|
616
|
-
function DatePicker() {
|
|
617
|
-
return <TextInput label="Pick a date" type="date" />;
|
|
618
|
-
}
|
|
619
|
-
```
|
|
620
|
-
|
|
621
648
|
### TextInput While Keyboard Is Open (mobile)
|
|
622
649
|
|
|
623
650
|
If you have the keyboard open, then closing the keyboard and interacting with the text input requires 2 taps, which isn't a great user experience.
|