bits-ui 1.8.0 → 2.2.0

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 (317) hide show
  1. package/dist/bits/accordion/accordion.svelte.d.ts +56 -53
  2. package/dist/bits/accordion/accordion.svelte.js +78 -89
  3. package/dist/bits/accordion/components/accordion-content.svelte +5 -3
  4. package/dist/bits/accordion/components/accordion-header.svelte +4 -2
  5. package/dist/bits/accordion/components/accordion-item.svelte +6 -3
  6. package/dist/bits/accordion/components/accordion-trigger.svelte +4 -2
  7. package/dist/bits/accordion/components/accordion.svelte +4 -2
  8. package/dist/bits/alert-dialog/components/alert-dialog-action.svelte +4 -2
  9. package/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte +4 -2
  10. package/dist/bits/alert-dialog/components/alert-dialog-content.svelte +8 -3
  11. package/dist/bits/aspect-ratio/aspect-ratio.svelte.js +2 -2
  12. package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +4 -2
  13. package/dist/bits/avatar/avatar.svelte.d.ts +2 -1
  14. package/dist/bits/avatar/avatar.svelte.js +8 -6
  15. package/dist/bits/avatar/components/avatar-fallback.svelte +4 -2
  16. package/dist/bits/avatar/components/avatar-image.svelte +4 -2
  17. package/dist/bits/avatar/components/avatar.svelte +4 -2
  18. package/dist/bits/button/components/button.svelte +1 -1
  19. package/dist/bits/calendar/calendar.svelte.d.ts +3 -9
  20. package/dist/bits/calendar/calendar.svelte.js +55 -41
  21. package/dist/bits/calendar/components/calendar-cell.svelte +4 -2
  22. package/dist/bits/calendar/components/calendar-day.svelte +4 -2
  23. package/dist/bits/calendar/components/calendar-grid-body.svelte +4 -2
  24. package/dist/bits/calendar/components/calendar-grid-head.svelte +4 -2
  25. package/dist/bits/calendar/components/calendar-grid-row.svelte +4 -2
  26. package/dist/bits/calendar/components/calendar-grid.svelte +4 -2
  27. package/dist/bits/calendar/components/calendar-head-cell.svelte +4 -2
  28. package/dist/bits/calendar/components/calendar-header.svelte +4 -2
  29. package/dist/bits/calendar/components/calendar-heading.svelte +4 -2
  30. package/dist/bits/calendar/components/calendar-next-button.svelte +4 -2
  31. package/dist/bits/calendar/components/calendar-prev-button.svelte +4 -2
  32. package/dist/bits/checkbox/checkbox.svelte.js +4 -14
  33. package/dist/bits/checkbox/components/checkbox-group-label.svelte +4 -2
  34. package/dist/bits/checkbox/components/checkbox-group.svelte +4 -2
  35. package/dist/bits/checkbox/components/checkbox.svelte +4 -2
  36. package/dist/bits/collapsible/collapsible.svelte.js +4 -10
  37. package/dist/bits/collapsible/components/collapsible-content.svelte +5 -3
  38. package/dist/bits/collapsible/components/collapsible-trigger.svelte +4 -2
  39. package/dist/bits/collapsible/components/collapsible.svelte +4 -2
  40. package/dist/bits/combobox/components/combobox-input.svelte +3 -3
  41. package/dist/bits/combobox/components/combobox.svelte +6 -1
  42. package/dist/bits/combobox/types.d.ts +18 -1
  43. package/dist/bits/command/command.svelte.js +13 -45
  44. package/dist/bits/command/components/_command-label.svelte +6 -7
  45. package/dist/bits/command/components/_command-label.svelte.d.ts +1 -1
  46. package/dist/bits/command/components/command-empty.svelte +4 -2
  47. package/dist/bits/command/components/command-group-heading.svelte +4 -2
  48. package/dist/bits/command/components/command-group-items.svelte +4 -2
  49. package/dist/bits/command/components/command-group.svelte +4 -2
  50. package/dist/bits/command/components/command-input.svelte +4 -2
  51. package/dist/bits/command/components/command-item.svelte +4 -2
  52. package/dist/bits/command/components/command-link-item.svelte +4 -2
  53. package/dist/bits/command/components/command-list.svelte +4 -2
  54. package/dist/bits/command/components/command-loading.svelte +4 -2
  55. package/dist/bits/command/components/command-separator.svelte +4 -2
  56. package/dist/bits/command/components/command-viewport.svelte +4 -2
  57. package/dist/bits/command/components/command.svelte +4 -2
  58. package/dist/bits/context-menu/components/context-menu-content-static.svelte +2 -3
  59. package/dist/bits/context-menu/components/context-menu-content.svelte +2 -3
  60. package/dist/bits/context-menu/components/context-menu-trigger.svelte +1 -1
  61. package/dist/bits/date-field/components/date-field-input.svelte +4 -2
  62. package/dist/bits/date-field/components/date-field-label.svelte +4 -2
  63. package/dist/bits/date-field/components/date-field-segment.svelte +4 -2
  64. package/dist/bits/date-field/date-field.svelte.d.ts +7 -5
  65. package/dist/bits/date-field/date-field.svelte.js +29 -38
  66. package/dist/bits/date-picker/components/date-picker-calendar.svelte +4 -2
  67. package/dist/bits/date-range-field/components/date-range-field-input.svelte +4 -2
  68. package/dist/bits/date-range-field/components/date-range-field-label.svelte +4 -2
  69. package/dist/bits/date-range-field/components/date-range-field.svelte +4 -2
  70. package/dist/bits/date-range-field/date-range-field.svelte.d.ts +2 -0
  71. package/dist/bits/date-range-field/date-range-field.svelte.js +6 -14
  72. package/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte +4 -2
  73. package/dist/bits/dialog/components/dialog-close.svelte +4 -2
  74. package/dist/bits/dialog/components/dialog-content.svelte +8 -2
  75. package/dist/bits/dialog/components/dialog-description.svelte +4 -2
  76. package/dist/bits/dialog/components/dialog-overlay.svelte +8 -3
  77. package/dist/bits/dialog/components/dialog-title.svelte +4 -2
  78. package/dist/bits/dialog/components/dialog-trigger.svelte +4 -2
  79. package/dist/bits/dialog/dialog.svelte.d.ts +1 -1
  80. package/dist/bits/dialog/dialog.svelte.js +19 -47
  81. package/dist/bits/dropdown-menu/components/dropdown-menu-content-static.svelte +6 -5
  82. package/dist/bits/dropdown-menu/components/dropdown-menu-content.svelte +6 -5
  83. package/dist/bits/index.d.ts +2 -0
  84. package/dist/bits/index.js +2 -0
  85. package/dist/bits/label/components/label.svelte +4 -2
  86. package/dist/bits/label/label.svelte.js +2 -2
  87. package/dist/bits/link-preview/components/link-preview-content-static.svelte +6 -2
  88. package/dist/bits/link-preview/components/link-preview-content.svelte +6 -2
  89. package/dist/bits/link-preview/components/link-preview-trigger.svelte +5 -3
  90. package/dist/bits/link-preview/link-preview.svelte.d.ts +2 -0
  91. package/dist/bits/link-preview/link-preview.svelte.js +13 -19
  92. package/dist/bits/menu/components/menu-checkbox-group.svelte +4 -2
  93. package/dist/bits/menu/components/menu-checkbox-item.svelte +6 -4
  94. package/dist/bits/menu/components/menu-content-static.svelte +6 -5
  95. package/dist/bits/menu/components/menu-content.svelte +6 -5
  96. package/dist/bits/menu/components/menu-group-heading.svelte +4 -2
  97. package/dist/bits/menu/components/menu-group.svelte +4 -2
  98. package/dist/bits/menu/components/menu-item.svelte +4 -2
  99. package/dist/bits/menu/components/menu-radio-group.svelte +4 -2
  100. package/dist/bits/menu/components/menu-radio-item.svelte +4 -2
  101. package/dist/bits/menu/components/menu-separator.svelte +4 -2
  102. package/dist/bits/menu/components/menu-sub-content-static.svelte +6 -5
  103. package/dist/bits/menu/components/menu-sub-content.svelte +6 -5
  104. package/dist/bits/menu/components/menu-sub-trigger.svelte +6 -3
  105. package/dist/bits/menu/components/menu-trigger.svelte +5 -3
  106. package/dist/bits/menu/menu.svelte.d.ts +9 -20
  107. package/dist/bits/menu/menu.svelte.js +40 -63
  108. package/dist/bits/menubar/components/menubar-content-static.svelte +4 -2
  109. package/dist/bits/menubar/components/menubar-content.svelte +4 -2
  110. package/dist/bits/menubar/components/menubar-menu.svelte +4 -2
  111. package/dist/bits/menubar/components/menubar-trigger.svelte +14 -6
  112. package/dist/bits/menubar/components/menubar.svelte +4 -2
  113. package/dist/bits/menubar/menubar.svelte.d.ts +24 -20
  114. package/dist/bits/menubar/menubar.svelte.js +40 -56
  115. package/dist/bits/meter/components/meter.svelte +4 -2
  116. package/dist/bits/meter/meter.svelte.js +2 -2
  117. package/dist/bits/navigation-menu/components/navigation-menu-content-impl.svelte +5 -2
  118. package/dist/bits/navigation-menu/components/navigation-menu-content.svelte +8 -3
  119. package/dist/bits/navigation-menu/components/navigation-menu-indicator-impl.svelte +4 -2
  120. package/dist/bits/navigation-menu/components/navigation-menu-indicator.svelte +6 -4
  121. package/dist/bits/navigation-menu/components/navigation-menu-item.svelte +6 -3
  122. package/dist/bits/navigation-menu/components/navigation-menu-link.svelte +4 -2
  123. package/dist/bits/navigation-menu/components/navigation-menu-list.svelte +4 -2
  124. package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte +4 -2
  125. package/dist/bits/navigation-menu/components/navigation-menu-trigger.svelte +4 -2
  126. package/dist/bits/navigation-menu/components/navigation-menu-viewport.svelte +5 -3
  127. package/dist/bits/navigation-menu/components/navigation-menu.svelte +4 -2
  128. package/dist/bits/navigation-menu/navigation-menu.svelte.d.ts +3 -1
  129. package/dist/bits/navigation-menu/navigation-menu.svelte.js +33 -60
  130. package/dist/bits/pagination/components/pagination-next-button.svelte +4 -2
  131. package/dist/bits/pagination/components/pagination-page.svelte +4 -2
  132. package/dist/bits/pagination/components/pagination-prev-button.svelte +4 -2
  133. package/dist/bits/pagination/components/pagination.svelte +4 -2
  134. package/dist/bits/pagination/pagination.svelte.js +4 -4
  135. package/dist/bits/pin-input/components/pin-input-cell.svelte +4 -2
  136. package/dist/bits/pin-input/components/pin-input.svelte +5 -3
  137. package/dist/bits/pin-input/pin-input.svelte.d.ts +4 -2
  138. package/dist/bits/pin-input/pin-input.svelte.js +20 -22
  139. package/dist/bits/pin-input/usePasswordManager.svelte.d.ts +3 -2
  140. package/dist/bits/pin-input/usePasswordManager.svelte.js +6 -5
  141. package/dist/bits/popover/components/popover-close.svelte +4 -2
  142. package/dist/bits/popover/components/popover-content-static.svelte +6 -2
  143. package/dist/bits/popover/components/popover-content.svelte +6 -2
  144. package/dist/bits/popover/components/popover-trigger.svelte +5 -3
  145. package/dist/bits/popover/popover.svelte.js +4 -18
  146. package/dist/bits/progress/components/progress.svelte +4 -2
  147. package/dist/bits/progress/progress.svelte.js +2 -2
  148. package/dist/bits/radio-group/components/radio-group-item.svelte +4 -2
  149. package/dist/bits/radio-group/components/radio-group.svelte +4 -2
  150. package/dist/bits/radio-group/radio-group.svelte.js +4 -7
  151. package/dist/bits/range-calendar/components/range-calendar-cell.svelte +4 -2
  152. package/dist/bits/range-calendar/components/range-calendar-day.svelte +4 -2
  153. package/dist/bits/range-calendar/components/range-calendar.svelte +4 -2
  154. package/dist/bits/range-calendar/range-calendar.svelte.d.ts +2 -0
  155. package/dist/bits/range-calendar/range-calendar.svelte.js +12 -6
  156. package/dist/bits/scroll-area/components/scroll-area-corner.svelte +8 -2
  157. package/dist/bits/scroll-area/components/scroll-area-scrollbar-auto.svelte +4 -1
  158. package/dist/bits/scroll-area/components/scroll-area-scrollbar-hover.svelte +1 -1
  159. package/dist/bits/scroll-area/components/scroll-area-scrollbar-scroll.svelte +5 -1
  160. package/dist/bits/scroll-area/components/scroll-area-scrollbar.svelte +4 -2
  161. package/dist/bits/scroll-area/components/scroll-area-thumb.svelte +8 -3
  162. package/dist/bits/scroll-area/components/scroll-area-viewport.svelte +4 -2
  163. package/dist/bits/scroll-area/components/scroll-area.svelte +4 -2
  164. package/dist/bits/scroll-area/scroll-area.svelte.d.ts +2 -0
  165. package/dist/bits/scroll-area/scroll-area.svelte.js +27 -58
  166. package/dist/bits/select/components/select-content-static.svelte +6 -2
  167. package/dist/bits/select/components/select-content.svelte +6 -2
  168. package/dist/bits/select/components/select-group-heading.svelte +3 -2
  169. package/dist/bits/select/components/select-group.svelte +4 -2
  170. package/dist/bits/select/components/select-item.svelte +4 -2
  171. package/dist/bits/select/components/select-scroll-down-button.svelte +4 -2
  172. package/dist/bits/select/components/select-scroll-up-button.svelte +4 -2
  173. package/dist/bits/select/components/select-trigger.svelte +5 -3
  174. package/dist/bits/select/components/select-viewport.svelte +4 -2
  175. package/dist/bits/select/components/select.svelte +7 -1
  176. package/dist/bits/select/select.svelte.d.ts +5 -19
  177. package/dist/bits/select/select.svelte.js +43 -60
  178. package/dist/bits/separator/components/separator.svelte +4 -2
  179. package/dist/bits/separator/separator.svelte.js +2 -2
  180. package/dist/bits/slider/components/slider-range.svelte +4 -2
  181. package/dist/bits/slider/components/slider-thumb-label.svelte +50 -0
  182. package/dist/bits/slider/components/slider-thumb-label.svelte.d.ts +4 -0
  183. package/dist/bits/slider/components/slider-thumb.svelte +4 -2
  184. package/dist/bits/slider/components/slider-tick-label.svelte +50 -0
  185. package/dist/bits/slider/components/slider-tick-label.svelte.d.ts +4 -0
  186. package/dist/bits/slider/components/slider-tick.svelte +4 -2
  187. package/dist/bits/slider/components/slider.svelte +24 -5
  188. package/dist/bits/slider/exports.d.ts +3 -1
  189. package/dist/bits/slider/exports.js +2 -0
  190. package/dist/bits/slider/helpers.d.ts +14 -0
  191. package/dist/bits/slider/helpers.js +122 -0
  192. package/dist/bits/slider/slider.svelte.d.ts +91 -5
  193. package/dist/bits/slider/slider.svelte.js +194 -101
  194. package/dist/bits/slider/types.d.ts +105 -11
  195. package/dist/bits/switch/components/switch-thumb.svelte +4 -2
  196. package/dist/bits/switch/components/switch.svelte +4 -2
  197. package/dist/bits/switch/switch.svelte.js +3 -3
  198. package/dist/bits/tabs/components/tabs-content.svelte +4 -2
  199. package/dist/bits/tabs/components/tabs-list.svelte +4 -2
  200. package/dist/bits/tabs/components/tabs-trigger.svelte +4 -2
  201. package/dist/bits/tabs/components/tabs.svelte +4 -2
  202. package/dist/bits/tabs/tabs.svelte.js +6 -6
  203. package/dist/bits/time-field/components/time-field-hidden-input.svelte +10 -0
  204. package/dist/bits/{date-field/components/date-field-error.svelte.d.ts → time-field/components/time-field-hidden-input.svelte.d.ts} +6 -14
  205. package/dist/bits/time-field/components/time-field-input.svelte +39 -0
  206. package/dist/bits/time-field/components/time-field-input.svelte.d.ts +4 -0
  207. package/dist/bits/time-field/components/time-field-label.svelte +34 -0
  208. package/dist/bits/time-field/components/time-field-label.svelte.d.ts +4 -0
  209. package/dist/bits/time-field/components/time-field-segment.svelte +37 -0
  210. package/dist/bits/time-field/components/time-field-segment.svelte.d.ts +4 -0
  211. package/dist/bits/time-field/components/time-field.svelte +94 -0
  212. package/dist/bits/time-field/components/time-field.svelte.d.ts +20 -0
  213. package/dist/bits/time-field/exports.d.ts +5 -0
  214. package/dist/bits/time-field/exports.js +4 -0
  215. package/dist/bits/time-field/index.d.ts +1 -0
  216. package/dist/bits/time-field/index.js +1 -0
  217. package/dist/bits/time-field/time-field.svelte.d.ts +417 -0
  218. package/dist/bits/time-field/time-field.svelte.js +980 -0
  219. package/dist/bits/time-field/types.d.ts +137 -0
  220. package/dist/bits/time-field/types.js +1 -0
  221. package/dist/bits/time-range-field/components/time-range-field-input.svelte +43 -0
  222. package/dist/bits/time-range-field/components/time-range-field-input.svelte.d.ts +4 -0
  223. package/dist/bits/time-range-field/components/time-range-field-label.svelte +34 -0
  224. package/dist/bits/time-range-field/components/time-range-field-label.svelte.d.ts +4 -0
  225. package/dist/bits/time-range-field/components/time-range-field.svelte +144 -0
  226. package/dist/bits/time-range-field/components/time-range-field.svelte.d.ts +20 -0
  227. package/dist/bits/time-range-field/exports.d.ts +5 -0
  228. package/dist/bits/time-range-field/exports.js +4 -0
  229. package/dist/bits/time-range-field/index.d.ts +1 -0
  230. package/dist/bits/time-range-field/index.js +1 -0
  231. package/dist/bits/time-range-field/time-range-field.svelte.d.ts +92 -0
  232. package/dist/bits/time-range-field/time-range-field.svelte.js +212 -0
  233. package/dist/bits/time-range-field/types.d.ts +150 -0
  234. package/dist/bits/time-range-field/types.js +1 -0
  235. package/dist/bits/toggle/components/toggle.svelte +4 -2
  236. package/dist/bits/toggle/toggle.svelte.js +2 -2
  237. package/dist/bits/toggle-group/components/toggle-group-item.svelte +4 -2
  238. package/dist/bits/toggle-group/components/toggle-group.svelte +4 -2
  239. package/dist/bits/toggle-group/toggle-group.svelte.js +4 -4
  240. package/dist/bits/toolbar/components/toolbar-button.svelte +4 -2
  241. package/dist/bits/toolbar/components/toolbar-group-item.svelte +4 -2
  242. package/dist/bits/toolbar/components/toolbar-group.svelte +4 -2
  243. package/dist/bits/toolbar/components/toolbar-link.svelte +4 -2
  244. package/dist/bits/toolbar/components/toolbar.svelte +4 -2
  245. package/dist/bits/toolbar/toolbar.svelte.js +7 -7
  246. package/dist/bits/tooltip/components/tooltip-content-static.svelte +6 -2
  247. package/dist/bits/tooltip/components/tooltip-content.svelte +6 -2
  248. package/dist/bits/tooltip/components/tooltip-trigger.svelte +5 -3
  249. package/dist/bits/tooltip/tooltip.svelte.d.ts +2 -0
  250. package/dist/bits/tooltip/tooltip.svelte.js +6 -15
  251. package/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte +2 -0
  252. package/dist/bits/utilities/dismissible-layer/types.d.ts +2 -0
  253. package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.d.ts +3 -3
  254. package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js +16 -25
  255. package/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte +2 -1
  256. package/dist/bits/utilities/floating-layer/types.d.ts +1 -0
  257. package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.d.ts +3 -2
  258. package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js +7 -27
  259. package/dist/bits/utilities/focus-scope/focus-scope.svelte +2 -0
  260. package/dist/bits/utilities/focus-scope/types.d.ts +2 -0
  261. package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.d.ts +2 -1
  262. package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.js +15 -16
  263. package/dist/bits/utilities/popper-layer/popper-layer-inner.svelte +4 -0
  264. package/dist/bits/utilities/popper-layer/popper-layer.svelte +3 -1
  265. package/dist/bits/utilities/portal/types.d.ts +1 -1
  266. package/dist/bits/utilities/presence-layer/presence-layer.svelte +2 -2
  267. package/dist/bits/utilities/presence-layer/types.d.ts +2 -1
  268. package/dist/bits/utilities/presence-layer/use-presence.svelte.d.ts +1 -1
  269. package/dist/bits/utilities/presence-layer/use-presence.svelte.js +19 -36
  270. package/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte +2 -0
  271. package/dist/bits/utilities/text-selection-layer/types.d.ts +2 -0
  272. package/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.d.ts +5 -1
  273. package/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.js +8 -14
  274. package/dist/index.d.ts +1 -1
  275. package/dist/index.js +1 -1
  276. package/dist/internal/box-auto-reset.svelte.d.ts +7 -1
  277. package/dist/internal/box-auto-reset.svelte.js +11 -6
  278. package/dist/internal/create-id.d.ts +8 -0
  279. package/dist/internal/create-id.js +5 -0
  280. package/dist/internal/date-time/announcer.d.ts +1 -1
  281. package/dist/internal/date-time/announcer.js +20 -20
  282. package/dist/internal/date-time/calendar-helpers.svelte.js +7 -5
  283. package/dist/internal/date-time/field/helpers.d.ts +9 -2
  284. package/dist/internal/date-time/field/helpers.js +16 -9
  285. package/dist/internal/date-time/field/parts.d.ts +3 -1
  286. package/dist/internal/date-time/field/parts.js +10 -2
  287. package/dist/internal/date-time/field/segments.d.ts +9 -0
  288. package/dist/internal/date-time/field/segments.js +65 -0
  289. package/dist/internal/date-time/field/time-helpers.d.ts +83 -0
  290. package/dist/internal/date-time/field/time-helpers.js +301 -0
  291. package/dist/internal/date-time/field/types.d.ts +2 -2
  292. package/dist/internal/date-time/formatter.d.ts +11 -1
  293. package/dist/internal/date-time/formatter.js +56 -0
  294. package/dist/internal/date-time/utils.d.ts +7 -2
  295. package/dist/internal/date-time/utils.js +15 -1
  296. package/dist/internal/dom.d.ts +0 -1
  297. package/dist/internal/dom.js +0 -3
  298. package/dist/internal/focus.d.ts +2 -2
  299. package/dist/internal/focus.js +14 -9
  300. package/dist/internal/math.d.ts +0 -4
  301. package/dist/internal/math.js +0 -28
  302. package/dist/internal/tabbable.d.ts +0 -2
  303. package/dist/internal/tabbable.js +10 -14
  304. package/dist/internal/use-data-typeahead.svelte.d.ts +1 -0
  305. package/dist/internal/use-data-typeahead.svelte.js +4 -1
  306. package/dist/internal/use-dom-typeahead.svelte.d.ts +3 -1
  307. package/dist/internal/use-dom-typeahead.svelte.js +5 -2
  308. package/dist/internal/use-grace-area.svelte.js +9 -5
  309. package/dist/internal/use-roving-focus.svelte.d.ts +3 -3
  310. package/dist/internal/use-roving-focus.svelte.js +10 -11
  311. package/dist/shared/date/types.d.ts +27 -4
  312. package/dist/shared/index.d.ts +2 -2
  313. package/dist/types.d.ts +2 -0
  314. package/package.json +18 -16
  315. package/dist/bits/date-field/components/date-field-error.svelte +0 -0
  316. package/dist/internal/use-size.svelte.d.ts +0 -7
  317. package/dist/internal/use-size.svelte.js +0 -54
