@human-kit/ui 1.0.0-beta.5 → 1.0.0-beta.7

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 (255) hide show
  1. package/README.md +19 -17
  2. package/dist/accordion/README.md +3 -3
  3. package/dist/accordion/types.d.ts +37 -23
  4. package/dist/autocomplete/README.md +6 -7
  5. package/dist/autocomplete/empty/autocomplete-empty.svelte +1 -1
  6. package/dist/autocomplete/empty/autocomplete-empty.svelte.d.ts +1 -1
  7. package/dist/autocomplete/input/autocomplete-input.svelte +3 -3
  8. package/dist/autocomplete/input/autocomplete-input.svelte.d.ts +3 -3
  9. package/dist/autocomplete/item/autocomplete-item.svelte +10 -0
  10. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte +2 -2
  11. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte.d.ts +2 -2
  12. package/dist/autocomplete/list/autocomplete-list.svelte +2 -2
  13. package/dist/autocomplete/list/autocomplete-list.svelte.d.ts +2 -2
  14. package/dist/autocomplete/root/autocomplete.svelte +7 -7
  15. package/dist/autocomplete/root/autocomplete.svelte.d.ts +7 -7
  16. package/dist/autocomplete/status/autocomplete-status.svelte +1 -1
  17. package/dist/autocomplete/status/autocomplete-status.svelte.d.ts +1 -1
  18. package/dist/button/README.md +1 -1
  19. package/dist/button/root/button-root.svelte +24 -10
  20. package/dist/button/root/button-root.svelte.d.ts +15 -10
  21. package/dist/calendar/README.md +3 -3
  22. package/dist/calendar/body-cell/calendar-body-cell.svelte +7 -0
  23. package/dist/calendar/grid-header/calendar-grid-header.svelte +3 -4
  24. package/dist/calendar/grid-header/calendar-grid-header.svelte.d.ts +3 -4
  25. package/dist/calendar/root/calendar-root.svelte +8 -2
  26. package/dist/calendar/root/calendar-root.svelte.d.ts +8 -2
  27. package/dist/calendar/trigger-next/README.md +1 -1
  28. package/dist/calendar/trigger-previous/README.md +1 -1
  29. package/dist/checkbox/README.md +1 -1
  30. package/dist/checkbox/indicator/README.md +1 -1
  31. package/dist/checkbox/indicator/checkbox-indicator.svelte +1 -0
  32. package/dist/checkbox/indicator/checkbox-indicator.svelte.d.ts +1 -0
  33. package/dist/checkbox/root/README.md +2 -2
  34. package/dist/checkbox/root/checkbox-root.svelte +118 -40
  35. package/dist/checkbox/root/checkbox-root.svelte.d.ts +17 -10
  36. package/dist/checkbox-group/README.md +95 -0
  37. package/dist/checkbox-group/index.d.ts +15 -0
  38. package/dist/checkbox-group/index.js +6 -0
  39. package/dist/checkbox-group/index.parts.d.ts +4 -0
  40. package/dist/checkbox-group/index.parts.js +7 -0
  41. package/dist/checkbox-group/label/checkbox-group-label.svelte +36 -0
  42. package/dist/checkbox-group/label/checkbox-group-label.svelte.d.ts +4 -0
  43. package/dist/checkbox-group/root/checkbox-group-root.svelte +118 -0
  44. package/dist/checkbox-group/root/checkbox-group-root.svelte.d.ts +4 -0
  45. package/dist/checkbox-group/root/context.svelte.d.ts +52 -0
  46. package/dist/checkbox-group/root/context.svelte.js +251 -0
  47. package/dist/checkbox-group/types.d.ts +57 -0
  48. package/dist/checkbox-group/types.js +1 -0
  49. package/dist/clock/README.md +3 -3
  50. package/dist/clock/axis/README.md +1 -1
  51. package/dist/clock/root/README.md +1 -1
  52. package/dist/clock/wheel-column/clock-wheel-column.svelte +1 -1
  53. package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +1 -1
  54. package/dist/collapsible/README.md +3 -3
  55. package/dist/collapsible/types.d.ts +10 -7
  56. package/dist/combobox/README.md +2 -2
  57. package/dist/combobox/button/README.md +6 -6
  58. package/dist/combobox/input/README.md +1 -1
  59. package/dist/combobox/input/combobox-input.svelte +3 -3
  60. package/dist/combobox/input/combobox-input.svelte.d.ts +3 -3
  61. package/dist/combobox/item/combobox-listboxitem.svelte +4 -2
  62. package/dist/combobox/item/combobox-listboxitem.svelte.d.ts +4 -2
  63. package/dist/combobox/item-indicator/README.md +1 -1
  64. package/dist/combobox/item-indicator/combobox-item-indicator.svelte +2 -2
  65. package/dist/combobox/item-indicator/combobox-item-indicator.svelte.d.ts +2 -2
  66. package/dist/combobox/list/combobox-listbox.svelte +11 -8
  67. package/dist/combobox/list/combobox-listbox.svelte.d.ts +11 -8
  68. package/dist/combobox/popover/README.md +1 -1
  69. package/dist/combobox/root/README.md +24 -24
  70. package/dist/combobox/root/combobox.svelte +26 -17
  71. package/dist/combobox/root/combobox.svelte.d.ts +26 -17
  72. package/dist/combobox/status/README.md +1 -1
  73. package/dist/combobox/status/combobox-status.svelte +1 -1
  74. package/dist/combobox/status/combobox-status.svelte.d.ts +1 -1
  75. package/dist/combobox/tag/README.md +1 -1
  76. package/dist/combobox/tag/combobox-tag.svelte +1 -1
  77. package/dist/combobox/tag/combobox-tag.svelte.d.ts +1 -1
  78. package/dist/combobox/tag-remove/README.md +1 -1
  79. package/dist/combobox/tag-remove/combobox-tag-remove.svelte +4 -5
  80. package/dist/combobox/tag-remove/combobox-tag-remove.svelte.d.ts +4 -5
  81. package/dist/combobox/tags/README.md +1 -1
  82. package/dist/combobox/tags/combobox-tags.svelte +11 -11
  83. package/dist/combobox/tags/combobox-tags.svelte.d.ts +11 -11
  84. package/dist/combobox/trigger/README.md +7 -7
  85. package/dist/datepicker/README.md +4 -4
  86. package/dist/datepicker/input/date-picker-input.svelte +3 -4
  87. package/dist/datepicker/input/date-picker-input.svelte.d.ts +3 -4
  88. package/dist/datepicker/root/date-picker-root.svelte +1 -1
  89. package/dist/datepicker/trigger/README.md +1 -1
  90. package/dist/daterangepicker/README.md +3 -3
  91. package/dist/daterangepicker/input/date-range-picker-input.svelte +3 -4
  92. package/dist/daterangepicker/input/date-range-picker-input.svelte.d.ts +3 -4
  93. package/dist/dialog/README.md +1 -1
  94. package/dist/dialog/close/dialog-close.svelte +3 -3
  95. package/dist/dialog/close/dialog-close.svelte.d.ts +3 -3
  96. package/dist/dialog/content/dialog-content.svelte +4 -4
  97. package/dist/dialog/content/dialog-content.svelte.d.ts +4 -4
  98. package/dist/dialog/description/dialog-description.svelte +3 -3
  99. package/dist/dialog/description/dialog-description.svelte.d.ts +3 -3
  100. package/dist/dialog/overlay/dialog-overlay.svelte +1 -1
  101. package/dist/dialog/overlay/dialog-overlay.svelte.d.ts +1 -1
  102. package/dist/dialog/portal/dialog-portal.svelte +1 -1
  103. package/dist/dialog/portal/dialog-portal.svelte.d.ts +1 -1
  104. package/dist/dialog/root/README.md +1 -1
  105. package/dist/dialog/root/dialog-root.svelte +36 -11
  106. package/dist/dialog/root/dialog-root.svelte.d.ts +11 -9
  107. package/dist/dialog/title/dialog-title.svelte +3 -3
  108. package/dist/dialog/title/dialog-title.svelte.d.ts +3 -3
  109. package/dist/dialog/trigger/README.md +1 -1
  110. package/dist/drawer/README.md +3 -3
  111. package/dist/drawer/body/drawer-body.svelte +2 -2
  112. package/dist/drawer/body/drawer-body.svelte.d.ts +2 -2
  113. package/dist/drawer/close/drawer-close.svelte +3 -3
  114. package/dist/drawer/close/drawer-close.svelte.d.ts +3 -3
  115. package/dist/drawer/content/drawer-content.svelte +12 -9
  116. package/dist/drawer/content/drawer-content.svelte.d.ts +12 -9
  117. package/dist/drawer/description/drawer-description.svelte +3 -3
  118. package/dist/drawer/description/drawer-description.svelte.d.ts +3 -3
  119. package/dist/drawer/indent/drawer-indent-background.svelte +1 -1
  120. package/dist/drawer/indent/drawer-indent-background.svelte.d.ts +1 -1
  121. package/dist/drawer/indent/drawer-indent.svelte +2 -2
  122. package/dist/drawer/indent/drawer-indent.svelte.d.ts +2 -2
  123. package/dist/drawer/overlay/drawer-overlay.svelte +1 -1
  124. package/dist/drawer/overlay/drawer-overlay.svelte.d.ts +1 -1
  125. package/dist/drawer/portal/drawer-portal.svelte +1 -1
  126. package/dist/drawer/portal/drawer-portal.svelte.d.ts +1 -1
  127. package/dist/drawer/root/context.d.ts +1 -1
  128. package/dist/drawer/root/drawer-root.svelte +25 -23
  129. package/dist/drawer/root/drawer-root.svelte.d.ts +25 -23
  130. package/dist/drawer/swipe-area/drawer-swipe-area.svelte +3 -3
  131. package/dist/drawer/swipe-area/drawer-swipe-area.svelte.d.ts +3 -3
  132. package/dist/drawer/title/drawer-title.svelte +3 -3
  133. package/dist/drawer/title/drawer-title.svelte.d.ts +3 -3
  134. package/dist/drawer/trigger/drawer-trigger.svelte +6 -6
  135. package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +6 -6
  136. package/dist/drawer/viewport/drawer-viewport.svelte +2 -2
  137. package/dist/drawer/viewport/drawer-viewport.svelte.d.ts +2 -2
  138. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +1 -1
  139. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte.d.ts +1 -1
  140. package/dist/dropzone/README.md +4 -6
  141. package/dist/index.d.ts +4 -0
  142. package/dist/index.js +4 -0
  143. package/dist/input/input.svelte +6 -6
  144. package/dist/input/input.svelte.d.ts +6 -6
  145. package/dist/listbox/README.md +3 -10
  146. package/dist/listbox/item/listbox-item.svelte +24 -15
  147. package/dist/listbox/item/listbox-item.svelte.d.ts +24 -15
  148. package/dist/listbox/root/README.md +1 -1
  149. package/dist/listbox/root/context.d.ts +1 -1
  150. package/dist/listbox/root/listbox.svelte +50 -38
  151. package/dist/listbox/root/listbox.svelte.d.ts +50 -38
  152. package/dist/locale-provider/README.md +1 -6
  153. package/dist/menu/README.md +6 -15
  154. package/dist/menu/content/menu-content.svelte +14 -10
  155. package/dist/menu/content/menu-content.svelte.d.ts +14 -10
  156. package/dist/menu/context-trigger/menu-context-trigger.svelte +8 -9
  157. package/dist/menu/context-trigger/menu-context-trigger.svelte.d.ts +8 -9
  158. package/dist/menu/group/menu-group-label.svelte +1 -1
  159. package/dist/menu/group/menu-group-label.svelte.d.ts +1 -1
  160. package/dist/menu/item/menu-item.svelte +11 -8
  161. package/dist/menu/item/menu-item.svelte.d.ts +11 -8
  162. package/dist/menu/overlay/menu-overlay.svelte +1 -1
  163. package/dist/menu/overlay/menu-overlay.svelte.d.ts +1 -1
  164. package/dist/menu/root/context.d.ts +6 -3
  165. package/dist/menu/root/menu-root.svelte +14 -8
  166. package/dist/menu/root/menu-root.svelte.d.ts +14 -8
  167. package/dist/menu/root/menu-state.svelte.d.ts +1 -1
  168. package/dist/menu/separator/menu-separator.svelte +1 -1
  169. package/dist/menu/separator/menu-separator.svelte.d.ts +1 -1
  170. package/dist/menu/submenu/menu-submenu-root.svelte +10 -7
  171. package/dist/menu/submenu/menu-submenu-root.svelte.d.ts +10 -7
  172. package/dist/numberfield/root/README.md +1 -1
  173. package/dist/numberfield/scrub-area-cursor/README.md +1 -1
  174. package/dist/popover/README.md +1 -1
  175. package/dist/popover/content/popover-content.svelte +19 -14
  176. package/dist/popover/content/popover-content.svelte.d.ts +19 -14
  177. package/dist/popover/overlay/popover-overlay.svelte +1 -1
  178. package/dist/popover/overlay/popover-overlay.svelte.d.ts +1 -1
  179. package/dist/popover/root/README.md +1 -1
  180. package/dist/popover/root/popover-root.svelte +13 -10
  181. package/dist/popover/root/popover-root.svelte.d.ts +13 -10
  182. package/dist/popover/trigger/README.md +1 -1
  183. package/dist/primitives/floating.d.ts +3 -3
  184. package/dist/primitives/focus-visible.svelte.d.ts +14 -0
  185. package/dist/primitives/focus-visible.svelte.js +19 -0
  186. package/dist/primitives/index.d.ts +1 -0
  187. package/dist/primitives/index.js +1 -0
  188. package/dist/primitives/input-modality.d.ts +7 -0
  189. package/dist/primitives/input-modality.js +32 -5
  190. package/dist/primitives/scroll-lock.js +37 -8
  191. package/dist/radio-group/README.md +103 -0
  192. package/dist/radio-group/index.d.ts +18 -0
  193. package/dist/radio-group/index.js +9 -0
  194. package/dist/radio-group/index.parts.d.ts +4 -0
  195. package/dist/radio-group/index.parts.js +4 -0
  196. package/dist/radio-group/indicator/radio-group-indicator.svelte +43 -0
  197. package/dist/radio-group/indicator/radio-group-indicator.svelte.d.ts +12 -0
  198. package/dist/radio-group/item/context.d.ts +18 -0
  199. package/dist/radio-group/item/context.js +15 -0
  200. package/dist/radio-group/item/radio-group-item.svelte +377 -0
  201. package/dist/radio-group/item/radio-group-item.svelte.d.ts +35 -0
  202. package/dist/radio-group/label/radio-group-label.svelte +37 -0
  203. package/dist/radio-group/label/radio-group-label.svelte.d.ts +4 -0
  204. package/dist/radio-group/root/context.svelte.d.ts +57 -0
  205. package/dist/radio-group/root/context.svelte.js +284 -0
  206. package/dist/radio-group/root/radio-group-root.svelte +193 -0
  207. package/dist/radio-group/root/radio-group-root.svelte.d.ts +4 -0
  208. package/dist/radio-group/types.d.ts +50 -0
  209. package/dist/radio-group/types.js +1 -0
  210. package/dist/switch/root/README.md +2 -2
  211. package/dist/switch/root/switch-root.svelte +32 -18
  212. package/dist/switch/root/switch-root.svelte.d.ts +23 -18
  213. package/dist/switch/thumb/switch-thumb.svelte +1 -1
  214. package/dist/switch/thumb/switch-thumb.svelte.d.ts +1 -1
  215. package/dist/table/README.md +15 -10
  216. package/dist/table/checkbox-indicator/README.md +1 -1
  217. package/dist/table/column-header-cell/table-column-header-cell.svelte +24 -0
  218. package/dist/table/column-resizer/README.md +2 -2
  219. package/dist/table/root/README.md +1 -1
  220. package/dist/table/root/table-root.svelte +29 -6
  221. package/dist/table/sort-trigger/README.md +1 -1
  222. package/dist/table/types.d.ts +21 -20
  223. package/dist/tabs/types.d.ts +6 -6
  224. package/dist/timepicker/README.md +3 -2
  225. package/dist/timepicker/input/README.md +1 -1
  226. package/dist/timepicker/input/time-picker-input.svelte +66 -5
  227. package/dist/timepicker/input/time-picker-input.svelte.d.ts +18 -1
  228. package/dist/timepicker/root/README.md +1 -1
  229. package/dist/timepicker/trigger/README.md +1 -1
  230. package/dist/toggle/README.md +1 -1
  231. package/dist/toggle/root/toggle-root.svelte +28 -0
  232. package/dist/toggle/root/toggle-root.svelte.d.ts +19 -0
  233. package/dist/toggle-group/README.md +8 -10
  234. package/dist/toggle-group/index.d.ts +2 -0
  235. package/dist/toggle-group/index.parts.d.ts +1 -0
  236. package/dist/toggle-group/index.parts.js +4 -0
  237. package/dist/toggle-group/types.d.ts +7 -6
  238. package/dist/transfer-list/README.md +6 -17
  239. package/dist/transfer-list/item/transfer-list-item.svelte +4 -4
  240. package/dist/transfer-list/item/transfer-list-item.svelte.d.ts +4 -4
  241. package/dist/transfer-list/list/transfer-list-list.svelte +12 -12
  242. package/dist/transfer-list/list/transfer-list-list.svelte.d.ts +12 -12
  243. package/dist/transfer-list/move/transfer-list-move-button.svelte +4 -4
  244. package/dist/transfer-list/move/transfer-list-move-button.svelte.d.ts +4 -4
  245. package/dist/transfer-list/move/transfer-list-reorder-button.svelte +3 -3
  246. package/dist/transfer-list/move/transfer-list-reorder-button.svelte.d.ts +3 -3
  247. package/dist/transfer-list/root/transfer-list-root.svelte +23 -20
  248. package/dist/transfer-list/root/transfer-list-root.svelte.d.ts +23 -20
  249. package/dist/transfer-list/status/transfer-list-status.svelte +1 -1
  250. package/dist/transfer-list/status/transfer-list-status.svelte.d.ts +1 -1
  251. package/dist/tree/README.md +3 -3
  252. package/dist/tree/checkbox-indicator/README.md +1 -1
  253. package/dist/tree/root/README.md +1 -1
  254. package/dist/tree/types.d.ts +19 -10
  255. package/package.json +11 -1
