@editora/ui-core 0.1.20 → 0.1.22

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 (290) hide show
  1. package/dist/accordion.cjs.js +3 -3
  2. package/dist/accordion.esm.js +3 -3
  3. package/dist/alert-dialog.cjs.js +32 -32
  4. package/dist/alert-dialog.esm.js +95 -75
  5. package/dist/alert.cjs.js +6 -6
  6. package/dist/alert.esm.js +6 -6
  7. package/dist/animated-list.cjs.js +4 -4
  8. package/dist/animated-list.esm.js +4 -4
  9. package/dist/animated-text.cjs.js +4 -4
  10. package/dist/animated-text.esm.js +4 -4
  11. package/dist/app-header.cjs.js +3 -3
  12. package/dist/app-header.esm.js +3 -3
  13. package/dist/aspect-ratio.cjs.js +3 -3
  14. package/dist/aspect-ratio.esm.js +3 -3
  15. package/dist/avatar.cjs.js +14 -14
  16. package/dist/avatar.esm.js +31 -29
  17. package/dist/badge.cjs.js +4 -4
  18. package/dist/badge.esm.js +4 -4
  19. package/dist/block-controls.cjs.js +4 -4
  20. package/dist/block-controls.esm.js +4 -4
  21. package/dist/box.cjs.js +2 -2
  22. package/dist/box.esm.js +2 -2
  23. package/dist/breadcrumb.cjs.js +5 -5
  24. package/dist/breadcrumb.esm.js +5 -5
  25. package/dist/button.cjs.js +1 -1
  26. package/dist/button.esm.js +1 -1
  27. package/dist/{calendar-DLY4acgn.mjs → calendar-DbxYRdlv.mjs} +227 -183
  28. package/dist/{calendar-Dkof-FTK.js → calendar-Qa-cFOp3.js} +74 -35
  29. package/dist/calendar.cjs.js +1 -1
  30. package/dist/calendar.esm.js +1 -1
  31. package/dist/card.cjs.js +8 -8
  32. package/dist/card.esm.js +63 -20
  33. package/dist/chart.cjs.js +4 -4
  34. package/dist/chart.esm.js +6 -6
  35. package/dist/checkbox.cjs.js +2 -2
  36. package/dist/checkbox.esm.js +2 -2
  37. package/dist/collapsible.cjs.js +7 -7
  38. package/dist/collapsible.esm.js +7 -7
  39. package/dist/collection.cjs.js +1 -1
  40. package/dist/collection.esm.js +27 -23
  41. package/dist/color-picker.cjs.js +34 -14
  42. package/dist/color-picker.esm.js +89 -67
  43. package/dist/combobox.cjs.js +29 -27
  44. package/dist/combobox.esm.js +51 -45
  45. package/dist/command.cjs.js +2 -2
  46. package/dist/command.esm.js +2 -2
  47. package/dist/components/ui-alert-dialog.d.ts +1 -0
  48. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  49. package/dist/components/ui-avatar.d.ts +1 -0
  50. package/dist/components/ui-avatar.d.ts.map +1 -1
  51. package/dist/components/ui-button.d.ts +1 -0
  52. package/dist/components/ui-button.d.ts.map +1 -1
  53. package/dist/components/ui-calendar.d.ts.map +1 -1
  54. package/dist/components/ui-card.d.ts +3 -0
  55. package/dist/components/ui-card.d.ts.map +1 -1
  56. package/dist/components/ui-checkbox.d.ts.map +1 -1
  57. package/dist/components/ui-collection.d.ts.map +1 -1
  58. package/dist/components/ui-color-picker.d.ts.map +1 -1
  59. package/dist/components/ui-combobox.d.ts.map +1 -1
  60. package/dist/components/ui-data-table.d.ts.map +1 -1
  61. package/dist/components/ui-date-field.d.ts.map +1 -1
  62. package/dist/components/ui-date-picker.d.ts.map +1 -1
  63. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  64. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  65. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  66. package/dist/components/ui-dock.d.ts +1 -0
  67. package/dist/components/ui-dock.d.ts.map +1 -1
  68. package/dist/components/ui-drawer.d.ts.map +1 -1
  69. package/dist/components/ui-dropdown.d.ts.map +1 -1
  70. package/dist/components/ui-field.d.ts.map +1 -1
  71. package/dist/components/ui-file-upload.d.ts.map +1 -1
  72. package/dist/components/ui-gantt.d.ts.map +1 -1
  73. package/dist/components/ui-input.d.ts.map +1 -1
  74. package/dist/components/ui-menu.d.ts.map +1 -1
  75. package/dist/components/ui-multi-select.d.ts.map +1 -1
  76. package/dist/components/ui-number-field.d.ts.map +1 -1
  77. package/dist/components/ui-password-field.d.ts.map +1 -1
  78. package/dist/components/ui-pin-input.d.ts +1 -0
  79. package/dist/components/ui-pin-input.d.ts.map +1 -1
  80. package/dist/components/ui-placement-grid.d.ts.map +1 -1
  81. package/dist/components/ui-portal.d.ts.map +1 -1
  82. package/dist/components/ui-positioner.d.ts.map +1 -1
  83. package/dist/components/ui-progress.d.ts.map +1 -1
  84. package/dist/components/ui-radio.d.ts.map +1 -1
  85. package/dist/components/ui-rating.d.ts +1 -0
  86. package/dist/components/ui-rating.d.ts.map +1 -1
  87. package/dist/components/ui-select.d.ts.map +1 -1
  88. package/dist/components/ui-sortable.d.ts +8 -0
  89. package/dist/components/ui-sortable.d.ts.map +1 -1
  90. package/dist/components/ui-switch.d.ts.map +1 -1
  91. package/dist/components/ui-table.d.ts.map +1 -1
  92. package/dist/components/ui-tabs.d.ts +1 -0
  93. package/dist/components/ui-tabs.d.ts.map +1 -1
  94. package/dist/components/ui-tags-input.d.ts +1 -0
  95. package/dist/components/ui-tags-input.d.ts.map +1 -1
  96. package/dist/components/ui-textarea.d.ts.map +1 -1
  97. package/dist/components/ui-time-field.d.ts.map +1 -1
  98. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  99. package/dist/components/ui-toggle.d.ts.map +1 -1
  100. package/dist/components/ui-tree.d.ts.map +1 -1
  101. package/dist/components/ui-wizard.d.ts.map +1 -1
  102. package/dist/context-menu.cjs.js +3 -3
  103. package/dist/context-menu.esm.js +4 -4
  104. package/dist/control-name-BmoI1m3a.js +1 -0
  105. package/dist/control-name-Bpj7F34X.mjs +48 -0
  106. package/dist/data-table.cjs.js +5 -2
  107. package/dist/data-table.esm.js +145 -142
  108. package/dist/date-field.cjs.js +5 -5
  109. package/dist/date-field.esm.js +34 -31
  110. package/dist/date-picker.cjs.js +16 -16
  111. package/dist/date-picker.esm.js +48 -44
  112. package/dist/date-range-picker.cjs.js +5 -5
  113. package/dist/date-range-picker.esm.js +120 -118
  114. package/dist/date-range-time-picker.cjs.js +22 -22
  115. package/dist/date-range-time-picker.esm.js +88 -84
  116. package/dist/date-time-picker.cjs.js +26 -26
  117. package/dist/date-time-picker.esm.js +105 -101
  118. package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-BzfTpeU-.js} +1 -1
  119. package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-Cps2aSu2.mjs} +1 -1
  120. package/dist/description.cjs.js +3 -3
  121. package/dist/description.esm.js +3 -3
  122. package/dist/dialog.cjs.js +2 -2
  123. package/dist/dialog.esm.js +2 -2
  124. package/dist/dock.cjs.js +12 -12
  125. package/dist/dock.esm.js +72 -74
  126. package/dist/drawer.cjs.js +19 -19
  127. package/dist/drawer.esm.js +58 -58
  128. package/dist/dropdown.cjs.js +13 -13
  129. package/dist/dropdown.esm.js +49 -48
  130. package/dist/empty-state.cjs.js +3 -3
  131. package/dist/empty-state.esm.js +3 -3
  132. package/dist/field-error.cjs.js +1 -1
  133. package/dist/field-error.esm.js +1 -1
  134. package/dist/field.cjs.js +12 -12
  135. package/dist/field.esm.js +84 -75
  136. package/dist/fieldset.cjs.js +4 -4
  137. package/dist/fieldset.esm.js +4 -4
  138. package/dist/file-upload.cjs.js +3 -3
  139. package/dist/file-upload.esm.js +5 -3
  140. package/dist/floating-toolbar.cjs.js +8 -8
  141. package/dist/floating-toolbar.esm.js +9 -9
  142. package/dist/form.cjs.js +11 -11
  143. package/dist/form.esm.js +11 -11
  144. package/dist/gantt.cjs.js +43 -32
  145. package/dist/gantt.esm.js +99 -88
  146. package/dist/icon-cloud.cjs.js +3 -3
  147. package/dist/icon-cloud.esm.js +3 -3
  148. package/dist/icon.cjs.js +1 -1
  149. package/dist/icon.esm.js +1 -1
  150. package/dist/index.cjs.js +1 -1
  151. package/dist/index.esm.js +121 -118
  152. package/dist/inline-edit.cjs.js +1 -1
  153. package/dist/inline-edit.esm.js +1 -1
  154. package/dist/input.cjs.js +14 -14
  155. package/dist/input.esm.js +39 -32
  156. package/dist/label.cjs.js +3 -3
  157. package/dist/label.esm.js +3 -3
  158. package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
  159. package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
  160. package/dist/listbox.cjs.js +1 -1
  161. package/dist/listbox.esm.js +1 -1
  162. package/dist/marquee.cjs.js +3 -3
  163. package/dist/marquee.esm.js +3 -3
  164. package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
  165. package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
  166. package/dist/menu.cjs.js +7 -7
  167. package/dist/menu.esm.js +29 -28
  168. package/dist/menubar.cjs.js +1 -1
  169. package/dist/menubar.esm.js +2 -2
  170. package/dist/meter.cjs.js +1 -1
  171. package/dist/meter.esm.js +1 -1
  172. package/dist/multi-select.cjs.js +18 -18
  173. package/dist/multi-select.esm.js +82 -66
  174. package/dist/navigation-menu.cjs.js +1 -1
  175. package/dist/navigation-menu.esm.js +1 -1
  176. package/dist/number-field.cjs.js +11 -13
  177. package/dist/number-field.esm.js +29 -27
  178. package/dist/number-ticker.cjs.js +4 -4
  179. package/dist/number-ticker.esm.js +4 -4
  180. package/dist/odometer.cjs.js +2 -2
  181. package/dist/odometer.esm.js +2 -2
  182. package/dist/orbiter.cjs.js +3 -3
  183. package/dist/orbiter.esm.js +3 -3
  184. package/dist/pagination.cjs.js +1 -1
  185. package/dist/pagination.esm.js +1 -1
  186. package/dist/password-field.cjs.js +23 -23
  187. package/dist/password-field.esm.js +48 -47
  188. package/dist/pin-input.cjs.js +8 -6
  189. package/dist/pin-input.esm.js +21 -15
  190. package/dist/placement-grid.cjs.js +4 -4
  191. package/dist/placement-grid.esm.js +58 -58
  192. package/dist/plugin-panel.cjs.js +1 -1
  193. package/dist/plugin-panel.esm.js +1 -1
  194. package/dist/popover.cjs.js +5 -5
  195. package/dist/popover.esm.js +4 -4
  196. package/dist/portal.cjs.js +3 -3
  197. package/dist/portal.esm.js +11 -10
  198. package/dist/positioner.cjs.js +2 -2
  199. package/dist/positioner.esm.js +15 -14
  200. package/dist/primitives/auto-scroll.d.ts +9 -0
  201. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  202. package/dist/primitives/control-name.d.ts +30 -0
  203. package/dist/primitives/control-name.d.ts.map +1 -0
  204. package/dist/primitives/selector.d.ts +4 -0
  205. package/dist/primitives/selector.d.ts.map +1 -0
  206. package/dist/primitives/trigger.d.ts +2 -0
  207. package/dist/primitives/trigger.d.ts.map +1 -0
  208. package/dist/progress.cjs.js +4 -4
  209. package/dist/progress.esm.js +20 -18
  210. package/dist/quick-actions.cjs.js +3 -3
  211. package/dist/quick-actions.esm.js +3 -3
  212. package/dist/radio-group.cjs.js +1 -1
  213. package/dist/radio-group.esm.js +1 -1
  214. package/dist/radio.cjs.js +2 -2
  215. package/dist/radio.esm.js +2 -2
  216. package/dist/rating.cjs.js +17 -16
  217. package/dist/rating.esm.js +91 -92
  218. package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
  219. package/dist/runtime-DwE-tizc.js +1 -0
  220. package/dist/runtime.cjs.js +1 -1
  221. package/dist/runtime.d.ts +1 -1
  222. package/dist/runtime.d.ts.map +1 -1
  223. package/dist/runtime.esm.js +29 -26
  224. package/dist/select.cjs.js +20 -19
  225. package/dist/select.esm.js +36 -32
  226. package/dist/selection-popup.cjs.js +2 -2
  227. package/dist/selection-popup.esm.js +2 -2
  228. package/dist/selector-BvAh35ve.js +1 -0
  229. package/dist/selector-WI8pD7YO.mjs +18 -0
  230. package/dist/separator.cjs.js +7 -7
  231. package/dist/separator.esm.js +7 -7
  232. package/dist/sidebar.cjs.js +7 -7
  233. package/dist/sidebar.esm.js +7 -7
  234. package/dist/skeleton.cjs.js +7 -7
  235. package/dist/skeleton.esm.js +7 -7
  236. package/dist/slider.cjs.js +3 -3
  237. package/dist/slider.esm.js +3 -3
  238. package/dist/slot.cjs.js +3 -3
  239. package/dist/slot.esm.js +3 -3
  240. package/dist/sortable.cjs.js +61 -48
  241. package/dist/sortable.esm.js +636 -554
  242. package/dist/spinning-text.cjs.js +3 -3
  243. package/dist/spinning-text.esm.js +3 -3
  244. package/dist/split-button.cjs.js +1 -1
  245. package/dist/split-button.esm.js +1 -1
  246. package/dist/stepper.cjs.js +1 -1
  247. package/dist/stepper.esm.js +1 -1
  248. package/dist/switch.cjs.js +10 -12
  249. package/dist/switch.esm.js +10 -12
  250. package/dist/table.cjs.js +9 -6
  251. package/dist/table.esm.js +46 -43
  252. package/dist/tabs.cjs.js +22 -23
  253. package/dist/tabs.esm.js +116 -112
  254. package/dist/tags-input.cjs.js +9 -9
  255. package/dist/tags-input.esm.js +32 -25
  256. package/dist/textarea.cjs.js +13 -13
  257. package/dist/textarea.esm.js +46 -31
  258. package/dist/theme.d.ts +18 -0
  259. package/dist/theme.d.ts.map +1 -1
  260. package/dist/time-field.cjs.js +5 -5
  261. package/dist/time-field.esm.js +21 -18
  262. package/dist/time-picker.cjs.js +4 -4
  263. package/dist/time-picker.esm.js +5 -5
  264. package/dist/timeline.cjs.js +2 -2
  265. package/dist/timeline.esm.js +4 -4
  266. package/dist/toast.cjs.js +6 -6
  267. package/dist/toast.esm.js +13 -13
  268. package/dist/toggle-group.cjs.js +5 -6
  269. package/dist/toggle-group.esm.js +63 -60
  270. package/dist/toggle.cjs.js +18 -18
  271. package/dist/toggle.esm.js +32 -31
  272. package/dist/tooltip.cjs.js +4 -4
  273. package/dist/tooltip.esm.js +4 -4
  274. package/dist/transfer-list.cjs.js +32 -32
  275. package/dist/transfer-list.esm.js +57 -57
  276. package/dist/tree-7qbVnpGp.js +39 -0
  277. package/dist/{tree-B3kE8ESs.mjs → tree-Deoft-kO.mjs} +34 -33
  278. package/dist/tree.cjs.js +1 -1
  279. package/dist/tree.esm.js +1 -1
  280. package/dist/trigger-BjnxLCeQ.mjs +9 -0
  281. package/dist/trigger-DkPsKxsP.js +1 -0
  282. package/dist/{ui-button-rXQOS9QJ.js → ui-button-BInsgSbr.js} +27 -26
  283. package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-rfiuUnUD.mjs} +65 -48
  284. package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-BSi_GtqO.mjs} +2 -2
  285. package/dist/{ui-icon-BzVNC_lr.js → ui-icon-Bvt9oIIR.js} +5 -5
  286. package/dist/wizard.cjs.js +12 -13
  287. package/dist/wizard.esm.js +17 -15
  288. package/package.json +1 -1
  289. package/dist/runtime-CTaOSmBj.js +0 -1
  290. package/dist/tree-Dx_kv_ih.js +0 -39