@@ -2,13 +2,15 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import { useCalendarHeader } from "../calendar.svelte.js";
4
4
  import type { CalendarHeaderProps } from "../types.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
+
7
+ const uid = $props.id();
6
8
 
7
9
  let {
8
10
  children,
9
11
  child,
10
12
  ref = $bindable(null),
11
- id = useId(),
13
+ id = createId(uid),
12
14
  ...restProps
13
15
  }: CalendarHeaderProps = $props();
14
16
 
@@ -2,13 +2,15 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import type { CalendarHeadingProps } from "../types.js";
4
4
  import { useCalendarHeading } from "../calendar.svelte.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
+
7
+ const uid = $props.id();
6
8
 
7
9
  let {
8
10
  children,
9
11
  child,
10
12
  ref = $bindable(null),
11
- id = useId(),
13
+ id = createId(uid),
12
14
  ...restProps
13
15
  }: CalendarHeadingProps = $props();
14
16
 
@@ -2,12 +2,14 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import { useCalendarNextButton } from "../calendar.svelte.js";
4
4
  import type { CalendarNextButtonProps } from "../types.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
+
7
+ const uid = $props.id();
6
8
 
7
9
  let {
8
10
  children,
9
11
  child,
10
- id = useId(),
12
+ id = createId(uid),
11
13
  ref = $bindable(null),
12
14
  ...restProps
13
15
  }: CalendarNextButtonProps = $props();