@@ -2,9 +2,7 @@
2
2
 
3
3
  ## Description
4
4
 
5
- `Dropzone` is a headless file-drop surface. It renders a focusable `<button>` plus a
6
- visually-hidden `<input type="file">`, so files can be selected by click/keyboard, by
7
- drag-and-drop, or by pasting from the clipboard, and emits the accepted native `File`s.
5
+ `Dropzone` is a headless file-drop surface. It makes a `<button>` element that takes the focus, and a hidden `<input type="file">` element. Thus the user selects the files with a click, with the keyboard, with a drag, or from the clipboard. The component then sends the native `File` objects that it accepts.
8
6
  It is encoding-agnostic — consumers own how files are stored or rendered.
9
7
 
10
8
  ## Anatomy
@@ -33,7 +31,7 @@ It is encoding-agnostic — consumers own how files are stored or rendered.
33
31
  tokens (`.ext`), so include the extensions you care about alongside MIME types.
34
32
  - Directory drops are excluded when the browser exposes `webkitGetAsEntry`; otherwise the
35
33
  drop falls back to `dataTransfer.files` as before.
36
- - `multiple` allows selecting/dropping more than one file; when false only the first is emitted.
34
+ - `multiple` lets the user give more than one file. With `false`, the component sends only the first file.
37
35
  - Style interaction state with `data-drop-target`, `data-focus-visible`, `data-hovered`, and
