@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,12 +1,13 @@
1
1
  import { E } from "./ElementBase-BeZT54Hj.mjs";
2
- import { b as k } from "./portal-bR42gHvG.mjs";
2
+ import { b as k } from "./portal-DeaM1tYY.mjs";
3
3
  import { d as L } from "./collection-C7URGjEI.mjs";
4
4
  import { c as I } from "./dismissable-layer-BmPIoK80.mjs";
5
5
  import { r as g, s as v, f as C, m as y, g as x } from "./roving-focus-group-Dbm1Jko_.mjs";
6
- import { e as T } from "./positioner-D0VGxtYU.mjs";
6
+ import { e as T } from "./positioner-BE8Nbho2.mjs";
7
+ import { O as D, o as z, r as O, a as B } from "./overlay-motion-BX3dPLay.mjs";
7
8
  import "./listbox-hMVOhKHC.mjs";
8
- import { c as D } from "./menu-item-styles-IGSFLAHu.mjs";
9
- const z = ":scope > .submenu", B = [
9
+ import { c as F } from "./menu-item-styles-IGSFLAHu.mjs";
10
+ const R = ":scope > .submenu", M = [
10
11
  "--ui-color-primary",
11
12
  "--ui-color-primary-hover",
12
13
  "--ui-color-foreground-on-primary",
@@ -41,7 +42,7 @@ const z = ":scope > .submenu", B = [
41
42
  "--accent-surface",
42
43
  "--accent-indicator",
43
44
  "--accent-track"
44
- ], F = [
45
+ ], $ = [
45
46
  { prefix: "--accent-", from: 1, to: 12 },
46
47
  { prefix: "--accent-a", from: 1, to: 12 },
47
48
  { prefix: "--gray-", from: 1, to: 12 },
@@ -51,17 +52,17 @@ const z = ":scope > .submenu", B = [
51
52
  { prefix: "--shadow-", from: 1, to: 6 },
52
53
  { prefix: "--radius-", from: 1, to: 6 }
53
54
  ];
54
- function O(n) {
55
+ function H(n) {
55
56
  return n === "sm" || n === "1" || n === "compact" ? "sm" : n === "lg" || n === "3" || n === "comfortable" ? "lg" : "md";
56
57
  }
57
58
  function S(n) {
58
59
  return !n || n === "default" ? null : n === "none" || n === "square" ? "0px" : n === "sm" ? "8px" : n === "md" || n === "soft" ? "12px" : n === "lg" ? "16px" : n === "full" ? "999px" : /^\d+(\.\d+)?$/.test(n) ? `${n}px` : /^\d+(\.\d+)?(px|rem|em|%)$/.test(n) ? n : null;
59
60
  }
60
- const R = `
61
+ const q = `
61
62
  :host {
62
63
  --ui-menubar-gap: var(--base-menubar-gap, 6px);
63
64
  --ui-menubar-padding: var(--base-menubar-padding, 6px);
64
- --ui-menubar-radius: var(--base-menubar-radius, var(--ui-radius, 4px));
65
+ --ui-menubar-radius: var(--base-menubar-radius, var(--ui-radius, 6px));
65
66
  --ui-menubar-bg: var(--base-menubar-bg, var(--color-panel-solid, var(--ui-color-surface, #ffffff)));
66
67
  --ui-menubar-border: var(--base-menubar-border, 1px solid color-mix(in srgb, var(--ui-color-border, #cbd5e1) 86%, transparent));
67
68
  --ui-menubar-shadow: var(--base-menubar-shadow, var(--shadow-2, none));
@@ -263,7 +264,9 @@ const R = `
263
264
  border-color: Highlight;
264
265
  }
265
266
  }
266
- `, M = `
267
+ `, N = `
268
+ ${D}
269
+
267
270
  .ui-menubar-portal {
268
271
  position: absolute;
269
272
  pointer-events: auto;
@@ -286,12 +289,7 @@ const R = `
286
289
  background: var(--ui-menubar-panel-bg, #fff);
287
290
  color: var(--ui-menubar-panel-color, #0f172a);
288
291
  box-shadow: var(--ui-menubar-panel-shadow);
289
- opacity: 0;
290
- transform: translateY(5px) scale(0.984);
291
- transform-origin: top left;
292
- animation: ui-menubar-panel-enter 160ms cubic-bezier(0.2, 0.9, 0.24, 1) forwards;
293
292
  outline: none;
294
- will-change: transform, opacity;
295
293
  }
296
294
 
297
295
  .ui-menubar-portal .surface[data-placement="top"] {
@@ -368,7 +366,7 @@ const R = `
368
366
  0 6px 18px rgba(2, 6, 23, 0.14);
369
367
  }
370
368
 
371
- ${D({
369
+ ${F({
372
370
  scopes: [".ui-menubar-portal .content-host"],
373
371
  prefix: "--ui-menubar-panel",
374
372
  shortcutSelectors: [".shortcut", ".meta"],
@@ -487,25 +485,6 @@ const R = `
487
485
  opacity: 0.72;
488
486
  }
489
487
 
490
- @keyframes ui-menubar-panel-enter {
491
- from {
492
- opacity: 0;
493
- transform: translateY(5px) scale(0.984);
494
- }
495
- to {
496
- opacity: 1;
497
- transform: translateY(0) scale(1);
498
- }
499
- }
500
-
501
- @media (prefers-reduced-motion: reduce) {
502
- .ui-menubar-portal .surface {
503
- animation: none;
504
- opacity: 1;
505
- transform: none;
506
- }
507
- }
508
-
509
488
  @media (prefers-contrast: more) {
510
489
  .ui-menubar-portal .surface {
511
490
  border-width: 2px;
@@ -513,11 +492,11 @@ const R = `
513
492
  }
514
493
  }
515
494
  `;
516
- function $(n) {
495
+ function V(n) {
517
496
  return n === "top" || n === "left" || n === "right" ? n : "bottom";
518
497
  }
519
- function H(n) {
520
- const e = $(n);
498
+ function K(n) {
499
+ const e = V(n);
521
500
  return e === "top" ? "top" : e === "left" ? "left" : e === "right" ? "right" : "bottom";
522
501
  }
523
502
  function f(n, e) {
@@ -542,9 +521,9 @@ function _(n) {
542
521
  }
543
522
  function w(n) {
544
523
  const e = typeof n.composedPath == "function" ? n.composedPath() : [];
545
- for (const a of e)
546
- if (a instanceof HTMLElement && a.matches(l()))
547
- return a;
524
+ for (const r of e)
525
+ if (r instanceof HTMLElement && r.matches(l()))
526
+ return r;
548
527
  const t = n.target;
549
528
  return t instanceof HTMLElement ? t.closest(l()) : null;
550
529
  }
@@ -554,7 +533,7 @@ function m(n) {
554
533
  function b(n, e) {
555
534
  return n.getAttribute(e) || "";
556
535
  }
557
- class q extends E {
536
+ class G extends E {
558
537
  constructor() {
559
538
  super(), this._items = [], this._contents = [], this._itemSlot = null, this._contentSlot = null, this._uid = Math.random().toString(36).slice(2, 8), this._ignoreSelected = !1, this._open = !1, this._portalEl = null, this._portalSurfaceEl = null, this._portalContentHostEl = null, this._positioner = null, this._dismissableLayer = null, this._panelForIndex = -1, this._typeaheadBuffer = "", this._typeaheadTimer = null, this._submenuRaf = null, this._globalListenersBound = !1, this._focusIndex = -1, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onDocKeyDown = this._onDocKeyDown.bind(this), this._onDocScroll = this._onDocScroll.bind(this), this._onSlotChange = this._onSlotChange.bind(this), this._onMouseMove = this._onMouseMove.bind(this), this._onPanelPointerOver = this._onPanelPointerOver.bind(this), this._onPanelPointerLeave = this._onPanelPointerLeave.bind(this), this._onPanelFocusIn = this._onPanelFocusIn.bind(this);
560
539
  }
@@ -587,8 +566,8 @@ class q extends E {
587
566
  disconnectedCallback() {
588
567
  this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.root.removeEventListener("mousemove", this._onMouseMove), this._unbindGlobalListeners(), this._detachSlotListeners(), this._teardownPanel(), super.disconnectedCallback();
589
568
  }
590
- attributeChangedCallback(e, t, a) {
591
- if (t !== a && !(e === "selected" && this._ignoreSelected)) {
569
+ attributeChangedCallback(e, t, r) {
570
+ if (t !== r && !(e === "selected" && this._ignoreSelected)) {
592
571
  if ((e === "radius" || e === "shape") && this._syncHostVisualState(), this._syncBarA11y(), this._open && e === "placement") {
593
572
  this._rebuildPanel();
594
573
  return;
@@ -603,7 +582,7 @@ class q extends E {
603
582
  render() {
604
583
  const e = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal";
605
584
  this.setContent(`
606
- <style>${R}</style>
585
+ <style>${q}</style>
607
586
  <div class="bar" part="bar" role="menubar" aria-orientation="${e}">
608
587
  <slot name="item"></slot>
609
588
  </div>
@@ -677,9 +656,9 @@ class q extends E {
677
656
  }
678
657
  _moveIndex(e, t) {
679
658
  if (this._items.length === 0) return -1;
680
- const a = this._loopEnabled();
681
- let r = e + t;
682
- return r < 0 && (r = a ? this._items.length - 1 : 0), r >= this._items.length && (r = a ? 0 : this._items.length - 1), r;
659
+ const r = this._loopEnabled();
660
+ let a = e + t;
661
+ return a < 0 && (a = r ? this._items.length - 1 : 0), a >= this._items.length && (a = r ? 0 : this._items.length - 1), a;
683
662
  }
684
663
  _syncState() {
685
664
  this._syncStructure();
@@ -695,11 +674,11 @@ class q extends E {
695
674
  else {
696
675
  this._unbindGlobalListeners();
697
676
  const t = this._panelForIndex >= 0 ? this._panelForIndex : this._selectedIndex();
698
- this._teardownPanel(), this.dispatchEvent(new CustomEvent("close", { detail: { previous: t }, bubbles: !0 }));
677
+ this._teardownPanel(!0), this.dispatchEvent(new CustomEvent("close", { detail: { previous: t }, bubbles: !0 }));
699
678
  }
700
679
  return;
701
680
  }
702
- this._open ? (this._bindGlobalListeners(), (this._selectedIndex() !== this._panelForIndex || !this._portalEl) && this._rebuildPanel()) : (this._unbindGlobalListeners(), this._teardownPanel());
681
+ this._open ? (this._bindGlobalListeners(), (this._selectedIndex() !== this._panelForIndex || !this._portalEl) && this._rebuildPanel()) : (this._unbindGlobalListeners(), this._teardownPanel(!0));
703
682
  }
704
683
  _bindGlobalListeners() {
705
684
  this._globalListenersBound || (document.addEventListener("keydown", this._onDocKeyDown), document.addEventListener("scroll", this._onDocScroll, { passive: !0, capture: !0 }), this._globalListenersBound = !0);
@@ -715,57 +694,57 @@ class q extends E {
715
694
  getDisabled: m
716
695
  });
717
696
  this._focusIndex = t;
718
- const a = this._isOpenAttribute();
719
- this._items.forEach((r, i) => {
720
- const s = e === i, o = r.id || `ui-menubar-item-${this._uid}-${i}`, u = this._contents[i]?.id || `ui-menubar-content-${this._uid}-${i}`;
721
- r.id = o, r.setAttribute("role", "menuitem"), r.setAttribute("tabindex", i === t && !m(r) ? "0" : "-1"), r.setAttribute("aria-haspopup", "menu"), r.setAttribute("aria-expanded", s && a ? "true" : "false"), r.setAttribute("aria-controls", u), r.setAttribute("data-active", s ? "true" : "false");
722
- }), v(this._items, this._items[t] || null, { activeAttribute: null }), this._contents.forEach((r, i) => {
723
- const s = r.id || `ui-menubar-content-${this._uid}-${i}`;
724
- r.id = s, r.setAttribute("role", "menu"), r.setAttribute("tabindex", "-1"), r.setAttribute("aria-hidden", e === i && a ? "false" : "true"), this._items[i] ? r.setAttribute("aria-labelledby", this._items[i].id) : r.removeAttribute("aria-labelledby");
697
+ const r = this._isOpenAttribute();
698
+ this._items.forEach((a, i) => {
699
+ const s = e === i, o = a.id || `ui-menubar-item-${this._uid}-${i}`, u = this._contents[i]?.id || `ui-menubar-content-${this._uid}-${i}`;
700
+ a.id = o, a.setAttribute("role", "menuitem"), a.setAttribute("tabindex", i === t && !m(a) ? "0" : "-1"), a.setAttribute("aria-haspopup", "menu"), a.setAttribute("aria-expanded", s && r ? "true" : "false"), a.setAttribute("aria-controls", u), a.setAttribute("data-active", s ? "true" : "false");
701
+ }), v(this._items, this._items[t] || null, { activeAttribute: null }), this._contents.forEach((a, i) => {
702
+ const s = a.id || `ui-menubar-content-${this._uid}-${i}`;
703
+ a.id = s, a.setAttribute("role", "menu"), a.setAttribute("tabindex", "-1"), a.setAttribute("aria-hidden", e === i && r ? "false" : "true"), this._items[i] ? a.setAttribute("aria-labelledby", this._items[i].id) : a.removeAttribute("aria-labelledby");
725
704
  });
726
705
  }
727
706
  _hydratePanelItems(e) {
728
- Array.from(e.querySelectorAll(l())).forEach((a, r) => {
729
- a.getAttribute("role") || a.setAttribute("role", "menuitem"), a.hasAttribute("tabindex") || a.setAttribute("tabindex", "-1"), a.hasAttribute("data-index") || a.setAttribute("data-index", String(r)), a.classList.contains("item") || a.classList.add("item");
707
+ Array.from(e.querySelectorAll(l())).forEach((r, a) => {
708
+ r.getAttribute("role") || r.setAttribute("role", "menuitem"), r.hasAttribute("tabindex") || r.setAttribute("tabindex", "-1"), r.hasAttribute("data-index") || r.setAttribute("data-index", String(a)), r.classList.contains("item") || r.classList.add("item");
730
709
  });
731
710
  }
732
711
  _queryPanelItemsIn(e) {
733
712
  return this._panelListbox()?.queryEnabledItems({ container: e || this._panelListbox() }) || [];
734
713
  }
735
714
  _submenuFor(e) {
736
- return e.querySelector(z);
715
+ return e.querySelector(R);
737
716
  }
738
717
  _setOpenPanelBranch(e, t) {
739
- const a = this._panelListbox();
740
- if (!a || (a.querySelectorAll('[data-submenu-open="true"]').forEach((s) => s.removeAttribute("data-submenu-open")), !e)) return;
741
- const r = [];
718
+ const r = this._panelListbox();
719
+ if (!r || (r.querySelectorAll('[data-submenu-open="true"]').forEach((s) => s.removeAttribute("data-submenu-open")), !e)) return;
720
+ const a = [];
742
721
  let i = e;
743
722
  for (; i; ) {
744
723
  const s = i.closest(".submenu");
745
724
  if (!s) break;
746
725
  const o = s.parentElement;
747
726
  if (!(o instanceof HTMLElement) || !o.matches(l())) break;
748
- r.unshift(o), i = o;
727
+ a.unshift(o), i = o;
749
728
  }
750
- r.forEach((s) => s.setAttribute("data-submenu-open", "true")), t && this._submenuFor(e) && e.setAttribute("data-submenu-open", "true");
729
+ a.forEach((s) => s.setAttribute("data-submenu-open", "true")), t && this._submenuFor(e) && e.setAttribute("data-submenu-open", "true");
751
730
  }
752
731
  _openPanelSubmenu(e, t) {
753
- const a = this._submenuFor(e);
754
- if (!a || _(e)) return !1;
732
+ const r = this._submenuFor(e);
733
+ if (!r || _(e)) return !1;
755
734
  if (this._setOpenPanelBranch(e, !0), this._schedulePanelSubmenuLayout(), !t) return !0;
756
- const r = this._panelListbox()?.focusBoundary("first", {
757
- container: a,
735
+ const a = this._panelListbox()?.focusBoundary("first", {
736
+ container: r,
758
737
  focus: !0,
759
738
  owner: this._panelSurface(),
760
739
  scroll: !0
761
740
  });
762
- return r && this._setOpenPanelBranch(r, !1), !0;
741
+ return a && this._setOpenPanelBranch(a, !1), !0;
763
742
  }
764
743
  _closeParentPanelSubmenu(e) {
765
744
  const t = e.closest(".submenu");
766
745
  if (!t) return !1;
767
- const a = t.parentElement;
768
- return !(a instanceof HTMLElement) || !a.matches(l()) ? !1 : (this._focusPanelItem(a), this._setOpenPanelBranch(a, !1), a.removeAttribute("data-submenu-open"), !0);
746
+ const r = t.parentElement;
747
+ return !(r instanceof HTMLElement) || !r.matches(l()) ? !1 : (this._focusPanelItem(r), this._setOpenPanelBranch(r, !1), r.removeAttribute("data-submenu-open"), !0);
769
748
  }
770
749
  _clearPanelSubmenuState() {
771
750
  const e = this._panelListbox();
@@ -779,7 +758,7 @@ class q extends E {
779
758
  _layoutPanelSubmenus() {
780
759
  const e = this._panelListbox();
781
760
  if (!e) return;
782
- const t = window.innerWidth, a = window.innerHeight;
761
+ const t = window.innerWidth, r = window.innerHeight;
783
762
  Array.from(e.querySelectorAll('.item > .submenu, [role="menuitem"] > .submenu, [role="menuitemcheckbox"] > .submenu, [role="menuitemradio"] > .submenu, [data-menu-item] > .submenu')).forEach((i) => {
784
763
  const s = i.parentElement;
785
764
  if (!(s instanceof HTMLElement)) return;
@@ -787,7 +766,7 @@ class q extends E {
787
766
  const o = i.style.display, u = i.style.visibility, c = i.style.pointerEvents, d = i.style.opacity, P = i.style.transform;
788
767
  i.style.display = "grid", i.style.visibility = "hidden", i.style.pointerEvents = "none", i.style.opacity = "0", i.style.transform = "none";
789
768
  const p = s.getBoundingClientRect(), h = i.getBoundingClientRect();
790
- p.right + 4 + h.width > t - 8 && p.left - 4 - h.width >= 8 && s.setAttribute("data-submenu-side", "left"), p.top + h.height > a - 8 && p.bottom - h.height >= 8 && s.setAttribute("data-submenu-align", "up"), i.style.display = o, i.style.visibility = u, i.style.pointerEvents = c, i.style.opacity = d, i.style.transform = P;
769
+ p.right + 4 + h.width > t - 8 && p.left - 4 - h.width >= 8 && s.setAttribute("data-submenu-side", "left"), p.top + h.height > r - 8 && p.bottom - h.height >= 8 && s.setAttribute("data-submenu-align", "up"), i.style.display = o, i.style.visibility = u, i.style.pointerEvents = c, i.style.opacity = d, i.style.transform = P;
791
770
  });
792
771
  }
793
772
  _panelListbox() {
@@ -797,25 +776,25 @@ class q extends E {
797
776
  return this._portalSurfaceEl;
798
777
  }
799
778
  _buildPanelContent(e) {
800
- const t = this._contents[e], a = document.createElement("div");
801
- a.className = "ui-menubar-portal", a.style.position = "absolute", a.style.pointerEvents = "auto", a.innerHTML = `
802
- <style>${M}</style>
779
+ const t = this._contents[e], r = document.createElement("div");
780
+ r.className = "ui-menubar-portal", r.style.position = "absolute", r.style.pointerEvents = "auto", r.innerHTML = `
781
+ <style>${N}</style>
803
782
  <div class="surface menu-panel" part="menu" role="menu" aria-hidden="false" aria-busy="false" tabindex="-1">
804
783
  <div class="state-row" part="state"></div>
805
784
  <ui-listbox class="content-host" slot="menu" role="menu" item-selector="${l().replace(/"/g, "&quot;")}" direct-item-selector=":scope > [slot=&quot;menu&quot;] > ${l().replace(/"/g, "&quot;")}" item-role="menuitem" active-attribute="data-active"></ui-listbox>
806
785
  </div>
807
786
  `;
808
- const r = a.querySelector("ui-listbox.content-host"), i = a.querySelector(".surface");
809
- if (!r || !i) return a;
810
- if (i.id = t?.id || `ui-menubar-panel-${this._uid}-${e}`, i.setAttribute("aria-labelledby", this._items[e]?.id || ""), this._applyPanelVariantData(a), this._applyPanelTokens(a), t) {
787
+ const a = r.querySelector("ui-listbox.content-host"), i = r.querySelector(".surface");
788
+ if (!a || !i) return r;
789
+ if (i.id = t?.id || `ui-menubar-panel-${this._uid}-${e}`, i.setAttribute("aria-labelledby", this._items[e]?.id || ""), this._applyPanelVariantData(r), this._applyPanelTokens(r), t) {
811
790
  const s = t.cloneNode(!0);
812
- s.setAttribute("slot", "menu"), r.appendChild(s);
791
+ s.setAttribute("slot", "menu"), a.appendChild(s);
813
792
  }
814
- if (this._hydratePanelItems(r), r.refresh(), !r.querySelector(l())) {
793
+ if (this._hydratePanelItems(a), a.refresh(), !a.querySelector(l())) {
815
794
  const s = document.createElement("div");
816
- s.className = "empty-state", s.textContent = "No items", r.appendChild(s);
795
+ s.className = "empty-state", s.textContent = "No items", a.appendChild(s);
817
796
  }
818
- return a.addEventListener("click", (s) => {
797
+ return r.addEventListener("click", (s) => {
819
798
  const o = w(s);
820
799
  if (!o || _(o)) return;
821
800
  if (this._submenuFor(o)) {
@@ -837,11 +816,11 @@ class q extends E {
837
816
  bubbles: !0
838
817
  })
839
818
  ), this.closeOnSelect ? this.close() : this._focusPanelItem(o);
840
- }), a.addEventListener("pointerover", this._onPanelPointerOver), a.addEventListener("pointerleave", this._onPanelPointerLeave), a.addEventListener("focusin", this._onPanelFocusIn), a;
819
+ }), r.addEventListener("pointerover", this._onPanelPointerOver), r.addEventListener("pointerleave", this._onPanelPointerLeave), r.addEventListener("focusin", this._onPanelFocusIn), r;
841
820
  }
842
821
  _applyPanelVariantData(e) {
843
- const t = b(this, "variant"), a = O(this.getAttribute("size") || this.getAttribute("density")), r = b(this, "density"), i = this.getAttribute("radius"), s = b(this, "shape"), o = b(this, "elevation"), u = b(this, "tone"), c = t === "default" || t === "" ? "" : t === "glass" ? "soft" : t === "line" ? "outline" : t;
844
- c ? e.setAttribute("data-variant", c) : e.removeAttribute("data-variant"), a !== "md" ? e.setAttribute("data-size", a) : e.removeAttribute("data-size"), r && r !== "default" ? e.setAttribute("data-density", r) : e.removeAttribute("data-density"), i ? e.setAttribute("data-radius", i) : e.removeAttribute("data-radius"), s && s !== "default" ? e.setAttribute("data-shape", s) : e.removeAttribute("data-shape"), o && o !== "default" ? e.setAttribute("data-elevation", o) : e.removeAttribute("data-elevation"), u && u !== "default" && u !== "brand" ? e.setAttribute("data-tone", u) : e.removeAttribute("data-tone"), this._open ? e.setAttribute("data-open", "true") : e.removeAttribute("data-open");
822
+ const t = b(this, "variant"), r = H(this.getAttribute("size") || this.getAttribute("density")), a = b(this, "density"), i = this.getAttribute("radius"), s = b(this, "shape"), o = b(this, "elevation"), u = b(this, "tone"), c = t === "default" || t === "" ? "" : t === "glass" ? "soft" : t === "line" ? "outline" : t;
823
+ c ? e.setAttribute("data-variant", c) : e.removeAttribute("data-variant"), r !== "md" ? e.setAttribute("data-size", r) : e.removeAttribute("data-size"), a && a !== "default" ? e.setAttribute("data-density", a) : e.removeAttribute("data-density"), i ? e.setAttribute("data-radius", i) : e.removeAttribute("data-radius"), s && s !== "default" ? e.setAttribute("data-shape", s) : e.removeAttribute("data-shape"), o && o !== "default" ? e.setAttribute("data-elevation", o) : e.removeAttribute("data-elevation"), u && u !== "default" && u !== "brand" ? e.setAttribute("data-tone", u) : e.removeAttribute("data-tone"), this._open ? e.setAttribute("data-open", "true") : e.removeAttribute("data-open");
845
824
  const d = S(i || s || null);
846
825
  d ? (e.style.setProperty("--ui-menubar-panel-radius", d), e.style.setProperty("--ui-menubar-panel-item-radius", d === "999px" ? "999px" : `calc(${d} - 2px)`)) : (e.style.removeProperty("--ui-menubar-panel-radius"), e.style.removeProperty("--ui-menubar-panel-item-radius"));
847
826
  }
@@ -902,15 +881,15 @@ class q extends E {
902
881
  "--ui-menubar-panel-separator-margin",
903
882
  "--ui-menubar-panel-item-hover-bg",
904
883
  "--ui-menubar-panel-item-active-color"
905
- ].forEach((r) => {
906
- const i = t.getPropertyValue(r).trim();
907
- i ? e.style.setProperty(r, i) : e.style.removeProperty(r);
908
- }), B.forEach((r) => {
909
- const i = t.getPropertyValue(r).trim();
910
- i ? e.style.setProperty(r, i) : e.style.removeProperty(r);
911
- }), F.forEach(({ prefix: r, from: i, to: s }) => {
884
+ ].forEach((a) => {
885
+ const i = t.getPropertyValue(a).trim();
886
+ i ? e.style.setProperty(a, i) : e.style.removeProperty(a);
887
+ }), M.forEach((a) => {
888
+ const i = t.getPropertyValue(a).trim();
889
+ i ? e.style.setProperty(a, i) : e.style.removeProperty(a);
890
+ }), $.forEach(({ prefix: a, from: i, to: s }) => {
912
891
  for (let o = i; o <= s; o += 1) {
913
- const u = `${r}${o}`, c = t.getPropertyValue(u).trim();
892
+ const u = `${a}${o}`, c = t.getPropertyValue(u).trim();
914
893
  c ? e.style.setProperty(u, c) : e.style.removeProperty(u);
915
894
  }
916
895
  });
@@ -921,8 +900,8 @@ class q extends E {
921
900
  this._setPanelFlag("open", this._open), this._applyPanelVariantData(e), this._applyPanelTokens(e);
922
901
  const t = this._panelSurface();
923
902
  t && (t.setAttribute("aria-hidden", "false"), t.setAttribute("aria-busy", "false"), t.removeAttribute("hidden"), t.style.display = "block", t.style.visibility = "visible", t.style.opacity = "1", t.style.transform = "translateY(0px) scale(1)", t.style.pointerEvents = "auto");
924
- const a = e.querySelector(".state-row");
925
- a && (a.textContent = ""), this._schedulePanelSubmenuLayout();
903
+ const r = e.querySelector(".state-row");
904
+ r && (r.textContent = ""), this._schedulePanelSubmenuLayout();
926
905
  }
927
906
  _rebuildPanel() {
928
907
  if (!this._open) return;
@@ -932,43 +911,38 @@ class q extends E {
932
911
  return;
933
912
  }
934
913
  this._teardownPanel();
935
- const a = this._buildPanelContent(e);
936
- this._portalEl = a, this._portalSurfaceEl = a.querySelector(".surface"), this._portalContentHostEl = a.querySelector("ui-listbox.content-host"), this._panelForIndex = e;
937
- const r = k();
938
- if (!r) {
914
+ const r = this._buildPanelContent(e);
915
+ this._portalEl = r, this._portalSurfaceEl = r.querySelector(".surface"), this._portalContentHostEl = r.querySelector("ui-listbox.content-host"), this._panelForIndex = e;
916
+ const a = k();
917
+ if (!a) {
939
918
  this._portalEl = null, this._panelForIndex = -1;
940
919
  return;
941
920
  }
942
- r.appendChild(a), this._positioner = T({
921
+ a.appendChild(r), this._positioner = T({
943
922
  anchor: t,
944
- floating: this._panelSurface() || a,
945
- placement: H(this.getAttribute("placement")),
923
+ floating: this._panelSurface() || r,
924
+ placement: K(this.getAttribute("placement")),
946
925
  offset: 6,
947
926
  flip: !0,
948
927
  shift: !0,
949
928
  fitViewport: !0,
950
929
  observeScroll: !1
951
930
  }), this._dismissableLayer = I({
952
- node: this._panelSurface() || a,
931
+ node: this._panelSurface() || r,
953
932
  trigger: t,
954
933
  closeOnEscape: !0,
955
934
  closeOnPointerOutside: !0,
956
935
  onDismiss: () => this.close()
957
- });
936
+ }), z(this._panelSurface() || r);
958
937
  }
959
- _teardownPanel() {
960
- if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._positioner?.destroy(), this._positioner = null, this._portalEl?.parentElement)
961
- try {
962
- this._portalEl.parentElement.removeChild(this._portalEl);
963
- } catch {
964
- }
965
- this._portalEl = null, this._portalSurfaceEl = null, this._portalContentHostEl = null, this._panelForIndex = -1, this._submenuRaf != null && (cancelAnimationFrame(this._submenuRaf), this._submenuRaf = null), this._resetTypeahead();
938
+ _teardownPanel(e = !1) {
939
+ this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._positioner?.destroy(), this._positioner = null, e ? O(this._portalEl) : B(this._portalEl), this._portalEl = null, this._portalSurfaceEl = null, this._portalContentHostEl = null, this._panelForIndex = -1, this._submenuRaf != null && (cancelAnimationFrame(this._submenuRaf), this._submenuRaf = null), this._resetTypeahead();
966
940
  }
967
941
  _selectIndex(e, t) {
968
- const a = this._selectedIndex(), r = A(e, this._items.length);
969
- r < 0 || (this._setSelectedAttribute(r), this.setAttribute("open", ""), this._syncState(), this.dispatchEvent(
942
+ const r = this._selectedIndex(), a = A(e, this._items.length);
943
+ a < 0 || (this._setSelectedAttribute(a), this.setAttribute("open", ""), this._syncState(), this.dispatchEvent(
970
944
  new CustomEvent("change", {
971
- detail: { selected: r, previous: a, open: !0, reason: t },
945
+ detail: { selected: a, previous: r, open: !0, reason: t },
972
946
  bubbles: !0
973
947
  })
974
948
  ));
@@ -990,9 +964,9 @@ class q extends E {
990
964
  this._panelListbox()?.focusBoundary("last", { focus: !0, owner: this._panelSurface(), scroll: !0 });
991
965
  }
992
966
  _movePanelFocus(e) {
993
- const t = document.activeElement, r = (t && this._portalEl?.contains(t) ? t.closest(l()) : null)?.closest(".submenu") || this._panelListbox();
967
+ const t = document.activeElement, a = (t && this._portalEl?.contains(t) ? t.closest(l()) : null)?.closest(".submenu") || this._panelListbox();
994
968
  this._panelListbox()?.move(e, {
995
- container: r,
969
+ container: a,
996
970
  current: t && this._portalEl?.contains(t) ? t : null,
997
971
  focus: !0,
998
972
  owner: this._panelSurface(),
@@ -1008,19 +982,19 @@ class q extends E {
1008
982
  _typeaheadOnBar(e) {
1009
983
  if (!this.typeahead || !this._isTypeaheadKey(e)) return !1;
1010
984
  this._typeaheadBuffer = `${this._typeaheadBuffer}${e.key.toLowerCase()}`.slice(0, 24), this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => this._resetTypeahead(), 420);
1011
- const t = this._items.findIndex((r) => r === e.target || r.contains(e.target)), a = L(this._items, this._typeaheadBuffer, {
985
+ const t = this._items.findIndex((a) => a === e.target || a.contains(e.target)), r = L(this._items, this._typeaheadBuffer, {
1012
986
  startIndex: t,
1013
- getLabel: (r) => r.getAttribute("aria-label") || r.textContent || "",
987
+ getLabel: (a) => a.getAttribute("aria-label") || a.textContent || "",
1014
988
  getDisabled: m
1015
989
  });
1016
- return a < 0 ? !1 : (e.preventDefault(), this._focusItem(a), this._open && this._selectIndex(a, "keyboard"), !0);
990
+ return r < 0 ? !1 : (e.preventDefault(), this._focusItem(r), this._open && this._selectIndex(r, "keyboard"), !0);
1017
991
  }
1018
992
  _typeaheadOnPanel(e) {
1019
993
  if (!this.typeahead || !this._isTypeaheadKey(e)) return !1;
1020
994
  this._typeaheadBuffer = `${this._typeaheadBuffer}${e.key.toLowerCase()}`.slice(0, 24), this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => this._resetTypeahead(), 420);
1021
- const t = document.activeElement, r = (t && this._portalEl?.contains(t) ? t.closest(l()) : null)?.closest(".submenu") || this._panelListbox();
995
+ const t = document.activeElement, a = (t && this._portalEl?.contains(t) ? t.closest(l()) : null)?.closest(".submenu") || this._panelListbox();
1022
996
  return this._panelListbox()?.typeahead(this._typeaheadBuffer, {
1023
- container: r,
997
+ container: a,
1024
998
  current: t && this._portalEl?.contains(t) ? t : null,
1025
999
  focus: !0,
1026
1000
  owner: this._panelSurface(),
@@ -1035,32 +1009,32 @@ class q extends E {
1035
1009
  return;
1036
1010
  }
1037
1011
  if (t !== "menuitemradio") return;
1038
- const a = e.closest(".submenu") || this._panelListbox();
1039
- if (!a) return;
1040
- const r = e.getAttribute("data-group") || e.getAttribute("name") || "";
1041
- Array.from(a.querySelectorAll('[role="menuitemradio"]')).forEach((s) => {
1042
- r && (s.getAttribute("data-group") || s.getAttribute("name") || "") !== r || (s.setAttribute("aria-checked", "false"), s.setAttribute("data-state", "unchecked"));
1012
+ const r = e.closest(".submenu") || this._panelListbox();
1013
+ if (!r) return;
1014
+ const a = e.getAttribute("data-group") || e.getAttribute("name") || "";
1015
+ Array.from(r.querySelectorAll('[role="menuitemradio"]')).forEach((s) => {
1016
+ a && (s.getAttribute("data-group") || s.getAttribute("name") || "") !== a || (s.setAttribute("aria-checked", "false"), s.setAttribute("data-state", "unchecked"));
1043
1017
  }), e.setAttribute("aria-checked", "true"), e.setAttribute("data-state", "checked");
1044
1018
  }
1045
1019
  _onClick(e) {
1046
- const t = e.composedPath(), a = this._items.findIndex((i) => t.includes(i));
1047
- if (a < 0) return;
1048
- if (this._focusItem(a), this._selectedIndex() === a && this._open) {
1020
+ const t = e.composedPath(), r = this._items.findIndex((i) => t.includes(i));
1021
+ if (r < 0) return;
1022
+ if (this._focusItem(r), this._selectedIndex() === r && this._open) {
1049
1023
  this.close(), this._syncState();
1050
1024
  return;
1051
1025
  }
1052
- this._selectIndex(a, "click");
1026
+ this._selectIndex(r, "click");
1053
1027
  }
1054
1028
  _onMouseMove(e) {
1055
1029
  if (!this._open) return;
1056
- const t = e.composedPath(), a = this._items.findIndex((r) => t.includes(r));
1057
- a < 0 || a !== this._selectedIndex() && this._selectIndex(a, "programmatic");
1030
+ const t = e.composedPath(), r = this._items.findIndex((a) => t.includes(a));
1031
+ r < 0 || r !== this._selectedIndex() && this._selectIndex(r, "programmatic");
1058
1032
  }
1059
1033
  _isInternalScrollEvent(e) {
1060
1034
  const t = typeof e.composedPath == "function" ? e.composedPath() : [];
1061
- if (this._portalEl && t.includes(this._portalEl) || this._items.some((r) => t.includes(r))) return !0;
1062
- const a = e.target;
1063
- return !!(a instanceof Node && (this._portalEl?.contains(a) || this._items.some((r) => r.contains(a))));
1035
+ if (this._portalEl && t.includes(this._portalEl) || this._items.some((a) => t.includes(a))) return !0;
1036
+ const r = e.target;
1037
+ return !!(r instanceof Node && (this._portalEl?.contains(r) || this._items.some((a) => a.contains(r))));
1064
1038
  }
1065
1039
  _onDocScroll(e) {
1066
1040
  !this._open || !this.closeOnScroll || this._isInternalScrollEvent(e) || this.close();
@@ -1069,9 +1043,9 @@ class q extends E {
1069
1043
  if (!this._open) return;
1070
1044
  const t = w(e);
1071
1045
  if (!t || _(t)) return;
1072
- const a = t.closest(".submenu") || this._panelListbox();
1046
+ const r = t.closest(".submenu") || this._panelListbox();
1073
1047
  this._panelListbox()?.setActiveItem(t, {
1074
- container: a,
1048
+ container: r,
1075
1049
  focus: !1,
1076
1050
  owner: this._panelSurface(),
1077
1051
  scroll: !1
@@ -1085,28 +1059,28 @@ class q extends E {
1085
1059
  _onPanelFocusIn(e) {
1086
1060
  const t = e.target;
1087
1061
  if (!(t instanceof HTMLElement)) return;
1088
- const a = t.closest(l());
1089
- a && (this._submenuFor(a) ? this._setOpenPanelBranch(a, !0) : this._setOpenPanelBranch(a, !1));
1062
+ const r = t.closest(l());
1063
+ r && (this._submenuFor(r) ? this._setOpenPanelBranch(r, !0) : this._setOpenPanelBranch(r, !1));
1090
1064
  }
1091
1065
  _onKeyDown(e) {
1092
1066
  const t = this._items.findIndex((o) => o === e.target || o.contains(e.target));
1093
1067
  if (t < 0) return;
1094
- const a = getComputedStyle(this).direction === "rtl" ? "rtl" : "ltr";
1095
- let r = !1, i = t;
1068
+ const r = getComputedStyle(this).direction === "rtl" ? "rtl" : "ltr";
1069
+ let a = !1, i = t;
1096
1070
  const s = g(this._items, {
1097
1071
  activeIndex: t,
1098
1072
  selectedIndex: this._selectedIndex(),
1099
1073
  getDisabled: m
1100
1074
  });
1101
- e.key === "ArrowRight" ? (i = y(this._items, t, a === "rtl" ? -1 : 1, {
1075
+ e.key === "ArrowRight" ? (i = y(this._items, t, r === "rtl" ? -1 : 1, {
1102
1076
  wrap: this._loopEnabled(),
1103
1077
  fallbackIndex: s,
1104
1078
  getDisabled: m
1105
- }), r = !0) : e.key === "ArrowLeft" ? (i = y(this._items, t, a === "rtl" ? 1 : -1, {
1079
+ }), a = !0) : e.key === "ArrowLeft" ? (i = y(this._items, t, r === "rtl" ? 1 : -1, {
1106
1080
  wrap: this._loopEnabled(),
1107
1081
  fallbackIndex: s,
1108
1082
  getDisabled: m
1109
- }), r = !0) : e.key === "Home" ? (i = x(this._items, "first", m), r = !0) : e.key === "End" ? (i = x(this._items, "last", m), r = !0) : e.key === "Enter" || e.key === " " ? (this._selectIndex(t, "keyboard"), r = !0) : e.key === "ArrowDown" ? (this._selectIndex(t, "keyboard"), setTimeout(() => this._focusPanelFirst(), 0), r = !0) : e.key === "ArrowUp" && (this._selectIndex(t, "keyboard"), setTimeout(() => this._focusPanelLast(), 0), r = !0), !(!r && this._typeaheadOnBar(e)) && r && (e.preventDefault(), i >= 0 && i !== t && (this._focusItem(i), this._open && this._selectIndex(i, "keyboard")));
1083
+ }), a = !0) : e.key === "Home" ? (i = x(this._items, "first", m), a = !0) : e.key === "End" ? (i = x(this._items, "last", m), a = !0) : e.key === "Enter" || e.key === " " ? (this._selectIndex(t, "keyboard"), a = !0) : e.key === "ArrowDown" ? (this._selectIndex(t, "keyboard"), setTimeout(() => this._focusPanelFirst(), 0), a = !0) : e.key === "ArrowUp" && (this._selectIndex(t, "keyboard"), setTimeout(() => this._focusPanelLast(), 0), a = !0), !(!a && this._typeaheadOnBar(e)) && a && (e.preventDefault(), i >= 0 && i !== t && (this._focusItem(i), this._open && this._selectIndex(i, "keyboard")));
1110
1084
  }
1111
1085
  _onDocKeyDown(e) {
1112
1086
  if (!this._open || !(!!this._portalEl && e.composedPath().includes(this._portalEl)) || this._typeaheadOnPanel(e)) return;
@@ -1126,12 +1100,12 @@ class q extends E {
1126
1100
  e.preventDefault(), this._focusPanelLast();
1127
1101
  return;
1128
1102
  }
1129
- const a = document.activeElement, r = a?.closest(l());
1130
- if (e.key === "ArrowRight" && r && this._openPanelSubmenu(r, !0)) {
1103
+ const r = document.activeElement, a = r?.closest(l());
1104
+ if (e.key === "ArrowRight" && a && this._openPanelSubmenu(a, !0)) {
1131
1105
  e.preventDefault();
1132
1106
  return;
1133
1107
  }
1134
- if (e.key === "ArrowLeft" && r && this._closeParentPanelSubmenu(r)) {
1108
+ if (e.key === "ArrowLeft" && a && this._closeParentPanelSubmenu(a)) {
1135
1109
  e.preventDefault();
1136
1110
  return;
1137
1111
  }
@@ -1140,15 +1114,15 @@ class q extends E {
1140
1114
  return;
1141
1115
  }
1142
1116
  if (e.key === "Enter" || e.key === " ") {
1143
- if (!a || !this._portalEl?.contains(a) || !r || _(r) || (e.preventDefault(), this._openPanelSubmenu(r, !0))) return;
1144
- r.click();
1117
+ if (!r || !this._portalEl?.contains(r) || !a || _(a) || (e.preventDefault(), this._openPanelSubmenu(a, !0))) return;
1118
+ a.click();
1145
1119
  }
1146
1120
  }
1147
- shouldRenderOnAttributeChange(e, t, a) {
1121
+ shouldRenderOnAttributeChange(e, t, r) {
1148
1122
  return !1;
1149
1123
  }
1150
1124
  }
1151
- typeof customElements < "u" && !customElements.get("ui-menubar") && customElements.define("ui-menubar", q);
1125
+ typeof customElements < "u" && !customElements.get("ui-menubar") && customElements.define("ui-menubar", G);
1152
1126
  export {
1153
- q as UIMenubar
1127
+ G as UIMenubar
1154
1128
  };