@mortenbrudvik/waveui 0.14.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +413 -53
- package/dist/components/data-display/InfoButton.cjs +1 -1
- package/dist/components/data-display/InfoButton.cjs.map +1 -1
- package/dist/components/data-display/InfoButton.mjs +90 -82
- package/dist/components/data-display/InfoButton.mjs.map +1 -1
- package/dist/components/data-display/InfoLabel.cjs +1 -1
- package/dist/components/data-display/InfoLabel.cjs.map +1 -1
- package/dist/components/data-display/InfoLabel.mjs +19 -18
- package/dist/components/data-display/InfoLabel.mjs.map +1 -1
- package/dist/components/data-display/List.cjs +1 -1
- package/dist/components/data-display/List.cjs.map +1 -1
- package/dist/components/data-display/List.mjs +405 -219
- package/dist/components/data-display/List.mjs.map +1 -1
- package/dist/components/data-display/List.registry.cjs +1 -1
- package/dist/components/data-display/List.registry.cjs.map +1 -1
- package/dist/components/data-display/List.registry.mjs +12 -6
- package/dist/components/data-display/List.registry.mjs.map +1 -1
- package/dist/components/feedback/MessageBarGroup.cjs +2 -0
- package/dist/components/feedback/MessageBarGroup.cjs.map +1 -0
- package/dist/components/feedback/MessageBarGroup.mjs +63 -0
- package/dist/components/feedback/MessageBarGroup.mjs.map +1 -0
- package/dist/components/feedback/ProgressBar.cjs +1 -1
- package/dist/components/feedback/ProgressBar.cjs.map +1 -1
- package/dist/components/feedback/ProgressBar.mjs +41 -39
- package/dist/components/feedback/ProgressBar.mjs.map +1 -1
- package/dist/components/feedback/Toaster.cjs +1 -1
- package/dist/components/feedback/Toaster.cjs.map +1 -1
- package/dist/components/feedback/Toaster.mjs +222 -216
- package/dist/components/feedback/Toaster.mjs.map +1 -1
- package/dist/components/input/Combobox.cjs +1 -1
- package/dist/components/input/Combobox.cjs.map +1 -1
- package/dist/components/input/Combobox.mjs +163 -148
- package/dist/components/input/Combobox.mjs.map +1 -1
- package/dist/components/input/Dropdown.cjs +1 -1
- package/dist/components/input/Dropdown.cjs.map +1 -1
- package/dist/components/input/Dropdown.mjs +132 -117
- package/dist/components/input/Dropdown.mjs.map +1 -1
- package/dist/components/input/Listbox.cjs +1 -1
- package/dist/components/input/Listbox.cjs.map +1 -1
- package/dist/components/input/Listbox.mjs +90 -78
- package/dist/components/input/Listbox.mjs.map +1 -1
- package/dist/components/input/Option.cjs +1 -1
- package/dist/components/input/Option.cjs.map +1 -1
- package/dist/components/input/Option.data.cjs +2 -0
- package/dist/components/input/Option.data.cjs.map +1 -0
- package/dist/components/input/Option.data.mjs +114 -0
- package/dist/components/input/Option.data.mjs.map +1 -0
- package/dist/components/input/Option.mjs +21 -17
- package/dist/components/input/Option.mjs.map +1 -1
- package/dist/components/layout/Accordion.cjs +1 -1
- package/dist/components/layout/Accordion.cjs.map +1 -1
- package/dist/components/layout/Accordion.mjs +124 -109
- package/dist/components/layout/Accordion.mjs.map +1 -1
- package/dist/components/layout/Carousel.cjs +1 -1
- package/dist/components/layout/Carousel.cjs.map +1 -1
- package/dist/components/layout/Carousel.mjs +207 -193
- package/dist/components/layout/Carousel.mjs.map +1 -1
- package/dist/components/layout/FlatTree.cjs +2 -0
- package/dist/components/layout/FlatTree.cjs.map +1 -0
- package/dist/components/layout/FlatTree.context.cjs +2 -0
- package/dist/components/layout/FlatTree.context.cjs.map +1 -0
- package/dist/components/layout/FlatTree.context.mjs +20 -0
- package/dist/components/layout/FlatTree.context.mjs.map +1 -0
- package/dist/components/layout/FlatTree.item.cjs +2 -0
- package/dist/components/layout/FlatTree.item.cjs.map +1 -0
- package/dist/components/layout/FlatTree.item.mjs +90 -0
- package/dist/components/layout/FlatTree.item.mjs.map +1 -0
- package/dist/components/layout/FlatTree.mjs +276 -0
- package/dist/components/layout/FlatTree.mjs.map +1 -0
- package/dist/components/layout/TabList.cjs +1 -1
- package/dist/components/layout/TabList.cjs.map +1 -1
- package/dist/components/layout/TabList.mjs +149 -108
- package/dist/components/layout/TabList.mjs.map +1 -1
- package/dist/components/layout/Tree.cjs.map +1 -1
- package/dist/components/layout/Tree.context.cjs +1 -1
- package/dist/components/layout/Tree.context.cjs.map +1 -1
- package/dist/components/layout/Tree.context.mjs +2 -1
- package/dist/components/layout/Tree.context.mjs.map +1 -1
- package/dist/components/layout/Tree.core.cjs +1 -1
- package/dist/components/layout/Tree.core.cjs.map +1 -1
- package/dist/components/layout/Tree.core.mjs +162 -148
- package/dist/components/layout/Tree.core.mjs.map +1 -1
- package/dist/components/layout/Tree.mjs.map +1 -1
- package/dist/components/layout/Tree.selection.cjs +1 -1
- package/dist/components/layout/Tree.selection.cjs.map +1 -1
- package/dist/components/layout/Tree.selection.mjs +11 -57
- package/dist/components/layout/Tree.selection.mjs.map +1 -1
- package/dist/components/layout/useFlatTree.cjs +2 -0
- package/dist/components/layout/useFlatTree.cjs.map +1 -0
- package/dist/components/layout/useFlatTree.mjs +83 -0
- package/dist/components/layout/useFlatTree.mjs.map +1 -0
- package/dist/components/navigation/Menu.popover.cjs +1 -1
- package/dist/components/navigation/Menu.popover.cjs.map +1 -1
- package/dist/components/navigation/Menu.popover.mjs +154 -168
- package/dist/components/navigation/Menu.popover.mjs.map +1 -1
- package/dist/components/navigation/Nav.cjs +1 -1
- package/dist/components/navigation/Nav.cjs.map +1 -1
- package/dist/components/navigation/Nav.mjs +156 -136
- package/dist/components/navigation/Nav.mjs.map +1 -1
- package/dist/components/navigation/NavDrawer.cjs +1 -1
- package/dist/components/navigation/NavDrawer.cjs.map +1 -1
- package/dist/components/navigation/NavDrawer.mjs +48 -45
- package/dist/components/navigation/NavDrawer.mjs.map +1 -1
- package/dist/components/overlays/Dialog.cjs +1 -1
- package/dist/components/overlays/Dialog.cjs.map +1 -1
- package/dist/components/overlays/Dialog.mjs +128 -122
- package/dist/components/overlays/Dialog.mjs.map +1 -1
- package/dist/components/overlays/Dialog.slots.cjs +1 -1
- package/dist/components/overlays/Dialog.slots.cjs.map +1 -1
- package/dist/components/overlays/Dialog.slots.mjs +12 -12
- package/dist/components/overlays/Dialog.slots.mjs.map +1 -1
- package/dist/components/overlays/Drawer.cjs.map +1 -1
- package/dist/components/overlays/Drawer.mjs.map +1 -1
- package/dist/components/overlays/Drawer.panel.cjs +1 -1
- package/dist/components/overlays/Drawer.panel.cjs.map +1 -1
- package/dist/components/overlays/Drawer.panel.mjs +97 -81
- package/dist/components/overlays/Drawer.panel.mjs.map +1 -1
- package/dist/components/overlays/Drawer.root.cjs +1 -1
- package/dist/components/overlays/Drawer.root.cjs.map +1 -1
- package/dist/components/overlays/Drawer.root.mjs +34 -31
- package/dist/components/overlays/Drawer.root.mjs.map +1 -1
- package/dist/components/overlays/Popover.cjs +1 -1
- package/dist/components/overlays/Popover.cjs.map +1 -1
- package/dist/components/overlays/Popover.mjs +231 -216
- package/dist/components/overlays/Popover.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.parts.cjs +1 -1
- package/dist/components/overlays/TeachingPopover.parts.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.parts.mjs +199 -177
- package/dist/components/overlays/TeachingPopover.parts.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.root.cjs +1 -1
- package/dist/components/overlays/TeachingPopover.root.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.root.mjs +93 -92
- package/dist/components/overlays/TeachingPopover.root.mjs.map +1 -1
- package/dist/components/overlays/Tooltip.cjs +1 -1
- package/dist/components/overlays/Tooltip.cjs.map +1 -1
- package/dist/components/overlays/Tooltip.mjs +66 -61
- package/dist/components/overlays/Tooltip.mjs.map +1 -1
- package/dist/components/provider/WaveProvider.cjs +1 -1
- package/dist/components/provider/WaveProvider.cjs.map +1 -1
- package/dist/components/provider/WaveProvider.mjs +26 -23
- package/dist/components/provider/WaveProvider.mjs.map +1 -1
- package/dist/components/table/DataGrid.cjs +1 -1
- package/dist/components/table/DataGrid.cjs.map +1 -1
- package/dist/components/table/DataGrid.context.cjs +2 -0
- package/dist/components/table/DataGrid.context.cjs.map +1 -0
- package/dist/components/table/DataGrid.context.mjs +74 -0
- package/dist/components/table/DataGrid.context.mjs.map +1 -0
- package/dist/components/table/DataGrid.header.cjs +2 -0
- package/dist/components/table/DataGrid.header.cjs.map +1 -0
- package/dist/components/table/DataGrid.header.mjs +168 -0
- package/dist/components/table/DataGrid.header.mjs.map +1 -0
- package/dist/components/table/DataGrid.mjs +488 -591
- package/dist/components/table/DataGrid.mjs.map +1 -1
- package/dist/components/table/DataGrid.sizing.cjs +2 -0
- package/dist/components/table/DataGrid.sizing.cjs.map +1 -0
- package/dist/components/table/DataGrid.sizing.mjs +187 -0
- package/dist/components/table/DataGrid.sizing.mjs.map +1 -0
- package/dist/components/table/DataGrid.store.cjs +2 -0
- package/dist/components/table/DataGrid.store.cjs.map +1 -0
- package/dist/components/table/DataGrid.store.mjs +108 -0
- package/dist/components/table/DataGrid.store.mjs.map +1 -0
- package/dist/components/table/DataGrid.window.cjs +2 -0
- package/dist/components/table/DataGrid.window.cjs.map +1 -0
- package/dist/components/table/DataGrid.window.mjs +165 -0
- package/dist/components/table/DataGrid.window.mjs.map +1 -0
- package/dist/components/table/Table.cjs +1 -1
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.mjs +74 -72
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/Table.resize.cjs +2 -0
- package/dist/components/table/Table.resize.cjs.map +1 -0
- package/dist/components/table/Table.resize.mjs +98 -0
- package/dist/components/table/Table.resize.mjs.map +1 -0
- package/dist/components/table/useGridNavigation.cjs +1 -1
- package/dist/components/table/useGridNavigation.cjs.map +1 -1
- package/dist/components/table/useGridNavigation.mjs +343 -140
- package/dist/components/table/useGridNavigation.mjs.map +1 -1
- package/dist/components/table/useTableColumnSizing.cjs +2 -0
- package/dist/components/table/useTableColumnSizing.cjs.map +1 -0
- package/dist/components/table/useTableColumnSizing.mjs +76 -0
- package/dist/components/table/useTableColumnSizing.mjs.map +1 -0
- package/dist/components/table/useTableFeatures.cjs +2 -0
- package/dist/components/table/useTableFeatures.cjs.map +1 -0
- package/dist/components/table/useTableFeatures.mjs +110 -0
- package/dist/components/table/useTableFeatures.mjs.map +1 -0
- package/dist/components/table/useTableSelection.cjs +2 -0
- package/dist/components/table/useTableSelection.cjs.map +1 -0
- package/dist/components/table/useTableSelection.mjs +39 -0
- package/dist/components/table/useTableSelection.mjs.map +1 -0
- package/dist/components/table/useTableSort.cjs +2 -0
- package/dist/components/table/useTableSort.cjs.map +1 -0
- package/dist/components/table/useTableSort.mjs +58 -0
- package/dist/components/table/useTableSort.mjs.map +1 -0
- package/dist/hooks/useActiveDescendant.cjs +1 -1
- package/dist/hooks/useActiveDescendant.cjs.map +1 -1
- package/dist/hooks/useActiveDescendant.mjs +33 -25
- package/dist/hooks/useActiveDescendant.mjs.map +1 -1
- package/dist/hooks/useCollapsePresence.cjs +2 -0
- package/dist/hooks/useCollapsePresence.cjs.map +1 -0
- package/dist/hooks/useCollapsePresence.mjs +21 -0
- package/dist/hooks/useCollapsePresence.mjs.map +1 -0
- package/dist/hooks/useFocusBeforeClose.cjs +2 -0
- package/dist/hooks/useFocusBeforeClose.cjs.map +1 -0
- package/dist/hooks/useFocusBeforeClose.mjs +33 -0
- package/dist/hooks/useFocusBeforeClose.mjs.map +1 -0
- package/dist/hooks/useListbox.cjs +1 -1
- package/dist/hooks/useListbox.cjs.map +1 -1
- package/dist/hooks/useListbox.mjs +140 -130
- package/dist/hooks/useListbox.mjs.map +1 -1
- package/dist/hooks/useMotion.cjs +2 -0
- package/dist/hooks/useMotion.cjs.map +1 -0
- package/dist/hooks/useMotion.mjs +14 -0
- package/dist/hooks/useMotion.mjs.map +1 -0
- package/dist/hooks/usePresenceGroup.cjs +2 -0
- package/dist/hooks/usePresenceGroup.cjs.map +1 -0
- package/dist/hooks/usePresenceGroup.mjs +68 -0
- package/dist/hooks/usePresenceGroup.mjs.map +1 -0
- package/dist/hooks/useRovingTabIndex.cjs +1 -1
- package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
- package/dist/hooks/useRovingTabIndex.mjs +1 -1
- package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
- package/dist/hooks/useSelection.cjs +2 -0
- package/dist/hooks/useSelection.cjs.map +1 -0
- package/dist/hooks/useSelection.mjs +57 -0
- package/dist/hooks/useSelection.mjs.map +1 -0
- package/dist/hooks/useVirtualWindow.cjs +2 -0
- package/dist/hooks/useVirtualWindow.cjs.map +1 -0
- package/dist/hooks/useVirtualWindow.mjs +102 -0
- package/dist/hooks/useVirtualWindow.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2249 -179
- package/dist/index.d.ts +2249 -179
- package/dist/index.mjs +147 -135
- package/dist/lib/classNames.cjs +1 -1
- package/dist/lib/classNames.cjs.map +1 -1
- package/dist/lib/classNames.mjs +125 -95
- package/dist/lib/classNames.mjs.map +1 -1
- package/dist/lib/columnSizing.cjs +2 -0
- package/dist/lib/columnSizing.cjs.map +1 -0
- package/dist/lib/columnSizing.mjs +27 -0
- package/dist/lib/columnSizing.mjs.map +1 -0
- package/dist/lib/flatTree.cjs +2 -0
- package/dist/lib/flatTree.cjs.map +1 -0
- package/dist/lib/flatTree.mjs +118 -0
- package/dist/lib/flatTree.mjs.map +1 -0
- package/dist/lib/motion.cjs +2 -0
- package/dist/lib/motion.cjs.map +1 -0
- package/dist/lib/motion.mjs +43 -0
- package/dist/lib/motion.mjs.map +1 -0
- package/dist/lib/selection.cjs +2 -0
- package/dist/lib/selection.cjs.map +1 -0
- package/dist/lib/selection.mjs +28 -0
- package/dist/lib/selection.mjs.map +1 -0
- package/dist/lib/treeCascade.cjs +2 -0
- package/dist/lib/treeCascade.cjs.map +1 -0
- package/dist/lib/treeCascade.mjs +52 -0
- package/dist/lib/treeCascade.mjs.map +1 -0
- package/dist/lib/virtual.cjs +2 -0
- package/dist/lib/virtual.cjs.map +1 -0
- package/dist/lib/virtual.mjs +54 -0
- package/dist/lib/virtual.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
2
3
|
import { FC } from 'react';
|
|
3
4
|
import { JSX } from 'react';
|
|
4
5
|
import { JSXElementConstructor } from 'react';
|
|
@@ -11,7 +12,9 @@ import { ReactPortal } from 'react';
|
|
|
11
12
|
/**
|
|
12
13
|
* A vertically stacked set of disclosure sections (WAI-ARIA Accordion pattern). Each
|
|
13
14
|
* `Accordion.Item` renders an `Accordion.Trigger` button inside a heading (`headingLevel`) and an
|
|
14
|
-
* `Accordion.Panel` region that is shown while the item is open.
|
|
15
|
+
* `Accordion.Panel` region that is shown while the item is open. A panel opens and closes its
|
|
16
|
+
* space with a short collapse and fade (`Accordion.Panel`'s `motion`; none under reduced motion or
|
|
17
|
+
* a `WaveProvider` with `motion="none"`), and focus inside a closing panel moves to its trigger.
|
|
15
18
|
*
|
|
16
19
|
* Single mode (the default) keeps at most one item open (`openItem`, `defaultOpenItem`,
|
|
17
20
|
* `onOpenItemChange`); `type="multiple"` lets any number of items open (`openItems`,
|
|
@@ -34,7 +37,7 @@ export declare const Accordion: {
|
|
|
34
37
|
displayName: string;
|
|
35
38
|
};
|
|
36
39
|
Panel: {
|
|
37
|
-
({ id: idProp, className, children, ref, ...rest }: AccordionPanelProps): React_2.JSX.Element | null;
|
|
40
|
+
({ id: idProp, className, children, motion, ref, ...rest }: AccordionPanelProps): React_2.JSX.Element | null;
|
|
38
41
|
displayName: string;
|
|
39
42
|
};
|
|
40
43
|
};
|
|
@@ -113,22 +116,46 @@ export declare interface AccordionMultipleProps extends AccordionBaseProps {
|
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
/**
|
|
116
|
-
* The content region of an Accordion.Item, rendered
|
|
117
|
-
*
|
|
118
|
-
* non-empty `id` replaces the generated one (the trigger's
|
|
119
|
+
* The content region of an Accordion.Item, labelled by its trigger and rendered while the item is
|
|
120
|
+
* open and while it collapses after a close. Its props (className merged, `ref`, `data-*`,
|
|
121
|
+
* handlers) land on the region, and a non-empty `id` replaces the generated one (the trigger's
|
|
122
|
+
* `aria-controls` follows it).
|
|
123
|
+
*
|
|
124
|
+
* The region renders as the only child of a collapse element (its stable class
|
|
125
|
+
* `wave-accordion-panel__collapse`), which opens and closes the region's space (`motion`) and has
|
|
126
|
+
* no box of its own while the item is open, so the region lays out in the Item as before. An item
|
|
127
|
+
* opened by default appears without motion. After a close the region stays in the document until
|
|
128
|
+
* the collapse ends, `inert` and with `data-state="closed"`, while its trigger already reports the
|
|
129
|
+
* item collapsed; opening the item again during the collapse keeps the same region and the state
|
|
130
|
+
* of its content. Focus inside the region when the item closes moves to the item's trigger.
|
|
119
131
|
*/
|
|
120
132
|
export declare const AccordionPanel: {
|
|
121
|
-
({ id: idProp, className, children, ref, ...rest }: AccordionPanelProps): React_2.JSX.Element | null;
|
|
133
|
+
({ id: idProp, className, children, motion, ref, ...rest }: AccordionPanelProps): React_2.JSX.Element | null;
|
|
122
134
|
displayName: string;
|
|
123
135
|
};
|
|
124
136
|
|
|
125
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* Accordion.Panel: `root` on the `role="region"` element; `collapse` on the element around it
|
|
139
|
+
* (the element that opens and closes the region's space, 0.15).
|
|
140
|
+
*/
|
|
126
141
|
export declare const accordionPanelClassNames: {
|
|
127
142
|
readonly root: "wave-accordion-panel";
|
|
143
|
+
readonly collapse: "wave-accordion-panel__collapse";
|
|
128
144
|
};
|
|
129
145
|
|
|
130
146
|
/** Properties for the AccordionPanel sub-component (merged onto the `role="region"` element). */
|
|
131
147
|
export declare interface AccordionPanelProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
148
|
+
/**
|
|
149
|
+
* Replaces the panel's collapse (Fluent's `AccordionPanel collapseMotion`), on the element
|
|
150
|
+
* around the region: by default the space the region takes opens from nothing and closes back
|
|
151
|
+
* to it, with a fade, over the normal duration (200 ms) with the max easy-ease curve, both ways.
|
|
152
|
+
* `null` turns it off (the region appears and disappears at once); a class string or
|
|
153
|
+
* `{ className }` replaces it, written as `MotionSlot` describes. A `WaveProvider` with
|
|
154
|
+
* `motion="none"` turns the default off, and a value here still applies under it. A panel
|
|
155
|
+
* rendered inside another panel has no motion of its own.
|
|
156
|
+
* @default the collapse described above
|
|
157
|
+
*/
|
|
158
|
+
motion?: MotionSlot | null;
|
|
132
159
|
/** Ref to the panel `<div role="region">`. */
|
|
133
160
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
134
161
|
}
|
|
@@ -1588,12 +1615,16 @@ export declare type CardProps<C extends React_2.ElementType = 'div'> = Polymorph
|
|
|
1588
1615
|
* - `controlsLayout` places the Previous and Next buttons over the slides (`overlay`,
|
|
1589
1616
|
* `overlay-wide`) or beside them (`inline`, `inline-wide`); `Carousel.Button` replaces the
|
|
1590
1617
|
* built-in button of its `direction` with one of your own glyph.
|
|
1618
|
+
* - The slides glide to the new page over 300 ms; `motion="fade"` cross-fades them instead (one
|
|
1619
|
+
* slide per page), `motion={null}` turns the motion off and `motionDuration` times it. Under
|
|
1620
|
+
* reduced motion, or below a `WaveProvider` with `motion="none"` (unless `motion` is set), the
|
|
1621
|
+
* page changes at once.
|
|
1591
1622
|
*
|
|
1592
1623
|
* Compound access (`Carousel.Item`, `Carousel.Button`) needs a client module; React Server
|
|
1593
1624
|
* Components import the flat names `CarouselItem` and `CarouselButton` instead.
|
|
1594
1625
|
*/
|
|
1595
1626
|
export declare const Carousel: {
|
|
1596
|
-
({ value: controlledValue, defaultValue, onValueChange, autoPlay, autoPlayInterval, autoPlayLabels, labels, loop, groupSize, align, draggable, controlsLayout, appearance, className, children, onMouseEnter, onMouseLeave, onFocus, onBlur, ref, ...rest }: CarouselProps): React_2.JSX.Element;
|
|
1627
|
+
({ value: controlledValue, defaultValue, onValueChange, autoPlay, autoPlayInterval, autoPlayLabels, labels, loop, groupSize, align, draggable, controlsLayout, appearance, motion, motionDuration, className, children, onMouseEnter, onMouseLeave, onFocus, onBlur, ref, ...rest }: CarouselProps): React_2.JSX.Element;
|
|
1597
1628
|
displayName: string;
|
|
1598
1629
|
} & {
|
|
1599
1630
|
Item: {
|
|
@@ -1741,6 +1772,12 @@ export declare interface CarouselLabels {
|
|
|
1741
1772
|
slideRoleDescription?: string;
|
|
1742
1773
|
}
|
|
1743
1774
|
|
|
1775
|
+
/**
|
|
1776
|
+
* How a Carousel moves between pages: `slide` moves the slides in from the side of the page order,
|
|
1777
|
+
* `fade` cross-fades them in place (one slide per page only).
|
|
1778
|
+
*/
|
|
1779
|
+
export declare type CarouselMotion = 'slide' | 'fade';
|
|
1780
|
+
|
|
1744
1781
|
/** Properties for the Carousel component. */
|
|
1745
1782
|
export declare interface CarouselProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
1746
1783
|
/**
|
|
@@ -1774,10 +1811,12 @@ export declare interface CarouselProps extends React_2.HTMLAttributes<HTMLDivEle
|
|
|
1774
1811
|
/**
|
|
1775
1812
|
* Lets the pointer drag the slides (mouse, touch and pen). The track follows the pointer and,
|
|
1776
1813
|
* on release, the page changes when the drag passed a quarter of the width or left fast, else
|
|
1777
|
-
* it snaps back; the direction follows the carousel's.
|
|
1778
|
-
*
|
|
1779
|
-
*
|
|
1780
|
-
*
|
|
1814
|
+
* it snaps back; the direction follows the carousel's. Under `motion="fade"` the slides do not
|
|
1815
|
+
* follow the pointer (they share one place): the same drag still changes the page on release,
|
|
1816
|
+
* and the slides cross-fade. The click that ends a drag is not delivered to the slide, and a
|
|
1817
|
+
* vertical swipe still scrolls the page. Dragging pauses autoplay like the pointer over the
|
|
1818
|
+
* carousel does. The buttons and the keyboard stay the way to operate the carousel without a
|
|
1819
|
+
* pointer.
|
|
1781
1820
|
* @default false
|
|
1782
1821
|
*/
|
|
1783
1822
|
draggable?: boolean;
|
|
@@ -1825,6 +1864,26 @@ export declare interface CarouselProps extends React_2.HTMLAttributes<HTMLDivEle
|
|
|
1825
1864
|
* @default false
|
|
1826
1865
|
*/
|
|
1827
1866
|
loop?: boolean;
|
|
1867
|
+
/**
|
|
1868
|
+
* How the carousel moves between pages: `slide` glides the slides in from the side of the page
|
|
1869
|
+
* order (mirrored in right-to-left layouts), `fade` cross-fades them in place, and `null` turns
|
|
1870
|
+
* the motion off (the page changes at once). Fluent's `motion`; its object form with a
|
|
1871
|
+
* `duration` is not offered: use `motionDuration`. `fade` needs one slide per page: with
|
|
1872
|
+
* `groupSize` above 1 or `'auto'` the slides slide, and a development warning says so. Under
|
|
1873
|
+
* `fade` a drag still changes the page on release, but the slides do not follow the pointer.
|
|
1874
|
+
* Below a `WaveProvider` with `motion="none"` the carousel does not move unless this prop is
|
|
1875
|
+
* set. Either motion is off while the user prefers reduced motion. The root renders the motion
|
|
1876
|
+
* it resolves from this prop, `groupSize` and the provider as `data-motion` (`slide`, `fade` or
|
|
1877
|
+
* `none`); reduced motion leaves it unchanged.
|
|
1878
|
+
* @default 'slide'
|
|
1879
|
+
*/
|
|
1880
|
+
motion?: CarouselMotion | null;
|
|
1881
|
+
/**
|
|
1882
|
+
* How long the slide or the fade takes, in milliseconds. Fluent's `duration` is a different
|
|
1883
|
+
* unit (Embla's unitless speed, 20 to 60), so a value ported from Fluent is far too short.
|
|
1884
|
+
* @default 300
|
|
1885
|
+
*/
|
|
1886
|
+
motionDuration?: number;
|
|
1828
1887
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
1829
1888
|
}
|
|
1830
1889
|
|
|
@@ -1993,6 +2052,9 @@ export declare interface CheckedValuesChangeDetails {
|
|
|
1993
2052
|
*/
|
|
1994
2053
|
export declare type CheckedValuesChangeHandler = (checkedValues: Record<string, string[]>, details?: CheckedValuesChangeDetails) => void;
|
|
1995
2054
|
|
|
2055
|
+
/** The check state of an item in a `selectionMode="multiple"` tree. */
|
|
2056
|
+
export declare type CheckState = 'checked' | 'mixed' | 'unchecked';
|
|
2057
|
+
|
|
1996
2058
|
/**
|
|
1997
2059
|
* Joins class names (clsx) and resolves Tailwind conflicts so the **last** class wins — pass
|
|
1998
2060
|
* internal classes first and the consumer's `className` last.
|
|
@@ -2581,6 +2643,26 @@ export declare interface ColorSwatchProps extends Omit<React_2.ButtonHTMLAttribu
|
|
|
2581
2643
|
ref?: React_2.Ref<HTMLButtonElement>;
|
|
2582
2644
|
}
|
|
2583
2645
|
|
|
2646
|
+
/** The sizing of one column of a table with resizable columns. */
|
|
2647
|
+
export declare interface ColumnSizingOption {
|
|
2648
|
+
/**
|
|
2649
|
+
* The narrowest the column can be, in pixels: the initial width and every resize are held at or
|
|
2650
|
+
* above it.
|
|
2651
|
+
* @default 80
|
|
2652
|
+
*/
|
|
2653
|
+
minWidth?: number;
|
|
2654
|
+
/**
|
|
2655
|
+
* The width the column starts at when it has no `defaultWidth`, in pixels.
|
|
2656
|
+
* @default 150
|
|
2657
|
+
*/
|
|
2658
|
+
idealWidth?: number;
|
|
2659
|
+
/**
|
|
2660
|
+
* The width the column starts at, in pixels. It wins over `idealWidth`.
|
|
2661
|
+
* @default idealWidth, else 150
|
|
2662
|
+
*/
|
|
2663
|
+
defaultWidth?: number;
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2584
2666
|
/**
|
|
2585
2667
|
* An editable combobox: a text input with a filterable listbox of `Option`s (APG combobox with
|
|
2586
2668
|
* list autocomplete). Typing filters the options; ArrowDown/ArrowUp move the highlight
|
|
@@ -2610,6 +2692,15 @@ export declare interface ColorSwatchProps extends Omit<React_2.ButtonHTMLAttribu
|
|
|
2610
2692
|
* the value. `freeform` is not available with `multiselect`, and a non-literal
|
|
2611
2693
|
* `multiselect={flag}` is a type error: render two elements, one for each mode.
|
|
2612
2694
|
*
|
|
2695
|
+
* **Data mode**: `items` passes the options as data instead of children. The open list renders an
|
|
2696
|
+
* option per matching item (`renderOption` draws it, an `Option` with the item's label by
|
|
2697
|
+
* default) and the closed list none; the keys, the filter and the input's text follow the data,
|
|
2698
|
+
* and each option carries `aria-posinset` and `aria-setsize` among the shown options. A long list
|
|
2699
|
+
* takes a `virtualWindow` (from `useVirtualWindow({ itemSize })`): the open list then renders only
|
|
2700
|
+
* the options in view, plus an overscan, with spacers for the others, every option `itemSize`
|
|
2701
|
+
* tall; the active option stays rendered, and opening scrolls it (else the first selected option)
|
|
2702
|
+
* to the middle of the list.
|
|
2703
|
+
*
|
|
2613
2704
|
* The `<input>` receives `id`, `aria-label`, `aria-labelledby`, `aria-describedby`,
|
|
2614
2705
|
* `aria-invalid`, `aria-required`, `aria-errormessage`, `aria-details`, `tabIndex`, `autoFocus`,
|
|
2615
2706
|
* `onFocus`/`onBlur`/`onKeyDown`/`onKeyUp` and the text input attributes `autoComplete`,
|
|
@@ -2636,7 +2727,8 @@ export declare const Combobox: ComboboxComponent;
|
|
|
2636
2727
|
* Combobox: `root` on the outer element; `input` on the `role="combobox"` input; `clearButton` on
|
|
2637
2728
|
* the clear button; `expandButton` on the expand button and `expandIcon` on its glyph; `listbox`
|
|
2638
2729
|
* on the `role="listbox"` list; `surface` on its portaled popup; `emptyMessage` on the
|
|
2639
|
-
* "No matches" row
|
|
2730
|
+
* "No matches" row; `spacer` on each spacer element of the list with a `virtualWindow` (the
|
|
2731
|
+
* elements that stand in for the options that are not rendered).
|
|
2640
2732
|
*/
|
|
2641
2733
|
export declare const comboboxClassNames: {
|
|
2642
2734
|
readonly root: "wave-combobox";
|
|
@@ -2647,6 +2739,7 @@ export declare const comboboxClassNames: {
|
|
|
2647
2739
|
readonly listbox: "wave-combobox__listbox";
|
|
2648
2740
|
readonly surface: "wave-combobox__surface";
|
|
2649
2741
|
readonly emptyMessage: "wave-combobox__empty-message";
|
|
2742
|
+
readonly spacer: "wave-combobox__spacer";
|
|
2650
2743
|
};
|
|
2651
2744
|
|
|
2652
2745
|
/** The Combobox component's type: a multi-select signature, then the single-select one. */
|
|
@@ -2799,8 +2892,9 @@ export declare interface ComboboxProps<M extends boolean = false> extends Omit<R
|
|
|
2799
2892
|
* keep options that do not contain the text: `filter={() => true}` with `query` and
|
|
2800
2893
|
* `onQueryChange` leaves the matching to you (a server-side search that replaces the options),
|
|
2801
2894
|
* and a filter that always keeps an option of your own gives a "Create …" entry. With a
|
|
2802
|
-
* server-side search, keep the selected option among the children, `hidden` while
|
|
2803
|
-
* leave it out: a value without an option shows no label (the "Async search" story
|
|
2895
|
+
* server-side search, keep the selected option among the children (or `items`), `hidden` while
|
|
2896
|
+
* the results leave it out: a value without an option shows no label (the "Async search" story
|
|
2897
|
+
* does this).
|
|
2804
2898
|
* @default a case-insensitive substring match on the option's `textValue`, else its `label`
|
|
2805
2899
|
*/
|
|
2806
2900
|
filter?: (option: ListboxItem, query: string) => boolean;
|
|
@@ -2894,6 +2988,51 @@ export declare interface ComboboxProps<M extends boolean = false> extends Omit<R
|
|
|
2894
2988
|
* Unset members keep their English defaults.
|
|
2895
2989
|
*/
|
|
2896
2990
|
labels?: ComboboxLabels;
|
|
2991
|
+
/**
|
|
2992
|
+
* Data mode: the options as data, in list order (`value`, `label`, and optionally `textValue`,
|
|
2993
|
+
* `disabled` and `hidden`; values unique). The open list renders one option per item that is
|
|
2994
|
+
* not `hidden` and that the typed text matches (`filter`, on `textValue ?? label` by default; see
|
|
2995
|
+
* `renderOption`); the closed list renders none. The keys, the selection and the input's label
|
|
2996
|
+
* text follow `items`, also for a selected item whose option is not rendered. The children are
|
|
2997
|
+
* neither read nor rendered: passing both warns once in development. Each option gets
|
|
2998
|
+
* `aria-posinset` and `aria-setsize` from its place among the shown items (typing narrows
|
|
2999
|
+
* them), and keeps one id per value. Without it, the options are the `Option` children.
|
|
3000
|
+
*/
|
|
3001
|
+
items?: readonly ListboxItem[];
|
|
3002
|
+
/**
|
|
3003
|
+
* Data mode: renders the option of an item, given its state (`selected`, `active`, and `index`
|
|
3004
|
+
* among the shown options). Return an `Option`, or an option component of your own on
|
|
3005
|
+
* `useListboxOption`, with the item's `value` (and its `disabled`); its position is set for you,
|
|
3006
|
+
* and in a windowed list (`virtualWindow`) its height. It is called again only when the item, its
|
|
3007
|
+
* state, its position (`aria-posinset` and `aria-setsize`, which typing changes) or the function
|
|
3008
|
+
* itself changes, so pass a stable function in a long list. Ignored without `items`, with a
|
|
3009
|
+
* development warning.
|
|
3010
|
+
* @default an `Option` with the item's `value`, `label` (also its text), `textValue` and `disabled`
|
|
3011
|
+
*/
|
|
3012
|
+
renderOption?: (item: ListboxItem, state: ListboxOptionRenderState) => React_2.ReactNode;
|
|
3013
|
+
/**
|
|
3014
|
+
* Data mode: renders only the options in view of a long list, plus an overscan, and spacers
|
|
3015
|
+
* (`aria-hidden`, `data-virtual-spacer`) as tall as the options they stand for: pass the result
|
|
3016
|
+
* of `useVirtualWindow({ itemSize })`, or an object of your own that implements `VirtualWindow`.
|
|
3017
|
+
* It needs `items`: without them, or beside `OptionGroup` children, it is ignored with a
|
|
3018
|
+
* development warning (a window renders a flat list).
|
|
3019
|
+
*
|
|
3020
|
+
* The open popup's list is the window's scroller, so it needs no height of yours: it scrolls
|
|
3021
|
+
* within its own maximum height (15rem, 240 pixels at the default root size, less where the
|
|
3022
|
+
* viewport has no room). Every option is exactly `itemSize` tall (the list sets its height,
|
|
3023
|
+
* after the option's own `style`), so an option's content must fit in it: the default `Option`
|
|
3024
|
+
* with one line of text is 32 pixels tall.
|
|
3025
|
+
*
|
|
3026
|
+
* The window counts the shown options: typing narrows it, as it narrows `aria-setsize`. The
|
|
3027
|
+
* arrow keys move over all of them; the active option stays rendered while it is scrolled away,
|
|
3028
|
+
* so `aria-activedescendant` always names an element, and when a key (or typing) makes it
|
|
3029
|
+
* active the list and the window move to it in the same update. Opening the list scrolls the
|
|
3030
|
+
* active option, else the first selected one, to the middle of the list, and again once the
|
|
3031
|
+
* popup's positioning has given the list its height (a short viewport) unless it was scrolled
|
|
3032
|
+
* first. A closed list renders no option. The browser's scroll anchoring is off on a windowed
|
|
3033
|
+
* list (the window lays the options out).
|
|
3034
|
+
*/
|
|
3035
|
+
virtualWindow?: VirtualWindow;
|
|
2897
3036
|
/**
|
|
2898
3037
|
* Called when the `<input role="combobox">` receives focus (the root keeps other handlers).
|
|
2899
3038
|
* With `multiselect`, a focus while the input shows the selected labels then selects them;
|
|
@@ -3181,6 +3320,29 @@ export declare function createToaster(): ToasterHandle;
|
|
|
3181
3320
|
* itself, and `DataGrid.Body` also takes a render function that returns each item's row. Rows
|
|
3182
3321
|
* rendered from `items` take their `rowId` from `getRowId` (by default the item's index).
|
|
3183
3322
|
*
|
|
3323
|
+
* With `items`, selection follows the data rather than the rendered rows: select-all and its
|
|
3324
|
+
* checkbox cover every item (`isSelectionDisabled` leaves items out), and ids of rows that are
|
|
3325
|
+
* filtered out, on another page or not rendered stay selected through row clicks, select-all and
|
|
3326
|
+
* sorting, and are reported by `onSelectedItemsChange`.
|
|
3327
|
+
*
|
|
3328
|
+
* With `items` and `columns`, the columns can be sized: `resizableColumns` gives each column
|
|
3329
|
+
* header a resize handle (a separator that a pointer drags and the arrow keys move, mirrored in
|
|
3330
|
+
* right-to-left grids; F2 on a column header moves focus to it, and Enter, Space or Escape back),
|
|
3331
|
+
* `columnSizingOptions` sets each column's initial and minimum width, and `columnWidths` or
|
|
3332
|
+
* `defaultColumnWidths` with `onColumnWidthsChange(widths, details)` hold the widths, for
|
|
3333
|
+
* instance to persist them (Fluent's `resizableColumns`, `columnSizingOptions` and
|
|
3334
|
+
* `onColumnResize`, whose data is in `details`). The grid then lays its columns out from the
|
|
3335
|
+
* widths and truncates its cells' text.
|
|
3336
|
+
*
|
|
3337
|
+
* With `items` and `columns`, a `virtualWindow` (from `useVirtualWindow`) renders only the rows in
|
|
3338
|
+
* view of a long list, with spacer rows for the others: the scroll wrapper (`containerProps`)
|
|
3339
|
+
* needs a bounded height, and every row has the window's fixed row height. The header stays at
|
|
3340
|
+
* the top of the wrapper, the keyboard moves by the data (a row that is not rendered is scrolled
|
|
3341
|
+
* in before it gets focus), the focused row stays rendered, and selection, select-all, sorting
|
|
3342
|
+
* and column sizing still cover every item. The grid then carries `aria-rowcount` and its rows
|
|
3343
|
+
* `aria-rowindex`, so assistive technology reads each row's place in the whole list. Fluent's
|
|
3344
|
+
* DataGrid has no built-in counterpart.
|
|
3345
|
+
*
|
|
3184
3346
|
* Sub-components are available as `DataGrid.Header`, `DataGrid.HeaderCell`, `DataGrid.Body`,
|
|
3185
3347
|
* `DataGrid.Row`, `DataGrid.Cell` and `DataGrid.SelectionCell` in client components, and as the
|
|
3186
3348
|
* flat exports `DataGridHeader`, `DataGridHeaderCell`, `DataGridBody`, `DataGridRow`,
|
|
@@ -3192,7 +3354,7 @@ export declare const DataGrid: typeof DataGridRoot & {
|
|
|
3192
3354
|
displayName: string;
|
|
3193
3355
|
};
|
|
3194
3356
|
HeaderCell: {
|
|
3195
|
-
({ columnId, sortable, sortIcon, children, className, onClick, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
|
|
3357
|
+
({ columnId, sortable, sortIcon, children, className, onClick, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
|
|
3196
3358
|
displayName: string;
|
|
3197
3359
|
};
|
|
3198
3360
|
Body: {
|
|
@@ -3200,7 +3362,7 @@ export declare const DataGrid: typeof DataGridRoot & {
|
|
|
3200
3362
|
displayName: string;
|
|
3201
3363
|
};
|
|
3202
3364
|
Row: {
|
|
3203
|
-
({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
|
|
3365
|
+
({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, style, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
|
|
3204
3366
|
displayName: string;
|
|
3205
3367
|
};
|
|
3206
3368
|
Cell: {
|
|
@@ -3217,10 +3379,28 @@ export declare const DataGrid: typeof DataGridRoot & {
|
|
|
3217
3379
|
export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttributes<HTMLTableElement> {
|
|
3218
3380
|
/**
|
|
3219
3381
|
* The row id of an item: the `rowId` of its row (for selection), for rows rendered from `items`.
|
|
3220
|
-
*
|
|
3382
|
+
* Select-all and its checkbox use these ids, whether the rows are rendered or not. A row's own
|
|
3383
|
+
* `rowId` wins for that row, but a row whose own id differs from its item's id is outside
|
|
3384
|
+
* select-all and its state, and select-all selects the item's id, which no row has (a
|
|
3385
|
+
* development warning says so): return the rows' ids here rather than setting `rowId`. Ids must
|
|
3386
|
+
* be unique (a duplicate warns in development). Define it outside the component, or memoise it:
|
|
3387
|
+
* a new function rebuilds the row of every item and the set of ids select-all works on (with a
|
|
3388
|
+
* `virtualWindow`, the component that holds the window renders at every row the view enters).
|
|
3221
3389
|
* @default the item's index in `items`, as a string
|
|
3222
3390
|
*/
|
|
3223
3391
|
getRowId?: (item: T) => string;
|
|
3392
|
+
/**
|
|
3393
|
+
* Whether the selection of an item of `items` is disabled (`index` is its index in `items`), so
|
|
3394
|
+
* select-all can skip items whose rows are not rendered. Select-all leaves such an item as it is,
|
|
3395
|
+
* selected or not, and its state counts only the other items. The item's row takes it as the
|
|
3396
|
+
* `disabled` of its selection cell (a disabled control; neither a row click nor Space changes
|
|
3397
|
+
* it), unless the cell sets `disabled` itself: the cell's value then applies to the control, a
|
|
3398
|
+
* value that disagrees warns in development, and select-all skips a row that either disables.
|
|
3399
|
+
* Without it, every item is selectable unless its rendered row disables its selection cell.
|
|
3400
|
+
* Ignored without `items`. Called for every item whenever `items`, `getRowId` or this function
|
|
3401
|
+
* change: define it outside the component, or memoise it.
|
|
3402
|
+
*/
|
|
3403
|
+
isSelectionDisabled?: (item: T, index: number) => boolean;
|
|
3224
3404
|
/**
|
|
3225
3405
|
* Column definitions. When given and no `DataGrid.Header` child is present, the header row
|
|
3226
3406
|
* (including the selection column) is rendered from them: `columnId` becomes the header cell's
|
|
@@ -3231,6 +3411,87 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
|
|
|
3231
3411
|
* memoised).
|
|
3232
3412
|
*/
|
|
3233
3413
|
columns?: readonly DataGridColumn<T>[];
|
|
3414
|
+
/**
|
|
3415
|
+
* Gives the header cell of each column (of `columns`, by `columnId`; the last one included, the
|
|
3416
|
+
* selection column not) a resize handle: a focusable `role="separator"` with the column's width
|
|
3417
|
+
* as `aria-valuenow`. A drag (mouse, touch or pen) moves the column's end edge, mirrored in
|
|
3418
|
+
* right-to-left grids. From the keyboard, F2 on a header cell (or on its sort button) moves focus
|
|
3419
|
+
* to its handle, which adds no Tab stop to the grid; there the arrow keys move the edge by 20
|
|
3420
|
+
* pixels (5 with Shift, mirrored in right-to-left grids), Home sets the minimum width, and Enter,
|
|
3421
|
+
* Space or Escape return focus to the header (its sort button, which Enter still activates
|
|
3422
|
+
* directly). A double click sets the column back to its initial width once a width is state.
|
|
3423
|
+
* The grid carries `data-resizing` while a handle drags. Needs `columns` and `items`, as every
|
|
3424
|
+
* column width prop does: without them they are all ignored, with a development warning.
|
|
3425
|
+
* Fluent's `resizableColumns`.
|
|
3426
|
+
* @default false
|
|
3427
|
+
*/
|
|
3428
|
+
resizableColumns?: boolean;
|
|
3429
|
+
/**
|
|
3430
|
+
* The sizing of each column, by `columnId`: `minWidth` (`@default 80`), and the width it starts
|
|
3431
|
+
* at, `defaultWidth`, else `idealWidth`, else 150 (never below `minWidth`). With it, or with
|
|
3432
|
+
* `columnWidths` or `defaultColumnWidths`, the grid lays its columns out from these widths
|
|
3433
|
+
* (a `<colgroup>` and a fixed table layout) with or without `resizableColumns`, and its cells
|
|
3434
|
+
* truncate their text with an ellipsis unless a cell's class says otherwise. Until a width is
|
|
3435
|
+
* state the grid is 100% wide and at least as wide as its columns, so a wider container spreads
|
|
3436
|
+
* them (the selection column too); the first change takes the widths the columns are drawn at,
|
|
3437
|
+
* so nothing jumps, and from then on the grid is exactly as wide as its columns (slack shows
|
|
3438
|
+
* after the last one). There is no maximum width and no fitting to the container. Ids that are
|
|
3439
|
+
* not columns are ignored; it may be written inline. Fluent's `columnSizingOptions`.
|
|
3440
|
+
*/
|
|
3441
|
+
columnSizingOptions?: Record<string, ColumnSizingOption>;
|
|
3442
|
+
/**
|
|
3443
|
+
* The column widths in pixels (controlled), by `columnId`; a column without an entry has its
|
|
3444
|
+
* initial width (see `columnSizingOptions`), and a width below the column's minimum is held at
|
|
3445
|
+
* it. The grid is exactly as wide as its columns. Pair it with `onColumnWidthsChange`; a parent
|
|
3446
|
+
* that ignores a change leaves the column where it is.
|
|
3447
|
+
*/
|
|
3448
|
+
columnWidths?: Record<string, number>;
|
|
3449
|
+
/** The column widths in pixels at first render (uncontrolled; see `columnWidths`). */
|
|
3450
|
+
defaultColumnWidths?: Record<string, number>;
|
|
3451
|
+
/**
|
|
3452
|
+
* Called with the width of every column (by `columnId`) whenever a width changes, at every step
|
|
3453
|
+
* of a drag (at most once per animation frame) or key press, then `details`: `{ columnId,
|
|
3454
|
+
* width, event }`, the resized column, its new width and the event behind it. The grid always
|
|
3455
|
+
* passes `details`; it is typed optional through 0.x, as every `details` argument. Setting the
|
|
3456
|
+
* width a column already has does not call it once a width is state. Fluent's `onColumnResize`,
|
|
3457
|
+
* whose data is in `details`.
|
|
3458
|
+
*/
|
|
3459
|
+
onColumnWidthsChange?: (widths: Record<string, number>, details?: TableColumnWidthsChangeDetails) => void;
|
|
3460
|
+
/**
|
|
3461
|
+
* Renders only the body rows in view, plus an overscan, of a grid with many `items`: pass the
|
|
3462
|
+
* result of `useVirtualWindow({ itemSize })` (or an object of your own that implements
|
|
3463
|
+
* `VirtualWindow`). The rows that are not rendered are replaced by spacer rows (`aria-hidden`,
|
|
3464
|
+
* `data-virtual-spacer`) of their height. Fluent has no counterpart in its DataGrid.
|
|
3465
|
+
*
|
|
3466
|
+
* The grid's scroll wrapper (the element of `containerProps`) becomes the window's scroller, so
|
|
3467
|
+
* give it a bounded height, a height or a maximum height in `containerProps`: without one the
|
|
3468
|
+
* window measures the whole list and renders every row (a development warning says so). Every
|
|
3469
|
+
* row has the window's `itemSize` as its height: the grid sets it on each body row, drops the
|
|
3470
|
+
* vertical padding of its cells and keeps their text on one line, so a cell's content must fit
|
|
3471
|
+
* in it. The columns are laid out from widths (as with `columnSizingOptions`), so they never
|
|
3472
|
+
* change width as rows come and go. The header stays at the top of the scroller: pass its height
|
|
3473
|
+
* as `scrollPaddingStart` to `useVirtualWindow`, so keyboard moves bring rows into the area below
|
|
3474
|
+
* it. The scroller is no tab stop of its own (`tabIndex` -1, as Firefox would stop on it; a
|
|
3475
|
+
* `tabIndex` in `containerProps` wins), and the browser's scroll anchoring is off on it (the
|
|
3476
|
+
* window lays the rows out).
|
|
3477
|
+
*
|
|
3478
|
+
* The keyboard moves by the data: ArrowUp/ArrowDown, PageUp/PageDown and Ctrl+Home/Ctrl+End
|
|
3479
|
+
* scroll a target row that is not rendered into the window, then focus it, and the focused row
|
|
3480
|
+
* stays rendered when it is scrolled away. When a data change (a sort, new `items`) makes the
|
|
3481
|
+
* browser drop focus from the moved row, focus returns to the same row, or to the row nearest
|
|
3482
|
+
* its place. Sorting, selection, select-all and column sizing work on every item, rendered or
|
|
3483
|
+
* not. The grid carries `aria-rowcount` (the items plus the header rows), every row
|
|
3484
|
+
* `aria-rowindex` (1-based, the header rows first, the body rows in the sorted order) and every
|
|
3485
|
+
* body row `data-row-index` (its 0-based position in the sorted order); a grid without a window
|
|
3486
|
+
* renders none of them.
|
|
3487
|
+
*
|
|
3488
|
+
* Needs `items` and `columns`, with the body rows rendered from them (no `DataGrid.Body` child,
|
|
3489
|
+
* or one whose child is a render function); otherwise it is ignored, with a development warning.
|
|
3490
|
+
* The component that calls `useVirtualWindow` renders again at every row the view enters: keep
|
|
3491
|
+
* `items`, `columns`, `getRowId` and `isSelectionDisabled` stable (defined outside it, or
|
|
3492
|
+
* memoised), or each of those renders rebuilds the rows of every item.
|
|
3493
|
+
*/
|
|
3494
|
+
virtualWindow?: VirtualWindow;
|
|
3234
3495
|
/**
|
|
3235
3496
|
* Row selection mode. `'multiple'` adds a checkbox column with a "Select all rows" header
|
|
3236
3497
|
* checkbox; `'single'` adds a radio column (its header reads "Selection" to assistive
|
|
@@ -3239,8 +3500,10 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
|
|
|
3239
3500
|
*/
|
|
3240
3501
|
selectionMode?: 'none' | SelectionMode_2;
|
|
3241
3502
|
/**
|
|
3242
|
-
* The
|
|
3243
|
-
*
|
|
3503
|
+
* The grid's built-in text, for localization: the name of the select-all checkbox
|
|
3504
|
+
* (`selectAll`), the header text of the selection column (`selectionHeader`), and, with
|
|
3505
|
+
* `resizableColumns`, the name of the resize handles (`resizeColumn`) and their value text
|
|
3506
|
+
* (`columnWidth`). Unset members keep their English defaults. Rows are named with their own
|
|
3244
3507
|
* `selectionLabel`.
|
|
3245
3508
|
*/
|
|
3246
3509
|
labels?: DataGridLabels;
|
|
@@ -3272,18 +3535,33 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
|
|
|
3272
3535
|
*/
|
|
3273
3536
|
subtleSelection?: boolean;
|
|
3274
3537
|
/**
|
|
3275
|
-
* Controlled selected row ids (`DataGrid.Row` `rowId
|
|
3276
|
-
*
|
|
3538
|
+
* Controlled selected row ids (`DataGrid.Row` `rowId`; with `items`, the ids from `getRowId`).
|
|
3539
|
+
* With `items`, every id counts, whether its row is rendered, filtered out or on another page
|
|
3540
|
+
* (see `onSelectedItemsChange`). In single mode pass at most one id: with several, only the
|
|
3541
|
+
* first one is selected (without `items`, the first one whose row is rendered), and a
|
|
3542
|
+
* development warning says so.
|
|
3277
3543
|
*/
|
|
3278
3544
|
selectedItems?: readonly string[];
|
|
3279
3545
|
/** Initially selected row ids (uncontrolled). In single mode, at most one (see `selectedItems`). */
|
|
3280
3546
|
defaultSelectedItems?: readonly string[];
|
|
3281
3547
|
/**
|
|
3282
3548
|
* Called with the new selected row ids when the selection changes, then `details` (`{ event }`,
|
|
3283
|
-
* the click or key press behind the change).
|
|
3284
|
-
*
|
|
3285
|
-
*
|
|
3286
|
-
*
|
|
3549
|
+
* the click or key press behind the change).
|
|
3550
|
+
*
|
|
3551
|
+
* With `items`, the selection follows the data: it reports every selected id, also ids whose
|
|
3552
|
+
* rows are not rendered or not in `items` (filtered out, on another page, restored by id), and no
|
|
3553
|
+
* change drops them. Select-all selects every item of `items` whose selection is not disabled
|
|
3554
|
+
* (`isSelectionDisabled`, or the selection cell of its rendered row) and keeps every other id;
|
|
3555
|
+
* when all of them are selected it removes only their ids. The select-all checkbox shows the
|
|
3556
|
+
* state of those items. Both use the ids from `getRowId` (by default the item's index): a row
|
|
3557
|
+
* that sets its own, different `rowId` (or a `DataGrid.Row` child whose `rowId` is no item's
|
|
3558
|
+
* id) is outside them, and select-all then selects ids that no row has, with a development
|
|
3559
|
+
* warning. Pass a `getRowId` that returns the rows' ids.
|
|
3560
|
+
*
|
|
3561
|
+
* Without `items` (rows written as `DataGrid.Row` children), ids of rows that are not rendered
|
|
3562
|
+
* are left out of the reported selection and of the select-all state, so the next change drops
|
|
3563
|
+
* them. Until that change an uncontrolled grid still holds such an id: a row re-added with the
|
|
3564
|
+
* same `rowId` before then is shown selected again.
|
|
3287
3565
|
*/
|
|
3288
3566
|
onSelectedItemsChange?: (selectedItems: string[], details?: DataGridSelectedItemsChangeDetails) => void;
|
|
3289
3567
|
/** @deprecated Use `selectedItems` (an array). A `Set` or an array is accepted. */
|
|
@@ -3294,7 +3572,8 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
|
|
|
3294
3572
|
onSelectionChange?: (keys: Set<string>) => void;
|
|
3295
3573
|
/**
|
|
3296
3574
|
* Props for the wrapper `<div>` around the `<table>`: a horizontally scrollable container
|
|
3297
|
-
* (`overflow-x-auto`). Use it for its className, style (e.g. a max height) or ref.
|
|
3575
|
+
* (`overflow-x-auto`). Use it for its className, style (e.g. a max height) or ref. With a
|
|
3576
|
+
* `virtualWindow` it is the window's scroller, which needs a bounded height. The wrapper
|
|
3298
3577
|
* is not a tab stop (the grid's own cell tab stop scrolls it) and has no role, so its
|
|
3299
3578
|
* `aria-label`/`aria-labelledby` are applied only together with a `role` (e.g. `'region'`);
|
|
3300
3579
|
* without one they are dropped with a development warning. Name the grid with `aria-label`.
|
|
@@ -3312,7 +3591,9 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
|
|
|
3312
3591
|
/**
|
|
3313
3592
|
* The grid's `<tbody>`. Its child can also be a render function, called with each item of the
|
|
3314
3593
|
* grid's `items` (and its index there) to render the item's row; without children, a grid with
|
|
3315
|
-
* `items` and `columns` renders the rows from the columns.
|
|
3594
|
+
* `items` and `columns` renders the rows from the columns. In a grid with a `virtualWindow` it
|
|
3595
|
+
* renders the rows of the window, the function being called for those rows only, and a spacer
|
|
3596
|
+
* row for each run of rows it leaves out.
|
|
3316
3597
|
*/
|
|
3317
3598
|
export declare const DataGridBody: {
|
|
3318
3599
|
<T>({ children, className, ref, ...rest }: DataGridBodyProps<T>): React_2.JSX.Element;
|
|
@@ -3343,7 +3624,10 @@ export declare interface DataGridBodyProps<T = unknown> extends Omit<React_2.HTM
|
|
|
3343
3624
|
|
|
3344
3625
|
/**
|
|
3345
3626
|
* A grid cell (`<td>`), focusable through the grid's keyboard navigation. It is the positioning
|
|
3346
|
-
* box of a `Table.CellActions` inside it.
|
|
3627
|
+
* box of a `Table.CellActions` inside it. In a grid that lays its columns out from widths (column
|
|
3628
|
+
* sizing, a `virtualWindow`), its text stays on one line and is truncated with an ellipsis, unless
|
|
3629
|
+
* its class says otherwise. In a body row of a grid with a `virtualWindow` it has no vertical
|
|
3630
|
+
* padding: the row has the window's height, which its content must fit in.
|
|
3347
3631
|
*/
|
|
3348
3632
|
export declare const DataGridCell: {
|
|
3349
3633
|
({ children, className, ref, ...rest }: DataGridCellProps): React_2.JSX.Element;
|
|
@@ -3363,10 +3647,15 @@ export declare interface DataGridCellProps extends React_2.TdHTMLAttributes<HTML
|
|
|
3363
3647
|
ref?: React_2.Ref<HTMLTableCellElement>;
|
|
3364
3648
|
}
|
|
3365
3649
|
|
|
3366
|
-
/**
|
|
3650
|
+
/**
|
|
3651
|
+
* DataGrid: `root` on the grid element (`role="grid"`); `container` on the wrapper around it;
|
|
3652
|
+
* `spacer` on each spacer row of a grid with a `virtualWindow` (the rows that stand in for the
|
|
3653
|
+
* rows that are not rendered).
|
|
3654
|
+
*/
|
|
3367
3655
|
export declare const dataGridClassNames: {
|
|
3368
3656
|
readonly root: "wave-data-grid";
|
|
3369
3657
|
readonly container: "wave-data-grid__container";
|
|
3658
|
+
readonly spacer: "wave-data-grid__spacer";
|
|
3370
3659
|
};
|
|
3371
3660
|
|
|
3372
3661
|
/**
|
|
@@ -3434,6 +3723,8 @@ export declare interface DataGridControlledSortProps extends NoDeprecatedSortPro
|
|
|
3434
3723
|
* mode) or the "Selection" header (single mode; DataGrid's `labels` localizes both), later rows of
|
|
3435
3724
|
* a grouped header an empty cell. A header row rendered by another component cannot get it (a
|
|
3436
3725
|
* development warning says so): use `DataGrid.Row` for such a row, which adds the cell itself.
|
|
3726
|
+
* In a grid with a `virtualWindow` the header stays at the top of the grid's scroll wrapper while
|
|
3727
|
+
* the rows scroll under it, and each header row carries its `aria-rowindex`.
|
|
3437
3728
|
*/
|
|
3438
3729
|
export declare const DataGridHeader: {
|
|
3439
3730
|
({ children, className, ref, ...rest }: DataGridHeaderProps): React_2.JSX.Element;
|
|
@@ -3445,21 +3736,28 @@ export declare const DataGridHeader: {
|
|
|
3445
3736
|
* `<button type="button">` that toggles the sort, followed by the direction glyph (`sortIcon`)
|
|
3446
3737
|
* while its column is sorted; the `<th>` carries `aria-sort`. A consumer `onClick` (on the `<th>`)
|
|
3447
3738
|
* runs before the sort, and calling `preventDefault()` in it cancels the sort (also for
|
|
3448
|
-
* Enter/Space on the button, which click it).
|
|
3739
|
+
* Enter/Space on the button, which click it). In a grid with `resizableColumns`, the header cell
|
|
3740
|
+
* of a column of `columns` (by `columnId`) also holds the column's resize handle, after its
|
|
3741
|
+
* content, along its end edge (the cell is positioned for it); the cell is then named by its
|
|
3742
|
+
* content alone (`aria-labelledby`, unless it has a name of its own), not by the handle's label.
|
|
3743
|
+
* The handle is no target of the grid's navigation: a sortable cell's target stays its sort
|
|
3744
|
+
* button, and F2 on the cell or the button moves focus to the handle.
|
|
3449
3745
|
*/
|
|
3450
3746
|
export declare const DataGridHeaderCell: {
|
|
3451
|
-
({ columnId, sortable, sortIcon, children, className, onClick, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
|
|
3747
|
+
({ columnId, sortable, sortIcon, children, className, onClick, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
|
|
3452
3748
|
displayName: string;
|
|
3453
3749
|
};
|
|
3454
3750
|
|
|
3455
3751
|
/**
|
|
3456
3752
|
* DataGrid.HeaderCell: `root` on the `<th>`; `button` on the sort button; `sortIcon` on its
|
|
3457
|
-
* direction glyph (the default arrow `<svg>`, or the `<span>` of a `sortIcon` slot)
|
|
3753
|
+
* direction glyph (the default arrow `<svg>`, or the `<span>` of a `sortIcon` slot);
|
|
3754
|
+
* `resizeHandle` on the column's resize handle (a `Table.ResizeHandle`, with resizable columns).
|
|
3458
3755
|
*/
|
|
3459
3756
|
export declare const dataGridHeaderCellClassNames: {
|
|
3460
3757
|
readonly root: "wave-data-grid-header-cell";
|
|
3461
3758
|
readonly button: "wave-data-grid-header-cell__button";
|
|
3462
3759
|
readonly sortIcon: "wave-data-grid-header-cell__sort-icon";
|
|
3760
|
+
readonly resizeHandle: "wave-data-grid-header-cell__resize-handle";
|
|
3463
3761
|
};
|
|
3464
3762
|
|
|
3465
3763
|
/** Properties for the DataGridHeaderCell sub-component. */
|
|
@@ -3561,6 +3859,16 @@ export declare interface DataGridLabels {
|
|
|
3561
3859
|
* @default 'Selection'
|
|
3562
3860
|
*/
|
|
3563
3861
|
selectionHeader?: string;
|
|
3862
|
+
/**
|
|
3863
|
+
* Accessible name of each column's resize handle (`resizableColumns`).
|
|
3864
|
+
* @default 'Resize column'
|
|
3865
|
+
*/
|
|
3866
|
+
resizeColumn?: string;
|
|
3867
|
+
/**
|
|
3868
|
+
* Builds the value text of a resize handle (`aria-valuetext`) from the column's width in pixels.
|
|
3869
|
+
* @default (width) => `${width} pixels`
|
|
3870
|
+
*/
|
|
3871
|
+
columnWidth?: (width: number) => string;
|
|
3564
3872
|
}
|
|
3565
3873
|
|
|
3566
3874
|
/**
|
|
@@ -3629,9 +3937,13 @@ declare namespace DataGridRoot {
|
|
|
3629
3937
|
* ancestor, so the rows of a grid nested in a cell
|
|
3630
3938
|
* share it: hovering the outer row also draws the subtle controls of the nested grid (a limit of
|
|
3631
3939
|
* CSS groups). A Tree in a cell keeps its own rows' group.
|
|
3940
|
+
*
|
|
3941
|
+
* In a grid with a `virtualWindow`, a row rendered for an item has the window's `itemSize` as its
|
|
3942
|
+
* height (its own `style` height loses) and carries `aria-rowindex` and `data-row-index`; a header
|
|
3943
|
+
* row carries `aria-rowindex`.
|
|
3632
3944
|
*/
|
|
3633
3945
|
export declare const DataGridRow: {
|
|
3634
|
-
({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
|
|
3946
|
+
({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, style, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
|
|
3635
3947
|
displayName: string;
|
|
3636
3948
|
};
|
|
3637
3949
|
|
|
@@ -3652,7 +3964,9 @@ export declare interface DataGridRowProps extends React_2.HTMLAttributes<HTMLTab
|
|
|
3652
3964
|
* a duplicate warns in development). A selectable grid renders no selection control (and warns
|
|
3653
3965
|
* in development) for a row without it. A row rendered from the grid's `items` (by
|
|
3654
3966
|
* `DataGrid.Body`'s render function or from `columns`) defaults to the item's row id
|
|
3655
|
-
* (`getRowId`).
|
|
3967
|
+
* (`getRowId`). In a grid with `items`, select-all uses the ids from `getRowId`: a row whose
|
|
3968
|
+
* `rowId` differs from its item's id, or is no item's id, is outside it (a development warning
|
|
3969
|
+
* says so), so set `getRowId` rather than a different `rowId`.
|
|
3656
3970
|
*/
|
|
3657
3971
|
rowId?: string;
|
|
3658
3972
|
/**
|
|
@@ -3688,7 +4002,7 @@ export declare interface DataGridRowSelectionCellProps {
|
|
|
3688
4002
|
* (the cell takes focus), and neither a row click (`selectOnRowClick`), Space on a cell nor
|
|
3689
4003
|
* select-all changes the row's selection: select-all skips it, keeps it as it is, and tells its
|
|
3690
4004
|
* state from the other rows. In a header row it disables the select-all checkbox.
|
|
3691
|
-
* @default false
|
|
4005
|
+
* @default false (in a row rendered from `items`: the grid's `isSelectionDisabled` for its item)
|
|
3692
4006
|
*/
|
|
3693
4007
|
disabled?: boolean;
|
|
3694
4008
|
/**
|
|
@@ -3729,6 +4043,8 @@ export declare type DataGridSelectionAppearance = 'brand' | 'neutral' | 'none';
|
|
|
3729
4043
|
* selection cell props of its row (`selectionCellProps`), its own winning. `aria-label`,
|
|
3730
4044
|
* `aria-labelledby` and `aria-describedby` go to the control; the other props, `className` and
|
|
3731
4045
|
* `ref` to the cell. In a grid without selection it renders nothing (with a development warning).
|
|
4046
|
+
* In a body row of a grid with a `virtualWindow` it has no vertical padding (the row has the
|
|
4047
|
+
* window's height) and its control is centred.
|
|
3732
4048
|
*/
|
|
3733
4049
|
export declare const DataGridSelectionCell: {
|
|
3734
4050
|
({ disabled, invisible, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, controlRef, ref, ...rest }: DataGridSelectionCellProps): React_2.JSX.Element | null;
|
|
@@ -4173,8 +4489,11 @@ export declare type DeprecatedPresenceStatus = 'dnd' | 'oof';
|
|
|
4173
4489
|
* closed, so a form keeps what was typed and the components inside keep their state; each open
|
|
4174
4490
|
* focuses the first focusable element again (an `autoFocus` inside never applies), and a kept
|
|
4175
4491
|
* dialog opened while another overlay is open stacks above it.
|
|
4176
|
-
* - **
|
|
4177
|
-
* motion
|
|
4492
|
+
* - **Motion**: the surface scales and fades in and out and the backdrop fades with it (none under
|
|
4493
|
+
* reduced motion); `Dialog.Content`'s `motion` and `backdropMotion` turn each off (`null`) or
|
|
4494
|
+
* replace it, and `WaveProvider motion="none"` turns both off. The surface mounts through the
|
|
4495
|
+
* presence core and renders `data-presence`; while it exits it stays on screen, `inert`, and
|
|
4496
|
+
* focus, the trap and the scroll lock are already released.
|
|
4178
4497
|
* - **Naming**: give `Dialog.Content` a `title`, a `Dialog.Title`, or `aria-label`.
|
|
4179
4498
|
*
|
|
4180
4499
|
* The sub-components are also exported under flat names (`DialogTrigger`, `DialogContent`,
|
|
@@ -4202,7 +4521,7 @@ export declare const Dialog: {
|
|
|
4202
4521
|
displayName: string;
|
|
4203
4522
|
};
|
|
4204
4523
|
Content: {
|
|
4205
|
-
({ title, size, backdrop, closeButton, titleAction, closeLabel, children, className, style, id, onKeyDown, ref, ...rest }: DialogContentProps): React_2.JSX.Element | null;
|
|
4524
|
+
({ title, size, backdrop, motion, backdropMotion, closeButton, titleAction, closeLabel, children, className, style, id, onKeyDown, ref, ...rest }: DialogContentProps): React_2.JSX.Element | null;
|
|
4206
4525
|
displayName: string;
|
|
4207
4526
|
};
|
|
4208
4527
|
Footer: {
|
|
@@ -4267,17 +4586,22 @@ export declare interface DialogCloseRenderProps extends React_2.HTMLAttributes<H
|
|
|
4267
4586
|
* centres the surface and lets presses through to the page. The titles' end padding follows the
|
|
4268
4587
|
* width of the title-actions area (`--wave-dialog-title-end-padding`, 2rem until it is measured).
|
|
4269
4588
|
*
|
|
4270
|
-
* It
|
|
4271
|
-
*
|
|
4272
|
-
*
|
|
4273
|
-
*
|
|
4274
|
-
*
|
|
4275
|
-
* `
|
|
4276
|
-
*
|
|
4277
|
-
*
|
|
4589
|
+
* It moves in and out: the surface scales up from 85% of its size and fades in over 250 ms, and
|
|
4590
|
+
* scales down and fades out over 200 ms, while the backdrop fades in over 250 ms and out with the
|
|
4591
|
+
* surface; a dialog open by default animates in when it mounts in the browser. Under reduced
|
|
4592
|
+
* motion both appear and disappear at once. `motion` (the surface) and `backdropMotion` (the
|
|
4593
|
+
* backdrop) turn each motion off (`null`) or replace its classes, and a `WaveProvider` with
|
|
4594
|
+
* `motion="none"` turns both defaults off. It mounts through the presence core: the backdrop, the
|
|
4595
|
+
* positioner and the surface render `data-presence` (`entering` and `exiting` while the surface's
|
|
4596
|
+
* motion runs, `entered` while open, `exited` while kept closed), and the backdrop and the
|
|
4597
|
+
* positioner are `inert` while exiting and `hidden` and `inert` while kept closed. A closed
|
|
4598
|
+
* surface waits for its motion before it unmounts or hides, while focus, the trap, the isolation
|
|
4599
|
+
* and the scroll lock follow the open state at once: an exiting dialog lets clicks through to the
|
|
4600
|
+
* page (an `inert` element takes no pointer events), and the page's scrollbar comes back while the
|
|
4601
|
+
* dialog still fades. Opened again during its exit, the same surface enters again.
|
|
4278
4602
|
*/
|
|
4279
4603
|
export declare const DialogContent: {
|
|
4280
|
-
({ title, size, backdrop, closeButton, titleAction, closeLabel, children, className, style, id, onKeyDown, ref, ...rest }: DialogContentProps): React_2.JSX.Element | null;
|
|
4604
|
+
({ title, size, backdrop, motion, backdropMotion, closeButton, titleAction, closeLabel, children, className, style, id, onKeyDown, ref, ...rest }: DialogContentProps): React_2.JSX.Element | null;
|
|
4281
4605
|
displayName: string;
|
|
4282
4606
|
};
|
|
4283
4607
|
|
|
@@ -4328,6 +4652,29 @@ export declare interface DialogContentProps extends Omit<React_2.HTMLAttributes<
|
|
|
4328
4652
|
backdrop?: Slot<'div'> | (SlotObject<'div'> & {
|
|
4329
4653
|
appearance?: BackdropAppearance;
|
|
4330
4654
|
});
|
|
4655
|
+
/**
|
|
4656
|
+
* The surface's motion. By default it scales up from 85% of its size and fades in over 250 ms
|
|
4657
|
+
* with a decelerating curve, and scales down and fades out over 200 ms with an accelerating
|
|
4658
|
+
* curve; under reduced motion it appears and disappears at once. `null` turns the motion off
|
|
4659
|
+
* (the surface still renders its `data-presence` phases, which then end at once); a class string
|
|
4660
|
+
* or `{ className }` replaces the default classes with yours (see `MotionSlot`), also under a
|
|
4661
|
+
* `WaveProvider` with `motion="none"`, which otherwise turns the default off. A `className` that
|
|
4662
|
+
* holds `data-[presence=…]` classes while `motion` is unset keeps 0.14's behaviour: no default
|
|
4663
|
+
* motion, your classes animate the surface. Fluent's `Dialog` `surfaceMotion`.
|
|
4664
|
+
* @default the scale and fade above
|
|
4665
|
+
*/
|
|
4666
|
+
motion?: MotionSlot | null;
|
|
4667
|
+
/**
|
|
4668
|
+
* The backdrop's motion. By default it fades in over 250 ms and out over 200 ms, the surface's
|
|
4669
|
+
* exit, with an easy-ease curve; under reduced motion it appears and disappears at once. `null`
|
|
4670
|
+
* turns the motion off; a class string or `{ className }` replaces the default classes with yours
|
|
4671
|
+
* (see `MotionSlot`), also under a `WaveProvider` with `motion="none"`, which otherwise turns the
|
|
4672
|
+
* default off. The surface's motion decides when the dialog unmounts or hides: a replacement
|
|
4673
|
+
* longer than the surface's exit is cut off there. Ignored with `modalType="non-modal"` (a
|
|
4674
|
+
* development warning says so). Fluent's `DialogSurface` `backdropMotion`.
|
|
4675
|
+
* @default the fade above
|
|
4676
|
+
*/
|
|
4677
|
+
backdropMotion?: MotionSlot | null;
|
|
4331
4678
|
/**
|
|
4332
4679
|
* Content of the built-in Close button (the dismiss glyph by default). It renders inside the
|
|
4333
4680
|
* button, decorative (`aria-hidden`), so the button keeps the name `closeLabel`; a slot object's
|
|
@@ -4456,13 +4803,13 @@ export declare interface DialogProps {
|
|
|
4456
4803
|
*/
|
|
4457
4804
|
finalFocusRef?: React_2.RefObject<HTMLElement | null>;
|
|
4458
4805
|
/**
|
|
4459
|
-
* Removes `Dialog.Content` (the surface and everything in it) when the dialog closes
|
|
4460
|
-
* keeps it mounted while closed, `hidden` and `inert`, so a form
|
|
4461
|
-
* the components inside keep their state; the surface then
|
|
4462
|
-
* the browser only, as an open one), and an `autoFocus`
|
|
4463
|
-
* focuses the first focusable element). A popup opened inside
|
|
4464
|
-
* dialog closes stays open over the page (a development warning says
|
|
4465
|
-
* Fluent's `unmountOnClose`.
|
|
4806
|
+
* Removes `Dialog.Content` (the surface and everything in it) when the dialog closes, once its
|
|
4807
|
+
* exit motion has ended. `false` keeps it mounted while closed, `hidden` and `inert`, so a form
|
|
4808
|
+
* inside keeps what was typed and the components inside keep their state; the surface then
|
|
4809
|
+
* mounts with the Dialog, closed (in the browser only, as an open one), and an `autoFocus`
|
|
4810
|
+
* inside it never applies (each open focuses the first focusable element). A popup opened inside
|
|
4811
|
+
* that is still open when the dialog closes stays open over the page (a development warning says
|
|
4812
|
+
* so): close it first. Fluent's `unmountOnClose`.
|
|
4466
4813
|
* @default true
|
|
4467
4814
|
*/
|
|
4468
4815
|
unmountOnClose?: boolean;
|
|
@@ -4693,13 +5040,28 @@ export declare type DividerProps<C extends React_2.ElementType = 'hr'> = Polymor
|
|
|
4693
5040
|
* each open of an overlay focuses the first focusable element again (an `autoFocus` inside never
|
|
4694
5041
|
* applies), and a kept overlay opened while another overlay is open stacks above it. A kept
|
|
4695
5042
|
* inline drawer is in the server HTML, hidden.
|
|
5043
|
+
* - **Motion**: an overlay panel slides in from its edge and fades in, and slides back and fades
|
|
5044
|
+
* out, over 250 ms (`small`), 300 ms (`medium`), 400 ms (`large`) or 500 ms (`full`), and its
|
|
5045
|
+
* backdrop fades with it; an overlay open by default animates in when it mounts in the browser.
|
|
5046
|
+
* An inline drawer opens and closes the space it takes in the layout over the same durations,
|
|
5047
|
+
* its panel held at its size and fading, so it reads as sliding out from its edge; one open by
|
|
5048
|
+
* default does not animate in, and one at `full` has no motion (a percentage width in
|
|
5049
|
+
* `className` resizes oddly during the motion: give it a length, or pass `motion={null}`).
|
|
5050
|
+
* Under reduced motion every drawer appears and disappears at once. `motion` (the panel, or an
|
|
5051
|
+
* inline drawer's space) and `backdropMotion` (the backdrop) turn each off (`null`) or replace
|
|
5052
|
+
* it, and `WaveProvider motion="none"` turns both defaults off. `data-[presence=…]:` classes in
|
|
5053
|
+
* `className` keep 0.14's behaviour: no default motion, they animate the panel.
|
|
4696
5054
|
* - **Presence**: the panel and the backdrop mount through the presence core and render
|
|
4697
|
-
* `data-presence` (`
|
|
4698
|
-
*
|
|
4699
|
-
*
|
|
4700
|
-
*
|
|
4701
|
-
*
|
|
4702
|
-
*
|
|
5055
|
+
* `data-presence` (`entering` and `exiting` while the drawer's motion runs, `entered` while
|
|
5056
|
+
* open, `exited` while kept closed). An inline drawer's `<aside>` is the only child of an
|
|
5057
|
+
* element of its own (`wave-drawer__collapse`), which renders the same phases, carries the
|
|
5058
|
+
* inline motion and has no box while open, so the `<aside>` lays out in your page as without
|
|
5059
|
+
* it. The backdrop and the panel (an inline drawer's `<aside>` and the element around it) are
|
|
5060
|
+
* `inert` while exiting and `hidden` and `inert` while kept closed. A closed drawer waits for
|
|
5061
|
+
* its motion (the panel's, an inline one's on the element around it) before it unmounts or
|
|
5062
|
+
* hides, while focus, the trap, the isolation and the scroll lock follow the open state at
|
|
5063
|
+
* once: an exiting overlay lets clicks through to the page (an `inert` element takes no pointer
|
|
5064
|
+
* events). Opened again during its exit, the same panel enters again.
|
|
4703
5065
|
*
|
|
4704
5066
|
* The sub-components are also exported under flat names (`DrawerTrigger`, `DrawerClose`,
|
|
4705
5067
|
* `DrawerTitle`, `DrawerHeader`, `DrawerHeaderTitle`, `DrawerHeaderNavigation`, `DrawerBody`,
|
|
@@ -4720,7 +5082,7 @@ export declare type DividerProps<C extends React_2.ElementType = 'hr'> = Polymor
|
|
|
4720
5082
|
* </Drawer>
|
|
4721
5083
|
*/
|
|
4722
5084
|
export declare const Drawer: {
|
|
4723
|
-
({ open: openProp, defaultOpen, onOpenChange, type, separator, position, size, modalType, backdrop, closeButton, titleAction, title, closeLabel, finalFocusRef, unmountOnClose, children, id, ref, ...rest }: DrawerProps): JSX.Element;
|
|
5085
|
+
({ open: openProp, defaultOpen, onOpenChange, type, separator, position, size, modalType, backdrop, motion, backdropMotion, closeButton, titleAction, title, closeLabel, finalFocusRef, unmountOnClose, children, id, ref, ...rest }: DrawerProps): JSX.Element;
|
|
4724
5086
|
displayName: string;
|
|
4725
5087
|
} & {
|
|
4726
5088
|
Trigger: {
|
|
@@ -4790,16 +5152,19 @@ export declare interface DrawerBodyProps extends React_2.HTMLAttributes<HTMLDivE
|
|
|
4790
5152
|
/**
|
|
4791
5153
|
* Drawer: `root` on the panel (the portaled `role="dialog"` element of an overlay drawer, while it
|
|
4792
5154
|
* is open or kept mounted, or the `<aside>` of an inline one); `backdrop` on the backdrop of a
|
|
4793
|
-
* modal or alert overlay drawer; `
|
|
4794
|
-
*
|
|
4795
|
-
*
|
|
4796
|
-
*
|
|
4797
|
-
*
|
|
4798
|
-
*
|
|
5155
|
+
* modal or alert overlay drawer; `collapse` on the element around an inline drawer's panel (its
|
|
5156
|
+
* only child), which carries the presence phases and the motion of an inline drawer; `header` on
|
|
5157
|
+
* the built-in header row (absent with a Drawer.Header); `titleAction` on the element of the
|
|
5158
|
+
* `titleAction` slot in that row; `closeButton` on every built-in Close button (which also
|
|
5159
|
+
* carries Button's root), in the built-in header and in each Drawer.HeaderTitle; `body` on the
|
|
5160
|
+
* scrolling body. The heading of its `title` prop carries Drawer.Title's class. The panel carries
|
|
5161
|
+
* `data-type`, `data-position` and `data-size`; the body, the header and the footer carry
|
|
5162
|
+
* `data-scroll-state`.
|
|
4799
5163
|
*/
|
|
4800
5164
|
export declare const drawerClassNames: {
|
|
4801
5165
|
readonly root: "wave-drawer";
|
|
4802
5166
|
readonly backdrop: "wave-drawer__backdrop";
|
|
5167
|
+
readonly collapse: "wave-drawer__collapse";
|
|
4803
5168
|
readonly header: "wave-drawer__header";
|
|
4804
5169
|
readonly titleAction: "wave-drawer__title-action";
|
|
4805
5170
|
readonly closeButton: "wave-drawer__close-button";
|
|
@@ -5057,7 +5422,10 @@ export declare interface DrawerProps extends Omit<React_2.HTMLAttributes<HTMLEle
|
|
|
5057
5422
|
* viewport's width — or its height at the bottom (the same values; `full` the viewport's height).
|
|
5058
5423
|
* It never exceeds the viewport. An inline panel takes the same sizes, where `full` is its
|
|
5059
5424
|
* container's width (height), and never grows past its container. A width class in `className`
|
|
5060
|
-
* (a height class for `bottom`) replaces it.
|
|
5425
|
+
* (a height class for `bottom`) replaces it. It also times the motion, an overlay's slide and an
|
|
5426
|
+
* inline drawer's collapse alike: 250 ms small, 300 ms medium, 400 ms large, 500 ms full (an
|
|
5427
|
+
* inline drawer at `full` has no motion; see `motion`). Rendered as `data-size`. Fluent's
|
|
5428
|
+
* `size`.
|
|
5061
5429
|
* @default 'small'
|
|
5062
5430
|
*/
|
|
5063
5431
|
size?: DrawerSize;
|
|
@@ -5091,6 +5459,43 @@ export declare interface DrawerProps extends Omit<React_2.HTMLAttributes<HTMLEle
|
|
|
5091
5459
|
backdrop?: Slot<'div'> | (SlotObject<'div'> & {
|
|
5092
5460
|
appearance?: BackdropAppearance;
|
|
5093
5461
|
});
|
|
5462
|
+
/**
|
|
5463
|
+
* The drawer's motion. By default an overlay panel slides in from beyond its edge and fades in
|
|
5464
|
+
* with a decelerating curve, and slides back out and fades out with an accelerating curve; the
|
|
5465
|
+
* `start` and `end` edges follow the text direction, `left` and `right` do not mirror, and a
|
|
5466
|
+
* `bottom` panel rises from below. An inline drawer by default opens the space it takes in your
|
|
5467
|
+
* layout from nothing (its width at a side, its height at the bottom) while its panel fades in,
|
|
5468
|
+
* held at its size against its inner edge, so it reads as sliding out from that edge, with a
|
|
5469
|
+
* decelerating curve; closing runs the same backwards with an accelerating curve. Both take a
|
|
5470
|
+
* duration that follows `size` both ways: 250 ms small, 300 ms medium, 400 ms large, 500 ms
|
|
5471
|
+
* full. An inline drawer at `full` has no motion, as its size is its container's (a value here
|
|
5472
|
+
* does not apply to it either), and an inline drawer whose width (height at the bottom) in
|
|
5473
|
+
* `className` is a percentage resizes oddly during the motion, correctly once open: give it a
|
|
5474
|
+
* length, or pass `null`. Under reduced motion the drawer appears and disappears at once.
|
|
5475
|
+
* `null` turns the motion off (the drawer still renders its `data-presence` phases, which then
|
|
5476
|
+
* end at once); a class string or `{ className }` replaces the default classes with yours (see
|
|
5477
|
+
* `MotionSlot`), also under a `WaveProvider` with `motion="none"`, which otherwise turns the
|
|
5478
|
+
* default off. They go on the overlay panel, or on the element around an inline drawer's
|
|
5479
|
+
* `<aside>` (`wave-drawer__collapse`), whose phases the drawer waits for. A `className` that
|
|
5480
|
+
* holds `data-[presence=…]` classes while `motion` is unset keeps 0.14's behaviour: no default
|
|
5481
|
+
* motion, your classes animate the panel, and the drawer waits for the panel's motion (an
|
|
5482
|
+
* inline one's `<aside>`, not the element around it). Fluent's `OverlayDrawer` and
|
|
5483
|
+
* `InlineDrawer` `surfaceMotion`.
|
|
5484
|
+
* @default the slide (overlay) or the collapse (inline) above
|
|
5485
|
+
*/
|
|
5486
|
+
motion?: MotionSlot | null;
|
|
5487
|
+
/**
|
|
5488
|
+
* The backdrop's motion (a modal or alert overlay). By default it fades in and out with a
|
|
5489
|
+
* linear curve over the panel's duration (250 to 500 ms, by `size`), so it ends with the panel;
|
|
5490
|
+
* under reduced motion it appears and disappears at once. `null` turns the motion off; a class
|
|
5491
|
+
* string or `{ className }` replaces the default classes with yours (see `MotionSlot`), also
|
|
5492
|
+
* under a `WaveProvider` with `motion="none"`, which otherwise turns the default off. The
|
|
5493
|
+
* panel's motion decides when the drawer unmounts or hides: a replacement longer than the
|
|
5494
|
+
* panel's exit is cut off there. Ignored with `modalType="non-modal"` and by an inline drawer
|
|
5495
|
+
* (a development warning says so). Fluent's `OverlayDrawer` `backdropMotion`.
|
|
5496
|
+
* @default the fade above
|
|
5497
|
+
*/
|
|
5498
|
+
backdropMotion?: MotionSlot | null;
|
|
5094
5499
|
/**
|
|
5095
5500
|
* Content of the built-in Close button, in the built-in header and in every
|
|
5096
5501
|
* `Drawer.HeaderTitle`, as `Dialog.Content`'s `closeButton`: decorative content inside the button
|
|
@@ -5136,16 +5541,17 @@ export declare interface DrawerProps extends Omit<React_2.HTMLAttributes<HTMLEle
|
|
|
5136
5541
|
*/
|
|
5137
5542
|
finalFocusRef?: React_2.RefObject<HTMLElement | null>;
|
|
5138
5543
|
/**
|
|
5139
|
-
* Removes the panel and its content when the drawer closes
|
|
5140
|
-
* closed, `hidden` and `inert` (out of the layout, the
|
|
5141
|
-
* what was typed and the state of the components
|
|
5142
|
-
* content then mounts with the Drawer, closed, and
|
|
5143
|
-
* overlay focuses its first focusable element on each
|
|
5144
|
-
* in the browser; a kept inline panel is in the
|
|
5145
|
-
* to its form: a `required` empty field in a
|
|
5146
|
-
* its submission without a visible message. A
|
|
5147
|
-
* drawer closes stays open over the page (a
|
|
5148
|
-
* `key` on the Drawer resets the kept content.
|
|
5544
|
+
* Removes the panel and its content when the drawer closes, once the panel's exit motion has
|
|
5545
|
+
* ended. `false` keeps them mounted while closed, `hidden` and `inert` (out of the layout, the
|
|
5546
|
+
* Tab order and the accessibility tree), so what was typed and the state of the components
|
|
5547
|
+
* inside survive closing and opening again; the content then mounts with the Drawer, closed, and
|
|
5548
|
+
* an `autoFocus` inside it never applies (an overlay focuses its first focusable element on each
|
|
5549
|
+
* open). An overlay panel still renders only in the browser; a kept inline panel is in the
|
|
5550
|
+
* server HTML, hidden. Kept content still belongs to its form: a `required` empty field in a
|
|
5551
|
+
* closed inline drawer inside a page `<form>` blocks its submission without a visible message. A
|
|
5552
|
+
* popup opened inside that is still open when the drawer closes stays open over the page (a
|
|
5553
|
+
* development warning says so): close it first. A `key` on the Drawer resets the kept content.
|
|
5554
|
+
* Fluent's `unmountOnClose`.
|
|
5149
5555
|
* @default true
|
|
5150
5556
|
*/
|
|
5151
5557
|
unmountOnClose?: boolean;
|
|
@@ -5306,6 +5712,14 @@ export declare type DrawerType = 'overlay' | 'inline';
|
|
|
5306
5712
|
* `clearable` then clears every value. A non-literal `multiselect={flag}` is a type error: render
|
|
5307
5713
|
* two elements, one for each mode.
|
|
5308
5714
|
*
|
|
5715
|
+
* **Data mode**: `items` passes the options as data instead of children. The open list renders an
|
|
5716
|
+
* option per item (`renderOption` draws it, an `Option` with the item's label by default) and the
|
|
5717
|
+
* closed list none; the keys, typeahead and the button's text follow the data, and each option
|
|
5718
|
+
* carries `aria-posinset` and `aria-setsize`. A long list takes a `virtualWindow` (from
|
|
5719
|
+
* `useVirtualWindow({ itemSize })`): the open list then renders only the options in view, plus an
|
|
5720
|
+
* overscan, with spacers for the others, every option `itemSize` tall; the active option stays
|
|
5721
|
+
* rendered, and opening scrolls it to the middle of the list.
|
|
5722
|
+
*
|
|
5309
5723
|
* The `<button>` receives `id`, `aria-label`, `aria-labelledby`, `aria-describedby`,
|
|
5310
5724
|
* `aria-invalid`, `aria-required`, `aria-errormessage`, `aria-details`, `tabIndex`, `autoFocus`
|
|
5311
5725
|
* and `onFocus`/`onBlur`/`onKeyDown`/`onKeyUp`. `ref`, `className`, `style`, other `aria-*`
|
|
@@ -5330,7 +5744,9 @@ export declare const Dropdown: DropdownComponent;
|
|
|
5330
5744
|
/**
|
|
5331
5745
|
* Dropdown: `root` on the outer element; `button` on the `role="combobox"` button; `value` on the
|
|
5332
5746
|
* value or placeholder span; `expandIcon` on the chevron `<svg>`; `clearButton` on the clear
|
|
5333
|
-
* button; `listbox` on the `role="listbox"` list; `surface` on its portaled popup
|
|
5747
|
+
* button; `listbox` on the `role="listbox"` list; `surface` on its portaled popup; `spacer` on
|
|
5748
|
+
* each spacer element of the list with a `virtualWindow` (the elements that stand in for the
|
|
5749
|
+
* options that are not rendered).
|
|
5334
5750
|
*/
|
|
5335
5751
|
export declare const dropdownClassNames: {
|
|
5336
5752
|
readonly root: "wave-dropdown";
|
|
@@ -5340,6 +5756,7 @@ export declare const dropdownClassNames: {
|
|
|
5340
5756
|
readonly clearButton: "wave-dropdown__clear-button";
|
|
5341
5757
|
readonly listbox: "wave-dropdown__listbox";
|
|
5342
5758
|
readonly surface: "wave-dropdown__surface";
|
|
5759
|
+
readonly spacer: "wave-dropdown__spacer";
|
|
5343
5760
|
};
|
|
5344
5761
|
|
|
5345
5762
|
/** The Dropdown component's type: a multi-select signature, then the single-select one. */
|
|
@@ -5517,6 +5934,50 @@ export declare interface DropdownProps<M extends boolean = false> extends Omit<R
|
|
|
5517
5934
|
* announcements, for localization. Unset members keep their English defaults.
|
|
5518
5935
|
*/
|
|
5519
5936
|
labels?: DropdownLabels;
|
|
5937
|
+
/**
|
|
5938
|
+
* Data mode: the options as data, in list order (`value`, `label`, and optionally `textValue`,
|
|
5939
|
+
* `disabled` and `hidden`; values unique). The open list renders one option per item that is
|
|
5940
|
+
* not `hidden` (see `renderOption`); the closed list renders none. The keys, typeahead, the
|
|
5941
|
+
* selection and the button's label text follow `items`, also for a selected item whose option
|
|
5942
|
+
* is not rendered. The children are neither read nor rendered: passing both warns once in
|
|
5943
|
+
* development. Each option gets `aria-posinset` and `aria-setsize` from its place among the
|
|
5944
|
+
* shown items, and keeps one id per value. Without it, the options are the `Option` children.
|
|
5945
|
+
*/
|
|
5946
|
+
items?: readonly ListboxItem[];
|
|
5947
|
+
/**
|
|
5948
|
+
* Data mode: renders the option of an item, given its state (`selected`, `active`, and `index`
|
|
5949
|
+
* among the shown options). Return an `Option`, or an option component of your own on
|
|
5950
|
+
* `useListboxOption`, with the item's `value` (and its `disabled`); its position is set for you,
|
|
5951
|
+
* and in a windowed list (`virtualWindow`) its height. It is called again only when the item, its
|
|
5952
|
+
* state, its position (`aria-posinset` and `aria-setsize`, which new `items` change) or the
|
|
5953
|
+
* function itself changes, so pass a stable function in a long list. Ignored without `items`,
|
|
5954
|
+
* with a development warning.
|
|
5955
|
+
* @default an `Option` with the item's `value`, `label` (also its text), `textValue` and `disabled`
|
|
5956
|
+
*/
|
|
5957
|
+
renderOption?: (item: ListboxItem, state: ListboxOptionRenderState) => React_2.ReactNode;
|
|
5958
|
+
/**
|
|
5959
|
+
* Data mode: renders only the options in view of a long list, plus an overscan, and spacers
|
|
5960
|
+
* (`aria-hidden`, `data-virtual-spacer`) as tall as the options they stand for: pass the result
|
|
5961
|
+
* of `useVirtualWindow({ itemSize })`, or an object of your own that implements `VirtualWindow`.
|
|
5962
|
+
* It needs `items`: without them, or beside `OptionGroup` children, it is ignored with a
|
|
5963
|
+
* development warning (a window renders a flat list).
|
|
5964
|
+
*
|
|
5965
|
+
* The open popup's list is the window's scroller, so it needs no height of yours: it scrolls
|
|
5966
|
+
* within its own maximum height (15rem, 240 pixels at the default root size, less where the
|
|
5967
|
+
* viewport has no room). Every option is exactly `itemSize` tall (the list sets its height,
|
|
5968
|
+
* after the option's own `style`), so an option's content must fit in it: the default `Option`
|
|
5969
|
+
* with one line of text is 32 pixels tall.
|
|
5970
|
+
*
|
|
5971
|
+
* The window counts the shown options (the items that are not `hidden`). The keys and typeahead
|
|
5972
|
+
* move over all of them (Home and End to the first and the last, PageUp and PageDown by ten); the
|
|
5973
|
+
* active option stays rendered while it is scrolled away, so `aria-activedescendant` always names
|
|
5974
|
+
* an element, and when a key makes it active the list and the window move to it in the same
|
|
5975
|
+
* update. Opening the list scrolls the active option (the selected one, by default) to the
|
|
5976
|
+
* middle of the list, and again once the popup's positioning has given the list its height (a
|
|
5977
|
+
* short viewport) unless it was scrolled first. A closed list renders no option. The browser's
|
|
5978
|
+
* scroll anchoring is off on a windowed list (the window lays the options out).
|
|
5979
|
+
*/
|
|
5980
|
+
virtualWindow?: VirtualWindow;
|
|
5520
5981
|
/** Called when the `<button role="combobox">` receives focus (the root keeps other handlers). */
|
|
5521
5982
|
onFocus?: React_2.FocusEventHandler<HTMLButtonElement>;
|
|
5522
5983
|
/** Called when the `<button role="combobox">` loses focus. */
|
|
@@ -5912,6 +6373,231 @@ export declare interface FieldProps extends React_2.HTMLAttributes<HTMLDivElemen
|
|
|
5912
6373
|
*/
|
|
5913
6374
|
export declare type FirstWeekOfYear = 'first-day' | 'first-full-week' | 'first-four-day-week';
|
|
5914
6375
|
|
|
6376
|
+
/**
|
|
6377
|
+
* A tree built from flat data (WAI-ARIA Tree View pattern) that can render only the items in
|
|
6378
|
+
* view, for trees of thousands of items. Its model comes from `useFlatTree(items, options)`: items
|
|
6379
|
+
* listed with a `parentValue`, in any order, the expanded and the checked state. The tree renders
|
|
6380
|
+
* the visible items (the roots and the children of every expanded branch) as sibling
|
|
6381
|
+
* `role="treeitem"` elements with `aria-level`, `aria-setsize` and `aria-posinset` from the data,
|
|
6382
|
+
* `aria-expanded` on branches, and the nested `Tree`'s chevron, checkbox and radio.
|
|
6383
|
+
*
|
|
6384
|
+
* ```tsx
|
|
6385
|
+
* const model = useFlatTree(items, { defaultExpandedItems: ['docs'] });
|
|
6386
|
+
* const virtualWindow = useVirtualWindow({ itemSize: 28 });
|
|
6387
|
+
* <FlatTree aria-label="Files" model={model} {...model.getTreeProps()} virtualWindow={virtualWindow} style={{ height: 400 }} />
|
|
6388
|
+
* ```
|
|
6389
|
+
*
|
|
6390
|
+
* Windowing: with `virtualWindow` the tree is the scrolling element (it needs a bounded height),
|
|
6391
|
+
* renders the items in view plus the window's overscan and spacers for the others, and every item
|
|
6392
|
+
* is exactly the window's `itemSize` tall. The server renders the first window. Keys move over the
|
|
6393
|
+
* whole visible list, scrolling an item that is not rendered into view before focusing it, and the
|
|
6394
|
+
* focused item stays rendered (and focused) while it is scrolled away.
|
|
6395
|
+
*
|
|
6396
|
+
* Keyboard: a single tab stop, on the focused item while focus is inside, else on the `selected`
|
|
6397
|
+
* item while it is visible, else on the first enabled item; Tab leaves the tree. Up/Down move
|
|
6398
|
+
* between the visible items, Home/End to the first and last, Right expands a collapsed branch or
|
|
6399
|
+
* moves to its first child, Left collapses an expanded branch or moves to the parent (both
|
|
6400
|
+
* mirrored in right-to-left layouts), Enter activates (and toggles a branch), and so does Space
|
|
6401
|
+
* unless the tree has checkboxes, `*` expands the sibling branches, and typing moves to the next
|
|
6402
|
+
* visible item whose label starts with the typed text (items under a collapsed branch are not
|
|
6403
|
+
* searched). The focused item stays the focused item (rendered, and the tab stop) while focus is
|
|
6404
|
+
* in a popup that its content opened, such as a menu in a portal, so the popup can return focus
|
|
6405
|
+
* to it.
|
|
6406
|
+
*
|
|
6407
|
+
* Selection, as the nested `Tree`: `selected` and `onItemSelect` (single selection and activation,
|
|
6408
|
+
* with radios in `selectionMode="single"`), `current`, and with `selectionMode="multiple"` a
|
|
6409
|
+
* checkbox on every item bound to the model's `checkedItems` (Space or a click on the checkbox
|
|
6410
|
+
* toggles it, and checks cascade). An item whose data is `disabled` is `aria-disabled`, is skipped
|
|
6411
|
+
* by the keys and typeahead, never holds the tab stop (except while a pointer press has focused
|
|
6412
|
+
* it), and is neither activated, expanded nor checked by the user (a check of its parent still
|
|
6413
|
+
* includes it).
|
|
6414
|
+
*
|
|
6415
|
+
* When a branch collapses around the focused item (from code), focus moves to that branch, so it
|
|
6416
|
+
* never falls to the page. Items expand and collapse at once, without motion: there is no child
|
|
6417
|
+
* group to animate. A selected item under a collapsed branch is not the tab stop until it is
|
|
6418
|
+
* visible again.
|
|
6419
|
+
*
|
|
6420
|
+
* `FlatTree.Item` is the row the tree renders for each visible item (it is not written by hand);
|
|
6421
|
+
* it is also exported as `FlatTreeItem` for React Server Components, which cannot use the dotted
|
|
6422
|
+
* form.
|
|
6423
|
+
*/
|
|
6424
|
+
export declare const FlatTree: {
|
|
6425
|
+
({ model, virtualWindow, renderItem, selectionMode: selectionModeProp, selected, current, onItemSelect, className, onKeyDown, onFocus, onBlur, onPointerDownCapture, ref, ...rest }: FlatTreeProps): React_2.JSX.Element;
|
|
6426
|
+
displayName: string;
|
|
6427
|
+
} & {
|
|
6428
|
+
Item: {
|
|
6429
|
+
({ item: row, children, className, style, onClick, ref, ...rest }: FlatTreeItemProps): React_2.JSX.Element;
|
|
6430
|
+
displayName: string;
|
|
6431
|
+
};
|
|
6432
|
+
};
|
|
6433
|
+
|
|
6434
|
+
/**
|
|
6435
|
+
* FlatTree: `root` on the `role="tree"` element (the scrolling element of a tree with a
|
|
6436
|
+
* `virtualWindow`); `spacer` on each spacer element of a windowed tree (the elements that stand in
|
|
6437
|
+
* for the items that are not rendered, 0.16).
|
|
6438
|
+
*/
|
|
6439
|
+
export declare const flatTreeClassNames: {
|
|
6440
|
+
readonly root: "wave-flat-tree";
|
|
6441
|
+
readonly spacer: "wave-flat-tree__spacer";
|
|
6442
|
+
};
|
|
6443
|
+
|
|
6444
|
+
/**
|
|
6445
|
+
* One row of a FlatTree, rendered by the tree for each visible item of its model (it is not
|
|
6446
|
+
* written by hand): a `role="treeitem"` element with the item's level, set size and position,
|
|
6447
|
+
* `aria-expanded` on a branch, and the expand chevron, the checkbox (multiple mode) or the radio
|
|
6448
|
+
* (single mode) of the nested `Tree`'s items, before the content. Levels are drawn by indenting
|
|
6449
|
+
* the row, since the items are siblings. In a windowed tree it is exactly the window's `itemSize`
|
|
6450
|
+
* tall.
|
|
6451
|
+
*
|
|
6452
|
+
* `ref`, `className` and the other props land on the treeitem element; its `onClick` receives the
|
|
6453
|
+
* clicks on the row, not those on the checkbox, and runs before the built-in activation (call
|
|
6454
|
+
* `event.preventDefault()` to skip it).
|
|
6455
|
+
*/
|
|
6456
|
+
export declare const FlatTreeItem: {
|
|
6457
|
+
({ item: row, children, className, style, onClick, ref, ...rest }: FlatTreeItemProps): React_2.JSX.Element;
|
|
6458
|
+
displayName: string;
|
|
6459
|
+
};
|
|
6460
|
+
|
|
6461
|
+
/**
|
|
6462
|
+
* FlatTree.Item: `root` on the `role="treeitem"` element; `row` on its row; `expandIcon` on the
|
|
6463
|
+
* chevron of a branch; `indicator` on the checkbox of a multi-select tree or the radio of a
|
|
6464
|
+
* single-select one; `label` on the span around the item's content (0.16).
|
|
6465
|
+
*/
|
|
6466
|
+
export declare const flatTreeItemClassNames: {
|
|
6467
|
+
readonly root: "wave-flat-tree-item";
|
|
6468
|
+
readonly row: "wave-flat-tree-item__row";
|
|
6469
|
+
readonly expandIcon: "wave-flat-tree-item__expand-icon";
|
|
6470
|
+
readonly indicator: "wave-flat-tree-item__indicator";
|
|
6471
|
+
readonly label: "wave-flat-tree-item__label";
|
|
6472
|
+
};
|
|
6473
|
+
|
|
6474
|
+
/** One item of a flat tree: `parentValue` places it, items are listed in any order. */
|
|
6475
|
+
export declare interface FlatTreeItemData {
|
|
6476
|
+
/** The item's identity; it must be unique among the items (a later duplicate is ignored). */
|
|
6477
|
+
value: string;
|
|
6478
|
+
/** The `value` of the item this one is nested in; absent for a root. */
|
|
6479
|
+
parentValue?: string;
|
|
6480
|
+
/**
|
|
6481
|
+
* `'branch'` marks an item that can expand even while it has no child items (children loaded
|
|
6482
|
+
* on demand). An item with child items is a branch whatever its type says.
|
|
6483
|
+
*/
|
|
6484
|
+
itemType?: 'leaf' | 'branch';
|
|
6485
|
+
/** The text the item shows. */
|
|
6486
|
+
label?: string;
|
|
6487
|
+
/**
|
|
6488
|
+
* Whether the item is disabled. `FlatTree` reads it (the keys and typeahead skip the item, it is
|
|
6489
|
+
* not the tab stop, and the user cannot activate, expand or check it); the model ignores it:
|
|
6490
|
+
* `expand`, `collapse`, `toggle` and `setChecked` change a disabled item too, and a check of its
|
|
6491
|
+
* parent includes it.
|
|
6492
|
+
*/
|
|
6493
|
+
disabled?: boolean;
|
|
6494
|
+
}
|
|
6495
|
+
|
|
6496
|
+
/** Properties for the FlatTreeItem sub-component. */
|
|
6497
|
+
export declare interface FlatTreeItemProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
6498
|
+
/** The row the item shows: a visible item of the tree's model (`model.visibleItems`). */
|
|
6499
|
+
item: VisibleFlatItem & {
|
|
6500
|
+
checked?: CheckState;
|
|
6501
|
+
};
|
|
6502
|
+
/** The item's content: what the tree's `renderItem` returns, else the item's label. */
|
|
6503
|
+
children?: React_2.ReactNode;
|
|
6504
|
+
/** Ref to the `role="treeitem"` element. */
|
|
6505
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
6506
|
+
}
|
|
6507
|
+
|
|
6508
|
+
/** The state and the visible rows of a flat tree, from {@link useFlatTree}. */
|
|
6509
|
+
export declare interface FlatTreeModel {
|
|
6510
|
+
/**
|
|
6511
|
+
* The rows to show: the roots and the children of every expanded branch, in tree order. With
|
|
6512
|
+
* `selectionMode: 'multiple'` each row has its `checked` state. The array and its rows keep
|
|
6513
|
+
* their identity until the items, the expanded set or the checked set change.
|
|
6514
|
+
*/
|
|
6515
|
+
visibleItems: readonly (VisibleFlatItem & {
|
|
6516
|
+
checked?: CheckState;
|
|
6517
|
+
})[];
|
|
6518
|
+
/** The visible row of `value`; `undefined` for an item under a collapsed branch or an unknown value. */
|
|
6519
|
+
getItem(value: string): (VisibleFlatItem & {
|
|
6520
|
+
checked?: CheckState;
|
|
6521
|
+
}) | undefined;
|
|
6522
|
+
/**
|
|
6523
|
+
* Expands `value`, or every value of a list in one change (one `onExpandedItemsChange` call, as
|
|
6524
|
+
* `*` on a tree item makes). Nothing happens, and nothing is called, if every value is already in
|
|
6525
|
+
* the expanded set.
|
|
6526
|
+
*/
|
|
6527
|
+
expand(value: string | readonly string[]): void;
|
|
6528
|
+
/** Collapses `value`. Nothing happens, and nothing is called, if it is not in the expanded set. */
|
|
6529
|
+
collapse(value: string): void;
|
|
6530
|
+
/** Expands `value` when it is collapsed and collapses it when it is expanded. */
|
|
6531
|
+
toggle(value: string): void;
|
|
6532
|
+
/** Whether `value` is a branch (an item with child items, or typed `'branch'`) in the expanded set. */
|
|
6533
|
+
isExpanded(value: string): boolean;
|
|
6534
|
+
/**
|
|
6535
|
+
* Sets the check state of `value`, with the cascade of the nested `Tree`: the item and everything
|
|
6536
|
+
* nested in it, then its ancestors from their children. Nothing is called when the item is
|
|
6537
|
+
* already in that state; a mixed item is set to `checked` as requested. A value that matches no
|
|
6538
|
+
* item is added to, or removed from, the checked list. `event` becomes `details.event` of
|
|
6539
|
+
* `onCheckedItemsChange`; without it the callback gets no `details`. It works in any
|
|
6540
|
+
* `selectionMode` (the rows carry `checked` only with `'multiple'`), and on a disabled item too.
|
|
6541
|
+
*/
|
|
6542
|
+
setChecked(value: string, checked: boolean, event?: Event): void;
|
|
6543
|
+
/** The props `FlatTree` takes from the model, for `<FlatTree model={model} {...model.getTreeProps()} />`. */
|
|
6544
|
+
getTreeProps(): {
|
|
6545
|
+
selectionMode: 'none' | SelectionMode_2;
|
|
6546
|
+
};
|
|
6547
|
+
}
|
|
6548
|
+
|
|
6549
|
+
/** Properties for the FlatTree component. */
|
|
6550
|
+
export declare interface FlatTreeProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'children' | 'onSelect'> {
|
|
6551
|
+
/** The tree's model, from `useFlatTree`: the visible rows, the expanded and the checked state. */
|
|
6552
|
+
model: FlatTreeModel;
|
|
6553
|
+
/**
|
|
6554
|
+
* Renders only the items in view (and a few beyond), from `useVirtualWindow({ itemSize })`. The
|
|
6555
|
+
* tree is then the scrolling element: give it a bounded height (a class or a style). Every item
|
|
6556
|
+
* is exactly `itemSize` pixels tall, so its content must fit in one row. Without it every visible
|
|
6557
|
+
* item is rendered.
|
|
6558
|
+
*
|
|
6559
|
+
* The tree element is then no tab stop of its own while an item is (`tabIndex` -1, as Firefox
|
|
6560
|
+
* would stop on a scroller; a `tabIndex` you pass wins), and the browser's scroll anchoring is
|
|
6561
|
+
* off on it (the window lays the items out): when rows are inserted or removed above the focused
|
|
6562
|
+
* item while it is in view (`*`, or a change of the model from code), the tree moves the view
|
|
6563
|
+
* with it, so it stays where it was.
|
|
6564
|
+
*/
|
|
6565
|
+
virtualWindow?: VirtualWindow;
|
|
6566
|
+
/**
|
|
6567
|
+
* The content of an item, from its row: the item data with its level, position, set size,
|
|
6568
|
+
* expanded state and, in multiple mode, its check state. Called for the rendered items only.
|
|
6569
|
+
* @default the item's `label`, else its `value`
|
|
6570
|
+
*/
|
|
6571
|
+
renderItem?: (item: VisibleFlatItem & {
|
|
6572
|
+
checked?: CheckState;
|
|
6573
|
+
}) => React_2.ReactNode;
|
|
6574
|
+
/**
|
|
6575
|
+
* How items are selected, as the nested `Tree`'s `selectionMode`. `'multiple'` draws a checkbox
|
|
6576
|
+
* on every item, bound to the model's checked items (create the model with
|
|
6577
|
+
* `selectionMode: 'multiple'`); `'single'` draws a radio for `selected`. Spread
|
|
6578
|
+
* `model.getTreeProps()` on the tree to pass the model's mode.
|
|
6579
|
+
* @default the model's mode (`model.getTreeProps().selectionMode`)
|
|
6580
|
+
*/
|
|
6581
|
+
selectionMode?: 'none' | SelectionMode_2;
|
|
6582
|
+
/**
|
|
6583
|
+
* Value of the selected item. When set (also to `null`), every item carries `aria-selected`, and
|
|
6584
|
+
* the selected item is where keyboard focus enters the tree while it is visible. It has no effect
|
|
6585
|
+
* with `selectionMode="multiple"` (a development warning). With `selectionMode="single"` every
|
|
6586
|
+
* item carries `aria-selected` even while it is not set (a development warning: the radios need
|
|
6587
|
+
* it).
|
|
6588
|
+
*/
|
|
6589
|
+
selected?: string | null;
|
|
6590
|
+
/** Value of the current item (for example the open page): it gets `aria-current="true"`. */
|
|
6591
|
+
current?: string | null;
|
|
6592
|
+
/**
|
|
6593
|
+
* Called with an item's value every time it is activated (a click on its row, Enter, or Space
|
|
6594
|
+
* unless the tree has checkboxes), also when the same item is activated again.
|
|
6595
|
+
*/
|
|
6596
|
+
onItemSelect?: (value: string) => void;
|
|
6597
|
+
/** Ref to the `role="tree"` element. */
|
|
6598
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
6599
|
+
}
|
|
6600
|
+
|
|
5915
6601
|
/**
|
|
5916
6602
|
* A flexbox layout container with token-based gaps.
|
|
5917
6603
|
*
|
|
@@ -6112,6 +6798,29 @@ export declare interface GridNavigationHandlers {
|
|
|
6112
6798
|
onBlur: React_2.FocusEventHandler<HTMLTableElement>;
|
|
6113
6799
|
}
|
|
6114
6800
|
|
|
6801
|
+
/**
|
|
6802
|
+
* The data behind the rows of a windowed grid, whose rows are mounted only in part (see
|
|
6803
|
+
* {@link UseGridNavigationOptions.model}). Each mounted data row carries its 0-based index in the
|
|
6804
|
+
* data as `data-row-index`.
|
|
6805
|
+
*/
|
|
6806
|
+
export declare interface GridNavigationModel {
|
|
6807
|
+
/** How many data rows there are, mounted or not. */
|
|
6808
|
+
rowCount: number;
|
|
6809
|
+
/**
|
|
6810
|
+
* How many header rows are above the data rows: the first rows of the grid without a
|
|
6811
|
+
* `data-row-index` (they stay mounted). Other rows without one, such as the spacer rows of a
|
|
6812
|
+
* window, are not navigated.
|
|
6813
|
+
*/
|
|
6814
|
+
headerRowCount: number;
|
|
6815
|
+
/**
|
|
6816
|
+
* Brings data row `index` into the mounted rows (scrolls the window to it). Called once for each
|
|
6817
|
+
* row a key moves focus to that is not mounted; focus moves to the row's cell in the commit that
|
|
6818
|
+
* mounts it. Ctrl+Home in a grid with header rows also calls it for row 0, so the first rows
|
|
6819
|
+
* show under the header.
|
|
6820
|
+
*/
|
|
6821
|
+
scrollToRow(index: number): void;
|
|
6822
|
+
}
|
|
6823
|
+
|
|
6115
6824
|
/**
|
|
6116
6825
|
* The Grid's own props (the XOwnProps rule of `PolymorphicProps`: component-specific props only).
|
|
6117
6826
|
* Every other prop comes from the rendered element (`as`).
|
|
@@ -6410,8 +7119,14 @@ export declare interface ImageSwatchProps extends Omit<React_2.ButtonHTMLAttribu
|
|
|
6410
7119
|
* attribute go to it, the consumer's handlers first. The description and the note render next
|
|
6411
7120
|
* to it, never inside it. Its box is 24×24px at every `size` and renders `data-size`. The note
|
|
6412
7121
|
* mounts through the presence core: it carries `data-presence`, `data-state` (`open`, and
|
|
6413
|
-
* `closed` while it exits, `inert`) and the `data-wave-infolabel-surface` marker
|
|
6414
|
-
*
|
|
7122
|
+
* `closed` while it exits, `inert`) and the `data-wave-infolabel-surface` marker.
|
|
7123
|
+
* - **Motion.** The note fades in and slides toward the button from the side it opened on, and
|
|
7124
|
+
* fades out and slides back as it closes (see `motion`); it stays in the document, `inert`,
|
|
7125
|
+
* until the exit ends, with `info` still inside it (never twice in the document), while the
|
|
7126
|
+
* dismiss layer, the focus restore and the button's `aria-expanded` follow the open state at
|
|
7127
|
+
* once. Focus inside a closing note moves to the button in the closing commit. Without motion
|
|
7128
|
+
* (reduced motion, `motion={null}`, or a provider with `motion="none"`) it unmounts as soon as
|
|
7129
|
+
* it closes.
|
|
6415
7130
|
*
|
|
6416
7131
|
* Fluent's InfoButton takes the same `info` and `size`. It opens on click only
|
|
6417
7132
|
* (`openOnHover={false}` here), renders its note in place, and moves focus into the note; this one
|
|
@@ -6427,7 +7142,7 @@ export declare interface ImageSwatchProps extends Omit<React_2.ButtonHTMLAttribu
|
|
|
6427
7142
|
* />
|
|
6428
7143
|
*/
|
|
6429
7144
|
export declare const InfoButton: {
|
|
6430
|
-
({ info, size: sizeProp, openOnHover, id: idProp, type, "aria-label": ariaLabelProp, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className, disabled, onClick, onFocus, onBlur, onKeyDown, onPointerDown, onMouseDown, onPointerEnter, onPointerMove, onPointerLeave, ref, ...rest }: InfoButtonProps): React_2.JSX.Element;
|
|
7145
|
+
({ info, size: sizeProp, openOnHover, id: idProp, type, "aria-label": ariaLabelProp, motion, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className, disabled, onClick, onFocus, onBlur, onKeyDown, onPointerDown, onMouseDown, onPointerEnter, onPointerMove, onPointerLeave, ref, ...rest }: InfoButtonProps): React_2.JSX.Element;
|
|
6431
7146
|
displayName: string;
|
|
6432
7147
|
};
|
|
6433
7148
|
|
|
@@ -6472,6 +7187,17 @@ export declare interface InfoButtonProps extends Omit<React_2.ButtonHTMLAttribut
|
|
|
6472
7187
|
* @default 'Information'
|
|
6473
7188
|
*/
|
|
6474
7189
|
'aria-label'?: string;
|
|
7190
|
+
/**
|
|
7191
|
+
* The note's motion. By default it fades in and slides 4px away from the button, on the side it
|
|
7192
|
+
* opened on, over 200 ms with a decelerating curve, and fades out and slides back over 100 ms
|
|
7193
|
+
* with an accelerating curve; under reduced motion it appears and disappears at once. `null`
|
|
7194
|
+
* turns the motion off (the note still renders its `data-presence` phases, which then end at
|
|
7195
|
+
* once); a class string or `{ className }` replaces the default classes with yours (see
|
|
7196
|
+
* `MotionSlot`), also under a `WaveProvider` with `motion="none"`, which otherwise turns the
|
|
7197
|
+
* default off. Fluent's `Popover` `surfaceMotion` (its InfoButton is a Popover).
|
|
7198
|
+
* @default the fade and slide above
|
|
7199
|
+
*/
|
|
7200
|
+
motion?: MotionSlot | null;
|
|
6475
7201
|
/** Ref to the button. */
|
|
6476
7202
|
ref?: React_2.Ref<HTMLButtonElement>;
|
|
6477
7203
|
}
|
|
@@ -6489,7 +7215,7 @@ export declare interface InfoButtonProps extends Omit<React_2.ButtonHTMLAttribut
|
|
|
6489
7215
|
* - The button is named "‹label text› ‹infoButtonLabel›" through `aria-labelledby`, which points
|
|
6490
7216
|
* at the `<label>` and at the button's own id (whose `aria-label` supplies the second half), so
|
|
6491
7217
|
* several InfoLabels on a page are told apart; `infoButtonLabel` localizes that second half.
|
|
6492
|
-
* `openOnHover` and `size` reach the button too.
|
|
7218
|
+
* `openOnHover`, `motion` and `size` reach the button too.
|
|
6493
7219
|
* - No `controlRef`: InfoLabel is a label, not a form control, so C-ROUTING's composite-control
|
|
6494
7220
|
* routing does not apply to it; a layout that needs the button's own element renders `InfoButton`
|
|
6495
7221
|
* next to a `Label` instead.
|
|
@@ -6498,7 +7224,7 @@ export declare interface InfoButtonProps extends Omit<React_2.ButtonHTMLAttribut
|
|
|
6498
7224
|
* <InfoLabel info="Use at least 8 characters.">Password</InfoLabel>
|
|
6499
7225
|
*/
|
|
6500
7226
|
export declare const InfoLabel: {
|
|
6501
|
-
({ children, label, info, infoButtonLabel, openOnHover, id, htmlFor, required, size, weight, disabled, className, ref, ...rest }: InfoLabelProps): React_2.JSX.Element;
|
|
7227
|
+
({ children, label, info, infoButtonLabel, openOnHover, motion, id, htmlFor, required, size, weight, disabled, className, ref, ...rest }: InfoLabelProps): React_2.JSX.Element;
|
|
6502
7228
|
displayName: string;
|
|
6503
7229
|
};
|
|
6504
7230
|
|
|
@@ -6537,6 +7263,13 @@ export declare interface InfoLabelProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
6537
7263
|
* @default true
|
|
6538
7264
|
*/
|
|
6539
7265
|
openOnHover?: boolean;
|
|
7266
|
+
/**
|
|
7267
|
+
* The motion of the info button's note, passed through unchanged (see `InfoButton`'s `motion`:
|
|
7268
|
+
* `undefined` is the default fade and slide, `null` none, a value replaces it). Fluent's
|
|
7269
|
+
* `Popover` `surfaceMotion`.
|
|
7270
|
+
* @default the fade and slide of InfoButton's note
|
|
7271
|
+
*/
|
|
7272
|
+
motion?: MotionSlot | null;
|
|
6540
7273
|
/** Ref to the root `<span>`. */
|
|
6541
7274
|
ref?: React_2.Ref<HTMLSpanElement>;
|
|
6542
7275
|
}
|
|
@@ -7044,19 +7777,31 @@ export declare type LinkVariant = LinkAppearance;
|
|
|
7044
7777
|
* - **Check marks** (`checkmark`, opt-in): a decorative check at the start of every item of a
|
|
7045
7778
|
* selectable list, shown while the item is selected; `List.Item checkmark` replaces or hides it.
|
|
7046
7779
|
* - **Switching semantics remounts the items.** Listbox/list and grid use different elements
|
|
7047
|
-
* (`ul`/`li` and `div`), so when a selectable list gains its first item
|
|
7048
|
-
* one, or `selectable` or `navigationMode` changes the structure, React
|
|
7049
|
-
* their content: state inside them (an inline rename input's draft, an
|
|
7050
|
-
* reset. Focus that is on an item or inside it when the list switches
|
|
7051
|
-
* `value`, else by position; the next item when the focused one was
|
|
7052
|
-
* focusable content when the item is no Tab stop any more, so the
|
|
7053
|
-
* `<body>`. This includes focus inside the last action when that action
|
|
7054
|
-
* inline rename input that unmounts on Enter). An action that removes itself
|
|
7055
|
-
* without causing a switch drops focus, like any removed element. When the list
|
|
7056
|
-
* keep such state in the parent, or pin the grid with `navigationMode="composite"`.
|
|
7780
|
+
* (`ul`/`li` and `div`), so when a selectable list without a window gains its first item
|
|
7781
|
+
* action, loses its last one, or `selectable` or `navigationMode` changes the structure, React
|
|
7782
|
+
* remounts the items and their content: state inside them (an inline rename input's draft, an
|
|
7783
|
+
* uncontrolled checkbox) is reset. Focus that is on an item or inside it when the list switches
|
|
7784
|
+
* moves to the same item (by `value`, else by position; the next item when the focused one was
|
|
7785
|
+
* removed), or to its first focusable content when the item is no Tab stop any more, so the
|
|
7786
|
+
* switch never drops it to `<body>`. This includes focus inside the last action when that action
|
|
7787
|
+
* removes itself (an inline rename input that unmounts on Enter). An action that removes itself
|
|
7788
|
+
* while focused without causing a switch drops focus, like any removed element. When the list
|
|
7789
|
+
* may switch, keep such state in the parent, or pin the grid with `navigationMode="composite"`.
|
|
7057
7790
|
* - Selection: `selectionMode` `'single'` (default) or `'multiple'`; controlled with
|
|
7058
7791
|
* `selectedItems` (or `selectedItem` in single mode) or uncontrolled with the `default*` props.
|
|
7059
|
-
* Values of items that are no longer rendered are dropped from the reported selection
|
|
7792
|
+
* Values of items that are no longer rendered are dropped from the reported selection (a
|
|
7793
|
+
* windowed list keeps them).
|
|
7794
|
+
* - **Windowing** (`virtualWindow` and `count`, for long lists): a window from `useVirtualWindow`
|
|
7795
|
+
* and a function child that returns the item at an index render only the items in view plus an
|
|
7796
|
+
* overscan, with spacers for the others. The list element scrolls (give it a bounded height),
|
|
7797
|
+
* every item has the window's item size as its height, the focused item stays rendered and is
|
|
7798
|
+
* the Tab stop while focus is in the list, each item carries its place in the whole list, and
|
|
7799
|
+
* the values selected outside the window stay selected. The keys move by index over the whole
|
|
7800
|
+
* list (ArrowUp/ArrowDown, Home/End, and PageUp/PageDown by ten), scrolling the target into view
|
|
7801
|
+
* before focusing it, rendered or not; typeahead matches the rendered items. Its structure
|
|
7802
|
+
* never follows the rendered items: a selectable windowed list is a listbox unless
|
|
7803
|
+
* `navigationMode="composite"` pins the grid (pin it when items have actions; a development
|
|
7804
|
+
* warning says so).
|
|
7060
7805
|
* - Sub-component: `List.Item` (also exported as `ListItem` for React Server Components).
|
|
7061
7806
|
*
|
|
7062
7807
|
* @example
|
|
@@ -7070,13 +7815,25 @@ export declare type LinkVariant = LinkAppearance;
|
|
|
7070
7815
|
* <List.Item value="report" onAction={() => open('report')}>Report</List.Item>
|
|
7071
7816
|
* <List.Item value="budget" onAction={() => open('budget')}>Budget</List.Item>
|
|
7072
7817
|
* </List>
|
|
7818
|
+
*
|
|
7819
|
+
* @example
|
|
7820
|
+
* const virtualWindow = useVirtualWindow({ itemSize: 40 });
|
|
7821
|
+
* <List
|
|
7822
|
+
* selectable
|
|
7823
|
+
* aria-label="Files"
|
|
7824
|
+
* virtualWindow={virtualWindow}
|
|
7825
|
+
* count={files.length}
|
|
7826
|
+
* style={{ height: 320 }}
|
|
7827
|
+
* >
|
|
7828
|
+
* {(index) => <List.Item value={files[index].id}>{files[index].name}</List.Item>}
|
|
7829
|
+
* </List>
|
|
7073
7830
|
*/
|
|
7074
7831
|
export declare const List: {
|
|
7075
7832
|
<M extends ListSelectionMode = "single">(props: ListProps<M>): React_2.ReactNode;
|
|
7076
7833
|
displayName: string;
|
|
7077
7834
|
} & {
|
|
7078
7835
|
Item: {
|
|
7079
|
-
({ value, action, onAction, disabledSelection, checkmark, className, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
|
|
7836
|
+
({ value, action, onAction, disabledSelection, checkmark, className, style, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
|
|
7080
7837
|
displayName: string;
|
|
7081
7838
|
};
|
|
7082
7839
|
};
|
|
@@ -7113,6 +7870,12 @@ export declare const List: {
|
|
|
7113
7870
|
* either), dims it, takes pointer input off its options, selects nothing and submits nothing.
|
|
7114
7871
|
* Disabled options are skipped by the keys unless `disabledOptionsFocusable`, and are never
|
|
7115
7872
|
* selected.
|
|
7873
|
+
* - **Data mode.** `items` passes the options as data instead of children: the list renders an
|
|
7874
|
+
* option per item (`renderOption` draws it, an `Option` with the item's label by default), the
|
|
7875
|
+
* keys, typeahead and the selection follow the data, and each option carries `aria-posinset`
|
|
7876
|
+
* and `aria-setsize`. A long list takes a `virtualWindow` (from `useVirtualWindow({ itemSize
|
|
7877
|
+
* })`): the list then renders only the options in view, plus an overscan, with spacers for the
|
|
7878
|
+
* others, every option `itemSize` tall, and the active option stays rendered.
|
|
7116
7879
|
* - **Forms and Field.** With `name` the value is submitted with its form (one entry, or one per
|
|
7117
7880
|
* value with `multiselect`), and `required` needs a value (native validation; a missing value
|
|
7118
7881
|
* moves focus to the list). A reset of its form restores `defaultValue`, with or without a
|
|
@@ -7131,12 +7894,21 @@ export declare const List: {
|
|
|
7131
7894
|
* <Listbox.Option value="apple">Apple</Listbox.Option>
|
|
7132
7895
|
* <Listbox.Option value="banana">Banana</Listbox.Option>
|
|
7133
7896
|
* </Listbox>
|
|
7897
|
+
*
|
|
7898
|
+
* @example
|
|
7899
|
+
* // Data mode
|
|
7900
|
+
* <Listbox aria-label="City" items={cities.map((c) => ({ value: c.id, label: c.name }))} />
|
|
7134
7901
|
*/
|
|
7135
7902
|
export declare const Listbox: ListboxComponent;
|
|
7136
7903
|
|
|
7137
|
-
/**
|
|
7904
|
+
/**
|
|
7905
|
+
* Listbox: `root` on the `role="listbox"` list (its options carry Option's classes); `spacer` on
|
|
7906
|
+
* each spacer element of a list with a `virtualWindow` (the elements that stand in for the options
|
|
7907
|
+
* that are not rendered).
|
|
7908
|
+
*/
|
|
7138
7909
|
export declare const listboxClassNames: {
|
|
7139
7910
|
readonly root: "wave-listbox";
|
|
7911
|
+
readonly spacer: "wave-listbox__spacer";
|
|
7140
7912
|
};
|
|
7141
7913
|
|
|
7142
7914
|
/** Props for the combobox element (spread them; see {@link UseListboxResult.getComboboxProps}). */
|
|
@@ -7296,6 +8068,20 @@ export declare interface ListboxOptionElementProps<E extends HTMLElement = HTMLE
|
|
|
7296
8068
|
'aria-disabled'?: true;
|
|
7297
8069
|
/** While filtered out or hidden. */
|
|
7298
8070
|
hidden?: boolean;
|
|
8071
|
+
/**
|
|
8072
|
+
* The number of shown options, for an option of a data-mode list rendered by Listbox, Combobox
|
|
8073
|
+
* or Dropdown (`items`), which tell each option its position. Absent otherwise.
|
|
8074
|
+
*/
|
|
8075
|
+
'aria-setsize'?: number;
|
|
8076
|
+
/** The option's position among the shown options (from 1), with `aria-setsize`. */
|
|
8077
|
+
'aria-posinset'?: number;
|
|
8078
|
+
/**
|
|
8079
|
+
* The option's box in a windowed list (a `virtualWindow` of Listbox, Combobox or Dropdown): the
|
|
8080
|
+
* window's `itemSize` as its height, padding and border included, and no shrinking in a flex
|
|
8081
|
+
* list. Absent otherwise. Merge it after a style of your own: every option of a window must be
|
|
8082
|
+
* exactly that tall.
|
|
8083
|
+
*/
|
|
8084
|
+
style?: React_2.CSSProperties;
|
|
7299
8085
|
/** While the option is active, for styling. */
|
|
7300
8086
|
'data-active'?: '';
|
|
7301
8087
|
/** While selected, for styling. */
|
|
@@ -7315,6 +8101,25 @@ export declare interface ListboxOptionElementProps<E extends HTMLElement = HTMLE
|
|
|
7315
8101
|
/** Flat name of `Listbox.OptionGroup` for React Server Components. */
|
|
7316
8102
|
export declare const ListboxOptionGroup: React_2.FC<OptionGroupProps>;
|
|
7317
8103
|
|
|
8104
|
+
/**
|
|
8105
|
+
* The state of an item's option, which `renderOption` of Listbox, Combobox and Dropdown receives
|
|
8106
|
+
* with the item (data mode, `items`).
|
|
8107
|
+
*/
|
|
8108
|
+
export declare interface ListboxOptionRenderState {
|
|
8109
|
+
/** The item's value is selected. */
|
|
8110
|
+
selected: boolean;
|
|
8111
|
+
/**
|
|
8112
|
+
* The option is the active one, which `aria-activedescendant` points at: in a Listbox while the
|
|
8113
|
+
* list has focus, in a Combobox or Dropdown while the list is open.
|
|
8114
|
+
*/
|
|
8115
|
+
active: boolean;
|
|
8116
|
+
/**
|
|
8117
|
+
* The option's index among the shown options, from 0 (its `aria-posinset` minus one): items a
|
|
8118
|
+
* filter leaves out and hidden items are not counted.
|
|
8119
|
+
*/
|
|
8120
|
+
index: number;
|
|
8121
|
+
}
|
|
8122
|
+
|
|
7318
8123
|
/** Properties for the Listbox component. */
|
|
7319
8124
|
export declare interface ListboxProps<M extends boolean = false> extends Omit<React_2.HTMLAttributes<HTMLUListElement>, 'onChange' | 'defaultValue'> {
|
|
7320
8125
|
/**
|
|
@@ -7375,6 +8180,49 @@ export declare interface ListboxProps<M extends boolean = false> extends Omit<Re
|
|
|
7375
8180
|
disabledOptionsFocusable?: boolean;
|
|
7376
8181
|
/** The `multiselect` toggle announcements, for localization. Unset members keep their English defaults. */
|
|
7377
8182
|
labels?: ListboxLabels;
|
|
8183
|
+
/**
|
|
8184
|
+
* Data mode: the options as data, in list order (`value`, `label`, and optionally `textValue`,
|
|
8185
|
+
* `disabled` and `hidden`; values unique). The list renders one option per item that is not
|
|
8186
|
+
* `hidden` (see `renderOption`), and the keys, typeahead and the selection follow `items`. The
|
|
8187
|
+
* children are neither read nor rendered: passing both warns once in development. Each option
|
|
8188
|
+
* gets `aria-posinset` and `aria-setsize` from its place among the shown items, and keeps one id
|
|
8189
|
+
* per value. Without it, the options are the `Option` children.
|
|
8190
|
+
*/
|
|
8191
|
+
items?: readonly ListboxItem[];
|
|
8192
|
+
/**
|
|
8193
|
+
* Data mode: renders the option of an item, given its state (`selected`, `active`, and `index`
|
|
8194
|
+
* among the shown options). Return an `Option`, or an option component of your own on
|
|
8195
|
+
* `useListboxOption`, with the item's `value` (and its `disabled`); its position is set for you,
|
|
8196
|
+
* and in a windowed list (`virtualWindow`) its height. It is called again only when the item, its
|
|
8197
|
+
* state, its position (`aria-posinset` and `aria-setsize`, which new `items` change) or the
|
|
8198
|
+
* function itself changes, so pass a stable function in a long list. Ignored without `items`,
|
|
8199
|
+
* with a development warning.
|
|
8200
|
+
* @default an `Option` with the item's `value`, `label` (also its text), `textValue` and `disabled`
|
|
8201
|
+
*/
|
|
8202
|
+
renderOption?: (item: ListboxItem, state: ListboxOptionRenderState) => React_2.ReactNode;
|
|
8203
|
+
/**
|
|
8204
|
+
* Data mode: renders only the options in view of a long list, plus an overscan, and spacers
|
|
8205
|
+
* (`aria-hidden`, `data-virtual-spacer`) as tall as the options they stand for: pass the result
|
|
8206
|
+
* of `useVirtualWindow({ itemSize })`, or an object of your own that implements `VirtualWindow`.
|
|
8207
|
+
* It needs `items`: without them, or beside `OptionGroup` children, it is ignored with a
|
|
8208
|
+
* development warning (a window renders a flat list).
|
|
8209
|
+
*
|
|
8210
|
+
* The list element is the window's scroller: give it a bounded height (a height or a maximum
|
|
8211
|
+
* height, through `className` or `style`); without one the window measures the whole list and
|
|
8212
|
+
* renders every option. While windowed the list has no block padding (add none through
|
|
8213
|
+
* `className`), so the options start at its top, where the window counts them, and no scroll
|
|
8214
|
+
* anchoring of the browser (the window lays the options out). Every option is exactly
|
|
8215
|
+
* `itemSize` tall (the list sets its height, after the option's own `style`), so an option's
|
|
8216
|
+
* content must fit in it: the default `Option` with one line of text is 32 pixels tall.
|
|
8217
|
+
*
|
|
8218
|
+
* The window counts the shown options (the items that are not `hidden`). The keys and typeahead
|
|
8219
|
+
* move over all of them (Home and End to the first and the last, PageUp and PageDown by ten); the
|
|
8220
|
+
* active option stays rendered while it is scrolled away, so `aria-activedescendant` always names
|
|
8221
|
+
* an element, and when the list gains focus or a key makes it active the list and the window
|
|
8222
|
+
* move to it in the same update (a pointer press moves neither). The server renders the first
|
|
8223
|
+
* window.
|
|
8224
|
+
*/
|
|
8225
|
+
virtualWindow?: VirtualWindow;
|
|
7378
8226
|
/**
|
|
7379
8227
|
* Name of the value in form submissions (renders a hidden input inside the list; one per value
|
|
7380
8228
|
* with `multiselect`).
|
|
@@ -7567,9 +8415,14 @@ export declare interface ListboxSurfaceProps {
|
|
|
7567
8415
|
children?: React_2.ReactNode;
|
|
7568
8416
|
}
|
|
7569
8417
|
|
|
7570
|
-
/**
|
|
8418
|
+
/**
|
|
8419
|
+
* List: `root` on the `<ul>` (the `role="grid"` element of a selectable list with actions);
|
|
8420
|
+
* `spacer` on each spacer element of a list with a `virtualWindow` (the elements that stand in for
|
|
8421
|
+
* the items that are not rendered).
|
|
8422
|
+
*/
|
|
7571
8423
|
export declare const listClassNames: {
|
|
7572
8424
|
readonly root: "wave-list";
|
|
8425
|
+
readonly spacer: "wave-list__spacer";
|
|
7573
8426
|
};
|
|
7574
8427
|
|
|
7575
8428
|
/**
|
|
@@ -7579,11 +8432,15 @@ export declare const listClassNames: {
|
|
|
7579
8432
|
* selection without calling `onClick`, which receives pointer clicks; `onAction` runs on clicks
|
|
7580
8433
|
* and Enter (and Space where the item cannot be selected), before the selection toggles.
|
|
7581
8434
|
*
|
|
8435
|
+
* In a windowed list (the List's `virtualWindow`) an item has the window's item size as its
|
|
8436
|
+
* height, after its own `style` (its content must fit), and carries `data-index` and its place
|
|
8437
|
+
* in the whole list: `aria-setsize` and `aria-posinset`, or `aria-rowindex` in a grid.
|
|
8438
|
+
*
|
|
7582
8439
|
* Exported under the flat name `ListItem` so React Server Components can import it; `List.Item`
|
|
7583
8440
|
* (dotted access) needs a client module.
|
|
7584
8441
|
*/
|
|
7585
8442
|
export declare const ListItem: {
|
|
7586
|
-
({ value, action, onAction, disabledSelection, checkmark, className, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
|
|
8443
|
+
({ value, action, onAction, disabledSelection, checkmark, className, style, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
|
|
7587
8444
|
displayName: string;
|
|
7588
8445
|
};
|
|
7589
8446
|
|
|
@@ -7667,7 +8524,72 @@ export declare type ListNavigationMode = 'none' | 'items' | 'composite';
|
|
|
7667
8524
|
* `selectionMode="multiple"` is passed; `ListProps` without a type argument accepts every mode
|
|
7668
8525
|
* (the 0.4 shape, extendable by interfaces).
|
|
7669
8526
|
*/
|
|
7670
|
-
export declare interface ListProps<M extends ListSelectionMode = ListSelectionMode> extends React_2.HTMLAttributes<HTMLUListElement> {
|
|
8527
|
+
export declare interface ListProps<M extends ListSelectionMode = ListSelectionMode> extends Omit<React_2.HTMLAttributes<HTMLUListElement>, 'children'> {
|
|
8528
|
+
/**
|
|
8529
|
+
* The items: `List.Item` elements. In a windowed list (`virtualWindow` and `count`), a function
|
|
8530
|
+
* `(index) => <List.Item … />` that returns the item at an index: the list calls it for the
|
|
8531
|
+
* rendered indexes only and keys each item by its index. Without `virtualWindow` and `count` a
|
|
8532
|
+
* function renders nothing (a development warning says so).
|
|
8533
|
+
*/
|
|
8534
|
+
children?: React_2.ReactNode | ((index: number) => React_2.ReactNode);
|
|
8535
|
+
/**
|
|
8536
|
+
* Renders only the items in view, plus an overscan, of a long list: pass the result of
|
|
8537
|
+
* `useVirtualWindow({ itemSize })` (or an object of your own that implements `VirtualWindow`)
|
|
8538
|
+
* with `count`, and a function child that returns the `List.Item` at an index. The items that
|
|
8539
|
+
* are not rendered are replaced by spacers (`aria-hidden`, `data-virtual-spacer`) of their
|
|
8540
|
+
* height.
|
|
8541
|
+
*
|
|
8542
|
+
* The list element becomes the window's scroller (it scrolls vertically, without the browser's
|
|
8543
|
+
* scroll anchoring): give it a bounded height, a height or a maximum height (a class or a style);
|
|
8544
|
+
* without one the window measures the whole list and renders every item. Where the list
|
|
8545
|
+
* navigates its items, one item is its Tab stop and the list element is none of its own
|
|
8546
|
+
* (`tabIndex` -1, as Firefox would stop on a scroller); a plain windowed list keeps the browser's
|
|
8547
|
+
* default, under which WebKit does not let the keyboard reach and scroll it: pass `tabIndex={0}`
|
|
8548
|
+
* or navigate its items (`navigationMode="items"`). A `tabIndex` you pass wins.
|
|
8549
|
+
*
|
|
8550
|
+
* Every item has the window's `itemSize` as its height (the list sets it, after the item's own
|
|
8551
|
+
* `style`), so an item's content must fit in it. Each item carries `data-index` (its 0-based
|
|
8552
|
+
* index) and its place in the whole list: `aria-setsize` and `aria-posinset`, or in a grid
|
|
8553
|
+
* (`navigationMode="composite"`) the list's `aria-rowcount` and the row's `aria-rowindex`.
|
|
8554
|
+
*
|
|
8555
|
+
* The item that has focus stays rendered when it is scrolled away (also while focus is in a
|
|
8556
|
+
* popup it opened), so it keeps focus, and while focus is in the list it is the list's Tab stop.
|
|
8557
|
+
* Once focus leaves the list it is no longer kept, and the Tab stop follows the rule of a list
|
|
8558
|
+
* without focus among the rendered items (the first selected item, else the first item; in a
|
|
8559
|
+
* list without selection the item that last had focus while it is rendered). When `count` drops
|
|
8560
|
+
* to or below the focused item, focus moves to the last item.
|
|
8561
|
+
*
|
|
8562
|
+
* The keys move by index over the whole list, rendered or not, where the list navigates its
|
|
8563
|
+
* items (`navigationMode` `'items'` or `'composite'`, or a selectable list): ArrowUp/ArrowDown
|
|
8564
|
+
* (wrapping at the ends), Home/End, and PageUp/PageDown, which move ten items and stop at the
|
|
8565
|
+
* ends. The target is scrolled into view before it is focused, the least that shows it whole: a
|
|
8566
|
+
* rendered one by the browser (`scrollIntoView`, nearest), which the window follows, one that is
|
|
8567
|
+
* not rendered through the window's `scrollToIndex`, and focused once it renders. An item that a
|
|
8568
|
+
* pointer press focuses is not scrolled. Typeahead matches the labels of the rendered items
|
|
8569
|
+
* only.
|
|
8570
|
+
*
|
|
8571
|
+
* Selection covers every value: the values of items that are not rendered stay selected, and
|
|
8572
|
+
* `onSelectionChange` reports them (a list without a window drops the values of items it no
|
|
8573
|
+
* longer renders).
|
|
8574
|
+
*
|
|
8575
|
+
* The structure never depends on which items are rendered: a selectable windowed list stays a
|
|
8576
|
+
* listbox (its items are options) unless `navigationMode="composite"` makes it a grid from the
|
|
8577
|
+
* first render, so scrolling never replaces the list element (which would reset its scroll
|
|
8578
|
+
* position and remount every item). Its items' actions do not switch it to a grid as they do in
|
|
8579
|
+
* a list without a window: an item with an action in a selectable windowed list without that
|
|
8580
|
+
* pin is a development warning, since an option cannot hold interactive content. Pin
|
|
8581
|
+
* `navigationMode="composite"` when items have actions.
|
|
8582
|
+
*
|
|
8583
|
+
* Applies only with `count` and a function child; otherwise it is ignored, with a development
|
|
8584
|
+
* warning.
|
|
8585
|
+
*/
|
|
8586
|
+
virtualWindow?: VirtualWindow;
|
|
8587
|
+
/**
|
|
8588
|
+
* The number of items of a windowed list (with `virtualWindow`): the function child is called
|
|
8589
|
+
* for the indexes from 0 to `count - 1` that are rendered. A value that is not a whole number
|
|
8590
|
+
* counts as its whole part, and one below 0 (or not finite) as 0.
|
|
8591
|
+
*/
|
|
8592
|
+
count?: number;
|
|
7671
8593
|
/** Whether list items can be selected.
|
|
7672
8594
|
* @default false
|
|
7673
8595
|
*/
|
|
@@ -7714,7 +8636,10 @@ export declare interface ListProps<M extends ListSelectionMode = ListSelectionMo
|
|
|
7714
8636
|
* the Tab order. The rows of a list without selection carry no `aria-selected`.
|
|
7715
8637
|
*
|
|
7716
8638
|
* The resolved mode is rendered as `data-navigation-mode`. Changing it while mounted can switch
|
|
7717
|
-
* between `ul`/`li` and `div` elements, which remounts the items (see {@link List}).
|
|
8639
|
+
* between `ul`/`li` and `div` elements, which remounts the items (see {@link List}). A windowed
|
|
8640
|
+
* list (`virtualWindow`) never switches for its items' actions: unset or `'items'`, a selectable
|
|
8641
|
+
* one is a listbox; only `'composite'` makes it a grid. In a windowed list the keys move by
|
|
8642
|
+
* index over the whole list, PageUp/PageDown included (see `virtualWindow`).
|
|
7718
8643
|
*/
|
|
7719
8644
|
navigationMode?: ListNavigationMode;
|
|
7720
8645
|
/**
|
|
@@ -7826,7 +8751,7 @@ export declare const Menu: {
|
|
|
7826
8751
|
displayName: string;
|
|
7827
8752
|
};
|
|
7828
8753
|
Popover: {
|
|
7829
|
-
({ side, align, offset, target: targetProp, positioning, children, className, style, onKeyDown, onKeyDownCapture, onFocus, onPointerEnter, onPointerLeave, onPointerMove, onContextMenu, ref, ...rest }: MenuPopoverProps): JSX.Element | null;
|
|
8754
|
+
({ side, align, offset, target: targetProp, positioning, motion, children, className, style, onKeyDown, onKeyDownCapture, onFocus, onPointerEnter, onPointerLeave, onPointerMove, onContextMenu, ref, ...rest }: MenuPopoverProps): JSX.Element | null;
|
|
7830
8755
|
displayName: string;
|
|
7831
8756
|
};
|
|
7832
8757
|
ItemCheckbox: {
|
|
@@ -8288,16 +9213,23 @@ export declare interface MenuItemSwitchProps extends MenuItemProps, MenuItemSele
|
|
|
8288
9213
|
* the element focused at the gesture; it is not labelled by its region, so give it `aria-label`
|
|
8289
9214
|
* (development warning otherwise), as for a menu placed at a `target` without `Menu.Trigger`.
|
|
8290
9215
|
*
|
|
8291
|
-
*
|
|
8292
|
-
*
|
|
8293
|
-
*
|
|
8294
|
-
*
|
|
8295
|
-
*
|
|
9216
|
+
* It moves in and out: the surface fades in and slides 4px away from its trigger over 200 ms, and
|
|
9217
|
+
* fades out and slides back over 100 ms, on the side it opened on (`data-side`), so a submenu
|
|
9218
|
+
* slides out of its parent menu; a menu open by default animates in when it mounts in the
|
|
9219
|
+
* browser. Under reduced motion it appears and disappears at once. `motion` turns the motion off
|
|
9220
|
+
* (`null`) or replaces its classes, and a `WaveProvider` with `motion="none"` turns the default
|
|
9221
|
+
* off; a `className` with `data-[presence=…]` classes and no `motion` keeps 0.14's behaviour (your
|
|
9222
|
+
* classes, no default motion). The surface mounts through the presence core (`usePresence`): it
|
|
9223
|
+
* carries `data-presence="entering" | "entered" | "exiting"` and, while it closes,
|
|
9224
|
+
* `data-state="closed"` and `inert`, so it stays on screen, where it was, until its exit motion
|
|
9225
|
+
* ends. Focus, the dismiss layer and positioning follow the open state, not the exit: focus
|
|
9226
|
+
* inside a closing menu leaves it in the commit that closes it. Without motion it unmounts as
|
|
9227
|
+
* soon as it closes.
|
|
8296
9228
|
*
|
|
8297
9229
|
* Also exported as `MenuPopover` (import the flat name from React Server Components).
|
|
8298
9230
|
*/
|
|
8299
9231
|
export declare const MenuPopover: {
|
|
8300
|
-
({ side, align, offset, target: targetProp, positioning, children, className, style, onKeyDown, onKeyDownCapture, onFocus, onPointerEnter, onPointerLeave, onPointerMove, onContextMenu, ref, ...rest }: MenuPopoverProps): React_2.JSX.Element | null;
|
|
9232
|
+
({ side, align, offset, target: targetProp, positioning, motion, children, className, style, onKeyDown, onKeyDownCapture, onFocus, onPointerEnter, onPointerLeave, onPointerMove, onContextMenu, ref, ...rest }: MenuPopoverProps): React_2.JSX.Element | null;
|
|
8301
9233
|
displayName: string;
|
|
8302
9234
|
};
|
|
8303
9235
|
|
|
@@ -8335,6 +9267,19 @@ export declare interface MenuPopoverProps extends Omit<React_2.HTMLAttributes<HT
|
|
|
8335
9267
|
* @default `{ fitViewport: true }`
|
|
8336
9268
|
*/
|
|
8337
9269
|
positioning?: PopupPositioning;
|
|
9270
|
+
/**
|
|
9271
|
+
* The menu's motion. By default it fades in and slides 4px away from its trigger, on the side
|
|
9272
|
+
* it opened on (a submenu away from its parent menu), over 200 ms with a decelerating curve, and
|
|
9273
|
+
* fades out and slides back over 100 ms with an accelerating curve; under reduced motion it
|
|
9274
|
+
* appears and disappears at once. `null` turns the motion off (the surface still renders its
|
|
9275
|
+
* `data-presence` phases, which then end at once); a class string or `{ className }` replaces
|
|
9276
|
+
* the default classes with yours (see `MotionSlot`), also under a `WaveProvider` with
|
|
9277
|
+
* `motion="none"`, which otherwise turns the default off. A `className` that holds
|
|
9278
|
+
* `data-[presence=…]` classes while `motion` is unset keeps 0.14's behaviour: no default motion,
|
|
9279
|
+
* your classes animate the surface. Fluent's `Menu` `surfaceMotion`.
|
|
9280
|
+
* @default the fade and slide above
|
|
9281
|
+
*/
|
|
9282
|
+
motion?: MotionSlot | null;
|
|
8338
9283
|
/** Menu items and dividers. */
|
|
8339
9284
|
children: React_2.ReactNode;
|
|
8340
9285
|
/**
|
|
@@ -8687,6 +9632,85 @@ export declare const messageBarClassNames: {
|
|
|
8687
9632
|
readonly dismissIcon: "wave-message-bar__dismiss-icon";
|
|
8688
9633
|
};
|
|
8689
9634
|
|
|
9635
|
+
/**
|
|
9636
|
+
* A stack of MessageBars that animates the bars it gains and loses, Fluent's MessageBarGroup with
|
|
9637
|
+
* its `animate` prop: a bar removed from the children fades out while its row closes, so the bars
|
|
9638
|
+
* below glide up instead of jumping (Fluent's bar only fades, and the bars below jump when it is
|
|
9639
|
+
* gone), and with `animate="both"` a bar added after mount opens its row and fades in.
|
|
9640
|
+
*
|
|
9641
|
+
* - **Keys.** Give every bar a stable `key` (`key={message.id}`): the group follows its children
|
|
9642
|
+
* by key, so it can keep a removed bar on screen during its exit, in its place, and move bars
|
|
9643
|
+
* that are reordered without replacing them. A removed bar that comes back during its exit is
|
|
9644
|
+
* shown again. A child without a key of its own, or text, renders after the bars as given,
|
|
9645
|
+
* without motion, with a development warning. Any keyed element animates; MessageBar is the
|
|
9646
|
+
* one the group is made for.
|
|
9647
|
+
* - **Motion.** Bars present at the group's first render (on the server too) never animate. Each
|
|
9648
|
+
* bar sits in an element of its own, which renders no box while the bar is shown, so the bars
|
|
9649
|
+
* are the stack's own items; while a bar enters or exits, that element clips it while its row
|
|
9650
|
+
* opens or closes. An exiting bar is `inert`. See `motion` for the default and how to replace
|
|
9651
|
+
* or turn it off; under `prefers-reduced-motion: reduce` a bar is added and removed at once.
|
|
9652
|
+
* - **Focus.** When a bar leaves with focus inside it (its Dismiss button was pressed), focus moves
|
|
9653
|
+
* in the same commit to the first tabbable element of the nearest bar after it that stays and
|
|
9654
|
+
* holds a tabbable element, else of the nearest such bar before it. When no such bar is left,
|
|
9655
|
+
* the app decides where focus goes.
|
|
9656
|
+
* - **Markup.** A plain `<div>` without a role stacking the bars with an 8px gap; each MessageBar
|
|
9657
|
+
* stays its own live region. MessageBarGroup is a component of its own rather than a part of
|
|
9658
|
+
* MessageBar, so a page that imports only MessageBar does not load the group's motion.
|
|
9659
|
+
*
|
|
9660
|
+
* @example
|
|
9661
|
+
* <MessageBarGroup animate="both">
|
|
9662
|
+
* {messages.map((message) => (
|
|
9663
|
+
* <MessageBar key={message.id} status={message.status} onDismiss={() => dismiss(message.id)}>
|
|
9664
|
+
* {message.text}
|
|
9665
|
+
* </MessageBar>
|
|
9666
|
+
* ))}
|
|
9667
|
+
* </MessageBarGroup>
|
|
9668
|
+
*/
|
|
9669
|
+
export declare const MessageBarGroup: {
|
|
9670
|
+
({ animate, motion, children, className, ref, ...rest }: MessageBarGroupProps): React_2.JSX.Element;
|
|
9671
|
+
displayName: string;
|
|
9672
|
+
};
|
|
9673
|
+
|
|
9674
|
+
/**
|
|
9675
|
+
* MessageBarGroup: `root` on the element that stacks the bars; `item` on the element around each
|
|
9676
|
+
* bar (the element its enter and exit run on).
|
|
9677
|
+
*/
|
|
9678
|
+
export declare const messageBarGroupClassNames: {
|
|
9679
|
+
readonly root: "wave-message-bar-group";
|
|
9680
|
+
readonly item: "wave-message-bar-group__item";
|
|
9681
|
+
};
|
|
9682
|
+
|
|
9683
|
+
/** Properties for the MessageBarGroup component. */
|
|
9684
|
+
export declare interface MessageBarGroupProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
9685
|
+
/**
|
|
9686
|
+
* Which changes animate: `'exit-only'` (a bar removed from the children fades and collapses
|
|
9687
|
+
* out) or `'both'` (a bar added after mount also fades and slides in). Bars present at the
|
|
9688
|
+
* group's first render never animate. Fluent's `animate`. The root renders it as
|
|
9689
|
+
* `data-animate`.
|
|
9690
|
+
* @default 'exit-only'
|
|
9691
|
+
*/
|
|
9692
|
+
animate?: 'exit-only' | 'both';
|
|
9693
|
+
/**
|
|
9694
|
+
* Replaces the bars' motion (both directions); `null` turns it off. The motion is on the element
|
|
9695
|
+
* around each bar (`className` stays on the root). By default a removed bar fades out while its
|
|
9696
|
+
* row and its bottom margin close over 250 ms with the linear curve, so the bars after it glide
|
|
9697
|
+
* up and nothing jumps when it unmounts (the margin makes up for the group's 8px gap, so a
|
|
9698
|
+
* different gap in `className` needs a `motion` whose margin matches it); with
|
|
9699
|
+
* `animate="both"`, a bar added after mount opens its row and fades in the same way. Under
|
|
9700
|
+
* reduced motion bars appear and disappear at once. `null` turns the motion off (the element
|
|
9701
|
+
* still renders its `data-presence` phases, which then end at once); a class string or
|
|
9702
|
+
* `{ className }` replaces the default classes with yours (see `MotionSlot`), also under a
|
|
9703
|
+
* `WaveProvider` with `motion="none"`, which otherwise turns the default off. A WaveUI addition:
|
|
9704
|
+
* Fluent's MessageBarGroup has no motion slot (its bar only fades out).
|
|
9705
|
+
* @default the collapse and fade above
|
|
9706
|
+
*/
|
|
9707
|
+
motion?: MotionSlot | null;
|
|
9708
|
+
/** MessageBar elements, each with a stable `key`. */
|
|
9709
|
+
children?: React_2.ReactNode;
|
|
9710
|
+
/** Ref to the root `<div>`. */
|
|
9711
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
9712
|
+
}
|
|
9713
|
+
|
|
8690
9714
|
/** Properties for the MessageBar component. */
|
|
8691
9715
|
export declare interface MessageBarProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
8692
9716
|
/** Status level controlling the color, icon, status text and role of the message bar.
|
|
@@ -8829,6 +9853,26 @@ export declare type ModalOpenChangeReason = 'trigger' | 'close' | 'close-button'
|
|
|
8829
9853
|
*/
|
|
8830
9854
|
export declare type ModalType = 'modal' | 'alert' | 'non-modal';
|
|
8831
9855
|
|
|
9856
|
+
/** Motion below a `WaveProvider`: `'default'`, or `'none'` (every motion slot acts as `null`). */
|
|
9857
|
+
export declare type MotionPreference = 'default' | 'none';
|
|
9858
|
+
|
|
9859
|
+
/**
|
|
9860
|
+
* Replaces a part's default motion (its `motion`, `backdropMotion`, `expandIconMotion` or
|
|
9861
|
+
* `indeterminateMotion` prop): a class string, or `{ className }`. `null` on the prop turns the
|
|
9862
|
+
* motion off and `undefined` keeps the default. On a part with presence phases (a surface, a
|
|
9863
|
+
* backdrop, a collapsing part, a toast, a bar of a MessageBarGroup), write the phases as the
|
|
9864
|
+
* default motion does: the enter's start with the starting variant gated on the entering phase
|
|
9865
|
+
* (`data-[presence=entering]:starting:…`), the exit with `data-[presence=exiting]:…`, and a
|
|
9866
|
+
* reduced-motion counterpart. The other parts (a Nav category's expand icon, ProgressBar's
|
|
9867
|
+
* indeterminate fill, TabList's selection line) have no phases: give them plain transition or
|
|
9868
|
+
* animation classes with a reduced-motion counterpart. The classes must exist in your CSS: the
|
|
9869
|
+
* precompiled stylesheet holds only Wave's own classes, so without Tailwind pass a class of your
|
|
9870
|
+
* own CSS (written against `[data-presence]` for a part with phases).
|
|
9871
|
+
*/
|
|
9872
|
+
export declare type MotionSlot = string | {
|
|
9873
|
+
className: string;
|
|
9874
|
+
};
|
|
9875
|
+
|
|
8832
9876
|
/**
|
|
8833
9877
|
* A vertical side navigation (`<nav>` landmark, default name "Navigation") with items, links and
|
|
8834
9878
|
* collapsible categories.
|
|
@@ -8854,9 +9898,14 @@ export declare type ModalType = 'modal' | 'alert' | 'non-modal';
|
|
|
8854
9898
|
* `href` or a button; it is never selected. `Nav.AppItemStatic` shows them as plain text.
|
|
8855
9899
|
* - **Item actions**: `actions` on `Nav.Item` and `Nav.SubItem` (Fluent's SplitNavItem) puts your
|
|
8856
9900
|
* own controls beside the item, in a group named by it; each is a Tab stop after the item, and
|
|
8857
|
-
* none selects it. They
|
|
8858
|
-
* has its menu open, and always on touch screens and in forced colours. With actions, a
|
|
8859
|
-
* item's background and indicator are drawn on its row (`.wave-nav-item__list-item`).
|
|
9901
|
+
* none selects it. They fade in while the row is hovered or has focus, while one is pressed or
|
|
9902
|
+
* has its menu open, and are always drawn on touch screens and in forced colours. With actions, a
|
|
9903
|
+
* selected item's background and indicator are drawn on its row (`.wave-nav-item__list-item`).
|
|
9904
|
+
* - **Motion**: a category's list opens and closes its space with a short collapse and fade
|
|
9905
|
+
* (`motion` on `Nav.Category`), its chevron's turn is animated (`expandIconMotion`) and item
|
|
9906
|
+
* actions fade in. None of these defaults runs under reduced motion, and a `WaveProvider` with
|
|
9907
|
+
* `motion="none"` turns them off, while a category's own `motion` or `expandIconMotion` value
|
|
9908
|
+
* still applies. Focus inside a list that closes moves to its category's toggle button.
|
|
8860
9909
|
*
|
|
8861
9910
|
* Sub-components are also exported under flat names (`NavCategory`, `NavItem`, `NavSubItem`,
|
|
8862
9911
|
* `NavSectionHeader`, `NavDivider`, `NavAppItem`, `NavAppItemStatic`): React Server Components
|
|
@@ -8867,7 +9916,7 @@ export declare const Nav: {
|
|
|
8867
9916
|
displayName: string;
|
|
8868
9917
|
} & {
|
|
8869
9918
|
Category: {
|
|
8870
|
-
({ value, label, icon, className, children, ref, ...rest }: NavCategoryProps): React_2.JSX.Element;
|
|
9919
|
+
({ value, label, icon, expandIcon, expandIconMotion, motion, className, children, ref, ...rest }: NavCategoryProps): React_2.JSX.Element;
|
|
8871
9920
|
displayName: string;
|
|
8872
9921
|
};
|
|
8873
9922
|
Item: typeof NavItem;
|
|
@@ -9007,8 +10056,19 @@ export declare interface NavAppItemStaticProps extends React_2.HTMLAttributes<HT
|
|
|
9007
10056
|
|
|
9008
10057
|
/**
|
|
9009
10058
|
* A collapsible group of sub-items. Its toggle button shows `label` and reports `aria-expanded`
|
|
9010
|
-
* (and `aria-controls` while open); the sub-items render in a nested list while it is open
|
|
9011
|
-
* Open state lives on `Nav`
|
|
10059
|
+
* (and `aria-controls` while open); the sub-items render in a nested list while it is open and
|
|
10060
|
+
* while the list collapses after a close. Open state lives on `Nav`
|
|
10061
|
+
* (`openCategories`/`defaultOpenCategories`).
|
|
10062
|
+
*
|
|
10063
|
+
* The list renders as the only child of a collapse element (its stable class
|
|
10064
|
+
* `wave-nav-category__collapse`), which opens and closes the list's space (`motion`) and has no
|
|
10065
|
+
* box of its own while the category is open, so the list lays out in the category as before. A
|
|
10066
|
+
* category open by default appears without motion. After a close the list stays in the document
|
|
10067
|
+
* until the collapse ends, `inert` (its items leave the Tab order and an arrow-key body's arrow
|
|
10068
|
+
* keys at once), while the toggle button already reports the category closed, without
|
|
10069
|
+
* `aria-controls`; opening the category again during the collapse keeps the same list. Focus
|
|
10070
|
+
* inside the list when the category closes moves to the toggle button. The expand chevron turns
|
|
10071
|
+
* while the category is open (`expandIcon` replaces it, `expandIconMotion` animates its turn).
|
|
9012
10072
|
*
|
|
9013
10073
|
* A closed category that contains the current item marks its toggle button with
|
|
9014
10074
|
* `aria-current="true"` (the button is not the page's link, so not `"page"`),
|
|
@@ -9021,14 +10081,15 @@ export declare interface NavAppItemStaticProps extends React_2.HTMLAttributes<HT
|
|
|
9021
10081
|
* Also exported as `NavCategory` (import the flat name from React Server Components).
|
|
9022
10082
|
*/
|
|
9023
10083
|
export declare const NavCategory: {
|
|
9024
|
-
({ value, label, icon, className, children, ref, ...rest }: NavCategoryProps): React_2.JSX.Element;
|
|
10084
|
+
({ value, label, icon, expandIcon, expandIconMotion, motion, className, children, ref, ...rest }: NavCategoryProps): React_2.JSX.Element;
|
|
9025
10085
|
displayName: string;
|
|
9026
10086
|
};
|
|
9027
10087
|
|
|
9028
10088
|
/**
|
|
9029
10089
|
* Nav.Category: `root` on its `<li>`; `button` on the toggle button; `icon` on the icon span;
|
|
9030
|
-
* `label` on the label span; `expandIcon` on the chevron `<svg
|
|
9031
|
-
* sub-items
|
|
10090
|
+
* `label` on the label span; `expandIcon` on the chevron `<svg>` (or on the span of your
|
|
10091
|
+
* `expandIcon`); `list` on the `<ul>` of its sub-items; `collapse` on the element around that
|
|
10092
|
+
* list (the element that opens and closes the list's space, 0.15).
|
|
9032
10093
|
*/
|
|
9033
10094
|
export declare const navCategoryClassNames: {
|
|
9034
10095
|
readonly root: "wave-nav-category";
|
|
@@ -9037,6 +10098,7 @@ export declare const navCategoryClassNames: {
|
|
|
9037
10098
|
readonly label: "wave-nav-category__label";
|
|
9038
10099
|
readonly expandIcon: "wave-nav-category__expand-icon";
|
|
9039
10100
|
readonly list: "wave-nav-category__list";
|
|
10101
|
+
readonly collapse: "wave-nav-category__collapse";
|
|
9040
10102
|
};
|
|
9041
10103
|
|
|
9042
10104
|
/** Properties for the NavCategory sub-component. */
|
|
@@ -9056,9 +10118,42 @@ export declare interface NavCategoryProps extends React_2.HTMLAttributes<HTMLLIE
|
|
|
9056
10118
|
* (`''`, `0`) or a list of nothing renders no icon box.
|
|
9057
10119
|
*/
|
|
9058
10120
|
icon?: Slot<'span'>;
|
|
10121
|
+
/**
|
|
10122
|
+
* Replaces the expand chevron at the end of the toggle button (decorative, `aria-hidden`).
|
|
10123
|
+
* `null`/`undefined` keep the chevron, which turns while the category is open; `false`, or
|
|
10124
|
+
* anything that renders nothing, hides it (`aria-expanded` still reports the state). Your glyph
|
|
10125
|
+
* renders as given in a span with the expand icon's class and is not turned, so a glyph that
|
|
10126
|
+
* shows the state itself works (a plus or a minus, picked from your `openCategories`). It is
|
|
10127
|
+
* rendered inside the toggle button: a `<button>` or `Button` passed here (or a slot object
|
|
10128
|
+
* whose `as` is one) is not nested (its children become the glyph and its props are dropped,
|
|
10129
|
+
* with a development warning).
|
|
10130
|
+
*/
|
|
10131
|
+
expandIcon?: Slot<'span'>;
|
|
10132
|
+
/**
|
|
10133
|
+
* Replaces the motion of the expand icon (Fluent's `NavCategoryItem expandIconMotion`): by
|
|
10134
|
+
* default the chevron's half turn as the category opens and closes is animated over the fast
|
|
10135
|
+
* duration (150 ms) with the easy-ease curve, both ways, and so is any transform of the span
|
|
10136
|
+
* around your own `expandIcon`. The turn itself is not motion: `null` turns the animation off
|
|
10137
|
+
* and the chevron still turns, at once; a class string or `{ className }` replaces it with
|
|
10138
|
+
* plain transition classes and a reduced-motion counterpart (the icon has no presence phases).
|
|
10139
|
+
* A `WaveProvider` with `motion="none"` turns the default off, and a value here still applies
|
|
10140
|
+
* under it.
|
|
10141
|
+
* @default the animated turn described above
|
|
10142
|
+
*/
|
|
10143
|
+
expandIconMotion?: MotionSlot | null;
|
|
10144
|
+
/**
|
|
10145
|
+
* Replaces the collapse of the category's list (Fluent's `NavSubItemGroup collapseMotion`), on
|
|
10146
|
+
* the element around its `<ul>`: by default the space the list takes opens from nothing and
|
|
10147
|
+
* closes back to it, with a fade, over the normal duration (200 ms) with the max easy-ease
|
|
10148
|
+
* curve, both ways. `null` turns it off (the list appears and disappears at once); a class
|
|
10149
|
+
* string or `{ className }` replaces it, written as `MotionSlot` describes. A `WaveProvider`
|
|
10150
|
+
* with `motion="none"` turns the default off, and a value here still applies under it.
|
|
10151
|
+
* @default the collapse described above
|
|
10152
|
+
*/
|
|
10153
|
+
motion?: MotionSlot | null;
|
|
9059
10154
|
/**
|
|
9060
10155
|
* The category's sub-items (`Nav.SubItem`), and `Nav.SectionHeader` and `Nav.Divider`, rendered
|
|
9061
|
-
* in its list while it is open.
|
|
10156
|
+
* in its list while it is open (and while the list collapses after a close).
|
|
9062
10157
|
*/
|
|
9063
10158
|
children?: React_2.ReactNode;
|
|
9064
10159
|
/** Ref to the category's `<li>` element. */
|
|
@@ -9113,6 +10208,16 @@ export declare interface NavDividerProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
9113
10208
|
* when an item is chosen is yours, in `onItemSelect`, which also fires when the current page is
|
|
9114
10209
|
* activated again. A non-modal overlay (`modalType="non-modal"`) covers the page, which keeps
|
|
9115
10210
|
* its Tab order: keep the page's controls clear of it, or use `type="inline"`.
|
|
10211
|
+
* - **Motion:** an overlay slides in from its edge and fades in, and slides back and fades out,
|
|
10212
|
+
* over 250 ms (`small`, the default), 300 ms (`medium`), 400 ms (`large`) or 500 ms (`full`),
|
|
10213
|
+
* with its backdrop fading along; one open by default animates in when it mounts in the browser.
|
|
10214
|
+
* An inline drawer opens and closes the space it takes in the layout over the same durations,
|
|
10215
|
+
* in an element of its own around the panel (`wave-nav-drawer__collapse`, which has no box
|
|
10216
|
+
* while open); one open by default does not animate in, and one at `full` has no motion. Under
|
|
10217
|
+
* reduced motion every drawer appears and disappears at once. `motion` and `backdropMotion`
|
|
10218
|
+
* turn each off (`null`) or replace it, and `WaveProvider motion="none"` turns both defaults
|
|
10219
|
+
* off. While it exits the panel stays on screen, `inert`, and focus, the trap and the scroll
|
|
10220
|
+
* lock are already released.
|
|
9116
10221
|
* - **Focus:** pass your page's Hamburger as `finalFocusRef`, so focus returns to it when a
|
|
9117
10222
|
* Hamburger inside the drawer closes it. An overlay moves focus in when it opens; an inline
|
|
9118
10223
|
* drawer does not.
|
|
@@ -9155,7 +10260,7 @@ export declare interface NavDividerProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
9155
10260
|
* </NavDrawer>
|
|
9156
10261
|
*/
|
|
9157
10262
|
export declare const NavDrawer: {
|
|
9158
|
-
({ type, open: openProp, defaultOpen, onOpenChange, onItemSelect, position, size, separator, modalType: modalTypeProp, unmountOnClose, finalFocusRef, backdrop, value, defaultValue, onValueChange, openCategories, defaultOpenCategories, onOpenCategoriesChange, currentCategory, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, id, children, ref, ...rest }: NavDrawerProps): React_2.JSX.Element;
|
|
10263
|
+
({ type, open: openProp, defaultOpen, onOpenChange, onItemSelect, position, size, separator, modalType: modalTypeProp, unmountOnClose, finalFocusRef, backdrop, motion, backdropMotion, value, defaultValue, onValueChange, openCategories, defaultOpenCategories, onOpenCategoriesChange, currentCategory, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, id, children, ref, ...rest }: NavDrawerProps): React_2.JSX.Element;
|
|
9159
10264
|
displayName: string;
|
|
9160
10265
|
} & {
|
|
9161
10266
|
Header: {
|
|
@@ -9210,13 +10315,15 @@ export declare interface NavDrawerBodyProps extends React_2.HTMLAttributes<HTMLD
|
|
|
9210
10315
|
|
|
9211
10316
|
/**
|
|
9212
10317
|
* NavDrawer (a Drawer variant: it also carries Drawer's root, and its backdrop Drawer's backdrop
|
|
9213
|
-
* class): `root` on the panel (the portaled
|
|
9214
|
-
*
|
|
9215
|
-
*
|
|
10318
|
+
* class, and its collapse element Drawer's collapse class): `root` on the panel (the portaled
|
|
10319
|
+
* `role="dialog"` element of an overlay drawer, the panel element of an inline one); `backdrop` on
|
|
10320
|
+
* the backdrop of a modal overlay; `collapse` on the element around an inline drawer's panel;
|
|
10321
|
+
* `nav` on the navigation landmark that fills the panel.
|
|
9216
10322
|
*/
|
|
9217
10323
|
export declare const navDrawerClassNames: {
|
|
9218
10324
|
readonly root: "wave-nav-drawer";
|
|
9219
10325
|
readonly backdrop: "wave-nav-drawer__backdrop";
|
|
10326
|
+
readonly collapse: "wave-nav-drawer__collapse";
|
|
9220
10327
|
readonly nav: "wave-nav-drawer__nav";
|
|
9221
10328
|
};
|
|
9222
10329
|
|
|
@@ -9316,7 +10423,10 @@ export declare interface NavDrawerProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
9316
10423
|
* The panel's width at a side (its height at the bottom), on Drawer's scale: `small` 320px,
|
|
9317
10424
|
* `medium` 592px, `large` 940px, `full` the viewport (inline: the container). A width class in
|
|
9318
10425
|
* `className` replaces it (Fluent's navigation pane is 260px wide: the width class of 65
|
|
9319
|
-
* spacing steps).
|
|
10426
|
+
* spacing steps). It also times the motion, an overlay's slide and an inline drawer's collapse
|
|
10427
|
+
* alike: 250 ms small, 300 ms medium, 400 ms large, 500 ms full (an inline drawer at `full` has
|
|
10428
|
+
* no motion; see `motion`), so a drawer without `size` takes 250 ms whatever width a class gives
|
|
10429
|
+
* it. Rendered as `data-size`. Drawer's default too.
|
|
9320
10430
|
* @default 'small'
|
|
9321
10431
|
*/
|
|
9322
10432
|
size?: DrawerSize;
|
|
@@ -9340,11 +10450,11 @@ export declare interface NavDrawerProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
9340
10450
|
*/
|
|
9341
10451
|
modalType?: Extract<ModalType, 'modal' | 'non-modal'>;
|
|
9342
10452
|
/**
|
|
9343
|
-
* Removes the panel when the drawer closes. `false` keeps it
|
|
9344
|
-
* and `inert`, so the state of what is inside survives, and a
|
|
9345
|
-
* `aria-controls` at it at all times: always for an inline drawer,
|
|
9346
|
-
* hydrated for an overlay (whose panel is not in the server HTML).
|
|
9347
|
-
* Drawer's default too.
|
|
10453
|
+
* Removes the panel when the drawer closes, once its exit motion has ended. `false` keeps it
|
|
10454
|
+
* mounted while closed, out of view and `inert`, so the state of what is inside survives, and a
|
|
10455
|
+
* Hamburger outside can point `aria-controls` at it at all times: always for an inline drawer,
|
|
10456
|
+
* and once the page has hydrated for an overlay (whose panel is not in the server HTML).
|
|
10457
|
+
* Fluent's `unmountOnClose`. Drawer's default too.
|
|
9348
10458
|
* @default true
|
|
9349
10459
|
*/
|
|
9350
10460
|
unmountOnClose?: boolean;
|
|
@@ -9362,6 +10472,43 @@ export declare interface NavDrawerProps extends Omit<React_2.HTMLAttributes<HTML
|
|
|
9362
10472
|
backdrop?: Slot<'div'> | (SlotObject<'div'> & {
|
|
9363
10473
|
appearance?: BackdropAppearance;
|
|
9364
10474
|
});
|
|
10475
|
+
/**
|
|
10476
|
+
* The drawer's motion, as Drawer's. By default an overlay panel slides in from beyond its edge
|
|
10477
|
+
* and fades in with a decelerating curve, and slides back out and fades out with an accelerating
|
|
10478
|
+
* curve; the `start` and `end` edges follow the text direction, `left` and `right` do not
|
|
10479
|
+
* mirror, and a `bottom` panel rises from below. An inline drawer by default opens the space it
|
|
10480
|
+
* takes in your layout from nothing (its width at a side, its height at the bottom) while its
|
|
10481
|
+
* panel fades in, held at its size against its inner edge, so it reads as sliding out from that
|
|
10482
|
+
* edge, with a decelerating curve; closing runs the same backwards with an accelerating curve.
|
|
10483
|
+
* Both take a duration that follows `size` both ways: 250 ms small (also without `size`), 300 ms
|
|
10484
|
+
* medium, 400 ms large, 500 ms full. An inline drawer at `full` has no motion, as its size is
|
|
10485
|
+
* its container's (a value here does not apply to it either), and an inline drawer whose width
|
|
10486
|
+
* (height at the bottom) in `className` is a percentage resizes oddly during the motion,
|
|
10487
|
+
* correctly once open: give it a length, or pass `null`. Under reduced motion the drawer appears
|
|
10488
|
+
* and disappears at once. `null` turns the motion off (the drawer still renders its
|
|
10489
|
+
* `data-presence` phases, which then end at once); a class string or `{ className }` replaces
|
|
10490
|
+
* the default classes with yours (see `MotionSlot`), also under a `WaveProvider` with
|
|
10491
|
+
* `motion="none"`, which otherwise turns the default off. They go on the overlay panel, or on
|
|
10492
|
+
* the element around an inline drawer's panel (`wave-nav-drawer__collapse`), whose phases the
|
|
10493
|
+
* drawer waits for. A `className` that holds `data-[presence=…]` classes while `motion` is unset
|
|
10494
|
+
* keeps 0.14's behaviour: no default motion, your classes animate the panel, and the drawer
|
|
10495
|
+
* waits for the panel's motion (inline too, not the element around it). Fluent's
|
|
10496
|
+
* `OverlayDrawer` and `InlineDrawer` `surfaceMotion`.
|
|
10497
|
+
* @default the slide (overlay) or the collapse (inline) above
|
|
10498
|
+
*/
|
|
10499
|
+
motion?: MotionSlot | null;
|
|
10500
|
+
/**
|
|
10501
|
+
* The backdrop's motion (a modal overlay), as Drawer's. By default it fades in and out with a
|
|
10502
|
+
* linear curve over the panel's duration (250 to 500 ms, by `size`), so it ends with the panel;
|
|
10503
|
+
* under reduced motion it appears and disappears at once. `null` turns the motion off; a class
|
|
10504
|
+
* string or `{ className }` replaces the default classes with yours (see `MotionSlot`), also
|
|
10505
|
+
* under a `WaveProvider` with `motion="none"`, which otherwise turns the default off. The
|
|
10506
|
+
* panel's motion decides when the drawer unmounts or hides: a replacement longer than the
|
|
10507
|
+
* panel's exit is cut off there. Ignored, with a development warning, by a non-modal or inline
|
|
10508
|
+
* drawer. Fluent's `OverlayDrawer` `backdropMotion`.
|
|
10509
|
+
* @default the fade above
|
|
10510
|
+
*/
|
|
10511
|
+
backdropMotion?: MotionSlot | null;
|
|
9365
10512
|
/**
|
|
9366
10513
|
* Name of the navigation landmark (and of an overlay's dialog). Localize it; rename it when the
|
|
9367
10514
|
* page has another navigation landmark (two with one name are ambiguous). An `aria-labelledby`
|
|
@@ -9491,11 +10638,14 @@ export declare interface NavItemOwnProps {
|
|
|
9491
10638
|
* never inside it, in a group named by the item; each is a Tab stop after the item, and a click
|
|
9492
10639
|
* or key on one never selects the item. They are drawn while the row is hovered or has focus,
|
|
9493
10640
|
* while one of them is pressed or has its popup open, and always in forced colours and on touch
|
|
9494
|
-
* screens; otherwise they are transparent and still focusable. They
|
|
9495
|
-
*
|
|
9496
|
-
*
|
|
9497
|
-
*
|
|
9498
|
-
*
|
|
10641
|
+
* screens; otherwise they are transparent and still focusable. They fade in and out over 150 ms
|
|
10642
|
+
* (at once under reduced motion or a `WaveProvider` with `motion="none"`); the fade sets the
|
|
10643
|
+
* transition of each direct child of the group, so a transition of your own on one is replaced.
|
|
10644
|
+
* They stay enabled when the item is `disabled`. With actions, the selected background and
|
|
10645
|
+
* indicator are drawn on the row (the item's list item, `.wave-nav-item__list-item`), so a
|
|
10646
|
+
* `className` on the item no longer covers them. Content that renders nothing renders no group.
|
|
10647
|
+
* Fluent's `actionButton`, `toggleButton` and `menuButton` slots and their tooltips are your own
|
|
10648
|
+
* controls here.
|
|
9499
10649
|
*/
|
|
9500
10650
|
actions?: React_2.ReactNode;
|
|
9501
10651
|
}
|
|
@@ -9705,7 +10855,9 @@ export declare interface OpenChangeDetails<R extends string = string> {
|
|
|
9705
10855
|
*
|
|
9706
10856
|
* Options register with the surrounding listbox (in DOM order, groups included), so they can be
|
|
9707
10857
|
* wrapped, grouped or rendered conditionally. The option is memoized: moving the highlight
|
|
9708
|
-
* re-renders only the previously and the newly active option.
|
|
10858
|
+
* re-renders only the previously and the newly active option. In a windowed list (the
|
|
10859
|
+
* `virtualWindow` of Listbox, Combobox or Dropdown) the option is exactly the window's `itemSize`
|
|
10860
|
+
* tall, a height set after its own `style`, so its content must fit in it.
|
|
9709
10861
|
*
|
|
9710
10862
|
* Styling: `className` comes last. A plain background class (`className="bg-primary"`) replaces
|
|
9711
10863
|
* the built-in hover, selected and active backgrounds in every state. To restyle one state only,
|
|
@@ -10448,6 +11600,8 @@ export declare type PolymorphicProps<C extends React_2.ElementType, OwnProps> =
|
|
|
10448
11600
|
* moving into the content). Name the content with `title` or `aria-label`.
|
|
10449
11601
|
* - **Custom anchors:** `target` places it at another element or at a `VirtualElement` (a point, a
|
|
10450
11602
|
* text selection); with a controlled `open` it needs no trigger.
|
|
11603
|
+
* - **Motion:** the content fades and slides in from its trigger and back out as it closes;
|
|
11604
|
+
* `Popover.Content`'s `motion` turns it off or replaces it.
|
|
10451
11605
|
*
|
|
10452
11606
|
* @example
|
|
10453
11607
|
* <Popover>
|
|
@@ -10464,7 +11618,7 @@ export declare const Popover: {
|
|
|
10464
11618
|
displayName: string;
|
|
10465
11619
|
};
|
|
10466
11620
|
Content: {
|
|
10467
|
-
({ children, title, id: idProp, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onKeyDown, onContextMenu, onPointerEnter, onPointerLeave, ref, ...rest }: PopoverContentProps): React_2.JSX.Element | null;
|
|
11621
|
+
({ children, title, id: idProp, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onKeyDown, onContextMenu, onPointerEnter, onPointerLeave, motion, ref, ...rest }: PopoverContentProps): React_2.JSX.Element | null;
|
|
10468
11622
|
displayName: string;
|
|
10469
11623
|
};
|
|
10470
11624
|
};
|
|
@@ -10497,11 +11651,25 @@ export declare const Popover: {
|
|
|
10497
11651
|
* `target` it is placed at the target and, without a trigger, follows a target element in the
|
|
10498
11652
|
* keyboard order.
|
|
10499
11653
|
*
|
|
11654
|
+
* It moves in and out: the surface fades in and slides 4px away from its trigger over 200 ms, and
|
|
11655
|
+
* fades out and slides back over 100 ms, on the side it opened on (`data-side`); a popover open by
|
|
11656
|
+
* default animates in when it mounts in the browser. Under reduced motion it appears and
|
|
11657
|
+
* disappears at once. `motion` turns the motion off (`null`) or replaces its classes, and a
|
|
11658
|
+
* `WaveProvider` with `motion="none"` turns the default off. The surface mounts through the
|
|
11659
|
+
* presence core (`usePresence`): it carries `data-presence="entering" | "entered" | "exiting"` and
|
|
11660
|
+
* `data-state="open"`, and while it closes `data-state="closed"` and `inert`, so it stays on
|
|
11661
|
+
* screen, where it was, until its exit motion ends. Focus, the dismiss layer, the trigger's
|
|
11662
|
+
* `aria-expanded` and `aria-controls`, and positioning follow the open state, not the exit: focus
|
|
11663
|
+
* inside a closing popover moves, in the commit that closes it, to where the popover returns
|
|
11664
|
+
* focus (so a Dialog opened by a button of the popover as it closes returns focus there too, not
|
|
11665
|
+
* to that button), and a hover close moves no focus. Without motion it unmounts as soon as it
|
|
11666
|
+
* closes.
|
|
11667
|
+
*
|
|
10500
11668
|
* Also exported as `PopoverContent` for React Server Components, which cannot use the dotted
|
|
10501
11669
|
* `Popover.Content` (that needs a client file).
|
|
10502
11670
|
*/
|
|
10503
11671
|
export declare const PopoverContent: {
|
|
10504
|
-
({ children, title, id: idProp, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onKeyDown, onContextMenu, onPointerEnter, onPointerLeave, ref, ...rest }: PopoverContentProps): React_2.JSX.Element | null;
|
|
11672
|
+
({ children, title, id: idProp, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onKeyDown, onContextMenu, onPointerEnter, onPointerLeave, motion, ref, ...rest }: PopoverContentProps): React_2.JSX.Element | null;
|
|
10505
11673
|
displayName: string;
|
|
10506
11674
|
};
|
|
10507
11675
|
|
|
@@ -10527,6 +11695,17 @@ export declare interface PopoverContentProps extends Omit<React_2.HTMLAttributes
|
|
|
10527
11695
|
title?: React_2.ReactNode;
|
|
10528
11696
|
/** Id of the surface; the trigger's `aria-controls` follows it. Defaults to a generated id. */
|
|
10529
11697
|
id?: string;
|
|
11698
|
+
/**
|
|
11699
|
+
* The popover's motion. By default it fades in and slides 4px away from its trigger, on the
|
|
11700
|
+
* side it opened on, over 200 ms with a decelerating curve, and fades out and slides back over
|
|
11701
|
+
* 100 ms with an accelerating curve; under reduced motion it appears and disappears at once.
|
|
11702
|
+
* `null` turns the motion off (the surface still renders its `data-presence` phases, which then
|
|
11703
|
+
* end at once); a class string or `{ className }` replaces the default classes with yours (see
|
|
11704
|
+
* `MotionSlot`), also under a `WaveProvider` with `motion="none"`, which otherwise turns the
|
|
11705
|
+
* default off. Fluent's `Popover` `surfaceMotion`.
|
|
11706
|
+
* @default the fade and slide above
|
|
11707
|
+
*/
|
|
11708
|
+
motion?: MotionSlot | null;
|
|
10530
11709
|
/** Ref to the popover surface. */
|
|
10531
11710
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
10532
11711
|
}
|
|
@@ -10961,7 +12140,8 @@ export declare type PresenceStatus = 'available' | 'busy' | 'away' | 'offline' |
|
|
|
10961
12140
|
* a Field's wrapper element, the bar gets an id of its own and leaves the Field's
|
|
10962
12141
|
* `<label htmlFor>` to that control.
|
|
10963
12142
|
* - The indeterminate animation follows the writing direction and becomes a full-width pulse for
|
|
10964
|
-
* reduced motion. In forced-colors mode the fill
|
|
12143
|
+
* reduced motion; `indeterminateMotion` replaces or removes it. In forced-colors mode the fill
|
|
12144
|
+
* uses `Highlight` and the track gets a border.
|
|
10965
12145
|
*
|
|
10966
12146
|
* @example
|
|
10967
12147
|
* <ProgressBar value={uploaded} max={total} label="Uploading photos" showLabel />
|
|
@@ -10972,7 +12152,7 @@ export declare type PresenceStatus = 'available' | 'busy' | 'away' | 'offline' |
|
|
|
10972
12152
|
* </Field>
|
|
10973
12153
|
*/
|
|
10974
12154
|
export declare const ProgressBar: {
|
|
10975
|
-
({ value, max, label, showLabel, color, id, "aria-describedby": ariaDescribedBy, "aria-invalid": _ariaInvalid, "aria-required": _ariaRequired, className, ref, ...rest }: ProgressBarProps): React_2.JSX.Element;
|
|
12155
|
+
({ value, max, label, showLabel, color, indeterminateMotion, id, "aria-describedby": ariaDescribedBy, "aria-invalid": _ariaInvalid, "aria-required": _ariaRequired, className, ref, ...rest }: ProgressBarProps): React_2.JSX.Element;
|
|
10976
12156
|
displayName: string;
|
|
10977
12157
|
};
|
|
10978
12158
|
|
|
@@ -11026,6 +12206,19 @@ export declare interface ProgressBarProps extends React_2.HTMLAttributes<HTMLDiv
|
|
|
11026
12206
|
* @default 'brand'
|
|
11027
12207
|
*/
|
|
11028
12208
|
color?: ProgressBarColor;
|
|
12209
|
+
/**
|
|
12210
|
+
* Replaces the motion of the indeterminate fill (no `value`): by default a fill two fifths of
|
|
12211
|
+
* the track wide sweeps across it, mirrored in right-to-left, and becomes a full-width pulse
|
|
12212
|
+
* for reduced motion. The classes go on the fill and replace the whole default, its width and
|
|
12213
|
+
* its reduced-motion counterparts included. `null` draws a static full-width fill; a class
|
|
12214
|
+
* string or `{ className }` replaces the classes with plain animation classes (and a width) and
|
|
12215
|
+
* their reduced-motion counterparts (the fill has no presence phases). A
|
|
12216
|
+
* `WaveProvider` with `motion="none"` turns the default off (a static full-width fill), and a
|
|
12217
|
+
* value here still applies under it. A determinate bar has no motion and ignores it. Fluent's
|
|
12218
|
+
* ProgressBar `indeterminateMotion` takes a motion slot the same way.
|
|
12219
|
+
* @default the sweep described above
|
|
12220
|
+
*/
|
|
12221
|
+
indeterminateMotion?: MotionSlot | null;
|
|
11029
12222
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
11030
12223
|
}
|
|
11031
12224
|
|
|
@@ -12987,11 +14180,12 @@ export declare type SwitchSize = Extract<Size, 'small' | 'medium'>;
|
|
|
12987
14180
|
* `Table.CellActions` shows a cell's actions while its row is hovered or holds focus.
|
|
12988
14181
|
*
|
|
12989
14182
|
* Sub-components are available as `Table.Header`, `Table.HeaderCell`, `Table.Body`, `Table.Row`,
|
|
12990
|
-
* `Table.Cell`, `Table.SelectionCell`, `Table.CellLayout
|
|
14183
|
+
* `Table.Cell`, `Table.SelectionCell`, `Table.CellLayout`, `Table.CellActions` and
|
|
14184
|
+
* `Table.ResizeHandle` (the separator that resizes a column, for a header cell's `aside`) in client
|
|
12991
14185
|
* components, and as the flat exports `TableHeader`, `TableHeaderCell`, `TableBody`, `TableRow`,
|
|
12992
|
-
* `TableCell`, `TableSelectionCell`, `TableCellLayout
|
|
12993
|
-
* Server Components can import). `Table.Head`/`Table.HeadCell`
|
|
12994
|
-
* deprecated aliases.
|
|
14186
|
+
* `TableCell`, `TableSelectionCell`, `TableCellLayout`, `TableCellActions` and
|
|
14187
|
+
* `TableResizeHandle` (the form React Server Components can import). `Table.Head`/`Table.HeadCell`
|
|
14188
|
+
* (`TableHead`/`TableHeadCell`) are deprecated aliases.
|
|
12995
14189
|
*/
|
|
12996
14190
|
export declare const Table: {
|
|
12997
14191
|
({ striped, containerProps, children, className, ref, ...props }: TableProps): React_2.JSX.Element;
|
|
@@ -13039,6 +14233,10 @@ export declare const Table: {
|
|
|
13039
14233
|
({ visible, className, ref, ...rest }: TableCellActionsProps): React_2.JSX.Element;
|
|
13040
14234
|
displayName: string;
|
|
13041
14235
|
};
|
|
14236
|
+
ResizeHandle: {
|
|
14237
|
+
({ width, minWidth, maxWidth, onResize, onReset, onLeave, label, valueText, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onLostPointerCapture, onDoubleClick, onKeyDown, onKeyUp, onBlur, className, ref, ...rest }: TableResizeHandleProps): React_2.JSX.Element;
|
|
14238
|
+
displayName: string;
|
|
14239
|
+
};
|
|
13042
14240
|
};
|
|
13043
14241
|
|
|
13044
14242
|
/** The table's `<tbody>`. */
|
|
@@ -13168,6 +14366,86 @@ export declare const tableClassNames: {
|
|
|
13168
14366
|
readonly container: "wave-table__container";
|
|
13169
14367
|
};
|
|
13170
14368
|
|
|
14369
|
+
/**
|
|
14370
|
+
* The column widths of {@link useTableFeatures} (`state.columnSizing`), filled by
|
|
14371
|
+
* `useTableColumnSizing`. Without that plugin no width is set and the functions do nothing.
|
|
14372
|
+
*/
|
|
14373
|
+
export declare interface TableColumnSizingState {
|
|
14374
|
+
/**
|
|
14375
|
+
* The width of every column in pixels, by `columnId`: the width that is state, else the
|
|
14376
|
+
* column's initial width.
|
|
14377
|
+
*/
|
|
14378
|
+
columnWidths: Readonly<Record<string, number>>;
|
|
14379
|
+
/** Whether a width is state (set, controlled or given as a default). */
|
|
14380
|
+
isSized: boolean;
|
|
14381
|
+
/** The width of the column `columnId` in pixels, or `undefined` when it is no column. */
|
|
14382
|
+
getColumnWidth(columnId: string): number | undefined;
|
|
14383
|
+
/**
|
|
14384
|
+
* Sets the width of the column `columnId` in pixels. Without `event`, the change's details carry
|
|
14385
|
+
* an untrusted `resize` event with no target.
|
|
14386
|
+
*/
|
|
14387
|
+
setColumnWidth(columnId: string, width: number, event?: Event): void;
|
|
14388
|
+
/** Props for the table element: its fixed layout and width style. */
|
|
14389
|
+
getTableProps(): {
|
|
14390
|
+
style: CSSProperties;
|
|
14391
|
+
};
|
|
14392
|
+
/** Props for the column's `<col>` element: its width style. */
|
|
14393
|
+
getColumnProps(columnId: string): {
|
|
14394
|
+
style: CSSProperties;
|
|
14395
|
+
};
|
|
14396
|
+
/** Props for the resize handle of the column `columnId`. */
|
|
14397
|
+
getResizeHandleProps(columnId: string): TableResizeHandleBindings;
|
|
14398
|
+
}
|
|
14399
|
+
|
|
14400
|
+
/** What {@link UseTableColumnSizingOptions.onColumnWidthsChange} gets besides the new widths. */
|
|
14401
|
+
export declare interface TableColumnWidthsChangeDetails {
|
|
14402
|
+
/** The column that was resized. */
|
|
14403
|
+
columnId: string;
|
|
14404
|
+
/** Its new width in pixels, held at or above its `minWidth`. */
|
|
14405
|
+
width: number;
|
|
14406
|
+
/**
|
|
14407
|
+
* The event behind the change (the drag, the key press); when none was passed, an untrusted
|
|
14408
|
+
* `resize` event with no target.
|
|
14409
|
+
*/
|
|
14410
|
+
event: Event;
|
|
14411
|
+
}
|
|
14412
|
+
|
|
14413
|
+
/**
|
|
14414
|
+
* A feature of {@link useTableFeatures}, returned by `useTableSort`, `useTableSelection` and
|
|
14415
|
+
* `useTableColumnSizing`, which hold the feature's state where they are called. The object is
|
|
14416
|
+
* opaque. It keeps its identity while the feature's state and the options it reads keep theirs; a
|
|
14417
|
+
* new one costs `useTableFeatures` a recompute of its state, and of the rows only when the sort
|
|
14418
|
+
* changed. `T` is the item type the plugin reads (a selection's `isDisabled`): a plugin that reads
|
|
14419
|
+
* no item, such as the sort, fits every table.
|
|
14420
|
+
*/
|
|
14421
|
+
export declare interface TableFeaturePlugin<T> {
|
|
14422
|
+
/** The brand of a plugin: only the plugin hooks create one. */
|
|
14423
|
+
readonly [tableFeaturePluginBrand]: (item: T) => void;
|
|
14424
|
+
}
|
|
14425
|
+
|
|
14426
|
+
declare const tableFeaturePluginBrand: unique symbol;
|
|
14427
|
+
|
|
14428
|
+
/** The state that {@link useTableFeatures} returns. */
|
|
14429
|
+
export declare interface TableFeaturesState<T> {
|
|
14430
|
+
/** The items, as given. */
|
|
14431
|
+
items: readonly T[];
|
|
14432
|
+
/** The columns, as given. */
|
|
14433
|
+
columns: readonly DataGridColumn<T>[];
|
|
14434
|
+
/** The row id of an item: `getRowId` as given, else the index as a string. */
|
|
14435
|
+
getRowId: (item: T, index: number) => string;
|
|
14436
|
+
/**
|
|
14437
|
+
* The rows in display order: sorted while `useTableSort` sorts them, else in the order of
|
|
14438
|
+
* `items`. The same array is returned until `items`, `getRowId`, `columns` or the sort change.
|
|
14439
|
+
*/
|
|
14440
|
+
getRows(): readonly TableRowData<T>[];
|
|
14441
|
+
/** The sort; without `useTableSort` it is `null` and its functions do nothing. */
|
|
14442
|
+
sort: TableSortState;
|
|
14443
|
+
/** The selection; without `useTableSelection` nothing is selected and its functions do nothing. */
|
|
14444
|
+
selection: TableSelectionState;
|
|
14445
|
+
/** The column widths; without `useTableColumnSizing` no width is set. */
|
|
14446
|
+
columnSizing: TableColumnSizingState;
|
|
14447
|
+
}
|
|
14448
|
+
|
|
13171
14449
|
/** @deprecated Use `Table.Header` (`TableHeader`). */
|
|
13172
14450
|
export declare const TableHead: {
|
|
13173
14451
|
(props: TableHeadProps): React_2.JSX.Element;
|
|
@@ -13286,6 +14564,110 @@ export declare interface TableProps extends React_2.HTMLAttributes<HTMLTableElem
|
|
|
13286
14564
|
ref?: React_2.Ref<HTMLTableElement>;
|
|
13287
14565
|
}
|
|
13288
14566
|
|
|
14567
|
+
/**
|
|
14568
|
+
* The drag handle of a column's edge: a vertical `role="separator"` with `aria-valuenow`, meant
|
|
14569
|
+
* for the `aside` slot of a `Table.HeaderCell` whose cell is positioned, since the handle is drawn
|
|
14570
|
+
* along the cell's end edge. A DataGrid with `resizableColumns` renders it in the header cell of
|
|
14571
|
+
* each of its columns itself (a `DataGrid.HeaderCell` has no `aside` slot). A pointer drag (mouse,
|
|
14572
|
+
* touch or pen) resizes through `onResize`, with the movement mirrored in right-to-left tables;
|
|
14573
|
+
* the arrow keys move the edge by 20 pixels (5 with Shift), Home sets the minimum width and End
|
|
14574
|
+
* the maximum one. A double click calls `onReset`. The handle is a Tab stop (`tabIndex` 0), so the
|
|
14575
|
+
* keys work in a static table; a grid that manages its own tab stops overrides `tabIndex`. The
|
|
14576
|
+
* handle carries `data-grid-auxiliary`, so a grid's cell navigation does not take it for the
|
|
14577
|
+
* cell's own widget.
|
|
14578
|
+
*
|
|
14579
|
+
* It keeps no width: spread the result of `useTableColumnSizing`'s `getResizeHandleProps(columnId)`
|
|
14580
|
+
* onto it, or pass `width`, `minWidth` and `onResize` from your own state.
|
|
14581
|
+
*/
|
|
14582
|
+
export declare const TableResizeHandle: {
|
|
14583
|
+
({ width, minWidth, maxWidth, onResize, onReset, onLeave, label, valueText, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onLostPointerCapture, onDoubleClick, onKeyDown, onKeyUp, onBlur, className, ref, ...rest }: TableResizeHandleProps): React_2.JSX.Element;
|
|
14584
|
+
displayName: string;
|
|
14585
|
+
};
|
|
14586
|
+
|
|
14587
|
+
/**
|
|
14588
|
+
* What a resize handle needs from the table state, as returned by
|
|
14589
|
+
* `columnSizing.getResizeHandleProps(columnId)`: the column's width and minimum, the callback
|
|
14590
|
+
* that sets a new width and the one that resets it. `Table.ResizeHandle` takes these props (and a few more).
|
|
14591
|
+
*/
|
|
14592
|
+
export declare interface TableResizeHandleBindings {
|
|
14593
|
+
/** The column's current width in pixels. */
|
|
14594
|
+
width: number;
|
|
14595
|
+
/** The narrowest the column can be, in pixels. */
|
|
14596
|
+
minWidth: number;
|
|
14597
|
+
/**
|
|
14598
|
+
* Sets the column's width in pixels (held at or above `minWidth`); `details.event` is the event
|
|
14599
|
+
* behind it (without `details`, an untrusted `resize` event is reported).
|
|
14600
|
+
*/
|
|
14601
|
+
onResize(width: number, details?: {
|
|
14602
|
+
event: Event;
|
|
14603
|
+
}): void;
|
|
14604
|
+
/**
|
|
14605
|
+
* Sets the column back to its initial width (a double click on the handle). It changes nothing
|
|
14606
|
+
* while no width is state, since the table is then in its initial layout.
|
|
14607
|
+
*/
|
|
14608
|
+
onReset?(details: {
|
|
14609
|
+
event: Event;
|
|
14610
|
+
}): void;
|
|
14611
|
+
}
|
|
14612
|
+
|
|
14613
|
+
/**
|
|
14614
|
+
* Table.ResizeHandle: `root` on the separator element that resizes a column (placed in the `aside`
|
|
14615
|
+
* of a header cell).
|
|
14616
|
+
*/
|
|
14617
|
+
export declare const tableResizeHandleClassNames: {
|
|
14618
|
+
readonly root: "wave-table-resize-handle";
|
|
14619
|
+
};
|
|
14620
|
+
|
|
14621
|
+
/** Properties for the TableResizeHandle sub-component. */
|
|
14622
|
+
export declare interface TableResizeHandleProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onResize' | 'onReset'> {
|
|
14623
|
+
/** The column's current width in pixels. It is reported as `aria-valuenow`. */
|
|
14624
|
+
width: number;
|
|
14625
|
+
/**
|
|
14626
|
+
* The narrowest the column can be, in pixels. The handle never asks for less, and Home sets it.
|
|
14627
|
+
* It is reported as `aria-valuemin`.
|
|
14628
|
+
* @default 0
|
|
14629
|
+
*/
|
|
14630
|
+
minWidth?: number;
|
|
14631
|
+
/**
|
|
14632
|
+
* The widest the column can be, in pixels. The handle never asks for more, and End sets it.
|
|
14633
|
+
* Without a maximum there is no `aria-valuemax` and End does nothing.
|
|
14634
|
+
*/
|
|
14635
|
+
maxWidth?: number;
|
|
14636
|
+
/**
|
|
14637
|
+
* Called with the width the user asks for, in whole pixels, held between `minWidth` and
|
|
14638
|
+
* `maxWidth`: while a pointer drags (at most once per animation frame) and for every handled
|
|
14639
|
+
* key, then `details` with the event behind it. The handle always passes `details`; it is typed
|
|
14640
|
+
* optional through 0.x, as every `details` argument. The handle keeps no width of its own, so a
|
|
14641
|
+
* parent that ignores the call leaves the column where it is.
|
|
14642
|
+
*/
|
|
14643
|
+
onResize: (width: number, details?: {
|
|
14644
|
+
event: Event;
|
|
14645
|
+
}) => void;
|
|
14646
|
+
/** Called with the event when the handle is double-clicked: reset the column's width. */
|
|
14647
|
+
onReset?: (details: {
|
|
14648
|
+
event: Event;
|
|
14649
|
+
}) => void;
|
|
14650
|
+
/**
|
|
14651
|
+
* Called when Escape is pressed on the handle, or Enter or Space is released on it after being
|
|
14652
|
+
* pressed there: move focus back to the header cell. Enter and Space are consumed from their
|
|
14653
|
+
* keydown on (their repeats included), so a held key never reaches the element that focus moves
|
|
14654
|
+
* to. Without it those keys are left to the handle's ancestors.
|
|
14655
|
+
*/
|
|
14656
|
+
onLeave?: () => void;
|
|
14657
|
+
/**
|
|
14658
|
+
* The accessible name of the separator.
|
|
14659
|
+
* @default 'Resize column'
|
|
14660
|
+
*/
|
|
14661
|
+
label?: string;
|
|
14662
|
+
/**
|
|
14663
|
+
* Builds `aria-valuetext` from the width.
|
|
14664
|
+
* @default (width) => `${width} pixels`
|
|
14665
|
+
*/
|
|
14666
|
+
valueText?: (width: number) => string;
|
|
14667
|
+
/** Ref to the `<div>` element. */
|
|
14668
|
+
ref?: React_2.Ref<HTMLDivElement>;
|
|
14669
|
+
}
|
|
14670
|
+
|
|
13289
14671
|
/**
|
|
13290
14672
|
* A table row. Striping comes from the table (`striped`), so rows need no context. The row is the
|
|
13291
14673
|
* `group/table-row` group whose hover or focus draws the subtle selection controls and the cell
|
|
@@ -13301,6 +14683,16 @@ export declare const tableRowClassNames: {
|
|
|
13301
14683
|
readonly root: "wave-table-row";
|
|
13302
14684
|
};
|
|
13303
14685
|
|
|
14686
|
+
/** One row of {@link useTableFeatures}: an item of `items` with its id. */
|
|
14687
|
+
export declare interface TableRowData<T> {
|
|
14688
|
+
/** The item. */
|
|
14689
|
+
item: T;
|
|
14690
|
+
/** The row's id, from `getRowId` (by default the index in `items`, as a string). */
|
|
14691
|
+
rowId: string;
|
|
14692
|
+
/** The item's index in `items`. Sorting moves the row, not this index. */
|
|
14693
|
+
index: number;
|
|
14694
|
+
}
|
|
14695
|
+
|
|
13304
14696
|
/** Properties for the TableRow sub-component. */
|
|
13305
14697
|
export declare interface TableRowProps extends React_2.HTMLAttributes<HTMLTableRowElement> {
|
|
13306
14698
|
/** Table cell elements. */
|
|
@@ -13414,6 +14806,59 @@ export declare interface TableSelectionCellProps extends Omit<React_2.TdHTMLAttr
|
|
|
13414
14806
|
ref?: React_2.Ref<HTMLTableCellElement>;
|
|
13415
14807
|
}
|
|
13416
14808
|
|
|
14809
|
+
/**
|
|
14810
|
+
* The selection of {@link useTableFeatures} (`state.selection`), filled by `useTableSelection`. The
|
|
14811
|
+
* selection is a set of row ids held apart from the rendered rows: rows that are not rendered keep
|
|
14812
|
+
* their state, and ids whose item is not in `items` (filtered out, on another page) stay selected.
|
|
14813
|
+
*/
|
|
14814
|
+
export declare interface TableSelectionState {
|
|
14815
|
+
/** `single` keeps at most one row selected; `multiple` selects rows independently. */
|
|
14816
|
+
selectionMode: SelectionMode_2;
|
|
14817
|
+
/** The selected row ids, ids whose item is not in `items` included. */
|
|
14818
|
+
selectedItems: ReadonlySet<string>;
|
|
14819
|
+
/**
|
|
14820
|
+
* Whether every selectable row of `items` is selected (and there is one): rows that
|
|
14821
|
+
* `isDisabled` marks do not count, rows that are not rendered do.
|
|
14822
|
+
*/
|
|
14823
|
+
allRowsSelected: boolean;
|
|
14824
|
+
/**
|
|
14825
|
+
* Whether a row of `items` is selected while not every selectable one is (the mixed state of a
|
|
14826
|
+
* select-all checkbox). A selected disabled row counts; ids outside `items` do not.
|
|
14827
|
+
*/
|
|
14828
|
+
someRowsSelected: boolean;
|
|
14829
|
+
/** Whether the row `id` is selected. */
|
|
14830
|
+
isRowSelected(id: string): boolean;
|
|
14831
|
+
/** Selects or deselects the row `id` (`multiple`); selects it (`single`). */
|
|
14832
|
+
toggleRow(id: string, event?: Event): void;
|
|
14833
|
+
/** Selects the row `id`; in `single` mode it replaces the selection. */
|
|
14834
|
+
selectRow(id: string, event?: Event): void;
|
|
14835
|
+
/** Deselects the row `id`. */
|
|
14836
|
+
deselectRow(id: string, event?: Event): void;
|
|
14837
|
+
/**
|
|
14838
|
+
* Selects every selectable row of `items` when not all of them are selected, else deselects
|
|
14839
|
+
* them. A disabled row keeps its state, and ids outside `items` stay selected. It does nothing in
|
|
14840
|
+
* `single` mode.
|
|
14841
|
+
*/
|
|
14842
|
+
toggleAllRows(event?: Event): void;
|
|
14843
|
+
/** Empties the selection, ids outside `items` included. */
|
|
14844
|
+
clearRows(event?: Event): void;
|
|
14845
|
+
}
|
|
14846
|
+
|
|
14847
|
+
/** The sort of {@link useTableFeatures} (`state.sort`), filled by `useTableSort`. */
|
|
14848
|
+
export declare interface TableSortState {
|
|
14849
|
+
/** The sorted column and its direction, or `null` while the rows are in the order of `items`. */
|
|
14850
|
+
value: DataGridSort | null;
|
|
14851
|
+
/** Sorts by the column `columnId` in `direction`. */
|
|
14852
|
+
setColumnSort(columnId: string, direction: SortDirection, event?: Event): void;
|
|
14853
|
+
/**
|
|
14854
|
+
* Sorts by the column `columnId`, as a sortable header of DataGrid does: ascending, or descending
|
|
14855
|
+
* when the column is already sorted ascending.
|
|
14856
|
+
*/
|
|
14857
|
+
toggleColumnSort(columnId: string, event?: Event): void;
|
|
14858
|
+
/** The direction of the column `columnId` while the rows are sorted by it, else `undefined`. */
|
|
14859
|
+
getSortDirection(columnId: string): SortDirection | undefined;
|
|
14860
|
+
}
|
|
14861
|
+
|
|
13417
14862
|
/**
|
|
13418
14863
|
* A set of tabs with their panels (WAI-ARIA Tabs pattern): the arrow keys (Left/Right, mirrored
|
|
13419
14864
|
* in RTL; Up/Down when vertical), Home and End move focus and select (automatic activation); with
|
|
@@ -13430,15 +14875,20 @@ export declare interface TableSelectionCellProps extends Omit<React_2.TdHTMLAttr
|
|
|
13430
14875
|
* a Panel that ends up inside the tablist). Content that is not a tab, such as a button next to
|
|
13431
14876
|
* the tabs, does not belong in a tablist either: render it outside the TabList.
|
|
13432
14877
|
*
|
|
14878
|
+
* In the `transparent` appearance the selected tab draws its line with its after pseudo-element,
|
|
14879
|
+
* over a transparent 2px border on its bottom edge (its start edge when vertical), so the tab keeps
|
|
14880
|
+
* the box it has without the line; a class that recolours the line targets that pseudo-element's
|
|
14881
|
+
* border. When the selection moves, the line slides from the tab selected before (`motion`).
|
|
14882
|
+
*
|
|
13433
14883
|
* Sub-components are also exported under flat names (`TabListTab`, `TabListPanel`,
|
|
13434
14884
|
* `TabListPanels`) for React Server Components, which cannot use the dotted form.
|
|
13435
14885
|
*/
|
|
13436
14886
|
export declare const TabList: {
|
|
13437
|
-
({ value: valueProp, defaultValue: defaultValueProp, onValueChange, orientation: orientationProp, appearance, size, selectTabOnFocus, selectedValue, defaultSelectedValue, onTabSelect, vertical, className, children, onKeyDown, onFocus, ref, ...rest }: TabListProps): React_2.JSX.Element;
|
|
14887
|
+
({ value: valueProp, defaultValue: defaultValueProp, onValueChange, orientation: orientationProp, appearance, size, selectTabOnFocus, motion, selectedValue, defaultSelectedValue, onTabSelect, vertical, className, children, onKeyDown, onFocus, ref, ...rest }: TabListProps): React_2.JSX.Element;
|
|
13438
14888
|
displayName: string;
|
|
13439
14889
|
} & {
|
|
13440
14890
|
Tab: {
|
|
13441
|
-
({ value, id: idProp, icon, className, children, onClick, ref, ...rest }: TabProps): React_2.JSX.Element;
|
|
14891
|
+
({ value, id: idProp, icon, className, style, children, onClick, ref, ...rest }: TabProps): React_2.JSX.Element;
|
|
13442
14892
|
displayName: string;
|
|
13443
14893
|
};
|
|
13444
14894
|
Panel: {
|
|
@@ -13537,6 +14987,22 @@ export declare interface TabListProps extends Omit<React_2.HTMLAttributes<HTMLDi
|
|
|
13537
14987
|
* @default true
|
|
13538
14988
|
*/
|
|
13539
14989
|
selectTabOnFocus?: boolean;
|
|
14990
|
+
/**
|
|
14991
|
+
* Replaces the slide of the selected tab's line in the `transparent` appearance (the other
|
|
14992
|
+
* appearances have no line and do not move): by default, when the selection moves, the line
|
|
14993
|
+
* slides and stretches from the tab selected before to the new one, over the slow duration
|
|
14994
|
+
* (300 ms) with the max decelerating curve. The classes go on the selected tab and time its
|
|
14995
|
+
* line, the tab's after pseudo-element (write them with the after variant, and a reduced-motion
|
|
14996
|
+
* counterpart); the line starts from the previous tab through two custom properties the
|
|
14997
|
+
* TabList writes for one frame. `null` turns the slide off (the line moves at once); a class
|
|
14998
|
+
* string or `{ className }` replaces the classes with plain transition classes for the line, as
|
|
14999
|
+
* above (it has no presence phases). A
|
|
15000
|
+
* `WaveProvider` with `motion="none"` turns the default off, and a value here still applies
|
|
15001
|
+
* under it. The line also moves at once while the user prefers reduced motion. Fluent's
|
|
15002
|
+
* TabList slides its indicator with no prop to turn it off: this prop is a WaveUI addition.
|
|
15003
|
+
* @default the slide described above
|
|
15004
|
+
*/
|
|
15005
|
+
motion?: MotionSlot | null;
|
|
13540
15006
|
/** @deprecated Use `value`. */
|
|
13541
15007
|
selectedValue?: string;
|
|
13542
15008
|
/** @deprecated Use `defaultValue`. */
|
|
@@ -13560,7 +15026,7 @@ export declare interface TabListProps extends Omit<React_2.HTMLAttributes<HTMLDi
|
|
|
13560
15026
|
* with its value is mounted.
|
|
13561
15027
|
*/
|
|
13562
15028
|
export declare const TabListTab: {
|
|
13563
|
-
({ value, id: idProp, icon, className, children, onClick, ref, ...rest }: TabProps): React_2.JSX.Element;
|
|
15029
|
+
({ value, id: idProp, icon, className, style, children, onClick, ref, ...rest }: TabProps): React_2.JSX.Element;
|
|
13564
15030
|
displayName: string;
|
|
13565
15031
|
};
|
|
13566
15032
|
|
|
@@ -14638,6 +16104,19 @@ export declare type TagSize = Extract<Size, 'extra-small' | 'small' | 'medium'>;
|
|
|
14638
16104
|
* With no control at or before the target, the popover is reached where it is portaled, at the
|
|
14639
16105
|
* end of the page: Tab from the page's last control and Shift+Tab from outside the page enter
|
|
14640
16106
|
* it.
|
|
16107
|
+
* - **Motion.** The surface fades in over 200 ms and out over 100 ms as it closes; pointed at a
|
|
16108
|
+
* target (or the Trigger) it also slides 4px away from it on the side it opened on
|
|
16109
|
+
* (`data-side`), and back. Under reduced motion it appears and disappears at once. `motion` (on
|
|
16110
|
+
* TeachingPopover for the surface it renders, or on `TeachingPopover.Surface`) turns it off
|
|
16111
|
+
* (`null`) or replaces its classes, and a `WaveProvider` with `motion="none"` turns the default
|
|
16112
|
+
* off. The surface mounts through the presence core: it carries `data-presence` and
|
|
16113
|
+
* `data-state="open"`, and while it closes `data-state="closed"` and `inert`, so it stays on
|
|
16114
|
+
* screen, where it was and on the step it closed on, until its exit ends. Escape, focus and the
|
|
16115
|
+
* Trigger's `aria-expanded` follow the open state, not the exit: focus inside a closing popover
|
|
16116
|
+
* moves, in the commit that closes it, to where it returns focus. A popover open by default
|
|
16117
|
+
* animates in when it mounts in the browser, and one opened again during its exit enters again
|
|
16118
|
+
* on the same surface (on its first step, as every opening). Without motion it unmounts as soon
|
|
16119
|
+
* as it closes.
|
|
14641
16120
|
* - **Parts** (Fluent's composition): `TeachingPopover.Trigger` opens and closes the popover, gets
|
|
14642
16121
|
* focus back when it closes and, without a `target`, is what it points at; written directly
|
|
14643
16122
|
* inside TeachingPopover (a Fragment is fine), it makes the popover start closed (`defaultOpen`
|
|
@@ -14695,7 +16174,7 @@ export declare type TagSize = Extract<Size, 'extra-small' | 'small' | 'medium'>;
|
|
|
14695
16174
|
* </TeachingPopover>
|
|
14696
16175
|
*/
|
|
14697
16176
|
export declare const TeachingPopover: {
|
|
14698
|
-
({ steps, activeStep: activeStepProp, defaultActiveStep, currentStep, defaultCurrentStep, onStepChange, onDismiss, onFinish, primaryAction: primaryActionProp, secondaryAction: secondaryActionProp, footerLayout, open: openProp, defaultOpen, onOpenChange, closeLabel, labels, target: targetProp, positioning, side, align, children, id, className, style, onKeyDown, ref, ...rest }: TeachingPopoverProps): JSX.Element;
|
|
16177
|
+
({ steps, activeStep: activeStepProp, defaultActiveStep, currentStep, defaultCurrentStep, onStepChange, onDismiss, onFinish, primaryAction: primaryActionProp, secondaryAction: secondaryActionProp, footerLayout, open: openProp, defaultOpen, onOpenChange, closeLabel, labels, target: targetProp, positioning, side, align, children, id, className, style, onKeyDown, motion, ref, ...rest }: TeachingPopoverProps): JSX.Element;
|
|
14699
16178
|
displayName: string;
|
|
14700
16179
|
} & {
|
|
14701
16180
|
Trigger: {
|
|
@@ -15215,11 +16694,25 @@ export declare interface TeachingPopoverProps extends React_2.HTMLAttributes<HTM
|
|
|
15215
16694
|
* @default `{ offset: 12 }`
|
|
15216
16695
|
*/
|
|
15217
16696
|
positioning?: PopupPositioning;
|
|
16697
|
+
/**
|
|
16698
|
+
* The motion of the surface TeachingPopover renders (next to a `TeachingPopover.Surface` it is
|
|
16699
|
+
* ignored, with a development warning: give it to the Surface). By default the surface fades in
|
|
16700
|
+
* over 200 ms with a decelerating curve and out over 100 ms with an accelerating curve, and,
|
|
16701
|
+
* pointed at a target (or the Trigger), also slides 4px away from it on the side it opened on,
|
|
16702
|
+
* and back as it closes; under reduced motion it appears and disappears at once. `null` turns
|
|
16703
|
+
* the motion off (the surface still renders its `data-presence` phases, which then end at
|
|
16704
|
+
* once); a class string or `{ className }` replaces the default classes with yours (see
|
|
16705
|
+
* `MotionSlot`), also under a `WaveProvider` with `motion="none"`, which otherwise turns the
|
|
16706
|
+
* default off. Fluent's `TeachingPopover` `surfaceMotion` (a TeachingPopover is a Popover
|
|
16707
|
+
* there).
|
|
16708
|
+
* @default the fade and slide above
|
|
16709
|
+
*/
|
|
16710
|
+
motion?: MotionSlot | null;
|
|
15218
16711
|
/**
|
|
15219
16712
|
* `TeachingPopover.Trigger` and `TeachingPopover.Surface` (Fluent's composition), rendered where
|
|
15220
16713
|
* they are written. Without a `TeachingPopover.Surface` among them, the popover renders its
|
|
15221
16714
|
* surface itself, after the children, with the element props given here (`className`, `style`,
|
|
15222
|
-
* `ref`, …); with one (best written directly inside, a Fragment is fine: see
|
|
16715
|
+
* `ref`, `motion`, …); with one (best written directly inside, a Fragment is fine: see
|
|
15223
16716
|
* `TeachingPopover.Surface`), the Surface takes them instead.
|
|
15224
16717
|
*/
|
|
15225
16718
|
children?: React_2.ReactNode;
|
|
@@ -15251,19 +16744,19 @@ export declare interface TeachingPopoverStep {
|
|
|
15251
16744
|
/**
|
|
15252
16745
|
* The popover surface (Fluent's `TeachingPopoverSurface`): the non-modal `role="dialog"` element
|
|
15253
16746
|
* that the `steps` form renders, with the same behaviour (in place, or portaled next to the
|
|
15254
|
-
* target with a beak; focus, dismissal, keyboard order
|
|
15255
|
-
* `className`, `style`, `ref` and other props reach the element the `steps` form gives
|
|
16747
|
+
* target with a beak; focus, dismissal, keyboard order, step announcements and motion), so your
|
|
16748
|
+
* `className`, `style`, `ref`, `motion` and other props reach the element the `steps` form gives
|
|
15256
16749
|
* TeachingPopover's own. Without children it shows the current step as the `steps` form does;
|
|
15257
16750
|
* children replace that content: build it from `TeachingPopover.Header`, `Title`, `Body` and
|
|
15258
16751
|
* `Footer`, or from your own (then name the surface with `aria-label` or `aria-labelledby`).
|
|
15259
16752
|
*
|
|
15260
16753
|
* Render one inside TeachingPopover; TeachingPopover then renders no surface of its own, and its
|
|
15261
|
-
* own `className`, `style`, `ref` and other element props are ignored (a development
|
|
15262
|
-
* so). Write it directly inside TeachingPopover (a Fragment is fine) where you can:
|
|
15263
|
-
* found while rendering. One inside an element or a component of yours is found once
|
|
15264
|
-
* mounted, so until then TeachingPopover's own surface renders next to it: in the server
|
|
15265
|
-
* in the browser's first commit (before anything is painted or focused). A second
|
|
15266
|
-
* a second popover (a development warning says so).
|
|
16754
|
+
* own `className`, `style`, `ref`, `motion` and other element props are ignored (a development
|
|
16755
|
+
* warning says so). Write it directly inside TeachingPopover (a Fragment is fine) where you can:
|
|
16756
|
+
* there it is found while rendering. One inside an element or a component of yours is found once
|
|
16757
|
+
* it has mounted, so until then TeachingPopover's own surface renders next to it: in the server
|
|
16758
|
+
* HTML, and in the browser's first commit (before anything is painted or focused). A second
|
|
16759
|
+
* Surface renders a second popover (a development warning says so).
|
|
15267
16760
|
*
|
|
15268
16761
|
* Also exported as `TeachingPopoverSurface` for React Server Components, which cannot use the
|
|
15269
16762
|
* dotted `TeachingPopover.Surface` (that needs a client file).
|
|
@@ -15294,6 +16787,19 @@ export declare interface TeachingPopoverSurfaceProps extends React_2.HTMLAttribu
|
|
|
15294
16787
|
* without one, name it with `aria-label` or `aria-labelledby`.
|
|
15295
16788
|
*/
|
|
15296
16789
|
children?: React_2.ReactNode;
|
|
16790
|
+
/**
|
|
16791
|
+
* The surface's motion (TeachingPopover's own `motion` is for the surface it renders without a
|
|
16792
|
+
* Surface). By default it fades in over 200 ms with a decelerating curve and out over 100 ms with
|
|
16793
|
+
* an accelerating curve, and, pointed at a target (or the Trigger), also slides 4px away from it
|
|
16794
|
+
* on the side it opened on, and back as it closes; under reduced motion it appears and
|
|
16795
|
+
* disappears at once. `null` turns the motion off (the surface still renders its
|
|
16796
|
+
* `data-presence` phases, which then end at once); a class string or `{ className }` replaces
|
|
16797
|
+
* the default classes with yours (see `MotionSlot`), also under a `WaveProvider` with
|
|
16798
|
+
* `motion="none"`, which otherwise turns the default off. Fluent's `TeachingPopover`
|
|
16799
|
+
* `surfaceMotion` (a TeachingPopover is a Popover there).
|
|
16800
|
+
* @default the fade and slide above
|
|
16801
|
+
*/
|
|
16802
|
+
motion?: MotionSlot | null;
|
|
15297
16803
|
/** Ref to the popover surface (`role="dialog"`). */
|
|
15298
16804
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
15299
16805
|
}
|
|
@@ -15892,7 +17398,8 @@ export declare interface ToastController {
|
|
|
15892
17398
|
};
|
|
15893
17399
|
/**
|
|
15894
17400
|
* Dismisses the toast with this id and cancels its timer: a shown toast exits (it stays, inert,
|
|
15895
|
-
* until
|
|
17401
|
+
* until its exit motion ends; see the Toaster's `motion`), a waiting one is removed. Unknown ids
|
|
17402
|
+
* are ignored.
|
|
15896
17403
|
*/
|
|
15897
17404
|
dismissToast: (id: string) => void;
|
|
15898
17405
|
/**
|
|
@@ -15970,6 +17477,10 @@ export declare interface ToastDispatchOptions {
|
|
|
15970
17477
|
* - `limit` caps how many toasts show at once: the others wait in a queue, in dispatch order,
|
|
15971
17478
|
* unannounced and without a running timer, and appear as shown toasts go.
|
|
15972
17479
|
* `dismissAllToasts()` removes every toast, shown and queued.
|
|
17480
|
+
* - **Motion:** a toast slides and fades in from the stack's edge while its place opens; a
|
|
17481
|
+
* dismissed one fades out, then its place closes and the others glide together. It stays in
|
|
17482
|
+
* the document, `inert`, until then; at once under reduced motion. `motion` replaces or turns
|
|
17483
|
+
* off the motion of every toast.
|
|
15973
17484
|
*
|
|
15974
17485
|
* @example
|
|
15975
17486
|
* <Toaster position="bottom-end" limit={3}>
|
|
@@ -15977,17 +17488,19 @@ export declare interface ToastDispatchOptions {
|
|
|
15977
17488
|
* </Toaster>
|
|
15978
17489
|
*/
|
|
15979
17490
|
export declare const Toaster: {
|
|
15980
|
-
({ position, limit: limitProp, shortcuts, toaster: handle, className, style, children, onFocus, onBlur, onKeyDown, onPointerEnter, onPointerLeave, onPointerOver, ref, ...rest }: ToasterProps): React_2.JSX.Element;
|
|
17491
|
+
({ position, limit: limitProp, shortcuts, toaster: handle, motion, className, style, children, onFocus, onBlur, onKeyDown, onPointerEnter, onPointerLeave, onPointerOver, ref, ...rest }: ToasterProps): React_2.JSX.Element;
|
|
15981
17492
|
displayName: string;
|
|
15982
17493
|
};
|
|
15983
17494
|
|
|
15984
17495
|
/**
|
|
15985
17496
|
* Toaster: `root` on the portaled toast region; `toast` on the `role="group"` container the
|
|
15986
|
-
* Toaster renders around each toast
|
|
17497
|
+
* Toaster renders around each toast; `toastContent` on the element inside each container, its
|
|
17498
|
+
* only child, which holds the toast's status text and content (0.15).
|
|
15987
17499
|
*/
|
|
15988
17500
|
export declare const toasterClassNames: {
|
|
15989
17501
|
readonly root: "wave-toaster";
|
|
15990
17502
|
readonly toast: "wave-toaster__toast";
|
|
17503
|
+
readonly toastContent: "wave-toaster__toast-content";
|
|
15991
17504
|
};
|
|
15992
17505
|
|
|
15993
17506
|
/**
|
|
@@ -16024,6 +17537,20 @@ export declare interface ToasterProps extends React_2.HTMLAttributes<HTMLDivElem
|
|
|
16024
17537
|
* queues again until a Toaster binds it.
|
|
16025
17538
|
*/
|
|
16026
17539
|
toaster?: ToasterHandle;
|
|
17540
|
+
/**
|
|
17541
|
+
* The motion of every toast's container (the `role="group"` element; `className` stays on the
|
|
17542
|
+
* region). By default a toast opens its place in the stack, fades in and slides 8px in from the
|
|
17543
|
+
* stack's edge (the top or bottom edge `position` names) over 250 ms with a decelerating curve,
|
|
17544
|
+
* all together; dismissed, it fades out over 200 ms, then its place closes over 200 ms more,
|
|
17545
|
+
* so the toasts around it glide together and nothing jumps when it unmounts (the timer still
|
|
17546
|
+
* starts when the toast is shown). Under reduced motion it appears and disappears at once.
|
|
17547
|
+
* `null` turns the motion off (the container still renders its `data-presence` phases, which
|
|
17548
|
+
* then end at once); a class string or `{ className }` replaces the default classes with yours
|
|
17549
|
+
* (see `MotionSlot`), also under a `WaveProvider` with `motion="none"`, which otherwise turns
|
|
17550
|
+
* the default off. A WaveUI addition: Fluent's Toaster has no motion slot.
|
|
17551
|
+
* @default the slide, fade and collapse above
|
|
17552
|
+
*/
|
|
17553
|
+
motion?: MotionSlot | null;
|
|
16027
17554
|
/** Ref to the toast region (the portaled `<div role="region">`). */
|
|
16028
17555
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
16029
17556
|
}
|
|
@@ -16572,8 +18099,13 @@ export declare interface ToolbarToggleButtonProps extends Omit<ToggleButtonProps
|
|
|
16572
18099
|
* - The text is always present as a hidden `role="tooltip"` element referenced by the child's
|
|
16573
18100
|
* `aria-describedby` (or `aria-labelledby` with `relationship="label"`), so screen readers get
|
|
16574
18101
|
* it on focus without waiting for the delay; the child's own ids are kept.
|
|
16575
|
-
* - The visual surface is rendered in a portal
|
|
16576
|
-
*
|
|
18102
|
+
* - The visual surface is rendered in a portal while visible (it is `aria-hidden`, a copy of the
|
|
18103
|
+
* description), positioned on `side`/`align` with flipping and shifting to stay in view.
|
|
18104
|
+
* - It fades in and out over 100 ms (see `motion`; at once under reduced motion). The surface
|
|
18105
|
+
* mounts through the presence core: it carries `data-presence` and `data-state="open"`, and
|
|
18106
|
+
* while it fades out `data-state="closed"` and `inert`, staying where it was until its exit
|
|
18107
|
+
* ends; the Escape layer goes as it hides, not after the fade. Shown again during its exit, the
|
|
18108
|
+
* same surface fades back in. The hidden description is unchanged in every phase.
|
|
16577
18109
|
* - It appears `openDelay` after the pointer rests on the child or the child takes keyboard focus,
|
|
16578
18110
|
* stays visible while the pointer moves onto it, hides `closeDelay` after the pointer leaves or
|
|
16579
18111
|
* immediately on blur, and Escape hides it without closing an enclosing dialog or popover. Focus
|
|
@@ -16609,7 +18141,7 @@ export declare interface ToolbarToggleButtonProps extends Omit<ToggleButtonProps
|
|
|
16609
18141
|
* </Menu>
|
|
16610
18142
|
*/
|
|
16611
18143
|
export declare const Tooltip: {
|
|
16612
|
-
({ content, appearance: appearanceProp, variant, openDelay: openDelayProp, closeDelay, delay, open: openProp, defaultOpen, onOpenChange, relationship, side, align, positioning, children, className, onMouseEnter, onMouseLeave, onFocus, onBlur, ref, ...rest }: TooltipProps): React_2.JSX.Element;
|
|
18144
|
+
({ content, appearance: appearanceProp, variant, openDelay: openDelayProp, closeDelay, delay, open: openProp, defaultOpen, onOpenChange, relationship, side, align, positioning, motion, children, className, onMouseEnter, onMouseLeave, onFocus, onBlur, ref, ...rest }: TooltipProps): React_2.JSX.Element;
|
|
16613
18145
|
displayName: string;
|
|
16614
18146
|
};
|
|
16615
18147
|
|
|
@@ -16692,6 +18224,17 @@ export declare interface TooltipProps extends Omit<React_2.HTMLAttributes<HTMLSp
|
|
|
16692
18224
|
* @default `{ offset: 8 }`
|
|
16693
18225
|
*/
|
|
16694
18226
|
positioning?: PopupPositioningOptions;
|
|
18227
|
+
/**
|
|
18228
|
+
* The motion of the tooltip's surface (the portaled box; `className` stays on the wrapper
|
|
18229
|
+
* `<span>`). By default it fades in over 100 ms and out over 100 ms with the easy-ease curve,
|
|
18230
|
+
* without a slide; under reduced motion it appears and disappears at once. `null` turns the
|
|
18231
|
+
* motion off (the surface still renders its `data-presence` phases, which then end at once); a
|
|
18232
|
+
* class string or `{ className }` replaces the default classes with yours (see `MotionSlot`),
|
|
18233
|
+
* also under a `WaveProvider` with `motion="none"`, which otherwise turns the default off. A
|
|
18234
|
+
* WaveUI addition: Fluent's Tooltip has no motion.
|
|
18235
|
+
* @default the fade above
|
|
18236
|
+
*/
|
|
18237
|
+
motion?: MotionSlot | null;
|
|
16695
18238
|
/**
|
|
16696
18239
|
* A single element that triggers the tooltip on hover and focus: it receives the
|
|
16697
18240
|
* `aria-describedby`/`aria-labelledby`, plus any `id` and `aria-*` props given to the Tooltip
|
|
@@ -16714,6 +18257,10 @@ export declare interface TooltipProps extends Omit<React_2.HTMLAttributes<HTMLSp
|
|
|
16714
18257
|
* Keyboard focus enters at the `selected` item, else the first item; while focus is inside, the
|
|
16715
18258
|
* tab stop follows it, so Shift+Tab leaves the tree.
|
|
16716
18259
|
*
|
|
18260
|
+
* A child group opens and closes its space with a short collapse and fade (the Tree's `motion`;
|
|
18261
|
+
* none under reduced motion or a `WaveProvider` with `motion="none"`), and focus inside a group
|
|
18262
|
+
* that collapses moves to its item.
|
|
18263
|
+
*
|
|
16717
18264
|
* `selectionMode="multiple"` draws a checkbox on every item, bound to `checkedItems`: Space
|
|
16718
18265
|
* toggles the focused item's check, a click on the checkbox toggles it, and a click elsewhere on
|
|
16719
18266
|
* the row activates the item (as Enter does). Checks cascade: checking an item checks every item
|
|
@@ -16740,7 +18287,7 @@ export declare interface TooltipProps extends Omit<React_2.HTMLAttributes<HTMLSp
|
|
|
16740
18287
|
* `TreeItemPersonaLayout` for React Server Components, which cannot use the dotted form.
|
|
16741
18288
|
*/
|
|
16742
18289
|
export declare const Tree: {
|
|
16743
|
-
({ expandedItems, defaultExpandedItems, onExpandedItemsChange, onItemSelect, selected, current, selectionMode, navigationMode, checkedItems, defaultCheckedItems, onCheckedItemsChange, className, children, onKeyDown, onKeyDownCapture, onFocus, onBlur, ref, ...rest }: TreeProps): JSX.Element;
|
|
18290
|
+
({ expandedItems, defaultExpandedItems, onExpandedItemsChange, onItemSelect, selected, current, selectionMode, navigationMode, checkedItems, defaultCheckedItems, onCheckedItemsChange, motion, className, children, onKeyDown, onKeyDownCapture, onFocus, onBlur, ref, ...rest }: TreeProps): JSX.Element;
|
|
16744
18291
|
displayName: string;
|
|
16745
18292
|
} & {
|
|
16746
18293
|
Item: {
|
|
@@ -16772,6 +18319,16 @@ export declare const treeClassNames: {
|
|
|
16772
18319
|
* One node of a Tree. Text and other content are the label; nested `Tree.Item` children form its
|
|
16773
18320
|
* child group, which is shown while the item is expanded.
|
|
16774
18321
|
*
|
|
18322
|
+
* The child group renders as the only child of a collapse element (its stable class
|
|
18323
|
+
* `wave-tree-item__collapse`), which opens and closes the group's space (the Tree's `motion`) and
|
|
18324
|
+
* has no box of its own while the item is expanded, so the group lays out in the item as before.
|
|
18325
|
+
* An item expanded by default appears without motion. After a collapse the group stays in the
|
|
18326
|
+
* document until the collapse ends, `inert` (its items leave the arrow keys and typeahead at once)
|
|
18327
|
+
* while the item already reports itself collapsed; expanding the item again during the collapse
|
|
18328
|
+
* keeps the same group. Focus inside the group when the item collapses moves to the item. A
|
|
18329
|
+
* pointer click that falls through the exiting group onto the item (an `inert` element lets the
|
|
18330
|
+
* pointer through) is not the item's: it neither expands nor activates it.
|
|
18331
|
+
*
|
|
16775
18332
|
* Nested items must be `Tree.Item` elements among the item's own children: written directly, in
|
|
16776
18333
|
* Fragments, or returned by a render function (`{node.children.map(renderNode)}`). A component
|
|
16777
18334
|
* that renders `Tree.Item` itself (a recursive `<NodeView node={child} />`) is not recognised:
|
|
@@ -16781,14 +18338,14 @@ export declare const treeClassNames: {
|
|
|
16781
18338
|
* renders is not checked with its parent.
|
|
16782
18339
|
*
|
|
16783
18340
|
* `ref` and every other prop land on the `role="treeitem"` element, which contains the label row
|
|
16784
|
-
* and the child group. Its `onClick` receives only clicks on its own
|
|
16785
|
-
* or nested items) and its `onKeyDown` only keys pressed while focus
|
|
16786
|
-
* run before the built-in behaviour (call `event.preventDefault()`
|
|
16787
|
-
* tree, a click on the item's checkbox toggles its check and is not
|
|
16788
|
-
* neither is a click on its actions; `onKeyDown` receives no keys pressed
|
|
16789
|
-
* other event handlers (`onFocus`, `onDoubleClick`, `onContextMenu` and the
|
|
16790
|
-
* filtered: as DOM events bubble, they also receive events from its child group and
|
|
16791
|
-
* (compare `event.target` with `event.currentTarget` to tell them apart).
|
|
18341
|
+
* and the child group (in its collapse element). Its `onClick` receives only clicks on its own
|
|
18342
|
+
* row (not on its child group or nested items) and its `onKeyDown` only keys pressed while focus
|
|
18343
|
+
* is on it or in its row; both run before the built-in behaviour (call `event.preventDefault()`
|
|
18344
|
+
* to skip it). In a checkbox tree, a click on the item's checkbox toggles its check and is not
|
|
18345
|
+
* passed to `onClick`, and neither is a click on its actions; `onKeyDown` receives no keys pressed
|
|
18346
|
+
* in the actions. Its other event handlers (`onFocus`, `onDoubleClick`, `onContextMenu` and the
|
|
18347
|
+
* rest) are not filtered: as DOM events bubble, they also receive events from its child group and
|
|
18348
|
+
* nested items (compare `event.target` with `event.currentTarget` to tell them apart).
|
|
16792
18349
|
*
|
|
16793
18350
|
* `actions` render in a toolbar at the end of the row, named by the item; keys and clicks on them
|
|
16794
18351
|
* belong to them and never activate or check the item. `aside` sits before them and describes the
|
|
@@ -16808,7 +18365,8 @@ export declare const TreeItem: {
|
|
|
16808
18365
|
* chevron (or your `expandIcon`); `indicator` on the checkbox of a multi-select tree or the radio
|
|
16809
18366
|
* of a single-select one; `icon` on the icon span; `label` on the label span; `iconAfter` on the
|
|
16810
18367
|
* icon after the label; `aside` on the aside content; `actions` on the row's actions toolbar;
|
|
16811
|
-
* `group` on the `role="group"` element of its nested items
|
|
18368
|
+
* `group` on the `role="group"` element of its nested items; `collapse` on the element around
|
|
18369
|
+
* that group (the element that opens and closes the group's space, 0.15).
|
|
16812
18370
|
*/
|
|
16813
18371
|
export declare const treeItemClassNames: {
|
|
16814
18372
|
readonly root: "wave-tree-item";
|
|
@@ -16821,6 +18379,7 @@ export declare const treeItemClassNames: {
|
|
|
16821
18379
|
readonly aside: "wave-tree-item__aside";
|
|
16822
18380
|
readonly actions: "wave-tree-item__actions";
|
|
16823
18381
|
readonly group: "wave-tree-item__group";
|
|
18382
|
+
readonly collapse: "wave-tree-item__collapse";
|
|
16824
18383
|
};
|
|
16825
18384
|
|
|
16826
18385
|
/**
|
|
@@ -16962,6 +18521,17 @@ export declare interface TreeProps extends React_2.HTMLAttributes<HTMLDivElement
|
|
|
16962
18521
|
* @default 'tree'
|
|
16963
18522
|
*/
|
|
16964
18523
|
navigationMode?: 'tree' | 'treegrid';
|
|
18524
|
+
/**
|
|
18525
|
+
* Replaces the collapse of every child group in the tree (Fluent's `Tree collapseMotion`), on
|
|
18526
|
+
* the element around each `role="group"` element: by default the space a group takes opens
|
|
18527
|
+
* from nothing and closes back to it, with a fade, over the normal duration (200 ms) with the
|
|
18528
|
+
* max easy-ease curve, both ways. `null` turns it off (a group appears and disappears at once);
|
|
18529
|
+
* a class string or `{ className }` replaces it, written as `MotionSlot` describes. A
|
|
18530
|
+
* `WaveProvider` with `motion="none"` turns the default off, and a value here still applies
|
|
18531
|
+
* under it. The expand chevron's turn is not part of it, and a nested `Tree` takes its own.
|
|
18532
|
+
* @default the collapse described above
|
|
18533
|
+
*/
|
|
18534
|
+
motion?: MotionSlot | null;
|
|
16965
18535
|
/** Ref to the `role="tree"` element. */
|
|
16966
18536
|
ref?: React_2.Ref<HTMLDivElement>;
|
|
16967
18537
|
}
|
|
@@ -16995,7 +18565,9 @@ export declare type TypographyVariant = 'caption-2' | 'caption-1' | 'body-1' | '
|
|
|
16995
18565
|
* - The moved-to item is dropped when it leaves `items` or while `enabled` is `false`, and does not
|
|
16996
18566
|
* come back without a user action; `fallback` is active while nothing was moved to.
|
|
16997
18567
|
* - Keyboard and programmatic moves are scrolled into view (`{ block: 'nearest' }`); pointer moves
|
|
16998
|
-
* (`highlight`) and `setActiveValue(value, { scroll: false })` are not.
|
|
18568
|
+
* (`highlight`) and `setActiveValue(value, { scroll: false })` are not. With `onScrollToItem` (a
|
|
18569
|
+
* windowed list) each such move is first passed to it by the item's index, also for an item
|
|
18570
|
+
* without an element.
|
|
16999
18571
|
* - `onActiveValueChange` reports every change after the commit, once (StrictMode included).
|
|
17000
18572
|
*
|
|
17001
18573
|
* `useListbox` is built on it; use it directly for composites that are not listboxes.
|
|
@@ -17036,6 +18608,17 @@ export declare interface UseActiveDescendantOptions {
|
|
|
17036
18608
|
activateFirstOnChange?: boolean;
|
|
17037
18609
|
/** The element of an item, for scrolling it into view. @default document.getElementById(getId(value)) */
|
|
17038
18610
|
getElement?: (value: string) => HTMLElement | null;
|
|
18611
|
+
/**
|
|
18612
|
+
* Called for every move that scrolls the active item into view, for a windowed list that renders
|
|
18613
|
+
* part of its items: `index` is the item's index in `items`. Scroll the list so that it shows and
|
|
18614
|
+
* renders the item (a virtual window's `scrollToIndex`, which moves the window in the same
|
|
18615
|
+
* update); an element, when there is one (`getElement`, then the id lookup), is then scrolled
|
|
18616
|
+
* into view as well. `aria-activedescendant` already names the item, and points at its element
|
|
18617
|
+
* once it mounts. Called after the same moves that scroll (not after a pointer move or a
|
|
18618
|
+
* `scroll: false` move), from a layout effect, once per change of the active item. Without it,
|
|
18619
|
+
* an item without an element is not scrolled to.
|
|
18620
|
+
*/
|
|
18621
|
+
onScrollToItem?: (index: number) => void;
|
|
17039
18622
|
/** Called after the active item changed (from an effect), `null` included. */
|
|
17040
18623
|
onActiveValueChange?: (value: string | null) => void;
|
|
17041
18624
|
}
|
|
@@ -17281,6 +18864,60 @@ export declare interface UseFieldControlOptions {
|
|
|
17281
18864
|
nativeRequired?: boolean;
|
|
17282
18865
|
}
|
|
17283
18866
|
|
|
18867
|
+
/**
|
|
18868
|
+
* The model of a flat tree: items listed with a `parentValue` link, in any order, become the rows
|
|
18869
|
+
* a windowed tree shows (`FlatTree`), without building an element tree. Returns the visible rows
|
|
18870
|
+
* (with `level`, `position`, `setSize` and `expanded` for the tree ARIA), the expanded and
|
|
18871
|
+
* checked state, and the actions on them.
|
|
18872
|
+
*
|
|
18873
|
+
* Pass `items` as a stable reference or memoise it: the index of the items is rebuilt when its
|
|
18874
|
+
* identity changes. Expanded and checked state work as in `Tree`: pass `expandedItems` or
|
|
18875
|
+
* `checkedItems` to control it (a stable array, or the rows are rebuilt on every render), or
|
|
18876
|
+
* `defaultExpandedItems` and `defaultCheckedItems` to start uncontrolled; the change callbacks
|
|
18877
|
+
* fire once per change. When `items` is replaced, the expanded and checked values stay in the
|
|
18878
|
+
* state: a value that matches no item is ignored for the rows until an item with it returns, and
|
|
18879
|
+
* it is changed only by you.
|
|
18880
|
+
*
|
|
18881
|
+
* Development warnings, once each: an unknown `parentValue` (the item is a root), a cycle of
|
|
18882
|
+
* parents (cut) and a duplicate value (the first item wins).
|
|
18883
|
+
*
|
|
18884
|
+
* @example
|
|
18885
|
+
* const model = useFlatTree(items, { defaultExpandedItems: ['docs'] });
|
|
18886
|
+
* model.visibleItems.map((row) => row.item.label);
|
|
18887
|
+
*/
|
|
18888
|
+
export declare function useFlatTree(items: readonly FlatTreeItemData[], options?: UseFlatTreeOptions): FlatTreeModel;
|
|
18889
|
+
|
|
18890
|
+
/** Options of {@link useFlatTree}: the state names and shapes of the nested `Tree`. */
|
|
18891
|
+
export declare interface UseFlatTreeOptions {
|
|
18892
|
+
/** Controlled list of expanded item values. */
|
|
18893
|
+
expandedItems?: readonly string[];
|
|
18894
|
+
/**
|
|
18895
|
+
* Item values that are expanded initially (uncontrolled).
|
|
18896
|
+
* @default []
|
|
18897
|
+
*/
|
|
18898
|
+
defaultExpandedItems?: readonly string[];
|
|
18899
|
+
/** Called with the new list of expanded item values when an item expands or collapses. */
|
|
18900
|
+
onExpandedItemsChange?: (expandedItems: string[]) => void;
|
|
18901
|
+
/** Controlled checked items (`selectionMode="multiple"`); the cascade rule is the nested `Tree`'s. */
|
|
18902
|
+
checkedItems?: readonly string[];
|
|
18903
|
+
/**
|
|
18904
|
+
* Initially checked items (uncontrolled).
|
|
18905
|
+
* @default []
|
|
18906
|
+
*/
|
|
18907
|
+
defaultCheckedItems?: readonly string[];
|
|
18908
|
+
/**
|
|
18909
|
+
* Called with every checked item (in tree order) when a check changes. `details` is passed when
|
|
18910
|
+
* `setChecked` got an `event`; it is typed optional until 1.0.
|
|
18911
|
+
*/
|
|
18912
|
+
onCheckedItemsChange?: (checkedItems: string[], details?: TreeCheckedItemsChangeDetails) => void;
|
|
18913
|
+
/**
|
|
18914
|
+
* How items are selected, as `Tree`. With `'multiple'` every visible row carries its `checked`
|
|
18915
|
+
* state; the model's `getTreeProps()` hands the mode on to `FlatTree`.
|
|
18916
|
+
* @default 'none'
|
|
18917
|
+
*/
|
|
18918
|
+
selectionMode?: 'none' | SelectionMode_2;
|
|
18919
|
+
}
|
|
18920
|
+
|
|
17284
18921
|
/**
|
|
17285
18922
|
* A focusable group (Fluent's `useFocusableGroup`, tabster's groupper): one tab stop that holds
|
|
17286
18923
|
* several focusable elements, so a long list of rich rows does not cost a Tab press per control.
|
|
@@ -17419,14 +19056,32 @@ export declare function useFocusVisible(): boolean;
|
|
|
17419
19056
|
* keys: its cell takes focus, and Enter/F2 enters the composite at its own tab stop. The grid never
|
|
17420
19057
|
* writes `tabindex` on or inside a composite (the composite manages its own), so a composite
|
|
17421
19058
|
* keeps its own Tab stop — the same documented limitation as `useRovingTabIndex`.
|
|
19059
|
+
* - **Auxiliary widgets** (a widget that carries `data-grid-auxiliary`, such as a column's resize
|
|
19060
|
+
* handle) are left out when the cell's target is chosen, so a header with a sort button and a
|
|
19061
|
+
* resize handle keeps the button as its target (Enter sorts), and a cell whose only widget is
|
|
19062
|
+
* auxiliary is its own target. Like every widget they are at `tabindex="-1"` in navigation mode
|
|
19063
|
+
* and take part in interaction mode. F2 on a cell that has one, or on its target widget, enters
|
|
19064
|
+
* interaction mode at the first auxiliary widget (Enter on a cell that is its own target still
|
|
19065
|
+
* enters its first widget); Escape returns to the cell's target, the cell or its target widget.
|
|
19066
|
+
* While the widgets of such a cell are interacted with, its target widget is in interaction mode
|
|
19067
|
+
* too, so Tab moves between all of them and Escape on the target ends the mode. A cell without
|
|
19068
|
+
* auxiliary widgets behaves as described above.
|
|
19069
|
+
* - **Rows by their data** (a `model`: a windowed grid, whose rows are mounted in part): the rows
|
|
19070
|
+
* are the header rows and the data rows, which carry their index in the data as `data-row-index`
|
|
19071
|
+
* (other rows, such as the spacer rows of a window, are skipped). ArrowUp/ArrowDown,
|
|
19072
|
+
* PageUp/PageDown and Ctrl+Home/Ctrl+End go by that index over every row of the data, header
|
|
19073
|
+
* rows first, with the rules above: a target row that is not mounted is asked for with
|
|
19074
|
+
* `scrollToRow` (once per row) and focused in the commit that mounts it, and Ctrl+Home also
|
|
19075
|
+
* brings data row 0 back under the header rows. The active cell is kept by its row and column:
|
|
19076
|
+
* `activeRowIndex` and `pendingRowIndex` name the rows the owner keeps mounted, and while the
|
|
19077
|
+
* active row is not mounted anyway, a cell of the nearest mounted row holds the tab stop until
|
|
19078
|
+
* the row is back. ArrowLeft/ArrowRight and Home/End work in the row as above.
|
|
17422
19079
|
*
|
|
17423
19080
|
* Keys are ignored when the event's default was prevented (a widget that handled the key, a
|
|
17424
19081
|
* consumer handler), or with Alt/Meta held. The tab indexes are written to the DOM (layout effect
|
|
17425
19082
|
* plus a `MutationObserver`), so rows and widgets added later are covered without a re-render. Focus
|
|
17426
19083
|
* moves re-sync only the cells involved, the observer only the cells that changed, and the grid's
|
|
17427
19084
|
* own `tabindex` writes do not trigger a re-sync.
|
|
17428
|
-
*
|
|
17429
|
-
* Internal to the table package.
|
|
17430
19085
|
*/
|
|
17431
19086
|
export declare function useGridNavigation(options?: UseGridNavigationOptions): UseGridNavigationResult;
|
|
17432
19087
|
|
|
@@ -17437,6 +19092,14 @@ export declare interface UseGridNavigationOptions {
|
|
|
17437
19092
|
* @default 10
|
|
17438
19093
|
*/
|
|
17439
19094
|
pageSize?: number;
|
|
19095
|
+
/**
|
|
19096
|
+
* The data of a windowed grid (DataGrid with a virtual window). ArrowUp/ArrowDown,
|
|
19097
|
+
* PageUp/PageDown and Ctrl+Home/Ctrl+End then move by the rows of the data: a target row that is
|
|
19098
|
+
* not mounted is asked for with `scrollToRow` and focused when it mounts. The active row is kept
|
|
19099
|
+
* by its index (see {@link UseGridNavigationResult.activeRowIndex}). Without it, the mounted
|
|
19100
|
+
* rows are the whole grid.
|
|
19101
|
+
*/
|
|
19102
|
+
model?: GridNavigationModel;
|
|
17440
19103
|
}
|
|
17441
19104
|
|
|
17442
19105
|
/** Result of {@link useGridNavigation}. */
|
|
@@ -17445,6 +19108,19 @@ export declare interface UseGridNavigationResult {
|
|
|
17445
19108
|
gridRef: React_2.RefCallback<HTMLTableElement>;
|
|
17446
19109
|
/** Keyboard and focus handlers for the grid element. Stable identities. */
|
|
17447
19110
|
gridProps: GridNavigationHandlers;
|
|
19111
|
+
/**
|
|
19112
|
+
* With a `model`: the `data-row-index` of the active cell's row, the row that holds the grid's
|
|
19113
|
+
* tab stop (or takes it back once it is mounted again), so the owner keeps that row mounted.
|
|
19114
|
+
* `null` on a header row, and always `null` without a model. A change re-renders the owner.
|
|
19115
|
+
*/
|
|
19116
|
+
activeRowIndex: number | null;
|
|
19117
|
+
/**
|
|
19118
|
+
* With a `model`: the index of the data row a key moved focus to while it is not mounted (asked
|
|
19119
|
+
* for with `scrollToRow`); focus moves there in the commit that mounts it, so the owner keeps it
|
|
19120
|
+
* mounted too. `null` when no row is awaited, and always `null` without a model. A change
|
|
19121
|
+
* re-renders the owner.
|
|
19122
|
+
*/
|
|
19123
|
+
pendingRowIndex: number | null;
|
|
17448
19124
|
}
|
|
17449
19125
|
|
|
17450
19126
|
/**
|
|
@@ -17540,7 +19216,10 @@ export declare function useIsOverflowItemVisible(itemId: string): boolean;
|
|
|
17540
19216
|
* render. Options register even when filtered out or hidden (they render `hidden` and are not
|
|
17541
19217
|
* navigable), so labels are always known — use {@link collectOptionLabels} for the display text
|
|
17542
19218
|
* before registration (SSR/first render). `filter` is the navigability predicate, which a
|
|
17543
|
-
* picker builds from its query.
|
|
19219
|
+
* picker builds from its query. In data mode the keys, typeahead, the labels and the filter
|
|
19220
|
+
* read `items` only, so a picker may render just the shown options (`items` of the result), or
|
|
19221
|
+
* part of them: `onScrollToItem` receives every active option that scrolls into view, rendered
|
|
19222
|
+
* or not.
|
|
17544
19223
|
* - **Active option** is derived during render: the highlighted value, else the `autoHighlight`
|
|
17545
19224
|
* fallback. The highlight is reset on close and after a single-select commit that closes the
|
|
17546
19225
|
* listbox, and dropped once it is not navigable any more (filtered out, hidden, removed by an
|
|
@@ -17607,8 +19286,10 @@ export declare function useListbox(options: UseListboxOptions): UseListboxResult
|
|
|
17607
19286
|
* the option (registration mode) and its element, and reads its flags from the listbox store, so
|
|
17608
19287
|
* it re-renders only when its own active/selected/hidden state changes. Spread `optionProps` onto
|
|
17609
19288
|
* the `<li>` (`id`, `role="option"`, `aria-selected`, `aria-disabled`, `hidden`, and
|
|
17610
|
-
* `data-active`/`data-selected`/`data-disabled` for styling
|
|
17611
|
-
*
|
|
19289
|
+
* `data-active`/`data-selected`/`data-disabled` for styling; `aria-posinset` and `aria-setsize`
|
|
19290
|
+
* when a `renderOption` of Listbox, Combobox or Dropdown renders it, and in a windowed list a
|
|
19291
|
+
* `style` with its height, to merge after yours) and compose its `onClick` —
|
|
19292
|
+
* and in standalone mode its `onMouseDown`, the pointer press — with your own handlers. Mark the
|
|
17612
19293
|
* component with {@link markListboxElement}, so its label is known before it registers.
|
|
17613
19294
|
*
|
|
17614
19295
|
* Throws in development when used outside a listbox; in production it logs the error once and
|
|
@@ -17767,6 +19448,16 @@ export declare interface UseListboxOptions {
|
|
|
17767
19448
|
* {@link useActiveDescendant}'s `onActiveValueChange`.
|
|
17768
19449
|
*/
|
|
17769
19450
|
onActiveValueChange?: (value: string | null) => void;
|
|
19451
|
+
/**
|
|
19452
|
+
* Called for every move that scrolls the active option into view, for a list that renders only
|
|
19453
|
+
* part of its options (a virtual window): `index` is the option's index in
|
|
19454
|
+
* {@link UseListboxResult.items}, the shown options (filtered-out and hidden items are not
|
|
19455
|
+
* counted, disabled ones are). Scroll the list so that it shows and renders the option (a
|
|
19456
|
+
* window's `scrollToIndex(index)`, which moves the window in the same update); an element, when
|
|
19457
|
+
* there is one, is then scrolled into view as well. `aria-activedescendant` names the option
|
|
19458
|
+
* meanwhile. Passed to {@link useActiveDescendant}'s `onScrollToItem`, mapped to that index.
|
|
19459
|
+
*/
|
|
19460
|
+
onScrollToItem?: (index: number) => void;
|
|
17770
19461
|
/** Prefix of the generated listbox id. @default 'listbox' */
|
|
17771
19462
|
idPrefix?: string;
|
|
17772
19463
|
/**
|
|
@@ -18526,6 +20217,224 @@ export declare interface UseRovingTabIndexResult {
|
|
|
18526
20217
|
focusLast: () => void;
|
|
18527
20218
|
}
|
|
18528
20219
|
|
|
20220
|
+
/**
|
|
20221
|
+
* Selection by id, held outside the DOM, for lists, tables and trees whose items are not all
|
|
20222
|
+
* rendered. State is controlled with `selectedItems` or uncontrolled with `defaultSelectedItems`;
|
|
20223
|
+
* `onSelectedItemsChange` fires once per change, never for a no-op.
|
|
20224
|
+
*
|
|
20225
|
+
* @example
|
|
20226
|
+
* const selection = useSelection({ selectionMode: 'multiple' });
|
|
20227
|
+
* selection.toggleAll(rows.map((row) => row.id));
|
|
20228
|
+
*/
|
|
20229
|
+
export declare function useSelection({ selectionMode, selectedItems: selectedItemsProp, defaultSelectedItems, onSelectedItemsChange, }: UseSelectionOptions): UseSelectionResult;
|
|
20230
|
+
|
|
20231
|
+
/** What {@link UseSelectionOptions.onSelectedItemsChange} receives as its second argument. */
|
|
20232
|
+
export declare interface UseSelectionChangeDetails {
|
|
20233
|
+
/** The event that caused the change, when the caller passed one. */
|
|
20234
|
+
event?: Event;
|
|
20235
|
+
/** The id that was toggled, selected or deselected. Absent for `toggleAll` and `clear`. */
|
|
20236
|
+
id?: string;
|
|
20237
|
+
}
|
|
20238
|
+
|
|
20239
|
+
/** Options of {@link useSelection}. */
|
|
20240
|
+
export declare interface UseSelectionOptions {
|
|
20241
|
+
/**
|
|
20242
|
+
* `single` keeps at most one id selected and never deselects through `toggle`; `multiple` toggles
|
|
20243
|
+
* ids independently.
|
|
20244
|
+
*/
|
|
20245
|
+
selectionMode: SelectionMode_2;
|
|
20246
|
+
/** The selected ids (controlled). Pair it with `onSelectedItemsChange`. */
|
|
20247
|
+
selectedItems?: readonly string[];
|
|
20248
|
+
/**
|
|
20249
|
+
* The ids selected at first render (uncontrolled).
|
|
20250
|
+
* @default []
|
|
20251
|
+
*/
|
|
20252
|
+
defaultSelectedItems?: readonly string[];
|
|
20253
|
+
/**
|
|
20254
|
+
* Called with a new array of the selected ids whenever the selection changes. A call that leaves
|
|
20255
|
+
* the selection as it is (selecting a selected id, toggling the selected id in `single` mode)
|
|
20256
|
+
* does not call it.
|
|
20257
|
+
*/
|
|
20258
|
+
onSelectedItemsChange?: (selectedItems: string[], details?: UseSelectionChangeDetails) => void;
|
|
20259
|
+
}
|
|
20260
|
+
|
|
20261
|
+
/** What {@link useSelection} returns. */
|
|
20262
|
+
export declare interface UseSelectionResult {
|
|
20263
|
+
/** The mode the hook was given. */
|
|
20264
|
+
selectionMode: SelectionMode_2;
|
|
20265
|
+
/**
|
|
20266
|
+
* The selected ids. The same set object is returned while the ids stay the same, so it can key a
|
|
20267
|
+
* memo. It holds ids whose items are not rendered.
|
|
20268
|
+
*/
|
|
20269
|
+
selectedItems: ReadonlySet<string>;
|
|
20270
|
+
/** Whether `id` is selected. */
|
|
20271
|
+
isSelected(id: string): boolean;
|
|
20272
|
+
/** Toggles `id`: in `multiple` mode adds or removes it, in `single` mode selects it. */
|
|
20273
|
+
toggle(id: string, event?: Event): void;
|
|
20274
|
+
/** Selects `id`; in `single` mode it replaces the selection. */
|
|
20275
|
+
select(id: string, event?: Event): void;
|
|
20276
|
+
/** Removes `id` from the selection. */
|
|
20277
|
+
deselect(id: string, event?: Event): void;
|
|
20278
|
+
/**
|
|
20279
|
+
* Selects every id of `universe` when not all of them are selected, else removes only the ids of
|
|
20280
|
+
* `universe`: ids outside it stay selected. It does nothing in `single` mode.
|
|
20281
|
+
*/
|
|
20282
|
+
toggleAll(universe: readonly string[], event?: Event): void;
|
|
20283
|
+
/** Empties the selection, ids outside any universe included. */
|
|
20284
|
+
clear(event?: Event): void;
|
|
20285
|
+
}
|
|
20286
|
+
|
|
20287
|
+
/**
|
|
20288
|
+
* The column sizing plugin of `useTableFeatures`: the width of every column, held at or above its
|
|
20289
|
+
* minimum, and the props that lay a static `Table` out with them. Fills `state.columnSizing`.
|
|
20290
|
+
* Spread `getTableProps()` on the `Table`, render a `<colgroup>` with a `<col>` per column and
|
|
20291
|
+
* spread `getColumnProps(columnId)` on it, and give each `Table.ResizeHandle` the
|
|
20292
|
+
* `getResizeHandleProps(columnId)`. The widths are controlled with `columnWidths` or uncontrolled
|
|
20293
|
+
* with `defaultColumnWidths`. Until a width is state (a resize, or `columnWidths` or
|
|
20294
|
+
* `defaultColumnWidths` is given) the table is 100% wide and at least as wide as the columns; from
|
|
20295
|
+
* then on it is exactly as wide as they are, so a dragged edge follows the pointer. There is no
|
|
20296
|
+
* maximum width, and no fitting of the columns to the container. Call it unconditionally and pass
|
|
20297
|
+
* the plugin to `useTableFeatures`.
|
|
20298
|
+
*
|
|
20299
|
+
* @example
|
|
20300
|
+
* const { columnSizing } = useTableFeatures({ items, columns }, [
|
|
20301
|
+
* useTableColumnSizing({ columnSizingOptions: { name: { minWidth: 120, defaultWidth: 240 } } }),
|
|
20302
|
+
* ]);
|
|
20303
|
+
* <Table {...columnSizing.getTableProps()}>
|
|
20304
|
+
* <colgroup>
|
|
20305
|
+
* {columns.map((c) => <col key={c.columnId} {...columnSizing.getColumnProps(c.columnId!)} />)}
|
|
20306
|
+
* </colgroup>
|
|
20307
|
+
* </Table>
|
|
20308
|
+
*/
|
|
20309
|
+
export declare function useTableColumnSizing<T>(options?: UseTableColumnSizingOptions): TableFeaturePlugin<T>;
|
|
20310
|
+
|
|
20311
|
+
/** Options of {@link useTableColumnSizing}. */
|
|
20312
|
+
export declare interface UseTableColumnSizingOptions {
|
|
20313
|
+
/**
|
|
20314
|
+
* Per column, by `columnId`: `minWidth` (`@default 80`), and the width the column starts at,
|
|
20315
|
+
* `defaultWidth` or else `idealWidth` (else 150). Ids that are not columns are ignored. May be
|
|
20316
|
+
* written inline.
|
|
20317
|
+
*/
|
|
20318
|
+
columnSizingOptions?: Record<string, ColumnSizingOption>;
|
|
20319
|
+
/**
|
|
20320
|
+
* The column widths in pixels (controlled), by `columnId`: a column without an entry has its
|
|
20321
|
+
* initial width. Pair it with `onColumnWidthsChange`.
|
|
20322
|
+
*/
|
|
20323
|
+
columnWidths?: Record<string, number>;
|
|
20324
|
+
/** The column widths at first render (uncontrolled). */
|
|
20325
|
+
defaultColumnWidths?: Record<string, number>;
|
|
20326
|
+
/**
|
|
20327
|
+
* Called with the width of every column and the details whenever a width changes (every step of
|
|
20328
|
+
* a drag or key press). The details are always passed; they are typed optional through 0.x, as
|
|
20329
|
+
* every `details` argument. Setting the width a column already has does not call it, once a
|
|
20330
|
+
* width is state.
|
|
20331
|
+
*/
|
|
20332
|
+
onColumnWidthsChange?: (widths: Record<string, number>, details?: TableColumnWidthsChangeDetails) => void;
|
|
20333
|
+
}
|
|
20334
|
+
|
|
20335
|
+
/**
|
|
20336
|
+
* Headless table state for a table built from the static `Table` parts: the rows of `items`, and
|
|
20337
|
+
* the features its plugins add (`useTableSort`, `useTableSelection`, `useTableColumnSizing`). Each
|
|
20338
|
+
* plugin fills its own part of the state (`sort`, `selection`, `columnSizing`), so the order of
|
|
20339
|
+
* the array does not matter. The state follows the data, not the rendered rows, so a table that
|
|
20340
|
+
* renders a page or a window of its rows keeps select-all and the sort over every item.
|
|
20341
|
+
*
|
|
20342
|
+
* Call each plugin hook unconditionally, in the array or before it, and pass the same plugins on
|
|
20343
|
+
* every render; to turn a feature off, change its options. Options may be written inline: a plugin
|
|
20344
|
+
* whose options change identity on every render (an inline `isDisabled`) only makes the state be
|
|
20345
|
+
* recomputed on every render, while `getRows()` keeps its array until `items`, `getRowId`,
|
|
20346
|
+
* `columns` or the sort change. A feature given twice (the last plugin of it is used), a plugin
|
|
20347
|
+
* count that changes between renders and repeated row ids are development warnings.
|
|
20348
|
+
*
|
|
20349
|
+
* @example
|
|
20350
|
+
* const { getRows, sort, selection } = useTableFeatures({ items, columns, getRowId }, [
|
|
20351
|
+
* useTableSort({ defaultSort: { columnId: 'name', direction: 'ascending' } }),
|
|
20352
|
+
* useTableSelection({ selectionMode: 'multiple' }),
|
|
20353
|
+
* ]);
|
|
20354
|
+
*/
|
|
20355
|
+
export declare function useTableFeatures<T>(options: UseTableFeaturesOptions<T>, plugins?: readonly TableFeaturePlugin<T>[]): TableFeaturesState<T>;
|
|
20356
|
+
|
|
20357
|
+
/** Options of {@link useTableFeatures}. */
|
|
20358
|
+
export declare interface UseTableFeaturesOptions<T> {
|
|
20359
|
+
/** The items, one row each. Every item counts for select-all, rendered or not. */
|
|
20360
|
+
items: readonly T[];
|
|
20361
|
+
/** The columns, from `createTableColumn`. The sort uses the `compare` of the sorted column. */
|
|
20362
|
+
columns: readonly DataGridColumn<T>[];
|
|
20363
|
+
/**
|
|
20364
|
+
* The row id of an item: unique, and the same for an item across renders (selection and the
|
|
20365
|
+
* selection callbacks use it). Pass a stable function (defined outside the component, or
|
|
20366
|
+
* memoised): the rows are rebuilt when it changes.
|
|
20367
|
+
* @default (item, index) => String(index)
|
|
20368
|
+
*/
|
|
20369
|
+
getRowId?: (item: T, index: number) => string;
|
|
20370
|
+
}
|
|
20371
|
+
|
|
20372
|
+
/**
|
|
20373
|
+
* The selection plugin of `useTableFeatures`: a set of row ids (`selectedItems`, controlled, or
|
|
20374
|
+
* `defaultSelectedItems`), and `state.selection` with select-all over every item of `items`,
|
|
20375
|
+
* rendered or not. Select-all selects every selectable row and leaves the other ids as they are;
|
|
20376
|
+
* deselecting all removes only the selectable ids of `items`, so a selected disabled row and ids
|
|
20377
|
+
* selected on another page or filtered out stay selected (`clearRows` empties the selection).
|
|
20378
|
+
* `onSelectedItemsChange` fires once per change with a new array of every selected id. Call it
|
|
20379
|
+
* unconditionally and pass the plugin to `useTableFeatures`.
|
|
20380
|
+
*
|
|
20381
|
+
* @example
|
|
20382
|
+
* const { selection } = useTableFeatures({ items, columns, getRowId }, [
|
|
20383
|
+
* useTableSelection({ selectionMode: 'multiple', onSelectedItemsChange: setSelected }),
|
|
20384
|
+
* ]);
|
|
20385
|
+
*/
|
|
20386
|
+
export declare function useTableSelection<T>(options: UseTableSelectionOptions<T>): TableFeaturePlugin<T>;
|
|
20387
|
+
|
|
20388
|
+
/** Options of {@link useTableSelection}: those of `useSelection`, plus the disabled rows. */
|
|
20389
|
+
export declare interface UseTableSelectionOptions<T> extends UseSelectionOptions {
|
|
20390
|
+
/**
|
|
20391
|
+
* Whether the selection of an item cannot change through select-all: `toggleAllRows` skips it,
|
|
20392
|
+
* and `allRowsSelected` does not wait for it. A disabled row keeps its state. The single-row
|
|
20393
|
+
* functions do not read it: disable the row's own control. Called for every item of `items`
|
|
20394
|
+
* whenever `useTableFeatures` computes its state: when the selection, `items`, `getRowId`,
|
|
20395
|
+
* `columns`, the sort or another plugin's state (the column widths) change, and when this
|
|
20396
|
+
* function changes. A function written inline is a new one on every render, so the state is
|
|
20397
|
+
* then computed, and this function called for every item, on every render (no more: no extra
|
|
20398
|
+
* render, and `getRows()` keeps its array); define it outside the component or memoise it to
|
|
20399
|
+
* call it only on those changes.
|
|
20400
|
+
*/
|
|
20401
|
+
isDisabled?: (item: T, index: number) => boolean;
|
|
20402
|
+
}
|
|
20403
|
+
|
|
20404
|
+
/**
|
|
20405
|
+
* The sort plugin of `useTableFeatures`: sorts the rows by the `compare` of a column and fills
|
|
20406
|
+
* `state.sort`. The sort is controlled with `sort` or uncontrolled with `defaultSort`;
|
|
20407
|
+
* `toggleColumnSort` goes from ascending to descending as a sortable DataGrid header does. The
|
|
20408
|
+
* sorted column is the one whose `columnId` is the sort's `columnId` (the deprecated `id` of a
|
|
20409
|
+
* column is not read). Call it unconditionally and pass the plugin to `useTableFeatures`.
|
|
20410
|
+
*
|
|
20411
|
+
* @example
|
|
20412
|
+
* const state = useTableFeatures({ items, columns }, [
|
|
20413
|
+
* useTableSort({ defaultSort: { columnId: 'name', direction: 'ascending' } }),
|
|
20414
|
+
* ]);
|
|
20415
|
+
* state.sort.toggleColumnSort('name');
|
|
20416
|
+
*/
|
|
20417
|
+
export declare function useTableSort<T>(options?: UseTableSortOptions): TableFeaturePlugin<T>;
|
|
20418
|
+
|
|
20419
|
+
/** Options of {@link useTableSort}. */
|
|
20420
|
+
export declare interface UseTableSortOptions {
|
|
20421
|
+
/**
|
|
20422
|
+
* The sort (controlled): the sorted column and its direction, or `null` for the order of
|
|
20423
|
+
* `items`. Pair it with `onSortChange`.
|
|
20424
|
+
*/
|
|
20425
|
+
sort?: DataGridSort | null;
|
|
20426
|
+
/**
|
|
20427
|
+
* The sort at first render (uncontrolled).
|
|
20428
|
+
* @default null
|
|
20429
|
+
*/
|
|
20430
|
+
defaultSort?: DataGridSort | null;
|
|
20431
|
+
/**
|
|
20432
|
+
* Called with the new sort whenever it changes, and the event behind it when the change was
|
|
20433
|
+
* given one. Setting the sort it already has does not call it.
|
|
20434
|
+
*/
|
|
20435
|
+
onSortChange?: (sort: DataGridSort, details?: DataGridSortChangeDetails) => void;
|
|
20436
|
+
}
|
|
20437
|
+
|
|
18529
20438
|
/**
|
|
18530
20439
|
* Returns the {@link ToastController} of the enclosing `<Toaster>`: `dispatchToast(content,
|
|
18531
20440
|
* options?)` shows your content (usually a `<Toast>` with parts) and `dispatchToast(options)` a
|
|
@@ -18558,6 +20467,70 @@ export declare interface UseRovingTabIndexResult {
|
|
|
18558
20467
|
*/
|
|
18559
20468
|
export declare function useToastController(): ToastController;
|
|
18560
20469
|
|
|
20470
|
+
/**
|
|
20471
|
+
* A window over a long list of fixed-height rows, for rendering only the rows in view. Give
|
|
20472
|
+
* `scrollRef` to the scrolling element and render `layout(count)`: rows for the item entries and
|
|
20473
|
+
* empty blocks of `size` pixels for the spacer entries.
|
|
20474
|
+
*
|
|
20475
|
+
* The window re-renders only when the first row in view or the viewport height changes, not on
|
|
20476
|
+
* every scroll event: scrolling is read in a passive `scroll` listener once per animation frame,
|
|
20477
|
+
* and the viewport height on attach, on scroll and from a `ResizeObserver` where one exists. The
|
|
20478
|
+
* server and the first render lay out the top of the list in `initialViewportSize`, and read no
|
|
20479
|
+
* DOM.
|
|
20480
|
+
*
|
|
20481
|
+
* Never write `ref={virtualWindow.scrollRef}` in JSX: the React Compiler's lint types a member
|
|
20482
|
+
* read in the `ref` position as a ref, then reports that read and every call on the window during
|
|
20483
|
+
* render (`virtualWindow.layout(count)` included). Merge the callback with the element's other
|
|
20484
|
+
* refs through `useMergedRefs(ownRef, virtualWindow.scrollRef)`, or destructure it first
|
|
20485
|
+
* (`const { scrollRef } = virtualWindow`); `virtualWindow.layout(count)` can then be called as is.
|
|
20486
|
+
*
|
|
20487
|
+
* @example
|
|
20488
|
+
* const virtualWindow = useVirtualWindow({ itemSize: 32 });
|
|
20489
|
+
* const { scrollRef } = virtualWindow;
|
|
20490
|
+
* return (
|
|
20491
|
+
* <div ref={scrollRef} style={{ height: 320, overflowY: 'auto' }}>
|
|
20492
|
+
* {virtualWindow.layout(rows.length).map((entry) =>
|
|
20493
|
+
* entry.kind === 'item' ? (
|
|
20494
|
+
* <Row key={rows[entry.index].id} row={rows[entry.index]} />
|
|
20495
|
+
* ) : (
|
|
20496
|
+
* <div key={entry.key} aria-hidden="true" style={{ height: entry.size }} />
|
|
20497
|
+
* ),
|
|
20498
|
+
* )}
|
|
20499
|
+
* </div>
|
|
20500
|
+
* );
|
|
20501
|
+
*/
|
|
20502
|
+
export declare function useVirtualWindow({ itemSize, overscan, initialViewportSize, scrollPaddingStart, }: UseVirtualWindowOptions): VirtualWindow;
|
|
20503
|
+
|
|
20504
|
+
/** Options of {@link useVirtualWindow}. */
|
|
20505
|
+
export declare interface UseVirtualWindowOptions {
|
|
20506
|
+
/**
|
|
20507
|
+
* The height of every row, in pixels (all rows have the same height). A value that is not a
|
|
20508
|
+
* positive finite number warns once in development and counts as 1.
|
|
20509
|
+
*/
|
|
20510
|
+
itemSize: number;
|
|
20511
|
+
/**
|
|
20512
|
+
* Rows rendered beyond each edge of the viewport, so a fast scroll shows rows instead of blank
|
|
20513
|
+
* space before the next window renders. A given number is a number of rows; the default covers
|
|
20514
|
+
* at least 240 pixels, so small rows get more of them (9 rows of 28 pixels, 8 of 32).
|
|
20515
|
+
* @default enough rows for 240 pixels, and at least 6
|
|
20516
|
+
*/
|
|
20517
|
+
overscan?: number;
|
|
20518
|
+
/**
|
|
20519
|
+
* The viewport height, in pixels, assumed until the scroller is measured: on the server, in the
|
|
20520
|
+
* first render, and while the scroller measures 0 (it has no layout, as in jsdom).
|
|
20521
|
+
* @default 480
|
|
20522
|
+
*/
|
|
20523
|
+
initialViewportSize?: number;
|
|
20524
|
+
/**
|
|
20525
|
+
* The height, in pixels, of content pinned over the top of the rows inside the scroller (a
|
|
20526
|
+
* sticky header). `scrollToIndex` places rows in the area below it, and its content bound leaves
|
|
20527
|
+
* it out; the rows' offsets and the layout do not change. A value that is not a finite number of
|
|
20528
|
+
* 0 or more counts as 0.
|
|
20529
|
+
* @default 0
|
|
20530
|
+
*/
|
|
20531
|
+
scrollPaddingStart?: number;
|
|
20532
|
+
}
|
|
20533
|
+
|
|
18561
20534
|
/**
|
|
18562
20535
|
* Reads the theme, direction, theme classes and portal container of the nearest
|
|
18563
20536
|
* {@link WaveProvider}. Outside a provider it returns light/ltr defaults with `hasProvider: false`.
|
|
@@ -18583,6 +20556,85 @@ export declare interface VirtualElement {
|
|
|
18583
20556
|
contextElement?: Element;
|
|
18584
20557
|
}
|
|
18585
20558
|
|
|
20559
|
+
/**
|
|
20560
|
+
* One entry of a windowed list: a row to render, or the empty space that stands in for the rows
|
|
20561
|
+
* that are not rendered. A spacer's `key` is stable for React: `spacer-<index of the next item>`,
|
|
20562
|
+
* or `spacer-end` for the one after the last item.
|
|
20563
|
+
*/
|
|
20564
|
+
export declare type VirtualEntry = {
|
|
20565
|
+
kind: 'item';
|
|
20566
|
+
index: number;
|
|
20567
|
+
} | {
|
|
20568
|
+
kind: 'spacer';
|
|
20569
|
+
size: number;
|
|
20570
|
+
key: string;
|
|
20571
|
+
};
|
|
20572
|
+
|
|
20573
|
+
/**
|
|
20574
|
+
* A window over a long list of fixed-height rows: which rows to render for the scroll position,
|
|
20575
|
+
* and the space that stands in for the others. {@link useVirtualWindow} returns one; a component
|
|
20576
|
+
* that takes a `virtualWindow` prop renders its rows through it, and an adapter over a
|
|
20577
|
+
* virtualization library can implement the same interface.
|
|
20578
|
+
*/
|
|
20579
|
+
export declare interface VirtualWindow {
|
|
20580
|
+
/** The row height the window lays out with, in pixels. */
|
|
20581
|
+
itemSize: number;
|
|
20582
|
+
/**
|
|
20583
|
+
* The callback ref of the scrolling element (the element with a bounded height and its own
|
|
20584
|
+
* scrollbar). It attaches once per element and detaches when called with `null`.
|
|
20585
|
+
*/
|
|
20586
|
+
scrollRef: React_2.RefCallback<HTMLElement>;
|
|
20587
|
+
/**
|
|
20588
|
+
* The entries to render, in order, for a list of `count` rows: the rows in view plus the
|
|
20589
|
+
* overscan, every `keep` index outside them as a row of its own (the focused row, a row about
|
|
20590
|
+
* to be focused), and spacers for the rows in between. The sizes add up to `count * itemSize`.
|
|
20591
|
+
* A pure function of the window's state and its arguments, called during render; it reads no
|
|
20592
|
+
* DOM.
|
|
20593
|
+
*/
|
|
20594
|
+
layout(count: number, options?: {
|
|
20595
|
+
keep?: readonly number[];
|
|
20596
|
+
}): readonly VirtualEntry[];
|
|
20597
|
+
/**
|
|
20598
|
+
* Scrolls the row at `index` into view and moves the window to it in the same update, so the
|
|
20599
|
+
* row is rendered once that update commits. `align` places it at the `start`, `center` or `end`
|
|
20600
|
+
* of the viewport; `auto` (the default) scrolls the least that shows it whole. The offset is
|
|
20601
|
+
* bounded by the rendered content. Before the scroller attaches, the last request is kept and
|
|
20602
|
+
* applied when it does, and once more when the scroller first changes height after that (a
|
|
20603
|
+
* popup that positioning shrinks once it is shown), unless it was scrolled or another request
|
|
20604
|
+
* came in between. Call it from an event handler or an effect, never during render.
|
|
20605
|
+
*/
|
|
20606
|
+
scrollToIndex(index: number, options?: {
|
|
20607
|
+
align?: 'auto' | 'start' | 'center' | 'end';
|
|
20608
|
+
}): void;
|
|
20609
|
+
}
|
|
20610
|
+
|
|
20611
|
+
/**
|
|
20612
|
+
* One row of the visible list: an item under expanded branches only, with the facts a row needs
|
|
20613
|
+
* for its tree semantics. A row is a branch when `hasChildren` is true or when
|
|
20614
|
+
* `item.itemType === 'branch'`; `expanded` is true only for a branch whose value is in the
|
|
20615
|
+
* expanded set (so a childless `'branch'` item can be expanded).
|
|
20616
|
+
*/
|
|
20617
|
+
export declare interface VisibleFlatItem {
|
|
20618
|
+
/** The item data, as passed in. */
|
|
20619
|
+
item: FlatTreeItemData;
|
|
20620
|
+
/** The depth, 1 for a root (`aria-level`). */
|
|
20621
|
+
level: number;
|
|
20622
|
+
/** The 1-based place among its siblings, in the order of `items` (`aria-posinset`). */
|
|
20623
|
+
position: number;
|
|
20624
|
+
/** The number of siblings, itself included (`aria-setsize`). */
|
|
20625
|
+
setSize: number;
|
|
20626
|
+
/** The value of the parent as indexed (`undefined` for a root, an unknown parent included). */
|
|
20627
|
+
parentValue: string | undefined;
|
|
20628
|
+
/** Whether other items are nested in it. */
|
|
20629
|
+
hasChildren: boolean;
|
|
20630
|
+
/** Whether it can expand: `hasChildren`, or `item.itemType === 'branch'` (`aria-expanded` is set for these). */
|
|
20631
|
+
isBranch: boolean;
|
|
20632
|
+
/** Whether it is a branch in the expanded set. */
|
|
20633
|
+
expanded: boolean;
|
|
20634
|
+
/** The place in the visible list, 0-based. */
|
|
20635
|
+
index: number;
|
|
20636
|
+
}
|
|
20637
|
+
|
|
18586
20638
|
/** Value provided by {@link WaveProvider} and returned by {@link useWaveTheme}. */
|
|
18587
20639
|
export declare interface WaveContextValue {
|
|
18588
20640
|
/** The active theme. */
|
|
@@ -18598,6 +20650,8 @@ export declare interface WaveContextValue {
|
|
|
18598
20650
|
portalContainer: HTMLElement | null;
|
|
18599
20651
|
/** The merged input defaults of the providers above (`{}` outside a provider). */
|
|
18600
20652
|
inputDefaults: InputDefaults;
|
|
20653
|
+
/** The motion preference of the providers above (`'default'` outside a provider). */
|
|
20654
|
+
motion: MotionPreference;
|
|
18601
20655
|
/** `false` when no {@link WaveProvider} is above the caller (the defaults are returned). */
|
|
18602
20656
|
hasProvider: boolean;
|
|
18603
20657
|
}
|
|
@@ -18624,9 +20678,13 @@ export declare type WaveDir = 'ltr' | 'rtl';
|
|
|
18624
20678
|
* - `inputDefaults` nests differently: a nested provider's defined keys override the enclosing
|
|
18625
20679
|
* provider's, and an omitted key is inherited, so setting only `appearance` in a nested provider
|
|
18626
20680
|
* keeps the enclosing provider's `size`.
|
|
20681
|
+
* - `motion="none"` turns the default motion of every animated part below it off (its motion
|
|
20682
|
+
* slots, Carousel's slide, TabList's sliding line, the reveal of Nav item actions; a part's own
|
|
20683
|
+
* `motion` still wins), while transitions without a slot keep running (Accordion's and Tree's
|
|
20684
|
+
* chevron turns, colour changes); a nested provider inherits an omitted `motion` like `theme`.
|
|
18627
20685
|
*/
|
|
18628
20686
|
export declare const WaveProvider: {
|
|
18629
|
-
({ theme: themeProp, dir: dirProp, portalContainer: portalContainerProp, inputDefaults: inputDefaultsProp, children, className, ref, ...rest }: WaveProviderProps): React_2.JSX.Element;
|
|
20687
|
+
({ theme: themeProp, dir: dirProp, portalContainer: portalContainerProp, inputDefaults: inputDefaultsProp, motion: motionProp, children, className, ref, ...rest }: WaveProviderProps): React_2.JSX.Element;
|
|
18630
20688
|
displayName: string;
|
|
18631
20689
|
};
|
|
18632
20690
|
|
|
@@ -18662,6 +20720,18 @@ export declare interface WaveProviderProps extends React_2.HTMLAttributes<HTMLDi
|
|
|
18662
20720
|
* @default the enclosing WaveProvider's defaults, else none (`medium`, `outline`)
|
|
18663
20721
|
*/
|
|
18664
20722
|
inputDefaults?: InputDefaults;
|
|
20723
|
+
/**
|
|
20724
|
+
* Motion of the subtree. `'none'` makes every motion slot below it (a part's `motion`,
|
|
20725
|
+
* `backdropMotion`, `expandIconMotion` or `indeterminateMotion` left unset) behave as `null`,
|
|
20726
|
+
* which also stops the slide of TabList's selection line, and turns off Carousel's slide or fade
|
|
20727
|
+
* (a Carousel without its own `motion`) and the reveal of Nav item actions; a part's own value
|
|
20728
|
+
* still wins. Transitions that are no motion slot keep running: the turn of Accordion's and
|
|
20729
|
+
* Tree's chevrons, colour changes on hover and press. Fluent's `MotionBehaviourProvider` with `'skip'` is the counterpart, which
|
|
20730
|
+
* `@fluentui/react-components` does not export. A nested provider inherits an omitted `motion`
|
|
20731
|
+
* like `theme`.
|
|
20732
|
+
* @default the enclosing WaveProvider's motion, else 'default'
|
|
20733
|
+
*/
|
|
20734
|
+
motion?: MotionPreference;
|
|
18665
20735
|
/** Content rendered inside the themed container. */
|
|
18666
20736
|
children: React_2.ReactNode;
|
|
18667
20737
|
/** Ref to the themed root `<div>`. */
|