38
36
  `data-disabled`. The `children` snippet also receives `{ dragging, hovered, focused,
39
37
  focusVisible, disabled }`.
@@ -58,9 +56,9 @@ focusVisible, disabled }`.
58
56
  - The drop surface is a native `<button type="button">`, so it is reachable by Tab and
59
57
  activatable with Enter/Space, which opens the file picker. This is the keyboard path that
60
58
  drag-and-drop alone cannot provide.
61
- - `aria-label` (or `aria-labelledby`/`aria-describedby` via rest props) names the zone.
59
+ - `aria-label` gives the zone its name. The `aria-labelledby` and `aria-describedby` attributes also go through the other props.
62
60
  - `data-focus-visible` follows the shared modality contract and only appears for keyboard or
63
61
  virtual focus.
64
- - `announcement` is rendered into a visually-hidden `role="status" aria-live="polite"` region.
62
+ - The component puts `announcement` in a hidden `role="status" aria-live="polite"` region.
65
63
  - The hidden file input is removed from the tab order (`tabindex="-1"`, `aria-hidden`) so the
66
64
  button is the single focus stop.
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { Accordion } from './accordion/index.js';
2
2
  export { Autocomplete } from './autocomplete/index.js';
3
3
  export { Button } from './button/index.js';
4
4
  export { Checkbox } from './checkbox/index.js';
5
+ export { CheckboxGroup } from './checkbox-group/index.js';
5
6
  export { Collapsible } from './collapsible/index.js';
6
7
  export { ComboBox } from './combobox/index.js';
7
8
  export { Calendar } from './calendar/index.js';
@@ -15,6 +16,7 @@ export { ListBox } from './listbox/index.js';
15
16
  export { Menu } from './menu/index.js';
16
17
  export { NumberField } from './numberfield/index.js';
17
18
  export { Popover } from './popover/index.js';
19
+ export { RadioGroup } from './radio-group/index.js';
18
20
  export { Switch } from './switch/index.js';
19
21
  export { Table } from './table/index.js';
20
22
  export { Tabs } from './tabs/index.js';
@@ -34,6 +36,7 @@ export * from './accordion/index.js';
34
36
  export * from './autocomplete/index.js';
35
37
  export * from './button/index.js';
36
38
  export * from './checkbox/index.js';
39
+ export * from './checkbox-group/index.js';
37
40
  export * from './collapsible/index.js';
38
41
  export * from './combobox/index.js';
39
42
  export * from './calendar/index.js';
@@ -48,6 +51,7 @@ export * from './listbox/index.js';
48
51
  export * from './menu/index.js';
49
52
  export * from './numberfield/index.js';
50
53
  export * from './popover/index.js';
54
+ export * from './radio-group/index.js';
51
55
  export * from './switch/index.js';
52
56
  export * from './table/index.js';
53
57
  export * from './tabs/index.js';
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ export { Accordion } from './accordion/index.js';
4
4
  export { Autocomplete } from './autocomplete/index.js';
5
5
  export { Button } from './button/index.js';
6
6
  export { Checkbox } from './checkbox/index.js';
7
+ export { CheckboxGroup } from './checkbox-group/index.js';
7
8
  export { Collapsible } from './collapsible/index.js';
8
9
  export { ComboBox } from './combobox/index.js';
9
10
  export { Calendar } from './calendar/index.js';
@@ -17,6 +18,7 @@ export { ListBox } from './listbox/index.js';
17
18
  export { Menu } from './menu/index.js';
18
19
  export { NumberField } from './numberfield/index.js';
19
20
  export { Popover } from './popover/index.js';
21
+ export { RadioGroup } from './radio-group/index.js';
20
22
  export { Switch } from './switch/index.js';
21
23
  export { Table } from './table/index.js';
22
24
  export { Tabs } from './tabs/index.js';
@@ -38,6 +40,7 @@ export * from './accordion/index.js';
38
40
  export * from './autocomplete/index.js';
39
41
  export * from './button/index.js';
40
42
  export * from './checkbox/index.js';
43
+ export * from './checkbox-group/index.js';
41
44
  export * from './collapsible/index.js';
42
45
  export * from './combobox/index.js';
43
46
  export * from './calendar/index.js';
@@ -52,6 +55,7 @@ export * from './listbox/index.js';
52
55
  export * from './menu/index.js';
53
56
  export * from './numberfield/index.js';
54
57
  export * from './popover/index.js';
58
+ export * from './radio-group/index.js';
55
59
  export * from './switch/index.js';
56
60
  export * from './table/index.js';
57
61
  export * from './tabs/index.js';
@@ -10,17 +10,17 @@
10
10
 
11
11
  type InputProps = HTMLInputAttributes & {
12
12
  class?: ClassValue;
13
- /** Disables the input natively. */
13
+ /** Disables the input, with the native attribute. */
14
14
  disabled?: boolean | null;
15
- /** Native readonly, also exposed as `aria-readonly`. */
15
+ /** The native `readonly` attribute. The component also sets `aria-readonly`. */
16
16
  readonly?: boolean | null;
17
- /** Marks the value as invalid: maps to `aria-invalid` and `data-invalid`. */
17
+ /** Marks the value as not valid. The component sets `aria-invalid` and `data-invalid`. */
18
18
  invalid?: boolean;
19
- /** Native required, also exposed as `aria-required`. */
19
+ /** The native `required` attribute. The component also sets `aria-required`. */
20
20
  required?: boolean | null;
21
- /** Current value. Bindable. */
21
+ /** The value. You can bind it. */
22
22
  value?: HTMLInputAttributes['value'];
23
- /** Bindable reference to the rendered input element. */
23
+ /** A bindable reference to the input element. */
24
24
  element?: HTMLInputElement | null;
25
25
  };
26
26
 
@@ -2,17 +2,17 @@ import type { HTMLInputAttributes } from 'svelte/elements';
2
2
  import type { ClassValue } from '../utils/cn';
3
3
  type InputProps = HTMLInputAttributes & {
4
4
  class?: ClassValue;
5
- /** Disables the input natively. */
5
+ /** Disables the input, with the native attribute. */
6
6
  disabled?: boolean | null;
7
- /** Native readonly, also exposed as `aria-readonly`. */
7
+ /** The native `readonly` attribute. The component also sets `aria-readonly`. */
8
8
  readonly?: boolean | null;
9
- /** Marks the value as invalid: maps to `aria-invalid` and `data-invalid`. */
9
+ /** Marks the value as not valid. The component sets `aria-invalid` and `data-invalid`. */
10
10
  invalid?: boolean;
11
- /** Native required, also exposed as `aria-required`. */
11
+ /** The native `required` attribute. The component also sets `aria-required`. */
12
12
  required?: boolean | null;
13
- /** Current value. Bindable. */
13
+ /** The value. You can bind it. */
14
14
  value?: HTMLInputAttributes['value'];
15
- /** Bindable reference to the rendered input element. */
15
+ /** A bindable reference to the input element. */
16
16
  element?: HTMLInputElement | null;
17
17
  };
18
18
  declare const Input: import("svelte").Component<InputProps, {}, "value" | "element">;
@@ -19,23 +19,16 @@ In `selectionMode="multiple"`, Shift selects a range and Ctrl/Cmd adds a single
19
19
  - **Shift+click** selects everything between the anchor and the clicked option. The anchor is
20
20
  the last option selected without modifiers.
21
21
  - **Shift+Arrow**, **Shift+Home** and **Shift+End** extend the same range with the keyboard.
22
- - A range **replaces** the selection rather than adding to it, following the APG multi-select
23
- listbox pattern — that is what lets a range shrink again when you drag it back toward the
24
- anchor.
22
+ - A range replaces the selection, and does not add to it. This is the APG pattern for a listbox with more than one selection. It is also what lets a range become smaller when the user drags back toward the anchor.
25
23
  - **Ctrl/Cmd+click** toggles one option even under `selectionBehavior="replace"`, where a
26
24
  plain click would clear the rest.
27
25
  - Disabled options are never included.
28
26
 
29
- The range is measured over the options that exist in the DOM. In a **virtualized** list that is
30
- only the rendered window, so pass `getItemKey` alongside `virtualizer` and the range is measured
31
- over the whole collection instead — a range then spans rows that were never rendered, and the
32
- anchor survives being scrolled away.
27
+ The range is measured over the options that exist in the DOM. In a virtualized list, those are only the rows near the viewport. Give `getItemKey` with `virtualizer`, and the component measures the range over the full collection. A range then includes the rows that are not in the DOM, and the anchor stays correct when the user scrolls it away.
33
28
 
34
29
  ## Virtualized lists and assistive technology
35
30
 
36
- A virtualized list holds a handful of options, so the position and count a browser computes from
37
- the DOM describe the window rather than the collection — a screen reader would announce "1 of 8"
38
- for a list of two thousand. `ListBox` writes `aria-setsize` and `aria-posinset` onto the rendered
31
+ A virtualized list holds few options. Thus the position and the count that a browser calculates from the DOM describe that window, and not the collection. For a list of two thousand items, a screen reader would announce "1 of 8". `ListBox` writes `aria-setsize` and `aria-posinset` onto the rendered
39
32
  rows with the real numbers.
40
33
 
41
34
  ## Anatomy
@@ -22,37 +22,46 @@
22
22
  * Props for the ListBox.Item component.
23
23
  */
24
24
  type ListBoxItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'children'> & {
25
- /** Unique identifier for this item. Used for selection tracking. */
25
+ /** The unique identifier of this item. The component uses it for the selection. */
26
26
  id: string | number;
27
- /** Text value for typeahead search. If not provided, extracted from content. */
27
+ /** The text for the typeahead. If you give none, the component reads it from the content. */
28
28
  textValue?: string;
29
- /** Whether this item is disabled and non-selectable. */
29
+ /** Disables this item. The user cannot select it. */
30
30
  disabled?: boolean;
31
- /** CSS class to apply to the item element. */
31
+ /** The CSS class names of the item element. */
32
32
  class?: string;
33
- /** Content to render inside the item. */
33
+ /** The content of the item. */
34
34
  children?: Snippet;
35
35
 
36
36
  // Override props for composition (e.g., ComboBox.Item wrapping ListBox.Item)
37
- /** Override the generated ID. Useful for components with custom ID requirements. */
37
+ /** Replaces the id that the component makes. Use it when your component needs its own id. */
38
38
  customId?: string;
39
- /** Disable real DOM focus handling. When true, no tabindex is set and focus events are skipped. */
39
+ /**
40
+ * Stops the DOM focus control. With `true`, the component sets no tabindex and it ignores the
41
+ * focus events.
42
+ */
40
43
  disableFocusHandling?: boolean;
41
- /** Override the focused state. When provided, this value is used instead of internal focus tracking. */
44
+ /** Replaces the focused state. With this prop, the component uses your value and not its own. */
42
45
  isFocusedOverride?: boolean;
43
- /** Override the focus-visible presentation state. */
46
+ /** Replaces the focus-visible state. */
44
47
  isFocusVisibleOverride?: boolean;
45
- /** Override the select behavior. When provided, called instead of default listbox selection. */
48
+ /**
49
+ * Replaces the selection behavior. With this prop, the component calls it and does not do its
50
+ * own selection.
51
+ */
46
52
  onItemSelect?: (id: string | number, label: string) => void;
47
- /** Callback with resolved text value when mounted (from prop or rendered content). */
53
+ /**
54
+ * The component calls it with the text value when the item goes into the DOM. That text comes
55
+ * from the prop or from the content.
56
+ */
48
57
  onResolvedTextValue?: (label: string) => void;
49
- /** Callback when pointer hover should move logical focus to this item. */
58
+ /** The component calls it when the pointer must move the logical focus to this item. */
50
59
  onItemHoverStart?: (id: string | number, label: string) => void;
51
- /** Whether to scroll this item into view when focused. Useful for virtual focus patterns. */
60
+ /** Scrolls this item into the viewport when it gets the focus. Use it with a virtual focus. */
52
61
  scrollOnFocus?: boolean;
53
- /** Additional disabled state from parent. */
62
+ /** A second disabled state, from the parent. */
54
63
  isParentDisabled?: boolean;
55
- /** Override the visual pressed state. When provided, this value is used instead of internal press tracking. */
64
+ /** Replaces the pressed state. With this prop, the component uses your value and not its own. */
56
65
  pressed?: boolean;
57
66
  };
58
67
 
@@ -4,35 +4,44 @@ import type { HTMLAttributes } from 'svelte/elements';
4
4
  * Props for the ListBox.Item component.
5
5
  */
6
6
  type ListBoxItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'children'> & {
7
- /** Unique identifier for this item. Used for selection tracking. */
7
+ /** The unique identifier of this item. The component uses it for the selection. */
8
8
  id: string | number;
9
- /** Text value for typeahead search. If not provided, extracted from content. */
9
+ /** The text for the typeahead. If you give none, the component reads it from the content. */
10
10
  textValue?: string;
11
- /** Whether this item is disabled and non-selectable. */
11
+ /** Disables this item. The user cannot select it. */
12
12
  disabled?: boolean;
13
- /** CSS class to apply to the item element. */
13
+ /** The CSS class names of the item element. */
14
14
  class?: string;
15
- /** Content to render inside the item. */
15
+ /** The content of the item. */
16
16
  children?: Snippet;
17
- /** Override the generated ID. Useful for components with custom ID requirements. */
17
+ /** Replaces the id that the component makes. Use it when your component needs its own id. */
18
18
  customId?: string;
19
- /** Disable real DOM focus handling. When true, no tabindex is set and focus events are skipped. */
19
+ /**
20
+ * Stops the DOM focus control. With `true`, the component sets no tabindex and it ignores the
21
+ * focus events.
22
+ */
20
23
  disableFocusHandling?: boolean;
21
- /** Override the focused state. When provided, this value is used instead of internal focus tracking. */
24
+ /** Replaces the focused state. With this prop, the component uses your value and not its own. */
22
25
  isFocusedOverride?: boolean;
23
- /** Override the focus-visible presentation state. */
26
+ /** Replaces the focus-visible state. */
24
27
  isFocusVisibleOverride?: boolean;
25
- /** Override the select behavior. When provided, called instead of default listbox selection. */
28
+ /**
29
+ * Replaces the selection behavior. With this prop, the component calls it and does not do its
30
+ * own selection.
31
+ */
26
32
  onItemSelect?: (id: string | number, label: string) => void;
27
- /** Callback with resolved text value when mounted (from prop or rendered content). */
33
+ /**
34
+ * The component calls it with the text value when the item goes into the DOM. That text comes
35
+ * from the prop or from the content.
36
+ */
28
37
  onResolvedTextValue?: (label: string) => void;
29
- /** Callback when pointer hover should move logical focus to this item. */
38
+ /** The component calls it when the pointer must move the logical focus to this item. */
30
39
  onItemHoverStart?: (id: string | number, label: string) => void;
31
- /** Whether to scroll this item into view when focused. Useful for virtual focus patterns. */
40
+ /** Scrolls this item into the viewport when it gets the focus. Use it with a virtual focus. */
32
41
  scrollOnFocus?: boolean;
33
- /** Additional disabled state from parent. */
42
+ /** A second disabled state, from the parent. */
34
43
  isParentDisabled?: boolean;
35
- /** Override the visual pressed state. When provided, this value is used instead of internal press tracking. */
44
+ /** Replaces the pressed state. With this prop, the component uses your value and not its own. */
36
45
  pressed?: boolean;
37
46
  };
38
47
  declare const ListboxItem: import("svelte").Component<ListBoxItemProps, {}, "">;
@@ -17,7 +17,7 @@ Description: Main listbox state container that manages registration, selection,
17
17
  | `value` | `Iterable<string \| number>` | `undefined` | Controlled selection values. |
18
18
  | `defaultValue` | `Iterable<string \| number>` | `undefined` | Initial uncontrolled selection values. |
19
19
  | `children` | `Snippet \| Snippet<[T]>` | `undefined` | Static or dynamic option rendering. |
20
- | `class` | `string` | `''` | CSS class names for the root element. |
20
+ | `class` | `string` | `''` | The CSS class names of the root element. |
21
21
  | `id` | `string` | `undefined` | DOM id for the listbox element. |
22
22
  | `aria-label` | `string` | `undefined` | Accessible label for the listbox. |
23
23
  | `onChange` | `(value: Set<string \| number>) => void` | `undefined` | Called when selection changes. |
@@ -125,7 +125,7 @@ export type CreateListBoxContextOptions = {
125
125
  loop?: boolean;
126
126
  /** Whether typing characters moves focus to a matching item. Default false. */
127
127
  typeahead?: boolean;
128
- /** Initial selection for uncontrolled mode. */
128
+ /** The selection at the start, for when the component controls the state. */
129
129
  initialSelection?: Set<string | number>;
130
130
  /** Callback fired when selection changes. */
131
131
  onSelectionChange?: (selection: Set<string | number>) => void;
@@ -11,75 +11,87 @@
11
11
  * @template T - The type of items when using dynamic rendering with the `items` prop.
12
12
  */
13
13
  type ListBoxProps = {
14
- /** How selection behaves: 'toggle' allows deselection, 'replace' always selects. */
14
+ /**
15
+ * The behavior of the selection: 'toggle' lets the user remove a selection, and 'replace' always
16
+ * selects.
17
+ */
15
18
  selectionBehavior?: 'toggle' | 'replace';
16
- /** Content shown when the list is empty. Can be a string or a Snippet. */
19
+ /** The content while the list is empty. It can be a string or a Snippet. */
17
20
  emptyPlaceholder?: string | Snippet;
18
- /** Iterable of items for dynamic rendering. Used with a snippet that receives each item. */
21
+ /**
22
+ * The items, for a list that the component makes from an array. Use it with a snippet that
23
+ * receives one item.
24
+ */
19
25
  items?: Iterable<T>;
20
26
  /**
21
- * Reads an item's key — the same value passed as `ListBox.Item`'s `id`.
27
+ * Reads the key of an item. This is the same value as the `id` of `ListBox.Item`.
22
28
  *
23
- * Only needed together with `virtualizer`: a Shift range is otherwise measured over
24
- * the options in the DOM, which for a virtualized list is just the rendered window,
25
- * so the range stops wherever the user happened to have scrolled.
29
+ * You need it only with `virtualizer`. Without it, a Shift range is measured over the options in
30
+ * the DOM. In a virtualized list, those are only the rows near the viewport, thus the range
31
+ * stops at the scroll position of the user.
26
32
  */
27
33
  getItemKey?: (item: T) => string | number;
28
- /** Keys of items that should be disabled and non-selectable. */
34
+ /** The keys of the items that must be disabled. The user cannot select them. */
29
35
  disabledKeys?: Iterable<string | number>;
30
- /** Selection mode: 'single' allows one selection, 'multiple' allows many. */
36
+ /** The selection mode: 'single' permits one selection, and 'multiple' permits more than one. */
31
37
  selectionMode?: 'single' | 'multiple';
32
- /** Selected keys. Two-way by default — use `bind:value`. */
38
+ /** The selected keys. By default it goes in the two directions: use `bind:value`. */
33
39
  value?: Iterable<string | number>;
34
- /** Initial selection, for when `value` is not supplied. */
40
+ /** The selection at the start, for when you give no `value`. */
35
41
  defaultValue?: Iterable<string | number>;
36
42
  /**
37
- * Opt into fully controlled state: the component stops writing back to `value` and
38
- * only reports through `onChange`, so the parent can reject a change by not flowing
39
- * the new selection back down. Off by default, because `bind:value` — the common
40
- * case — needs the write-back to work at all.
43
+ * Give your own code full control of the selection. The component stops to write back to
44
+ * `value`, and it reports only through `onChange`. Thus the parent can refuse a change: the
45
+ * parent does not send the new selection down. The default is off, because `bind:value` is the
46
+ * usual case and it needs the write-back.
41
47
  */
42
48
  controlledValue?: boolean;
43
- /** Content of the listbox. Can be static children or a snippet receiving items. */
49
+ /** The content of the listbox. It can be static children, or a snippet that receives one item. */
44
50
  children?: Snippet | Snippet<[T]>;
45
51
  /**
46
- * Rows rendered inside the listbox above the items — an action row such as
47
- * "Create …". Kept out of `children` because in dynamic mode that snippet is called
48
- * once per item.
52
+ * The rows in the listbox above the items, for example an action row such as "Create …". They
53
+ * are not in `children`, because from an array of items the component calls that snippet one
54
+ * time for each item.
49
55
  *
50
- * A virtualized list does not navigate into it: navigation there walks the item
51
- * array, which this is not part of.
56
+ * In a virtualized list, the keyboard does not go into these rows. There, the keys move through
57
+ * the array of the items, and these rows are not in it.
52
58
  */
53
59
  header?: Snippet;
54
- /** CSS class to apply to the listbox container. */
60
+ /** The CSS class names of the listbox container. */
55
61
  class?: string;
56
- /** HTML id attribute for the listbox element. */
62
+ /** The id of the listbox element. */
57
63
  id?: string;
58
- /** Accessible label for the listbox. Announced by screen readers. */
64
+ /** The accessible name of the listbox. A screen reader announces it. */
59
65
  'aria-label'?: string;
60
- /** Id of a visible element that labels the listbox. Use instead of `aria-label`
61
- * when the list already has a heading on screen. */
66
+ /**
67
+ * The id of an element that the user sees, and that gives the listbox its name. Use it in place
68
+ * of `aria-label` when the list already has a heading.
69
+ */
62
70
  'aria-labelledby'?: string;
63
- /** Callback fired when the selection changes. */
71
+ /** The component calls it when the selection changes. */
64
72
  onChange?: (value: Set<string | number>) => void;
65
- /** Disable DOM focus handling on the root container for virtual-focus compositions. */
73
+ /** Stops the DOM focus control on the root container, for a composition with a virtual focus. */
66
74
  disableFocusHandling?: boolean;
67
- /** Whether arrow-key navigation wraps from the last item to the first (and back). */
75
+ /**
76
+ * At the last item, the arrow keys move the focus to the first item, and at the first item, to
77
+ * the last one.
78
+ */
68
79
  loop?: boolean;
69
- /** Whether typing characters moves focus to the option whose text matches. */
80
+ /** When the user types a character, the focus moves to the option whose text agrees with it. */
70
81
  typeahead?: boolean;
71
82
  /**
72
- * Renders only the rows near the viewport instead of all of them.
83
+ * Makes only the rows near the viewport, and not all of the rows.
73
84
  *
74
- * Only honoured together with `items`: the listbox has to own the loop to be able to
75
- * slice it, so a list written as static children is never virtualized.
85
+ * The component obeys it only with `items`. The listbox must control the loop to cut it, thus a
86
+ * list written as static children is never virtualized.
76
87
  *
77
- * Rows must all be the same height — that assumption is what lets the scrollbar be
78
- * sized without measuring every row. The height is measured from the first rendered
79
- * row unless `rowHeight` says otherwise, so a themed list needs no magic number.
88
+ * All of the rows must have the same height. This is what lets the component calculate the
89
+ * scrollbar without a measurement of each row. The component measures the height from the first
90
+ * row, but `rowHeight` replaces that measurement. Thus a list with your own styles needs no
91
+ * fixed number.
80
92
  *
81
- * The listbox element itself is the scroller: give it a max height and
82
- * `overflow-y: auto`, as an unvirtualized long list would need anyway.
93
+ * The listbox element is the element that scrolls. Give it a maximum height and `overflow-y:
94
+ * auto`. A long list without a virtualizer needs the same.
83
95
  */
84
96
  virtualizer?: { rowHeight?: number; overscan?: number };
85
97
  } & Omit<
@@ -3,75 +3,87 @@ import type { HTMLAttributes } from 'svelte/elements';
3
3
  import { type ListBoxContext } from './context';
4
4
  declare function $$render<T extends object = object>(): {
5
5
  props: {
6
- /** How selection behaves: 'toggle' allows deselection, 'replace' always selects. */
6
+ /**
7
+ * The behavior of the selection: 'toggle' lets the user remove a selection, and 'replace' always
8
+ * selects.
9
+ */
7
10
  selectionBehavior?: "toggle" | "replace";
8
- /** Content shown when the list is empty. Can be a string or a Snippet. */
11
+ /** The content while the list is empty. It can be a string or a Snippet. */
9
12
  emptyPlaceholder?: string | Snippet;
10
- /** Iterable of items for dynamic rendering. Used with a snippet that receives each item. */
13
+ /**
14
+ * The items, for a list that the component makes from an array. Use it with a snippet that
15
+ * receives one item.
16
+ */
11
17
  items?: Iterable<T>;
12
18
  /**
13
- * Reads an item's key — the same value passed as `ListBox.Item`'s `id`.
19
+ * Reads the key of an item. This is the same value as the `id` of `ListBox.Item`.
14
20
  *
15
- * Only needed together with `virtualizer`: a Shift range is otherwise measured over
16
- * the options in the DOM, which for a virtualized list is just the rendered window,
17
- * so the range stops wherever the user happened to have scrolled.
21
+ * You need it only with `virtualizer`. Without it, a Shift range is measured over the options in
22
+ * the DOM. In a virtualized list, those are only the rows near the viewport, thus the range
23
+ * stops at the scroll position of the user.
18
24
  */
19
25
  getItemKey?: (item: T) => string | number;
20
- /** Keys of items that should be disabled and non-selectable. */
26
+ /** The keys of the items that must be disabled. The user cannot select them. */
21
27
  disabledKeys?: Iterable<string | number>;
22
- /** Selection mode: 'single' allows one selection, 'multiple' allows many. */
28
+ /** The selection mode: 'single' permits one selection, and 'multiple' permits more than one. */
23
29
  selectionMode?: "single" | "multiple";
24
- /** Selected keys. Two-way by default — use `bind:value`. */
30
+ /** The selected keys. By default it goes in the two directions: use `bind:value`. */
25
31
  value?: Iterable<string | number>;
26
- /** Initial selection, for when `value` is not supplied. */
32
+ /** The selection at the start, for when you give no `value`. */
27
33
  defaultValue?: Iterable<string | number>;
28
34
  /**
29
- * Opt into fully controlled state: the component stops writing back to `value` and
30
- * only reports through `onChange`, so the parent can reject a change by not flowing
31
- * the new selection back down. Off by default, because `bind:value` — the common
32
- * case — needs the write-back to work at all.
35
+ * Give your own code full control of the selection. The component stops to write back to
36
+ * `value`, and it reports only through `onChange`. Thus the parent can refuse a change: the
37
+ * parent does not send the new selection down. The default is off, because `bind:value` is the
38
+ * usual case and it needs the write-back.
33
39
  */
34
40
  controlledValue?: boolean;
35
- /** Content of the listbox. Can be static children or a snippet receiving items. */
41
+ /** The content of the listbox. It can be static children, or a snippet that receives one item. */
36
42
  children?: Snippet | Snippet<[T]>;
37
43
  /**
38
- * Rows rendered inside the listbox above the items — an action row such as
39
- * "Create …". Kept out of `children` because in dynamic mode that snippet is called
40
- * once per item.
44
+ * The rows in the listbox above the items, for example an action row such as "Create …". They
45
+ * are not in `children`, because from an array of items the component calls that snippet one
46
+ * time for each item.
41
47
  *
42
- * A virtualized list does not navigate into it: navigation there walks the item
43
- * array, which this is not part of.
48
+ * In a virtualized list, the keyboard does not go into these rows. There, the keys move through
49
+ * the array of the items, and these rows are not in it.
44
50
  */
45
51
  header?: Snippet;
46
- /** CSS class to apply to the listbox container. */
52
+ /** The CSS class names of the listbox container. */
47
53
  class?: string;
48
- /** HTML id attribute for the listbox element. */
54
+ /** The id of the listbox element. */
49
55
  id?: string;
50
- /** Accessible label for the listbox. Announced by screen readers. */
56
+ /** The accessible name of the listbox. A screen reader announces it. */
51
57
  'aria-label'?: string;
52
- /** Id of a visible element that labels the listbox. Use instead of `aria-label`
53
- * when the list already has a heading on screen. */
58
+ /**
59
+ * The id of an element that the user sees, and that gives the listbox its name. Use it in place
60
+ * of `aria-label` when the list already has a heading.
61
+ */
54
62
  'aria-labelledby'?: string;
55
- /** Callback fired when the selection changes. */
63
+ /** The component calls it when the selection changes. */
56
64
  onChange?: (value: Set<string | number>) => void;
57
- /** Disable DOM focus handling on the root container for virtual-focus compositions. */
65
+ /** Stops the DOM focus control on the root container, for a composition with a virtual focus. */
58
66
  disableFocusHandling?: boolean;
59
- /** Whether arrow-key navigation wraps from the last item to the first (and back). */
67
+ /**
68
+ * At the last item, the arrow keys move the focus to the first item, and at the first item, to
69
+ * the last one.
70
+ */
60
71
  loop?: boolean;
61
- /** Whether typing characters moves focus to the option whose text matches. */
72
+ /** When the user types a character, the focus moves to the option whose text agrees with it. */
62
73
  typeahead?: boolean;
63
74
  /**
64
- * Renders only the rows near the viewport instead of all of them.
75
+ * Makes only the rows near the viewport, and not all of the rows.
65
76
  *
66
- * Only honoured together with `items`: the listbox has to own the loop to be able to
67
- * slice it, so a list written as static children is never virtualized.
77
+ * The component obeys it only with `items`. The listbox must control the loop to cut it, thus a
78
+ * list written as static children is never virtualized.
68
79
  *
69
- * Rows must all be the same height — that assumption is what lets the scrollbar be
70
- * sized without measuring every row. The height is measured from the first rendered
71
- * row unless `rowHeight` says otherwise, so a themed list needs no magic number.
80
+ * All of the rows must have the same height. This is what lets the component calculate the
81
+ * scrollbar without a measurement of each row. The component measures the height from the first
82
+ * row, but `rowHeight` replaces that measurement. Thus a list with your own styles needs no
83
+ * fixed number.
72
84
  *
73
- * The listbox element itself is the scroller: give it a max height and
74
- * `overflow-y: auto`, as an unvirtualized long list would need anyway.
85
+ * The listbox element is the element that scrolls. Give it a maximum height and `overflow-y:
86
+ * auto`. A long list without a virtualizer needs the same.
75
87
  */
76
88
  virtualizer?: {
77
89
  rowHeight?: number;
@@ -30,12 +30,7 @@ renders no markup of its own.
30
30
 
31
31
  ## SSR and hydration
32
32
 
33
- In server-rendered apps an explicit `locale` is effectively **required**. Without it, the
34
- server formats with the Node process locale while the client formats with the visitor's
35
- `navigator.language`; when they differ, the server HTML and the first client render
36
- disagree — date segment order (`dd/MM` vs `MM/dd`), hour cycle (12h vs 24h) and number
37
- formats (decimal/group separators) all shift — which produces hydration mismatches and
38
- visible content flicker.
33
+ In server-rendered apps an explicit `locale` is effectively **required**. Without it, the server uses the locale of the Node process and the client uses `navigator.language`. When the two are different, the HTML of the server and the first render of the client do not agree. The sequence of the date segments changes (`dd/MM` or `MM/dd`), and so do the hour cycle (12h or 24h) and the number format. The result is a hydration error and a flash of different content.
39
34
 
40
35
  Resolve the locale on the server (typically from the `Accept-Language` request header, or
41
36
  the user's saved preference) and pass it explicitly so both passes agree: