ui-ingredients 0.0.27 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (464) hide show
  1. package/README.md +80 -80
  2. package/dist/accordion/context.svelte.d.ts +1 -1
  3. package/dist/accordion/context.svelte.js +1 -1
  4. package/dist/accordion/create-accordion.svelte.js +1 -1
  5. package/dist/accordion/item-content.svelte +32 -27
  6. package/dist/accordion/item-indicator.svelte +32 -27
  7. package/dist/accordion/item-trigger.svelte +32 -27
  8. package/dist/accordion/item.svelte +43 -37
  9. package/dist/accordion/root.svelte +50 -56
  10. package/dist/avatar/context.svelte.d.ts +1 -1
  11. package/dist/avatar/context.svelte.js +1 -1
  12. package/dist/avatar/create-avatar.svelte.js +1 -1
  13. package/dist/avatar/fallback.svelte +26 -26
  14. package/dist/avatar/image.svelte +24 -24
  15. package/dist/avatar/root.svelte +41 -37
  16. package/dist/carousel/context.svelte.d.ts +1 -1
  17. package/dist/carousel/context.svelte.js +1 -1
  18. package/dist/carousel/create-carousel.svelte.js +1 -1
  19. package/dist/carousel/indicator-group.svelte +28 -26
  20. package/dist/carousel/indicator.svelte +35 -35
  21. package/dist/carousel/item-group.svelte +26 -26
  22. package/dist/carousel/item.svelte +38 -30
  23. package/dist/carousel/next-trigger.svelte +26 -26
  24. package/dist/carousel/prev-trigger.svelte +26 -26
  25. package/dist/carousel/root.svelte +51 -56
  26. package/dist/carousel/viewport.svelte +26 -26
  27. package/dist/checkbox/context.svelte.d.ts +1 -1
  28. package/dist/checkbox/context.svelte.js +1 -1
  29. package/dist/checkbox/control.svelte +26 -26
  30. package/dist/checkbox/create-checkbox.svelte.js +1 -1
  31. package/dist/checkbox/hidden-input.svelte +18 -18
  32. package/dist/checkbox/indicator.svelte +26 -26
  33. package/dist/checkbox/label.svelte +26 -26
  34. package/dist/checkbox/root.svelte +53 -60
  35. package/dist/clipboard/context.svelte.d.ts +1 -1
  36. package/dist/clipboard/context.svelte.js +1 -1
  37. package/dist/clipboard/control.svelte +26 -26
  38. package/dist/clipboard/create-clipboard.svelte.js +1 -1
  39. package/dist/clipboard/indicator.svelte +35 -28
  40. package/dist/clipboard/input.svelte +24 -24
  41. package/dist/clipboard/label.svelte +26 -26
  42. package/dist/clipboard/root.svelte +47 -49
  43. package/dist/clipboard/trigger.svelte +26 -26
  44. package/dist/collapsible/content.svelte +26 -26
  45. package/dist/collapsible/context.svelte.d.ts +1 -1
  46. package/dist/collapsible/context.svelte.js +1 -1
  47. package/dist/collapsible/create-collapsible.svelte.js +2 -2
  48. package/dist/collapsible/root.svelte +51 -55
  49. package/dist/collapsible/trigger.svelte +26 -26
  50. package/dist/color-picker/area-background.svelte +26 -21
  51. package/dist/color-picker/area-thumb.svelte +26 -21
  52. package/dist/color-picker/area.svelte +33 -27
  53. package/dist/color-picker/channel-input.svelte +28 -28
  54. package/dist/color-picker/channel-slider-label.svelte +36 -25
  55. package/dist/color-picker/channel-slider-thumb.svelte +30 -23
  56. package/dist/color-picker/channel-slider-track.svelte +30 -23
  57. package/dist/color-picker/channel-slider-value-text.svelte +36 -29
  58. package/dist/color-picker/channel-slider.svelte +40 -29
  59. package/dist/color-picker/content.svelte +20 -20
  60. package/dist/color-picker/context.svelte.d.ts +1 -1
  61. package/dist/color-picker/context.svelte.js +1 -1
  62. package/dist/color-picker/control.svelte +20 -20
  63. package/dist/color-picker/create-color-picker.svelte.js +2 -2
  64. package/dist/color-picker/eye-dropper-trigger.svelte +23 -20
  65. package/dist/color-picker/format-select.svelte +30 -28
  66. package/dist/color-picker/format-trigger.svelte +22 -20
  67. package/dist/color-picker/hidden-input.svelte +20 -18
  68. package/dist/color-picker/label.svelte +20 -20
  69. package/dist/color-picker/positioner.svelte +22 -20
  70. package/dist/color-picker/root.svelte +75 -75
  71. package/dist/color-picker/swatch-group.svelte +22 -20
  72. package/dist/color-picker/swatch-indicator.svelte +26 -21
  73. package/dist/color-picker/swatch-trigger.svelte +34 -31
  74. package/dist/color-picker/swatch.svelte +34 -27
  75. package/dist/color-picker/transparency-grid.svelte +29 -29
  76. package/dist/color-picker/trigger.svelte +20 -20
  77. package/dist/color-picker/value-text.svelte +26 -24
  78. package/dist/combobox/clear-trigger.svelte +28 -26
  79. package/dist/combobox/content.svelte +26 -26
  80. package/dist/combobox/context.svelte.d.ts +1 -1
  81. package/dist/combobox/context.svelte.js +1 -1
  82. package/dist/combobox/control.svelte +26 -26
  83. package/dist/combobox/create-combobox.svelte.js +5 -5
  84. package/dist/combobox/input.svelte +24 -24
  85. package/dist/combobox/item-group-label.svelte +37 -34
  86. package/dist/combobox/item-group.svelte +40 -36
  87. package/dist/combobox/item-indicator.svelte +29 -27
  88. package/dist/combobox/item-text.svelte +33 -31
  89. package/dist/combobox/item.svelte +40 -36
  90. package/dist/combobox/label.svelte +26 -26
  91. package/dist/combobox/list.svelte +26 -26
  92. package/dist/combobox/positioner.svelte +26 -26
  93. package/dist/combobox/root.svelte +83 -120
  94. package/dist/combobox/trigger.svelte +26 -26
  95. package/dist/context.svelte.d.ts +8 -0
  96. package/dist/{utils.svelte.js → context.svelte.js} +1 -17
  97. package/dist/create-unique-id.d.ts +1 -0
  98. package/dist/create-unique-id.js +4 -0
  99. package/dist/date-picker/clear-trigger.svelte +28 -26
  100. package/dist/date-picker/content.svelte +26 -26
  101. package/dist/date-picker/context.svelte.d.ts +1 -1
  102. package/dist/date-picker/context.svelte.js +1 -1
  103. package/dist/date-picker/control.svelte +26 -26
  104. package/dist/date-picker/create-date-picker.svelte.d.ts +2 -2
  105. package/dist/date-picker/create-date-picker.svelte.js +7 -3
  106. package/dist/date-picker/day-table-cell-trigger.svelte +34 -27
  107. package/dist/date-picker/day-table-cell.svelte +48 -39
  108. package/dist/date-picker/input.svelte +28 -25
  109. package/dist/date-picker/label.svelte +30 -27
  110. package/dist/date-picker/month-select.svelte +49 -47
  111. package/dist/date-picker/month-table-cell-trigger.svelte +34 -27
  112. package/dist/date-picker/month-table-cell.svelte +46 -39
  113. package/dist/date-picker/next-trigger.svelte +32 -27
  114. package/dist/date-picker/positioner.svelte +28 -26
  115. package/dist/date-picker/preset-trigger.svelte +31 -28
  116. package/dist/date-picker/prev-trigger.svelte +32 -27
  117. package/dist/date-picker/range-text.svelte +30 -30
  118. package/dist/date-picker/root.svelte +70 -94
  119. package/dist/date-picker/table-body.svelte +32 -27
  120. package/dist/date-picker/table-head.svelte +32 -27
  121. package/dist/date-picker/table-header.svelte +32 -27
  122. package/dist/date-picker/table-row.svelte +32 -27
  123. package/dist/date-picker/table.svelte +39 -36
  124. package/dist/date-picker/trigger.svelte +26 -26
  125. package/dist/date-picker/view-control.svelte +32 -27
  126. package/dist/date-picker/view-trigger.svelte +32 -27
  127. package/dist/date-picker/view.svelte +42 -36
  128. package/dist/date-picker/year-select.svelte +49 -47
  129. package/dist/date-picker/year-table-cell-trigger.svelte +34 -27
  130. package/dist/date-picker/year-table-cell.svelte +46 -39
  131. package/dist/dialog/backdrop.svelte +26 -26
  132. package/dist/dialog/close-trigger.svelte +26 -26
  133. package/dist/dialog/content.svelte +26 -26
  134. package/dist/dialog/context.svelte.d.ts +1 -1
  135. package/dist/dialog/context.svelte.js +1 -1
  136. package/dist/dialog/create-dialog.svelte.js +2 -2
  137. package/dist/dialog/description.svelte +26 -26
  138. package/dist/dialog/positioner.svelte +27 -27
  139. package/dist/dialog/root.svelte +24 -21
  140. package/dist/dialog/title.svelte +26 -26
  141. package/dist/dialog/trigger.svelte +26 -26
  142. package/dist/editable/area.svelte +26 -26
  143. package/dist/editable/cancel-trigger.svelte +28 -26
  144. package/dist/editable/context.svelte.d.ts +1 -1
  145. package/dist/editable/context.svelte.js +1 -1
  146. package/dist/editable/control.svelte +26 -26
  147. package/dist/editable/create-editable.svelte.js +2 -2
  148. package/dist/editable/edit-trigger.svelte +26 -26
  149. package/dist/editable/input.svelte +24 -24
  150. package/dist/editable/label.svelte +26 -26
  151. package/dist/editable/preview.svelte +30 -30
  152. package/dist/editable/root.svelte +68 -90
  153. package/dist/editable/submit-trigger.svelte +28 -26
  154. package/dist/environment-provider/context.svelte.d.ts +1 -1
  155. package/dist/environment-provider/context.svelte.js +1 -1
  156. package/dist/environment-provider/index.d.ts +1 -1
  157. package/dist/environment-provider/index.js +1 -1
  158. package/dist/environment-provider/root.svelte +44 -40
  159. package/dist/file-upload/context.svelte.d.ts +1 -1
  160. package/dist/file-upload/context.svelte.js +1 -1
  161. package/dist/file-upload/create-file-upload.svelte.js +1 -1
  162. package/dist/file-upload/dropzone.svelte +26 -26
  163. package/dist/file-upload/hidden-input.svelte +20 -18
  164. package/dist/file-upload/item-delete-trigger.svelte +34 -27
  165. package/dist/file-upload/item-group.svelte +26 -26
  166. package/dist/file-upload/item-name.svelte +36 -31
  167. package/dist/file-upload/item-preview-image.svelte +38 -33
  168. package/dist/file-upload/item-preview.svelte +32 -27
  169. package/dist/file-upload/item-size-text.svelte +36 -31
  170. package/dist/file-upload/item.svelte +40 -32
  171. package/dist/file-upload/label.svelte +26 -26
  172. package/dist/file-upload/root.svelte +60 -74
  173. package/dist/file-upload/trigger.svelte +26 -26
  174. package/dist/hover-card/arrow-tip.svelte +26 -26
  175. package/dist/hover-card/arrow.svelte +26 -26
  176. package/dist/hover-card/content.svelte +26 -26
  177. package/dist/hover-card/context.svelte.d.ts +1 -1
  178. package/dist/hover-card/context.svelte.js +1 -1
  179. package/dist/hover-card/create-hover-card.svelte.js +2 -2
  180. package/dist/hover-card/positioner.svelte +26 -26
  181. package/dist/hover-card/root.svelte +24 -21
  182. package/dist/hover-card/trigger.svelte +26 -26
  183. package/dist/index.d.ts +0 -1
  184. package/dist/index.js +0 -1
  185. package/dist/locale-provider/context.svelte.d.ts +1 -1
  186. package/dist/locale-provider/context.svelte.js +1 -1
  187. package/dist/locale-provider/index.d.ts +1 -1
  188. package/dist/locale-provider/index.js +1 -1
  189. package/dist/locale-provider/root.svelte +24 -24
  190. package/dist/menu/arrow-tip.svelte +26 -26
  191. package/dist/menu/arrow.svelte +26 -26
  192. package/dist/menu/content.svelte +26 -26
  193. package/dist/menu/context-trigger.svelte +26 -26
  194. package/dist/menu/context.svelte.d.ts +1 -1
  195. package/dist/menu/context.svelte.js +1 -1
  196. package/dist/menu/create-menu.svelte.js +2 -2
  197. package/dist/menu/indicator.svelte +26 -26
  198. package/dist/menu/item-group-label.svelte +35 -34
  199. package/dist/menu/item-group.svelte +37 -35
  200. package/dist/menu/item.svelte +43 -37
  201. package/dist/menu/option-item-indicator.svelte +30 -27
  202. package/dist/menu/option-item-text.svelte +34 -31
  203. package/dist/menu/option-item.svelte +49 -53
  204. package/dist/menu/positioner.svelte +26 -26
  205. package/dist/menu/root.svelte +24 -21
  206. package/dist/menu/separator.svelte +26 -26
  207. package/dist/menu/trigger-item.svelte +26 -26
  208. package/dist/menu/trigger.svelte +26 -26
  209. package/dist/merge-props.d.ts +2 -0
  210. package/dist/merge-props.js +18 -0
  211. package/dist/number-input/context.svelte.d.ts +1 -1
  212. package/dist/number-input/context.svelte.js +1 -1
  213. package/dist/number-input/control.svelte +26 -26
  214. package/dist/number-input/create-number-input.svelte.js +1 -1
  215. package/dist/number-input/decrement-trigger.svelte +30 -26
  216. package/dist/number-input/increment-trigger.svelte +30 -26
  217. package/dist/number-input/input.svelte +24 -24
  218. package/dist/number-input/label.svelte +26 -26
  219. package/dist/number-input/root.svelte +69 -91
  220. package/dist/number-input/scrubber.svelte +26 -26
  221. package/dist/pagination/context.svelte.d.ts +1 -1
  222. package/dist/pagination/context.svelte.js +1 -1
  223. package/dist/pagination/create-pagination.svelte.js +1 -1
  224. package/dist/pagination/ellipsis.svelte +30 -27
  225. package/dist/pagination/item.svelte +36 -36
  226. package/dist/pagination/next-trigger.svelte +28 -26
  227. package/dist/pagination/prev-trigger.svelte +28 -26
  228. package/dist/pagination/root.svelte +52 -58
  229. package/dist/pin-input/clear-trigger.svelte +34 -29
  230. package/dist/pin-input/context.svelte.d.ts +1 -1
  231. package/dist/pin-input/context.svelte.js +1 -1
  232. package/dist/pin-input/create-pin-input.svelte.d.ts +2 -2
  233. package/dist/pin-input/create-pin-input.svelte.js +1 -1
  234. package/dist/pin-input/hidden-input.svelte +18 -18
  235. package/dist/pin-input/input.svelte +28 -25
  236. package/dist/pin-input/label.svelte +26 -26
  237. package/dist/pin-input/root.svelte +63 -80
  238. package/dist/popover/arrow-tip.svelte +26 -26
  239. package/dist/popover/arrow.svelte +26 -26
  240. package/dist/popover/close-trigger.svelte +26 -26
  241. package/dist/popover/content.svelte +26 -26
  242. package/dist/popover/context.svelte.d.ts +1 -1
  243. package/dist/popover/context.svelte.js +1 -1
  244. package/dist/popover/create-popover.svelte.js +2 -2
  245. package/dist/popover/description.svelte +26 -26
  246. package/dist/popover/positioner.svelte +26 -26
  247. package/dist/popover/root.svelte +24 -21
  248. package/dist/popover/title.svelte +26 -26
  249. package/dist/popover/trigger.svelte +26 -26
  250. package/dist/portal/root.svelte +28 -28
  251. package/dist/presence/context.svelte.d.ts +1 -1
  252. package/dist/presence/context.svelte.js +1 -1
  253. package/dist/presence/root.svelte +29 -32
  254. package/dist/presence/root.svelte.d.ts +1 -1
  255. package/dist/progress/circle-range.svelte +26 -26
  256. package/dist/progress/circle-track.svelte +26 -26
  257. package/dist/progress/circle.svelte +26 -26
  258. package/dist/progress/context.svelte.d.ts +1 -1
  259. package/dist/progress/context.svelte.js +1 -1
  260. package/dist/progress/create-progress.svelte.js +1 -1
  261. package/dist/progress/label.svelte +26 -26
  262. package/dist/progress/range.svelte +26 -26
  263. package/dist/progress/root.svelte +49 -53
  264. package/dist/progress/track.svelte +26 -26
  265. package/dist/progress/value-text.svelte +30 -30
  266. package/dist/progress/view.svelte +28 -27
  267. package/dist/qr-code/context.svelte.d.ts +1 -1
  268. package/dist/qr-code/context.svelte.js +1 -1
  269. package/dist/qr-code/create-qr-code.svelte.js +1 -1
  270. package/dist/qr-code/frame.svelte +26 -26
  271. package/dist/qr-code/overlay.svelte +26 -26
  272. package/dist/qr-code/pattern.svelte +26 -26
  273. package/dist/qr-code/root.svelte +43 -47
  274. package/dist/radio-group/context.svelte.d.ts +1 -1
  275. package/dist/radio-group/context.svelte.js +1 -1
  276. package/dist/radio-group/create-radio-group.svelte.js +1 -1
  277. package/dist/radio-group/indicator.svelte +26 -26
  278. package/dist/radio-group/item-control.svelte +32 -27
  279. package/dist/radio-group/item-hidden-input.svelte +24 -19
  280. package/dist/radio-group/item-text.svelte +32 -27
  281. package/dist/radio-group/item.svelte +43 -38
  282. package/dist/radio-group/label.svelte +26 -26
  283. package/dist/radio-group/root.svelte +51 -56
  284. package/dist/rating-group/context.svelte.d.ts +1 -1
  285. package/dist/rating-group/context.svelte.js +1 -1
  286. package/dist/rating-group/control.svelte +26 -26
  287. package/dist/rating-group/create-rating-group.svelte.js +1 -1
  288. package/dist/rating-group/hidden-input.svelte +20 -18
  289. package/dist/rating-group/item.svelte +33 -31
  290. package/dist/rating-group/label.svelte +26 -26
  291. package/dist/rating-group/root.svelte +58 -69
  292. package/dist/segment-group/context.svelte.d.ts +1 -1
  293. package/dist/segment-group/context.svelte.js +1 -1
  294. package/dist/segment-group/create-segment-group.svelte.js +1 -1
  295. package/dist/segment-group/indicator.svelte +29 -27
  296. package/dist/segment-group/item-control.svelte +37 -30
  297. package/dist/segment-group/item-hidden-input.svelte +25 -19
  298. package/dist/segment-group/item-text.svelte +37 -30
  299. package/dist/segment-group/item.svelte +48 -47
  300. package/dist/segment-group/label.svelte +29 -27
  301. package/dist/segment-group/root.svelte +57 -60
  302. package/dist/select/clear-trigger.svelte +26 -26
  303. package/dist/select/content.svelte +26 -26
  304. package/dist/select/context.svelte.d.ts +1 -1
  305. package/dist/select/context.svelte.js +1 -1
  306. package/dist/select/control.svelte +26 -26
  307. package/dist/select/create-select.svelte.js +5 -5
  308. package/dist/select/hidden-select.svelte +20 -20
  309. package/dist/select/indicator.svelte +26 -26
  310. package/dist/select/item-group-label.svelte +35 -29
  311. package/dist/select/item-group.svelte +40 -36
  312. package/dist/select/item-indicator.svelte +29 -27
  313. package/dist/select/item-text.svelte +33 -31
  314. package/dist/select/item.svelte +40 -36
  315. package/dist/select/label.svelte +26 -26
  316. package/dist/select/list.svelte +26 -26
  317. package/dist/select/positioner.svelte +26 -26
  318. package/dist/select/root.svelte +70 -94
  319. package/dist/select/trigger.svelte +26 -26
  320. package/dist/select/value-text.svelte +33 -32
  321. package/dist/signature-pad/clear-trigger.svelte +28 -26
  322. package/dist/signature-pad/context.svelte.d.ts +1 -1
  323. package/dist/signature-pad/context.svelte.js +1 -1
  324. package/dist/signature-pad/control.svelte +26 -26
  325. package/dist/signature-pad/create-signature-pad.svelte.js +1 -1
  326. package/dist/signature-pad/current-segment-path.svelte +37 -35
  327. package/dist/signature-pad/guide.svelte +26 -26
  328. package/dist/signature-pad/hidden-input.svelte +22 -20
  329. package/dist/signature-pad/label.svelte +26 -26
  330. package/dist/signature-pad/root.svelte +57 -61
  331. package/dist/signature-pad/segment-path.svelte +31 -28
  332. package/dist/signature-pad/segment.svelte +26 -26
  333. package/dist/slider/context.svelte.d.ts +1 -1
  334. package/dist/slider/context.svelte.js +1 -1
  335. package/dist/slider/control.svelte +26 -26
  336. package/dist/slider/create-slider.svelte.js +1 -1
  337. package/dist/slider/hidden-input.svelte +21 -19
  338. package/dist/slider/label.svelte +26 -26
  339. package/dist/slider/marker-group.svelte +26 -26
  340. package/dist/slider/marker.svelte +35 -34
  341. package/dist/slider/range.svelte +26 -26
  342. package/dist/slider/root.svelte +64 -82
  343. package/dist/slider/thumb.svelte +37 -33
  344. package/dist/slider/track.svelte +26 -26
  345. package/dist/slider/value-text.svelte +30 -30
  346. package/dist/splitter/context.svelte.d.ts +1 -1
  347. package/dist/splitter/context.svelte.js +1 -1
  348. package/dist/splitter/create-splitter.svelte.js +1 -1
  349. package/dist/splitter/panel.svelte +35 -35
  350. package/dist/splitter/resize-trigger.svelte +48 -46
  351. package/dist/splitter/root.svelte +48 -50
  352. package/dist/steps/completed-content.svelte +33 -33
  353. package/dist/steps/content.svelte +28 -27
  354. package/dist/steps/context.svelte.d.ts +1 -1
  355. package/dist/steps/context.svelte.js +1 -1
  356. package/dist/steps/create-steps.svelte.js +1 -1
  357. package/dist/steps/indicator.svelte +30 -27
  358. package/dist/steps/item.svelte +41 -35
  359. package/dist/steps/list.svelte +26 -26
  360. package/dist/steps/next-trigger.svelte +26 -26
  361. package/dist/steps/prev-trigger.svelte +26 -26
  362. package/dist/steps/progress.svelte +26 -26
  363. package/dist/steps/root.svelte +50 -53
  364. package/dist/steps/separator.svelte +29 -27
  365. package/dist/steps/trigger.svelte +29 -27
  366. package/dist/switch/context.svelte.d.ts +1 -1
  367. package/dist/switch/context.svelte.js +1 -1
  368. package/dist/switch/control.svelte +26 -26
  369. package/dist/switch/create-switch.svelte.js +1 -1
  370. package/dist/switch/hidden-input.svelte +18 -18
  371. package/dist/switch/label.svelte +26 -26
  372. package/dist/switch/root.svelte +54 -62
  373. package/dist/switch/thumb.svelte +26 -26
  374. package/dist/tabs/content.svelte +35 -27
  375. package/dist/tabs/context.svelte.d.ts +1 -1
  376. package/dist/tabs/context.svelte.js +1 -1
  377. package/dist/tabs/create-tabs.svelte.js +1 -1
  378. package/dist/tabs/list.svelte +26 -26
  379. package/dist/tabs/root.svelte +52 -57
  380. package/dist/tabs/trigger.svelte +35 -35
  381. package/dist/tags-input/clear-trigger.svelte +28 -26
  382. package/dist/tags-input/context.svelte.d.ts +1 -1
  383. package/dist/tags-input/context.svelte.js +1 -1
  384. package/dist/tags-input/control.svelte +26 -26
  385. package/dist/tags-input/create-tags-input.svelte.d.ts +1 -1
  386. package/dist/tags-input/create-tags-input.svelte.js +2 -2
  387. package/dist/tags-input/hidden-input.svelte +20 -18
  388. package/dist/tags-input/input.svelte +24 -24
  389. package/dist/tags-input/item-delete-trigger.svelte +32 -27
  390. package/dist/tags-input/item-input.svelte +30 -25
  391. package/dist/tags-input/item-preview.svelte +32 -27
  392. package/dist/tags-input/item-text.svelte +32 -27
  393. package/dist/tags-input/item.svelte +44 -38
  394. package/dist/tags-input/label.svelte +26 -26
  395. package/dist/tags-input/root.svelte +69 -92
  396. package/dist/time-picker/clear-trigger.svelte +28 -26
  397. package/dist/time-picker/column.svelte +30 -27
  398. package/dist/time-picker/content.svelte +26 -26
  399. package/dist/time-picker/context.svelte.d.ts +1 -1
  400. package/dist/time-picker/context.svelte.js +1 -1
  401. package/dist/time-picker/control.svelte +26 -26
  402. package/dist/time-picker/create-time-picker.svelte.js +2 -2
  403. package/dist/time-picker/hour-cell.svelte +30 -27
  404. package/dist/time-picker/input.svelte +24 -24
  405. package/dist/time-picker/label.svelte +26 -26
  406. package/dist/time-picker/minute-cell.svelte +31 -27
  407. package/dist/time-picker/period-cell.svelte +36 -34
  408. package/dist/time-picker/positioner.svelte +28 -26
  409. package/dist/time-picker/root.svelte +61 -76
  410. package/dist/time-picker/second-cell.svelte +31 -27
  411. package/dist/time-picker/spacer.svelte +26 -26
  412. package/dist/time-picker/trigger.svelte +26 -26
  413. package/dist/timer/action-trigger.svelte +30 -27
  414. package/dist/timer/context.svelte.d.ts +1 -1
  415. package/dist/timer/context.svelte.js +1 -1
  416. package/dist/timer/create-timer.svelte.js +1 -1
  417. package/dist/timer/item-label.svelte +29 -27
  418. package/dist/timer/item-value.svelte +33 -31
  419. package/dist/timer/item.svelte +36 -32
  420. package/dist/timer/root.svelte +50 -53
  421. package/dist/timer/separator.svelte +26 -26
  422. package/dist/toast/action-trigger.svelte +28 -26
  423. package/dist/toast/close-trigger.svelte +26 -26
  424. package/dist/toast/context.svelte.d.ts +1 -1
  425. package/dist/toast/context.svelte.js +1 -1
  426. package/dist/toast/create-toaster.svelte.js +1 -1
  427. package/dist/toast/description.svelte +30 -30
  428. package/dist/toast/ghost-after.svelte +19 -18
  429. package/dist/toast/ghost-before.svelte +19 -18
  430. package/dist/toast/root.svelte +31 -30
  431. package/dist/toast/title.svelte +30 -30
  432. package/dist/toast/toaster.svelte +40 -40
  433. package/dist/toggle-group/context.svelte.d.ts +1 -1
  434. package/dist/toggle-group/context.svelte.js +1 -1
  435. package/dist/toggle-group/create-toggle-group.svelte.js +1 -1
  436. package/dist/toggle-group/item.svelte +39 -35
  437. package/dist/toggle-group/root.svelte +53 -59
  438. package/dist/tooltip/arrow-tip.svelte +26 -26
  439. package/dist/tooltip/arrow.svelte +26 -26
  440. package/dist/tooltip/content.svelte +26 -26
  441. package/dist/tooltip/context.svelte.d.ts +1 -1
  442. package/dist/tooltip/context.svelte.js +1 -1
  443. package/dist/tooltip/create-tooltip.svelte.js +2 -2
  444. package/dist/tooltip/positioner.svelte +26 -26
  445. package/dist/tooltip/root.svelte +24 -21
  446. package/dist/tooltip/trigger.svelte +26 -26
  447. package/dist/tree-view/branch-content.svelte +33 -27
  448. package/dist/tree-view/branch-control.svelte +33 -27
  449. package/dist/tree-view/branch-indicator.svelte +33 -27
  450. package/dist/tree-view/branch-text.svelte +33 -27
  451. package/dist/tree-view/branch-trigger.svelte +33 -27
  452. package/dist/tree-view/branch.svelte +44 -38
  453. package/dist/tree-view/context.svelte.d.ts +1 -1
  454. package/dist/tree-view/context.svelte.js +1 -1
  455. package/dist/tree-view/create-tree-view.svelte.js +1 -1
  456. package/dist/tree-view/item-indicator.svelte +30 -27
  457. package/dist/tree-view/item-text.svelte +30 -27
  458. package/dist/tree-view/item.svelte +41 -37
  459. package/dist/tree-view/label.svelte +26 -26
  460. package/dist/tree-view/root.svelte +53 -60
  461. package/dist/tree-view/tree.svelte +26 -26
  462. package/dist/types.d.ts +5 -9
  463. package/package.json +2 -1
  464. package/dist/utils.svelte.d.ts +0 -10
