@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,54 +1,54 @@
1
1
  import { E as g } from "./ElementBase-YlTLMsGk.mjs";
2
2
  import { n as b } from "./collection-C7URGjEI.mjs";
3
3
  import { UITreeItem as f } from "./tree-item.esm.js";
4
- function C(l, t) {
4
+ function C(a, t) {
5
5
  const e = [], i = t.getExpanded || (() => !1), r = t.getDisabled || (() => !1), s = (d, n, o) => {
6
- d.forEach((a) => {
7
- const u = t.getChildren(a) || [], c = {
8
- item: a,
9
- id: t.getId(a),
10
- label: t.getLabel(a),
6
+ d.forEach((l) => {
7
+ const u = t.getChildren(l) || [], c = {
8
+ item: l,
9
+ id: t.getId(l),
10
+ label: t.getLabel(l),
11
11
  level: n,
12
12
  parentId: o,
13
- disabled: r(a),
14
- expanded: i(a),
13
+ disabled: r(l),
14
+ expanded: i(l),
15
15
  hasChildren: u.length > 0
16
16
  };
17
17
  e.push(c), s(u, n + 1, c.id);
18
18
  });
19
19
  };
20
- return s(l, 1, null), e;
20
+ return s(a, 1, null), e;
21
21
  }
22
- function _(l, t) {
22
+ function _(a, t) {
23
23
  const e = [], i = t.getExpanded || (() => !1), r = t.getDisabled || (() => !1), s = (d, n, o) => {
24
- d.forEach((a) => {
25
- const u = t.getChildren(a) || [], c = i(a), h = {
26
- item: a,
27
- id: t.getId(a),
28
- label: t.getLabel(a),
24
+ d.forEach((l) => {
25
+ const u = t.getChildren(l) || [], c = i(l), h = {
26
+ item: l,
27
+ id: t.getId(l),
28
+ label: t.getLabel(l),
29
29
  level: n,
30
30
  parentId: o,
31
- disabled: r(a),
31
+ disabled: r(l),
32
32
  expanded: c,
33
33
  hasChildren: u.length > 0
34
34
  };
35
35
  e.push(h), h.hasChildren && c && s(u, n + 1, h.id);
36
36
  });
37
37
  };
38
- return s(l, 1, null), e;
38
+ return s(a, 1, null), e;
39
39
  }
40
- function p(l, t) {
41
- return l.findIndex((e) => e.id === t);
40
+ function p(a, t) {
41
+ return a.findIndex((e) => e.id === t);
42
42
  }
43
- function m(l, t) {
44
- const e = l[t];
45
- return e?.parentId ? l.findIndex((i) => i.id === e.parentId) : -1;
43
+ function y(a, t) {
44
+ const e = a[t];
45
+ return e?.parentId ? a.findIndex((i) => i.id === e.parentId) : -1;
46
46
  }
47
- function y(l, t, e = -1) {
47
+ function m(a, t, e = -1) {
48
48
  const i = b(t);
49
49
  if (!i) return -1;
50
- for (let r = 1; r <= l.length; r += 1) {
51
- const s = (e + r + l.length) % l.length, d = l[s];
50
+ for (let r = 1; r <= a.length; r += 1) {
51
+ const s = (e + r + a.length) % a.length, d = a[s];
52
52
  if (!d.disabled && b(d.label).startsWith(i))
53
53
  return s;
54
54
  }
@@ -61,7 +61,7 @@ const v = `
61
61
  --ui-tree-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent);
62
62
  --ui-tree-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
63
63
  --ui-tree-text: var(--ui-color-text, #0f172a);
64
- --ui-tree-muted: var(--ui-color-muted, #64748b);
64
+ --ui-tree-muted: var(--ui-color-muted, #526175);
65
65
  display: block;
66
66
  min-inline-size: 0;
67
67
  color-scheme: light dark;
@@ -93,7 +93,7 @@ class x extends g {
93
93
  super(), this._observer = null, this._focusedValue = null, this._typeaheadBuffer = "", this._typeaheadTimer = null, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onMutation = this._onMutation.bind(this);
94
94
  }
95
95
  static get observedAttributes() {
96
- return ["value", "indent-size"];
96
+ return ["value", "indent-size", "aria-label", "aria-labelledby"];
97
97
  }
98
98
  connectedCallback() {
99
99
  super.connectedCallback(), this.addEventListener("click", this._onClick), this.addEventListener("keydown", this._onKeyDown), this._observer = new MutationObserver(this._onMutation), this._observer.observe(this, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["expanded", "selected", "disabled", "label", "value"] }), queueMicrotask(() => this._syncTree());
@@ -247,7 +247,7 @@ class x extends g {
247
247
  this.collapse(r.id);
248
248
  return;
249
249
  }
250
- const s = m(e, i);
250
+ const s = y(e, i);
251
251
  s >= 0 && this.focusValue(e[s].id);
252
252
  return;
253
253
  }
@@ -259,18 +259,19 @@ class x extends g {
259
259
  this._typeaheadBuffer = `${this._typeaheadBuffer}${t.key.toLowerCase()}`.slice(0, 24), this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => {
260
260
  this._typeaheadBuffer = "", this._typeaheadTimer = null;
261
261
  }, 420);
262
- const s = y(e, this._typeaheadBuffer, i);
262
+ const s = m(e, this._typeaheadBuffer, i);
263
263
  s >= 0 && (t.preventDefault(), this.focusValue(e[s].id));
264
264
  }
265
265
  }
266
266
  }
267
267
  shouldRenderOnAttributeChange(t) {
268
- return t === "indent-size";
268
+ return t === "indent-size" || t === "aria-label" || t === "aria-labelledby";
269
269
  }
270
270
  render() {
271
+ const t = (this.getAttribute("aria-label") || "").trim(), e = (this.getAttribute("aria-labelledby") || "").trim(), i = (s) => s.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), r = (t ? ` aria-label="${i(t)}"` : "") + (e ? ` aria-labelledby="${i(e)}"` : "");
271
272
  this.setContent(`
272
273
  <style>${v}</style>
273
- <div class="tree" part="tree" role="tree">
274
+ <div class="tree" part="tree" role="tree"${r}>
274
275
  <slot></slot>
275
276
  </div>
276
277
  `), queueMicrotask(() => this._syncTree());
@@ -280,8 +281,8 @@ typeof customElements < "u" && !customElements.get("ui-tree") && customElements.
280
281
  export {
281
282
  x as U,
282
283
  p as a,
283
- y as b,
284
+ m as b,
284
285
  C as c,
285
286
  _ as d,
286
- m as f
287
+ y as f
287
288
  };
package/dist/tree.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./tree-Dx_kv_ih.js");exports.UITree=e.UITree;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./tree-7qbVnpGp.js");exports.UITree=e.UITree;
package/dist/tree.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { U as o } from "./tree-B3kE8ESs.mjs";
1
+ import { U as o } from "./tree-Deoft-kO.mjs";
2
2
  export {
3
3
  o as UITree
4
4
  };
@@ -0,0 +1,9 @@
1
+ const n = 'button, a[href], input, select, textarea, summary, [role="button"], [tabindex]:not([tabindex="-1"]), ui-button';
2
+ function o(t) {
3
+ if (t.matches(n)) return t;
4
+ const e = t.querySelector(n);
5
+ return e || (t.hasAttribute("role") || t.setAttribute("role", "button"), t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0"), t);
6
+ }
7
+ export {
8
+ o as r
9
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n='button, a[href], input, select, textarea, summary, [role="button"], [tabindex]:not([tabindex="-1"]), ui-button';function o(t){if(t.matches(n))return t;const e=t.querySelector(n);return e||(t.hasAttribute("role")||t.setAttribute("role","button"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t)}exports.resolveTriggerControl=o;
@@ -1,4 +1,4 @@
1
- "use strict";const D=require("./ElementBase-EV6mVBUV.js");require("./ui-icon-BzVNC_lr.js");const F=`
1
+ "use strict";const P=require("./ElementBase-EV6mVBUV.js");require("./ui-icon-Bvt9oIIR.js");const I=`
2
2
  :host {
3
3
  --ui-btn-radius: var(--ui-control-radius, var(--ui-radius, 4px));
4
4
  --ui-btn-min-height: var(--ui-control-min-height, var(--base-button-height-md, 40px));
@@ -17,7 +17,7 @@
17
17
  --ui-btn-surface: var(--ui-color-surface, #ffffff);
18
18
  --ui-btn-surface-alt: var(--ui-color-surface-alt, #f8fafc);
19
19
  --ui-btn-text: var(--ui-color-text, #0f172a);
20
- --ui-btn-muted: var(--ui-color-muted, #64748b);
20
+ --ui-btn-muted: var(--ui-color-muted, #526175);
21
21
  --ui-btn-ring: var(--ui-color-focus-ring, #2563eb);
22
22
 
23
23
  display: inline-flex;
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  :host([tone="neutral"]) {
36
- --ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #64748b) 74%, var(--ui-color-text, #0f172a) 26%);
36
+ --ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #526175) 74%, var(--ui-color-text, #0f172a) 26%);
37
37
  }
38
38
 
39
39
  :host([tone="info"]) {
@@ -41,11 +41,11 @@
41
41
  }
42
42
 
43
43
  :host([tone="success"]) {
44
- --ui-btn-accent: var(--ui-color-success, #16a34a);
44
+ --ui-btn-accent: var(--ui-color-success, #15803d);
45
45
  }
46
46
 
47
47
  :host([tone="warning"]) {
48
- --ui-btn-accent: var(--ui-color-warning, #d97706);
48
+ --ui-btn-accent: var(--ui-color-warning, #b45309);
49
49
  }
50
50
 
51
51
  :host([tone="danger"]) {
@@ -57,7 +57,7 @@
57
57
  }
58
58
 
59
59
  :host([state="success"]) {
60
- --ui-btn-accent: var(--ui-color-success, #16a34a);
60
+ --ui-btn-accent: var(--ui-color-success, #15803d);
61
61
  }
62
62
 
63
63
  :host([theme="dark"]) {
@@ -85,8 +85,8 @@
85
85
  }
86
86
 
87
87
  :host([recipe="soft"]) {
88
- --ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%, white);
89
- --ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%, white);
88
+ --ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%, var(--ui-color-surface, #ffffff));
89
+ --ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%, var(--ui-color-surface, #ffffff));
90
90
  }
91
91
 
92
92
  :host([recipe="soft"]) .btn--secondary {
@@ -229,7 +229,8 @@
229
229
 
230
230
  .btn--primary {
231
231
  background: var(--ui-btn-accent);
232
- color: #ffffff;
232
+ /* The theme's text colour for a primary fill: the default theme's amber needs dark text. */
233
+ color: var(--ui-color-foreground-on-primary, #ffffff);
233
234
  border-color: color-mix(in srgb, var(--ui-btn-accent) 74%, #0f172a 26%);
234
235
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-btn-accent) 22%, transparent);
235
236
  }
@@ -240,7 +241,7 @@
240
241
 
241
242
  .btn--secondary {
242
243
  background: var(--ui-btn-surface);
243
- color: color-mix(in srgb, var(--ui-btn-accent) 78%, var(--ui-btn-text) 22%);
244
+ color: color-mix(in srgb, var(--ui-btn-accent) 50%, var(--ui-btn-text) 50%);
244
245
  border-color: color-mix(in srgb, var(--ui-btn-accent) 22%, var(--ui-btn-muted));
245
246
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.06);
246
247
  }
@@ -251,7 +252,7 @@
251
252
 
252
253
  .btn--ghost {
253
254
  background: transparent;
254
- color: color-mix(in srgb, var(--ui-btn-accent) 80%, var(--ui-btn-text) 20%);
255
+ color: color-mix(in srgb, var(--ui-btn-accent) 50%, var(--ui-btn-text) 50%);
255
256
  border-color: transparent;
256
257
  box-shadow: none;
257
258
  }
@@ -272,25 +273,25 @@
272
273
  }
273
274
 
274
275
  .btn--success {
275
- background: var(--ui-color-success, #16a34a);
276
+ background: var(--ui-color-success, #15803d);
276
277
  color: #ffffff;
277
- border-color: color-mix(in srgb, var(--ui-color-success, #16a34a) 70%, #0f172a 30%);
278
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-success, #16a34a) 20%, transparent);
278
+ border-color: color-mix(in srgb, var(--ui-color-success, #15803d) 70%, #0f172a 30%);
279
+ box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-success, #15803d) 20%, transparent);
279
280
  }
280
281
 
281
282
  .btn--success:hover:not([disabled]) {
282
- background: color-mix(in srgb, var(--ui-color-success, #16a34a) 86%, #0f172a 14%);
283
+ background: color-mix(in srgb, var(--ui-color-success, #15803d) 86%, #0f172a 14%);
283
284
  }
284
285
 
285
286
  .btn--warning {
286
- background: var(--ui-color-warning, #d97706);
287
+ background: var(--ui-color-warning, #b45309);
287
288
  color: #ffffff;
288
- border-color: color-mix(in srgb, var(--ui-color-warning, #d97706) 70%, #0f172a 30%);
289
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-warning, #d97706) 18%, transparent);
289
+ border-color: color-mix(in srgb, var(--ui-color-warning, #b45309) 70%, #0f172a 30%);
290
+ box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-warning, #b45309) 18%, transparent);
290
291
  }
291
292
 
292
293
  .btn--warning:hover:not([disabled]) {
293
- background: color-mix(in srgb, var(--ui-color-warning, #d97706) 86%, #0f172a 14%);
294
+ background: color-mix(in srgb, var(--ui-color-warning, #b45309) 86%, #0f172a 14%);
294
295
  }
295
296
 
296
297
  :host([size="sm"]) {
@@ -318,7 +319,7 @@
318
319
  }
319
320
 
320
321
  :host([state="success"]) .btn:not([disabled]) {
321
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #16a34a) 30%, transparent), 0 8px 18px rgba(22, 163, 74, 0.14);
322
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #15803d) 30%, transparent), 0 8px 18px rgba(22, 163, 74, 0.14);
322
323
  }
323
324
 
324
325
  :host([data-animation]) .btn:not([disabled]):hover {
@@ -501,21 +502,21 @@
501
502
  color: HighlightText;
502
503
  }
503
504
  }
504
- `;function _(t){return t!==null&&t.toLowerCase()!=="false"&&t!=="0"}function I(t){return t==="secondary"||t==="ghost"||t==="danger"||t==="success"||t==="warning"?t:"primary"}function U(t){return t==="sm"||t==="lg"?t:"md"}function S(t){return t==="scale"||t==="pulse"||t==="none"?t:null}function N(t){return t==="neutral"||t==="info"||t==="success"||t==="warning"||t==="danger"?t:null}function G(t){return t==="loading"||t==="error"||t==="success"?t:"idle"}function $(t){return t==="submit"||t==="reset"?t:"button"}function J(t){return t==="classic"||t==="solid"||t==="soft"||t==="surface"||t==="outline"||t==="ghost"?t:null}function K(t){return t==="none"||t==="sm"||t==="md"||t==="lg"||t==="full"?t:null}function Q(t){return t==="1"||t==="2"||t==="3"||t==="4"?t:null}function V(t){if(!t)return null;const n=t.trim();return n?n==="full"?"999px":/^-?\d+(\.\d+)?$/.test(n)?`${n}px`:n:null}function r(t,n){const e=t.getAttribute(n);if(e!=null)return e;const i=t[n];return typeof i=="string"&&i.length>0?i:null}function c(t,n){const e=t.getAttribute(n);if(e!=null)return _(e);const i=t[n];return typeof i=="boolean"?i:typeof i=="string"?_(i):!1}function u(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function L(t,n){return!!t.querySelector(`[slot="${n}"]`)}function W(t,n){if(n==="button")return;const e=t.closest("form");if(!e)return;if(n==="reset"){e.reset();return}if(typeof e.requestSubmit=="function"){e.requestSubmit();return}const i=new Event("submit",{bubbles:!0,cancelable:!0});e.dispatchEvent(i)}class E extends D.ElementBase{constructor(){super(),this._slots=[],this._contentObserver=null,this._onRootClick=this._onRootClick.bind(this),this._onSlotChange=this._onSlotChange.bind(this),this._onContentMutations=this._onContentMutations.bind(this)}static get observedAttributes(){return["disabled","variant","size","headless","loading","icon","block","animation","theme","tone","state","type","recipe","shape","radius","scale","loading-label","aria-label"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this._contentObserver=new MutationObserver(this._onContentMutations),this._contentObserver.observe(this,{childList:!0,subtree:!1,characterData:!0})}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this._contentObserver?.disconnect(),this._contentObserver=null,this._detachSlotListeners(),super.disconnectedCallback()}attributeChangedCallback(n,e,i){if(e!==i){if(n==="animation"){const o=S(i);o?this.setAttribute("data-animation",o):this.removeAttribute("data-animation")}this.isConnected&&this.requestRender()}}_onRootClick(n){const i=n.target?.closest('button[data-ui-button="true"]');if(!i||i.disabled)return;const o=$(i.getAttribute("data-request-type"));queueMicrotask(()=>{n.defaultPrevented||W(this,o)})}_attachSlotListeners(){this._detachSlotListeners(),this._slots=Array.from(this.root.querySelectorAll("slot")),this._slots.forEach(n=>n.addEventListener("slotchange",this._onSlotChange))}_detachSlotListeners(){this._slots.forEach(n=>n.removeEventListener("slotchange",this._onSlotChange)),this._slots=[]}_onSlotChange(){this.requestRender()}_onContentMutations(){this.requestRender()}render(){const n=c(this,"disabled"),e=c(this,"loading"),i=r(this,"state"),o=G(i),s=e||o==="loading",l=r(this,"icon"),q=I(r(this,"variant")),b=r(this,"size"),d=U(b),h=S(r(this,"animation")),a=r(this,"theme"),p=a==="dark"||a==="brand"?a:null,f=r(this,"tone"),g=N(f),R=c(this,"block"),T=c(this,"headless"),M=$(r(this,"type")),m=J(r(this,"recipe")),x=r(this,"shape"),v=K(x),B=r(this,"radius"),y=V(B),w=Q(r(this,"scale")),k=r(this,"aria-label"),j=r(this,"loading-label")||"Loading";h?this.setAttribute("data-animation",h):this.removeAttribute("data-animation"),R?this.setAttribute("block",""):this.removeAttribute("block"),T?this.setAttribute("headless",""):this.removeAttribute("headless"),f!=null&&(g?this.setAttribute("tone",g):this.removeAttribute("tone")),b!=null&&(d==="md"?this.removeAttribute("size"):this.setAttribute("size",d)),a!=null&&(p?this.setAttribute("theme",p):this.removeAttribute("theme")),i!=null&&(o==="idle"?this.removeAttribute("state"):this.setAttribute("state",o)),m?this.setAttribute("recipe",m):this.removeAttribute("recipe"),x!=null&&(v?this.setAttribute("shape",v):this.removeAttribute("shape")),y?this.style.setProperty("--ui-btn-radius",y):this.style.removeProperty("--ui-btn-radius"),w?this.setAttribute("scale",w):this.removeAttribute("scale");const z=n||s;z?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled"),s?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy");const H=L(this,"prefix"),O=L(this,"suffix"),A=!s&&l?`<ui-icon class="icon" name="${u(l)}" aria-hidden="true"></ui-icon>`:"",C=s?'<span class="spinner" aria-hidden="true" part="spinner"></span>':"",Y=C||A||H?`<span class="slot slot--prefix" part="prefix">${C}${A}${s?"":'<slot name="prefix"></slot>'}</span>`:"",P=O?'<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>':"";this.setContent(`
505
- <style>${F}</style>
505
+ `;function S(t){return t!==null&&t.toLowerCase()!=="false"&&t!=="0"}function U(t){return t==="secondary"||t==="ghost"||t==="danger"||t==="success"||t==="warning"?t:"primary"}function N(t){return t==="sm"||t==="lg"?t:"md"}function C(t){return t==="scale"||t==="pulse"||t==="none"?t:null}function W(t){return t==="neutral"||t==="info"||t==="success"||t==="warning"||t==="danger"?t:null}function G(t){return t==="loading"||t==="error"||t==="success"?t:"idle"}function $(t){return t==="submit"||t==="reset"?t:"button"}function J(t){return t==="classic"||t==="solid"||t==="soft"||t==="surface"||t==="outline"||t==="ghost"?t:null}function K(t){return t==="none"||t==="sm"||t==="md"||t==="lg"||t==="full"?t:null}function Q(t){return t==="1"||t==="2"||t==="3"||t==="4"?t:null}function V(t){if(!t)return null;const n=t.trim();return n?n==="full"?"999px":/^-?\d+(\.\d+)?$/.test(n)?`${n}px`:n:null}function r(t,n){const e=t.getAttribute(n);if(e!=null)return e;const i=t[n];return typeof i=="string"&&i.length>0?i:null}function c(t,n){const e=t.getAttribute(n);if(e!=null)return S(e);const i=t[n];return typeof i=="boolean"?i:typeof i=="string"?S(i):!1}function u(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function E(t,n){return!!t.querySelector(`[slot="${n}"]`)}function X(t,n){if(n==="button")return;const e=t.closest("form");if(!e)return;if(n==="reset"){e.reset();return}if(typeof e.requestSubmit=="function"){e.requestSubmit();return}const i=new Event("submit",{bubbles:!0,cancelable:!0});e.dispatchEvent(i)}const T=["aria-expanded","aria-haspopup","aria-pressed"];class L extends P.ElementBase{constructor(){super(),this._slots=[],this._contentObserver=null,this._onRootClick=this._onRootClick.bind(this),this._onSlotChange=this._onSlotChange.bind(this),this._onContentMutations=this._onContentMutations.bind(this)}static get observedAttributes(){return["disabled","variant","size","headless","loading","icon","block","animation","theme","tone","state","type","recipe","shape","radius","scale","loading-label","aria-label","aria-expanded","aria-haspopup","aria-pressed"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this._contentObserver=new MutationObserver(this._onContentMutations),this._contentObserver.observe(this,{childList:!0,subtree:!1,characterData:!0})}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this._contentObserver?.disconnect(),this._contentObserver=null,this._detachSlotListeners(),super.disconnectedCallback()}attributeChangedCallback(n,e,i){if(e!==i){if(n==="animation"){const o=C(i);o?this.setAttribute("data-animation",o):this.removeAttribute("data-animation")}if(T.includes(n)){this._syncForwardedState();return}this.isConnected&&this.requestRender()}}_syncForwardedState(){const n=this.root.querySelector('button[data-ui-button="true"]');if(n)for(const e of T){const i=this.getAttribute(e);i==null||i===""?n.removeAttribute(e):n.getAttribute(e)!==i&&n.setAttribute(e,i)}}_onRootClick(n){const i=n.target?.closest('button[data-ui-button="true"]');if(!i||i.disabled)return;const o=$(i.getAttribute("data-request-type"));queueMicrotask(()=>{n.defaultPrevented||X(this,o)})}_attachSlotListeners(){this._detachSlotListeners(),this._slots=Array.from(this.root.querySelectorAll("slot")),this._slots.forEach(n=>n.addEventListener("slotchange",this._onSlotChange))}_detachSlotListeners(){this._slots.forEach(n=>n.removeEventListener("slotchange",this._onSlotChange)),this._slots=[]}_onSlotChange(){this.requestRender()}_onContentMutations(){this.requestRender()}render(){const n=c(this,"disabled"),e=c(this,"loading"),i=r(this,"state"),o=G(i),s=e||o==="loading",l=r(this,"icon"),q=U(r(this,"variant")),b=r(this,"size"),d=N(b),h=C(r(this,"animation")),a=r(this,"theme"),p=a==="dark"||a==="brand"?a:null,f=r(this,"tone"),g=W(f),R=c(this,"block"),M=c(this,"headless"),B=$(r(this,"type")),m=J(r(this,"recipe")),x=r(this,"shape"),v=K(x),O=r(this,"radius"),y=V(O),w=Q(r(this,"scale")),k=r(this,"aria-label"),j=r(this,"loading-label")||"Loading";h?this.setAttribute("data-animation",h):this.removeAttribute("data-animation"),R?this.setAttribute("block",""):this.removeAttribute("block"),M?this.setAttribute("headless",""):this.removeAttribute("headless"),f!=null&&(g?this.setAttribute("tone",g):this.removeAttribute("tone")),b!=null&&(d==="md"?this.removeAttribute("size"):this.setAttribute("size",d)),a!=null&&(p?this.setAttribute("theme",p):this.removeAttribute("theme")),i!=null&&(o==="idle"?this.removeAttribute("state"):this.setAttribute("state",o)),m?this.setAttribute("recipe",m):this.removeAttribute("recipe"),x!=null&&(v?this.setAttribute("shape",v):this.removeAttribute("shape")),y?this.style.setProperty("--ui-btn-radius",y):this.style.removeProperty("--ui-btn-radius"),w?this.setAttribute("scale",w):this.removeAttribute("scale");const A=n||s;A?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled"),s?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy");const F=E(this,"prefix"),H=E(this,"suffix"),z=!s&&l?`<ui-icon class="icon" name="${u(l)}" aria-hidden="true"></ui-icon>`:"",_=s?'<span class="spinner" aria-hidden="true" part="spinner"></span>':"",Y=_||z||F?`<span class="slot slot--prefix" part="prefix">${_}${z}${s?"":'<slot name="prefix"></slot>'}</span>`:"",D=H?'<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>':"";this.setContent(`
506
+ <style>${I}</style>
506
507
  <button
507
508
  class="btn btn--${q}"
508
509
  part="button"
509
510
  type="button"
510
511
  data-ui-button="true"
511
- data-request-type="${M}"
512
+ data-request-type="${B}"
512
513
  aria-busy="${s?"true":"false"}"
513
514
  ${k?`aria-label="${u(k)}"`:""}
514
- ${z?"disabled":""}
515
+ ${A?"disabled":""}
515
516
  >
516
517
  ${Y}
517
518
  <span class="slot slot--label" part="label"><slot></slot></span>
518
- ${P}
519
+ ${D}
519
520
  ${s?`<span class="sr-only">${u(j)}</span>`:""}
520
521
  </button>
521
- `),this._attachSlotListeners()}}typeof customElements<"u"&&!customElements.get("ui-button")&&customElements.define("ui-button",E);exports.UIButton=E;
522
+ `),this._syncForwardedState(),this._attachSlotListeners()}}typeof customElements<"u"&&!customElements.get("ui-button")&&customElements.define("ui-button",L);exports.UIButton=L;
@@ -1,6 +1,6 @@
1
- import { E as P } from "./ElementBase-YlTLMsGk.mjs";
2
- import "./ui-icon-YI6lyuqU.mjs";
3
- const D = `
1
+ import { E as D } from "./ElementBase-YlTLMsGk.mjs";
2
+ import "./ui-icon-BSi_GtqO.mjs";
3
+ const P = `
4
4
  :host {
5
5
  --ui-btn-radius: var(--ui-control-radius, var(--ui-radius, 4px));
6
6
  --ui-btn-min-height: var(--ui-control-min-height, var(--base-button-height-md, 40px));
@@ -19,7 +19,7 @@ const D = `
19
19
  --ui-btn-surface: var(--ui-color-surface, #ffffff);
20
20
  --ui-btn-surface-alt: var(--ui-color-surface-alt, #f8fafc);
21
21
  --ui-btn-text: var(--ui-color-text, #0f172a);
22
- --ui-btn-muted: var(--ui-color-muted, #64748b);
22
+ --ui-btn-muted: var(--ui-color-muted, #526175);
23
23
  --ui-btn-ring: var(--ui-color-focus-ring, #2563eb);
24
24
 
25
25
  display: inline-flex;
@@ -35,7 +35,7 @@ const D = `
35
35
  }
36
36
 
37
37
  :host([tone="neutral"]) {
38
- --ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #64748b) 74%, var(--ui-color-text, #0f172a) 26%);
38
+ --ui-btn-accent: color-mix(in srgb, var(--ui-color-muted, #526175) 74%, var(--ui-color-text, #0f172a) 26%);
39
39
  }
40
40
 
41
41
  :host([tone="info"]) {
@@ -43,11 +43,11 @@ const D = `
43
43
  }
44
44
 
45
45
  :host([tone="success"]) {
46
- --ui-btn-accent: var(--ui-color-success, #16a34a);
46
+ --ui-btn-accent: var(--ui-color-success, #15803d);
47
47
  }
48
48
 
49
49
  :host([tone="warning"]) {
50
- --ui-btn-accent: var(--ui-color-warning, #d97706);
50
+ --ui-btn-accent: var(--ui-color-warning, #b45309);
51
51
  }
52
52
 
53
53
  :host([tone="danger"]) {
@@ -59,7 +59,7 @@ const D = `
59
59
  }
60
60
 
61
61
  :host([state="success"]) {
62
- --ui-btn-accent: var(--ui-color-success, #16a34a);
62
+ --ui-btn-accent: var(--ui-color-success, #15803d);
63
63
  }
64
64
 
65
65
  :host([theme="dark"]) {
@@ -87,8 +87,8 @@ const D = `
87
87
  }
88
88
 
89
89
  :host([recipe="soft"]) {
90
- --ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%, white);
91
- --ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%, white);
90
+ --ui-btn-surface: color-mix(in srgb, var(--ui-btn-accent) 10%, var(--ui-color-surface, #ffffff));
91
+ --ui-btn-surface-alt: color-mix(in srgb, var(--ui-btn-accent) 14%, var(--ui-color-surface, #ffffff));
92
92
  }
93
93
 
94
94
  :host([recipe="soft"]) .btn--secondary {
@@ -231,7 +231,8 @@ const D = `
231
231
 
232
232
  .btn--primary {
233
233
  background: var(--ui-btn-accent);
234
- color: #ffffff;
234
+ /* The theme's text colour for a primary fill: the default theme's amber needs dark text. */
235
+ color: var(--ui-color-foreground-on-primary, #ffffff);
235
236
  border-color: color-mix(in srgb, var(--ui-btn-accent) 74%, #0f172a 26%);
236
237
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-btn-accent) 22%, transparent);
237
238
  }
@@ -242,7 +243,7 @@ const D = `
242
243
 
243
244
  .btn--secondary {
244
245
  background: var(--ui-btn-surface);
245
- color: color-mix(in srgb, var(--ui-btn-accent) 78%, var(--ui-btn-text) 22%);
246
+ color: color-mix(in srgb, var(--ui-btn-accent) 50%, var(--ui-btn-text) 50%);
246
247
  border-color: color-mix(in srgb, var(--ui-btn-accent) 22%, var(--ui-btn-muted));
247
248
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.06);
248
249
  }
@@ -253,7 +254,7 @@ const D = `
253
254
 
254
255
  .btn--ghost {
255
256
  background: transparent;
256
- color: color-mix(in srgb, var(--ui-btn-accent) 80%, var(--ui-btn-text) 20%);
257
+ color: color-mix(in srgb, var(--ui-btn-accent) 50%, var(--ui-btn-text) 50%);
257
258
  border-color: transparent;
258
259
  box-shadow: none;
259
260
  }
@@ -274,25 +275,25 @@ const D = `
274
275
  }
275
276
 
276
277
  .btn--success {
277
- background: var(--ui-color-success, #16a34a);
278
+ background: var(--ui-color-success, #15803d);
278
279
  color: #ffffff;
279
- border-color: color-mix(in srgb, var(--ui-color-success, #16a34a) 70%, #0f172a 30%);
280
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-success, #16a34a) 20%, transparent);
280
+ border-color: color-mix(in srgb, var(--ui-color-success, #15803d) 70%, #0f172a 30%);
281
+ box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-success, #15803d) 20%, transparent);
281
282
  }
282
283
 
283
284
  .btn--success:hover:not([disabled]) {
284
- background: color-mix(in srgb, var(--ui-color-success, #16a34a) 86%, #0f172a 14%);
285
+ background: color-mix(in srgb, var(--ui-color-success, #15803d) 86%, #0f172a 14%);
285
286
  }
286
287
 
287
288
  .btn--warning {
288
- background: var(--ui-color-warning, #d97706);
289
+ background: var(--ui-color-warning, #b45309);
289
290
  color: #ffffff;
290
- border-color: color-mix(in srgb, var(--ui-color-warning, #d97706) 70%, #0f172a 30%);
291
- box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-warning, #d97706) 18%, transparent);
291
+ border-color: color-mix(in srgb, var(--ui-color-warning, #b45309) 70%, #0f172a 30%);
292
+ box-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ui-color-warning, #b45309) 18%, transparent);
292
293
  }
293
294
 
294
295
  .btn--warning:hover:not([disabled]) {
295
- background: color-mix(in srgb, var(--ui-color-warning, #d97706) 86%, #0f172a 14%);
296
+ background: color-mix(in srgb, var(--ui-color-warning, #b45309) 86%, #0f172a 14%);
296
297
  }
297
298
 
298
299
  :host([size="sm"]) {
@@ -320,7 +321,7 @@ const D = `
320
321
  }
321
322
 
322
323
  :host([state="success"]) .btn:not([disabled]) {
323
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #16a34a) 30%, transparent), 0 8px 18px rgba(22, 163, 74, 0.14);
324
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-color-success, #15803d) 30%, transparent), 0 8px 18px rgba(22, 163, 74, 0.14);
324
325
  }
325
326
 
326
327
  :host([data-animation]) .btn:not([disabled]):hover {
@@ -504,22 +505,22 @@ const D = `
504
505
  }
505
506
  }
506
507
  `;
507
- function _(t) {
508
+ function S(t) {
508
509
  return t !== null && t.toLowerCase() !== "false" && t !== "0";
509
510
  }
510
- function F(t) {
511
+ function U(t) {
511
512
  return t === "secondary" || t === "ghost" || t === "danger" || t === "success" || t === "warning" ? t : "primary";
512
513
  }
513
- function U(t) {
514
+ function I(t) {
514
515
  return t === "sm" || t === "lg" ? t : "md";
515
516
  }
516
- function S(t) {
517
+ function C(t) {
517
518
  return t === "scale" || t === "pulse" || t === "none" ? t : null;
518
519
  }
519
- function I(t) {
520
+ function N(t) {
520
521
  return t === "neutral" || t === "info" || t === "success" || t === "warning" || t === "danger" ? t : null;
521
522
  }
522
- function N(t) {
523
+ function W(t) {
523
524
  return t === "loading" || t === "error" || t === "success" ? t : "idle";
524
525
  }
525
526
  function $(t) {
@@ -547,14 +548,14 @@ function r(t, n) {
547
548
  }
548
549
  function c(t, n) {
549
550
  const e = t.getAttribute(n);
550
- if (e != null) return _(e);
551
+ if (e != null) return S(e);
551
552
  const i = t[n];
552
- return typeof i == "boolean" ? i : typeof i == "string" ? _(i) : !1;
553
+ return typeof i == "boolean" ? i : typeof i == "string" ? S(i) : !1;
553
554
  }
554
555
  function u(t) {
555
556
  return t.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
556
557
  }
557
- function L(t, n) {
558
+ function E(t, n) {
558
559
  return !!t.querySelector(`[slot="${n}"]`);
559
560
  }
560
561
  function V(t, n) {
@@ -572,7 +573,8 @@ function V(t, n) {
572
573
  const i = new Event("submit", { bubbles: !0, cancelable: !0 });
573
574
  e.dispatchEvent(i);
574
575
  }
575
- class W extends P {
576
+ const T = ["aria-expanded", "aria-haspopup", "aria-pressed"];
577
+ class X extends D {
576
578
  constructor() {
577
579
  super(), this._slots = [], this._contentObserver = null, this._onRootClick = this._onRootClick.bind(this), this._onSlotChange = this._onSlotChange.bind(this), this._onContentMutations = this._onContentMutations.bind(this);
578
580
  }
@@ -595,7 +597,10 @@ class W extends P {
595
597
  "radius",
596
598
  "scale",
597
599
  "loading-label",
598
- "aria-label"
600
+ "aria-label",
601
+ "aria-expanded",
602
+ "aria-haspopup",
603
+ "aria-pressed"
599
604
  ];
600
605
  }
601
606
  connectedCallback() {
@@ -607,12 +612,24 @@ class W extends P {
607
612
  attributeChangedCallback(n, e, i) {
608
613
  if (e !== i) {
609
614
  if (n === "animation") {
610
- const o = S(i);
615
+ const o = C(i);
611
616
  o ? this.setAttribute("data-animation", o) : this.removeAttribute("data-animation");
612
617
  }
618
+ if (T.includes(n)) {
619
+ this._syncForwardedState();
620
+ return;
621
+ }
613
622
  this.isConnected && this.requestRender();
614
623
  }
615
624
  }
625
+ _syncForwardedState() {
626
+ const n = this.root.querySelector('button[data-ui-button="true"]');
627
+ if (n)
628
+ for (const e of T) {
629
+ const i = this.getAttribute(e);
630
+ i == null || i === "" ? n.removeAttribute(e) : n.getAttribute(e) !== i && n.setAttribute(e, i);
631
+ }
632
+ }
616
633
  _onRootClick(n) {
617
634
  const i = n.target?.closest('button[data-ui-button="true"]');
618
635
  if (!i || i.disabled) return;
@@ -634,32 +651,32 @@ class W extends P {
634
651
  this.requestRender();
635
652
  }
636
653
  render() {
637
- const n = c(this, "disabled"), e = c(this, "loading"), i = r(this, "state"), o = N(i), s = e || o === "loading", l = r(this, "icon"), E = F(r(this, "variant")), b = r(this, "size"), d = U(b), h = S(r(this, "animation")), a = r(this, "theme"), p = a === "dark" || a === "brand" ? a : null, f = r(this, "tone"), g = I(f), q = c(this, "block"), R = c(this, "headless"), T = $(r(this, "type")), m = G(r(this, "recipe")), x = r(this, "shape"), v = J(x), M = r(this, "radius"), y = Q(M), w = K(r(this, "scale")), k = r(this, "aria-label"), B = r(this, "loading-label") || "Loading";
638
- h ? this.setAttribute("data-animation", h) : this.removeAttribute("data-animation"), q ? this.setAttribute("block", "") : this.removeAttribute("block"), R ? this.setAttribute("headless", "") : this.removeAttribute("headless"), f != null && (g ? this.setAttribute("tone", g) : this.removeAttribute("tone")), b != null && (d === "md" ? this.removeAttribute("size") : this.setAttribute("size", d)), a != null && (p ? this.setAttribute("theme", p) : this.removeAttribute("theme")), i != null && (o === "idle" ? this.removeAttribute("state") : this.setAttribute("state", o)), m ? this.setAttribute("recipe", m) : this.removeAttribute("recipe"), x != null && (v ? this.setAttribute("shape", v) : this.removeAttribute("shape")), y ? this.style.setProperty("--ui-btn-radius", y) : this.style.removeProperty("--ui-btn-radius"), w ? this.setAttribute("scale", w) : this.removeAttribute("scale");
639
- const z = n || s;
640
- z ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"), s ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
641
- const j = L(this, "prefix"), H = L(this, "suffix"), A = !s && l ? `<ui-icon class="icon" name="${u(l)}" aria-hidden="true"></ui-icon>` : "", C = s ? '<span class="spinner" aria-hidden="true" part="spinner"></span>' : "", O = C || A || j ? `<span class="slot slot--prefix" part="prefix">${C}${A}${s ? "" : '<slot name="prefix"></slot>'}</span>` : "", Y = H ? '<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>' : "";
654
+ const n = c(this, "disabled"), e = c(this, "loading"), i = r(this, "state"), o = W(i), s = e || o === "loading", l = r(this, "icon"), L = U(r(this, "variant")), b = r(this, "size"), d = I(b), h = C(r(this, "animation")), a = r(this, "theme"), p = a === "dark" || a === "brand" ? a : null, f = r(this, "tone"), g = N(f), R = c(this, "block"), q = c(this, "headless"), M = $(r(this, "type")), m = G(r(this, "recipe")), x = r(this, "shape"), v = J(x), B = r(this, "radius"), y = Q(B), w = K(r(this, "scale")), k = r(this, "aria-label"), O = r(this, "loading-label") || "Loading";
655
+ h ? this.setAttribute("data-animation", h) : this.removeAttribute("data-animation"), R ? this.setAttribute("block", "") : this.removeAttribute("block"), q ? this.setAttribute("headless", "") : this.removeAttribute("headless"), f != null && (g ? this.setAttribute("tone", g) : this.removeAttribute("tone")), b != null && (d === "md" ? this.removeAttribute("size") : this.setAttribute("size", d)), a != null && (p ? this.setAttribute("theme", p) : this.removeAttribute("theme")), i != null && (o === "idle" ? this.removeAttribute("state") : this.setAttribute("state", o)), m ? this.setAttribute("recipe", m) : this.removeAttribute("recipe"), x != null && (v ? this.setAttribute("shape", v) : this.removeAttribute("shape")), y ? this.style.setProperty("--ui-btn-radius", y) : this.style.removeProperty("--ui-btn-radius"), w ? this.setAttribute("scale", w) : this.removeAttribute("scale");
656
+ const A = n || s;
657
+ A ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"), s ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
658
+ const j = E(this, "prefix"), F = E(this, "suffix"), z = !s && l ? `<ui-icon class="icon" name="${u(l)}" aria-hidden="true"></ui-icon>` : "", _ = s ? '<span class="spinner" aria-hidden="true" part="spinner"></span>' : "", H = _ || z || j ? `<span class="slot slot--prefix" part="prefix">${_}${z}${s ? "" : '<slot name="prefix"></slot>'}</span>` : "", Y = F ? '<span class="slot slot--suffix" part="suffix"><slot name="suffix"></slot></span>' : "";
642
659
  this.setContent(`
643
- <style>${D}</style>
660
+ <style>${P}</style>
644
661
  <button
645
- class="btn btn--${E}"
662
+ class="btn btn--${L}"
646
663
  part="button"
647
664
  type="button"
648
665
  data-ui-button="true"
649
- data-request-type="${T}"
666
+ data-request-type="${M}"
650
667
  aria-busy="${s ? "true" : "false"}"
651
668
  ${k ? `aria-label="${u(k)}"` : ""}
652
- ${z ? "disabled" : ""}
669
+ ${A ? "disabled" : ""}
653
670
  >
654
- ${O}
671
+ ${H}
655
672
  <span class="slot slot--label" part="label"><slot></slot></span>
656
673
  ${Y}
657
- ${s ? `<span class="sr-only">${u(B)}</span>` : ""}
674
+ ${s ? `<span class="sr-only">${u(O)}</span>` : ""}
658
675
  </button>
659
- `), this._attachSlotListeners();
676
+ `), this._syncForwardedState(), this._attachSlotListeners();
660
677
  }
661
678
  }
662
- typeof customElements < "u" && !customElements.get("ui-button") && customElements.define("ui-button", W);
679
+ typeof customElements < "u" && !customElements.get("ui-button") && customElements.define("ui-button", X);
663
680
  export {
664
- W as U
681
+ X as U
665
682
  };
@@ -189,8 +189,8 @@ const z = `
189
189
  }
190
190
 
191
191
  :host([tone="brand"]) { --ui-icon-color: var(--ui-color-primary, var(--ui-primary, #2563eb)); }
192
- :host([tone="success"]) { --ui-icon-color: var(--ui-color-success, var(--ui-success, #16a34a)); }
193
- :host([tone="warning"]) { --ui-icon-color: var(--ui-color-warning, var(--ui-warning, #d97706)); }
192
+ :host([tone="success"]) { --ui-icon-color: var(--ui-color-success, var(--ui-success, #15803d)); }
193
+ :host([tone="warning"]) { --ui-icon-color: var(--ui-color-warning, var(--ui-warning, #b45309)); }
194
194
  :host([tone="danger"]) { --ui-icon-color: var(--ui-color-danger, var(--ui-error, #dc2626)); }
195
195
 
196
196
  :host([shape="square"]) { --ui-icon-radius: 4px; }