ui-ingredients 0.0.44 → 0.0.46

Sign up to get free protection for your applications and to get access to all the features.
Files changed (433) hide show
  1. package/README.md +1 -0
  2. package/dist/accordion/context.svelte.d.ts +2 -2
  3. package/dist/accordion/create-accordion.svelte.js +3 -4
  4. package/dist/accordion/item-content.svelte +14 -13
  5. package/dist/accordion/item-indicator.svelte +7 -2
  6. package/dist/accordion/item-trigger.svelte +7 -2
  7. package/dist/accordion/item.svelte +4 -4
  8. package/dist/accordion/root.svelte +61 -63
  9. package/dist/avatar/context.svelte.d.ts +1 -1
  10. package/dist/avatar/create-avatar.svelte.js +3 -4
  11. package/dist/avatar/fallback.svelte +2 -2
  12. package/dist/avatar/image.svelte +2 -2
  13. package/dist/avatar/root.svelte +4 -4
  14. package/dist/carousel/context.svelte.d.ts +1 -1
  15. package/dist/carousel/create-carousel.svelte.js +3 -4
  16. package/dist/carousel/indicator-group.svelte +7 -2
  17. package/dist/carousel/indicator.svelte +4 -4
  18. package/dist/carousel/item-group.svelte +2 -2
  19. package/dist/carousel/item.svelte +4 -4
  20. package/dist/carousel/next-trigger.svelte +7 -2
  21. package/dist/carousel/prev-trigger.svelte +7 -2
  22. package/dist/carousel/root.svelte +4 -4
  23. package/dist/carousel/viewport.svelte +2 -2
  24. package/dist/checkbox/context.svelte.d.ts +1 -1
  25. package/dist/checkbox/control.svelte +2 -2
  26. package/dist/checkbox/create-checkbox.svelte.js +4 -5
  27. package/dist/checkbox/hidden-input.svelte +2 -2
  28. package/dist/checkbox/indicator.svelte +2 -2
  29. package/dist/checkbox/label.svelte +2 -2
  30. package/dist/checkbox/root.svelte +4 -4
  31. package/dist/clipboard/context.svelte.d.ts +1 -1
  32. package/dist/clipboard/control.svelte +2 -2
  33. package/dist/clipboard/create-clipboard.svelte.js +3 -4
  34. package/dist/clipboard/indicator.svelte +2 -1
  35. package/dist/clipboard/input.svelte +2 -2
  36. package/dist/clipboard/label.svelte +2 -2
  37. package/dist/clipboard/root.svelte +4 -4
  38. package/dist/clipboard/trigger.svelte +2 -2
  39. package/dist/collapsible/content.svelte +7 -2
  40. package/dist/collapsible/context.svelte.d.ts +1 -1
  41. package/dist/collapsible/create-collapsible.svelte.js +3 -4
  42. package/dist/collapsible/root.svelte +4 -4
  43. package/dist/collapsible/trigger.svelte +7 -2
  44. package/dist/color-picker/context.svelte.d.ts +5 -5
  45. package/dist/color-picker/create-color-picker.svelte.js +3 -4
  46. package/dist/color-picker/root.svelte +2 -2
  47. package/dist/combobox/clear-trigger.svelte +7 -2
  48. package/dist/combobox/content.svelte +2 -2
  49. package/dist/combobox/context.svelte.d.ts +3 -3
  50. package/dist/combobox/control.svelte +2 -2
  51. package/dist/combobox/create-combobox.svelte.js +4 -5
  52. package/dist/combobox/input.svelte +2 -2
  53. package/dist/combobox/item-group-label.svelte +7 -2
  54. package/dist/combobox/item-group.svelte +8 -2
  55. package/dist/combobox/item-indicator.svelte +7 -2
  56. package/dist/combobox/item-text.svelte +2 -2
  57. package/dist/combobox/item.svelte +4 -4
  58. package/dist/combobox/label.svelte +2 -2
  59. package/dist/combobox/list.svelte +2 -2
  60. package/dist/combobox/positioner.svelte +7 -2
  61. package/dist/combobox/root.svelte +12 -18
  62. package/dist/combobox/trigger.svelte +2 -2
  63. package/dist/create-context.svelte.d.ts +8 -3
  64. package/dist/create-context.svelte.js +15 -20
  65. package/dist/date-picker/clear-trigger.svelte +7 -2
  66. package/dist/date-picker/content.svelte +2 -2
  67. package/dist/date-picker/context.svelte.d.ts +5 -5
  68. package/dist/date-picker/control.svelte +2 -2
  69. package/dist/date-picker/create-date-picker.svelte.js +2 -3
  70. package/dist/date-picker/day-table-cell-trigger.svelte +7 -3
  71. package/dist/date-picker/day-table-cell.svelte +9 -4
  72. package/dist/date-picker/input.svelte +2 -2
  73. package/dist/date-picker/label.svelte +8 -2
  74. package/dist/date-picker/month-select.svelte +7 -2
  75. package/dist/date-picker/month-table-cell-trigger.svelte +7 -3
  76. package/dist/date-picker/month-table-cell.svelte +9 -4
  77. package/dist/date-picker/next-trigger.svelte +7 -2
  78. package/dist/date-picker/positioner.svelte +7 -2
  79. package/dist/date-picker/preset-trigger.svelte +8 -3
  80. package/dist/date-picker/prev-trigger.svelte +7 -2
  81. package/dist/date-picker/range-text.svelte +7 -2
  82. package/dist/date-picker/root.svelte +12 -20
  83. package/dist/date-picker/table-body.svelte +7 -2
  84. package/dist/date-picker/table-head.svelte +7 -2
  85. package/dist/date-picker/table-header.svelte +7 -2
  86. package/dist/date-picker/table-row.svelte +7 -2
  87. package/dist/date-picker/table.svelte +9 -3
  88. package/dist/date-picker/trigger.svelte +2 -2
  89. package/dist/date-picker/view-control.svelte +7 -2
  90. package/dist/date-picker/view-trigger.svelte +7 -2
  91. package/dist/date-picker/view.svelte +2 -1
  92. package/dist/date-picker/year-select.svelte +7 -2
  93. package/dist/date-picker/year-table-cell-trigger.svelte +7 -3
  94. package/dist/date-picker/year-table-cell.svelte +9 -4
  95. package/dist/dialog/backdrop.svelte +9 -14
  96. package/dist/dialog/close-trigger.svelte +7 -2
  97. package/dist/dialog/content.svelte +2 -2
  98. package/dist/dialog/context.svelte.d.ts +1 -1
  99. package/dist/dialog/create-dialog.svelte.js +3 -4
  100. package/dist/dialog/description.svelte +2 -2
  101. package/dist/dialog/positioner.svelte +2 -2
  102. package/dist/dialog/root.svelte +6 -12
  103. package/dist/dialog/title.svelte +2 -2
  104. package/dist/dialog/trigger.svelte +2 -2
  105. package/dist/editable/area.svelte +2 -2
  106. package/dist/editable/cancel-trigger.svelte +7 -2
  107. package/dist/editable/context.svelte.d.ts +1 -1
  108. package/dist/editable/control.svelte +2 -2
  109. package/dist/editable/create-editable.svelte.js +4 -5
  110. package/dist/editable/edit-trigger.svelte +7 -2
  111. package/dist/editable/input.svelte +2 -2
  112. package/dist/editable/label.svelte +2 -2
  113. package/dist/editable/preview.svelte +2 -2
  114. package/dist/editable/root.svelte +4 -4
  115. package/dist/editable/submit-trigger.svelte +7 -2
  116. package/dist/environment-provider/context.svelte.d.ts +1 -1
  117. package/dist/environment-provider/root.svelte +5 -8
  118. package/dist/field/context.svelte.d.ts +1 -1
  119. package/dist/field/create-field.svelte.d.ts +1 -22
  120. package/dist/field/create-field.svelte.js +9 -20
  121. package/dist/field/error-text.svelte +2 -2
  122. package/dist/field/helper-text.svelte +2 -2
  123. package/dist/field/input.svelte +2 -2
  124. package/dist/field/label.svelte +2 -2
  125. package/dist/field/root.svelte +4 -4
  126. package/dist/field/select.svelte +2 -2
  127. package/dist/field/textarea.svelte +2 -2
  128. package/dist/file-upload/context.svelte.d.ts +2 -2
  129. package/dist/file-upload/create-file-upload.svelte.js +4 -5
  130. package/dist/file-upload/dropzone.svelte +7 -2
  131. package/dist/file-upload/hidden-input.svelte +2 -2
  132. package/dist/file-upload/item-delete-trigger.svelte +7 -3
  133. package/dist/file-upload/item-group.svelte +7 -2
  134. package/dist/file-upload/item-name.svelte +7 -2
  135. package/dist/file-upload/item-preview-image.svelte +2 -2
  136. package/dist/file-upload/item-preview.svelte +7 -2
  137. package/dist/file-upload/item-size-text.svelte +7 -2
  138. package/dist/file-upload/item.svelte +4 -4
  139. package/dist/file-upload/label.svelte +2 -2
  140. package/dist/file-upload/root.svelte +4 -4
  141. package/dist/file-upload/trigger.svelte +2 -2
  142. package/dist/floating-panel/body.svelte +2 -2
  143. package/dist/floating-panel/close-trigger.svelte +7 -2
  144. package/dist/floating-panel/content.svelte +7 -2
  145. package/dist/floating-panel/context.svelte.d.ts +1 -1
  146. package/dist/floating-panel/create-floating-panel.svelte.js +3 -4
  147. package/dist/floating-panel/drag-trigger.svelte +7 -2
  148. package/dist/floating-panel/header.svelte +7 -2
  149. package/dist/floating-panel/maximize-trigger.svelte +7 -3
  150. package/dist/floating-panel/minimize-trigger.svelte +7 -3
  151. package/dist/floating-panel/positioner.svelte +7 -2
  152. package/dist/floating-panel/resize-trigger.svelte +9 -4
  153. package/dist/floating-panel/restore-trigger.svelte +7 -3
  154. package/dist/floating-panel/root.svelte +6 -11
  155. package/dist/floating-panel/title.svelte +7 -2
  156. package/dist/floating-panel/trigger.svelte +7 -2
  157. package/dist/highlight/highlight.svelte +42 -0
  158. package/dist/highlight/highlight.svelte.d.ts +18 -0
  159. package/dist/highlight/index.d.ts +1 -0
  160. package/dist/highlight/index.js +1 -0
  161. package/dist/hover-card/arrow-tip.svelte +2 -2
  162. package/dist/hover-card/arrow.svelte +2 -2
  163. package/dist/hover-card/content.svelte +2 -2
  164. package/dist/hover-card/context.svelte.d.ts +1 -1
  165. package/dist/hover-card/create-hover-card.svelte.js +3 -4
  166. package/dist/hover-card/positioner.svelte +7 -2
  167. package/dist/hover-card/root.svelte +6 -11
  168. package/dist/hover-card/trigger.svelte +2 -2
  169. package/dist/index.d.ts +1 -0
  170. package/dist/index.js +1 -0
  171. package/dist/locale-provider/context.svelte.d.ts +1 -1
  172. package/dist/locale-provider/root.svelte +8 -6
  173. package/dist/menu/arrow-tip.svelte +2 -2
  174. package/dist/menu/arrow.svelte +2 -2
  175. package/dist/menu/content.svelte +2 -2
  176. package/dist/menu/context-trigger.svelte +7 -2
  177. package/dist/menu/context.svelte.d.ts +3 -3
  178. package/dist/menu/create-menu.svelte.js +3 -4
  179. package/dist/menu/indicator.svelte +2 -2
  180. package/dist/menu/item-group-label.svelte +7 -2
  181. package/dist/menu/item-group.svelte +2 -2
  182. package/dist/menu/item.svelte +4 -4
  183. package/dist/menu/option-item-indicator.svelte +7 -2
  184. package/dist/menu/option-item-text.svelte +7 -2
  185. package/dist/menu/option-item.svelte +4 -4
  186. package/dist/menu/positioner.svelte +2 -2
  187. package/dist/menu/root.svelte +6 -12
  188. package/dist/menu/separator.svelte +2 -2
  189. package/dist/menu/trigger-item.svelte +7 -2
  190. package/dist/menu/trigger.svelte +2 -2
  191. package/dist/number-input/context.svelte.d.ts +1 -1
  192. package/dist/number-input/control.svelte +7 -2
  193. package/dist/number-input/create-number-input.svelte.js +4 -5
  194. package/dist/number-input/decrement-trigger.svelte +7 -3
  195. package/dist/number-input/increment-trigger.svelte +7 -3
  196. package/dist/number-input/input.svelte +2 -2
  197. package/dist/number-input/label.svelte +2 -2
  198. package/dist/number-input/root.svelte +4 -4
  199. package/dist/number-input/scrubber.svelte +7 -2
  200. package/dist/pagination/context.svelte.d.ts +1 -1
  201. package/dist/pagination/create-pagination.svelte.js +3 -4
  202. package/dist/pagination/ellipsis.svelte +8 -2
  203. package/dist/pagination/item.svelte +8 -2
  204. package/dist/pagination/next-trigger.svelte +7 -2
  205. package/dist/pagination/prev-trigger.svelte +7 -2
  206. package/dist/pagination/root.svelte +4 -4
  207. package/dist/pin-input/clear-trigger.svelte +7 -2
  208. package/dist/pin-input/context.svelte.d.ts +1 -1
  209. package/dist/pin-input/create-pin-input.svelte.js +4 -5
  210. package/dist/pin-input/hidden-input.svelte +2 -2
  211. package/dist/pin-input/input.svelte +2 -2
  212. package/dist/pin-input/label.svelte +2 -2
  213. package/dist/pin-input/root.svelte +4 -4
  214. package/dist/popover/arrow-tip.svelte +2 -2
  215. package/dist/popover/arrow.svelte +2 -2
  216. package/dist/popover/close-trigger.svelte +7 -2
  217. package/dist/popover/content.svelte +2 -2
  218. package/dist/popover/context.svelte.d.ts +1 -1
  219. package/dist/popover/create-popover.svelte.js +3 -4
  220. package/dist/popover/description.svelte +7 -2
  221. package/dist/popover/positioner.svelte +2 -2
  222. package/dist/popover/root.svelte +6 -11
  223. package/dist/popover/title.svelte +2 -2
  224. package/dist/popover/trigger.svelte +2 -2
  225. package/dist/presence/context.svelte.d.ts +2 -2
  226. package/dist/presence/root.svelte +2 -2
  227. package/dist/progress/circle-range.svelte +7 -2
  228. package/dist/progress/circle-track.svelte +7 -2
  229. package/dist/progress/circle.svelte +2 -2
  230. package/dist/progress/context.svelte.d.ts +1 -1
  231. package/dist/progress/create-progress.svelte.js +3 -4
  232. package/dist/progress/label.svelte +2 -2
  233. package/dist/progress/range.svelte +2 -2
  234. package/dist/progress/root.svelte +4 -4
  235. package/dist/progress/track.svelte +2 -2
  236. package/dist/progress/value-text.svelte +2 -2
  237. package/dist/progress/view.svelte +8 -2
  238. package/dist/qr-code/context.svelte.d.ts +1 -1
  239. package/dist/qr-code/create-qr-code.svelte.js +3 -4
  240. package/dist/qr-code/frame.svelte +2 -2
  241. package/dist/qr-code/overlay.svelte +2 -2
  242. package/dist/qr-code/pattern.svelte +2 -2
  243. package/dist/qr-code/root.svelte +4 -4
  244. package/dist/radio-group/context.svelte.d.ts +2 -2
  245. package/dist/radio-group/create-radio-group.svelte.js +3 -4
  246. package/dist/radio-group/indicator.svelte +7 -2
  247. package/dist/radio-group/item-control.svelte +7 -2
  248. package/dist/radio-group/item-hidden-input.svelte +2 -2
  249. package/dist/radio-group/item-text.svelte +7 -2
  250. package/dist/radio-group/item.svelte +4 -4
  251. package/dist/radio-group/label.svelte +2 -2
  252. package/dist/radio-group/root.svelte +4 -4
  253. package/dist/rating-group/context.svelte.d.ts +1 -1
  254. package/dist/rating-group/control.svelte +7 -2
  255. package/dist/rating-group/create-rating-group.svelte.js +4 -5
  256. package/dist/rating-group/hidden-input.svelte +2 -2
  257. package/dist/rating-group/item.svelte +8 -2
  258. package/dist/rating-group/label.svelte +2 -2
  259. package/dist/rating-group/root.svelte +4 -4
  260. package/dist/segment-group/context.svelte.d.ts +2 -2
  261. package/dist/segment-group/create-segment-group.svelte.js +3 -4
  262. package/dist/segment-group/indicator.svelte +7 -2
  263. package/dist/segment-group/item-control.svelte +7 -2
  264. package/dist/segment-group/item-hidden-input.svelte +2 -2
  265. package/dist/segment-group/item-text.svelte +7 -2
  266. package/dist/segment-group/item.svelte +4 -4
  267. package/dist/segment-group/label.svelte +2 -2
  268. package/dist/segment-group/root.svelte +4 -4
  269. package/dist/select/clear-trigger.svelte +7 -2
  270. package/dist/select/content.svelte +2 -2
  271. package/dist/select/context.svelte.d.ts +3 -3
  272. package/dist/select/control.svelte +2 -2
  273. package/dist/select/create-select.svelte.js +4 -5
  274. package/dist/select/hidden-select.svelte +7 -2
  275. package/dist/select/indicator.svelte +2 -2
  276. package/dist/select/item-group-label.svelte +7 -2
  277. package/dist/select/item-group.svelte +8 -2
  278. package/dist/select/item-indicator.svelte +7 -2
  279. package/dist/select/item-text.svelte +2 -2
  280. package/dist/select/item.svelte +4 -4
  281. package/dist/select/label.svelte +2 -2
  282. package/dist/select/list.svelte +2 -2
  283. package/dist/select/positioner.svelte +2 -2
  284. package/dist/select/root.svelte +13 -21
  285. package/dist/select/trigger.svelte +2 -2
  286. package/dist/select/value-text.svelte +8 -3
  287. package/dist/signature-pad/clear-trigger.svelte +7 -2
  288. package/dist/signature-pad/context.svelte.d.ts +1 -1
  289. package/dist/signature-pad/control.svelte +7 -2
  290. package/dist/signature-pad/create-signature-pad.svelte.js +3 -4
  291. package/dist/signature-pad/current-segment-path.svelte +7 -3
  292. package/dist/signature-pad/guide.svelte +2 -2
  293. package/dist/signature-pad/hidden-input.svelte +7 -2
  294. package/dist/signature-pad/label.svelte +2 -2
  295. package/dist/signature-pad/root.svelte +4 -4
  296. package/dist/signature-pad/segment-path.svelte +8 -3
  297. package/dist/signature-pad/segment.svelte +7 -2
  298. package/dist/slider/context.svelte.d.ts +2 -2
  299. package/dist/slider/control.svelte +2 -2
  300. package/dist/slider/create-slider.svelte.js +3 -4
  301. package/dist/slider/hidden-input.svelte +2 -2
  302. package/dist/slider/label.svelte +2 -2
  303. package/dist/slider/marker-group.svelte +2 -2
  304. package/dist/slider/marker.svelte +8 -2
  305. package/dist/slider/range.svelte +2 -2
  306. package/dist/slider/root.svelte +4 -4
  307. package/dist/slider/thumb.svelte +4 -4
  308. package/dist/slider/track.svelte +2 -2
  309. package/dist/slider/value-text.svelte +2 -2
  310. package/dist/splitter/context.svelte.d.ts +1 -1
  311. package/dist/splitter/create-splitter.svelte.js +3 -4
  312. package/dist/splitter/panel.svelte +4 -4
  313. package/dist/splitter/resize-trigger.svelte +9 -4
  314. package/dist/splitter/root.svelte +4 -4
  315. package/dist/steps/completed-content.svelte +7 -2
  316. package/dist/steps/content.svelte +8 -2
  317. package/dist/steps/context.svelte.d.ts +2 -2
  318. package/dist/steps/create-steps.svelte.js +3 -4
  319. package/dist/steps/indicator.svelte +2 -2
  320. package/dist/steps/item.svelte +4 -4
  321. package/dist/steps/list.svelte +2 -2
  322. package/dist/steps/next-trigger.svelte +2 -2
  323. package/dist/steps/prev-trigger.svelte +2 -2
  324. package/dist/steps/progress.svelte +2 -2
  325. package/dist/steps/root.svelte +4 -4
  326. package/dist/steps/separator.svelte +2 -2
  327. package/dist/steps/trigger.svelte +2 -2
  328. package/dist/switch/context.svelte.d.ts +1 -1
  329. package/dist/switch/control.svelte +4 -4
  330. package/dist/switch/create-switch.svelte.d.ts +3 -3
  331. package/dist/switch/create-switch.svelte.js +7 -8
  332. package/dist/switch/hidden-input.svelte +4 -4
  333. package/dist/switch/label.svelte +4 -4
  334. package/dist/switch/root.svelte +8 -8
  335. package/dist/switch/thumb.svelte +4 -4
  336. package/dist/tabs/content.svelte +4 -4
  337. package/dist/tabs/context.svelte.d.ts +1 -1
  338. package/dist/tabs/create-tabs.svelte.js +3 -4
  339. package/dist/tabs/list.svelte +2 -2
  340. package/dist/tabs/root.svelte +4 -4
  341. package/dist/tabs/trigger.svelte +4 -4
  342. package/dist/tags-input/clear-trigger.svelte +7 -2
  343. package/dist/tags-input/context.svelte.d.ts +2 -2
  344. package/dist/tags-input/control.svelte +2 -2
  345. package/dist/tags-input/create-tags-input.svelte.js +4 -5
  346. package/dist/tags-input/hidden-input.svelte +2 -2
  347. package/dist/tags-input/input.svelte +2 -2
  348. package/dist/tags-input/item-delete-trigger.svelte +7 -2
  349. package/dist/tags-input/item-input.svelte +2 -2
  350. package/dist/tags-input/item-preview.svelte +7 -2
  351. package/dist/tags-input/item-text.svelte +2 -2
  352. package/dist/tags-input/item.svelte +4 -4
  353. package/dist/tags-input/label.svelte +2 -2
  354. package/dist/tags-input/root.svelte +4 -4
  355. package/dist/time-picker/clear-trigger.svelte +7 -2
  356. package/dist/time-picker/column.svelte +8 -2
  357. package/dist/time-picker/content.svelte +2 -2
  358. package/dist/time-picker/context.svelte.d.ts +1 -1
  359. package/dist/time-picker/control.svelte +2 -2
  360. package/dist/time-picker/create-time-picker.svelte.js +3 -4
  361. package/dist/time-picker/hour-cell.svelte +8 -2
  362. package/dist/time-picker/input.svelte +2 -2
  363. package/dist/time-picker/label.svelte +2 -2
  364. package/dist/time-picker/minute-cell.svelte +8 -3
  365. package/dist/time-picker/period-cell.svelte +8 -3
  366. package/dist/time-picker/positioner.svelte +7 -2
  367. package/dist/time-picker/root.svelte +13 -23
  368. package/dist/time-picker/second-cell.svelte +8 -3
  369. package/dist/time-picker/spacer.svelte +2 -2
  370. package/dist/time-picker/trigger.svelte +2 -2
  371. package/dist/timer/action-trigger.svelte +8 -2
  372. package/dist/timer/context.svelte.d.ts +2 -2
  373. package/dist/timer/create-timer.svelte.js +3 -4
  374. package/dist/timer/item-label.svelte +2 -2
  375. package/dist/timer/item-value.svelte +2 -2
  376. package/dist/timer/item.svelte +4 -4
  377. package/dist/timer/root.svelte +4 -4
  378. package/dist/timer/separator.svelte +2 -2
  379. package/dist/toast/action-trigger.svelte +7 -2
  380. package/dist/toast/close-trigger.svelte +2 -2
  381. package/dist/toast/context.svelte.d.ts +1 -1
  382. package/dist/toast/create-toast.svelte.js +1 -2
  383. package/dist/toast/create-toaster.svelte.js +2 -3
  384. package/dist/toast/description.svelte +2 -2
  385. package/dist/toast/ghost-after.svelte +2 -2
  386. package/dist/toast/ghost-before.svelte +2 -2
  387. package/dist/toast/root.svelte +2 -2
  388. package/dist/toast/title.svelte +2 -2
  389. package/dist/toast/toaster.svelte +2 -2
  390. package/dist/toggle-group/context.svelte.d.ts +1 -1
  391. package/dist/toggle-group/create-toggle-group.svelte.js +3 -4
  392. package/dist/toggle-group/item.svelte +4 -4
  393. package/dist/toggle-group/root.svelte +4 -4
  394. package/dist/tooltip/arrow-tip.svelte +2 -2
  395. package/dist/tooltip/arrow.svelte +2 -2
  396. package/dist/tooltip/content.svelte +2 -2
  397. package/dist/tooltip/context.svelte.d.ts +1 -1
  398. package/dist/tooltip/create-tooltip.svelte.js +3 -4
  399. package/dist/tooltip/positioner.svelte +2 -2
  400. package/dist/tooltip/root.svelte +6 -12
  401. package/dist/tooltip/trigger.svelte +2 -2
  402. package/dist/tour/arrow-tip.svelte +2 -2
  403. package/dist/tour/arrow.svelte +2 -2
  404. package/dist/tour/close-trigger.svelte +2 -2
  405. package/dist/tour/content.svelte +2 -2
  406. package/dist/tour/context.svelte.d.ts +1 -1
  407. package/dist/tour/create-tour.svelte.js +3 -4
  408. package/dist/tour/description.svelte +2 -2
  409. package/dist/tour/next-trigger.svelte +2 -2
  410. package/dist/tour/overlay.svelte +9 -14
  411. package/dist/tour/positioner.svelte +2 -2
  412. package/dist/tour/prev-trigger.svelte +2 -2
  413. package/dist/tour/progress-text.svelte +2 -2
  414. package/dist/tour/root.svelte +6 -11
  415. package/dist/tour/skip-trigger.svelte +2 -2
  416. package/dist/tour/spotlight.svelte +2 -2
  417. package/dist/tour/title.svelte +2 -2
  418. package/dist/tree-view/branch-content.svelte +7 -2
  419. package/dist/tree-view/branch-control.svelte +7 -2
  420. package/dist/tree-view/branch-indicator.svelte +7 -2
  421. package/dist/tree-view/branch-text.svelte +7 -2
  422. package/dist/tree-view/branch-trigger.svelte +7 -2
  423. package/dist/tree-view/branch.svelte +4 -4
  424. package/dist/tree-view/context.svelte.d.ts +3 -3
  425. package/dist/tree-view/create-tree-view.svelte.js +3 -4
  426. package/dist/tree-view/item-indicator.svelte +7 -2
  427. package/dist/tree-view/item-text.svelte +2 -2
  428. package/dist/tree-view/item.svelte +4 -4
  429. package/dist/tree-view/label.svelte +2 -2
  430. package/dist/tree-view/root.svelte +4 -4
  431. package/dist/tree-view/tree.svelte +2 -2
  432. package/dist/types.d.ts +2 -1
  433. package/package.json +176 -175
