@editora/ui-core 0.1.25 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/README.md +124 -0
  2. package/dist/accordion.cjs.js +13 -12
  3. package/dist/accordion.esm.js +13 -12
  4. package/dist/alert-dialog.cjs.js +76 -45
  5. package/dist/alert-dialog.esm.js +179 -135
  6. package/dist/alert.cjs.js +41 -32
  7. package/dist/alert.esm.js +79 -70
  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 +4 -4
  13. package/dist/animated-text.esm.js +4 -4
  14. package/dist/app-header.cjs.js +5 -5
  15. package/dist/app-header.esm.js +6 -6
  16. package/dist/aspect-ratio.cjs.js +10 -12
  17. package/dist/aspect-ratio.esm.js +11 -13
  18. package/dist/avatar.cjs.js +13 -17
  19. package/dist/avatar.esm.js +13 -17
  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-B3PUKHQm.mjs → calendar-DmxiZrR7.mjs} +126 -117
  31. package/dist/{calendar-D-mXMgqc.js → calendar-o273O28D.js} +53 -44
  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 +52 -52
  37. package/dist/chart.esm.js +95 -95
  38. package/dist/checkbox.cjs.js +19 -15
  39. package/dist/checkbox.esm.js +19 -15
  40. package/dist/collapsible.cjs.js +7 -11
  41. package/dist/collapsible.esm.js +7 -11
  42. package/dist/color-picker.cjs.js +36 -17
  43. package/dist/color-picker.esm.js +132 -113
  44. package/dist/combobox.cjs.js +57 -54
  45. package/dist/combobox.esm.js +62 -58
  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-aspect-ratio.d.ts.map +1 -1
  58. package/dist/components/ui-avatar.d.ts.map +1 -1
  59. package/dist/components/ui-badge.d.ts.map +1 -1
  60. package/dist/components/ui-block-controls.d.ts.map +1 -1
  61. package/dist/components/ui-box.d.ts.map +1 -1
  62. package/dist/components/ui-breadcrumb.d.ts.map +1 -1
  63. package/dist/components/ui-button.d.ts.map +1 -1
  64. package/dist/components/ui-calendar.d.ts.map +1 -1
  65. package/dist/components/ui-card.d.ts.map +1 -1
  66. package/dist/components/ui-checkbox.d.ts.map +1 -1
  67. package/dist/components/ui-collapsible.d.ts.map +1 -1
  68. package/dist/components/ui-color-picker.d.ts.map +1 -1
  69. package/dist/components/ui-combobox.d.ts.map +1 -1
  70. package/dist/components/ui-command-palette.d.ts.map +1 -1
  71. package/dist/components/ui-command.d.ts.map +1 -1
  72. package/dist/components/ui-container.d.ts.map +1 -1
  73. package/dist/components/ui-context-menu.d.ts.map +1 -1
  74. package/dist/components/ui-data-table.d.ts +7 -0
  75. package/dist/components/ui-data-table.d.ts.map +1 -1
  76. package/dist/components/ui-date-picker.d.ts.map +1 -1
  77. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  78. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  79. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  80. package/dist/components/ui-dialog.d.ts +2 -0
  81. package/dist/components/ui-dialog.d.ts.map +1 -1
  82. package/dist/components/ui-dock.d.ts.map +1 -1
  83. package/dist/components/ui-drawer.d.ts.map +1 -1
  84. package/dist/components/ui-dropdown.d.ts.map +1 -1
  85. package/dist/components/ui-empty-state.d.ts.map +1 -1
  86. package/dist/components/ui-field.d.ts.map +1 -1
  87. package/dist/components/ui-fieldset.d.ts.map +1 -1
  88. package/dist/components/ui-file-upload.d.ts.map +1 -1
  89. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  90. package/dist/components/ui-form.d.ts.map +1 -1
  91. package/dist/components/ui-icon-cloud.d.ts.map +1 -1
  92. package/dist/components/ui-inline-edit.d.ts.map +1 -1
  93. package/dist/components/ui-input.d.ts.map +1 -1
  94. package/dist/components/ui-marquee.d.ts.map +1 -1
  95. package/dist/components/ui-menu.d.ts.map +1 -1
  96. package/dist/components/ui-menubar.d.ts.map +1 -1
  97. package/dist/components/ui-meter.d.ts.map +1 -1
  98. package/dist/components/ui-multi-select.d.ts.map +1 -1
  99. package/dist/components/ui-number-field.d.ts.map +1 -1
  100. package/dist/components/ui-orbiter.d.ts.map +1 -1
  101. package/dist/components/ui-pagination.d.ts.map +1 -1
  102. package/dist/components/ui-password-field.d.ts.map +1 -1
  103. package/dist/components/ui-pin-input.d.ts.map +1 -1
  104. package/dist/components/ui-popover.d.ts.map +1 -1
  105. package/dist/components/ui-progress.d.ts.map +1 -1
  106. package/dist/components/ui-radio-group.d.ts.map +1 -1
  107. package/dist/components/ui-radio.d.ts.map +1 -1
  108. package/dist/components/ui-rating.d.ts +1 -0
  109. package/dist/components/ui-rating.d.ts.map +1 -1
  110. package/dist/components/ui-scroll-area.d.ts.map +1 -1
  111. package/dist/components/ui-section.d.ts.map +1 -1
  112. package/dist/components/ui-select.d.ts.map +1 -1
  113. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  114. package/dist/components/ui-slider.d.ts.map +1 -1
  115. package/dist/components/ui-sortable.d.ts.map +1 -1
  116. package/dist/components/ui-spinning-text.d.ts.map +1 -1
  117. package/dist/components/ui-split-button.d.ts.map +1 -1
  118. package/dist/components/ui-splitter.d.ts.map +1 -1
  119. package/dist/components/ui-stepper.d.ts.map +1 -1
  120. package/dist/components/ui-switch.d.ts.map +1 -1
  121. package/dist/components/ui-tabs.d.ts.map +1 -1
  122. package/dist/components/ui-tags-input.d.ts.map +1 -1
  123. package/dist/components/ui-textarea.d.ts.map +1 -1
  124. package/dist/components/ui-time-picker.d.ts.map +1 -1
  125. package/dist/components/ui-toggle-group.d.ts +2 -0
  126. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  127. package/dist/components/ui-toggle.d.ts.map +1 -1
  128. package/dist/components/ui-toolbar.d.ts +2 -0
  129. package/dist/components/ui-toolbar.d.ts.map +1 -1
  130. package/dist/components/ui-tooltip.d.ts.map +1 -1
  131. package/dist/components/ui-transfer-list.d.ts.map +1 -1
  132. package/dist/components/ui-tree-item.d.ts.map +1 -1
  133. package/dist/components/ui-tree.d.ts.map +1 -1
  134. package/dist/components/ui-wizard.d.ts.map +1 -1
  135. package/dist/container.cjs.js +6 -12
  136. package/dist/container.esm.js +8 -14
  137. package/dist/context-menu.cjs.js +8 -8
  138. package/dist/context-menu.esm.js +42 -41
  139. package/dist/data-table.cjs.js +18 -15
  140. package/dist/data-table.esm.js +207 -187
  141. package/dist/date-field.cjs.js +8 -8
  142. package/dist/date-field.esm.js +7 -7
  143. package/dist/date-picker.cjs.js +27 -18
  144. package/dist/date-picker.esm.js +57 -48
  145. package/dist/date-range-picker.cjs.js +22 -17
  146. package/dist/date-range-picker.esm.js +31 -26
  147. package/dist/date-range-time-picker.cjs.js +26 -19
  148. package/dist/date-range-time-picker.esm.js +23 -16
  149. package/dist/date-time-picker.cjs.js +23 -16
  150. package/dist/date-time-picker.esm.js +88 -81
  151. package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-B4hAkt36.mjs} +75 -68
  152. package/dist/date-time-utils-DdigV4hs.js +1 -0
  153. package/dist/dialog.cjs.js +57 -41
  154. package/dist/dialog.esm.js +84 -51
  155. package/dist/dock.cjs.js +16 -30
  156. package/dist/dock.esm.js +26 -40
  157. package/dist/drawer.cjs.js +8 -12
  158. package/dist/drawer.esm.js +6 -10
  159. package/dist/dropdown.cjs.js +8 -6
  160. package/dist/dropdown.esm.js +33 -30
  161. package/dist/empty-state.cjs.js +17 -15
  162. package/dist/empty-state.esm.js +13 -11
  163. package/dist/field.cjs.js +22 -13
  164. package/dist/field.esm.js +54 -45
  165. package/dist/fieldset.cjs.js +18 -11
  166. package/dist/fieldset.esm.js +20 -13
  167. package/dist/file-upload.cjs.js +77 -35
  168. package/dist/file-upload.esm.js +152 -110
  169. package/dist/floating-toolbar.cjs.js +6 -7
  170. package/dist/floating-toolbar.esm.js +8 -9
  171. package/dist/form.cjs.js +20 -23
  172. package/dist/form.esm.js +20 -23
  173. package/dist/gantt.cjs.js +6 -6
  174. package/dist/gantt.esm.js +6 -6
  175. package/dist/hover-card.cjs.js +7 -7
  176. package/dist/hover-card.esm.js +7 -7
  177. package/dist/icon-cloud.cjs.js +19 -36
  178. package/dist/icon-cloud.esm.js +41 -58
  179. package/dist/index.cjs.js +1 -1
  180. package/dist/index.d.ts +2 -0
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.esm.js +108 -104
  183. package/dist/inline-edit.cjs.js +47 -19
  184. package/dist/inline-edit.esm.js +66 -38
  185. package/dist/input.cjs.js +44 -37
  186. package/dist/input.esm.js +59 -52
  187. package/dist/layout.cjs.js +3 -3
  188. package/dist/layout.esm.js +3 -3
  189. package/dist/marquee.cjs.js +7 -10
  190. package/dist/marquee.esm.js +7 -10
  191. package/dist/menu.cjs.js +8 -24
  192. package/dist/menu.esm.js +52 -72
  193. package/dist/menubar.cjs.js +9 -31
  194. package/dist/menubar.esm.js +127 -153
  195. package/dist/meter.cjs.js +4 -9
  196. package/dist/meter.esm.js +6 -11
  197. package/dist/multi-select.cjs.js +48 -35
  198. package/dist/multi-select.esm.js +67 -53
  199. package/dist/navigation-menu.cjs.js +10 -10
  200. package/dist/navigation-menu.esm.js +33 -33
  201. package/dist/number-field.cjs.js +27 -16
  202. package/dist/number-field.esm.js +36 -25
  203. package/dist/odometer.cjs.js +5 -5
  204. package/dist/odometer.esm.js +3 -3
  205. package/dist/orbiter.cjs.js +11 -28
  206. package/dist/orbiter.esm.js +28 -45
  207. package/dist/overlay-motion-B56x1GoY.js +49 -0
  208. package/dist/overlay-motion-BX3dPLay.mjs +120 -0
  209. package/dist/pagination.cjs.js +28 -25
  210. package/dist/pagination.esm.js +54 -51
  211. package/dist/password-field.cjs.js +38 -33
  212. package/dist/password-field.esm.js +62 -57
  213. package/dist/pin-input.cjs.js +17 -13
  214. package/dist/pin-input.esm.js +23 -19
  215. package/dist/plugin-panel.cjs.js +1 -1
  216. package/dist/plugin-panel.esm.js +1 -1
  217. package/dist/popover.cjs.js +16 -28
  218. package/dist/popover.esm.js +29 -45
  219. package/dist/portal-DeaM1tYY.mjs +121 -0
  220. package/dist/portal-XbYR3m_q.js +1 -0
  221. package/dist/portal.d.ts +3 -1
  222. package/dist/portal.d.ts.map +1 -1
  223. package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
  224. package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
  225. package/dist/positioner.cjs.js +1 -1
  226. package/dist/positioner.esm.js +1 -1
  227. package/dist/primitives/overlay-motion.d.ts +47 -0
  228. package/dist/primitives/overlay-motion.d.ts.map +1 -0
  229. package/dist/primitives/positioner.d.ts.map +1 -1
  230. package/dist/progress.cjs.js +11 -16
  231. package/dist/progress.esm.js +37 -42
  232. package/dist/quick-actions.cjs.js +13 -13
  233. package/dist/quick-actions.esm.js +11 -11
  234. package/dist/radio-group.cjs.js +50 -26
  235. package/dist/radio-group.esm.js +53 -29
  236. package/dist/radio.cjs.js +15 -12
  237. package/dist/radio.esm.js +15 -12
  238. package/dist/rating.cjs.js +11 -15
  239. package/dist/rating.esm.js +48 -50
  240. package/dist/{runtime-CFnK53iC.mjs → runtime-CQM6wZOc.mjs} +498 -514
  241. package/dist/runtime-DxCl0A5q.js +5 -0
  242. package/dist/runtime.cjs.js +1 -1
  243. package/dist/runtime.d.ts +3 -2
  244. package/dist/runtime.d.ts.map +1 -1
  245. package/dist/runtime.esm.js +36 -32
  246. package/dist/scroll-area.cjs.js +3 -4
  247. package/dist/scroll-area.esm.js +3 -4
  248. package/dist/section.cjs.js +2 -4
  249. package/dist/section.esm.js +2 -4
  250. package/dist/select.cjs.js +40 -73
  251. package/dist/select.esm.js +55 -87
  252. package/dist/selection-popup.cjs.js +3 -4
  253. package/dist/selection-popup.esm.js +3 -4
  254. package/dist/semantic-tokens.d.ts +17 -0
  255. package/dist/semantic-tokens.d.ts.map +1 -0
  256. package/dist/sidebar.cjs.js +22 -22
  257. package/dist/sidebar.esm.js +25 -25
  258. package/dist/skeleton.cjs.js +2 -2
  259. package/dist/skeleton.esm.js +2 -2
  260. package/dist/slider.cjs.js +22 -26
  261. package/dist/slider.esm.js +25 -29
  262. package/dist/sortable.cjs.js +4 -5
  263. package/dist/sortable.esm.js +4 -5
  264. package/dist/spinning-text.cjs.js +4 -13
  265. package/dist/spinning-text.esm.js +4 -13
  266. package/dist/split-button.cjs.js +5 -5
  267. package/dist/split-button.esm.js +15 -14
  268. package/dist/splitter.cjs.js +52 -10
  269. package/dist/splitter.esm.js +55 -13
  270. package/dist/stepper.cjs.js +31 -65
  271. package/dist/stepper.esm.js +32 -66
  272. package/dist/switch.cjs.js +20 -22
  273. package/dist/switch.esm.js +20 -22
  274. package/dist/table.cjs.js +5 -5
  275. package/dist/table.esm.js +20 -20
  276. package/dist/tabs.cjs.js +91 -21
  277. package/dist/tabs.esm.js +182 -112
  278. package/dist/tags-input.cjs.js +41 -15
  279. package/dist/tags-input.esm.js +73 -47
  280. package/dist/textarea.cjs.js +32 -33
  281. package/dist/textarea.esm.js +38 -39
  282. package/dist/theme.d.ts +25 -1
  283. package/dist/theme.d.ts.map +1 -1
  284. package/dist/time-field.cjs.js +7 -7
  285. package/dist/time-field.esm.js +6 -6
  286. package/dist/time-picker.cjs.js +16 -13
  287. package/dist/time-picker.esm.js +27 -24
  288. package/dist/timeline.cjs.js +10 -10
  289. package/dist/timeline.esm.js +7 -7
  290. package/dist/toggle-group.cjs.js +13 -13
  291. package/dist/toggle-group.esm.js +66 -61
  292. package/dist/toggle.cjs.js +52 -34
  293. package/dist/toggle.esm.js +80 -62
  294. package/dist/toolbar.cjs.js +14 -14
  295. package/dist/toolbar.esm.js +41 -33
  296. package/dist/tooltip.cjs.js +3 -3
  297. package/dist/tooltip.esm.js +39 -33
  298. package/dist/transfer-list.cjs.js +28 -29
  299. package/dist/transfer-list.esm.js +28 -29
  300. package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
  301. package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
  302. package/dist/tree-item.cjs.js +9 -8
  303. package/dist/tree-item.esm.js +13 -12
  304. package/dist/tree.cjs.js +1 -1
  305. package/dist/tree.esm.js +1 -1
  306. package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
  307. package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
  308. package/dist/wizard.cjs.js +39 -36
  309. package/dist/wizard.esm.js +39 -36
  310. package/package.json +1 -1
  311. package/dist/date-time-utils-y3AvNvGe.js +0 -1
  312. package/dist/portal-DgpQ3Jo1.js +0 -1
  313. package/dist/portal-bR42gHvG.mjs +0 -118
  314. 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));
