@mortenbrudvik/waveui 0.15.0 → 0.17.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.
Files changed (188) hide show
  1. package/README.md +339 -40
  2. package/dist/components/data-display/List.cjs +1 -1
  3. package/dist/components/data-display/List.cjs.map +1 -1
  4. package/dist/components/data-display/List.mjs +405 -219
  5. package/dist/components/data-display/List.mjs.map +1 -1
  6. package/dist/components/data-display/List.registry.cjs +1 -1
  7. package/dist/components/data-display/List.registry.cjs.map +1 -1
  8. package/dist/components/data-display/List.registry.mjs +12 -6
  9. package/dist/components/data-display/List.registry.mjs.map +1 -1
  10. package/dist/components/input/Combobox.cjs +1 -1
  11. package/dist/components/input/Combobox.cjs.map +1 -1
  12. package/dist/components/input/Combobox.mjs +163 -148
  13. package/dist/components/input/Combobox.mjs.map +1 -1
  14. package/dist/components/input/Dropdown.cjs +1 -1
  15. package/dist/components/input/Dropdown.cjs.map +1 -1
  16. package/dist/components/input/Dropdown.mjs +132 -117
  17. package/dist/components/input/Dropdown.mjs.map +1 -1
  18. package/dist/components/input/Label.cjs +1 -1
  19. package/dist/components/input/Label.cjs.map +1 -1
  20. package/dist/components/input/Label.mjs +1 -0
  21. package/dist/components/input/Label.mjs.map +1 -1
  22. package/dist/components/input/Listbox.cjs +1 -1
  23. package/dist/components/input/Listbox.cjs.map +1 -1
  24. package/dist/components/input/Listbox.mjs +90 -78
  25. package/dist/components/input/Listbox.mjs.map +1 -1
  26. package/dist/components/input/Option.cjs +1 -1
  27. package/dist/components/input/Option.cjs.map +1 -1
  28. package/dist/components/input/Option.data.cjs +2 -0
  29. package/dist/components/input/Option.data.cjs.map +1 -0
  30. package/dist/components/input/Option.data.mjs +114 -0
  31. package/dist/components/input/Option.data.mjs.map +1 -0
  32. package/dist/components/input/Option.mjs +21 -17
  33. package/dist/components/input/Option.mjs.map +1 -1
  34. package/dist/components/layout/FlatTree.cjs +2 -0
  35. package/dist/components/layout/FlatTree.cjs.map +1 -0
  36. package/dist/components/layout/FlatTree.context.cjs +2 -0
  37. package/dist/components/layout/FlatTree.context.cjs.map +1 -0
  38. package/dist/components/layout/FlatTree.context.mjs +20 -0
  39. package/dist/components/layout/FlatTree.context.mjs.map +1 -0
  40. package/dist/components/layout/FlatTree.item.cjs +2 -0
  41. package/dist/components/layout/FlatTree.item.cjs.map +1 -0
  42. package/dist/components/layout/FlatTree.item.mjs +90 -0
  43. package/dist/components/layout/FlatTree.item.mjs.map +1 -0
  44. package/dist/components/layout/FlatTree.mjs +276 -0
  45. package/dist/components/layout/FlatTree.mjs.map +1 -0
  46. package/dist/components/layout/Tree.core.cjs +1 -1
  47. package/dist/components/layout/Tree.core.cjs.map +1 -1
  48. package/dist/components/layout/Tree.core.mjs +166 -165
  49. package/dist/components/layout/Tree.core.mjs.map +1 -1
  50. package/dist/components/layout/Tree.selection.cjs +1 -1
  51. package/dist/components/layout/Tree.selection.cjs.map +1 -1
  52. package/dist/components/layout/Tree.selection.mjs +11 -57
  53. package/dist/components/layout/Tree.selection.mjs.map +1 -1
  54. package/dist/components/layout/useFlatTree.cjs +2 -0
  55. package/dist/components/layout/useFlatTree.cjs.map +1 -0
  56. package/dist/components/layout/useFlatTree.mjs +83 -0
  57. package/dist/components/layout/useFlatTree.mjs.map +1 -0
  58. package/dist/components/portal/Portal.cjs +1 -1
  59. package/dist/components/portal/Portal.cjs.map +1 -1
  60. package/dist/components/portal/Portal.mjs +12 -11
  61. package/dist/components/portal/Portal.mjs.map +1 -1
  62. package/dist/components/provider/WaveProvider.cjs +1 -1
  63. package/dist/components/provider/WaveProvider.cjs.map +1 -1
  64. package/dist/components/provider/WaveProvider.mjs +59 -35
  65. package/dist/components/provider/WaveProvider.mjs.map +1 -1
  66. package/dist/components/table/DataGrid.cjs +1 -1
  67. package/dist/components/table/DataGrid.cjs.map +1 -1
  68. package/dist/components/table/DataGrid.context.cjs +2 -0
  69. package/dist/components/table/DataGrid.context.cjs.map +1 -0
  70. package/dist/components/table/DataGrid.context.mjs +74 -0
  71. package/dist/components/table/DataGrid.context.mjs.map +1 -0
  72. package/dist/components/table/DataGrid.header.cjs +2 -0
  73. package/dist/components/table/DataGrid.header.cjs.map +1 -0
  74. package/dist/components/table/DataGrid.header.mjs +168 -0
  75. package/dist/components/table/DataGrid.header.mjs.map +1 -0
  76. package/dist/components/table/DataGrid.mjs +488 -591
  77. package/dist/components/table/DataGrid.mjs.map +1 -1
  78. package/dist/components/table/DataGrid.sizing.cjs +2 -0
  79. package/dist/components/table/DataGrid.sizing.cjs.map +1 -0
  80. package/dist/components/table/DataGrid.sizing.mjs +187 -0
  81. package/dist/components/table/DataGrid.sizing.mjs.map +1 -0
  82. package/dist/components/table/DataGrid.store.cjs +2 -0
  83. package/dist/components/table/DataGrid.store.cjs.map +1 -0
  84. package/dist/components/table/DataGrid.store.mjs +108 -0
  85. package/dist/components/table/DataGrid.store.mjs.map +1 -0
  86. package/dist/components/table/DataGrid.window.cjs +2 -0
  87. package/dist/components/table/DataGrid.window.cjs.map +1 -0
  88. package/dist/components/table/DataGrid.window.mjs +165 -0
  89. package/dist/components/table/DataGrid.window.mjs.map +1 -0
  90. package/dist/components/table/Table.cjs +1 -1
  91. package/dist/components/table/Table.cjs.map +1 -1
  92. package/dist/components/table/Table.mjs +74 -72
  93. package/dist/components/table/Table.mjs.map +1 -1
  94. package/dist/components/table/Table.resize.cjs +2 -0
  95. package/dist/components/table/Table.resize.cjs.map +1 -0
  96. package/dist/components/table/Table.resize.mjs +98 -0
  97. package/dist/components/table/Table.resize.mjs.map +1 -0
  98. package/dist/components/table/useGridNavigation.cjs +1 -1
  99. package/dist/components/table/useGridNavigation.cjs.map +1 -1
  100. package/dist/components/table/useGridNavigation.mjs +343 -140
  101. package/dist/components/table/useGridNavigation.mjs.map +1 -1
  102. package/dist/components/table/useTableColumnSizing.cjs +2 -0
  103. package/dist/components/table/useTableColumnSizing.cjs.map +1 -0
  104. package/dist/components/table/useTableColumnSizing.mjs +76 -0
  105. package/dist/components/table/useTableColumnSizing.mjs.map +1 -0
  106. package/dist/components/table/useTableFeatures.cjs +2 -0
  107. package/dist/components/table/useTableFeatures.cjs.map +1 -0
  108. package/dist/components/table/useTableFeatures.mjs +110 -0
  109. package/dist/components/table/useTableFeatures.mjs.map +1 -0
  110. package/dist/components/table/useTableSelection.cjs +2 -0
  111. package/dist/components/table/useTableSelection.cjs.map +1 -0
  112. package/dist/components/table/useTableSelection.mjs +39 -0
  113. package/dist/components/table/useTableSelection.mjs.map +1 -0
  114. package/dist/components/table/useTableSort.cjs +2 -0
  115. package/dist/components/table/useTableSort.cjs.map +1 -0
  116. package/dist/components/table/useTableSort.mjs +58 -0
  117. package/dist/components/table/useTableSort.mjs.map +1 -0
  118. package/dist/components/typography/Text.cjs +1 -1
  119. package/dist/components/typography/Text.cjs.map +1 -1
  120. package/dist/components/typography/Text.mjs +11 -7
  121. package/dist/components/typography/Text.mjs.map +1 -1
  122. package/dist/hooks/useActiveDescendant.cjs +1 -1
  123. package/dist/hooks/useActiveDescendant.cjs.map +1 -1
  124. package/dist/hooks/useActiveDescendant.mjs +33 -25
  125. package/dist/hooks/useActiveDescendant.mjs.map +1 -1
  126. package/dist/hooks/useListbox.cjs +1 -1
  127. package/dist/hooks/useListbox.cjs.map +1 -1
  128. package/dist/hooks/useListbox.mjs +140 -130
  129. package/dist/hooks/useListbox.mjs.map +1 -1
  130. package/dist/hooks/useRovingTabIndex.cjs +1 -1
  131. package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
  132. package/dist/hooks/useRovingTabIndex.mjs +1 -1
  133. package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
  134. package/dist/hooks/useSelection.cjs +2 -0
  135. package/dist/hooks/useSelection.cjs.map +1 -0
  136. package/dist/hooks/useSelection.mjs +57 -0
  137. package/dist/hooks/useSelection.mjs.map +1 -0
  138. package/dist/hooks/useVirtualWindow.cjs +2 -0
  139. package/dist/hooks/useVirtualWindow.cjs.map +1 -0
  140. package/dist/hooks/useVirtualWindow.mjs +102 -0
  141. package/dist/hooks/useVirtualWindow.mjs.map +1 -0
  142. package/dist/index.cjs +1 -1
  143. package/dist/index.d.cts +1799 -63
  144. package/dist/index.d.ts +1799 -63
  145. package/dist/index.mjs +150 -136
  146. package/dist/lib/brand.cjs +2 -0
  147. package/dist/lib/brand.cjs.map +1 -0
  148. package/dist/lib/brand.mjs +358 -0
  149. package/dist/lib/brand.mjs.map +1 -0
  150. package/dist/lib/classNames.cjs +1 -1
  151. package/dist/lib/classNames.cjs.map +1 -1
  152. package/dist/lib/classNames.mjs +68 -49
  153. package/dist/lib/classNames.mjs.map +1 -1
  154. package/dist/lib/cn.cjs +1 -1
  155. package/dist/lib/cn.cjs.map +1 -1
  156. package/dist/lib/cn.mjs +5 -1
  157. package/dist/lib/cn.mjs.map +1 -1
  158. package/dist/lib/columnSizing.cjs +2 -0
  159. package/dist/lib/columnSizing.cjs.map +1 -0
  160. package/dist/lib/columnSizing.mjs +27 -0
  161. package/dist/lib/columnSizing.mjs.map +1 -0
  162. package/dist/lib/flatTree.cjs +2 -0
  163. package/dist/lib/flatTree.cjs.map +1 -0
  164. package/dist/lib/flatTree.mjs +118 -0
  165. package/dist/lib/flatTree.mjs.map +1 -0
  166. package/dist/lib/selection.cjs +2 -0
  167. package/dist/lib/selection.cjs.map +1 -0
  168. package/dist/lib/selection.mjs +28 -0
  169. package/dist/lib/selection.mjs.map +1 -0
  170. package/dist/lib/tokens.cjs +2 -0
  171. package/dist/lib/tokens.cjs.map +1 -0
  172. package/dist/lib/tokens.mjs +43 -0
  173. package/dist/lib/tokens.mjs.map +1 -0
  174. package/dist/lib/treeCascade.cjs +2 -0
  175. package/dist/lib/treeCascade.cjs.map +1 -0
  176. package/dist/lib/treeCascade.mjs +52 -0
  177. package/dist/lib/treeCascade.mjs.map +1 -0
  178. package/dist/lib/virtual.cjs +2 -0
  179. package/dist/lib/virtual.cjs.map +1 -0
  180. package/dist/lib/virtual.mjs +54 -0
  181. package/dist/lib/virtual.mjs.map +1 -0
  182. package/dist/lib/waveTokens.cjs +2 -0
  183. package/dist/lib/waveTokens.cjs.map +1 -0
  184. package/dist/lib/waveTokens.mjs +24 -0
  185. package/dist/lib/waveTokens.mjs.map +1 -0
  186. package/dist/styles.css +1 -1
  187. package/package.json +3 -1
  188. package/src/styles/tokens.css +210 -10
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';
@@ -713,6 +714,33 @@ export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLSpanEleme
713
714
  ref?: React_2.Ref<HTMLSpanElement>;
714
715
  }
715
716
 
717
+ /**
718
+ * A full brand ramp: a hex colour (`#rgb` or `#rrggbb`) for each of the 16 stops, darkest first.
719
+ * The shape of Fluent's `BrandVariants`, which `createLightTheme(brand)` and
720
+ * `createDarkTheme(brand)` take. The themes read the light primary from stop 80 (hover 70, pressed
721
+ * 40, focus ring 80), the light selection from stops 160, 150 and 140 with its text at 60, the
722
+ * dark primary from stop 110 (hover 120, pressed 90, focus ring 100) and the dark selection from
723
+ * stops 20, 40 and 10 with its text at 110. A ramp whose stops have the luminance of the default
724
+ * ramp's keeps the contrast of the light and dark themes; the high-contrast theme reads no stop.
725
+ */
726
+ export declare type BrandRamp = Readonly<Record<BrandStop, string>>;
727
+
728
+ /**
729
+ * A stop of the brand ramp, from 10 (the darkest) to 160 (the lightest) in steps of 10: the stops
730
+ * of Fluent's `BrandVariants` and of the `--wave-brand-N` tokens.
731
+ */
732
+ export declare type BrandStop = 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 110 | 120 | 130 | 140 | 150 | 160;
733
+
734
+ /**
735
+ * The 16 brand tokens, `brand10` to `brand160`: the overrides of `--wave-brand-10` to
736
+ * `--wave-brand-160`, in the shape `WaveProvider tokens` and `getTokenStyle` take. Where Fluent's
737
+ * `createLightTheme(brand)` builds a whole theme from a `BrandVariants` ramp, Wave applies the
738
+ * ramp as these tokens over its named themes; the high-contrast theme reads none of them.
739
+ */
740
+ export declare type BrandTokens = {
741
+ [K in `brand${BrandStop}`]: string;
742
+ };
743
+
716
744
  /**
717
745
  * A breadcrumb trail: a `<nav aria-label="Breadcrumb">` landmark with an ordered list. Each child
718
746
  * is placed in its own list item (Fragments are opened, so each of their items gets one too); from
@@ -1886,6 +1914,25 @@ export declare interface CarouselProps extends React_2.HTMLAttributes<HTMLDivEle
1886
1914
  ref?: React_2.Ref<HTMLDivElement>;
1887
1915
  }
1888
1916
 
1917
+ /**
1918
+ * The 12 palette fills as token names, in the order a categorical chart gives them to its series.
1919
+ * The order keeps neighbouring series as far apart as the palette allows, for colour vision and
1920
+ * for hue: in the light and dark themes, every two neighbours (the first and second, the second
1921
+ * and third, up to the eleventh and twelfth) differ by at least 6.3 (OKLab ΔE ×100) under
1922
+ * simulated protanopia, deuteranopia and tritanopia and by at least 15.7 for full colour vision,
1923
+ * and their hues are at least 49° apart. The first six are the six fills that stay furthest apart
1924
+ * as a set, yet no six fills of the palette keep every pair apart for colour-vision deficiencies:
1925
+ * two series that are not neighbours can differ by only about 3.2 among the first six, and by
1926
+ * less further on. So colour never identifies a series on its own: every chart needs a second
1927
+ * encoding (a pattern, a marker shape or a direct label), whatever its number of series, and in
1928
+ * high contrast every palette fill is white. Read each colour through `waveTokens`
1929
+ * (`waveTokens[chartPalette[index]]`), so the series follow the theme. Frozen and server-safe.
1930
+ *
1931
+ * @example
1932
+ * const color = waveTokens[chartPalette[index % chartPalette.length]];
1933
+ */
1934
+ export declare const chartPalette: readonly WaveTokenName[];
1935
+
1889
1936
  /**
1890
1937
  * A checkbox for a boolean (or mixed) choice, drawn as a `role="checkbox"` button inside a
1891
1938
  * `<label>`.
@@ -2051,6 +2098,9 @@ export declare interface CheckedValuesChangeDetails {
2051
2098
  */
2052
2099
  export declare type CheckedValuesChangeHandler = (checkedValues: Record<string, string[]>, details?: CheckedValuesChangeDetails) => void;
2053
2100
 
2101
+ /** The check state of an item in a `selectionMode="multiple"` tree. */
2102
+ export declare type CheckState = 'checked' | 'mixed' | 'unchecked';
2103
+
2054
2104
  /**
2055
2105
  * Joins class names (clsx) and resolves Tailwind conflicts so the **last** class wins — pass
2056
2106
  * internal classes first and the consumer's `className` last.
@@ -2639,6 +2689,26 @@ export declare interface ColorSwatchProps extends Omit<React_2.ButtonHTMLAttribu
2639
2689
  ref?: React_2.Ref<HTMLButtonElement>;
2640
2690
  }
2641
2691
 
2692
+ /** The sizing of one column of a table with resizable columns. */
2693
+ export declare interface ColumnSizingOption {
2694
+ /**
2695
+ * The narrowest the column can be, in pixels: the initial width and every resize are held at or
2696
+ * above it.
2697
+ * @default 80
2698
+ */
2699
+ minWidth?: number;
2700
+ /**
2701
+ * The width the column starts at when it has no `defaultWidth`, in pixels.
2702
+ * @default 150
2703
+ */
2704
+ idealWidth?: number;
2705
+ /**
2706
+ * The width the column starts at, in pixels. It wins over `idealWidth`.
2707
+ * @default idealWidth, else 150
2708
+ */
2709
+ defaultWidth?: number;
2710
+ }
2711
+
2642
2712
  /**
2643
2713
  * An editable combobox: a text input with a filterable listbox of `Option`s (APG combobox with
2644
2714
  * list autocomplete). Typing filters the options; ArrowDown/ArrowUp move the highlight
@@ -2668,6 +2738,15 @@ export declare interface ColorSwatchProps extends Omit<React_2.ButtonHTMLAttribu
2668
2738
  * the value. `freeform` is not available with `multiselect`, and a non-literal
2669
2739
  * `multiselect={flag}` is a type error: render two elements, one for each mode.
2670
2740
  *
2741
+ * **Data mode**: `items` passes the options as data instead of children. The open list renders an
2742
+ * option per matching item (`renderOption` draws it, an `Option` with the item's label by
2743
+ * default) and the closed list none; the keys, the filter and the input's text follow the data,
2744
+ * and each option carries `aria-posinset` and `aria-setsize` among the shown options. A long list
2745
+ * takes a `virtualWindow` (from `useVirtualWindow({ itemSize })`): the open list then renders only
2746
+ * the options in view, plus an overscan, with spacers for the others, every option `itemSize`
2747
+ * tall; the active option stays rendered, and opening scrolls it (else the first selected option)
2748
+ * to the middle of the list.
2749
+ *
2671
2750
  * The `<input>` receives `id`, `aria-label`, `aria-labelledby`, `aria-describedby`,
2672
2751
  * `aria-invalid`, `aria-required`, `aria-errormessage`, `aria-details`, `tabIndex`, `autoFocus`,
2673
2752
  * `onFocus`/`onBlur`/`onKeyDown`/`onKeyUp` and the text input attributes `autoComplete`,
@@ -2694,7 +2773,8 @@ export declare const Combobox: ComboboxComponent;
2694
2773
  * Combobox: `root` on the outer element; `input` on the `role="combobox"` input; `clearButton` on
2695
2774
  * the clear button; `expandButton` on the expand button and `expandIcon` on its glyph; `listbox`
2696
2775
  * on the `role="listbox"` list; `surface` on its portaled popup; `emptyMessage` on the
2697
- * "No matches" row.
2776
+ * "No matches" row; `spacer` on each spacer element of the list with a `virtualWindow` (the
2777
+ * elements that stand in for the options that are not rendered).
2698
2778
  */
