@editora/ui-core 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (365) hide show
  1. package/dist/{ElementBase-DxbvhLJs.js → ElementBase-CbUsP3D6.js} +1 -1
  2. package/dist/{ElementBase-BeZT54Hj.mjs → ElementBase-D5QsC5Vw.mjs} +10 -1
  3. package/dist/ElementBase.d.ts +7 -0
  4. package/dist/ElementBase.d.ts.map +1 -1
  5. package/dist/accordion.cjs.js +1 -1
  6. package/dist/accordion.esm.js +1 -1
  7. package/dist/add-icons-CVeHOsWl.js +1 -0
  8. package/dist/add-icons-DBUZJ0g7.mjs +14 -0
  9. package/dist/add-icons.cjs.js +1 -0
  10. package/dist/add-icons.d.ts +16 -0
  11. package/dist/add-icons.d.ts.map +1 -0
  12. package/dist/add-icons.esm.js +4 -0
  13. package/dist/alert-dialog.cjs.js +24 -24
  14. package/dist/alert-dialog.esm.js +112 -107
  15. package/dist/alert.cjs.js +8 -8
  16. package/dist/alert.esm.js +22 -22
  17. package/dist/animated-beam.cjs.js +1 -1
  18. package/dist/animated-beam.esm.js +1 -1
  19. package/dist/animated-list.cjs.js +1 -1
  20. package/dist/animated-list.esm.js +1 -1
  21. package/dist/animated-text.cjs.js +1 -1
  22. package/dist/animated-text.esm.js +1 -1
  23. package/dist/app-header.cjs.js +15 -3
  24. package/dist/app-header.esm.js +31 -4
  25. package/dist/aspect-ratio.cjs.js +1 -1
  26. package/dist/aspect-ratio.esm.js +1 -1
  27. package/dist/avatar.cjs.js +1 -1
  28. package/dist/avatar.esm.js +1 -1
  29. package/dist/badge.cjs.js +1 -1
  30. package/dist/badge.esm.js +1 -1
  31. package/dist/block-controls.cjs.js +1 -1
  32. package/dist/block-controls.esm.js +1 -1
  33. package/dist/box.cjs.js +1 -1
  34. package/dist/box.esm.js +1 -1
  35. package/dist/breadcrumb.cjs.js +4 -4
  36. package/dist/breadcrumb.esm.js +93 -84
  37. package/dist/button.cjs.js +520 -1
  38. package/dist/button.esm.js +682 -2
  39. package/dist/{calendar-CzpWDxLc.js → calendar-BsVqtpjM.js} +6 -6
  40. package/dist/{calendar-DkSDFg33.mjs → calendar-CFafqZVA.mjs} +6 -6
  41. package/dist/calendar.cjs.js +1 -1
  42. package/dist/calendar.esm.js +1 -1
  43. package/dist/card.cjs.js +6 -5
  44. package/dist/card.esm.js +52 -39
  45. package/dist/chart.cjs.js +2 -2
  46. package/dist/chart.esm.js +2 -2
  47. package/dist/checkbox.cjs.js +4 -4
  48. package/dist/checkbox.esm.js +36 -15
  49. package/dist/clone-source-BxK2pEVw.mjs +11 -0
  50. package/dist/clone-source-C7E_ri5f.js +1 -0
  51. package/dist/collapsible.cjs.js +1 -1
  52. package/dist/collapsible.esm.js +1 -1
  53. package/dist/color-picker.cjs.js +2 -2
  54. package/dist/color-picker.esm.js +3 -3
  55. package/dist/combobox.cjs.js +4 -4
  56. package/dist/combobox.esm.js +22 -19
  57. package/dist/command-palette.cjs.js +1 -1
  58. package/dist/command-palette.esm.js +1 -1
  59. package/dist/command.cjs.js +1 -1
  60. package/dist/command.esm.js +1 -1
  61. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  62. package/dist/components/ui-alert.d.ts.map +1 -1
  63. package/dist/components/ui-app-header.d.ts +1 -0
  64. package/dist/components/ui-app-header.d.ts.map +1 -1
  65. package/dist/components/ui-breadcrumb.d.ts.map +1 -1
  66. package/dist/components/ui-card.d.ts +7 -0
  67. package/dist/components/ui-card.d.ts.map +1 -1
  68. package/dist/components/ui-checkbox.d.ts +6 -0
  69. package/dist/components/ui-checkbox.d.ts.map +1 -1
  70. package/dist/components/ui-combobox.d.ts.map +1 -1
  71. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  72. package/dist/components/ui-dialog.d.ts +1 -0
  73. package/dist/components/ui-dialog.d.ts.map +1 -1
  74. package/dist/components/ui-drawer.d.ts.map +1 -1
  75. package/dist/components/ui-dropdown.d.ts.map +1 -1
  76. package/dist/components/ui-empty-state.d.ts.map +1 -1
  77. package/dist/components/ui-hover-card.d.ts.map +1 -1
  78. package/dist/components/ui-icon.d.ts +1 -0
  79. package/dist/components/ui-icon.d.ts.map +1 -1
  80. package/dist/components/ui-input.d.ts +16 -0
  81. package/dist/components/ui-input.d.ts.map +1 -1
  82. package/dist/components/ui-layout.d.ts +20 -0
  83. package/dist/components/ui-layout.d.ts.map +1 -1
  84. package/dist/components/ui-menu.d.ts +1 -0
  85. package/dist/components/ui-menu.d.ts.map +1 -1
  86. package/dist/components/ui-menubar.d.ts.map +1 -1
  87. package/dist/components/ui-multi-select.d.ts +6 -0
  88. package/dist/components/ui-multi-select.d.ts.map +1 -1
  89. package/dist/components/ui-number-field.d.ts +6 -0
  90. package/dist/components/ui-number-field.d.ts.map +1 -1
  91. package/dist/components/ui-pagination.d.ts.map +1 -1
  92. package/dist/components/ui-password-field.d.ts +11 -0
  93. package/dist/components/ui-password-field.d.ts.map +1 -1
  94. package/dist/components/ui-popover.d.ts.map +1 -1
  95. package/dist/components/ui-positioner.d.ts.map +1 -1
  96. package/dist/components/ui-radio-group.d.ts +6 -0
  97. package/dist/components/ui-radio-group.d.ts.map +1 -1
  98. package/dist/components/ui-rating.d.ts +1 -0
  99. package/dist/components/ui-rating.d.ts.map +1 -1
  100. package/dist/components/ui-select.d.ts +7 -0
  101. package/dist/components/ui-select.d.ts.map +1 -1
  102. package/dist/components/ui-sidebar.d.ts +1 -0
  103. package/dist/components/ui-sidebar.d.ts.map +1 -1
  104. package/dist/components/ui-slider.d.ts +6 -0
  105. package/dist/components/ui-slider.d.ts.map +1 -1
  106. package/dist/components/ui-sortable.d.ts +1 -0
  107. package/dist/components/ui-sortable.d.ts.map +1 -1
  108. package/dist/components/ui-switch.d.ts +6 -0
  109. package/dist/components/ui-switch.d.ts.map +1 -1
  110. package/dist/components/ui-tabs.d.ts +2 -0
  111. package/dist/components/ui-tabs.d.ts.map +1 -1
  112. package/dist/components/ui-textarea.d.ts +6 -0
  113. package/dist/components/ui-textarea.d.ts.map +1 -1
  114. package/dist/components/ui-toast.d.ts.map +1 -1
  115. package/dist/components/ui-tooltip.d.ts.map +1 -1
  116. package/dist/container.cjs.js +1 -1
  117. package/dist/container.esm.js +1 -1
  118. package/dist/context-menu.cjs.js +2 -2
  119. package/dist/context-menu.esm.js +2 -2
  120. package/dist/control-group.cjs.js +1 -1
  121. package/dist/control-group.esm.js +1 -1
  122. package/dist/data-table.cjs.js +5 -5
  123. package/dist/data-table.esm.js +7 -7
  124. package/dist/date-field.cjs.js +1 -1
  125. package/dist/date-field.esm.js +3 -3
  126. package/dist/date-picker.cjs.js +2 -2
  127. package/dist/date-picker.esm.js +17 -17
  128. package/dist/date-range-picker.cjs.js +2 -2
  129. package/dist/date-range-picker.esm.js +4 -4
  130. package/dist/date-range-time-picker.cjs.js +3 -3
  131. package/dist/date-range-time-picker.esm.js +16 -16
  132. package/dist/date-time-picker.cjs.js +26 -23
  133. package/dist/date-time-picker.esm.js +49 -46
  134. package/dist/{date-time-utils-zAx4ghvC.mjs → date-time-utils-CJUksWj3.mjs} +1 -1
  135. package/dist/{date-time-utils-C-4eHTyy.js → date-time-utils-D3hQQ5Om.js} +1 -1
  136. package/dist/description.cjs.js +1 -1
  137. package/dist/description.esm.js +1 -1
  138. package/dist/dialog.cjs.js +7 -7
  139. package/dist/dialog.esm.js +51 -47
  140. package/dist/direction-provider.cjs.js +1 -1
  141. package/dist/direction-provider.esm.js +1 -1
  142. package/dist/dismissable-layer.cjs.js +1 -1
  143. package/dist/dismissable-layer.esm.js +1 -1
  144. package/dist/dock.cjs.js +1 -1
  145. package/dist/dock.esm.js +1 -1
  146. package/dist/drawer.cjs.js +5 -5
  147. package/dist/drawer.esm.js +18 -17
  148. package/dist/dropdown.cjs.js +7 -7
  149. package/dist/dropdown.esm.js +39 -38
  150. package/dist/empty-state.cjs.js +12 -2
  151. package/dist/empty-state.esm.js +17 -7
  152. package/dist/field-error.cjs.js +1 -1
  153. package/dist/field-error.esm.js +1 -1
  154. package/dist/field.cjs.js +2 -2
  155. package/dist/field.esm.js +2 -2
  156. package/dist/fieldset.cjs.js +1 -1
  157. package/dist/fieldset.esm.js +1 -1
  158. package/dist/file-upload.cjs.js +1 -1
  159. package/dist/file-upload.esm.js +1 -1
  160. package/dist/flex.cjs.js +1 -1
  161. package/dist/flex.esm.js +1 -1
  162. package/dist/floating-toolbar.cjs.js +2 -2
  163. package/dist/floating-toolbar.esm.js +2 -2
  164. package/dist/focus-scope-Dl0qk5GP.mjs +177 -0
  165. package/dist/focus-scope-Doz0bnE1.js +1 -0
  166. package/dist/focus-scope.cjs.js +1 -1
  167. package/dist/focus-scope.esm.js +2 -2
  168. package/dist/form-control-B90_3kYN.js +1 -0
  169. package/dist/form-control-D9wWUMBl.mjs +86 -0
  170. package/dist/form.cjs.js +2 -2
  171. package/dist/form.esm.js +2 -2
  172. package/dist/gantt.cjs.js +2 -2
  173. package/dist/gantt.esm.js +2 -2
  174. package/dist/grid.cjs.js +1 -1
  175. package/dist/grid.esm.js +1 -1
  176. package/dist/hover-card.cjs.js +5 -5
  177. package/dist/hover-card.esm.js +19 -18
  178. package/dist/icon-cloud.cjs.js +1 -1
  179. package/dist/icon-cloud.esm.js +1 -1
  180. package/dist/icon.cjs.js +207 -1
  181. package/dist/icon.esm.js +294 -2
  182. package/dist/icons-CpCpPXV5.js +1 -0
  183. package/dist/icons-DWYbbhb0.mjs +115 -0
  184. package/dist/icons.d.ts +11 -1
  185. package/dist/icons.d.ts.map +1 -1
  186. package/dist/implicit-submit-B6M5Uc56.js +1 -0
  187. package/dist/implicit-submit-Lr0-q2LR.mjs +44 -0
  188. package/dist/index.cjs.js +1 -1
  189. package/dist/index.d.ts +1 -0
  190. package/dist/index.d.ts.map +1 -1
  191. package/dist/index.esm.js +309 -299
  192. package/dist/inline-edit.cjs.js +1 -1
  193. package/dist/inline-edit.esm.js +1 -1
  194. package/dist/input.cjs.js +62 -20
  195. package/dist/input.esm.js +164 -58
  196. package/dist/label.cjs.js +1 -1
  197. package/dist/label.esm.js +1 -1
  198. package/dist/layout.cjs.js +145 -4
  199. package/dist/layout.esm.js +278 -40
  200. package/dist/marquee.cjs.js +1 -1
  201. package/dist/marquee.esm.js +1 -1
  202. package/dist/masonry-grid.cjs.js +1 -1
  203. package/dist/masonry-grid.esm.js +1 -1
  204. package/dist/menu.cjs.js +8 -8
  205. package/dist/menu.esm.js +51 -47
  206. package/dist/menubar.cjs.js +9 -9
  207. package/dist/menubar.esm.js +41 -40
  208. package/dist/meter.cjs.js +1 -1
  209. package/dist/meter.esm.js +1 -1
  210. package/dist/multi-select.cjs.js +7 -7
  211. package/dist/multi-select.esm.js +55 -34
  212. package/dist/navigate-CXebafwF.mjs +18 -0
  213. package/dist/navigate-ChJVIIuS.js +1 -0
  214. package/dist/navigation-menu.cjs.js +1 -1
  215. package/dist/navigation-menu.esm.js +1 -1
  216. package/dist/number-attribute-BAF07JrU.mjs +8 -0
  217. package/dist/number-attribute-C4Rrl7d3.js +1 -0
  218. package/dist/number-field.cjs.js +8 -8
  219. package/dist/number-field.esm.js +90 -69
  220. package/dist/number-ticker.cjs.js +1 -1
  221. package/dist/number-ticker.esm.js +1 -1
  222. package/dist/odometer.cjs.js +1 -1
  223. package/dist/odometer.esm.js +1 -1
  224. package/dist/orbiter.cjs.js +1 -1
  225. package/dist/orbiter.esm.js +1 -1
  226. package/dist/pagination.cjs.js +24 -23
  227. package/dist/pagination.esm.js +61 -46
  228. package/dist/{panel-group-BVHJEdfx.js → panel-group-BIzzpQ5i.js} +1 -1
  229. package/dist/{panel-group-BxO_eNW6.mjs → panel-group-CFLjzRWI.mjs} +1 -1
  230. package/dist/panel-group.cjs.js +1 -1
  231. package/dist/panel-group.esm.js +1 -1
  232. package/dist/panel.cjs.js +1 -1
  233. package/dist/panel.esm.js +1 -1
  234. package/dist/password-field.cjs.js +36 -16
  235. package/dist/password-field.esm.js +113 -44
  236. package/dist/pin-input.cjs.js +1 -1
  237. package/dist/pin-input.esm.js +1 -1
  238. package/dist/placement-grid.cjs.js +1 -1
  239. package/dist/placement-grid.esm.js +1 -1
  240. package/dist/plugin-panel.cjs.js +1 -1
  241. package/dist/plugin-panel.esm.js +1 -1
  242. package/dist/popover.cjs.js +2 -2
  243. package/dist/popover.esm.js +28 -26
  244. package/dist/portal.cjs.js +1 -1
  245. package/dist/portal.esm.js +1 -1
  246. package/dist/positioner.cjs.js +2 -2
  247. package/dist/positioner.esm.js +35 -38
  248. package/dist/preload.cjs.js +221 -0
  249. package/dist/preload.css +220 -0
  250. package/dist/preload.d.ts +17 -0
  251. package/dist/preload.d.ts.map +1 -0
  252. package/dist/preload.esm.js +224 -0
  253. package/dist/presence.cjs.js +1 -1
  254. package/dist/presence.esm.js +1 -1
  255. package/dist/primitives/clone-source.d.ts +3 -0
  256. package/dist/primitives/clone-source.d.ts.map +1 -0
  257. package/dist/primitives/focus-scope.d.ts +6 -0
  258. package/dist/primitives/focus-scope.d.ts.map +1 -1
  259. package/dist/primitives/form-control.d.ts +68 -0
  260. package/dist/primitives/form-control.d.ts.map +1 -0
  261. package/dist/primitives/implicit-submit.d.ts +17 -0
  262. package/dist/primitives/implicit-submit.d.ts.map +1 -0
  263. package/dist/primitives/navigate.d.ts +27 -0
  264. package/dist/primitives/navigate.d.ts.map +1 -0
  265. package/dist/primitives/number-attribute.d.ts +7 -0
  266. package/dist/primitives/number-attribute.d.ts.map +1 -0
  267. package/dist/primitives/slotted-input.d.ts +19 -0
  268. package/dist/primitives/slotted-input.d.ts.map +1 -0
  269. package/dist/progress.cjs.js +3 -3
  270. package/dist/progress.esm.js +3 -3
  271. package/dist/quick-actions.cjs.js +5 -5
  272. package/dist/quick-actions.esm.js +3 -3
  273. package/dist/radio-group.cjs.js +9 -9
  274. package/dist/radio-group.esm.js +47 -24
  275. package/dist/radio.cjs.js +1 -1
  276. package/dist/radio.esm.js +1 -1
  277. package/dist/rating.cjs.js +6 -6
  278. package/dist/rating.esm.js +21 -10
  279. package/dist/{runtime-BRT7E4A8.mjs → runtime-CORXjP7e.mjs} +379 -357
  280. package/dist/runtime-uCly3ECd.js +5 -0
  281. package/dist/runtime.cjs.js +1 -1
  282. package/dist/runtime.esm.js +1 -1
  283. package/dist/scroll-area.cjs.js +1 -1
  284. package/dist/scroll-area.esm.js +1 -1
  285. package/dist/section.cjs.js +1 -1
  286. package/dist/section.esm.js +1 -1
  287. package/dist/select.cjs.js +21 -21
  288. package/dist/select.esm.js +111 -71
  289. package/dist/selection-popup.cjs.js +2 -2
  290. package/dist/selection-popup.esm.js +2 -2
  291. package/dist/semantic-tokens.d.ts.map +1 -1
  292. package/dist/separator.cjs.js +1 -1
  293. package/dist/separator.esm.js +1 -1
  294. package/dist/sidebar.cjs.js +15 -15
  295. package/dist/sidebar.esm.js +48 -42
  296. package/dist/skeleton.cjs.js +1 -1
  297. package/dist/skeleton.esm.js +1 -1
  298. package/dist/slider.cjs.js +11 -11
  299. package/dist/slider.esm.js +40 -23
  300. package/dist/slot.cjs.js +1 -1
  301. package/dist/slot.esm.js +1 -1
  302. package/dist/slotted-input-BVq2QQg2.js +1 -0
  303. package/dist/slotted-input-atWznLfm.mjs +13 -0
  304. package/dist/sortable.cjs.js +25 -25
  305. package/dist/sortable.esm.js +29 -21
  306. package/dist/spinning-text.cjs.js +1 -1
  307. package/dist/spinning-text.esm.js +1 -1
  308. package/dist/split-button.cjs.js +1 -1
  309. package/dist/split-button.esm.js +1 -1
  310. package/dist/splitter.cjs.js +1 -1
  311. package/dist/splitter.esm.js +1 -1
  312. package/dist/standalone/add-icons.d.ts +2 -0
  313. package/dist/standalone/add-icons.d.ts.map +1 -0
  314. package/dist/standalone/preload.d.ts +2 -0
  315. package/dist/standalone/preload.d.ts.map +1 -0
  316. package/dist/stepper.cjs.js +3 -3
  317. package/dist/stepper.esm.js +3 -3
  318. package/dist/switch.cjs.js +9 -9
  319. package/dist/switch.esm.js +56 -35
  320. package/dist/table.cjs.js +1 -1
  321. package/dist/table.esm.js +1 -1
  322. package/dist/tabs.cjs.js +14 -14
  323. package/dist/tabs.esm.js +129 -115
  324. package/dist/tags-input.cjs.js +1 -1
  325. package/dist/tags-input.esm.js +1 -1
  326. package/dist/textarea.cjs.js +33 -11
  327. package/dist/textarea.esm.js +74 -35
  328. package/dist/theme.d.ts +6 -0
  329. package/dist/theme.d.ts.map +1 -1
  330. package/dist/time-field.cjs.js +1 -1
  331. package/dist/time-field.esm.js +2 -2
  332. package/dist/time-picker.cjs.js +1 -1
  333. package/dist/time-picker.esm.js +3 -3
  334. package/dist/timeline.cjs.js +2 -2
  335. package/dist/timeline.esm.js +2 -2
  336. package/dist/toast.cjs.js +4 -4
  337. package/dist/toast.esm.js +17 -16
  338. package/dist/toggle-group.cjs.js +1 -1
  339. package/dist/toggle-group.esm.js +1 -1
  340. package/dist/toggle.cjs.js +3 -3
  341. package/dist/toggle.esm.js +9 -9
  342. package/dist/toolbar.cjs.js +1 -1
  343. package/dist/toolbar.esm.js +1 -1
  344. package/dist/tooltip.cjs.js +2 -2
  345. package/dist/tooltip.esm.js +12 -14
  346. package/dist/transfer-list.cjs.js +1 -1
  347. package/dist/transfer-list.esm.js +1 -1
  348. package/dist/{tree-33fVNnaf.mjs → tree-CD2k2lIC.mjs} +1 -1
  349. package/dist/{tree-Dc02MChE.js → tree-ChQfhxya.js} +1 -1
  350. package/dist/tree-item.cjs.js +1 -1
  351. package/dist/tree-item.esm.js +1 -1
  352. package/dist/tree.cjs.js +1 -1
  353. package/dist/tree.esm.js +1 -1
  354. package/dist/visually-hidden.cjs.js +1 -1
  355. package/dist/visually-hidden.esm.js +1 -1
  356. package/dist/wizard.cjs.js +4 -4
  357. package/dist/wizard.esm.js +4 -4
  358. package/package.json +3 -2
  359. package/dist/focus-scope-Bwug2gDv.js +0 -1
  360. package/dist/focus-scope-CmEsG5UZ.mjs +0 -138
  361. package/dist/runtime-CXw4SGV9.js +0 -5
  362. package/dist/ui-button-C3OmI7Sn.mjs +0 -684
  363. package/dist/ui-button-CnLwXBnx.js +0 -520
  364. package/dist/ui-icon-D3avtxX_.js +0 -207
  365. package/dist/ui-icon-DLhB08Fo.mjs +0 -361
