ui-ingredients 0.0.37 → 0.0.39

Sign up to get free protection for your applications and to get access to all the features.
Files changed (535) hide show
  1. package/README.md +11 -0
  2. package/dist/accordion/context.svelte.d.ts +2 -3
  3. package/dist/accordion/context.svelte.js +3 -3
  4. package/dist/accordion/create-accordion.svelte.js +5 -3
  5. package/dist/accordion/index.d.ts +1 -0
  6. package/dist/accordion/index.js +1 -0
  7. package/dist/accordion/item-content.svelte +4 -4
  8. package/dist/accordion/item-indicator.svelte +4 -4
  9. package/dist/accordion/item-trigger.svelte +4 -4
  10. package/dist/accordion/item.svelte +4 -4
  11. package/dist/accordion/root.svelte +2 -2
  12. package/dist/avatar/context.svelte.d.ts +1 -2
  13. package/dist/avatar/context.svelte.js +2 -2
  14. package/dist/avatar/create-avatar.svelte.js +5 -3
  15. package/dist/avatar/fallback.svelte +2 -2
  16. package/dist/avatar/image.svelte +2 -2
  17. package/dist/avatar/index.d.ts +1 -0
  18. package/dist/avatar/index.js +1 -0
  19. package/dist/avatar/root.svelte +2 -2
  20. package/dist/carousel/context.svelte.d.ts +1 -2
  21. package/dist/carousel/context.svelte.js +2 -2
  22. package/dist/carousel/create-carousel.svelte.js +5 -3
  23. package/dist/carousel/index.d.ts +1 -0
  24. package/dist/carousel/index.js +1 -0
  25. package/dist/carousel/indicator-group.svelte +2 -2
  26. package/dist/carousel/indicator.svelte +2 -2
  27. package/dist/carousel/item-group.svelte +2 -2
  28. package/dist/carousel/item.svelte +2 -2
  29. package/dist/carousel/next-trigger.svelte +2 -2
  30. package/dist/carousel/prev-trigger.svelte +2 -2
  31. package/dist/carousel/root.svelte +2 -2
  32. package/dist/carousel/viewport.svelte +2 -2
  33. package/dist/checkbox/context.svelte.d.ts +1 -2
  34. package/dist/checkbox/context.svelte.js +2 -2
  35. package/dist/checkbox/control.svelte +2 -2
  36. package/dist/checkbox/create-checkbox.svelte.js +5 -3
  37. package/dist/checkbox/hidden-input.svelte +2 -2
  38. package/dist/checkbox/index.d.ts +1 -0
  39. package/dist/checkbox/index.js +1 -0
  40. package/dist/checkbox/indicator.svelte +2 -2
  41. package/dist/checkbox/label.svelte +2 -2
  42. package/dist/checkbox/root.svelte +2 -2
  43. package/dist/clipboard/context.svelte.d.ts +1 -2
  44. package/dist/clipboard/context.svelte.js +2 -2
  45. package/dist/clipboard/control.svelte +2 -2
  46. package/dist/clipboard/create-clipboard.svelte.js +5 -3
  47. package/dist/clipboard/index.d.ts +1 -0
  48. package/dist/clipboard/index.js +1 -0
  49. package/dist/clipboard/indicator.svelte +2 -2
  50. package/dist/clipboard/input.svelte +2 -2
  51. package/dist/clipboard/label.svelte +2 -2
  52. package/dist/clipboard/root.svelte +2 -2
  53. package/dist/clipboard/trigger.svelte +2 -2
  54. package/dist/collapsible/content.svelte +2 -2
  55. package/dist/collapsible/context.svelte.d.ts +1 -2
  56. package/dist/collapsible/context.svelte.js +2 -2
  57. package/dist/collapsible/create-collapsible.svelte.js +5 -3
  58. package/dist/collapsible/index.d.ts +1 -0
  59. package/dist/collapsible/index.js +1 -0
  60. package/dist/collapsible/root.svelte +2 -2
  61. package/dist/collapsible/trigger.svelte +2 -2
  62. package/dist/color-picker/area-background.svelte +4 -4
  63. package/dist/color-picker/area-thumb.svelte +4 -4
  64. package/dist/color-picker/area.svelte +4 -4
  65. package/dist/color-picker/channel-input.svelte +2 -2
  66. package/dist/color-picker/channel-slider-label.svelte +4 -4
  67. package/dist/color-picker/channel-slider-thumb.svelte +4 -4
  68. package/dist/color-picker/channel-slider-track.svelte +4 -4
  69. package/dist/color-picker/channel-slider-value-text.svelte +6 -6
  70. package/dist/color-picker/channel-slider.svelte +4 -4
  71. package/dist/color-picker/content.svelte +2 -2
  72. package/dist/color-picker/context.svelte.d.ts +5 -6
  73. package/dist/color-picker/context.svelte.js +6 -6
  74. package/dist/color-picker/control.svelte +2 -2
  75. package/dist/color-picker/create-color-picker.svelte.js +5 -3
  76. package/dist/color-picker/eye-dropper-trigger.svelte +2 -2
  77. package/dist/color-picker/format-select.svelte +2 -2
  78. package/dist/color-picker/format-trigger.svelte +2 -2
  79. package/dist/color-picker/hidden-input.svelte +2 -2
  80. package/dist/color-picker/index.d.ts +1 -0
  81. package/dist/color-picker/index.js +1 -0
  82. package/dist/color-picker/label.svelte +2 -2
  83. package/dist/color-picker/positioner.svelte +2 -2
  84. package/dist/color-picker/root.svelte +34 -49
  85. package/dist/color-picker/swatch-group.svelte +2 -2
  86. package/dist/color-picker/swatch-indicator.svelte +4 -4
  87. package/dist/color-picker/swatch-trigger.svelte +4 -4
  88. package/dist/color-picker/swatch.svelte +4 -4
  89. package/dist/color-picker/transparency-grid.svelte +2 -2
  90. package/dist/color-picker/trigger.svelte +2 -2
  91. package/dist/color-picker/value-text.svelte +2 -2
  92. package/dist/combobox/clear-trigger.svelte +2 -2
  93. package/dist/combobox/content.svelte +2 -2
  94. package/dist/combobox/context.svelte.d.ts +3 -4
  95. package/dist/combobox/context.svelte.js +4 -4
  96. package/dist/combobox/control.svelte +2 -2
  97. package/dist/combobox/create-combobox.svelte.d.ts +3 -5
  98. package/dist/combobox/create-combobox.svelte.js +16 -13
  99. package/dist/combobox/input.svelte +2 -2
  100. package/dist/combobox/item-group-label.svelte +4 -4
  101. package/dist/combobox/item-group.svelte +4 -4
  102. package/dist/combobox/item-indicator.svelte +6 -3
  103. package/dist/combobox/item-text.svelte +6 -3
  104. package/dist/combobox/item.svelte +6 -3
  105. package/dist/combobox/label.svelte +2 -2
  106. package/dist/combobox/list.svelte +2 -2
  107. package/dist/combobox/positioner.svelte +2 -2
  108. package/dist/combobox/root.svelte +2 -2
  109. package/dist/combobox/trigger.svelte +2 -2
  110. package/dist/create-context.svelte.d.ts +5 -0
  111. package/dist/{context.svelte.js → create-context.svelte.js} +8 -13
  112. package/dist/date-picker/clear-trigger.svelte +2 -2
  113. package/dist/date-picker/content.svelte +2 -2
  114. package/dist/date-picker/context.svelte.d.ts +5 -6
  115. package/dist/date-picker/context.svelte.js +6 -6
  116. package/dist/date-picker/control.svelte +2 -2
  117. package/dist/date-picker/create-date-picker.svelte.js +5 -3
  118. package/dist/date-picker/day-table-cell-trigger.svelte +4 -4
  119. package/dist/date-picker/day-table-cell.svelte +4 -4
  120. package/dist/date-picker/index.d.ts +1 -0
  121. package/dist/date-picker/index.js +1 -0
  122. package/dist/date-picker/input.svelte +2 -2
  123. package/dist/date-picker/label.svelte +2 -2
  124. package/dist/date-picker/month-select.svelte +2 -2
  125. package/dist/date-picker/month-table-cell-trigger.svelte +4 -4
  126. package/dist/date-picker/month-table-cell.svelte +4 -4
  127. package/dist/date-picker/next-trigger.svelte +4 -4
  128. package/dist/date-picker/positioner.svelte +2 -2
  129. package/dist/date-picker/preset-trigger.svelte +2 -2
  130. package/dist/date-picker/prev-trigger.svelte +4 -4
  131. package/dist/date-picker/range-text.svelte +2 -2
  132. package/dist/date-picker/root.svelte +2 -2
  133. package/dist/date-picker/table-body.svelte +4 -4
  134. package/dist/date-picker/table-head.svelte +4 -4
  135. package/dist/date-picker/table-header.svelte +4 -4
  136. package/dist/date-picker/table-row.svelte +4 -4
  137. package/dist/date-picker/table.svelte +6 -6
  138. package/dist/date-picker/trigger.svelte +2 -2
  139. package/dist/date-picker/view-control.svelte +4 -4
  140. package/dist/date-picker/view-trigger.svelte +4 -4
  141. package/dist/date-picker/view.svelte +4 -4
  142. package/dist/date-picker/year-select.svelte +2 -2
  143. package/dist/date-picker/year-table-cell-trigger.svelte +4 -4
  144. package/dist/date-picker/year-table-cell.svelte +4 -4
  145. package/dist/dialog/backdrop.svelte +2 -2
  146. package/dist/dialog/close-trigger.svelte +2 -2
  147. package/dist/dialog/content.svelte +2 -2
  148. package/dist/dialog/context.svelte.d.ts +1 -2
  149. package/dist/dialog/context.svelte.js +2 -2
  150. package/dist/dialog/create-dialog.svelte.js +5 -3
  151. package/dist/dialog/description.svelte +2 -2
  152. package/dist/dialog/index.d.ts +1 -0
  153. package/dist/dialog/index.js +1 -0
  154. package/dist/dialog/positioner.svelte +2 -2
  155. package/dist/dialog/root.svelte +2 -2
  156. package/dist/dialog/title.svelte +2 -2
  157. package/dist/dialog/trigger.svelte +2 -2
  158. package/dist/editable/area.svelte +2 -2
  159. package/dist/editable/cancel-trigger.svelte +2 -2
  160. package/dist/editable/context.svelte.d.ts +1 -2
  161. package/dist/editable/context.svelte.js +2 -2
  162. package/dist/editable/control.svelte +2 -2
  163. package/dist/editable/create-editable.svelte.js +5 -3
  164. package/dist/editable/edit-trigger.svelte +2 -2
  165. package/dist/editable/index.d.ts +1 -0
  166. package/dist/editable/index.js +1 -0
  167. package/dist/editable/input.svelte +2 -2
  168. package/dist/editable/label.svelte +2 -2
  169. package/dist/editable/preview.svelte +2 -2
  170. package/dist/editable/root.svelte +2 -2
  171. package/dist/editable/submit-trigger.svelte +2 -2
  172. package/dist/environment-provider/context.svelte.d.ts +1 -3
  173. package/dist/environment-provider/context.svelte.js +2 -3
  174. package/dist/environment-provider/root.svelte +2 -2
  175. package/dist/field/context.svelte.d.ts +1 -3
  176. package/dist/field/context.svelte.js +2 -3
  177. package/dist/field/error-text.svelte +2 -2
  178. package/dist/field/helper-text.svelte +2 -2
  179. package/dist/field/index.d.ts +3 -2
  180. package/dist/field/index.js +2 -1
  181. package/dist/field/input.svelte +2 -2
  182. package/dist/field/label.svelte +2 -2
  183. package/dist/field/root.svelte +14 -11
  184. package/dist/field/select.svelte +2 -2
  185. package/dist/field/textarea.svelte +2 -2
  186. package/dist/file-upload/context.svelte.d.ts +2 -3
  187. package/dist/file-upload/context.svelte.js +3 -3
  188. package/dist/file-upload/create-file-upload.svelte.js +5 -3
  189. package/dist/file-upload/dropzone.svelte +2 -2
  190. package/dist/file-upload/hidden-input.svelte +2 -2
  191. package/dist/file-upload/index.d.ts +1 -0
  192. package/dist/file-upload/index.js +1 -0
  193. package/dist/file-upload/item-delete-trigger.svelte +4 -4
  194. package/dist/file-upload/item-group.svelte +2 -2
  195. package/dist/file-upload/item-name.svelte +4 -4
  196. package/dist/file-upload/item-preview-image.svelte +4 -4
  197. package/dist/file-upload/item-preview.svelte +4 -4
  198. package/dist/file-upload/item-size-text.svelte +4 -4
  199. package/dist/file-upload/item.svelte +4 -4
  200. package/dist/file-upload/label.svelte +2 -2
  201. package/dist/file-upload/root.svelte +2 -2
  202. package/dist/file-upload/trigger.svelte +2 -2
  203. package/dist/hover-card/arrow-tip.svelte +2 -2
  204. package/dist/hover-card/arrow.svelte +2 -2
  205. package/dist/hover-card/content.svelte +2 -2
  206. package/dist/hover-card/context.svelte.d.ts +1 -2
  207. package/dist/hover-card/context.svelte.js +2 -2
  208. package/dist/hover-card/create-hover-card.svelte.js +5 -3
  209. package/dist/hover-card/index.d.ts +1 -0
  210. package/dist/hover-card/index.js +1 -0
  211. package/dist/hover-card/positioner.svelte +2 -2
  212. package/dist/hover-card/root.svelte +2 -2
  213. package/dist/hover-card/trigger.svelte +2 -2
  214. package/dist/locale-provider/context.svelte.d.ts +1 -3
  215. package/dist/locale-provider/context.svelte.js +2 -3
  216. package/dist/locale-provider/root.svelte +2 -2
  217. package/dist/menu/arrow-tip.svelte +2 -2
  218. package/dist/menu/arrow.svelte +2 -2
  219. package/dist/menu/content.svelte +2 -2
  220. package/dist/menu/context-trigger.svelte +2 -2
  221. package/dist/menu/context.svelte.d.ts +3 -4
  222. package/dist/menu/context.svelte.js +4 -4
  223. package/dist/menu/create-menu.svelte.js +5 -3
  224. package/dist/menu/index.d.ts +1 -0
  225. package/dist/menu/index.js +1 -0
  226. package/dist/menu/indicator.svelte +2 -2
  227. package/dist/menu/item-group-label.svelte +6 -3
  228. package/dist/menu/item-group.svelte +6 -3
  229. package/dist/menu/item.svelte +2 -2
  230. package/dist/menu/option-item-indicator.svelte +6 -3
  231. package/dist/menu/option-item-text.svelte +6 -3
  232. package/dist/menu/option-item.svelte +6 -3
  233. package/dist/menu/positioner.svelte +2 -2
  234. package/dist/menu/root.svelte +2 -2
  235. package/dist/menu/separator.svelte +2 -2
  236. package/dist/menu/trigger-item.svelte +2 -2
  237. package/dist/menu/trigger.svelte +2 -2
  238. package/dist/number-input/context.svelte.d.ts +1 -2
  239. package/dist/number-input/context.svelte.js +2 -2
  240. package/dist/number-input/control.svelte +2 -2
  241. package/dist/number-input/create-number-input.svelte.js +5 -3
  242. package/dist/number-input/decrement-trigger.svelte +2 -2
  243. package/dist/number-input/increment-trigger.svelte +2 -2
  244. package/dist/number-input/index.d.ts +1 -0
  245. package/dist/number-input/index.js +1 -0
  246. package/dist/number-input/input.svelte +2 -2
  247. package/dist/number-input/label.svelte +2 -2
  248. package/dist/number-input/root.svelte +2 -2
  249. package/dist/number-input/scrubber.svelte +2 -2
  250. package/dist/pagination/context.svelte.d.ts +1 -2
  251. package/dist/pagination/context.svelte.js +2 -2
  252. package/dist/pagination/create-pagination.svelte.js +5 -3
  253. package/dist/pagination/ellipsis.svelte +2 -2
  254. package/dist/pagination/index.d.ts +1 -0
  255. package/dist/pagination/index.js +1 -0
  256. package/dist/pagination/item.svelte +2 -2
  257. package/dist/pagination/next-trigger.svelte +2 -2
  258. package/dist/pagination/prev-trigger.svelte +2 -2
  259. package/dist/pagination/root.svelte +2 -2
  260. package/dist/pin-input/clear-trigger.svelte +2 -2
  261. package/dist/pin-input/context.svelte.d.ts +1 -2
  262. package/dist/pin-input/context.svelte.js +2 -2
  263. package/dist/pin-input/create-pin-input.svelte.js +5 -3
  264. package/dist/pin-input/hidden-input.svelte +2 -2
  265. package/dist/pin-input/index.d.ts +1 -0
  266. package/dist/pin-input/index.js +1 -0
  267. package/dist/pin-input/input.svelte +2 -2
  268. package/dist/pin-input/label.svelte +2 -2
  269. package/dist/pin-input/root.svelte +2 -2
  270. package/dist/popover/arrow-tip.svelte +2 -2
  271. package/dist/popover/arrow.svelte +2 -2
  272. package/dist/popover/close-trigger.svelte +2 -2
  273. package/dist/popover/content.svelte +2 -2
  274. package/dist/popover/context.svelte.d.ts +1 -2
  275. package/dist/popover/context.svelte.js +2 -2
  276. package/dist/popover/create-popover.svelte.js +5 -3
  277. package/dist/popover/description.svelte +2 -2
  278. package/dist/popover/index.d.ts +2 -0
  279. package/dist/popover/index.js +2 -0
  280. package/dist/popover/popover.d.ts +0 -1
  281. package/dist/popover/popover.js +0 -1
  282. package/dist/popover/positioner.svelte +2 -2
  283. package/dist/popover/root.svelte +2 -2
  284. package/dist/popover/title.svelte +2 -2
  285. package/dist/popover/trigger.svelte +2 -2
  286. package/dist/presence/context.svelte.d.ts +1 -2
  287. package/dist/presence/context.svelte.js +2 -2
  288. package/dist/presence/create-presence.svelte.js +4 -3
  289. package/dist/progress/circle-range.svelte +2 -2
  290. package/dist/progress/circle-track.svelte +2 -2
  291. package/dist/progress/circle.svelte +2 -2
  292. package/dist/progress/context.svelte.d.ts +1 -2
  293. package/dist/progress/context.svelte.js +2 -2
  294. package/dist/progress/create-progress.svelte.js +5 -3
  295. package/dist/progress/index.d.ts +1 -0
  296. package/dist/progress/index.js +1 -0
  297. package/dist/progress/label.svelte +2 -2
  298. package/dist/progress/range.svelte +2 -2
  299. package/dist/progress/root.svelte +2 -2
  300. package/dist/progress/track.svelte +2 -2
  301. package/dist/progress/value-text.svelte +2 -2
  302. package/dist/progress/view.svelte +2 -2
  303. package/dist/qr-code/context.svelte.d.ts +1 -2
  304. package/dist/qr-code/context.svelte.js +2 -2
  305. package/dist/qr-code/create-qr-code.svelte.js +5 -3
  306. package/dist/qr-code/frame.svelte +2 -2
  307. package/dist/qr-code/index.d.ts +1 -0
  308. package/dist/qr-code/index.js +1 -0
  309. package/dist/qr-code/overlay.svelte +2 -2
  310. package/dist/qr-code/pattern.svelte +2 -2
  311. package/dist/qr-code/root.svelte +2 -2
  312. package/dist/radio-group/context.svelte.d.ts +2 -3
  313. package/dist/radio-group/context.svelte.js +3 -3
  314. package/dist/radio-group/create-radio-group.svelte.js +5 -3
  315. package/dist/radio-group/index.d.ts +1 -0
  316. package/dist/radio-group/index.js +1 -0
  317. package/dist/radio-group/indicator.svelte +2 -2
  318. package/dist/radio-group/item-control.svelte +4 -4
  319. package/dist/radio-group/item-hidden-input.svelte +4 -4
  320. package/dist/radio-group/item-text.svelte +4 -4
  321. package/dist/radio-group/item.svelte +5 -4
  322. package/dist/radio-group/label.svelte +2 -2
  323. package/dist/radio-group/root.svelte +2 -2
  324. package/dist/rating-group/context.svelte.d.ts +1 -2
  325. package/dist/rating-group/context.svelte.js +2 -2
  326. package/dist/rating-group/control.svelte +2 -2
  327. package/dist/rating-group/create-rating-group.svelte.js +5 -3
  328. package/dist/rating-group/hidden-input.svelte +2 -2
  329. package/dist/rating-group/index.d.ts +1 -0
  330. package/dist/rating-group/index.js +1 -0
  331. package/dist/rating-group/item.svelte +2 -2
  332. package/dist/rating-group/label.svelte +2 -2
  333. package/dist/rating-group/root.svelte +2 -2
  334. package/dist/segment-group/context.svelte.d.ts +2 -3
  335. package/dist/segment-group/context.svelte.js +3 -3
  336. package/dist/segment-group/create-segment-group.svelte.js +5 -3
  337. package/dist/segment-group/index.d.ts +1 -0
  338. package/dist/segment-group/index.js +1 -0
  339. package/dist/segment-group/indicator.svelte +2 -2
  340. package/dist/segment-group/item-control.svelte +4 -4
  341. package/dist/segment-group/item-hidden-input.svelte +4 -4
  342. package/dist/segment-group/item-text.svelte +4 -4
  343. package/dist/segment-group/item.svelte +4 -4
  344. package/dist/segment-group/label.svelte +2 -2
  345. package/dist/segment-group/root.svelte +2 -2
  346. package/dist/select/clear-trigger.svelte +2 -2
  347. package/dist/select/content.svelte +2 -2
  348. package/dist/select/context.svelte.d.ts +3 -4
  349. package/dist/select/context.svelte.js +4 -4
  350. package/dist/select/control.svelte +2 -2
  351. package/dist/select/create-select.svelte.d.ts +3 -5
  352. package/dist/select/create-select.svelte.js +15 -12
  353. package/dist/select/hidden-select.svelte +2 -2
  354. package/dist/select/index.d.ts +1 -0
  355. package/dist/select/index.js +1 -0
  356. package/dist/select/indicator.svelte +2 -2
  357. package/dist/select/item-group-label.svelte +5 -4
  358. package/dist/select/item-group.svelte +4 -4
  359. package/dist/select/item-indicator.svelte +6 -3
  360. package/dist/select/item-text.svelte +6 -3
  361. package/dist/select/item.svelte +6 -3
  362. package/dist/select/label.svelte +2 -2
  363. package/dist/select/list.svelte +2 -2
  364. package/dist/select/positioner.svelte +2 -2
  365. package/dist/select/root.svelte +2 -2
  366. package/dist/select/trigger.svelte +2 -2
  367. package/dist/select/value-text.svelte +2 -2
  368. package/dist/signature-pad/clear-trigger.svelte +2 -2
  369. package/dist/signature-pad/context.svelte.d.ts +1 -2
  370. package/dist/signature-pad/context.svelte.js +2 -2
  371. package/dist/signature-pad/control.svelte +2 -2
  372. package/dist/signature-pad/create-signature-pad.svelte.js +5 -3
  373. package/dist/signature-pad/current-segment-path.svelte +2 -2
  374. package/dist/signature-pad/guide.svelte +2 -2
  375. package/dist/signature-pad/hidden-input.svelte +2 -2
  376. package/dist/signature-pad/index.d.ts +1 -0
  377. package/dist/signature-pad/index.js +1 -0
  378. package/dist/signature-pad/label.svelte +2 -2
  379. package/dist/signature-pad/root.svelte +2 -2
  380. package/dist/signature-pad/segment-path.svelte +2 -2
  381. package/dist/signature-pad/segment.svelte +2 -2
  382. package/dist/slider/context.svelte.d.ts +2 -3
  383. package/dist/slider/context.svelte.js +3 -3
  384. package/dist/slider/control.svelte +2 -2
  385. package/dist/slider/create-slider.svelte.js +5 -3
  386. package/dist/slider/hidden-input.svelte +6 -3
  387. package/dist/slider/index.d.ts +1 -0
  388. package/dist/slider/index.js +1 -0
  389. package/dist/slider/label.svelte +2 -2
  390. package/dist/slider/marker-group.svelte +2 -2
  391. package/dist/slider/marker.svelte +2 -2
  392. package/dist/slider/range.svelte +2 -2
  393. package/dist/slider/root.svelte +2 -2
  394. package/dist/slider/thumb.svelte +6 -3
  395. package/dist/slider/track.svelte +2 -2
  396. package/dist/slider/value-text.svelte +2 -2
  397. package/dist/splitter/context.svelte.d.ts +1 -2
  398. package/dist/splitter/context.svelte.js +2 -2
  399. package/dist/splitter/create-splitter.svelte.js +3 -2
  400. package/dist/splitter/index.d.ts +1 -0
  401. package/dist/splitter/index.js +1 -0
  402. package/dist/splitter/panel.svelte +2 -2
  403. package/dist/splitter/resize-trigger.svelte +2 -2
  404. package/dist/splitter/root.svelte +2 -2
  405. package/dist/steps/completed-content.svelte +2 -2
  406. package/dist/steps/content.svelte +2 -2
  407. package/dist/steps/context.svelte.d.ts +2 -3
  408. package/dist/steps/context.svelte.js +3 -3
  409. package/dist/steps/create-steps.svelte.js +5 -3
  410. package/dist/steps/index.d.ts +1 -0
  411. package/dist/steps/index.js +1 -0
  412. package/dist/steps/indicator.svelte +3 -3
  413. package/dist/steps/item.svelte +3 -3
  414. package/dist/steps/list.svelte +2 -2
  415. package/dist/steps/next-trigger.svelte +2 -2
  416. package/dist/steps/prev-trigger.svelte +2 -2
  417. package/dist/steps/progress.svelte +2 -2
  418. package/dist/steps/root.svelte +2 -2
  419. package/dist/steps/separator.svelte +3 -3
  420. package/dist/steps/trigger.svelte +3 -3
  421. package/dist/switch/context.svelte.d.ts +1 -2
  422. package/dist/switch/context.svelte.js +2 -2
  423. package/dist/switch/control.svelte +2 -2
  424. package/dist/switch/create-switch.svelte.js +5 -3
  425. package/dist/switch/hidden-input.svelte +2 -2
  426. package/dist/switch/index.d.ts +1 -0
  427. package/dist/switch/index.js +1 -0
  428. package/dist/switch/label.svelte +2 -2
  429. package/dist/switch/root.svelte +2 -2
  430. package/dist/switch/thumb.svelte +2 -2
  431. package/dist/tabs/content.svelte +2 -2
  432. package/dist/tabs/context.svelte.d.ts +1 -2
  433. package/dist/tabs/context.svelte.js +2 -2
  434. package/dist/tabs/create-tabs.svelte.js +5 -3
  435. package/dist/tabs/index.d.ts +1 -0
  436. package/dist/tabs/index.js +1 -0
  437. package/dist/tabs/list.svelte +2 -2
  438. package/dist/tabs/root.svelte +2 -2
  439. package/dist/tabs/trigger.svelte +2 -2
  440. package/dist/tags-input/clear-trigger.svelte +2 -2
  441. package/dist/tags-input/context.svelte.d.ts +2 -3
  442. package/dist/tags-input/context.svelte.js +3 -3
  443. package/dist/tags-input/control.svelte +2 -2
  444. package/dist/tags-input/create-tags-input.svelte.js +5 -3
  445. package/dist/tags-input/hidden-input.svelte +2 -2
  446. package/dist/tags-input/index.d.ts +1 -0
  447. package/dist/tags-input/index.js +1 -0
  448. package/dist/tags-input/input.svelte +2 -2
  449. package/dist/tags-input/item-delete-trigger.svelte +4 -4
  450. package/dist/tags-input/item-input.svelte +4 -4
  451. package/dist/tags-input/item-preview.svelte +4 -4
  452. package/dist/tags-input/item-text.svelte +4 -4
  453. package/dist/tags-input/item.svelte +4 -4
  454. package/dist/tags-input/label.svelte +2 -2
  455. package/dist/tags-input/root.svelte +2 -2
  456. package/dist/time-picker/clear-trigger.svelte +2 -2
  457. package/dist/time-picker/column.svelte +2 -2
  458. package/dist/time-picker/content.svelte +2 -2
  459. package/dist/time-picker/context.svelte.d.ts +1 -2
  460. package/dist/time-picker/context.svelte.js +2 -2
  461. package/dist/time-picker/control.svelte +2 -2
  462. package/dist/time-picker/create-time-picker.svelte.js +5 -3
  463. package/dist/time-picker/hour-cell.svelte +2 -2
  464. package/dist/time-picker/index.d.ts +1 -0
  465. package/dist/time-picker/index.js +1 -0
  466. package/dist/time-picker/input.svelte +2 -2
  467. package/dist/time-picker/label.svelte +2 -2
  468. package/dist/time-picker/minute-cell.svelte +2 -2
  469. package/dist/time-picker/period-cell.svelte +2 -2
  470. package/dist/time-picker/positioner.svelte +2 -2
  471. package/dist/time-picker/root.svelte +2 -2
  472. package/dist/time-picker/second-cell.svelte +2 -2
  473. package/dist/time-picker/spacer.svelte +2 -2
  474. package/dist/time-picker/trigger.svelte +2 -2
  475. package/dist/timer/action-trigger.svelte +2 -2
  476. package/dist/timer/context.svelte.d.ts +2 -3
  477. package/dist/timer/context.svelte.js +3 -3
  478. package/dist/timer/create-timer.svelte.js +5 -3
  479. package/dist/timer/index.d.ts +1 -0
  480. package/dist/timer/index.js +1 -0
  481. package/dist/timer/item-label.svelte +3 -3
  482. package/dist/timer/item-value.svelte +3 -3
  483. package/dist/timer/item.svelte +3 -3
  484. package/dist/timer/root.svelte +2 -2
  485. package/dist/timer/separator.svelte +2 -2
  486. package/dist/toast/action-trigger.svelte +2 -2
  487. package/dist/toast/actor.svelte +2 -2
  488. package/dist/toast/close-trigger.svelte +2 -2
  489. package/dist/toast/context.svelte.d.ts +1 -2
  490. package/dist/toast/context.svelte.js +2 -2
  491. package/dist/toast/create-toaster.svelte.js +2 -1
  492. package/dist/toast/description.svelte +2 -2
  493. package/dist/toast/ghost-after.svelte +2 -2
  494. package/dist/toast/ghost-before.svelte +2 -2
  495. package/dist/toast/index.d.ts +1 -0
  496. package/dist/toast/index.js +1 -0
  497. package/dist/toast/root.svelte +2 -2
  498. package/dist/toast/title.svelte +2 -2
  499. package/dist/toggle-group/context.svelte.d.ts +1 -2
  500. package/dist/toggle-group/context.svelte.js +2 -2
  501. package/dist/toggle-group/create-toggle-group.svelte.js +5 -3
  502. package/dist/toggle-group/index.d.ts +1 -0
  503. package/dist/toggle-group/index.js +1 -0
  504. package/dist/toggle-group/item.svelte +2 -2
  505. package/dist/toggle-group/root.svelte +2 -2
  506. package/dist/tooltip/arrow-tip.svelte +2 -2
  507. package/dist/tooltip/arrow.svelte +2 -2
  508. package/dist/tooltip/content.svelte +2 -2
  509. package/dist/tooltip/context.svelte.d.ts +1 -2
  510. package/dist/tooltip/context.svelte.js +2 -2
  511. package/dist/tooltip/create-tooltip.svelte.js +5 -3
  512. package/dist/tooltip/index.d.ts +1 -0
  513. package/dist/tooltip/index.js +1 -0
  514. package/dist/tooltip/positioner.svelte +2 -2
  515. package/dist/tooltip/root.svelte +2 -2
  516. package/dist/tooltip/trigger.svelte +2 -2
  517. package/dist/tree-view/branch-content.svelte +4 -4
  518. package/dist/tree-view/branch-control.svelte +4 -4
  519. package/dist/tree-view/branch-indicator.svelte +4 -4
  520. package/dist/tree-view/branch-text.svelte +4 -4
  521. package/dist/tree-view/branch-trigger.svelte +4 -4
  522. package/dist/tree-view/branch.svelte +4 -4
  523. package/dist/tree-view/context.svelte.d.ts +3 -4
  524. package/dist/tree-view/context.svelte.js +4 -4
  525. package/dist/tree-view/create-tree-view.svelte.js +5 -3
  526. package/dist/tree-view/index.d.ts +1 -0
  527. package/dist/tree-view/index.js +1 -0
  528. package/dist/tree-view/item-indicator.svelte +6 -3
  529. package/dist/tree-view/item-text.svelte +6 -3
  530. package/dist/tree-view/item.svelte +6 -3
  531. package/dist/tree-view/label.svelte +2 -2
  532. package/dist/tree-view/root.svelte +2 -2
  533. package/dist/tree-view/tree.svelte +2 -2
  534. package/package.json +3 -1
  535. package/dist/context.svelte.d.ts +0 -8