@@ -25,7 +26,8 @@ const U = `
25
26
  --ui-alert-btn-bg: color-mix(in srgb, var(--ui-alert-bg-base) 90%, var(--ui-color-background, #ffffff) 10%);
26
27
  --ui-alert-btn-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
27
28
  --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);
29
+ /* Default confirm is the primary fill. A tone sets its own fill and text below, so the text always reads. */
30
+ --ui-alert-confirm-bg: var(--ui-color-primary, #2563eb);
29
31
  --ui-alert-confirm-color: var(--ui-color-foreground-on-primary, #ffffff);
30
32
  --ui-alert-icon-bg: color-mix(in srgb, var(--ui-alert-accent) 14%, transparent);
31
33
  --ui-alert-icon-color: var(--ui-alert-accent);
@@ -37,8 +39,8 @@ const U = `
37
39
  --ui-alert-description-size: 13px;
38
40
  --ui-alert-description-line-height: 20px;
39
41
  --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);
42
+ --ui-alert-button-height: var(--base-button-height-md, var(--ui-control-height-2, 32px));
43
+ --ui-alert-button-radius: var(--ui-radius, 6px);
42
44
  }
43
45
 
44
46
  :host([tone='info']) {
@@ -47,14 +49,20 @@ const U = `
47
49
 
48
50
  :host([tone='success']) {
49
51
  --ui-alert-accent: var(--ui-color-success, #15803d);
52
+ --ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 76%, #000000);
53
+ --ui-alert-confirm-color: #ffffff;
50
54
  }
51
55
 
52
56
  :host([tone='warning']) {
53
57
  --ui-alert-accent: var(--ui-color-warning, #b45309);
58
+ --ui-alert-confirm-bg: var(--ui-alert-accent);
59
+ --ui-alert-confirm-color: var(--ui-color-foreground-on-warning, #ffffff);
54
60
  }
55
61
 
56
62
  :host([tone='danger']) {
57
63
  --ui-alert-accent: var(--ui-color-danger, #dc2626);
64
+ --ui-alert-confirm-bg: color-mix(in srgb, var(--ui-alert-accent) 80%, #000000);
65
+ --ui-alert-confirm-color: #ffffff;
58
66
  }
59
67
 
60
68
  :host([size='sm']),
@@ -68,7 +76,7 @@ const U = `
68
76
  --ui-alert-description-size: 12px;
69
77
  --ui-alert-description-line-height: 18px;
70
78
  --ui-alert-icon-size: 24px;
71
- --ui-alert-button-height: var(--base-button-height-sm, 32px);
79
+ --ui-alert-button-height: var(--base-button-height-sm, var(--ui-control-height-1, 24px));
72
80
  }
