@human-kit/ui 1.0.0-beta.1 → 1.0.0-beta.11

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 (495) hide show
  1. package/README.md +27 -16
  2. package/dist/FOCUS_STATE_CONTRACT.md +17 -4
  3. package/dist/FOCUS_STATE_REVIEW_TEMPLATE.md +8 -8
  4. package/dist/accordion/README.md +3 -3
  5. package/dist/accordion/types.d.ts +37 -23
  6. package/dist/autocomplete/README.md +6 -7
  7. package/dist/autocomplete/empty/autocomplete-empty.svelte +1 -1
  8. package/dist/autocomplete/empty/autocomplete-empty.svelte.d.ts +1 -1
  9. package/dist/autocomplete/input/autocomplete-input.svelte +3 -3
  10. package/dist/autocomplete/input/autocomplete-input.svelte.d.ts +3 -3
  11. package/dist/autocomplete/item/autocomplete-item.svelte +10 -0
  12. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte +2 -2
  13. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte.d.ts +2 -2
  14. package/dist/autocomplete/list/autocomplete-list.svelte +2 -2
  15. package/dist/autocomplete/list/autocomplete-list.svelte.d.ts +5 -3
  16. package/dist/autocomplete/root/autocomplete.svelte +7 -7
  17. package/dist/autocomplete/root/autocomplete.svelte.d.ts +7 -7
  18. package/dist/autocomplete/status/autocomplete-status.svelte +1 -1
  19. package/dist/autocomplete/status/autocomplete-status.svelte.d.ts +1 -1
  20. package/dist/avatar/README.md +52 -0
  21. package/dist/avatar/count/avatar-count.svelte +56 -0
  22. package/dist/avatar/count/avatar-count.svelte.d.ts +4 -0
  23. package/dist/avatar/fallback/avatar-fallback.svelte +67 -0
  24. package/dist/avatar/fallback/avatar-fallback.svelte.d.ts +4 -0
  25. package/dist/avatar/group/avatar-group.svelte +65 -0
  26. package/dist/avatar/group/avatar-group.svelte.d.ts +4 -0
  27. package/dist/avatar/group/context.d.ts +15 -0
  28. package/dist/avatar/group/context.js +15 -0
  29. package/dist/avatar/image/avatar-image.svelte +104 -0
  30. package/dist/avatar/image/avatar-image.svelte.d.ts +4 -0
  31. package/dist/avatar/index.d.ts +22 -0
  32. package/dist/avatar/index.js +10 -0
  33. package/dist/avatar/index.parts.d.ts +5 -0
  34. package/dist/avatar/index.parts.js +5 -0
  35. package/dist/avatar/root/avatar-root.svelte +79 -0
  36. package/dist/avatar/root/avatar-root.svelte.d.ts +4 -0
  37. package/dist/avatar/root/context.d.ts +14 -0
  38. package/dist/avatar/root/context.js +15 -0
  39. package/dist/avatar/types.d.ts +84 -0
  40. package/dist/avatar/types.js +1 -0
  41. package/dist/breadcrumbs/README.md +65 -0
  42. package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte +62 -0
  43. package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte.d.ts +4 -0
  44. package/dist/breadcrumbs/index.d.ts +23 -0
  45. package/dist/breadcrumbs/index.js +10 -0
  46. package/dist/breadcrumbs/index.parts.d.ts +6 -0
  47. package/dist/breadcrumbs/index.parts.js +6 -0
  48. package/dist/breadcrumbs/item/breadcrumbs-item.svelte +42 -0
  49. package/dist/breadcrumbs/item/breadcrumbs-item.svelte.d.ts +4 -0
  50. package/dist/breadcrumbs/link/breadcrumbs-link.svelte +47 -0
  51. package/dist/breadcrumbs/link/breadcrumbs-link.svelte.d.ts +4 -0
  52. package/dist/breadcrumbs/list/breadcrumbs-list.svelte +31 -0
  53. package/dist/breadcrumbs/list/breadcrumbs-list.svelte.d.ts +4 -0
  54. package/dist/breadcrumbs/root/breadcrumbs-root.svelte +112 -0
  55. package/dist/breadcrumbs/root/breadcrumbs-root.svelte.d.ts +4 -0
  56. package/dist/breadcrumbs/root/context.d.ts +19 -0
  57. package/dist/breadcrumbs/root/context.js +15 -0
  58. package/dist/breadcrumbs/separator/breadcrumbs-separator.svelte +35 -0
  59. package/dist/breadcrumbs/separator/breadcrumbs-separator.svelte.d.ts +4 -0
  60. package/dist/breadcrumbs/types.d.ts +80 -0
  61. package/dist/breadcrumbs/types.js +1 -0
  62. package/dist/button/README.md +1 -1
  63. package/dist/button/root/button-root.svelte +37 -7
  64. package/dist/button/root/button-root.svelte.d.ts +19 -4
  65. package/dist/calendar/README.md +3 -3
  66. package/dist/calendar/body-cell/calendar-body-cell.svelte +7 -0
  67. package/dist/calendar/grid-header/calendar-grid-header.svelte +3 -4
  68. package/dist/calendar/grid-header/calendar-grid-header.svelte.d.ts +3 -4
  69. package/dist/calendar/root/calendar-root.svelte +8 -2
  70. package/dist/calendar/root/calendar-root.svelte.d.ts +8 -2
  71. package/dist/calendar/trigger-next/README.md +1 -1
  72. package/dist/calendar/trigger-previous/README.md +1 -1
  73. package/dist/checkbox/README.md +1 -1
  74. package/dist/checkbox/indicator/README.md +1 -1
  75. package/dist/checkbox/indicator/checkbox-indicator.svelte +1 -0
  76. package/dist/checkbox/indicator/checkbox-indicator.svelte.d.ts +1 -0
  77. package/dist/checkbox/root/README.md +2 -2
  78. package/dist/checkbox/root/checkbox-root.svelte +118 -40
  79. package/dist/checkbox/root/checkbox-root.svelte.d.ts +17 -10
  80. package/dist/checkbox-group/README.md +95 -0
  81. package/dist/checkbox-group/index.d.ts +15 -0
  82. package/dist/checkbox-group/index.js +6 -0
  83. package/dist/checkbox-group/index.parts.d.ts +4 -0
  84. package/dist/checkbox-group/index.parts.js +7 -0
  85. package/dist/checkbox-group/label/checkbox-group-label.svelte +36 -0
  86. package/dist/checkbox-group/label/checkbox-group-label.svelte.d.ts +4 -0
  87. package/dist/checkbox-group/root/checkbox-group-root.svelte +118 -0
  88. package/dist/checkbox-group/root/checkbox-group-root.svelte.d.ts +4 -0
  89. package/dist/checkbox-group/root/context.svelte.d.ts +52 -0
  90. package/dist/checkbox-group/root/context.svelte.js +251 -0
  91. package/dist/checkbox-group/types.d.ts +57 -0
  92. package/dist/checkbox-group/types.js +1 -0
  93. package/dist/clock/README.md +3 -3
  94. package/dist/clock/axis/README.md +1 -1
  95. package/dist/clock/root/README.md +1 -1
  96. package/dist/clock/wheel-column/clock-wheel-column.svelte +1 -1
  97. package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +1 -1
  98. package/dist/collapsible/README.md +3 -3
  99. package/dist/collapsible/types.d.ts +10 -7
  100. package/dist/combobox/README.md +2 -2
  101. package/dist/combobox/button/README.md +6 -6
  102. package/dist/combobox/input/README.md +1 -1
  103. package/dist/combobox/input/combobox-input.svelte +3 -3
  104. package/dist/combobox/input/combobox-input.svelte.d.ts +3 -3
  105. package/dist/combobox/item/combobox-listboxitem.svelte +4 -2
  106. package/dist/combobox/item/combobox-listboxitem.svelte.d.ts +4 -2
  107. package/dist/combobox/item-indicator/README.md +1 -1
  108. package/dist/combobox/item-indicator/combobox-item-indicator.svelte +2 -2
  109. package/dist/combobox/item-indicator/combobox-item-indicator.svelte.d.ts +2 -2
  110. package/dist/combobox/list/combobox-listbox.svelte +11 -8
  111. package/dist/combobox/list/combobox-listbox.svelte.d.ts +14 -9
  112. package/dist/combobox/popover/README.md +1 -1
  113. package/dist/combobox/popover/combobox-popover.svelte +4 -56
  114. package/dist/combobox/root/README.md +24 -24
  115. package/dist/combobox/root/combobox.svelte +26 -17
  116. package/dist/combobox/root/combobox.svelte.d.ts +26 -17
  117. package/dist/combobox/status/README.md +1 -1
  118. package/dist/combobox/status/combobox-status.svelte +1 -1
  119. package/dist/combobox/status/combobox-status.svelte.d.ts +1 -1
  120. package/dist/combobox/tag/README.md +1 -1
  121. package/dist/combobox/tag/combobox-tag.svelte +1 -1
  122. package/dist/combobox/tag/combobox-tag.svelte.d.ts +1 -1
  123. package/dist/combobox/tag-remove/README.md +1 -1
  124. package/dist/combobox/tag-remove/combobox-tag-remove.svelte +4 -5
  125. package/dist/combobox/tag-remove/combobox-tag-remove.svelte.d.ts +4 -5
  126. package/dist/combobox/tags/README.md +1 -1
  127. package/dist/combobox/tags/combobox-tags.svelte +11 -11
  128. package/dist/combobox/tags/combobox-tags.svelte.d.ts +11 -11
  129. package/dist/combobox/trigger/README.md +7 -7
  130. package/dist/datepicker/README.md +4 -4
  131. package/dist/datepicker/input/date-picker-input.svelte +3 -4
  132. package/dist/datepicker/input/date-picker-input.svelte.d.ts +3 -4
  133. package/dist/datepicker/root/date-picker-root.svelte +1 -1
  134. package/dist/datepicker/trigger/README.md +1 -1
  135. package/dist/daterangepicker/README.md +3 -3
  136. package/dist/daterangepicker/input/date-range-picker-input.svelte +3 -4
  137. package/dist/daterangepicker/input/date-range-picker-input.svelte.d.ts +3 -4
  138. package/dist/dialog/README.md +1 -1
  139. package/dist/dialog/close/dialog-close.svelte +3 -3
  140. package/dist/dialog/close/dialog-close.svelte.d.ts +3 -3
  141. package/dist/dialog/content/dialog-content.svelte +4 -4
  142. package/dist/dialog/content/dialog-content.svelte.d.ts +4 -4
  143. package/dist/dialog/description/dialog-description.svelte +3 -3
  144. package/dist/dialog/description/dialog-description.svelte.d.ts +3 -3
  145. package/dist/dialog/overlay/dialog-overlay.svelte +1 -1
  146. package/dist/dialog/overlay/dialog-overlay.svelte.d.ts +1 -1
  147. package/dist/dialog/portal/dialog-portal.svelte +1 -1
  148. package/dist/dialog/portal/dialog-portal.svelte.d.ts +1 -1
  149. package/dist/dialog/root/README.md +1 -1
  150. package/dist/dialog/root/dialog-root.svelte +49 -11
  151. package/dist/dialog/root/dialog-root.svelte.d.ts +11 -9
  152. package/dist/dialog/title/dialog-title.svelte +3 -3
  153. package/dist/dialog/title/dialog-title.svelte.d.ts +3 -3
  154. package/dist/dialog/trigger/README.md +1 -1
  155. package/dist/drawer/README.md +3 -3
  156. package/dist/drawer/body/drawer-body.svelte +2 -2
  157. package/dist/drawer/body/drawer-body.svelte.d.ts +2 -2
  158. package/dist/drawer/close/drawer-close.svelte +3 -3
  159. package/dist/drawer/close/drawer-close.svelte.d.ts +3 -3
  160. package/dist/drawer/content/drawer-content.svelte +12 -9
  161. package/dist/drawer/content/drawer-content.svelte.d.ts +12 -9
  162. package/dist/drawer/description/drawer-description.svelte +3 -3
  163. package/dist/drawer/description/drawer-description.svelte.d.ts +3 -3
  164. package/dist/drawer/indent/drawer-indent-background.svelte +1 -1
  165. package/dist/drawer/indent/drawer-indent-background.svelte.d.ts +1 -1
  166. package/dist/drawer/indent/drawer-indent.svelte +2 -2
  167. package/dist/drawer/indent/drawer-indent.svelte.d.ts +2 -2
  168. package/dist/drawer/overlay/drawer-overlay.svelte +1 -1
  169. package/dist/drawer/overlay/drawer-overlay.svelte.d.ts +1 -1
  170. package/dist/drawer/portal/drawer-portal.svelte +1 -1
  171. package/dist/drawer/portal/drawer-portal.svelte.d.ts +1 -1
  172. package/dist/drawer/root/context.d.ts +1 -1
  173. package/dist/drawer/root/drawer-root.svelte +40 -25
  174. package/dist/drawer/root/drawer-root.svelte.d.ts +25 -23
  175. package/dist/drawer/swipe-area/drawer-swipe-area.svelte +3 -3
  176. package/dist/drawer/swipe-area/drawer-swipe-area.svelte.d.ts +3 -3
  177. package/dist/drawer/title/drawer-title.svelte +3 -3
  178. package/dist/drawer/title/drawer-title.svelte.d.ts +3 -3
  179. package/dist/drawer/trigger/drawer-trigger.svelte +6 -6
  180. package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +6 -6
  181. package/dist/drawer/viewport/drawer-viewport.svelte +2 -2
  182. package/dist/drawer/viewport/drawer-viewport.svelte.d.ts +2 -2
  183. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +1 -1
  184. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte.d.ts +1 -1
  185. package/dist/dropzone/README.md +4 -6
  186. package/dist/index.d.ts +22 -0
  187. package/dist/index.js +21 -0
  188. package/dist/input/input.svelte +6 -6
  189. package/dist/input/input.svelte.d.ts +6 -6
  190. package/dist/internal/environment.d.ts +11 -0
  191. package/dist/internal/environment.js +14 -0
  192. package/dist/internal/localized-strings.d.ts +152 -0
  193. package/dist/internal/localized-strings.js +152 -0
  194. package/dist/internal/number-precision.d.ts +9 -0
  195. package/dist/internal/number-precision.js +27 -0
  196. package/dist/listbox/README.md +20 -1
  197. package/dist/listbox/item/listbox-item.svelte +35 -17
  198. package/dist/listbox/item/listbox-item.svelte.d.ts +24 -15
  199. package/dist/listbox/root/README.md +1 -1
  200. package/dist/listbox/root/context.d.ts +26 -1
  201. package/dist/listbox/root/context.js +108 -1
  202. package/dist/listbox/root/listbox.svelte +129 -39
  203. package/dist/listbox/root/listbox.svelte.d.ts +57 -33
  204. package/dist/locale-provider/README.md +1 -6
  205. package/dist/menu/README.md +41 -4
  206. package/dist/menu/content/menu-content.svelte +28 -13
  207. package/dist/menu/content/menu-content.svelte.d.ts +14 -9
  208. package/dist/menu/context-trigger/menu-context-trigger.svelte +194 -0
  209. package/dist/menu/context-trigger/menu-context-trigger.svelte.d.ts +35 -0
  210. package/dist/menu/group/menu-group-label.svelte +1 -1
  211. package/dist/menu/group/menu-group-label.svelte.d.ts +1 -1
  212. package/dist/menu/index.d.ts +4 -1
  213. package/dist/menu/index.js +1 -0
  214. package/dist/menu/index.parts.d.ts +1 -0
  215. package/dist/menu/index.parts.js +1 -0
  216. package/dist/menu/item/menu-item.svelte +11 -8
  217. package/dist/menu/item/menu-item.svelte.d.ts +11 -8
  218. package/dist/menu/overlay/menu-overlay.svelte +1 -1
  219. package/dist/menu/overlay/menu-overlay.svelte.d.ts +1 -1
  220. package/dist/menu/root/context.d.ts +24 -3
  221. package/dist/menu/root/focus-state.d.ts +2 -2
  222. package/dist/menu/root/focus-state.js +8 -32
  223. package/dist/menu/root/menu-root.svelte +14 -8
  224. package/dist/menu/root/menu-root.svelte.d.ts +14 -8
  225. package/dist/menu/root/menu-state.svelte.d.ts +1 -1
  226. package/dist/menu/root/menu-state.svelte.js +24 -1
  227. package/dist/menu/separator/menu-separator.svelte +1 -1
  228. package/dist/menu/separator/menu-separator.svelte.d.ts +1 -1
  229. package/dist/menu/submenu/menu-submenu-root.svelte +10 -7
  230. package/dist/menu/submenu/menu-submenu-root.svelte.d.ts +10 -7
  231. package/dist/numberfield/root/README.md +1 -1
  232. package/dist/numberfield/root/number-utils.js +1 -20
  233. package/dist/numberfield/scrub-area-cursor/README.md +1 -1
  234. package/dist/popover/README.md +1 -1
  235. package/dist/popover/content/popover-content.svelte +21 -15
  236. package/dist/popover/content/popover-content.svelte.d.ts +19 -14
  237. package/dist/popover/overlay/popover-overlay.svelte +1 -1
  238. package/dist/popover/overlay/popover-overlay.svelte.d.ts +1 -1
  239. package/dist/popover/root/README.md +1 -1
  240. package/dist/popover/root/focus-state.d.ts +2 -2
  241. package/dist/popover/root/focus-state.js +7 -34
  242. package/dist/popover/root/popover-root.svelte +13 -10
  243. package/dist/popover/root/popover-root.svelte.d.ts +13 -10
  244. package/dist/popover/trigger/README.md +1 -1
  245. package/dist/primitives/aria-hide-outside.d.ts +13 -0
  246. package/dist/primitives/aria-hide-outside.js +7 -1
  247. package/dist/primitives/contain-wheel.d.ts +9 -0
  248. package/dist/primitives/contain-wheel.js +41 -0
  249. package/dist/primitives/floating.d.ts +42 -8
  250. package/dist/primitives/floating.js +70 -6
  251. package/dist/primitives/focus-trap.d.ts +2 -0
  252. package/dist/primitives/focus-trap.js +7 -1
  253. package/dist/primitives/focus-visible.svelte.d.ts +14 -0
  254. package/dist/primitives/focus-visible.svelte.js +19 -0
  255. package/dist/primitives/index.d.ts +2 -0
  256. package/dist/primitives/index.js +2 -0
  257. package/dist/primitives/input-modality.d.ts +7 -0
  258. package/dist/primitives/input-modality.js +32 -5
  259. package/dist/primitives/keyboard-navigation.d.ts +29 -5
  260. package/dist/primitives/keyboard-navigation.js +24 -16
  261. package/dist/primitives/long-press.d.ts +59 -0
  262. package/dist/primitives/long-press.js +142 -0
  263. package/dist/primitives/presence.svelte.js +6 -1
  264. package/dist/primitives/scroll-lock.d.ts +24 -0
  265. package/dist/primitives/scroll-lock.js +75 -6
  266. package/dist/primitives/trigger-focus-state.d.ts +29 -0
  267. package/dist/primitives/trigger-focus-state.js +57 -0
  268. package/dist/progress/README.md +54 -0
  269. package/dist/progress/index.d.ts +21 -0
  270. package/dist/progress/index.js +9 -0
  271. package/dist/progress/index.parts.d.ts +5 -0
  272. package/dist/progress/index.parts.js +5 -0
  273. package/dist/progress/indicator/progress-indicator.svelte +37 -0
  274. package/dist/progress/indicator/progress-indicator.svelte.d.ts +4 -0
  275. package/dist/progress/label/progress-label.svelte +34 -0
  276. package/dist/progress/label/progress-label.svelte.d.ts +4 -0
  277. package/dist/progress/root/context.d.ts +26 -0
  278. package/dist/progress/root/context.js +15 -0
  279. package/dist/progress/root/progress-root.svelte +136 -0
  280. package/dist/progress/root/progress-root.svelte.d.ts +4 -0
  281. package/dist/progress/root/progress-utils.d.ts +12 -0
  282. package/dist/progress/root/progress-utils.js +41 -0
  283. package/dist/progress/track/progress-track.svelte +27 -0
  284. package/dist/progress/track/progress-track.svelte.d.ts +4 -0
  285. package/dist/progress/types.d.ts +81 -0
  286. package/dist/progress/types.js +1 -0
  287. package/dist/progress/value/progress-value.svelte +36 -0
  288. package/dist/progress/value/progress-value.svelte.d.ts +4 -0
  289. package/dist/radio-group/README.md +103 -0
  290. package/dist/radio-group/index.d.ts +18 -0
  291. package/dist/radio-group/index.js +9 -0
  292. package/dist/radio-group/index.parts.d.ts +4 -0
  293. package/dist/radio-group/index.parts.js +4 -0
  294. package/dist/radio-group/indicator/radio-group-indicator.svelte +43 -0
  295. package/dist/radio-group/indicator/radio-group-indicator.svelte.d.ts +12 -0
  296. package/dist/radio-group/item/context.d.ts +18 -0
  297. package/dist/radio-group/item/context.js +15 -0
  298. package/dist/radio-group/item/radio-group-item.svelte +377 -0
  299. package/dist/radio-group/item/radio-group-item.svelte.d.ts +35 -0
  300. package/dist/radio-group/label/radio-group-label.svelte +37 -0
  301. package/dist/radio-group/label/radio-group-label.svelte.d.ts +4 -0
  302. package/dist/radio-group/root/context.svelte.d.ts +57 -0
  303. package/dist/radio-group/root/context.svelte.js +284 -0
  304. package/dist/radio-group/root/radio-group-root.svelte +193 -0
  305. package/dist/radio-group/root/radio-group-root.svelte.d.ts +4 -0
  306. package/dist/radio-group/types.d.ts +50 -0
  307. package/dist/radio-group/types.js +1 -0
  308. package/dist/select/README.md +129 -0
  309. package/dist/select/index.d.ts +30 -0
  310. package/dist/select/index.js +16 -0
  311. package/dist/select/index.parts.d.ts +8 -0
  312. package/dist/select/index.parts.js +9 -0
  313. package/dist/select/item/select-item.svelte +68 -0
  314. package/dist/select/item/select-item.svelte.d.ts +10 -0
  315. package/dist/select/item-indicator/select-item-indicator.svelte +55 -0
  316. package/dist/select/item-indicator/select-item-indicator.svelte.d.ts +4 -0
  317. package/dist/select/label/select-label.svelte +46 -0
  318. package/dist/select/label/select-label.svelte.d.ts +4 -0
  319. package/dist/select/list/select-list.svelte +241 -0
  320. package/dist/select/list/select-list.svelte.d.ts +62 -0
  321. package/dist/select/popover/select-popover.svelte +80 -0
  322. package/dist/select/popover/select-popover.svelte.d.ts +9 -0
  323. package/dist/select/root/context.d.ts +106 -0
  324. package/dist/select/root/context.js +22 -0
  325. package/dist/select/root/select-root.svelte +544 -0
  326. package/dist/select/root/select-root.svelte.d.ts +25 -0
  327. package/dist/select/trigger/select-trigger.svelte +192 -0
  328. package/dist/select/trigger/select-trigger.svelte.d.ts +4 -0
  329. package/dist/select/types.d.ts +133 -0
  330. package/dist/select/types.js +1 -0
  331. package/dist/select/value/select-value.svelte +61 -0
  332. package/dist/select/value/select-value.svelte.d.ts +4 -0
  333. package/dist/separator/README.md +35 -0
  334. package/dist/separator/index.d.ts +7 -0
  335. package/dist/separator/index.js +3 -0
  336. package/dist/separator/separator.svelte +254 -0
  337. package/dist/separator/separator.svelte.d.ts +45 -0
  338. package/dist/separator/types.d.ts +1 -0
  339. package/dist/separator/types.js +1 -0
  340. package/dist/slider/README.md +61 -0
  341. package/dist/slider/fill/slider-fill.svelte +40 -0
  342. package/dist/slider/fill/slider-fill.svelte.d.ts +4 -0
  343. package/dist/slider/index.d.ts +9 -0
  344. package/dist/slider/index.js +8 -0
  345. package/dist/slider/index.parts.d.ts +6 -0
  346. package/dist/slider/index.parts.js +6 -0
  347. package/dist/slider/label/slider-label.svelte +44 -0
  348. package/dist/slider/label/slider-label.svelte.d.ts +4 -0
  349. package/dist/slider/output/slider-output.svelte +46 -0
  350. package/dist/slider/output/slider-output.svelte.d.ts +4 -0
  351. package/dist/slider/root/context.d.ts +106 -0
  352. package/dist/slider/root/context.js +15 -0
  353. package/dist/slider/root/slider-root.svelte +545 -0
  354. package/dist/slider/root/slider-root.svelte.d.ts +4 -0
  355. package/dist/slider/root/slider-utils.d.ts +57 -0
  356. package/dist/slider/root/slider-utils.js +88 -0
  357. package/dist/slider/thumb/slider-thumb.svelte +276 -0
  358. package/dist/slider/thumb/slider-thumb.svelte.d.ts +4 -0
  359. package/dist/slider/track/slider-track.svelte +60 -0
  360. package/dist/slider/track/slider-track.svelte.d.ts +4 -0
  361. package/dist/slider/types.d.ts +144 -0
  362. package/dist/slider/types.js +1 -0
  363. package/dist/switch/root/README.md +2 -2
  364. package/dist/switch/root/switch-root.svelte +32 -18
  365. package/dist/switch/root/switch-root.svelte.d.ts +23 -18
  366. package/dist/switch/thumb/switch-thumb.svelte +1 -1
  367. package/dist/switch/thumb/switch-thumb.svelte.d.ts +1 -1
  368. package/dist/table/README.md +16 -9
  369. package/dist/table/cell/table-cell.svelte +27 -8
  370. package/dist/table/checkbox/table-checkbox.svelte +3 -0
  371. package/dist/table/checkbox-indicator/README.md +1 -1
  372. package/dist/table/column-header-cell/table-column-header-cell.svelte +24 -0
  373. package/dist/table/column-resizer/README.md +2 -2
  374. package/dist/table/index.d.ts +1 -1
  375. package/dist/table/index.js +1 -1
  376. package/dist/table/interactive-cell/table-interactive-cell.svelte +26 -8
  377. package/dist/table/root/README.md +1 -1
  378. package/dist/table/root/context.svelte.d.ts +17 -0
  379. package/dist/table/root/context.svelte.js +113 -17
  380. package/dist/table/root/table-root.svelte +36 -6
  381. package/dist/table/row/table-row.svelte +7 -7
  382. package/dist/table/sort-trigger/README.md +1 -1
  383. package/dist/table/types.d.ts +26 -14
  384. package/dist/tabs/types.d.ts +6 -6
  385. package/dist/timepicker/README.md +3 -2
  386. package/dist/timepicker/input/README.md +1 -1
  387. package/dist/timepicker/input/time-picker-input.svelte +66 -5
  388. package/dist/timepicker/input/time-picker-input.svelte.d.ts +18 -1
  389. package/dist/timepicker/root/README.md +1 -1
  390. package/dist/timepicker/trigger/README.md +1 -1
  391. package/dist/toast/README.md +75 -0
  392. package/dist/toast/action/toast-action.svelte +42 -0
  393. package/dist/toast/action/toast-action.svelte.d.ts +4 -0
  394. package/dist/toast/close/toast-close.svelte +41 -0
  395. package/dist/toast/close/toast-close.svelte.d.ts +4 -0
  396. package/dist/toast/content/toast-content.svelte +24 -0
  397. package/dist/toast/content/toast-content.svelte.d.ts +4 -0
  398. package/dist/toast/description/toast-description.svelte +41 -0
  399. package/dist/toast/description/toast-description.svelte.d.ts +4 -0
  400. package/dist/toast/index.d.ts +34 -0
  401. package/dist/toast/index.js +15 -0
  402. package/dist/toast/index.parts.d.ts +9 -0
  403. package/dist/toast/index.parts.js +9 -0
  404. package/dist/toast/positioner/toast-positioner.svelte +75 -0
  405. package/dist/toast/positioner/toast-positioner.svelte.d.ts +4 -0
  406. package/dist/toast/provider/context.d.ts +36 -0
  407. package/dist/toast/provider/context.js +22 -0
  408. package/dist/toast/provider/toast-manager.svelte.d.ts +113 -0
  409. package/dist/toast/provider/toast-manager.svelte.js +210 -0
  410. package/dist/toast/provider/toast-provider.svelte +98 -0
  411. package/dist/toast/provider/toast-provider.svelte.d.ts +4 -0
  412. package/dist/toast/root/context.d.ts +18 -0
  413. package/dist/toast/root/context.js +15 -0
  414. package/dist/toast/root/toast-root.svelte +296 -0
  415. package/dist/toast/root/toast-root.svelte.d.ts +4 -0
  416. package/dist/toast/title/toast-title.svelte +38 -0
  417. package/dist/toast/title/toast-title.svelte.d.ts +4 -0
  418. package/dist/toast/types.d.ts +100 -0
  419. package/dist/toast/types.js +1 -0
  420. package/dist/toast/viewport/toast-viewport.svelte +389 -0
  421. package/dist/toast/viewport/toast-viewport.svelte.d.ts +4 -0
  422. package/dist/toggle/README.md +1 -1
  423. package/dist/toggle/root/toggle-root.svelte +28 -0
  424. package/dist/toggle/root/toggle-root.svelte.d.ts +19 -0
  425. package/dist/toggle-group/README.md +12 -4
  426. package/dist/toggle-group/index.d.ts +2 -0
  427. package/dist/toggle-group/index.parts.d.ts +1 -0
  428. package/dist/toggle-group/index.parts.js +4 -0
  429. package/dist/toggle-group/root/context.svelte.d.ts +1 -1
  430. package/dist/toggle-group/root/context.svelte.js +20 -11
  431. package/dist/toggle-group/root/toggle-group-root.svelte +20 -15
  432. package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte +13 -0
  433. package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte.d.ts +7 -0
  434. package/dist/toggle-group/types.d.ts +9 -9
  435. package/dist/tooltip/README.md +53 -0
  436. package/dist/tooltip/arrow/tooltip-arrow.svelte +36 -0
  437. package/dist/tooltip/arrow/tooltip-arrow.svelte.d.ts +4 -0
  438. package/dist/tooltip/content/tooltip-content.svelte +148 -0
  439. package/dist/tooltip/content/tooltip-content.svelte.d.ts +4 -0
  440. package/dist/tooltip/index.d.ts +8 -0
  441. package/dist/tooltip/index.js +7 -0
  442. package/dist/tooltip/index.parts.d.ts +5 -0
  443. package/dist/tooltip/index.parts.js +5 -0
  444. package/dist/tooltip/provider/tooltip-provider.svelte +36 -0
  445. package/dist/tooltip/provider/tooltip-provider.svelte.d.ts +4 -0
  446. package/dist/tooltip/root/context.d.ts +46 -0
  447. package/dist/tooltip/root/context.js +22 -0
  448. package/dist/tooltip/root/safe-polygon.d.ts +26 -0
  449. package/dist/tooltip/root/safe-polygon.js +66 -0
  450. package/dist/tooltip/root/tooltip-group.d.ts +26 -0
  451. package/dist/tooltip/root/tooltip-group.js +41 -0
  452. package/dist/tooltip/root/tooltip-root.svelte +459 -0
  453. package/dist/tooltip/root/tooltip-root.svelte.d.ts +4 -0
  454. package/dist/tooltip/trigger/tooltip-trigger.svelte +52 -0
  455. package/dist/tooltip/trigger/tooltip-trigger.svelte.d.ts +4 -0
  456. package/dist/tooltip/types.d.ts +105 -0
  457. package/dist/tooltip/types.js +1 -0
  458. package/dist/transfer-list/README.md +110 -0
  459. package/dist/transfer-list/index.d.ts +33 -0
  460. package/dist/transfer-list/index.js +18 -0
  461. package/dist/transfer-list/index.parts.d.ts +9 -0
  462. package/dist/transfer-list/index.parts.js +10 -0
  463. package/dist/transfer-list/item/transfer-list-item.svelte +74 -0
  464. package/dist/transfer-list/item/transfer-list-item.svelte.d.ts +35 -0
  465. package/dist/transfer-list/list/transfer-list-list.svelte +162 -0
  466. package/dist/transfer-list/list/transfer-list-list.svelte.d.ts +56 -0
  467. package/dist/transfer-list/list/transfer-list-source.svelte +13 -0
  468. package/dist/transfer-list/list/transfer-list-source.svelte.d.ts +36 -0
  469. package/dist/transfer-list/list/transfer-list-target.svelte +14 -0
  470. package/dist/transfer-list/list/transfer-list-target.svelte.d.ts +36 -0
  471. package/dist/transfer-list/move/transfer-list-move-all.svelte +14 -0
  472. package/dist/transfer-list/move/transfer-list-move-all.svelte.d.ts +10 -0
  473. package/dist/transfer-list/move/transfer-list-move-button.svelte +103 -0
  474. package/dist/transfer-list/move/transfer-list-move-button.svelte.d.ts +25 -0
  475. package/dist/transfer-list/move/transfer-list-move-down.svelte +14 -0
  476. package/dist/transfer-list/move/transfer-list-move-down.svelte.d.ts +10 -0
  477. package/dist/transfer-list/move/transfer-list-move-selected.svelte +14 -0
  478. package/dist/transfer-list/move/transfer-list-move-selected.svelte.d.ts +10 -0
  479. package/dist/transfer-list/move/transfer-list-move-up.svelte +14 -0
  480. package/dist/transfer-list/move/transfer-list-move-up.svelte.d.ts +10 -0
  481. package/dist/transfer-list/move/transfer-list-reorder-button.svelte +83 -0
  482. package/dist/transfer-list/move/transfer-list-reorder-button.svelte.d.ts +21 -0
  483. package/dist/transfer-list/root/context.d.ts +70 -0
  484. package/dist/transfer-list/root/context.js +24 -0
  485. package/dist/transfer-list/root/transfer-list-root.svelte +345 -0
  486. package/dist/transfer-list/root/transfer-list-root.svelte.d.ts +68 -0
  487. package/dist/transfer-list/root/types.d.ts +22 -0
  488. package/dist/transfer-list/root/types.js +4 -0
  489. package/dist/transfer-list/status/transfer-list-status.svelte +70 -0
  490. package/dist/transfer-list/status/transfer-list-status.svelte.d.ts +15 -0
  491. package/dist/tree/README.md +3 -3
  492. package/dist/tree/checkbox-indicator/README.md +1 -1
  493. package/dist/tree/root/README.md +1 -1
  494. package/dist/tree/types.d.ts +19 -10
  495. package/package.json +56 -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">
