@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
@@ -10,7 +10,7 @@ Description: Container that renders selected values as tags in multiple mode.
10
10
  | Prop | Type | Default | Description |
11
11
  | ---------- | ------------------------------ | ---------- | --------------------------------------------------------------------------------- |
12
12
  | `children` | `Snippet<[{ item: TagItem }]>` | `required` | Render function that receives each selected item as `{ item: { value, label } }`. |
13
- | `class` | `string` | `''` | CSS class names for the tags container. |
13
+ | `class` | `string` | `''` | The CSS class names of the tags container. |
14
14
 
15
15
  ### TagItem type
16
16
 
@@ -22,25 +22,25 @@
22
22
  * component only adapts it to the combobox (selection -> items, per-tag context).
23
23
  */
24
24
  type ComboBoxTagsProps = {
25
- /** Snippet to render each tag. Receives { item: { value, label } } */
25
+ /** The snippet that makes each tag. It receives { item: { value, label } }. */
26
26
  children: Snippet<[{ item: TagItem }]>;
27
27
  /**
28
- * Optional overflow indicator. When provided, the tag row is constrained to
29
- * a single line: tags that don't fit are not rendered, and this snippet
30
- * renders at the end with how many are hidden (plus `visible`/`total`, so the
31
- * consumer can e.g. show a summary when nothing fits). Expected to render a
32
- * single element. Without `overflow`, every tag renders and wrapping is left
33
- * to the consumer's styles (the previous behaviour).
28
+ * An optional indicator for the tags that do not fit. With it, the tag row stays on one line.
29
+ * The component makes no tag that does not fit, and it puts this snippet at the end with the
30
+ * number of the hidden tags. The snippet also receives `visible` and `total`, thus you can show
31
+ * a summary when no tag fits. Make one element in it.
32
+ *
33
+ * Without `overflow`, the component makes each tag, and your styles decide how the row wraps.
34
34
  */
35
35
  overflow?: Snippet<[TagsOverflow]>;
36
36
  /**
37
- * Horizontal space (px) to keep free inside the parent for siblings such as
38
- * the search input, so the overflow calc doesn't claim the whole row. Only
39
- * used in overflow mode.
37
+ * The horizontal space to keep free in the parent, in px, for an element beside the tags such as
38
+ * the search input. Thus the calculation does not take the full row. The component uses it only
39
+ * with `overflow`.
40
40
  */
41
41
  reserve?: number;
42
42
  class?: string;
43
- /** Accessible name of the tag row. Defaults to `Selected values`. */
43
+ /** The accessible name of the tag row. The default is `Selected values`. */
44
44
  'aria-label'?: string;
45
45
  };
46
46
 
@@ -14,27 +14,27 @@ export type TagsOverflow = OverflowRowState;
14
14
  * component only adapts it to the combobox (selection -> items, per-tag context).
15
15
  */
16
16
  type ComboBoxTagsProps = {
17
- /** Snippet to render each tag. Receives { item: { value, label } } */
17
+ /** The snippet that makes each tag. It receives { item: { value, label } }. */
18
18
  children: Snippet<[{
19
19
  item: TagItem;
20
20
  }]>;
21
21
  /**
22
- * Optional overflow indicator. When provided, the tag row is constrained to
23
- * a single line: tags that don't fit are not rendered, and this snippet
24
- * renders at the end with how many are hidden (plus `visible`/`total`, so the
25
- * consumer can e.g. show a summary when nothing fits). Expected to render a
26
- * single element. Without `overflow`, every tag renders and wrapping is left
27
- * to the consumer's styles (the previous behaviour).
22
+ * An optional indicator for the tags that do not fit. With it, the tag row stays on one line.
23
+ * The component makes no tag that does not fit, and it puts this snippet at the end with the
24
+ * number of the hidden tags. The snippet also receives `visible` and `total`, thus you can show
25
+ * a summary when no tag fits. Make one element in it.
26
+ *
27
+ * Without `overflow`, the component makes each tag, and your styles decide how the row wraps.
28
28
  */
29
29
  overflow?: Snippet<[TagsOverflow]>;
30
30
  /**
31
- * Horizontal space (px) to keep free inside the parent for siblings such as
32
- * the search input, so the overflow calc doesn't claim the whole row. Only
33
- * used in overflow mode.
31
+ * The horizontal space to keep free in the parent, in px, for an element beside the tags such as
32
+ * the search input. Thus the calculation does not take the full row. The component uses it only
33
+ * with `overflow`.
34
34
  */
35
35
  reserve?: number;
36
36
  class?: string;
37
- /** Accessible name of the tag row. Defaults to `Selected values`. */
37
+ /** The accessible name of the tag row. The default is `Selected values`. */
38
38
  'aria-label'?: string;
39
39
  };