@@ -8,7 +8,7 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getSliderContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: SliderRangeProps = $props();
11
+ let {this: e, asChild, children, ...props}: SliderRangeProps = $props();
12
12
 
13
13
  let slider = getSliderContext();
14
14
 
@@ -18,7 +18,7 @@
18
18
  {#if asChild}
19
19
  {@render asChild(mergedProps)}
20
20
  {:else}
21
- <div {...mergedProps}>
21
+ <div bind:this={e} {...mergedProps}>
22
22
  {@render children?.()}
23
23
  </div>
24
24
  {/if}
@@ -19,9 +19,9 @@
19
19
  import {setSliderContext} from './context.svelte.js';
20
20
  import {createSlider} from './create-slider.svelte.js';
21
21
 
22
- let {asChild, children, ...props}: SliderProps = $props();
22
+ let {this: e, asChild, children, ...props}: SliderProps = $props();
23
23
 
24
- let [sliderProps, otherProps] = $derived(
24
+ let [sliderProps, localProps] = $derived(
25
25
  createSplitProps<CreateSliderProps>([
26
26
  'id',
27
27
  'ids',
@@ -50,7 +50,7 @@
50
50
 
51
51
  let slider = createSlider(reflect(() => sliderProps));
52
52
 
53
- let mergedProps = $derived(mergeProps(otherProps, slider.getRootProps()));
53
+ let mergedProps = $derived(mergeProps(localProps, slider.getRootProps()));
54
54
 
55
55
  setSliderContext(slider);
56
56
  </script>
@@ -58,7 +58,7 @@
58
58
  {#if asChild}
59
59
  {@render asChild(mergedProps, slider)}
60
60
  {:else}
61
- <div {...mergedProps}>
61
+ <div bind:this={e} {...mergedProps}>
62
62
  {@render children?.(slider)}
63
63
  </div>
64
64
  {/if}
@@ -14,16 +14,16 @@
14
14
  setSliderThumbPropsContext,
15
15
  } from './context.svelte.js';
16
16
 
17
- let {asChild, children, ...props}: SliderThumbProps = $props();
17
+ let {this: e, asChild, children, ...props}: SliderThumbProps = $props();
18
18
 
19
19
  let slider = getSliderContext();
20
20
 
21
- let [thumbProps, otherProps] = $derived(
21
+ let [thumbProps, localProps] = $derived(
22
22
  createSplitProps<ThumbProps>(['name', 'index'])(props),
23
23
  );
24
24
 
25
25
  let mergedProps = $derived(
26
- mergeProps(otherProps, slider.getThumbProps(thumbProps)),
26
+ mergeProps(localProps, slider.getThumbProps(thumbProps)),
27
27
  );
28
28
 
29
29
  setSliderThumbPropsContext(() => thumbProps);
@@ -32,7 +32,7 @@
32
32
  {#if asChild}
33
33
  {@render asChild(mergedProps)}
34
34
  {:else}
35
- <div {...mergedProps}>
35
+ <div bind:this={e} {...mergedProps}>
36
36
  {@render children?.()}
37
37
  </div>
38
38
  {/if}
@@ -8,7 +8,7 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getSliderContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: SliderTrackProps = $props();
11
+ let {this: e, asChild, children, ...props}: SliderTrackProps = $props();
12
12
 
13
13
  let slider = getSliderContext();
14
14
 
@@ -18,7 +18,7 @@
18
18
  {#if asChild}
19
19
  {@render asChild(mergedProps)}
20
20
  {:else}
21
- <div {...mergedProps}>
21
+ <div bind:this={e} {...mergedProps}>
22
22
  {@render children?.()}
23
23
  </div>
24
24
  {/if}
@@ -8,7 +8,7 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getSliderContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: SliderValueTextProps = $props();
11
+ let {this: e, asChild, children, ...props}: SliderValueTextProps = $props();
12
12
 
13
13
  let slider = getSliderContext();
14
14
 
@@ -18,7 +18,7 @@
18
18
  {#if asChild}
19
19
  {@render asChild(mergedProps)}
20
20
  {:else}
21
- <span {...mergedProps}>
21
+ <span bind:this={e} {...mergedProps}>
22
22
  {#if children}
23
23
  {@render children()}
24
24
  {:else}
@@ -1,2 +1,2 @@
1
1
  import type { CreateSplitterReturn } from './create-splitter.svelte.js';
2
- export declare const getSplitterContext: () => CreateSplitterReturn, setSplitterContext: (context: CreateSplitterReturn | (() => CreateSplitterReturn)) => void;
2
+ export declare const getSplitterContext: () => CreateSplitterReturn, setSplitterContext: (context: CreateSplitterReturn | (() => CreateSplitterReturn)) => CreateSplitterReturn;
@@ -6,13 +6,12 @@ import { uid } from 'uid';
6
6
  export function createSplitter(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
- const context = $derived(reflect(() => ({
9
+ const context = reflect(() => ({
10
10
  ...props,
11
11
  id: props.id ?? uid(),
12
12
  dir: locale?.dir,
13
13
  getRootNode: environment?.getRootNode,
14
- })));
14
+ }));
15
15
  const [state, send] = useMachine(splitter.machine(context), { context });
16
- const api = $derived(reflect(() => splitter.connect(state, send, normalizeProps)));
17
- return api;
16
+ return reflect(() => splitter.connect(state, send, normalizeProps));
18
17
  }
@@ -11,23 +11,23 @@
11
11
  import {createSplitProps} from '@zag-js/utils';
12
12
  import {getSplitterContext} from './context.svelte.js';
13
13
 
14
- let {asChild, children, ...props}: SplitterPanelProps = $props();
14
+ let {this: e, asChild, children, ...props}: SplitterPanelProps = $props();
15
15
 
16
16
  let splitter = getSplitterContext();
17
17
 
18
- let [panelProps, otherProps] = $derived(
18
+ let [panelProps, localProps] = $derived(
19
19
  createSplitProps<PanelProps>(['id', 'snapSize'])(props),
20
20
  );
21
21
 
22
22
  let mergedProps = $derived(
23
- mergeProps(otherProps, splitter.getPanelProps(panelProps)),
23
+ mergeProps(localProps, splitter.getPanelProps(panelProps)),
24
24
  );
25
25
  </script>
26
26
 
27
27
  {#if asChild}
28
28
  {@render asChild(mergedProps)}
29
29
  {:else}
30
- <div {...mergedProps}>
30
+ <div bind:this={e} {...mergedProps}>
31
31
  {@render children?.()}
32
32
  </div>
33
33
  {/if}
@@ -23,25 +23,30 @@
23
23
  import {createSplitProps} from '@zag-js/utils';
24
24
  import {getSplitterContext} from './context.svelte.js';
25
25
 
26
- let {asChild, children, ...props}: SplitterResizeTriggerProps = $props();
26
+ let {
27
+ this: e,
28
+ asChild,
29
+ children,
30
+ ...props
31
+ }: SplitterResizeTriggerProps = $props();
27
32
 
28
33
  let splitter = getSplitterContext();
29
34
 
30
- let [resizeTriggerProps, otherProps] = $derived(
35
+ let [resizeTriggerProps, localProps] = $derived(
31
36
  createSplitProps<ResizeTriggerProps>(['id', 'step', 'disabled'])(props),
32
37
  );
33
38
 
34
39
  let itemState = $derived(splitter.getResizeTriggerState(resizeTriggerProps));
35
40
 
36
41
  let mergedProps = $derived(
37
- mergeProps(otherProps, splitter.getResizeTriggerProps(resizeTriggerProps)),
42
+ mergeProps(localProps, splitter.getResizeTriggerProps(resizeTriggerProps)),
38
43
  );
39
44
  </script>
40
45
 
41
46
  {#if asChild}
42
47
  {@render asChild(mergedProps, itemState)}
43
48
  {:else}
44
- <div {...mergedProps}>
49
+ <div bind:this={e} {...mergedProps}>
45
50
  {@render children?.(itemState)}
46
51
  </div>
47
52
  {/if}
@@ -19,9 +19,9 @@
19
19
  import {setSplitterContext} from './context.svelte.js';
20
20
  import {createSplitter} from './create-splitter.svelte.js';
21
21
 
22
- let {asChild, children, ...props}: SplitterProps = $props();
22
+ let {this: e, asChild, children, ...props}: SplitterProps = $props();
23
23
 
24
- let [splitterProps, otherProps] = $derived(
24
+ let [splitterProps, localProps] = $derived(
25
25
  createSplitProps<CreateSplitterProps>([
26
26
  'id',
27
27
  'ids',
@@ -34,7 +34,7 @@
34
34
 
35
35
  let splitter = createSplitter(reflect(() => splitterProps));
36
36
 
37
- let mergedProps = $derived(mergeProps(otherProps, splitter.getRootProps()));
37
+ let mergedProps = $derived(mergeProps(localProps, splitter.getRootProps()));
38
38
 
39
39
  setSplitterContext(splitter);
40
40
  </script>
@@ -42,7 +42,7 @@
42
42
  {#if asChild}
43
43
  {@render asChild(mergedProps, splitter)}
44
44
  {:else}
45
- <div {...mergedProps}>
45
+ <div bind:this={e} {...mergedProps}>
46
46
  {@render children?.(splitter)}
47
47
  </div>
48
48
  {/if}
@@ -9,7 +9,12 @@
9
9
  import {mergeProps} from '../merge-props.js';
10
10
  import {getStepsContext} from './context.svelte.js';
11
11
 
12
- let {asChild, children, ...props}: StepsCompletedContentProps = $props();
12
+ let {
13
+ this: e,
14
+ asChild,
15
+ children,
16
+ ...props
17
+ }: StepsCompletedContentProps = $props();
13
18
 
14
19
  let steps = getStepsContext();
15
20
 
@@ -26,7 +31,7 @@
26
31
  {#if asChild}
27
32
  {@render asChild(mergedProps)}
28
33
  {:else}
29
- <div {...mergedProps}>
34
+ <div bind:this={e} {...mergedProps}>
30
35
  {@render children?.()}
31
36
  </div>
32
37
  {/if}
@@ -10,7 +10,13 @@
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {getStepsContext} from './context.svelte.js';
12
12
 
13
- let {index, asChild, children, ...props}: StepsContentProps = $props();
13
+ let {
14
+ this: e,
15
+ index,
16
+ asChild,
17
+ children,
18
+ ...props
19
+ }: StepsContentProps = $props();
14
20
 
15
21
  let steps = getStepsContext();
16
22
 
@@ -20,7 +26,7 @@
20
26
  {#if asChild}
21
27
  {@render asChild(mergedProps)}
22
28
  {:else}
23
- <div {...mergedProps}>
29
+ <div bind:this={e} {...mergedProps}>
24
30
  {@render children?.()}
25
31
  </div>
26
32
  {/if}
@@ -1,4 +1,4 @@
1
1
  import type { ItemProps } from '@zag-js/steps';
2
2
  import type { CreateStepsReturn } from './create-steps.svelte.js';
3
- export declare const getStepsContext: () => CreateStepsReturn, setStepsContext: (context: CreateStepsReturn | (() => CreateStepsReturn)) => void;
4
- export declare const getStepsItemPropsContext: () => ItemProps, setStepsItemPropsContext: (context: ItemProps | (() => ItemProps)) => void;
3
+ export declare const getStepsContext: () => CreateStepsReturn, setStepsContext: (context: CreateStepsReturn | (() => CreateStepsReturn)) => CreateStepsReturn;
4
+ export declare const getStepsItemPropsContext: () => ItemProps, setStepsItemPropsContext: (context: ItemProps | (() => ItemProps)) => ItemProps;
@@ -7,13 +7,12 @@ export function createSteps(props) {
7
7
  const locale = getLocaleContext();
8
8
  const environment = getEnvironmentContext();
9
9
  const id = uid();
10
- const context = $derived(reflect(() => ({
10
+ const context = reflect(() => ({
11
11
  ...props,
12
12
  id: props.id ?? id,
13
13
  dir: locale?.dir,
14
14
  getRootNode: environment?.getRootNode,
15
- })));
15
+ }));
16
16
  const [state, send] = useMachine(steps.machine(context), { context });
17
- const api = $derived(reflect(() => steps.connect(state, send, normalizeProps)));
18
- return api;
17
+ return reflect(() => steps.connect(state, send, normalizeProps));
19
18
  }
@@ -8,7 +8,7 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getStepsContext, getStepsItemPropsContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: StepsIndicatorProps = $props();
11
+ let {this: e, asChild, children, ...props}: StepsIndicatorProps = $props();
12
12
 
13
13
  let steps = getStepsContext();
14
14
 
@@ -22,7 +22,7 @@
22
22
  {#if asChild}
23
23
  {@render asChild(mergedProps)}
24
24
  {:else}
25
- <span {...mergedProps}>
25
+ <span bind:this={e} {...mergedProps}>
26
26
  {@render children?.()}
27
27
  </span>
28
28
  {/if}
@@ -11,18 +11,18 @@
11
11
  import {createSplitProps} from '@zag-js/utils';
12
12
  import {getStepsContext, setStepsItemPropsContext} from './context.svelte.js';
13
13
 
14
- let {asChild, children, ...props}: StepsItemProps = $props();
14
+ let {this: e, asChild, children, ...props}: StepsItemProps = $props();
15
15
 
16
16
  let steps = getStepsContext();
17
17
 
18
- let [itemProps, otherProps] = $derived(
18
+ let [itemProps, localProps] = $derived(
19
19
  createSplitProps<ItemProps>(['index'])(props),
20
20
  );
21
21
 
22
22
  let itemState = $derived(steps.getItemState(itemProps));
23
23
 
24
24
  let mergedProps = $derived(
25
- mergeProps(otherProps, steps.getItemProps(itemProps)),
25
+ mergeProps(localProps, steps.getItemProps(itemProps)),
26
26
  );
27
27
 
28
28
  setStepsItemPropsContext(() => itemProps);
@@ -31,7 +31,7 @@
31
31
  {#if asChild}
32
32
  {@render asChild(mergedProps, itemState)}
33
33
  {:else}
34
- <div {...mergedProps}>
34
+ <div bind:this={e} {...mergedProps}>
35
35
  {@render children?.(itemState)}
36
36
  </div>
37
37
  {/if}
@@ -8,7 +8,7 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getStepsContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: StepsListProps = $props();
11
+ let {this: e, asChild, children, ...props}: StepsListProps = $props();
12
12
 
13
13
  let steps = getStepsContext();
14
14
 
@@ -18,7 +18,7 @@
18
18
  {#if asChild}
19
19
  {@render asChild(mergedProps)}
20
20
  {:else}
21
- <div {...mergedProps}>
21
+ <div bind:this={e} {...mergedProps}>
22
22
  {@render children?.()}
23
23
  </div>
24
24
  {/if}
@@ -9,7 +9,7 @@
9
9
  import {mergeProps} from '../merge-props.js';
10
10
  import {getStepsContext} from './context.svelte.js';
11
11
 
12
- let {asChild, children, ...props}: StepsNextTriggerProps = $props();
12
+ let {this: e, asChild, children, ...props}: StepsNextTriggerProps = $props();
13
13
 
14
14
  let steps = getStepsContext();
15
15
 
@@ -19,7 +19,7 @@
19
19
  {#if asChild}
20
20
  {@render asChild(mergedProps)}
21
21
  {:else}
22
- <button type="button" {...mergedProps}>
22
+ <button bind:this={e} type="button" {...mergedProps}>
23
23
  {@render children?.()}
24
24
  </button>
25
25
  {/if}
@@ -9,7 +9,7 @@
9
9
  import {mergeProps} from '../merge-props.js';
10
10
  import {getStepsContext} from './context.svelte.js';
11
11
 
12
- let {asChild, children, ...props}: StepsPrevTriggerProps = $props();
12
+ let {this: e, asChild, children, ...props}: StepsPrevTriggerProps = $props();
13
13
 
14
14
  let steps = getStepsContext();
15
15
 
@@ -19,7 +19,7 @@
19
19
  {#if asChild}
20
20
  {@render asChild(mergedProps)}
21
21
  {:else}
22
- <button type="button" {...mergedProps}>
22
+ <button bind:this={e} type="button" {...mergedProps}>
23
23
  {@render children?.()}
24
24
  </button>
25
25
  {/if}
@@ -8,7 +8,7 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getStepsContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: StepsProgressProps = $props();
11
+ let {this: e, asChild, children, ...props}: StepsProgressProps = $props();
12
12
 
13
13
  let steps = getStepsContext();
14
14
 
@@ -18,7 +18,7 @@
18
18
  {#if asChild}
19
19
  {@render asChild(mergedProps)}
20
20
  {:else}
21
- <div {...mergedProps}>
21
+ <div bind:this={e} {...mergedProps}>
22
22
  {@render children?.()}
23
23
  </div>
24
24
  {/if}
@@ -19,9 +19,9 @@
19
19
  import {setStepsContext} from './context.svelte.js';
20
20
  import {createSteps} from './create-steps.svelte.js';
21
21
 
22
- let {asChild, children, ...props}: StepsProps = $props();
22
+ let {this: e, asChild, children, ...props}: StepsProps = $props();
23
23
 
24
- let [stepsProps, otherProps] = $derived(
24
+ let [stepsProps, localProps] = $derived(
25
25
  createSplitProps<CreateStepsProps>([
26
26
  'id',
27
27
  'ids',
@@ -36,7 +36,7 @@
36
36
 
37
37
  let steps = createSteps(reflect(() => stepsProps));
38
38
 
39
- let mergedProps = $derived(mergeProps(otherProps, steps.getRootProps()));
39
+ let mergedProps = $derived(mergeProps(localProps, steps.getRootProps()));
40
40
 
41
41
  setStepsContext(steps);
42
42
  </script>
@@ -44,7 +44,7 @@
44
44
  {#if asChild}
45
45
  {@render asChild(mergedProps, steps)}
46
46
  {:else}
47
- <div {...mergedProps}>
47
+ <div bind:this={e} {...mergedProps}>
48
48
  {@render children?.(steps)}
49
49
  </div>
50
50
  {/if}
@@ -8,7 +8,7 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getStepsContext, getStepsItemPropsContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: StepsSeparatorProps = $props();
11
+ let {this: e, asChild, children, ...props}: StepsSeparatorProps = $props();
12
12
 
13
13
  let steps = getStepsContext();
14
14
  let itemProps = getStepsItemPropsContext();
@@ -21,7 +21,7 @@
21
21
  {#if asChild}
22
22
  {@render asChild(mergedProps)}
23
23
  {:else}
24
- <span {...mergedProps}>
24
+ <span bind:this={e} {...mergedProps}>
25
25
  {@render children?.()}
26
26
  </span>
27
27
  {/if}
@@ -8,7 +8,7 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getStepsContext, getStepsItemPropsContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: StepsTriggerProps = $props();
11
+ let {this: e, asChild, children, ...props}: StepsTriggerProps = $props();
12
12
 
13
13
  let steps = getStepsContext();
14
14
  let itemProps = getStepsItemPropsContext();
@@ -21,7 +21,7 @@
21
21
  {#if asChild}
22
22
  {@render asChild(mergedProps)}
23
23
  {:else}
24
- <button type="button" {...mergedProps}>
24
+ <button bind:this={e} type="button" {...mergedProps}>
25
25
  {@render children?.()}
26
26
  </button>
27
27
  {/if}
@@ -1,2 +1,2 @@
1
1
  import type { CreateSwitchReturn } from './create-switch.svelte.js';
2
- export declare const getSwitchContext: () => CreateSwitchReturn, setSwitchContext: (context: CreateSwitchReturn | (() => CreateSwitchReturn)) => void;
2
+ export declare const getSwitchContext: () => CreateSwitchReturn, setSwitchContext: (context: CreateSwitchReturn | (() => CreateSwitchReturn)) => CreateSwitchReturn;
@@ -8,17 +8,17 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getSwitchContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: SwitchControlProps = $props();
11
+ let {this: e, asChild, children, ...props}: SwitchControlProps = $props();
12
12
 
13
- let switch$ = getSwitchContext();
13
+ let switch_ = getSwitchContext();
14
14
 
15
- let mergedProps = $derived(mergeProps(props, switch$.getControlProps()));
15
+ let mergedProps = $derived(mergeProps(props, switch_.getControlProps()));
16
16
  </script>
17
17
 
18
18
  {#if asChild}
19
19
  {@render asChild(mergedProps)}
20
20
  {:else}
21
- <div {...mergedProps}>
21
+ <div bind:this={e} {...mergedProps}>
22
22
  {@render children?.()}
23
23
  </div>
24
24
  {/if}
@@ -1,7 +1,7 @@
1
- import * as switch$ from '@zag-js/switch';
2
- export interface CreateSwitchProps extends Omit<switch$.Context, 'id' | 'dir' | 'getRootNode'> {
1
+ import * as switch_ from '@zag-js/switch';
2
+ export interface CreateSwitchProps extends Omit<switch_.Context, 'id' | 'dir' | 'getRootNode'> {
3
3
  id?: string | null;
4
4
  }
5
- export interface CreateSwitchReturn extends switch$.Api {
5
+ export interface CreateSwitchReturn extends switch_.Api {
6
6
  }
7
7
  export declare function createSwitch(props: CreateSwitchProps): any;
@@ -2,14 +2,14 @@ import { getEnvironmentContext } from '../environment-provider/context.svelte.js
2
2
  import { getFieldContext } from '../field/context.svelte.js';
3
3
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
4
4
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
- import * as switch$ from '@zag-js/switch';
5
+ import * as switch_ from '@zag-js/switch';
6
6
  import { uid } from 'uid';
7
7
  export function createSwitch(props) {
8
8
  const field = getFieldContext();
9
9
  const locale = getLocaleContext();
10
10
  const environment = getEnvironmentContext();
11
11
  const id = uid();
12
- const context = $derived(reflect(() => ({
12
+ const context = reflect(() => ({
13
13
  ids: {
14
14
  label: field?.ids.label,
15
15
  hiddenInput: field?.ids.control,
@@ -22,10 +22,10 @@ export function createSwitch(props) {
22
22
  id: props.id ?? id,
23
23
  dir: locale?.dir,
24
24
  getRootNode: environment?.getRootNode,
25
- })));
26
- const [state, send] = useMachine(switch$.machine(context), { context });
27
- const api = $derived(reflect(() => {
28
- const o = switch$.connect(state, send, normalizeProps);
25
+ }));
26
+ const [state, send] = useMachine(switch_.machine(context), { context });
27
+ return reflect(() => {
28
+ const o = switch_.connect(state, send, normalizeProps);
29
29
  return {
30
30
  ...o,
31
31
  getHiddenInputProps() {
@@ -35,6 +35,5 @@ export function createSwitch(props) {
35
35
  };
36
36
  },
37
37
  };
38
- }));
39
- return api;
38
+ });
40
39
  }
@@ -9,15 +9,15 @@
9
9
  import {mergeProps} from '../merge-props.js';
10
10
  import {getSwitchContext} from './context.svelte.js';
11
11
 
12
- let {asChild, ...props}: SwitchHiddenInputProps = $props();
12
+ let {this: e, asChild, ...props}: SwitchHiddenInputProps = $props();
13
13
 
14
- let switch$ = getSwitchContext();
14
+ let switch_ = getSwitchContext();
15
15
 
16
- let mergedProps = $derived(mergeProps(props, switch$.getHiddenInputProps()));
16
+ let mergedProps = $derived(mergeProps(props, switch_.getHiddenInputProps()));
17
17
  </script>
18
18
 
19
19
  {#if asChild}
20
20
  {@render asChild(mergedProps)}
21
21
  {:else}
22
- <input {...mergedProps} />
22
+ <input bind:this={e} {...mergedProps} />
23
23
  {/if}
@@ -8,17 +8,17 @@
8
8
  import {mergeProps} from '../merge-props.js';
9
9
  import {getSwitchContext} from './context.svelte.js';
10
10
 
11
- let {asChild, children, ...props}: SwitchLabelProps = $props();
11
+ let {this: e, asChild, children, ...props}: SwitchLabelProps = $props();
12
12
 
13
- let switch$ = getSwitchContext();
13
+ let switch_ = getSwitchContext();
14
14
 
15
- let mergedProps = $derived(mergeProps(props, switch$.getLabelProps()));
15
+ let mergedProps = $derived(mergeProps(props, switch_.getLabelProps()));
16
16
  </script>
17
17
 
18
18
  {#if asChild}
19
19
  {@render asChild(mergedProps)}
20
20
  {:else}
21
- <span {...mergedProps}>
21
+ <span bind:this={e} {...mergedProps}>
22
22
  {@render children?.()}
23
23
  </span>
24
24
  {/if}
@@ -19,9 +19,9 @@
19
19
  import {setSwitchContext} from './context.svelte.js';
20
20
  import {createSwitch} from './create-switch.svelte.js';
21
21
 
22
- let {asChild, children, ...props}: SwitchProps = $props();
22
+ let {this: e, asChild, children, ...props}: SwitchProps = $props();
23
23
 
24
- let [switchProps, otherProps] = $derived(
24
+ let [switchProps, localProps] = $derived(
25
25
  createSplitProps<CreateSwitchProps>([
26
26
  'id',
27
27
  'ids',
@@ -38,17 +38,17 @@
38
38
  ])(props),
39
39
  );
40
40
 
41
- let switch$ = createSwitch(reflect(() => switchProps));
41
+ let switch_ = createSwitch(reflect(() => switchProps));
42
42
 
43
- let mergedProps = $derived(mergeProps(otherProps, switch$.getRootProps()));
43
+ let mergedProps = $derived(mergeProps(localProps, switch_.getRootProps()));
44
44
 
45
- setSwitchContext(switch$);
45
+ setSwitchContext(switch_);
46
46
  </script>
47
47
 
48
48
  {#if asChild}
49
- {@render asChild(mergedProps, switch$)}
49
+ {@render asChild(mergedProps, switch_)}
50
50
  {:else}
51
- <label {...mergedProps}>
52
- {@render children?.(switch$)}
51
+ <label bind:this={e} {...mergedProps}>
52
+ {@render children?.(switch_)}
53
53
  </label>
54
54
  {/if}