@human-kit/ui 1.0.0-beta.0 → 1.0.0-beta.10

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 (558) hide show
  1. package/README.md +29 -16
  2. package/dist/FOCUS_STATE_CONTRACT.md +18 -4
  3. package/dist/FOCUS_STATE_REVIEW_TEMPLATE.md +8 -8
  4. package/dist/accordion/README.md +3 -3
  5. package/dist/accordion/root/accordion-root.svelte +15 -3
  6. package/dist/accordion/root/context.svelte.js +4 -4
  7. package/dist/accordion/types.d.ts +40 -19
  8. package/dist/autocomplete/README.md +6 -7
  9. package/dist/autocomplete/empty/autocomplete-empty.svelte +1 -1
  10. package/dist/autocomplete/empty/autocomplete-empty.svelte.d.ts +1 -1
  11. package/dist/autocomplete/input/autocomplete-input.svelte +3 -3
  12. package/dist/autocomplete/input/autocomplete-input.svelte.d.ts +3 -3
  13. package/dist/autocomplete/item/autocomplete-item.svelte +10 -0
  14. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte +2 -2
  15. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte.d.ts +2 -2
  16. package/dist/autocomplete/list/autocomplete-list.svelte +2 -2
  17. package/dist/autocomplete/list/autocomplete-list.svelte.d.ts +11 -3
  18. package/dist/autocomplete/root/autocomplete.svelte +7 -7
  19. package/dist/autocomplete/root/autocomplete.svelte.d.ts +7 -7
  20. package/dist/autocomplete/status/autocomplete-status.svelte +1 -1
  21. package/dist/autocomplete/status/autocomplete-status.svelte.d.ts +1 -1
  22. package/dist/avatar/README.md +52 -0
  23. package/dist/avatar/count/avatar-count.svelte +56 -0
  24. package/dist/avatar/count/avatar-count.svelte.d.ts +4 -0
  25. package/dist/avatar/fallback/avatar-fallback.svelte +67 -0
  26. package/dist/avatar/fallback/avatar-fallback.svelte.d.ts +4 -0
  27. package/dist/avatar/group/avatar-group.svelte +65 -0
  28. package/dist/avatar/group/avatar-group.svelte.d.ts +4 -0
  29. package/dist/avatar/group/context.d.ts +15 -0
  30. package/dist/avatar/group/context.js +15 -0
  31. package/dist/avatar/image/avatar-image.svelte +104 -0
  32. package/dist/avatar/image/avatar-image.svelte.d.ts +4 -0
  33. package/dist/avatar/index.d.ts +22 -0
  34. package/dist/avatar/index.js +10 -0
  35. package/dist/avatar/index.parts.d.ts +5 -0
  36. package/dist/avatar/index.parts.js +5 -0
  37. package/dist/avatar/root/avatar-root.svelte +79 -0
  38. package/dist/avatar/root/avatar-root.svelte.d.ts +4 -0
  39. package/dist/avatar/root/context.d.ts +14 -0
  40. package/dist/avatar/root/context.js +15 -0
  41. package/dist/avatar/types.d.ts +84 -0
  42. package/dist/avatar/types.js +1 -0
  43. package/dist/breadcrumbs/README.md +65 -0
  44. package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte +62 -0
  45. package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte.d.ts +4 -0
  46. package/dist/breadcrumbs/index.d.ts +23 -0
  47. package/dist/breadcrumbs/index.js +10 -0
  48. package/dist/breadcrumbs/index.parts.d.ts +6 -0
  49. package/dist/breadcrumbs/index.parts.js +6 -0
  50. package/dist/breadcrumbs/item/breadcrumbs-item.svelte +42 -0
  51. package/dist/breadcrumbs/item/breadcrumbs-item.svelte.d.ts +4 -0
  52. package/dist/breadcrumbs/link/breadcrumbs-link.svelte +47 -0
  53. package/dist/breadcrumbs/link/breadcrumbs-link.svelte.d.ts +4 -0
  54. package/dist/breadcrumbs/list/breadcrumbs-list.svelte +31 -0
  55. package/dist/breadcrumbs/list/breadcrumbs-list.svelte.d.ts +4 -0
  56. package/dist/breadcrumbs/root/breadcrumbs-root.svelte +112 -0
  57. package/dist/breadcrumbs/root/breadcrumbs-root.svelte.d.ts +4 -0
  58. package/dist/breadcrumbs/root/context.d.ts +19 -0
  59. package/dist/breadcrumbs/root/context.js +15 -0
  60. package/dist/breadcrumbs/separator/breadcrumbs-separator.svelte +35 -0
  61. package/dist/breadcrumbs/separator/breadcrumbs-separator.svelte.d.ts +4 -0
  62. package/dist/breadcrumbs/types.d.ts +80 -0
  63. package/dist/breadcrumbs/types.js +1 -0
  64. package/dist/button/README.md +1 -1
  65. package/dist/button/root/button-root.svelte +37 -7
  66. package/dist/button/root/button-root.svelte.d.ts +19 -4
  67. package/dist/calendar/README.md +3 -3
  68. package/dist/calendar/body-cell/calendar-body-cell.svelte +7 -0
  69. package/dist/calendar/grid-header/calendar-grid-header.svelte +3 -4
  70. package/dist/calendar/grid-header/calendar-grid-header.svelte.d.ts +3 -4
  71. package/dist/calendar/root/calendar-root.svelte +8 -2
  72. package/dist/calendar/root/calendar-root.svelte.d.ts +8 -2
  73. package/dist/calendar/root/context.svelte.js +8 -2
  74. package/dist/calendar/trigger-next/README.md +1 -1
  75. package/dist/calendar/trigger-previous/README.md +1 -1
  76. package/dist/checkbox/README.md +1 -1
  77. package/dist/checkbox/indicator/README.md +1 -1
  78. package/dist/checkbox/indicator/checkbox-indicator.svelte +1 -0
  79. package/dist/checkbox/indicator/checkbox-indicator.svelte.d.ts +1 -0
  80. package/dist/checkbox/root/README.md +2 -2
  81. package/dist/checkbox/root/checkbox-root.svelte +133 -38
  82. package/dist/checkbox/root/checkbox-root.svelte.d.ts +21 -1
  83. package/dist/checkbox-group/README.md +95 -0
  84. package/dist/checkbox-group/index.d.ts +15 -0
  85. package/dist/checkbox-group/index.js +6 -0
  86. package/dist/checkbox-group/index.parts.d.ts +4 -0
  87. package/dist/checkbox-group/index.parts.js +7 -0
  88. package/dist/checkbox-group/label/checkbox-group-label.svelte +36 -0
  89. package/dist/checkbox-group/label/checkbox-group-label.svelte.d.ts +4 -0
  90. package/dist/checkbox-group/root/checkbox-group-root.svelte +118 -0
  91. package/dist/checkbox-group/root/checkbox-group-root.svelte.d.ts +4 -0
  92. package/dist/checkbox-group/root/context.svelte.d.ts +52 -0
  93. package/dist/checkbox-group/root/context.svelte.js +251 -0
  94. package/dist/checkbox-group/types.d.ts +57 -0
  95. package/dist/checkbox-group/types.js +1 -0
  96. package/dist/clock/README.md +3 -3
  97. package/dist/clock/axis/README.md +1 -1
  98. package/dist/clock/root/README.md +1 -1
  99. package/dist/clock/root/create-time-selection-state.svelte.d.ts +5 -0
  100. package/dist/clock/root/create-time-selection-state.svelte.js +113 -10
  101. package/dist/clock/root/wheel-options.d.ts +7 -3
  102. package/dist/clock/root/wheel-options.js +7 -15
  103. package/dist/clock/wheel-column/clock-wheel-column.svelte +10 -2
  104. package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +2 -1
  105. package/dist/collapsible/README.md +3 -3
  106. package/dist/collapsible/root/collapsible-root.svelte +9 -4
  107. package/dist/collapsible/types.d.ts +13 -1
  108. package/dist/combobox/README.md +2 -2
  109. package/dist/combobox/button/README.md +6 -6
  110. package/dist/combobox/input/README.md +1 -1
  111. package/dist/combobox/input/combobox-input.svelte +15 -4
  112. package/dist/combobox/input/combobox-input.svelte.d.ts +3 -3
  113. package/dist/combobox/item/combobox-listboxitem.svelte +4 -2
  114. package/dist/combobox/item/combobox-listboxitem.svelte.d.ts +4 -2
  115. package/dist/combobox/item-indicator/README.md +1 -1
  116. package/dist/combobox/item-indicator/combobox-item-indicator.svelte +2 -2
  117. package/dist/combobox/item-indicator/combobox-item-indicator.svelte.d.ts +2 -2
  118. package/dist/combobox/list/combobox-listbox.svelte +98 -3
  119. package/dist/combobox/list/combobox-listbox.svelte.d.ts +28 -3
  120. package/dist/combobox/popover/README.md +1 -1
  121. package/dist/combobox/popover/combobox-popover.svelte +4 -56
  122. package/dist/combobox/root/README.md +24 -24
  123. package/dist/combobox/root/combobox.svelte +138 -56
  124. package/dist/combobox/root/combobox.svelte.d.ts +31 -11
  125. package/dist/combobox/root/context.d.ts +12 -0
  126. package/dist/combobox/status/README.md +3 -3
  127. package/dist/combobox/status/combobox-status.svelte +1 -1
  128. package/dist/combobox/status/combobox-status.svelte.d.ts +1 -1
  129. package/dist/combobox/tag/README.md +1 -1
  130. package/dist/combobox/tag/combobox-tag.svelte +1 -1
  131. package/dist/combobox/tag/combobox-tag.svelte.d.ts +1 -1
  132. package/dist/combobox/tag-remove/README.md +1 -1
  133. package/dist/combobox/tag-remove/combobox-tag-remove.svelte +14 -3
  134. package/dist/combobox/tag-remove/combobox-tag-remove.svelte.d.ts +7 -1
  135. package/dist/combobox/tags/README.md +1 -1
  136. package/dist/combobox/tags/combobox-tags.svelte +15 -12
  137. package/dist/combobox/tags/combobox-tags.svelte.d.ts +12 -10
  138. package/dist/combobox/trigger/README.md +7 -7
  139. package/dist/combobox/trigger/combobox-trigger.svelte +4 -1
  140. package/dist/datepicker/README.md +5 -4
  141. package/dist/datepicker/input/date-picker-input.svelte +3 -4
  142. package/dist/datepicker/input/date-picker-input.svelte.d.ts +3 -4
  143. package/dist/datepicker/root/date-picker-root.svelte +38 -2
  144. package/dist/datepicker/root/date-picker-root.svelte.d.ts +2 -0
  145. package/dist/datepicker/root/draft-evaluation.d.ts +7 -0
  146. package/dist/datepicker/root/draft-evaluation.js +2 -2
  147. package/dist/datepicker/trigger/README.md +1 -1
  148. package/dist/daterangepicker/README.md +3 -3
  149. package/dist/daterangepicker/input/date-range-picker-input.svelte +3 -4
  150. package/dist/daterangepicker/input/date-range-picker-input.svelte.d.ts +3 -4
  151. package/dist/daterangepicker/root/date-range-picker-root.svelte +19 -1
  152. package/dist/daterangepicker/root/date-range-picker-root.svelte.d.ts +2 -0
  153. package/dist/dialog/README.md +10 -2
  154. package/dist/dialog/close/dialog-close.svelte +57 -0
  155. package/dist/dialog/close/dialog-close.svelte.d.ts +19 -0
  156. package/dist/dialog/content/dialog-content.svelte +6 -4
  157. package/dist/dialog/content/dialog-content.svelte.d.ts +4 -4
  158. package/dist/dialog/description/dialog-description.svelte +46 -0
  159. package/dist/dialog/description/dialog-description.svelte.d.ts +20 -0
  160. package/dist/dialog/index.d.ts +9 -0
  161. package/dist/dialog/index.js +3 -0
  162. package/dist/dialog/index.parts.d.ts +3 -0
  163. package/dist/dialog/index.parts.js +3 -0
  164. package/dist/dialog/overlay/dialog-overlay.svelte +1 -1
  165. package/dist/dialog/overlay/dialog-overlay.svelte.d.ts +1 -1
  166. package/dist/dialog/portal/dialog-portal.svelte +1 -1
  167. package/dist/dialog/portal/dialog-portal.svelte.d.ts +1 -1
  168. package/dist/dialog/root/README.md +1 -1
  169. package/dist/dialog/root/context.d.ts +8 -0
  170. package/dist/dialog/root/dialog-root.svelte +100 -20
  171. package/dist/dialog/root/dialog-root.svelte.d.ts +15 -6
  172. package/dist/dialog/root/dialog-stack.d.ts +6 -22
  173. package/dist/dialog/root/dialog-stack.js +4 -33
  174. package/dist/dialog/title/dialog-title.svelte +43 -0
  175. package/dist/dialog/title/dialog-title.svelte.d.ts +21 -0
  176. package/dist/dialog/trigger/README.md +1 -1
  177. package/dist/drawer/README.md +111 -0
  178. package/dist/drawer/body/drawer-body.svelte +47 -0
  179. package/dist/drawer/body/drawer-body.svelte.d.ts +32 -0
  180. package/dist/drawer/close/drawer-close.svelte +52 -0
  181. package/dist/drawer/close/drawer-close.svelte.d.ts +20 -0
  182. package/dist/drawer/content/drawer-content.svelte +600 -0
  183. package/dist/drawer/content/drawer-content.svelte.d.ts +31 -0
  184. package/dist/drawer/description/drawer-description.svelte +40 -0
  185. package/dist/drawer/description/drawer-description.svelte.d.ts +20 -0
  186. package/dist/drawer/indent/drawer-indent-background.svelte +36 -0
  187. package/dist/drawer/indent/drawer-indent-background.svelte.d.ts +17 -0
  188. package/dist/drawer/indent/drawer-indent.svelte +59 -0
  189. package/dist/drawer/indent/drawer-indent.svelte.d.ts +32 -0
  190. package/dist/drawer/index.d.ts +49 -0
  191. package/dist/drawer/index.js +25 -0
  192. package/dist/drawer/index.parts.d.ts +14 -0
  193. package/dist/drawer/index.parts.js +15 -0
  194. package/dist/drawer/overlay/drawer-overlay.svelte +67 -0
  195. package/dist/drawer/overlay/drawer-overlay.svelte.d.ts +12 -0
  196. package/dist/drawer/portal/drawer-portal.svelte +57 -0
  197. package/dist/drawer/portal/drawer-portal.svelte.d.ts +13 -0
  198. package/dist/drawer/root/context.d.ts +81 -0
  199. package/dist/drawer/root/context.js +20 -0
  200. package/dist/drawer/root/drawer-root.svelte +348 -0
  201. package/dist/drawer/root/drawer-root.svelte.d.ts +79 -0
  202. package/dist/drawer/root/drawer-stack.svelte.d.ts +73 -0
  203. package/dist/drawer/root/drawer-stack.svelte.js +113 -0
  204. package/dist/drawer/root/handle.svelte.d.ts +39 -0
  205. package/dist/drawer/root/handle.svelte.js +64 -0
  206. package/dist/drawer/root/keyboard-context.d.ts +13 -0
  207. package/dist/drawer/root/keyboard-context.js +8 -0
  208. package/dist/drawer/root/presence-context.d.ts +22 -0
  209. package/dist/drawer/root/presence-context.js +8 -0
  210. package/dist/drawer/root/snap-points.d.ts +68 -0
  211. package/dist/drawer/root/snap-points.js +120 -0
  212. package/dist/drawer/root/starting-style.svelte.d.ts +18 -0
  213. package/dist/drawer/root/starting-style.svelte.js +38 -0
  214. package/dist/drawer/root/types.d.ts +36 -0
  215. package/dist/drawer/root/types.js +1 -0
  216. package/dist/drawer/root/viewport-context.d.ts +2 -0
  217. package/dist/drawer/root/viewport-context.js +16 -0
  218. package/dist/drawer/swipe-area/drawer-swipe-area.svelte +143 -0
  219. package/dist/drawer/swipe-area/drawer-swipe-area.svelte.d.ts +22 -0
  220. package/dist/drawer/title/drawer-title.svelte +37 -0
  221. package/dist/drawer/title/drawer-title.svelte.d.ts +21 -0
  222. package/dist/drawer/trigger/drawer-trigger.svelte +90 -0
  223. package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +41 -0
  224. package/dist/drawer/viewport/drawer-viewport.svelte +69 -0
  225. package/dist/drawer/viewport/drawer-viewport.svelte.d.ts +15 -0
  226. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +88 -0
  227. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte.d.ts +29 -0
  228. package/dist/dropzone/README.md +4 -6
  229. package/dist/hooks/use-virtual-focus.svelte.d.ts +9 -0
  230. package/dist/hooks/use-virtual-focus.svelte.js +7 -1
  231. package/dist/index.d.ts +24 -0
  232. package/dist/index.js +23 -0
  233. package/dist/input/input.svelte +6 -6
  234. package/dist/input/input.svelte.d.ts +6 -6
  235. package/dist/internal/environment.d.ts +11 -0
  236. package/dist/internal/environment.js +14 -0
  237. package/dist/internal/localized-strings.d.ts +152 -0
  238. package/dist/internal/localized-strings.js +152 -0
  239. package/dist/internal/number-precision.d.ts +9 -0
  240. package/dist/internal/number-precision.js +27 -0
  241. package/dist/listbox/README.md +20 -1
  242. package/dist/listbox/item/listbox-item.svelte +43 -18
  243. package/dist/listbox/item/listbox-item.svelte.d.ts +24 -15
  244. package/dist/listbox/root/README.md +1 -1
  245. package/dist/listbox/root/context.d.ts +56 -1
  246. package/dist/listbox/root/context.js +118 -1
  247. package/dist/listbox/root/listbox.svelte +400 -27
  248. package/dist/listbox/root/listbox.svelte.d.ts +73 -16
  249. package/dist/locale-provider/README.md +1 -6
  250. package/dist/menu/README.md +41 -4
  251. package/dist/menu/content/menu-content.svelte +31 -14
  252. package/dist/menu/content/menu-content.svelte.d.ts +14 -9
  253. package/dist/menu/context-trigger/menu-context-trigger.svelte +194 -0
  254. package/dist/menu/context-trigger/menu-context-trigger.svelte.d.ts +35 -0
  255. package/dist/menu/group/menu-group-label.svelte +1 -1
  256. package/dist/menu/group/menu-group-label.svelte.d.ts +1 -1
  257. package/dist/menu/index.d.ts +4 -1
  258. package/dist/menu/index.js +1 -0
  259. package/dist/menu/index.parts.d.ts +1 -0
  260. package/dist/menu/index.parts.js +1 -0
  261. package/dist/menu/item/menu-item.svelte +11 -8
  262. package/dist/menu/item/menu-item.svelte.d.ts +11 -8
  263. package/dist/menu/overlay/menu-overlay.svelte +2 -2
  264. package/dist/menu/overlay/menu-overlay.svelte.d.ts +1 -1
  265. package/dist/menu/root/context.d.ts +24 -3
  266. package/dist/menu/root/focus-state.d.ts +2 -2
  267. package/dist/menu/root/focus-state.js +8 -32
  268. package/dist/menu/root/menu-root.svelte +14 -8
  269. package/dist/menu/root/menu-root.svelte.d.ts +14 -8
  270. package/dist/menu/root/menu-state.svelte.d.ts +1 -1
  271. package/dist/menu/root/menu-state.svelte.js +24 -1
  272. package/dist/menu/separator/menu-separator.svelte +1 -1
  273. package/dist/menu/separator/menu-separator.svelte.d.ts +1 -1
  274. package/dist/menu/submenu/menu-submenu-root.svelte +10 -7
  275. package/dist/menu/submenu/menu-submenu-root.svelte.d.ts +10 -7
  276. package/dist/numberfield/root/README.md +1 -1
  277. package/dist/numberfield/root/number-field-root.svelte +2 -1
  278. package/dist/numberfield/root/number-utils.js +1 -20
  279. package/dist/numberfield/scrub-area-cursor/README.md +1 -1
  280. package/dist/popover/README.md +1 -1
  281. package/dist/popover/content/popover-content.svelte +22 -16
  282. package/dist/popover/content/popover-content.svelte.d.ts +19 -14
  283. package/dist/popover/overlay/popover-overlay.svelte +2 -2
  284. package/dist/popover/overlay/popover-overlay.svelte.d.ts +1 -1
  285. package/dist/popover/root/README.md +1 -1
  286. package/dist/popover/root/focus-state.d.ts +2 -2
  287. package/dist/popover/root/focus-state.js +7 -34
  288. package/dist/popover/root/popover-root.svelte +29 -14
  289. package/dist/popover/root/popover-root.svelte.d.ts +16 -5
  290. package/dist/popover/trigger/README.md +1 -1
  291. package/dist/primitives/aria-hide-outside.d.ts +13 -0
  292. package/dist/primitives/aria-hide-outside.js +7 -1
  293. package/dist/primitives/contain-wheel.d.ts +9 -0
  294. package/dist/primitives/contain-wheel.js +41 -0
  295. package/dist/primitives/floating.d.ts +49 -8
  296. package/dist/primitives/floating.js +75 -7
  297. package/dist/primitives/focus-trap.d.ts +2 -0
  298. package/dist/primitives/focus-trap.js +7 -1
  299. package/dist/primitives/focus-visible.svelte.d.ts +14 -0
  300. package/dist/primitives/focus-visible.svelte.js +19 -0
  301. package/dist/primitives/index.d.ts +3 -0
  302. package/dist/primitives/index.js +3 -0
  303. package/dist/primitives/input-modality.d.ts +7 -0
  304. package/dist/primitives/input-modality.js +32 -5
  305. package/dist/primitives/keyboard-navigation.d.ts +29 -5
  306. package/dist/primitives/keyboard-navigation.js +27 -17
  307. package/dist/primitives/layer-stack.d.ts +29 -0
  308. package/dist/primitives/layer-stack.js +35 -0
  309. package/dist/primitives/list-virtualizer.d.ts +75 -0
  310. package/dist/primitives/list-virtualizer.js +59 -0
  311. package/dist/primitives/long-press.d.ts +59 -0
  312. package/dist/primitives/long-press.js +142 -0
  313. package/dist/primitives/presence.svelte.js +6 -1
  314. package/dist/primitives/scroll-lock.d.ts +47 -3
  315. package/dist/primitives/scroll-lock.js +191 -9
  316. package/dist/primitives/swipe-gesture.d.ts +126 -0
  317. package/dist/primitives/swipe-gesture.js +351 -0
  318. package/dist/primitives/text.d.ts +8 -0
  319. package/dist/primitives/text.js +13 -0
  320. package/dist/primitives/trigger-focus-state.d.ts +29 -0
  321. package/dist/primitives/trigger-focus-state.js +57 -0
  322. package/dist/progress/README.md +54 -0
  323. package/dist/progress/index.d.ts +21 -0
  324. package/dist/progress/index.js +9 -0
  325. package/dist/progress/index.parts.d.ts +5 -0
  326. package/dist/progress/index.parts.js +5 -0
  327. package/dist/progress/indicator/progress-indicator.svelte +37 -0
  328. package/dist/progress/indicator/progress-indicator.svelte.d.ts +4 -0
  329. package/dist/progress/label/progress-label.svelte +34 -0
  330. package/dist/progress/label/progress-label.svelte.d.ts +4 -0
  331. package/dist/progress/root/context.d.ts +26 -0
  332. package/dist/progress/root/context.js +15 -0
  333. package/dist/progress/root/progress-root.svelte +136 -0
  334. package/dist/progress/root/progress-root.svelte.d.ts +4 -0
  335. package/dist/progress/root/progress-utils.d.ts +12 -0
  336. package/dist/progress/root/progress-utils.js +41 -0
  337. package/dist/progress/track/progress-track.svelte +27 -0
  338. package/dist/progress/track/progress-track.svelte.d.ts +4 -0
  339. package/dist/progress/types.d.ts +81 -0
  340. package/dist/progress/types.js +1 -0
  341. package/dist/progress/value/progress-value.svelte +36 -0
  342. package/dist/progress/value/progress-value.svelte.d.ts +4 -0
  343. package/dist/radio-group/README.md +103 -0
  344. package/dist/radio-group/index.d.ts +18 -0
  345. package/dist/radio-group/index.js +9 -0
  346. package/dist/radio-group/index.parts.d.ts +4 -0
  347. package/dist/radio-group/index.parts.js +4 -0
  348. package/dist/radio-group/indicator/radio-group-indicator.svelte +43 -0
  349. package/dist/radio-group/indicator/radio-group-indicator.svelte.d.ts +12 -0
  350. package/dist/radio-group/item/context.d.ts +18 -0
  351. package/dist/radio-group/item/context.js +15 -0
  352. package/dist/radio-group/item/radio-group-item.svelte +377 -0
  353. package/dist/radio-group/item/radio-group-item.svelte.d.ts +35 -0
  354. package/dist/radio-group/label/radio-group-label.svelte +37 -0
  355. package/dist/radio-group/label/radio-group-label.svelte.d.ts +4 -0
  356. package/dist/radio-group/root/context.svelte.d.ts +57 -0
  357. package/dist/radio-group/root/context.svelte.js +284 -0
  358. package/dist/radio-group/root/radio-group-root.svelte +193 -0
  359. package/dist/radio-group/root/radio-group-root.svelte.d.ts +4 -0
  360. package/dist/radio-group/types.d.ts +50 -0
  361. package/dist/radio-group/types.js +1 -0
  362. package/dist/select/README.md +129 -0
  363. package/dist/select/index.d.ts +30 -0
  364. package/dist/select/index.js +16 -0
  365. package/dist/select/index.parts.d.ts +8 -0
  366. package/dist/select/index.parts.js +9 -0
  367. package/dist/select/item/select-item.svelte +68 -0
  368. package/dist/select/item/select-item.svelte.d.ts +10 -0
  369. package/dist/select/item-indicator/select-item-indicator.svelte +55 -0
  370. package/dist/select/item-indicator/select-item-indicator.svelte.d.ts +4 -0
  371. package/dist/select/label/select-label.svelte +46 -0
  372. package/dist/select/label/select-label.svelte.d.ts +4 -0
  373. package/dist/select/list/select-list.svelte +241 -0
  374. package/dist/select/list/select-list.svelte.d.ts +62 -0
  375. package/dist/select/popover/select-popover.svelte +80 -0
  376. package/dist/select/popover/select-popover.svelte.d.ts +9 -0
  377. package/dist/select/root/context.d.ts +106 -0
  378. package/dist/select/root/context.js +22 -0
  379. package/dist/select/root/select-root.svelte +544 -0
  380. package/dist/select/root/select-root.svelte.d.ts +25 -0
  381. package/dist/select/trigger/select-trigger.svelte +192 -0
  382. package/dist/select/trigger/select-trigger.svelte.d.ts +4 -0
  383. package/dist/select/types.d.ts +133 -0
  384. package/dist/select/types.js +1 -0
  385. package/dist/select/value/select-value.svelte +61 -0
  386. package/dist/select/value/select-value.svelte.d.ts +4 -0
  387. package/dist/separator/README.md +35 -0
  388. package/dist/separator/index.d.ts +7 -0
  389. package/dist/separator/index.js +3 -0
  390. package/dist/separator/separator.svelte +254 -0
  391. package/dist/separator/separator.svelte.d.ts +45 -0
  392. package/dist/separator/types.d.ts +1 -0
  393. package/dist/separator/types.js +1 -0
  394. package/dist/slider/README.md +61 -0
  395. package/dist/slider/fill/slider-fill.svelte +40 -0
  396. package/dist/slider/fill/slider-fill.svelte.d.ts +4 -0
  397. package/dist/slider/index.d.ts +9 -0
  398. package/dist/slider/index.js +8 -0
  399. package/dist/slider/index.parts.d.ts +6 -0
  400. package/dist/slider/index.parts.js +6 -0
  401. package/dist/slider/label/slider-label.svelte +44 -0
  402. package/dist/slider/label/slider-label.svelte.d.ts +4 -0
  403. package/dist/slider/output/slider-output.svelte +46 -0
  404. package/dist/slider/output/slider-output.svelte.d.ts +4 -0
  405. package/dist/slider/root/context.d.ts +106 -0
  406. package/dist/slider/root/context.js +15 -0
  407. package/dist/slider/root/slider-root.svelte +545 -0
  408. package/dist/slider/root/slider-root.svelte.d.ts +4 -0
  409. package/dist/slider/root/slider-utils.d.ts +57 -0
  410. package/dist/slider/root/slider-utils.js +88 -0
  411. package/dist/slider/thumb/slider-thumb.svelte +276 -0
  412. package/dist/slider/thumb/slider-thumb.svelte.d.ts +4 -0
  413. package/dist/slider/track/slider-track.svelte +60 -0
  414. package/dist/slider/track/slider-track.svelte.d.ts +4 -0
  415. package/dist/slider/types.d.ts +144 -0
  416. package/dist/slider/types.js +1 -0
  417. package/dist/switch/root/README.md +2 -2
  418. package/dist/switch/root/switch-root.svelte +49 -21
  419. package/dist/switch/root/switch-root.svelte.d.ts +26 -14
  420. package/dist/switch/thumb/switch-thumb.svelte +1 -1
  421. package/dist/switch/thumb/switch-thumb.svelte.d.ts +1 -1
  422. package/dist/table/README.md +16 -9
  423. package/dist/table/body/table-body.svelte +84 -9
  424. package/dist/table/cell/table-cell.svelte +27 -10
  425. package/dist/table/checkbox/table-checkbox.svelte +3 -0
  426. package/dist/table/checkbox-indicator/README.md +1 -1
  427. package/dist/table/column/table-column.svelte +5 -1
  428. package/dist/table/column-header-cell/table-column-header-cell.svelte +24 -0
  429. package/dist/table/column-resizer/README.md +2 -2
  430. package/dist/table/column-resizer/table-column-resizer.svelte +1 -5
  431. package/dist/table/index.d.ts +1 -1
  432. package/dist/table/index.js +1 -1
  433. package/dist/table/interactive-cell/table-interactive-cell.svelte +26 -10
  434. package/dist/table/root/README.md +1 -1
  435. package/dist/table/root/context.svelte.d.ts +17 -0
  436. package/dist/table/root/context.svelte.js +212 -66
  437. package/dist/table/root/table-root.svelte +36 -6
  438. package/dist/table/row/table-row.svelte +14 -14
  439. package/dist/table/sort-trigger/README.md +1 -1
  440. package/dist/table/sort-trigger/table-sort-trigger.svelte +5 -1
  441. package/dist/table/types.d.ts +32 -14
  442. package/dist/tabs/root/tabs-root.svelte +20 -6
  443. package/dist/tabs/types.d.ts +9 -0
  444. package/dist/timepicker/README.md +3 -2
  445. package/dist/timepicker/input/README.md +1 -1
  446. package/dist/timepicker/input/time-picker-input.svelte +66 -5
  447. package/dist/timepicker/input/time-picker-input.svelte.d.ts +18 -1
  448. package/dist/timepicker/root/README.md +1 -1
  449. package/dist/timepicker/root/time-picker-root.svelte +11 -0
  450. package/dist/timepicker/root/time-picker-root.svelte.d.ts +2 -0
  451. package/dist/timepicker/trigger/README.md +1 -1
  452. package/dist/toast/README.md +75 -0
  453. package/dist/toast/action/toast-action.svelte +42 -0
  454. package/dist/toast/action/toast-action.svelte.d.ts +4 -0
  455. package/dist/toast/close/toast-close.svelte +41 -0
  456. package/dist/toast/close/toast-close.svelte.d.ts +4 -0
  457. package/dist/toast/content/toast-content.svelte +24 -0
  458. package/dist/toast/content/toast-content.svelte.d.ts +4 -0
  459. package/dist/toast/description/toast-description.svelte +41 -0
  460. package/dist/toast/description/toast-description.svelte.d.ts +4 -0
  461. package/dist/toast/index.d.ts +34 -0
  462. package/dist/toast/index.js +15 -0
  463. package/dist/toast/index.parts.d.ts +9 -0
  464. package/dist/toast/index.parts.js +9 -0
  465. package/dist/toast/positioner/toast-positioner.svelte +75 -0
  466. package/dist/toast/positioner/toast-positioner.svelte.d.ts +4 -0
  467. package/dist/toast/provider/context.d.ts +36 -0
  468. package/dist/toast/provider/context.js +22 -0
  469. package/dist/toast/provider/toast-manager.svelte.d.ts +113 -0
  470. package/dist/toast/provider/toast-manager.svelte.js +210 -0
  471. package/dist/toast/provider/toast-provider.svelte +98 -0
  472. package/dist/toast/provider/toast-provider.svelte.d.ts +4 -0
  473. package/dist/toast/root/context.d.ts +18 -0
  474. package/dist/toast/root/context.js +15 -0
  475. package/dist/toast/root/toast-root.svelte +296 -0
  476. package/dist/toast/root/toast-root.svelte.d.ts +4 -0
  477. package/dist/toast/title/toast-title.svelte +38 -0
  478. package/dist/toast/title/toast-title.svelte.d.ts +4 -0
  479. package/dist/toast/types.d.ts +100 -0
  480. package/dist/toast/types.js +1 -0
  481. package/dist/toast/viewport/toast-viewport.svelte +389 -0
  482. package/dist/toast/viewport/toast-viewport.svelte.d.ts +4 -0
  483. package/dist/toggle/README.md +1 -1
  484. package/dist/toggle/root/toggle-root.svelte +28 -0
  485. package/dist/toggle/root/toggle-root.svelte.d.ts +19 -0
  486. package/dist/toggle-group/README.md +12 -4
  487. package/dist/toggle-group/index.d.ts +2 -0
  488. package/dist/toggle-group/index.parts.d.ts +1 -0
  489. package/dist/toggle-group/index.parts.js +4 -0
  490. package/dist/toggle-group/root/context.svelte.d.ts +1 -1
  491. package/dist/toggle-group/root/context.svelte.js +24 -8
  492. package/dist/toggle-group/root/toggle-group-root.svelte +24 -4
  493. package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte +13 -0
  494. package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte.d.ts +7 -0
  495. package/dist/toggle-group/types.d.ts +9 -0
  496. package/dist/tooltip/README.md +53 -0
  497. package/dist/tooltip/arrow/tooltip-arrow.svelte +36 -0
  498. package/dist/tooltip/arrow/tooltip-arrow.svelte.d.ts +4 -0
  499. package/dist/tooltip/content/tooltip-content.svelte +148 -0
  500. package/dist/tooltip/content/tooltip-content.svelte.d.ts +4 -0
  501. package/dist/tooltip/index.d.ts +8 -0
  502. package/dist/tooltip/index.js +7 -0
  503. package/dist/tooltip/index.parts.d.ts +5 -0
  504. package/dist/tooltip/index.parts.js +5 -0
  505. package/dist/tooltip/provider/tooltip-provider.svelte +36 -0
  506. package/dist/tooltip/provider/tooltip-provider.svelte.d.ts +4 -0
  507. package/dist/tooltip/root/context.d.ts +46 -0
  508. package/dist/tooltip/root/context.js +22 -0
  509. package/dist/tooltip/root/safe-polygon.d.ts +26 -0
  510. package/dist/tooltip/root/safe-polygon.js +66 -0
  511. package/dist/tooltip/root/tooltip-group.d.ts +26 -0
  512. package/dist/tooltip/root/tooltip-group.js +41 -0
  513. package/dist/tooltip/root/tooltip-root.svelte +461 -0
  514. package/dist/tooltip/root/tooltip-root.svelte.d.ts +4 -0
  515. package/dist/tooltip/trigger/tooltip-trigger.svelte +52 -0
  516. package/dist/tooltip/trigger/tooltip-trigger.svelte.d.ts +4 -0
  517. package/dist/tooltip/types.d.ts +105 -0
  518. package/dist/tooltip/types.js +1 -0
  519. package/dist/transfer-list/README.md +110 -0
  520. package/dist/transfer-list/index.d.ts +33 -0
  521. package/dist/transfer-list/index.js +18 -0
  522. package/dist/transfer-list/index.parts.d.ts +9 -0
  523. package/dist/transfer-list/index.parts.js +10 -0
  524. package/dist/transfer-list/item/transfer-list-item.svelte +74 -0
  525. package/dist/transfer-list/item/transfer-list-item.svelte.d.ts +35 -0
  526. package/dist/transfer-list/list/transfer-list-list.svelte +162 -0
  527. package/dist/transfer-list/list/transfer-list-list.svelte.d.ts +56 -0
  528. package/dist/transfer-list/list/transfer-list-source.svelte +13 -0
  529. package/dist/transfer-list/list/transfer-list-source.svelte.d.ts +36 -0
  530. package/dist/transfer-list/list/transfer-list-target.svelte +14 -0
  531. package/dist/transfer-list/list/transfer-list-target.svelte.d.ts +36 -0
  532. package/dist/transfer-list/move/transfer-list-move-all.svelte +14 -0
  533. package/dist/transfer-list/move/transfer-list-move-all.svelte.d.ts +10 -0
  534. package/dist/transfer-list/move/transfer-list-move-button.svelte +103 -0
  535. package/dist/transfer-list/move/transfer-list-move-button.svelte.d.ts +25 -0
  536. package/dist/transfer-list/move/transfer-list-move-down.svelte +14 -0
  537. package/dist/transfer-list/move/transfer-list-move-down.svelte.d.ts +10 -0
  538. package/dist/transfer-list/move/transfer-list-move-selected.svelte +14 -0
  539. package/dist/transfer-list/move/transfer-list-move-selected.svelte.d.ts +10 -0
  540. package/dist/transfer-list/move/transfer-list-move-up.svelte +14 -0
  541. package/dist/transfer-list/move/transfer-list-move-up.svelte.d.ts +10 -0
  542. package/dist/transfer-list/move/transfer-list-reorder-button.svelte +83 -0
  543. package/dist/transfer-list/move/transfer-list-reorder-button.svelte.d.ts +21 -0
  544. package/dist/transfer-list/root/context.d.ts +70 -0
  545. package/dist/transfer-list/root/context.js +24 -0
  546. package/dist/transfer-list/root/transfer-list-root.svelte +345 -0
  547. package/dist/transfer-list/root/transfer-list-root.svelte.d.ts +68 -0
  548. package/dist/transfer-list/root/types.d.ts +22 -0
  549. package/dist/transfer-list/root/types.js +4 -0
  550. package/dist/transfer-list/status/transfer-list-status.svelte +70 -0
  551. package/dist/transfer-list/status/transfer-list-status.svelte.d.ts +15 -0
  552. package/dist/tree/README.md +3 -3
  553. package/dist/tree/checkbox-indicator/README.md +1 -1
  554. package/dist/tree/root/README.md +1 -1
  555. package/dist/tree/root/context.svelte.js +6 -0
  556. package/dist/tree/root/tree-root.svelte +22 -8
  557. package/dist/tree/types.d.ts +23 -1
  558. package/package.json +282 -224