40
40
  declare const ComboboxTags: import("svelte").Component<ComboBoxTagsProps, {}, "">;
@@ -7,17 +7,17 @@
7
7
  Name: `ComboBox.Trigger`
8
8
  Description: Optional trigger button that toggles the combobox popover without stealing focus from the input.
9
9
 
10
- | Prop | Type | Default | Description |
11
- | -------------- | ---------------------- | ----------- | --------------------------------------------------------------- |
12
- | `class` | `string` | `undefined` | CSS class names for the trigger element. |
13
- | `children` | `Snippet` | `undefined` | Custom trigger content. If omitted, a chevron icon is rendered. |
14
- | `tabindex` | `number` | `-1` | Tab index applied to the trigger button. |
15
- | `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes. |
10
+ | Prop | Type | Default | Description |
11
+ | -------------- | ---------------------- | ----------- | --------------------------------------------------------------------------------------- |
12
+ | `class` | `string` | `undefined` | The CSS class names of the trigger element. |
13
+ | `children` | `Snippet` | `undefined` | Your own content for the trigger. If you give none, the component makes a chevron icon. |
14
+ | `tabindex` | `number` | `-1` | Tab index applied to the trigger button. |
15
+ | `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes. |
16
16
 
17
17
  ## Notes
18
18
 
19
19
  - `ComboBox.Trigger` reflects the root pending state through `data-pending`.
20
20
  - While the combobox is disabled, read-only, or pending, the trigger becomes non-interactive.
21
- - The trigger toggles on `click`, so keyboard activation (Enter/Space) works when the trigger is focusable (e.g. `tabindex={0}`). The pointer press itself is prevented so it never steals DOM focus from the input.
21
+ - The trigger obeys the `click` event. Thus the `Enter` key and the `Space` key work when the trigger can take the focus, for example with `tabindex={0}`. The component stops the pointer press, thus the trigger never takes the DOM focus from the input.
22
22
  - `aria-controls` is only exposed while the popover is open, because the listbox does not exist in the DOM while closed.
23
23
  - `ComboBox.Button` remains available as a compatibility alias.
@@ -86,9 +86,9 @@
86
86
 
87
87
  ## UX Decisions
88
88
 
89
- - **No Date Auto-Correction:** When users manually type dates out of the configured bounds (`minValue`/`maxValue`) or dates that are unavailable, the DatePicker **does not auto-correct** the typed value, and does not snap it back. It exposes `aria-invalid="true"` and `data-invalid` on the input, so the user sees what they typed and that it is refused. Auto-correcting input without explicit user consent is an inaccessible anti-pattern.
90
- - **A Rejected Date Is Still Committed:** the typed date is published through `onChange`/`value` even when the bounds refuse it. Publishing `null` instead would leave the input showing a date the consumer reads as an empty field — which is how a form ends up printing "required" underneath a filled-in control. Rejection travels as an invalid state, not as absence, so the layer that owns the rule (a form schema, usually) is the one that phrases the error. Typing bypasses the bounds this way; the Calendar does not — a disabled day is never selectable by pointer or keyboard.
91
- - **Navigable Disabled Dates:** When using the Calendar, disabled dates remain focusable via keyboard navigation. This ensures ARIA Grid spatial navigation parity so that screen readers can consistently announce all calendar cells and report them as "disabled", rather than skipping over them and disorienting the user.
89
+ - **No Date Auto-Correction:** The user can type a date out of the limits of `minValue` and `maxValue`, or an unavailable date. The DatePicker does not correct that date, and it does not remove it. It exposes `aria-invalid="true"` and `data-invalid` on the input, so the user sees what they typed and that it is refused. Auto-correcting input without explicit user consent is an inaccessible anti-pattern.
90
+ - A refused date is still a value: the component sends the date through `onChange` and `value`, also when the limits refuse it. With `null`, the input would show a date and your code would read an empty field. That is how a form prints "required" below a control that has a value. A refusal travels as an invalid state, and not as an absent value. Thus the layer with the rule, usually a form schema, writes the error text. Typing bypasses the bounds this way; the Calendar does not — a disabled day is never selectable by pointer or keyboard.
91
+ - Disabled dates keep the focus: in the Calendar, the keyboard still goes to a disabled date. Thus the ARIA grid navigation stays complete. A screen reader announces each cell and says "disabled". Without this, the focus would go past those cells and confuse the user.
92
92
 