@@ -1,4 +1,5 @@
1
- import { E as T } from "./ElementBase-BeZT54Hj.mjs";
1
+ import { E as D } from "./ElementBase-D5QsC5Vw.mjs";
2
+ import { r as T } from "./navigate-CXebafwF.mjs";
2
3
  const y = {
3
4
  sm: { expanded: 220, collapsed: 64, min: 168, max: 300 },
4
5
  md: { expanded: 236, collapsed: 72, min: 180, max: 320 },
@@ -28,7 +29,7 @@ const y = {
28
29
  "collapsed-width",
29
30
  "storage-key",
30
31
  "auto-save"
31
- ]), D = (o) => `
32
+ ]), V = (o) => `
32
33
  <style>
33
34
  :host {
34
35
  --ui-sidebar-bg: var(--base-sidebar-bg, var(--color-panel-solid, var(--ui-color-surface, #ffffff)));
@@ -280,7 +281,7 @@ const y = {
280
281
  inset: 0;
281
282
  border-radius: inherit;
282
283
  pointer-events: none;
283
- box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 8%, transparent);
284
+ box-shadow: var(--base-sidebar-outline, inset 0 0 0 1px color-mix(in srgb, currentColor 8%, transparent));
284
285
  }
285
286
 
286
287
  .header-wrap,
@@ -744,10 +745,10 @@ const y = {
744
745
  </style>
745
746
  ${o}
746
747
  `;
747
- function d(o) {
748
+ function l(o) {
748
749
  return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
749
750
  }
750
- function f(o) {
751
+ function v(o) {
751
752
  if (!o) return null;
752
753
  const e = o.trim();
753
754
  return e ? ["none", "sm", "md", "lg", "full"].includes(e) ? e : /^\d+(\.\d+)?$/.test(e) ? `${e}px` : e : null;
@@ -760,15 +761,15 @@ function m(o) {
760
761
  function z(o) {
761
762
  return o === "sm" || o === "1" ? "sm" : o === "lg" || o === "3" ? "lg" : "md";
762
763
  }
763
- function l(o, e) {
764
+ function c(o, e) {
764
765
  if (!o) return e;
765
766
  const i = Number.parseFloat(String(o));
766
767
  return Number.isFinite(i) ? i : e;
767
768
  }
768
- function v(o) {
769
+ function f(o) {
769
770
  return o.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") || "item";
770
771
  }
771
- class V extends T {
772
+ class q extends D {
772
773
  constructor() {
773
774
  super(...arguments), this._observer = null, this._resizeCleanup = null, this._responsiveCleanup = null, this._responsiveAutoCollapsed = !1, this._userCollapsePreference = !1, this._expanded = /* @__PURE__ */ new Set(), this._dragging = !1, this._lastExpandedWidth = 0, this._handleSearchInput = (e) => {
774
775
  const i = e.target;
@@ -826,7 +827,7 @@ class V extends T {
826
827
  attributeChangedCallback(e, i, r) {
827
828
  if (i !== r) {
828
829
  if (e === "radius" && this.isConnected) {
829
- const t = f(r);
830
+ const t = v(r);
830
831
  if (t && t !== r) {
831
832
  this.setAttribute("radius", t);
832
833
  return;
@@ -879,7 +880,7 @@ class V extends T {
879
880
  <aside class="shell" part="shell">
880
881
  <div class="header-wrap" part="header" ${i ? "hidden" : ""}><slot name="header"></slot></div>
881
882
  <div class="search-wrap" part="search" ${r ? "hidden" : ""}><slot name="search"></slot></div>
882
- <nav class="nav" part="nav" aria-label="${d(this.getAttribute("aria-label") || "Sidebar")}">
883
+ <nav class="nav" part="nav" aria-label="${l(this.getAttribute("aria-label") || "Sidebar")}">
883
884
  ${e}
884
885
  </nav>
885
886
  <div class="promo-wrap" part="promo" ${s ? "hidden" : ""}><slot name="promo"></slot></div>
@@ -887,7 +888,7 @@ class V extends T {
887
888
  <button class="resize-handle" part="resize-handle" type="button" aria-label="Resize sidebar"></button>
888
889
  </aside>
889
890
  `;
890
- this.setContent(D(n)), this._applyItemMetrics(), this._applyRadius(), this._applySizing(), this._bindInteractions(), this._syncActiveDom(), this._syncExpandedDom();
891
+ this.setContent(V(n)), this._applyItemMetrics(), this._applyRadius(), this._applySizing(), this._bindInteractions(), this._syncActiveDom(), this._syncExpandedDom();
891
892
  }
892
893
  _observeLightDom() {
893
894
  this._observer || (this._observer = new MutationObserver((e) => {
@@ -903,8 +904,8 @@ class V extends T {
903
904
  const e = this._groupItems(this._filterItems(this._collectItems(), this.getAttribute("search-query") || ""));
904
905
  return e.length ? e.map(({ label: i, items: r }) => `
905
906
  <section class="section" part="section">
906
- ${i ? `<div class="section-label" part="section-label">${d(i)}</div>` : ""}
907
- <div class="section-items">${r.map((s, n) => this._renderItem(s, `${v(i || "general")}-${n}`)).join("")}</div>
907
+ ${i ? `<div class="section-label" part="section-label">${l(i)}</div>` : ""}
908
+ <div class="section-items">${r.map((s, n) => this._renderItem(s, `${f(i || "general")}-${n}`)).join("")}</div>
908
909
  </section>
909
910
  `).join("") : `
910
911
  <section class="section" part="section">
@@ -922,19 +923,19 @@ class V extends T {
922
923
  `;
923
924
  }
924
925
  _renderItem(e, i) {
925
- const r = e.id || i, t = this.value ? this.value === e.value : !!e.active, s = this._expanded.has(r), n = this.getAttribute("show-icons") !== "false", a = this.getAttribute("show-badges") !== "false", c = e.description ? `<div class="item-description">${d(e.description)}</div>` : "", u = e.contentHtml ? `<span class="copy custom-copy">${e.contentHtml}</span>` : `<span class="copy">
926
- <span class="item-label">${d(e.label)}</span>
927
- ${c}
928
- </span>`, p = n ? this._renderIcon(e) : "", g = a && e.badge ? `<span class="badge" part="badge">${d(e.badge)}</span>` : "", b = e.children.length ? '<span class="arrow-wrap" part="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M6 3.75L10.25 8L6 12.25" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg></span>' : "", A = p ? `<span class="icon-wrap" part="icon"><span class="icon">${p}</span></span>` : "", C = g || b ? `<span class="end-wrap">${g ? `<span class="meta">${g}</span>` : ""}${b}</span>` : "", h = !!e.href && !e.children.length, E = t ? ' aria-current="page" data-active="true"' : "", $ = e.disabled ? ' aria-disabled="true"' : ' aria-disabled="false"', k = e.tone && e.tone !== "default" ? ` data-tone="${d(e.tone)}"` : "", I = h ? ` href="${d(e.href || "")}"` : "", S = h && e.target ? ` target="${d(e.target)}"` : "", P = h && e.rel ? ` rel="${d(e.rel)}"` : "", L = e.children.length ? `<div class="submenu" part="submenu"><div class="submenu-inner">${e.children.map((R, W) => this._renderItem(R, `${r}-${W}`)).join("")}</div></div>` : "", x = h ? "a" : "button", H = h ? "" : ' type="button"';
926
+ const r = e.id || i, t = this.value ? this.value === e.value : !!e.active, s = this._expanded.has(r), n = this.getAttribute("show-icons") !== "false", a = this.getAttribute("show-badges") !== "false", d = e.description ? `<div class="item-description">${l(e.description)}</div>` : "", u = e.contentHtml ? `<span class="copy custom-copy">${e.contentHtml}</span>` : `<span class="copy">
927
+ <span class="item-label">${l(e.label)}</span>
928
+ ${d}
929
+ </span>`, p = n ? this._renderIcon(e) : "", g = a && e.badge ? `<span class="badge" part="badge">${l(e.badge)}</span>` : "", b = e.children.length ? '<span class="arrow-wrap" part="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M6 3.75L10.25 8L6 12.25" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg></span>' : "", A = p ? `<span class="icon-wrap" part="icon"><span class="icon">${p}</span></span>` : "", C = g || b ? `<span class="end-wrap">${g ? `<span class="meta">${g}</span>` : ""}${b}</span>` : "", h = !!e.href && !e.children.length, E = t ? ' aria-current="page" data-active="true"' : "", $ = e.disabled ? ' aria-disabled="true"' : ' aria-disabled="false"', k = e.tone && e.tone !== "default" ? ` data-tone="${l(e.tone)}"` : "", I = h ? ` href="${l(e.href || "")}"` : "", S = h && e.target ? ` target="${l(e.target)}"` : "", P = h && e.rel ? ` rel="${l(e.rel)}"` : "", L = e.children.length ? `<div class="submenu" part="submenu"><div class="submenu-inner">${e.children.map((R, W) => this._renderItem(R, `${r}-${W}`)).join("")}</div></div>` : "", x = h ? "a" : "button", H = h ? "" : ' type="button"';
929
930
  return `
930
- <div class="item" data-item-id="${d(r)}" data-value="${d(e.value)}" ${s ? 'data-expanded="true"' : ""}>
931
+ <div class="item" data-item-id="${l(r)}" data-value="${l(e.value)}" ${s ? 'data-expanded="true"' : ""}>
931
932
  <${x}
932
933
  class="item-button"
933
934
  part="item"
934
935
  ${H}
935
936
  data-action="${e.children.length ? "toggle" : h ? "navigate" : "select"}"
936
- data-item-id="${d(r)}"
937
- data-value="${d(e.value)}"
937
+ data-item-id="${l(r)}"
938
+ data-value="${l(e.value)}"
938
939
  ${I}
939
940
  ${S}
940
941
  ${P}
@@ -997,17 +998,17 @@ class V extends T {
997
998
  const i = String(e.iconHtml || "").trim();
998
999
  if (i) return i;
999
1000
  const r = String(e.icon || "").trim();
1000
- return r ? d(r) : "";
1001
+ return r ? l(r) : "";
1001
1002
  }
1002
1003
  _normalizeItems(e, i = 0, r = "") {
1003
1004
  return e.map((t, s) => {
1004
- const n = t.label?.trim() || t.value?.trim() || `Item ${s + 1}`, a = t.value?.trim() || v(n), c = t.section?.trim() || r || "", u = `${v(c || "nav")}-${v(a)}-${i}-${s}`, p = this._normalizeItems(t.children || [], i + 1, c);
1005
+ const n = t.label?.trim() || t.value?.trim() || `Item ${s + 1}`, a = t.value?.trim() || f(n), d = t.section?.trim() || r || "", u = `${f(d || "nav")}-${f(a)}-${i}-${s}`, p = this._normalizeItems(t.children || [], i + 1, d);
1005
1006
  return {
1006
1007
  ...t,
1007
1008
  id: u,
1008
1009
  label: n,
1009
1010
  value: a,
1010
- section: c,
1011
+ section: d,
1011
1012
  children: p,
1012
1013
  depth: i
1013
1014
  };
@@ -1046,19 +1047,24 @@ class V extends T {
1046
1047
  return;
1047
1048
  }
1048
1049
  if (s === "navigate") {
1049
- this._selectValue(a);
1050
+ this._selectValue(a), this._handleNavigate(r, t, a);
1050
1051
  return;
1051
1052
  }
1052
1053
  r.preventDefault(), this._selectValue(a);
1053
1054
  }
1054
1055
  }, i.onkeydown = (r) => {
1055
1056
  const t = r.currentTarget, s = t.dataset.itemId || "", n = t.dataset.value || "";
1056
- r.key === "ArrowRight" && t.dataset.action === "toggle" ? (r.preventDefault(), this._expanded.add(s), this._syncExpandedDom()) : r.key === "ArrowLeft" ? (r.preventDefault(), this._expanded.delete(s), this._syncExpandedDom()) : (r.key === "Enter" || r.key === " ") && (r.preventDefault(), t.dataset.action === "toggle" ? this._toggleExpanded(s) : this._selectValue(n));
1057
+ r.key === "ArrowRight" && t.dataset.action === "toggle" ? (r.preventDefault(), this._expanded.add(s), this._syncExpandedDom()) : r.key === "ArrowLeft" ? (r.preventDefault(), this._expanded.delete(s), this._syncExpandedDom()) : r.key === "Enter" && t.dataset.action === "navigate" || (r.key === "Enter" || r.key === " ") && (r.preventDefault(), t.dataset.action === "toggle" ? this._toggleExpanded(s) : t.dataset.action === "navigate" ? t.click() : this._selectValue(n));
1057
1058
  };
1058
1059
  });
1059
1060
  const e = this.root.querySelector(".resize-handle");
1060
1061
  e && (e.onkeydown = (i) => this._handleResizeKey(i), e.onpointerdown = (i) => this._startResize(i));
1061
1062
  }
1063
+ // Link items: the shared navigate contract (primitives/navigate.ts).
1064
+ _handleNavigate(e, i, r) {
1065
+ const t = this._flattenItems(this._collectItems()), s = t.findIndex((d) => d.value === r), n = t[s], a = i.getAttribute("href") || "";
1066
+ T(this, { index: s, value: r, label: n?.label || r, href: a, item: n }, e, i.getAttribute("target") || "") && e.preventDefault();
1067
+ }
1062
1068
  _toggleExpanded(e) {
1063
1069
  this.hasAttribute("collapsed") || (this._expanded.has(e) ? this._expanded.delete(e) : this._expanded.add(e), this._syncExpandedDom());
1064
1070
  }
@@ -1088,8 +1094,8 @@ class V extends T {
1088
1094
  return e.flatMap((i) => [i, ...this._flattenItems(i.children)]);
1089
1095
  }
1090
1096
  _applySizing() {
1091
- const e = z(this.getAttribute("size")), i = y[e], r = l(this.getAttribute("width"), i.expanded), t = l(this.getAttribute("min-width"), i.min), s = l(this.getAttribute("max-width"), i.max), n = l(this.getAttribute("collapsed-width"), i.collapsed), a = this._restoreWidth(r), c = Math.min(Math.max(a, t), s), u = this.hasAttribute("collapsed") ? n : c;
1092
- this.style.setProperty("--ui-sidebar-width", `${c}px`), this.style.setProperty("--ui-sidebar-min-width", `${t}px`), this.style.setProperty("--ui-sidebar-max-width", `${s}px`), this.style.setProperty("--ui-sidebar-collapsed-width", `${n}px`), this.style.setProperty("--ui-sidebar-current-width", `${u}px`), this.style.setProperty("inline-size", `${u}px`);
1097
+ const e = z(this.getAttribute("size")), i = y[e], r = c(this.getAttribute("width"), i.expanded), t = c(this.getAttribute("min-width"), i.min), s = c(this.getAttribute("max-width"), i.max), n = c(this.getAttribute("collapsed-width"), i.collapsed), a = this._restoreWidth(r), d = Math.min(Math.max(a, t), s), u = this.hasAttribute("collapsed") ? n : d;
1098
+ this.style.setProperty("--ui-sidebar-width", `${d}px`), this.style.setProperty("--ui-sidebar-min-width", `${t}px`), this.style.setProperty("--ui-sidebar-max-width", `${s}px`), this.style.setProperty("--ui-sidebar-collapsed-width", `${n}px`), this.style.setProperty("--ui-sidebar-current-width", `${u}px`), this.style.setProperty("inline-size", `${u}px`);
1093
1099
  }
1094
1100
  _applyRadius() {
1095
1101
  const e = this.getAttribute("radius"), i = this.getAttribute("item-radius");
@@ -1097,11 +1103,11 @@ class V extends T {
1097
1103
  this.style.removeProperty("--ui-sidebar-radius"), i || this.style.removeProperty("--ui-sidebar-item-radius"), this.style.removeProperty("--ui-sidebar-promo-radius");
1098
1104
  return;
1099
1105
  }
1100
- const r = f(e) || e;
1106
+ const r = v(e) || e;
1101
1107
  this.style.setProperty("--ui-sidebar-radius", r), i || this.style.setProperty("--ui-sidebar-item-radius", r), this.style.setProperty("--ui-sidebar-promo-radius", r);
1102
1108
  }
1103
1109
  _applyItemMetrics() {
1104
- const e = f(this.getAttribute("item-radius")), i = m(this.getAttribute("item-gap")), r = m(this.getAttribute("item-padding-x")), t = m(this.getAttribute("item-padding-y")), s = m(this.getAttribute("item-height")), n = m(this.getAttribute("item-font-size")), a = m(this.getAttribute("item-line-height"));
1110
+ const e = v(this.getAttribute("item-radius")), i = m(this.getAttribute("item-gap")), r = m(this.getAttribute("item-padding-x")), t = m(this.getAttribute("item-padding-y")), s = m(this.getAttribute("item-height")), n = m(this.getAttribute("item-font-size")), a = m(this.getAttribute("item-line-height"));
1105
1111
  this._setOptionalCssVar("--ui-sidebar-item-radius", e), this._setOptionalCssVar("--ui-sidebar-item-gap", i), this._setOptionalCssVar("--ui-sidebar-item-padding-x", r), this._setOptionalCssVar("--ui-sidebar-item-padding-y", t), this._setOptionalCssVar("--ui-sidebar-item-height", s), this._setOptionalCssVar("--ui-sidebar-item-font-size", n), this._setOptionalCssVar("--ui-sidebar-item-line-height", a);
1106
1112
  }
1107
1113
  _setOptionalCssVar(e, i) {
@@ -1135,7 +1141,7 @@ class V extends T {
1135
1141
  }
1136
1142
  _currentExpandedWidth() {
1137
1143
  const e = Number.parseFloat(this.style.getPropertyValue("--ui-sidebar-width"));
1138
- return Number.isFinite(e) && e > 0 ? e : l(this.getAttribute("width"), y[z(this.getAttribute("size"))].expanded);
1144
+ return Number.isFinite(e) && e > 0 ? e : c(this.getAttribute("width"), y[z(this.getAttribute("size"))].expanded);
1139
1145
  }
1140
1146
  _bindResponsiveCollapse() {
1141
1147
  if (this._responsiveCleanup?.(), this._responsiveCleanup = null, typeof window > "u" || typeof window.matchMedia != "function") return;
@@ -1155,16 +1161,16 @@ class V extends T {
1155
1161
  }
1156
1162
  _emitWidthChange(e) {
1157
1163
  const i = {
1158
- width: l(this.style.getPropertyValue("--ui-sidebar-width"), 0),
1159
- collapsedWidth: l(this.style.getPropertyValue("--ui-sidebar-collapsed-width"), 0),
1160
- minWidth: l(this.style.getPropertyValue("--ui-sidebar-min-width"), 0),
1161
- maxWidth: l(this.style.getPropertyValue("--ui-sidebar-max-width"), 0),
1164
+ width: c(this.style.getPropertyValue("--ui-sidebar-width"), 0),
1165
+ collapsedWidth: c(this.style.getPropertyValue("--ui-sidebar-collapsed-width"), 0),
1166
+ minWidth: c(this.style.getPropertyValue("--ui-sidebar-min-width"), 0),
1167
+ maxWidth: c(this.style.getPropertyValue("--ui-sidebar-max-width"), 0),
1162
1168
  source: e
1163
1169
  };
1164
1170
  this.dispatchEvent(new CustomEvent("width-change", { detail: i, bubbles: !0 }));
1165
1171
  }
1166
1172
  _handleResizeKey(e) {
1167
- const r = this.getAttribute("position") === "right" ? -1 : 1, t = this._currentExpandedWidth(), s = l(this.style.getPropertyValue("--ui-sidebar-min-width"), t), n = l(this.style.getPropertyValue("--ui-sidebar-max-width"), t);
1173
+ const r = this.getAttribute("position") === "right" ? -1 : 1, t = this._currentExpandedWidth(), s = c(this.style.getPropertyValue("--ui-sidebar-min-width"), t), n = c(this.style.getPropertyValue("--ui-sidebar-max-width"), t);
1168
1174
  let a = t;
1169
1175
  if (e.key === "ArrowRight") a = t + 16 * r;
1170
1176
  else if (e.key === "ArrowLeft") a = t - 16 * r;
@@ -1176,23 +1182,23 @@ class V extends T {
1176
1182
  _startResize(e) {
1177
1183
  if (!this.hasAttribute("resizable")) return;
1178
1184
  e.preventDefault();
1179
- const i = this.getAttribute("position") === "right", r = e.clientX, t = this._currentExpandedWidth(), s = l(this.style.getPropertyValue("--ui-sidebar-min-width"), t), n = l(this.style.getPropertyValue("--ui-sidebar-max-width"), t);
1185
+ const i = this.getAttribute("position") === "right", r = e.clientX, t = this._currentExpandedWidth(), s = c(this.style.getPropertyValue("--ui-sidebar-min-width"), t), n = c(this.style.getPropertyValue("--ui-sidebar-max-width"), t);
1180
1186
  this._dragging = !0, this.dispatchEvent(new CustomEvent("resize-start", { detail: { width: t }, bubbles: !0 }));
1181
1187
  const a = (u) => {
1182
1188
  const p = u.clientX - r, g = i ? t - p : t + p, b = Math.min(Math.max(g, s), n);
1183
1189
  this.style.setProperty("--ui-sidebar-width", `${b}px`), this.hasAttribute("collapsed") || (this.style.setProperty("--ui-sidebar-current-width", `${b}px`), this.style.setProperty("inline-size", `${b}px`)), this.dispatchEvent(new CustomEvent("resize", { detail: { width: b }, bubbles: !0 }));
1184
- }, c = () => {
1190
+ }, d = () => {
1185
1191
  if (!this._dragging) return;
1186
- this._dragging = !1, window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", c);
1192
+ this._dragging = !1, window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", d);
1187
1193
  const u = this._currentExpandedWidth();
1188
1194
  this._persistWidth(u), this._emitWidthChange("pointer"), this.dispatchEvent(new CustomEvent("resize-end", { detail: { width: u }, bubbles: !0 }));
1189
1195
  };
1190
- window.addEventListener("pointermove", a), window.addEventListener("pointerup", c), this._resizeCleanup = () => {
1191
- window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", c);
1196
+ window.addEventListener("pointermove", a), window.addEventListener("pointerup", d), this._resizeCleanup = () => {
1197
+ window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", d);
1192
1198
  };
1193
1199
  }
1194
1200
  }
1195
- typeof customElements < "u" && !customElements.get("ui-sidebar") && customElements.define("ui-sidebar", V);
1201
+ typeof customElements < "u" && !customElements.get("ui-sidebar") && customElements.define("ui-sidebar", q);
1196
1202
  export {
1197
- V as UISidebar
1203
+ q as UISidebar
1198
1204
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./ElementBase-DxbvhLJs.js");function r(a){const e=a.trim();return!e||/[;{}<>"']/.test(e)?"":e}const x=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./ElementBase-CbUsP3D6.js");function r(a){const e=a.trim();return!e||/[;{}<>"']/.test(e)?"":e}const x=`
2
2
  :host {
3
3
  display: block;
4
4
  --ui-skeleton-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
@@ -1,4 +1,4 @@
1
- import { E as v } from "./ElementBase-BeZT54Hj.mjs";
1
+ import { E as v } from "./ElementBase-D5QsC5Vw.mjs";
2
2
  function r(a) {
3
3
  const e = a.trim();
4
4
  return !e || /[;{}<>"']/.test(e) ? "" : e;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("./ElementBase-DxbvhLJs.js"),x=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("./ElementBase-CbUsP3D6.js"),k=require("./form-control-B90_3kYN.js"),z=`
2
2
  :host {
3
3
  --ui-slider-width: min(340px, 100%);
4
4
  --ui-slider-track-size: 4px;
@@ -282,10 +282,10 @@
282
282
  --ui-slider-text: #e2e8f0;
283
283
  --ui-slider-muted: #93a4bd;
284
284
  --ui-slider-track: #334155;
285
- --ui-slider-fill: #93c5fd;
286
- --ui-slider-focus: #93c5fd;
285
+ --ui-slider-fill: var(--ui-color-accent-on-dark, #93c5fd);
286
+ --ui-slider-focus: var(--ui-color-accent-on-dark, #93c5fd);
287
287
  --ui-slider-thumb-shadow:
288
- 0 0 0 1px color-mix(in srgb, #93c5fd 36%, transparent),
288
+ 0 0 0 1px color-mix(in srgb, var(--ui-color-accent-on-dark, #93c5fd) 36%, transparent),
289
289
  0 4px 14px rgba(2, 6, 23, 0.42);
290
290
  --ui-slider-shadow:
291
291
  0 14px 34px rgba(2, 6, 23, 0.46),
@@ -460,12 +460,12 @@
460
460
  box-shadow: none;
461
461
  }
462
462
  }
463
- `;function a(n,t){const e=Number(n);return Number.isFinite(e)?e:t}function h(n,t,e){return Math.max(t,Math.min(e,n))}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function v(n,t,e){if(!n)return[];try{const r=JSON.parse(n);return Array.isArray(r)?r.map(i=>typeof i=="number"?{value:i}:i&&typeof i=="object"&&Number.isFinite(Number(i.value))?{value:Number(i.value),label:i.label!=null?String(i.label):void 0}:null).filter(i=>!!i).map(i=>({...i,value:h(i.value,t,e)})):[]}catch{return[]}}function p(n,t=!1){if(n==null)return t;const e=String(n).toLowerCase();return e!=="false"&&e!=="0"&&e!=="off"}function k(n,t,e,r,i,l,u){const s=Math.max(1,l-i),o=Math.round((t-i)/s*100),d=Math.round((e-i)/s*100),c=Math.round((r-i)/s*100);return n==="percent"?u?`${d}% – ${c}%`:`${o}%`:n==="range"?u?`${e} – ${r}`:`${t}`:`${t}`}const m=new Set(["value","value-start","value-end","min","max","step","disabled","headless","orientation","size","variant","tone","show-value","format","name","name-start","name-end"]);class g extends _.ElementBase{constructor(){super(),this._startInput=null,this._endInput=null,this._valueEl=null,this._trackWrap=null,this._rangeMode=!1,this._value=0,this._valueStart=0,this._valueEnd=0,this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this)}static get observedAttributes(){return["value","value-start","value-end","min","max","step","disabled","headless","range","orientation","size","variant","tone","show-value","format","label","description","marks","name","name-start","name-end"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("input",this._onInput,!0),this.root.addEventListener("change",this._onChange,!0)}disconnectedCallback(){this.root.removeEventListener("input",this._onInput,!0),this.root.removeEventListener("change",this._onChange,!0),super.disconnectedCallback()}attributeChangedCallback(t,e,r){if(e!==r){if(m.has(t)&&this._trackWrap){this._syncFromAttributes(),this._syncDom();return}this.isConnected&&this.requestRender()}}get value(){return this._rangeMode?this._valueEnd:this._value}set value(t){const e=Number(t);Number.isFinite(e)&&this.setAttribute("value",String(e))}get valueStart(){return this._valueStart}set valueStart(t){const e=Number(t);Number.isFinite(e)&&this.setAttribute("value-start",String(e))}get valueEnd(){return this._valueEnd}set valueEnd(t){const e=Number(t);Number.isFinite(e)&&this.setAttribute("value-end",String(e))}_syncFromAttributes(){const t=a(this.getAttribute("min"),0),e=Math.max(t,a(this.getAttribute("max"),100)),r=Math.max(1e-4,a(this.getAttribute("step"),1));this._rangeMode=this.hasAttribute("range");const i=a(this.getAttribute("value"),this._value||t),l=a(this.getAttribute("value-start"),this._valueStart||t),u=a(this.getAttribute("value-end"),this._valueEnd||i||t);if(!this._rangeMode){this._value=h(i,t,e),this._valueStart=t,this._valueEnd=this._value;return}const s=h(Math.min(l,u),t,e),o=h(Math.max(l,u),t,e);this._valueStart=Math.round(s/r)*r,this._valueEnd=Math.round(o/r)*r,this._value=this._valueEnd}_detail(){const t=a(this.getAttribute("min"),0),e=Math.max(t,a(this.getAttribute("max"),100)),r=Math.max(1e-4,a(this.getAttribute("step"),1)),i=Math.max(1,e-t),l=(this._value-t)/i*100,u=(this._valueStart-t)/i*100,s=(this._valueEnd-t)/i*100;return{value:this._rangeMode?this._valueEnd:this._value,valueStart:this._valueStart,valueEnd:this._valueEnd,range:this._rangeMode,min:t,max:e,step:r,percent:l,percentStart:u,percentEnd:s}}_emit(t){this.dispatchEvent(new CustomEvent(t,{detail:this._detail(),bubbles:!0,composed:!0}))}_syncDom(){const t=a(this.getAttribute("min"),0),e=Math.max(t,a(this.getAttribute("max"),100)),r=Math.max(1e-4,a(this.getAttribute("step"),1)),i=p(this.getAttribute("disabled"))||this.hasAttribute("disabled"),l=this.getAttribute("format")||(this._rangeMode?"range":"percent"),u=p(this.getAttribute("show-value"),!0),s=Math.max(1,e-t),o=(this._valueStart-t)/s*100,d=(this._valueEnd-t)/s*100;this._startInput&&(this._startInput.min=String(t),this._startInput.max=String(e),this._startInput.step=String(r),this._startInput.value=String(this._rangeMode?this._valueStart:this._value),this._startInput.disabled=i,this._startInput.name=this._rangeMode?this.getAttribute("name-start")||this.getAttribute("name")||"":this.getAttribute("name")||"",this._startInput.setAttribute("aria-valuemin",String(t)),this._startInput.setAttribute("aria-valuemax",String(e)),this._startInput.setAttribute("aria-valuenow",String(this._rangeMode?this._valueStart:this._value))),this._endInput&&(this._endInput.min=String(t),this._endInput.max=String(e),this._endInput.step=String(r),this._endInput.value=String(this._valueEnd),this._endInput.disabled=i,this._endInput.name=this.getAttribute("name-end")||this.getAttribute("name")||"",this._endInput.setAttribute("aria-valuemin",String(t)),this._endInput.setAttribute("aria-valuemax",String(e)),this._endInput.setAttribute("aria-valuenow",String(this._valueEnd))),this._trackWrap&&(this._trackWrap.style.setProperty("--ui-slider-start",`${this._rangeMode?o:0}%`),this._trackWrap.style.setProperty("--ui-slider-end",`${d}%`)),this._valueEl&&(this._valueEl.textContent=k(l,this._value,this._valueStart,this._valueEnd,t,e,this._rangeMode),u?this._valueEl.removeAttribute("hidden"):this._valueEl.setAttribute("hidden","")),this.setAttribute("aria-valuemin",String(t)),this.setAttribute("aria-valuemax",String(e)),this.setAttribute("aria-valuenow",String(this.value)),this.setAttribute("aria-orientation",this.getAttribute("orientation")==="vertical"?"vertical":"horizontal"),this.setAttribute("aria-disabled",i?"true":"false")}_updateFromInput(t){const e=a(this.getAttribute("min"),0),r=Math.max(e,a(this.getAttribute("max"),100)),i=Math.max(1e-4,a(this.getAttribute("step"),1));if(!this._rangeMode){this._value=h(a(t.value,this._value),e,r),this._valueStart=e,this._valueEnd=this._value,this.setAttribute("value",String(this._value));return}const l=h(a(t.value,t.classList.contains("start")?this._valueStart:this._valueEnd),e,r);t.classList.contains("start")?this._valueStart=Math.min(l,this._valueEnd):this._valueEnd=Math.max(l,this._valueStart),this._valueStart=Math.round(this._valueStart/i)*i,this._valueEnd=Math.round(this._valueEnd/i)*i,this._value=this._valueEnd,this.setAttribute("value-start",String(this._valueStart)),this.setAttribute("value-end",String(this._valueEnd)),this.setAttribute("value",String(this._valueEnd))}_onInput(t){if(p(this.getAttribute("disabled"))||this.hasAttribute("disabled"))return;const e=t.target;!e||e.type!=="range"||(this._updateFromInput(e),this._syncDom(),this._emit("input"),this._emit("valuechange"))}_onChange(t){if(p(this.getAttribute("disabled"))||this.hasAttribute("disabled"))return;const e=t.target;!e||e.type!=="range"||(this._updateFromInput(e),this._syncDom(),this._emit("change"))}_renderMarks(t,e){const r=v(this.getAttribute("marks"),t,e);if(!r.length)return'<div class="marks" part="marks" hidden></div>';const i=Math.max(1,e-t),l=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal";return`<div class="marks" part="marks">${r.map(s=>{const o=(s.value-t)/i*100,d=l==="vertical"?`style="bottom:${o}%"`:`style="left:${o}%"`,c=s.label!=null?b(s.label):String(s.value);return`
463
+ `;function a(n,t){if(n==null||n.trim()==="")return t;const e=Number(n);return Number.isFinite(e)?e:t}function c(n,t,e){return Math.max(t,Math.min(e,n))}function m(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function g(n,t,e){if(!n)return[];try{const r=JSON.parse(n);return Array.isArray(r)?r.map(i=>typeof i=="number"?{value:i}:i&&typeof i=="object"&&Number.isFinite(Number(i.value))?{value:Number(i.value),label:i.label!=null?String(i.label):void 0}:null).filter(i=>!!i).map(i=>({...i,value:c(i.value,t,e)})):[]}catch{return[]}}function p(n,t=!1){if(n==null)return t;const e=String(n).toLowerCase();return e!=="false"&&e!=="0"&&e!=="off"}function A(n,t,e,r,i,l,u){const s=Math.max(1,l-i),o=Math.round((t-i)/s*100),d=Math.round((e-i)/s*100),h=Math.round((r-i)/s*100);return n==="percent"?u?`${d}% – ${h}%`:`${o}%`:n==="range"?u?`${e} – ${r}`:`${t}`:`${t}`}const f=new Set(["value","value-start","value-end","min","max","step","disabled","headless","orientation","size","variant","tone","show-value","format","name","name-start","name-end"]),v=class v extends x.ElementBase{constructor(){super(),this._formControl=new k.FormControl(this,{getValue:()=>this._rangeMode?[String(this._valueStart),String(this._valueEnd)]:String(this.value),defaultAttribute:"value",observe:["value-start","value-end","range","min","max","step"]}),this._startInput=null,this._endInput=null,this._valueEl=null,this._trackWrap=null,this._rangeMode=!1,this._value=0,this._valueStart=0,this._valueEnd=0,this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this)}static get observedAttributes(){return["value","value-start","value-end","min","max","step","disabled","headless","range","orientation","size","variant","tone","show-value","format","label","description","marks","name","name-start","name-end"]}formResetCallback(){this._formControl.formResetCallback()}formDisabledCallback(t){this._formControl.formDisabledCallback(t)}get form(){return this._formControl.form}connectedCallback(){super.connectedCallback(),this._formControl.connect(),this.root.addEventListener("input",this._onInput,!0),this.root.addEventListener("change",this._onChange,!0)}disconnectedCallback(){this._formControl.disconnect(),this.root.removeEventListener("input",this._onInput,!0),this.root.removeEventListener("change",this._onChange,!0),super.disconnectedCallback()}attributeChangedCallback(t,e,r){if(e!==r){if(f.has(t)&&this._trackWrap){this._syncFromAttributes(),this._syncDom();return}this.isConnected&&this.requestRender()}}get value(){return this._rangeMode?this._valueEnd:this._value}set value(t){const e=Number(t);Number.isFinite(e)&&this.setAttribute("value",String(e))}get valueStart(){return this._valueStart}set valueStart(t){const e=Number(t);Number.isFinite(e)&&this.setAttribute("value-start",String(e))}get valueEnd(){return this._valueEnd}set valueEnd(t){const e=Number(t);Number.isFinite(e)&&this.setAttribute("value-end",String(e))}_syncFromAttributes(){const t=a(this.getAttribute("min"),0),e=Math.max(t,a(this.getAttribute("max"),100)),r=Math.max(1e-4,a(this.getAttribute("step"),1));this._rangeMode=this.hasAttribute("range");const i=a(this.getAttribute("value"),this._value||t),l=a(this.getAttribute("value-start"),this._valueStart||t),u=a(this.getAttribute("value-end"),this._valueEnd||i||t);if(!this._rangeMode){this._value=c(i,t,e),this._valueStart=t,this._valueEnd=this._value;return}const s=c(Math.min(l,u),t,e),o=c(Math.max(l,u),t,e);this._valueStart=Math.round(s/r)*r,this._valueEnd=Math.round(o/r)*r,this._value=this._valueEnd}_detail(){const t=a(this.getAttribute("min"),0),e=Math.max(t,a(this.getAttribute("max"),100)),r=Math.max(1e-4,a(this.getAttribute("step"),1)),i=Math.max(1,e-t),l=(this._value-t)/i*100,u=(this._valueStart-t)/i*100,s=(this._valueEnd-t)/i*100;return{value:this._rangeMode?this._valueEnd:this._value,valueStart:this._valueStart,valueEnd:this._valueEnd,range:this._rangeMode,min:t,max:e,step:r,percent:l,percentStart:u,percentEnd:s}}_emit(t){this.dispatchEvent(new CustomEvent(t,{detail:this._detail(),bubbles:!0,composed:!0}))}_syncDom(){const t=a(this.getAttribute("min"),0),e=Math.max(t,a(this.getAttribute("max"),100)),r=Math.max(1e-4,a(this.getAttribute("step"),1)),i=p(this.getAttribute("disabled"))||this.hasAttribute("disabled"),l=this.getAttribute("format")||(this._rangeMode?"range":"percent"),u=p(this.getAttribute("show-value"),!0),s=Math.max(1,e-t),o=(this._valueStart-t)/s*100,d=(this._valueEnd-t)/s*100;this._startInput&&(this._startInput.min=String(t),this._startInput.max=String(e),this._startInput.step=String(r),this._startInput.value=String(this._rangeMode?this._valueStart:this._value),this._startInput.disabled=i,this._startInput.name=this._rangeMode?this.getAttribute("name-start")||this.getAttribute("name")||"":this.getAttribute("name")||"",this._startInput.setAttribute("aria-valuemin",String(t)),this._startInput.setAttribute("aria-valuemax",String(e)),this._startInput.setAttribute("aria-valuenow",String(this._rangeMode?this._valueStart:this._value))),this._endInput&&(this._endInput.min=String(t),this._endInput.max=String(e),this._endInput.step=String(r),this._endInput.value=String(this._valueEnd),this._endInput.disabled=i,this._endInput.name=this.getAttribute("name-end")||this.getAttribute("name")||"",this._endInput.setAttribute("aria-valuemin",String(t)),this._endInput.setAttribute("aria-valuemax",String(e)),this._endInput.setAttribute("aria-valuenow",String(this._valueEnd))),this._trackWrap&&(this._trackWrap.style.setProperty("--ui-slider-start",`${this._rangeMode?o:0}%`),this._trackWrap.style.setProperty("--ui-slider-end",`${d}%`)),this._valueEl&&(this._valueEl.textContent=A(l,this._value,this._valueStart,this._valueEnd,t,e,this._rangeMode),u?this._valueEl.removeAttribute("hidden"):this._valueEl.setAttribute("hidden","")),this.setAttribute("aria-valuemin",String(t)),this.setAttribute("aria-valuemax",String(e)),this.setAttribute("aria-valuenow",String(this.value)),this.setAttribute("aria-orientation",this.getAttribute("orientation")==="vertical"?"vertical":"horizontal"),this.setAttribute("aria-disabled",i?"true":"false")}_updateFromInput(t){const e=a(this.getAttribute("min"),0),r=Math.max(e,a(this.getAttribute("max"),100)),i=Math.max(1e-4,a(this.getAttribute("step"),1));if(!this._rangeMode){this._value=c(a(t.value,this._value),e,r),this._valueStart=e,this._valueEnd=this._value,this.setAttribute("value",String(this._value));return}const l=c(a(t.value,t.classList.contains("start")?this._valueStart:this._valueEnd),e,r);t.classList.contains("start")?this._valueStart=Math.min(l,this._valueEnd):this._valueEnd=Math.max(l,this._valueStart),this._valueStart=Math.round(this._valueStart/i)*i,this._valueEnd=Math.round(this._valueEnd/i)*i,this._value=this._valueEnd,this.setAttribute("value-start",String(this._valueStart)),this.setAttribute("value-end",String(this._valueEnd)),this.setAttribute("value",String(this._valueEnd))}_onInput(t){if(p(this.getAttribute("disabled"))||this.hasAttribute("disabled"))return;const e=t.target;!e||e.type!=="range"||(this._updateFromInput(e),this._syncDom(),this._emit("input"),this._emit("valuechange"))}_onChange(t){if(p(this.getAttribute("disabled"))||this.hasAttribute("disabled"))return;const e=t.target;!e||e.type!=="range"||(this._updateFromInput(e),this._syncDom(),this._emit("change"))}_renderMarks(t,e){const r=g(this.getAttribute("marks"),t,e);if(!r.length)return'<div class="marks" part="marks" hidden></div>';const i=Math.max(1,e-t),l=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal";return`<div class="marks" part="marks">${r.map(s=>{const o=(s.value-t)/i*100,d=l==="vertical"?`style="bottom:${o}%"`:`style="left:${o}%"`,h=s.label!=null?m(s.label):String(s.value);return`
464
464
  <span class="mark" ${d}>
465
- <span class="mark-label">${c}</span>
465
+ <span class="mark-label">${h}</span>
466
466
  </span>
467
- `}).join("")}</div>`}render(){this._syncFromAttributes();const t=a(this.getAttribute("min"),0),e=Math.max(t,a(this.getAttribute("max"),100)),r=this.getAttribute("label")||"",i=this.getAttribute("description")||"",l=!!r||!!i,u=this._renderMarks(t,e),s=v(this.getAttribute("marks"),t,e).length>0,o=b(r),d=b(i),c=o?`${o} start`:"Slider value",f=o?`${o} end`:"Slider end value";this.setContent(`
468
- <style>${x}</style>
467
+ `}).join("")}</div>`}render(){this._syncFromAttributes();const t=a(this.getAttribute("min"),0),e=Math.max(t,a(this.getAttribute("max"),100)),r=this.getAttribute("label")||"",i=this.getAttribute("description")||"",l=!!r||!!i,u=this._renderMarks(t,e),s=g(this.getAttribute("marks"),t,e).length>0,o=m(r),d=m(i),h=o?`${o} start`:"Slider value",_=o?`${o} end`:"Slider end value";this.setContent(`
468
+ <style>${z}</style>
469
469
  <div class="shell" part="shell" role="group" data-has-marks="${s}">
470
470
  <div class="meta" part="meta" ${l?"":"hidden"}>
471
471
  <span class="label" part="label" ${r?"":"hidden"}>${o}</span>
@@ -479,11 +479,11 @@
479
479
  <span class="track-indicator start" part="indicator-start" ${this._rangeMode?"":"hidden"}></span>
480
480
  <span class="track-indicator end" part="indicator-end"></span>
481
481
  <div class="inputs" part="inputs">
482
- <input class="start" type="range" aria-label="${c}" />
483
- ${this._rangeMode?`<input class="end" type="range" aria-label="${f}" />`:""}
482
+ <input class="start" type="range" aria-label="${h}" />
483
+ ${this._rangeMode?`<input class="end" type="range" aria-label="${_}" />`:""}
484
484
  </div>
485
485
  ${u}
486
486
  </div>
487
487
  </div>
488
488
  </div>
489
- `),this._startInput=this.root.querySelector("input.start"),this._endInput=this.root.querySelector("input.end"),this._valueEl=this.root.querySelector(".value"),this._trackWrap=this.root.querySelector(".track-wrap"),this._syncDom()}shouldRenderOnAttributeChange(t,e,r){return!m.has(t)}}typeof customElements<"u"&&!customElements.get("ui-slider")&&customElements.define("ui-slider",g);exports.UISlider=g;
489
+ `),this._startInput=this.root.querySelector("input.start"),this._endInput=this.root.querySelector("input.end"),this._valueEl=this.root.querySelector(".value"),this._trackWrap=this.root.querySelector(".track-wrap"),this._syncDom()}shouldRenderOnAttributeChange(t,e,r){return!f.has(t)}};v.formAssociated=!0;let b=v;typeof customElements<"u"&&!customElements.get("ui-slider")&&customElements.define("ui-slider",b);exports.UISlider=b;
@@ -1,5 +1,6 @@
1
- import { E as f } from "./ElementBase-BeZT54Hj.mjs";
2
- const _ = `
1
+ import { E as x } from "./ElementBase-D5QsC5Vw.mjs";
2
+ import { F as k } from "./form-control-D9wWUMBl.mjs";
3
+ const z = `
3
4
  :host {
4
5
  --ui-slider-width: min(340px, 100%);
5
6
  --ui-slider-track-size: 4px;
@@ -283,10 +284,10 @@ const _ = `
283
284
  --ui-slider-text: #e2e8f0;
284
285
  --ui-slider-muted: #93a4bd;
285
286
  --ui-slider-track: #334155;
286
- --ui-slider-fill: #93c5fd;
287
- --ui-slider-focus: #93c5fd;
287
+ --ui-slider-fill: var(--ui-color-accent-on-dark, #93c5fd);
288
+ --ui-slider-focus: var(--ui-color-accent-on-dark, #93c5fd);
288
289
  --ui-slider-thumb-shadow:
289
- 0 0 0 1px color-mix(in srgb, #93c5fd 36%, transparent),
290
+ 0 0 0 1px color-mix(in srgb, var(--ui-color-accent-on-dark, #93c5fd) 36%, transparent),
290
291
  0 4px 14px rgba(2, 6, 23, 0.42);
291
292
  --ui-slider-shadow:
292
293
  0 14px 34px rgba(2, 6, 23, 0.46),
@@ -463,6 +464,7 @@ const _ = `
463
464
  }
464
465
  `;
465
466
  function a(n, t) {
467
+ if (n == null || n.trim() === "") return t;
466
468
  const e = Number(n);
467
469
  return Number.isFinite(e) ? e : t;
468
470
  }
@@ -472,7 +474,7 @@ function h(n, t, e) {
472
474
  function b(n) {
473
475
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
474
476
  }
475
- function v(n, t, e) {
477
+ function g(n, t, e) {
476
478
  if (!n) return [];
477
479
  try {
478
480
  const r = JSON.parse(n);
@@ -489,11 +491,11 @@ function p(n, t = !1) {
489
491
  const e = String(n).toLowerCase();
490
492
  return e !== "false" && e !== "0" && e !== "off";
491
493
  }
492
- function x(n, t, e, r, i, l, u) {
494
+ function A(n, t, e, r, i, l, u) {
493
495
  const s = Math.max(1, l - i), o = Math.round((t - i) / s * 100), d = Math.round((e - i) / s * 100), c = Math.round((r - i) / s * 100);
494
496
  return n === "percent" ? u ? `${d}% – ${c}%` : `${o}%` : n === "range" ? u ? `${e} – ${r}` : `${t}` : `${t}`;
495
497
  }
496
- const m = /* @__PURE__ */ new Set([
498
+ const f = /* @__PURE__ */ new Set([
497
499
  "value",
498
500
  "value-start",
499
501
  "value-end",
@@ -511,10 +513,13 @@ const m = /* @__PURE__ */ new Set([
511
513
  "name",
512
514
  "name-start",
513
515
  "name-end"
514
- ]);
515
- class k extends f {
516
+ ]), v = class v extends x {
516
517
  constructor() {
517
- super(), this._startInput = null, this._endInput = null, this._valueEl = null, this._trackWrap = null, this._rangeMode = !1, this._value = 0, this._valueStart = 0, this._valueEnd = 0, this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this);
518
+ super(), this._formControl = new k(this, {
519
+ getValue: () => this._rangeMode ? [String(this._valueStart), String(this._valueEnd)] : String(this.value),
520
+ defaultAttribute: "value",
521
+ observe: ["value-start", "value-end", "range", "min", "max", "step"]
522
+ }), this._startInput = null, this._endInput = null, this._valueEl = null, this._trackWrap = null, this._rangeMode = !1, this._value = 0, this._valueStart = 0, this._valueEnd = 0, this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this);
518
523
  }
519
524
  static get observedAttributes() {
520
525
  return [
@@ -541,15 +546,25 @@ class k extends f {
541
546
  "name-end"
542
547
  ];
543
548
  }
549
+ formResetCallback() {
550
+ this._formControl.formResetCallback();
551
+ }
552
+ formDisabledCallback(t) {
553
+ this._formControl.formDisabledCallback(t);
554
+ }
555
+ /** The `<form>` this field belongs to, if any. */
556
+ get form() {
557
+ return this._formControl.form;
558
+ }
544
559
  connectedCallback() {
545
- super.connectedCallback(), this.root.addEventListener("input", this._onInput, !0), this.root.addEventListener("change", this._onChange, !0);
560
+ super.connectedCallback(), this._formControl.connect(), this.root.addEventListener("input", this._onInput, !0), this.root.addEventListener("change", this._onChange, !0);
546
561
  }
547
562
  disconnectedCallback() {
548
- this.root.removeEventListener("input", this._onInput, !0), this.root.removeEventListener("change", this._onChange, !0), super.disconnectedCallback();
563
+ this._formControl.disconnect(), this.root.removeEventListener("input", this._onInput, !0), this.root.removeEventListener("change", this._onChange, !0), super.disconnectedCallback();
549
564
  }
550
565
  attributeChangedCallback(t, e, r) {
551
566
  if (e !== r) {
552
- if (m.has(t) && this._trackWrap) {
567
+ if (f.has(t) && this._trackWrap) {
553
568
  this._syncFromAttributes(), this._syncDom();
554
569
  return;
555
570
  }
@@ -614,7 +629,7 @@ class k extends f {
614
629
  }
615
630
  _syncDom() {
616
631
  const t = a(this.getAttribute("min"), 0), e = Math.max(t, a(this.getAttribute("max"), 100)), r = Math.max(1e-4, a(this.getAttribute("step"), 1)), i = p(this.getAttribute("disabled")) || this.hasAttribute("disabled"), l = this.getAttribute("format") || (this._rangeMode ? "range" : "percent"), u = p(this.getAttribute("show-value"), !0), s = Math.max(1, e - t), o = (this._valueStart - t) / s * 100, d = (this._valueEnd - t) / s * 100;
617
- this._startInput && (this._startInput.min = String(t), this._startInput.max = String(e), this._startInput.step = String(r), this._startInput.value = String(this._rangeMode ? this._valueStart : this._value), this._startInput.disabled = i, this._startInput.name = this._rangeMode ? this.getAttribute("name-start") || this.getAttribute("name") || "" : this.getAttribute("name") || "", this._startInput.setAttribute("aria-valuemin", String(t)), this._startInput.setAttribute("aria-valuemax", String(e)), this._startInput.setAttribute("aria-valuenow", String(this._rangeMode ? this._valueStart : this._value))), this._endInput && (this._endInput.min = String(t), this._endInput.max = String(e), this._endInput.step = String(r), this._endInput.value = String(this._valueEnd), this._endInput.disabled = i, this._endInput.name = this.getAttribute("name-end") || this.getAttribute("name") || "", this._endInput.setAttribute("aria-valuemin", String(t)), this._endInput.setAttribute("aria-valuemax", String(e)), this._endInput.setAttribute("aria-valuenow", String(this._valueEnd))), this._trackWrap && (this._trackWrap.style.setProperty("--ui-slider-start", `${this._rangeMode ? o : 0}%`), this._trackWrap.style.setProperty("--ui-slider-end", `${d}%`)), this._valueEl && (this._valueEl.textContent = x(l, this._value, this._valueStart, this._valueEnd, t, e, this._rangeMode), u ? this._valueEl.removeAttribute("hidden") : this._valueEl.setAttribute("hidden", "")), this.setAttribute("aria-valuemin", String(t)), this.setAttribute("aria-valuemax", String(e)), this.setAttribute("aria-valuenow", String(this.value)), this.setAttribute("aria-orientation", this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal"), this.setAttribute("aria-disabled", i ? "true" : "false");
632
+ this._startInput && (this._startInput.min = String(t), this._startInput.max = String(e), this._startInput.step = String(r), this._startInput.value = String(this._rangeMode ? this._valueStart : this._value), this._startInput.disabled = i, this._startInput.name = this._rangeMode ? this.getAttribute("name-start") || this.getAttribute("name") || "" : this.getAttribute("name") || "", this._startInput.setAttribute("aria-valuemin", String(t)), this._startInput.setAttribute("aria-valuemax", String(e)), this._startInput.setAttribute("aria-valuenow", String(this._rangeMode ? this._valueStart : this._value))), this._endInput && (this._endInput.min = String(t), this._endInput.max = String(e), this._endInput.step = String(r), this._endInput.value = String(this._valueEnd), this._endInput.disabled = i, this._endInput.name = this.getAttribute("name-end") || this.getAttribute("name") || "", this._endInput.setAttribute("aria-valuemin", String(t)), this._endInput.setAttribute("aria-valuemax", String(e)), this._endInput.setAttribute("aria-valuenow", String(this._valueEnd))), this._trackWrap && (this._trackWrap.style.setProperty("--ui-slider-start", `${this._rangeMode ? o : 0}%`), this._trackWrap.style.setProperty("--ui-slider-end", `${d}%`)), this._valueEl && (this._valueEl.textContent = A(l, this._value, this._valueStart, this._valueEnd, t, e, this._rangeMode), u ? this._valueEl.removeAttribute("hidden") : this._valueEl.setAttribute("hidden", "")), this.setAttribute("aria-valuemin", String(t)), this.setAttribute("aria-valuemax", String(e)), this.setAttribute("aria-valuenow", String(this.value)), this.setAttribute("aria-orientation", this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal"), this.setAttribute("aria-disabled", i ? "true" : "false");
618
633
  }
619
634
  _updateFromInput(t) {
620
635
  const e = a(this.getAttribute("min"), 0), r = Math.max(e, a(this.getAttribute("max"), 100)), i = Math.max(1e-4, a(this.getAttribute("step"), 1));
@@ -636,7 +651,7 @@ class k extends f {
636
651
  !e || e.type !== "range" || (this._updateFromInput(e), this._syncDom(), this._emit("change"));
637
652
  }
638
653
  _renderMarks(t, e) {
639
- const r = v(this.getAttribute("marks"), t, e);
654
+ const r = g(this.getAttribute("marks"), t, e);
640
655
  if (!r.length) return '<div class="marks" part="marks" hidden></div>';
641
656
  const i = Math.max(1, e - t), l = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal";
642
657
  return `<div class="marks" part="marks">${r.map((s) => {
@@ -650,9 +665,9 @@ class k extends f {
650
665
  }
651
666
  render() {
652
667
  this._syncFromAttributes();
653
- const t = a(this.getAttribute("min"), 0), e = Math.max(t, a(this.getAttribute("max"), 100)), r = this.getAttribute("label") || "", i = this.getAttribute("description") || "", l = !!r || !!i, u = this._renderMarks(t, e), s = v(this.getAttribute("marks"), t, e).length > 0, o = b(r), d = b(i), c = o ? `${o} start` : "Slider value", g = o ? `${o} end` : "Slider end value";
668
+ const t = a(this.getAttribute("min"), 0), e = Math.max(t, a(this.getAttribute("max"), 100)), r = this.getAttribute("label") || "", i = this.getAttribute("description") || "", l = !!r || !!i, u = this._renderMarks(t, e), s = g(this.getAttribute("marks"), t, e).length > 0, o = b(r), d = b(i), c = o ? `${o} start` : "Slider value", _ = o ? `${o} end` : "Slider end value";
654
669
  this.setContent(`
655
- <style>${_}</style>
670
+ <style>${z}</style>
656
671
  <div class="shell" part="shell" role="group" data-has-marks="${s}">
657
672
  <div class="meta" part="meta" ${l ? "" : "hidden"}>
658
673
  <span class="label" part="label" ${r ? "" : "hidden"}>${o}</span>
@@ -667,7 +682,7 @@ class k extends f {
667
682
  <span class="track-indicator end" part="indicator-end"></span>
668
683
  <div class="inputs" part="inputs">
669
684
  <input class="start" type="range" aria-label="${c}" />
670
- ${this._rangeMode ? `<input class="end" type="range" aria-label="${g}" />` : ""}
685
+ ${this._rangeMode ? `<input class="end" type="range" aria-label="${_}" />` : ""}
671
686
  </div>
672
687
  ${u}
673
688
  </div>
@@ -676,10 +691,12 @@ class k extends f {
676
691
  `), this._startInput = this.root.querySelector("input.start"), this._endInput = this.root.querySelector("input.end"), this._valueEl = this.root.querySelector(".value"), this._trackWrap = this.root.querySelector(".track-wrap"), this._syncDom();
677
692
  }
678
693
  shouldRenderOnAttributeChange(t, e, r) {
679
- return !m.has(t);
694
+ return !f.has(t);
680
695
  }
681
- }
682
- typeof customElements < "u" && !customElements.get("ui-slider") && customElements.define("ui-slider", k);
696
+ };
697
+ v.formAssociated = !0;
698
+ let m = v;
699
+ typeof customElements < "u" && !customElements.get("ui-slider") && customElements.define("ui-slider", m);
683
700
  export {
684
- k as UISlider
701
+ m as UISlider
685
702
  };
package/dist/slot.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-DxbvhLJs.js"),u=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-CbUsP3D6.js"),u=`
2
2
  :host {
3
3
  --ui-slot-bg: transparent;
4
4
  --ui-slot-text: inherit;
package/dist/slot.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as n } from "./ElementBase-BeZT54Hj.mjs";
1
+ import { E as n } from "./ElementBase-D5QsC5Vw.mjs";
2
2
  const r = `
3
3
  :host {
4
4
  --ui-slot-bg: transparent;
@@ -0,0 +1 @@
1
+ "use strict";const r="data-ui-auto-name";function i(t){for(const e of Array.from(t.children))if(e instanceof HTMLInputElement&&e.getAttribute("slot")==="input")return e;return null}function l(t,e,a){t.hasAttribute("aria-label")&&!t.hasAttribute(r)||t.hasAttribute("aria-labelledby")||(t.labels?.length??0)>0||(e?(t.setAttribute("aria-label",e),t.setAttribute(r,"")):t.hasAttribute(r)&&(t.removeAttribute("aria-label"),t.removeAttribute(r))),a?t.setAttribute("aria-description",a):t.removeAttribute("aria-description")}exports.findSlottedInput=i;exports.nameSlottedInput=l;
@@ -0,0 +1,13 @@
1
+ const a = "data-ui-auto-name";
2
+ function l(t) {
3
+ for (const e of Array.from(t.children))
4
+ if (e instanceof HTMLInputElement && e.getAttribute("slot") === "input") return e;
5
+ return null;
6
+ }
7
+ function o(t, e, r) {
8
+ t.hasAttribute("aria-label") && !t.hasAttribute(a) || t.hasAttribute("aria-labelledby") || (t.labels?.length ?? 0) > 0 || (e ? (t.setAttribute("aria-label", e), t.setAttribute(a, "")) : t.hasAttribute(a) && (t.removeAttribute("aria-label"), t.removeAttribute(a))), r ? t.setAttribute("aria-description", r) : t.removeAttribute("aria-description");
9
+ }
10
+ export {
11
+ l as f,
12
+ o as n
13
+ };