@@ -1,8 +1,7 @@
1
- import { Context } from '../context.svelte.js';
2
1
  import type { DayTableCellProps, TableCellProps, TableProps, ViewProps } from '@zag-js/date-picker';
3
2
  import type { CreateDatePickerReturn } from './create-date-picker.svelte.js';
4
- export declare const datePickerContext: Context<CreateDatePickerReturn>;
5
- export declare const datePickerViewPropsContext: Context<ViewProps>;
6
- export declare const datePickerTablePropsContext: Context<TableProps>;
7
- export declare const datePickerTableCellPropsContext: Context<TableCellProps>;
8
- export declare const datePickerDayTableCellPropsContext: Context<DayTableCellProps>;
3
+ export declare const getDatePickerContext: () => CreateDatePickerReturn, setDatePickerContext: (context: CreateDatePickerReturn | (() => CreateDatePickerReturn)) => void;
4
+ export declare const getDatePickerViewPropsContext: () => ViewProps, setDatePickerViewPropsContext: (context: ViewProps | (() => ViewProps)) => void;
5
+ export declare const getDatePickerTablePropsContext: () => TableProps, setDatePickerTablePropsContext: (context: TableProps | (() => TableProps)) => void;
6
+ export declare const getDatePickerTableCellPropsContext: () => TableCellProps, setDatePickerTableCellPropsContext: (context: TableCellProps | (() => TableCellProps)) => void;
7
+ export declare const getDatePickerDayTableCellPropsContext: () => DayTableCellProps, setDatePickerDayTableCellPropsContext: (context: DayTableCellProps | (() => DayTableCellProps)) => void;
@@ -1,6 +1,6 @@
1
- import { Context } from '../context.svelte.js';
2
- export const datePickerContext = new Context('DatePicker');
3
- export const datePickerViewPropsContext = new Context('DatePickerView');
4
- export const datePickerTablePropsContext = new Context('DatePickerTable');
5
- export const datePickerTableCellPropsContext = new Context('DatePickerTableCell');
6
- export const datePickerDayTableCellPropsContext = new Context('DatePickerDayTableCell');
1
+ import { createContext } from '../create-context.svelte.js';
2
+ export const [getDatePickerContext, setDatePickerContext] = createContext('DatePicker');
3
+ export const [getDatePickerViewPropsContext, setDatePickerViewPropsContext] = createContext('DatePickerView');
4
+ export const [getDatePickerTablePropsContext, setDatePickerTablePropsContext] = createContext('DatePickerTable');
5
+ export const [getDatePickerTableCellPropsContext, setDatePickerTableCellPropsContext,] = createContext('DatePickerTableCell');
6
+ export const [getDatePickerDayTableCellPropsContext, setDatePickerDayTableCellPropsContext,] = createContext('DatePickerDayTableCell');
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {datePickerContext} from './context.svelte.js';
11
+ import {getDatePickerContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DatePickerControlProps = $props();
14
14
 
15
- let datePicker = datePickerContext.get();
15
+ let datePicker = getDatePickerContext();
16
16
 
17
17
  let mergedProps = $derived(mergeProps(props, datePicker.getControlProps()));
18
18
  </script>
@@ -7,9 +7,10 @@ import { parts } from './anatomy.js';
7
7
  export function createDatePicker(props) {
8
8
  const locale = getLocaleContext();
9
9
  const environment = getEnvironmentContext();
10
- const [state, send] = useMachine(datePicker.machine({
10
+ const id = uid();
11
+ const context = $derived({
11
12
  ...props,
12
- id: props.id ?? uid(),
13
+ id: props.id ?? id,
13
14
  dir: locale?.dir,
14
15
  min: props.min ? datePicker.parse(props.min) : undefined,
15
16
  max: props.max ? datePicker.parse(props.max) : undefined,
@@ -21,7 +22,8 @@ export function createDatePicker(props) {
21
22
  'open.controlled': props.open != null,
22
23
  locale: props.locale ?? locale?.locale,
23
24
  getRootNode: environment?.getRootNode,
24
- }));
25
+ });
26
+ const [state, send] = useMachine(datePicker.machine(context), { context });
25
27
  const api = $derived(reflect(() => {
26
28
  const o = datePicker.connect(state, send, normalizeProps);
27
29
  return {
@@ -10,15 +10,15 @@
10
10
  <script lang="ts">
11
11
  import {mergeProps} from '../merge-props.js';
12
12
  import {
13
- datePickerContext,
14
- datePickerDayTableCellPropsContext,
13
+ getDatePickerContext,
14
+ getDatePickerDayTableCellPropsContext,
15
15
  } from './context.svelte.js';
16
16
 
17
17
  let {asChild, children, ...props}: DatePickerDayTableCellTriggerProps =
18
18
  $props();
19
19
 
20
- let datePicker = datePickerContext.get();
21
- let tableCellProps = datePickerDayTableCellPropsContext.get();
20
+ let datePicker = getDatePickerContext();
21
+ let tableCellProps = getDatePickerDayTableCellPropsContext();
22
22
 
23
23
  let mergedProps = $derived(
24
24
  mergeProps(props, datePicker.getDayTableCellTriggerProps(tableCellProps)),
@@ -14,13 +14,13 @@
14
14
  import {mergeProps} from '../merge-props.js';
15
15
  import {createSplitProps} from '@zag-js/utils';
16
16
  import {
17
- datePickerContext,
18
- datePickerDayTableCellPropsContext,
17
+ getDatePickerContext,
18
+ setDatePickerDayTableCellPropsContext,
19
19
  } from './context.svelte.js';
20
20
 
21
21
  let {asChild, children, ...props}: DatePickerDayTableCellProps = $props();
22
22
 
23
- let datePicker = datePickerContext.get();
23
+ let datePicker = getDatePickerContext();
24
24
 
25
25
  let [tableCellProps, otherProps] = $derived(
26
26
  createSplitProps<DayTableCellProps>(['value', 'disabled', 'visibleRange'])(
@@ -36,7 +36,7 @@
36
36
  mergeProps(otherProps, datePicker.getDayTableCellProps(tableCellProps)),
37
37
  );
38
38
 
39
- datePickerDayTableCellPropsContext.set(() => tableCellProps);
39
+ setDatePickerDayTableCellPropsContext(() => tableCellProps);
40
40
  </script>
41
41
 
42
42
  {#if asChild}
@@ -28,3 +28,4 @@ export type { DatePickerYearSelectProps } from './year-select.svelte';
28
28
  export type { DatePickerYearTableCellTriggerProps } from './year-table-cell-trigger.svelte';
29
29
  export type { DatePickerYearTableCellProps } from './year-table-cell.svelte';
30
30
  export { anatomy as datePickerAnatomy } from './anatomy.js';
31
+ export { getDatePickerContext } from './context.svelte.js';
@@ -1,2 +1,3 @@
1
1
  export * as DatePicker from './date-picker.js';
2
2
  export { anatomy as datePickerAnatomy } from './anatomy.js';
3
+ export { getDatePickerContext } from './context.svelte.js';
@@ -10,11 +10,11 @@
10
10
 
11
11
  <script lang="ts">
12
12
  import {mergeProps} from '../merge-props.js';
13
- import {datePickerContext} from './context.svelte.js';
13
+ import {getDatePickerContext} from './context.svelte.js';
14
14
 
15
15
  let {index, asChild, ...props}: DatePickerInputProps = $props();
16
16
 
17
- let datePicker = datePickerContext.get();
17
+ let datePicker = getDatePickerContext();
18
18
 
19
19
  let mergedProps = $derived(
20
20
  mergeProps(props, datePicker.getInputProps({index})),
@@ -10,11 +10,11 @@
10
10
 
11
11
  <script lang="ts">
12
12
  import {mergeProps} from '../merge-props.js';
13
- import {datePickerContext} from './context.svelte.js';
13
+ import {getDatePickerContext} from './context.svelte.js';
14
14
 
15
15
  let {index, asChild, children, ...props}: DatePickerLabelProps = $props();
16
16
 
17
- let datePicker = datePickerContext.get();
17
+ let datePicker = getDatePickerContext();
18
18
 
19
19
  let mergedProps = $derived(
20
20
  mergeProps(props, datePicker.getLabelProps({index})),
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {datePickerContext} from './context.svelte.js';
11
+ import {getDatePickerContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DatePickerMonthSelectProps = $props();
14
14
 
15
- let datePicker = datePickerContext.get();
15
+ let datePicker = getDatePickerContext();
16
16
 
17
17
  let mergedProps = $derived(
18
18
  mergeProps(props, datePicker.getMonthSelectProps()),
@@ -10,15 +10,15 @@
10
10
  <script lang="ts">
11
11
  import {mergeProps} from '../merge-props.js';
12
12
  import {
13
- datePickerContext,
14
- datePickerTableCellPropsContext,
13
+ getDatePickerContext,
14
+ getDatePickerTableCellPropsContext,
15
15
  } from './context.svelte.js';
16
16
 
17
17
  let {asChild, children, ...props}: DatePickerMonthTableCellTriggerProps =
18
18
  $props();
19
19
 
20
- let datePicker = datePickerContext.get();
21
- let tableCellProps = datePickerTableCellPropsContext.get();
20
+ let datePicker = getDatePickerContext();
21
+ let tableCellProps = getDatePickerTableCellPropsContext();
22
22
 
23
23
  let mergedProps = $derived(
24
24
  mergeProps(props, datePicker.getMonthTableCellTriggerProps(tableCellProps)),
@@ -14,13 +14,13 @@
14
14
  import {mergeProps} from '../merge-props.js';
15
15
  import {createSplitProps} from '@zag-js/utils';
16
16
  import {
17
- datePickerContext,
18
- datePickerTableCellPropsContext,
17
+ getDatePickerContext,
18
+ setDatePickerTableCellPropsContext,
19
19
  } from './context.svelte.js';
20
20
 
21
21
  let {asChild, children, ...props}: DatePickerMonthTableCellProps = $props();
22
22
 
23
- let datePicker = datePickerContext.get();
23
+ let datePicker = getDatePickerContext();
24
24
 
25
25
  let [tableCellProps, otherProps] = $derived(
26
26
  createSplitProps<TableCellProps>(['value', 'disabled', 'columns'])(props),
@@ -34,7 +34,7 @@
34
34
  mergeProps(otherProps, datePicker.getMonthTableCellProps(tableCellProps)),
35
35
  );
36
36
 
37
- datePickerTableCellPropsContext.set(() => tableCellProps);
37
+ setDatePickerTableCellPropsContext(() => tableCellProps);
38
38
  </script>
39
39
 
40
40
  {#if asChild}
@@ -9,14 +9,14 @@
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {
12
- datePickerContext,
13
- datePickerViewPropsContext,
12
+ getDatePickerContext,
13
+ getDatePickerViewPropsContext,
14
14
  } from './context.svelte.js';
15
15
 
16
16
  let {asChild, children, ...props}: DatePickerNextTriggerProps = $props();
17
17
 
18
- let datePicker = datePickerContext.get();
19
- let viewProps = datePickerViewPropsContext.get();
18
+ let datePicker = getDatePickerContext();
19
+ let viewProps = getDatePickerViewPropsContext();
20
20
 
21
21
  let mergedProps = $derived(
22
22
  mergeProps(props, datePicker.getNextTriggerProps(viewProps)),
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {datePickerContext} from './context.svelte.js';
11
+ import {getDatePickerContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DatePickerPositionerProps = $props();
14
14
 
15
- let datePicker = datePickerContext.get();
15
+ let datePicker = getDatePickerContext();
16
16
 
17
17
  let mergedProps = $derived(
18
18
  mergeProps(props, datePicker.getPositionerProps()),
@@ -10,12 +10,12 @@
10
10
 
11
11
  <script lang="ts">
12
12
  import {mergeProps} from '../merge-props.js';
13
- import {datePickerContext} from './context.svelte.js';
13
+ import {getDatePickerContext} from './context.svelte.js';
14
14
 
15
15
  let {value, asChild, children, ...props}: DatePickerPresetTriggerProps =
16
16
  $props();
17
17
 
18
- let datePicker = datePickerContext.get();
18
+ let datePicker = getDatePickerContext();
19
19
 
20
20
  let mergedProps = $derived(
21
21
  mergeProps(props, datePicker.getPresetTriggerProps({value})),
@@ -9,14 +9,14 @@
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {
12
- datePickerContext,
13
- datePickerViewPropsContext,
12
+ getDatePickerContext,
13
+ getDatePickerViewPropsContext,
14
14
  } from './context.svelte.js';
15
15
 
16
16
  let {asChild, children, ...props}: DatePickerPrevTriggerProps = $props();
17
17
 
18
- let datePicker = datePickerContext.get();
19
- let viewProps = datePickerViewPropsContext.get();
18
+ let datePicker = getDatePickerContext();
19
+ let viewProps = getDatePickerViewPropsContext();
20
20
 
21
21
  let mergedProps = $derived(
22
22
  mergeProps(props, datePicker.getPrevTriggerProps(viewProps)),
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {datePickerContext} from './context.svelte.js';
11
+ import {getDatePickerContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DatePickerRangeTextProps = $props();
14
14
 
15
- let datePicker = datePickerContext.get();
15
+ let datePicker = getDatePickerContext();
16
16
 
17
17
  let mergedProps = $derived(mergeProps(props, datePicker.getRangeTextProps()));
18
18
  </script>
@@ -17,7 +17,7 @@
17
17
  import {mergeProps} from '../merge-props.js';
18
18
  import {reflect} from '@zag-js/svelte';
19
19
  import {createSplitProps} from '@zag-js/utils';
20
- import {datePickerContext} from './context.svelte.js';
20
+ import {setDatePickerContext} from './context.svelte.js';
21
21
  import {createDatePicker} from './create-date-picker.svelte.js';
22
22
 
23
23
  let {asChild, children, ...props}: DatePickerProps = $props();
@@ -59,7 +59,7 @@
59
59
 
60
60
  let mergedProps = $derived(mergeProps(otherProps, datePicker.getRootProps()));
61
61
 
62
- datePickerContext.set(datePicker);
62
+ setDatePickerContext(datePicker);
63
63
  </script>
64
64
 
65
65
  {#if asChild}
@@ -9,14 +9,14 @@
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {
12
- datePickerContext,
13
- datePickerTablePropsContext,
12
+ getDatePickerContext,
13
+ getDatePickerTablePropsContext,
14
14
  } from './context.svelte.js';
15
15
 
16
16
  let {asChild, children, ...props}: DatePickerTableBodyProps = $props();
17
17
 
18
- let datePicker = datePickerContext.get();
19
- let tableProps = datePickerTablePropsContext.get();
18
+ let datePicker = getDatePickerContext();
19
+ let tableProps = getDatePickerTablePropsContext();
20
20
 
21
21
  let mergedProps = $derived(
22
22
  mergeProps(props, datePicker.getTableBodyProps(tableProps)),
@@ -9,14 +9,14 @@
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {
12
- datePickerContext,
13
- datePickerTablePropsContext,
12
+ getDatePickerContext,
13
+ getDatePickerTablePropsContext,
14
14
  } from './context.svelte.js';
15
15
 
16
16
  let {asChild, children, ...props}: DatePickerTableHeadProps = $props();
17
17
 
18
- let datePicker = datePickerContext.get();
19
- let tableProps = datePickerTablePropsContext.get();
18
+ let datePicker = getDatePickerContext();
19
+ let tableProps = getDatePickerTablePropsContext();
20
20
 
21
21
  let mergedProps = $derived(
22
22
  mergeProps(props, datePicker.getTableHeadProps(tableProps)),
@@ -9,14 +9,14 @@
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {
12
- datePickerContext,
13
- datePickerTablePropsContext,
12
+ getDatePickerContext,
13
+ getDatePickerTablePropsContext,
14
14
  } from './context.svelte.js';
15
15
 
16
16
  let {asChild, children, ...props}: DatePickerTableHeaderProps = $props();
17
17
 
18
- let datePicker = datePickerContext.get();
19
- let tableProps = datePickerTablePropsContext.get();
18
+ let datePicker = getDatePickerContext();
19
+ let tableProps = getDatePickerTablePropsContext();
20
20
 
21
21
  let mergedProps = $derived(
22
22
  mergeProps(props, datePicker.getTableHeaderProps(tableProps)),
@@ -9,14 +9,14 @@
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {
12
- datePickerContext,
13
- datePickerTablePropsContext,
12
+ getDatePickerContext,
13
+ getDatePickerTablePropsContext,
14
14
  } from './context.svelte.js';
15
15
 
16
16
  let {asChild, children, ...props}: DatePickerTableRowProps = $props();
17
17
 
18
- let datePicker = datePickerContext.get();
19
- let tableProps = datePickerTablePropsContext.get();
18
+ let datePicker = getDatePickerContext();
19
+ let tableProps = getDatePickerTablePropsContext();
20
20
 
21
21
  let mergedProps = $derived(
22
22
  mergeProps(props, datePicker.getTableRowProps(tableProps)),
@@ -11,23 +11,23 @@
11
11
  <script lang="ts">
12
12
  import {mergeProps} from '../merge-props.js';
13
13
  import {
14
- datePickerContext,
15
- datePickerTablePropsContext,
16
- datePickerViewPropsContext,
14
+ getDatePickerContext,
15
+ getDatePickerViewPropsContext,
16
+ setDatePickerTablePropsContext,
17
17
  } from './context.svelte.js';
18
18
 
19
19
  let {id, columns, asChild, children, ...props}: DatePickerTableProps =
20
20
  $props();
21
21
 
22
- let datePicker = datePickerContext.get();
23
- let viewProps = datePickerViewPropsContext.get();
22
+ let datePicker = getDatePickerContext();
23
+ let viewProps = getDatePickerViewPropsContext();
24
24
  let tableProps: TableProps = $derived({...viewProps, id, columns});
25
25
 
26
26
  let mergedProps = $derived(
27
27
  mergeProps(props, datePicker.getTableProps(tableProps)),
28
28
  );
29
29
 
30
- datePickerTablePropsContext.set(() => tableProps);
30
+ setDatePickerTablePropsContext(() => tableProps);
31
31
  </script>
32
32
 
33
33
  {#if asChild}
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {datePickerContext} from './context.svelte.js';
11
+ import {getDatePickerContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DatePickerTriggerProps = $props();
14
14
 
15
- let datePicker = datePickerContext.get();
15
+ let datePicker = getDatePickerContext();
16
16
 
17
17
  let mergedProps = $derived(mergeProps(props, datePicker.getTriggerProps()));
18
18
  </script>
@@ -9,14 +9,14 @@
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {
12
- datePickerContext,
13
- datePickerViewPropsContext,
12
+ getDatePickerContext,
13
+ getDatePickerViewPropsContext,
14
14
  } from './context.svelte.js';
15
15
 
16
16
  let {asChild, children, ...props}: DatePickerViewControlProps = $props();
17
17
 
18
- let datePicker = datePickerContext.get();
19
- let viewProps = datePickerViewPropsContext.get();
18
+ let datePicker = getDatePickerContext();
19
+ let viewProps = getDatePickerViewPropsContext();
20
20
 
21
21
  let mergedProps = $derived(
22
22
  mergeProps(props, datePicker.getViewControlProps(viewProps)),
@@ -9,14 +9,14 @@
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
11
  import {
12
- datePickerContext,
13
- datePickerViewPropsContext,
12
+ getDatePickerContext,
13
+ getDatePickerViewPropsContext,
14
14
  } from './context.svelte.js';
15
15
 
16
16
  let {asChild, children, ...props}: DatePickerViewTriggerProps = $props();
17
17
 
18
- let datePicker = datePickerContext.get();
19
- let viewProps = datePickerViewPropsContext.get();
18
+ let datePicker = getDatePickerContext();
19
+ let viewProps = getDatePickerViewPropsContext();
20
20
 
21
21
  let mergedProps = $derived(
22
22
  mergeProps(props, datePicker.getViewTriggerProps(viewProps)),
@@ -11,8 +11,8 @@
11
11
  <script lang="ts">
12
12
  import {mergeProps} from '../merge-props.js';
13
13
  import {
14
- datePickerContext,
15
- datePickerViewPropsContext,
14
+ getDatePickerContext,
15
+ setDatePickerViewPropsContext,
16
16
  } from './context.svelte.js';
17
17
 
18
18
  let {
@@ -22,7 +22,7 @@
22
22
  ...props
23
23
  }: DatePickerViewProps = $props();
24
24
 
25
- let datePicker = datePickerContext.get();
25
+ let datePicker = getDatePickerContext();
26
26
 
27
27
  let viewProps: ViewProps = $derived({view});
28
28
 
@@ -30,7 +30,7 @@
30
30
  mergeProps(props, datePicker.getViewProps(viewProps)),
31
31
  );
32
32
 
33
- datePickerViewPropsContext.set(() => viewProps);
33
+ setDatePickerViewPropsContext(() => viewProps);
34
34
  </script>
35
35
 
36
36
  {#if asChild}
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {datePickerContext} from './context.svelte.js';
11
+ import {getDatePickerContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DatePickerYearSelectProps = $props();
14
14
 
15
- let datePicker = datePickerContext.get();
15
+ let datePicker = getDatePickerContext();
16
16
 
17
17
  let mergedProps = $derived(
18
18
  mergeProps(props, datePicker.getYearSelectProps()),
@@ -10,15 +10,15 @@
10
10
  <script lang="ts">
11
11
  import {mergeProps} from '../merge-props.js';
12
12
  import {
13
- datePickerContext,
14
- datePickerTableCellPropsContext,
13
+ getDatePickerContext,
14
+ getDatePickerTableCellPropsContext,
15
15
  } from './context.svelte.js';
16
16
 
17
17
  let {asChild, children, ...props}: DatePickerYearTableCellTriggerProps =
18
18
  $props();
19
19
 
20
- let datePicker = datePickerContext.get();
21
- let tableCellProps = datePickerTableCellPropsContext.get();
20
+ let datePicker = getDatePickerContext();
21
+ let tableCellProps = getDatePickerTableCellPropsContext();
22
22
 
23
23
  let mergedProps = $derived(
24
24
  mergeProps(props, datePicker.getYearTableCellTriggerProps(tableCellProps)),
@@ -14,13 +14,13 @@
14
14
  import {mergeProps} from '../merge-props.js';
15
15
  import {createSplitProps} from '@zag-js/utils';
16
16
  import {
17
- datePickerContext,
18
- datePickerTableCellPropsContext,
17
+ getDatePickerContext,
18
+ setDatePickerTableCellPropsContext,
19
19
  } from './context.svelte.js';
20
20
 
21
21
  let {asChild, children, ...props}: DatePickerYearTableCellProps = $props();
22
22
 
23
- let datePicker = datePickerContext.get();
23
+ let datePicker = getDatePickerContext();
24
24
 
25
25
  let [tableCellProps, otherProps] = $derived(
26
26
  createSplitProps<TableCellProps>(['value', 'disabled', 'columns'])(props),
@@ -34,7 +34,7 @@
34
34
  mergeProps(otherProps, datePicker.getYearTableCellProps(tableCellProps)),
35
35
  );
36
36
 
37
- datePickerTableCellPropsContext.set(() => tableCellProps);
37
+ setDatePickerTableCellPropsContext(() => tableCellProps);
38
38
  </script>
39
39
 
40
40
  {#if asChild}
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {dialogContext} from './context.svelte.js';
11
+ import {getDialogContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DialogBackdropProps = $props();
14
14
 
15
- let dialog = dialogContext.get();
15
+ let dialog = getDialogContext();
16
16
 
17
17
  let mergedProps = $derived(mergeProps(props, dialog.getBackdropProps()));
18
18
  </script>
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {dialogContext} from './context.svelte.js';
11
+ import {getDialogContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DialogCloseTriggerProps = $props();
14
14
 
15
- let dialog = dialogContext.get();
15
+ let dialog = getDialogContext();
16
16
 
17
17
  let mergedProps = $derived(mergeProps(props, dialog.getCloseTriggerProps()));
18
18
  </script>
@@ -8,11 +8,11 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import {mergeProps} from '../merge-props.js';
11
- import {dialogContext} from './context.svelte.js';
11
+ import {getDialogContext} from './context.svelte.js';
12
12
 
13
13
  let {asChild, children, ...props}: DialogContentProps = $props();
14
14
 
15
- let dialog = dialogContext.get();
15
+ let dialog = getDialogContext();
16
16
 
17
17
  let mergedProps = $derived(mergeProps(props, dialog.getContentProps()));
18
18
  </script>
@@ -1,3 +1,2 @@
1
- import { Context } from '../context.svelte.js';
2
1
  import type { CreateDialogReturn } from './create-dialog.svelte.js';
3
- export declare const dialogContext: Context<CreateDialogReturn>;
2
+ export declare const getDialogContext: () => CreateDialogReturn, setDialogContext: (context: CreateDialogReturn | (() => CreateDialogReturn)) => void;
@@ -1,2 +1,2 @@
1
- import { Context } from '../context.svelte.js';
2
- export const dialogContext = new Context('Dialog');
1
+ import { createContext } from '../create-context.svelte.js';
2
+ export const [getDialogContext, setDialogContext] = createContext('Dialog');