93
93
  ## Focus behavior decisions
94
94
 
@@ -97,5 +97,5 @@
97
97
  - Trigger focus restore after calendar close is modality-aware:
98
98
  - keyboard close paths keep visible focus,
99
99
  - pointer outside close restores focus without visible focus.
100
- - The component keeps explicit `trackInteractionModality(...)` calls in local handlers to ensure deterministic modality updates before local focus-state logic runs.
100
+ - The component calls `trackInteractionModality(...)` in its own handlers. Thus the modality is correct before the focus-state code runs.
101
101
  - Cross-component focus contract and invariants are documented in `FOCUS_STATE_CONTRACT.md`.
@@ -24,10 +24,9 @@
24
24
  > & {
25
25
  id?: string;
26
26
  /**
27
- * Name of the hidden proxy input used for form submission. The proxy only
28
- * mirrors the committed value: autofill is NOT supported (it renders with
29
- * `autocomplete="off"` so browsers and password managers do not write
30
- * into it) — dates are entered through the editable segments.
27
+ * The name of the hidden input for the form submission. That input only holds the value. It does
28
+ * not accept an autofill: it has `autocomplete="off"`, thus a browser and a password manager do
29
+ * not write in it. The user types the date in the segments.
31
30
  */
32
31
  name?: string;
33
32
  children?: Snippet<[DatePickerSegmentPart]>;
@@ -4,10 +4,9 @@ import { type DatePickerSegmentPart } from '../root/context';
4
4
  type DatePickerInputProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'id' | 'role' | 'tabindex' | 'onmousedown' | 'onfocus' | 'onblur' | 'onfocusout' | 'onkeydown' | 'aria-invalid'> & {
5
5
  id?: string;
6
6
  /**
7
- * Name of the hidden proxy input used for form submission. The proxy only
8
- * mirrors the committed value: autofill is NOT supported (it renders with
9
- * `autocomplete="off"` so browsers and password managers do not write
10
- * into it) — dates are entered through the editable segments.
7
+ * The name of the hidden input for the form submission. That input only holds the value. It does
8
+ * not accept an autofill: it has `autocomplete="off"`, thus a browser and a password manager do
9
+ * not write in it. The user types the date in the segments.
11
10
  */
12
11
  name?: string;
13
12
  children?: Snippet<[DatePickerSegmentPart]>;
@@ -78,7 +78,7 @@
78
78
  isDateUnavailable,
79
79
  open = $bindable(),
80
80
  defaultOpen = false,
81
- /** Opt into fully controlled open state. See `controlledValue`. */
81
+ /** Give your own code full control of the open state. Read `controlledValue`. */
82
82
  controlledOpen = false,
83
83
  onOpenChange,
84
84
  closeOnSelect = true,
@@ -10,5 +10,5 @@ Description: Button part that toggles `DatePicker.Popover` and anchors positioni
10
10
  | Prop | Type | Default | Description |
11
11
  | -------------- | ---------------------- | ----------- | ------------------------------------------------------ |
12
12
  | `children` | `Snippet` | `undefined` | Optional trigger content. |
13
- | `class` | `string` | `''` | CSS class names for the trigger button. |
13
+ | `class` | `string` | `''` | The CSS class names of the trigger button. |
14
14
  | `...restProps` | `HTMLButtonAttributes` | `-` | Additional button attributes forwarded to the trigger. |
@@ -53,7 +53,7 @@
53
53
 
54
54
  ## Usage guidelines
55
55
 
56
- - Use `value` / `onChange` for controlled state and `defaultValue` for uncontrolled state; the value is a `{ start, end }` pair and the empty state is `null` (null-first empty contract, matching `DatePicker`).
56
+ - Use `value` and `onChange` when your own code controls the state. Use `defaultValue` when the component controls it. The value is a `{ start, end }` pair, and the empty state is `null`. `DatePicker` uses the same contract.
57
57
  - Always render one input with `part="start"` and one with `part="end"`, and pass the same `part` to their segments.
58
58
  - Use `open` / `defaultOpen` / `onOpenChange` to control the popover, and `closeOnSelect` to keep it open after the range is confirmed.
59
59
  - Use `minValue` / `maxValue` (`YYYY-MM-DD`) to constrain both the calendar and the typed inputs, and `isDateUnavailable` to mark specific days as non-selectable.
@@ -65,8 +65,8 @@
65
65
 
66
66
  - Give each input its own accessible name (for example `aria-label="Start date"` and `aria-label="End date"`).
67
67
  - Segment accessible names are resolved automatically from the active locale.
68
- - Validity is per part: when an input's own segment draft is invalid (empty drafts are never invalid), its segments expose `aria-invalid` (so assistive technology announces it on the spinbuttons) and the input group exposes `data-invalid` for styling; invalid input is shown, never auto-corrected (see UX decisions in the DatePicker README — the same contract applies).
69
- - Disabled calendar dates remain focusable via keyboard navigation so screen readers can discover and announce them as disabled.
68
+ - Each input has its own validity. The text in the segments of one input can be an invalid date. Those segments then get `aria-invalid`, and assistive technology announces it on the spinbuttons. The input group gets `data-invalid`, for the styles. Empty text is never invalid. The component shows the text of the user and never corrects it. The DatePicker README has the same contract.
69
+ - A disabled date in the calendar keeps the focus. Thus a screen reader can find it and announce it as disabled.
70
70
  - In the range calendar, the first selection starts the range, arrow keys extend the preview, and `Enter` or `Space` confirms it.
71
71
 
72
72
  ## Notes
@@ -29,10 +29,9 @@
29
29
  part: DateRangePickerRangePart;
30
30
  id?: string;
31
31
  /**
32
- * Name of the hidden proxy input used for form submission. The proxy only
33
- * mirrors the committed value: autofill is NOT supported (it renders with
34
- * `autocomplete="off"` so browsers and password managers do not write
35
- * into it) — dates are entered through the editable segments.
32
+ * The name of the hidden input for the form submission. That input only holds the value. It does
33
+ * not accept an autofill: it has `autocomplete="off"`, thus a browser and a password manager do
34
+ * not write in it. The user types the date in the segments.
36
35
  */
37
36
  name?: string;
38
37
  children?: Snippet<[DatePickerSegmentPart]>;
@@ -5,10 +5,9 @@ type DateRangePickerInputProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'
5
5
  part: DateRangePickerRangePart;
6
6
  id?: string;
7
7
  /**
8
- * Name of the hidden proxy input used for form submission. The proxy only
9
- * mirrors the committed value: autofill is NOT supported (it renders with
10
- * `autocomplete="off"` so browsers and password managers do not write
11
- * into it) — dates are entered through the editable segments.
8
+ * The name of the hidden input for the form submission. That input only holds the value. It does
9
+ * not accept an autofill: it has `autocomplete="off"`, thus a browser and a password manager do
10
+ * not write in it. The user types the date in the segments.
12
11
  */
13
12
  name?: string;
14
13
  children?: Snippet<[DatePickerSegmentPart]>;
@@ -10,7 +10,7 @@
10
10
  - Use `Dialog.Trigger` as the opener button.
11
11
  - Render modal layers inside `Dialog.Portal`.
12
12
  - Use `Dialog.Overlay` and `Dialog.Content` together for standard modal behavior.
13
- - Use nested `Dialog.Root` instances when you need modal stacks; topmost behavior is handled internally.
13
+ - Use nested `Dialog.Root` parts when you need a stack. The component controls which dialog is on top.
14
14
  - Always give the dialog a `Dialog.Title`. A `role="dialog"` takes its name from `aria-labelledby`, not from the text inside it, so a bare heading leaves the dialog unnamed.
15
15
 
16
16
  ## Anatomy
@@ -11,11 +11,11 @@
11
11
  * but usable at any depth without threading it down.
12
12
  */
13
13
  export type DialogCloseProps = Omit<HTMLButtonAttributes, 'type' | 'class' | 'children'> & {
14
- /** Button label. */
14
+ /** The name on the button. */
15
15
  children?: Snippet;
16
- /** CSS class for the button. */
16
+ /** The CSS class names of the button. */
17
17
  class?: string;
18
- /** Bindable reference to the rendered button. */
18
+ /** A bindable reference to the button element. */
19
19
  element?: HTMLButtonElement | null;
20
20
  };
21
21
 
@@ -7,11 +7,11 @@ import type { HTMLButtonAttributes } from 'svelte/elements';
7
7
  * but usable at any depth without threading it down.
8
8
  */
9
9
  export type DialogCloseProps = Omit<HTMLButtonAttributes, 'type' | 'class' | 'children'> & {
10
- /** Button label. */
10
+ /** The name on the button. */
11
11
  children?: Snippet;
12
- /** CSS class for the button. */
12
+ /** The CSS class names of the button. */
13
13
  class?: string;
14
- /** Bindable reference to the rendered button. */
14
+ /** A bindable reference to the button element. */
15
15
  element?: HTMLButtonElement | null;
16
16
  };
17
17
  declare const DialogClose: import("svelte").Component<DialogCloseProps, {}, "element">;
@@ -23,13 +23,13 @@
23
23
  * Must be used inside a Dialog.Portal.
24
24
  */
25
25
  type DialogContentProps = {
26
- /** Content of the dialog. */
26
+ /** The content of the dialog. */
27
27
  children?: Snippet;
28
- /** CSS class for the dialog container. */
28
+ /** The CSS class names of the dialog container. */
29
29
  class?: string;
30
- /** Whether clicking outside the dialog should close it. */
30
+ /** Closes the dialog when the user clicks outside it. */
31
31
  shouldCloseOnInteractOutside?: boolean;
32
- /** Whether pressing Escape should close the dialog. */
32
+ /** Closes the dialog when the user pushes the `Escape` key. */
33
33
  shouldCloseOnEscape?: boolean;
34
34
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
35
35
 
@@ -5,13 +5,13 @@ import type { HTMLAttributes } from 'svelte/elements';
5
5
  * Must be used inside a Dialog.Portal.
6
6
  */
7
7
  type DialogContentProps = {
8
- /** Content of the dialog. */
8
+ /** The content of the dialog. */
9
9
  children?: Snippet;
10
- /** CSS class for the dialog container. */
10
+ /** The CSS class names of the dialog container. */
11
11
  class?: string;
12
- /** Whether clicking outside the dialog should close it. */
12
+ /** Closes the dialog when the user clicks outside it. */
13
13
  shouldCloseOnInteractOutside?: boolean;
14
- /** Whether pressing Escape should close the dialog. */
14
+ /** Closes the dialog when the user pushes the `Escape` key. */
15
15
  shouldCloseOnEscape?: boolean;
16
16
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
17
17
  declare const DialogContent: import("svelte").Component<DialogContentProps, {}, "">;
@@ -11,11 +11,11 @@
11
11
  * than only when the user happens to arrow onto it.
12
12
  */
13
13
  type DialogDescriptionProps = {
14
- /** Supporting text announced after the title. */
14
+ /** The text that a screen reader announces after the title. */
15
15
  children?: Snippet;
16
- /** CSS class for the paragraph. */
16
+ /** The CSS class names of the paragraph. */
17
17
  class?: string;
18
- /** Overrides the generated id. */
18
+ /** Replaces the id that the component makes. */
19
19
  id?: string;
20
20
  } & Omit<HTMLAttributes<HTMLParagraphElement>, 'class' | 'children' | 'id'>;
21
21
 
@@ -8,11 +8,11 @@ import type { HTMLAttributes } from 'svelte/elements';
8
8
  * than only when the user happens to arrow onto it.
9
9
  */
10
10
  type DialogDescriptionProps = {
11
- /** Supporting text announced after the title. */
11
+ /** The text that a screen reader announces after the title. */
12
12
  children?: Snippet;
13
- /** CSS class for the paragraph. */
13
+ /** The CSS class names of the paragraph. */
14
14
  class?: string;
15
- /** Overrides the generated id. */
15
+ /** Replaces the id that the component makes. */
16
16
  id?: string;
17
17
  } & Omit<HTMLAttributes<HTMLParagraphElement>, 'class' | 'children' | 'id'>;
18
18
  declare const DialogDescription: import("svelte").Component<DialogDescriptionProps, {}, "">;
@@ -9,7 +9,7 @@
9
9
  * Must be used inside a Dialog.Portal.
10
10
  */
11
11
  type DialogOverlayProps = {
12
- /** CSS class for the overlay. */
12
+ /** The CSS class names of the overlay. */
13
13
  class?: string;
14
14
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class'>;
15
15
 
@@ -4,7 +4,7 @@ import type { HTMLAttributes } from 'svelte/elements';
4
4
  * Must be used inside a Dialog.Portal.
5
5
  */
6
6
  type DialogOverlayProps = {
7
- /** CSS class for the overlay. */
7
+ /** The CSS class names of the overlay. */
8
8
  class?: string;
9
9
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class'>;
10
10
  declare const DialogOverlay: import("svelte").Component<DialogOverlayProps, {}, "">;
@@ -11,7 +11,7 @@
11
11
  * Must be used inside a Dialog.Root.
12
12
  */
13
13
  type DialogPortalProps = {
14
- /** Content to render in portal (Overlay and Content) */
14
+ /** The content of the portal: the Overlay and the Content. */
15
15
  children?: Snippet;
16
16
  };
17
17
 
@@ -5,7 +5,7 @@ import type { Snippet } from 'svelte';
5
5
  * Must be used inside a Dialog.Root.
6
6
  */
7
7
  type DialogPortalProps = {
8
- /** Content to render in portal (Overlay and Content) */
8
+ /** The content of the portal: the Overlay and the Content. */
9
9
  children?: Snippet;
10
10
  };
11
11
  declare const DialogPortal: import("svelte").Component<DialogPortalProps, {}, "">;
@@ -9,7 +9,7 @@ Description: Dialog state container for open state, trigger ref, and root-level
9
9
 
10
10
  | Prop | Type | Default | Description |
11
11
  | -------------- | ------------------------------- | ----------- | ------------------------------------------------------- |
12
- | `open` | `boolean` | `undefined` | Controlled open state. Supports `bind:open`. |
12
+ | `open` | `boolean` | `undefined` | The open state. Supports `bind:open`. |
13
13
  | `defaultOpen` | `boolean` | `false` | Initial open state in uncontrolled mode. |
14
14
  | `onOpenChange` | `(open: boolean) => void` | `undefined` | Called whenever open state changes. |
15
15
  | `triggerRef` | `HTMLElement \| null` | `null` | Trigger reference. Supports `bind:triggerRef`. |
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { untrack, type Snippet } from 'svelte';
2
+ import { tick, untrack, type Snippet } from 'svelte';
3
3
  import { setDialogContext, type DialogContext } from './context';
4
4
  import type { DialogStateHelpers } from './types';
5
5
  import {
@@ -13,22 +13,24 @@
13
13
  * Provides context for Trigger and Content children.
14
14
  */
15
15
  type DialogRootProps = {
16
- /** Open state. Two-way by default — use `bind:open`. */
16
+ /** The open state. By default it goes in the two directions: use `bind:open`. */
17
17
  open?: boolean;
18
- /** Initial open state, for when `open` is not supplied. */
18
+ /** The open state at the start, for when you give no `open`. */
19
19
  defaultOpen?: boolean;
20
20
  /**
21
- * Opt into fully controlled state: the component stops writing back to `open` and
22
- * only reports through `onOpenChange`, so the parent can reject a change by not
23
- * flowing the new value back down. Off by default, because `bind:open` — the
24
- * common case — needs the write-back to work at all.
21
+ * Give your own code full control of the open state. The component stops to write back to
22
+ * `open`, and it reports only through `onOpenChange`. Thus the parent can refuse a change: the
23
+ * parent does not send the new value down. The default is off, because `bind:open` is the usual
24
+ * case and it needs the write-back.
25
25
  */
26
26
  controlledOpen?: boolean;
27
- /** Callback when open state changes. */
27
+ /** The component calls it when the open state changes. */
28
28
  onOpenChange?: (open: boolean) => void;
29
- /** Reference to the trigger element. Can be set manually or via Dialog.Trigger. */
29
+ /**
30
+ * The reference to the trigger element. Set it in your own code, or let Dialog.Trigger set it.
31
+ */
30
32
  triggerRef?: HTMLElement | null;
31
- /** Children snippet receives state helpers: { close, open, toggle, isOpen } */
33
+ /** The children snippet. It receives the state functions: { close, open, toggle, isOpen }. */
32
34
  children?: Snippet<[DialogStateHelpers]>;
33
35
  };
34
36
 
@@ -81,6 +83,29 @@
81
83
  setOpen(true);
82
84
  }
83
85
 
86
+ /**
87
+ * Focuses `target`, and tries once more after the update this close kicks off.
88
+ *
89
+ * While a modal dialog is open, `ariaHideOutside` marks everything outside the
90
+ * panel `inert` — the trigger included — and `focus()` on an inert element is a
91
+ * no-op. The attribute is only lifted during that update, so the first attempt
92
+ * can silently land on `<body>`. It does exactly that whenever the panel has an
93
+ * exit animation, which keeps the content (and the `inert` with it) alive past
94
+ * the state change. The retry costs nothing when the first attempt worked.
95
+ */
96
+ function restoreFocusTo(
97
+ target: HTMLElement,
98
+ modality: ReturnType<typeof resolveCloseInteractionModality>
99
+ ) {
100
+ focusWithModality(target, modality);
101
+ if (document.activeElement === target) return;
102
+
103
+ void tick().then(() => {
104
+ if (!target.isConnected || document.activeElement === target) return;
105
+ focusWithModality(target, modality);
106
+ });
107
+ }
108
+
84
109
  function closeDialog(reason: DialogCloseReason = 'imperative-action', event?: Event) {
85
110
  const wasOpen = isOpen;
86
111
  setOpen(false);
@@ -88,7 +113,7 @@
88
113
  // back down) — don't steal focus while the dialog is still open.
89
114
  if (!wasOpen || isOpen) return;
90
115
  if (triggerRef) {
91
- focusWithModality(triggerRef, resolveCloseInteractionModality(reason, event));
116
+ restoreFocusTo(triggerRef, resolveCloseInteractionModality(reason, event));
92
117
  }
93
118
  }
94
119
 
@@ -5,22 +5,24 @@ import type { DialogStateHelpers } from './types';
5
5
  * Provides context for Trigger and Content children.
6
6
  */
7
7
  type DialogRootProps = {
8
- /** Open state. Two-way by default — use `bind:open`. */
8
+ /** The open state. By default it goes in the two directions: use `bind:open`. */
9
9
  open?: boolean;
10
- /** Initial open state, for when `open` is not supplied. */
10
+ /** The open state at the start, for when you give no `open`. */
11
11
  defaultOpen?: boolean;
12
12
  /**
13
- * Opt into fully controlled state: the component stops writing back to `open` and
14
- * only reports through `onOpenChange`, so the parent can reject a change by not
15
- * flowing the new value back down. Off by default, because `bind:open` — the
16
- * common case — needs the write-back to work at all.
13
+ * Give your own code full control of the open state. The component stops to write back to
14
+ * `open`, and it reports only through `onOpenChange`. Thus the parent can refuse a change: the
15
+ * parent does not send the new value down. The default is off, because `bind:open` is the usual
16
+ * case and it needs the write-back.
17
17
  */
18
18
  controlledOpen?: boolean;
19
- /** Callback when open state changes. */
19
+ /** The component calls it when the open state changes. */
20
20
  onOpenChange?: (open: boolean) => void;
21
- /** Reference to the trigger element. Can be set manually or via Dialog.Trigger. */
21
+ /**
22
+ * The reference to the trigger element. Set it in your own code, or let Dialog.Trigger set it.
23
+ */
22
24
  triggerRef?: HTMLElement | null;
23
- /** Children snippet receives state helpers: { close, open, toggle, isOpen } */
25
+ /** The children snippet. It receives the state functions: { close, open, toggle, isOpen }. */
24
26
  children?: Snippet<[DialogStateHelpers]>;
25
27
  };
26
28
  declare const DialogRoot: import("svelte").Component<DialogRootProps, {}, "open" | "triggerRef">;
@@ -12,11 +12,11 @@
12
12
  * the text inside it.
13
13
  */
14
14
  type DialogTitleProps = {
15
- /** The dialog's name. */
15
+ /** The name of the dialog. */
16
16
  children?: Snippet;
17
- /** CSS class for the heading. */
17
+ /** The CSS class names of the heading. */
18
18
  class?: string;
19
- /** Overrides the generated id. */
19
+ /** Replaces the id that the component makes. */
20
20
  id?: string;
21
21
  } & Omit<HTMLAttributes<HTMLHeadingElement>, 'class' | 'children' | 'id'>;
22
22
 
@@ -9,11 +9,11 @@ import type { HTMLAttributes } from 'svelte/elements';
9
9
  * the text inside it.
10
10
  */
11
11
  type DialogTitleProps = {
12
- /** The dialog's name. */
12
+ /** The name of the dialog. */
13
13
  children?: Snippet;
14
- /** CSS class for the heading. */
14
+ /** The CSS class names of the heading. */
15
15
  class?: string;
16
- /** Overrides the generated id. */
16
+ /** Replaces the id that the component makes. */
17
17
  id?: string;
18
18
  } & Omit<HTMLAttributes<HTMLHeadingElement>, 'class' | 'children' | 'id'>;
19
19
  declare const DialogTitle: import("svelte").Component<DialogTitleProps, {}, "">;
@@ -9,6 +9,6 @@ Description: Button trigger part that wires itself as the trigger and toggles th
9
9
 
10
10
  | Prop | Type | Default | Description |
11
11
  | -------------- | ---------------------- | ----------- | -------------------------------------------------------------------------- |
12
- | `children` | `Snippet` | `undefined` | Button content. |
12
+ | `children` | `Snippet` | `undefined` | The content of the button. |
13
13
  | `class` | `string` | `''` | CSS class names for the button. |
14
14
  | `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes, excluding reserved trigger semantics. |
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Description
4
4
 
5
- `Drawer` is a panel anchored to an edge of the viewport that can be dismissed by swiping it away. It is a modal dialog by behaviour — focus trap, scroll lock, Escape, outside press — with the gesture, snap points, stacking and software-keyboard handling a sheet needs on a phone.
5
+ `Drawer` is a panel anchored to an edge of the viewport that can be dismissed by swiping it away. It behaves like a modal dialog: the focus stays in the panel and the page does not scroll. The `Escape` key and a press outside it close it. It adds what a sheet needs on a telephone: the drag, the snap points, the stack, and a knowledge of the keyboard.
6
6
 
7
7
  ## Usage guidelines
8
8
 
@@ -10,7 +10,7 @@
10
10
  - Render `Drawer.Overlay` and the panel inside `Drawer.Portal`.
11
11
  - Always give the drawer a `Drawer.Title`. A `role="dialog"` takes its name from `aria-labelledby`, not from the text inside it.
12
12
  - Always give a dismissible drawer a `Drawer.Close`. A swipe has no keyboard or screen-reader equivalent, so a drawer that can only be swiped away is unreachable for some users.
13
- - Wrap the content in `Drawer.Body` so a scroll that reaches its end does not chain out to the page behind, and so a mouse drag inside it selects text instead of throwing the panel across the screen. Leave the grab bar outside it, as the surface a mouse can still drag by.
13
+ - Put the content in `Drawer.Body`. Thus a scroll that gets to its end does not continue on the page behind. A mouse drag in it also selects the text, and does not move the panel. Leave the grab bar outside it, as the surface a mouse can still drag by.
14
14
  - Mark any control with a drag of its own — a slider, a carousel — with `data-hk-swipe-ignore`. Valueless opts it out for every input type; `="mouse"` opts it out for a mouse only.
15
15
  - Put `Drawer.SwipeArea` OUTSIDE `Drawer.Portal` — it has to exist while the drawer is closed.
16
16
  - Wrap `Drawer.Root` in `Drawer.VirtualKeyboardProvider` when the panel contains form fields.
@@ -107,5 +107,5 @@ The resting transform is the sum of the snap point and the drag:
107
107
 
108
108
  This drawer is modelled on Base UI's, with two deliberate differences:
109
109
 
110
- - The panel part is `Drawer.Content` (Base UI calls it `Popup`) and the scrolling region is `Drawer.Body` (Base UI calls that one `Content`), so the naming matches `Dialog` and `Popover` in this library.
110
+ - The panel part is `Drawer.Content`, and Base UI calls it `Popup`. The region that scrolls is `Drawer.Body`, and Base UI calls that one `Content`. Thus the names agree with `Dialog` and `Popover` in this library.
111
111
  - There is no `Drawer.Provider`. The drawer stack is module-global here, so a provider would have nothing left to coordinate; `Drawer.Indent` reads the stack directly.