@@ -2,12 +2,14 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import type { CalendarPrevButtonProps } from "../types.js";
4
4
  import { useCalendarPrevButton } from "../calendar.svelte.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
+
7
+ const uid = $props.id();
6
8
 
7
9
  let {
8
10
  children,
9
11
  child,
10
- id = useId(),
12
+ id = createId(uid),
11
13
  ref = $bindable(null),
12
14
  ...restProps
13
15
  }: CalendarPrevButtonProps = $props();
@@ -1,4 +1,4 @@
1
- import { useRefById } from "svelte-toolbelt";
1
+ import { attachRef } from "svelte-toolbelt";
2
2
  import { Context, watch } from "runed";
3
3
  import { getAriaChecked, getAriaRequired, getDataDisabled } from "../../internal/attrs.js";
4
4
  import { kbd } from "../../internal/kbd.js";
@@ -10,7 +10,6 @@ class CheckboxGroupState {
10
10
  labelId = $state(undefined);
11
11
  constructor(opts) {
12
12
  this.opts = opts;
13
- useRefById(opts);
14
13
  }
15
14
  addValue(checkboxValue) {
16
15
  if (!checkboxValue)
@@ -37,6 +36,7 @@ class CheckboxGroupState {
37
36
  "aria-labelledby": this.labelId,
38
37
  "data-disabled": getDataDisabled(this.opts.disabled.current),
39
38
  [CHECKBOX_GROUP_ATTR]: "",
39
+ ...attachRef(this.opts.ref),
40
40
  }));
