@editora/ui-core 0.1.25 → 0.2.1

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 (349) hide show
  1. package/README.md +132 -0
  2. package/dist/accordion.cjs.js +13 -12
  3. package/dist/accordion.esm.js +13 -12
  4. package/dist/alert-dialog.cjs.js +92 -53
  5. package/dist/alert-dialog.esm.js +211 -159
  6. package/dist/alert.cjs.js +42 -33
  7. package/dist/alert.esm.js +80 -71
  8. package/dist/animated-beam.cjs.js +42 -50
  9. package/dist/animated-beam.esm.js +47 -55
  10. package/dist/animated-list.cjs.js +11 -27
  11. package/dist/animated-list.esm.js +12 -28
  12. package/dist/animated-text.cjs.js +9 -9
  13. package/dist/animated-text.esm.js +9 -9
  14. package/dist/app-header.cjs.js +17 -12
  15. package/dist/app-header.esm.js +18 -13
  16. package/dist/aspect-ratio.cjs.js +10 -12
  17. package/dist/aspect-ratio.esm.js +11 -13
  18. package/dist/avatar.cjs.js +16 -20
  19. package/dist/avatar.esm.js +16 -20
  20. package/dist/badge.cjs.js +27 -22
  21. package/dist/badge.esm.js +32 -27
  22. package/dist/block-controls.cjs.js +11 -12
  23. package/dist/block-controls.esm.js +8 -9
  24. package/dist/box.cjs.js +2 -3
  25. package/dist/box.esm.js +2 -3
  26. package/dist/breadcrumb.cjs.js +12 -18
  27. package/dist/breadcrumb.esm.js +11 -17
  28. package/dist/button.cjs.js +1 -1
  29. package/dist/button.esm.js +1 -1
  30. package/dist/{calendar-D-mXMgqc.js → calendar-CzpWDxLc.js} +56 -46
  31. package/dist/{calendar-B3PUKHQm.mjs → calendar-DkSDFg33.mjs} +127 -117
  32. package/dist/calendar.cjs.js +1 -1
  33. package/dist/calendar.esm.js +1 -1
  34. package/dist/card.cjs.js +6 -7
  35. package/dist/card.esm.js +5 -6
  36. package/dist/chart.cjs.js +58 -52
  37. package/dist/chart.esm.js +101 -95
  38. package/dist/checkbox.cjs.js +19 -15
  39. package/dist/checkbox.esm.js +19 -15
  40. package/dist/collapsible.cjs.js +9 -13
  41. package/dist/collapsible.esm.js +9 -13
  42. package/dist/color-picker.cjs.js +38 -19
  43. package/dist/color-picker.esm.js +134 -115
  44. package/dist/combobox.cjs.js +60 -57
  45. package/dist/combobox.esm.js +96 -92
  46. package/dist/command-palette.cjs.js +1 -0
  47. package/dist/command-palette.esm.js +1 -0
  48. package/dist/command.cjs.js +32 -14
  49. package/dist/command.esm.js +46 -28
  50. package/dist/components/date-time-utils.d.ts.map +1 -1
  51. package/dist/components/ui-accordion.d.ts.map +1 -1
  52. package/dist/components/ui-alert-dialog.d.ts +2 -0
  53. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  54. package/dist/components/ui-alert.d.ts.map +1 -1
  55. package/dist/components/ui-animated-beam.d.ts.map +1 -1
  56. package/dist/components/ui-animated-list.d.ts.map +1 -1
  57. package/dist/components/ui-app-header.d.ts.map +1 -1
  58. package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
  59. package/dist/components/ui-avatar.d.ts.map +1 -1
  60. package/dist/components/ui-badge.d.ts.map +1 -1
  61. package/dist/components/ui-block-controls.d.ts.map +1 -1
  62. package/dist/components/ui-box.d.ts.map +1 -1
  63. package/dist/components/ui-breadcrumb.d.ts.map +1 -1
  64. package/dist/components/ui-button.d.ts.map +1 -1
  65. package/dist/components/ui-calendar.d.ts.map +1 -1
  66. package/dist/components/ui-card.d.ts.map +1 -1
  67. package/dist/components/ui-chart.d.ts.map +1 -1
  68. package/dist/components/ui-checkbox.d.ts.map +1 -1
  69. package/dist/components/ui-collapsible.d.ts.map +1 -1
  70. package/dist/components/ui-color-picker.d.ts.map +1 -1
  71. package/dist/components/ui-combobox.d.ts.map +1 -1
  72. package/dist/components/ui-command-palette.d.ts.map +1 -1
  73. package/dist/components/ui-command.d.ts.map +1 -1
  74. package/dist/components/ui-container.d.ts.map +1 -1
  75. package/dist/components/ui-context-menu.d.ts.map +1 -1
  76. package/dist/components/ui-data-table.d.ts +7 -0
  77. package/dist/components/ui-data-table.d.ts.map +1 -1
  78. package/dist/components/ui-date-picker.d.ts.map +1 -1
  79. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  80. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  81. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  82. package/dist/components/ui-dialog.d.ts +2 -0
  83. package/dist/components/ui-dialog.d.ts.map +1 -1
  84. package/dist/components/ui-dock.d.ts.map +1 -1
  85. package/dist/components/ui-drawer.d.ts.map +1 -1
  86. package/dist/components/ui-dropdown.d.ts.map +1 -1
  87. package/dist/components/ui-empty-state.d.ts.map +1 -1
  88. package/dist/components/ui-field.d.ts.map +1 -1
  89. package/dist/components/ui-fieldset.d.ts.map +1 -1
  90. package/dist/components/ui-file-upload.d.ts.map +1 -1
  91. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  92. package/dist/components/ui-form.d.ts.map +1 -1
  93. package/dist/components/ui-gantt.d.ts.map +1 -1
  94. package/dist/components/ui-hover-card.d.ts.map +1 -1
  95. package/dist/components/ui-icon-cloud.d.ts.map +1 -1
  96. package/dist/components/ui-inline-edit.d.ts.map +1 -1
  97. package/dist/components/ui-input.d.ts.map +1 -1
  98. package/dist/components/ui-marquee.d.ts.map +1 -1
  99. package/dist/components/ui-menu.d.ts.map +1 -1
  100. package/dist/components/ui-menubar.d.ts.map +1 -1
  101. package/dist/components/ui-meter.d.ts.map +1 -1
  102. package/dist/components/ui-multi-select.d.ts.map +1 -1
  103. package/dist/components/ui-number-field.d.ts.map +1 -1
  104. package/dist/components/ui-orbiter.d.ts.map +1 -1
  105. package/dist/components/ui-pagination.d.ts.map +1 -1
  106. package/dist/components/ui-password-field.d.ts.map +1 -1
  107. package/dist/components/ui-pin-input.d.ts.map +1 -1
  108. package/dist/components/ui-popover.d.ts.map +1 -1
  109. package/dist/components/ui-progress.d.ts.map +1 -1
  110. package/dist/components/ui-radio-group.d.ts.map +1 -1
  111. package/dist/components/ui-radio.d.ts.map +1 -1
  112. package/dist/components/ui-rating.d.ts +1 -0
  113. package/dist/components/ui-rating.d.ts.map +1 -1
  114. package/dist/components/ui-scroll-area.d.ts.map +1 -1
  115. package/dist/components/ui-section.d.ts.map +1 -1
  116. package/dist/components/ui-select.d.ts.map +1 -1
  117. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  118. package/dist/components/ui-sidebar.d.ts.map +1 -1
  119. package/dist/components/ui-slider.d.ts.map +1 -1
  120. package/dist/components/ui-sortable.d.ts.map +1 -1
  121. package/dist/components/ui-spinning-text.d.ts.map +1 -1
  122. package/dist/components/ui-split-button.d.ts.map +1 -1
  123. package/dist/components/ui-splitter.d.ts.map +1 -1
  124. package/dist/components/ui-stepper.d.ts.map +1 -1
  125. package/dist/components/ui-switch.d.ts.map +1 -1
  126. package/dist/components/ui-tabs.d.ts.map +1 -1
  127. package/dist/components/ui-tags-input.d.ts.map +1 -1
  128. package/dist/components/ui-textarea.d.ts.map +1 -1
  129. package/dist/components/ui-time-picker.d.ts.map +1 -1
  130. package/dist/components/ui-toggle-group.d.ts +2 -0
  131. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  132. package/dist/components/ui-toggle.d.ts.map +1 -1
  133. package/dist/components/ui-toolbar.d.ts +2 -0
  134. package/dist/components/ui-toolbar.d.ts.map +1 -1
  135. package/dist/components/ui-tooltip.d.ts.map +1 -1
  136. package/dist/components/ui-transfer-list.d.ts.map +1 -1
  137. package/dist/components/ui-tree-item.d.ts.map +1 -1
  138. package/dist/components/ui-tree.d.ts.map +1 -1
  139. package/dist/components/ui-wizard.d.ts.map +1 -1
  140. package/dist/container.cjs.js +6 -12
  141. package/dist/container.esm.js +8 -14
  142. package/dist/context-menu.cjs.js +8 -8
  143. package/dist/context-menu.esm.js +42 -41
  144. package/dist/data-table.cjs.js +21 -18
  145. package/dist/data-table.esm.js +210 -190
  146. package/dist/date-field.cjs.js +9 -9
  147. package/dist/date-field.esm.js +19 -19
  148. package/dist/date-picker.cjs.js +29 -20
  149. package/dist/date-picker.esm.js +59 -50
  150. package/dist/date-range-picker.cjs.js +24 -19
  151. package/dist/date-range-picker.esm.js +86 -81
  152. package/dist/date-range-time-picker.cjs.js +27 -20
  153. package/dist/date-range-time-picker.esm.js +24 -17
  154. package/dist/date-time-picker.cjs.js +24 -17
  155. package/dist/date-time-picker.esm.js +89 -82
  156. package/dist/date-time-utils-C-4eHTyy.js +1 -0
  157. package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-zAx4ghvC.mjs} +75 -68
  158. package/dist/description.cjs.js +4 -4
  159. package/dist/description.esm.js +4 -4
  160. package/dist/dialog.cjs.js +59 -43
  161. package/dist/dialog.esm.js +86 -53
  162. package/dist/direction-provider.cjs.js +1 -1
  163. package/dist/direction-provider.esm.js +1 -1
  164. package/dist/dock.cjs.js +16 -30
  165. package/dist/dock.esm.js +26 -40
  166. package/dist/drawer.cjs.js +8 -12
  167. package/dist/drawer.esm.js +6 -10
  168. package/dist/dropdown.cjs.js +8 -6
  169. package/dist/dropdown.esm.js +33 -30
  170. package/dist/empty-state.cjs.js +17 -15
  171. package/dist/empty-state.esm.js +13 -11
  172. package/dist/field-error.cjs.js +1 -1
  173. package/dist/field-error.esm.js +7 -7
  174. package/dist/field.cjs.js +23 -14
  175. package/dist/field.esm.js +30 -21
  176. package/dist/fieldset.cjs.js +16 -9
  177. package/dist/fieldset.esm.js +19 -12
  178. package/dist/file-upload.cjs.js +79 -37
  179. package/dist/file-upload.esm.js +154 -112
  180. package/dist/flex.cjs.js +2 -2
  181. package/dist/flex.esm.js +8 -8
  182. package/dist/floating-toolbar.cjs.js +6 -7
  183. package/dist/floating-toolbar.esm.js +8 -9
  184. package/dist/form.cjs.js +24 -27
  185. package/dist/form.esm.js +24 -27
  186. package/dist/gantt.cjs.js +13 -11
  187. package/dist/gantt.esm.js +13 -11
  188. package/dist/grid.cjs.js +1 -1
  189. package/dist/grid.esm.js +1 -1
  190. package/dist/hover-card.cjs.js +8 -8
  191. package/dist/hover-card.esm.js +18 -15
  192. package/dist/icon-cloud.cjs.js +19 -36
  193. package/dist/icon-cloud.esm.js +41 -58
  194. package/dist/index.cjs.js +1 -1
  195. package/dist/index.d.ts +2 -0
  196. package/dist/index.d.ts.map +1 -1
  197. package/dist/index.esm.js +108 -104
  198. package/dist/inline-edit.cjs.js +50 -22
  199. package/dist/inline-edit.esm.js +77 -49
  200. package/dist/input.cjs.js +45 -38
  201. package/dist/input.esm.js +60 -53
  202. package/dist/label.cjs.js +6 -6
  203. package/dist/label.esm.js +6 -6
  204. package/dist/layout.cjs.js +3 -3
  205. package/dist/layout.esm.js +3 -3
  206. package/dist/marquee.cjs.js +7 -10
  207. package/dist/marquee.esm.js +7 -10
  208. package/dist/masonry-grid.cjs.js +2 -2
  209. package/dist/masonry-grid.esm.js +11 -11
  210. package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
  211. package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
  212. package/dist/menu.cjs.js +8 -24
  213. package/dist/menu.esm.js +52 -72
  214. package/dist/menubar.cjs.js +9 -31
  215. package/dist/menubar.esm.js +127 -153
  216. package/dist/meter.cjs.js +4 -9
  217. package/dist/meter.esm.js +6 -11
  218. package/dist/multi-select.cjs.js +53 -40
  219. package/dist/multi-select.esm.js +87 -73
  220. package/dist/navigation-menu.cjs.js +10 -10
  221. package/dist/navigation-menu.esm.js +33 -33
  222. package/dist/number-field.cjs.js +28 -17
  223. package/dist/number-field.esm.js +37 -26
  224. package/dist/number-ticker.cjs.js +4 -4
  225. package/dist/number-ticker.esm.js +10 -10
  226. package/dist/odometer.cjs.js +9 -9
  227. package/dist/odometer.esm.js +17 -17
  228. package/dist/orbiter.cjs.js +11 -28
  229. package/dist/orbiter.esm.js +28 -45
  230. package/dist/overlay-motion-B56x1GoY.js +49 -0
  231. package/dist/overlay-motion-BX3dPLay.mjs +120 -0
  232. package/dist/pagination.cjs.js +28 -25
  233. package/dist/pagination.esm.js +54 -51
  234. package/dist/password-field.cjs.js +39 -34
  235. package/dist/password-field.esm.js +63 -58
  236. package/dist/pin-input.cjs.js +18 -14
  237. package/dist/pin-input.esm.js +24 -20
  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 +16 -28
  243. package/dist/popover.esm.js +29 -45
  244. package/dist/portal-DeaM1tYY.mjs +121 -0
  245. package/dist/portal-XbYR3m_q.js +1 -0
  246. package/dist/portal.cjs.js +1 -1
  247. package/dist/portal.d.ts +3 -1
  248. package/dist/portal.d.ts.map +1 -1
  249. package/dist/portal.esm.js +1 -1
  250. package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
  251. package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
  252. package/dist/positioner.cjs.js +1 -1
  253. package/dist/positioner.esm.js +1 -1
  254. package/dist/presence.cjs.js +1 -1
  255. package/dist/presence.esm.js +1 -1
  256. package/dist/primitives/overlay-motion.d.ts +47 -0
  257. package/dist/primitives/overlay-motion.d.ts.map +1 -0
  258. package/dist/primitives/positioner.d.ts.map +1 -1
  259. package/dist/progress.cjs.js +11 -16
  260. package/dist/progress.esm.js +37 -42
  261. package/dist/quick-actions.cjs.js +14 -14
  262. package/dist/quick-actions.esm.js +12 -12
  263. package/dist/radio-group.cjs.js +50 -26
  264. package/dist/radio-group.esm.js +53 -29
  265. package/dist/radio.cjs.js +16 -13
  266. package/dist/radio.esm.js +16 -13
  267. package/dist/rating.cjs.js +11 -15
  268. package/dist/rating.esm.js +48 -50
  269. package/dist/{runtime-CFnK53iC.mjs → runtime-BRT7E4A8.mjs} +563 -531
  270. package/dist/runtime-CXw4SGV9.js +5 -0
  271. package/dist/runtime.cjs.js +1 -1
  272. package/dist/runtime.d.ts +3 -2
  273. package/dist/runtime.d.ts.map +1 -1
  274. package/dist/runtime.esm.js +36 -32
  275. package/dist/scroll-area.cjs.js +3 -4
  276. package/dist/scroll-area.esm.js +3 -4
  277. package/dist/section.cjs.js +2 -4
  278. package/dist/section.esm.js +2 -4
  279. package/dist/select.cjs.js +42 -75
  280. package/dist/select.esm.js +57 -89
  281. package/dist/selection-popup.cjs.js +3 -4
  282. package/dist/selection-popup.esm.js +3 -4
  283. package/dist/semantic-tokens.d.ts +17 -0
  284. package/dist/semantic-tokens.d.ts.map +1 -0
  285. package/dist/separator.cjs.js +6 -6
  286. package/dist/separator.esm.js +7 -7
  287. package/dist/sidebar.cjs.js +29 -28
  288. package/dist/sidebar.esm.js +32 -31
  289. package/dist/skeleton.cjs.js +2 -2
  290. package/dist/skeleton.esm.js +2 -2
  291. package/dist/slider.cjs.js +22 -26
  292. package/dist/slider.esm.js +25 -29
  293. package/dist/slot.cjs.js +1 -1
  294. package/dist/slot.esm.js +1 -1
  295. package/dist/sortable.cjs.js +10 -11
  296. package/dist/sortable.esm.js +10 -11
  297. package/dist/spinning-text.cjs.js +4 -13
  298. package/dist/spinning-text.esm.js +4 -13
  299. package/dist/split-button.cjs.js +7 -7
  300. package/dist/split-button.esm.js +17 -16
  301. package/dist/splitter.cjs.js +52 -10
  302. package/dist/splitter.esm.js +55 -13
  303. package/dist/stepper.cjs.js +31 -65
  304. package/dist/stepper.esm.js +32 -66
  305. package/dist/switch.cjs.js +20 -22
  306. package/dist/switch.esm.js +20 -22
  307. package/dist/table.cjs.js +5 -5
  308. package/dist/table.esm.js +20 -20
  309. package/dist/tabs.cjs.js +101 -26
  310. package/dist/tabs.esm.js +187 -112
  311. package/dist/tags-input.cjs.js +43 -17
  312. package/dist/tags-input.esm.js +75 -49
  313. package/dist/textarea.cjs.js +34 -35
  314. package/dist/textarea.esm.js +50 -51
  315. package/dist/theme.d.ts +25 -1
  316. package/dist/theme.d.ts.map +1 -1
  317. package/dist/time-field.cjs.js +8 -8
  318. package/dist/time-field.esm.js +29 -29
  319. package/dist/time-picker.cjs.js +17 -14
  320. package/dist/time-picker.esm.js +28 -25
  321. package/dist/timeline.cjs.js +10 -10
  322. package/dist/timeline.esm.js +7 -7
  323. package/dist/toast.cjs.js +2 -2
  324. package/dist/toast.esm.js +2 -2
  325. package/dist/toggle-group.cjs.js +13 -13
  326. package/dist/toggle-group.esm.js +66 -61
  327. package/dist/toggle.cjs.js +52 -34
  328. package/dist/toggle.esm.js +80 -62
  329. package/dist/toolbar.cjs.js +14 -14
  330. package/dist/toolbar.esm.js +41 -33
  331. package/dist/tooltip.cjs.js +3 -3
  332. package/dist/tooltip.esm.js +39 -33
  333. package/dist/transfer-list.cjs.js +37 -38
  334. package/dist/transfer-list.esm.js +32 -33
  335. package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
  336. package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
  337. package/dist/tree-item.cjs.js +9 -8
  338. package/dist/tree-item.esm.js +13 -12
  339. package/dist/tree.cjs.js +1 -1
  340. package/dist/tree.esm.js +1 -1
  341. package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
  342. package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
  343. package/dist/wizard.cjs.js +51 -39
  344. package/dist/wizard.esm.js +51 -39
  345. package/package.json +1 -1
  346. package/dist/date-time-utils-y3AvNvGe.js +0 -1
  347. package/dist/portal-DgpQ3Jo1.js +0 -1
  348. package/dist/portal-bR42gHvG.mjs +0 -118
  349. package/dist/runtime-DwE-tizc.js +0 -1