@@ -45,29 +46,39 @@ Or import a single component via its subpath for the leanest bundle:
45
46
 
46
47
  | Category | Components |
47
48
  | ----------- | ----------------------------------------------------------------------------- |
48
- | Overlays | `Dialog`, `Popover`, `Menu`, `Portal` |
49
+ | Overlays | `Dialog`, `Drawer`, `Popover`, `Menu`, `Portal` |
49
50
  | Forms | `Input`, `TextArea`, `Label`, `Checkbox`, `Switch`, `NumberField`, `Dropzone` |
50
51
  | Selection | `ComboBox`, `Autocomplete`, `ListBox`, `Toggle`, `ToggleGroup` |
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 ship class-based styles composed with
62
- [`tailwind-variants`](https://www.tailwind-variants.org/) and merged with
63
- [`tailwind-merge`](https://github.com/dcastil/tailwind-merge). A Tailwind CSS
64
- setup in the consuming app is expected for the default look, and every component
65
- accepts a `class` prop so you can override or extend styles.
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.
67
+
68
+ ```svelte
69
+ <Button.Root class="rounded-md bg-black px-3 py-1.5 text-white data-[pressed]:opacity-80">
70
+ Save
71
+ </Button.Root>
72
+ ```
73
+
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.
66
77
 
67
78
  ## Requirements
68
79
 
69
80
  - Svelte `^5.0.0`
70
- - Node.js 20+
81
+ - Node.js version 20 or later
71
82
 
72
83
  ## License
73
84
 
@@ -35,10 +35,19 @@ Canonical implementation lives in `primitives/input-modality.ts`:
35
35
 
36
36
  ## Restore focus
37
37
 
38
- On overlay/popover close, transient trigger state is allowed:
38
+ On overlay/popover close, the trigger shows only the focus it holds:
39
39
 
40
- - `escape-key` => `data-focused=true` and `data-focus-visible=true`.
41
- - `outside-press` => `data-focused=true` and `data-focus-visible` absent.
40
+ - `escape-key`, `close-press`, `imperative-action` => the focus returns to the trigger:
41
+ `data-focused=true`, and `data-focus-visible=true` when the close came from the keyboard.
42
+ - `outside-press` on a focusable element => the focus stays there, and the trigger shows no
43
+ focus attributes.
44
+ - `outside-press` on nothing focusable (the focus fell to the body) => the focus returns to
45
+ the trigger with the pointer modality: `data-focused=true` and `data-focus-visible` absent.
46
+ Without it a keyboard user has nowhere to continue from.
47
+ Inside a modal popover every outside press is of this kind, because the page is inert.
48
+ - `focus-out`, `scroll` => the focus stays where the user put it.
49
+
50
+ `focusFellToBody()` and `applyTriggerCloseFocusState()` in `primitives/trigger-focus-state.ts` are the shared implementation; Popover and Menu only decide which reasons return the focus.
42
51
 
43
52
  ## Recommended Implementation
44
53
 
@@ -55,11 +64,15 @@ On overlay/popover close, transient trigger state is allowed:
55
64
  The following components implement this contract:
56
65
 
57
66
  - **Popover** — trigger + content, restore focus on close.
58
- - **Dialog** — trigger + overlay/content, nested stack support.
67
+ - **Dialog** — trigger + overlay/content, nested stack support. After an outside press the restore waits a frame, because the press moves the focus to the body after the close.
59
68
  - **Drawer** — trigger + overlay/content, shares the modal layer stack with Dialog. Restore also covers the `swipe` close reason (resolves to `pointer`), and retries the trigger focus after `ariaHideOutside` lifts `inert`.
69
+ - **Menu** — trigger + content, restore focus on close (`menu/root/focus-state.ts`). `Menu.ContextTrigger` is the same contract on a surface instead of a button: it registers as the trigger ref, so Escape and item selection restore focus to it. It is a tab stop by default so there is something to restore focus to.
60
70
  - **DatePicker** — segment spinbuttons, trigger, popover (calendar).
61
71
  - **TimePicker** — segment spinbuttons, trigger, popover (scrollable columns). Follows the same contract as DatePicker.
62
72
  - **Calendar** — grid cells with roving tabindex.
63
73
  - **ComboBox** — input + listbox with virtual focus.
64
74
  - **ListBox** — items with roving tabindex.
75
+ - **TransferList** — two ListBoxes plus move buttons. Focus is placed explicitly after every move, because the rows the user was on stop existing: it stays on the button while that button still has work, and otherwise follows the items to the destination list; a double-clicked row hands focus to whichever row took its place.
65
76
  - **NumberField** — spinbutton input, stepper buttons, wheel, and pointer scrub area.
77
+ - **Slider** — one native range input per thumb. The thumb shows `data-focused` and `data-focus-visible` for its input, and the root shows `data-focus-within` and `data-focus-visible`. A press on the track focuses the thumb with the pointer modality, and a key press after it turns the ring on through `watchFocusVisible`.
78
+ - **Tooltip** — never takes the focus, and never moves it. It opens on a focus of the trigger only when `shouldShowFocusVisible` says the focus came from the keyboard, thus a focus that a script gave with the pointer modality opens nothing.
@@ -20,14 +20,14 @@ Fill this out for PRs that modify interaction, keyboard navigation, overlays, or
20
20
 
21
21
  > Mark **OK/NA/FAIL** and add a short note when failing.
22
22
 
23
- | Scenario | What to validate | Status | Note |
24
- | ---------------------------------- | --------------------------------------------------------------------------- | ------ | ---- |
25
- | Keyboard (Tab/Arrow/Home/End/Page) | `data-*` and ARIA stay in sync with logical focus | | |
26
- | Pointer (click/mousedown) | do not elevate `data-focus-visible` by default | | |
27
- | External blur | transient state cleanup (`data-focus-within`, `data-focus-visible`) | | |
28
- | Close restore (`escape-key`) | trigger: `data-focused=true`, `data-focus-visible=true` (when applicable) | | |
29
- | Close restore (`outside-press`) | trigger: `data-focused=true`, `data-focus-visible` absent (when applicable) | | |
30
- | Programmatic focus | does not break invariants or leave stale state | | |
23
+ | Scenario | What to validate | Status | Note |
24
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---- |
25
+ | Keyboard (Tab/Arrow/Home/End/Page) | `data-*` and ARIA stay in sync with logical focus | | |
26
+ | Pointer (click/mousedown) | do not elevate `data-focus-visible` by default | | |
27
+ | External blur | transient state cleanup (`data-focus-within`, `data-focus-visible`) | | |
28
+ | Close restore (`escape-key`) | trigger: `data-focused=true`, `data-focus-visible=true` (when applicable) | | |
29
+ | Close restore (`outside-press`) | focusable target: focus stays there, trigger without focus attrs; nothing focusable: focus returns to the trigger, `data-focused=true`, `data-focus-visible` absent | | |
30
+ | Programmatic focus | does not break invariants or leave stale state | | |
31
31
 
32
32
  ## 3) Required Invariants
33
33
 
@@ -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
  };
@@ -112,6 +112,15 @@
112
112
  if (isVisibleRegistered) ctx.unregisterVisibleItem(id);
113
113
  });
