bits-ui 2.10.0 → 2.11.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 (277) hide show
  1. package/dist/bits/accordion/accordion.svelte.d.ts +9 -7
  2. package/dist/bits/accordion/accordion.svelte.js +36 -13
  3. package/dist/bits/accordion/components/accordion-content.svelte +15 -7
  4. package/dist/bits/accordion/components/accordion-header.svelte +4 -4
  5. package/dist/bits/accordion/components/accordion-item.svelte +5 -5
  6. package/dist/bits/accordion/components/accordion-trigger.svelte +4 -4
  7. package/dist/bits/accordion/components/accordion.svelte +7 -7
  8. package/dist/bits/accordion/components/accordion.svelte.d.ts +1 -1
  9. package/dist/bits/accordion/types.d.ts +17 -8
  10. package/dist/bits/alert-dialog/components/alert-dialog-action.svelte +3 -3
  11. package/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte +4 -4
  12. package/dist/bits/alert-dialog/components/alert-dialog-content.svelte +3 -3
  13. package/dist/bits/alert-dialog/components/alert-dialog.svelte +4 -4
  14. package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +4 -4
  15. package/dist/bits/avatar/components/avatar-fallback.svelte +3 -3
  16. package/dist/bits/avatar/components/avatar-image.svelte +6 -6
  17. package/dist/bits/avatar/components/avatar.svelte +5 -5
  18. package/dist/bits/calendar/calendar.svelte.js +30 -30
  19. package/dist/bits/calendar/components/calendar-cell.svelte +5 -5
  20. package/dist/bits/calendar/components/calendar-day.svelte +3 -3
  21. package/dist/bits/calendar/components/calendar-grid-body.svelte +3 -3
  22. package/dist/bits/calendar/components/calendar-grid-head.svelte +3 -3
  23. package/dist/bits/calendar/components/calendar-grid-row.svelte +3 -3
  24. package/dist/bits/calendar/components/calendar-grid.svelte +3 -3
  25. package/dist/bits/calendar/components/calendar-head-cell.svelte +3 -3
  26. package/dist/bits/calendar/components/calendar-header.svelte +3 -3
  27. package/dist/bits/calendar/components/calendar-heading.svelte +3 -3
  28. package/dist/bits/calendar/components/calendar-month-select.svelte +6 -6
  29. package/dist/bits/calendar/components/calendar-next-button.svelte +3 -3
  30. package/dist/bits/calendar/components/calendar-prev-button.svelte +3 -3
  31. package/dist/bits/calendar/components/calendar-year-select.svelte +6 -6
  32. package/dist/bits/calendar/components/calendar.svelte +24 -24
  33. package/dist/bits/calendar/components/calendar.svelte.d.ts +1 -1
  34. package/dist/bits/checkbox/checkbox.svelte.d.ts +1 -1
  35. package/dist/bits/checkbox/checkbox.svelte.js +7 -7
  36. package/dist/bits/checkbox/components/checkbox-group-label.svelte +3 -3
  37. package/dist/bits/checkbox/components/checkbox-group.svelte +9 -9
  38. package/dist/bits/checkbox/components/checkbox-group.svelte.d.ts +1 -1
  39. package/dist/bits/checkbox/components/checkbox.svelte +11 -11
  40. package/dist/bits/checkbox/components/checkbox.svelte.d.ts +1 -1
  41. package/dist/bits/collapsible/collapsible.svelte.d.ts +2 -0
  42. package/dist/bits/collapsible/collapsible.svelte.js +31 -8
  43. package/dist/bits/collapsible/components/collapsible-content.svelte +15 -7
  44. package/dist/bits/collapsible/components/collapsible-trigger.svelte +4 -4
  45. package/dist/bits/collapsible/components/collapsible.svelte +6 -6
  46. package/dist/bits/collapsible/types.d.ts +12 -3
  47. package/dist/bits/combobox/components/combobox-input.svelte +4 -4
  48. package/dist/bits/combobox/components/combobox-trigger.svelte +3 -3
  49. package/dist/bits/combobox/components/combobox.svelte +12 -12
  50. package/dist/bits/command/command.svelte.js +6 -6
  51. package/dist/bits/command/components/_command-label.svelte +3 -3
  52. package/dist/bits/command/components/command-empty.svelte +4 -4
  53. package/dist/bits/command/components/command-group-heading.svelte +3 -3
  54. package/dist/bits/command/components/command-group-items.svelte +3 -3
  55. package/dist/bits/command/components/command-group.svelte +5 -5
  56. package/dist/bits/command/components/command-input.svelte +5 -5
  57. package/dist/bits/command/components/command-input.svelte.d.ts +1 -1
  58. package/dist/bits/command/components/command-item.svelte +8 -8
  59. package/dist/bits/command/components/command-link-item.svelte +8 -8
  60. package/dist/bits/command/components/command-list.svelte +4 -4
  61. package/dist/bits/command/components/command-loading.svelte +4 -4
  62. package/dist/bits/command/components/command-separator.svelte +4 -4
  63. package/dist/bits/command/components/command-viewport.svelte +3 -3
  64. package/dist/bits/command/components/command.svelte +12 -12
  65. package/dist/bits/command/components/command.svelte.d.ts +1 -1
  66. package/dist/bits/context-menu/components/context-menu-content-static.svelte +5 -5
  67. package/dist/bits/context-menu/components/context-menu-content.svelte +5 -5
  68. package/dist/bits/context-menu/components/context-menu-trigger.svelte +4 -4
  69. package/dist/bits/context-menu/components/context-menu.svelte +5 -5
  70. package/dist/bits/date-field/components/date-field-input.svelte +4 -4
  71. package/dist/bits/date-field/components/date-field-label.svelte +3 -3
  72. package/dist/bits/date-field/components/date-field-segment.svelte +3 -3
  73. package/dist/bits/date-field/components/date-field.svelte +16 -16
  74. package/dist/bits/date-field/date-field.svelte.js +17 -17
  75. package/dist/bits/date-picker/components/date-picker-calendar.svelte +5 -5
  76. package/dist/bits/date-picker/components/date-picker.svelte +32 -32
  77. package/dist/bits/date-range-field/components/date-range-field-input.svelte +4 -4
  78. package/dist/bits/date-range-field/components/date-range-field-label.svelte +3 -3
  79. package/dist/bits/date-range-field/components/date-range-field.svelte +19 -19
  80. package/dist/bits/date-range-field/components/date-range-field.svelte.d.ts +1 -1
  81. package/dist/bits/date-range-field/date-range-field.svelte.js +9 -9
  82. package/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte +3 -3
  83. package/dist/bits/date-range-picker/components/date-range-picker.svelte +37 -37
  84. package/dist/bits/date-range-picker/components/date-range-picker.svelte.d.ts +1 -1
  85. package/dist/bits/dialog/components/dialog-close.svelte +5 -5
  86. package/dist/bits/dialog/components/dialog-content.svelte +3 -3
  87. package/dist/bits/dialog/components/dialog-description.svelte +3 -3
  88. package/dist/bits/dialog/components/dialog-overlay.svelte +3 -3
  89. package/dist/bits/dialog/components/dialog-title.svelte +4 -4
  90. package/dist/bits/dialog/components/dialog-trigger.svelte +4 -4
  91. package/dist/bits/dialog/components/dialog.svelte +4 -4
  92. package/dist/bits/dialog/dialog.svelte.d.ts +1 -1
  93. package/dist/bits/dialog/dialog.svelte.js +4 -4
  94. package/dist/bits/dropdown-menu/components/dropdown-menu-content-static.svelte +5 -5
  95. package/dist/bits/dropdown-menu/components/dropdown-menu-content.svelte +5 -5
  96. package/dist/bits/label/components/label.svelte +3 -3
  97. package/dist/bits/link-preview/components/link-preview-content-static.svelte +5 -5
  98. package/dist/bits/link-preview/components/link-preview-content.svelte +5 -5
  99. package/dist/bits/link-preview/components/link-preview-trigger.svelte +3 -3
  100. package/dist/bits/link-preview/components/link-preview.svelte +6 -6
  101. package/dist/bits/link-preview/link-preview.svelte.js +4 -4
  102. package/dist/bits/menu/components/menu-checkbox-group.svelte +5 -5
  103. package/dist/bits/menu/components/menu-checkbox-group.svelte.d.ts +1 -1
  104. package/dist/bits/menu/components/menu-checkbox-item.svelte +9 -9
  105. package/dist/bits/menu/components/menu-checkbox-item.svelte.d.ts +1 -1
  106. package/dist/bits/menu/components/menu-content-static.svelte +5 -5
  107. package/dist/bits/menu/components/menu-content.svelte +5 -5
  108. package/dist/bits/menu/components/menu-group-heading.svelte +3 -3
  109. package/dist/bits/menu/components/menu-group.svelte +3 -3
  110. package/dist/bits/menu/components/menu-item.svelte +6 -6
  111. package/dist/bits/menu/components/menu-radio-group.svelte +4 -4
  112. package/dist/bits/menu/components/menu-radio-group.svelte.d.ts +1 -1
  113. package/dist/bits/menu/components/menu-radio-item.svelte +7 -7
  114. package/dist/bits/menu/components/menu-separator.svelte +3 -3
  115. package/dist/bits/menu/components/menu-sub-content-static.svelte +5 -5
  116. package/dist/bits/menu/components/menu-sub-content.svelte +5 -5
  117. package/dist/bits/menu/components/menu-sub-trigger.svelte +5 -5
  118. package/dist/bits/menu/components/menu-sub.svelte +3 -3
  119. package/dist/bits/menu/components/menu-trigger.svelte +4 -4
  120. package/dist/bits/menu/components/menu.svelte +5 -5
  121. package/dist/bits/menu/menu.svelte.d.ts +1 -1
  122. package/dist/bits/menu/menu.svelte.js +14 -14
  123. package/dist/bits/menubar/components/menubar-content-static.svelte +8 -8
  124. package/dist/bits/menubar/components/menubar-content.svelte +8 -8
  125. package/dist/bits/menubar/components/menubar-menu.svelte +3 -3
  126. package/dist/bits/menubar/components/menubar-trigger.svelte +4 -4
  127. package/dist/bits/menubar/components/menubar.svelte +6 -6
  128. package/dist/bits/menubar/menubar.svelte.js +5 -5
  129. package/dist/bits/meter/components/meter.svelte +6 -6
  130. package/dist/bits/navigation-menu/components/navigation-menu-content-impl.svelte +3 -3
  131. package/dist/bits/navigation-menu/components/navigation-menu-content.svelte +3 -3
  132. package/dist/bits/navigation-menu/components/navigation-menu-indicator-impl.svelte +3 -3
  133. package/dist/bits/navigation-menu/components/navigation-menu-indicator.svelte +2 -2
  134. package/dist/bits/navigation-menu/components/navigation-menu-item.svelte +5 -5
  135. package/dist/bits/navigation-menu/components/navigation-menu-link.svelte +5 -5
  136. package/dist/bits/navigation-menu/components/navigation-menu-list.svelte +3 -3
  137. package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte +5 -5
  138. package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte.d.ts +1 -1
  139. package/dist/bits/navigation-menu/components/navigation-menu-trigger.svelte +4 -4
  140. package/dist/bits/navigation-menu/components/navigation-menu-viewport.svelte +3 -3
  141. package/dist/bits/navigation-menu/components/navigation-menu.svelte +8 -8
  142. package/dist/bits/navigation-menu/components/navigation-menu.svelte.d.ts +1 -1
  143. package/dist/bits/navigation-menu/navigation-menu.svelte.d.ts +6 -6
  144. package/dist/bits/navigation-menu/navigation-menu.svelte.js +23 -23
  145. package/dist/bits/pagination/components/pagination-next-button.svelte +4 -4
  146. package/dist/bits/pagination/components/pagination-page.svelte +5 -5
  147. package/dist/bits/pagination/components/pagination-prev-button.svelte +4 -4
  148. package/dist/bits/pagination/components/pagination.svelte +9 -9
  149. package/dist/bits/pagination/pagination.svelte.d.ts +1 -1
  150. package/dist/bits/pagination/pagination.svelte.js +2 -2
  151. package/dist/bits/pin-input/components/pin-input-cell.svelte +4 -4
  152. package/dist/bits/pin-input/components/pin-input.svelte +14 -14
  153. package/dist/bits/pin-input/components/pin-input.svelte.d.ts +1 -1
  154. package/dist/bits/pin-input/pin-input.svelte.d.ts +2 -2
  155. package/dist/bits/pin-input/pin-input.svelte.js +5 -5
  156. package/dist/bits/popover/components/popover-close.svelte +3 -3
  157. package/dist/bits/popover/components/popover-content-static.svelte +6 -6
  158. package/dist/bits/popover/components/popover-content.svelte +6 -6
  159. package/dist/bits/popover/components/popover-trigger.svelte +4 -4
  160. package/dist/bits/popover/components/popover.svelte +3 -3
  161. package/dist/bits/popover/popover.svelte.js +4 -4
  162. package/dist/bits/progress/components/progress.svelte +6 -6
  163. package/dist/bits/radio-group/components/radio-group-item.svelte +5 -5
  164. package/dist/bits/radio-group/components/radio-group.svelte +10 -10
  165. package/dist/bits/radio-group/components/radio-group.svelte.d.ts +1 -1
  166. package/dist/bits/radio-group/radio-group.svelte.js +7 -7
  167. package/dist/bits/range-calendar/components/range-calendar-cell.svelte +5 -5
  168. package/dist/bits/range-calendar/components/range-calendar-day.svelte +3 -3
  169. package/dist/bits/range-calendar/components/range-calendar.svelte +26 -26
  170. package/dist/bits/range-calendar/components/range-calendar.svelte.d.ts +1 -1
  171. package/dist/bits/range-calendar/range-calendar.svelte.js +7 -7
  172. package/dist/bits/rating-group/components/rating-group-item.svelte +5 -5
  173. package/dist/bits/rating-group/components/rating-group.svelte +14 -14
  174. package/dist/bits/rating-group/components/rating-group.svelte.d.ts +1 -1
  175. package/dist/bits/rating-group/rating-group.svelte.js +4 -4
  176. package/dist/bits/scroll-area/components/scroll-area-corner-impl.svelte +3 -3
  177. package/dist/bits/scroll-area/components/scroll-area-scrollbar-x.svelte +2 -2
  178. package/dist/bits/scroll-area/components/scroll-area-scrollbar-y.svelte +2 -2
  179. package/dist/bits/scroll-area/components/scroll-area-scrollbar.svelte +4 -4
  180. package/dist/bits/scroll-area/components/scroll-area-thumb-impl.svelte +4 -4
  181. package/dist/bits/scroll-area/components/scroll-area-viewport.svelte +3 -3
  182. package/dist/bits/scroll-area/components/scroll-area.svelte +6 -6
  183. package/dist/bits/scroll-area/scroll-area.svelte.d.ts +2 -2
  184. package/dist/bits/scroll-area/scroll-area.svelte.js +6 -7
  185. package/dist/bits/select/components/select-content-static.svelte +5 -5
  186. package/dist/bits/select/components/select-content.svelte +5 -5
  187. package/dist/bits/select/components/select-group-heading.svelte +3 -3
  188. package/dist/bits/select/components/select-group.svelte +3 -3
  189. package/dist/bits/select/components/select-hidden-input.svelte +2 -2
  190. package/dist/bits/select/components/select-item.svelte +8 -8
  191. package/dist/bits/select/components/select-scroll-down-button.svelte +4 -4
  192. package/dist/bits/select/components/select-scroll-up-button.svelte +4 -4
  193. package/dist/bits/select/components/select-trigger.svelte +3 -3
  194. package/dist/bits/select/components/select-viewport.svelte +3 -3
  195. package/dist/bits/select/components/select.svelte +12 -12
  196. package/dist/bits/select/select.svelte.js +12 -12
  197. package/dist/bits/separator/components/separator.svelte +5 -5
  198. package/dist/bits/separator/separator.svelte.d.ts +2 -2
  199. package/dist/bits/separator/separator.svelte.js +4 -4
  200. package/dist/bits/slider/components/slider-range.svelte +3 -3
  201. package/dist/bits/slider/components/slider-thumb-label.svelte +5 -5
  202. package/dist/bits/slider/components/slider-thumb.svelte +5 -5
  203. package/dist/bits/slider/components/slider-tick-label.svelte +5 -5
  204. package/dist/bits/slider/components/slider-tick.svelte +4 -4
  205. package/dist/bits/slider/components/slider.svelte +14 -14
  206. package/dist/bits/slider/components/slider.svelte.d.ts +1 -1
  207. package/dist/bits/slider/slider.svelte.d.ts +16 -16
  208. package/dist/bits/slider/slider.svelte.js +20 -20
  209. package/dist/bits/switch/components/switch-thumb.svelte +3 -3
  210. package/dist/bits/switch/components/switch.svelte +8 -8
  211. package/dist/bits/switch/components/switch.svelte.d.ts +1 -1
  212. package/dist/bits/switch/switch.svelte.js +5 -5
  213. package/dist/bits/tabs/components/tabs-content.svelte +4 -4
  214. package/dist/bits/tabs/components/tabs-list.svelte +3 -3
  215. package/dist/bits/tabs/components/tabs-trigger.svelte +5 -5
  216. package/dist/bits/tabs/components/tabs.svelte +8 -8
  217. package/dist/bits/tabs/components/tabs.svelte.d.ts +1 -1
  218. package/dist/bits/tabs/tabs.svelte.d.ts +5 -5
  219. package/dist/bits/tabs/tabs.svelte.js +11 -11
  220. package/dist/bits/time-field/components/time-field-input.svelte +4 -4
  221. package/dist/bits/time-field/components/time-field-label.svelte +3 -3
  222. package/dist/bits/time-field/components/time-field-segment.svelte +3 -3
  223. package/dist/bits/time-field/components/time-field.svelte +16 -16
  224. package/dist/bits/time-field/time-field.svelte.js +15 -15
  225. package/dist/bits/time-range-field/components/time-range-field-input.svelte +4 -4
  226. package/dist/bits/time-range-field/components/time-range-field-label.svelte +3 -3
  227. package/dist/bits/time-range-field/components/time-range-field.svelte +19 -19
  228. package/dist/bits/time-range-field/components/time-range-field.svelte.d.ts +1 -1
  229. package/dist/bits/time-range-field/time-range-field.svelte.js +7 -7
  230. package/dist/bits/toggle/components/toggle.svelte +5 -5
  231. package/dist/bits/toggle/toggle.svelte.d.ts +0 -1
  232. package/dist/bits/toggle/toggle.svelte.js +5 -10
  233. package/dist/bits/toggle-group/components/toggle-group-item.svelte +5 -5
  234. package/dist/bits/toggle-group/components/toggle-group.svelte +8 -8
  235. package/dist/bits/toggle-group/components/toggle-group.svelte.d.ts +1 -1
  236. package/dist/bits/toggle-group/toggle-group.svelte.d.ts +2 -2
  237. package/dist/bits/toggle-group/toggle-group.svelte.js +7 -7
  238. package/dist/bits/toolbar/components/toolbar-button.svelte +4 -4
  239. package/dist/bits/toolbar/components/toolbar-group-item.svelte +5 -5
  240. package/dist/bits/toolbar/components/toolbar-group.svelte +5 -5
  241. package/dist/bits/toolbar/components/toolbar-group.svelte.d.ts +1 -1
  242. package/dist/bits/toolbar/components/toolbar-link.svelte +3 -3
  243. package/dist/bits/toolbar/components/toolbar.svelte +5 -5
  244. package/dist/bits/toolbar/toolbar.svelte.d.ts +4 -4
  245. package/dist/bits/toolbar/toolbar.svelte.js +11 -11
  246. package/dist/bits/tooltip/components/tooltip-content-static.svelte +5 -5
  247. package/dist/bits/tooltip/components/tooltip-content.svelte +7 -5
  248. package/dist/bits/tooltip/components/tooltip-provider.svelte +7 -7
  249. package/dist/bits/tooltip/components/tooltip-trigger.svelte +4 -4
  250. package/dist/bits/tooltip/components/tooltip.svelte +8 -8
  251. package/dist/bits/tooltip/tooltip.svelte.js +7 -7
  252. package/dist/bits/tooltip/types.d.ts +1 -1
  253. package/dist/bits/utilities/config/bits-config.js +2 -2
  254. package/dist/bits/utilities/config/components/bits-config.svelte +3 -3
  255. package/dist/bits/utilities/config/prop-resolvers.js +2 -2
  256. package/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte +7 -7
  257. package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js +4 -3
  258. package/dist/bits/utilities/escape-layer/escape-layer.svelte +4 -4
  259. package/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte +3 -3
  260. package/dist/bits/utilities/floating-layer/components/floating-layer-arrow.svelte +3 -3
  261. package/dist/bits/utilities/floating-layer/components/floating-layer-content.svelte +20 -20
  262. package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.d.ts +3 -3
  263. package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js +9 -9
  264. package/dist/bits/utilities/focus-scope/focus-scope-manager.js +2 -2
  265. package/dist/bits/utilities/focus-scope/focus-scope.svelte +5 -5
  266. package/dist/bits/utilities/presence-layer/presence-layer.svelte +2 -2
  267. package/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte +5 -5
  268. package/dist/internal/attrs.d.ts +4 -19
  269. package/dist/internal/attrs.js +11 -56
  270. package/dist/internal/body-scroll-lock.svelte.js +5 -5
  271. package/dist/internal/box-auto-reset.svelte.js +2 -2
  272. package/dist/internal/date-time/calendar-helpers.svelte.js +4 -4
  273. package/dist/internal/events.d.ts +0 -6
  274. package/dist/internal/events.js +0 -17
  275. package/dist/internal/floating-svelte/use-floating.svelte.js +2 -2
  276. package/dist/internal/state-machine.js +2 -2
  277. package/package.json +2 -2