73
81
 
74
82
  :host([size='md']),
@@ -88,7 +96,7 @@ const U = `
88
96
  --ui-alert-description-size: 14px;
89
97
  --ui-alert-description-line-height: 22px;
90
98
  --ui-alert-icon-size: 32px;
91
- --ui-alert-button-height: var(--base-button-height-lg, 44px);
99
+ --ui-alert-button-height: var(--base-button-height-lg, var(--ui-control-height-3, 40px));
92
100
  }
93
101
 
94
102
  :host([variant='outline']) {
@@ -136,8 +144,16 @@ const U = `
136
144
  place-items: center;
137
145
  background: var(--ui-alert-backdrop);
138
146
  backdrop-filter: saturate(1.04) blur(3px);
139
- opacity: 0;
140
- transition: opacity var(--ui-alert-duration) var(--ui-alert-easing);
147
+ /* The backdrop goes to the top layer (popover); undo the popover user-agent box. */
148
+ inline-size: 100%;
149
+ block-size: 100%;
150
+ max-inline-size: none;
151
+ max-block-size: none;
152
+ margin: 0;
153
+ padding: 0;
154
+ border: 0;
155
+ overflow: visible;
156
+ color: inherit;
141
157
  }
142
158
 
143
159
  .dialog {
@@ -154,13 +170,9 @@ const U = `
154
170
  padding: var(--ui-alert-padding);
155
171
  outline: none;
156
172
  overflow: clip;
157
- opacity: 0;
158
- transform: translateY(12px) scale(0.985);
159
173
  transition:
160
174
  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);
175
+ box-shadow var(--ui-alert-duration) var(--ui-alert-easing);
164
176
  }
165
177
 
166
178
  .dialog::before {
@@ -181,13 +193,33 @@ const U = `
181
193
  display: none;
182
194
  }