@@ -1,15 +1,15 @@
1
1
  import { E as I } from "./ElementBase-BeZT54Hj.mjs";
2
2
  const M = `
3
3
  :host {
4
- --ui-file-upload-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
4
+ --ui-file-upload-border-color: var(--ui-color-line, color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent));
5
5
  --ui-file-upload-border: 1px solid var(--ui-file-upload-border-color);
6
- --ui-file-upload-radius: var(--ui-radius, 12px);
6
+ --ui-file-upload-radius: calc(var(--ui-radius, 6px) + 2px);
7
7
  --ui-file-upload-bg: var(--ui-color-surface, #ffffff);
8
8
  --ui-file-upload-text: var(--ui-color-text, #0f172a);
9
9
  --ui-file-upload-muted: var(--ui-color-muted, #526175);
10
10
  --ui-file-upload-focus: var(--ui-color-focus-ring, #2563eb);
11
- --ui-file-upload-danger: var(--ui-color-danger, #dc2626);
12
- --ui-file-upload-success: var(--ui-color-success, #15803d);
11
+ --ui-file-upload-danger: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
12
+ --ui-file-upload-success: var(--ui-color-success-text, var(--ui-color-success, #15803d));
13
13
  display: block;
14
14
  inline-size: 100%;
15
15
  min-inline-size: 0;
@@ -75,10 +75,16 @@ const M = `
75
75
  box-sizing: border-box;