@@ -2,7 +2,24 @@ import { untrack } from 'svelte';
2
2
  import { fromStore } from 'svelte/store';
3
3
  import { useLocaleContextOptional } from '../../locale-provider/context';
4
4
  import { buildWheelOptions } from './wheel-options';
5
- import { buildTimePartsFromDraft, clampToStep, createEmptyTimePickerDraft, formatTimePickerValue, getRequiredSegments, getSegmentLabel, isSegmentValueEmpty, isTimeOutOfRange, isValidTimePickerValue, normalizeSegmentNumberInput, normalizeTimePickerValue, toDraftFromTimeValue } from './time-utils';
5
+ import { buildTimePartsFromDraft, clampToStep, createEmptyTimePickerDraft, formatTimePickerValue, getRequiredSegments, getSegmentLabel, isSegmentValueEmpty, isTimeOutOfRange, isValidTimePickerValue, normalizeSegmentNumberInput, normalizeTimePickerValue, parseTimePickerValue, toDraftFromTimeValue } from './time-utils';
6
+ /**
7
+ * Editable segments ordered from most to least significant. Range checks and
8
+ * boundary clamping both need to know which segments a given column is free to
9
+ * move: picking an hour may rewrite the minute, never the other way around.
10
+ */
11
+ const SEGMENT_SIGNIFICANCE = [
12
+ 'dayPeriod',
13
+ 'hour',
14
+ 'minute',
15
+ 'second'
16
+ ];
17
+ function getLessSignificantSegments(type) {
18
+ const index = SEGMENT_SIGNIFICANCE.indexOf(type);
19
+ if (index < 0)
20
+ return [];
21
+ return SEGMENT_SIGNIFICANCE.slice(index + 1);
22
+ }
6
23
  /**
7
24
  * Shared time-selection state used by both `Clock.Root` and `TimePicker.Root`.
8
25
  *
@@ -20,6 +37,11 @@ import { buildTimePartsFromDraft, clampToStep, createEmptyTimePickerDraft, forma
20
37
  * values entirely (TimePicker's historical policy, now applied to both); and
21
38
  * externally provided values (controlled `value` prop or `defaultValue`) are
22
39
  * normalized to `null` when malformed or out of range before being adopted.
40
+ * - Wheel selection is the one path that adjusts rather than rejects: a wheel
41
+ * option is offered whenever *some* in-range time still fits it, and picking
42
+ * it clamps the less significant segments onto the boundary (hour `17` under
43
+ * a `17:00` max commits `17:00`, not `null`). Without this the boundary hour
44
+ * was unreachable unless the minute already happened to be low enough.
23
45
  * - `isEditable` differs: TimePicker also blocks mutations while `readonly`;
24
46
  * Clock has no readonly concept and only checks `disabled`.
25
47
  * - TimePicker layers a multi-digit typing buffer on top of this state via the
@@ -147,6 +169,11 @@ export function createTimeSelectionState(options) {
147
169
  function setSegmentValue(type, nextValue) {
148
170
  if (!options.isEditable())
149
171
  return;
172
+ writeSegmentValue(type, nextValue);
173
+ commitFromDraft();
174
+ }
175
+ /** Normalizes and writes a segment into the draft without committing it. */
176
+ function writeSegmentValue(type, nextValue) {
150
177
  options.onBeforeSegmentMutation?.(type);
151
178
  if (type === 'dayPeriod') {
152
179
  const normalized = nextValue.trim().toUpperCase();
@@ -187,7 +214,6 @@ export function createTimeSelectionState(options) {
187
214
  segmentDraft.dayPeriod = 'AM';
188
215
  }
189
216
  }
190
- commitFromDraft();
191
217
  }
