@human-kit/ui 1.0.0-beta.4 → 1.0.0-beta.6

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 (209) 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-indicator/autocomplete-item-indicator.svelte +2 -2
  10. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte.d.ts +2 -2
  11. package/dist/autocomplete/list/autocomplete-list.svelte +2 -2
  12. package/dist/autocomplete/list/autocomplete-list.svelte.d.ts +2 -2
  13. package/dist/autocomplete/root/autocomplete.svelte +7 -7
  14. package/dist/autocomplete/root/autocomplete.svelte.d.ts +7 -7
  15. package/dist/autocomplete/status/autocomplete-status.svelte +1 -1
  16. package/dist/autocomplete/status/autocomplete-status.svelte.d.ts +1 -1
  17. package/dist/button/README.md +1 -1
  18. package/dist/button/root/button-root.svelte +15 -10
  19. package/dist/button/root/button-root.svelte.d.ts +15 -10
  20. package/dist/calendar/README.md +3 -3
  21. package/dist/calendar/grid-header/calendar-grid-header.svelte +3 -4
  22. package/dist/calendar/grid-header/calendar-grid-header.svelte.d.ts +3 -4
  23. package/dist/calendar/root/calendar-root.svelte +8 -2
  24. package/dist/calendar/root/calendar-root.svelte.d.ts +8 -2
  25. package/dist/calendar/trigger-next/README.md +1 -1
  26. package/dist/calendar/trigger-previous/README.md +1 -1
  27. package/dist/checkbox/README.md +1 -1
  28. package/dist/checkbox/indicator/README.md +1 -1
  29. package/dist/checkbox/root/README.md +2 -2
  30. package/dist/checkbox/root/checkbox-root.svelte +12 -10
  31. package/dist/checkbox/root/checkbox-root.svelte.d.ts +12 -10
  32. package/dist/clock/README.md +3 -3
  33. package/dist/clock/axis/README.md +1 -1
  34. package/dist/clock/root/README.md +1 -1
  35. package/dist/clock/wheel-column/clock-wheel-column.svelte +1 -1
  36. package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +1 -1
  37. package/dist/collapsible/README.md +3 -3
  38. package/dist/collapsible/types.d.ts +10 -7
  39. package/dist/combobox/README.md +2 -2
  40. package/dist/combobox/button/README.md +6 -6
  41. package/dist/combobox/input/README.md +1 -1
  42. package/dist/combobox/input/combobox-input.svelte +3 -3
  43. package/dist/combobox/input/combobox-input.svelte.d.ts +3 -3
  44. package/dist/combobox/item/combobox-listboxitem.svelte +4 -2
  45. package/dist/combobox/item/combobox-listboxitem.svelte.d.ts +4 -2
  46. package/dist/combobox/item-indicator/README.md +1 -1
  47. package/dist/combobox/item-indicator/combobox-item-indicator.svelte +2 -2
  48. package/dist/combobox/item-indicator/combobox-item-indicator.svelte.d.ts +2 -2
  49. package/dist/combobox/list/combobox-listbox.svelte +11 -8
  50. package/dist/combobox/list/combobox-listbox.svelte.d.ts +11 -8
  51. package/dist/combobox/popover/README.md +1 -1
  52. package/dist/combobox/root/README.md +24 -24
  53. package/dist/combobox/root/combobox.svelte +26 -17
  54. package/dist/combobox/root/combobox.svelte.d.ts +26 -17
  55. package/dist/combobox/status/README.md +1 -1
  56. package/dist/combobox/status/combobox-status.svelte +1 -1
  57. package/dist/combobox/status/combobox-status.svelte.d.ts +1 -1
  58. package/dist/combobox/tag/README.md +1 -1
  59. package/dist/combobox/tag/combobox-tag.svelte +1 -1
  60. package/dist/combobox/tag/combobox-tag.svelte.d.ts +1 -1
  61. package/dist/combobox/tag-remove/README.md +1 -1
  62. package/dist/combobox/tag-remove/combobox-tag-remove.svelte +4 -5
  63. package/dist/combobox/tag-remove/combobox-tag-remove.svelte.d.ts +4 -5
  64. package/dist/combobox/tags/README.md +1 -1
  65. package/dist/combobox/tags/combobox-tags.svelte +11 -11
  66. package/dist/combobox/tags/combobox-tags.svelte.d.ts +11 -11
  67. package/dist/combobox/trigger/README.md +7 -7
  68. package/dist/datepicker/README.md +4 -4
  69. package/dist/datepicker/input/date-picker-input.svelte +3 -4
  70. package/dist/datepicker/input/date-picker-input.svelte.d.ts +3 -4
  71. package/dist/datepicker/root/date-picker-root.svelte +1 -1
  72. package/dist/datepicker/trigger/README.md +1 -1
  73. package/dist/daterangepicker/README.md +3 -3
  74. package/dist/daterangepicker/input/date-range-picker-input.svelte +3 -4
  75. package/dist/daterangepicker/input/date-range-picker-input.svelte.d.ts +3 -4
  76. package/dist/dialog/README.md +1 -1
  77. package/dist/dialog/close/dialog-close.svelte +3 -3
  78. package/dist/dialog/close/dialog-close.svelte.d.ts +3 -3
  79. package/dist/dialog/content/dialog-content.svelte +4 -4
  80. package/dist/dialog/content/dialog-content.svelte.d.ts +4 -4
  81. package/dist/dialog/description/dialog-description.svelte +3 -3
  82. package/dist/dialog/description/dialog-description.svelte.d.ts +3 -3
  83. package/dist/dialog/overlay/dialog-overlay.svelte +1 -1
  84. package/dist/dialog/overlay/dialog-overlay.svelte.d.ts +1 -1
  85. package/dist/dialog/portal/dialog-portal.svelte +1 -1
  86. package/dist/dialog/portal/dialog-portal.svelte.d.ts +1 -1
  87. package/dist/dialog/root/README.md +1 -1
  88. package/dist/dialog/root/dialog-root.svelte +36 -11
  89. package/dist/dialog/root/dialog-root.svelte.d.ts +11 -9
  90. package/dist/dialog/title/dialog-title.svelte +3 -3
  91. package/dist/dialog/title/dialog-title.svelte.d.ts +3 -3
  92. package/dist/dialog/trigger/README.md +1 -1
  93. package/dist/drawer/README.md +3 -3
  94. package/dist/drawer/body/drawer-body.svelte +2 -2
  95. package/dist/drawer/body/drawer-body.svelte.d.ts +2 -2
  96. package/dist/drawer/close/drawer-close.svelte +3 -3
  97. package/dist/drawer/close/drawer-close.svelte.d.ts +3 -3
  98. package/dist/drawer/content/drawer-content.svelte +12 -9
  99. package/dist/drawer/content/drawer-content.svelte.d.ts +12 -9
  100. package/dist/drawer/description/drawer-description.svelte +3 -3
  101. package/dist/drawer/description/drawer-description.svelte.d.ts +3 -3
  102. package/dist/drawer/indent/drawer-indent-background.svelte +1 -1
  103. package/dist/drawer/indent/drawer-indent-background.svelte.d.ts +1 -1
  104. package/dist/drawer/indent/drawer-indent.svelte +2 -2
  105. package/dist/drawer/indent/drawer-indent.svelte.d.ts +2 -2
  106. package/dist/drawer/overlay/drawer-overlay.svelte +1 -1
  107. package/dist/drawer/overlay/drawer-overlay.svelte.d.ts +1 -1
  108. package/dist/drawer/portal/drawer-portal.svelte +1 -1
  109. package/dist/drawer/portal/drawer-portal.svelte.d.ts +1 -1
  110. package/dist/drawer/root/context.d.ts +1 -1
  111. package/dist/drawer/root/drawer-root.svelte +25 -23
  112. package/dist/drawer/root/drawer-root.svelte.d.ts +25 -23
  113. package/dist/drawer/swipe-area/drawer-swipe-area.svelte +3 -3
  114. package/dist/drawer/swipe-area/drawer-swipe-area.svelte.d.ts +3 -3
  115. package/dist/drawer/title/drawer-title.svelte +3 -3
  116. package/dist/drawer/title/drawer-title.svelte.d.ts +3 -3
  117. package/dist/drawer/trigger/drawer-trigger.svelte +6 -6
  118. package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +6 -6
  119. package/dist/drawer/viewport/drawer-viewport.svelte +2 -2
  120. package/dist/drawer/viewport/drawer-viewport.svelte.d.ts +2 -2
  121. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +1 -1
  122. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte.d.ts +1 -1
  123. package/dist/dropzone/README.md +4 -6
  124. package/dist/input/input.svelte +6 -6
  125. package/dist/input/input.svelte.d.ts +6 -6
  126. package/dist/listbox/README.md +3 -10
  127. package/dist/listbox/item/listbox-item.svelte +24 -15
  128. package/dist/listbox/item/listbox-item.svelte.d.ts +24 -15
  129. package/dist/listbox/root/README.md +1 -1
  130. package/dist/listbox/root/context.d.ts +1 -1
  131. package/dist/listbox/root/listbox.svelte +50 -38
  132. package/dist/listbox/root/listbox.svelte.d.ts +50 -38
  133. package/dist/locale-provider/README.md +1 -6
  134. package/dist/menu/README.md +6 -15
  135. package/dist/menu/content/menu-content.svelte +14 -10
  136. package/dist/menu/content/menu-content.svelte.d.ts +14 -10
  137. package/dist/menu/context-trigger/menu-context-trigger.svelte +8 -9
  138. package/dist/menu/context-trigger/menu-context-trigger.svelte.d.ts +8 -9
  139. package/dist/menu/group/menu-group-label.svelte +1 -1
  140. package/dist/menu/group/menu-group-label.svelte.d.ts +1 -1
  141. package/dist/menu/item/menu-item.svelte +11 -8
  142. package/dist/menu/item/menu-item.svelte.d.ts +11 -8
  143. package/dist/menu/overlay/menu-overlay.svelte +1 -1
  144. package/dist/menu/overlay/menu-overlay.svelte.d.ts +1 -1
  145. package/dist/menu/root/context.d.ts +6 -3
  146. package/dist/menu/root/menu-root.svelte +14 -8
  147. package/dist/menu/root/menu-root.svelte.d.ts +14 -8
  148. package/dist/menu/root/menu-state.svelte.d.ts +1 -1
  149. package/dist/menu/separator/menu-separator.svelte +1 -1
  150. package/dist/menu/separator/menu-separator.svelte.d.ts +1 -1
  151. package/dist/menu/submenu/menu-submenu-root.svelte +10 -7
  152. package/dist/menu/submenu/menu-submenu-root.svelte.d.ts +10 -7
  153. package/dist/numberfield/root/README.md +1 -1
  154. package/dist/numberfield/scrub-area-cursor/README.md +1 -1
  155. package/dist/popover/README.md +1 -1
  156. package/dist/popover/content/popover-content.svelte +19 -14
  157. package/dist/popover/content/popover-content.svelte.d.ts +19 -14
  158. package/dist/popover/overlay/popover-overlay.svelte +1 -1
  159. package/dist/popover/overlay/popover-overlay.svelte.d.ts +1 -1
  160. package/dist/popover/root/README.md +1 -1
  161. package/dist/popover/root/popover-root.svelte +13 -10
  162. package/dist/popover/root/popover-root.svelte.d.ts +13 -10
  163. package/dist/popover/trigger/README.md +1 -1
  164. package/dist/primitives/floating.d.ts +3 -3
  165. package/dist/primitives/scroll-lock.js +37 -8
  166. package/dist/switch/root/README.md +2 -2
  167. package/dist/switch/root/switch-root.svelte +23 -18
  168. package/dist/switch/root/switch-root.svelte.d.ts +23 -18
  169. package/dist/switch/thumb/switch-thumb.svelte +1 -1
  170. package/dist/switch/thumb/switch-thumb.svelte.d.ts +1 -1
  171. package/dist/table/README.md +15 -10
  172. package/dist/table/checkbox-indicator/README.md +1 -1
  173. package/dist/table/column-resizer/README.md +2 -2
  174. package/dist/table/root/README.md +1 -1
  175. package/dist/table/sort-trigger/README.md +1 -1
  176. package/dist/table/types.d.ts +21 -20
  177. package/dist/tabs/types.d.ts +6 -6
  178. package/dist/timepicker/README.md +3 -2
  179. package/dist/timepicker/input/README.md +1 -1
  180. package/dist/timepicker/input/time-picker-input.svelte +58 -5
  181. package/dist/timepicker/input/time-picker-input.svelte.d.ts +10 -1
  182. package/dist/timepicker/root/README.md +1 -1
  183. package/dist/timepicker/trigger/README.md +1 -1
  184. package/dist/toggle/README.md +1 -1
  185. package/dist/toggle-group/README.md +6 -0
  186. package/dist/toggle-group/root/context.svelte.d.ts +1 -1
  187. package/dist/toggle-group/root/context.svelte.js +20 -11
  188. package/dist/toggle-group/root/toggle-group-root.svelte +20 -15
  189. package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte +13 -0
  190. package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte.d.ts +7 -0
  191. package/dist/toggle-group/types.d.ts +9 -9
  192. package/dist/transfer-list/README.md +6 -17
  193. package/dist/transfer-list/item/transfer-list-item.svelte +4 -4
  194. package/dist/transfer-list/item/transfer-list-item.svelte.d.ts +4 -4
  195. package/dist/transfer-list/list/transfer-list-list.svelte +12 -12
  196. package/dist/transfer-list/list/transfer-list-list.svelte.d.ts +12 -12
  197. package/dist/transfer-list/move/transfer-list-move-button.svelte +4 -4
  198. package/dist/transfer-list/move/transfer-list-move-button.svelte.d.ts +4 -4
  199. package/dist/transfer-list/move/transfer-list-reorder-button.svelte +3 -3
  200. package/dist/transfer-list/move/transfer-list-reorder-button.svelte.d.ts +3 -3
  201. package/dist/transfer-list/root/transfer-list-root.svelte +23 -20
  202. package/dist/transfer-list/root/transfer-list-root.svelte.d.ts +23 -20
  203. package/dist/transfer-list/status/transfer-list-status.svelte +1 -1
  204. package/dist/transfer-list/status/transfer-list-status.svelte.d.ts +1 -1
  205. package/dist/tree/README.md +3 -3
  206. package/dist/tree/checkbox-indicator/README.md +1 -1
  207. package/dist/tree/root/README.md +1 -1
  208. package/dist/tree/types.d.ts +19 -10
  209. package/package.json +1 -1