183
195
 
184
- .backdrop[data-open='true'] {
185
- opacity: 1;
196
+ /* Open and close are animations on data-state; the surface is created and removed, which a transition cannot play. */
197
+ .backdrop[data-state='open']:not([data-instant]) {
198
+ animation: ui-alert-backdrop-in 150ms ease-out backwards;
186
199
  }
187
200
 
188
- .backdrop[data-open='true'] .dialog {
189
- opacity: 1;
190
- transform: translateY(0) scale(1);
201
+ .backdrop[data-state='open']:not([data-instant]) .dialog {
202
+ animation: ui-alert-dialog-in 150ms var(--ui-motion-enter-easing, cubic-bezier(0.16, 1, 0.3, 1)) backwards;
203
+ }
204
+
205
+ .backdrop[data-state='closed'] {
206
+ animation: ui-alert-backdrop-out 100ms ease-in both;
207
+ pointer-events: none;
208
+ }
209
+
210
+ .backdrop[data-state='closed'] .dialog {
211
+ animation: ui-alert-dialog-out 100ms var(--ui-motion-exit-easing, cubic-bezier(0.4, 0, 1, 1)) both;
212
+ }
213
+
214
+ @keyframes ui-alert-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
215
+ @keyframes ui-alert-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
216
+ @keyframes ui-alert-dialog-in {
217
+ from { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
218
+ to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
219
+ }
220
+ @keyframes ui-alert-dialog-out {
221
+ from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
222
+ to { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
191
223
  }
192
224
 
193
225
  .dialog:focus-visible {
@@ -307,12 +339,12 @@ const U = `
307
339
 
308
340
  .input {
309
341
  width: 100%;
310
- border-radius: var(--ui-radius, 4px);
342
+ border-radius: var(--ui-radius, 6px);
311
343
  border: var(--base-input-border, 1px solid color-mix(in srgb, var(--ui-alert-border-color) 88%, transparent));
312
344
  background: var(--base-input-bg, color-mix(in srgb, var(--ui-alert-bg-base) 94%, #ffffff 6%));
313
345
  color: inherit;
314
346
  box-sizing: border-box;
315
- min-height: var(--base-input-height-md, 36px);
347
+ min-height: var(--base-input-height-md, var(--ui-control-height-2, 32px));
316
348
  padding: 9px 12px;
317
349
  font: inherit;
318
350
  line-height: 1.35;
@@ -499,62 +531,62 @@ const U = `
499
531
  border: 1px solid CanvasText;
500
532
  }
501
533
  }
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";
534
+ `, X = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
535
+ function f(i, t) {
536
+ if (i == null) return t;
537
+ const e = i.trim().toLowerCase();
538
+ return e !== "false" && e !== "0" && e !== "off";
507
539
  }
508
- function a(e) {
509
- return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
540
+ function a(i) {
541
+ return String(i).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
510
542
  }
511
- function G(e) {
512
- return e === "info" || e === "success" || e === "warning" || e === "danger" ? e : "neutral";
543
+ function tt(i) {
544
+ return i === "info" || i === "success" || i === "warning" || i === "danger" ? i : "neutral";
513
545
  }
514
- function J(e) {
515
- return e === "sm" || e === "1" ? "sm" : e === "lg" || e === "3" ? "lg" : "md";
546
+ function et(i) {
547
+ return i === "sm" || i === "1" ? "sm" : i === "lg" || i === "3" ? "lg" : "md";
516
548
  }
517
- function Q(e) {
518
- return e === "soft" || e === "outline" || e === "solid" ? e : "surface";
549
+ function it(i) {
550
+ return i === "soft" || i === "outline" || i === "solid" ? i : "surface";
519
551
  }
520
- function X(e) {
521
- return e === "none" || e === "high" ? e : "low";
552
+ function rt(i) {
553
+ return i === "none" || i === "high" ? i : "low";
522
554
  }
523
- function tt(e) {
524
- return e === "none" ? "none" : "line";
555
+ function st(i) {
556
+ return i === "none" ? "none" : "line";
525
557
  }
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;
558
+ function at(i, t = "var(--base-alert-dialog-radius, var(--ui-radius, 6px))") {
559
+ if (i == null) return t;
560
+ const e = i.trim().toLowerCase();
561
+ return e ? e === "full" || e === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(e) ? `${e}px` : i : t;
530
562
  }
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>';
563
+ const ot = /* @__PURE__ */ new Set(["tone", "size", "variant", "elevation", "indicator", "radius"]);
564
+ function nt(i) {
565
+ 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
566
  }
535
567
  function u() {
536
568
  return typeof window < "u" && typeof document < "u";
537
569
  }
538
- function S() {
570
+ function T() {
539
571
  if (!u()) return null;
540
- const e = document.activeElement;
541
- return e instanceof HTMLElement ? e : null;
572
+ const i = document.activeElement;
573
+ return i instanceof HTMLElement ? i : null;
542
574
  }
543
- function _(e) {
544
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => e()) : window.setTimeout(e, 16);
575
+ function k(i) {
576
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => i()) : window.setTimeout(i, 16);
545
577
  }
546
- function p(e) {
547
- if (e) {
578
+ function p(i) {
579
+ if (i) {
548
580
  if (typeof cancelAnimationFrame == "function") {
549
- cancelAnimationFrame(e);
581
+ cancelAnimationFrame(i);
550
582
  return;
551
583
  }
552
- window.clearTimeout(e);
584
+ window.clearTimeout(i);
553
585
  }
554
586
  }
555
- const c = "data-ui-auto-name", l = class l extends N {
587
+ const c = "data-ui-auto-name", l = class l extends Z {
556
588
  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;
589
+ 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
590
  }
559
591
  static get observedAttributes() {
560
592
  return [
@@ -590,9 +622,9 @@ const c = "data-ui-auto-name", l = class l extends N {
590
622
  disconnectedCallback() {
591
623
  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
624
  }
593
- attributeChangedCallback(t, i, r) {
594
- if (i !== r) {
595
- if (et.has(t)) {
625
+ attributeChangedCallback(t, e, r) {
626
+ if (e !== r) {
627
+ if (ot.has(t)) {
596
628
  this._syncVisualTokens();
597
629
  return;
598
630
  }
@@ -620,25 +652,25 @@ const c = "data-ui-auto-name", l = class l extends N {
620
652
  t ? this.setAttribute("headless", "") : this.removeAttribute("headless");
621
653
  }
622
654
  get dismissible() {
623
- return b(this.getAttribute("dismissible"), !0);
655
+ return f(this.getAttribute("dismissible"), !0);
624
656
  }
625
657
  set dismissible(t) {
626
658
  this.setAttribute("dismissible", String(t));
627
659
  }
628
660
  get closeOnEsc() {
629
- return b(this.getAttribute("close-on-esc"), this.dismissible);
661
+ return f(this.getAttribute("close-on-esc"), this.dismissible);
630
662
  }
631
663
  set closeOnEsc(t) {
632
664
  this.setAttribute("close-on-esc", String(t));
633
665
  }
634
666
  get closeOnBackdrop() {
635
- return b(this.getAttribute("close-on-backdrop"), this.dismissible);
667
+ return f(this.getAttribute("close-on-backdrop"), this.dismissible);
636
668
  }
637
669
  set closeOnBackdrop(t) {
638
670
  this.setAttribute("close-on-backdrop", String(t));
639
671
  }
640
672
  get lockWhileLoading() {
641
- return b(this.getAttribute("lock-while-loading"), !0);
673
+ return f(this.getAttribute("lock-while-loading"), !0);
642
674
  }
643
675
  set lockWhileLoading(t) {
644
676
  this.setAttribute("lock-while-loading", String(t));
@@ -650,7 +682,7 @@ const c = "data-ui-auto-name", l = class l extends N {
650
682
  this.setAttribute("role", t);
651
683
  }
652
684
  get tone() {
653
- return G(this.getAttribute("tone"));
685
+ return tt(this.getAttribute("tone"));
654
686
  }
655
687
  set tone(t) {
656
688
  if (t === "neutral") {
@@ -660,7 +692,7 @@ const c = "data-ui-auto-name", l = class l extends N {
660
692
  this.setAttribute("tone", t);
661
693
  }
662
694
  get size() {
663
- return J(this.getAttribute("size"));
695
+ return et(this.getAttribute("size"));
664
696
  }
665
697
  set size(t) {
666
698
  if (t === "md") {
@@ -670,7 +702,7 @@ const c = "data-ui-auto-name", l = class l extends N {
670
702
  this.setAttribute("size", t);
671
703
  }
672
704
  get variant() {
673
- return Q(this.getAttribute("variant"));
705
+ return it(this.getAttribute("variant"));
674
706
  }
675
707
  set variant(t) {
676
708
  if (t === "surface") {
@@ -680,7 +712,7 @@ const c = "data-ui-auto-name", l = class l extends N {
680
712
  this.setAttribute("variant", t);
681
713
  }
682
714
  get elevation() {
683
- return X(this.getAttribute("elevation"));
715
+ return rt(this.getAttribute("elevation"));
684
716
  }
685
717
  set elevation(t) {
686
718
  if (t === "low") {
@@ -690,7 +722,7 @@ const c = "data-ui-auto-name", l = class l extends N {
690
722
  this.setAttribute("elevation", t);
691
723
  }
692
724
  get indicator() {
693
- return tt(this.getAttribute("indicator"));
725
+ return st(this.getAttribute("indicator"));
694
726
  }
695
727
  set indicator(t) {
696
728
  if (t === "line") {
@@ -747,16 +779,16 @@ const c = "data-ui-auto-name", l = class l extends N {
747
779
  }
748
780
  setInputValue(t) {
749
781
  this._inputValue = t;
750
- const i = this.root.querySelector(".input");
751
- i && (i.value = t);
782
+ const e = this.root.querySelector(".input");
783
+ e && (e.value = t);
752
784
  }
753
785
  getChecked() {
754
786
  return this.root.querySelector(".checkbox-input")?.checked ?? this._checked;
755
787
  }
756
788
  setChecked(t) {
757
789
  this._checked = t;
758
- const i = this.root.querySelector(".checkbox-input");
759
- i && (i.checked = t);
790
+ const e = this.root.querySelector(".checkbox-input");
791
+ e && (e.checked = t);
760
792
  }
761
793
  setError(t) {
762
794
  this._runtimeError = t, this.state = t ? "error" : "idle", this.requestRender();
@@ -764,14 +796,14 @@ const c = "data-ui-auto-name", l = class l extends N {
764
796
  clearError() {
765
797
  this._runtimeError = "", this.state === "error" && (this.state = "idle"), this.requestRender();
766
798
  }
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());
799
+ close(t = "dismiss", e, r) {
800
+ this._terminalEmitted || (this._closeMeta = { action: t, source: e, reason: r }, this.hasAttribute("open") && this.removeAttribute("open"), this._syncOpenState());
769
801
  }
770
802
  _syncFromAttributes() {
771
803
  this.hasAttribute("role") || this.setAttribute("role", "alertdialog");
772
804
  }
773
805
  _syncVisualTokens() {
774
- this.style.setProperty("--ui-alert-radius", it(this.getAttribute("radius")));
806
+ this.style.setProperty("--ui-alert-radius", at(this.getAttribute("radius")));
775
807
  }
776
808
  _syncOpenState() {
777
809
  const t = this.hasAttribute("open");
@@ -782,9 +814,9 @@ const c = "data-ui-auto-name", l = class l extends N {
782
814
  !t && this._active && this._deactivate();
783
815
  }
784
816
  _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);
817
+ 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
818
  const t = this.dialogId || this._uid;
787
- this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = _(() => {
819
+ this._dispatchWithLegacy("ui-open", "open", { id: t }), this.headless || (this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
788
820
  this._focusInitialFrame = 0, this._focusInitial();
789
821
  })), this.requestRender();
790
822
  }
@@ -792,7 +824,7 @@ const c = "data-ui-auto-name", l = class l extends N {
792
824
  if (!this._active) return;
793
825
  this._active = !1;
794
826
  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) {
827
+ if (t >= 0 && l._openStack.splice(t, 1), u() && !this._activeHeadless && document.removeEventListener("focusin", this._onFocusIn, !0), this._activeHeadless || L(), !this._terminalEmitted) {
796
828
  const r = this._closeMeta || { action: "dismiss", source: "abort" }, s = this.dialogId || this._uid;
797
829
  r.action === "cancel" ? this._dispatchWithLegacy("ui-cancel", "cancel", { id: s }) : r.action === "dismiss" && this._dispatchWithLegacy("ui-dismiss", "dismiss", {
798
830
  id: s,
@@ -805,11 +837,11 @@ const c = "data-ui-auto-name", l = class l extends N {
805
837
  reason: r.reason
806
838
  }), this._terminalEmitted = !0, this._closeMeta = null;
807
839
  }
808
- const i = this._lastActive;
809
- this._lastActive = null, i && !this._activeHeadless && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame = _(() => {
840
+ const e = this._lastActive;
841
+ this._lastActive = null, e && !this._activeHeadless && (this._restoreFocusFrame && p(this._restoreFocusFrame), this._restoreFocusFrame = k(() => {
810
842
  this._restoreFocusFrame = 0;
811
843
  try {
812
- i.focus();
844
+ e.focus();
813
845
  } catch {
814
846
  }
815
847
  })), this._activeHeadless = !1, this.requestRender();
@@ -817,15 +849,15 @@ const c = "data-ui-auto-name", l = class l extends N {
817
849
  _syncActiveEnvironment() {
818
850
  if (this._active && this.headless !== this._activeHeadless) {
819
851
  if (this.headless) {
820
- u() && document.removeEventListener("focusin", this._onFocusIn, !0), I(), this._lastActive = null, this._activeHeadless = !0;
852
+ u() && document.removeEventListener("focusin", this._onFocusIn, !0), L(), this._lastActive = null, this._activeHeadless = !0;
821
853
  return;
822
854
  }
823
- this._lastActive = S(), C(), u() && document.addEventListener("focusin", this._onFocusIn, !0), this._activeHeadless = !1, this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = _(() => {
855
+ this._lastActive = T(), S(), u() && document.addEventListener("focusin", this._onFocusIn, !0), this._activeHeadless = !1, this._focusInitialFrame && p(this._focusInitialFrame), this._focusInitialFrame = k(() => {
824
856
  this._focusInitialFrame = 0, this._focusInitial();
825
857
  });
826
858
  }
827
859
  }
828
- _dispatchWithLegacy(t, i, r, s = !1) {
860
+ _dispatchWithLegacy(t, e, r, s = !1) {
829
861
  const o = new CustomEvent(t, {
830
862
  detail: r,
831
863
  bubbles: !0,
@@ -833,7 +865,7 @@ const c = "data-ui-auto-name", l = class l extends N {
833
865
  cancelable: s
834
866
  });
835
867
  this.dispatchEvent(o);
836
- const n = new CustomEvent(i, {
868
+ const n = new CustomEvent(e, {
837
869
  detail: r,
838
870
  bubbles: !0,
839
871
  composed: !0,
@@ -850,9 +882,9 @@ const c = "data-ui-auto-name", l = class l extends N {
850
882
  return this.root.querySelector(".dialog");
851
883
  }
852
884
  _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;
885
+ return Array.from(t.querySelectorAll(X)).filter((e) => {
886
+ if (e.disabled || e.getAttribute("aria-hidden") === "true") return !1;
887
+ const s = u() ? window.getComputedStyle(e) : null;
856
888
  return !(s && (s.display === "none" || s.visibility === "hidden"));
857
889
  });
858
890
  }
@@ -860,9 +892,9 @@ const c = "data-ui-auto-name", l = class l extends N {
860
892
  if (!this.open) return;
861
893
  const t = this._queryPanel();
862
894
  if (!t) return;
863
- const i = this.initialFocus;
864
- if (i) {
865
- const n = t.querySelector(i);
895
+ const e = this.initialFocus;
896
+ if (e) {
897
+ const n = t.querySelector(e);
866
898
  if (n && typeof n.focus == "function") {
867
899
  n.focus();
868
900
  return;
@@ -877,30 +909,30 @@ const c = "data-ui-auto-name", l = class l extends N {
877
909
  }
878
910
  _handleTab(t) {
879
911
  if (t.key !== "Tab") return;
880
- const i = this._queryPanel();
881
- if (!i) return;
882
- const r = this._collectFocusable(i);
912
+ const e = this._queryPanel();
913
+ if (!e) return;
914
+ const r = this._collectFocusable(e);
883
915
  if (!r.length) {
884
- t.preventDefault(), i.focus();
916
+ t.preventDefault(), e.focus();
885
917
  return;
886
918
  }
887
919
  const s = this.root.activeElement || document.activeElement, o = r[0], n = r[r.length - 1];
888
920
  if (t.shiftKey) {
889
- (s === o || !s || !i.contains(s)) && (t.preventDefault(), n.focus());
921
+ (s === o || !s || !e.contains(s)) && (t.preventDefault(), n.focus());
890
922
  return;
891
923
  }
892
924
  s === n && (t.preventDefault(), o.focus());
893
925
  }
894
926
  _onFocusIn(t) {
895
927
  if (!this.open || !this._isTopMost()) return;
896
- const i = this._queryPanel();
897
- if (!i) return;
928
+ const e = this._queryPanel();
929
+ if (!e) return;
898
930
  const r = t.target;
899
- (typeof t.composedPath == "function" ? t.composedPath() : []).includes(i) || r && i.contains(r) || this._focusInitial();
931
+ (typeof t.composedPath == "function" ? t.composedPath() : []).includes(e) || r && e.contains(r) || this._focusInitial();
900
932
  }
901
933
  _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", {
934
+ const e = t.target;
935
+ e && (e.classList.contains("input") && (this._inputValue = e.value), e.classList.contains("checkbox-input") && (this._checked = e.checked), this._dispatchWithLegacy("ui-change", "change", {
904
936
  id: this.dialogId || this._uid,
905
937
  inputValue: this._inputValue,
906
938
  checked: this._checked
@@ -909,8 +941,8 @@ const c = "data-ui-auto-name", l = class l extends N {
909
941
  _isInteractionLocked() {
910
942
  return this.state === "loading" && this.lockWhileLoading;
911
943
  }
912
- _requestDismiss(t, i) {
913
- this._isInteractionLocked() || this.close("dismiss", t, i);
944
+ _requestDismiss(t, e) {
945
+ this._isInteractionLocked() || this.close("dismiss", t, e);
914
946
  }
915
947
  _handleConfirm() {
916
948
  const t = {
@@ -925,21 +957,21 @@ const c = "data-ui-auto-name", l = class l extends N {
925
957
  }
926
958
  _onClick(t) {
927
959
  if (!this.open || !this._isTopMost()) return;
928
- const i = t.target;
929
- if (i) {
930
- if (i.classList.contains("backdrop") && this.closeOnBackdrop) {
960
+ const e = t.target;
961
+ if (e) {
962
+ if (e.classList.contains("backdrop") && this.closeOnBackdrop) {
931
963
  this._requestDismiss("backdrop");
932
964
  return;
933
965
  }
934
- if (i.closest(".close")) {
966
+ if (e.closest(".close")) {
935
967
  this._requestDismiss("close-icon");
936
968
  return;
937
969
  }
938
- if (i.closest(".btn-confirm")) {
970
+ if (e.closest(".btn-confirm")) {
939
971
  this._handleConfirm();
940
972
  return;
941
973
  }
942
- i.closest(".btn-cancel") && this._handleCancel();
974
+ e.closest(".btn-cancel") && this._handleCancel();
943
975
  }
944
976
  }
945
977
  _onKeyDown(t) {
@@ -955,7 +987,7 @@ const c = "data-ui-auto-name", l = class l extends N {
955
987
  // The host carries role="alertdialog" (that attribute is also how the role is configured), so it
956
988
  // is exposed as a dialog of its own. Closed, it was an empty, unnamed alert dialog sitting in the
957
989
  // page; open, it needs the same name as the dialog inside its shadow root.
958
- _syncHostSemantics(t, i = "", r = !1) {
990
+ _syncHostSemantics(t, e = "", r = !1) {
959
991
  if (!t) {
960
992
  this.getAttribute("aria-hidden") !== "true" && this.setAttribute("aria-hidden", "true"), this.hasAttribute(c) && (this.removeAttribute("aria-label"), this.removeAttribute(c));
961
993
  return;
@@ -964,25 +996,35 @@ const c = "data-ui-auto-name", l = class l extends N {
964
996
  this.hasAttribute(c) && this.removeAttribute(c);
965
997
  return;
966
998
  }
967
- this.getAttribute("aria-label") !== i && this.setAttribute("aria-label", i), this.hasAttribute(c) || this.setAttribute(c, "");
999
+ this.getAttribute("aria-label") !== e && this.setAttribute("aria-label", e), this.hasAttribute(c) || this.setAttribute(c, "");
968
1000
  }
969
1001
  render() {
970
1002
  if (!this.open) {
971
- this._syncHostSemantics(!1), this.setContent("");
1003
+ this._syncHostSemantics(!1);
1004
+ const _ = this.root.querySelector(".backdrop");
1005
+ if (this._presented && _) {
1006
+ this._presented = !1, _.removeAttribute("data-instant"), this._finishClose = G(_, () => {
1007
+ this._finishClose = null, this.setContent("");
1008
+ });
1009
+ return;
1010
+ }
1011
+ if (this._finishClose) return;
1012
+ this.setContent("");
972
1013
  return;
973
1014
  }
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();
1015
+ this._finishClose?.(), this._finishClose = null;
1016
+ const t = this._config.title ?? this.getAttribute("title") ?? "", e = 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, $ = 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
1017
  this._syncHostSemantics(
976
1018
  !0,
977
- v || Y || t || i || "Dialog",
1019
+ v || U || t || e || "Dialog",
978
1020
  !!v || !!F
979
1021
  );
980
1022
  const d = [];
981
- z ? d.push(z) : (m && d.push(w), f && d.push(A));
1023
+ C ? d.push(C) : (m && d.push(A), b && d.push(z));
982
1024
  const h = M === "loading";
983
1025
  this.setContent(`
984
- <style>${U}</style>
985
- <div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}">
1026
+ <style>${Q}</style>
1027
+ <div class="backdrop" part="backdrop" role="presentation" data-open="${String(this.open)}" data-state="open" ${this._presented ? "data-instant" : ""}>
986
1028
  <section
987
1029
  class="dialog"
988
1030
  part="dialog"
@@ -993,66 +1035,68 @@ const c = "data-ui-auto-name", l = class l extends N {
993
1035
  ${d.length ? `aria-describedby="${a(d.join(" "))}"` : ""}
994
1036
  tabindex="-1"
995
1037
  >
996
- ${j ? `<button class="close" part="close" aria-label="Close dialog">
1038
+ ${Y ? `<button class="close" part="close" aria-label="Close dialog">
997
1039
  <svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
998
1040
  <path d="m6 6 8 8M14 6l-8 8"></path>
999
1041
  </svg>
1000
1042
  </button>` : ""}
1001
1043
 
1002
- ${W ? `<header class="header">
1044
+ ${j ? `<header class="header">
1003
1045
  <div class="header-main">
1004
1046
  <span class="icon-wrap" part="icon-wrap" aria-hidden="true">
1005
1047
  <span class="icon" part="icon">
1006
- <slot name="icon">${rt(K)}</slot>
1048
+ <slot name="icon">${nt(N)}</slot>
1007
1049
  </span>
1008
1050
  </span>
1009
1051
  <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>` : ""}
1052
+ ${g ? `<h2 id="${w}" class="title" part="title"><slot name="title">${a(t)}</slot></h2>` : ""}
1053
+ ${m ? `<p id="${A}" class="description" part="description"><slot name="description">${a(e)}</slot></p>` : ""}
1012
1054
  </div>
1013
1055
  </div>
1014
1056
  </header>` : ""}
1015
1057
 
1016
1058
  <div class="content" part="content">
1017
- ${R ? '<slot name="content"></slot>' : "<slot></slot>"}
1059
+ ${P ? '<slot name="content"></slot>' : "<slot></slot>"}
1018
1060
 
1019
1061
  ${n ? `<label class="input-wrap">
1020
- <span class="label">${a(L)}</span>
1062
+ <span class="label">${a($)}</span>
1021
1063
  <input
1022
1064
  class="input"
1023
1065
  part="input"
1024
1066
  type="text"
1025
1067
  value="${a(this.getInputValue())}"
1026
- placeholder="${a($)}"
1027
- ${T ? "required" : ""}
1068
+ placeholder="${a(B)}"
1069
+ ${q ? "required" : ""}
1028
1070
  ${h ? "disabled" : ""}
1029
1071
  />
1030
1072
  </label>` : ""}
1031
1073
 
1032
- ${B ? `<label class="checkbox" part="checkbox">
1074
+ ${O ? `<label class="checkbox" part="checkbox">
1033
1075
  <span class="checkbox-line">
1034
1076
  <input class="checkbox-input" type="checkbox" ${this.getChecked() ? "checked" : ""} ${h ? "disabled" : ""} />
1035
- <span>${a(q)}</span>
1077
+ <span>${a(D)}</span>
1036
1078
  </span>
1037
1079
  </label>` : ""}
1038
1080
  </div>
1039
1081
 
1040
- <div class="error" id="${A}" part="error" aria-live="polite" data-empty="${String(!f)}">${a(f)}</div>
1082
+ <div class="error" id="${z}" part="error" aria-live="polite" data-empty="${String(!b)}">${a(b)}</div>
1041
1083
 
1042
1084
  <footer class="footer" part="footer">
1043
1085
  ${h ? `<span class="loading"><span class="spinner" aria-hidden="true"></span><span>${a(o)}</span></span>` : '<span aria-hidden="true"></span>'}
1044
1086
 
1045
- ${V ? '<slot name="footer"></slot>' : `${P ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${a(s)}</button>` : ""}
1087
+ ${W ? '<slot name="footer"></slot>' : `${K ? `<button class="btn btn-cancel" part="cancel" type="button" ${h ? "disabled" : ""}>${a(s)}</button>` : ""}
1046
1088
  <button class="btn btn-confirm" part="confirm" type="button" ${h ? "disabled" : ""}>${a(r)}</button>`}
1047
1089
  </footer>
1048
1090
  </section>
1049
1091
  </div>
1050
1092
  `);
1093
+ const I = this.root.querySelector(".backdrop");
1094
+ I && !this.headless && J(I, { resetBox: !1 }), this._presented = !0;
1051
1095
  }
1052
1096
  };
1053
1097
  l._openStack = [];
1054
- let k = l;
1055
- typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog", k);
1098
+ let y = l;
1099
+ typeof customElements < "u" && !customElements.get("ui-alert-dialog") && customElements.define("ui-alert-dialog", y);
1056
1100
  export {
1057
- k as UIAlertDialog
1101
+ y as UIAlertDialog
1058
1102
  };