@@ -1,26 +1,26 @@
1
- <script lang="ts" module>
2
- import type {AsChild, HtmlProps} from '../types.js';
3
-
4
- export interface ComboboxContentProps extends HtmlProps<'div'> {
5
- asChild?: AsChild;
6
- }
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../utils.svelte.js';
11
- import {comboboxContext} from './context.svelte.js';
12
-
13
- let {asChild, children, ...props}: ComboboxContentProps = $props();
14
-
15
- let combobox = comboboxContext.get();
16
-
17
- let attrs = $derived(mergeProps(props, combobox.getContentProps()));
18
- </script>
19
-
20
- {#if asChild}
21
- {@render asChild(attrs)}
22
- {:else}
23
- <div {...attrs}>
24
- {@render children?.()}
25
- </div>
26
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxContentProps extends HTMLProps<'div'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {comboboxContext} from './context.svelte.js';
12
+
13
+ let {asChild, children, ...props}: ComboboxContentProps = $props();
14
+
15
+ let combobox = comboboxContext.get();
16
+
17
+ let mergedProps = $derived(mergeProps(props, combobox.getContentProps()));
18
+ </script>
19
+
20
+ {#if asChild}
21
+ {@render asChild(mergedProps)}
22
+ {:else}
23
+ <div {...mergedProps}>
24
+ {@render children?.()}
25
+ </div>
26
+ {/if}
@@ -1,4 +1,4 @@
1
- import { Context } from '../utils.svelte.js';
1
+ import { Context } from '../context.svelte.js';
2
2
  import type { ItemGroupProps, ItemProps } from '@zag-js/combobox';
3
3
  import type { CreateComboboxReturn } from './create-combobox.svelte.js';
4
4
  export declare const comboboxContext: Context<CreateComboboxReturn>;
@@ -1,4 +1,4 @@
1
- import { Context } from '../utils.svelte.js';
1
+ import { Context } from '../context.svelte.js';
2
2
  export const comboboxContext = new Context('Combobox');
3
3
  export const comboboxItemPropsContext = new Context('ComboboxItem');
4
4
  export const comboboxItemGroupPropsContext = new Context('ComboboxItemGroup');
@@ -1,26 +1,26 @@
1
- <script lang="ts" module>
2
- import type {AsChild, HtmlProps} from '../types.js';
3
-
4
- export interface ComboboxControlProps extends HtmlProps<'div'> {
5
- asChild?: AsChild;
6
- }
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../utils.svelte.js';
11
- import {comboboxContext} from './context.svelte.js';
12
-
13
- let {asChild, children, ...props}: ComboboxControlProps = $props();
14
-
15
- let combobox = comboboxContext.get();
16
-
17
- let attrs = $derived(mergeProps(props, combobox.getControlProps()));
18
- </script>
19
-
20
- {#if asChild}
21
- {@render asChild(attrs)}
22
- {:else}
23
- <div {...attrs}>
24
- {@render children?.()}
25
- </div>
26
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxControlProps extends HTMLProps<'div'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {comboboxContext} from './context.svelte.js';
12
+
13
+ let {asChild, children, ...props}: ComboboxControlProps = $props();
14
+
15
+ let combobox = comboboxContext.get();
16
+
17
+ let mergedProps = $derived(mergeProps(props, combobox.getControlProps()));
18
+ </script>
19
+
20
+ {#if asChild}
21
+ {@render asChild(mergedProps)}
22
+ {:else}
23
+ <div {...mergedProps}>
24
+ {@render children?.()}
25
+ </div>
26
+ {/if}
@@ -1,14 +1,14 @@
1
+ import { createUniqueId } from '../create-unique-id.js';
1
2
  import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
2
3
  import { getLocaleContext } from '../locale-provider/context.svelte.js';
3
- import { createUniqueId } from '../utils.svelte.js';
4
4
  import * as combobox from '@zag-js/combobox';
5
5
  import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
6
6
  export function createCombobox(props) {
7
7
  const collection = $derived(combobox.collection({
8
8
  items: props.items,
9
- itemToValue: (item) => (props.itemToValue ? props.itemToValue(item) : String(item)),
10
- itemToString: (item) => (props.itemToString ? props.itemToString(item) : String(item)),
11
- isItemDisabled: (item) => (props.isItemDisabled ? props.isItemDisabled(item) : false),
9
+ itemToValue: (item) => props.itemToValue ? props.itemToValue(item) : String(item),
10
+ itemToString: (item) => props.itemToString ? props.itemToString(item) : String(item),
11
+ isItemDisabled: (item) => props.isItemDisabled ? props.isItemDisabled(item) : false,
12
12
  }));
13
13
  const locale = getLocaleContext();
14
14
  const environment = getEnvironmentContext();
@@ -16,7 +16,7 @@ export function createCombobox(props) {
16
16
  ...props,
17
17
  id: props.id ?? createUniqueId(),
18
18
  dir: locale?.dir,
19
- open: props.defaultOpen,
19
+ open: props.defaultOpen ?? props.open,
20
20
  getRootNode: environment?.getRootNode,
21
21
  'open.controlled': props.open != null,
22
22
  collection,
@@ -1,24 +1,24 @@
1
- <script lang="ts" module>
2
- import type {AsChild, HtmlProps} from '../types.js';
3
-
4
- export interface ComboboxInputProps extends HtmlProps<'input'> {
5
- asChild?: AsChild<HtmlProps<'input'>>;
6
- }
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../utils.svelte.js';
11
- import {comboboxContext} from './context.svelte.js';
12
-
13
- let {asChild, ...props}: ComboboxInputProps = $props();
14
-
15
- let combobox = comboboxContext.get();
16
-
17
- let attrs = $derived(mergeProps(props, combobox.getInputProps()));
18
- </script>
19
-
20
- {#if asChild}
21
- {@render asChild(attrs)}
22
- {:else}
23
- <input {...attrs} />
24
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxInputProps extends HTMLProps<'input'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {comboboxContext} from './context.svelte.js';
12
+
13
+ let {asChild, ...props}: ComboboxInputProps = $props();
14
+
15
+ let combobox = comboboxContext.get();
16
+
17
+ let mergedProps = $derived(mergeProps(props, combobox.getInputProps()));
18
+ </script>
19
+
20
+ {#if asChild}
21
+ {@render asChild(mergedProps)}
22
+ {:else}
23
+ <input {...mergedProps} />
24
+ {/if}
@@ -1,34 +1,37 @@
1
- <script lang="ts" module>
2
- import type {AsChild, HtmlProps} from '../types.js';
3
-
4
- export interface ComboboxItemGroupLabelProps extends HtmlProps<'span'> {
5
- asChild?: AsChild;
6
- }
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../utils.svelte.js';
11
- import {comboboxContext, comboboxItemGroupPropsContext} from './context.svelte.js';
12
-
13
- let {asChild, children, ...props}: ComboboxItemGroupLabelProps = $props();
14
-
15
- let combobox = comboboxContext.get();
16
- let itemGroupProps = comboboxItemGroupPropsContext.get();
17
-
18
- let attrs = $derived(
19
- mergeProps(
20
- props,
21
- combobox.getItemGroupLabelProps({
22
- htmlFor: itemGroupProps.id,
23
- }),
24
- ),
25
- );
26
- </script>
27
-
28
- {#if asChild}
29
- {@render asChild(attrs)}
30
- {:else}
31
- <span {...attrs}>
32
- {@render children?.()}
33
- </span>
34
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxItemGroupLabelProps extends HTMLProps<'span'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {
12
+ comboboxContext,
13
+ comboboxItemGroupPropsContext,
14
+ } from './context.svelte.js';
15
+
16
+ let {asChild, children, ...props}: ComboboxItemGroupLabelProps = $props();
17
+
18
+ let combobox = comboboxContext.get();
19
+ let itemGroupProps = comboboxItemGroupPropsContext.get();
20
+
21
+ let mergedProps = $derived(
22
+ mergeProps(
23
+ props,
24
+ combobox.getItemGroupLabelProps({
25
+ htmlFor: itemGroupProps.id,
26
+ }),
27
+ ),
28
+ );
29
+ </script>
30
+
31
+ {#if asChild}
32
+ {@render asChild(mergedProps)}
33
+ {:else}
34
+ <span {...mergedProps}>
35
+ {@render children?.()}
36
+ </span>
37
+ {/if}
@@ -1,36 +1,40 @@
1
- <script lang="ts" module>
2
- import type {AsChild, Assign, HtmlProps} from '../types.js';
3
- import type {ItemGroupProps} from '@zag-js/combobox';
4
-
5
- export interface ComboboxItemGroupProps
6
- extends Assign<HtmlProps<'div'>, Omit<ItemGroupProps, 'id'>> {
7
- asChild?: AsChild;
8
- }
9
- </script>
10
-
11
- <script lang="ts">
12
- import {createUniqueId, mergeProps} from '../utils.svelte.js';
13
- import {comboboxContext, comboboxItemGroupPropsContext} from './context.svelte.js';
14
-
15
- let {id, asChild, children, ...props}: ComboboxItemGroupProps = $props();
16
-
17
- let combobox = comboboxContext.get();
18
-
19
- let uid = createUniqueId();
20
-
21
- let comboboxItemGroupProps = $derived({
22
- id: id ?? uid,
23
- });
24
-
25
- let attrs = $derived(mergeProps(props, combobox.getItemGroupProps(comboboxItemGroupProps)));
26
-
27
- comboboxItemGroupPropsContext.set(() => comboboxItemGroupProps);
28
- </script>
29
-
30
- {#if asChild}
31
- {@render asChild(attrs)}
32
- {:else}
33
- <div {...attrs}>
34
- {@render children?.()}
35
- </div>
36
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxItemGroupProps extends HTMLProps<'div'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {createUniqueId} from '../create-unique-id.js';
11
+ import {mergeProps} from '../merge-props.js';
12
+ import {
13
+ comboboxContext,
14
+ comboboxItemGroupPropsContext,
15
+ } from './context.svelte.js';
16
+
17
+ let {id, asChild, children, ...props}: ComboboxItemGroupProps = $props();
18
+
19
+ let combobox = comboboxContext.get();
20
+
21
+ let uid = createUniqueId();
22
+
23
+ let comboboxItemGroupProps = $derived({
24
+ id: id ?? uid,
25
+ });
26
+
27
+ let mergedProps = $derived(
28
+ mergeProps(props, combobox.getItemGroupProps(comboboxItemGroupProps)),
29
+ );
30
+
31
+ comboboxItemGroupPropsContext.set(() => comboboxItemGroupProps);
32
+ </script>
33
+
34
+ {#if asChild}
35
+ {@render asChild(mergedProps)}
36
+ {:else}
37
+ <div {...mergedProps}>
38
+ {@render children?.()}
39
+ </div>
40
+ {/if}
@@ -1,27 +1,29 @@
1
- <script lang="ts" module>
2
- import type {AsChild, HtmlProps} from '../types.js';
3
-
4
- export interface ComboboxItemIndicatorProps extends HtmlProps<'span'> {
5
- asChild?: AsChild;
6
- }
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../utils.svelte.js';
11
- import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
12
-
13
- let {asChild, children, ...props}: ComboboxItemIndicatorProps = $props();
14
-
15
- let combobox = comboboxContext.get();
16
- let itemProps = comboboxItemPropsContext.get();
17
-
18
- let attrs = $derived(mergeProps(props, combobox.getItemIndicatorProps(itemProps)));
19
- </script>
20
-
21
- {#if asChild}
22
- {@render asChild(attrs)}
23
- {:else}
24
- <span {...attrs}>
25
- {@render children?.()}
26
- </span>
27
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxItemIndicatorProps extends HTMLProps<'span'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
12
+
13
+ let {asChild, children, ...props}: ComboboxItemIndicatorProps = $props();
14
+
15
+ let combobox = comboboxContext.get();
16
+ let itemProps = comboboxItemPropsContext.get();
17
+
18
+ let mergedProps = $derived(
19
+ mergeProps(props, combobox.getItemIndicatorProps(itemProps)),
20
+ );
21
+ </script>
22
+
23
+ {#if asChild}
24
+ {@render asChild(mergedProps)}
25
+ {:else}
26
+ <span {...mergedProps}>
27
+ {@render children?.()}
28
+ </span>
29
+ {/if}
@@ -1,31 +1,33 @@
1
- <script lang="ts" module>
2
- import type {AsChild, HtmlProps} from '../types.js';
3
-
4
- export interface ComboboxItemTextProps extends HtmlProps<'span'> {
5
- asChild?: AsChild;
6
- }
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../utils.svelte.js';
11
- import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
12
-
13
- let {asChild, children, ...props}: ComboboxItemTextProps = $props();
14
-
15
- let combobox = comboboxContext.get();
16
- let itemProps = comboboxItemPropsContext.get();
17
-
18
- let attrs = $derived(mergeProps(props, combobox.getItemTextProps(itemProps)));
19
- </script>
20
-
21
- {#if asChild}
22
- {@render asChild(attrs)}
23
- {:else}
24
- <span {...attrs}>
25
- {#if children}
26
- {@render children?.()}
27
- {:else}
28
- {combobox.collection.stringifyItem(itemProps.item)}
29
- {/if}
30
- </span>
31
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxItemTextProps extends HTMLProps<'span'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
12
+
13
+ let {asChild, children, ...props}: ComboboxItemTextProps = $props();
14
+
15
+ let combobox = comboboxContext.get();
16
+ let itemProps = comboboxItemPropsContext.get();
17
+
18
+ let mergedProps = $derived(
19
+ mergeProps(props, combobox.getItemTextProps(itemProps)),
20
+ );
21
+ </script>
22
+
23
+ {#if asChild}
24
+ {@render asChild(mergedProps)}
25
+ {:else}
26
+ <span {...mergedProps}>
27
+ {#if children}
28
+ {@render children?.()}
29
+ {:else}
30
+ {combobox.collection.stringifyItem(itemProps.item)}
31
+ {/if}
32
+ </span>
33
+ {/if}
@@ -1,36 +1,40 @@
1
- <script lang="ts" module>
2
- import type {AsChild, Assign, GenericHtmlProps, HtmlProps} from '../types.js';
3
- import type {ItemProps, ItemState} from '@zag-js/combobox';
4
- import type {Snippet} from 'svelte';
5
-
6
- export interface ComboboxItemProps extends Assign<Omit<HtmlProps<'div'>, 'children'>, ItemProps> {
7
- asChild?: AsChild<GenericHtmlProps, ItemState>;
8
- children?: Snippet<[state: ItemState]>;
9
- }
10
- </script>
11
-
12
- <script lang="ts">
13
- import {mergeProps} from '../utils.svelte.js';
14
- import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
15
-
16
- let {item, persistFocus, asChild, children, ...props}: ComboboxItemProps = $props();
17
-
18
- let combobox = comboboxContext.get();
19
- let itemProps = $derived({
20
- item,
21
- persistFocus,
22
- });
23
-
24
- let state = $derived(combobox.getItemState(itemProps));
25
- let attrs = $derived(mergeProps(props, combobox.getItemProps(itemProps)));
26
-
27
- comboboxItemPropsContext.set(() => itemProps);
28
- </script>
29
-
30
- {#if asChild}
31
- {@render asChild(attrs, state)}
32
- {:else}
33
- <div {...attrs}>
34
- {@render children?.(state)}
35
- </div>
36
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, Assign, HTMLProps} from '../types.js';
3
+ import type {ItemProps, ItemState} from '@zag-js/combobox';
4
+ import type {Snippet} from 'svelte';
5
+
6
+ export interface ComboboxItemProps
7
+ extends Assign<Omit<HTMLProps<'div'>, 'children'>, ItemProps> {
8
+ asChild?: AsChild<ItemState>;
9
+ children?: Snippet<[ItemState]>;
10
+ }
11
+ </script>
12
+
13
+ <script lang="ts">
14
+ import {mergeProps} from '../merge-props.js';
15
+ import {createSplitProps} from '@zag-js/utils';
16
+ import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
17
+
18
+ let {asChild, children, ...props}: ComboboxItemProps = $props();
19
+
20
+ let combobox = comboboxContext.get();
21
+
22
+ let [itemProps, otherProps] = $derived(
23
+ createSplitProps<ItemProps>(['item', 'persistFocus'])(props),
24
+ );
25
+
26
+ let itemState = $derived(combobox.getItemState(itemProps));
27
+ let mergedProps = $derived(
28
+ mergeProps(otherProps, combobox.getItemProps(itemProps)),
29
+ );
30
+
31
+ comboboxItemPropsContext.set(() => itemProps);
32
+ </script>
33
+
34
+ {#if asChild}
35
+ {@render asChild(mergedProps, itemState)}
36
+ {:else}
37
+ <div {...mergedProps}>
38
+ {@render children?.(itemState)}
39
+ </div>
40
+ {/if}
@@ -1,26 +1,26 @@
1
- <script lang="ts" module>
2
- import type {AsChild, HtmlProps} from '../types.js';
3
-
4
- export interface ComboboxLabelProps extends HtmlProps<'label'> {
5
- asChild?: AsChild<HtmlProps<'label'>>;
6
- }
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../utils.svelte.js';
11
- import {comboboxContext} from './context.svelte.js';
12
-
13
- let {asChild, children, ...props}: ComboboxLabelProps = $props();
14
-
15
- let combobox = comboboxContext.get();
16
-
17
- let attrs = $derived(mergeProps(props, combobox.getLabelProps()));
18
- </script>
19
-
20
- {#if asChild}
21
- {@render asChild(attrs)}
22
- {:else}
23
- <label {...attrs}>
24
- {@render children?.()}
25
- </label>
26
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxLabelProps extends HTMLProps<'label'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {comboboxContext} from './context.svelte.js';
12
+
13
+ let {asChild, children, ...props}: ComboboxLabelProps = $props();
14
+
15
+ let combobox = comboboxContext.get();
16
+
17
+ let mergedProps = $derived(mergeProps(props, combobox.getLabelProps()));
18
+ </script>
19
+
20
+ {#if asChild}
21
+ {@render asChild(mergedProps)}
22
+ {:else}
23
+ <label {...mergedProps}>
24
+ {@render children?.()}
25
+ </label>
26
+ {/if}
@@ -1,26 +1,26 @@
1
- <script lang="ts" module>
2
- import type {AsChild, HtmlProps} from '../types.js';
3
-
4
- export interface ComboboxListProps extends HtmlProps<'div'> {
5
- asChild?: AsChild;
6
- }
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../utils.svelte.js';
11
- import {comboboxContext} from './context.svelte.js';
12
-
13
- let {asChild, children, ...props}: ComboboxListProps = $props();
14
-
15
- let combobox = comboboxContext.get();
16
-
17
- let attrs = $derived(mergeProps(props, combobox.getListProps()));
18
- </script>
19
-
20
- {#if asChild}
21
- {@render asChild(attrs)}
22
- {:else}
23
- <div {...attrs}>
24
- {@render children?.()}
25
- </div>
26
- {/if}
1
+ <script lang="ts" module>
2
+ import type {AsChild, HTMLProps} from '../types.js';
3
+
4
+ export interface ComboboxListProps extends HTMLProps<'div'> {
5
+ asChild?: AsChild;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {comboboxContext} from './context.svelte.js';
12
+
13
+ let {asChild, children, ...props}: ComboboxListProps = $props();
14
+
15
+ let combobox = comboboxContext.get();
16
+
17
+ let mergedProps = $derived(mergeProps(props, combobox.getListProps()));
18
+ </script>
19
+
20
+ {#if asChild}
21
+ {@render asChild(mergedProps)}
22
+ {:else}
23
+ <div {...mergedProps}>
24
+ {@render children?.()}
25
+ </div>
26
+ {/if}