76
76
  }
77
77
 
78
+ :host(:not([disabled])) .surface:hover:not([data-dragging="true"]) {
79
+ border-color: var(--ui-color-line-strong, var(--ui-file-upload-border-color));
80
+ background: color-mix(in srgb, currentColor 2%, var(--ui-file-upload-bg));
81
+ }
82
+
78
83
  .surface[data-dragging="true"] {
79
- border-color: color-mix(in srgb, var(--ui-file-upload-focus) 62%, transparent);
80
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-file-upload-focus) 18%, transparent);
81
- transform: translateY(-1px);
84
+ border-color: var(--ui-file-upload-focus);
85
+ outline: var(--ui-ring-width, 2px) solid var(--ui-file-upload-focus);
86
+ outline-offset: -1px;
87
+ background: color-mix(in srgb, var(--ui-file-upload-focus) 6%, var(--ui-file-upload-bg));
82
88
  }
83
89
 
84
90
  :host([surface="dropzone"]) .surface {
@@ -86,16 +92,10 @@ const M = `
86
92
  justify-items: center;
87
93
  text-align: center;
88
94
  min-block-size: 168px;
89
- background:
90
- linear-gradient(
91
- 180deg,
92
- color-mix(in srgb, var(--ui-file-upload-bg) 94%, #ffffff 6%),
93
- var(--ui-file-upload-bg)
94
- );
95
95
  }
96
96
 
97
97
  .headline {
98
- font: 600 14px/1.35 "Inter", "IBM Plex Sans", sans-serif;
98
+ font: 500 14px/1.35 "Inter", "IBM Plex Sans", sans-serif;
99
99
  }
100
100
 
101
101
  .subline {
@@ -109,12 +109,24 @@ const M = `
109
109
  align-items: center;
110
110
  justify-content: center;
111
111
  border: none;
112
- border-radius: 999px;
113
- padding: 8px 12px;
114
- background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 12%, transparent);
115
- color: color-mix(in srgb, var(--ui-color-primary, #2563eb) 82%, #0f172a 18%);
116
- font: 600 12px/1 "Inter", "IBM Plex Sans", sans-serif;
112
+ border-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
113
+ min-height: var(--ui-control-height-2, 32px);
114
+ padding: 0 12px;
115
+ /* A primary button: the theme's text colour on its fill (the tinted version was unreadable on amber). */
116
+ background: var(--ui-color-primary, #2563eb);
117
+ color: var(--ui-color-foreground-on-primary, #ffffff);
118
+ font: 500 14px/1 "Inter", "IBM Plex Sans", sans-serif;
117
119
  cursor: pointer;
120
+ transition: background-color 120ms ease;
121
+ }
122
+
123
+ .cta:hover {
124
+ background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 88%, #000);
125
+ }
126
+
127
+ .cta:focus-visible {
128
+ outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-color-primary, #2563eb));
129
+ outline-offset: var(--ui-ring-offset, 2px);
118
130
  }
119
131
 
120
132
  .list {
@@ -129,9 +141,9 @@ const M = `
129
141
  justify-content: space-between;
130
142
  gap: 10px;
131
143
  padding: 10px 12px;
132
- border: 1px solid color-mix(in srgb, var(--ui-file-upload-border-color) 70%, transparent);
133
- border-radius: 14px;
134
- background: color-mix(in srgb, var(--ui-file-upload-bg) 97%, transparent);
144
+ border: 1px solid var(--ui-file-upload-border-color);
145
+ border-radius: var(--ui-file-upload-radius);
146
+ background: transparent;
135
147
  }
136
148
 
137
149
  .actions[hidden] {
@@ -166,15 +178,15 @@ const M = `
166
178
  gap: 10px;
167
179
  align-items: center;
168
180
  padding: 10px 12px;
169
- border: 1px solid color-mix(in srgb, var(--ui-file-upload-border-color) 76%, transparent);
170
- border-radius: 12px;
171
- background: color-mix(in srgb, var(--ui-file-upload-bg) 94%, transparent);
181
+ border: 1px solid var(--ui-file-upload-border-color);
182
+ border-radius: var(--ui-file-upload-radius);
183
+ background: transparent;
172
184
  }
173
185
 
174
186
  .preview {
175
187
  inline-size: 38px;
176
188
  block-size: 38px;
177
- border-radius: 10px;
189
+ border-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
178
190
  background: color-mix(in srgb, var(--ui-file-upload-text) 8%, transparent);
179
191
  overflow: hidden;
180
192
  display: inline-grid;
@@ -231,12 +243,12 @@ const M = `
231
243
 
232
244
  .status[data-state="pending"] {
233
245
  background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 10%, transparent);
234
- color: color-mix(in srgb, var(--ui-color-primary, #2563eb) 82%, #0f172a 18%);
246
+ color: var(--ui-color-accent-text, color-mix(in srgb, var(--ui-color-primary, #2563eb) 82%, #0f172a 18%));
235
247
  }
236
248
 
237
249
  .status[data-state="uploading"] {
238
250
  background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
239
- color: color-mix(in srgb, var(--ui-color-primary, #2563eb) 84%, #0f172a 16%);
251
+ color: var(--ui-color-accent-text, color-mix(in srgb, var(--ui-color-primary, #2563eb) 84%, #0f172a 16%));
240
252
  }
241
253
 
242
254
  .status[data-state="success"] {
@@ -271,7 +283,16 @@ const M = `
271
283
  .progress-bar {
272
284
  block-size: 100%;
273
285
  border-radius: inherit;
274
- background: color-mix(in srgb, var(--ui-file-upload-success) 74%, transparent);
286
+ background: var(--ui-color-primary, #2563eb);
287
+ transition: inline-size 200ms ease;
288
+ }
289
+
290
+ .progress-bar[data-state="success"] {
291
+ background: var(--ui-file-upload-success);
292
+ }
293
+
294
+ .progress-bar[data-state="error"] {
295
+ background: var(--ui-file-upload-danger);
275
296
  }
276
297
 
277
298
  .progress-text {
@@ -281,13 +302,24 @@ const M = `
281
302
  }
282
303
 
283
304
  .file-remove {
284
- border: none;
285
- border-radius: 999px;
286
- padding: 6px 9px;
287
- background: color-mix(in srgb, currentColor 8%, transparent);
305
+ border: 1px solid var(--ui-file-upload-border-color);
306
+ border-radius: var(--ui-control-radius-1, var(--ui-radius, 6px));
307
+ min-block-size: var(--ui-control-height-1, 24px);
308
+ padding: 0 8px;
309
+ background: transparent;
288
310
  color: inherit;
289
311
  cursor: pointer;
290
- font: 600 11px/1 "Inter", sans-serif;
312
+ font: 500 12px/1 "Inter", sans-serif;
313
+ transition: background-color 120ms ease;
314
+ }
315
+
316
+ .file-remove:hover {
317
+ background: var(--ui-color-fill-hover, color-mix(in srgb, currentColor 8%, transparent));
318
+ }
319
+
320
+ .file-remove:focus-visible {
321
+ outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-file-upload-focus));
322
+ outline-offset: var(--ui-ring-offset, 1px);
291
323
  }
292
324
 
293
325
  .file-remove[data-tone="danger"] {
@@ -295,8 +327,9 @@ const M = `
295
327
  }
296
328
 
297
329
  .file-remove[data-variant="primary"] {
330
+ border-color: transparent;
298
331
  background: color-mix(in srgb, var(--ui-color-primary, #2563eb) 12%, transparent);
299
- color: color-mix(in srgb, var(--ui-color-primary, #2563eb) 84%, #0f172a 16%);
332
+ color: var(--ui-color-accent-text, color-mix(in srgb, var(--ui-color-primary, #2563eb) 84%, #0f172a 16%));
300
333
  }
301
334
 
302
335
  .file-error {
@@ -322,6 +355,15 @@ const M = `
322
355
  display: none;
323
356
  }
324
357
 
358
+ @media (prefers-reduced-motion: reduce) {
359
+ .surface,
360
+ .cta,
361
+ .file-remove,
362
+ .progress-bar {
363
+ transition: none !important;
364
+ }
365
+ }
366
+
325
367
  :host([disabled]) .surface,
326
368
  :host([disabled]) .file-remove,
327
369
  :host([disabled]) .cta {
@@ -341,10 +383,10 @@ function O(g, e) {
341
383
  if (!e.trim()) return !0;
342
384
  const t = e.split(",").map((a) => a.trim()).filter(Boolean);
343
385
  if (!t.length) return !0;
344
- const i = g.name.toLowerCase(), s = (g.type || "").toLowerCase();
386
+ const i = g.name.toLowerCase(), r = (g.type || "").toLowerCase();
345
387
  return t.some((a) => {
346
- const r = a.toLowerCase();
347
- return r.startsWith(".") ? i.endsWith(r) : r.endsWith("/*") ? s.startsWith(r.slice(0, -1)) : s === r;
388
+ const s = a.toLowerCase();
389
+ return s.startsWith(".") ? i.endsWith(s) : s.endsWith("/*") ? r.startsWith(s.slice(0, -1)) : r === s;
348
390
  });
349
391
  }
350
392
  class W extends I {
@@ -390,20 +432,20 @@ class W extends I {
390
432
  removeFile(e) {
391
433
  if (this._disabled() || e < 0 || e >= this._files.length) return;
392
434
  const t = this._files[e];
393
- this.cancelUpload(this._fileKey(t)), this._uploadState.delete(this._fileKey(t)), this._files = this._files.filter((i, s) => s !== e), this._syncUi(), this._emit("change", { files: this.files, source: "remove" });
435
+ this.cancelUpload(this._fileKey(t)), this._uploadState.delete(this._fileKey(t)), this._files = this._files.filter((i, r) => r !== e), this._syncUi(), this._emit("change", { files: this.files, source: "remove" });
394
436
  }
395
437
  async startUpload() {
396
438
  if (!this.uploadRequest || this._disabled()) return;
397
439
  const e = this._files.filter((i) => {
398
- const s = this._uploadState.get(this._fileKey(i));
399
- return !s || s.state === "pending" || s.state === "error" || s.state === "canceled";
440
+ const r = this._uploadState.get(this._fileKey(i));
441
+ return !r || r.state === "pending" || r.state === "error" || r.state === "canceled";
400
442
  });
401
443
  if (!e.length) return;
402
444
  const t = ++this._uploadSequence;
403
445
  this._emit("upload-start", { files: e, requestId: t }), await Promise.all(e.map((i) => this._runUpload(i, t))), this._emit("upload-complete", {
404
446
  files: this.files,
405
447
  requestId: t,
406
- statuses: Object.fromEntries(Array.from(this._uploadState.entries()).map(([i, s]) => [i, { ...s }]))
448
+ statuses: Object.fromEntries(Array.from(this._uploadState.entries()).map(([i, r]) => [i, { ...r }]))
407
449
  }), this._syncUi();
408
450
  }
409
451
  cancelUploads() {
@@ -470,32 +512,32 @@ class W extends I {
470
512
  this._applyFiles(e, t, !1);
471
513
  }
472
514
  _applyFiles(e, t, i) {
473
- const s = this.hasAttribute("multiple"), a = i ? [] : s ? [...this._files] : [], r = [], n = [], m = this.getAttribute("accept") || "", _ = this._maxFiles(), v = this._maxSize(), x = new Set(a.map((o) => this._fileKey(o)));
474
- e.forEach((o) => {
475
- const b = this._fileKey(o);
515
+ const r = this.hasAttribute("multiple"), a = i ? [] : r ? [...this._files] : [], s = [], o = [], m = this.getAttribute("accept") || "", _ = this._maxFiles(), v = this._maxSize(), x = new Set(a.map((n) => this._fileKey(n)));
516
+ e.forEach((n) => {
517
+ const b = this._fileKey(n);
476
518
  if (!x.has(b)) {
477
- if (!O(o, m)) {
478
- n.push({ file: o, reason: "accept" });
519
+ if (!O(n, m)) {
520
+ o.push({ file: n, reason: "accept" });
479
521
  return;
480
522
  }
481
- if (v != null && o.size > v) {
482
- n.push({ file: o, reason: "max-size" });
523
+ if (v != null && n.size > v) {
524
+ o.push({ file: n, reason: "max-size" });
483
525
  return;
484
526
  }
485
- if (_ != null && a.length + r.length >= _) {
486
- n.push({ file: o, reason: "max-files" });
527
+ if (_ != null && a.length + s.length >= _) {
528
+ o.push({ file: n, reason: "max-files" });
487
529
  return;
488
530
  }
489
- x.add(b), r.push(o);
531
+ x.add(b), s.push(n);
490
532
  }
491
- }), i && (this.cancelUploads(), this._uploadState.clear()), this._files = [...a, ...r], !s && this._files.length > 1 && (this._files = [this._files[this._files.length - 1]]);
492
- const w = new Set(this._files.map((o) => this._fileKey(o)));
493
- Array.from(this._uploadState.keys()).forEach((o) => {
494
- w.has(o) || this._uploadState.delete(o);
495
- }), this._files.forEach((o) => {
496
- const b = this._fileKey(o);
533
+ }), i && (this.cancelUploads(), this._uploadState.clear()), this._files = [...a, ...s], !r && this._files.length > 1 && (this._files = [this._files[this._files.length - 1]]);
534
+ const w = new Set(this._files.map((n) => this._fileKey(n)));
535
+ Array.from(this._uploadState.keys()).forEach((n) => {
536
+ w.has(n) || this._uploadState.delete(n);
537
+ }), this._files.forEach((n) => {
538
+ const b = this._fileKey(n);
497
539
  this._uploadState.has(b) || this._uploadState.set(b, { state: "pending", progress: null });
498
- }), this._syncUi(), this._emit("change", { files: this.files, source: t }), n.length ? (this._emit("reject", { rejected: n, source: t }), this.setAttribute("data-error", n[0].reason === "accept" ? "One or more files do not match the accepted types" : n[0].reason === "max-size" ? "One or more files exceed the size limit" : "Too many files selected")) : this.removeAttribute("data-error"), r.length && this.hasAttribute("upload-on-select") && this.uploadRequest && this.startUpload(), this._syncUi();
540
+ }), this._syncUi(), this._emit("change", { files: this.files, source: t }), o.length ? (this._emit("reject", { rejected: o, source: t }), this.setAttribute("data-error", o[0].reason === "accept" ? "One or more files do not match the accepted types" : o[0].reason === "max-size" ? "One or more files exceed the size limit" : "Too many files selected")) : this.removeAttribute("data-error"), s.length && this.hasAttribute("upload-on-select") && this.uploadRequest && this.startUpload(), this._syncUi();
499
541
  }
500
542
  _emit(e, t) {
501
543
  this.dispatchEvent(new CustomEvent(e, { detail: t, bubbles: !0, composed: !0 }));
@@ -508,28 +550,28 @@ class W extends I {
508
550
  }
509
551
  async _runUpload(e, t) {
510
552
  if (!this.uploadRequest) return;
511
- const i = this._fileKey(e), s = new AbortController();
512
- this._uploadControllers.set(i, s), this._setUploadEntry(i, { state: "uploading", progress: 0 });
513
- const a = (r) => {
514
- const n = this._uploadState.get(i);
515
- if (!n || n.state !== "uploading") return;
516
- const m = Number.isFinite(r) ? Math.max(0, Math.min(100, r)) : 0;
517
- this._uploadState.set(i, { ...n, progress: m }), this._emit("upload-progress", { file: e, fileKey: i, progress: m, requestId: t }), this._syncUi();
553
+ const i = this._fileKey(e), r = new AbortController();
554
+ this._uploadControllers.set(i, r), this._setUploadEntry(i, { state: "uploading", progress: 0 });
555
+ const a = (s) => {
556
+ const o = this._uploadState.get(i);
557
+ if (!o || o.state !== "uploading") return;
558
+ const m = Number.isFinite(s) ? Math.max(0, Math.min(100, s)) : 0;
559
+ this._uploadState.set(i, { ...o, progress: m }), this._emit("upload-progress", { file: e, fileKey: i, progress: m, requestId: t }), this._syncUi();
518
560
  };
519
561
  try {
520
- const r = await this.uploadRequest({
562
+ const s = await this.uploadRequest({
521
563
  file: e,
522
564
  files: this.files,
523
- signal: s.signal,
565
+ signal: r.signal,
524
566
  setProgress: a
525
567
  });
526
- s.signal.aborted ? (this._uploadState.set(i, { state: "canceled", progress: null }), this._emit("upload-cancel", { file: e, fileKey: i, requestId: t })) : (this._uploadState.set(i, { state: "success", progress: 100, result: r }), this._emit("upload-success", { file: e, fileKey: i, requestId: t, result: r }));
527
- } catch (r) {
528
- if (s.signal.aborted)
568
+ r.signal.aborted ? (this._uploadState.set(i, { state: "canceled", progress: null }), this._emit("upload-cancel", { file: e, fileKey: i, requestId: t })) : (this._uploadState.set(i, { state: "success", progress: 100, result: s }), this._emit("upload-success", { file: e, fileKey: i, requestId: t, result: s }));
569
+ } catch (s) {
570
+ if (r.signal.aborted)
529
571
  this._uploadState.set(i, { state: "canceled", progress: null }), this._emit("upload-cancel", { file: e, fileKey: i, requestId: t });
530
572
  else {
531
- const n = r instanceof Error ? r.message : "Upload failed";
532
- this._uploadState.set(i, { state: "error", progress: null, error: n }), this._emit("upload-error", { file: e, fileKey: i, requestId: t, error: n });
573
+ const o = s instanceof Error ? s.message : "Upload failed";
574
+ this._uploadState.set(i, { state: "error", progress: null, error: o }), this._emit("upload-error", { file: e, fileKey: i, requestId: t, error: o });
533
575
  }
534
576
  } finally {
535
577
  this._uploadControllers.delete(i), this._syncUi();
@@ -541,8 +583,8 @@ class W extends I {
541
583
  try {
542
584
  const t = JSON.parse(e);
543
585
  return !t || typeof t != "object" || Array.isArray(t) ? {} : Object.fromEntries(
544
- Object.entries(t).map(([i, s]) => {
545
- const a = Number(s);
586
+ Object.entries(t).map(([i, r]) => {
587
+ const a = Number(r);
546
588
  return [i, Number.isFinite(a) ? Math.max(0, Math.min(100, a)) : 0];
547
589
  })
548
590
  );
@@ -565,16 +607,16 @@ class W extends I {
565
607
  }
566
608
  }
567
609
  _actionSummary() {
568
- const e = this._files.map((a) => this._uploadState.get(this._fileKey(a)) || { state: "pending", progress: null }), t = e.filter((a) => a.state === "uploading").length, i = e.filter((a) => a.state === "error").length, s = e.filter((a) => a.state === "success").length;
610
+ const e = this._files.map((a) => this._uploadState.get(this._fileKey(a)) || { state: "pending", progress: null }), t = e.filter((a) => a.state === "uploading").length, i = e.filter((a) => a.state === "error").length, r = e.filter((a) => a.state === "success").length;
569
611
  return t > 0 ? {
570
612
  title: "Upload in progress",
571
613
  subtitle: `${t} file${t === 1 ? "" : "s"} still uploading`
572
614
  } : i > 0 ? {
573
615
  title: "Retry required",
574
616
  subtitle: `${i} file${i === 1 ? "" : "s"} failed to upload`
575
- } : s > 0 && s === this._files.length ? {
617
+ } : r > 0 && r === this._files.length ? {
576
618
  title: "Uploads complete",
577
- subtitle: `${s} file${s === 1 ? "" : "s"} uploaded successfully`
619
+ subtitle: `${r} file${r === 1 ? "" : "s"} uploaded successfully`
578
620
  } : {
579
621
  title: "Ready to upload",
580
622
  subtitle: `${this._files.length} file${this._files.length === 1 ? "" : "s"} queued`
@@ -584,8 +626,8 @@ class W extends I {
584
626
  if (!this.hasAttribute("show-previews") || typeof URL > "u" || typeof URL.createObjectURL != "function" || !e.type.startsWith("image/")) return null;
585
627
  const t = this._fileKey(e), i = this._previewUrls.get(t);
586
628
  if (i) return i;
587
- const s = URL.createObjectURL(e);
588
- return this._previewUrls.set(t, s), s;
629
+ const r = URL.createObjectURL(e);
630
+ return this._previewUrls.set(t, r), r;
589
631
  }
590
632
  _revokePreviewUrls(e = /* @__PURE__ */ new Set()) {
591
633
  this._previewUrls.forEach((t, i) => {
@@ -600,23 +642,23 @@ class W extends I {
600
642
  }
601
643
  _syncUi() {
602
644
  if (!this._surfaceEl || !this._inputEl || !this._listEl || !this._errorEl || !this._actionsEl) return;
603
- const e = (this.getAttribute("label") || "").trim(), t = (this.getAttribute("description") || "").trim(), i = this.hasAttribute("required"), s = this._disabled();
645
+ const e = (this.getAttribute("label") || "").trim(), t = (this.getAttribute("description") || "").trim(), i = this.hasAttribute("required"), r = this._disabled();
604
646
  this._inputEl.setAttribute("aria-label", e || (this.getAttribute("aria-label") || "").trim() || "Choose files");
605
- const a = this.getAttribute("drop-label") || "Drag files here or browse from your device", r = this.getAttribute("button-text") || "Choose files", n = this.getAttribute("upload-button-text") || "Start upload", m = (this.getAttribute("data-error") || "").trim(), _ = this._parseProgress(), v = this.root.querySelector(".label"), x = this.root.querySelector(".description"), w = this.root.querySelector(".meta"), o = this.root.querySelector(".headline"), b = this.root.querySelector(".subline"), D = this.root.querySelector(".cta"), R = this.root.querySelector(".required"), $ = this.root.querySelector(".actions-title"), B = this.root.querySelector(".actions-subtitle"), k = this.root.querySelector(".actions-row");
606
- v.hidden = !e, v.querySelector(".label-text").textContent = e, R.hidden = !i, x.hidden = !t, x.textContent = t, w.hidden = !e && !t, o.textContent = this._files.length ? `${this._files.length} file${this._files.length === 1 ? "" : "s"} selected` : a, b.textContent = this._files.length ? this._files.map((p) => p.name).join(", ") : this.getAttribute("accept") ? `Accepted: ${this.getAttribute("accept")}` : "Supports click, keyboard, and drag-and-drop upload", D.textContent = r, D.disabled = s, this._surfaceEl.setAttribute("data-dragging", this._dragging ? "true" : "false"), this._surfaceEl.setAttribute("aria-disabled", s ? "true" : "false"), this._inputEl.disabled = s, this._inputEl.multiple = this.hasAttribute("multiple"), this._inputEl.name = this.getAttribute("name") || "", this._inputEl.accept = this.getAttribute("accept") || "", this._errorEl.hidden = !m, this._errorEl.textContent = m;
647
+ const a = this.getAttribute("drop-label") || "Drag files here or browse from your device", s = this.getAttribute("button-text") || "Choose files", o = this.getAttribute("upload-button-text") || "Start upload", m = (this.getAttribute("data-error") || "").trim(), _ = this._parseProgress(), v = this.root.querySelector(".label"), x = this.root.querySelector(".description"), w = this.root.querySelector(".meta"), n = this.root.querySelector(".headline"), b = this.root.querySelector(".subline"), D = this.root.querySelector(".cta"), R = this.root.querySelector(".required"), $ = this.root.querySelector(".actions-title"), B = this.root.querySelector(".actions-subtitle"), S = this.root.querySelector(".actions-row");
648
+ v.hidden = !e, v.querySelector(".label-text").textContent = e, R.hidden = !i, x.hidden = !t, x.textContent = t, w.hidden = !e && !t, n.textContent = this._files.length ? `${this._files.length} file${this._files.length === 1 ? "" : "s"} selected` : a, b.textContent = this._files.length ? this._files.map((p) => p.name).join(", ") : this.getAttribute("accept") ? `Accepted: ${this.getAttribute("accept")}` : "Supports click, keyboard, and drag-and-drop upload", D.textContent = s, D.disabled = r, this._surfaceEl.setAttribute("data-dragging", this._dragging ? "true" : "false"), this._surfaceEl.setAttribute("aria-disabled", r ? "true" : "false"), this._inputEl.disabled = r, this._inputEl.multiple = this.hasAttribute("multiple"), this._inputEl.name = this.getAttribute("name") || "", this._inputEl.accept = this.getAttribute("accept") || "", this._errorEl.hidden = !m, this._errorEl.textContent = m;
607
649
  const L = !!this.uploadRequest && this._files.length > 0, N = this._actionSummary();
608
- if (this._actionsEl.hidden = !L, $.textContent = N.title, B.textContent = N.subtitle, k.replaceChildren(), L) {
650
+ if (this._actionsEl.hidden = !L, $.textContent = N.title, B.textContent = N.subtitle, S.replaceChildren(), L) {
609
651
  const p = this._files.some((l) => {
610
652
  const h = this._uploadState.get(this._fileKey(l))?.state || "pending";
611
653
  return h === "pending" || h === "error" || h === "canceled";
612
654
  }), f = document.createElement("button");
613
- if (f.type = "button", f.className = "file-remove", f.dataset.variant = "primary", f.textContent = this.uploading ? "Uploading…" : p ? n : "Upload complete", f.disabled = s || this.uploading || !p, f.addEventListener("click", (l) => {
655
+ if (f.type = "button", f.className = "file-remove", f.dataset.variant = "primary", f.textContent = this.uploading ? "Uploading…" : p ? o : "Upload complete", f.disabled = r || this.uploading || !p, f.addEventListener("click", (l) => {
614
656
  l.stopPropagation(), this.startUpload();
615
- }), k.append(f), this.uploading) {
657
+ }), S.append(f), this.uploading) {
616
658
  const l = document.createElement("button");
617
- l.type = "button", l.className = "file-remove", l.dataset.tone = "danger", l.textContent = "Cancel uploads", l.disabled = s, l.addEventListener("click", (h) => {
659
+ l.type = "button", l.className = "file-remove", l.dataset.tone = "danger", l.textContent = "Cancel uploads", l.disabled = r, l.addEventListener("click", (h) => {
618
660
  h.stopPropagation(), this.cancelUploads();
619
- }), k.append(l);
661
+ }), S.append(l);
620
662
  }
621
663
  }
622
664
  const P = /* @__PURE__ */ new Set();
@@ -625,7 +667,7 @@ class W extends I {
625
667
  l.className = "file";
626
668
  const h = this._fileKey(p);
627
669
  P.add(h);
628
- const c = this._uploadState.get(h) || { state: "pending", progress: null }, y = document.createElement("div");
670
+ const u = this._uploadState.get(h) || { state: "pending", progress: null }, y = document.createElement("div");
629
671
  y.className = "preview";
630
672
  const K = this._getPreviewUrl(p);
631
673
  if (K) {
@@ -633,35 +675,35 @@ class W extends I {
633
675
  d.src = K, d.alt = "", y.append(d);
634
676
  } else
635
677
  y.textContent = p.name.split(".").pop()?.slice(0, 4).toUpperCase() || "FILE";
636
- const S = document.createElement("div");
637
- S.className = "file-text";
638
678
  const C = document.createElement("div");
639
- C.className = "file-name", C.textContent = p.name;
679
+ C.className = "file-text";
680
+ const A = document.createElement("div");
681
+ A.className = "file-name", A.textContent = p.name;
640
682
  const E = document.createElement("div");
641
683
  E.className = "file-meta", E.textContent = j(p.size);
642
684
  const U = document.createElement("span");
643
- U.className = "status", U.dataset.state = c.state, U.textContent = this._statusLabel(c.state), E.append(U), S.append(C, E);
644
- const u = document.createElement("button");
645
- u.type = "button", u.className = "file-remove", u.disabled = s, c.state === "uploading" ? (u.textContent = "Cancel", u.dataset.tone = "danger", u.addEventListener("click", (d) => {
685
+ U.className = "status", U.dataset.state = u.state, U.textContent = this._statusLabel(u.state), E.append(U), C.append(A, E);
686
+ const c = document.createElement("button");
687
+ c.type = "button", c.className = "file-remove", c.disabled = r, u.state === "uploading" ? (c.textContent = "Cancel", c.dataset.tone = "danger", c.addEventListener("click", (d) => {
646
688
  d.stopPropagation(), this.cancelUpload(h);
647
- })) : c.state === "error" ? (u.textContent = "Retry", u.dataset.variant = "primary", u.addEventListener("click", (d) => {
689
+ })) : u.state === "error" ? (c.textContent = "Retry", c.dataset.variant = "primary", c.addEventListener("click", (d) => {
648
690
  d.stopPropagation(), this._uploadState.set(h, { state: "pending", progress: null }), this._syncUi(), this.startUpload();
649
- })) : (u.textContent = "Remove", u.addEventListener("click", (d) => {
691
+ })) : (c.textContent = "Remove", c.addEventListener("click", (d) => {
650
692
  d.stopPropagation(), this.removeFile(f);
651
- })), l.append(y, S, u);
652
- const A = typeof c.progress == "number" ? c.progress : _[h] ?? _[p.name];
653
- if (typeof A == "number") {
693
+ })), l.append(y, C, c);
694
+ const z = typeof u.progress == "number" ? u.progress : _[h] ?? _[p.name];
695
+ if (typeof z == "number") {
654
696
  const d = document.createElement("div");
655
697
  d.className = "progress";
656
- const z = document.createElement("div");
657
- z.className = "progress-track";
658
698
  const F = document.createElement("div");
659
- F.className = "progress-bar", F.style.inlineSize = `${A}%`, z.append(F);
699
+ F.className = "progress-track";
700
+ const k = document.createElement("div");
701
+ k.className = "progress-bar", k.dataset.state = u.state, k.style.inlineSize = `${z}%`, F.append(k);
660
702
  const q = document.createElement("div");
661
- q.className = "progress-text", q.textContent = c.state === "success" ? "Upload complete" : c.state === "error" ? c.error || "Upload failed" : c.state === "canceled" ? "Upload canceled" : `Uploading ${Math.round(A)}%`, d.append(z, q), l.append(d);
662
- } else if (c.state === "error" && c.error) {
703
+ q.className = "progress-text", q.textContent = u.state === "success" ? "Upload complete" : u.state === "error" ? u.error || "Upload failed" : u.state === "canceled" ? "Upload canceled" : `Uploading ${Math.round(z)}%`, d.append(F, q), l.append(d);
704
+ } else if (u.state === "error" && u.error) {
663
705
  const d = document.createElement("div");
664
- d.className = "file-error", d.textContent = c.error, l.append(d);
706
+ d.className = "file-error", d.textContent = u.error, l.append(d);
665
707
  }
666
708
  return l;
667
709
  })), this._revokePreviewUrls(P);
@@ -669,16 +711,16 @@ class W extends I {
669
711
  _registerWithForm() {
670
712
  this._formUnregister && (this._formUnregister(), this._formUnregister = null);
671
713
  try {
672
- const s = this.getRootNode().host?.closest?.("ui-form") || null || this.closest("ui-form"), a = this.getAttribute("name");
673
- s && typeof s.registerField == "function" && a && (this._formUnregister = s.registerField(a, {
714
+ const r = this.getRootNode().host?.closest?.("ui-form") || null || this.closest("ui-form"), a = this.getAttribute("name");
715
+ r && typeof r.registerField == "function" && a && (this._formUnregister = r.registerField(a, {
674
716
  name: a,
675
717
  getValue: () => this.files,
676
- setValue: (r) => {
677
- Array.isArray(r) && r.every((n) => n instanceof File) && this.setFiles(r);
718
+ setValue: (s) => {
719
+ Array.isArray(s) && s.every((o) => o instanceof File) && this.setFiles(s);
678
720
  },
679
721
  validate: async () => this.hasAttribute("required") && this._files.length === 0 ? { valid: !1, message: "At least one file is required" } : { valid: !0 },
680
- setError: (r) => {
681
- r ? this.setAttribute("data-error", r) : this.removeAttribute("data-error"), this._syncUi();
722
+ setError: (s) => {
723
+ s ? this.setAttribute("data-error", s) : this.removeAttribute("data-error"), this._syncUi();
682
724
  }
683
725
  }));
684
726
  } catch {
package/dist/flex.cjs.js CHANGED
@@ -8,7 +8,7 @@
8
8
  --ui-flex-gap: 0px;
9
9
  --ui-flex-row-gap: var(--ui-flex-gap);
10
10
  --ui-flex-column-gap: var(--ui-flex-gap);
11
- --ui-flex-color: var(--ui-color-text, inherit);
11
+ --ui-flex-color: inherit;
12
12
  color-scheme: light dark;
13
13
  display: var(--ui-flex-display);
14
14
  color: var(--ui-flex-color);
@@ -49,6 +49,6 @@
49
49
  --ui-flex-color: CanvasText;
50
50
  }
51
51
  }
52
- `;function x(i){if(!i)return null;const e=i.trim();if(!e.startsWith("{"))return null;try{const s=JSON.parse(e);return!s||typeof s!="object"?null:s}catch{return null}}function f(i){return v[i]||i}function d(i,e){switch(i){case"display":return{"--ui-flex-display":e};case"direction":return{"--ui-flex-direction":e};case"align":return{"--ui-flex-align":e};case"justify":return{"--ui-flex-justify":e};case"wrap":return{"--ui-flex-wrap":e};case"gap":return{"--ui-flex-gap":f(e)};case"rowgap":return{"--ui-flex-row-gap":f(e)};case"columngap":return{"--ui-flex-column-gap":f(e)};default:return{}}}class m extends h.ElementBase{constructor(){super(...arguments),this._lastClassname="",this._appliedInlineProps=new Set}static get observedAttributes(){return["classname","headless",...p]}_syncLegacyClassname(){const e=this.getAttribute("classname")||"";e!==this._lastClassname&&(this._lastClassname&&this._lastClassname.split(/\s+/).forEach(s=>{s&&this.classList.remove(s)}),e&&e.split(/\s+/).forEach(s=>{s&&this.classList.add(s)}),this._lastClassname=e)}_applyInlineStyles(){this._appliedInlineProps.forEach(e=>this.style.removeProperty(e)),this._appliedInlineProps.clear(),p.forEach(e=>{const s=this.getAttribute(e);if(!s||x(s))return;const o=d(e,s);Object.entries(o).forEach(([n,u])=>{this.style.setProperty(n,u),this._appliedInlineProps.add(n)})})}_buildResponsiveCss(){const e={},s={sm:{},md:{},lg:{},xl:{}};p.forEach(r=>{const l=this.getAttribute(r),t=x(l);if(!t)return;const a=(c,g)=>{Object.assign(c,d(r,g))};typeof t.initial=="string"&&a(e,t.initial),typeof t.sm=="string"&&a(s.sm,t.sm),typeof t.md=="string"&&a(s.md,t.md),typeof t.lg=="string"&&a(s.lg,t.lg),typeof t.xl=="string"&&a(s.xl,t.xl)});const o=(r,l)=>{const t=Object.entries(l);return t.length?`${r} { ${t.map(([a,c])=>`${a}: ${c};`).join(" ")} }`:""},n=[],u=o(":host",e);return u&&n.push(u),Object.keys(s).forEach(r=>{const l=o(":host",s[r]);l&&n.push(`@media (min-width: ${y[r]}) { ${l} }`)}),n.join(`
52
+ `;function x(i){if(!i)return null;const e=i.trim();if(!e.startsWith("{"))return null;try{const s=JSON.parse(e);return!s||typeof s!="object"?null:s}catch{return null}}function f(i){return v[i]||i}function d(i,e){switch(i){case"display":return{"--ui-flex-display":e};case"direction":return{"--ui-flex-direction":e};case"align":return{"--ui-flex-align":e};case"justify":return{"--ui-flex-justify":e};case"wrap":return{"--ui-flex-wrap":e};case"gap":return{"--ui-flex-gap":f(e)};case"rowgap":return{"--ui-flex-row-gap":f(e)};case"columngap":return{"--ui-flex-column-gap":f(e)};default:return{}}}class m extends h.ElementBase{constructor(){super(...arguments),this._lastClassname="",this._appliedInlineProps=new Set}static get observedAttributes(){return["classname","headless",...p]}_syncLegacyClassname(){const e=this.getAttribute("classname")||"";e!==this._lastClassname&&(this._lastClassname&&this._lastClassname.split(/\s+/).forEach(s=>{s&&this.classList.remove(s)}),e&&e.split(/\s+/).forEach(s=>{s&&this.classList.add(s)}),this._lastClassname=e)}_applyInlineStyles(){this._appliedInlineProps.forEach(e=>this.style.removeProperty(e)),this._appliedInlineProps.clear(),p.forEach(e=>{const s=this.getAttribute(e);if(!s||x(s))return;const o=d(e,s);Object.entries(o).forEach(([a,u])=>{this.style.setProperty(a,u),this._appliedInlineProps.add(a)})})}_buildResponsiveCss(){const e={},s={sm:{},md:{},lg:{},xl:{}};p.forEach(r=>{const l=this.getAttribute(r),t=x(l);if(!t)return;const n=(c,g)=>{Object.assign(c,d(r,g))};typeof t.initial=="string"&&n(e,t.initial),typeof t.sm=="string"&&n(s.sm,t.sm),typeof t.md=="string"&&n(s.md,t.md),typeof t.lg=="string"&&n(s.lg,t.lg),typeof t.xl=="string"&&n(s.xl,t.xl)});const o=(r,l)=>{const t=Object.entries(l);return t.length?`${r} { ${t.map(([n,c])=>`${n}: ${c};`).join(" ")} }`:""},a=[],u=o(":host",e);return u&&a.push(u),Object.keys(s).forEach(r=>{const l=o(":host",s[r]);l&&a.push(`@media (min-width: ${y[r]}) { ${l} }`)}),a.join(`
53
53
  `)}render(){this._syncLegacyClassname(),this._applyInlineStyles();const e=this._buildResponsiveCss();this.setContent(`<style>${b}${e?`
54
54
  ${e}`:""}</style><slot></slot>`)}shouldRenderOnAttributeChange(e,s,o){return!0}}typeof customElements<"u"&&!customElements.get("ui-flex")&&customElements.define("ui-flex",m);exports.UIFlex=m;
package/dist/flex.esm.js CHANGED
@@ -4,7 +4,7 @@ const h = {
4
4
  md: "var(--ui-breakpoint-md, 768px)",
5
5
  lg: "var(--ui-breakpoint-lg, 1024px)",
6
6
  xl: "var(--ui-breakpoint-xl, 1280px)"
7
- }, p = ["display", "direction", "align", "justify", "wrap", "gap", "rowgap", "columngap"], y = {
7
+ }, c = ["display", "direction", "align", "justify", "wrap", "gap", "rowgap", "columngap"], y = {
8
8
  xs: "var(--ui-space-xs, 4px)",
9
9
  sm: "var(--ui-space-sm, 8px)",
10
10
  md: "var(--ui-space-md, 12px)",
@@ -20,7 +20,7 @@ const h = {
20
20
  --ui-flex-gap: 0px;
21
21
  --ui-flex-row-gap: var(--ui-flex-gap);
22
22
  --ui-flex-column-gap: var(--ui-flex-gap);
23
- --ui-flex-color: var(--ui-color-text, inherit);
23
+ --ui-flex-color: inherit;
24
24
  color-scheme: light dark;
25
25
  display: var(--ui-flex-display);
26
26
  color: var(--ui-flex-color);
@@ -103,7 +103,7 @@ class b extends g {
103
103
  super(...arguments), this._lastClassname = "", this._appliedInlineProps = /* @__PURE__ */ new Set();
104
104
  }
105
105
  static get observedAttributes() {
106
- return ["classname", "headless", ...p];
106
+ return ["classname", "headless", ...c];
107
107
  }
108
108
  _syncLegacyClassname() {
109
109
  const e = this.getAttribute("classname") || "";
@@ -114,7 +114,7 @@ class b extends g {
114
114
  }), this._lastClassname = e);
115
115
  }
116
116
  _applyInlineStyles() {
117
- this._appliedInlineProps.forEach((e) => this.style.removeProperty(e)), this._appliedInlineProps.clear(), p.forEach((e) => {
117
+ this._appliedInlineProps.forEach((e) => this.style.removeProperty(e)), this._appliedInlineProps.clear(), c.forEach((e) => {
118
118
  const s = this.getAttribute(e);
119
119
  if (!s || x(s)) return;
120
120
  const o = d(e, s);
@@ -130,17 +130,17 @@ class b extends g {
130
130
  lg: {},
131
131
  xl: {}
132
132
  };
133
- p.forEach((r) => {
133
+ c.forEach((r) => {
134
134
  const l = this.getAttribute(r), t = x(l);
135
135
  if (!t) return;
136
- const a = (c, m) => {
137
- Object.assign(c, d(r, m));
136
+ const a = (p, m) => {
137
+ Object.assign(p, d(r, m));
138
138
  };
139
139
  typeof t.initial == "string" && a(e, t.initial), typeof t.sm == "string" && a(s.sm, t.sm), typeof t.md == "string" && a(s.md, t.md), typeof t.lg == "string" && a(s.lg, t.lg), typeof t.xl == "string" && a(s.xl, t.xl);
140
140
  });
141
141
  const o = (r, l) => {
142
142
  const t = Object.entries(l);
143
- return t.length ? `${r} { ${t.map(([a, c]) => `${a}: ${c};`).join(" ")} }` : "";
143
+ return t.length ? `${r} { ${t.map(([a, p]) => `${a}: ${p};`).join(" ")} }` : "";
144
144
  }, n = [], u = o(":host", e);
145
145
  return u && n.push(u), Object.keys(s).forEach((r) => {
146
146
  const l = o(":host", s[r]);