package/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # @human-kit/ui
2
2
 
3
- Accessible, reusable UI components for **Svelte 5**.
3
+ Accessible UI components for **Svelte 5**.
4
4
 
5
- Built with Svelte 5 runes, typed end to end, and shipped as native ESM with
6
- per-component subpath exports so bundlers only include what you import.
5
+ The components use Svelte 5 runes and have full types. The package is native
6
+ ESM, and each component has a subpath export, thus your bundler includes only
7
+ the components that you import.
7
8
 
8
9
  **[Documentation and live demos → ui.human-kit.com](https://ui.human-kit.com)**
9
10
 
@@ -25,7 +26,7 @@ Svelte 5 is a peer dependency:
25
26
 
26
27
  ## Usage
27
28
 
28
- Import from the package root:
29
+ Import from the root of the package:
29
30
 
30
31
  ```svelte
31
32
  <script lang="ts">
@@ -33,7 +34,7 @@ Import from the package root:
33
34
  </script>
34
35
  ```
35
36
 
36
- Or import a single component via its subpath for the leanest bundle:
37
+ For the smallest bundle, import one component from its subpath:
37
38
 
38
39
  ```svelte
39
40
  <script lang="ts">
@@ -51,18 +52,18 @@ Or import a single component via its subpath for the leanest bundle:
51
52
  | Date & time | `Calendar`, `Clock`, `DatePicker`, `DateRangePicker`, `TimePicker` |
52
53
  | Layout | `Accordion`, `Collapsible`, `Tabs`, `Table`, `Tree`, `OverflowRow` |
53
54
  | Actions | `Button` |
54
- | Utilities | `LocaleProvider`, primitives, and the `cn` class helper |
55
+ | Utilities | `LocaleProvider`, primitives, and the `cn` class function |
55
56
 
56
- Each component is also available as a subpath export (for example
57
- `@human-kit/ui/calendar`).
57
+ Each component also has a subpath export, for example `@human-kit/ui/calendar`.
58
58
 
59
- ## Styling
59
+ ## Styles
60
60
 
61
- Components are headless: they ship no CSS and assume no framework. Each part
62
- takes a `class` and exposes its state as `data-*` attributes — `data-state`,
63
- `data-disabled`, `data-focus-visible`, `data-pressed` and so on — so you can
64
- style it with plain CSS, Tailwind, or anything else. Every component page in the
65
- docs lists its full data-attribute contract.
61
+ The components are headless: they have no CSS, and they do not need a CSS
62
+ framework. Each part accepts a `class` attribute. Each part also shows its state
63
+ in `data-*` attributes, for example `data-state`, `data-disabled`,
64
+ `data-focus-visible`, and `data-pressed`. Thus you can write the styles in plain
65
+ CSS, in Tailwind, or in a different tool. Each component page in the
66
+ documentation gives the full list of the data attributes.
66
67
 
67
68
  ```svelte
68
69
  <Button.Root class="rounded-md bg-black px-3 py-1.5 text-white data-[pressed]:opacity-80">
@@ -70,13 +71,14 @@ docs lists its full data-attribute contract.
70
71
  </Button.Root>
71
72
  ```
72
73
 
73
- The only runtime dependency is [`@floating-ui/dom`](https://floating-ui.com), and
74
- only the components that position something against an anchor use it.
74
+ The library has one dependency at run time:
75
+ [`@floating-ui/dom`](https://floating-ui.com). Only the components that put an
76
+ element against an anchor use it.
75
77
 
76
78
  ## Requirements
77
79
 
78
80
  - Svelte `^5.0.0`
79
- - Node.js 20+
81
+ - Node.js version 20 or later
80
82
 
81
83
  ## License
82
84
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Description
4
4
 
5
- `Accordion` is a headless disclosure primitive: a vertical (or horizontal) stack of collapsible sections with roving focus, single or multiple expansion, disabled items, and controlled/uncontrolled open state.
5
+ `Accordion` is a headless disclosure component: a vertical or horizontal stack of sections that open and close. It has roving focus and disabled items. One section can be open, or more than one. You can control the open state, or the component can control it.
6
6
 
7
7
  ## Anatomy
8
8
 
@@ -34,7 +34,7 @@
34
34
 
35
35
  - Provide a unique `value` on every `Accordion.Item`. The matching `Header`, `Trigger` and `Panel` read it from the item context, so you only declare it once.
36
36
  - Use `value` / `onChange` for controlled state and `defaultValue` for uncontrolled state. Both are arrays of open item values.
37
- - Set `selectionMode="multiple"` to allow more than one panel open at a time (default is `"single"`).
37
+ - Set `selectionMode="multiple"` to let more than one panel stay open. The default is `"single"`.
38
38
  - Use `disallowEmptySelection` to keep at least one panel open.
39
39
  - Use `disabled` on `Accordion.Item` to disable a single item, or `disabled` on `Accordion.Root` to disable the whole accordion.
40
40
  - Use `orientation="horizontal"` to switch the arrow-key navigation axis.
@@ -48,4 +48,4 @@
48
48
  - `Accordion.Trigger` renders button semantics with `aria-expanded` and `aria-controls`.
49
49
  - `Accordion.Panel` renders `role="region"` and `aria-labelledby` pointing at its trigger, and is `hidden` + `inert` while collapsed. Set `region={false}` on panels of large accordions (the APG recommends avoiding `region` landmarks beyond roughly six panels) so assistive-technology landmark lists are not flooded.
50
50
  - Arrow keys move focus between triggers, Home/End jump to the first or last enabled trigger, and focus wraps at the ends unless `loop={false}`.
51
- - Enter/Space toggle the focused panel via native button activation.
51
+ - The `Enter` key and the `Space` key open and close the panel with the focus, like a native button.
@@ -3,72 +3,86 @@ import type { HTMLAttributes, HTMLButtonAttributes } from 'svelte/elements';
3
3
  import type { AccordionContext, AccordionOrientation, AccordionSelectionMode, AccordionValue } from './root/context.svelte';
4
4
  export type { AccordionContext, AccordionOrientation, AccordionSelectionMode, AccordionValue } from './root/context.svelte';
5
5
  export type AccordionRootProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class'> & {
6
- /** List of open item values. Two-way by default — use `bind:value`. */
6
+ /**
7
+ * The list of the values of the open items. By default it goes in the two directions: use
8
+ * `bind:value`.
9
+ */
7
10
  value?: AccordionValue[];
8
- /** Initially open item values, for when `value` is not supplied. */
11
+ /** The values of the items that are open at the start, for when you give no `value`. */
9
12
  defaultValue?: AccordionValue[];
10
13
  /**
11
- * Opt into fully controlled state: the component stops writing back to `value` and
12
- * only reports through `onChange`, so the parent can reject a change by not flowing
13
- * the new value back down. Off by default, because `bind:value` — the common case —
14
- * needs the write-back to work at all.
14
+ * Give your own code full control of the state. The component stops to write back to `value`, and
15
+ * it reports only through `onChange`. Thus the parent can refuse a change: the parent does not
16
+ * send the new value down. The default is off, because `bind:value` is the usual case and it
17
+ * needs the write-back.
15
18
  */
16
19
  controlledValue?: boolean;
17
- /** Called with the new list of open item values after a user toggle. */
20
+ /**
21
+ * The component calls it with the new list of the open item values, after the user opens or
22
+ * closes a panel.
23
+ */
18
24
  onChange?: (value: AccordionValue[]) => void;
19
- /** Whether one (`'single'`) or several (`'multiple'`) panels can be open at once. */
25
+ /**
26
+ * The number of panels that can be open together: one with `'single'`, or more than one with
27
+ * `'multiple'`.
28
+ */
20
29
  selectionMode?: AccordionSelectionMode;
21
30
  /** Disables every item in the accordion. */
22
31
  disabled?: boolean;
23
- /** Axis used for arrow-key navigation between triggers. */
32
+ /** The axis of the arrow keys between the triggers. */
24
33
  orientation?: AccordionOrientation;
25
- /** Keeps at least one panel open at all times. */
34
+ /** Keeps one panel open at all times. */
26
35
  disallowEmptySelection?: boolean;
27
- /** Whether trigger focus wraps at the first and last items. */
36
+ /** At the first trigger and at the last trigger, the focus goes to the opposite end. */
28
37
  loop?: boolean;
29
38
  children?: Snippet;
30
39
  class?: string;
31
40
  id?: string;
32
- /** Bindable reference to the rendered root element. */
41
+ /** A bindable reference to the root element. */
33
42
  element?: HTMLDivElement | null;
34
- /** Externally created accordion context, for advanced composition. */
43
+ /** An accordion context that your own code makes, for a complex composition. */
35
44
  context?: AccordionContext;
36
45
  };
37
46
  export type AccordionItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class'> & {
38
- /** Unique value identifying the item. Header, Trigger and Panel read it from context. */
47
+ /**
48
+ * The unique value of the item. The Header, the Trigger, and the Panel read it from the context.
49
+ */
39
50
  value: AccordionValue;
40
51
  /** Disables this item only. */
41
52
  disabled?: boolean;
42
53
  children?: Snippet;
43
54
  class?: string;
44
- /** Bindable reference to the rendered item element. */
55
+ /** A bindable reference to the item element. */
45
56
  element?: HTMLDivElement | null;
46
57
  };
47
58
  export type AccordionHeaderProps = Omit<HTMLAttributes<HTMLHeadingElement>, 'children' | 'class'> & {
48
- /** Heading level of the rendered element, to match the surrounding document outline. */
59
+ /** The heading level of the element, to agree with the headings around it. */
49
60
  level?: 1 | 2 | 3 | 4 | 5 | 6;
50
61
  children?: Snippet;
51
62
  class?: string;
52
- /** Bindable reference to the rendered heading element. */
63
+ /** A bindable reference to the heading element. */
53
64
  element?: HTMLHeadingElement | null;
54
65
  };
55
66
  export type AccordionTriggerProps = Omit<HTMLButtonAttributes, 'children' | 'class' | 'type' | 'disabled' | 'role' | 'aria-expanded' | 'aria-controls'> & {
56
67
  children?: Snippet;
57
68
  class?: string;
58
- /** Bindable reference to the rendered trigger button. */
69
+ /** A bindable reference to the trigger button. */
59
70
  element?: HTMLButtonElement | null;
60
71
  };
61
72
  export type AccordionPanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'role' | 'hidden' | 'aria-labelledby'> & {
62
- /** Keep the closed panel mounted (hidden) instead of unmounting it after the exit animation. */
73
+ /**
74
+ * Keep the closed panel in the DOM, and hidden. Without it, the panel leaves the DOM after the
75
+ * exit animation.
76
+ */
63
77
  forceMount?: boolean;
64
78
  /**
65
- * Whether the panel is exposed as a `role="region"` landmark (default `true`).
66
- * Set to `false` on accordions with many items: the APG recommends avoiding
67
- * `region` beyond roughly six panels so landmark lists are not flooded.
79
+ * Makes the panel a `role="region"` landmark. The default is `true`. In an accordion with many
80
+ * items, set it to `false`. Above approximately six panels, the APG recommends no `region`,
81
+ * because too many landmarks make the landmark list difficult to use.
68
82
  */
69
83
  region?: boolean;
70
84
  children?: Snippet;
71
85
  class?: string;
72
- /** Bindable reference to the rendered panel element. */
86
+ /** A bindable reference to the panel element. */
73
87
  element?: HTMLDivElement | null;
74
88
  };
@@ -2,14 +2,13 @@
2
2
 
3
3
  ## Description
4
4
 
5
- `Autocomplete` is an always-visible, filterable list: a search input on top of a
6
- `ListBox`. As the user types, items are filtered locally; arrow keys move a
7
- virtual focus through the list (via `aria-activedescendant`) while DOM focus stays
8
- in the input. Unlike `ComboBox`, there is **no popover and no open/closed state**.
5
+ `Autocomplete` is a list that the user always sees and can filter: a search input above a
6
+ `ListBox`. When the user types, the component filters the items locally. The arrow keys
7
+ move a virtual focus through the list with `aria-activedescendant`, and the DOM focus
8
+ stays in the input. A `ComboBox` has a popover and an open state. An `Autocomplete` has
9
+ **neither**.
9
10
 
10
- Selection lives in the inner list — pass `selectionMode`, `value`/`defaultValue`
11
- and `onChange` to `Autocomplete.List`, exactly like a plain `ListBox`. The
12
- Autocomplete only owns the search query, filtering and virtual focus.
11
+ The inner list holds the selection. Put `selectionMode`, `value`, `defaultValue`, and `onChange` on `Autocomplete.List`, like a plain `ListBox`. The Autocomplete controls only the search text, the filter, and the virtual focus.
13
12
 
14
13
  ## Usage guidelines
15
14
 
@@ -7,7 +7,7 @@
7
7
  * Autocomplete.Empty - Rendered when no items match the current query.
8
8
  */
9
9
  type AutocompleteEmptyProps = {
10
- /** Content to show when empty (defaults to "No results"). */
10
+ /** The content while the list is empty. The default is "No results". */
11
11
  children?: Snippet;
12
12
  class?: string;
13
13
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
@@ -4,7 +4,7 @@ import type { HTMLAttributes } from 'svelte/elements';
4
4
  * Autocomplete.Empty - Rendered when no items match the current query.
5
5
  */
6
6
  type AutocompleteEmptyProps = {
7
- /** Content to show when empty (defaults to "No results"). */
7
+ /** The content while the list is empty. The default is "No results". */
8
8
  children?: Snippet;
9
9
  class?: string;
10
10
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
@@ -8,11 +8,11 @@
8
8
  } from '../../primitives/input-modality';
9
9
 
10
10
  type AutocompleteInputProps = HTMLInputAttributes & {
11
- /** Accessible label for the input. */
11
+ /** The accessible name of the input. */
12
12
  'aria-label'?: string;
13
- /** ID of element that labels this input. */
13
+ /** The id of the element that gives this input its name. */
14
14
  'aria-labelledby'?: string;
15
- /** ID of element that describes this input (e.g. usage instructions). */
15
+ /** The id of the element that describes this input, for example the instructions. */
16
16
  'aria-describedby'?: string;
17
17
  class?: string;
18
18
  };
@@ -1,10 +1,10 @@
1
1
  import type { HTMLInputAttributes } from 'svelte/elements';
2
2
  type AutocompleteInputProps = HTMLInputAttributes & {
3
- /** Accessible label for the input. */
3
+ /** The accessible name of the input. */
4
4
  'aria-label'?: string;
5
- /** ID of element that labels this input. */
5
+ /** The id of the element that gives this input its name. */
6
6
  'aria-labelledby'?: string;
7
- /** ID of element that describes this input (e.g. usage instructions). */
7
+ /** The id of the element that describes this input, for example the instructions. */
8
8
  'aria-describedby'?: string;
9
9
  class?: string;
10
10
  };
@@ -13,9 +13,9 @@
13
13
  * Must be used inside Autocomplete.Item. Only renders when the item is selected.
14
14
  */
15
15
  type AutocompleteItemIndicatorProps = {
16
- /** Content to render when selected (defaults to a checkmark icon). */
16
+ /** The content while the item is selected. The default is a check mark icon. */
17
17
  children?: Snippet;
18
- /** Force the indicator to render regardless of selection state. */
18
+ /** Keeps the indicator in the DOM, for each selection state. */
19
19
  forceMount?: boolean;
20
20
  class?: string;
21
21
  } & Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'children'>;
@@ -5,9 +5,9 @@ import type { HTMLAttributes } from 'svelte/elements';
5
5
  * Must be used inside Autocomplete.Item. Only renders when the item is selected.
6
6
  */
7
7
  type AutocompleteItemIndicatorProps = {
8
- /** Content to render when selected (defaults to a checkmark icon). */
8
+ /** The content while the item is selected. The default is a check mark icon. */
9
9
  children?: Snippet;
10
- /** Force the indicator to render regardless of selection state. */
10
+ /** Keeps the indicator in the DOM, for each selection state. */
11
11
  forceMount?: boolean;
12
12
  class?: string;
13
13
  } & Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'children'>;
@@ -22,9 +22,9 @@
22
22
  | 'children'
23
23
  | 'emptyPlaceholder'
24
24
  > & {
25
- /** Optional items for dynamic rendering. */
25
+ /** The items, for a list that the component makes from an array. */
26
26
  items?: Iterable<T>;
27
- /** Content of the list. Receives item in dynamic mode. */
27
+ /** The content of the list. From an array of items, it receives one item. */
28
28
  children?: Snippet<[T]> | Snippet;
29
29
  };
30
30
 
@@ -29,9 +29,9 @@ declare function $$render<T extends object = object>(): {
29
29
  context?: ListBoxContext;
30
30
  element?: HTMLElement;
31
31
  }, "children" | "id" | "element" | "context" | "disableFocusHandling" | "emptyPlaceholder" | "items"> & {
32
- /** Optional items for dynamic rendering. */
32
+ /** The items, for a list that the component makes from an array. */
33
33
  items?: Iterable<T>;
34
- /** Content of the list. Receives item in dynamic mode. */
34
+ /** The content of the list. From an array of items, it receives one item. */
35
35
  children?: Snippet<[T]> | Snippet;
36
36
  };
37
37
  exports: {};
@@ -11,22 +11,22 @@
11
11
  import { useVirtualFocus } from '../../hooks/use-virtual-focus.svelte';
12
12
 
13
13
  type AutocompleteProps = {
14
- /** Stable ID used to generate internal ARIA IDs (recommended for SSR). */
14
+ /** A stable id, from which the component makes its internal ARIA ids. Give one on a server. */
15
15
  id?: string;
16
16
  disabled?: boolean;
17
17
  readonly?: boolean;
18
- /** Current search query. Can be bound with bind:inputValue. */
18
+ /** The search text. You can bind it with `bind:inputValue`. */
19
19
  inputValue?: string;
20
- /** Initial query for uncontrolled mode. */
20
+ /** The search text at the start, for when the component controls the state. */
21
21
  defaultInputValue?: string;
22
22
  /**
23
- * Local filter function. Defaults to a case-insensitive "contains" match.
24
- * Set to `null` to disable local filtering (e.g. when filtering server-side).
23
+ * The local filter function. The default compares the text and ignores the letter case. Set it
24
+ * to `null` to stop the local filter, for example when a server sends the filtered results.
25
25
  */
26
26
  filter?: AutocompleteFilter | null;
27
- /** Automatically highlight the first matching item as the query changes. */
27
+ /** Highlights the first item that agrees with the search text, each time that text changes. */
28
28
  autoHighlight?: boolean;
29
- /** Called when the search query changes. */
29
+ /** The component calls it when the search text changes. */
30
30
  onInputChange?: (value: string) => void;
31
31
  children?: Snippet;
32
32
  class?: string;
@@ -1,22 +1,22 @@
1
1
  import { type Snippet } from 'svelte';
2
2
  import { type AutocompleteFilter } from './context';
3
3
  type AutocompleteProps = {
4
- /** Stable ID used to generate internal ARIA IDs (recommended for SSR). */
4
+ /** A stable id, from which the component makes its internal ARIA ids. Give one on a server. */
5
5
  id?: string;
6
6
  disabled?: boolean;
7
7
  readonly?: boolean;
8
- /** Current search query. Can be bound with bind:inputValue. */
8
+ /** The search text. You can bind it with `bind:inputValue`. */
9
9
  inputValue?: string;
10
- /** Initial query for uncontrolled mode. */
10
+ /** The search text at the start, for when the component controls the state. */
11
11
  defaultInputValue?: string;
12
12
  /**
13
- * Local filter function. Defaults to a case-insensitive "contains" match.
14
- * Set to `null` to disable local filtering (e.g. when filtering server-side).
13
+ * The local filter function. The default compares the text and ignores the letter case. Set it
14
+ * to `null` to stop the local filter, for example when a server sends the filtered results.
15
15
  */
16
16
  filter?: AutocompleteFilter | null;
17
- /** Automatically highlight the first matching item as the query changes. */
17
+ /** Highlights the first item that agrees with the search text, each time that text changes. */
18
18
  autoHighlight?: boolean;
19
- /** Called when the search query changes. */
19
+ /** The component calls it when the search text changes. */
20
20
  onInputChange?: (value: string) => void;
21
21
  children?: Snippet;
22
22
  class?: string;
@@ -6,7 +6,7 @@
6
6
  * of available results to screen readers as the query changes.
7
7
  */
8
8
  type AutocompleteStatusProps = {
9
- /** Build the announced message from the visible item count. */
9
+ /** Makes the announced message from the number of the items that the user sees. */
10
10
  formatMessage?: (count: number) => string;
11
11
  };
12
12
 
@@ -3,7 +3,7 @@
3
3
  * of available results to screen readers as the query changes.
4
4
  */
5
5
  type AutocompleteStatusProps = {
6
- /** Build the announced message from the visible item count. */
6
+ /** Makes the announced message from the number of the items that the user sees. */
7
7
  formatMessage?: (count: number) => string;
8
8
  };
9
9
  declare const AutocompleteStatus: import("svelte").Component<AutocompleteStatusProps, {}, "">;
@@ -44,5 +44,5 @@
44
44
 
45
45
  ## Notes
46
46
 
47
- - When `type="submit"` and `pending` is true, the rendered button type switches to `button` to prevent implicit and explicit form submission.
47
+ - If the type is `submit` and `pending` is true, the component makes the element with the type `button`. Thus the form does not submit.
48
48
  - Pending does not serialize `data-disabled`; it is represented by `data-pending`.
@@ -20,26 +20,31 @@
20
20
  HTMLButtonAttributes,
21
21
  'children' | 'class' | 'disabled' | 'aria-disabled'
22
22
  > & {
23
- /** Content. Receives the live render state (hovered, pressed, focused, pending…) when used as a one-argument snippet. */
23
+ /**
24
+ * The content. As a snippet with one argument, it receives the live render state: hovered,
25
+ * pressed, focused, and pending.
26
+ */
24
27
  children?: Snippet<[ButtonRenderState]> | Snippet;
25
28
  class?: string;
26
- /** Keeps the button focusable while blocking activation, and announces the pending state politely. */
29
+ /**
30
+ * Keeps the button focusable, but stops the activation. It announces the pending state politely.
31
+ */
27
32
  pending?: boolean | null;
28
33
  /** Disables the button natively. */
29
34
  disabled?: boolean | null;
30
35
  /**
31
- * Keeps a disabled button in the tab order, marking it `aria-disabled` instead of
32
- * using the native attribute. Activation is still blocked.
36
+ * Keeps a disabled button in the tab order. The button gets `aria-disabled` and not the native
37
+ * attribute. The component still stops the activation.
33
38
  *
34
- * For controls that are unavailable more often than not — the move buttons of a
35
- * transfer list, a toolbar that reacts to a selection. Natively disabling those hides
36
- * them from anyone exploring with a keyboard, and shifts the tab order underfoot as
37
- * the user works. Unlike `pending`, this says "not applicable", not "busy".
39
+ * Use it for a control that is unavailable more often than available. The move buttons of a
40
+ * transfer list are one example, and a toolbar that obeys a selection is another. If you disable
41
+ * those natively, a keyboard user does not find them, and the tab order changes while the user
42
+ * works. `pending` says "busy". This says "not applicable".
38
43
  */
39
44
  focusableWhenDisabled?: boolean | null;
40
- /** Bindable reference to the rendered button element. */
45
+ /** A bindable reference to the button element. */
41
46
  element?: HTMLButtonElement | null;
42
- /** Overrides the internally tracked pressed state. */
47
+ /** Replaces the pressed state that the component holds. */
43
48
  pressed?: boolean;
44
49
  };
45
50
 
@@ -9,26 +9,31 @@ export type ButtonRenderState = {
9
9
  pending: boolean;
10
10
  };
11
11
  type ButtonRootProps = Omit<HTMLButtonAttributes, 'children' | 'class' | 'disabled' | 'aria-disabled'> & {
12
- /** Content. Receives the live render state (hovered, pressed, focused, pending…) when used as a one-argument snippet. */
12
+ /**
13
+ * The content. As a snippet with one argument, it receives the live render state: hovered,
14
+ * pressed, focused, and pending.
15
+ */
13
16
  children?: Snippet<[ButtonRenderState]> | Snippet;
14
17
  class?: string;
15
- /** Keeps the button focusable while blocking activation, and announces the pending state politely. */
18
+ /**
19
+ * Keeps the button focusable, but stops the activation. It announces the pending state politely.
20
+ */
16
21
  pending?: boolean | null;
17
22
  /** Disables the button natively. */
18
23
  disabled?: boolean | null;
19
24
  /**
20
- * Keeps a disabled button in the tab order, marking it `aria-disabled` instead of
21
- * using the native attribute. Activation is still blocked.
25
+ * Keeps a disabled button in the tab order. The button gets `aria-disabled` and not the native
26
+ * attribute. The component still stops the activation.
22
27
  *
23
- * For controls that are unavailable more often than not — the move buttons of a
24
- * transfer list, a toolbar that reacts to a selection. Natively disabling those hides
25
- * them from anyone exploring with a keyboard, and shifts the tab order underfoot as
26
- * the user works. Unlike `pending`, this says "not applicable", not "busy".
28
+ * Use it for a control that is unavailable more often than available. The move buttons of a
29
+ * transfer list are one example, and a toolbar that obeys a selection is another. If you disable
30
+ * those natively, a keyboard user does not find them, and the tab order changes while the user
31
+ * works. `pending` says "busy". This says "not applicable".
27
32
  */
28
33
  focusableWhenDisabled?: boolean | null;
29
- /** Bindable reference to the rendered button element. */
34
+ /** A bindable reference to the button element. */
30
35
  element?: HTMLButtonElement | null;
31
- /** Overrides the internally tracked pressed state. */
36
+ /** Replaces the pressed state that the component holds. */
32
37
  pressed?: boolean;
33
38
  };
34
39
  declare const ButtonRoot: import("svelte").Component<ButtonRootProps, {}, "element">;
@@ -11,12 +11,12 @@
11
11
  - In controlled mode, use `value` with `onChange`; in uncontrolled mode, use `defaultValue`.
12
12
  - In `single` mode, `value/defaultValue` is `YYYY-MM-DD`.
13
13
  - In `range` mode, `value/defaultValue` is `{ start?: 'YYYY-MM-DD', end?: 'YYYY-MM-DD' }`.
14
- - `visibleMonths` controls how many months are rendered and how paging behaves.
14
+ - `visibleMonths` sets the number of the months, and it changes how far the triggers move.
15
15
  - `showOutsideDays` controls whether days outside the current month are shown; default is `false`.
16
16
  - `isDateUnavailable` marks specific days as non-focusable and non-selectable.
17
17
  - Use `LocaleProvider` to localize month/day labels and first day of week.
18
18
  - Use `firstDayOfWeek` to override the locale-specified first day of the week.
19
- - Use `monthHeadingStyle="month-year"` on `Calendar.Root` to render headings as separate month and year parts, e.g. `May 2026` instead of locale-composed strings.
19
+ - Use `monthHeadingStyle="month-year"` on `Calendar.Root` to make the heading in two parts: the month and the year. An example is `May 2026`, in place of one string from the locale.
20
20
  - Use `weekdayStyle="narrow" | "short" | "long"` on `Calendar.Grid` to control weekday header labels.
21
21
  - Keyboard navigation uses `Arrow` keys for day/week movement and `Home/End` for month edges.
22
22
 
@@ -38,7 +38,7 @@
38
38
 
39
39
  ## Internal Notes
40
40
 
41
- - `PageUp/PageDown` try to preserve the day when crossing months; if no focusable target exists in the destination month and a range is pending, focus falls back to the reachable edge in the current month (aligned with `Home/End` behavior).
41
+ - The `PageUp` key and the `PageDown` key keep the day number when they cross a month. The new month can have no day that takes the focus, while a range is not complete. The focus then goes to the last available day of the current month. The `Home` key and the `End` key do the same.
42
42
  - In `selectionMode="range"`, the first click starts the range (`start`) and the second click confirms it (`end`), with automatic normalization for reversed selection order.
43
43
  - In `selectionMode="range"`, hover updates a live preview before confirmation.
44
44
 
@@ -6,10 +6,9 @@
6
6
 
7
7
  type CalendarGridHeaderProps = {
8
8
  /**
9
- * Custom header cell rendering. Receives the styled weekday label (per
10
- * `weekdayStyle`) and the long weekday name, useful as an accessible
11
- * label when the styled label is narrow (e.g. "M" for both Monday and
12
- * Wednesday in some locales).
9
+ * Your own content for a header cell. It receives the weekday name in the length of
10
+ * `weekdayStyle`, and also the long weekday name. Use the long name as the accessible name when
11
+ * the short one is narrow. In some locales, "M" is the narrow name of Monday and of Wednesday.
13
12
  */
14
13
  children?: Snippet<[string, string]>;
15
14
  class?: string;
@@ -1,10 +1,9 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  type CalendarGridHeaderProps = {
3
3
  /**
4
- * Custom header cell rendering. Receives the styled weekday label (per
5
- * `weekdayStyle`) and the long weekday name, useful as an accessible
6
- * label when the styled label is narrow (e.g. "M" for both Monday and
7
- * Wednesday in some locales).
4
+ * Your own content for a header cell. It receives the weekday name in the length of
5
+ * `weekdayStyle`, and also the long weekday name. Use the long name as the accessible name when
6
+ * the short one is narrow. In some locales, "M" is the narrow name of Monday and of Wednesday.
8
7
  */
9
8
  children?: Snippet<[string, string]>;
10
9
  class?: string;
@@ -42,9 +42,15 @@
42
42
  showOutsideDays?: boolean;
43
43
  firstDayOfWeek?: CalendarFirstDayOfWeek;
44
44
  monthHeadingStyle?: CalendarMonthHeadingStyle;
45
- /** Earliest selectable date (`YYYY-MM-DD`). Earlier dates report unavailable and page/focus navigation clamps at this bound. */
45
+ /**
46
+ * The first date that the user can select (`YYYY-MM-DD`). A date before it is unavailable, and
47
+ * the triggers and the focus stop at this limit.
48
+ */
46
49
  minValue?: CalendarDateValue;
47
- /** Latest selectable date (`YYYY-MM-DD`). Later dates report unavailable and page/focus navigation clamps at this bound. */
50
+ /**
51
+ * The last date that the user can select (`YYYY-MM-DD`). A date after it is unavailable, and the
52
+ * triggers and the focus stop at this limit.
53
+ */
48
54
  maxValue?: CalendarDateValue;
49
55
  isDateUnavailable?: (date: string) => boolean;
50
56
  disabled?: boolean;