41
41
  }
42
42
  class CheckboxGroupLabelState {
@@ -45,22 +45,12 @@ class CheckboxGroupLabelState {
45
45
  constructor(opts, group) {
46
46
  this.opts = opts;
47
47
  this.group = group;
48
- useRefById({
49
- ...opts,
50
- onRefChange: (node) => {
51
- if (node) {
52
- group.labelId = node.id;
53
- }
54
- else {
55
- group.labelId = undefined;
56
- }
57
- },
58
- });
59
48
  }
60
49
  props = $derived.by(() => ({
61
50
  id: this.opts.id.current,
62
51
  "data-disabled": getDataDisabled(this.group.opts.disabled.current),
63
52
  [CHECKBOX_GROUP_LABEL_ATTR]: "",
53
+ ...attachRef(this.opts.ref, (v) => (this.group.labelId = v?.id)),
64
54
  }));
65
55
  }
66
56
  class CheckboxRootState {
@@ -91,7 +81,6 @@ class CheckboxRootState {
91
81
  this.group = group;
92
82
  this.onkeydown = this.onkeydown.bind(this);
93
83
  this.onclick = this.onclick.bind(this);
94
- useRefById(opts);
95
84
  watch.pre([() => $state.snapshot(this.group?.opts.value.current), () => this.opts.value.current], ([groupValue, value]) => {
96
85
  if (!groupValue || !value)
97
86
  return;
@@ -149,6 +138,7 @@ class CheckboxRootState {
149
138
  //
150
139
  onclick: this.onclick,
151
140
  onkeydown: this.onkeydown,
141
+ ...attachRef(this.opts.ref),
152
142
  }));
153
143
  }
154
144
  //
@@ -2,11 +2,13 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import type { CheckboxGroupLabelProps } from "../types.js";
4
4
  import { useCheckboxGroupLabel } from "../checkbox.svelte.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
+
7
+ const uid = $props.id();
6
8
 
7
9
  let {
8
10
  ref = $bindable(null),
9
- id = useId(),
11
+ id = createId(uid),
10
12
  child,
11
13
  children,
12
14
  ...restProps
@@ -3,11 +3,13 @@
3
3
  import type { CheckboxGroupProps } from "../types.js";
4
4
  import { useCheckboxGroup } from "../checkbox.svelte.js";
5
5
  import { noop } from "../../../internal/noop.js";
6
- import { useId } from "../../../internal/use-id.js";
6
+ import { createId } from "../../../internal/create-id.js";
7
+
8
+ const uid = $props.id();
7
9
 
8
10
  let {
9
11
  ref = $bindable(null),
10
- id = useId(),
12
+ id = createId(uid),
11
13
  value = $bindable([]),
12
14
  onValueChange = noop,
13
15
  name,
@@ -3,9 +3,11 @@
3
3
  import type { CheckboxRootProps } from "../types.js";
4
4
  import { CheckboxGroupContext, useCheckboxRoot } from "../checkbox.svelte.js";
5
5
  import CheckboxInput from "./checkbox-input.svelte";
6
- import { useId } from "../../../internal/use-id.js";
6
+ import { createId } from "../../../internal/create-id.js";
7
7
  import { watch } from "runed";
8
8
 
9
+ const uid = $props.id();
10
+
9
11
  let {
10
12
  checked = $bindable(false),
11
13
  ref = $bindable(null),
@@ -15,7 +17,7 @@
15
17
  required = false,
16
18
  name = undefined,
17
19
  value = "on",
18
- id = useId(),
20
+ id = createId(uid),
19
21
  indeterminate = $bindable(false),
20
22
  onIndeterminateChange,
21
23
  child,
@@ -1,4 +1,4 @@
1
- import { afterTick, useRefById } from "svelte-toolbelt";
1
+ import { afterTick, attachRef } from "svelte-toolbelt";
2
2
  import { Context, watch } from "runed";
3
3
  import { getAriaExpanded, getDataDisabled, getDataOpenClosed } from "../../internal/attrs.js";
4
4
  import { kbd } from "../../internal/kbd.js";
@@ -11,7 +11,6 @@ class CollapsibleRootState {
11
11
  constructor(opts) {
12
12
  this.opts = opts;
13
13
  this.toggleOpen = this.toggleOpen.bind(this);
14
- useRefById(opts);
15
14
  }
16
15
  toggleOpen() {
17
16
  this.opts.open.current = !this.opts.open.current;
@@ -21,6 +20,7 @@ class CollapsibleRootState {
21
20
  "data-state": getDataOpenClosed(this.opts.open.current),
22
21
  "data-disabled": getDataDisabled(this.opts.disabled.current),
23
22
  [COLLAPSIBLE_ROOT_ATTR]: "",
23
+ ...attachRef(this.opts.ref),
24
24
  }));
25
25
  }
26
26
  class CollapsibleContentState {
@@ -35,13 +35,6 @@ class CollapsibleContentState {
35
35
  this.opts = opts;
36
36
  this.root = root;
37
37
  this.#isMountAnimationPrevented = root.opts.open.current;
38
- useRefById({
39
- ...opts,
40
- deps: () => this.present,
41
- onRefChange: (node) => {
42
- this.root.contentNode = node;
43
- },
44
- });
45
38
  $effect.pre(() => {
46
39
  const rAF = requestAnimationFrame(() => {
47
40
  this.#isMountAnimationPrevented = false;
@@ -92,6 +85,7 @@ class CollapsibleContentState {
92
85
  "data-state": getDataOpenClosed(this.root.opts.open.current),
93
86
  "data-disabled": getDataDisabled(this.root.opts.disabled.current),
94
87
  [COLLAPSIBLE_CONTENT_ATTR]: "",
88
+ ...attachRef(this.opts.ref, (v) => (this.root.contentNode = v)),
95
89
  }));
96
90
  }
97
91
  class CollapsibleTriggerState {
@@ -103,7 +97,6 @@ class CollapsibleTriggerState {
103
97
  this.root = root;
104
98
  this.onclick = this.onclick.bind(this);
105
99
  this.onkeydown = this.onkeydown.bind(this);
106
- useRefById(opts);
107
100
  }
108
101
  onclick(e) {
109
102
  if (this.#isDisabled)
@@ -132,6 +125,7 @@ class CollapsibleTriggerState {
132
125
  //
133
126
  onclick: this.onclick,
134
127
  onkeydown: this.onkeydown,
128
+ ...attachRef(this.opts.ref),
135
129
  }));
136
130
  }
137
131
  const CollapsibleRootContext = new Context("Collapsible.Root");
@@ -3,14 +3,16 @@
3
3
  import { useCollapsibleContent } from "../collapsible.svelte.js";
4
4
  import type { CollapsibleContentProps } from "../types.js";
5
5
  import { PresenceLayer } from "../../utilities/presence-layer/index.js";
6
- import { useId } from "../../../internal/use-id.js";
6
+ import { createId } from "../../../internal/create-id.js";
7
+
8
+ const uid = $props.id();
7
9
 
8
10
  let {
9
11
  child,
10
12
  ref = $bindable(null),
11
13
  forceMount = false,
12
14
  children,
13
- id = useId(),
15
+ id = createId(uid),
14
16
  ...restProps
15
17
  }: CollapsibleContentProps & { forceMount?: boolean } = $props();
16
18
 
@@ -24,7 +26,7 @@
24
26
  });
25
27
  </script>
26
28
 
27
- <PresenceLayer forceMount={true} present={contentState.present} {id}>
29
+ <PresenceLayer forceMount={true} present={contentState.present} ref={contentState.opts.ref}>
28
30
  {#snippet presence({ present })}
29
31
  {@const mergedProps = mergeProps(restProps, contentState.props, {
30
32
  hidden: forceMount ? undefined : !present.current,
@@ -2,13 +2,15 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import type { CollapsibleTriggerProps } from "../types.js";
4
4
  import { useCollapsibleTrigger } from "../collapsible.svelte.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
+
7
+ const uid = $props.id();
6
8
 
7
9
  let {
8
10
  children,
9
11
  child,
10
12
  ref = $bindable(null),
11
- id = useId(),
13
+ id = createId(uid),
12
14
  disabled = false,
13
15
  ...restProps
14
16
  }: CollapsibleTriggerProps = $props();
@@ -2,13 +2,15 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import type { CollapsibleRootProps } from "../types.js";
4
4
  import { useCollapsibleRoot } from "../collapsible.svelte.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
6
  import { noop } from "../../../internal/noop.js";
7
7
 
8
+ const uid = $props.id();
9
+
8
10
  let {
9
11
  children,
10
12
  child,
11
- id = useId(),
13
+ id = createId(uid),
12
14
  ref = $bindable(null),
13
15
  open = $bindable(false),
14
16
  disabled = false,
@@ -24,15 +24,15 @@
24
24
  });
25
25
 
26
26
  if (defaultValue) {
27
- inputState.root.inputValue = defaultValue;
27
+ inputState.root.opts.inputValue.current = defaultValue;
28
28
  }
29
29
 
30
30
  const mergedProps = $derived(
31
- mergeProps(restProps, inputState.props, { value: inputState.root.inputValue })
31
+ mergeProps(restProps, inputState.props, { value: inputState.root.opts.inputValue.current })
32
32
  );
33
33
  </script>
34
34
 
35
- <FloatingLayer.Anchor {id}>
35
+ <FloatingLayer.Anchor {id} ref={inputState.opts.ref}>
36
36
  {#if child}
37
37
  {@render child({ props: mergedProps })}
38
38
  {:else}
@@ -20,6 +20,7 @@
20
20
  required = false,
21
21
  items = [],
22
22
  allowDeselect = true,
23
+ inputValue = "",
23
24
  children,
24
25
  }: ComboboxRootProps = $props();
25
26
 
@@ -61,6 +62,10 @@
61
62
  isCombobox: true,
62
63
  items: box.with(() => items),
63
64
  allowDeselect: box.with(() => allowDeselect),
65
+ inputValue: box.with(
66
+ () => inputValue,
67
+ (v) => (inputValue = v)
68
+ ),
64
69
  });
65
70
  </script>
66
71
 
@@ -70,7 +75,7 @@
70
75
 
71
76
  {#if Array.isArray(rootState.opts.value.current)}
72
77
  {#if rootState.opts.value.current.length}
73
- {#each rootState.opts.value.current as item}
78
+ {#each rootState.opts.value.current as item (item)}
74
79
  <ListboxHiddenInput value={item} />
75
80
  {/each}
76
81
  {/if}
@@ -1,6 +1,23 @@
1
1
  import type { BitsPrimitiveInputAttributes } from "../../shared/attributes.js";
2
+ import type { SelectBaseRootPropsWithoutHTML, SelectMultipleRootPropsWithoutHTML, SelectSingleRootPropsWithoutHTML } from "../select/types.js";
2
3
  import type { WithChild, Without } from "../../internal/types.js";
3
- export type { SelectBaseRootPropsWithoutHTML as ComboboxBaseRootPropsWithoutHTML, SelectContentProps as ComboboxContentProps, SelectContentPropsWithoutHTML as ComboboxContentPropsWithoutHTML, SelectContentStaticProps as ComboboxContentStaticProps, SelectContentStaticPropsWithoutHTML as ComboboxContentStaticPropsWithoutHTML, SelectItemProps as ComboboxItemProps, SelectItemPropsWithoutHTML as ComboboxItemPropsWithoutHTML, SelectItemSnippetProps as ComboboxItemSnippetProps, SelectMultipleRootProps as ComboboxMultipleRootProps, SelectMultipleRootPropsWithoutHTML as ComboboxMultipleRootPropsWithoutHTML, SelectRootProps as ComboboxRootProps, SelectRootPropsWithoutHTML as ComboboxRootPropsWithoutHTML, SelectSingleRootProps as ComboboxSingleRootProps, SelectSingleRootPropsWithoutHTML as ComboboxSingleRootPropsWithoutHTML, SelectTriggerProps as ComboboxTriggerProps, SelectTriggerPropsWithoutHTML as ComboboxTriggerPropsWithoutHTML, SelectGroupPropsWithoutHTML as ComboboxGroupPropsWithoutHTML, SelectGroupProps as ComboboxGroupProps, SelectGroupHeadingPropsWithoutHTML as ComboboxGroupHeadingPropsWithoutHTML, SelectGroupHeadingProps as ComboboxGroupHeadingProps, SelectViewportPropsWithoutHTML as ComboboxViewportPropsWithoutHTML, SelectViewportProps as ComboboxViewportProps, SelectScrollDownButtonProps as ComboboxScrollDownButtonProps, SelectScrollDownButtonPropsWithoutHTML as ComboboxScrollDownButtonPropsWithoutHTML, SelectScrollUpButtonProps as ComboboxScrollUpButtonProps, SelectScrollUpButtonPropsWithoutHTML as ComboboxScrollUpButtonPropsWithoutHTML, SelectArrowProps as ComboboxArrowProps, SelectArrowPropsWithoutHTML as ComboboxArrowPropsWithoutHTML, SelectPortalProps as ComboboxPortalProps, SelectPortalPropsWithoutHTML as ComboboxPortalPropsWithoutHTML, } from "../select/types.js";
4
+ export type ComboboxBaseRootPropsWithoutHTML = SelectBaseRootPropsWithoutHTML & {
5
+ /**
6
+ * A read-only value that can be used to programmatically
7
+ * update the input value.
8
+ *
9
+ * This is useful for updating the displayed label/input
10
+ * when the value changes outside of Bits UI.
11
+ */
12
+ inputValue?: string;
13
+ };
14
+ export type ComboboxSingleRootPropsWithoutHTML = ComboboxBaseRootPropsWithoutHTML & SelectSingleRootPropsWithoutHTML;
15
+ export type ComboboxSingleRootProps = ComboboxSingleRootPropsWithoutHTML;
16
+ export type ComboboxMultipleRootPropsWithoutHTML = ComboboxBaseRootPropsWithoutHTML & SelectMultipleRootPropsWithoutHTML;
17
+ export type ComboboxMultipleRootProps = ComboboxMultipleRootPropsWithoutHTML;
18
+ export type ComboboxRootPropsWithoutHTML = ComboboxBaseRootPropsWithoutHTML & (ComboboxSingleRootPropsWithoutHTML | ComboboxMultipleRootPropsWithoutHTML);
19
+ export type ComboboxRootProps = ComboboxRootPropsWithoutHTML;
20
+ export type { SelectContentProps as ComboboxContentProps, SelectContentPropsWithoutHTML as ComboboxContentPropsWithoutHTML, SelectContentStaticProps as ComboboxContentStaticProps, SelectContentStaticPropsWithoutHTML as ComboboxContentStaticPropsWithoutHTML, SelectItemProps as ComboboxItemProps, SelectItemPropsWithoutHTML as ComboboxItemPropsWithoutHTML, SelectItemSnippetProps as ComboboxItemSnippetProps, SelectTriggerProps as ComboboxTriggerProps, SelectTriggerPropsWithoutHTML as ComboboxTriggerPropsWithoutHTML, SelectGroupPropsWithoutHTML as ComboboxGroupPropsWithoutHTML, SelectGroupProps as ComboboxGroupProps, SelectGroupHeadingPropsWithoutHTML as ComboboxGroupHeadingPropsWithoutHTML, SelectGroupHeadingProps as ComboboxGroupHeadingProps, SelectViewportPropsWithoutHTML as ComboboxViewportPropsWithoutHTML, SelectViewportProps as ComboboxViewportProps, SelectScrollDownButtonProps as ComboboxScrollDownButtonProps, SelectScrollDownButtonPropsWithoutHTML as ComboboxScrollDownButtonPropsWithoutHTML, SelectScrollUpButtonProps as ComboboxScrollUpButtonProps, SelectScrollUpButtonPropsWithoutHTML as ComboboxScrollUpButtonPropsWithoutHTML, SelectArrowProps as ComboboxArrowProps, SelectArrowPropsWithoutHTML as ComboboxArrowPropsWithoutHTML, SelectPortalProps as ComboboxPortalProps, SelectPortalPropsWithoutHTML as ComboboxPortalPropsWithoutHTML, } from "../select/types.js";
4
21
  export type ComboboxInputPropsWithoutHTML = WithChild<{
5
22
  /**
6
23
  * The default value of the input. This is not a reactive prop and is only used to populate
@@ -1,4 +1,4 @@
1
- import { afterSleep, afterTick, srOnlyStyles, useRefById } from "svelte-toolbelt";
1
+ import { afterSleep, afterTick, srOnlyStyles, attachRef } from "svelte-toolbelt";
2
2
  import { Context, watch } from "runed";
3
3
  import { findNextSibling, findPreviousSibling } from "./utils.js";
4
4
  import { kbd } from "../../internal/kbd.js";
@@ -100,7 +100,6 @@ class CommandRootState {
100
100
  const defaults = { ...this._commandState, value: this.opts.value.current ?? "" };
101
101
  this._commandState = defaults;
102
102
  this.commandState = defaults;
103
- useRefById(opts);
104
103
  this.onkeydown = this.onkeydown.bind(this);
105
104
  }
106
105
  /**
@@ -572,6 +571,7 @@ class CommandRootState {
572
571
  [COMMAND_ROOT_ATTR]: "",
573
572
  tabindex: -1,
574
573
  onkeydown: this.onkeydown,
574
+ ...attachRef(this.opts.ref),
575
575
  }));
576
576
  }
577
577
  class CommandEmptyState {
@@ -588,15 +588,12 @@ class CommandEmptyState {
588
588
  $effect.pre(() => {
589
589
  this.#isInitialRender = false;
590
590
  });
591
- useRefById({
592
- ...opts,
593
- deps: () => this.shouldRender,
594
- });
595
591
  }
596
592
  props = $derived.by(() => ({
597
593
  id: this.opts.id.current,
598
594
  role: "presentation",
599
595
  [COMMAND_EMPTY_ATTR]: "",
596
+ ...attachRef(this.opts.ref),
600
597
  }));
601
598
  }
602
599
  class CommandGroupContainerState {
@@ -617,10 +614,6 @@ class CommandGroupContainerState {
617
614
  this.opts = opts;
618
615
  this.root = root;
619
616
  this.trueValue = opts.value.current ?? opts.id.current;
620
- useRefById({
621
- ...opts,
622
- deps: () => this.shouldRender,
623
- });
624
617
  watch(() => this.trueValue, () => {
625
618
  return this.root.registerGroup(this.trueValue);
626
619
  });
@@ -645,6 +638,7 @@ class CommandGroupContainerState {
645
638
  hidden: this.shouldRender ? undefined : true,
646
639
  "data-value": this.trueValue,
647
640
  [COMMAND_GROUP_ATTR]: "",
641
+ ...attachRef(this.opts.ref),
648
642
  }));
649
643
  }
650
644
  class CommandGroupHeadingState {
@@ -653,16 +647,11 @@ class CommandGroupHeadingState {
653
647
  constructor(opts, group) {
654
648
  this.opts = opts;
655
649
  this.group = group;
656
- useRefById({
657
- ...opts,
658
- onRefChange: (node) => {
659
- this.group.headingNode = node;
660
- },
661
- });
662
650
  }
663
651
  props = $derived.by(() => ({
664
652
  id: this.opts.id.current,
665
653
  [COMMAND_GROUP_HEADING_ATTR]: "",
654
+ ...attachRef(this.opts.ref, (v) => (this.group.headingNode = v)),
666
655
  }));
667
656
  }
668
657
  class CommandGroupItemsState {
@@ -671,13 +660,13 @@ class CommandGroupItemsState {
671
660
  constructor(opts, group) {
672
661
  this.opts = opts;
673
662
  this.group = group;
674
- useRefById(opts);
675
663
  }
676
664
  props = $derived.by(() => ({
677
665
  id: this.opts.id.current,
678
666
  role: "group",
679
667
  [COMMAND_GROUP_ITEMS_ATTR]: "",
680
668
  "aria-labelledby": this.group.headingNode?.id ?? undefined,
669
+ ...attachRef(this.opts.ref),
681
670
  }));
682
671
  }
683
672
  class CommandInputState {
@@ -692,12 +681,6 @@ class CommandInputState {
692
681
  constructor(opts, root) {
693
682
  this.opts = opts;
694
683
  this.root = root;
695
- useRefById({
696
- ...opts,
697
- onRefChange: (node) => {
698
- this.root.inputNode = node;
699
- },
700
- });
701
684
  watch(() => this.opts.ref.current, () => {
702
685
  const node = this.opts.ref.current;
703
686
  if (node && this.opts.autofocus.current) {
@@ -723,6 +706,7 @@ class CommandInputState {
723
706
  "aria-controls": this.root.viewportNode?.id ?? undefined,
724
707
  "aria-labelledby": this.root.labelNode?.id ?? undefined,
725
708
  "aria-activedescendant": this.#selectedItemId,
709
+ ...attachRef(this.opts.ref, (v) => (this.root.inputNode = v)),
726
710
  }));
727
711
  }
728
712
  class CommandItemState {
@@ -751,10 +735,6 @@ class CommandItemState {
751
735
  this.root = root;
752
736
  this.#group = CommandGroupContainerContext.getOr(null);
753
737
  this.trueValue = opts.value.current;
754
- useRefById({
755
- ...opts,
756
- deps: () => Boolean(this.root.commandState.search),
757
- });
758
738
  watch([
759
739
  () => this.trueValue,
760
740
  () => this.#group?.trueValue,
@@ -807,13 +787,13 @@ class CommandItemState {
807
787
  role: "option",
808
788
  onpointermove: this.onpointermove,
809
789
  onclick: this.onclick,
790
+ ...attachRef(this.opts.ref),
810
791
  }));
811
792
  }
812
793
  class CommandLoadingState {
813
794
  opts;
814
795
  constructor(opts) {
815
796
  this.opts = opts;
816
- useRefById(opts);
817
797
  }
818
798
  props = $derived.by(() => ({
819
799
  id: this.opts.id.current,
@@ -823,6 +803,7 @@ class CommandLoadingState {
823
803
  "aria-valuemax": 100,
824
804
  "aria-label": "Loading...",
825
805
  [COMMAND_LOADING_ATTR]: "",
806
+ ...attachRef(this.opts.ref),
826
807
  }));
827
808
  }
828
809
  class CommandSeparatorState {
@@ -832,16 +813,13 @@ class CommandSeparatorState {
832
813
  constructor(opts, root) {
833
814
  this.opts = opts;
834
815
  this.root = root;
835
- useRefById({
836
- ...opts,
837
- deps: () => this.shouldRender,
838
- });
839
816
  }
840
817
  props = $derived.by(() => ({
841
818
  id: this.opts.id.current,
842
819
  // role="separator" cannot belong to a role="listbox"
843
820
  "aria-hidden": "true",
844
821
  [COMMAND_SEPARATOR_ATTR]: "",
822
+ ...attachRef(this.opts.ref),
845
823
  }));
846
824
  }
847
825
  class CommandListState {
@@ -850,13 +828,13 @@ class CommandListState {
850
828
  constructor(opts, root) {
851
829
  this.opts = opts;
852
830
  this.root = root;
853
- useRefById(opts);
854
831
  }
855
832
  props = $derived.by(() => ({
856
833
  id: this.opts.id.current,
857
834
  role: "listbox",
858
835
  "aria-label": this.opts.ariaLabel.current,
859
836
  [COMMAND_LIST_ATTR]: "",
837
+ ...attachRef(this.opts.ref),
860
838
  }));
861
839
  }
862
840
  class CommandLabelState {
@@ -865,18 +843,13 @@ class CommandLabelState {
865
843
  constructor(opts, root) {
866
844
  this.opts = opts;
867
845
  this.root = root;
868
- useRefById({
869
- ...opts,
870
- onRefChange: (node) => {
871
- this.root.labelNode = node;
872
- },
873
- });
874
846
  }
875
847
  props = $derived.by(() => ({
876
848
  id: this.opts.id.current,
877
849
  [COMMAND_INPUT_LABEL_ATTR]: "",
878
850
  for: this.opts.for?.current,
879
851
  style: srOnlyStyles,
852
+ ...attachRef(this.opts.ref, (v) => (this.root.labelNode = v)),
880
853
  }));
881
854
  }
882
855
  class CommandViewportState {
@@ -885,12 +858,6 @@ class CommandViewportState {
885
858
  constructor(opts, list) {
886
859
  this.opts = opts;
887
860
  this.list = list;
888
- useRefById({
889
- ...opts,
890
- onRefChange: (node) => {
891
- this.list.root.viewportNode = node;
892
- },
893
- });
894
861
  $effect(() => {
895
862
  const node = this.opts.ref.current;
896
863
  const listNode = this.list.opts.ref.current;
@@ -913,6 +880,7 @@ class CommandViewportState {
913
880
  props = $derived.by(() => ({
914
881
  id: this.opts.id.current,
915
882
  [COMMAND_VIEWPORT_ATTR]: "",
883
+ ...attachRef(this.opts.ref, (v) => (this.list.root.viewportNode = v)),
916
884
  }));
917
885
  }
918
886
  export function useCommandRoot(props) {
@@ -1,16 +1,15 @@
1
1
  <script lang="ts">
2
2
  import { box } from "svelte-toolbelt";
3
3
  import { useCommandLabel } from "../command.svelte.js";
4
- import {
5
- type BitsPrimitiveLabelAttributes,
6
- type WithElementRef,
7
- mergeProps,
8
- useId,
9
- } from "../../../shared/index.js";
4
+
10
5
  import type { WithChildren } from "../../../internal/types.js";
6
+ import { createId } from "../../../internal/create-id.js";
7
+ import { mergeProps } from "svelte-toolbelt";
8
+ import type { BitsPrimitiveLabelAttributes, WithElementRef } from "../../../shared/index.js";
11
9
 
10
+ const uid = $props.id();
12
11
  let {
13
- id = useId(),
12
+ id = createId(uid),
14
13
  ref = $bindable(null),
15
14
  children,
16
15
  ...restProps
@@ -1,5 +1,5 @@
1
- import { type BitsPrimitiveLabelAttributes, type WithElementRef } from "../../../shared/index.js";
2
1
  import type { WithChildren } from "../../../internal/types.js";
2
+ import type { BitsPrimitiveLabelAttributes, WithElementRef } from "../../../shared/index.js";
3
3
  declare const CommandLabel: import("svelte").Component<WithChildren<WithElementRef<BitsPrimitiveLabelAttributes>>, {}, "ref">;
4
4
  type CommandLabel = ReturnType<typeof CommandLabel>;
5
5
  export default CommandLabel;
@@ -2,10 +2,12 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import type { CommandEmptyProps } from "../types.js";
4
4
  import { useCommandEmpty } from "../command.svelte.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
+
7
+ const uid = $props.id();
6
8
 
7
9
  let {
8
- id = useId(),
10
+ id = createId(uid),
9
11
  ref = $bindable(null),
10
12
  children,
11
13
  child,
@@ -2,10 +2,12 @@
2
2
  import { box, mergeProps } from "svelte-toolbelt";
3
3
  import { useCommandGroupHeading } from "../command.svelte.js";
4
4
  import type { CommandGroupHeadingProps } from "../types.js";
5
- import { useId } from "../../../internal/use-id.js";
5
+ import { createId } from "../../../internal/create-id.js";
6
+
7
+ const uid = $props.id();
6
8
 
7
9
  let {
8
- id = useId(),
10
+ id = createId(uid),
9
11
  ref = $bindable(null),
10
12
  children,
11
13
  child,