@@ -29,6 +29,7 @@ interface AccordionTriggerStateOpts extends WithRefOpts, ReadableBoxedValues<{
29
29
  }
30
30
  interface AccordionContentStateOpts extends WithRefOpts, ReadableBoxedValues<{
31
31
  forceMount: boolean;
32
+ hiddenUntilFound: boolean;
32
33
  }> {
33
34
  }
34
35
  interface AccordionHeaderStateOpts extends WithRefOpts, ReadableBoxedValues<{
@@ -53,7 +54,7 @@ declare abstract class AccordionBaseState {
53
54
  abstract toggleItem(item: string): void;
54
55
  readonly props: {
55
56
  readonly id: string;
56
- readonly "data-orientation": "horizontal" | "vertical";
57
+ readonly "data-orientation": Orientation;
57
58
  readonly "data-disabled": "" | undefined;
58
59
  };
59
60
  }
@@ -87,7 +88,7 @@ export declare class AccordionItemState {
87
88
  readonly id: string;
88
89
  readonly "data-state": "open" | "closed";
89
90
  readonly "data-disabled": "" | undefined;
90
- readonly "data-orientation": "horizontal" | "vertical";
91
+ readonly "data-orientation": Orientation;
91
92
  };
92
93
  }
93
94
  export declare class AccordionTriggerState {
@@ -106,7 +107,7 @@ export declare class AccordionTriggerState {
106
107
  readonly "aria-disabled": "true" | "false";
107
108
  readonly "data-disabled": "" | undefined;
108
109
  readonly "data-state": "open" | "closed";
109
- readonly "data-orientation": "horizontal" | "vertical";
110
+ readonly "data-orientation": Orientation;
110
111
  readonly tabindex: 0;
111
112
  readonly onclick: (e: BitsMouseEvent) => void;
112
113
  readonly onkeydown: (e: BitsKeyboardEvent) => void;
@@ -127,11 +128,12 @@ export declare class AccordionContentState {
127
128
  readonly id: string;
128
129
  readonly "data-state": "open" | "closed";
129
130
  readonly "data-disabled": "" | undefined;
130
- readonly "data-orientation": "horizontal" | "vertical";
131
+ readonly "data-orientation": Orientation;
131
132
  readonly style: {
132
133
  readonly "--bits-accordion-content-height": `${number}px`;
133
134
  readonly "--bits-accordion-content-width": `${number}px`;
134
135
  };
136
+ readonly hidden: "until-found" | undefined;
135
137
  };
136
138
  }
137
139
  export declare class AccordionHeaderState {
@@ -143,10 +145,10 @@ export declare class AccordionHeaderState {
143
145
  readonly props: {
144
146
  readonly id: string;
145
147
  readonly role: "heading";
146
- readonly "aria-level": 1 | 2 | 3 | 4 | 6 | 5;
147
- readonly "data-heading-level": 1 | 2 | 3 | 4 | 6 | 5;
148
+ readonly "aria-level": 1 | 2 | 3 | 4 | 5 | 6;
149
+ readonly "data-heading-level": 1 | 2 | 3 | 4 | 5 | 6;
148
150
  readonly "data-state": "open" | "closed";
149
- readonly "data-orientation": "horizontal" | "vertical";
151
+ readonly "data-orientation": Orientation;
150
152
  };
151
153
  }
152
154
  export {};
@@ -1,9 +1,10 @@
1
1
  import { afterTick, attachRef, } from "svelte-toolbelt";
2
2
  import { Context, watch } from "runed";
3
- import { getAriaDisabled, getAriaExpanded, getDataDisabled, getDataOpenClosed, getDataOrientation, } from "../../internal/attrs.js";
3
+ import { boolToStr, boolToEmptyStrOrUndef, getDataOpenClosed } from "../../internal/attrs.js";
4
4
  import { kbd } from "../../internal/kbd.js";
5
5
  import { createBitsAttrs } from "../../internal/attrs.js";
6
6
  import { RovingFocusGroup } from "../../internal/roving-focus-group.js";
7
+ import { on } from "svelte/events";
7
8
  const accordionAttrs = createBitsAttrs({
8
9
  component: "accordion",
9
10
  parts: ["root", "trigger", "content", "item", "header"],
@@ -26,8 +27,8 @@ class AccordionBaseState {
26
27
  }
27
28
  props = $derived.by(() => ({
28
29
  id: this.opts.id.current,
29
- "data-orientation": getDataOrientation(this.opts.orientation.current),
30
- "data-disabled": getDataDisabled(this.opts.disabled.current),
30
+ "data-orientation": this.opts.orientation.current,
31
+ "data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
31
32
  [accordionAttrs.root]: "",
32
33
  ...this.attachment,
33
34
  }));
@@ -96,8 +97,8 @@ export class AccordionItemState {
96
97
  props = $derived.by(() => ({
97
98
  id: this.opts.id.current,
98
99
  "data-state": getDataOpenClosed(this.isActive),
99
- "data-disabled": getDataDisabled(this.isDisabled),
100
- "data-orientation": getDataOrientation(this.root.opts.orientation.current),
100
+ "data-disabled": boolToEmptyStrOrUndef(this.isDisabled),
101
+ "data-orientation": this.root.opts.orientation.current,
101
102
  [accordionAttrs.item]: "",
102
103
  ...this.attachment,
103
104
  }));
@@ -141,11 +142,11 @@ export class AccordionTriggerState {
141
142
  props = $derived.by(() => ({
142
143
  id: this.opts.id.current,
143
144
  disabled: this.#isDisabled,
144
- "aria-expanded": getAriaExpanded(this.itemState.isActive),
145
- "aria-disabled": getAriaDisabled(this.#isDisabled),
146
- "data-disabled": getDataDisabled(this.#isDisabled),
145
+ "aria-expanded": boolToStr(this.itemState.isActive),
146
+ "aria-disabled": boolToStr(this.#isDisabled),
147
+ "data-disabled": boolToEmptyStrOrUndef(this.#isDisabled),
147
148
  "data-state": getDataOpenClosed(this.itemState.isActive),
148
- "data-orientation": getDataOrientation(this.#root.opts.orientation.current),
149
+ "data-orientation": this.#root.opts.orientation.current,
149
150
  [accordionAttrs.trigger]: "",
150
151
  tabindex: 0,
151
152
  onclick: this.onclick,
@@ -160,7 +161,11 @@ export class AccordionContentState {
160
161
  #originalStyles = undefined;
161
162
  #isMountAnimationPrevented = false;
162
163
  #dimensions = $state({ width: 0, height: 0 });
163
- open = $derived.by(() => this.opts.forceMount.current || this.item.isActive);
164
+ open = $derived.by(() => {
165
+ if (this.opts.hiddenUntilFound.current)
166
+ return this.item.isActive;
167
+ return this.opts.forceMount.current || this.item.isActive;
168
+ });
164
169
  constructor(opts, item) {
165
170
  this.opts = opts;
166
171
  this.item = item;
@@ -173,6 +178,21 @@ export class AccordionContentState {
173
178
  });
174
179
  return () => cancelAnimationFrame(rAF);
175
180
  });
181
+ watch.pre([() => this.opts.ref.current, () => this.opts.hiddenUntilFound.current], ([node, hiddenUntilFound]) => {
182
+ if (!node || !hiddenUntilFound)
183
+ return;
184
+ const handleBeforeMatch = () => {
185
+ if (this.item.isActive)
186
+ return;
187
+ // we need to defer opening until after browser completes search highlighting
188
+ // otherwise the browser will immediately open the accordion
189
+ // and the search highlighting will not be visible
190
+ requestAnimationFrame(() => {
191
+ this.item.updateValue();
192
+ });
193
+ };
194
+ return on(node, "beforematch", handleBeforeMatch);
195
+ });
176
196
  // Handle dimension updates
177
197
  watch([() => this.open, () => this.opts.ref.current], this.#updateDimensions);
178
198
  }
@@ -207,13 +227,16 @@ export class AccordionContentState {
207
227
  props = $derived.by(() => ({
208
228
  id: this.opts.id.current,
209
229
  "data-state": getDataOpenClosed(this.item.isActive),
210
- "data-disabled": getDataDisabled(this.item.isDisabled),
211
- "data-orientation": getDataOrientation(this.item.root.opts.orientation.current),
230
+ "data-disabled": boolToEmptyStrOrUndef(this.item.isDisabled),
231
+ "data-orientation": this.item.root.opts.orientation.current,
212
232
  [accordionAttrs.content]: "",
213
233
  style: {
214
234
  "--bits-accordion-content-height": `${this.#dimensions.height}px`,
215
235
  "--bits-accordion-content-width": `${this.#dimensions.width}px`,
216
236
  },
237
+ hidden: this.opts.hiddenUntilFound.current && !this.item.isActive
238
+ ? "until-found"
239
+ : undefined,
217
240
  ...this.attachment,
218
241
  }));
219
242
  }
@@ -235,7 +258,7 @@ export class AccordionHeaderState {
235
258
  "aria-level": this.opts.level.current,
236
259
  "data-heading-level": this.opts.level.current,
237
260
  "data-state": getDataOpenClosed(this.item.isActive),
238
- "data-orientation": getDataOrientation(this.item.root.opts.orientation.current),
261
+ "data-orientation": this.item.root.opts.orientation.current,
239
262
  [accordionAttrs.header]: "",
240
263
  ...this.attachment,
241
264
  }));
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { mergeProps, boxWith } from "svelte-toolbelt";
3
3
  import { AccordionContentState } from "../accordion.svelte.js";
4
4
  import type { AccordionContentProps } from "../types.js";
5
5
  import { PresenceLayer } from "../../utilities/presence-layer/index.js";
@@ -13,24 +13,32 @@
13
13
  id = createId(uid),
14
14
  forceMount = false,
15
15
  children,
16
+ hiddenUntilFound = false,
16
17
  ...restProps
17
18
  }: AccordionContentProps = $props();
18
19
 
19
20
  const contentState = AccordionContentState.create({
20
- forceMount: box.with(() => forceMount),
21
- id: box.with(() => id),
22
- ref: box.with(
21
+ forceMount: boxWith(() => forceMount),
22
+ id: boxWith(() => id),
23
+ ref: boxWith(
23
24
  () => ref,
24
25
  (v) => (ref = v)
25
26
  ),
27
+ hiddenUntilFound: boxWith(() => hiddenUntilFound),
26
28
  });
27
29
  </script>
28
30
 
29
31
  <PresenceLayer forceMount={true} open={contentState.open} ref={contentState.opts.ref}>
30
32
  {#snippet presence({ present })}
31
- {@const mergedProps = mergeProps(restProps, contentState.props, {
32
- hidden: forceMount ? undefined : !present,
33
- })}
33
+ {@const mergedProps = mergeProps(
34
+ restProps,
35
+ contentState.props,
36
+ hiddenUntilFound && !present
37
+ ? {}
38
+ : {
39
+ hidden: hiddenUntilFound ? !present : forceMount ? undefined : !present,
40
+ }
41
+ )}
34
42
  {#if child}
35
43
  {@render child({
36
44
  props: mergedProps,
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AccordionHeaderProps } from "../types.js";
4
4
  import { AccordionHeaderState } from "../accordion.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -16,9 +16,9 @@
16
16
  }: AccordionHeaderProps = $props();
17
17
 
18
18
  const headerState = AccordionHeaderState.create({
19
- id: box.with(() => id),
20
- level: box.with(() => level),
21
- ref: box.with(
19
+ id: boxWith(() => id),
20
+ level: boxWith(() => level),
21
+ ref: boxWith(
22
22
  () => ref,
23
23
  (v) => (ref = v)
24
24
  ),
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AccordionItemProps } from "../types.js";
4
4
  import { AccordionItemState } from "../accordion.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -18,10 +18,10 @@
18
18
  }: AccordionItemProps = $props();
19
19
 
20
20
  const itemState = AccordionItemState.create({
21
- value: box.with(() => value),
22
- disabled: box.with(() => disabled),
23
- id: box.with(() => id),
24
- ref: box.with(
21
+ value: boxWith(() => value),
22
+ disabled: boxWith(() => disabled),
23
+ id: boxWith(() => id),
24
+ ref: boxWith(
25
25
  () => ref,
26
26
  (v) => (ref = v)
27
27
  ),
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AccordionTriggerProps } from "../types.js";
4
4
  import { AccordionTriggerState } from "../accordion.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -16,9 +16,9 @@
16
16
  }: AccordionTriggerProps = $props();
17
17
 
18
18
  const triggerState = AccordionTriggerState.create({
19
- disabled: box.with(() => disabled),
20
- id: box.with(() => id),
21
- ref: box.with(
19
+ disabled: boxWith(() => disabled),
20
+ id: boxWith(() => id),
21
+ ref: boxWith(
22
22
  () => ref,
23
23
  (v) => (ref = v)
24
24
  ),
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { type WritableBox, box, mergeProps } from "svelte-toolbelt";
2
+ import { type WritableBox, boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import { AccordionRootState } from "../accordion.svelte.js";
4
4
  import type { AccordionRootProps } from "../types.js";
5
5
  import { noop } from "../../../internal/noop.js";
@@ -39,7 +39,7 @@
39
39
 
40
40
  const rootState = AccordionRootState.create({
41
41
  type,
42
- value: box.with(
42
+ value: boxWith(
43
43
  () => value!,
44
44
  (v) => {
45
45
  value = v;
@@ -47,11 +47,11 @@
47
47
  onValueChange(v as any);
48
48
  }
49
49
  ) as WritableBox<string> | WritableBox<string[]>,
50
- id: box.with(() => id),
51
- disabled: box.with(() => disabled),
52
- loop: box.with(() => loop),
53
- orientation: box.with(() => orientation),
54
- ref: box.with(
50
+ id: boxWith(() => id),
51
+ disabled: boxWith(() => disabled),
52
+ loop: boxWith(() => loop),
53
+ orientation: boxWith(() => orientation),
54
+ ref: boxWith(
55
55
  () => ref,
56
56
  (v) => (ref = v)
57
57
  ),
@@ -1,4 +1,4 @@
1
1
  import type { AccordionRootProps } from "../types.js";
2
- declare const Accordion: import("svelte").Component<AccordionRootProps, {}, "value" | "ref">;
2
+ declare const Accordion: import("svelte").Component<AccordionRootProps, {}, "ref" | "value">;
3
3
  type Accordion = ReturnType<typeof Accordion>;
4
4
  export default Accordion;
@@ -5,20 +5,20 @@ export type BaseAccordionRootPropsWithoutHTML = {
5
5
  /**
6
6
  * Whether the accordion is disabled or not.
7
7
  *
8
- * @defaultValue false
8
+ * @default false
9
9
  */
10
10
  disabled?: boolean;
11
11
  /**
12
12
  * Whether to loop through the accordion items when navigating
13
13
  * with the arrow keys.
14
14
  *
15
- * @defaultValue true
15
+ * @default true
16
16
  */
17
17
  loop?: boolean;
18
18
  /**
19
19
  * The orientation of the accordion.
20
20
  *
21
- * @defaultValue "vertical"
21
+ * @default "vertical"
22
22
  */
23
23
  orientation?: Orientation;
24
24
  };
@@ -35,7 +35,7 @@ export type AccordionRootSinglePropsWithoutHTML = BaseAccordionRootPropsWithoutH
35
35
  * The value of the currently open accordion item.
36
36
  *
37
37
  * @bindable
38
- * @defaultValue ""
38
+ * @default ""
39
39
  */
40
40
  value?: string;
41
41
  /**
@@ -56,7 +56,7 @@ export type AccordionRootMultiplePropsWithoutHTML = BaseAccordionRootPropsWithou
56
56
  * The value of the currently open accordion item.
57
57
  *
58
58
  * @bindable
59
- * @defaultValue []
59
+ * @default []
60
60
  */
61
61
  value?: string[];
62
62
  /**
@@ -81,9 +81,18 @@ export type AccordionContentPropsWithoutHTML = WithChildNoChildrenSnippetProps<{
81
81
  * Whether to forcefully mount the content, regardless of the open state.
82
82
  * This is useful if you want to use Svelte transitions for the content.
83
83
  *
84
- * @defaultValue `true`
84
+ * @default true
85
85
  */
86
86
  forceMount?: boolean;
87
+ /**
88
+ * Whether to allow the browser to expand the content when searching for content
89
+ * within the panel via the browser's built-in search functionality.
90
+ *
91
+ * When `true`, this prop will override the `forceMount` prop.
92
+ *
93
+ * @default false
94
+ */
95
+ hiddenUntilFound?: boolean;
87
96
  }, AccordionContentSnippetProps>;
88
97
  export type AccordionContentProps = AccordionContentPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, AccordionContentPropsWithoutHTML>;
89
98
  export type AccordionItemPropsWithoutHTML = WithChild<{
@@ -95,7 +104,7 @@ export type AccordionItemPropsWithoutHTML = WithChild<{
95
104
  /**
96
105
  * Whether the accordion item is disabled, which prevents users from interacting with it.
97
106
  *
98
- * @defaultValue `false`
107
+ * @default false
99
108
  */
100
109
  disabled?: boolean;
101
110
  }>;
@@ -105,7 +114,7 @@ export type AccordionHeaderPropsWithoutHTML = WithChild<{
105
114
  * The level of the accordion header, applied to the element's `aria-level` attribute.
106
115
  * This is used to indicate the hierarchical relationship between the accordion items.
107
116
  *
108
- * @defaultValue `3`
117
+ * @default `3`
109
118
  */
110
119
  level?: 1 | 2 | 3 | 4 | 5 | 6;
111
120
  }>;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AlertDialogActionProps } from "../types.js";
4
4
  import { DialogActionState } from "../../dialog/dialog.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -15,8 +15,8 @@
15
15
  }: AlertDialogActionProps = $props();
16
16
 
17
17
  const actionState = DialogActionState.create({
18
- id: box.with(() => id),
19
- ref: box.with(
18
+ id: boxWith(() => id),
19
+ ref: boxWith(
20
20
  () => ref,
21
21
  (v) => (ref = v)
22
22
  ),
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AlertDialogCancelProps } from "../types.js";
4
4
  import { AlertDialogCancelState } from "../../dialog/dialog.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -16,12 +16,12 @@
16
16
  }: AlertDialogCancelProps = $props();
17
17
 
18
18
  const cancelState = AlertDialogCancelState.create({
19
- id: box.with(() => id),
20
- ref: box.with(
19
+ id: boxWith(() => id),
20
+ ref: boxWith(
21
21
  () => ref,
22
22
  (v) => (ref = v)
23
23
  ),
24
- disabled: box.with(() => Boolean(disabled)),
24
+ disabled: boxWith(() => Boolean(disabled)),
25
25
  });
26
26
 
27
27
  const mergedProps = $derived(mergeProps(restProps, cancelState.props));
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { afterSleep, box, mergeProps } from "svelte-toolbelt";
2
+ import { afterSleep, boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AlertDialogContentProps } from "../types.js";
4
4
  import DismissibleLayer from "../../utilities/dismissible-layer/dismissible-layer.svelte";
5
5
  import EscapeLayer from "../../utilities/escape-layer/escape-layer.svelte";
@@ -32,8 +32,8 @@
32
32
  }: AlertDialogContentProps = $props();
33
33
 
34
34
  const contentState = DialogContentState.create({
35
- id: box.with(() => id),
36
- ref: box.with(
35
+ id: boxWith(() => id),
36
+ ref: boxWith(
37
37
  () => ref,
38
38
  (v) => (ref = v)
39
39
  ),
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box } from "svelte-toolbelt";
2
+ import { boxWith } from "svelte-toolbelt";
3
3
  import type { AlertDialogRootProps } from "../types.js";
4
4
  import { noop } from "../../../internal/noop.js";
5
5
  import { DialogRootState } from "../../dialog/dialog.svelte.js";
@@ -12,15 +12,15 @@
12
12
  }: AlertDialogRootProps = $props();
13
13
 
14
14
  DialogRootState.create({
15
- variant: box.with(() => "alert-dialog"),
16
- open: box.with(
15
+ variant: boxWith(() => "alert-dialog"),
16
+ open: boxWith(
17
17
  () => open,
18
18
  (v) => {
19
19
  open = v;
20
20
  onOpenChange(v);
21
21
  }
22
22
  ),
23
- onOpenChangeComplete: box.with(() => onOpenChangeComplete),
23
+ onOpenChangeComplete: boxWith(() => onOpenChangeComplete),
24
24
  });
25
25
  </script>
26
26
 
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AspectRatioRootProps } from "../types.js";
4
4
  import { AspectRatioRootState } from "../aspect-ratio.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -16,12 +16,12 @@
16
16
  }: AspectRatioRootProps = $props();
17
17
 
18
18
  const rootState = AspectRatioRootState.create({
19
- id: box.with(() => id),
20
- ref: box.with(
19
+ id: boxWith(() => id),
20
+ ref: boxWith(
21
21
  () => ref,
22
22
  (v) => (ref = v)
23
23
  ),
24
- ratio: box.with(() => ratio),
24
+ ratio: boxWith(() => ratio),
25
25
  });
26
26
 
27
27
  const mergedProps = $derived(mergeProps(restProps, rootState.props));
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AvatarFallbackProps } from "../types.js";
4
4
  import { AvatarFallbackState } from "../avatar.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -15,8 +15,8 @@
15
15
  }: AvatarFallbackProps = $props();
16
16
 
17
17
  const fallbackState = AvatarFallbackState.create({
18
- id: box.with(() => id),
19
- ref: box.with(
18
+ id: boxWith(() => id),
19
+ ref: boxWith(
20
20
  () => ref,
21
21
  (v) => (ref = v)
22
22
  ),
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AvatarImageProps } from "../types.js";
4
4
  import { AvatarImageState } from "../avatar.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -17,14 +17,14 @@
17
17
  }: AvatarImageProps = $props();
18
18
 
19
19
  const imageState = AvatarImageState.create({
20
- src: box.with(() => src),
21
- id: box.with(() => id),
22
- ref: box.with(
20
+ src: boxWith(() => src),
21
+ id: boxWith(() => id),
22
+ ref: boxWith(
23
23
  () => ref,
24
24
  (v) => (ref = v)
25
25
  ),
26
- crossOrigin: box.with(() => crossorigin),
27
- referrerPolicy: box.with(() => referrerpolicy),
26
+ crossOrigin: boxWith(() => crossorigin),
27
+ referrerPolicy: boxWith(() => referrerpolicy),
28
28
  });
29
29
 
30
30
  const mergedProps = $derived(mergeProps(restProps, imageState.props));
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { box, mergeProps } from "svelte-toolbelt";
2
+ import { boxWith, mergeProps } from "svelte-toolbelt";
3
3
  import type { AvatarRootProps } from "../types.js";
4
4
  import { AvatarRootState } from "../avatar.svelte.js";
5
5
  import { createId } from "../../../internal/create-id.js";
@@ -18,8 +18,8 @@
18
18
  }: AvatarRootProps = $props();
19
19
 
20
20
  const rootState = AvatarRootState.create({
21
- delayMs: box.with(() => delayMs),
22
- loadingStatus: box.with(
21
+ delayMs: boxWith(() => delayMs),
22
+ loadingStatus: boxWith(
23
23
  () => loadingStatus,
24
24
  (v) => {
25
25
  if (loadingStatus !== v) {
@@ -28,8 +28,8 @@
28
28
  }
29
29
  }
30
30
  ),
31
- id: box.with(() => id),
32
- ref: box.with(
31
+ id: boxWith(() => id),
32
+ ref: boxWith(
33
33
  () => ref,
34
34
  (v) => (ref = v)
35
35
  ),