114
114
 
115
+ function handleHoverStart(itemId: string | number) {
116
+ // The pointer takes the virtual focus, the same as in a ComboBox. Without
117
+ // this the keys move one row and the pointer marks another, and both read
118
+ // as the current one at the same time — which the item cannot correct on
119
+ // its own, because it only sees its own attributes.
120
+ ctx.setFocusVisible(false);
121
+ ctx.setFocusedItemId(itemId);
122
+ }
123
+
115
124
  function handleSelect(itemId: string | number) {
116
125
  if (ctx.isReadOnly) return;
117
126
  // Selection here is pointer-driven (click); clear the keyboard focus ring.
@@ -136,6 +145,7 @@
136
145
  isFocusVisibleOverride={isFocusVisible}
137
146
  onItemSelect={handleSelect}
138
147
  onResolvedTextValue={handleResolvedTextValue}
148
+ onItemHoverStart={handleHoverStart}
139
149
  scrollOnFocus={true}
140
150
  isParentDisabled={ctx.isDisabled}
141
151
  />
@@ -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
 
@@ -5,6 +5,7 @@ declare function $$render<T extends object = object>(): {
5
5
  selectionBehavior?: "toggle" | "replace";
6
6
  emptyPlaceholder?: string | Snippet;
7
7
  items?: Iterable<object> | undefined;
8
+ getItemKey?: ((item: object) => string | number) | undefined;
8
9
  disabledKeys?: Iterable<string | number>;
9
10
  selectionMode?: "single" | "multiple";
10
11
  value?: Iterable<string | number>;
@@ -15,6 +16,7 @@ declare function $$render<T extends object = object>(): {
15
16
  class?: string;
16
17
  id?: string;
17
18
  'aria-label'?: string;
19
+ 'aria-labelledby'?: string;
18
20
  onChange?: ((value: Set<string | number>) => void) | undefined;
19
21
  disableFocusHandling?: boolean;
20
22
  loop?: boolean;
@@ -23,13 +25,13 @@ declare function $$render<T extends object = object>(): {
23
25
  rowHeight?: number;
24
26
  overscan?: number;
25
27
  } | undefined;
26
- } & {
28
+ } & Omit<import("svelte/elements").HTMLAttributes<HTMLDivElement>, "children" | "class" | "id" | "role" | "aria-label" | "aria-labelledby" | "onchange"> & {
27
29
  context?: ListBoxContext;
28
30
  element?: HTMLElement;
29
31
  }, "children" | "id" | "element" | "context" | "disableFocusHandling" | "emptyPlaceholder" | "items"> & {
30
- /** Optional items for dynamic rendering. */
32
+ /** The items, for a list that the component makes from an array. */
31
33
  items?: Iterable<T>;
32
- /** Content of the list. Receives item in dynamic mode. */
34
+ /** The content of the list. From an array of items, it receives one item. */
33
35
  children?: Snippet<[T]> | Snippet;
34
36
  };
35
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, {}, "">;
@@ -0,0 +1,52 @@
1
+ # Avatar
2
+
3
+ ## Description
4
+
5
+ `Avatar` is a picture of a person or a thing, with a fallback for when the picture is not there. The image loads off the screen first, and it shows once it is there: a broken image icon never shows. The fallback shows in its place, at once or after a delay.
6
+
7
+ ## Anatomy
8
+
9
+ - `Avatar.Root`
10
+ - `Avatar.Image`
11
+ - `Avatar.Fallback`
12
+ - `Avatar.Group`
13
+ - `Avatar.Count`
14
+
15
+ ```svelte
16
+ <Avatar.Root class="size-10 rounded-full">
17
+ <Avatar.Image src="/ada.jpg" alt="Ada Lovelace" />
18
+ <Avatar.Fallback delay={600}>AL</Avatar.Fallback>
19
+ </Avatar.Root>
20
+ ```
21
+
22
+ ## Usage guidelines
23
+
24
+ - Give `alt` the name of the person or the thing. Give an empty `alt` when the name is beside the avatar already. The fallback follows the `alt`: it takes the name, or it hides.
25
+ - Give `delay` to the fallback, such as 600, thus a fast image does not flash initials first.
26
+ - Style the root by `data-status`: `loading`, `loaded` or `error`.
27
+ - Read the status with `onStatusChange` on the root.
28
+ - Give `loading="lazy"` to the image on a long list: the load starts when the avatar comes into view.
29
+ - Put a row of avatars in `Avatar.Group` with an `aria-label` and a `max`, and an `Avatar.Count` for the ones past the limit.
30
+
31
+ ## API reference
32
+
33
+ - `Avatar.Root`
34
+ - `onStatusChange?: (status: 'loading' | 'loaded' | 'error') => void`
35
+ - `element?: HTMLSpanElement | null` (bindable)
36
+ - `Avatar.Image`
37
+ - `src?: string | null`, `alt: string`
38
+ - `element?: HTMLImageElement | null` (bindable)
39
+ - `Avatar.Fallback`
40
+ - `delay?: number` (`0`)
41
+ - `element?: HTMLSpanElement | null` (bindable)
42
+ - `Avatar.Group`
43
+ - `max?: number`, `aria-label?: string`
44
+ - `Avatar.Count`
45
+ - `children?: Snippet<[{ overflow, count, max }]>`, `aria-label?: string` ("N more", localized)
46
+
47
+ ## Accessibility
48
+
49
+ - The image is an `<img>` with your `alt`. The root has no role of its own.
50
+ - The fallback takes the name of the image: it is a `role="img"` named with the `alt`. A screen reader hears the name, and not the letters of the initials. An empty `alt` hides it. Without an image, it is plain content.
51
+ - `Avatar.Group` is a `role="group"` named with your `aria-label`. `Avatar.Count` is a `role="img"` named "N more".
52
+ - Nothing in the avatar is focusable.