192
218
  function commitFromDraft() {
193
219
  const granularity = options.granularity();
@@ -219,15 +245,50 @@ export function createTimeSelectionState(options) {
219
245
  : createEmptyTimePickerDraft();
220
246
  options.onDraftReplaced?.();
221
247
  }
248
+ /**
249
+ * Pulls the segments below `changedType` onto the range boundary when the
250
+ * draft overshot it. Picking hour `17` under a `17:00` max leaves the minute
251
+ * on whatever it was (`17:30`); rather than refusing the commit, the minute
252
+ * moves to the boundary's own (`17:00`). Only runs when the boundary shares
253
+ * the segments at or above `changedType`, so it can never rewrite the
254
+ * selection the user just made.
255
+ */
256
+ function clampDraftToRangeBoundary(changedType) {
257
+ const granularity = options.granularity();
258
+ const parts = buildTimePartsFromDraft(segmentDraft, granularity, resolvedHourCycle);
259
+ if (!parts)
260
+ return;
261
+ const candidate = formatTimePickerValue(parts, granularity);
262
+ const overshootsMax = isTimeOutOfRange(candidate, undefined, normalizedMaxValue, granularity);
263
+ const undershootsMin = isTimeOutOfRange(candidate, normalizedMinValue, undefined, granularity);
264
+ if (!overshootsMax && !undershootsMin)
265
+ return;
266
+ const boundary = overshootsMax ? normalizedMaxValue : normalizedMinValue;
267
+ if (!boundary)
268
+ return;
269
+ const boundaryParts = parseTimePickerValue(boundary);
270
+ if (!boundaryParts)
271
+ return;
272
+ // The hour is the only segment above `minute`/`second` that can differ here;
273
+ // if it does, the boundary belongs to another hour and its minutes say
274
+ // nothing about this one.
275
+ const lessSignificant = getLessSignificantSegments(changedType);
276
+ if (lessSignificant.includes('minute') && boundaryParts.hour !== parts.hour)
277
+ return;
278
+ for (const segment of lessSignificant) {
279
+ if (segment === 'minute')
280
+ segmentDraft.minute = String(boundaryParts.minute);
281
+ if (segment === 'second')
282
+ segmentDraft.second = String(boundaryParts.second);
283
+ }
284
+ }
222
285
  function selectWheelValue(type, optionValue) {
223
286
  if (!options.isEditable())
224
287
  return;
225
- if (type === 'dayPeriod') {
226
- setSegmentValue(type, optionValue.toUpperCase());
227
- }
228
- else {
229
- setSegmentValue(type, optionValue);
230
- }
288
+ const nextValue = type === 'dayPeriod' ? optionValue.toUpperCase() : optionValue;
289
+ writeSegmentValue(type, nextValue);
290
+ clampDraftToRangeBoundary(type);
291
+ commitFromDraft();
231
292
  }
232
293
  function getSelectedWheelValue(type) {
233
294
  const selected = getSegmentValue(type);
@@ -248,6 +309,22 @@ export function createTimeSelectionState(options) {
248
309
  return null;
249
310
  return formatTimePickerValue(parts, granularity);
250
311
  };
312
+ // An option is out of range only when EVERY time it can still produce is out
313
+ // of range. Testing the single candidate built from the current draft would
314
+ // disable the boundary option whenever a less significant segment happens to
315
+ // overshoot — with max `17:00` and the minute sitting on `30`, hour `17` would
316
+ // read as `17:30` and never become selectable. Comparing the earliest/latest
317
+ // time the option spans keeps the boundary reachable; `selectWheelValue`
318
+ // clamps the less significant segments when the option is committed.
319
+ const isOptionOutOfRange = (partial) => {
320
+ const earliest = getCandidateFromPartial(fillLessSignificant(type, partial, 'earliest'));
321
+ const latest = getCandidateFromPartial(fillLessSignificant(type, partial, 'latest'));
322
+ if (!earliest || !latest)
323
+ return false;
324
+ const startsAfterMax = isTimeOutOfRange(earliest, undefined, normalizedMaxValue, granularity);
325
+ const endsBeforeMin = isTimeOutOfRange(latest, normalizedMinValue, undefined, granularity);
326
+ return startsAfterMax || endsBeforeMin;
327
+ };
251
328
  return buildWheelOptions({
252
329
  type,
253
330
  granularity,
@@ -256,11 +333,37 @@ export function createTimeSelectionState(options) {
256
333
  minuteStep: options.minuteStep(),
257
334
  secondStep: options.secondStep(),
258
335
  hasRangeBounds,
259
- getCandidateFromPartial,
260
- isOutOfRange: (candidate) => isTimeOutOfRange(candidate, normalizedMinValue, normalizedMaxValue, granularity),
336
+ isPartialOutOfRange: isOptionOutOfRange,
261
337
  locale: resolvedLocale
262
338
  });
263
339
  }
340
+ /**
341
+ * Fills the segments below `type` with the lowest / highest value they can
342
+ * take, so the caller can measure the whole span an option covers. In the
343
+ * 12-hour cycle the lowest hour is `12` (midnight / noon), not `1`.
344
+ */
345
+ function fillLessSignificant(type, partial, edge) {
346
+ const filled = { ...partial };
347
+ for (const segment of getLessSignificantSegments(type)) {
348
+ if (segment === 'hour') {
349
+ filled.hour =
350
+ edge === 'earliest'
351
+ ? resolvedHourCycle === 12
352
+ ? '12'
353
+ : '0'
354
+ : resolvedHourCycle === 12
355
+ ? '11'
356
+ : '23';
357
+ }
358
+ else if (segment === 'minute') {
359
+ filled.minute = edge === 'earliest' ? '0' : '59';
360
+ }
361
+ else if (segment === 'second') {
362
+ filled.second = edge === 'earliest' ? '0' : '59';
363
+ }
364
+ }
365
+ return filled;
366
+ }
264
367
  function getSegmentLabelByType(type) {
265
368
  return getSegmentLabel(type, resolvedLocale);
266
369
  }
@@ -1,4 +1,4 @@
1
- import { type TimePickerDraft, type TimePickerEditableSegmentType, type TimePickerGranularity, type TimePickerHourCycle, type TimePickerTimeValue } from './time-utils';
1
+ import { type TimePickerDraft, type TimePickerEditableSegmentType, type TimePickerGranularity, type TimePickerHourCycle } from './time-utils';
2
2
  export type WheelOption = {
3
3
  value: string;
4
4
  label: string;
@@ -12,7 +12,11 @@ export declare function buildWheelOptions(params: {
12
12
  minuteStep: number;
13
13
  secondStep: number;
14
14
  hasRangeBounds: boolean;
15
- getCandidateFromPartial: (partial: Partial<TimePickerDraft>) => TimePickerTimeValue | null;
16
- isOutOfRange: (value: TimePickerTimeValue) => boolean;
15
+ /**
16
+ * Whether fixing this one segment leaves no in-range time at all. Receives the
17
+ * partial draft for the option; the caller decides how much freedom the
18
+ * remaining segments have (see `create-time-selection-state`).
19
+ */
20
+ isPartialOutOfRange: (partial: Partial<TimePickerDraft>) => boolean;
17
21
  locale?: string;
18
22
  }): WheelOption[];
@@ -1,15 +1,10 @@
1
1
  import { getLocalizedDayPeriod } from './time-utils';
2
2
  export function buildWheelOptions(params) {
3
- const { type, hourCycle, hourStep, minuteStep, secondStep, hasRangeBounds, getCandidateFromPartial, isOutOfRange, locale } = params;
3
+ const { type, hourCycle, hourStep, minuteStep, secondStep, hasRangeBounds, isPartialOutOfRange, locale } = params;
4
4
  const options = [];
5
5
  if (type === 'dayPeriod') {
6
6
  for (const option of ['AM', 'PM']) {
7
- const disabled = hasRangeBounds
8
- ? (() => {
9
- const candidate = getCandidateFromPartial({ dayPeriod: option });
10
- return candidate ? isOutOfRange(candidate) : false;
11
- })()
12
- : false;
7
+ const disabled = hasRangeBounds ? isPartialOutOfRange({ dayPeriod: option }) : false;
13
8
  options.push({
14
9
  value: option,
15
10
  label: locale ? getLocalizedDayPeriod(locale, option) : option,
@@ -45,14 +40,11 @@ export function buildWheelOptions(params) {
45
40
  for (let current = min; current <= max; current += step) {
46
41
  const valueString = String(current);
47
42
  const disabled = hasRangeBounds
48
- ? (() => {
49
- const candidate = getCandidateFromPartial(type === 'hour'
50
- ? { hour: valueString }
51
- : type === 'minute'
52
- ? { minute: valueString }
53
- : { second: valueString });
54
- return candidate ? isOutOfRange(candidate) : false;
55
- })()
43
+ ? isPartialOutOfRange(type === 'hour'
44
+ ? { hour: valueString }
45
+ : type === 'minute'
46
+ ? { minute: valueString }
47
+ : { second: valueString })
56
48
  : false;
57
49
  options.push({
58
50
  value: valueString,
@@ -31,7 +31,8 @@
31
31
  | 'onclick'
32
32
  > & {
33
33
  type: ClockEditableSegmentType;
34
- children?: Snippet<[TimePickerWheelOption]>;
34
+ /** It receives the option, and a boolean that is true for the selected value of the column. */
35
+ children?: Snippet<[TimePickerWheelOption, boolean]>;
35
36
  class?: string;
36
37
  'aria-label'?: string;
37
38
  };
@@ -202,6 +203,13 @@
202
203
  const fallbackIndex = findClosestEnabledIndex(nextIndex, direction);
203
204
  if (fallbackIndex >= 0 && fallbackIndex !== nextIndex) {
204
205
  lastCenteredIndex = fallbackIndex;
206
+ // The wheel re-centres on the fallback, so the value has to follow it.
207
+ // Leaving it behind desynced the column from the committed time: the
208
+ // item under the axis read `16` while the value stayed on `15`.
209
+ const fallbackOption = options[fallbackIndex];
210
+ if (fallbackOption && selectedValue !== fallbackOption.value) {
211
+ clock.selectWheelValue(type, fallbackOption.value);
212
+ }
205
213
  return fallbackIndex;
206
214
  }
207
215
  return null;
@@ -512,7 +520,7 @@
512
520
  >
513
521
  {#each options as option, index (option.value)}
514
522
  {#if children}
515
- {@render children(option)}
523
+ {@render children(option, selectedValue === option.value)}
516
524
  {:else}
517
525
  <TimePickerWheelItem
518
526
  {type}
@@ -8,7 +8,8 @@ type TimePickerWheelOption = {
8
8
  };
9
9
  type TimePickerWheelColumnProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'role' | 'tabindex' | 'aria-label' | 'onkeydown' | 'onfocusin' | 'onfocusout' | 'onmousedown' | 'onclick'> & {
10
10
  type: ClockEditableSegmentType;
11
- children?: Snippet<[TimePickerWheelOption]>;
11
+ /** It receives the option, and a boolean that is true for the selected value of the column. */
12
+ children?: Snippet<[TimePickerWheelOption, boolean]>;
12
13
  class?: string;
13
14
  'aria-label'?: string;
14
15
  };
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Description
4
4
 
5
- `Collapsible` is a headless single disclosure primitive: a button that shows and hides an associated panel, with controlled or uncontrolled open state and a disabled state.
5
+ `Collapsible` is a headless disclosure component: a button that shows and hides one panel. You can control the open state, or the component can control it. It also has a disabled state.
6
6
 
7
7
  ## Anatomy
8
8
 
@@ -20,7 +20,7 @@
20
20
  ## Usage Guidelines
21
21
 
22
22
  - Use `open` / `onOpenChange` for controlled state and `defaultOpen` for uncontrolled state.
23
- - Use `disabled` to prevent the trigger from toggling the panel.
23
+ - Use `disabled` to stop the trigger. It cannot open or close the panel.
24
24
  - Use `forceMount` on `Collapsible.Panel` when collapsed content must stay in the DOM.
25
25
  - For grouped disclosures where only one section opens at a time, use `Accordion` instead.
26
26
 
@@ -28,4 +28,4 @@
28
28
 
29
29
  - `Collapsible.Trigger` renders button semantics with `aria-expanded` and `aria-controls` pointing at the panel, following the WAI-ARIA disclosure pattern.
30
30
  - `Collapsible.Panel` is `hidden` + `inert` while collapsed and carries the `id` referenced by the trigger.
31
- - Enter/Space toggle the panel via native button activation.
31
+ - The `Enter` key and the `Space` key open and close the panel, like a native button.
@@ -9,6 +9,7 @@
9
9
  id,
10
10
  open: openProp = $bindable(),
11
11
  defaultOpen = false,
12
+ controlledOpen = false,
12
13
  onOpenChange,
13
14
  disabled = false,
14
15
  children,
@@ -18,18 +19,22 @@
18
19
  ...restProps
19
20
  }: CollapsibleRootProps = $props();
20
21
 
21
- const isControlled = untrack(() => openProp !== undefined);
22
22
  const instanceId = untrack(() => id) ?? generatedId;
23
23
 
24
24
  let rootRef: HTMLDivElement | null = $state(null);
25
25
  let internalOpen = $state(untrack(() => defaultOpen));
26
26
 
27
- const isOpen = $derived(isControlled ? Boolean(openProp) : internalOpen);
27
+ // `open` wins whenever it is supplied — that covers both `bind:open` and a plain
28
+ // `open={...}` — and the internal state only carries the fully uncontrolled case.
29
+ // Controlled-ness is NOT inferred from `open` being defined: `bind:open={value}` and
30
+ // `open={value}` are indistinguishable at runtime, so inferring it silently broke
31
+ // every `bind:open` seeded with `false`. It is opt-in via `controlledOpen` instead.
32
+ const isOpen = $derived(controlledOpen ? Boolean(openProp) : (openProp ?? internalOpen));
28
33
 
29
34
  function setOpen(next: boolean) {
30
35
  if (disabled || next === isOpen) return;
31
- if (!isControlled) {
32
- // Uncontrolled: apply the change and keep `bind:open` in sync.
36
+ if (!controlledOpen) {
37
+ // Apply the change and keep `bind:open` in sync.
33
38
  internalOpen = next;
34
39
  openProp = next;
35
40
  }
@@ -3,8 +3,17 @@ import type { HTMLAttributes, HTMLButtonAttributes } from 'svelte/elements';
3
3
  import type { CollapsibleContext } from './root/context.js';
4
4
  export type { CollapsibleContext } from './root/context.js';
5
5
  export type CollapsibleRootProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class'> & {
6
+ /** The open state. By default it goes in the two directions: use `bind:open`. */
6
7
  open?: boolean;
8
+ /** The open state at the start, for when you give no `open`. */
7
9
  defaultOpen?: boolean;
10
+ /**
11
+ * Give your own code full control of the open state. The component stops to write back to `open`,
12
+ * and it reports only through `onOpenChange`. Thus the parent can refuse a change: the parent
13
+ * does not send the new value down. The default is off, because `bind:open` is the usual case and
14
+ * it needs the write-back.
15
+ */
16
+ controlledOpen?: boolean;
8
17
  onOpenChange?: (open: boolean) => void;
9
18
  disabled?: boolean;
10
19
  children?: Snippet;
@@ -19,7 +28,10 @@ export type CollapsibleTriggerProps = Omit<HTMLButtonAttributes, 'children' | 'c
19
28
  element?: HTMLButtonElement | null;
20
29
  };
21
30
  export type CollapsiblePanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'hidden'> & {
22
- /** Keep the closed panel mounted (hidden) instead of unmounting it after the exit animation. */
31
+ /**
32
+ * Keep the closed panel in the DOM, and hidden. Without it, the panel leaves the DOM after the
33
+ * exit animation.
34
+ */
23
35
  forceMount?: boolean;
24
36
  children?: Snippet;
25
37
  class?: string;
@@ -10,10 +10,10 @@
10
10
  - Use controlled props (`value`, `inputValue`, `open`) only when external state management is needed.
11
11
  - Use `pending` on `ComboBox.Root` to expose async loading state on the root while keeping the rest of the composition under your control.
12
12
  - Prefer `ComboBox.Trigger` in new code. `ComboBox.Button` remains available as a compatibility alias.
13
- - Use `ComboBox.Clear` when you want a built-in clear affordance that resets both the input and selected value.
13
+ - Use `ComboBox.Clear` when you want a control that removes the input text and the selected value together.
14
14
  - Provide a stable `id` in SSR environments to keep ARIA ids deterministic.
15
15
  - Render `ComboBox.Tags`, `ComboBox.Tag`, and `ComboBox.TagRemove` in multiple mode to expose selected values.
16
- - Render `ComboBox.Status` to announce the number of visible results to screen readers as the filter changes. It is a visually-hidden `aria-live="polite"` region; the default message is localized (via `LocaleProvider`) and can be replaced with the `formatMessage` prop. It only announces while the popover is open.
16
+ - Use `ComboBox.Status` to announce the number of the results to a screen reader when the filter changes. It is a hidden `aria-live="polite"` region. `LocaleProvider` localizes the default message, and the `formatMessage` prop replaces it. The region announces only while the popover is open.
17
17
  - Choose `trigger="focus"`, `trigger="input"`, or `trigger="press"` based on your opening behavior requirements.
18
18
 
19
19
  ## Anatomy
@@ -7,12 +7,12 @@
7
7
  Name: `ComboBox.Button`
8
8
  Description: Compatibility alias for `ComboBox.Trigger`.
9
9
 
10
- | Prop | Type | Default | Description |
11
- | -------------- | ---------------------- | ----------- | --------------------------------------------------------------- |
12
- | `class` | `string` | `undefined` | CSS class names for the trigger element. |
13
- | `children` | `Snippet` | `undefined` | Custom trigger content. If omitted, a chevron icon is rendered. |
14
- | `tabindex` | `number` | `-1` | Tab index applied to the trigger button. |
15
- | `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes. |
10
+ | Prop | Type | Default | Description |
11
+ | -------------- | ---------------------- | ----------- | --------------------------------------------------------------------------------------- |
12
+ | `class` | `string` | `undefined` | The CSS class names of the trigger element. |
13
+ | `children` | `Snippet` | `undefined` | Your own content for the trigger. If you give none, the component makes a chevron icon. |
14
+ | `tabindex` | `number` | `-1` | Tab index applied to the trigger button. |
15
+ | `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes. |
16
16
 
17
17
  ## Notes
18
18
 
@@ -12,5 +12,5 @@ Description: Text input with `role="combobox"` that syncs typed value, active de
12
12
  | `aria-label` | `string` | `undefined` | Accessible label applied directly to the input. |
13
13
  | `aria-labelledby` | `string` | `undefined` | Element id that labels the input. |
14
14
  | `aria-describedby` | `string` | `undefined` | Element id that describes the input behavior. |
15
- | `class` | `string` | `undefined` | CSS class names for the input element. |
15
+ | `class` | `string` | `undefined` | The CSS class names of the input element. |
16
16
  | `...restProps` | `HTMLInputAttributes` | `-` | Additional native input attributes. |
@@ -8,11 +8,11 @@
8
8
  } from '../../primitives/input-modality';
9
9
 
10
10
  type ComboBoxInputProps = 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
  };
@@ -115,6 +115,14 @@
115
115
  }
116
116
  </script>
117
117
 
118
+ <!--
119
+ `autocomplete="new-password"` where "off" is what you would expect: Chrome ignores "off"
120
+ on a field it has classified as part of an address form, so a combobox called "País" got
121
+ the browser's saved-addresses dropdown *over* its own option list. "new-password" is the
122
+ one value Chromium honours as "never autofill this", and on a text input it shows no
123
+ password UI of its own. The `data-*` attributes are the equivalent opt-out for the common
124
+ password managers. Consumers can still override it through `restProps`.
125
+ -->
118
126
  <Input
119
127
  bind:element={inputRef}
120
128
  type="text"
@@ -131,7 +139,10 @@
131
139
  aria-label={ariaLabel}
132
140
  aria-labelledby={ariaLabelledby}
133
141
  aria-describedby={ariaDescribedby}
134
- autocomplete="off"
142
+ autocomplete="new-password"
143
+ data-1p-ignore
144
+ data-lpignore="true"
145
+ data-form-type="other"
135
146
  value={ctx.displayValue}
136
147
  disabled={ctx.isDisabled}
137
148
  readonly={ctx.isReadOnly}
@@ -1,10 +1,10 @@
1
1
  import type { HTMLInputAttributes } from 'svelte/elements';
2
2
  type ComboBoxInputProps = 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
  };
@@ -31,9 +31,11 @@
31
31
  | 'scrollOnFocus'
32
32
  | 'isParentDisabled'
33
33
  > & {
34
- /** Called when this item is activated as an action instead of selected. */
34
+ /**
35
+ * The component calls it when the user activates this item as an action, and does not select it.
36
+ */
35
37
  onAction?: ComboBoxItemActionHandler;
36
- /** Whether to close the popover after running onAction. */
38
+ /** Closes the popover after the `onAction` function runs. */
37
39
  closeOnAction?: boolean;
38
40
  };
39
41
 
@@ -14,9 +14,11 @@ import { type ComboBoxItemActionHandler } from '../root/context';
14
14
  * - Automatic filtering based on inputValue
15
15
  */
16
16
  type ComboBoxListBoxItemProps = Omit<ComponentProps<typeof ListBoxItem>, 'customId' | 'disableFocusHandling' | 'isFocusedOverride' | 'onItemSelect' | 'onResolvedTextValue' | 'scrollOnFocus' | 'isParentDisabled'> & {
17
- /** Called when this item is activated as an action instead of selected. */
17
+ /**
18
+ * The component calls it when the user activates this item as an action, and does not select it.
19
+ */
18
20
  onAction?: ComboBoxItemActionHandler;
19
- /** Whether to close the popover after running onAction. */
21
+ /** Closes the popover after the `onAction` function runs. */
20
22
  closeOnAction?: boolean;
21
23
  };
22
24
  declare const ComboboxListboxitem: import("svelte").Component<ComboBoxListBoxItemProps, {}, "">;
@@ -11,5 +11,5 @@ Description: Visual selection indicator rendered inside `ComboBox.Item`.
11
11
  | -------------- | --------------------------------- | ------------ | ---------------------------------------------------- |
12
12
  | `children` | `Snippet` | `check icon` | Custom indicator content. |
13
13
  | `forceMount` | `boolean` | `false` | Forces rendering even when the item is not selected. |
14
- | `class` | `string` | `undefined` | CSS class names for the indicator wrapper. |
14
+ | `class` | `string` | `undefined` | The CSS class names of the indicator container. |
15
15
  | `...restProps` | `HTMLAttributes<HTMLSpanElement>` | `-` | Additional attributes passed to the wrapper span. |
@@ -14,9 +14,9 @@
14
14
  * Only renders when the parent item is selected.
15
15
  */
16
16
  type ComboBoxItemIndicatorProps = {
17
- /** Content to render when selected (defaults to checkmark icon) */
17
+ /** The content while the item is selected. The default is a check mark icon. */
18
18
  children?: Snippet;
19
- /** Force show the indicator regardless of selection state */
19
+ /** Keeps the indicator in the DOM, for each selection state. */
20
20
  forceMount?: boolean;
21
21
  class?: string;
22
22
  } & Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'children'>;
@@ -6,9 +6,9 @@ import type { HTMLAttributes } from 'svelte/elements';
6
6
  * Only renders when the parent item is selected.
7
7
  */
8
8
  type ComboBoxItemIndicatorProps = {
9
- /** Content to render when selected (defaults to checkmark icon) */
9
+ /** The content while the item is selected. The default is a check mark icon. */
10
10
  children?: Snippet;
11
- /** Force show the indicator regardless of selection state */
11
+ /** Keeps the indicator in the DOM, for each selection state. */
12
12
  forceMount?: boolean;
13
13
  class?: string;
14
14
  } & Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'children'>;