2699
2779
  export declare const comboboxClassNames: {
2700
2780
  readonly root: "wave-combobox";
@@ -2705,6 +2785,7 @@ export declare const comboboxClassNames: {
2705
2785
  readonly listbox: "wave-combobox__listbox";
2706
2786
  readonly surface: "wave-combobox__surface";
2707
2787
  readonly emptyMessage: "wave-combobox__empty-message";
2788
+ readonly spacer: "wave-combobox__spacer";
2708
2789
  };
2709
2790
 
2710
2791
  /** The Combobox component's type: a multi-select signature, then the single-select one. */
@@ -2857,8 +2938,9 @@ export declare interface ComboboxProps<M extends boolean = false> extends Omit<R
2857
2938
  * keep options that do not contain the text: `filter={() => true}` with `query` and
2858
2939
  * `onQueryChange` leaves the matching to you (a server-side search that replaces the options),
2859
2940
  * and a filter that always keeps an option of your own gives a "Create …" entry. With a
2860
- * server-side search, keep the selected option among the children, `hidden` while the results
2861
- * leave it out: a value without an option shows no label (the "Async search" story does this).
2941
+ * server-side search, keep the selected option among the children (or `items`), `hidden` while
2942
+ * the results leave it out: a value without an option shows no label (the "Async search" story
2943
+ * does this).
2862
2944
  * @default a case-insensitive substring match on the option's `textValue`, else its `label`
2863
2945
  */
2864
2946
  filter?: (option: ListboxItem, query: string) => boolean;
@@ -2952,6 +3034,51 @@ export declare interface ComboboxProps<M extends boolean = false> extends Omit<R
2952
3034
  * Unset members keep their English defaults.
2953
3035
  */
2954
3036
  labels?: ComboboxLabels;
3037
+ /**
3038
+ * Data mode: the options as data, in list order (`value`, `label`, and optionally `textValue`,
3039
+ * `disabled` and `hidden`; values unique). The open list renders one option per item that is
3040
+ * not `hidden` and that the typed text matches (`filter`, on `textValue ?? label` by default; see
3041
+ * `renderOption`); the closed list renders none. The keys, the selection and the input's label
3042
+ * text follow `items`, also for a selected item whose option is not rendered. The children are
3043
+ * neither read nor rendered: passing both warns once in development. Each option gets
3044
+ * `aria-posinset` and `aria-setsize` from its place among the shown items (typing narrows
3045
+ * them), and keeps one id per value. Without it, the options are the `Option` children.
3046
+ */
3047
+ items?: readonly ListboxItem[];
3048
+ /**
3049
+ * Data mode: renders the option of an item, given its state (`selected`, `active`, and `index`
3050
+ * among the shown options). Return an `Option`, or an option component of your own on
3051
+ * `useListboxOption`, with the item's `value` (and its `disabled`); its position is set for you,
3052
+ * and in a windowed list (`virtualWindow`) its height. It is called again only when the item, its
3053
+ * state, its position (`aria-posinset` and `aria-setsize`, which typing changes) or the function
3054
+ * itself changes, so pass a stable function in a long list. Ignored without `items`, with a
3055
+ * development warning.
3056
+ * @default an `Option` with the item's `value`, `label` (also its text), `textValue` and `disabled`
3057
+ */
3058
+ renderOption?: (item: ListboxItem, state: ListboxOptionRenderState) => React_2.ReactNode;
3059
+ /**
3060
+ * Data mode: renders only the options in view of a long list, plus an overscan, and spacers
3061
+ * (`aria-hidden`, `data-virtual-spacer`) as tall as the options they stand for: pass the result
3062
+ * of `useVirtualWindow({ itemSize })`, or an object of your own that implements `VirtualWindow`.
3063
+ * It needs `items`: without them, or beside `OptionGroup` children, it is ignored with a
3064
+ * development warning (a window renders a flat list).
3065
+ *
3066
+ * The open popup's list is the window's scroller, so it needs no height of yours: it scrolls
3067
+ * within its own maximum height (15rem, 240 pixels at the default root size, less where the
3068
+ * viewport has no room). Every option is exactly `itemSize` tall (the list sets its height,
3069
+ * after the option's own `style`), so an option's content must fit in it: the default `Option`
3070
+ * with one line of text is 32 pixels tall.
3071
+ *
3072
+ * The window counts the shown options: typing narrows it, as it narrows `aria-setsize`. The
3073
+ * arrow keys move over all of them; the active option stays rendered while it is scrolled away,
3074
+ * so `aria-activedescendant` always names an element, and when a key (or typing) makes it
3075
+ * active the list and the window move to it in the same update. Opening the list scrolls the
3076
+ * active option, else the first selected one, to the middle of the list, and again once the
3077
+ * popup's positioning has given the list its height (a short viewport) unless it was scrolled
3078
+ * first. A closed list renders no option. The browser's scroll anchoring is off on a windowed
3079
+ * list (the window lays the options out).
3080
+ */
3081
+ virtualWindow?: VirtualWindow;
2955
3082
  /**
2956
3083
  * Called when the `<input role="combobox">` receives focus (the root keeps other handlers).
2957
3084
  * With `multiselect`, a focus while the input shows the selected labels then selects them;
@@ -3159,6 +3286,48 @@ export declare interface CounterBadgeProps extends React_2.HTMLAttributes<HTMLSp
3159
3286
  ref?: React_2.Ref<HTMLSpanElement>;
3160
3287
  }
3161
3288
 
3289
+ /**
3290
+ * The brand tokens of a brand colour or of a full ramp, to pass as `WaveProvider tokens` (alone or
3291
+ * spread with other overrides) or to `getTokenStyle`. Wave's counterpart of Fluent's
3292
+ * `createLightTheme(brand)` and `createDarkTheme(brand)`, which take a full `BrandVariants` ramp;
3293
+ * Wave also builds the ramp from one colour. The high-contrast theme ignores the brand: its colours
3294
+ * are fixed.
3295
+ *
3296
+ * From a seed (`#rgb` or `#rrggbb`, any case, with the `#`), each stop keeps the **luminance of the
3297
+ * default ramp's stop** and takes its hue and colourfulness from the seed: the seed's OKLCH chroma
3298
+ * and hue, shaped per stop like the default ramp (less colourful toward both ends, the hue
3299
+ * drifting a few degrees as the default's does), reduced where the colour would leave sRGB, and
3300
+ * rounded to a neighbouring 8-bit colour on the side that keeps its contrast. Contrast depends
3301
+ * only on luminance, so every text, fill, stroke and focus-ring pair of the light and dark themes
3302
+ * keeps, to within 8-bit rounding, the contrast it has with the default ramp, and stays above the
3303
+ * floor the themes are held to (4.5:1 for text, 3:1 for strokes, graphics and focus rings, 1.15:1
3304
+ * between the states of a fill), whatever the seed. The cost: the seed sets hue and
3305
+ * colourfulness, not lightness, so the primary fill (stop 80) is the seed's hue at the default's
3306
+ * lightness, and a light seed gives a darker button than itself. For a brand whose exact colours
3307
+ * matter, pass a full `BrandRamp`. The default seed `#0f6cbd` gives the default ramp, and a grey
3308
+ * seed (black, white or any grey) a grey ramp.
3309
+ *
3310
+ * A full `BrandRamp` is returned as tokens with its colours unchanged; a stop that is missing or
3311
+ * not a hex colour takes the default ramp's colour, with a development warning. In development the
3312
+ * ramp is also checked against the pairs the light and dark themes read from it (the primary
3313
+ * colour as text and as a fill under its text, the hover and pressed fills, the selection fills
3314
+ * and their text, the focus ring): each pair below its minimum (4.5:1 for text, 3:1 for the focus
3315
+ * ring, 1.15:1 between the states of a fill) logs one warning naming the theme, the tokens, the
3316
+ * stops and the ratio. The check is advisory: the ramp applies as given. Any other seed returns
3317
+ * the default ramp, with a development warning.
3318
+ *
3319
+ * Pure and server-safe; it returns a new object on each call, so compute it once (at module scope,
3320
+ * or memoised) rather than on every render.
3321
+ *
3322
+ * @example
3323
+ * const brand = createBrandTokens('#c43e00');
3324
+ * <WaveProvider tokens={brand}>…</WaveProvider>
3325
+ *
3326
+ * @example
3327
+ * <WaveProvider tokens={{ ...createBrandTokens('#c43e00'), fontFamily: 'Inter, sans-serif' }}>
3328
+ */
3329
+ export declare function createBrandTokens(seed: string | BrandRamp): BrandTokens;
3330
+
3162
3331
  /**
3163
3332
  * Creates a column for DataGrid's `columns`, typed by the grid's items, with `sortable` resolved
3164
3333
  * (`true` when the column has `compare`, unless `sortable` says otherwise). Returns a new object
@@ -3239,6 +3408,29 @@ export declare function createToaster(): ToasterHandle;
3239
3408
  * itself, and `DataGrid.Body` also takes a render function that returns each item's row. Rows
3240
3409
  * rendered from `items` take their `rowId` from `getRowId` (by default the item's index).
3241
3410
  *
3411
+ * With `items`, selection follows the data rather than the rendered rows: select-all and its
3412
+ * checkbox cover every item (`isSelectionDisabled` leaves items out), and ids of rows that are
3413
+ * filtered out, on another page or not rendered stay selected through row clicks, select-all and
3414
+ * sorting, and are reported by `onSelectedItemsChange`.
3415
+ *
3416
+ * With `items` and `columns`, the columns can be sized: `resizableColumns` gives each column
3417
+ * header a resize handle (a separator that a pointer drags and the arrow keys move, mirrored in
3418
+ * right-to-left grids; F2 on a column header moves focus to it, and Enter, Space or Escape back),
3419
+ * `columnSizingOptions` sets each column's initial and minimum width, and `columnWidths` or
3420
+ * `defaultColumnWidths` with `onColumnWidthsChange(widths, details)` hold the widths, for
3421
+ * instance to persist them (Fluent's `resizableColumns`, `columnSizingOptions` and
3422
+ * `onColumnResize`, whose data is in `details`). The grid then lays its columns out from the
3423
+ * widths and truncates its cells' text.
3424
+ *
3425
+ * With `items` and `columns`, a `virtualWindow` (from `useVirtualWindow`) renders only the rows in
3426
+ * view of a long list, with spacer rows for the others: the scroll wrapper (`containerProps`)
3427
+ * needs a bounded height, and every row has the window's fixed row height. The header stays at
3428
+ * the top of the wrapper, the keyboard moves by the data (a row that is not rendered is scrolled
3429
+ * in before it gets focus), the focused row stays rendered, and selection, select-all, sorting
3430
+ * and column sizing still cover every item. The grid then carries `aria-rowcount` and its rows
3431
+ * `aria-rowindex`, so assistive technology reads each row's place in the whole list. Fluent's
3432
+ * DataGrid has no built-in counterpart.
3433
+ *
3242
3434
  * Sub-components are available as `DataGrid.Header`, `DataGrid.HeaderCell`, `DataGrid.Body`,
3243
3435
  * `DataGrid.Row`, `DataGrid.Cell` and `DataGrid.SelectionCell` in client components, and as the
3244
3436
  * flat exports `DataGridHeader`, `DataGridHeaderCell`, `DataGridBody`, `DataGridRow`,
@@ -3250,7 +3442,7 @@ export declare const DataGrid: typeof DataGridRoot & {
3250
3442
  displayName: string;
3251
3443
  };
3252
3444
  HeaderCell: {
3253
- ({ columnId, sortable, sortIcon, children, className, onClick, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
3445
+ ({ columnId, sortable, sortIcon, children, className, onClick, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
3254
3446
  displayName: string;
3255
3447
  };
3256
3448
  Body: {
@@ -3258,7 +3450,7 @@ export declare const DataGrid: typeof DataGridRoot & {
3258
3450
  displayName: string;
3259
3451
  };
3260
3452
  Row: {
3261
- ({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
3453
+ ({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, style, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
3262
3454
  displayName: string;
3263
3455
  };
3264
3456
  Cell: {
@@ -3275,10 +3467,28 @@ export declare const DataGrid: typeof DataGridRoot & {
3275
3467
  export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttributes<HTMLTableElement> {
3276
3468
  /**
3277
3469
  * The row id of an item: the `rowId` of its row (for selection), for rows rendered from `items`.
3278
- * A row's own `rowId` wins. Ids must be unique (a duplicate warns in development).
3470
+ * Select-all and its checkbox use these ids, whether the rows are rendered or not. A row's own
3471
+ * `rowId` wins for that row, but a row whose own id differs from its item's id is outside
3472
+ * select-all and its state, and select-all selects the item's id, which no row has (a
3473
+ * development warning says so): return the rows' ids here rather than setting `rowId`. Ids must
3474
+ * be unique (a duplicate warns in development). Define it outside the component, or memoise it:
3475
+ * a new function rebuilds the row of every item and the set of ids select-all works on (with a
3476
+ * `virtualWindow`, the component that holds the window renders at every row the view enters).
3279
3477
  * @default the item's index in `items`, as a string
3280
3478
  */
3281
3479
  getRowId?: (item: T) => string;
3480
+ /**
3481
+ * Whether the selection of an item of `items` is disabled (`index` is its index in `items`), so
3482
+ * select-all can skip items whose rows are not rendered. Select-all leaves such an item as it is,
3483
+ * selected or not, and its state counts only the other items. The item's row takes it as the
3484
+ * `disabled` of its selection cell (a disabled control; neither a row click nor Space changes
3485
+ * it), unless the cell sets `disabled` itself: the cell's value then applies to the control, a
3486
+ * value that disagrees warns in development, and select-all skips a row that either disables.
3487
+ * Without it, every item is selectable unless its rendered row disables its selection cell.
3488
+ * Ignored without `items`. Called for every item whenever `items`, `getRowId` or this function
3489
+ * change: define it outside the component, or memoise it.
3490
+ */
3491
+ isSelectionDisabled?: (item: T, index: number) => boolean;
3282
3492
  /**
3283
3493
  * Column definitions. When given and no `DataGrid.Header` child is present, the header row
3284
3494
  * (including the selection column) is rendered from them: `columnId` becomes the header cell's
@@ -3289,6 +3499,87 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
3289
3499
  * memoised).
3290
3500
  */
3291
3501
  columns?: readonly DataGridColumn<T>[];
3502
+ /**
3503
+ * Gives the header cell of each column (of `columns`, by `columnId`; the last one included, the
3504
+ * selection column not) a resize handle: a focusable `role="separator"` with the column's width
3505
+ * as `aria-valuenow`. A drag (mouse, touch or pen) moves the column's end edge, mirrored in
3506
+ * right-to-left grids. From the keyboard, F2 on a header cell (or on its sort button) moves focus
3507
+ * to its handle, which adds no Tab stop to the grid; there the arrow keys move the edge by 20
3508
+ * pixels (5 with Shift, mirrored in right-to-left grids), Home sets the minimum width, and Enter,
3509
+ * Space or Escape return focus to the header (its sort button, which Enter still activates
3510
+ * directly). A double click sets the column back to its initial width once a width is state.
3511
+ * The grid carries `data-resizing` while a handle drags. Needs `columns` and `items`, as every
3512
+ * column width prop does: without them they are all ignored, with a development warning.
3513
+ * Fluent's `resizableColumns`.
3514
+ * @default false
3515
+ */
3516
+ resizableColumns?: boolean;
3517
+ /**
3518
+ * The sizing of each column, by `columnId`: `minWidth` (`@default 80`), and the width it starts
3519
+ * at, `defaultWidth`, else `idealWidth`, else 150 (never below `minWidth`). With it, or with
3520
+ * `columnWidths` or `defaultColumnWidths`, the grid lays its columns out from these widths
3521
+ * (a `<colgroup>` and a fixed table layout) with or without `resizableColumns`, and its cells
3522
+ * truncate their text with an ellipsis unless a cell's class says otherwise. Until a width is
3523
+ * state the grid is 100% wide and at least as wide as its columns, so a wider container spreads
3524
+ * them (the selection column too); the first change takes the widths the columns are drawn at,
3525
+ * so nothing jumps, and from then on the grid is exactly as wide as its columns (slack shows
3526
+ * after the last one). There is no maximum width and no fitting to the container. Ids that are
3527
+ * not columns are ignored; it may be written inline. Fluent's `columnSizingOptions`.
3528
+ */
3529
+ columnSizingOptions?: Record<string, ColumnSizingOption>;
3530
+ /**
3531
+ * The column widths in pixels (controlled), by `columnId`; a column without an entry has its
3532
+ * initial width (see `columnSizingOptions`), and a width below the column's minimum is held at
3533
+ * it. The grid is exactly as wide as its columns. Pair it with `onColumnWidthsChange`; a parent
3534
+ * that ignores a change leaves the column where it is.
3535
+ */
3536
+ columnWidths?: Record<string, number>;
3537
+ /** The column widths in pixels at first render (uncontrolled; see `columnWidths`). */
3538
+ defaultColumnWidths?: Record<string, number>;
3539
+ /**
3540
+ * Called with the width of every column (by `columnId`) whenever a width changes, at every step
3541
+ * of a drag (at most once per animation frame) or key press, then `details`: `{ columnId,
3542
+ * width, event }`, the resized column, its new width and the event behind it. The grid always
3543
+ * passes `details`; it is typed optional through 0.x, as every `details` argument. Setting the
3544
+ * width a column already has does not call it once a width is state. Fluent's `onColumnResize`,
3545
+ * whose data is in `details`.
3546
+ */
3547
+ onColumnWidthsChange?: (widths: Record<string, number>, details?: TableColumnWidthsChangeDetails) => void;
3548
+ /**
3549
+ * Renders only the body rows in view, plus an overscan, of a grid with many `items`: pass the
3550
+ * result of `useVirtualWindow({ itemSize })` (or an object of your own that implements
3551
+ * `VirtualWindow`). The rows that are not rendered are replaced by spacer rows (`aria-hidden`,
3552
+ * `data-virtual-spacer`) of their height. Fluent has no counterpart in its DataGrid.
3553
+ *
3554
+ * The grid's scroll wrapper (the element of `containerProps`) becomes the window's scroller, so
3555
+ * give it a bounded height, a height or a maximum height in `containerProps`: without one the
3556
+ * window measures the whole list and renders every row (a development warning says so). Every
3557
+ * row has the window's `itemSize` as its height: the grid sets it on each body row, drops the
3558
+ * vertical padding of its cells and keeps their text on one line, so a cell's content must fit
3559
+ * in it. The columns are laid out from widths (as with `columnSizingOptions`), so they never
3560
+ * change width as rows come and go. The header stays at the top of the scroller: pass its height
3561
+ * as `scrollPaddingStart` to `useVirtualWindow`, so keyboard moves bring rows into the area below
3562
+ * it. The scroller is no tab stop of its own (`tabIndex` -1, as Firefox would stop on it; a
3563
+ * `tabIndex` in `containerProps` wins), and the browser's scroll anchoring is off on it (the
3564
+ * window lays the rows out).
3565
+ *
3566
+ * The keyboard moves by the data: ArrowUp/ArrowDown, PageUp/PageDown and Ctrl+Home/Ctrl+End
3567
+ * scroll a target row that is not rendered into the window, then focus it, and the focused row
3568
+ * stays rendered when it is scrolled away. When a data change (a sort, new `items`) makes the
3569
+ * browser drop focus from the moved row, focus returns to the same row, or to the row nearest
3570
+ * its place. Sorting, selection, select-all and column sizing work on every item, rendered or
3571
+ * not. The grid carries `aria-rowcount` (the items plus the header rows), every row
3572
+ * `aria-rowindex` (1-based, the header rows first, the body rows in the sorted order) and every
3573
+ * body row `data-row-index` (its 0-based position in the sorted order); a grid without a window
3574
+ * renders none of them.
3575
+ *
3576
+ * Needs `items` and `columns`, with the body rows rendered from them (no `DataGrid.Body` child,
3577
+ * or one whose child is a render function); otherwise it is ignored, with a development warning.
3578
+ * The component that calls `useVirtualWindow` renders again at every row the view enters: keep
3579
+ * `items`, `columns`, `getRowId` and `isSelectionDisabled` stable (defined outside it, or
3580
+ * memoised), or each of those renders rebuilds the rows of every item.
3581
+ */
3582
+ virtualWindow?: VirtualWindow;
3292
3583
  /**
3293
3584
  * Row selection mode. `'multiple'` adds a checkbox column with a "Select all rows" header
3294
3585
  * checkbox; `'single'` adds a radio column (its header reads "Selection" to assistive
@@ -3297,8 +3588,10 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
3297
3588
  */
3298
3589
  selectionMode?: 'none' | SelectionMode_2;
3299
3590
  /**
3300
- * The name of the select-all checkbox and the header text of the selection column, for
3301
- * localization. Unset members keep their English defaults. Rows are named with their own
3591
+ * The grid's built-in text, for localization: the name of the select-all checkbox
3592
+ * (`selectAll`), the header text of the selection column (`selectionHeader`), and, with
3593
+ * `resizableColumns`, the name of the resize handles (`resizeColumn`) and their value text
3594
+ * (`columnWidth`). Unset members keep their English defaults. Rows are named with their own
3302
3595
  * `selectionLabel`.
3303
3596
  */
3304
3597
  labels?: DataGridLabels;
@@ -3330,18 +3623,33 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
3330
3623
  */
3331
3624
  subtleSelection?: boolean;
3332
3625
  /**
3333
- * Controlled selected row ids (`DataGrid.Row` `rowId`). In single mode pass at most one id: with
3334
- * several, only the first one whose row is rendered is selected (a development warning says so).
3626
+ * Controlled selected row ids (`DataGrid.Row` `rowId`; with `items`, the ids from `getRowId`).
3627
+ * With `items`, every id counts, whether its row is rendered, filtered out or on another page
3628
+ * (see `onSelectedItemsChange`). In single mode pass at most one id: with several, only the
3629
+ * first one is selected (without `items`, the first one whose row is rendered), and a
3630
+ * development warning says so.
3335
3631
  */
3336
3632
  selectedItems?: readonly string[];
3337
3633
  /** Initially selected row ids (uncontrolled). In single mode, at most one (see `selectedItems`). */
3338
3634
  defaultSelectedItems?: readonly string[];
3339
3635
  /**
3340
3636
  * Called with the new selected row ids when the selection changes, then `details` (`{ event }`,
3341
- * the click or key press behind the change). Ids of rows that are not rendered are left out of
3342
- * the reported selection and of the select-all state, so the next change drops them. Until that
3343
- * change an uncontrolled grid still holds such an id: a row re-added with the same `rowId` before
3344
- * then is shown selected again.
3637
+ * the click or key press behind the change).
3638
+ *
3639
+ * With `items`, the selection follows the data: it reports every selected id, also ids whose
3640
+ * rows are not rendered or not in `items` (filtered out, on another page, restored by id), and no
3641
+ * change drops them. Select-all selects every item of `items` whose selection is not disabled
3642
+ * (`isSelectionDisabled`, or the selection cell of its rendered row) and keeps every other id;
3643
+ * when all of them are selected it removes only their ids. The select-all checkbox shows the
3644
+ * state of those items. Both use the ids from `getRowId` (by default the item's index): a row
3645
+ * that sets its own, different `rowId` (or a `DataGrid.Row` child whose `rowId` is no item's
3646
+ * id) is outside them, and select-all then selects ids that no row has, with a development
3647
+ * warning. Pass a `getRowId` that returns the rows' ids.
3648
+ *
3649
+ * Without `items` (rows written as `DataGrid.Row` children), ids of rows that are not rendered
3650
+ * are left out of the reported selection and of the select-all state, so the next change drops
3651
+ * them. Until that change an uncontrolled grid still holds such an id: a row re-added with the
3652
+ * same `rowId` before then is shown selected again.
3345
3653
  */
3346
3654
  onSelectedItemsChange?: (selectedItems: string[], details?: DataGridSelectedItemsChangeDetails) => void;
3347
3655
  /** @deprecated Use `selectedItems` (an array). A `Set` or an array is accepted. */
@@ -3352,7 +3660,8 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
3352
3660
  onSelectionChange?: (keys: Set<string>) => void;
3353
3661
  /**
3354
3662
  * Props for the wrapper `<div>` around the `<table>`: a horizontally scrollable container
3355
- * (`overflow-x-auto`). Use it for its className, style (e.g. a max height) or ref. The wrapper
3663
+ * (`overflow-x-auto`). Use it for its className, style (e.g. a max height) or ref. With a
3664
+ * `virtualWindow` it is the window's scroller, which needs a bounded height. The wrapper
3356
3665
  * is not a tab stop (the grid's own cell tab stop scrolls it) and has no role, so its
3357
3666
  * `aria-label`/`aria-labelledby` are applied only together with a `role` (e.g. `'region'`);
3358
3667
  * without one they are dropped with a development warning. Name the grid with `aria-label`.
@@ -3370,7 +3679,9 @@ export declare interface DataGridBaseProps<T = unknown> extends React_2.HTMLAttr
3370
3679
  /**
3371
3680
  * The grid's `<tbody>`. Its child can also be a render function, called with each item of the
3372
3681
  * grid's `items` (and its index there) to render the item's row; without children, a grid with
3373
- * `items` and `columns` renders the rows from the columns.
3682
+ * `items` and `columns` renders the rows from the columns. In a grid with a `virtualWindow` it
3683
+ * renders the rows of the window, the function being called for those rows only, and a spacer
3684
+ * row for each run of rows it leaves out.
3374
3685
  */
3375
3686
  export declare const DataGridBody: {
3376
3687
  <T>({ children, className, ref, ...rest }: DataGridBodyProps<T>): React_2.JSX.Element;
@@ -3401,7 +3712,10 @@ export declare interface DataGridBodyProps<T = unknown> extends Omit<React_2.HTM
3401
3712
 
3402
3713
  /**
3403
3714
  * A grid cell (`<td>`), focusable through the grid's keyboard navigation. It is the positioning
3404
- * box of a `Table.CellActions` inside it.
3715
+ * box of a `Table.CellActions` inside it. In a grid that lays its columns out from widths (column
3716
+ * sizing, a `virtualWindow`), its text stays on one line and is truncated with an ellipsis, unless
3717
+ * its class says otherwise. In a body row of a grid with a `virtualWindow` it has no vertical
3718
+ * padding: the row has the window's height, which its content must fit in.
3405
3719
  */
3406
3720
  export declare const DataGridCell: {
3407
3721
  ({ children, className, ref, ...rest }: DataGridCellProps): React_2.JSX.Element;
@@ -3421,10 +3735,15 @@ export declare interface DataGridCellProps extends React_2.TdHTMLAttributes<HTML
3421
3735
  ref?: React_2.Ref<HTMLTableCellElement>;
3422
3736
  }
3423
3737
 
3424
- /** DataGrid: `root` on the grid element (`role="grid"`); `container` on the wrapper around it. */
3738
+ /**
3739
+ * DataGrid: `root` on the grid element (`role="grid"`); `container` on the wrapper around it;
3740
+ * `spacer` on each spacer row of a grid with a `virtualWindow` (the rows that stand in for the
3741
+ * rows that are not rendered).
3742
+ */
3425
3743
  export declare const dataGridClassNames: {
3426
3744
  readonly root: "wave-data-grid";
3427
3745
  readonly container: "wave-data-grid__container";
3746
+ readonly spacer: "wave-data-grid__spacer";
3428
3747
  };
3429
3748
 
3430
3749
  /**
@@ -3492,6 +3811,8 @@ export declare interface DataGridControlledSortProps extends NoDeprecatedSortPro
3492
3811
  * mode) or the "Selection" header (single mode; DataGrid's `labels` localizes both), later rows of
3493
3812
  * a grouped header an empty cell. A header row rendered by another component cannot get it (a
3494
3813
  * development warning says so): use `DataGrid.Row` for such a row, which adds the cell itself.
3814
+ * In a grid with a `virtualWindow` the header stays at the top of the grid's scroll wrapper while
3815
+ * the rows scroll under it, and each header row carries its `aria-rowindex`.
3495
3816
  */
3496
3817
  export declare const DataGridHeader: {
3497
3818
  ({ children, className, ref, ...rest }: DataGridHeaderProps): React_2.JSX.Element;
@@ -3503,21 +3824,28 @@ export declare const DataGridHeader: {
3503
3824
  * `<button type="button">` that toggles the sort, followed by the direction glyph (`sortIcon`)
3504
3825
  * while its column is sorted; the `<th>` carries `aria-sort`. A consumer `onClick` (on the `<th>`)
3505
3826
  * runs before the sort, and calling `preventDefault()` in it cancels the sort (also for
3506
- * Enter/Space on the button, which click it).
3827
+ * Enter/Space on the button, which click it). In a grid with `resizableColumns`, the header cell
3828
+ * of a column of `columns` (by `columnId`) also holds the column's resize handle, after its
3829
+ * content, along its end edge (the cell is positioned for it); the cell is then named by its
3830
+ * content alone (`aria-labelledby`, unless it has a name of its own), not by the handle's label.
3831
+ * The handle is no target of the grid's navigation: a sortable cell's target stays its sort
3832
+ * button, and F2 on the cell or the button moves focus to the handle.
3507
3833
  */
3508
3834
  export declare const DataGridHeaderCell: {
3509
- ({ columnId, sortable, sortIcon, children, className, onClick, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
3835
+ ({ columnId, sortable, sortIcon, children, className, onClick, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: DataGridHeaderCellProps): React_2.JSX.Element;
3510
3836
  displayName: string;
3511
3837
  };
3512
3838
 
3513
3839
  /**
3514
3840
  * DataGrid.HeaderCell: `root` on the `<th>`; `button` on the sort button; `sortIcon` on its
3515
- * direction glyph (the default arrow `<svg>`, or the `<span>` of a `sortIcon` slot).
3841
+ * direction glyph (the default arrow `<svg>`, or the `<span>` of a `sortIcon` slot);
3842
+ * `resizeHandle` on the column's resize handle (a `Table.ResizeHandle`, with resizable columns).
3516
3843
  */
3517
3844
  export declare const dataGridHeaderCellClassNames: {
3518
3845
  readonly root: "wave-data-grid-header-cell";
3519
3846
  readonly button: "wave-data-grid-header-cell__button";
3520
3847
  readonly sortIcon: "wave-data-grid-header-cell__sort-icon";
3848
+ readonly resizeHandle: "wave-data-grid-header-cell__resize-handle";
3521
3849
  };
3522
3850
 
3523
3851
  /** Properties for the DataGridHeaderCell sub-component. */
@@ -3619,6 +3947,16 @@ export declare interface DataGridLabels {
3619
3947
  * @default 'Selection'
3620
3948
  */
3621
3949
  selectionHeader?: string;
3950
+ /**
3951
+ * Accessible name of each column's resize handle (`resizableColumns`).
3952
+ * @default 'Resize column'
3953
+ */
3954
+ resizeColumn?: string;
3955
+ /**
3956
+ * Builds the value text of a resize handle (`aria-valuetext`) from the column's width in pixels.
3957
+ * @default (width) => `${width} pixels`
3958
+ */
3959
+ columnWidth?: (width: number) => string;
3622
3960
  }
3623
3961
 
3624
3962
  /**
@@ -3687,9 +4025,13 @@ declare namespace DataGridRoot {
3687
4025
  * ancestor, so the rows of a grid nested in a cell
3688
4026
  * share it: hovering the outer row also draws the subtle controls of the nested grid (a limit of
3689
4027
  * CSS groups). A Tree in a cell keeps its own rows' group.
4028
+ *
4029
+ * In a grid with a `virtualWindow`, a row rendered for an item has the window's `itemSize` as its
4030
+ * height (its own `style` height loses) and carries `aria-rowindex` and `data-row-index`; a header
4031
+ * row carries `aria-rowindex`.
3690
4032
  */
3691
4033
  export declare const DataGridRow: {
3692
- ({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
4034
+ ({ rowId: rowIdProp, selectionLabel, selectionCellProps, children, className, style, onClick, onKeyDown, ref, ...rest }: DataGridRowProps): React_2.JSX.Element;
3693
4035
  displayName: string;
3694
4036
  };
3695
4037
 
@@ -3710,7 +4052,9 @@ export declare interface DataGridRowProps extends React_2.HTMLAttributes<HTMLTab
3710
4052
  * a duplicate warns in development). A selectable grid renders no selection control (and warns
3711
4053
  * in development) for a row without it. A row rendered from the grid's `items` (by
3712
4054
  * `DataGrid.Body`'s render function or from `columns`) defaults to the item's row id
3713
- * (`getRowId`).
4055
+ * (`getRowId`). In a grid with `items`, select-all uses the ids from `getRowId`: a row whose
4056
+ * `rowId` differs from its item's id, or is no item's id, is outside it (a development warning
4057
+ * says so), so set `getRowId` rather than a different `rowId`.
3714
4058
  */
3715
4059
  rowId?: string;
3716
4060
  /**
@@ -3746,7 +4090,7 @@ export declare interface DataGridRowSelectionCellProps {
3746
4090
  * (the cell takes focus), and neither a row click (`selectOnRowClick`), Space on a cell nor
3747
4091
  * select-all changes the row's selection: select-all skips it, keeps it as it is, and tells its
3748
4092
  * state from the other rows. In a header row it disables the select-all checkbox.
3749
- * @default false
4093
+ * @default false (in a row rendered from `items`: the grid's `isSelectionDisabled` for its item)
3750
4094
  */
3751
4095
  disabled?: boolean;
3752
4096
  /**
@@ -3787,6 +4131,8 @@ export declare type DataGridSelectionAppearance = 'brand' | 'neutral' | 'none';
3787
4131
  * selection cell props of its row (`selectionCellProps`), its own winning. `aria-label`,
3788
4132
  * `aria-labelledby` and `aria-describedby` go to the control; the other props, `className` and
3789
4133
  * `ref` to the cell. In a grid without selection it renders nothing (with a development warning).
4134
+ * In a body row of a grid with a `virtualWindow` it has no vertical padding (the row has the
4135
+ * window's height) and its control is centred.
3790
4136
  */
3791
4137
  export declare const DataGridSelectionCell: {
3792
4138
  ({ disabled, invisible, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, controlRef, ref, ...rest }: DataGridSelectionCellProps): React_2.JSX.Element | null;
@@ -5454,6 +5800,14 @@ export declare type DrawerType = 'overlay' | 'inline';
5454
5800
  * `clearable` then clears every value. A non-literal `multiselect={flag}` is a type error: render
5455
5801
  * two elements, one for each mode.
5456
5802
  *
5803
+ * **Data mode**: `items` passes the options as data instead of children. The open list renders an
5804
+ * option per item (`renderOption` draws it, an `Option` with the item's label by default) and the
5805
+ * closed list none; the keys, typeahead and the button's text follow the data, and each option
5806
+ * carries `aria-posinset` and `aria-setsize`. A long list takes a `virtualWindow` (from
5807
+ * `useVirtualWindow({ itemSize })`): the open list then renders only the options in view, plus an
5808
+ * overscan, with spacers for the others, every option `itemSize` tall; the active option stays
5809
+ * rendered, and opening scrolls it to the middle of the list.
5810
+ *
5457
5811
  * The `<button>` receives `id`, `aria-label`, `aria-labelledby`, `aria-describedby`,
5458
5812
  * `aria-invalid`, `aria-required`, `aria-errormessage`, `aria-details`, `tabIndex`, `autoFocus`
5459
5813
  * and `onFocus`/`onBlur`/`onKeyDown`/`onKeyUp`. `ref`, `className`, `style`, other `aria-*`
@@ -5478,7 +5832,9 @@ export declare const Dropdown: DropdownComponent;
5478
5832
  /**
5479
5833
  * Dropdown: `root` on the outer element; `button` on the `role="combobox"` button; `value` on the
5480
5834
  * value or placeholder span; `expandIcon` on the chevron `<svg>`; `clearButton` on the clear
5481
- * button; `listbox` on the `role="listbox"` list; `surface` on its portaled popup.
5835
+ * button; `listbox` on the `role="listbox"` list; `surface` on its portaled popup; `spacer` on
5836
+ * each spacer element of the list with a `virtualWindow` (the elements that stand in for the
5837
+ * options that are not rendered).
5482
5838
  */
5483
5839
  export declare const dropdownClassNames: {
5484
5840
  readonly root: "wave-dropdown";
@@ -5488,6 +5844,7 @@ export declare const dropdownClassNames: {
5488
5844
  readonly clearButton: "wave-dropdown__clear-button";
5489
5845
  readonly listbox: "wave-dropdown__listbox";
5490
5846
  readonly surface: "wave-dropdown__surface";
5847
+ readonly spacer: "wave-dropdown__spacer";
5491
5848
  };
5492
5849
 
5493
5850
  /** The Dropdown component's type: a multi-select signature, then the single-select one. */
@@ -5665,6 +6022,50 @@ export declare interface DropdownProps<M extends boolean = false> extends Omit<R
5665
6022
  * announcements, for localization. Unset members keep their English defaults.
5666
6023
  */
5667
6024
  labels?: DropdownLabels;
6025
+ /**
6026
+ * Data mode: the options as data, in list order (`value`, `label`, and optionally `textValue`,
6027
+ * `disabled` and `hidden`; values unique). The open list renders one option per item that is
6028
+ * not `hidden` (see `renderOption`); the closed list renders none. The keys, typeahead, the
6029
+ * selection and the button's label text follow `items`, also for a selected item whose option
6030
+ * is not rendered. The children are neither read nor rendered: passing both warns once in
6031
+ * development. Each option gets `aria-posinset` and `aria-setsize` from its place among the
6032
+ * shown items, and keeps one id per value. Without it, the options are the `Option` children.
6033
+ */
6034
+ items?: readonly ListboxItem[];
6035
+ /**
6036
+ * Data mode: renders the option of an item, given its state (`selected`, `active`, and `index`
6037
+ * among the shown options). Return an `Option`, or an option component of your own on
6038
+ * `useListboxOption`, with the item's `value` (and its `disabled`); its position is set for you,
6039
+ * and in a windowed list (`virtualWindow`) its height. It is called again only when the item, its
6040
+ * state, its position (`aria-posinset` and `aria-setsize`, which new `items` change) or the
6041
+ * function itself changes, so pass a stable function in a long list. Ignored without `items`,
6042
+ * with a development warning.
6043
+ * @default an `Option` with the item's `value`, `label` (also its text), `textValue` and `disabled`
6044
+ */
6045
+ renderOption?: (item: ListboxItem, state: ListboxOptionRenderState) => React_2.ReactNode;
6046
+ /**
6047
+ * Data mode: renders only the options in view of a long list, plus an overscan, and spacers
6048
+ * (`aria-hidden`, `data-virtual-spacer`) as tall as the options they stand for: pass the result
6049
+ * of `useVirtualWindow({ itemSize })`, or an object of your own that implements `VirtualWindow`.
6050
+ * It needs `items`: without them, or beside `OptionGroup` children, it is ignored with a
6051
+ * development warning (a window renders a flat list).
6052
+ *
6053
+ * The open popup's list is the window's scroller, so it needs no height of yours: it scrolls
6054
+ * within its own maximum height (15rem, 240 pixels at the default root size, less where the
6055
+ * viewport has no room). Every option is exactly `itemSize` tall (the list sets its height,
6056
+ * after the option's own `style`), so an option's content must fit in it: the default `Option`
6057
+ * with one line of text is 32 pixels tall.
6058
+ *
6059
+ * The window counts the shown options (the items that are not `hidden`). The keys and typeahead
6060
+ * move over all of them (Home and End to the first and the last, PageUp and PageDown by ten); the
6061
+ * active option stays rendered while it is scrolled away, so `aria-activedescendant` always names
6062
+ * an element, and when a key makes it active the list and the window move to it in the same
6063
+ * update. Opening the list scrolls the active option (the selected one, by default) to the
6064
+ * middle of the list, and again once the popup's positioning has given the list its height (a
6065
+ * short viewport) unless it was scrolled first. A closed list renders no option. The browser's
6066
+ * scroll anchoring is off on a windowed list (the window lays the options out).
6067
+ */
6068
+ virtualWindow?: VirtualWindow;
5668
6069
  /** Called when the `<button role="combobox">` receives focus (the root keeps other handlers). */
5669
6070
  onFocus?: React_2.FocusEventHandler<HTMLButtonElement>;
5670
6071
  /** Called when the `<button role="combobox">` loses focus. */
@@ -6060,6 +6461,231 @@ export declare interface FieldProps extends React_2.HTMLAttributes<HTMLDivElemen
6060
6461
  */
6061
6462
  export declare type FirstWeekOfYear = 'first-day' | 'first-full-week' | 'first-four-day-week';
6062
6463
 
6464
+ /**
6465
+ * A tree built from flat data (WAI-ARIA Tree View pattern) that can render only the items in
6466
+ * view, for trees of thousands of items. Its model comes from `useFlatTree(items, options)`: items
6467
+ * listed with a `parentValue`, in any order, the expanded and the checked state. The tree renders
6468
+ * the visible items (the roots and the children of every expanded branch) as sibling
6469
+ * `role="treeitem"` elements with `aria-level`, `aria-setsize` and `aria-posinset` from the data,
6470
+ * `aria-expanded` on branches, and the nested `Tree`'s chevron, checkbox and radio.
6471
+ *
6472
+ * ```tsx
6473
+ * const model = useFlatTree(items, { defaultExpandedItems: ['docs'] });
6474
+ * const virtualWindow = useVirtualWindow({ itemSize: 28 });
6475
+ * <FlatTree aria-label="Files" model={model} {...model.getTreeProps()} virtualWindow={virtualWindow} style={{ height: 400 }} />
6476
+ * ```
6477
+ *
6478
+ * Windowing: with `virtualWindow` the tree is the scrolling element (it needs a bounded height),
6479
+ * renders the items in view plus the window's overscan and spacers for the others, and every item
6480
+ * is exactly the window's `itemSize` tall. The server renders the first window. Keys move over the
6481
+ * whole visible list, scrolling an item that is not rendered into view before focusing it, and the
6482
+ * focused item stays rendered (and focused) while it is scrolled away.
6483
+ *
6484
+ * Keyboard: a single tab stop, on the focused item while focus is inside, else on the `selected`
6485
+ * item while it is visible, else on the first enabled item; Tab leaves the tree. Up/Down move
6486
+ * between the visible items, Home/End to the first and last, Right expands a collapsed branch or
6487
+ * moves to its first child, Left collapses an expanded branch or moves to the parent (both
6488
+ * mirrored in right-to-left layouts), Enter activates (and toggles a branch), and so does Space
6489
+ * unless the tree has checkboxes, `*` expands the sibling branches, and typing moves to the next
6490
+ * visible item whose label starts with the typed text (items under a collapsed branch are not
6491
+ * searched). The focused item stays the focused item (rendered, and the tab stop) while focus is
6492
+ * in a popup that its content opened, such as a menu in a portal, so the popup can return focus
6493
+ * to it.
6494
+ *
6495
+ * Selection, as the nested `Tree`: `selected` and `onItemSelect` (single selection and activation,
6496
+ * with radios in `selectionMode="single"`), `current`, and with `selectionMode="multiple"` a
6497
+ * checkbox on every item bound to the model's `checkedItems` (Space or a click on the checkbox
6498
+ * toggles it, and checks cascade). An item whose data is `disabled` is `aria-disabled`, is skipped
6499
+ * by the keys and typeahead, never holds the tab stop (except while a pointer press has focused
6500
+ * it), and is neither activated, expanded nor checked by the user (a check of its parent still
6501
+ * includes it).
6502
+ *
6503
+ * When a branch collapses around the focused item (from code), focus moves to that branch, so it
6504
+ * never falls to the page. Items expand and collapse at once, without motion: there is no child
6505
+ * group to animate. A selected item under a collapsed branch is not the tab stop until it is
6506
+ * visible again.
6507
+ *
6508
+ * `FlatTree.Item` is the row the tree renders for each visible item (it is not written by hand);
6509
+ * it is also exported as `FlatTreeItem` for React Server Components, which cannot use the dotted
6510
+ * form.
6511
+ */
6512
+ export declare const FlatTree: {
6513
+ ({ model, virtualWindow, renderItem, selectionMode: selectionModeProp, selected, current, onItemSelect, className, onKeyDown, onFocus, onBlur, onPointerDownCapture, ref, ...rest }: FlatTreeProps): React_2.JSX.Element;
6514
+ displayName: string;
6515
+ } & {
6516
+ Item: {
6517
+ ({ item: row, children, className, style, onClick, ref, ...rest }: FlatTreeItemProps): React_2.JSX.Element;
6518
+ displayName: string;
6519
+ };
6520
+ };
6521
+
6522
+ /**
6523
+ * FlatTree: `root` on the `role="tree"` element (the scrolling element of a tree with a
6524
+ * `virtualWindow`); `spacer` on each spacer element of a windowed tree (the elements that stand in
6525
+ * for the items that are not rendered, 0.16).
6526
+ */
6527
+ export declare const flatTreeClassNames: {
6528
+ readonly root: "wave-flat-tree";
6529
+ readonly spacer: "wave-flat-tree__spacer";
6530
+ };
6531
+
6532
+ /**
6533
+ * One row of a FlatTree, rendered by the tree for each visible item of its model (it is not
6534
+ * written by hand): a `role="treeitem"` element with the item's level, set size and position,
6535
+ * `aria-expanded` on a branch, and the expand chevron, the checkbox (multiple mode) or the radio
6536
+ * (single mode) of the nested `Tree`'s items, before the content. Levels are drawn by indenting
6537
+ * the row, since the items are siblings. In a windowed tree it is exactly the window's `itemSize`
6538
+ * tall.
6539
+ *
6540
+ * `ref`, `className` and the other props land on the treeitem element; its `onClick` receives the
6541
+ * clicks on the row, not those on the checkbox, and runs before the built-in activation (call
6542
+ * `event.preventDefault()` to skip it).
6543
+ */
6544
+ export declare const FlatTreeItem: {
6545
+ ({ item: row, children, className, style, onClick, ref, ...rest }: FlatTreeItemProps): React_2.JSX.Element;
6546
+ displayName: string;
6547
+ };
6548
+
6549
+ /**
6550
+ * FlatTree.Item: `root` on the `role="treeitem"` element; `row` on its row; `expandIcon` on the
6551
+ * chevron of a branch; `indicator` on the checkbox of a multi-select tree or the radio of a
6552
+ * single-select one; `label` on the span around the item's content (0.16).
6553
+ */
6554
+ export declare const flatTreeItemClassNames: {
6555
+ readonly root: "wave-flat-tree-item";
6556
+ readonly row: "wave-flat-tree-item__row";
6557
+ readonly expandIcon: "wave-flat-tree-item__expand-icon";
6558
+ readonly indicator: "wave-flat-tree-item__indicator";
6559
+ readonly label: "wave-flat-tree-item__label";
6560
+ };
6561
+
6562
+ /** One item of a flat tree: `parentValue` places it, items are listed in any order. */
6563
+ export declare interface FlatTreeItemData {
6564
+ /** The item's identity; it must be unique among the items (a later duplicate is ignored). */
6565
+ value: string;
6566
+ /** The `value` of the item this one is nested in; absent for a root. */
6567
+ parentValue?: string;
6568
+ /**
6569
+ * `'branch'` marks an item that can expand even while it has no child items (children loaded
6570
+ * on demand). An item with child items is a branch whatever its type says.
6571
+ */
6572
+ itemType?: 'leaf' | 'branch';
6573
+ /** The text the item shows. */
6574
+ label?: string;
6575
+ /**
6576
+ * Whether the item is disabled. `FlatTree` reads it (the keys and typeahead skip the item, it is
6577
+ * not the tab stop, and the user cannot activate, expand or check it); the model ignores it:
6578
+ * `expand`, `collapse`, `toggle` and `setChecked` change a disabled item too, and a check of its
6579
+ * parent includes it.
6580
+ */
6581
+ disabled?: boolean;
6582
+ }
6583
+
6584
+ /** Properties for the FlatTreeItem sub-component. */
6585
+ export declare interface FlatTreeItemProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'children'> {
6586
+ /** The row the item shows: a visible item of the tree's model (`model.visibleItems`). */
6587
+ item: VisibleFlatItem & {
6588
+ checked?: CheckState;
6589
+ };
6590
+ /** The item's content: what the tree's `renderItem` returns, else the item's label. */
6591
+ children?: React_2.ReactNode;
6592
+ /** Ref to the `role="treeitem"` element. */
6593
+ ref?: React_2.Ref<HTMLDivElement>;
6594
+ }
6595
+
6596
+ /** The state and the visible rows of a flat tree, from {@link useFlatTree}. */
6597
+ export declare interface FlatTreeModel {
6598
+ /**
6599
+ * The rows to show: the roots and the children of every expanded branch, in tree order. With
6600
+ * `selectionMode: 'multiple'` each row has its `checked` state. The array and its rows keep
6601
+ * their identity until the items, the expanded set or the checked set change.
6602
+ */
6603
+ visibleItems: readonly (VisibleFlatItem & {
6604
+ checked?: CheckState;
6605
+ })[];
6606
+ /** The visible row of `value`; `undefined` for an item under a collapsed branch or an unknown value. */
6607
+ getItem(value: string): (VisibleFlatItem & {
6608
+ checked?: CheckState;
6609
+ }) | undefined;
6610
+ /**
6611
+ * Expands `value`, or every value of a list in one change (one `onExpandedItemsChange` call, as
6612
+ * `*` on a tree item makes). Nothing happens, and nothing is called, if every value is already in
6613
+ * the expanded set.
6614
+ */
6615
+ expand(value: string | readonly string[]): void;
6616
+ /** Collapses `value`. Nothing happens, and nothing is called, if it is not in the expanded set. */
6617
+ collapse(value: string): void;
6618
+ /** Expands `value` when it is collapsed and collapses it when it is expanded. */
6619
+ toggle(value: string): void;
6620
+ /** Whether `value` is a branch (an item with child items, or typed `'branch'`) in the expanded set. */
6621
+ isExpanded(value: string): boolean;
6622
+ /**
6623
+ * Sets the check state of `value`, with the cascade of the nested `Tree`: the item and everything
6624
+ * nested in it, then its ancestors from their children. Nothing is called when the item is
6625
+ * already in that state; a mixed item is set to `checked` as requested. A value that matches no
6626
+ * item is added to, or removed from, the checked list. `event` becomes `details.event` of
6627
+ * `onCheckedItemsChange`; without it the callback gets no `details`. It works in any
6628
+ * `selectionMode` (the rows carry `checked` only with `'multiple'`), and on a disabled item too.
6629
+ */
6630
+ setChecked(value: string, checked: boolean, event?: Event): void;
6631
+ /** The props `FlatTree` takes from the model, for `<FlatTree model={model} {...model.getTreeProps()} />`. */
6632
+ getTreeProps(): {
6633
+ selectionMode: 'none' | SelectionMode_2;
6634
+ };
6635
+ }
6636
+
6637
+ /** Properties for the FlatTree component. */
6638
+ export declare interface FlatTreeProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'children' | 'onSelect'> {
6639
+ /** The tree's model, from `useFlatTree`: the visible rows, the expanded and the checked state. */
6640
+ model: FlatTreeModel;
6641
+ /**
6642
+ * Renders only the items in view (and a few beyond), from `useVirtualWindow({ itemSize })`. The
6643
+ * tree is then the scrolling element: give it a bounded height (a class or a style). Every item
6644
+ * is exactly `itemSize` pixels tall, so its content must fit in one row. Without it every visible
6645
+ * item is rendered.
6646
+ *
6647
+ * The tree element is then no tab stop of its own while an item is (`tabIndex` -1, as Firefox
6648
+ * would stop on a scroller; a `tabIndex` you pass wins), and the browser's scroll anchoring is
6649
+ * off on it (the window lays the items out): when rows are inserted or removed above the focused
6650
+ * item while it is in view (`*`, or a change of the model from code), the tree moves the view
6651
+ * with it, so it stays where it was.
6652
+ */
6653
+ virtualWindow?: VirtualWindow;
6654
+ /**
6655
+ * The content of an item, from its row: the item data with its level, position, set size,
6656
+ * expanded state and, in multiple mode, its check state. Called for the rendered items only.
6657
+ * @default the item's `label`, else its `value`
6658
+ */
6659
+ renderItem?: (item: VisibleFlatItem & {
6660
+ checked?: CheckState;
6661
+ }) => React_2.ReactNode;
6662
+ /**
6663
+ * How items are selected, as the nested `Tree`'s `selectionMode`. `'multiple'` draws a checkbox
6664
+ * on every item, bound to the model's checked items (create the model with
6665
+ * `selectionMode: 'multiple'`); `'single'` draws a radio for `selected`. Spread
6666
+ * `model.getTreeProps()` on the tree to pass the model's mode.
6667
+ * @default the model's mode (`model.getTreeProps().selectionMode`)
6668
+ */
6669
+ selectionMode?: 'none' | SelectionMode_2;
6670
+ /**
6671
+ * Value of the selected item. When set (also to `null`), every item carries `aria-selected`, and
6672
+ * the selected item is where keyboard focus enters the tree while it is visible. It has no effect
6673
+ * with `selectionMode="multiple"` (a development warning). With `selectionMode="single"` every
6674
+ * item carries `aria-selected` even while it is not set (a development warning: the radios need
6675
+ * it).
6676
+ */
6677
+ selected?: string | null;
6678
+ /** Value of the current item (for example the open page): it gets `aria-current="true"`. */
6679
+ current?: string | null;
6680
+ /**
6681
+ * Called with an item's value every time it is activated (a click on its row, Enter, or Space
6682
+ * unless the tree has checkboxes), also when the same item is activated again.
6683
+ */
6684
+ onItemSelect?: (value: string) => void;
6685
+ /** Ref to the `role="tree"` element. */
6686
+ ref?: React_2.Ref<HTMLDivElement>;
6687
+ }
6688
+
6063
6689
  /**
6064
6690
  * A flexbox layout container with token-based gaps.
6065
6691
  *
@@ -6212,6 +6838,28 @@ export declare function getTabbableElements(container: Element, options?: {
6212
6838
  */
6213
6839
  export declare function getThemeClassName(theme: WaveTheme): string;
6214
6840
 
6841
+ /**
6842
+ * The inline style that applies token overrides: one `--wave-*` custom property per entry, the
6843
+ * object `WaveProvider` puts on its root and its portals. Use it where no provider renders, such
6844
+ * as a Server Component's document element. Server-safe.
6845
+ *
6846
+ * Returns `undefined` for `null`, `undefined` or a map with nothing to set. An `undefined` value is
6847
+ * skipped, a number is written as its string, and the properties keep the order of the input. A
6848
+ * key that is not a camelCase identifier, or a value that is neither a finite number nor a string
6849
+ * without `;`, `{` or `}` (which could add a declaration of its own to a server-rendered `style`
6850
+ * attribute), is skipped with a development warning (once per key). Names are not checked against
6851
+ * the list of tokens: TypeScript refuses a misspelled one, and in JavaScript it sets a property
6852
+ * nothing reads.
6853
+ *
6854
+ * @example
6855
+ * // app/layout.tsx (a Server Component)
6856
+ * <html style={getTokenStyle({ brand80: '#c43e00' })}>
6857
+ *
6858
+ * @example
6859
+ * <div style={{ ...getTokenStyle(overrides), padding: 16 }} />
6860
+ */
6861
+ export declare function getTokenStyle(overrides: WaveTokenOverrides | null | undefined): TokenStyle | undefined;
6862
+
6215
6863
  /**
6216
6864
  * The week number (1–53) of `date`'s calendar day (time of day ignored): days before a year's week
6217
6865
  * 1 belong to the previous year's last week, and days in the next year's week 1 are week 1. ISO 8601
@@ -6260,6 +6908,29 @@ export declare interface GridNavigationHandlers {
6260
6908
  onBlur: React_2.FocusEventHandler<HTMLTableElement>;
6261
6909
  }
6262
6910
 
6911
+ /**
6912
+ * The data behind the rows of a windowed grid, whose rows are mounted only in part (see
6913
+ * {@link UseGridNavigationOptions.model}). Each mounted data row carries its 0-based index in the
6914
+ * data as `data-row-index`.
6915
+ */
6916
+ export declare interface GridNavigationModel {
6917
+ /** How many data rows there are, mounted or not. */
6918
+ rowCount: number;
6919
+ /**
6920
+ * How many header rows are above the data rows: the first rows of the grid without a
6921
+ * `data-row-index` (they stay mounted). Other rows without one, such as the spacer rows of a
6922
+ * window, are not navigated.
6923
+ */
6924
+ headerRowCount: number;
6925
+ /**
6926
+ * Brings data row `index` into the mounted rows (scrolls the window to it). Called once for each
6927
+ * row a key moves focus to that is not mounted; focus moves to the row's cell in the commit that
6928
+ * mounts it. Ctrl+Home in a grid with header rows also calls it for row 0, so the first rows
6929
+ * show under the header.
6930
+ */
6931
+ scrollToRow(index: number): void;
6932
+ }
6933
+
6263
6934
  /**
6264
6935
  * The Grid's own props (the XOwnProps rule of `PolymorphicProps`: component-specific props only).
6265
6936
  * Every other prop comes from the rendered element (`as`).
@@ -7216,19 +7887,31 @@ export declare type LinkVariant = LinkAppearance;
7216
7887
  * - **Check marks** (`checkmark`, opt-in): a decorative check at the start of every item of a
7217
7888
  * selectable list, shown while the item is selected; `List.Item checkmark` replaces or hides it.
7218
7889
  * - **Switching semantics remounts the items.** Listbox/list and grid use different elements
7219
- * (`ul`/`li` and `div`), so when a selectable list gains its first item action, loses its last
7220
- * one, or `selectable` or `navigationMode` changes the structure, React remounts the items and
7221
- * their content: state inside them (an inline rename input's draft, an uncontrolled checkbox) is
7222
- * reset. Focus that is on an item or inside it when the list switches moves to the same item (by
7223
- * `value`, else by position; the next item when the focused one was removed), or to its first
7224
- * focusable content when the item is no Tab stop any more, so the switch never drops it to
7225
- * `<body>`. This includes focus inside the last action when that action removes itself (an
7226
- * inline rename input that unmounts on Enter). An action that removes itself while focused
7227
- * without causing a switch drops focus, like any removed element. When the list may switch,
7228
- * keep such state in the parent, or pin the grid with `navigationMode="composite"`.
7890
+ * (`ul`/`li` and `div`), so when a selectable list without a window gains its first item
7891
+ * action, loses its last one, or `selectable` or `navigationMode` changes the structure, React
7892
+ * remounts the items and their content: state inside them (an inline rename input's draft, an
7893
+ * uncontrolled checkbox) is reset. Focus that is on an item or inside it when the list switches
7894
+ * moves to the same item (by `value`, else by position; the next item when the focused one was
7895
+ * removed), or to its first focusable content when the item is no Tab stop any more, so the
7896
+ * switch never drops it to `<body>`. This includes focus inside the last action when that action
7897
+ * removes itself (an inline rename input that unmounts on Enter). An action that removes itself
7898
+ * while focused without causing a switch drops focus, like any removed element. When the list
7899
+ * may switch, keep such state in the parent, or pin the grid with `navigationMode="composite"`.
7229
7900
  * - Selection: `selectionMode` `'single'` (default) or `'multiple'`; controlled with
7230
7901
  * `selectedItems` (or `selectedItem` in single mode) or uncontrolled with the `default*` props.
7231
- * Values of items that are no longer rendered are dropped from the reported selection.
7902
+ * Values of items that are no longer rendered are dropped from the reported selection (a
7903
+ * windowed list keeps them).
7904
+ * - **Windowing** (`virtualWindow` and `count`, for long lists): a window from `useVirtualWindow`
7905
+ * and a function child that returns the item at an index render only the items in view plus an
7906
+ * overscan, with spacers for the others. The list element scrolls (give it a bounded height),
7907
+ * every item has the window's item size as its height, the focused item stays rendered and is
7908
+ * the Tab stop while focus is in the list, each item carries its place in the whole list, and
7909
+ * the values selected outside the window stay selected. The keys move by index over the whole
7910
+ * list (ArrowUp/ArrowDown, Home/End, and PageUp/PageDown by ten), scrolling the target into view
7911
+ * before focusing it, rendered or not; typeahead matches the rendered items. Its structure
7912
+ * never follows the rendered items: a selectable windowed list is a listbox unless
7913
+ * `navigationMode="composite"` pins the grid (pin it when items have actions; a development
7914
+ * warning says so).
7232
7915
  * - Sub-component: `List.Item` (also exported as `ListItem` for React Server Components).
7233
7916
  *
7234
7917
  * @example
@@ -7242,13 +7925,25 @@ export declare type LinkVariant = LinkAppearance;
7242
7925
  * <List.Item value="report" onAction={() => open('report')}>Report</List.Item>
7243
7926
  * <List.Item value="budget" onAction={() => open('budget')}>Budget</List.Item>
7244
7927
  * </List>
7928
+ *
7929
+ * @example
7930
+ * const virtualWindow = useVirtualWindow({ itemSize: 40 });
7931
+ * <List
7932
+ * selectable
7933
+ * aria-label="Files"
7934
+ * virtualWindow={virtualWindow}
7935
+ * count={files.length}
7936
+ * style={{ height: 320 }}
7937
+ * >
7938
+ * {(index) => <List.Item value={files[index].id}>{files[index].name}</List.Item>}
7939
+ * </List>
7245
7940
  */
7246
7941
  export declare const List: {
7247
7942
  <M extends ListSelectionMode = "single">(props: ListProps<M>): React_2.ReactNode;
7248
7943
  displayName: string;
7249
7944
  } & {
7250
7945
  Item: {
7251
- ({ value, action, onAction, disabledSelection, checkmark, className, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
7946
+ ({ value, action, onAction, disabledSelection, checkmark, className, style, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
7252
7947
  displayName: string;
7253
7948
  };
7254
7949
  };
@@ -7285,6 +7980,12 @@ export declare const List: {
7285
7980
  * either), dims it, takes pointer input off its options, selects nothing and submits nothing.
7286
7981
  * Disabled options are skipped by the keys unless `disabledOptionsFocusable`, and are never
7287
7982
  * selected.
7983
+ * - **Data mode.** `items` passes the options as data instead of children: the list renders an
7984
+ * option per item (`renderOption` draws it, an `Option` with the item's label by default), the
7985
+ * keys, typeahead and the selection follow the data, and each option carries `aria-posinset`
7986
+ * and `aria-setsize`. A long list takes a `virtualWindow` (from `useVirtualWindow({ itemSize
7987
+ * })`): the list then renders only the options in view, plus an overscan, with spacers for the
7988
+ * others, every option `itemSize` tall, and the active option stays rendered.
7288
7989
  * - **Forms and Field.** With `name` the value is submitted with its form (one entry, or one per
7289
7990
  * value with `multiselect`), and `required` needs a value (native validation; a missing value
7290
7991
  * moves focus to the list). A reset of its form restores `defaultValue`, with or without a
@@ -7303,12 +8004,21 @@ export declare const List: {
7303
8004
  * <Listbox.Option value="apple">Apple</Listbox.Option>
7304
8005
  * <Listbox.Option value="banana">Banana</Listbox.Option>
7305
8006
  * </Listbox>
8007
+ *
8008
+ * @example
8009
+ * // Data mode
8010
+ * <Listbox aria-label="City" items={cities.map((c) => ({ value: c.id, label: c.name }))} />
7306
8011
  */
7307
8012
  export declare const Listbox: ListboxComponent;
7308
8013
 
7309
- /** Listbox: `root` on the `role="listbox"` list (its options carry Option's classes). */
8014
+ /**
8015
+ * Listbox: `root` on the `role="listbox"` list (its options carry Option's classes); `spacer` on
8016
+ * each spacer element of a list with a `virtualWindow` (the elements that stand in for the options
8017
+ * that are not rendered).
8018
+ */
7310
8019
  export declare const listboxClassNames: {
7311
8020
  readonly root: "wave-listbox";
8021
+ readonly spacer: "wave-listbox__spacer";
7312
8022
  };
7313
8023
 
7314
8024
  /** Props for the combobox element (spread them; see {@link UseListboxResult.getComboboxProps}). */
@@ -7468,6 +8178,20 @@ export declare interface ListboxOptionElementProps<E extends HTMLElement = HTMLE
7468
8178
  'aria-disabled'?: true;
7469
8179
  /** While filtered out or hidden. */
7470
8180
  hidden?: boolean;
8181
+ /**
8182
+ * The number of shown options, for an option of a data-mode list rendered by Listbox, Combobox
8183
+ * or Dropdown (`items`), which tell each option its position. Absent otherwise.
8184
+ */
8185
+ 'aria-setsize'?: number;
8186
+ /** The option's position among the shown options (from 1), with `aria-setsize`. */
8187
+ 'aria-posinset'?: number;
8188
+ /**
8189
+ * The option's box in a windowed list (a `virtualWindow` of Listbox, Combobox or Dropdown): the
8190
+ * window's `itemSize` as its height, padding and border included, and no shrinking in a flex
8191
+ * list. Absent otherwise. Merge it after a style of your own: every option of a window must be
8192
+ * exactly that tall.
8193
+ */
8194
+ style?: React_2.CSSProperties;
7471
8195
  /** While the option is active, for styling. */
7472
8196
  'data-active'?: '';
7473
8197
  /** While selected, for styling. */
@@ -7487,6 +8211,25 @@ export declare interface ListboxOptionElementProps<E extends HTMLElement = HTMLE
7487
8211
  /** Flat name of `Listbox.OptionGroup` for React Server Components. */
7488
8212
  export declare const ListboxOptionGroup: React_2.FC<OptionGroupProps>;
7489
8213
 
8214
+ /**
8215
+ * The state of an item's option, which `renderOption` of Listbox, Combobox and Dropdown receives
8216
+ * with the item (data mode, `items`).
8217
+ */
8218
+ export declare interface ListboxOptionRenderState {
8219
+ /** The item's value is selected. */
8220
+ selected: boolean;
8221
+ /**
8222
+ * The option is the active one, which `aria-activedescendant` points at: in a Listbox while the
8223
+ * list has focus, in a Combobox or Dropdown while the list is open.
8224
+ */
8225
+ active: boolean;
8226
+ /**
8227
+ * The option's index among the shown options, from 0 (its `aria-posinset` minus one): items a
8228
+ * filter leaves out and hidden items are not counted.
8229
+ */
8230
+ index: number;
8231
+ }
8232
+
7490
8233
  /** Properties for the Listbox component. */
7491
8234
  export declare interface ListboxProps<M extends boolean = false> extends Omit<React_2.HTMLAttributes<HTMLUListElement>, 'onChange' | 'defaultValue'> {
7492
8235
  /**
@@ -7547,6 +8290,49 @@ export declare interface ListboxProps<M extends boolean = false> extends Omit<Re
7547
8290
  disabledOptionsFocusable?: boolean;
7548
8291
  /** The `multiselect` toggle announcements, for localization. Unset members keep their English defaults. */
7549
8292
  labels?: ListboxLabels;
8293
+ /**
8294
+ * Data mode: the options as data, in list order (`value`, `label`, and optionally `textValue`,
8295
+ * `disabled` and `hidden`; values unique). The list renders one option per item that is not
8296
+ * `hidden` (see `renderOption`), and the keys, typeahead and the selection follow `items`. The
8297
+ * children are neither read nor rendered: passing both warns once in development. Each option
8298
+ * gets `aria-posinset` and `aria-setsize` from its place among the shown items, and keeps one id
8299
+ * per value. Without it, the options are the `Option` children.
8300
+ */
8301
+ items?: readonly ListboxItem[];
8302
+ /**
8303
+ * Data mode: renders the option of an item, given its state (`selected`, `active`, and `index`
8304
+ * among the shown options). Return an `Option`, or an option component of your own on
8305
+ * `useListboxOption`, with the item's `value` (and its `disabled`); its position is set for you,
8306
+ * and in a windowed list (`virtualWindow`) its height. It is called again only when the item, its
8307
+ * state, its position (`aria-posinset` and `aria-setsize`, which new `items` change) or the
8308
+ * function itself changes, so pass a stable function in a long list. Ignored without `items`,
8309
+ * with a development warning.
8310
+ * @default an `Option` with the item's `value`, `label` (also its text), `textValue` and `disabled`
8311
+ */
8312
+ renderOption?: (item: ListboxItem, state: ListboxOptionRenderState) => React_2.ReactNode;
8313
+ /**
8314
+ * Data mode: renders only the options in view of a long list, plus an overscan, and spacers
8315
+ * (`aria-hidden`, `data-virtual-spacer`) as tall as the options they stand for: pass the result
8316
+ * of `useVirtualWindow({ itemSize })`, or an object of your own that implements `VirtualWindow`.
8317
+ * It needs `items`: without them, or beside `OptionGroup` children, it is ignored with a
8318
+ * development warning (a window renders a flat list).
8319
+ *
8320
+ * The list element is the window's scroller: give it a bounded height (a height or a maximum
8321
+ * height, through `className` or `style`); without one the window measures the whole list and
8322
+ * renders every option. While windowed the list has no block padding (add none through
8323
+ * `className`), so the options start at its top, where the window counts them, and no scroll
8324
+ * anchoring of the browser (the window lays the options out). Every option is exactly
8325
+ * `itemSize` tall (the list sets its height, after the option's own `style`), so an option's
8326
+ * content must fit in it: the default `Option` with one line of text is 32 pixels tall.
8327
+ *
8328
+ * The window counts the shown options (the items that are not `hidden`). The keys and typeahead
8329
+ * move over all of them (Home and End to the first and the last, PageUp and PageDown by ten); the
8330
+ * active option stays rendered while it is scrolled away, so `aria-activedescendant` always names
8331
+ * an element, and when the list gains focus or a key makes it active the list and the window
8332
+ * move to it in the same update (a pointer press moves neither). The server renders the first
8333
+ * window.
8334
+ */
8335
+ virtualWindow?: VirtualWindow;
7550
8336
  /**
7551
8337
  * Name of the value in form submissions (renders a hidden input inside the list; one per value
7552
8338
  * with `multiselect`).
@@ -7739,9 +8525,14 @@ export declare interface ListboxSurfaceProps {
7739
8525
  children?: React_2.ReactNode;
7740
8526
  }
7741
8527
 
7742
- /** List: `root` on the `<ul>` (the `role="grid"` element of a selectable list with actions). */
8528
+ /**
8529
+ * List: `root` on the `<ul>` (the `role="grid"` element of a selectable list with actions);
8530
+ * `spacer` on each spacer element of a list with a `virtualWindow` (the elements that stand in for
8531
+ * the items that are not rendered).
8532
+ */
7743
8533
  export declare const listClassNames: {
7744
8534
  readonly root: "wave-list";
8535
+ readonly spacer: "wave-list__spacer";
7745
8536
  };
7746
8537
 
7747
8538
  /**
@@ -7751,11 +8542,15 @@ export declare const listClassNames: {
7751
8542
  * selection without calling `onClick`, which receives pointer clicks; `onAction` runs on clicks
7752
8543
  * and Enter (and Space where the item cannot be selected), before the selection toggles.
7753
8544
  *
8545
+ * In a windowed list (the List's `virtualWindow`) an item has the window's item size as its
8546
+ * height, after its own `style` (its content must fit), and carries `data-index` and its place
8547
+ * in the whole list: `aria-setsize` and `aria-posinset`, or `aria-rowindex` in a grid.
8548
+ *
7754
8549
  * Exported under the flat name `ListItem` so React Server Components can import it; `List.Item`
7755
8550
  * (dotted access) needs a client module.
7756
8551
  */
7757
8552
  export declare const ListItem: {
7758
- ({ value, action, onAction, disabledSelection, checkmark, className, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
8553
+ ({ value, action, onAction, disabledSelection, checkmark, className, style, children, onClick, onKeyDown, ref, ...rest }: ListItemProps): React_2.JSX.Element;
7759
8554
  displayName: string;
7760
8555
  };
7761
8556
 
@@ -7839,7 +8634,72 @@ export declare type ListNavigationMode = 'none' | 'items' | 'composite';
7839
8634
  * `selectionMode="multiple"` is passed; `ListProps` without a type argument accepts every mode
7840
8635
  * (the 0.4 shape, extendable by interfaces).
7841
8636
  */
7842
- export declare interface ListProps<M extends ListSelectionMode = ListSelectionMode> extends React_2.HTMLAttributes<HTMLUListElement> {
8637
+ export declare interface ListProps<M extends ListSelectionMode = ListSelectionMode> extends Omit<React_2.HTMLAttributes<HTMLUListElement>, 'children'> {
8638
+ /**
8639
+ * The items: `List.Item` elements. In a windowed list (`virtualWindow` and `count`), a function
8640
+ * `(index) => <List.Item … />` that returns the item at an index: the list calls it for the
8641
+ * rendered indexes only and keys each item by its index. Without `virtualWindow` and `count` a
8642
+ * function renders nothing (a development warning says so).
8643
+ */
8644
+ children?: React_2.ReactNode | ((index: number) => React_2.ReactNode);
8645
+ /**
8646
+ * Renders only the items in view, plus an overscan, of a long list: pass the result of
8647
+ * `useVirtualWindow({ itemSize })` (or an object of your own that implements `VirtualWindow`)
8648
+ * with `count`, and a function child that returns the `List.Item` at an index. The items that
8649
+ * are not rendered are replaced by spacers (`aria-hidden`, `data-virtual-spacer`) of their
8650
+ * height.
8651
+ *
8652
+ * The list element becomes the window's scroller (it scrolls vertically, without the browser's
8653
+ * scroll anchoring): give it a bounded height, a height or a maximum height (a class or a style);
8654
+ * without one the window measures the whole list and renders every item. Where the list
8655
+ * navigates its items, one item is its Tab stop and the list element is none of its own
8656
+ * (`tabIndex` -1, as Firefox would stop on a scroller); a plain windowed list keeps the browser's
8657
+ * default, under which WebKit does not let the keyboard reach and scroll it: pass `tabIndex={0}`
8658
+ * or navigate its items (`navigationMode="items"`). A `tabIndex` you pass wins.
8659
+ *
8660
+ * Every item has the window's `itemSize` as its height (the list sets it, after the item's own
8661
+ * `style`), so an item's content must fit in it. Each item carries `data-index` (its 0-based
8662
+ * index) and its place in the whole list: `aria-setsize` and `aria-posinset`, or in a grid
8663
+ * (`navigationMode="composite"`) the list's `aria-rowcount` and the row's `aria-rowindex`.
8664
+ *
8665
+ * The item that has focus stays rendered when it is scrolled away (also while focus is in a
8666
+ * popup it opened), so it keeps focus, and while focus is in the list it is the list's Tab stop.
8667
+ * Once focus leaves the list it is no longer kept, and the Tab stop follows the rule of a list
8668
+ * without focus among the rendered items (the first selected item, else the first item; in a
8669
+ * list without selection the item that last had focus while it is rendered). When `count` drops
8670
+ * to or below the focused item, focus moves to the last item.
8671
+ *
8672
+ * The keys move by index over the whole list, rendered or not, where the list navigates its
8673
+ * items (`navigationMode` `'items'` or `'composite'`, or a selectable list): ArrowUp/ArrowDown
8674
+ * (wrapping at the ends), Home/End, and PageUp/PageDown, which move ten items and stop at the
8675
+ * ends. The target is scrolled into view before it is focused, the least that shows it whole: a
8676
+ * rendered one by the browser (`scrollIntoView`, nearest), which the window follows, one that is
8677
+ * not rendered through the window's `scrollToIndex`, and focused once it renders. An item that a
8678
+ * pointer press focuses is not scrolled. Typeahead matches the labels of the rendered items
8679
+ * only.
8680
+ *
8681
+ * Selection covers every value: the values of items that are not rendered stay selected, and
8682
+ * `onSelectionChange` reports them (a list without a window drops the values of items it no
8683
+ * longer renders).
8684
+ *
8685
+ * The structure never depends on which items are rendered: a selectable windowed list stays a
8686
+ * listbox (its items are options) unless `navigationMode="composite"` makes it a grid from the
8687
+ * first render, so scrolling never replaces the list element (which would reset its scroll
8688
+ * position and remount every item). Its items' actions do not switch it to a grid as they do in
8689
+ * a list without a window: an item with an action in a selectable windowed list without that
8690
+ * pin is a development warning, since an option cannot hold interactive content. Pin
8691
+ * `navigationMode="composite"` when items have actions.
8692
+ *
8693
+ * Applies only with `count` and a function child; otherwise it is ignored, with a development
8694
+ * warning.
8695
+ */
8696
+ virtualWindow?: VirtualWindow;
8697
+ /**
8698
+ * The number of items of a windowed list (with `virtualWindow`): the function child is called
8699
+ * for the indexes from 0 to `count - 1` that are rendered. A value that is not a whole number
8700
+ * counts as its whole part, and one below 0 (or not finite) as 0.
8701
+ */
8702
+ count?: number;
7843
8703
  /** Whether list items can be selected.
7844
8704
  * @default false
7845
8705
  */
@@ -7886,7 +8746,10 @@ export declare interface ListProps<M extends ListSelectionMode = ListSelectionMo
7886
8746
  * the Tab order. The rows of a list without selection carry no `aria-selected`.
7887
8747
  *
7888
8748
  * The resolved mode is rendered as `data-navigation-mode`. Changing it while mounted can switch
7889
- * between `ul`/`li` and `div` elements, which remounts the items (see {@link List}).
8749
+ * between `ul`/`li` and `div` elements, which remounts the items (see {@link List}). A windowed
8750
+ * list (`virtualWindow`) never switches for its items' actions: unset or `'items'`, a selectable
8751
+ * one is a listbox; only `'composite'` makes it a grid. In a windowed list the keys move by
8752
+ * index over the whole list, PageUp/PageDown included (see `virtualWindow`).
7890
8753
  */
7891
8754
  navigationMode?: ListNavigationMode;
7892
8755
  /**
@@ -10102,7 +10965,9 @@ export declare interface OpenChangeDetails<R extends string = string> {
10102
10965
  *
10103
10966
  * Options register with the surrounding listbox (in DOM order, groups included), so they can be
10104
10967
  * wrapped, grouped or rendered conditionally. The option is memoized: moving the highlight
10105
- * re-renders only the previously and the newly active option.
10968
+ * re-renders only the previously and the newly active option. In a windowed list (the
10969
+ * `virtualWindow` of Listbox, Combobox or Dropdown) the option is exactly the window's `itemSize`
10970
+ * tall, a height set after its own `style`, so its content must fit in it.
10106
10971
  *
10107
10972
  * Styling: `className` comes last. A plain background class (`className="bg-primary"`) replaces
10108
10973
  * the built-in hover, selected and active backgrounds in every state. To restyle one state only,
@@ -11201,7 +12066,8 @@ export declare type PopupTargetInput = PopupTarget | {
11201
12066
 
11202
12067
  /**
11203
12068
  * Renders its children into `document.body` (or the WaveProvider `portalContainer`), wrapped in a
11204
- * `<div class="wave-portal …">` that carries the provider's theme classes, direction and font, so
12069
+ * `<div class="wave-portal …">` that carries the provider's theme classes, direction and font, and
12070
+ * its token overrides (WaveProvider `tokens`, unless its `applyStylesToPortals` is `false`), so
11205
12071
  * portaled overlays look like the rest of the themed tree. The wrapper paints no background.
11206
12072
  *
11207
12073
  * - **Client only, first commit**: nothing is rendered on the server or during hydration (no
@@ -13425,11 +14291,12 @@ export declare type SwitchSize = Extract<Size, 'small' | 'medium'>;
13425
14291
  * `Table.CellActions` shows a cell's actions while its row is hovered or holds focus.
13426
14292
  *
13427
14293
  * Sub-components are available as `Table.Header`, `Table.HeaderCell`, `Table.Body`, `Table.Row`,
13428
- * `Table.Cell`, `Table.SelectionCell`, `Table.CellLayout` and `Table.CellActions` in client
14294
+ * `Table.Cell`, `Table.SelectionCell`, `Table.CellLayout`, `Table.CellActions` and
14295
+ * `Table.ResizeHandle` (the separator that resizes a column, for a header cell's `aside`) in client
13429
14296
  * components, and as the flat exports `TableHeader`, `TableHeaderCell`, `TableBody`, `TableRow`,
13430
- * `TableCell`, `TableSelectionCell`, `TableCellLayout` and `TableCellActions` (the form React
13431
- * Server Components can import). `Table.Head`/`Table.HeadCell` (`TableHead`/`TableHeadCell`) are
13432
- * deprecated aliases.
14297
+ * `TableCell`, `TableSelectionCell`, `TableCellLayout`, `TableCellActions` and
14298
+ * `TableResizeHandle` (the form React Server Components can import). `Table.Head`/`Table.HeadCell`
14299
+ * (`TableHead`/`TableHeadCell`) are deprecated aliases.
13433
14300
  */
13434
14301
  export declare const Table: {
13435
14302
  ({ striped, containerProps, children, className, ref, ...props }: TableProps): React_2.JSX.Element;
@@ -13477,6 +14344,10 @@ export declare const Table: {
13477
14344
  ({ visible, className, ref, ...rest }: TableCellActionsProps): React_2.JSX.Element;
13478
14345
  displayName: string;
13479
14346
  };
14347
+ ResizeHandle: {
14348
+ ({ 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;
14349
+ displayName: string;
14350
+ };
13480
14351
  };
13481
14352
 
13482
14353
  /** The table's `<tbody>`. */
@@ -13606,6 +14477,86 @@ export declare const tableClassNames: {
13606
14477
  readonly container: "wave-table__container";
13607
14478
  };
13608
14479
 
14480
+ /**
14481
+ * The column widths of {@link useTableFeatures} (`state.columnSizing`), filled by
14482
+ * `useTableColumnSizing`. Without that plugin no width is set and the functions do nothing.
14483
+ */
14484
+ export declare interface TableColumnSizingState {
14485
+ /**
14486
+ * The width of every column in pixels, by `columnId`: the width that is state, else the
14487
+ * column's initial width.
14488
+ */
14489
+ columnWidths: Readonly<Record<string, number>>;
14490
+ /** Whether a width is state (set, controlled or given as a default). */
14491
+ isSized: boolean;
14492
+ /** The width of the column `columnId` in pixels, or `undefined` when it is no column. */
14493
+ getColumnWidth(columnId: string): number | undefined;
14494
+ /**
14495
+ * Sets the width of the column `columnId` in pixels. Without `event`, the change's details carry
14496
+ * an untrusted `resize` event with no target.
14497
+ */
14498
+ setColumnWidth(columnId: string, width: number, event?: Event): void;
14499
+ /** Props for the table element: its fixed layout and width style. */
14500
+ getTableProps(): {
14501
+ style: CSSProperties;
14502
+ };
14503
+ /** Props for the column's `<col>` element: its width style. */
14504
+ getColumnProps(columnId: string): {
14505
+ style: CSSProperties;
14506
+ };
14507
+ /** Props for the resize handle of the column `columnId`. */
14508
+ getResizeHandleProps(columnId: string): TableResizeHandleBindings;
14509
+ }
14510
+
14511
+ /** What {@link UseTableColumnSizingOptions.onColumnWidthsChange} gets besides the new widths. */
14512
+ export declare interface TableColumnWidthsChangeDetails {
14513
+ /** The column that was resized. */
14514
+ columnId: string;
14515
+ /** Its new width in pixels, held at or above its `minWidth`. */
14516
+ width: number;
14517
+ /**
14518
+ * The event behind the change (the drag, the key press); when none was passed, an untrusted
14519
+ * `resize` event with no target.
14520
+ */
14521
+ event: Event;
14522
+ }
14523
+
14524
+ /**
14525
+ * A feature of {@link useTableFeatures}, returned by `useTableSort`, `useTableSelection` and
14526
+ * `useTableColumnSizing`, which hold the feature's state where they are called. The object is
14527
+ * opaque. It keeps its identity while the feature's state and the options it reads keep theirs; a
14528
+ * new one costs `useTableFeatures` a recompute of its state, and of the rows only when the sort
14529
+ * changed. `T` is the item type the plugin reads (a selection's `isDisabled`): a plugin that reads
14530
+ * no item, such as the sort, fits every table.
14531
+ */
14532
+ export declare interface TableFeaturePlugin<T> {
14533
+ /** The brand of a plugin: only the plugin hooks create one. */
14534
+ readonly [tableFeaturePluginBrand]: (item: T) => void;
14535
+ }
14536
+
14537
+ declare const tableFeaturePluginBrand: unique symbol;
14538
+
14539
+ /** The state that {@link useTableFeatures} returns. */
14540
+ export declare interface TableFeaturesState<T> {
14541
+ /** The items, as given. */
14542
+ items: readonly T[];
14543
+ /** The columns, as given. */
14544
+ columns: readonly DataGridColumn<T>[];
14545
+ /** The row id of an item: `getRowId` as given, else the index as a string. */
14546
+ getRowId: (item: T, index: number) => string;
14547
+ /**
14548
+ * The rows in display order: sorted while `useTableSort` sorts them, else in the order of
14549
+ * `items`. The same array is returned until `items`, `getRowId`, `columns` or the sort change.
14550
+ */
14551
+ getRows(): readonly TableRowData<T>[];
14552
+ /** The sort; without `useTableSort` it is `null` and its functions do nothing. */
14553
+ sort: TableSortState;
14554
+ /** The selection; without `useTableSelection` nothing is selected and its functions do nothing. */
14555
+ selection: TableSelectionState;
14556
+ /** The column widths; without `useTableColumnSizing` no width is set. */
14557
+ columnSizing: TableColumnSizingState;
14558
+ }
14559
+
13609
14560
  /** @deprecated Use `Table.Header` (`TableHeader`). */
13610
14561
  export declare const TableHead: {
13611
14562
  (props: TableHeadProps): React_2.JSX.Element;
@@ -13724,6 +14675,110 @@ export declare interface TableProps extends React_2.HTMLAttributes<HTMLTableElem
13724
14675
  ref?: React_2.Ref<HTMLTableElement>;
13725
14676
  }
13726
14677
 
14678
+ /**
14679
+ * The drag handle of a column's edge: a vertical `role="separator"` with `aria-valuenow`, meant
14680
+ * for the `aside` slot of a `Table.HeaderCell` whose cell is positioned, since the handle is drawn
14681
+ * along the cell's end edge. A DataGrid with `resizableColumns` renders it in the header cell of
14682
+ * each of its columns itself (a `DataGrid.HeaderCell` has no `aside` slot). A pointer drag (mouse,
14683
+ * touch or pen) resizes through `onResize`, with the movement mirrored in right-to-left tables;
14684
+ * the arrow keys move the edge by 20 pixels (5 with Shift), Home sets the minimum width and End
14685
+ * the maximum one. A double click calls `onReset`. The handle is a Tab stop (`tabIndex` 0), so the
14686
+ * keys work in a static table; a grid that manages its own tab stops overrides `tabIndex`. The
14687
+ * handle carries `data-grid-auxiliary`, so a grid's cell navigation does not take it for the
14688
+ * cell's own widget.
14689
+ *
14690
+ * It keeps no width: spread the result of `useTableColumnSizing`'s `getResizeHandleProps(columnId)`
14691
+ * onto it, or pass `width`, `minWidth` and `onResize` from your own state.
14692
+ */
14693
+ export declare const TableResizeHandle: {
14694
+ ({ 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;
14695
+ displayName: string;
14696
+ };
14697
+
14698
+ /**
14699
+ * What a resize handle needs from the table state, as returned by
14700
+ * `columnSizing.getResizeHandleProps(columnId)`: the column's width and minimum, the callback
14701
+ * that sets a new width and the one that resets it. `Table.ResizeHandle` takes these props (and a few more).
14702
+ */
14703
+ export declare interface TableResizeHandleBindings {
14704
+ /** The column's current width in pixels. */
14705
+ width: number;
14706
+ /** The narrowest the column can be, in pixels. */
14707
+ minWidth: number;
14708
+ /**
14709
+ * Sets the column's width in pixels (held at or above `minWidth`); `details.event` is the event
14710
+ * behind it (without `details`, an untrusted `resize` event is reported).
14711
+ */
14712
+ onResize(width: number, details?: {
14713
+ event: Event;
14714
+ }): void;
14715
+ /**
14716
+ * Sets the column back to its initial width (a double click on the handle). It changes nothing
14717
+ * while no width is state, since the table is then in its initial layout.
14718
+ */
14719
+ onReset?(details: {
14720
+ event: Event;
14721
+ }): void;
14722
+ }
14723
+
14724
+ /**
14725
+ * Table.ResizeHandle: `root` on the separator element that resizes a column (placed in the `aside`
14726
+ * of a header cell).
14727
+ */
14728
+ export declare const tableResizeHandleClassNames: {
14729
+ readonly root: "wave-table-resize-handle";
14730
+ };
14731
+
14732
+ /** Properties for the TableResizeHandle sub-component. */
14733
+ export declare interface TableResizeHandleProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onResize' | 'onReset'> {
14734
+ /** The column's current width in pixels. It is reported as `aria-valuenow`. */
14735
+ width: number;
14736
+ /**
14737
+ * The narrowest the column can be, in pixels. The handle never asks for less, and Home sets it.
14738
+ * It is reported as `aria-valuemin`.
14739
+ * @default 0
14740
+ */
14741
+ minWidth?: number;
14742
+ /**
14743
+ * The widest the column can be, in pixels. The handle never asks for more, and End sets it.
14744
+ * Without a maximum there is no `aria-valuemax` and End does nothing.
14745
+ */
14746
+ maxWidth?: number;
14747
+ /**
14748
+ * Called with the width the user asks for, in whole pixels, held between `minWidth` and
14749
+ * `maxWidth`: while a pointer drags (at most once per animation frame) and for every handled
14750
+ * key, then `details` with the event behind it. The handle always passes `details`; it is typed
14751
+ * optional through 0.x, as every `details` argument. The handle keeps no width of its own, so a
14752
+ * parent that ignores the call leaves the column where it is.
14753
+ */
14754
+ onResize: (width: number, details?: {
14755
+ event: Event;
14756
+ }) => void;
14757
+ /** Called with the event when the handle is double-clicked: reset the column's width. */
14758
+ onReset?: (details: {
14759
+ event: Event;
14760
+ }) => void;
14761
+ /**
14762
+ * Called when Escape is pressed on the handle, or Enter or Space is released on it after being
14763
+ * pressed there: move focus back to the header cell. Enter and Space are consumed from their
14764
+ * keydown on (their repeats included), so a held key never reaches the element that focus moves
14765
+ * to. Without it those keys are left to the handle's ancestors.
14766
+ */
14767
+ onLeave?: () => void;
14768
+ /**
14769
+ * The accessible name of the separator.
14770
+ * @default 'Resize column'
14771
+ */
14772
+ label?: string;
14773
+ /**
14774
+ * Builds `aria-valuetext` from the width.
14775
+ * @default (width) => `${width} pixels`
14776
+ */
14777
+ valueText?: (width: number) => string;
14778
+ /** Ref to the `<div>` element. */
14779
+ ref?: React_2.Ref<HTMLDivElement>;
14780
+ }
14781
+
13727
14782
  /**
13728
14783
  * A table row. Striping comes from the table (`striped`), so rows need no context. The row is the
13729
14784
  * `group/table-row` group whose hover or focus draws the subtle selection controls and the cell
@@ -13739,6 +14794,16 @@ export declare const tableRowClassNames: {
13739
14794
  readonly root: "wave-table-row";
13740
14795
  };
13741
14796
 
14797
+ /** One row of {@link useTableFeatures}: an item of `items` with its id. */
14798
+ export declare interface TableRowData<T> {
14799
+ /** The item. */
14800
+ item: T;
14801
+ /** The row's id, from `getRowId` (by default the index in `items`, as a string). */
14802
+ rowId: string;
14803
+ /** The item's index in `items`. Sorting moves the row, not this index. */
14804
+ index: number;
14805
+ }
14806
+
13742
14807
  /** Properties for the TableRow sub-component. */
13743
14808
  export declare interface TableRowProps extends React_2.HTMLAttributes<HTMLTableRowElement> {
13744
14809
  /** Table cell elements. */
@@ -13852,6 +14917,59 @@ export declare interface TableSelectionCellProps extends Omit<React_2.TdHTMLAttr
13852
14917
  ref?: React_2.Ref<HTMLTableCellElement>;
13853
14918
  }
13854
14919
 
14920
+ /**
14921
+ * The selection of {@link useTableFeatures} (`state.selection`), filled by `useTableSelection`. The
14922
+ * selection is a set of row ids held apart from the rendered rows: rows that are not rendered keep
14923
+ * their state, and ids whose item is not in `items` (filtered out, on another page) stay selected.
14924
+ */
14925
+ export declare interface TableSelectionState {
14926
+ /** `single` keeps at most one row selected; `multiple` selects rows independently. */
14927
+ selectionMode: SelectionMode_2;
14928
+ /** The selected row ids, ids whose item is not in `items` included. */
14929
+ selectedItems: ReadonlySet<string>;
14930
+ /**
14931
+ * Whether every selectable row of `items` is selected (and there is one): rows that
14932
+ * `isDisabled` marks do not count, rows that are not rendered do.
14933
+ */
14934
+ allRowsSelected: boolean;
14935
+ /**
14936
+ * Whether a row of `items` is selected while not every selectable one is (the mixed state of a
14937
+ * select-all checkbox). A selected disabled row counts; ids outside `items` do not.
14938
+ */
14939
+ someRowsSelected: boolean;
14940
+ /** Whether the row `id` is selected. */
14941
+ isRowSelected(id: string): boolean;
14942
+ /** Selects or deselects the row `id` (`multiple`); selects it (`single`). */
14943
+ toggleRow(id: string, event?: Event): void;
14944
+ /** Selects the row `id`; in `single` mode it replaces the selection. */
14945
+ selectRow(id: string, event?: Event): void;
14946
+ /** Deselects the row `id`. */
14947
+ deselectRow(id: string, event?: Event): void;
14948
+ /**
14949
+ * Selects every selectable row of `items` when not all of them are selected, else deselects
14950
+ * them. A disabled row keeps its state, and ids outside `items` stay selected. It does nothing in
14951
+ * `single` mode.
14952
+ */
14953
+ toggleAllRows(event?: Event): void;
14954
+ /** Empties the selection, ids outside `items` included. */
14955
+ clearRows(event?: Event): void;
14956
+ }
14957
+
14958
+ /** The sort of {@link useTableFeatures} (`state.sort`), filled by `useTableSort`. */
14959
+ export declare interface TableSortState {
14960
+ /** The sorted column and its direction, or `null` while the rows are in the order of `items`. */
14961
+ value: DataGridSort | null;
14962
+ /** Sorts by the column `columnId` in `direction`. */
14963
+ setColumnSort(columnId: string, direction: SortDirection, event?: Event): void;
14964
+ /**
14965
+ * Sorts by the column `columnId`, as a sortable header of DataGrid does: ascending, or descending
14966
+ * when the column is already sorted ascending.
14967
+ */
14968
+ toggleColumnSort(columnId: string, event?: Event): void;
14969
+ /** The direction of the column `columnId` while the rows are sorted by it, else `undefined`. */
14970
+ getSortDirection(columnId: string): SortDirection | undefined;
14971
+ }
14972
+
13855
14973
  /**
13856
14974
  * A set of tabs with their panels (WAI-ARIA Tabs pattern): the arrow keys (Left/Right, mirrored
13857
14975
  * in RTL; Up/Down when vertical), Home and End move focus and select (automatic activation); with
@@ -15986,13 +17104,20 @@ export declare interface TextOwnProps {
15986
17104
  */
15987
17105
  variant?: TypographyVariant;
15988
17106
  /**
15989
- * Font weight: `'regular'`, `'semibold'` or `'bold'`. Unset, the variant's own weight applies:
15990
- * semibold for `'subtitle-2'` and every larger variant (`'subtitle-1'`, the titles,
15991
- * `'large-title'`, `'display'`), inherited for the caption and body variants. Pass `'regular'`
15992
- * for a title at regular weight. The numeric 0.4 values `400`, `600` and `700` still work but
15993
- * are deprecated.
17107
+ * Font weight: `'regular'`, `'medium'`, `'semibold'` or `'bold'`. Unset, the variant's own
17108
+ * weight applies: semibold for `'subtitle-2'` and every larger variant (`'subtitle-1'`, the
17109
+ * titles, `'large-title'`, `'display'`), inherited for the caption and body variants. Pass
17110
+ * `'regular'` for a title at regular weight. The numeric 0.4 values `400`, `600` and `700` still
17111
+ * work but are deprecated.
15994
17112
  */
15995
17113
  weight?: TextWeight | 400 | 600 | 700;
17114
+ /**
17115
+ * Font family: `'base'` keeps the inherited family (the Wave sans-serif), `'monospace'` sets the
17116
+ * Wave monospace stack for code and identifiers, `'numeric'` the stack for figures that should
17117
+ * align in columns. Fluent's `font` prop. A `className` that sets a font family replaces it.
17118
+ * @default 'base'
17119
+ */
17120
+ font?: 'base' | 'monospace' | 'numeric';
15996
17121
  }
15997
17122
 
15998
17123
  /**
@@ -16001,8 +17126,8 @@ export declare interface TextOwnProps {
16001
17126
  */
16002
17127
  export declare type TextProps<C extends React_2.ElementType = 'span'> = PolymorphicProps<C, TextOwnProps>;
16003
17128
 
16004
- /** Font weight vocabulary shared by Text and Label (400 / 600 / 700). */
16005
- export declare type TextWeight = 'regular' | 'semibold' | 'bold';
17129
+ /** Font weight vocabulary shared by Text and Label (400 / 500 / 600 / 700). */
17130
+ export declare type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
16006
17131
 
16007
17132
  /**
16008
17133
  * A time input with a filterable list of times (APG editable combobox with list autocomplete).
@@ -16779,6 +17904,23 @@ export declare interface ToggleButtonProps extends Omit<React_2.ButtonHTMLAttrib
16779
17904
  ref?: React_2.Ref<HTMLButtonElement>;
16780
17905
  }
16781
17906
 
17907
+ /**
17908
+ * The inline style that applies token overrides: a React style object whose `--wave-*` custom
17909
+ * properties set the tokens, so it can be merged with other style properties.
17910
+ */
17911
+ export declare type TokenStyle = React_2.CSSProperties & {
17912
+ [K in `--wave-${string}`]?: string;
17913
+ };
17914
+
17915
+ /**
17916
+ * The CSS custom property of a token name at the type level: `TokenVariable<'brand80'>` is
17917
+ * `'--wave-brand-80'`, by the rule of {@link tokenVariable}. It spells out the literal values of
17918
+ * `waveTokens`. It walks the name one character at a time (tail-recursive, so long names stay
17919
+ * within the compiler's depth limit): `AfterLetter` says whether the previous character was a
17920
+ * letter, `Done` holds the converted text so far.
17921
+ */
17922
+ declare type TokenVariable<Name extends string, AfterLetter extends boolean = false, Done extends string = ''> = Name extends `${infer Char}${infer Rest}` ? Char extends '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ? TokenVariable<Rest, false, `${Done}${AfterLetter extends true ? '-' : ''}${Char}`> : Char extends Lowercase<Char> ? TokenVariable<Rest, true, `${Done}${Char}`> : TokenVariable<Rest, true, `${Done}-${Lowercase<Char>}`> : `--wave-${Done}`;
17923
+
16782
17924
  /**
16783
17925
  * A container for a set of controls (APG Toolbar pattern): `role="toolbar"`, one Tab stop, and
16784
17926
  * arrow-key navigation between its controls.
@@ -17558,7 +18700,9 @@ export declare type TypographyVariant = 'caption-2' | 'caption-1' | 'body-1' | '
17558
18700
  * - The moved-to item is dropped when it leaves `items` or while `enabled` is `false`, and does not
17559
18701
  * come back without a user action; `fallback` is active while nothing was moved to.
17560
18702
  * - Keyboard and programmatic moves are scrolled into view (`{ block: 'nearest' }`); pointer moves
17561
- * (`highlight`) and `setActiveValue(value, { scroll: false })` are not.
18703
+ * (`highlight`) and `setActiveValue(value, { scroll: false })` are not. With `onScrollToItem` (a
18704
+ * windowed list) each such move is first passed to it by the item's index, also for an item
18705
+ * without an element.
17562
18706
  * - `onActiveValueChange` reports every change after the commit, once (StrictMode included).
17563
18707
  *
17564
18708
  * `useListbox` is built on it; use it directly for composites that are not listboxes.
@@ -17599,6 +18743,17 @@ export declare interface UseActiveDescendantOptions {
17599
18743
  activateFirstOnChange?: boolean;
17600
18744
  /** The element of an item, for scrolling it into view. @default document.getElementById(getId(value)) */
17601
18745
  getElement?: (value: string) => HTMLElement | null;
18746
+ /**
18747
+ * Called for every move that scrolls the active item into view, for a windowed list that renders
18748
+ * part of its items: `index` is the item's index in `items`. Scroll the list so that it shows and
18749
+ * renders the item (a virtual window's `scrollToIndex`, which moves the window in the same
18750
+ * update); an element, when there is one (`getElement`, then the id lookup), is then scrolled
18751
+ * into view as well. `aria-activedescendant` already names the item, and points at its element
18752
+ * once it mounts. Called after the same moves that scroll (not after a pointer move or a
18753
+ * `scroll: false` move), from a layout effect, once per change of the active item. Without it,
18754
+ * an item without an element is not scrolled to.
18755
+ */
18756
+ onScrollToItem?: (index: number) => void;
17602
18757
  /** Called after the active item changed (from an effect), `null` included. */
17603
18758
  onActiveValueChange?: (value: string | null) => void;
17604
18759
  }
@@ -17844,6 +18999,60 @@ export declare interface UseFieldControlOptions {
17844
18999
  nativeRequired?: boolean;
17845
19000
  }
17846
19001
 
19002
+ /**
19003
+ * The model of a flat tree: items listed with a `parentValue` link, in any order, become the rows
19004
+ * a windowed tree shows (`FlatTree`), without building an element tree. Returns the visible rows
19005
+ * (with `level`, `position`, `setSize` and `expanded` for the tree ARIA), the expanded and
19006
+ * checked state, and the actions on them.
19007
+ *
19008
+ * Pass `items` as a stable reference or memoise it: the index of the items is rebuilt when its
19009
+ * identity changes. Expanded and checked state work as in `Tree`: pass `expandedItems` or
19010
+ * `checkedItems` to control it (a stable array, or the rows are rebuilt on every render), or
19011
+ * `defaultExpandedItems` and `defaultCheckedItems` to start uncontrolled; the change callbacks
19012
+ * fire once per change. When `items` is replaced, the expanded and checked values stay in the
19013
+ * state: a value that matches no item is ignored for the rows until an item with it returns, and
19014
+ * it is changed only by you.
19015
+ *
19016
+ * Development warnings, once each: an unknown `parentValue` (the item is a root), a cycle of
19017
+ * parents (cut) and a duplicate value (the first item wins).
19018
+ *
19019
+ * @example
19020
+ * const model = useFlatTree(items, { defaultExpandedItems: ['docs'] });
19021
+ * model.visibleItems.map((row) => row.item.label);
19022
+ */
19023
+ export declare function useFlatTree(items: readonly FlatTreeItemData[], options?: UseFlatTreeOptions): FlatTreeModel;
19024
+
19025
+ /** Options of {@link useFlatTree}: the state names and shapes of the nested `Tree`. */
19026
+ export declare interface UseFlatTreeOptions {
19027
+ /** Controlled list of expanded item values. */
19028
+ expandedItems?: readonly string[];
19029
+ /**
19030
+ * Item values that are expanded initially (uncontrolled).
19031
+ * @default []
19032
+ */
19033
+ defaultExpandedItems?: readonly string[];
19034
+ /** Called with the new list of expanded item values when an item expands or collapses. */
19035
+ onExpandedItemsChange?: (expandedItems: string[]) => void;
19036
+ /** Controlled checked items (`selectionMode="multiple"`); the cascade rule is the nested `Tree`'s. */
19037
+ checkedItems?: readonly string[];
19038
+ /**
19039
+ * Initially checked items (uncontrolled).
19040
+ * @default []
19041
+ */
19042
+ defaultCheckedItems?: readonly string[];
19043
+ /**
19044
+ * Called with every checked item (in tree order) when a check changes. `details` is passed when
19045
+ * `setChecked` got an `event`; it is typed optional until 1.0.
19046
+ */
19047
+ onCheckedItemsChange?: (checkedItems: string[], details?: TreeCheckedItemsChangeDetails) => void;
19048
+ /**
19049
+ * How items are selected, as `Tree`. With `'multiple'` every visible row carries its `checked`
19050
+ * state; the model's `getTreeProps()` hands the mode on to `FlatTree`.
19051
+ * @default 'none'
19052
+ */
19053
+ selectionMode?: 'none' | SelectionMode_2;
19054
+ }
19055
+
17847
19056
  /**
17848
19057
  * A focusable group (Fluent's `useFocusableGroup`, tabster's groupper): one tab stop that holds
17849
19058
  * several focusable elements, so a long list of rich rows does not cost a Tab press per control.
@@ -17982,14 +19191,32 @@ export declare function useFocusVisible(): boolean;
17982
19191
  * keys: its cell takes focus, and Enter/F2 enters the composite at its own tab stop. The grid never
17983
19192
  * writes `tabindex` on or inside a composite (the composite manages its own), so a composite
17984
19193
  * keeps its own Tab stop — the same documented limitation as `useRovingTabIndex`.
19194
+ * - **Auxiliary widgets** (a widget that carries `data-grid-auxiliary`, such as a column's resize
19195
+ * handle) are left out when the cell's target is chosen, so a header with a sort button and a
19196
+ * resize handle keeps the button as its target (Enter sorts), and a cell whose only widget is
19197
+ * auxiliary is its own target. Like every widget they are at `tabindex="-1"` in navigation mode
19198
+ * and take part in interaction mode. F2 on a cell that has one, or on its target widget, enters
19199
+ * interaction mode at the first auxiliary widget (Enter on a cell that is its own target still
19200
+ * enters its first widget); Escape returns to the cell's target, the cell or its target widget.
19201
+ * While the widgets of such a cell are interacted with, its target widget is in interaction mode
19202
+ * too, so Tab moves between all of them and Escape on the target ends the mode. A cell without
19203
+ * auxiliary widgets behaves as described above.
19204
+ * - **Rows by their data** (a `model`: a windowed grid, whose rows are mounted in part): the rows
19205
+ * are the header rows and the data rows, which carry their index in the data as `data-row-index`
19206
+ * (other rows, such as the spacer rows of a window, are skipped). ArrowUp/ArrowDown,
19207
+ * PageUp/PageDown and Ctrl+Home/Ctrl+End go by that index over every row of the data, header
19208
+ * rows first, with the rules above: a target row that is not mounted is asked for with
19209
+ * `scrollToRow` (once per row) and focused in the commit that mounts it, and Ctrl+Home also
19210
+ * brings data row 0 back under the header rows. The active cell is kept by its row and column:
19211
+ * `activeRowIndex` and `pendingRowIndex` name the rows the owner keeps mounted, and while the
19212
+ * active row is not mounted anyway, a cell of the nearest mounted row holds the tab stop until
19213
+ * the row is back. ArrowLeft/ArrowRight and Home/End work in the row as above.
17985
19214
  *
17986
19215
  * Keys are ignored when the event's default was prevented (a widget that handled the key, a
17987
19216
  * consumer handler), or with Alt/Meta held. The tab indexes are written to the DOM (layout effect
17988
19217
  * plus a `MutationObserver`), so rows and widgets added later are covered without a re-render. Focus
17989
19218
  * moves re-sync only the cells involved, the observer only the cells that changed, and the grid's
17990
19219
  * own `tabindex` writes do not trigger a re-sync.
17991
- *
17992
- * Internal to the table package.
17993
19220
  */
17994
19221
  export declare function useGridNavigation(options?: UseGridNavigationOptions): UseGridNavigationResult;
17995
19222
 
@@ -18000,6 +19227,14 @@ export declare interface UseGridNavigationOptions {
18000
19227
  * @default 10
18001
19228
  */
18002
19229
  pageSize?: number;
19230
+ /**
19231
+ * The data of a windowed grid (DataGrid with a virtual window). ArrowUp/ArrowDown,
19232
+ * PageUp/PageDown and Ctrl+Home/Ctrl+End then move by the rows of the data: a target row that is
19233
+ * not mounted is asked for with `scrollToRow` and focused when it mounts. The active row is kept
19234
+ * by its index (see {@link UseGridNavigationResult.activeRowIndex}). Without it, the mounted
19235
+ * rows are the whole grid.
19236
+ */
19237
+ model?: GridNavigationModel;
18003
19238
  }
18004
19239
 
18005
19240
  /** Result of {@link useGridNavigation}. */
@@ -18008,6 +19243,19 @@ export declare interface UseGridNavigationResult {
18008
19243
  gridRef: React_2.RefCallback<HTMLTableElement>;
18009
19244
  /** Keyboard and focus handlers for the grid element. Stable identities. */
18010
19245
  gridProps: GridNavigationHandlers;
19246
+ /**
19247
+ * With a `model`: the `data-row-index` of the active cell's row, the row that holds the grid's
19248
+ * tab stop (or takes it back once it is mounted again), so the owner keeps that row mounted.
19249
+ * `null` on a header row, and always `null` without a model. A change re-renders the owner.
19250
+ */
19251
+ activeRowIndex: number | null;
19252
+ /**
19253
+ * With a `model`: the index of the data row a key moved focus to while it is not mounted (asked
19254
+ * for with `scrollToRow`); focus moves there in the commit that mounts it, so the owner keeps it
19255
+ * mounted too. `null` when no row is awaited, and always `null` without a model. A change
19256
+ * re-renders the owner.
19257
+ */
19258
+ pendingRowIndex: number | null;
18011
19259
  }
18012
19260
 
18013
19261
  /**
@@ -18103,7 +19351,10 @@ export declare function useIsOverflowItemVisible(itemId: string): boolean;
18103
19351
  * render. Options register even when filtered out or hidden (they render `hidden` and are not
18104
19352
  * navigable), so labels are always known — use {@link collectOptionLabels} for the display text
18105
19353
  * before registration (SSR/first render). `filter` is the navigability predicate, which a
18106
- * picker builds from its query.
19354
+ * picker builds from its query. In data mode the keys, typeahead, the labels and the filter
19355
+ * read `items` only, so a picker may render just the shown options (`items` of the result), or
19356
+ * part of them: `onScrollToItem` receives every active option that scrolls into view, rendered
19357
+ * or not.
18107
19358
  * - **Active option** is derived during render: the highlighted value, else the `autoHighlight`
18108
19359
  * fallback. The highlight is reset on close and after a single-select commit that closes the
18109
19360
  * listbox, and dropped once it is not navigable any more (filtered out, hidden, removed by an
@@ -18170,8 +19421,10 @@ export declare function useListbox(options: UseListboxOptions): UseListboxResult
18170
19421
  * the option (registration mode) and its element, and reads its flags from the listbox store, so
18171
19422
  * it re-renders only when its own active/selected/hidden state changes. Spread `optionProps` onto
18172
19423
  * the `<li>` (`id`, `role="option"`, `aria-selected`, `aria-disabled`, `hidden`, and
18173
- * `data-active`/`data-selected`/`data-disabled` for styling) and compose its `onClick` — and in
18174
- * standalone mode its `onMouseDown`, the pointer press — with your own handlers. Mark the
19424
+ * `data-active`/`data-selected`/`data-disabled` for styling; `aria-posinset` and `aria-setsize`
19425
+ * when a `renderOption` of Listbox, Combobox or Dropdown renders it, and in a windowed list a
19426
+ * `style` with its height, to merge after yours) and compose its `onClick` —
19427
+ * and in standalone mode its `onMouseDown`, the pointer press — with your own handlers. Mark the
18175
19428
  * component with {@link markListboxElement}, so its label is known before it registers.
18176
19429
  *
18177
19430
  * Throws in development when used outside a listbox; in production it logs the error once and
@@ -18330,6 +19583,16 @@ export declare interface UseListboxOptions {
18330
19583
  * {@link useActiveDescendant}'s `onActiveValueChange`.
18331
19584
  */
18332
19585
  onActiveValueChange?: (value: string | null) => void;
19586
+ /**
19587
+ * Called for every move that scrolls the active option into view, for a list that renders only
19588
+ * part of its options (a virtual window): `index` is the option's index in
19589
+ * {@link UseListboxResult.items}, the shown options (filtered-out and hidden items are not
19590
+ * counted, disabled ones are). Scroll the list so that it shows and renders the option (a
19591
+ * window's `scrollToIndex(index)`, which moves the window in the same update); an element, when
19592
+ * there is one, is then scrolled into view as well. `aria-activedescendant` names the option
19593
+ * meanwhile. Passed to {@link useActiveDescendant}'s `onScrollToItem`, mapped to that index.
19594
+ */
19595
+ onScrollToItem?: (index: number) => void;
18333
19596
  /** Prefix of the generated listbox id. @default 'listbox' */
18334
19597
  idPrefix?: string;
18335
19598
  /**
@@ -19089,6 +20352,224 @@ export declare interface UseRovingTabIndexResult {
19089
20352
  focusLast: () => void;
19090
20353
  }
19091
20354
 
20355
+ /**
20356
+ * Selection by id, held outside the DOM, for lists, tables and trees whose items are not all
20357
+ * rendered. State is controlled with `selectedItems` or uncontrolled with `defaultSelectedItems`;
20358
+ * `onSelectedItemsChange` fires once per change, never for a no-op.
20359
+ *
20360
+ * @example
20361
+ * const selection = useSelection({ selectionMode: 'multiple' });
20362
+ * selection.toggleAll(rows.map((row) => row.id));
20363
+ */
20364
+ export declare function useSelection({ selectionMode, selectedItems: selectedItemsProp, defaultSelectedItems, onSelectedItemsChange, }: UseSelectionOptions): UseSelectionResult;
20365
+
20366
+ /** What {@link UseSelectionOptions.onSelectedItemsChange} receives as its second argument. */
20367
+ export declare interface UseSelectionChangeDetails {
20368
+ /** The event that caused the change, when the caller passed one. */
20369
+ event?: Event;
20370
+ /** The id that was toggled, selected or deselected. Absent for `toggleAll` and `clear`. */
20371
+ id?: string;
20372
+ }
20373
+
20374
+ /** Options of {@link useSelection}. */
20375
+ export declare interface UseSelectionOptions {
20376
+ /**
20377
+ * `single` keeps at most one id selected and never deselects through `toggle`; `multiple` toggles
20378
+ * ids independently.
20379
+ */
20380
+ selectionMode: SelectionMode_2;
20381
+ /** The selected ids (controlled). Pair it with `onSelectedItemsChange`. */
20382
+ selectedItems?: readonly string[];
20383
+ /**
20384
+ * The ids selected at first render (uncontrolled).
20385
+ * @default []
20386
+ */
20387
+ defaultSelectedItems?: readonly string[];
20388
+ /**
20389
+ * Called with a new array of the selected ids whenever the selection changes. A call that leaves
20390
+ * the selection as it is (selecting a selected id, toggling the selected id in `single` mode)
20391
+ * does not call it.
20392
+ */
20393
+ onSelectedItemsChange?: (selectedItems: string[], details?: UseSelectionChangeDetails) => void;
20394
+ }
20395
+
20396
+ /** What {@link useSelection} returns. */
20397
+ export declare interface UseSelectionResult {
20398
+ /** The mode the hook was given. */
20399
+ selectionMode: SelectionMode_2;
20400
+ /**
20401
+ * The selected ids. The same set object is returned while the ids stay the same, so it can key a
20402
+ * memo. It holds ids whose items are not rendered.
20403
+ */
20404
+ selectedItems: ReadonlySet<string>;
20405
+ /** Whether `id` is selected. */
20406
+ isSelected(id: string): boolean;
20407
+ /** Toggles `id`: in `multiple` mode adds or removes it, in `single` mode selects it. */
20408
+ toggle(id: string, event?: Event): void;
20409
+ /** Selects `id`; in `single` mode it replaces the selection. */
20410
+ select(id: string, event?: Event): void;
20411
+ /** Removes `id` from the selection. */
20412
+ deselect(id: string, event?: Event): void;
20413
+ /**
20414
+ * Selects every id of `universe` when not all of them are selected, else removes only the ids of
20415
+ * `universe`: ids outside it stay selected. It does nothing in `single` mode.
20416
+ */
20417
+ toggleAll(universe: readonly string[], event?: Event): void;
20418
+ /** Empties the selection, ids outside any universe included. */
20419
+ clear(event?: Event): void;
20420
+ }
20421
+
20422
+ /**
20423
+ * The column sizing plugin of `useTableFeatures`: the width of every column, held at or above its
20424
+ * minimum, and the props that lay a static `Table` out with them. Fills `state.columnSizing`.
20425
+ * Spread `getTableProps()` on the `Table`, render a `<colgroup>` with a `<col>` per column and
20426
+ * spread `getColumnProps(columnId)` on it, and give each `Table.ResizeHandle` the
20427
+ * `getResizeHandleProps(columnId)`. The widths are controlled with `columnWidths` or uncontrolled
20428
+ * with `defaultColumnWidths`. Until a width is state (a resize, or `columnWidths` or
20429
+ * `defaultColumnWidths` is given) the table is 100% wide and at least as wide as the columns; from
20430
+ * then on it is exactly as wide as they are, so a dragged edge follows the pointer. There is no
20431
+ * maximum width, and no fitting of the columns to the container. Call it unconditionally and pass
20432
+ * the plugin to `useTableFeatures`.
20433
+ *
20434
+ * @example
20435
+ * const { columnSizing } = useTableFeatures({ items, columns }, [
20436
+ * useTableColumnSizing({ columnSizingOptions: { name: { minWidth: 120, defaultWidth: 240 } } }),
20437
+ * ]);
20438
+ * <Table {...columnSizing.getTableProps()}>
20439
+ * <colgroup>
20440
+ * {columns.map((c) => <col key={c.columnId} {...columnSizing.getColumnProps(c.columnId!)} />)}
20441
+ * </colgroup>
20442
+ * </Table>
20443
+ */
20444
+ export declare function useTableColumnSizing<T>(options?: UseTableColumnSizingOptions): TableFeaturePlugin<T>;
20445
+
20446
+ /** Options of {@link useTableColumnSizing}. */
20447
+ export declare interface UseTableColumnSizingOptions {
20448
+ /**
20449
+ * Per column, by `columnId`: `minWidth` (`@default 80`), and the width the column starts at,
20450
+ * `defaultWidth` or else `idealWidth` (else 150). Ids that are not columns are ignored. May be
20451
+ * written inline.
20452
+ */
20453
+ columnSizingOptions?: Record<string, ColumnSizingOption>;
20454
+ /**
20455
+ * The column widths in pixels (controlled), by `columnId`: a column without an entry has its
20456
+ * initial width. Pair it with `onColumnWidthsChange`.
20457
+ */
20458
+ columnWidths?: Record<string, number>;
20459
+ /** The column widths at first render (uncontrolled). */
20460
+ defaultColumnWidths?: Record<string, number>;
20461
+ /**
20462
+ * Called with the width of every column and the details whenever a width changes (every step of
20463
+ * a drag or key press). The details are always passed; they are typed optional through 0.x, as
20464
+ * every `details` argument. Setting the width a column already has does not call it, once a
20465
+ * width is state.
20466
+ */
20467
+ onColumnWidthsChange?: (widths: Record<string, number>, details?: TableColumnWidthsChangeDetails) => void;
20468
+ }
20469
+
20470
+ /**
20471
+ * Headless table state for a table built from the static `Table` parts: the rows of `items`, and
20472
+ * the features its plugins add (`useTableSort`, `useTableSelection`, `useTableColumnSizing`). Each
20473
+ * plugin fills its own part of the state (`sort`, `selection`, `columnSizing`), so the order of
20474
+ * the array does not matter. The state follows the data, not the rendered rows, so a table that
20475
+ * renders a page or a window of its rows keeps select-all and the sort over every item.
20476
+ *
20477
+ * Call each plugin hook unconditionally, in the array or before it, and pass the same plugins on
20478
+ * every render; to turn a feature off, change its options. Options may be written inline: a plugin
20479
+ * whose options change identity on every render (an inline `isDisabled`) only makes the state be
20480
+ * recomputed on every render, while `getRows()` keeps its array until `items`, `getRowId`,
20481
+ * `columns` or the sort change. A feature given twice (the last plugin of it is used), a plugin
20482
+ * count that changes between renders and repeated row ids are development warnings.
20483
+ *
20484
+ * @example
20485
+ * const { getRows, sort, selection } = useTableFeatures({ items, columns, getRowId }, [
20486
+ * useTableSort({ defaultSort: { columnId: 'name', direction: 'ascending' } }),
20487
+ * useTableSelection({ selectionMode: 'multiple' }),
20488
+ * ]);
20489
+ */
20490
+ export declare function useTableFeatures<T>(options: UseTableFeaturesOptions<T>, plugins?: readonly TableFeaturePlugin<T>[]): TableFeaturesState<T>;
20491
+
20492
+ /** Options of {@link useTableFeatures}. */
20493
+ export declare interface UseTableFeaturesOptions<T> {
20494
+ /** The items, one row each. Every item counts for select-all, rendered or not. */
20495
+ items: readonly T[];
20496
+ /** The columns, from `createTableColumn`. The sort uses the `compare` of the sorted column. */
20497
+ columns: readonly DataGridColumn<T>[];
20498
+ /**
20499
+ * The row id of an item: unique, and the same for an item across renders (selection and the
20500
+ * selection callbacks use it). Pass a stable function (defined outside the component, or
20501
+ * memoised): the rows are rebuilt when it changes.
20502
+ * @default (item, index) => String(index)
20503
+ */
20504
+ getRowId?: (item: T, index: number) => string;
20505
+ }
20506
+
20507
+ /**
20508
+ * The selection plugin of `useTableFeatures`: a set of row ids (`selectedItems`, controlled, or
20509
+ * `defaultSelectedItems`), and `state.selection` with select-all over every item of `items`,
20510
+ * rendered or not. Select-all selects every selectable row and leaves the other ids as they are;
20511
+ * deselecting all removes only the selectable ids of `items`, so a selected disabled row and ids
20512
+ * selected on another page or filtered out stay selected (`clearRows` empties the selection).
20513
+ * `onSelectedItemsChange` fires once per change with a new array of every selected id. Call it
20514
+ * unconditionally and pass the plugin to `useTableFeatures`.
20515
+ *
20516
+ * @example
20517
+ * const { selection } = useTableFeatures({ items, columns, getRowId }, [
20518
+ * useTableSelection({ selectionMode: 'multiple', onSelectedItemsChange: setSelected }),
20519
+ * ]);
20520
+ */
20521
+ export declare function useTableSelection<T>(options: UseTableSelectionOptions<T>): TableFeaturePlugin<T>;
20522
+
20523
+ /** Options of {@link useTableSelection}: those of `useSelection`, plus the disabled rows. */
20524
+ export declare interface UseTableSelectionOptions<T> extends UseSelectionOptions {
20525
+ /**
20526
+ * Whether the selection of an item cannot change through select-all: `toggleAllRows` skips it,
20527
+ * and `allRowsSelected` does not wait for it. A disabled row keeps its state. The single-row
20528
+ * functions do not read it: disable the row's own control. Called for every item of `items`
20529
+ * whenever `useTableFeatures` computes its state: when the selection, `items`, `getRowId`,
20530
+ * `columns`, the sort or another plugin's state (the column widths) change, and when this
20531
+ * function changes. A function written inline is a new one on every render, so the state is
20532
+ * then computed, and this function called for every item, on every render (no more: no extra
20533
+ * render, and `getRows()` keeps its array); define it outside the component or memoise it to
20534
+ * call it only on those changes.
20535
+ */
20536
+ isDisabled?: (item: T, index: number) => boolean;
20537
+ }
20538
+
20539
+ /**
20540
+ * The sort plugin of `useTableFeatures`: sorts the rows by the `compare` of a column and fills
20541
+ * `state.sort`. The sort is controlled with `sort` or uncontrolled with `defaultSort`;
20542
+ * `toggleColumnSort` goes from ascending to descending as a sortable DataGrid header does. The
20543
+ * sorted column is the one whose `columnId` is the sort's `columnId` (the deprecated `id` of a
20544
+ * column is not read). Call it unconditionally and pass the plugin to `useTableFeatures`.
20545
+ *
20546
+ * @example
20547
+ * const state = useTableFeatures({ items, columns }, [
20548
+ * useTableSort({ defaultSort: { columnId: 'name', direction: 'ascending' } }),
20549
+ * ]);
20550
+ * state.sort.toggleColumnSort('name');
20551
+ */
20552
+ export declare function useTableSort<T>(options?: UseTableSortOptions): TableFeaturePlugin<T>;
20553
+
20554
+ /** Options of {@link useTableSort}. */
20555
+ export declare interface UseTableSortOptions {
20556
+ /**
20557
+ * The sort (controlled): the sorted column and its direction, or `null` for the order of
20558
+ * `items`. Pair it with `onSortChange`.
20559
+ */
20560
+ sort?: DataGridSort | null;
20561
+ /**
20562
+ * The sort at first render (uncontrolled).
20563
+ * @default null
20564
+ */
20565
+ defaultSort?: DataGridSort | null;
20566
+ /**
20567
+ * Called with the new sort whenever it changes, and the event behind it when the change was
20568
+ * given one. Setting the sort it already has does not call it.
20569
+ */
20570
+ onSortChange?: (sort: DataGridSort, details?: DataGridSortChangeDetails) => void;
20571
+ }
20572
+
19092
20573
  /**
19093
20574
  * Returns the {@link ToastController} of the enclosing `<Toaster>`: `dispatchToast(content,
19094
20575
  * options?)` shows your content (usually a `<Toast>` with parts) and `dispatchToast(options)` a
@@ -19122,7 +20603,71 @@ export declare interface UseRovingTabIndexResult {
19122
20603
  export declare function useToastController(): ToastController;
19123
20604
 
19124
20605
  /**
19125
- * Reads the theme, direction, theme classes and portal container of the nearest
20606
+ * A window over a long list of fixed-height rows, for rendering only the rows in view. Give
20607
+ * `scrollRef` to the scrolling element and render `layout(count)`: rows for the item entries and
20608
+ * empty blocks of `size` pixels for the spacer entries.
20609
+ *
20610
+ * The window re-renders only when the first row in view or the viewport height changes, not on
20611
+ * every scroll event: scrolling is read in a passive `scroll` listener once per animation frame,
20612
+ * and the viewport height on attach, on scroll and from a `ResizeObserver` where one exists. The
20613
+ * server and the first render lay out the top of the list in `initialViewportSize`, and read no
20614
+ * DOM.
20615
+ *
20616
+ * Never write `ref={virtualWindow.scrollRef}` in JSX: the React Compiler's lint types a member
20617
+ * read in the `ref` position as a ref, then reports that read and every call on the window during
20618
+ * render (`virtualWindow.layout(count)` included). Merge the callback with the element's other
20619
+ * refs through `useMergedRefs(ownRef, virtualWindow.scrollRef)`, or destructure it first
20620
+ * (`const { scrollRef } = virtualWindow`); `virtualWindow.layout(count)` can then be called as is.
20621
+ *
20622
+ * @example
20623
+ * const virtualWindow = useVirtualWindow({ itemSize: 32 });
20624
+ * const { scrollRef } = virtualWindow;
20625
+ * return (
20626
+ * <div ref={scrollRef} style={{ height: 320, overflowY: 'auto' }}>
20627
+ * {virtualWindow.layout(rows.length).map((entry) =>
20628
+ * entry.kind === 'item' ? (
20629
+ * <Row key={rows[entry.index].id} row={rows[entry.index]} />
20630
+ * ) : (
20631
+ * <div key={entry.key} aria-hidden="true" style={{ height: entry.size }} />
20632
+ * ),
20633
+ * )}
20634
+ * </div>
20635
+ * );
20636
+ */
20637
+ export declare function useVirtualWindow({ itemSize, overscan, initialViewportSize, scrollPaddingStart, }: UseVirtualWindowOptions): VirtualWindow;
20638
+
20639
+ /** Options of {@link useVirtualWindow}. */
20640
+ export declare interface UseVirtualWindowOptions {
20641
+ /**
20642
+ * The height of every row, in pixels (all rows have the same height). A value that is not a
20643
+ * positive finite number warns once in development and counts as 1.
20644
+ */
20645
+ itemSize: number;
20646
+ /**
20647
+ * Rows rendered beyond each edge of the viewport, so a fast scroll shows rows instead of blank
20648
+ * space before the next window renders. A given number is a number of rows; the default covers
20649
+ * at least 240 pixels, so small rows get more of them (9 rows of 28 pixels, 8 of 32).
20650
+ * @default enough rows for 240 pixels, and at least 6
20651
+ */
20652
+ overscan?: number;
20653
+ /**
20654
+ * The viewport height, in pixels, assumed until the scroller is measured: on the server, in the
20655
+ * first render, and while the scroller measures 0 (it has no layout, as in jsdom).
20656
+ * @default 480
20657
+ */
20658
+ initialViewportSize?: number;
20659
+ /**
20660
+ * The height, in pixels, of content pinned over the top of the rows inside the scroller (a
20661
+ * sticky header). `scrollToIndex` places rows in the area below it, and its content bound leaves
20662
+ * it out; the rows' offsets and the layout do not change. A value that is not a finite number of
20663
+ * 0 or more counts as 0.
20664
+ * @default 0
20665
+ */
20666
+ scrollPaddingStart?: number;
20667
+ }
20668
+
20669
+ /**
20670
+ * Reads the theme, direction, theme classes, portal container and token overrides of the nearest
19126
20671
  * {@link WaveProvider}. Outside a provider it returns light/ltr defaults with `hasProvider: false`.
19127
20672
  *
19128
20673
  * @returns The {@link WaveContextValue} of the nearest provider.
@@ -19146,6 +20691,91 @@ export declare interface VirtualElement {
19146
20691
  contextElement?: Element;
19147
20692
  }
19148
20693
 
20694
+ /**
20695
+ * One entry of a windowed list: a row to render, or the empty space that stands in for the rows
20696
+ * that are not rendered. A spacer's `key` is stable for React: `spacer-<index of the next item>`,
20697
+ * or `spacer-end` for the one after the last item.
20698
+ */
20699
+ export declare type VirtualEntry = {
20700
+ kind: 'item';
20701
+ index: number;
20702
+ } | {
20703
+ kind: 'spacer';
20704
+ size: number;
20705
+ key: string;
20706
+ };
20707
+
20708
+ /**
20709
+ * A window over a long list of fixed-height rows: which rows to render for the scroll position,
20710
+ * and the space that stands in for the others. {@link useVirtualWindow} returns one; a component
20711
+ * that takes a `virtualWindow` prop renders its rows through it, and an adapter over a
20712
+ * virtualization library can implement the same interface.
20713
+ */
20714
+ export declare interface VirtualWindow {
20715
+ /** The row height the window lays out with, in pixels. */
20716
+ itemSize: number;
20717
+ /**
20718
+ * The callback ref of the scrolling element (the element with a bounded height and its own
20719
+ * scrollbar). It attaches once per element and detaches when called with `null`.
20720
+ */
20721
+ scrollRef: React_2.RefCallback<HTMLElement>;
20722
+ /**
20723
+ * The entries to render, in order, for a list of `count` rows: the rows in view plus the
20724
+ * overscan, every `keep` index outside them as a row of its own (the focused row, a row about
20725
+ * to be focused), and spacers for the rows in between. The sizes add up to `count * itemSize`.
20726
+ * A pure function of the window's state and its arguments, called during render; it reads no
20727
+ * DOM.
20728
+ */
20729
+ layout(count: number, options?: {
20730
+ keep?: readonly number[];
20731
+ }): readonly VirtualEntry[];
20732
+ /**
20733
+ * Scrolls the row at `index` into view and moves the window to it in the same update, so the
20734
+ * row is rendered once that update commits. `align` places it at the `start`, `center` or `end`
20735
+ * of the viewport; `auto` (the default) scrolls the least that shows it whole. The offset is
20736
+ * bounded by the rendered content. Before the scroller attaches, the last request is kept and
20737
+ * applied when it does, and once more when the scroller first changes height after that (a
20738
+ * popup that positioning shrinks once it is shown), unless it was scrolled or another request
20739
+ * came in between. Call it from an event handler or an effect, never during render.
20740
+ */
20741
+ scrollToIndex(index: number, options?: {
20742
+ align?: 'auto' | 'start' | 'center' | 'end';
20743
+ }): void;
20744
+ }
20745
+
20746
+ /**
20747
+ * One row of the visible list: an item under expanded branches only, with the facts a row needs
20748
+ * for its tree semantics. A row is a branch when `hasChildren` is true or when
20749
+ * `item.itemType === 'branch'`; `expanded` is true only for a branch whose value is in the
20750
+ * expanded set (so a childless `'branch'` item can be expanded).
20751
+ */
20752
+ export declare interface VisibleFlatItem {
20753
+ /** The item data, as passed in. */
20754
+ item: FlatTreeItemData;
20755
+ /** The depth, 1 for a root (`aria-level`). */
20756
+ level: number;
20757
+ /** The 1-based place among its siblings, in the order of `items` (`aria-posinset`). */
20758
+ position: number;
20759
+ /** The number of siblings, itself included (`aria-setsize`). */
20760
+ setSize: number;
20761
+ /** The value of the parent as indexed (`undefined` for a root, an unknown parent included). */
20762
+ parentValue: string | undefined;
20763
+ /** Whether other items are nested in it. */
20764
+ hasChildren: boolean;
20765
+ /** Whether it can expand: `hasChildren`, or `item.itemType === 'branch'` (`aria-expanded` is set for these). */
20766
+ isBranch: boolean;
20767
+ /** Whether it is a branch in the expanded set. */
20768
+ expanded: boolean;
20769
+ /** The place in the visible list, 0-based. */
20770
+ index: number;
20771
+ }
20772
+
20773
+ /**
20774
+ * The name of every `--wave-*` variable of `tokens.css`, in camelCase, in the file's groups and
20775
+ * order. A test parses `tokens.css` and fails when a variable is missing here or a name has none.
20776
+ */
20777
+ declare const WAVE_TOKEN_NAMES: readonly ["fontFamily", "fontFamilyMonospace", "fontFamilyNumeric", "zOverlay", "zToast", "zTooltip", "durationUltraFast", "durationFaster", "durationFast", "durationNormal", "durationGentle", "durationSlow", "durationSlower", "durationUltraSlow", "curveAccelerateMax", "curveAccelerateMid", "curveAccelerateMin", "curveDecelerateMax", "curveDecelerateMid", "curveDecelerateMin", "curveEasyEaseMax", "curveEasyEase", "curveLinear", "brand10", "brand20", "brand30", "brand40", "brand50", "brand60", "brand70", "brand80", "brand90", "brand100", "brand110", "brand120", "brand130", "brand140", "brand150", "brand160", "grey2", "grey4", "grey6", "grey8", "grey10", "grey12", "grey14", "grey16", "grey20", "grey24", "grey26", "grey30", "grey34", "grey38", "grey40", "grey44", "grey50", "grey60", "grey68", "grey74", "grey78", "grey82", "grey86", "grey88", "grey90", "grey92", "grey94", "grey96", "grey98", "background", "foreground", "card", "secondary", "muted", "mutedForeground", "mutedHover", "mutedPressed", "primary", "primaryForeground", "primaryHover", "primaryPressed", "destructive", "destructiveForeground", "error", "errorForeground", "subtle", "subtleHover", "subtlePressed", "subtleSelected", "selected", "selectedForeground", "selectedHover", "selectedPressed", "border", "stroke", "strokeHover", "strokeAccessible", "input", "inputFilledDarker", "inputFilledStroke", "ring", "success", "successForeground", "successTint", "successTintForeground", "warning", "warningForeground", "warningTint", "warningTintForeground", "errorTint", "errorTintForeground", "severe", "severeForeground", "severeTint", "severeTintForeground", "info", "infoForeground", "infoTint", "infoTintForeground", "inverted", "invertedForeground", "invertedBorder", "track", "skeleton", "rating", "presenceAvailable", "presenceBusy", "presenceAway", "presenceOffline", "presenceOof", "presenceGlyph", "backdrop", "paletteRed", "paletteRedForeground", "paletteRedTint", "paletteRedTintForeground", "paletteRedBorder", "palettePumpkin", "palettePumpkinForeground", "palettePumpkinTint", "palettePumpkinTintForeground", "palettePumpkinBorder", "paletteGold", "paletteGoldForeground", "paletteGoldTint", "paletteGoldTintForeground", "paletteGoldBorder", "paletteForest", "paletteForestForeground", "paletteForestTint", "paletteForestTintForeground", "paletteForestBorder", "paletteTeal", "paletteTealForeground", "paletteTealTint", "paletteTealTintForeground", "paletteTealBorder", "paletteBlue", "paletteBlueForeground", "paletteBlueTint", "paletteBlueTintForeground", "paletteBlueBorder", "paletteNavy", "paletteNavyForeground", "paletteNavyTint", "paletteNavyTintForeground", "paletteNavyBorder", "paletteLavender", "paletteLavenderForeground", "paletteLavenderTint", "paletteLavenderTintForeground", "paletteLavenderBorder", "palettePurple", "palettePurpleForeground", "palettePurpleTint", "palettePurpleTintForeground", "palettePurpleBorder", "paletteMagenta", "paletteMagentaForeground", "paletteMagentaTint", "paletteMagentaTintForeground", "paletteMagentaBorder", "paletteBrown", "paletteBrownForeground", "paletteBrownTint", "paletteBrownTintForeground", "paletteBrownBorder", "paletteSteel", "paletteSteelForeground", "paletteSteelTint", "paletteSteelTintForeground", "paletteSteelBorder", "shadow2", "shadow4", "shadow8", "shadow16", "shadow28", "shadow64", "cardForeground", "secondaryForeground", "accent", "accentForeground", "inputFilledLighter"];
20778
+
19149
20779
  /** Value provided by {@link WaveProvider} and returned by {@link useWaveTheme}. */
19150
20780
  export declare interface WaveContextValue {
19151
20781
  /** The active theme. */
@@ -19163,6 +20793,19 @@ export declare interface WaveContextValue {
19163
20793
  inputDefaults: InputDefaults;
19164
20794
  /** The motion preference of the providers above (`'default'` outside a provider). */
19165
20795
  motion: MotionPreference;
20796
+ /**
20797
+ * The merged token overrides of the providers above (`{}` outside a provider), as given: an
20798
+ * entry skipped for a malformed key or value stays in it, and only `tokenStyle` leaves it out.
20799
+ */
20800
+ tokens: WaveTokenOverrides;
20801
+ /**
20802
+ * The inline style that applies `tokens`, as the provider's root and, unless
20803
+ * `applyStylesToPortals` is `false`, its portals carry it; `undefined` when there is nothing to
20804
+ * set (also outside a provider).
20805
+ */
20806
+ tokenStyle: TokenStyle | undefined;
20807
+ /** Whether portals carry `tokenStyle` (`true` outside a provider). */
20808
+ applyStylesToPortals: boolean;
19166
20809
  /** `false` when no {@link WaveProvider} is above the caller (the defaults are returned). */
19167
20810
  hasProvider: boolean;
19168
20811
  }
@@ -19193,9 +20836,18 @@ export declare type WaveDir = 'ltr' | 'rtl';
19193
20836
  * slots, Carousel's slide, TabList's sliding line, the reveal of Nav item actions; a part's own
19194
20837
  * `motion` still wins), while transitions without a slot keep running (Accordion's and Tree's
19195
20838
  * chevron turns, colour changes); a nested provider inherits an omitted `motion` like `theme`.
20839
+ * - `tokens` overrides design tokens in the subtree with inline custom properties on the root
20840
+ * (rendered on the server too) and on every portal of the subtree, unless
20841
+ * `applyStylesToPortals` is `false`. A nested provider merges its overrides over the enclosing
20842
+ * provider's key by key, also when it sets another `theme`; `tokens={null}` clears them for the
20843
+ * tokens the theme declares and for the overlays, while the theme-independent ones of an
20844
+ * enclosing provider still reach the subtree through the CSS cascade. An override whose key is
20845
+ * not a camelCase identifier, or whose value is neither a finite number nor a string without
20846
+ * `;`, `{` or `}`, is skipped with a development warning. Without overrides the root renders no
20847
+ * `style` attribute unless you pass `style`.
19196
20848
  */
19197
20849
  export declare const WaveProvider: {
19198
- ({ theme: themeProp, dir: dirProp, portalContainer: portalContainerProp, inputDefaults: inputDefaultsProp, motion: motionProp, children, className, ref, ...rest }: WaveProviderProps): React_2.JSX.Element;
20850
+ ({ theme: themeProp, dir: dirProp, portalContainer: portalContainerProp, inputDefaults: inputDefaultsProp, motion: motionProp, tokens: tokensProp, applyStylesToPortals: applyStylesToPortalsProp, children, className, style, ref, ...rest }: WaveProviderProps): React_2.JSX.Element;
19199
20851
  displayName: string;
19200
20852
  };
19201
20853
 
@@ -19243,6 +20895,52 @@ export declare interface WaveProviderProps extends React_2.HTMLAttributes<HTMLDi
19243
20895
  * @default the enclosing WaveProvider's motion, else 'default'
19244
20896
  */
19245
20897
  motion?: MotionPreference;
20898
+ /**
20899
+ * Design token overrides for the subtree: CSS values by token name, the CSS variable in camelCase
20900
+ * without its `--wave-` prefix (`brand80` for `--wave-brand-80`, `primaryForeground` for
20901
+ * `--wave-primary-foreground`; a number is written as its string). `theme` still names one of
20902
+ * the three themes, and the overrides apply over it as inline custom properties on the root and
20903
+ * on every portal of the subtree (see `applyStylesToPortals`), so its dialogs, menus, popovers,
20904
+ * tooltips and toasts take them too. Fluent's `theme` prop with a partial theme is the
20905
+ * counterpart.
20906
+ *
20907
+ * A nested provider merges its overrides over the enclosing provider's, key by key: an omitted
20908
+ * `tokens` inherits them all, and a key whose value is `undefined` inherits that key. `null`
20909
+ * clears the inherited overrides of the tokens the theme declares (the semantic colours, shadows,
20910
+ * palette) and of the subtree's overlays; theme-independent tokens (the brand and grey ramps,
20911
+ * font families, stacking order, motion durations and curves) of an enclosing provider still
20912
+ * reach the subtree's own elements through the CSS cascade, and the theme's colours built on the
20913
+ * brand ramp follow them there. A nested provider that sets another `theme` inherits the
20914
+ * overrides too, so set an override of a semantic colour (`primary`) in the provider that sets
20915
+ * the theme it was chosen for. A whole brand ramp is better made with `createBrandTokens` than
20916
+ * written by hand.
20917
+ * A key that is not a camelCase identifier, or a value that is neither a finite number nor a
20918
+ * string without `;`, `{` or `}` (such a value could add a declaration of its own to the
20919
+ * server-rendered `style` attribute), is skipped with a development warning; a well-formed name
20920
+ * is not checked against the list of tokens (TypeScript refuses a misspelled one).
20921
+ *
20922
+ * The overrides are rendered on the server too. Under a Content Security Policy that blocks
20923
+ * inline style attributes (`style-src` without `'unsafe-inline'`), the server-rendered overrides
20924
+ * do not apply and hydration does not apply them again: ship them in a stylesheet there, and pass
20925
+ * no `tokens` (nor `getTokenStyle`), since the overlays and the subtrees rendered in the client
20926
+ * would still take them and leave the page half branded.
20927
+ *
20928
+ * @example
20929
+ * <WaveProvider tokens={{ fontFamily: 'Inter, sans-serif', zOverlay: 2000 }}>
20930
+ * @default the enclosing WaveProvider's overrides, else none
20931
+ */
20932
+ tokens?: WaveTokenOverrides | null;
20933
+ /**
20934
+ * Whether the portals of the subtree (dialogs, popovers, menus, tooltips, toasts) carry the
20935
+ * overrides of `tokens`. `false` leaves them out: an overlay then shows its theme's own values
20936
+ * for the tokens the theme declares, and keeps the surrounding cascade (that of the element it
20937
+ * renders into) for the theme-independent ones. The theme classes and the direction are set on
20938
+ * every portal either way, so an overlay of a dark provider is still dark. Fluent's
20939
+ * `applyStylesToPortals` is the counterpart; unlike Fluent's, a nested provider inherits an
20940
+ * omitted value, like `theme`.
20941
+ * @default the enclosing WaveProvider's value, else true
20942
+ */
20943
+ applyStylesToPortals?: boolean;
19246
20944
  /** Content rendered inside the themed container. */
19247
20945
  children: React_2.ReactNode;
19248
20946
  /** Ref to the themed root `<div>`. */
@@ -19258,4 +20956,42 @@ export declare interface WaveProviderProps extends React_2.HTMLAttributes<HTMLDi
19258
20956
  /** Supported visual themes for the Wave design system. */
19259
20957
  export declare type WaveTheme = 'light' | 'dark' | 'high-contrast';
19260
20958
 
20959
+ /**
20960
+ * The name of a design token: its CSS custom property without the `--wave-` prefix, in camelCase.
20961
+ * `--wave-primary-foreground` is `primaryForeground`, `--wave-brand-80` is `brand80` and
20962
+ * `--wave-palette-red-tint` is `paletteRedTint`.
20963
+ */
20964
+ export declare type WaveTokenName = (typeof WAVE_TOKEN_NAMES)[number];
20965
+
20966
+ /**
20967
+ * Token overrides: CSS values by token name, as `WaveProvider tokens` and `getTokenStyle` take
20968
+ * them. A number is written as its string (`zOverlay: 2000`); a key whose value is `undefined`
20969
+ * sets nothing.
20970
+ */
20971
+ export declare type WaveTokenOverrides = {
20972
+ [K in WaveTokenName]?: string | number;
20973
+ };
20974
+
20975
+ /** The shape of `waveTokens`: every token name mapped to the CSS value that reads the token. */
20976
+ export declare type WaveTokens = {
20977
+ readonly [K in WaveTokenName]: string;
20978
+ };
20979
+
20980
+ /**
20981
+ * Every design token as the CSS value that reads it: `waveTokens.primary` is
20982
+ * `'var(--wave-primary)'`, typed as that literal. Use it where a style is written in JavaScript
20983
+ * (an inline style, a CSS-in-JS rule, the colours of an SVG chart), so the value follows the theme
20984
+ * and the provider's token overrides. The counterpart of Fluent's `tokens` object
20985
+ * (`tokens.colorBrandBackground`), with Wave's names: the CSS variable in camelCase without its
20986
+ * `--wave-` prefix. A canvas library cannot read a CSS variable: resolve the value with
20987
+ * `getComputedStyle` on an element inside the provider, and again when the theme changes.
20988
+ * Frozen and server-safe; no component imports it.
20989
+ *
20990
+ * @example
20991
+ * <span style={{ color: waveTokens.primary, boxShadow: waveTokens.shadow8 }} />
20992
+ */
20993
+ export declare const waveTokens: {
20994
+ readonly [K in WaveTokenName]: `var(${TokenVariable<K>})`;
20995
+ };
20996
+
19261
20997
  export { }