@qualtrics/ui-react 2.32.0 → 2.32.2
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 +68 -13
- package/dist/__shared/cjs/{index-1c5b62c1.js → index-ca1f966f.js} +3 -4
- package/dist/__shared/cjs/{index-95ae1cca.js → index-d21d0581.js} +140 -157
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/Combobox/Combobox.js +0 -1
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/Dropdown.js +0 -2
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +0 -1
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/IconButton/IconButton.js +0 -1
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +0 -1
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/parts/MenuItem.js +0 -1
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +0 -1
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav.js +1 -0
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tab.js +0 -2
- package/dist/components/Tabs/TabList.js +0 -4
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +1 -2
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/createIconComponent.js +0 -1
- package/dist/icons/index.d.ts +6 -0
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +1299 -155
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +0 -5
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +0 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxFlyout.js +0 -1
- package/dist/next/Combobox/ComboboxInput.js +0 -1
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +0 -1
- package/dist/next/Drawer/Drawer.js +0 -1
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Input/Input.js +4 -5
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +2 -2
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/Stack/StackItem.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +531 -32
- package/dist/next/index.js +43 -53
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +0 -1
- package/dist/utils/constants.js +0 -1
- package/next/package.json +1 -1
- package/package.json +6 -3
package/dist/next/index.d.ts
CHANGED
|
@@ -13,8 +13,6 @@ import { FormEvent } from 'react';
|
|
|
13
13
|
import { FormHTMLAttributes } from 'react';
|
|
14
14
|
import { FunctionComponent } from 'react';
|
|
15
15
|
import type { InputHTMLAttributes } from 'react';
|
|
16
|
-
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
17
|
-
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
18
16
|
import { MouseEventHandler } from 'react';
|
|
19
17
|
import { MutableRefObject } from 'react';
|
|
20
18
|
import { default as React_2 } from 'react';
|
|
@@ -90,15 +88,27 @@ declare interface AdvancedTablePaginationProps {
|
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
export declare interface AdvancedTableProps {
|
|
91
|
+
/** An array of column config objects that configure each column. */
|
|
93
92
|
columnConfigs: AdvancedTableColumnConfig[];
|
|
93
|
+
/** An array of row objects to define the rows.
|
|
94
|
+
* @defaultValue []
|
|
95
|
+
*/
|
|
94
96
|
rows?: AdvancedTableRow[];
|
|
97
|
+
/** Handler to be called whenever the rows change. */
|
|
95
98
|
onRowsChange?: (newRows: AdvancedTableRow[]) => void;
|
|
99
|
+
/** Handler to be called whenever a row is selected from click or Enter. When defined, enables the ability to focus an entire row via keyboard navigation. */
|
|
96
100
|
onRowSelect?: (row: AdvancedTableRow) => void;
|
|
101
|
+
/** Used to control which row is selected. */
|
|
97
102
|
selectedRowId?: string;
|
|
103
|
+
/** Handler to be called whenever a row checkbox is toggled. When defined, adds a checkbox to each row and enables the ability to focus an entire row via keyboard navigation. */
|
|
98
104
|
onCheckedRowIdsChange?: (newCheckedRowIds: string[]) => void;
|
|
105
|
+
/** Used to control which rows are checked. */
|
|
99
106
|
checkedRowIds?: string[];
|
|
107
|
+
/** Handler to be called whenever a sort option is selected. */
|
|
100
108
|
onSelectedSortOptionChange?: (newSelectedSortOption: AdvancedTableSelectedSortOption) => void;
|
|
109
|
+
/** Control which sort option is initially selected. */
|
|
101
110
|
defaultSelectedSortOption?: AdvancedTableSelectedSortOption;
|
|
111
|
+
/** Control which sort option is selected. */
|
|
102
112
|
selectedSortOption?: AdvancedTableSelectedSortOption;
|
|
103
113
|
/** Prevents users from pinning/unpinning columns.
|
|
104
114
|
* @defaultValue false */
|
|
@@ -130,18 +140,46 @@ export declare interface AdvancedTableProps {
|
|
|
130
140
|
* @defaultValue 1
|
|
131
141
|
*/
|
|
132
142
|
headerMaxLines?: number;
|
|
133
|
-
|
|
143
|
+
/** Determines the number of rows for each page. Default is all rows. */
|
|
134
144
|
rowsPerPage?: number;
|
|
145
|
+
/** Determines the starting page; must be used with `rowsPerPage`.
|
|
146
|
+
* @defaultValue 1
|
|
147
|
+
*/
|
|
135
148
|
initialPage?: number;
|
|
149
|
+
/** Handler to be called whenever the page changes. */
|
|
136
150
|
onPageChange?: AdvancedTablePaginationProps['onPageChange'];
|
|
151
|
+
/** The aria-label applied to the pagination interface. */
|
|
137
152
|
paginationAriaLabel?: string;
|
|
153
|
+
/** The id of the element that serves as an accessible label for the AdvancedTable. */
|
|
138
154
|
'aria-labelledby'?: string;
|
|
155
|
+
/** An accessible label for the `AdvancedTable` for when it does not have a visible label. */
|
|
139
156
|
'aria-label'?: string;
|
|
157
|
+
/** The id of the element that describes `AdvancedTable`. Internally this is combined with the screen reader descriptions mentioned in the localization section. */
|
|
140
158
|
'aria-describedby'?: string;
|
|
159
|
+
/** Forwarded to the containing `div` element and to the sub-elements, each with their own suffix:
|
|
160
|
+
* - columnheader: `-<columnId>`
|
|
161
|
+
* - columnheader menu: `-<columnId>-ColumnHeaderMenu`
|
|
162
|
+
* - pin column: `-PinColumn`
|
|
163
|
+
* - move column left: `-MoveColumnLeft`
|
|
164
|
+
* - move column right: `-MoveColumnRight`
|
|
165
|
+
* - sort: `-Sort-<index>-<direction>`
|
|
166
|
+
* - row: `-row-<rowId>`
|
|
167
|
+
* - gridcell: `-cell-<rowId>-<columnId>`
|
|
168
|
+
* - pagination: `-TablePagination`
|
|
169
|
+
* - previous button: `-PreviousButton`
|
|
170
|
+
* - page input: `-PageInput`
|
|
171
|
+
* - next button: `-NextButton` */
|
|
141
172
|
'data-testid'?: string;
|
|
173
|
+
/** Controls which actions appear beside each row. */
|
|
142
174
|
rowActions?: AdvancedTableActionGroup[];
|
|
175
|
+
/** The aria-label applied to the row actions button. */
|
|
143
176
|
rowActionsButtonAriaLabel?: string;
|
|
177
|
+
/** Where to prioritize placement of the rowActions pane relative to the button.
|
|
178
|
+
* @defaultValue 'bottom-end'
|
|
179
|
+
*/
|
|
144
180
|
rowActionsPlacement?: DropdownListProps['placement'];
|
|
181
|
+
/** A unique id for the AdvancedTable. */
|
|
182
|
+
id?: string;
|
|
145
183
|
}
|
|
146
184
|
|
|
147
185
|
export declare interface AdvancedTableRow {
|
|
@@ -172,17 +210,38 @@ declare interface CheckboxRegisterProps<V extends Values> {
|
|
|
172
210
|
export declare const CollapsibleSearchInput: React_2.ForwardRefExoticComponent<CollapsibleSearchInputProps & React_2.RefAttributes<HTMLSpanElement>>;
|
|
173
211
|
|
|
174
212
|
export declare interface CollapsibleSearchInputProps {
|
|
213
|
+
/** The initial value for the search input.
|
|
214
|
+
* @defaultValue ''
|
|
215
|
+
*/
|
|
175
216
|
defaultValue?: string;
|
|
217
|
+
/** The value for the search input. */
|
|
176
218
|
value?: string;
|
|
219
|
+
/** Handler to be called when the value of the search input changes. */
|
|
177
220
|
onValueChange?: (newValue: string) => void;
|
|
221
|
+
/** A custom placeholder for the search input. */
|
|
178
222
|
placeholder?: string;
|
|
223
|
+
/** The initial value for the expanded state
|
|
224
|
+
* @defaultValue false
|
|
225
|
+
*/
|
|
179
226
|
defaultIsExpanded?: boolean;
|
|
227
|
+
/** If true, expands into a search input. If false, collapses into an icon button. */
|
|
180
228
|
isExpanded?: boolean;
|
|
229
|
+
/** Handler to be called when the `isExpanded` value changes. */
|
|
181
230
|
onIsExpandedChange?: (newIsExpanded: boolean) => void;
|
|
231
|
+
/** The width of the component when it is expanded. This can be any valid CSS `width` value. Use this prop instead of setting a `max-width` on the component.
|
|
232
|
+
* @defaultValue 100%
|
|
233
|
+
*/
|
|
182
234
|
widthWhenExpanded?: string | number;
|
|
235
|
+
/** Forwarded to the [`SearchInput`](/components/search-input) component's `aria-label` prop. */
|
|
183
236
|
searchInputAriaLabel?: string;
|
|
237
|
+
/** Forwarded to the [`SearchInput`](/components/search-input) component's `aria-labelledby` prop. */
|
|
184
238
|
searchInputAriaLabelledBy?: string;
|
|
239
|
+
/** Forwarded to the [`SearchInput`](/components/search-input) component's `aria-describedby` prop. */
|
|
185
240
|
searchInputAriaDescribedBy?: string;
|
|
241
|
+
/** Forwarded to the containing `span` element, the [`SearchInput`](/components/search-input), and the [`IconButton`](/components/icon-button). The subcomponents each get their own suffix:
|
|
242
|
+
* * `SearchInput`: `-SearchInput`
|
|
243
|
+
* * `IconButton`: `-IconButton`
|
|
244
|
+
* */
|
|
186
245
|
'data-testid'?: string;
|
|
187
246
|
}
|
|
188
247
|
|
|
@@ -191,19 +250,35 @@ export declare const CollectionGrid: React_2.ForwardRefExoticComponent<Collectio
|
|
|
191
250
|
export declare const CollectionGridItem: React_2.ForwardRefExoticComponent<CollectionGridItemProps & React_2.RefAttributes<HTMLElement>>;
|
|
192
251
|
|
|
193
252
|
export declare interface CollectionGridItemProps {
|
|
253
|
+
/** Replaces the `CollectionGridItem`'s default element with its single child and merges `CollectionGridItem`'s props and behavior into the child's. This is especially useful if your grid item should be represented by a semantic HTML element. Use this prop with caution, as any future changes we make to the component may override the child's props.
|
|
254
|
+
* @defaultValue false
|
|
255
|
+
*/
|
|
194
256
|
asChild?: boolean;
|
|
257
|
+
/** Content to display inside of the grid item */
|
|
195
258
|
children?: React_2.ReactNode & React_2.RefAttributes<HTMLElement>;
|
|
259
|
+
/** Added to the containing `div` */
|
|
196
260
|
'data-testid'?: string;
|
|
197
261
|
}
|
|
198
262
|
|
|
199
263
|
export declare interface CollectionGridProps extends CollectionGridItemProps {
|
|
264
|
+
/** Sets the minimum width that a column in the grid will shrink to */
|
|
200
265
|
minColumnWidth?: string;
|
|
266
|
+
/** Sets the maximum width that a column in the grid will take up
|
|
267
|
+
* @defaultValue 1fr
|
|
268
|
+
*/
|
|
201
269
|
maxColumnWidth?: string;
|
|
270
|
+
/** Sets the number of columns in the grid. The two non-numeric options you will generally use are `auto-fit` and `auto-fill`. `auto-fill` means "fill the row with as many columns as possible, even if some are empty". `auto-fit` does the same thing, but extra space is distributed among non-empty columns instead of leaving empty space.
|
|
271
|
+
* @defaultValue auto-fit
|
|
272
|
+
*/
|
|
202
273
|
numColumns?: number | string;
|
|
274
|
+
/** Sets the height of rows in the grid. If not provided, row heights are established by the height of the grid's children */
|
|
275
|
+
rowHeight?: React_2.CSSProperties['gridAutoRows'];
|
|
276
|
+
/** Sets the size of the gap between columns in the grid */
|
|
203
277
|
columnGap?: React_2.CSSProperties['columnGap'];
|
|
278
|
+
/** Sets the size of the gap between rows in the grid */
|
|
204
279
|
rowGap?: React_2.CSSProperties['rowGap'];
|
|
280
|
+
/** Sets `columnGap` and `rowGap` */
|
|
205
281
|
gap?: React_2.CSSProperties['gap'];
|
|
206
|
-
rowHeight?: React_2.CSSProperties['gridAutoRows'];
|
|
207
282
|
}
|
|
208
283
|
|
|
209
284
|
export declare function Combobox({ initialValue, value, onChange, onSubmit, isDisabled, isInvalid, isRequired, isLoading, isOpen: externalIsOpen, onIsOpenChange: externalOnIsOpenChange, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'data-testid': dataTestId, children, }: ComboboxProps): JSX.Element;
|
|
@@ -211,54 +286,103 @@ export declare function Combobox({ initialValue, value, onChange, onSubmit, isDi
|
|
|
211
286
|
export declare const ComboboxFlyout: FunctionComponent<ComboboxFlyoutProps>;
|
|
212
287
|
|
|
213
288
|
export declare interface ComboboxFlyoutProps {
|
|
289
|
+
/** The `ComboboxOption`s and `ComboboxGroup`s. */
|
|
290
|
+
children?: ReactNode;
|
|
291
|
+
/** Forwarded to the element with `role="listbox"`. If defined, it will override the `aria-label` prop value provided to `Combobox`. */
|
|
214
292
|
'aria-label'?: string;
|
|
293
|
+
/** Forwarded to the element with `role="listbox"`. If defined, it will override the `aria-labelledby` prop value provided to `Combobox`. */
|
|
215
294
|
'aria-labelledby'?: string;
|
|
295
|
+
/** Forwarded to the element with `role="listbox"`. */
|
|
216
296
|
'aria-describedby'?: string;
|
|
217
|
-
children?: ReactNode;
|
|
218
297
|
}
|
|
219
298
|
|
|
220
299
|
export declare function ComboboxGroup({ label, 'aria-describedby': ariaDescribedBy, children, }: ComboboxGroupProps): JSX.Element;
|
|
221
300
|
|
|
222
301
|
export declare interface ComboboxGroupProps {
|
|
302
|
+
/** The `ComboboxOption`s. */
|
|
303
|
+
children: ReactNode;
|
|
304
|
+
/** Rendered as text that represents the name of the group. The label needs to be unique across all `ComboboxGroup`s for a given `Combobox` instance. */
|
|
223
305
|
label: string;
|
|
306
|
+
/** Forwarded to the element with `role="group"`. */
|
|
224
307
|
'aria-describedby'?: string;
|
|
225
|
-
children: ReactNode;
|
|
226
308
|
}
|
|
227
309
|
|
|
228
310
|
export declare const ComboboxInput: React_2.ForwardRefExoticComponent<ComboboxInputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
229
311
|
|
|
230
312
|
export declare interface ComboboxInputProps {
|
|
313
|
+
/** Forwarded to the `placeholder` prop of [Input](/next/input). */
|
|
231
314
|
placeholder?: string;
|
|
315
|
+
/** Forwarded to the `leftAddOn` prop of [Input](/next/input). */
|
|
232
316
|
leftAddOn?: InputProps['leftAddOn'];
|
|
317
|
+
/** Forwarded to the `className` prop of [Input](/next/input). */
|
|
233
318
|
className?: string;
|
|
319
|
+
/** Forwarded to the `style` prop of [Input](/next/input). */
|
|
234
320
|
style?: CSSProperties;
|
|
321
|
+
/** Forwarded to the `id` prop of [Input](/next/input). */
|
|
235
322
|
id?: string;
|
|
323
|
+
/** Forwarded to the `aria-label` prop of [Input](/next/input). If defined, it will override the `aria-label` prop value provided to `Combobox` */
|
|
236
324
|
'aria-label'?: string;
|
|
325
|
+
/** Forwarded to the `aria-labelledby` prop of [Input](/next/input). If defined, it will override the `aria-labelledby` prop value provided to `Combobox` */
|
|
237
326
|
'aria-labelledby'?: string;
|
|
327
|
+
/** Forwarded to the `aria-describedby` prop of [Input](/next/input). */
|
|
238
328
|
'aria-describedby'?: string;
|
|
239
329
|
}
|
|
240
330
|
|
|
241
331
|
export declare function ComboboxOption({ label }: ComboboxOptionProps): JSX.Element | null;
|
|
242
332
|
|
|
243
333
|
export declare interface ComboboxOptionProps {
|
|
334
|
+
/** Rendered as text that represents the name of the option. The label needs to be unique across all `ComboboxOption`s for a given `Combobox` instance. */
|
|
244
335
|
label: string;
|
|
245
336
|
}
|
|
246
337
|
|
|
247
338
|
export declare interface ComboboxProps {
|
|
339
|
+
/** The `ComboboxInput` and `ComboboxFlyout`. */
|
|
340
|
+
children: ReactNode;
|
|
341
|
+
/** The initial value of the input.
|
|
342
|
+
* @defaultValue ''
|
|
343
|
+
*/
|
|
248
344
|
initialValue?: string;
|
|
345
|
+
/** The current value of the combobox. */
|
|
249
346
|
value?: string;
|
|
347
|
+
/** Handler to be called whenever `value` changes. */
|
|
250
348
|
onChange?: (newValue: string) => void;
|
|
349
|
+
/** Handler to be called whenever `enter` is pressed or a value is selected.
|
|
350
|
+
*/
|
|
251
351
|
onSubmit?: (value: string) => void;
|
|
352
|
+
/**
|
|
353
|
+
* * Removes the component from the page tab order.
|
|
354
|
+
* * Adds styling to the ComboboxInput to indicate that it is disabled.
|
|
355
|
+
* * Closes the flyout.
|
|
356
|
+
* @defaultValue false
|
|
357
|
+
*/
|
|
252
358
|
isDisabled?: boolean;
|
|
359
|
+
/** Tells the screen reader that the `ComboboxInput` is invalid. Also adds styling to the `ComboboxInput` to indicate that it is invalid.
|
|
360
|
+
* * @defaultValue false
|
|
361
|
+
*/
|
|
253
362
|
isInvalid?: boolean;
|
|
363
|
+
/** Tells the screen reader that the `ComboboxInput` is required.
|
|
364
|
+
* * @defaultValue false
|
|
365
|
+
*/
|
|
254
366
|
isRequired?: boolean;
|
|
367
|
+
/** Indicates that new `ComboboxOption`s are loading. If this prop is used, be sure to set the `width` CSS property on the `ComboboxInput` so that the loading spinner doesn't make the input wider when `isLoading` is `true`.
|
|
368
|
+
* @defaultValue false
|
|
369
|
+
*/
|
|
255
370
|
isLoading?: boolean;
|
|
371
|
+
/** Controls the open state of the flyout. */
|
|
256
372
|
isOpen?: boolean;
|
|
373
|
+
/** Handler to be called whenever the open state changes. */
|
|
257
374
|
onIsOpenChange?: (shouldOpen: boolean) => void;
|
|
375
|
+
/** Forwarded to the `ComboboxInput` and `ComboboxFlyout`. */
|
|
258
376
|
'aria-label'?: string;
|
|
377
|
+
/** Forwarded to the `ComboboxInput` and `ComboboxFlyout`. */
|
|
259
378
|
'aria-labelledby'?: string;
|
|
379
|
+
/** Forwarded to sub-components with the following suffixes:
|
|
380
|
+
* * `ComboboxInput`: `-input`
|
|
381
|
+
* * `ComboboxFlyout`: `-flyout`
|
|
382
|
+
* * `ComboboxGroup`: `-group-<label>`
|
|
383
|
+
* * `ComboboxOption`: `-option-<label>`
|
|
384
|
+
*/
|
|
260
385
|
'data-testid'?: string;
|
|
261
|
-
children: ReactNode;
|
|
262
386
|
}
|
|
263
387
|
|
|
264
388
|
declare interface CustomRegisterProps<V extends Values> {
|
|
@@ -272,40 +396,96 @@ declare interface CustomRegisterProps<V extends Values> {
|
|
|
272
396
|
export declare const Drawer: ({ id, isOpen: externalIsOpen, onIsOpenChange, title, width, zIndex, elementRefToFocusOnClose, containerRef, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "data-testid": dataTestId, children, }: DrawerProps) => React_2.ReactPortal | null;
|
|
273
397
|
|
|
274
398
|
export declare interface DrawerProps {
|
|
275
|
-
|
|
399
|
+
/** Controls whether component is expanded or collapsed */
|
|
276
400
|
isOpen: boolean;
|
|
401
|
+
/** Handler to be called when component expands or collapses */
|
|
277
402
|
onIsOpenChange: (newIsOpen: boolean) => void;
|
|
403
|
+
/** Header content displayed inside expanded Drawer */
|
|
278
404
|
title: ReactNode;
|
|
405
|
+
/** The contents of the Drawer */
|
|
406
|
+
children: ReactNode;
|
|
407
|
+
/** Id applied to outermost Drawer element */
|
|
408
|
+
id?: string;
|
|
409
|
+
/** Sets the width of the expanded Drawer
|
|
410
|
+
* @defaultValue '292px'
|
|
411
|
+
*/
|
|
279
412
|
width?: CSSProperties['width'];
|
|
413
|
+
/** Sets the zIndex of the Drawer. The overlay zIndex will be 1 smaller than the Drawer zIndex.
|
|
414
|
+
* @defaultValue 1000
|
|
415
|
+
*/
|
|
280
416
|
zIndex?: CSSProperties['zIndex'];
|
|
417
|
+
/** Ref belonging to element that should be focused when Drawer collapses */
|
|
281
418
|
elementRefToFocusOnClose?: MutableRefObject<HTMLElement | null>;
|
|
419
|
+
/** Ref belonging to the element that the Drawer component should fill
|
|
420
|
+
* @defaultValue document.body
|
|
421
|
+
*/
|
|
282
422
|
containerRef?: MutableRefObject<HTMLElement | null>;
|
|
423
|
+
/** Forwarded to the `aside` element */
|
|
283
424
|
'aria-label'?: string;
|
|
425
|
+
/** Forwarded to the `aside` element */
|
|
284
426
|
'aria-labelledby'?: string;
|
|
427
|
+
/** Forwarded to the `aside` element */
|
|
285
428
|
'aria-describedby'?: string;
|
|
429
|
+
/** Added to the outermost Drawer element and to main sub-components with the following suffixes:
|
|
430
|
+
* * `-title`: assigned to the title container
|
|
431
|
+
* * `-close-button`: assigned to the close button inside the expanded Drawer
|
|
432
|
+
* * `-body`: assigned to the body content container
|
|
433
|
+
* * `-overlay`: assigned to the overlay that appears while the Drawer is expanded
|
|
434
|
+
* */
|
|
286
435
|
'data-testid'?: string;
|
|
287
|
-
children: ReactNode;
|
|
288
436
|
}
|
|
289
437
|
|
|
290
438
|
declare interface DropdownListProps extends React_2.AllHTMLAttributes<HTMLDivElement> {
|
|
439
|
+
/** The displayed `DropdownOption` components. */
|
|
291
440
|
children?: React_2.ReactNode;
|
|
441
|
+
/**
|
|
442
|
+
* Where to prioritize placement of the `DropdownList` relative to the `DropdownButton`.
|
|
443
|
+
* @defaultValue 'bottom-start'
|
|
444
|
+
*/
|
|
292
445
|
placement?: ComputedPlacement;
|
|
446
|
+
/** Handler to be called when a keyboard key is pressed down. */
|
|
293
447
|
onKeyDown?: (event: React_2.KeyboardEvent<HTMLDivElement>) => void;
|
|
448
|
+
/**
|
|
449
|
+
* The unique identifier for the `DropdownList`, used for linking it to the `DropdownButton`.
|
|
450
|
+
* @defaultValue random
|
|
451
|
+
*/
|
|
452
|
+
id?: string;
|
|
453
|
+
/**
|
|
454
|
+
* The container element where the `DropdownList` should be rendered.
|
|
455
|
+
* Overrides the default set by `UIProvider`.
|
|
456
|
+
*/
|
|
294
457
|
portalTarget?: HTMLElement;
|
|
295
|
-
|
|
458
|
+
/**
|
|
459
|
+
* The id of the element that acts as a label for the listbox.
|
|
460
|
+
* Used to override the `DropdownButton` serving as its label.
|
|
461
|
+
* @defaultValue button id
|
|
462
|
+
*/
|
|
296
463
|
'aria-labelledby'?: string;
|
|
464
|
+
/** Appended to internal classes on the containing `div` element. */
|
|
465
|
+
className?: string;
|
|
466
|
+
/** Appended to the internal `div` element. Overwrites `data-testid` from parent, if present. */
|
|
467
|
+
'data-testid'?: string;
|
|
297
468
|
[prop: string]: any;
|
|
298
469
|
}
|
|
299
470
|
|
|
300
471
|
declare interface ExternalStackProps extends StackItemProps {
|
|
472
|
+
/** The size of the gap to place between the component's children. */
|
|
301
473
|
gap?: string | number;
|
|
474
|
+
/** Sets the CSS `padding-left` for the component. */
|
|
302
475
|
paddingLeft?: string | number;
|
|
476
|
+
/** Sets the CSS `padding-right` for the component. */
|
|
303
477
|
paddingRight?: string | number;
|
|
478
|
+
/** Sets the CSS `padding-top` for the component. */
|
|
304
479
|
paddingTop?: string | number;
|
|
480
|
+
/** Sets the CSS `padding-bottom` for the component. */
|
|
305
481
|
paddingBottom?: string | number;
|
|
482
|
+
/** Sets the CSS `margin-left` for the component. */
|
|
306
483
|
marginLeft?: string | number;
|
|
484
|
+
/** Sets the CSS `margin-right` for the component. */
|
|
307
485
|
marginRight?: string | number;
|
|
486
|
+
/** Sets the CSS `margin-top` for the component. */
|
|
308
487
|
marginTop?: string | number;
|
|
488
|
+
/** Sets the CSS `margin-bottom` for the component. */
|
|
309
489
|
marginBottom?: string | number;
|
|
310
490
|
alignChildrenX?: HStackAlignChildrenX | VStackAlignChildrenX;
|
|
311
491
|
alignChildrenY?: HStackAlignChildrenY | VStackAlignChildrenY;
|
|
@@ -314,16 +494,29 @@ declare interface ExternalStackProps extends StackItemProps {
|
|
|
314
494
|
export declare const FilterAnchor: React_2.ForwardRefExoticComponent<FilterAnchorProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
315
495
|
|
|
316
496
|
export declare interface FilterAnchorProps extends Omit<AllHTMLAttributes<HTMLButtonElement>, 'type' | 'disabled' | 'aria-disabled'> {
|
|
497
|
+
/** The label for the button. This should be treated as a form control label. */
|
|
317
498
|
label: string;
|
|
318
|
-
|
|
499
|
+
/** Indicates if the associated flyout is open. This component is not aware of whether the associated flyout is open, so the value must come from state held in a component wrapping this component. */
|
|
319
500
|
isOpen: boolean;
|
|
320
|
-
|
|
321
|
-
|
|
501
|
+
/** The filters passed in via this prop should be derived from values selected in the flyout. This component only displays the string and adds styling which means that the prop expects a string that is already translated. */
|
|
502
|
+
selectedFilters?: string;
|
|
503
|
+
/** If true, adds a lock icon. If this prop is set to `true`, a value for the `locked` translation key must be exist in the `UIProvider`.
|
|
504
|
+
* @defaultValue false
|
|
505
|
+
*/
|
|
322
506
|
isLocked?: boolean;
|
|
507
|
+
/** Indicates if the component is disabled. Use this prop instead of `disabled` or `aria-disabled`.
|
|
508
|
+
* @defaultValue false
|
|
509
|
+
*/
|
|
323
510
|
isDisabled?: boolean;
|
|
511
|
+
/** When set to `true`, the `selectedFilters` content will be replaced with a `LoadingSpinner` until `isLoading` is set to false again. Use for indicating asynchronous filtering.
|
|
512
|
+
* @defaultValue false
|
|
513
|
+
*/
|
|
324
514
|
isLoading?: boolean;
|
|
515
|
+
/** Appended to the list of internal ids used to label the `button` element. */
|
|
325
516
|
'aria-labelledby'?: string;
|
|
517
|
+
/** An accessible label to indicate that new filters are loading, added to the `LoadingSpinner` that is visible when `isLoading` is set to `true`. */
|
|
326
518
|
loadingSpinnerAriaLabel?: string;
|
|
519
|
+
/** Appended to internal classes on the `button` element. */
|
|
327
520
|
className?: string;
|
|
328
521
|
}
|
|
329
522
|
|
|
@@ -336,25 +529,62 @@ declare type HStackAlignChildrenX = 'left' | 'center' | 'right' | 'spaceAround'
|
|
|
336
529
|
declare type HStackAlignChildrenY = 'top' | 'center' | 'bottom' | 'stretch';
|
|
337
530
|
|
|
338
531
|
export declare interface HStackProps extends ExternalStackProps {
|
|
532
|
+
/** Align children along the component's x-axis.
|
|
533
|
+
* * `left`: Move children to the left side of the container.
|
|
534
|
+
* * `center`: Move children to the horizontal center of the container.
|
|
535
|
+
* * `right`: Move children to the right side of the container.
|
|
536
|
+
* * `spaceAround`: Each child gets the same amount of space before it and after it. Each child gets space on both sides, so there will be more space between two children than there is between the first child and the stack's edge.
|
|
537
|
+
* * `spaceBetween`: Distribute children to maximize the amount of space between them.
|
|
538
|
+
* * `spaceEvenly`: Space children equally apart from each other and the edges of the stack.
|
|
539
|
+
* @defaultValue 'center'
|
|
540
|
+
*/
|
|
339
541
|
alignChildrenX?: HStackAlignChildrenX;
|
|
542
|
+
/** Align children along the component's y-axis.
|
|
543
|
+
* * `top`: Move children to the top of the container.
|
|
544
|
+
* * `center`: Move children to the vertical center of the container.
|
|
545
|
+
* * `bottom`: Move children to the bottom of the container.
|
|
546
|
+
* * `stretch`: Stretch children vertically to take up the full width of the stack.
|
|
547
|
+
* @defaultValue 'center'
|
|
548
|
+
*/
|
|
340
549
|
alignChildrenY?: HStackAlignChildrenY;
|
|
341
550
|
}
|
|
342
551
|
|
|
343
552
|
export declare const Input: React_2.ForwardRefExoticComponent<InputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
344
553
|
|
|
345
554
|
export declare interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
555
|
+
/**
|
|
556
|
+
* Unique name for use with forms.
|
|
557
|
+
*
|
|
558
|
+
* See [Form API](../../form/getting-started) for more information.
|
|
559
|
+
*/
|
|
346
560
|
name?: string;
|
|
561
|
+
/** See [MDN notes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types). */
|
|
347
562
|
type?: 'email' | 'number' | 'password' | 'tel' | 'text' | 'url';
|
|
563
|
+
/** The initial value of the input. Use this prop instead of `value` and `onChange` when there is no need to control the input. */
|
|
348
564
|
initialValue?: string;
|
|
565
|
+
/** The value of the input. Use this prop with the `onChange` prop to create controlled state. */
|
|
349
566
|
value?: string;
|
|
567
|
+
/** Handler that is called when the value of the input changes. */
|
|
350
568
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
569
|
+
/** Provides a label for the input */
|
|
351
570
|
label?: string;
|
|
571
|
+
/** - Positioned on the left side of the `Input` (vertically centered).
|
|
572
|
+
* - Pointer events are ignored by default for the add-on. If pointer events are needed, set `pointer-events: auto` on the root level element passed to this prop.
|
|
573
|
+
* - If a `string` or `number` is passed in, the text will be hidden from screen readers. */
|
|
352
574
|
leftAddOn?: ReactNode;
|
|
575
|
+
/** - Positioned on the right side of the `Input` (vertically centered).
|
|
576
|
+
* - Pointer events are ignored by default for the add-on. If pointer events are needed, set `pointer-events: auto` on the root level element passed to this prop.
|
|
577
|
+
* - If a `string` or `number` is passed in, the text will be hidden from screen readers. */
|
|
353
578
|
rightAddOn?: ReactNode;
|
|
579
|
+
/** Adds an error message directly below `Input` */
|
|
354
580
|
errorText?: ReactNode;
|
|
581
|
+
/** Adds additional information directly below `Input` */
|
|
355
582
|
helperText?: ReactNode;
|
|
356
|
-
|
|
583
|
+
/** Passed to the `input` */
|
|
357
584
|
'data-testid'?: string;
|
|
585
|
+
/** Appended to internal classes on the containing `span` element. */
|
|
586
|
+
className?: string;
|
|
587
|
+
/** Forwarded to the containing `span` element. */
|
|
358
588
|
style?: CSSProperties;
|
|
359
589
|
}
|
|
360
590
|
|
|
@@ -363,19 +593,38 @@ export declare const LayoutGrid: React_2.ForwardRefExoticComponent<LayoutGridPro
|
|
|
363
593
|
export declare const LayoutGridItem: React_2.ForwardRefExoticComponent<LayoutGridItemProps & React_2.RefAttributes<HTMLElement>>;
|
|
364
594
|
|
|
365
595
|
export declare interface LayoutGridItemProps {
|
|
596
|
+
/** Content to display inside of the grid item */
|
|
597
|
+
children?: React_2.ReactNode & React_2.RefAttributes<HTMLElement>;
|
|
598
|
+
/** Assigns a grid item to one of the areas defined in the parent `LayoutGrid`'s `areas` prop */
|
|
366
599
|
area?: React_2.CSSProperties['gridArea'];
|
|
600
|
+
/** Replaces the `LayoutGridItem`'s default element with its single child and merges `LayoutGridItem`'s props and behavior into the child's. This is especially useful if your grid item should be represented by a semantic HTML element. Use this prop with caution, as any future changes we make to the component may override the child's props.
|
|
601
|
+
* @defaultValue false */
|
|
367
602
|
asChild?: boolean;
|
|
603
|
+
/** Added to the containing `div` */
|
|
368
604
|
'data-testid'?: string;
|
|
369
|
-
children?: React_2.ReactNode & React_2.RefAttributes<HTMLElement>;
|
|
370
605
|
}
|
|
371
606
|
|
|
372
607
|
export declare interface LayoutGridProps extends LayoutGridItemProps {
|
|
373
|
-
|
|
374
|
-
columnWidths: Array<string>;
|
|
608
|
+
/** Defines the different sections of a grid. Each subarray represents a single row */
|
|
375
609
|
areas: Array<Array<string>>;
|
|
610
|
+
/** Defines the width of each grid column. Its length should match that of one of `areas`'s subarrays */
|
|
611
|
+
columnWidths: Array<string>;
|
|
612
|
+
/** Defines the height of each grid row. Its length should match the length of `areas` */
|
|
613
|
+
rowHeights?: Array<string>;
|
|
614
|
+
/** Sets the size of the gap between columns in the grid */
|
|
376
615
|
columnGap?: React_2.CSSProperties['columnGap'];
|
|
616
|
+
/** Sets the size of the gap between rows in the grid */
|
|
377
617
|
rowGap?: React_2.CSSProperties['rowGap'];
|
|
618
|
+
/** Sets `columnGap` and `rowGap` */
|
|
378
619
|
gap?: React_2.CSSProperties['gap'];
|
|
620
|
+
/** Replaces the `LayoutGrid`'s default element with its single child and merges `LayoutGrid`'s props and behavior into the child's. This is especially useful if your grid should be represented by a semantic HTML element. Use this prop with caution, as any future changes we make to the component may override the child's props.
|
|
621
|
+
* @defaultValue false
|
|
622
|
+
*/
|
|
623
|
+
asChild?: boolean;
|
|
624
|
+
/** @internal */
|
|
625
|
+
'data-testid'?: string;
|
|
626
|
+
/** @internal */
|
|
627
|
+
area?: React_2.CSSProperties['gridArea'];
|
|
379
628
|
}
|
|
380
629
|
|
|
381
630
|
export declare const Menu: ({ "data-testid": dataTestId, isOpen, onIsOpenChange, isDisabled, children, isVirtualizationDisabled, }: MenuProps) => JSX.Element;
|
|
@@ -383,40 +632,89 @@ export declare const Menu: ({ "data-testid": dataTestId, isOpen, onIsOpenChange,
|
|
|
383
632
|
export declare const MenuButton: React_2.ForwardRefExoticComponent<MenuButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
384
633
|
|
|
385
634
|
export declare interface MenuButtonProps extends Omit<AllHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
635
|
+
/** Replaces the entire button component with its only child. Props will be merged together, excluding `className`. Only the `className` of the child will be used. See "Custom Anchor" example above.
|
|
636
|
+
* @defaultValue false
|
|
637
|
+
*/
|
|
386
638
|
asChild?: boolean;
|
|
639
|
+
/** Either acts as the label, or replaces the `button` if used with `asChild`. */
|
|
387
640
|
children: React_2.ReactNode;
|
|
388
641
|
}
|
|
389
642
|
|
|
390
643
|
export declare const MenuItem: React_2.ForwardRefExoticComponent<MenuItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
391
644
|
|
|
392
645
|
export declare interface MenuItemProps extends AllHTMLAttributes<HTMLDivElement> {
|
|
646
|
+
/** Disables the item
|
|
647
|
+
* @defaultValue false
|
|
648
|
+
*/
|
|
393
649
|
isDisabled?: boolean;
|
|
650
|
+
/** Replaces the entire item with its only child. Props will be merged together, including `className`.
|
|
651
|
+
* @defaultValue false
|
|
652
|
+
*/
|
|
394
653
|
asChild?: boolean;
|
|
654
|
+
/** Either acts as the label, or replaces the item if used with `asChild`. */
|
|
395
655
|
children?: React_2.ReactNode;
|
|
396
|
-
|
|
656
|
+
/** Handler to be called when `MenuItem` is selected. */
|
|
397
657
|
onSelect?: () => void;
|
|
658
|
+
/** The visible label for the item. This prop will overwrite any `string` `children` labels. */
|
|
398
659
|
label?: string;
|
|
399
660
|
}
|
|
400
661
|
|
|
401
662
|
export declare const MenuPane: React_2.ForwardRefExoticComponent<MenuPaneProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
402
663
|
|
|
403
664
|
export declare interface MenuPaneProps extends AllHTMLAttributes<HTMLDivElement> {
|
|
665
|
+
/** Defines where to prioritize placement of the pane. A demo of this behavior is available [here](https://popper.js.org/).
|
|
666
|
+
* @defaultValue "bottom-start"
|
|
667
|
+
*/
|
|
404
668
|
placement?: ComputedPlacement;
|
|
405
|
-
|
|
669
|
+
/** Determines whether or not to include search functionality.
|
|
670
|
+
* @defaultValue false
|
|
671
|
+
*/
|
|
406
672
|
isSearchable?: boolean;
|
|
673
|
+
/** Controls the value of the search bar. */
|
|
407
674
|
searchValue?: string;
|
|
675
|
+
/** Handler to be called whenever the search input value changes. */
|
|
408
676
|
onSearchValueChange?: (newValue: string) => void;
|
|
677
|
+
/** Disables search filtering. Useful for controlled searching.
|
|
678
|
+
* @defaultValue false
|
|
679
|
+
*/
|
|
409
680
|
isSearchFilteringDisabled?: boolean;
|
|
681
|
+
/** Sets the z-index for the top-level menu flyout.
|
|
682
|
+
* @defaultValue 1000
|
|
683
|
+
*/
|
|
410
684
|
zIndex?: number;
|
|
411
685
|
}
|
|
412
686
|
|
|
413
687
|
export declare interface MenuProps {
|
|
414
|
-
|
|
688
|
+
/** Controls whether or not the `MenuPane` is open
|
|
689
|
+
* @defaultValue false
|
|
690
|
+
*/
|
|
415
691
|
isOpen?: boolean;
|
|
692
|
+
/** Handler to be called whenever the `MenuPane` should open or close */
|
|
416
693
|
onIsOpenChange?: (shouldOpen: boolean) => void;
|
|
694
|
+
/** Disables the entire component
|
|
695
|
+
* @defaultValue false
|
|
696
|
+
*/
|
|
417
697
|
isDisabled?: boolean;
|
|
698
|
+
/** Accepts `MenuPane` and `MenuButton` */
|
|
418
699
|
children: React_2.ReactNode;
|
|
700
|
+
/** Controls whether or not `MenuItem`s are virtualized within their pane. By default, virtualization is enabled only if many items are passed.
|
|
701
|
+
* @defaultValue false
|
|
702
|
+
*/
|
|
419
703
|
isVirtualizationDisabled?: boolean;
|
|
704
|
+
/** Forwarded to all component parts with the following suffixes:
|
|
705
|
+
* - `MenuButton`: `-menubutton`
|
|
706
|
+
* - `MenuPane`: `-menupane`
|
|
707
|
+
* - `MenuItem`: `-menuitem-<index path>`
|
|
708
|
+
* - `<index path>`: Comprised of the indices of each `MenuItem` that must be activated in order to access this `MenuItem`.
|
|
709
|
+
* - See "SubMenu" example above.
|
|
710
|
+
* - `SubMenu`: `-menupane-<index path>`
|
|
711
|
+
* - `<index path>`: Comprised of the indices of each `MenuItem` that must be activated in order to access this `SubMenu`.
|
|
712
|
+
* - See "SubMenu" examples above.
|
|
713
|
+
* - Search bar: `-menusearch-<index path>`
|
|
714
|
+
* - `<index path>`: Comprised of the indices of each `MenuItem` that must be activated in order to access the search.
|
|
715
|
+
* - See "SubMenu" examples above.
|
|
716
|
+
* */
|
|
717
|
+
'data-testid'?: string;
|
|
420
718
|
}
|
|
421
719
|
|
|
422
720
|
declare type OnBlur = () => void;
|
|
@@ -461,17 +759,40 @@ export declare interface PaginationProps {
|
|
|
461
759
|
export declare const PhoneNumberInput: React_2.ForwardRefExoticComponent<PhoneNumberInputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
462
760
|
|
|
463
761
|
export declare interface PhoneNumberInputProps {
|
|
762
|
+
/** Determines the country to be displayed on initial load.
|
|
763
|
+
* @defaultValue 'US'
|
|
764
|
+
*/
|
|
464
765
|
initialCountryCode?: CountryCode;
|
|
766
|
+
/** Determines the list of countries available in the dropdown. Defaults to all country codes listed in the table below. */
|
|
465
767
|
countryCodes?: CountryCode[];
|
|
768
|
+
/** Handler to be called when the user enters new input.
|
|
769
|
+
* - `e164Number`: The phone number formatted to the [E.164 international standard](https://en.wikipedia.org/wiki/E.164).
|
|
770
|
+
* - `isValidLength`: Returns whether or not the user-entered phone number matches a valid length for the given country code. These lengths are determined by Google's actively-maintained [libphonenumber](https://github.com/google/libphonenumber) library. National phone number standards commonly change, and this boolean is only as good as Google's ability to keep up with them.
|
|
771
|
+
* - `countryCode`: The selected CountryCode. See ["Supported Countries/Regions" table](/next/phone-number-input/#supported-countriesregions) below.
|
|
772
|
+
* - `rawUserInput`: The raw user input without any masking.
|
|
773
|
+
*/
|
|
466
774
|
onChange?: (e164Number: E164Number | null, isValidLength: boolean, countryCode: CountryCode, rawUserInput: string) => void;
|
|
775
|
+
/** Controls whether or not to limit user input to the maximum valid length for a given country. The "maximum valid length" is determined by Google's actively-maintained [libphonenumber](https://github.com/google/libphonenumber) library. National phone number standards commonly change, and this length limit is only as good as Google's ability to keep up with them.
|
|
776
|
+
* @defaultValue false
|
|
777
|
+
*/
|
|
467
778
|
limitToValidLength?: boolean;
|
|
779
|
+
/** Disables the input and dropdown.
|
|
780
|
+
* @defaultValue false
|
|
781
|
+
*/
|
|
468
782
|
isDisabled?: boolean;
|
|
783
|
+
/** The starting value. A formatting mask will be applied where possible. */
|
|
469
784
|
initialValue?: string;
|
|
785
|
+
/** Applied to the country code `button` dropdown. */
|
|
470
786
|
buttonAriaLabel?: string;
|
|
787
|
+
/** Applied to the `input`. */
|
|
471
788
|
inputAriaLabel?: string;
|
|
789
|
+
/** Applied to the country code `button` dropdown. */
|
|
472
790
|
buttonAriaLabelledBy?: string;
|
|
791
|
+
/** Applied to the `input`. */
|
|
473
792
|
inputAriaLabelledBy?: string;
|
|
793
|
+
/** Applied to the containing `div`. */
|
|
474
794
|
'data-testid'?: string;
|
|
795
|
+
/** Applied to the `input`. */
|
|
475
796
|
inputId?: string;
|
|
476
797
|
}
|
|
477
798
|
|
|
@@ -527,40 +848,97 @@ export declare const Select: ({ multiselect, children, isDisabled, onChange, isO
|
|
|
527
848
|
export declare const SelectButton: React_2.ForwardRefExoticComponent<SelectButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
528
849
|
|
|
529
850
|
export declare interface SelectButtonProps extends AllHTMLAttributes<HTMLButtonElement> {
|
|
851
|
+
/** Replaces the entire button component with its only child. Props will be merged together, excluding `className`. Only the `className` of the child will be used. See "Custom Anchor" example above.
|
|
852
|
+
* @defaultValue false
|
|
853
|
+
*/
|
|
530
854
|
asChild?: boolean;
|
|
855
|
+
/** Overrides the default label when no items are selected. */
|
|
531
856
|
placeholder?: string;
|
|
857
|
+
/** Either acts as an override for the visible label, or replaces the `button` if used with `asChild`. */
|
|
858
|
+
children?: React_2.ReactNode;
|
|
532
859
|
}
|
|
533
860
|
|
|
534
861
|
export declare const SelectItem: React_2.ForwardRefExoticComponent<SelectItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
535
862
|
|
|
536
863
|
export declare interface SelectItemProps extends AllHTMLAttributes<HTMLDivElement> {
|
|
864
|
+
/** Disables the item
|
|
865
|
+
* @defaultValue false
|
|
866
|
+
*/
|
|
537
867
|
isDisabled?: boolean;
|
|
868
|
+
/** The visible label associated with the item. Also displayed in 'Selected items' pane, and determines search results. */
|
|
538
869
|
label: string;
|
|
870
|
+
/** The unique identifier for the item. */
|
|
539
871
|
value: string | number;
|
|
540
872
|
}
|
|
541
873
|
|
|
542
874
|
export declare const SelectPane: React_2.ForwardRefExoticComponent<SelectPaneProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
543
875
|
|
|
544
876
|
export declare interface SelectPaneProps extends AllHTMLAttributes<HTMLDivElement> {
|
|
877
|
+
/** Defines where to prioritize placement of the pane.
|
|
878
|
+
* @defaultValue 'bottom-start'
|
|
879
|
+
*/
|
|
545
880
|
placement?: ComputedPlacement;
|
|
881
|
+
/** Determines whether or not to include search functionality.
|
|
882
|
+
* @defaultValue false
|
|
883
|
+
*/
|
|
546
884
|
isSearchable?: boolean;
|
|
885
|
+
/** Controls the value of the search bar. */
|
|
547
886
|
searchValue?: string;
|
|
887
|
+
/** Handler to be called whenever the search input value changes. */
|
|
548
888
|
onSearchValueChange?: (newValue: string) => void;
|
|
889
|
+
/** Disables search filtering. Useful for custom search behavior.
|
|
890
|
+
* @defaultValue false
|
|
891
|
+
*/
|
|
549
892
|
isSearchFilteringDisabled?: boolean;
|
|
893
|
+
/** Determines whether or not the 'Selected item' subpane is shown.
|
|
894
|
+
* @defaultValue false
|
|
895
|
+
*/
|
|
550
896
|
showSelectedItemsPane?: boolean;
|
|
897
|
+
/** Sets the z-index for the top-level flyout.
|
|
898
|
+
* @defaultValue 1000
|
|
899
|
+
*/
|
|
551
900
|
zIndex?: number;
|
|
552
901
|
}
|
|
553
902
|
|
|
554
903
|
export declare interface SelectProps {
|
|
904
|
+
/** Allows for the selection of multiple items.
|
|
905
|
+
* @defaultValue false
|
|
906
|
+
*/
|
|
555
907
|
multiselect?: boolean;
|
|
908
|
+
/** Forwarded to all component parts with the following suffixes:
|
|
909
|
+
* - `SelectButton`: `-selectbutton`
|
|
910
|
+
* - `SelectPane`: `-selectpane`
|
|
911
|
+
* - `SelectItem`: `-selectitem-<index path>`
|
|
912
|
+
* - `<index path>`: Comprised of the indices of each `SelectItem` that must be activated in order to access this `SelectItem`.
|
|
913
|
+
* - See "Multiselect" example above.
|
|
914
|
+
* - `SubSelect`: `-selectpane-<index path>`
|
|
915
|
+
* - `<index path>`: Comprised of the indices of each `SelectItem` that must be activated in order to access this `SubSelect`.
|
|
916
|
+
* - See "Multiselect" examples above.
|
|
917
|
+
* - Search bar:` -selectsearch-<index path>`
|
|
918
|
+
* - `<index path>`: Comprised of the indices of each SelectItem that must be activated in order to access the search.
|
|
919
|
+
* - See "Multiselect" examples above. */
|
|
556
920
|
'data-testid'?: string;
|
|
921
|
+
/** Controls whether or not the SelectPane is open. */
|
|
557
922
|
isOpen?: boolean;
|
|
923
|
+
/** Handler to be called whenever the `SelectPane` should open or close */
|
|
558
924
|
onIsOpenChange?: (shouldOpen: boolean) => void;
|
|
925
|
+
/** Disables the entire component
|
|
926
|
+
* @defaultValue false
|
|
927
|
+
*/
|
|
559
928
|
isDisabled?: boolean;
|
|
929
|
+
/** Handler to be called whenever `value` should change */
|
|
560
930
|
onChange?: (value: string | number | (string | number)[]) => void;
|
|
931
|
+
/** Controls the selected value */
|
|
561
932
|
value?: string | number | (string | number)[];
|
|
933
|
+
/** Styles the component as invalid
|
|
934
|
+
* @defaultValue false
|
|
935
|
+
*/
|
|
562
936
|
isInvalid?: boolean;
|
|
937
|
+
/** `SelectButton` and `SelectPane` */
|
|
563
938
|
children: React_2.ReactNode;
|
|
939
|
+
/** Controls whether or not SelectItems are virtualized within their pane. By default, virtualization is enabled only if many items are passed.
|
|
940
|
+
* @defaultValue false
|
|
941
|
+
*/
|
|
564
942
|
isVirtualizationDisabled?: boolean;
|
|
565
943
|
}
|
|
566
944
|
|
|
@@ -569,61 +947,120 @@ export declare const SplitButton: React_2.ForwardRefExoticComponent<SplitButtonP
|
|
|
569
947
|
export declare const SplitButtonOption: React_2.ForwardRefExoticComponent<SplitButtonOptionProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
570
948
|
|
|
571
949
|
export declare interface SplitButtonOptionProps {
|
|
950
|
+
/** Handler that is called when the option is clicked. */
|
|
572
951
|
onClick: MouseEventHandler<HTMLDivElement>;
|
|
573
|
-
|
|
952
|
+
/** The content of the `SplitButtonOption`. */
|
|
574
953
|
children: React_2.ReactNode;
|
|
954
|
+
/** Disables the option.
|
|
955
|
+
* @defaultValue false
|
|
956
|
+
*/
|
|
957
|
+
isDisabled?: boolean;
|
|
575
958
|
}
|
|
576
959
|
|
|
577
960
|
export declare interface SplitButtonProps {
|
|
578
|
-
|
|
961
|
+
/** Determines the label for the main button. Supports [`Icon`](/components/icon) */
|
|
579
962
|
label: React_2.ReactNode;
|
|
963
|
+
/** Determines the style of the button. See example above.
|
|
964
|
+
* @defaultValue 'primary'
|
|
965
|
+
*/
|
|
966
|
+
kind?: 'primary' | 'secondary';
|
|
967
|
+
/** Handler that is called when the main button is clicked. */
|
|
968
|
+
onClick?: (event: React_2.MouseEvent<HTMLButtonElement>) => void;
|
|
969
|
+
/** Disables only the main button.
|
|
970
|
+
* @defaultValue false
|
|
971
|
+
*/
|
|
580
972
|
isButtonDisabled?: boolean;
|
|
973
|
+
/** Disables only the dropdown button.
|
|
974
|
+
* @defaultValue false
|
|
975
|
+
*/
|
|
581
976
|
isDropdownDisabled?: boolean;
|
|
977
|
+
/** Added to the `div` container. Also added to the main button and the dropdown button using the following suffixes:
|
|
978
|
+
* - `-button`
|
|
979
|
+
* - `-dropdown`
|
|
980
|
+
*/
|
|
582
981
|
'data-testid'?: string;
|
|
982
|
+
/** Added to the container. */
|
|
583
983
|
className?: string;
|
|
984
|
+
/** Added to main button. */
|
|
584
985
|
buttonAriaLabel?: string;
|
|
986
|
+
/** Added to main button. */
|
|
585
987
|
buttonAriaLabelledBy?: string;
|
|
988
|
+
/** Added to dropdown button. */
|
|
586
989
|
dropdownAriaLabel?: string;
|
|
990
|
+
/** Added to dropdown button. */
|
|
587
991
|
dropdownAriaLabelledBy?: string;
|
|
588
|
-
|
|
992
|
+
/** The `SplitButtonOption`s. */
|
|
589
993
|
children?: React_2.ReactNode;
|
|
590
994
|
}
|
|
591
995
|
|
|
592
996
|
export declare const StackItem: React_2.ForwardRefExoticComponent<StackItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
593
997
|
|
|
594
998
|
export declare interface StackItemProps {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
maxHeight?: string;
|
|
999
|
+
/** Children to be wrapped by the `StackItem`. */
|
|
1000
|
+
children?: React_2.ReactNode;
|
|
1001
|
+
/** Determines whether the item will grow and shrink to take up space in the containing Stack.
|
|
1002
|
+
* @defaultValue false
|
|
1003
|
+
*/
|
|
601
1004
|
fillSpace?: boolean;
|
|
1005
|
+
/** Sets the CSS `width` for the component. */
|
|
1006
|
+
width?: string | number;
|
|
1007
|
+
/** Sets the CSS `min-width` for the component. */
|
|
1008
|
+
minWidth?: string | number;
|
|
1009
|
+
/** Sets the CSS `max-width` for the component. */
|
|
1010
|
+
maxWidth?: string | number;
|
|
1011
|
+
/** Sets the CSS `height` for the component. */
|
|
1012
|
+
height?: string | number;
|
|
1013
|
+
/** Sets the CSS `min-height` for the component. */
|
|
1014
|
+
minHeight?: string | number;
|
|
1015
|
+
/** Sets the CSS `max-height` for the component. */
|
|
1016
|
+
maxHeight?: string | number;
|
|
1017
|
+
/** An accessible label for the item to be used by screen readers. This prop is forwarded to the div that wraps the component's children. */
|
|
602
1018
|
'aria-label'?: string;
|
|
1019
|
+
/** The id of an element that acts as a label for the item. This prop is forwarded to the div that wraps the component's children. */
|
|
603
1020
|
'aria-labelledby'?: string;
|
|
1021
|
+
/** The id of an element that describes the item. This prop is forwarded to the div that wraps the component's children. */
|
|
604
1022
|
'aria-describedby'?: string;
|
|
1023
|
+
/** Added to the containing div. */
|
|
605
1024
|
'data-testid'?: string;
|
|
606
|
-
children?: React_2.ReactNode;
|
|
607
1025
|
}
|
|
608
1026
|
|
|
609
1027
|
export declare const SubMenu: React_2.ForwardRefExoticComponent<SubMenuProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
610
1028
|
|
|
611
1029
|
export declare interface SubMenuProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'label'> {
|
|
612
|
-
|
|
1030
|
+
/** The label used on the trigger */
|
|
613
1031
|
label?: React_2.ReactNode;
|
|
1032
|
+
/** Prevents the trigger from opening the pane
|
|
1033
|
+
* @defaultValue false
|
|
1034
|
+
*/
|
|
614
1035
|
isDisabled?: boolean;
|
|
1036
|
+
/** Determines whether or not to include search functionality.
|
|
1037
|
+
* @defaultValue false
|
|
1038
|
+
*/
|
|
615
1039
|
isSearchable?: boolean;
|
|
1040
|
+
/** Controls the value of the search bar. */
|
|
616
1041
|
searchValue?: string;
|
|
1042
|
+
/** Handler to be called whenever the search input value changes. */
|
|
617
1043
|
onSearchValueChange?: (newValue: string) => void;
|
|
1044
|
+
/** Disables search filtering. Useful for controlled searching.
|
|
1045
|
+
* @defaultValue false
|
|
1046
|
+
*/
|
|
618
1047
|
isSearchFilteringDisabled?: boolean;
|
|
1048
|
+
/** Handler to be called whenever `SubMenu` opens or closes. The pane is considered open even while animating away. */
|
|
619
1049
|
onIsOpenChange?: (isOpen: boolean) => void;
|
|
620
1050
|
}
|
|
621
1051
|
|
|
622
1052
|
export declare const SubSelect: React_2.ForwardRefExoticComponent<SubSelectProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
623
1053
|
|
|
624
|
-
export declare interface SubSelectProps extends Omit<SelectPaneProps, 'label' | 'placement' | 'showSelectedItemsPane'> {
|
|
1054
|
+
export declare interface SubSelectProps extends Omit<SelectPaneProps, 'label' | 'placement' | 'showSelectedItemsPane' | 'zIndex'> {
|
|
1055
|
+
/** The visible label associated with the item. Determines search results. */
|
|
625
1056
|
label?: string | React_2.ReactNode;
|
|
1057
|
+
/** Prevents the trigger from opening the pane
|
|
1058
|
+
* @defaultValue false
|
|
1059
|
+
*/
|
|
626
1060
|
isDisabled?: boolean;
|
|
1061
|
+
/**
|
|
1062
|
+
* Handler to be called whenever the `SubSelect` pane opens or closes. The pane is considered open even while animating away.
|
|
1063
|
+
* */
|
|
627
1064
|
onIsOpenChange?: (isOpen: boolean) => void;
|
|
628
1065
|
}
|
|
629
1066
|
|
|
@@ -644,15 +1081,37 @@ declare interface Time {
|
|
|
644
1081
|
export declare const TimePicker: React_2.ForwardRefExoticComponent<TimePickerProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
645
1082
|
|
|
646
1083
|
export declare interface TimePickerProps {
|
|
1084
|
+
/** An object containing the current value of the `TimePicker`. Uses 24-hour time regardless of whether `is24Hour` is `true` or `false`. Should always be a valid time, where `hour` is a number between 0 and 23 (inclusive) and `minute` is a number between 0 and 59 (inclusive).*/
|
|
647
1085
|
value?: Time;
|
|
1086
|
+
/** Handler to be called whenever time changes. Note that this is called only when the user actually submits a time by hitting enter, selecting an item, or navigating away from the component. Will always be called with a valid time. */
|
|
648
1087
|
onChange?: (value: Time) => void;
|
|
1088
|
+
/** Sets the `TimePicker` to a 24-hour format.
|
|
1089
|
+
* @defaultValue false
|
|
1090
|
+
*/
|
|
649
1091
|
is24HourClock?: boolean;
|
|
1092
|
+
/** Disables user interactions with the component.
|
|
1093
|
+
* @defaultValue false
|
|
1094
|
+
*/
|
|
650
1095
|
isDisabled?: boolean;
|
|
1096
|
+
/** Shows an invalid state for the component.
|
|
1097
|
+
* @defaultValue false
|
|
1098
|
+
*/
|
|
651
1099
|
isInvalid?: boolean;
|
|
1100
|
+
/** The unique identifier used for linking accessibility properties within the component.
|
|
1101
|
+
* @defaultValue random
|
|
1102
|
+
*/
|
|
652
1103
|
id?: string;
|
|
1104
|
+
/** Forwarded to sub-components with the following suffixes:
|
|
1105
|
+
* * `-input`
|
|
1106
|
+
* * `-dropdown`
|
|
1107
|
+
* * `-option-${index}`
|
|
1108
|
+
* */
|
|
653
1109
|
'data-testid'?: string;
|
|
1110
|
+
/** An accessible label for the `TimePicker` to be used by screen readers. This prop is forwarded to the input and dropdown components. */
|
|
654
1111
|
'aria-label'?: string;
|
|
1112
|
+
/** The id of an element that acts as a label for the `TimePicker`. This prop is forwarded to the input and dropdown components. */
|
|
655
1113
|
'aria-labelledby'?: string;
|
|
1114
|
+
/** The id of an element that describes the `TimePicker`. This prop is forwarded to the input and dropdown components. */
|
|
656
1115
|
'aria-describedby'?: string;
|
|
657
1116
|
}
|
|
658
1117
|
|
|
@@ -661,26 +1120,50 @@ export declare const ToggleButton: React_2.ForwardRefExoticComponent<ToggleButto
|
|
|
661
1120
|
export declare const ToggleButtonGroup: React_2.ForwardRefExoticComponent<ToggleButtonGroupProps & React_2.RefAttributes<HTMLFieldSetElement>>;
|
|
662
1121
|
|
|
663
1122
|
export declare interface ToggleButtonGroupProps {
|
|
1123
|
+
/** The toggle buttons to act as radios in the group. The individual buttons can be wrapped in tooltips */
|
|
664
1124
|
children: React_2.ReactNode;
|
|
1125
|
+
/** The value of the selected child toggle button. */
|
|
665
1126
|
value: string | null;
|
|
1127
|
+
/** Change handler to be fired when the toggle button group value changes. */
|
|
666
1128
|
onChange: (value: string) => void;
|
|
1129
|
+
/** The name used by the internal radio controls. Overwrites the same property set on children. Useful when retrieving a radio group's value within a form */
|
|
667
1130
|
name?: string;
|
|
1131
|
+
/** Label for the radio button group. */
|
|
668
1132
|
label?: string;
|
|
1133
|
+
/** Disables interaction with the entire button group. */
|
|
669
1134
|
isDisabled?: boolean;
|
|
1135
|
+
/** The label forwarded to the the internal radiogroup. Should be provided if visual label is not set and aria-labelledby is not set. */
|
|
670
1136
|
'aria-label'?: string;
|
|
1137
|
+
/** The label reference forwarded to the the internal radiogroup. Should be provided if visual label is not set and aria-label is not set. */
|
|
671
1138
|
'aria-labelledby'?: string;
|
|
672
1139
|
}
|
|
673
1140
|
|
|
674
1141
|
export declare interface ToggleButtonProps {
|
|
1142
|
+
/** String or components to show up inside the button. */
|
|
675
1143
|
children: React_2.ReactNode;
|
|
1144
|
+
/** Determines if the toggle is activated. Required outside a group context.
|
|
1145
|
+
* @defaultValue false
|
|
1146
|
+
*/
|
|
676
1147
|
isActivated?: boolean;
|
|
1148
|
+
/** Change handler to be fired when the toggle button state changes. Required outside of a group context. */
|
|
677
1149
|
onChange?: (isActivated: boolean) => void;
|
|
1150
|
+
/** Defines the value the toggle represents. Required in group context, as this will be the value passed on change. */
|
|
678
1151
|
value?: string;
|
|
1152
|
+
/** Disables interaction with the button. Overwritten by group level setting, if present.
|
|
1153
|
+
* @defaultValue false
|
|
1154
|
+
*/
|
|
679
1155
|
isDisabled?: boolean;
|
|
1156
|
+
/** The kind of button to present. Modifies style to support different button types. Defaults to expecting an icon and text. For icon or text only use the appropriate value.
|
|
1157
|
+
* @defaultValue 'icon-text'
|
|
1158
|
+
*/
|
|
680
1159
|
kind?: 'icon' | 'icon-text' | 'text';
|
|
1160
|
+
/** The label forwarded to the the internal input, enabling screen reader support if there is no text in the button */
|
|
681
1161
|
'aria-label'?: string;
|
|
1162
|
+
/** The label reference forwarded to the the internal input, enabling screen reader support if there is no text in the button */
|
|
682
1163
|
'aria-labelledby'?: string;
|
|
1164
|
+
/** The name used by the internal input control. Overwritten by group level setting. Useful for retrieving a toggle button value within a form. */
|
|
683
1165
|
name?: string;
|
|
1166
|
+
/** Test ID prefix to attach to the internal input (prefix-input) and label (prefix-label). */
|
|
684
1167
|
dataTestId?: string;
|
|
685
1168
|
}
|
|
686
1169
|
|
|
@@ -734,7 +1217,23 @@ declare type VStackAlignChildrenX = 'left' | 'center' | 'right' | 'stretch';
|
|
|
734
1217
|
declare type VStackAlignChildrenY = 'top' | 'center' | 'bottom' | 'spaceAround' | 'spaceBetween' | 'spaceEvenly';
|
|
735
1218
|
|
|
736
1219
|
export declare interface VStackProps extends ExternalStackProps {
|
|
1220
|
+
/** Align children along the component's x-axis.
|
|
1221
|
+
* * `left`: Move children to the left side of the container.
|
|
1222
|
+
* * `center`: Move children to the horizontal center of the container.
|
|
1223
|
+
* * `right`: Move children to the right side of the container.
|
|
1224
|
+
* * `stretch`: Stretch children horizontally to take up the full width of the stack.
|
|
1225
|
+
* @defaultValue 'center'
|
|
1226
|
+
*/
|
|
737
1227
|
alignChildrenX?: VStackAlignChildrenX;
|
|
1228
|
+
/** Align children along the component's y-axis.
|
|
1229
|
+
* * `top`: Move children to the top of the container.
|
|
1230
|
+
* * `center`: Move children to the vertical center of the container.
|
|
1231
|
+
* * `bottom`: Move children to the bottom of the container.
|
|
1232
|
+
* * `spaceAround`: Each child gets the same amount of space before it and after it. Each child gets space on both sides, so there will be more space between two children than there is between the first child and the stack's edge.
|
|
1233
|
+
* * `spaceBetween`: Distribute children to maximize the amount of space between them.
|
|
1234
|
+
* * `spaceEvenly`: Space children equally apart from each other and the edges of the stack.
|
|
1235
|
+
* @defaultValue 'center'
|
|
1236
|
+
*/
|
|
738
1237
|
alignChildrenY?: VStackAlignChildrenY;
|
|
739
1238
|
}
|
|
740
1239
|
|