@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,10 +1,11 @@
1
- import { E as N } from "./ElementBase-BeZT54Hj.mjs";
2
- import { a as C, r as I } from "./scroll-lock-LfqXXqsu.mjs";
3
- const U = `
1
+ import { E as Z } from "./ElementBase-BeZT54Hj.mjs";
2
+ import { c as G, l as J } from "./overlay-motion-BX3dPLay.mjs";
3
+ import { a as S, r as L } from "./scroll-lock-LfqXXqsu.mjs";
4
+ const Q = `
4
5
  :host {
5
6
  display: block;
6
7
  color-scheme: light dark;
7
- --ui-alert-radius: var(--base-alert-dialog-radius, var(--ui-radius, 4px));
8
+ --ui-alert-radius: var(--base-alert-dialog-radius, var(--ui-radius, 6px));
8
9
  --ui-alert-bg-base: var(--base-alert-dialog-bg, var(--color-panel-solid, var(--ui-color-surface, #ffffff)));
9
10
  --ui-alert-bg: var(--ui-alert-bg-base);
10
11
  --ui-alert-text: var(--ui-color-text, var(--ui-text, #202020));
@@ -20,12 +21,16 @@ const U = `
20
21
  --ui-alert-z: 1301;
21
22
  --ui-alert-backdrop-z: 1300;
22
23
  --ui-alert-focus: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
23
- --ui-alert-danger: var(--ui-color-danger, #dc2626);
24
+ --ui-alert-danger: var(--ui-color-danger-text, var(--ui-color-danger, #dc2626));
25
+ /* A solid dialog: the fill, and the text colour that reads on it. */
26
+ --ui-alert-solid-bg: var(--ui-alert-accent);
27
+ --ui-alert-on-accent: var(--ui-color-foreground-on-primary, #ffffff);
24
28
  --ui-alert-backdrop: var(--base-alert-dialog-backdrop, var(--color-overlay, rgba(2, 6, 23, 0.52)));
25
29
  --ui-alert-btn-bg: color-mix(in srgb, var(--ui-alert-bg-base) 90%, var(--ui-color-background, #ffffff) 10%);
26
30
  --ui-alert-btn-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
27
31
  --ui-alert-btn-hover: color-mix(in srgb, var(--ui-alert-btn-bg) 76%, var(--ui-color-border, #cbd5e1) 24%);
28
- --ui-alert-confirm-bg: var(--ui-alert-accent);
32
+ /* Default confirm is the primary fill. A tone sets its own fill and text below, so the text always reads. */
33
+ --ui-alert-confirm-bg: var(--ui-color-primary, #2563eb);
29
34
  --ui-alert-confirm-color: var(--ui-color-foreground-on-primary, #ffffff);
30
35
  --ui-alert-icon-bg: color-mix(in srgb, var(--ui-alert-accent) 14%, transparent);
31
36
  --ui-alert-icon-color: var(--ui-alert-accent);
@@ -37,8 +42,8 @@ const U = `
37
42
  --ui-alert-description-size: 13px;
38
43
  --ui-alert-description-line-height: 20px;
39
44
  --ui-alert-icon-size: 28px;
40
- --ui-alert-button-height: var(--base-button-height-md, 36px);
41
- --ui-alert-button-radius: var(--ui-radius, 4px);
45
+ --ui-alert-button-height: var(--base-button-height-md, var(--ui-control-height-2, 32px));
46
+ --ui-alert-button-radius: var(--ui-radius, 6px);
42
47
  }
43
48
 
44
49
  :host([tone='info']) {
@@ -47,14 +52,25 @@ const U = `
47
52
 
48
53
  :host([tone='success']) {
49
54
  --ui-alert-accent: var(--ui-color-success, #15803d);
55
+ --ui-alert-solid-bg: var(--ui-color-success-solid, var(--ui-alert-accent));
56
+ --ui-alert-on-accent: var(--ui-color-foreground-on-success, #ffffff);
57
+ --ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 76%, #000000);
58
+ --ui-alert-confirm-color: #ffffff;
50
59
  }
51
60
 
52
61
  :host([tone='warning']) {
53
62
  --ui-alert-accent: var(--ui-color-warning, #b45309);
63
+ --ui-alert-on-accent: var(--ui-color-foreground-on-warning, #ffffff);
64
+ --ui-alert-confirm-bg: var(--ui-alert-accent);
65
+ --ui-alert-confirm-color: var(--ui-color-foreground-on-warning, #ffffff);
54
66
  }
55
67
 
56
68
  :host([tone='danger']) {
57
69
  --ui-alert-accent: var(--ui-color-danger, #dc2626);
70
+ --ui-alert-solid-bg: var(--ui-color-danger-solid, var(--ui-alert-accent));
71
+ --ui-alert-on-accent: var(--ui-color-foreground-on-danger, #ffffff);
72
+ --ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 80%, #000000);
73
+ --ui-alert-confirm-color: #ffffff;
58
74
  }
59
75
 
60
76
  :host([size='sm']),
@@ -68,7 +84,7 @@ const U = `
68
84
  --ui-alert-description-size: 12px;
69
85
  --ui-alert-description-line-height: 18px;
70
86
  --ui-alert-icon-size: 24px;
71
- --ui-alert-button-height: var(--base-button-height-sm, 32px);
87
+ --ui-alert-button-height: var(--base-button-height-sm, var(--ui-control-height-1, 24px));
72
88
  }
73
89
 
74
90
  :host([size='md']),
@@ -88,7 +104,7 @@ const U = `
88
104
  --ui-alert-description-size: 14px;
89
105
  --ui-alert-description-line-height: 22px;
90
106
  --ui-alert-icon-size: 32px;
91
- --ui-alert-button-height: var(--base-button-height-lg, 44px);
107
+ --ui-alert-button-height: var(--base-button-height-lg, var(--ui-control-height-3, 40px));
92
108
  }
93
109
 
94
110
  :host([variant='outline']) {
@@ -103,17 +119,17 @@ const U = `
103
119
  }
104
120
 
105
121
  :host([variant='solid']) {
106
- --ui-alert-bg: var(--ui-alert-accent);
122
+ --ui-alert-bg: var(--ui-alert-solid-bg);
107
123
  --ui-alert-border: 1px solid color-mix(in srgb, #000000 16%, transparent);
108
- --ui-alert-text: #ffffff;
109
- --ui-alert-muted: color-mix(in srgb, #ffffff 98%, transparent);
124
+ --ui-alert-text: var(--ui-alert-on-accent);
125
+ --ui-alert-muted: color-mix(in srgb, var(--ui-alert-on-accent) 98%, transparent);
110
126
  --ui-alert-btn-bg: color-mix(in srgb, #000000 14%, transparent);
111
- --ui-alert-btn-border: color-mix(in srgb, #ffffff 30%, transparent);
127
+ --ui-alert-btn-border: color-mix(in srgb, var(--ui-alert-on-accent) 30%, transparent);
112
128
  --ui-alert-btn-hover: color-mix(in srgb, #000000 22%, transparent);
113
129
  --ui-alert-confirm-bg: color-mix(in srgb, #000000 30%, transparent);
114
- --ui-alert-confirm-color: #ffffff;
115
- --ui-alert-icon-bg: color-mix(in srgb, #ffffff 18%, transparent);
116
- --ui-alert-icon-color: #ffffff;
130
+ --ui-alert-confirm-color: var(--ui-alert-on-accent);
131
+ --ui-alert-icon-bg: color-mix(in srgb, var(--ui-alert-on-accent) 18%, transparent);
132
+ --ui-alert-icon-color: var(--ui-alert-on-accent);
117
133
  }
118
134
 
119
135
  :host([elevation='none']) {
@@ -136,8 +152,16 @@ const U = `
136
152
  place-items: center;
137
153
  background: var(--ui-alert-backdrop);
138
154
  backdrop-filter: saturate(1.04) blur(3px);
139
- opacity: 0;
140
- transition: opacity var(--ui-alert-duration) var(--ui-alert-easing);
155
+ /* The backdrop goes to the top layer (popover); undo the popover user-agent box. */
156
+ inline-size: 100%;
157
+ block-size: 100%;
158
+ max-inline-size: none;
159
+ max-block-size: none;
160
+ margin: 0;
161
+ padding: 0;
162
+ border: 0;
163
+ overflow: visible;
164
+ color: inherit;
141
165
  }
142
166
 
143
167
  .dialog {
@@ -154,13 +178,9 @@ const U = `
154
178
  padding: var(--ui-alert-padding);
155
179
  outline: none;
156
180
  overflow: clip;
157
- opacity: 0;
158
- transform: translateY(12px) scale(0.985);
159
181
  transition:
160
182
  border-color var(--ui-alert-duration) var(--ui-alert-easing),
161
- box-shadow var(--ui-alert-duration) var(--ui-alert-easing),
162
- transform var(--ui-alert-duration) var(--ui-alert-easing),
163
- opacity var(--ui-alert-duration) var(--ui-alert-easing);
183
+ box-shadow var(--ui-alert-duration) var(--ui-alert-easing);
164
184
  }
165
185
 
166
186
  .dialog::before {
@@ -181,13 +201,33 @@ const U = `
181
201
  display: none;
182
202
  }
183
203
 
184
- .backdrop[data-open='true'] {
185
- opacity: 1;
204
+ /* Open and close are animations on data-state; the surface is created and removed, which a transition cannot play. */
205
+ .backdrop[data-state='open']:not([data-instant]) {
206
+ animation: ui-alert-backdrop-in 150ms ease-out backwards;
186
207
  }
187
208
 
188
- .backdrop[data-open='true'] .dialog {
189
- opacity: 1;
190
- transform: translateY(0) scale(1);
209
+ .backdrop[data-state='open']:not([data-instant]) .dialog {
210
+ animation: ui-alert-dialog-in 150ms var(--ui-motion-enter-easing, cubic-bezier(0.16, 1, 0.3, 1)) backwards;
211
+ }
212
+
213
+ .backdrop[data-state='closed'] {
214
+ animation: ui-alert-backdrop-out 100ms ease-in both;
215
+ pointer-events: none;
216
+ }
217
+
218
+ .backdrop[data-state='closed'] .dialog {
219
+ animation: ui-alert-dialog-out 100ms var(--ui-motion-exit-easing, cubic-bezier(0.4, 0, 1, 1)) both;
220
+ }
221
+
222
+ @keyframes ui-alert-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
223
+ @keyframes ui-alert-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
224
+ @keyframes ui-alert-dialog-in {
225
+ from { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
226
+ to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
227
+ }
228
+ @keyframes ui-alert-dialog-out {
229
+ from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
230
+ to { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
191
231
  }
192
232
 
193
233
  .dialog:focus-visible {
@@ -307,12 +347,12 @@ const U = `
307
347
 
308
348
  .input {
309
349
  width: 100%;
310
- border-radius: var(--ui-radius, 4px);
350
+ border-radius: var(--ui-radius, 6px);
311
351
  border: var(--base-input-border, 1px solid color-mix(in srgb, var(--ui-alert-border-color) 88%, transparent));
312
352
  background: var(--base-input-bg, color-mix(in srgb, var(--ui-alert-bg-base) 94%, #ffffff 6%));
313
353
  color: inherit;
314
354
  box-sizing: border-box;
315
- min-height: var(--base-input-height-md, 36px);
355
+ min-height: var(--base-input-height-md, var(--ui-control-height-2, 32px));
316
356
  padding: 9px 12px;
317
357
  font: inherit;
318
358
  line-height: 1.35;
@@ -499,62 +539,62 @@ const U = `
499
539
  border: 1px solid CanvasText;
500
540
  }
501
541
  }
502
- `, Z = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
503
- function b(e, t) {
504
- if (e == null) return t;
505
- const i = e.trim().toLowerCase();
506
- return i !== "false" && i !== "0" && i !== "off";
542
+ `, X = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
543
+ function f(i, t) {
544
+ if (i == null) return t;
545
+ const e = i.trim().toLowerCase();
546
+ return e !== "false" && e !== "0" && e !== "off";
507
547
  }
508
- function a(e) {
509
- return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
548
+ function s(i) {
549
+ return String(i).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
510
550
  }
511
- function G(e) {
512
- return e === "info" || e === "success" || e === "warning" || e === "danger" ? e : "neutral";
551
+ function tt(i) {
552
+ return i === "info" || i === "success" || i === "warning" || i === "danger" ? i : "neutral";
513
553
  }
514
- function J(e) {
515
- return e === "sm" || e === "1" ? "sm" : e === "lg" || e === "3" ? "lg" : "md";
554
+ function et(i) {
555
+ return i === "sm" || i === "1" ? "sm" : i === "lg" || i === "3" ? "lg" : "md";
516
556
  }
517
- function Q(e) {
518
- return e === "soft" || e === "outline" || e === "solid" ? e : "surface";
557
+ function it(i) {
558
+ return i === "soft" || i === "outline" || i === "solid" ? i : "surface";
519
559
  }
520
- function X(e) {
521
- return e === "none" || e === "high" ? e : "low";
560
+ function rt(i) {
561
+ return i === "none" || i === "high" ? i : "low";
522
562
  }
523
- function tt(e) {
524
- return e === "none" ? "none" : "line";
563
+ function at(i) {
564
+ return i === "none" ? "none" : "line";
525
565
  }
526
- function it(e, t = "var(--base-alert-dialog-radius, var(--ui-radius, 4px))") {
527
- if (e == null) return t;
528
- const i = e.trim().toLowerCase();
529
- return i ? i === "full" || i === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(i) ? `${i}px` : e : t;
566
+ function st(i, t = "var(--base-alert-dialog-radius, var(--ui-radius, 6px))") {
567
+ if (i == null) return t;
568
+ const e = i.trim().toLowerCase();
569
+ return e ? e === "full" || e === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(e) ? `${e}px` : i : t;
530
570
  }
531
- const et = /* @__PURE__ */ new Set(["tone", "size", "variant", "elevation", "indicator", "radius"]);
532
- function rt(e) {
533
- return e === "success" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M5 10.2 8.3 13.4 15 6.8"></path></svg>' : e === "warning" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3.6 17 16.4H3L10 3.6Z"></path><path d="M10 8v3.4"></path><circle cx="10" cy="14.1" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : e === "danger" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="m7.5 7.5 5 5M12.5 7.5l-5 5"></path></svg>' : e === "info" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="M10 13v-3.8"></path><circle cx="10" cy="6.5" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6 10h8"></path><circle cx="10" cy="10" r="7.1"></circle></svg>';
571
+ const ot = /* @__PURE__ */ new Set(["tone", "size", "variant", "elevation", "indicator", "radius"]);
572
+ function nt(i) {
573
+ return i === "success" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M5 10.2 8.3 13.4 15 6.8"></path></svg>' : i === "warning" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M10 3.6 17 16.4H3L10 3.6Z"></path><path d="M10 8v3.4"></path><circle cx="10" cy="14.1" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : i === "danger" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="m7.5 7.5 5 5M12.5 7.5l-5 5"></path></svg>' : i === "info" ? '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.1"></circle><path d="M10 13v-3.8"></path><circle cx="10" cy="6.5" r="0.9" fill="currentColor" stroke="none"></circle></svg>' : '<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6 10h8"></path><circle cx="10" cy="10" r="7.1"></circle></svg>';
534
574
  }
535
575
  function u() {
536
576
  return typeof window < "u" && typeof document < "u";
537
577
  }
538
- function S() {
578
+ function T() {
539
579
  if (!u()) return null;
540
- const e = document.activeElement;
541
- return e instanceof HTMLElement ? e : null;
580
+ const i = document.activeElement;
581
+ return i instanceof HTMLElement ? i : null;
542
582
  }
543
- function _(e) {
544
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => e()) : window.setTimeout(e, 16);
583
+ function k(i) {
584
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => i()) : window.setTimeout(i, 16);
545
585
  }
546
- function p(e) {
547
- if (e) {
586
+ function p(i) {
587
+ if (i) {
548
588
  if (typeof cancelAnimationFrame == "function") {
549
- cancelAnimationFrame(e);
589
+ cancelAnimationFrame(i);
550
590
  return;
551
591
  }
552
- window.clearTimeout(e);
592
+ window.clearTimeout(i);
553
593
  }
554
594
  }
555
- const c = "data-ui-auto-name", l = class l extends N {
595
+ const c = "data-ui-auto-name", l = class l extends Z {
556
596
  constructor() {
557
- super(), this._lastActive = null, this._active = !1, this._terminalEmitted = !1, this._closeMeta = null, this._uid = Math.random().toString(36).slice(2, 10), this._dialogId = "", this._config = {}, this._inputValue = "", this._checked = !1, this._runtimeError = "", this._activeHeadless = !1, this._focusInitialFrame = 0, this._restoreFocusFrame = 0, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onFocusIn = this._onFocusIn.bind(this), this._onInput = this._onInput.bind(this), this._dialogId = this._uid;
597
+ super(), this._lastActive = null, this._active = !1, this._terminalEmitted = !1, this._closeMeta = null, this._uid = Math.random().toString(36).slice(2, 10), this._dialogId = "", this._config = {}, this._inputValue = "", this._checked = !1, this._runtimeError = "", this._activeHeadless = !1, this._focusInitialFrame = 0, this._restoreFocusFrame = 0, this._presented = !1, this._finishClose = null, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onFocusIn = this._onFocusIn.bind(this), this._onInput = this._onInput.bind(this), this._dialogId = this._uid;
558
598
  }
559
599
  static get observedAttributes() {
560
600
  return [
@@ -590,9 +630,9 @@ const c = "data-ui-auto-name", l = class l extends N {
590
630
  disconnectedCallback() {
591
631
  this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.root.removeEventListener("input", this._onInput), this._focusInitialFrame && (p(this._focusInitialFrame), this._focusInitialFrame = 0), this._restoreFocusFrame && (p(this._restoreFocusFrame), this._restoreFocusFrame = 0), this._active && !this._terminalEmitted && this.close("dismiss", "unmount"), this._deactivate(), super.disconnectedCallback();
592
632
  }
593
- attributeChangedCallback(t, i, r) {
594
- if (i !== r) {
595
- if (et.has(t)) {
633
+ attributeChangedCallback(t, e, r) {
634
+ if (e !== r) {
635
+ if (ot.has(t)) {
596
636
  this._syncVisualTokens();
597
637
  return;
598
638
  }
@@ -620,25 +660,25 @@ const c = "data-ui-auto-name", l = class l extends N {
620
660
  t ? this.setAttribute("headless", "") : this.removeAttribute("headless");
621
661
  }
622
662
  get dismissible() {
623
- return b(this.getAttribute("dismissible"), !0);
663
+ return f(this.getAttribute("dismissible"), !0);
624
664
  }
625
665
  set dismissible(t) {
626
666
  this.setAttribute("dismissible", String(t));
627
667
  }
628
668
  get closeOnEsc() {
629
- return b(this.getAttribute("close-on-esc"), this.dismissible);
669
+ return f(this.getAttribute("close-on-esc"), this.dismissible);
630
670
  }
631
671
  set closeOnEsc(t) {
632
672
  this.setAttribute("close-on-esc", String(t));
633
673
  }
634
674
  get closeOnBackdrop() {
635
- return b(this.getAttribute("close-on-backdrop"), this.dismissible);
675
+ return f(this.getAttribute("close-on-backdrop"), this.dismissible);
636
676
  }
637
677
  set closeOnBackdrop(t) {
638
678
  this.setAttribute("close-on-backdrop", String(t));
639
679
  }
640
680
  get lockWhileLoading() {
641
- return b(this.getAttribute("lock-while-loading"), !0);
681
+ return f(this.getAttribute("lock-while-loading"), !0);
642
682
  }
643
683
  set lockWhileLoading(t) {
644
684
  this.setAttribute("lock-while-loading", String(t));
@@ -650,7 +690,7 @@ const c = "data-ui-auto-name", l = class l extends N {
650
690
  this.setAttribute("role", t);
651
691
  }
652
692
  get tone() {
653
- return G(this.getAttribute("tone"));
693
+ return tt(this.getAttribute("tone"));
654
694
  }
655
695
  set tone(t) {
656
696
  if (t === "neutral") {
@@ -660,7 +700,7 @@ const c = "data-ui-auto-name", l = class l extends N {
660
700
  this.setAttribute("tone", t);
661
701
  }
662
702
  get size() {
663
- return J(this.getAttribute("size"));
703
+ return et(this.getAttribute("size"));
664
704
  }
665
705
  set size(t) {
666
706
  if (t === "md") {
@@ -670,7 +710,7 @@ const c = "data-ui-auto-name", l = class l extends N {
670
710
  this.setAttribute("size", t);
671
711
  }
672
712
  get variant() {
673
- return Q(this.getAttribute("variant"));
713
+ return it(this.getAttribute("variant"));
674
714
  }
675
715
  set variant(t) {
676
716
  if (t === "surface") {
@@ -680,7 +720,7 @@ const c = "data-ui-auto-name", l = class l extends N {
680
720
  this.setAttribute("variant", t);
681
721
  }
682
722
  get elevation() {
683
- return X(this.getAttribute("elevation"));
723
+ return rt(this.getAttribute("elevation"));
684
724
  }
685
725
  set elevation(t) {
686
726
  if (t === "low") {
@@ -690,7 +730,7 @@ const c = "data-ui-auto-name", l = class l extends N {
690
730
  this.setAttribute("elevation", t);
691
731
  }
692
732
  get indicator() {
693
- return tt(this.getAttribute("indicator"));
733
+ return at(this.getAttribute("indicator"));
694
734
  }
695
735
  set indicator(t) {
696
736
  if (t === "line") {
@@ -747,16 +787,16 @@ const c = "data-ui-auto-name", l = class l extends N {
747
787
  }
748
788
  setInputValue(t) {
749
789
  this._inputValue = t;
750
- const i = this.root.querySelector(".input");
751
- i && (i.value = t);
790
+ const e = this.root.querySelector(".input");
791
+ e && (e.value = t);
752
792
  }
753
793
  getChecked() {
754
794
  return this.root.querySelector(".checkbox-input")?.checked ?? this._checked;
755
795
  }
756
796
  setChecked(t) {
757
797
  this._checked = t;
758
- const i = this.root.querySelector(".checkbox-input");
759
- i && (i.checked = t);
798
+ const e = this.root.querySelector(".checkbox-input");
799
+ e && (e.checked = t);
760
800
  }
761
801
  setError(t) {
762
802
  this._runtimeError = t, this.state = t ? "error" : "idle", this.requestRender();
@@ -764,14 +804,14 @@ const c = "data-ui-auto-name", l = class l extends N {
764
804
  clearError() {
765
805
  this._runtimeError = "", this.state === "error" && (this.state = "idle"), this.requestRender();
766
806
  }
767
- close(t = "dismiss", i, r) {
768
- this._terminalEmitted || (this._closeMeta = { action: t, source: i, reason: r }, this.hasAttribute("open") && this.removeAttribute("open"), this._syncOpenState());
807
+ close(t = "dismiss", e, r) {
808
+ this._terminalEmitted || (this._closeMeta = { action: t, source: e, reason: r }, this.hasAttribute("open") && this.removeAttribute("open"), this._syncOpenState());
769
809
  }
770
810
  _syncFromAttributes() {
771
811
  this.hasAttribute("role") || this.setAttribute("role", "alertdialog");
772
812
  }
773
813
  _syncVisualTokens() {
774
- this.style.setProperty("--ui-alert-radius", it(this.getAttribute("radius")));
814
+ this.style.setProperty("--ui-alert-radius", st(this.getAttribute("radius")));
775
815
  }
776
816
  _syncOpenState() {
777
817
  const t = this.hasAttribute("open");
@@ -782,9 +822,9 @@ const c = "data-ui-auto-name", l = class l extends N {
782
822
  !t && this._active && this._deactivate();
783
823
  }
784
824
  _activate() {
785
- this._active = !0, this._activeHeadless = this.headless, this._terminalEmitted = !1, this._closeMeta = null, l._openStack.includes(this) || l._openStack.push(this), this._lastActive = this.headless ? null : S(), this.headless || C(), u() && !this.headless && document.addEventListener("focusin", this._onFocusIn, !0);
825
+ this._active = !0, this._activeHeadless = this.headless, this._terminalEmitted = !1, this._closeMeta = null, l._openStack.includes(this) || l._openStack.push(this), this._lastActive = this.headless ? null : T(), this.headless || S(), u() && !this.headless && document.addEventListener("focusin", this._onFocusIn, !0);
786
826
  const t = this.dialogId || this._uid;
787
- this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = _(() => {
827
+ this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
788
828
  this._focusInitialFrame = 0, this._focusInitial();
789
829
  })), this.requestRender();
790
830
  }
@@ -792,24 +832,24 @@ const c = "data-ui-auto-name", l = class l extends N {
792
832
  if (!this._active) return;
793
833
  this._active = !1;
794
834
  const t = l._openStack.lastIndexOf(this);
795
- if (t >= 0 && l._openStack.splice(t, 1), u() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless || I(), !this._terminalEmitted) {
796
- const r = this._closeMeta || { action: "dismiss", source: "abort" }, s = this.dialogId || this._uid;
797
- r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: s }) : r.action === "dismiss" && this._dispatchWithLegacy("ui-dismiss", "dismiss", {
798
- id: s,
835
+ if (t >= 0 && l._openStack.splice(t, 1), u() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless || L(), !this._terminalEmitted) {
836
+ const r = this._closeMeta || { action: "dismiss", source: "abort" }, a = this.dialogId || this._uid;
837
+ r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: a }) : r.action === "dismiss" && this._dispatchWithLegacy("ui-dismiss", "dismiss", {
838
+ id: a,
799
839
  source: r.source || "abort",
800
840
  reason: r.reason
801
841
  }), this._dispatchWithLegacy("ui-close", "close", {
802
- id: s,
842
+ id: a,
803
843
  action: r.action,
804
844
  source: r.source,
805
845
  reason: r.reason
806
846
  }), this._terminalEmitted = !0, this._closeMeta = null;
807
847
  }
808
- const i = this._lastActive;
809
- this._lastActive = null, i && !this._activeHeadless && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame = _(() => {
848
+ const e = this._lastActive;
849
+ this._lastActive = null, e && !this._activeHeadless && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame = k(() => {
810
850
  this._restoreFocusFrame = 0;
811
851
  try {
812
- i.focus();
852
+ e.focus();
813
853
  } catch {
814
854
  }
815
855
  })), this._activeHeadless = !1, this.requestRender();
@@ -817,27 +857,27 @@ const c = "data-ui-auto-name", l = class l extends N {
817
857
  _syncActiveEnvironment() {
818
858
  if (this._active && this.headless !== this._activeHeadless) {
819
859
  if (this.headless) {
820
- u() && document.removeEventListener("focusin", this._onFocusIn, !0), I(), this._lastActive = null, this._activeHeadless = !0;
860
+ u() && document.removeEventListener("focusin", this._onFocusIn, !0), L(), this._lastActive = null, this._activeHeadless = !0;
821
861
  return;
822
862
  }
823
- this._lastActive = S(), C(), u() && document.addEventListener("focusin", this._onFocusIn, !0), this._activeHeadless = !1, this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = _(() => {
863
+ this._lastActive = T(), S(), u() && document.addEventListener("focusin", this._onFocusIn, !0), this._activeHeadless = !1, this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
824
864
  this._focusInitialFrame = 0, this._focusInitial();
825
865
  });
826
866
  }
827
867
  }
828
- _dispatchWithLegacy(t, i, r, s = !1) {
868
+ _dispatchWithLegacy(t, e, r, a = !1) {
829
869
  const o = new CustomEvent(t, {
830
870
  detail: r,
831
871
  bubbles: !0,
832
872
  composed: !0,
833
- cancelable: s
873
+ cancelable: a
834
874
  });
835
875
  this.dispatchEvent(o);
836
- const n = new CustomEvent(i, {
876
+ const n = new CustomEvent(e, {
837
877
  detail: r,
838
878
  bubbles: !0,
839
879
  composed: !0,
840
- cancelable: s
880
+ cancelable: a
841
881
  });
842
882
  return this.dispatchEvent(n), o;
843
883
  }
@@ -850,19 +890,19 @@ const c = "data-ui-auto-name", l = class l extends N {
850
890
  return this.root.querySelector(".dialog");
851
891
  }
852
892
  _collectFocusable(t) {
853
- return Array.from(t.querySelectorAll(Z)).filter((i) => {
854
- if (i.disabled || i.getAttribute("aria-hidden") === "true") return !1;
855
- const s = u() ? window.getComputedStyle(i) : null;
856
- return !(s && (s.display === "none" || s.visibility === "hidden"));
893
+ return Array.from(t.querySelectorAll(X)).filter((e) => {
894
+ if (e.disabled || e.getAttribute("aria-hidden") === "true") return !1;
895
+ const a = u() ? window.getComputedStyle(e) : null;
896
+ return !(a && (a.display === "none" || a.visibility === "hidden"));
857
897
  });
858
898
  }
859
899
  _focusInitial() {
860
900
  if (!this.open) return;
861
901
  const t = this._queryPanel();
862
902
  if (!t) return;
863
- const i = this.initialFocus;
864
- if (i) {
865
- const n = t.querySelector(i);
903
+ const e = this.initialFocus;
904
+ if (e) {
905
+ const n = t.querySelector(e);
866
906
  if (n && typeof n.focus == "function") {
867
907
  n.focus();
868
908
  return;
@@ -877,30 +917,30 @@ const c = "data-ui-auto-name", l = class l extends N {
877
917
  }
878
918
  _handleTab(t) {
879
919
  if (t.key !== "Tab") return;
880
- const i = this._queryPanel();
881
- if (!i) return;
882
- const r = this._collectFocusable(i);
920
+ const e = this._queryPanel();
921
+ if (!e) return;
922
+ const r = this._collectFocusable(e);
883
923
  if (!r.length) {
884
- t.preventDefault(), i.focus();
924
+ t.preventDefault(), e.focus();
885
925
  return;
886
926
  }
887
- const s = this.root.activeElement || document.activeElement, o = r[0], n = r[r.length - 1];
927
+ const a = this.root.activeElement || document.activeElement, o = r[0], n = r[r.length - 1];
888
928
  if (t.shiftKey) {
889
- (s === o || !s || !i.contains(s)) && (t.preventDefault(), n.focus());
929
+ (a === o || !a || !e.contains(a)) && (t.preventDefault(), n.focus());
890
930
  return;
891
931
  }
892
- s === n && (t.preventDefault(), o.focus());
932
+ a === n && (t.preventDefault(), o.focus());
893
933
  }
894
934
  _onFocusIn(t) {
895
935
  if (!this.open || !this._isTopMost()) return;
896
- const i = this._queryPanel();
897
- if (!i) return;
936
+ const e = this._queryPanel();
937
+ if (!e) return;
898
938
  const r = t.target;
899
- (typeof t.composedPath == "function" ? t.composedPath() : []).includes(i) || r && i.contains(r) || this._focusInitial();
939
+ (typeof t.composedPath == "function" ? t.composedPath() : []).includes(e) || r && e.contains(r) || this._focusInitial();
900
940
  }
901
941
  _onInput(t) {
902
- const i = t.target;
903
- i && (i.classList.contains("input") && (this._inputValue = i.value), i.classList.contains("checkbox-input") && (this._checked = i.checked), this._dispatchWithLegacy("ui-change", "change", {
942
+ const e = t.target;
943
+ e && (e.classList.contains("input") && (this._inputValue = e.value), e.classList.contains("checkbox-input") && (this._checked = e.checked), this._dispatchWithLegacy("ui-change", "change", {
904
944
  id: this.dialogId || this._uid,
905
945
  inputValue: this._inputValue,
906
946
  checked: this._checked
@@ -909,8 +949,8 @@ const c = "data-ui-auto-name", l = class l extends N {
909
949
  _isInteractionLocked() {
910
950
  return this.state === "loading" && this.lockWhileLoading;
911
951
  }
912
- _requestDismiss(t, i) {
913
- this._isInteractionLocked() || this.close("dismiss", t, i);
952
+ _requestDismiss(t, e) {
953
+ this._isInteractionLocked() || this.close("dismiss", t, e);
914
954
  }
915
955
  _handleConfirm() {
916
956
  const t = {
@@ -925,21 +965,21 @@ const c = "data-ui-auto-name", l = class l extends N {
925
965
  }
926
966
  _onClick(t) {
927
967
  if (!this.open || !this._isTopMost()) return;
928
- const i = t.target;
929
- if (i) {
930
- if (i.classList.contains("backdrop") && this.closeOnBackdrop) {
968
+ const e = t.target;
969
+ if (e) {
970
+ if (e.classList.contains("backdrop") && this.closeOnBackdrop) {
931
971
  this._requestDismiss("backdrop");
932
972
  return;
933
973
  }
934
- if (i.closest(".close")) {
974
+ if (e.closest(".close")) {
935
975
  this._requestDismiss("close-icon");
936
976
  return;
937
977
  }
938
- if (i.closest(".btn-confirm")) {
978
+ if (e.closest(".btn-confirm")) {
939
979
  this._handleConfirm();
940
980
  return;
941
981
  }
942
- i.closest(".btn-cancel") && this._handleCancel();
982
+ e.closest(".btn-cancel") && this._handleCancel();
943
983
  }
944
984
  }
945
985
  _onKeyDown(t) {
@@ -955,7 +995,7 @@ const c = "data-ui-auto-name", l = class l extends N {
955
995
  // The host carries role="alertdialog" (that attribute is also how the role is configured), so it
956
996
  // is exposed as a dialog of its own. Closed, it was an empty, unnamed alert dialog sitting in the
957
997
  // page; open, it needs the same name as the dialog inside its shadow root.
958
- _syncHostSemantics(t, i = "", r = !1) {
998
+ _syncHostSemantics(t, e = "", r = !1) {
959
999
  if (!t) {
960
1000
  this.getAttribute("aria-hidden") !== "true" && this.setAttribute("aria-hidden", "true"), this.hasAttribute(c) && (this.removeAttribute("aria-label"), this.removeAttribute(c));
961
1001
  return;
@@ -964,95 +1004,107 @@ const c = "data-ui-auto-name", l = class l extends N {
964
1004
  this.hasAttribute(c) && this.removeAttribute(c);
965
1005
  return;
966
1006
  }
967
- this.getAttribute("aria-label") !== i && this.setAttribute("aria-label", i), this.hasAttribute(c) || this.setAttribute(c, "");
1007
+ this.getAttribute("aria-label") !== e && this.setAttribute("aria-label", e), this.hasAttribute(c) || this.setAttribute(c, "");
968
1008
  }
969
1009
  render() {
970
1010
  if (!this.open) {
971
- this._syncHostSemantics(!1), this.setContent("");
1011
+ this._syncHostSemantics(!1);
1012
+ const _ = this.root.querySelector(".backdrop");
1013
+ if (this._presented && _) {
1014
+ this._presented = !1, _.removeAttribute("data-instant"), this._finishClose = G(_, () => {
1015
+ this._finishClose = null, this.setContent("");
1016
+ });
1017
+ return;
1018
+ }
1019
+ if (this._finishClose) return;
1020
+ this.setContent("");
972
1021
  return;
973
1022
  }
974
- const t = this._config.title ?? this.getAttribute("title") ?? "", i = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm", s = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", n = !!this._config.input?.enabled, L = this._config.input?.label || "Value", $ = this._config.input?.placeholder || "", T = !!this._config.input?.required, B = !!this._config.checkbox?.enabled, q = this._config.checkbox?.label || "Remember this choice", M = this.state, f = this._runtimeError || this._config.errorMessage || this.getAttribute("error-message") || "", y = `ui-alert-title-${this._uid}`, w = `ui-alert-description-${this._uid}`, A = `ui-alert-error-${this._uid}`, O = !!this.querySelector('[slot="title"]'), D = !!this.querySelector('[slot="description"]'), H = !!this.querySelector('[slot="icon"]'), V = !!this.querySelector('[slot="footer"]'), R = !!this.querySelector('[slot="content"]'), g = O || !!t, m = D || !!i, W = H || g || m, P = this._config.showCancel ?? this.dismissible, j = this._config.showClose ?? this.dismissible, K = this.tone, v = this.hasAttribute(c) ? "" : this.getAttribute("aria-label") || "", F = this.getAttribute("aria-labelledby") || "", z = this.getAttribute("aria-describedby") || "", x = F || (g ? y : ""), E = v || (x ? "" : t || i || "Dialog"), Y = (this.querySelector('[slot="title"]')?.textContent || "").replace(/\s+/g, " ").trim();
1023
+ this._finishClose?.(), this._finishClose = null;
1024
+ const t = this._config.title ?? this.getAttribute("title") ?? "", e = this._config.description ?? this.getAttribute("description") ?? "", r = this._config.confirmText ?? this.getAttribute("confirm-text") ?? "Confirm", a = this._config.cancelText ?? this.getAttribute("cancel-text") ?? "Cancel", o = this._config.loadingText ?? this.getAttribute("loading-text") ?? "Working...", n = !!this._config.input?.enabled, $ = this._config.input?.label || "Value", B = this._config.input?.placeholder || "", q = !!this._config.input?.required, O = !!this._config.checkbox?.enabled, D = this._config.checkbox?.label || "Remember this choice", M = this.state, b = this._runtimeError || this._config.errorMessage || this.getAttribute("error-message") || "", w = `ui-alert-title-${this._uid}`, A = `ui-alert-description-${this._uid}`, z = `ui-alert-error-${this._uid}`, H = !!this.querySelector('[slot="title"]'), V = !!this.querySelector('[slot="description"]'), R = !!this.querySelector('[slot="icon"]'), W = !!this.querySelector('[slot="footer"]'), P = !!this.querySelector('[slot="content"]'), g = H || !!t, m = V || !!e, j = R || g || m, K = this._config.showCancel ?? this.dismissible, Y = this._config.showClose ?? this.dismissible, N = this.tone, v = this.hasAttribute(c) ? "" : this.getAttribute("aria-label") || "", F = this.getAttribute("aria-labelledby") || "", C = this.getAttribute("aria-describedby") || "", x = F || (g ? w : ""), E = v || (x ? "" : t || e || "Dialog"), U = (this.querySelector('[slot="title"]')?.textContent || "").replace(/\s+/g, " ").trim();
975
1025
  this._syncHostSemantics(
976
1026
  !0,
977
- v || Y || t || i || "Dialog",
1027
+ v || U || t || e || "Dialog",
978
1028
  !!v || !!F
979
1029
  );
980
1030
  const d = [];
981
- z ? d.push(z) : (m && d.push(w), f && d.push(A));
1031
+ C ? d.push(C) : (m && d.push(A), b && d.push(z));
982
1032
  const h = M === "loading";
983
1033
  this.setContent(`
984
- <style>${U}</style>
985
- <div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}">
1034
+ <style>${Q}</style>
1035
+ <div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}" data-state="open" ${this._presented ? "data-instant" : ""}>
986
1036
  <section
987
1037
  class="dialog"
988
1038
  part="dialog"
989
- role="${a(this.roleType)}"
1039
+ role="${s(this.roleType)}"
990
1040
  aria-modal="true"
991
- ${E ? `aria-label="${a(E)}"` : ""}
992
- ${x ? `aria-labelledby="${a(x)}"` : ""}
993
- ${d.length ? `aria-describedby="${a(d.join(" "))}"` : ""}
1041
+ ${E ? `aria-label="${s(E)}"` : ""}
1042
+ ${x ? `aria-labelledby="${s(x)}"` : ""}
1043
+ ${d.length ? `aria-describedby="${s(d.join(" "))}"` : ""}
994
1044
  tabindex="-1"
995
1045
  >
996
- ${j ? `<button class="close" part="close" aria-label="Close dialog">
1046
+ ${Y ? `<button class="close" part="close" aria-label="Close dialog">
997
1047
  <svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
998
1048
  <path d="m6 6 8 8M14 6l-8 8"></path>
999
1049
  </svg>
1000
1050
  </button>` : ""}
1001
1051
 
1002
- ${W ? `<header class="header">
1052
+ ${j ? `<header class="header">
1003
1053
  <div class="header-main">
1004
1054
  <span class="icon-wrap" part="icon-wrap" aria-hidden="true">
1005
1055
  <span class="icon" part="icon">
1006
- <slot name="icon">${rt(K)}</slot>
1056
+ <slot name="icon">${nt(N)}</slot>
1007
1057
  </span>
1008
1058
  </span>
1009
1059
  <div class="heading">
1010
- ${g ? `<h2 id="${y}" class="title" part="title"><slot name="title">${a(t)}</slot></h2>` : ""}
1011
- ${m ? `<p id="${w}" class="description" part="description"><slot name="description">${a(i)}</slot></p>` : ""}
1060
+ ${g ? `<h2 id="${w}" class="title" part="title"><slot name="title">${s(t)}</slot></h2>` : ""}
1061
+ ${m ? `<p id="${A}" class="description" part="description"><slot name="description">${s(e)}</slot></p>` : ""}
1012
1062
  </div>
1013
1063
  </div>
1014
1064
  </header>` : ""}
1015
1065
 
1016
1066
  <div class="content" part="content">
1017
- ${R ? '<slot name="content"></slot>' : "<slot></slot>"}
1067
+ ${P ? '<slot name="content"></slot>' : "<slot></slot>"}
1018
1068
 
1019
1069
  ${n ? `<label class="input-wrap">
1020
- <span class="label">${a(L)}</span>
1070
+ <span class="label">${s($)}</span>
1021
1071
  <input
1022
1072
  class="input"
1023
1073
  part="input"
1024
1074
  type="text"
1025
- value="${a(this.getInputValue())}"
1026
- placeholder="${a($)}"
1027
- ${T ? "required" : ""}
1075
+ value="${s(this.getInputValue())}"
1076
+ placeholder="${s(B)}"
1077
+ ${q ? "required" : ""}
1028
1078
  ${h ? "disabled" : ""}
1029
1079
  />
1030
1080
  </label>` : ""}
1031
1081
 
1032
- ${B ? `<label class="checkbox" part="checkbox">
1082
+ ${O ? `<label class="checkbox" part="checkbox">
1033
1083
  <span class="checkbox-line">
1034
1084
  <input class="checkbox-input" type="checkbox" ${this.getChecked() ? "checked" : ""} ${h ? "disabled" : ""} />
1035
- <span>${a(q)}</span>
1085
+ <span>${s(D)}</span>
1036
1086
  </span>
1037
1087
  </label>` : ""}
1038
1088
  </div>
1039
1089
 
1040
- <div class="error" id="${A}" part="error" aria-live="polite" data-empty="${String(!f)}">${a(f)}</div>
1090
+ <div class="error" id="${z}" part="error" aria-live="polite" data-empty="${String(!b)}">${s(b)}</div>
1041
1091
 
1042
1092
  <footer class="footer" part="footer">
1043
- ${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${a(o)}</span></span>` : '<span aria-hidden="true"></span>'}
1093
+ ${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${s(o)}</span></span>` : '<span aria-hidden="true"></span>'}
1044
1094
 
1045
- ${V ? '<slot name="footer"></slot>' : `${P ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${a(s)}</button>` : ""}
1046
- <button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${a(r)}</button>`}
1095
+ ${W ? '<slot name="footer"></slot>' : `${K ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${s(a)}</button>` : ""}
1096
+ <button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${s(r)}</button>`}
1047
1097
  </footer>
1048
1098
  </section>
1049
1099
  </div>
1050
1100
  `);
1101
+ const I = this.root.querySelector(".backdrop");
1102
+ I && !this.headless && J(I, { resetBox: !1 }), this._presented = !0;
1051
1103
  }
1052
1104
  };
1053
1105
  l._openStack = [];
1054
- let k = l;
1055
- typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog", k);
1106
+ let y = l;
1107
+ typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog", y);
1056
1108
  export {
1057
- k as UIAlertDialog
1109
+ y as UIAlertDialog
1058
1110
  };