@@ -1,5 +1,5 @@
1
- import { E as b } from "./ElementBase-YlTLMsGk.mjs";
2
- const _ = {
1
+ import { E as _ } from "./ElementBase-YlTLMsGk.mjs";
2
+ const b = {
3
3
  sm: "var(--ui-breakpoint-sm, 640px)",
4
4
  md: "var(--ui-breakpoint-md, 768px)",
5
5
  lg: "var(--ui-breakpoint-lg, 1024px)",
@@ -187,7 +187,7 @@ function g(u, t) {
187
187
  return {};
188
188
  }
189
189
  }
190
- class I extends b {
190
+ class I extends _ {
191
191
  constructor() {
192
192
  super(...arguments), this._lastClassname = "", this._appliedInlineProps = /* @__PURE__ */ new Set(), this._mutationObserver = null, this._suppressMutations = !1, this._focusedValue = null, this._dragItem = null, this._dragOverItem = null, this._onKeyDownBound = (t) => this._onKeyDown(t), this._onClickBound = (t) => this._onClick(t), this._onDragStartBound = (t) => this._onDragStart(t), this._onDragOverBound = (t) => this._onDragOver(t), this._onDropBound = (t) => this._onDrop(t), this._onDragEndBound = () => this._clearDragState();
193
193
  }
@@ -234,8 +234,8 @@ class I extends b {
234
234
  const e = this.getAttribute(t);
235
235
  if (!e || f(e)) return;
236
236
  const s = g(t, e);
237
- Object.entries(s).forEach(([r, i]) => {
238
- this.style.setProperty(r, i), this._appliedInlineProps.add(r);
237
+ Object.entries(s).forEach(([r, a]) => {
238
+ this.style.setProperty(r, a), this._appliedInlineProps.add(r);
239
239
  });
240
240
  });
241
241
  }
@@ -246,21 +246,21 @@ class I extends b {
246
246
  lg: {},
247
247
  xl: {}
248
248
  };
249
- p.forEach((a) => {
250
- const o = this.getAttribute(a), n = f(o);
249
+ p.forEach((i) => {
250
+ const o = this.getAttribute(i), n = f(o);
251
251
  if (!n) return;
252
252
  const l = (c, m) => {
253
- Object.assign(c, g(a, m));
253
+ Object.assign(c, g(i, m));
254
254
  };
255
255
  typeof n.initial == "string" && l(t, n.initial), typeof n.sm == "string" && l(e.sm, n.sm), typeof n.md == "string" && l(e.md, n.md), typeof n.lg == "string" && l(e.lg, n.lg), typeof n.xl == "string" && l(e.xl, n.xl);
256
256
  });
257
- const s = (a, o) => {
257
+ const s = (i, o) => {
258
258
  const n = Object.entries(o);
259
- return n.length ? `${a} { ${n.map(([l, c]) => `${l}: ${c};`).join(" ")} }` : "";
260
- }, r = [], i = s(":host", t);
261
- return i && r.push(i), Object.keys(e).forEach((a) => {
262
- const o = s(":host", e[a]);
263
- o && r.push(`@media (min-width: ${_[a]}) { ${o} }`);
259
+ return n.length ? `${i} { ${n.map(([l, c]) => `${l}: ${c};`).join(" ")} }` : "";
260
+ }, r = [], a = s(":host", t);
261
+ return a && r.push(a), Object.keys(e).forEach((i) => {
262
+ const o = s(":host", e[i]);
263
+ o && r.push(`@media (min-width: ${b[i]}) { ${o} }`);
264
264
  }), r.join(`
265
265
  `);
266
266
  }
@@ -280,17 +280,17 @@ class I extends b {
280
280
  const t = this._fallbackColumnCount();
281
281
  let e = 0;
282
282
  return this._items().map((s, r) => {
283
- let i = d(s.getAttribute("data-row")), a = d(s.getAttribute("data-column"));
283
+ let a = d(s.getAttribute("data-row")), i = d(s.getAttribute("data-column"));
284
284
  const o = d(s.getAttribute("data-row-span")) || 1, n = d(s.getAttribute("data-column-span")) || 1;
285
- if (i == null || a == null) {
285
+ if (a == null || i == null) {
286
286
  const l = e++, c = Math.floor(l / t) + 1, m = l % t + 1;
287
- i == null && (i = c), a == null && (a = m);
287
+ a == null && (a = c), i == null && (i = m);
288
288
  }
289
289
  return {
290
290
  el: s,
291
291
  index: r,
292
- row: i,
293
- column: a,
292
+ row: a,
293
+ column: i,
294
294
  rowSpan: o,
295
295
  columnSpan: n,
296
296
  value: s.getAttribute("data-value") || s.id || String(r),
@@ -312,18 +312,12 @@ class I extends b {
312
312
  return [...t].sort((e, s) => e.row !== s.row ? e.row - s.row : e.column !== s.column ? e.column - s.column : e.index - s.index);
313
313
  }
314
314
  _syncHostSemantics(t) {
315
- this._isInteractive() ? (this.hasAttribute("role") || (this.setAttribute("role", "grid"), this.setAttribute("data-ui-placement-role", "")), this.setAttribute(
316
- "aria-rowcount",
317
- String(t.reduce((e, s) => Math.max(e, s.row + s.rowSpan - 1), 0))
318
- ), this.setAttribute(
319
- "aria-colcount",
320
- String(t.reduce((e, s) => Math.max(e, s.column + s.columnSpan - 1), this._fallbackColumnCount()))
321
- )) : this.hasAttribute("data-ui-placement-role") && (this.removeAttribute("role"), this.removeAttribute("data-ui-placement-role"), this.removeAttribute("aria-rowcount"), this.removeAttribute("aria-colcount"));
315
+ this._isInteractive() ? this.hasAttribute("role") || (this.setAttribute("role", "list"), this.setAttribute("data-ui-placement-role", "")) : this.hasAttribute("data-ui-placement-role") && (this.removeAttribute("role"), this.removeAttribute("data-ui-placement-role")), (!this._isInteractive() || this.hasAttribute("data-ui-placement-role")) && (this.removeAttribute("aria-rowcount"), this.removeAttribute("aria-colcount"));
322
316
  }
323
317
  _setFocusedItem(t, e = !1) {
324
318
  const s = this._items(), r = t || s[0] || null;
325
- this._focusedValue = r && (r.getAttribute("data-value") || r.id) || null, s.forEach((i) => {
326
- this._isInteractive() ? i.tabIndex = i === r ? 0 : -1 : i.removeAttribute("tabindex");
319
+ this._focusedValue = r && (r.getAttribute("data-value") || r.id) || null, s.forEach((a) => {
320
+ this._isInteractive() ? a.tabIndex = a === r ? 0 : -1 : a.removeAttribute("tabindex");
327
321
  }), e && r && r.focus({ preventScroll: !0 });
328
322
  }
329
323
  _syncItems() {
@@ -333,7 +327,13 @@ class I extends b {
333
327
  this._order() === "row-major" && e.forEach((r) => this.appendChild(r.el)), this._syncHostSemantics(e);
334
328
  const s = e.find((r) => r.value === this._focusedValue)?.el || e[0]?.el || null;
335
329
  e.forEach((r) => {
336
- r.el.style.gridColumn = `${r.column} / span ${r.columnSpan}`, r.el.style.gridRow = `${r.row} / span ${r.rowSpan}`, r.el.style.minInlineSize = "0", r.el.style.boxSizing = "border-box", this._isInteractive() ? (r.el.hasAttribute("role") || r.el.setAttribute("role", "gridcell"), r.el.setAttribute("aria-rowindex", String(r.row)), r.el.setAttribute("aria-colindex", String(r.column)), r.columnSpan > 1 ? r.el.setAttribute("aria-colspan", String(r.columnSpan)) : r.el.removeAttribute("aria-colspan"), r.rowSpan > 1 ? r.el.setAttribute("aria-rowspan", String(r.rowSpan)) : r.el.removeAttribute("aria-rowspan"), r.selected ? r.el.setAttribute("aria-selected", "true") : r.el.removeAttribute("aria-selected"), r.disabled ? r.el.setAttribute("aria-disabled", "true") : r.el.removeAttribute("aria-disabled")) : (r.el.removeAttribute("aria-rowindex"), r.el.removeAttribute("aria-colindex"), r.el.removeAttribute("aria-rowspan"), r.el.removeAttribute("aria-colspan"), r.el.removeAttribute("aria-selected"), r.el.removeAttribute("aria-disabled")), this._isDraggable() && !r.disabled ? (r.el.setAttribute("data-draggable", ""), r.el.setAttribute("draggable", "true")) : (r.el.removeAttribute("data-draggable"), r.el.removeAttribute("draggable"));
330
+ if (r.el.style.gridColumn = `${r.column} / span ${r.columnSpan}`, r.el.style.gridRow = `${r.row} / span ${r.rowSpan}`, r.el.style.minInlineSize = "0", r.el.style.boxSizing = "border-box", this._isInteractive()) {
331
+ r.el.hasAttribute("role") || (r.el.setAttribute("role", "listitem"), r.el.setAttribute("data-ui-placement-item-role", ""));
332
+ const a = e.indexOf(r) + 1;
333
+ r.el.hasAttribute("data-ui-placement-item-role") && (r.el.setAttribute("aria-posinset", String(a)), r.el.setAttribute("aria-setsize", String(e.length)), r.selected ? r.el.setAttribute("aria-current", "true") : r.el.removeAttribute("aria-current")), r.disabled ? r.el.setAttribute("aria-disabled", "true") : r.el.removeAttribute("aria-disabled");
334
+ } else
335
+ r.el.hasAttribute("data-ui-placement-item-role") && (r.el.removeAttribute("role"), r.el.removeAttribute("data-ui-placement-item-role")), r.el.removeAttribute("aria-posinset"), r.el.removeAttribute("aria-setsize"), r.el.removeAttribute("aria-current"), r.el.removeAttribute("aria-disabled");
336
+ this._isDraggable() && !r.disabled ? (r.el.setAttribute("data-draggable", ""), r.el.setAttribute("draggable", "true")) : (r.el.removeAttribute("data-draggable"), r.el.removeAttribute("draggable"));
337
337
  }), this._setFocusedItem(s, !1);
338
338
  } finally {
339
339
  this._suppressMutations = !1;
@@ -348,53 +348,53 @@ class I extends b {
348
348
  return this._computeItems().find((e) => e.el === t) || null;
349
349
  }
350
350
  _intervalsOverlap(t, e, s, r) {
351
- const i = t + e - 1, a = s + r - 1;
352
- return t <= a && s <= i;
351
+ const a = t + e - 1, i = s + r - 1;
352
+ return t <= i && s <= a;
353
353
  }
354
354
  _findNeighbor(t, e) {
355
- const s = this._computeItems().filter((a) => !a.disabled && a.el !== t.el);
355
+ const s = this._computeItems().filter((i) => !i.disabled && i.el !== t.el);
356
356
  if (!s.length) return null;
357
- const r = s.filter((a) => e === "left" || e === "right" ? this._intervalsOverlap(t.row, t.rowSpan, a.row, a.rowSpan) ? e === "left" ? a.column < t.column : a.column > t.column : !1 : this._intervalsOverlap(t.column, t.columnSpan, a.column, a.columnSpan) ? e === "up" ? a.row < t.row : a.row > t.row : !1);
357
+ const r = s.filter((i) => e === "left" || e === "right" ? this._intervalsOverlap(t.row, t.rowSpan, i.row, i.rowSpan) ? e === "left" ? i.column < t.column : i.column > t.column : !1 : this._intervalsOverlap(t.column, t.columnSpan, i.column, i.columnSpan) ? e === "up" ? i.row < t.row : i.row > t.row : !1);
358
358
  if (!r.length) {
359
- const a = this._order() === "row-major" ? this._sortMeta(this._computeItems()) : this._computeItems(), o = a.findIndex((l) => l.el === t.el);
360
- return a[o + (e === "left" || e === "up" ? -1 : 1)]?.el || null;
359
+ const i = this._order() === "row-major" ? this._sortMeta(this._computeItems()) : this._computeItems(), o = i.findIndex((l) => l.el === t.el);
360
+ return i[o + (e === "left" || e === "up" ? -1 : 1)]?.el || null;
361
361
  }
362
- return r.sort((a, o) => {
362
+ return r.sort((i, o) => {
363
363
  if (e === "left" || e === "right") {
364
- const c = Math.abs(a.column - t.column), m = Math.abs(o.column - t.column);
365
- return c !== m ? c - m : Math.abs(a.row - t.row) - Math.abs(o.row - t.row);
364
+ const c = Math.abs(i.column - t.column), m = Math.abs(o.column - t.column);
365
+ return c !== m ? c - m : Math.abs(i.row - t.row) - Math.abs(o.row - t.row);
366
366
  }
367
- const n = Math.abs(a.row - t.row), l = Math.abs(o.row - t.row);
368
- return n !== l ? n - l : Math.abs(a.column - t.column) - Math.abs(o.column - t.column);
367
+ const n = Math.abs(i.row - t.row), l = Math.abs(o.row - t.row);
368
+ return n !== l ? n - l : Math.abs(i.column - t.column) - Math.abs(o.column - t.column);
369
369
  })[0]?.el || null;
370
370
  }
371
371
  _moveItemTo(t, e, s, r) {
372
- const i = this._metaForItem(t);
373
- !i || i.disabled || (t.setAttribute("data-row", String(e)), t.setAttribute("data-column", String(s)), this.dispatchEvent(
372
+ const a = this._metaForItem(t);
373
+ !a || a.disabled || (t.setAttribute("data-row", String(e)), t.setAttribute("data-column", String(s)), this.dispatchEvent(
374
374
  new CustomEvent("itemmove", {
375
375
  bubbles: !0,
376
376
  composed: !0,
377
377
  detail: {
378
- value: i.value,
378
+ value: a.value,
379
379
  reason: r,
380
- from: { row: i.row, column: i.column },
380
+ from: { row: a.row, column: a.column },
381
381
  to: { row: e, column: s }
382
382
  }
383
383
  })
384
384
  ), this.requestRender());
385
385
  }
386
386
  _swapItems(t, e, s) {
387
- const r = this._metaForItem(t), i = this._metaForItem(e);
388
- !r || !i || (t.setAttribute("data-row", String(i.row)), t.setAttribute("data-column", String(i.column)), e.setAttribute("data-row", String(r.row)), e.setAttribute("data-column", String(r.column)), this.dispatchEvent(
387
+ const r = this._metaForItem(t), a = this._metaForItem(e);
388
+ !r || !a || (t.setAttribute("data-row", String(a.row)), t.setAttribute("data-column", String(a.column)), e.setAttribute("data-row", String(r.row)), e.setAttribute("data-column", String(r.column)), this.dispatchEvent(
389
389
  new CustomEvent("itemmove", {
390
390
  bubbles: !0,
391
391
  composed: !0,
392
392
  detail: {
393
393
  value: r.value,
394
- targetValue: i.value,
394
+ targetValue: a.value,
395
395
  reason: s,
396
396
  from: { row: r.row, column: r.column },
397
- to: { row: i.row, column: i.column }
397
+ to: { row: a.row, column: a.column }
398
398
  }
399
399
  })
400
400
  ), this.requestRender());
@@ -410,24 +410,24 @@ class I extends b {
410
410
  if (!e) return;
411
411
  const s = this._metaForItem(e);
412
412
  if (!s || s.disabled) return;
413
- const r = t.key, i = r === "ArrowLeft" || r === "ArrowRight" || r === "ArrowUp" || r === "ArrowDown";
414
- if (t.altKey && this._isDraggable() && i) {
413
+ const r = t.key, a = r === "ArrowLeft" || r === "ArrowRight" || r === "ArrowUp" || r === "ArrowDown";
414
+ if (t.altKey && this._isDraggable() && a) {
415
415
  t.preventDefault();
416
416
  const o = r === "ArrowDown" ? 1 : r === "ArrowUp" ? -1 : 0, n = r === "ArrowRight" ? 1 : r === "ArrowLeft" ? -1 : 0;
417
417
  this._moveItemTo(e, Math.max(1, s.row + o), Math.max(1, s.column + n), "keyboard"), this._setFocusedItem(e, !0);
418
418
  return;
419
419
  }
420
- let a = null;
421
- if (r === "ArrowLeft") a = this._findNeighbor(s, "left");
422
- else if (r === "ArrowRight") a = this._findNeighbor(s, "right");
423
- else if (r === "ArrowUp") a = this._findNeighbor(s, "up");
424
- else if (r === "ArrowDown") a = this._findNeighbor(s, "down");
425
- else if (r === "Home") a = (this._order() === "row-major" ? this._sortMeta(this._computeItems()) : this._computeItems())[0]?.el || null;
420
+ let i = null;
421
+ if (r === "ArrowLeft") i = this._findNeighbor(s, "left");
422
+ else if (r === "ArrowRight") i = this._findNeighbor(s, "right");
423
+ else if (r === "ArrowUp") i = this._findNeighbor(s, "up");
424
+ else if (r === "ArrowDown") i = this._findNeighbor(s, "down");
425
+ else if (r === "Home") i = (this._order() === "row-major" ? this._sortMeta(this._computeItems()) : this._computeItems())[0]?.el || null;
426
426
  else if (r === "End") {
427
427
  const o = this._order() === "row-major" ? this._sortMeta(this._computeItems()) : this._computeItems();
428
- a = o[o.length - 1]?.el || null;
428
+ i = o[o.length - 1]?.el || null;
429
429
  }
430
- a && (t.preventDefault(), this._setFocusedItem(a, !0));
430
+ i && (t.preventDefault(), this._setFocusedItem(i, !0));
431
431
  }
432
432
  _onDragStart(t) {
433
433
  if (!this._isDraggable()) return;
@@ -121,7 +121,7 @@
121
121
  <header class="header" part="header" style="display:flex;align-items:flex-start;gap:10px;padding:12px 14px 0;">
122
122
  <div style="min-width:0;display:grid;gap:4px;flex:1 1 auto;">
123
123
  ${e?`<strong part="title" style="font-size:14px;line-height:1.3;">${e}</strong>`:""}
124
- ${t?`<p part="description" style="margin:0;font-size:12px;line-height:1.4;color:var(--ui-color-muted, #64748b);">${t}</p>`:""}
124
+ ${t?`<p part="description" style="margin:0;font-size:12px;line-height:1.4;color:var(--ui-color-muted, #526175);">${t}</p>`:""}
125
125
  </div>
126
126
  ${i?'<button type="button" class="dismiss" part="dismiss-button" aria-label="Close panel" style="border:none;background:transparent;color:inherit;cursor:pointer;font:inherit;padding:4px 6px;">Close</button>':""}
127
127
  </header>
@@ -155,7 +155,7 @@ class o extends a {
155
155
  <header class="header" part="header" style="display:flex;align-items:flex-start;gap:10px;padding:12px 14px 0;">
156
156
  <div style="min-width:0;display:grid;gap:4px;flex:1 1 auto;">
157
157
  ${e ? `<strong part="title" style="font-size:14px;line-height:1.3;">${e}</strong>` : ""}
158
- ${t ? `<p part="description" style="margin:0;font-size:12px;line-height:1.4;color:var(--ui-color-muted, #64748b);">${t}</p>` : ""}
158
+ ${t ? `<p part="description" style="margin:0;font-size:12px;line-height:1.4;color:var(--ui-color-muted, #526175);">${t}</p>` : ""}
159
159
  </div>
160
160
  ${i ? '<button type="button" class="dismiss" part="dismiss-button" aria-label="Close panel" style="border:none;background:transparent;color:inherit;cursor:pointer;font:inherit;padding:4px 6px;">Close</button>' : ""}
161
161
  </header>
@@ -8,7 +8,7 @@
8
8
  color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 24%, var(--ui-color-surface, #ffffff)) 100%
9
9
  );
10
10
  --ui-popover-text: var(--ui-color-text, #0f172a);
11
- --ui-popover-muted: var(--ui-color-muted, #64748b);
11
+ --ui-popover-muted: var(--ui-color-muted, #526175);
12
12
  --ui-popover-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 70%, transparent);
13
13
  --ui-popover-border: 1px solid var(--ui-popover-border-color);
14
14
  --ui-popover-shadow:
@@ -45,7 +45,7 @@
45
45
  }
46
46
 
47
47
  .popover-shell[data-tone="neutral"] {
48
- --ui-popover-accent: var(--ui-color-muted, #64748b);
48
+ --ui-popover-accent: var(--ui-color-muted, #526175);
49
49
  }
50
50
 
51
51
  .popover-shell[data-tone="brand"],
@@ -54,11 +54,11 @@
54
54
  }
55
55
 
56
56
  .popover-shell[data-tone="success"] {
57
- --ui-popover-accent: var(--ui-color-success, #16a34a);
57
+ --ui-popover-accent: var(--ui-color-success, #15803d);
58
58
  }
59
59
 
60
60
  .popover-shell[data-tone="warning"] {
61
- --ui-popover-accent: var(--ui-color-warning, #d97706);
61
+ --ui-popover-accent: var(--ui-color-warning, #b45309);
62
62
  }
63
63
 
64
64
  .popover-shell[data-tone="danger"] {
@@ -283,4 +283,4 @@
283
283
  box-shadow: none;
284
284
  }
285
285
  }
286
- `;class d extends h.ElementBase{constructor(){super(),this._portalEl=null,this._panelEl=null,this._positioner=null,this._layer=null,this._isOpen=!1,this._restoreFocusEl=null,this._contentObserver=null,this._hostObserver=null,this._syncPortalScheduled=!1,this._onHostClick=this._handleHostClick.bind(this)}static get observedAttributes(){return["open","placement","offset","flip","shift","close-on-escape","close-on-outside","variant","tone","size","radius","elevation"]}attributeChangedCallback(e,t,r){if(t!==r){if(e==="open"){this._syncOpenState();return}this._isOpen&&this._portalEl?.isConnected&&(e==="placement"||e==="offset"||e==="flip"||e==="shift"||e==="variant"||e==="tone"||e==="size"||e==="radius"||e==="elevation"?this._mountPortal():(e==="close-on-escape"||e==="close-on-outside")&&this._syncDismissableLayer())}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onHostClick),this._observeHost(),this._syncOpenState()}disconnectedCallback(){this.removeEventListener("click",this._onHostClick),this._hostObserver?.disconnect(),this._hostObserver=null,this._teardownPortal(),super.disconnectedCallback()}_handleHostClick(e){const t=this._getTrigger();if(!t)return;const r=typeof e.composedPath=="function"?e.composedPath():[],o=e.target instanceof Node?e.target:null;(r.includes(t)||o&&(t===o||t.contains(o)))&&this.toggle()}open(){this.setAttribute("open","")}close(){this.removeAttribute("open")}toggle(){this.hasAttribute("open")?this.close():this.open()}updatePosition(){this._positioner?.update()}_getTrigger(){return this.querySelector('[slot="trigger"]')}_buildPortalContent(){const e=document.createElement("div");e.className="popover-shell",e.style.pointerEvents="auto";const t=this.getAttribute("variant");t&&(e.dataset.variant=t);const r=this.getAttribute("tone");r&&(e.dataset.tone=r);const o=this.getAttribute("size");o&&(e.dataset.size=o);const a=this.getAttribute("elevation");a&&(e.dataset.elevation=a);const s=this.getAttribute("radius");if(s&&s.trim()){const p=s.trim(),v=/^-?\d+(\.\d+)?$/.test(p)?`${p}px`:p;e.style.setProperty("--ui-popover-radius",v)}const l=document.createElement("style");l.textContent=m,e.appendChild(l);const i=document.createElement("div");i.className="panel show",this._panelEl=i;const c=document.createElement("div");c.className="arrow",i.appendChild(c);const u=this.querySelector('[slot="content"]'),n=document.createElement("div");return n.className="content",u&&n.appendChild(u.cloneNode(!0)),i.appendChild(n),e.appendChild(i),e}_getContentSource(){return this.querySelector('[slot="content"]')}_placement(){const e=this.getAttribute("placement");return e||"bottom"}_offset(){const e=Number(this.getAttribute("offset"));return Number.isFinite(e)?e:8}_closeOnEscape(){return this.getAttribute("close-on-escape")!=="false"}_closeOnOutside(){return this.getAttribute("close-on-outside")!=="false"}_syncDismissableLayer(){const e=this._getTrigger();!e||!this._panelEl||(this._layer?.destroy(),this._layer=b.createDismissableLayer({node:this._panelEl,trigger:e,closeOnEscape:this._closeOnEscape(),closeOnPointerOutside:this._closeOnOutside(),onDismiss:()=>this.close()}))}_teardownPortal(){if(this._contentObserver?.disconnect(),this._contentObserver=null,this._layer?.destroy(),this._layer=null,this._positioner?.destroy(),this._positioner=null,this._panelEl=null,this._portalEl?.parentElement)try{this._portalEl.parentElement.removeChild(this._portalEl)}catch{}this._portalEl=null}_schedulePortalSync(){this._syncPortalScheduled||!this._isOpen||(this._syncPortalScheduled=!0,queueMicrotask(()=>{this._syncPortalScheduled=!1,this._isOpen&&this._mountPortal()}))}_observeContent(){this._contentObserver?.disconnect(),this._contentObserver=null;const e=this._getContentSource();!e||typeof MutationObserver>"u"||(this._contentObserver=new MutationObserver(()=>this._schedulePortalSync()),this._contentObserver.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))}_observeHost(){this._hostObserver?.disconnect(),this._hostObserver=null,!(typeof MutationObserver>"u")&&(this._hostObserver=new MutationObserver(()=>this._schedulePortalSync()),this._hostObserver.observe(this,{childList:!0,subtree:!1}))}_mountPortal(){const e=this._getTrigger();if(!e)return;this._teardownPortal(),this._portalEl=this._buildPortalContent();const t=f.createPortalContainer();t&&(t.appendChild(this._portalEl),this._observeContent(),this._positioner=g.createPositioner({anchor:e,floating:this._portalEl,placement:this._placement(),offset:this._offset(),shift:this.getAttribute("shift")!=="false",flip:this.getAttribute("flip")!=="false",arrow:this._portalEl.querySelector(".arrow")}),this._syncDismissableLayer())}_syncOpenState(){const e=this.hasAttribute("open");if(e===this._isOpen){e&&(!this._portalEl||!this._portalEl.isConnected?this._mountPortal():this._positioner?.update());return}if(this._isOpen=e,e){this._restoreFocusEl=document.activeElement instanceof HTMLElement?document.activeElement:null,this._mountPortal(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("open-change",{detail:{open:!0},bubbles:!0,composed:!0}));return}this._teardownPortal(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("open-change",{detail:{open:!1},bubbles:!0,composed:!0}));const t=this._getTrigger(),r=this._restoreFocusEl;this._restoreFocusEl=null;const o=(t&&t.isConnected?t:r)||null;if(o&&o.isConnected)try{o.focus()}catch{}}render(){this.setContent('<slot name="trigger"></slot>')}shouldRenderOnAttributeChange(e,t,r){return!1}}typeof customElements<"u"&&!customElements.get("ui-popover")&&customElements.define("ui-popover",d);exports.UIPopover=d;
286
+ `;class d extends h.ElementBase{constructor(){super(),this._portalEl=null,this._panelEl=null,this._positioner=null,this._layer=null,this._isOpen=!1,this._restoreFocusEl=null,this._contentObserver=null,this._hostObserver=null,this._syncPortalScheduled=!1,this._onHostClick=this._handleHostClick.bind(this)}static get observedAttributes(){return["open","placement","offset","flip","shift","close-on-escape","close-on-outside","variant","tone","size","radius","elevation"]}attributeChangedCallback(e,t,r){if(t!==r){if(e==="open"){this._syncOpenState();return}this._isOpen&&this._portalEl?.isConnected&&(e==="placement"||e==="offset"||e==="flip"||e==="shift"||e==="variant"||e==="tone"||e==="size"||e==="radius"||e==="elevation"?this._mountPortal():(e==="close-on-escape"||e==="close-on-outside")&&this._syncDismissableLayer())}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onHostClick),this._observeHost(),this._syncOpenState()}disconnectedCallback(){this.removeEventListener("click",this._onHostClick),this._hostObserver?.disconnect(),this._hostObserver=null,this._teardownPortal(),super.disconnectedCallback()}_handleHostClick(e){const t=this._getTrigger();if(!t)return;const r=typeof e.composedPath=="function"?e.composedPath():[],o=e.target instanceof Node?e.target:null;(r.includes(t)||o&&(t===o||t.contains(o)))&&this.toggle()}open(){this.setAttribute("open","")}close(){this.removeAttribute("open")}toggle(){this.hasAttribute("open")?this.close():this.open()}updatePosition(){this._positioner?.update()}_getTrigger(){return this.querySelector('[slot="trigger"]')}_buildPortalContent(){const e=document.createElement("div");e.className="popover-shell",e.style.pointerEvents="auto";const t=this.getAttribute("variant");t&&(e.dataset.variant=t);const r=this.getAttribute("tone");r&&(e.dataset.tone=r);const o=this.getAttribute("size");o&&(e.dataset.size=o);const s=this.getAttribute("elevation");s&&(e.dataset.elevation=s);const a=this.getAttribute("radius");if(a&&a.trim()){const p=a.trim(),v=/^-?\d+(\.\d+)?$/.test(p)?`${p}px`:p;e.style.setProperty("--ui-popover-radius",v)}const l=document.createElement("style");l.textContent=m,e.appendChild(l);const i=document.createElement("div");i.className="panel show",this._panelEl=i;const c=document.createElement("div");c.className="arrow",i.appendChild(c);const u=this.querySelector('[slot="content"]'),n=document.createElement("div");return n.className="content",u&&n.appendChild(u.cloneNode(!0)),i.appendChild(n),e.appendChild(i),e}_getContentSource(){return this.querySelector('[slot="content"]')}_placement(){const e=this.getAttribute("placement");return e||"bottom"}_offset(){const e=Number(this.getAttribute("offset"));return Number.isFinite(e)?e:8}_closeOnEscape(){return this.getAttribute("close-on-escape")!=="false"}_closeOnOutside(){return this.getAttribute("close-on-outside")!=="false"}_syncDismissableLayer(){const e=this._getTrigger();!e||!this._panelEl||(this._layer?.destroy(),this._layer=b.createDismissableLayer({node:this._panelEl,trigger:e,closeOnEscape:this._closeOnEscape(),closeOnPointerOutside:this._closeOnOutside(),onDismiss:()=>this.close()}))}_teardownPortal(){if(this._contentObserver?.disconnect(),this._contentObserver=null,this._layer?.destroy(),this._layer=null,this._positioner?.destroy(),this._positioner=null,this._panelEl=null,this._portalEl?.parentElement)try{this._portalEl.parentElement.removeChild(this._portalEl)}catch{}this._portalEl=null}_schedulePortalSync(){this._syncPortalScheduled||!this._isOpen||(this._syncPortalScheduled=!0,queueMicrotask(()=>{this._syncPortalScheduled=!1,this._isOpen&&this._mountPortal()}))}_observeContent(){this._contentObserver?.disconnect(),this._contentObserver=null;const e=this._getContentSource();!e||typeof MutationObserver>"u"||(this._contentObserver=new MutationObserver(()=>this._schedulePortalSync()),this._contentObserver.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))}_observeHost(){this._hostObserver?.disconnect(),this._hostObserver=null,!(typeof MutationObserver>"u")&&(this._hostObserver=new MutationObserver(()=>this._schedulePortalSync()),this._hostObserver.observe(this,{childList:!0,subtree:!1}))}_mountPortal(){const e=this._getTrigger();if(!e)return;this._teardownPortal(),this._portalEl=this._buildPortalContent();const t=f.createPortalContainer();t&&(t.appendChild(this._portalEl),this._observeContent(),this._positioner=g.createPositioner({anchor:e,floating:this._portalEl,placement:this._placement(),offset:this._offset(),shift:this.getAttribute("shift")!=="false",flip:this.getAttribute("flip")!=="false",arrow:this._portalEl.querySelector(".arrow")}),this._syncDismissableLayer())}_syncOpenState(){const e=this.hasAttribute("open");if(e===this._isOpen){e&&(!this._portalEl||!this._portalEl.isConnected?this._mountPortal():this._positioner?.update());return}if(this._isOpen=e,e){this._restoreFocusEl=document.activeElement instanceof HTMLElement?document.activeElement:null,this._mountPortal(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("open-change",{detail:{open:!0},bubbles:!0,composed:!0}));return}this._teardownPortal(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("open-change",{detail:{open:!1},bubbles:!0,composed:!0}));const t=this._getTrigger(),r=this._restoreFocusEl;this._restoreFocusEl=null;const o=(t&&t.isConnected?t:r)||null;if(o&&o.isConnected)try{o.focus()}catch{}}render(){this.setContent('<slot name="trigger"></slot>')}shouldRenderOnAttributeChange(e,t,r){return!1}}typeof customElements<"u"&&!customElements.get("ui-popover")&&customElements.define("ui-popover",d);exports.UIPopover=d;
@@ -12,7 +12,7 @@ const g = `
12
12
  color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 24%, var(--ui-color-surface, #ffffff)) 100%
13
13
  );
14
14
  --ui-popover-text: var(--ui-color-text, #0f172a);
15
- --ui-popover-muted: var(--ui-color-muted, #64748b);
15
+ --ui-popover-muted: var(--ui-color-muted, #526175);
16
16
  --ui-popover-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 70%, transparent);
17
17
  --ui-popover-border: 1px solid var(--ui-popover-border-color);
18
18
  --ui-popover-shadow:
@@ -49,7 +49,7 @@ const g = `
49
49
  }
50
50
 
51
51
  .popover-shell[data-tone="neutral"] {
52
- --ui-popover-accent: var(--ui-color-muted, #64748b);
52
+ --ui-popover-accent: var(--ui-color-muted, #526175);
53
53
  }
54
54
 
55
55
  .popover-shell[data-tone="brand"],
@@ -58,11 +58,11 @@ const g = `
58
58
  }
59
59
 
60
60
  .popover-shell[data-tone="success"] {
61
- --ui-popover-accent: var(--ui-color-success, #16a34a);
61
+ --ui-popover-accent: var(--ui-color-success, #15803d);
62
62
  }
63
63
 
64
64
  .popover-shell[data-tone="warning"] {
65
- --ui-popover-accent: var(--ui-color-warning, #d97706);
65
+ --ui-popover-accent: var(--ui-color-warning, #b45309);
66
66
  }
67
67
 
68
68
  .popover-shell[data-tone="danger"] {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./ElementBase-EV6mVBUV.js"),l=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./ElementBase-EV6mVBUV.js"),l=require("./selector-BvAh35ve.js"),a=`
2
2
  :host {
3
3
  display: contents;
4
4
  color-scheme: light dark;
@@ -31,8 +31,8 @@
31
31
  --ui-portal-color: CanvasText;
32
32
  }
33
33
  }
34
- `;function a(r){return r==="prepend"?"prepend":"append"}function h(r){return r.nodeType===Node.ELEMENT_NODE?!0:r.nodeType===Node.TEXT_NODE?!!r.textContent?.trim():!1}function u(r){return r.nodeType===Node.ELEMENT_NODE||r.nodeType===Node.TEXT_NODE}class n extends o.ElementBase{constructor(){super(),this._headless=!1,this._strategy="append",this._target=null,this._slot=null,this._entries=[],this._syncing=!1,this._guardTimer=null,this._targetObserver=null,this._pendingSlotSync=!1,this._onSlotChange=this._onSlotChange.bind(this),this._onTargetMutations=this._onTargetMutations.bind(this)}static get observedAttributes(){return["target","headless","strategy","disabled"]}connectedCallback(){super.connectedCallback(),this._syncConfig(),this._mountAllFromSlot()}disconnectedCallback(){this._guardTimer!=null&&(window.clearTimeout(this._guardTimer),this._guardTimer=null),this._slot&&(this._slot.removeEventListener("slotchange",this._onSlotChange),this._slot=null),this._disconnectTargetObserver(),this._restoreAll(),super.disconnectedCallback()}attributeChangedCallback(t,e,s){if(e!==s){if(this._syncConfig(),this._headless){this._restoreAll();return}(t==="target"||t==="strategy"||t==="disabled"||t==="headless")&&this._moveAllToTarget()}}_syncConfig(){this._headless=this.hasAttribute("headless")||this.hasAttribute("disabled"),this._strategy=a(this.getAttribute("strategy")),this._target=this._resolveTarget(),this._connectTargetObserver()}_resolveTarget(){const t=this.getAttribute("target");if(t){const e=document.querySelector(t);if(e instanceof HTMLElement)return e;this.dispatchEvent(new CustomEvent("target-missing",{detail:{target:t},bubbles:!0}))}return document.body}_connectTargetObserver(){this._disconnectTargetObserver(),!(!this._target||typeof MutationObserver>"u")&&(this._targetObserver=new MutationObserver(this._onTargetMutations),this._targetObserver.observe(this._target,{childList:!0,subtree:!0}))}_disconnectTargetObserver(){this._targetObserver&&(this._targetObserver.disconnect(),this._targetObserver=null)}_onTargetMutations(){if(this._syncing)return;let t=!1;this._entries=this._entries.filter(e=>{if(e.node.isConnected)return!0;try{e.anchor.parentNode&&e.anchor.parentNode.removeChild(e.anchor)}catch{}return t=!0,!1}),t&&this.dispatchEvent(new CustomEvent("sync",{detail:{count:this._entries.length},bubbles:!0}))}_beginSync(){this._syncing=!0,this._guardTimer!=null&&window.clearTimeout(this._guardTimer),this._guardTimer=window.setTimeout(()=>{this._syncing=!1,this._guardTimer=null,this._pendingSlotSync&&(this._pendingSlotSync=!1,this._mountAllFromSlot())},0)}_findEntry(t){return this._entries.find(e=>e.node===t)}_portalNode(t){if(!this._target||this._headless||!u(t)||this._findEntry(t)||!this.contains(t))return;const e=document.createComment("ui-portal-anchor"),s=t.parentNode;s&&(this._beginSync(),s.insertBefore(e,t),this._strategy==="prepend"?this._target.insertBefore(t,this._target.firstChild):this._target.appendChild(t),this._entries.push({node:t,anchor:e}))}_restoreEntry(t){const{node:e,anchor:s}=t;this._beginSync(),s.parentNode&&(s.parentNode.insertBefore(e,s),s.parentNode.removeChild(s))}_restoreAll(){if(!this._entries.length)return;const t=[...this._entries];this._entries=[],t.forEach(e=>this._restoreEntry(e)),this.dispatchEvent(new CustomEvent("unmount",{detail:{count:t.length},bubbles:!0}))}_moveAllToTarget(){if(this._headless){this._restoreAll();return}const t=[...this._entries];this._entries=[],t.forEach(e=>{const s=e.anchor,i=e.node;s.parentNode&&(this._beginSync(),this._strategy==="prepend"?this._target.insertBefore(i,this._target.firstChild):this._target.appendChild(i),this._entries.push({node:i,anchor:s}))}),this.dispatchEvent(new CustomEvent("mount",{detail:{count:this._entries.length},bubbles:!0}))}_mountAllFromSlot(){if(this._headless)return;const t=this._slot||this.root.querySelector("slot");if(!t)return;const e=t.assignedNodes({flatten:!0}).filter(s=>h(s));e.forEach(s=>this._portalNode(s)),e.length&&this.dispatchEvent(new CustomEvent("mount",{detail:{count:this._entries.length},bubbles:!0}))}_pruneDetachedEntries(){this._entries.length&&(this._entries=this._entries.filter(t=>{if(t.node.isConnected)return!0;try{t.anchor.parentNode&&t.anchor.parentNode.removeChild(t.anchor)}catch{}return!1}))}_onSlotChange(){if(!this._headless){if(this._syncing){this._pendingSlotSync=!0;return}this._pruneDetachedEntries(),this._mountAllFromSlot()}}render(){this.setContent(`
35
- <style>${l}</style>
34
+ `;function h(r){return r==="prepend"?"prepend":"append"}function u(r){return r.nodeType===Node.ELEMENT_NODE?!0:r.nodeType===Node.TEXT_NODE?!!r.textContent?.trim():!1}function c(r){return r.nodeType===Node.ELEMENT_NODE||r.nodeType===Node.TEXT_NODE}class n extends o.ElementBase{constructor(){super(),this._headless=!1,this._strategy="append",this._target=null,this._slot=null,this._entries=[],this._syncing=!1,this._guardTimer=null,this._targetObserver=null,this._pendingSlotSync=!1,this._onSlotChange=this._onSlotChange.bind(this),this._onTargetMutations=this._onTargetMutations.bind(this)}static get observedAttributes(){return["target","headless","strategy","disabled"]}connectedCallback(){super.connectedCallback(),this._syncConfig(),this._mountAllFromSlot()}disconnectedCallback(){this._guardTimer!=null&&(window.clearTimeout(this._guardTimer),this._guardTimer=null),this._slot&&(this._slot.removeEventListener("slotchange",this._onSlotChange),this._slot=null),this._disconnectTargetObserver(),this._restoreAll(),super.disconnectedCallback()}attributeChangedCallback(t,e,s){if(e!==s){if(this._syncConfig(),this._headless){this._restoreAll();return}(t==="target"||t==="strategy"||t==="disabled"||t==="headless")&&this._moveAllToTarget()}}_syncConfig(){this._headless=this.hasAttribute("headless")||this.hasAttribute("disabled"),this._strategy=h(this.getAttribute("strategy")),this._target=this._resolveTarget(),this._connectTargetObserver()}_resolveTarget(){const t=this.getAttribute("target");if(t){const e=l.safeQuerySelector(document,t);if(e instanceof HTMLElement)return e;this.dispatchEvent(new CustomEvent("target-missing",{detail:{target:t},bubbles:!0}))}return document.body}_connectTargetObserver(){this._disconnectTargetObserver(),!(!this._target||typeof MutationObserver>"u")&&(this._targetObserver=new MutationObserver(this._onTargetMutations),this._targetObserver.observe(this._target,{childList:!0,subtree:!0}))}_disconnectTargetObserver(){this._targetObserver&&(this._targetObserver.disconnect(),this._targetObserver=null)}_onTargetMutations(){if(this._syncing)return;let t=!1;this._entries=this._entries.filter(e=>{if(e.node.isConnected)return!0;try{e.anchor.parentNode&&e.anchor.parentNode.removeChild(e.anchor)}catch{}return t=!0,!1}),t&&this.dispatchEvent(new CustomEvent("sync",{detail:{count:this._entries.length},bubbles:!0}))}_beginSync(){this._syncing=!0,this._guardTimer!=null&&window.clearTimeout(this._guardTimer),this._guardTimer=window.setTimeout(()=>{this._syncing=!1,this._guardTimer=null,this._pendingSlotSync&&(this._pendingSlotSync=!1,this._mountAllFromSlot())},0)}_findEntry(t){return this._entries.find(e=>e.node===t)}_portalNode(t){if(!this._target||this._headless||!c(t)||this._findEntry(t)||!this.contains(t))return;const e=document.createComment("ui-portal-anchor"),s=t.parentNode;s&&(this._beginSync(),s.insertBefore(e,t),this._strategy==="prepend"?this._target.insertBefore(t,this._target.firstChild):this._target.appendChild(t),this._entries.push({node:t,anchor:e}))}_restoreEntry(t){const{node:e,anchor:s}=t;this._beginSync(),s.parentNode&&(s.parentNode.insertBefore(e,s),s.parentNode.removeChild(s))}_restoreAll(){if(!this._entries.length)return;const t=[...this._entries];this._entries=[],t.forEach(e=>this._restoreEntry(e)),this.dispatchEvent(new CustomEvent("unmount",{detail:{count:t.length},bubbles:!0}))}_moveAllToTarget(){if(this._headless){this._restoreAll();return}const t=[...this._entries];this._entries=[],t.forEach(e=>{const s=e.anchor,i=e.node;s.parentNode&&(this._beginSync(),this._strategy==="prepend"?this._target.insertBefore(i,this._target.firstChild):this._target.appendChild(i),this._entries.push({node:i,anchor:s}))}),this.dispatchEvent(new CustomEvent("mount",{detail:{count:this._entries.length},bubbles:!0}))}_mountAllFromSlot(){if(this._headless)return;const t=this._slot||this.root.querySelector("slot");if(!t)return;const e=t.assignedNodes({flatten:!0}).filter(s=>u(s));e.forEach(s=>this._portalNode(s)),e.length&&this.dispatchEvent(new CustomEvent("mount",{detail:{count:this._entries.length},bubbles:!0}))}_pruneDetachedEntries(){this._entries.length&&(this._entries=this._entries.filter(t=>{if(t.node.isConnected)return!0;try{t.anchor.parentNode&&t.anchor.parentNode.removeChild(t.anchor)}catch{}return!1}))}_onSlotChange(){if(!this._headless){if(this._syncing){this._pendingSlotSync=!0;return}this._pruneDetachedEntries(),this._mountAllFromSlot()}}render(){this.setContent(`
35
+ <style>${a}</style>
36
36
  <div class="source" part="source">
37
37
  <slot></slot>
38
38
  </div>
@@ -1,5 +1,6 @@
1
1
  import { E as n } from "./ElementBase-YlTLMsGk.mjs";
2
- const o = `
2
+ import { s as o } from "./selector-WI8pD7YO.mjs";
3
+ const a = `
3
4
  :host {
4
5
  display: contents;
5
6
  color-scheme: light dark;
@@ -36,13 +37,13 @@ const o = `
36
37
  function l(r) {
37
38
  return r === "prepend" ? "prepend" : "append";
38
39
  }
39
- function a(r) {
40
+ function h(r) {
40
41
  return r.nodeType === Node.ELEMENT_NODE ? !0 : r.nodeType === Node.TEXT_NODE ? !!r.textContent?.trim() : !1;
41
42
  }
42
- function h(r) {
43
+ function u(r) {
43
44
  return r.nodeType === Node.ELEMENT_NODE || r.nodeType === Node.TEXT_NODE;
44
45
  }
45
- class u extends n {
46
+ class c extends n {
46
47
  constructor() {
47
48
  super(), this._headless = !1, this._strategy = "append", this._target = null, this._slot = null, this._entries = [], this._syncing = !1, this._guardTimer = null, this._targetObserver = null, this._pendingSlotSync = !1, this._onSlotChange = this._onSlotChange.bind(this), this._onTargetMutations = this._onTargetMutations.bind(this);
48
49
  }
@@ -70,7 +71,7 @@ class u extends n {
70
71
  _resolveTarget() {
71
72
  const t = this.getAttribute("target");
72
73
  if (t) {
73
- const e = document.querySelector(t);
74
+ const e = o(document, t);
74
75
  if (e instanceof HTMLElement) return e;
75
76
  this.dispatchEvent(
76
77
  new CustomEvent("target-missing", {
@@ -108,7 +109,7 @@ class u extends n {
108
109
  return this._entries.find((e) => e.node === t);
109
110
  }
110
111
  _portalNode(t) {
111
- if (!this._target || this._headless || !h(t) || this._findEntry(t) || !this.contains(t)) return;
112
+ if (!this._target || this._headless || !u(t) || this._findEntry(t) || !this.contains(t)) return;
112
113
  const e = document.createComment("ui-portal-anchor"), s = t.parentNode;
113
114
  s && (this._beginSync(), s.insertBefore(e, t), this._strategy === "prepend" ? this._target.insertBefore(t, this._target.firstChild) : this._target.appendChild(t), this._entries.push({ node: t, anchor: e }));
114
115
  }
@@ -136,7 +137,7 @@ class u extends n {
136
137
  if (this._headless) return;
137
138
  const t = this._slot || this.root.querySelector("slot");
138
139
  if (!t) return;
139
- const e = t.assignedNodes({ flatten: !0 }).filter((s) => a(s));
140
+ const e = t.assignedNodes({ flatten: !0 }).filter((s) => h(s));
140
141
  e.forEach((s) => this._portalNode(s)), e.length && this.dispatchEvent(new CustomEvent("mount", { detail: { count: this._entries.length }, bubbles: !0 }));
141
142
  }
142
143
  _pruneDetachedEntries() {
@@ -160,7 +161,7 @@ class u extends n {
160
161
  }
161
162
  render() {
162
163
  this.setContent(`
163
- <style>${o}</style>
164
+ <style>${a}</style>
164
165
  <div class="source" part="source">
165
166
  <slot></slot>
166
167
  </div>
@@ -172,7 +173,7 @@ class u extends n {
172
173
  return !1;
173
174
  }
174
175
  }
175
- typeof customElements < "u" && !customElements.get("ui-portal") && customElements.define("ui-portal", u);
176
+ typeof customElements < "u" && !customElements.get("ui-portal") && customElements.define("ui-portal", c);
176
177
  export {
177
- u as UIPortal
178
+ c as UIPortal
178
179
  };
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-EV6mVBUV.js"),c=require("./positioner-D_fqyx_j.js"),h=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./ElementBase-EV6mVBUV.js"),h=require("./positioner-D_fqyx_j.js"),a=require("./selector-BvAh35ve.js"),d=`
2
2
  :host {
3
3
  display: contents;
4
4
  color-scheme: light dark;
5
5
  }
6
- `;function r(s,t=0){const e=Number(s);return Number.isFinite(e)?e:t}function o(s){if(s==null)return!1;const t=s.toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function d(s){return new Set(["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"]).has(s)?s:"bottom"}function f(s){return s==="absolute"?"absolute":"fixed"}class a extends u.ElementBase{constructor(){super(...arguments),this._positioner=null,this._observer=null}static get observedAttributes(){return["open","placement","strategy","offset","cross-offset","flip","shift","match-width","fit-viewport","auto-placement","hide-when-detached","inline","boundary-padding","dir","anchor","headless"]}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>this._syncPositioner()),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot","id"]}),this._syncPositioner()}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._destroyPositioner(),super.disconnectedCallback()}attributeChangedCallback(t,e,i){e!==i&&this._syncPositioner()}open(){this.setAttribute("open","")}close(){this.removeAttribute("open")}updatePosition(){this._positioner?.update()}_destroyPositioner(){this._positioner?.destroy(),this._positioner=null}_resolveAnchor(){const t=this.getAttribute("anchor");if(t){const i=this.getRootNode(),n=i instanceof ShadowRoot||i instanceof Document?i.querySelector(t):null;if(n instanceof HTMLElement)return n;const l=document.querySelector(t);if(l instanceof HTMLElement)return l}const e=this.querySelector('[slot="anchor"]');return e instanceof HTMLElement?e:null}_resolveFloating(){const t=this.querySelector('[slot="content"]');return t instanceof HTMLElement?t:Array.from(this.children).find(e=>e.getAttribute("slot")!=="anchor")}_syncPositioner(){if(!this.isConnected)return;if(this.hasAttribute("headless")||!this.hasAttribute("open")){this._destroyPositioner();return}const t=this._resolveAnchor(),e=this._resolveFloating();if(!(t instanceof HTMLElement)||!(e instanceof HTMLElement)){this._destroyPositioner();return}this._destroyPositioner(),this._positioner=c.createPositioner({anchor:t,floating:e,placement:d(this.getAttribute("placement")),strategy:f(this.getAttribute("strategy")),dir:this.getAttribute("dir")==="rtl"?"rtl":"ltr",offset:r(this.getAttribute("offset"),8),crossOffset:r(this.getAttribute("cross-offset"),0),flip:!this.hasAttribute("flip")||o(this.getAttribute("flip")),shift:!this.hasAttribute("shift")||o(this.getAttribute("shift")),matchWidth:o(this.getAttribute("match-width")),fitViewport:o(this.getAttribute("fit-viewport")),autoPlacement:o(this.getAttribute("auto-placement")),hideWhenDetached:o(this.getAttribute("hide-when-detached")),inline:o(this.getAttribute("inline")),boundaryPadding:r(this.getAttribute("boundary-padding"),4),arrow:this.querySelector('[slot="arrow"], .arrow'),onUpdate:i=>{this.dispatchEvent(new CustomEvent("position-change",{detail:i,bubbles:!0,composed:!0}))}})}render(){this.setContent(`<style>${h}</style><slot name="anchor"></slot><slot name="content"></slot><slot></slot>`)}shouldRenderOnAttributeChange(){return!1}}typeof customElements<"u"&&!customElements.get("ui-positioner")&&customElements.define("ui-positioner",a);exports.UIPositioner=a;
6
+ `;function r(s,t=0){const e=Number(s);return Number.isFinite(e)?e:t}function o(s){if(s==null)return!1;const t=s.toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function f(s){return new Set(["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"]).has(s)?s:"bottom"}function b(s){return s==="absolute"?"absolute":"fixed"}class u extends c.ElementBase{constructor(){super(...arguments),this._positioner=null,this._observer=null}static get observedAttributes(){return["open","placement","strategy","offset","cross-offset","flip","shift","match-width","fit-viewport","auto-placement","hide-when-detached","inline","boundary-padding","dir","anchor","headless"]}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>this._syncPositioner()),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot","id"]}),this._syncPositioner()}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._destroyPositioner(),super.disconnectedCallback()}attributeChangedCallback(t,e,i){e!==i&&this._syncPositioner()}open(){this.setAttribute("open","")}close(){this.removeAttribute("open")}updatePosition(){this._positioner?.update()}_destroyPositioner(){this._positioner?.destroy(),this._positioner=null}_resolveAnchor(){const t=this.getAttribute("anchor");if(t){const i=this.getRootNode(),n=i instanceof ShadowRoot||i instanceof Document?a.safeQuerySelector(i,t):null;if(n instanceof HTMLElement)return n;const l=a.safeQuerySelector(document,t);if(l instanceof HTMLElement)return l}const e=this.querySelector('[slot="anchor"]');return e instanceof HTMLElement?e:null}_resolveFloating(){const t=this.querySelector('[slot="content"]');return t instanceof HTMLElement?t:Array.from(this.children).find(e=>e.getAttribute("slot")!=="anchor")}_syncPositioner(){if(!this.isConnected)return;if(this.hasAttribute("headless")||!this.hasAttribute("open")){this._destroyPositioner();return}const t=this._resolveAnchor(),e=this._resolveFloating();if(!(t instanceof HTMLElement)||!(e instanceof HTMLElement)){this._destroyPositioner();return}this._destroyPositioner(),this._positioner=h.createPositioner({anchor:t,floating:e,placement:f(this.getAttribute("placement")),strategy:b(this.getAttribute("strategy")),dir:this.getAttribute("dir")==="rtl"?"rtl":"ltr",offset:r(this.getAttribute("offset"),8),crossOffset:r(this.getAttribute("cross-offset"),0),flip:!this.hasAttribute("flip")||o(this.getAttribute("flip")),shift:!this.hasAttribute("shift")||o(this.getAttribute("shift")),matchWidth:o(this.getAttribute("match-width")),fitViewport:o(this.getAttribute("fit-viewport")),autoPlacement:o(this.getAttribute("auto-placement")),hideWhenDetached:o(this.getAttribute("hide-when-detached")),inline:o(this.getAttribute("inline")),boundaryPadding:r(this.getAttribute("boundary-padding"),4),arrow:this.querySelector('[slot="arrow"], .arrow'),onUpdate:i=>{this.dispatchEvent(new CustomEvent("position-change",{detail:i,bubbles:!0,composed:!0}))}})}render(){this.setContent(`<style>${d}</style><slot name="anchor"></slot><slot name="content"></slot><slot></slot>`)}shouldRenderOnAttributeChange(){return!1}}typeof customElements<"u"&&!customElements.get("ui-positioner")&&customElements.define("ui-positioner",u);exports.UIPositioner=u;
@@ -1,6 +1,7 @@
1
- import { E as l } from "./ElementBase-YlTLMsGk.mjs";
2
- import { e as h } from "./positioner-D0VGxtYU.mjs";
3
- const c = `
1
+ import { E as h } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { e as c } from "./positioner-D0VGxtYU.mjs";
3
+ import { s as l } from "./selector-WI8pD7YO.mjs";
4
+ const u = `
4
5
  :host {
5
6
  display: contents;
6
7
  color-scheme: light dark;
@@ -15,7 +16,7 @@ function o(s) {
15
16
  const t = s.toLowerCase();
16
17
  return t !== "false" && t !== "0" && t !== "off";
17
18
  }
18
- function u(s) {
19
+ function d(s) {
19
20
  return (/* @__PURE__ */ new Set([
20
21
  "top",
21
22
  "top-start",
@@ -31,10 +32,10 @@ function u(s) {
31
32
  "left-end"
32
33
  ])).has(s) ? s : "bottom";
33
34
  }
34
- function d(s) {
35
+ function f(s) {
35
36
  return s === "absolute" ? "absolute" : "fixed";
36
37
  }
37
- class f extends l {
38
+ class b extends h {
38
39
  constructor() {
39
40
  super(...arguments), this._positioner = null, this._observer = null;
40
41
  }
@@ -82,9 +83,9 @@ class f extends l {
82
83
  _resolveAnchor() {
83
84
  const t = this.getAttribute("anchor");
84
85
  if (t) {
85
- const i = this.getRootNode(), n = i instanceof ShadowRoot || i instanceof Document ? i.querySelector(t) : null;
86
+ const i = this.getRootNode(), n = i instanceof ShadowRoot || i instanceof Document ? l(i, t) : null;
86
87
  if (n instanceof HTMLElement) return n;
87
- const a = document.querySelector(t);
88
+ const a = l(document, t);
88
89
  if (a instanceof HTMLElement) return a;
89
90
  }
90
91
  const e = this.querySelector('[slot="anchor"]');
@@ -105,11 +106,11 @@ class f extends l {
105
106
  this._destroyPositioner();
106
107
  return;
107
108
  }
108
- this._destroyPositioner(), this._positioner = h({
109
+ this._destroyPositioner(), this._positioner = c({
109
110
  anchor: t,
110
111
  floating: e,
111
- placement: u(this.getAttribute("placement")),
112
- strategy: d(this.getAttribute("strategy")),
112
+ placement: d(this.getAttribute("placement")),
113
+ strategy: f(this.getAttribute("strategy")),
113
114
  dir: this.getAttribute("dir") === "rtl" ? "rtl" : "ltr",
114
115
  offset: r(this.getAttribute("offset"), 8),
115
116
  crossOffset: r(this.getAttribute("cross-offset"), 0),
@@ -128,13 +129,13 @@ class f extends l {
128
129
  });
129
130
  }
130
131
  render() {
131
- this.setContent(`<style>${c}</style><slot name="anchor"></slot><slot name="content"></slot><slot></slot>`);
132
+ this.setContent(`<style>${u}</style><slot name="anchor"></slot><slot name="content"></slot><slot></slot>`);
132
133
  }
133
134
  shouldRenderOnAttributeChange() {
134
135
  return !1;
135
136
  }
136
137
  }
137
- typeof customElements < "u" && !customElements.get("ui-positioner") && customElements.define("ui-positioner", f);
138
+ typeof customElements < "u" && !customElements.get("ui-positioner") && customElements.define("ui-positioner", b);
138
139
  export {
139
- f as UIPositioner
140
+ b as UIPositioner
140
141
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Per-frame scroll step for a pointer at `position` inside the span [start, end]: negative near
3
+ * the start, positive near the end, 0 elsewhere. The step grows linearly from 0 at the edge of the
4
+ * `zone` to `maxStep` at the very edge, and the zone never exceeds half the span.
5
+ */
6
+ export declare function edgeScrollDelta(position: number, start: number, end: number, zone?: number, maxStep?: number): number;
7
+ /** The nearest ancestor (crossing shadow roots) that scrolls vertically, or null for the page. */
8
+ export declare function findScrollParent(element: Element | null): HTMLElement | null;
9
+ //# sourceMappingURL=auto-scroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-scroll.d.ts","sourceRoot":"","sources":["../../src/primitives/auto-scroll.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,SAAK,EAAE,OAAO,SAAK,GAAG,MAAM,CAO7G;AAID,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAU5E"}
@@ -0,0 +1,30 @@
1
+ export declare function syncControlName(control: HTMLElement | null | undefined, host: HTMLElement, labelId: string | null, fallbackName?: string): void;
2
+ /**
3
+ * Keeps the text of an `<slot>`'s fallback content in step with an attribute. Fallback text written
4
+ * only at first render goes stale when a framework sets the attribute after the element connects
5
+ * (React does), leaving an empty label or description.
6
+ */
7
+ export declare function syncSlotFallbackText(slot: HTMLSlotElement | null | undefined, text: string): void;
8
+ /**
9
+ * What the host was described with from outside its shadow root: its own `aria-description` plus the text
10
+ * of any `aria-describedby` ids that resolve where the host lives. A `ui-field` supplies its description
11
+ * and error this way; its own ids sit in another shadow root and could never be followed.
12
+ */
13
+ export declare function externalDescriptionText(host: HTMLElement): string;
14
+ /**
15
+ * Keeps one visually hidden element, next to `anchor`, holding the host's external description, and
16
+ * returns its id (or null when there is nothing to say) so a control in the same shadow root can point
17
+ * an aria-describedby at it.
18
+ */
19
+ export declare function syncExternalDescription(anchor: HTMLElement | null | undefined, host: HTMLElement, uid: string): string | null;
20
+ /**
21
+ * Sets `aria-describedby` on a control inside a shadow root: the ids of descriptions that live in that
22
+ * same root (`ownIds`), plus the host's external description (see `syncExternalDescription`).
23
+ */
24
+ export declare function syncControlDescription(control: HTMLElement | null | undefined, host: HTMLElement, uid: string, ownIds?: string[]): void;
25
+ /** The same hidden description as markup, for components that render their shadow root from a template. */
26
+ export declare function externalDescriptionMarkup(host: HTMLElement, uid: string): {
27
+ id: string;
28
+ html: string;
29
+ };
30
+ //# sourceMappingURL=control-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-name.d.ts","sourceRoot":"","sources":["../../src/primitives/control-name.ts"],"names":[],"mappings":"AAQA,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACvC,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,YAAY,SAAK,GAChB,IAAI,CAaN;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAIjG;AAKD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAUjE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqB7H;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACvC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,MAAM,EAAO,GACpB,IAAI,CASN;AAED,2GAA2G;AAC3G,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAMtG"}
@@ -0,0 +1,4 @@
1
+ export declare function isValidSelector(selector: string): boolean;
2
+ /** `root.querySelector(selector)` that yields null instead of throwing on an invalid selector. */
3
+ export declare function safeQuerySelector<T extends Element = Element>(root: ParentNode, selector: string): T | null;
4
+ //# sourceMappingURL=selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../src/primitives/selector.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAazD;AAED,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAG3G"}
@@ -0,0 +1,2 @@
1
+ export declare function resolveTriggerControl(trigger: HTMLElement): HTMLElement;
2
+ //# sourceMappingURL=trigger.d.ts.map