@helixui/library 3.2.0-next.104 → 3.2.0-next.110

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 (32) hide show
  1. package/custom-elements.json +17 -5
  2. package/dist/components/hx-button/hx-button.d.ts +3 -1
  3. package/dist/components/hx-button/hx-button.d.ts.map +1 -1
  4. package/dist/components/hx-button/hx-button.styles.d.ts.map +1 -1
  5. package/dist/components/hx-button/index.js +1 -1
  6. package/dist/components/hx-side-nav/hx-side-nav.d.ts +1 -0
  7. package/dist/components/hx-side-nav/hx-side-nav.d.ts.map +1 -1
  8. package/dist/components/hx-side-nav/hx-side-nav.styles.d.ts.map +1 -1
  9. package/dist/components/hx-side-nav/index.js +1 -1
  10. package/dist/components/hx-theme/hx-theme.d.ts +14 -2
  11. package/dist/components/hx-theme/hx-theme.d.ts.map +1 -1
  12. package/dist/components/hx-theme/index.js +1 -1
  13. package/dist/css/helix-all.css +41 -9
  14. package/dist/css/helix-core.css +25 -5
  15. package/dist/css/helix-navigation.css +16 -4
  16. package/dist/css/helix-tokens.css +0 -8
  17. package/dist/css/hx-button.css +25 -5
  18. package/dist/css/hx-side-nav.css +16 -4
  19. package/dist/css/index.css +1 -1
  20. package/dist/css/manifest.json +2 -1
  21. package/dist/index.js +3 -3
  22. package/dist/shared/{hx-button-DVSDRKoV.js → hx-button-DPY6SPVT.js} +26 -6
  23. package/dist/shared/hx-button-DPY6SPVT.js.map +1 -0
  24. package/dist/shared/{hx-nav-item-Dap3DYgB.js → hx-nav-item-xqRPOCWX.js} +47 -35
  25. package/dist/shared/hx-nav-item-xqRPOCWX.js.map +1 -0
  26. package/dist/shared/{hx-theme-BiyQ7UUK.js → hx-theme-BsefFWTO.js} +83 -113
  27. package/dist/shared/hx-theme-BsefFWTO.js.map +1 -0
  28. package/figma-inventory.json +17 -2
  29. package/package.json +2 -2
  30. package/dist/shared/hx-button-DVSDRKoV.js.map +0 -1
  31. package/dist/shared/hx-nav-item-Dap3DYgB.js.map +0 -1
  32. package/dist/shared/hx-theme-BiyQ7UUK.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { css as m, html as p } from "lit";
2
- import { property as l, customElement as u } from "lit/decorators.js";
3
- import { HelixBrandRegistry as x, tokenEntries as f, darkTokenEntries as y } from "@helixui/tokens";
4
- import { H as _ } from "./helix-element-BNEYeiys.js";
5
- const F = m`
1
+ import { css as p, html as u } from "lit";
2
+ import { property as d, customElement as f } from "lit/decorators.js";
3
+ import { HelixBrandRegistry as l, tokenEntries as y, darkTokenEntries as _, highContrastTokenEntries as x } from "@helixui/tokens";
4
+ import { H as g } from "./helix-element-BNEYeiys.js";
5
+ const v = p`
6
6
  :host {
7
7
  display: contents;
8
8
  }
@@ -37,10 +37,10 @@ const F = m`
37
37
  }
38
38
  }
39
39
  `;
40
- function g(e, t) {
40
+ function w(e, t) {
41
41
  if (Object.keys(t).length === 0)
42
42
  return e;
43
- const s = Object.entries(t).map(([i, r]) => ` ${i}: ${r};`).join(`
43
+ const s = Object.entries(t).map(([r, i]) => ` ${r}: ${i};`).join(`
44
44
  `);
45
45
  return `${e}
46
46
 
@@ -49,60 +49,12 @@ function g(e, t) {
49
49
  ${s}
50
50
  }`;
51
51
  }
52
- var v = Object.defineProperty, w = Object.getOwnPropertyDescriptor, c = (e, t, s, i) => {
53
- for (var r = i > 1 ? void 0 : i ? w(t, s) : t, o = e.length - 1, a; o >= 0; o--)
54
- (a = e[o]) && (r = (i ? a(t, s, r) : a(r)) || r);
55
- return i && r && v(t, s, r), r;
52
+ var b = Object.defineProperty, S = Object.getOwnPropertyDescriptor, o = (e, t, s, r) => {
53
+ for (var i = r > 1 ? void 0 : r ? S(t, s) : t, n = e.length - 1, c; n >= 0; n--)
54
+ (c = e[n]) && (i = (r ? c(t, s, i) : c(i)) || i);
55
+ return r && i && b(t, s, i), i;
56
56
  };
57
- const b = [
58
- ["--hx-color-text-primary", "#FFFFFF"],
59
- ["--hx-color-text-secondary", "#FFFFFF"],
60
- ["--hx-color-text-muted", "#E0E0E0"],
61
- ["--hx-color-text-strong", "#FFFFFF"],
62
- ["--hx-color-text-placeholder", "#B0B0B0"],
63
- ["--hx-color-text-disabled", "#767676"],
64
- ["--hx-color-text-inverse", "#000000"],
65
- ["--hx-color-text-on-primary", "#000000"],
66
- ["--hx-color-text-on-secondary", "#000000"],
67
- ["--hx-color-text-on-error", "#000000"],
68
- ["--hx-color-text-on-success", "#000000"],
69
- ["--hx-color-text-on-warning", "#000000"],
70
- ["--hx-color-text-on-info", "#000000"],
71
- ["--hx-color-error-text", "#FCA5A5"],
72
- ["--hx-color-success-text", "#86EFAC"],
73
- ["--hx-color-text-link", "#FFFF00"],
74
- ["--hx-color-text-link-hover", "#FFFF99"],
75
- ["--hx-color-text-link-visited", "#FF80FF"],
76
- ["--hx-color-text-link-active", "#FFFFFF"],
77
- ["--hx-color-surface-default", "#000000"],
78
- ["--hx-color-surface-raised", "#1A1A1A"],
79
- ["--hx-color-surface-sunken", "#000000"],
80
- ["--hx-color-surface-inverse", "#FFFFFF"],
81
- ["--hx-color-surface-overlay", "rgba(0, 0, 0, 0.95)"],
82
- ["--hx-color-border-default", "#FFFFFF"],
83
- ["--hx-color-border-subtle", "#C0C0C0"],
84
- ["--hx-color-border-strong", "#FFFFFF"],
85
- ["--hx-color-border-focus", "#FFFF00"],
86
- ["--hx-color-focus-ring", "#FFFF00"],
87
- ["--hx-color-selection-bg", "#1AEBFF"],
88
- ["--hx-color-selection-color", "#000000"],
89
- ["--hx-body-bg", "#000000"],
90
- ["--hx-body-color", "#FFFFFF"],
91
- ["--hx-shadow-sm", "0 1px 2px 0 rgb(255 255 255 / 0.2)"],
92
- [
93
- "--hx-shadow-md",
94
- "0 4px 6px -1px rgb(255 255 255 / 0.3), 0 2px 4px -2px rgb(255 255 255 / 0.2)"
95
- ],
96
- [
97
- "--hx-shadow-lg",
98
- "0 10px 15px -3px rgb(255 255 255 / 0.3), 0 4px 6px -4px rgb(255 255 255 / 0.2)"
99
- ],
100
- [
101
- "--hx-shadow-xl",
102
- "0 20px 25px -5px rgb(255 255 255 / 0.3), 0 8px 10px -6px rgb(255 255 255 / 0.2)"
103
- ],
104
- ["--hx-shadow-2xl", "0 25px 50px -12px rgb(255 255 255 / 0.4)"]
105
- ], S = [
57
+ const T = [
106
58
  ["--hx-space-1", "0.1875rem"],
107
59
  ["--hx-space-2", "0.375rem"],
108
60
  ["--hx-space-3", "0.5625rem"],
@@ -165,42 +117,42 @@ const b = [
165
117
  ["--hx-easing-accelerate", "linear"],
166
118
  ["--hx-easing-spring", "linear"]
167
119
  ];
168
- function n(e) {
120
+ function h(e) {
169
121
  return Array.from(e).map(([t, s]) => ` ${t}: ${s};`).join(`
170
122
  `);
171
123
  }
172
- const d = /* @__PURE__ */ new Map();
173
- function T(e) {
174
- const t = d.get(e);
124
+ const m = /* @__PURE__ */ new Map();
125
+ function $(e) {
126
+ const t = m.get(e);
175
127
  if (t) return t;
176
- const s = new Map(f.map((r) => [r.name, r.value]));
177
- let i;
128
+ const s = new Map(y.map((i) => [i.name, i.value]));
129
+ let r;
178
130
  if (e === "dark") {
179
- const r = new Map(s);
180
- for (const o of y)
181
- r.set(o.name, o.value);
182
- i = `:host {
183
- ${n(r)}
131
+ const i = new Map(s);
132
+ for (const n of _)
133
+ i.set(n.name, n.value);
134
+ r = `:host {
135
+ ${h(i)}
184
136
  color-scheme: dark;
185
137
  }`;
186
138
  } else if (e === "high-contrast") {
187
- const r = new Map(s);
188
- for (const [o, a] of b)
189
- r.set(o, a);
190
- i = `:host {
191
- ${n(r)}
139
+ const i = new Map(s);
140
+ for (const n of x)
141
+ i.set(n.name, n.value);
142
+ r = `:host {
143
+ ${h(i)}
192
144
  color-scheme: dark;
193
145
  }`;
194
146
  } else
195
- i = `:host {
196
- ${n(s)}
147
+ r = `:host {
148
+ ${h(s)}
197
149
  color-scheme: light;
198
150
  }`;
199
- return d.set(e, i), i;
151
+ return m.set(e, r), r;
200
152
  }
201
- let h = class extends _ {
153
+ let a = class extends g {
202
154
  constructor() {
203
- super(...arguments), this.theme = "light", this.brand = "", this.motion = "full", this.density = "comfortable", this._mediaQuery = null, this._mediaHandler = null, this._themeSheet = null, this._densitySheet = null, this._motionQuery = null, this._motionHandler = null;
155
+ super(...arguments), this.theme = "light", this.brand = "", this.motion = "full", this.density = "comfortable", this._mediaQuery = null, this._mediaHandler = null, this._themeSheet = null, this._densitySheet = null, this._motionQuery = null, this._motionHandler = null, this._lastBrandAdvisoryKey = null;
204
156
  }
205
157
  firstUpdated(e) {
206
158
  super.firstUpdated(e), this._initThemeSheet(), this.theme === "auto" && this._attachMediaQuery(), this.motion === "full" && this._attachMotionQuery();
@@ -215,7 +167,7 @@ let h = class extends _ {
215
167
  }
216
168
  /**
217
169
  * Returns the currently active theme name.
218
- * When `system=true` or `theme="auto"`, reflects the OS preference (`"light"` or `"dark"`).
170
+ * When `theme="auto"`, reflects the OS preference (`"light"` or `"dark"`).
219
171
  * Otherwise returns the `theme` property value.
220
172
  */
221
173
  get effectiveTheme() {
@@ -266,30 +218,48 @@ let h = class extends _ {
266
218
  /** @internal */
267
219
  _applyEffectiveTheme() {
268
220
  if (!this._themeSheet) return;
269
- let e = T(this.effectiveTheme);
270
- if (this.brand !== "") {
271
- const t = x.getBrandTokens(this.brand);
272
- t !== void 0 ? e = g(e, t) : console.warn(
273
- `[hx-theme] Brand "${this.brand}" is not registered. Register it via HelixBrandRegistry.register() before use. Applying base theme only.`
274
- );
275
- }
221
+ let e = $(this.effectiveTheme);
222
+ if (this.brand !== "" && this.effectiveTheme !== "high-contrast") {
223
+ const t = l.getBrandTokens(this.brand);
224
+ if (t !== void 0)
225
+ e = w(e, t), this._lastBrandAdvisoryKey = `${this.brand}|${this.effectiveTheme}|applied`;
226
+ else {
227
+ const s = `${this.brand}|${this.effectiveTheme}|unregistered`;
228
+ this._lastBrandAdvisoryKey !== s && (console.warn(
229
+ `[hx-theme] Brand "${this.brand}" is not registered. Register it via HelixBrandRegistry.register() before use. Applying base theme only.`
230
+ ), this._lastBrandAdvisoryKey = s);
231
+ }
232
+ } else if (this.brand !== "" && this.effectiveTheme === "high-contrast")
233
+ if (l.getBrandTokens(this.brand) === void 0) {
234
+ const s = `${this.brand}|high-contrast|unregistered`;
235
+ this._lastBrandAdvisoryKey !== s && (console.warn(
236
+ `[hx-theme] Brand "${this.brand}" is not registered. Register it via HelixBrandRegistry.register() before use. Applying base theme only.`
237
+ ), this._lastBrandAdvisoryKey = s);
238
+ } else {
239
+ const s = `${this.brand}|high-contrast|suppressed`;
240
+ this._lastBrandAdvisoryKey !== s && (console.info(
241
+ `[hx-theme] Brand "${this.brand}" is suppressed on theme="high-contrast" to preserve the WCAG 7:1+ contrast contract. Applying base high-contrast tokens only. See BRAND_THEMING.md.`
242
+ ), this._lastBrandAdvisoryKey = s);
243
+ }
244
+ else
245
+ this._lastBrandAdvisoryKey = null;
276
246
  this.effectiveMotion === "reduced" && (e += `
277
247
  :host {
278
- ${n(Q)}
279
- }`), this._themeSheet.replace(e);
248
+ ${h(Q)}
249
+ }`), this._themeSheet.replaceSync(e);
280
250
  }
281
251
  /** @internal */
282
252
  _applyDensity() {
283
253
  if (!this._densitySheet) return;
284
254
  let e = "";
285
255
  this.density === "compact" ? e = `:host {
286
- ${n(S)}
256
+ ${h(T)}
287
257
  }` : this.density === "spacious" && (e = `:host {
288
- ${n(M)}
289
- }`), this._densitySheet.replace(e);
258
+ ${h(M)}
259
+ }`), this._densitySheet.replaceSync(e);
290
260
  }
291
261
  render() {
292
- return p`
262
+ return u`
293
263
  <div part="base" class="theme-base">
294
264
  <slot></slot>
295
265
  </div>
@@ -297,23 +267,23 @@ ${n(M)}
297
267
  `;
298
268
  }
299
269
  };
300
- h.styles = [F];
301
- c([
302
- l({ type: String, reflect: !0 })
303
- ], h.prototype, "theme", 2);
304
- c([
305
- l({ type: String, reflect: !0 })
306
- ], h.prototype, "brand", 2);
307
- c([
308
- l({ type: String, reflect: !0 })
309
- ], h.prototype, "motion", 2);
310
- c([
311
- l({ type: String, reflect: !0 })
312
- ], h.prototype, "density", 2);
313
- h = c([
314
- u("hx-theme")
315
- ], h);
270
+ a.styles = [v];
271
+ o([
272
+ d({ type: String, reflect: !0 })
273
+ ], a.prototype, "theme", 2);
274
+ o([
275
+ d({ type: String, reflect: !0 })
276
+ ], a.prototype, "brand", 2);
277
+ o([
278
+ d({ type: String, reflect: !0 })
279
+ ], a.prototype, "motion", 2);
280
+ o([
281
+ d({ type: String, reflect: !0 })
282
+ ], a.prototype, "density", 2);
283
+ a = o([
284
+ f("hx-theme")
285
+ ], a);
316
286
  export {
317
- h as H
287
+ a as H
318
288
  };
319
- //# sourceMappingURL=hx-theme-BiyQ7UUK.js.map
289
+ //# sourceMappingURL=hx-theme-BsefFWTO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hx-theme-BsefFWTO.js","sources":["../../src/components/hx-theme/hx-theme.styles.ts","../../src/utils/token-merger.ts","../../src/components/hx-theme/hx-theme.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixThemeStyles = css`\n :host {\n display: contents;\n }\n\n /* display: contents makes this wrapper layout-invisible; exposed as [part=\"base\"]\n for consumer targeting via CSS parts without affecting layout */\n .theme-base {\n display: contents;\n }\n\n /* Visually hidden but accessible to screen readers — used for aria-live announcements */\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n /* hx-theme is a transparent wrapper that applies design tokens.\n It has no visual output of its own. forced-color-adjust: auto (default)\n is sufficient — theme tokens will resolve to system colors as needed. */\n @media (forced-colors: active) {\n :host {\n forced-color-adjust: auto;\n }\n }\n`;\n","import type { BrandTokenMap } from '@helixui/tokens';\n\n/**\n * Merges brand token overrides on top of a base theme CSS string.\n *\n * Brand tokens are appended as a `:host` block after the base theme CSS,\n * which gives them higher cascade precedence within the adopted stylesheet.\n * This preserves all primitive and semantic tokens from the base theme while\n * allowing brand-specific values to override selectively.\n *\n * @param baseCSS - The base theme CSS string (from `_buildThemeCss`).\n * @param brandTokens - CSS custom property overrides for the active brand.\n * @returns Combined CSS string with brand overrides applied after the base theme.\n *\n * @example\n * ```ts\n * const merged = mergeBrandTokens(lightCSS, {\n * '--hx-color-primary-500': '#003DA5',\n * '--hx-color-primary-600': '#002D8A',\n * });\n * // merged === lightCSS + \"\\n\\n:host {\\n --hx-color-primary-500: #003DA5;\\n ...}\\n\"\n * ```\n */\nexport function mergeBrandTokens(baseCSS: string, brandTokens: BrandTokenMap): string {\n if (Object.keys(brandTokens).length === 0) {\n return baseCSS;\n }\n\n const brandOverrides = Object.entries(brandTokens)\n .map(([name, value]) => ` ${name}: ${value};`)\n .join('\\n');\n\n return `${baseCSS}\\n\\n/* Brand token overrides */\\n:host {\\n${brandOverrides}\\n}`;\n}\n","import { html, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { HelixElement } from '../../base/index.js';\nimport {\n tokenEntries,\n darkTokenEntries,\n highContrastTokenEntries,\n HelixBrandRegistry,\n} from '@helixui/tokens';\nimport { helixThemeStyles } from './hx-theme.styles.js';\nimport { mergeBrandTokens } from '../../utils/token-merger.js';\n\nexport type { TokenDefinition, TokenEntry } from '@helixui/tokens';\n\n/**\n * Controls the spacing density for all descendant `hx-*` components.\n * - `\"comfortable\"` (default): Standard spacing tokens.\n * - `\"compact\"`: Reduces `--hx-space-*` tokens ~25%. For data-dense clinical dashboards.\n * - `\"spacious\"`: Increases `--hx-space-*` tokens ~25%. For touch-optimized bedside tablets.\n */\nexport type DensityMode = 'comfortable' | 'compact' | 'spacious';\n\n/**\n * Controls the motion behavior applied to all descendant `hx-*` components.\n * - `\"full\"` (default): Full animations. Respects OS `prefers-reduced-motion`.\n * - `\"reduced\"`: Collapses all animation durations to 0ms and easings to linear.\n * - `\"none\"`: Same as `\"reduced\"` — all motion tokens resolve to instant/linear.\n */\nexport type MotionMode = 'full' | 'reduced' | 'none';\n\n/**\n * Supported theme names.\n *\n * Three-tier token cascade applied by this component:\n * - **Primitive tier** (`--hx-color-primary-500`, `--hx-space-4`, etc.) — raw values, always injected\n * - **Semantic tier** (`--hx-color-text-primary`, `--hx-color-surface-default`, etc.) — theme-sensitive,\n * override primitives for dark / high-contrast themes\n * - **Component tier** (`--hx-button-bg`, `--hx-card-padding`, etc.) — set by individual components,\n * consumed via semantic fallbacks; not managed by `hx-theme` directly\n *\n * Consumers should override at the semantic tier to respect theme scoping.\n */\nexport type ThemeName = 'light' | 'dark' | 'high-contrast' | 'auto';\n\n/**\n * Compact density overrides: ~75% of original --hx-space-* values.\n * Fixed tokens (--hx-space-0 and --hx-space-px) are intentionally omitted — they stay fixed.\n * Component height tokens are reduced one step to match the tighter spacing.\n */\nconst _compactDensityOverrides: Array<[string, string]> = [\n ['--hx-space-1', '0.1875rem'],\n ['--hx-space-2', '0.375rem'],\n ['--hx-space-3', '0.5625rem'],\n ['--hx-space-4', '0.75rem'],\n ['--hx-space-5', '0.9375rem'],\n ['--hx-space-6', '1.125rem'],\n ['--hx-space-7', '1.3125rem'],\n ['--hx-space-8', '1.5rem'],\n ['--hx-space-10', '1.875rem'],\n ['--hx-space-12', '2.25rem'],\n ['--hx-space-14', '2.625rem'],\n ['--hx-space-16', '3rem'],\n ['--hx-space-20', '3.75rem'],\n ['--hx-space-24', '4.5rem'],\n ['--hx-space-32', '6rem'],\n ['--hx-space-40', '7.5rem'],\n ['--hx-space-48', '9rem'],\n ['--hx-space-64', '12rem'],\n // Component heights — one step smaller\n ['--hx-input-height-sm', '1.75rem'],\n ['--hx-input-height-md', '2rem'],\n ['--hx-input-height-lg', '2.25rem'],\n];\n\n/**\n * Spacious density overrides: ~125% of original --hx-space-* values.\n * Fixed tokens (--hx-space-0 and --hx-space-px) are intentionally omitted — they stay fixed.\n * Component height tokens are increased one step to match the looser spacing.\n */\nconst _spaciousDensityOverrides: Array<[string, string]> = [\n ['--hx-space-1', '0.3125rem'],\n ['--hx-space-2', '0.625rem'],\n ['--hx-space-3', '0.9375rem'],\n ['--hx-space-4', '1.25rem'],\n ['--hx-space-5', '1.5625rem'],\n ['--hx-space-6', '1.875rem'],\n ['--hx-space-7', '2.1875rem'],\n ['--hx-space-8', '2.5rem'],\n ['--hx-space-10', '3.125rem'],\n ['--hx-space-12', '3.75rem'],\n ['--hx-space-14', '4.375rem'],\n ['--hx-space-16', '5rem'],\n ['--hx-space-20', '6.25rem'],\n ['--hx-space-24', '7.5rem'],\n ['--hx-space-32', '10rem'],\n ['--hx-space-40', '12.5rem'],\n ['--hx-space-48', '15rem'],\n ['--hx-space-64', '20rem'],\n // Component heights — one step larger\n ['--hx-input-height-sm', '2.25rem'],\n ['--hx-input-height-md', '2.75rem'],\n ['--hx-input-height-lg', '3.5rem'],\n];\n\n/**\n * Motion token overrides applied when reduced or no motion is requested.\n * All durations collapse to 0ms and all easings become linear so that\n * every animated component goes instantaneous without modifying its own CSS.\n */\nconst _reducedMotionOverrides: Array<[string, string]> = [\n ['--hx-duration-fast', '0ms'],\n ['--hx-duration-normal', '0ms'],\n ['--hx-duration-slow', '0ms'],\n ['--hx-duration-slower', '0ms'],\n ['--hx-duration-spinner', '0ms'],\n ['--hx-transition-fast', '0ms linear'],\n ['--hx-transition-normal', '0ms linear'],\n ['--hx-transition-slow', '0ms linear'],\n ['--hx-easing-default', 'linear'],\n ['--hx-easing-in', 'linear'],\n ['--hx-easing-out', 'linear'],\n ['--hx-easing-in-out', 'linear'],\n ['--hx-easing-decelerate', 'linear'],\n ['--hx-easing-accelerate', 'linear'],\n ['--hx-easing-spring', 'linear'],\n];\n\nfunction _buildProps(entries: Iterable<[string, string]>): string {\n return Array.from(entries)\n .map(([name, value]) => ` ${name}: ${value};`)\n .join('\\n');\n}\n\n/** Module-level CSS cache: one string per ThemeName — avoids re-building on every theme change */\nconst _cssCache = new Map<ThemeName, string>();\n\nfunction _buildThemeCss(theme: ThemeName): string {\n const cached = _cssCache.get(theme);\n if (cached) return cached;\n\n // Build light token base map from the @helixui/tokens package\n const lightMap = new Map(tokenEntries.map((t) => [t.name, t.value]));\n\n let css: string;\n if (theme === 'dark') {\n // Apply dark semantic overrides on top of light primitives\n const merged = new Map(lightMap);\n for (const t of darkTokenEntries) {\n merged.set(t.name, t.value);\n }\n css = `:host {\\n${_buildProps(merged)}\\n color-scheme: dark;\\n}`;\n } else if (theme === 'high-contrast') {\n // Apply HC overrides on top of light primitives — distinct WCAG 7:1+ token set\n // sourced from tokens.json `high-contrast` block via highContrastTokenEntries.\n // Mirrors the dark-mode injection path so source/runtime drift is structurally impossible.\n const merged = new Map(lightMap);\n for (const t of highContrastTokenEntries) {\n merged.set(t.name, t.value);\n }\n css = `:host {\\n${_buildProps(merged)}\\n color-scheme: dark;\\n}`;\n } else {\n // 'light' — 'auto' resolves to 'light' or 'dark' at runtime via effectiveTheme\n css = `:host {\\n${_buildProps(lightMap)}\\n color-scheme: light;\\n}`;\n }\n\n _cssCache.set(theme, css);\n return css;\n}\n\n/**\n * A theme provider that injects CSS custom property tokens for a named theme\n * onto a scoped root element. Wrapping content with this component scopes\n * all `--hx-*` design tokens to the selected theme.\n *\n * This is a pure infrastructure component with `display: contents` — it does\n * not affect layout. Use it to apply a theme to a subtree of components.\n *\n * Supported themes:\n * - `\"light\"` — standard light-mode token set (default)\n * - `\"dark\"` — dark-mode semantic overrides applied on top of light primitives\n * - `\"high-contrast\"` — WCAG 7:1+ contrast token set for low-vision accessibility\n * - `\"auto\"` — follows the OS `prefers-color-scheme` media query (light or dark)\n *\n * @summary Injects --hx-* design tokens for the specified theme scope and controls motion behavior.\n *\n * @tag hx-theme\n *\n * @slot - Default slot for themed content.\n *\n * @csspart base - The inner slot wrapper element. `display: contents` — no layout effect.\n *\n * @cssprop [--hx-*] - All design tokens for the selected theme are injected\n * as CSS custom properties on the host element.\n *\n * @example Drupal Twig — wrap a region with a dark theme:\n * ```twig\n * <hx-theme theme=\"dark\">\n * {{ content }}\n * </hx-theme>\n * ```\n *\n * @example Nested scoping — dark sidebar inside a light page:\n * ```html\n * <hx-theme theme=\"light\">\n * <main>...</main>\n * <hx-theme theme=\"dark\">\n * <aside>...</aside>\n * </hx-theme>\n * </hx-theme>\n * ```\n *\n * @example Compact density for clinical dashboards:\n * ```html\n * <hx-theme theme=\"dark\" density=\"compact\">\n * <!-- Clinical dashboard content -->\n * </hx-theme>\n * ```\n * @cssprop [--hx-color-text-primary] - Color.\n * @cssprop [--hx-space-4] - Spacing token.\n * @cssprop [--hx-duration-fast] - Animation duration.\n */\n@customElement('hx-theme')\nexport class HelixTheme extends HelixElement {\n static override styles = [helixThemeStyles];\n\n /**\n * The theme to apply. Determines which set of --hx-* tokens are injected.\n * - `\"light\"` (default): standard light-mode tokens\n * - `\"dark\"`: dark-mode semantic overrides applied on top of light primitives\n * - `\"high-contrast\"`: WCAG 7:1+ contrast tokens for low-vision users\n * - `\"auto\"`: follows OS `prefers-color-scheme`; resolves to `\"light\"` or `\"dark\"` at runtime\n * @attr theme\n */\n @property({ type: String, reflect: true })\n theme: 'light' | 'dark' | 'high-contrast' | 'auto' = 'light';\n\n // The deprecated `system` boolean property has been removed in 3.0.0.\n // Use `theme=\"auto\"` instead.\n\n /**\n * The registered brand name to apply on top of the base theme.\n * When set, brand-specific CSS custom property overrides are merged\n * after the base theme tokens in the adopted stylesheet, enabling\n * hospital system white-label implementations.\n *\n * The brand must first be registered via `HelixBrandRegistry.register()`.\n * If the brand name is non-empty but not registered, a warning is logged\n * and the base theme is applied without brand overrides.\n *\n * **High-contrast suppression:** When `theme=\"high-contrast\"`, the brand\n * merge is intentionally skipped to preserve the WCAG 1.4.6 Enhanced\n * Contrast (7:1+) guarantee that the HC token set is tuned for. A\n * registered brand applied under HC emits a `console.info` to surface\n * the suppression in development. Brand merging on `light` and `dark`\n * is unaffected. See `BRAND_THEMING.md`.\n *\n * @attr brand\n * @example\n * ```html\n * <hx-theme theme=\"light\" brand=\"mercy-health\">\n * <!-- Content inherits Mercy Health brand tokens -->\n * </hx-theme>\n * ```\n */\n @property({ type: String, reflect: true })\n brand = '';\n\n /**\n * Controls motion behavior for all descendant `hx-*` components.\n * - `\"full\"` (default): Full animations. Respects OS `prefers-reduced-motion`.\n * - `\"reduced\"`: Collapses all animation durations to 0ms and easings to linear.\n * Use this for devices where OS accessibility settings cannot be relied on\n * (e.g. healthcare bedside terminals).\n * - `\"none\"`: Same as `\"reduced\"` — all motion tokens resolve to instant/linear.\n *\n * When `motion=\"full\"` and the OS reports `prefers-reduced-motion: reduce`,\n * the same token overrides are applied automatically.\n * @attr motion\n */\n @property({ type: String, reflect: true })\n motion: MotionMode = 'full';\n\n /**\n * Controls the spacing density for all descendant `hx-*` components.\n * - `\"comfortable\"` (default): Standard spacing tokens.\n * - `\"compact\"`: Reduces `--hx-space-*` tokens ~25%. For data-dense clinical dashboards.\n * - `\"spacious\"`: Increases `--hx-space-*` tokens ~25%. For touch-optimized bedside tablets.\n * @attr density\n */\n @property({ type: String, reflect: true })\n density: DensityMode = 'comfortable';\n\n /** @internal */\n private _mediaQuery: MediaQueryList | null = null;\n /** @internal */\n private _mediaHandler: (() => void) | null = null;\n /** @internal */\n private _themeSheet: CSSStyleSheet | null = null;\n /** @internal */\n private _densitySheet: CSSStyleSheet | null = null;\n /** @internal — media query for OS prefers-reduced-motion */\n private _motionQuery: MediaQueryList | null = null;\n /** @internal */\n private _motionHandler: (() => void) | null = null;\n /** @internal — last `${brand}|${effectiveTheme}|${kind}` for which a brand\n * suppression info / unregistered warn was emitted. `_applyEffectiveTheme()`\n * runs on every relevant property change, so without this guard the message\n * fires once per `update()` tick rather than once per applied state. */\n private _lastBrandAdvisoryKey: string | null = null;\n\n override firstUpdated(changed: PropertyValues<this>): void {\n super.firstUpdated(changed);\n this._initThemeSheet();\n if (this.theme === 'auto') {\n this._attachMediaQuery();\n }\n if (this.motion === 'full') {\n this._attachMotionQuery();\n }\n }\n\n override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n const autoMode = this.theme === 'auto';\n if (changed.has('theme')) {\n if (autoMode) {\n this._attachMediaQuery();\n } else {\n this._detachMediaQuery();\n }\n this._applyEffectiveTheme();\n }\n if (changed.has('motion')) {\n if (this.motion === 'full') {\n this._attachMotionQuery();\n } else {\n this._detachMotionQuery();\n }\n this._applyEffectiveTheme();\n }\n if (changed.has('brand')) {\n this._applyEffectiveTheme();\n }\n if (changed.has('density')) {\n this._applyDensity();\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._detachMediaQuery();\n this._detachMotionQuery();\n }\n\n /**\n * Returns the currently active theme name.\n * When `theme=\"auto\"`, reflects the OS preference (`\"light\"` or `\"dark\"`).\n * Otherwise returns the `theme` property value.\n */\n get effectiveTheme(): 'light' | 'dark' | 'high-contrast' {\n if (this.theme === 'auto') {\n if (typeof window === 'undefined') return 'light';\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n return this.theme;\n }\n\n /**\n * Returns the resolved motion level after considering the `motion` attribute and OS preference.\n * When `motion=\"full\"` and the OS reports `prefers-reduced-motion: reduce`, returns `\"reduced\"`.\n * Otherwise returns `\"full\"` or `\"reduced\"` based on the `motion` attribute.\n */\n get effectiveMotion(): 'full' | 'reduced' {\n if (this.motion === 'reduced' || this.motion === 'none') return 'reduced';\n if (\n typeof window !== 'undefined' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n ) {\n return 'reduced';\n }\n return 'full';\n }\n\n /** @internal */\n private _initThemeSheet(): void {\n if (this.shadowRoot) {\n this._themeSheet = new CSSStyleSheet();\n this._densitySheet = new CSSStyleSheet();\n this.shadowRoot.adoptedStyleSheets = [\n ...this.shadowRoot.adoptedStyleSheets,\n this._themeSheet,\n this._densitySheet,\n ];\n this._applyEffectiveTheme();\n this._applyDensity();\n }\n }\n\n /** @internal */\n private _attachMediaQuery(): void {\n if (this._mediaQuery || typeof window === 'undefined') return;\n this._mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n this._mediaHandler = () => {\n this._applyEffectiveTheme();\n this._announceThemeChange();\n };\n this._mediaQuery.addEventListener('change', this._mediaHandler);\n }\n\n /** @internal */\n private _detachMediaQuery(): void {\n if (this._mediaQuery && this._mediaHandler) {\n this._mediaQuery.removeEventListener('change', this._mediaHandler);\n }\n this._mediaQuery = null;\n this._mediaHandler = null;\n }\n\n /** @internal — attach OS prefers-reduced-motion listener when motion=\"full\" */\n private _attachMotionQuery(): void {\n if (this._motionQuery || typeof window === 'undefined') return;\n this._motionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');\n this._motionHandler = () => {\n this._applyEffectiveTheme();\n };\n this._motionQuery.addEventListener('change', this._motionHandler);\n }\n\n /** @internal */\n private _detachMotionQuery(): void {\n if (this._motionQuery && this._motionHandler) {\n this._motionQuery.removeEventListener('change', this._motionHandler);\n }\n this._motionQuery = null;\n this._motionHandler = null;\n }\n\n /** @internal — notifies AT users when system theme changes programmatically */\n private _announceThemeChange(): void {\n const announcer = this.shadowRoot?.querySelector('[role=\"status\"]');\n if (announcer) {\n announcer.textContent = `Theme changed to ${this.effectiveTheme}`;\n }\n }\n\n /** @internal */\n private _applyEffectiveTheme(): void {\n if (!this._themeSheet) return;\n\n let css = _buildThemeCss(this.effectiveTheme);\n\n // Brand merge is skipped on high-contrast mode. Brands declare 22 color\n // stops (primary + secondary 50..950) but the HC `tokens.json` block\n // overlays only the AAA-tuned subset (primary 500/600/700, secondary\n // 500/600). Merging brand tokens then re-overlaying HC would still leak\n // the 17+ brand-supplied stops HC does not redefine — components that\n // consume those stops directly (hx-checkbox, hx-tag, hx-list-item, etc.)\n // would silently break the BRAND_THEMING.md \"WCAG 7:1+\" contract.\n // Skipping the merge entirely on HC delivers the contract; brands\n // continue to apply on light/dark.\n if (this.brand !== '' && this.effectiveTheme !== 'high-contrast') {\n const brandTokens = HelixBrandRegistry.getBrandTokens(this.brand);\n if (brandTokens !== undefined) {\n css = mergeBrandTokens(css, brandTokens);\n this._lastBrandAdvisoryKey = `${this.brand}|${this.effectiveTheme}|applied`;\n } else {\n const advisoryKey = `${this.brand}|${this.effectiveTheme}|unregistered`;\n if (this._lastBrandAdvisoryKey !== advisoryKey) {\n console.warn(\n `[hx-theme] Brand \"${this.brand}\" is not registered. ` +\n `Register it via HelixBrandRegistry.register() before use. ` +\n `Applying base theme only.`,\n );\n this._lastBrandAdvisoryKey = advisoryKey;\n }\n }\n } else if (this.brand !== '' && this.effectiveTheme === 'high-contrast') {\n const brandTokens = HelixBrandRegistry.getBrandTokens(this.brand);\n if (brandTokens === undefined) {\n const advisoryKey = `${this.brand}|high-contrast|unregistered`;\n if (this._lastBrandAdvisoryKey !== advisoryKey) {\n console.warn(\n `[hx-theme] Brand \"${this.brand}\" is not registered. ` +\n `Register it via HelixBrandRegistry.register() before use. ` +\n `Applying base theme only.`,\n );\n this._lastBrandAdvisoryKey = advisoryKey;\n }\n } else {\n const advisoryKey = `${this.brand}|high-contrast|suppressed`;\n if (this._lastBrandAdvisoryKey !== advisoryKey) {\n console.info(\n `[hx-theme] Brand \"${this.brand}\" is suppressed on theme=\"high-contrast\" ` +\n `to preserve the WCAG 7:1+ contrast contract. ` +\n `Applying base high-contrast tokens only. See BRAND_THEMING.md.`,\n );\n this._lastBrandAdvisoryKey = advisoryKey;\n }\n }\n } else {\n this._lastBrandAdvisoryKey = null;\n }\n\n if (this.effectiveMotion === 'reduced') {\n css += `\\n:host {\\n${_buildProps(_reducedMotionOverrides)}\\n}`;\n }\n\n this._themeSheet.replaceSync(css);\n }\n\n /** @internal */\n private _applyDensity(): void {\n if (!this._densitySheet) return;\n\n let css = '';\n if (this.density === 'compact') {\n css = `:host {\\n${_buildProps(_compactDensityOverrides)}\\n}`;\n } else if (this.density === 'spacious') {\n css = `:host {\\n${_buildProps(_spaciousDensityOverrides)}\\n}`;\n }\n // comfortable = no overrides needed (defaults from theme sheet)\n\n this._densitySheet.replaceSync(css);\n }\n\n override render() {\n return html`\n <div part=\"base\" class=\"theme-base\">\n <slot></slot>\n </div>\n <span role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"visually-hidden\"></span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-theme': HelixTheme;\n }\n}\n\n/** Canonical type alias for HelixTheme. Use this when typing hx-theme element references. */\nexport type HxTheme = HelixTheme;\n"],"names":["helixThemeStyles","css","mergeBrandTokens","baseCSS","brandTokens","brandOverrides","name","value","_compactDensityOverrides","_spaciousDensityOverrides","_reducedMotionOverrides","_buildProps","entries","_cssCache","_buildThemeCss","theme","cached","lightMap","tokenEntries","t","merged","darkTokenEntries","highContrastTokenEntries","HelixTheme","HelixElement","changed","autoMode","announcer","_a","HelixBrandRegistry","advisoryKey","html","__decorateClass","property","customElement"],"mappings":";;;;AAEO,MAAMA,IAAmBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACqBzB,SAASC,EAAiBC,GAAiBC,GAAoC;AACpF,MAAI,OAAO,KAAKA,CAAW,EAAE,WAAW;AACtC,WAAOD;AAGT,QAAME,IAAiB,OAAO,QAAQD,CAAW,EAC9C,IAAI,CAAC,CAACE,GAAMC,CAAK,MAAM,KAAKD,CAAI,KAAKC,CAAK,GAAG,EAC7C,KAAK;AAAA,CAAI;AAEZ,SAAO,GAAGJ,CAAO;AAAA;AAAA;AAAA;AAAA,EAA6CE,CAAc;AAAA;AAC9E;;;;;;ACiBA,MAAMG,IAAoD;AAAA,EACxD,CAAC,gBAAgB,WAAW;AAAA,EAC5B,CAAC,gBAAgB,UAAU;AAAA,EAC3B,CAAC,gBAAgB,WAAW;AAAA,EAC5B,CAAC,gBAAgB,SAAS;AAAA,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6
  "tokensVersion": "3.2.0",
@@ -2690,7 +2690,7 @@
2690
2690
  ],
2691
2691
  "cssProperties": [
2692
2692
  {
2693
- "description": "Button background color (3.2.1 cascade variant rules route through action.{primary,secondary,ghost,danger}.bg).",
2693
+ "description": "Button background color. **Variant-shadowed**: every `.button--{variant}` rule rebinds this property at descendant scope, so a host-level override (`style=\"--hx-button-bg: …\"` or `:host`-targeting CSS) does not reach paint for primary/secondary/tertiary/danger/ghost/outline buttons. To recolor a variant fill, override the upstream semantic instead — e.g. `--hx-color-action-primary-bg` (light primary), `--hx-color-action-primary-bg-inverted-rest` (inverted primary), `--hx-color-action-danger-bg` (danger), or the inverted overlay tokens for tertiary/secondary/ghost/outline. The `--hx-button-bg` hook still works for the rare case of an unstyled base button without a `variant` class, and is internally rebound by the variant rules to participate in the active/hover override chain.",
2694
2694
  "name": "--hx-button-bg",
2695
2695
  "default": "var(--hx-color-action-primary-bg)",
2696
2696
  "figmaBinding": {
@@ -2957,6 +2957,16 @@
2957
2957
  "description": "Inverted-secondary/outline border + inverted focus-visible outline (overlay-white-70 ≈ 5:1 — clears WCAG 1.4.11 3:1 floor).",
2958
2958
  "name": "--hx-color-border-on-dark-strong",
2959
2959
  "figmaBinding": null
2960
+ },
2961
+ {
2962
+ "description": "DEPRECATED 3.2.2; renamed to --hx-color-surface-on-dark-overlay-subtle (the value paints a translucent fill, not a border). Consume sites read both names via deprecated-first fallback so existing overrides keep working until removal in 4.0.0.",
2963
+ "name": "--hx-color-border-on-dark-subtle",
2964
+ "figmaBinding": null
2965
+ },
2966
+ {
2967
+ "description": "DEPRECATED 3.2.2; renamed to --hx-color-surface-on-dark-overlay-default (the value paints a translucent fill, not a border). Consume sites read both names via deprecated-first fallback so existing overrides keep working until removal in 4.0.0.",
2968
+ "name": "--hx-color-border-on-dark-default",
2969
+ "figmaBinding": null
2960
2970
  }
2961
2971
  ],
2962
2972
  "dependsOn": [],
@@ -17684,6 +17694,11 @@
17684
17694
  "description": "Toggle button hover surface (overlay-white-10 primitive — translucent fill, not a border).",
17685
17695
  "name": "--hx-color-surface-on-dark-overlay-subtle",
17686
17696
  "figmaBinding": null
17697
+ },
17698
+ {
17699
+ "description": "DEPRECATED 3.2.2; renamed to --hx-color-surface-on-dark-overlay-subtle (the value paints a translucent fill, not a border). Toggle-hover rule reads both names via deprecated-first fallback so existing overrides keep working until removal in 4.0.0.",
17700
+ "name": "--hx-color-border-on-dark-subtle",
17701
+ "figmaBinding": null
17687
17702
  }
17688
17703
  ],
17689
17704
  "dependsOn": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helixui/library",
3
- "version": "3.2.0-next.104",
3
+ "version": "3.2.0-next.110",
4
4
  "description": "Enterprise Web Component Library built with Lit 3.x",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -59,7 +59,7 @@
59
59
  "customElements": "custom-elements.json",
60
60
  "dependencies": {
61
61
  "lit": "^3.3.2",
62
- "@helixui/tokens": "3.2.0-next.104"
62
+ "@helixui/tokens": "3.2.0-next.110"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@floating-ui/dom": "^1.7.6"
@@ -1 +0,0 @@
1
- {"version":3,"file":"hx-button-DVSDRKoV.js","sources":["../../src/components/hx-button/hx-button.styles.ts","../../src/components/hx-button/hx-button.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixButtonStyles = css`\n :host {\n display: inline-block;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: var(--hx-opacity-disabled, 0.5);\n }\n\n :host([full]) {\n display: block;\n width: 100%;\n }\n\n :host([full]) .button {\n width: 100%;\n justify-content: center;\n }\n\n /* ─── Base Button ─── */\n\n .button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--hx-space-2, 0.5rem);\n border: var(--hx-border-width-thin, 1px) solid var(--hx-button-border-color, transparent);\n border-radius: var(--hx-button-border-radius, var(--hx-border-radius-md, 0.375rem));\n background-color: var(--hx-button-bg, var(--hx-color-primary-500, #429797));\n color: var(--hx-button-color, var(--hx-color-neutral-0, #ffffff));\n font-family: var(--hx-button-font-family, var(--hx-font-family-sans, sans-serif));\n font-weight: var(--hx-button-font-weight, var(--hx-font-weight-semibold, 600));\n line-height: var(--hx-line-height-tight, 1.25);\n cursor: pointer;\n transition:\n background-color var(--hx-transition-fast, 150ms ease),\n color var(--hx-transition-fast, 150ms ease),\n border-color var(--hx-transition-fast, 150ms ease),\n box-shadow var(--hx-transition-fast, 150ms ease);\n text-decoration: none;\n white-space: nowrap;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .button:focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-button-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n\n .button:hover {\n filter: brightness(var(--hx-filter-brightness-hover, 0.9));\n }\n\n .button:active {\n filter: brightness(var(--hx-filter-brightness-active, 0.8));\n }\n\n /* ─── Size Variants ─── */\n\n /* WCAG 2.5.5 (healthcare mandate): minimum 44px touch target for sm variant.\n min-height uses --hx-touch-target-min to guarantee the interactive area\n meets the threshold even though the visual size token is smaller. */\n .button--sm {\n padding: var(--hx-space-1, 0.25rem) var(--hx-space-3, 0.75rem);\n font-size: var(--hx-font-size-sm, 0.875rem);\n min-height: var(--hx-touch-target-min, 2.75rem);\n }\n\n .button--md {\n padding: var(--hx-space-2, 0.5rem) var(--hx-space-4, 1rem);\n font-size: var(--hx-font-size-md, 1rem);\n min-height: var(--hx-size-10, 2.5rem);\n }\n\n .button--lg {\n padding: var(--hx-space-3, 0.75rem) var(--hx-space-6, 1.5rem);\n font-size: var(--hx-font-size-lg, 1.125rem);\n min-height: var(--hx-size-12, 3rem);\n }\n\n /* ─── Style Variants ─── */\n\n .button--primary {\n --hx-button-bg: var(--hx-color-action-primary-bg, #429797);\n /* Inline #0d1825 matches text.on-primary's resolved primitive (neutral-900);\n cold-start without the semantic still paints AA-tuned dark-on-primary\n rather than white-on-primary (3.43:1 fail). */\n --hx-button-color: var(--hx-color-text-on-primary, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n .button--secondary {\n --hx-button-bg: transparent;\n /* primary-500 (#429797) text on white surface = 3.44:1 — fails AA.\n primary-600 (#0F7078) on white = 5.82:1 — AA pass. */\n --hx-button-color: var(--hx-color-action-secondary-fg, #0f7078);\n --hx-button-border-color: var(--hx-color-action-secondary-border, #0f7078);\n }\n\n .button--secondary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-secondary-bg-hover, #ebf8f8));\n }\n\n .button--tertiary {\n --hx-button-bg: var(--hx-color-surface-sunken, #ebeee9);\n --hx-button-color: var(--hx-color-text-primary, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n .button--tertiary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-surface-raised, #f5f8f3));\n }\n\n .button--danger {\n --hx-button-bg: var(--hx-color-action-danger-bg, #e5493e);\n /* Inline #0d1825 matches text.on-error's resolved primitive (neutral-900);\n cold-start without the semantic still paints AA-tuned dark-on-error\n rather than white-on-error (3.92:1 fail). */\n --hx-button-color: var(--hx-color-text-on-error, #0d1825);\n --hx-button-border-color: transparent;\n }\n\n /* on-error tokens are tuned for error-500 (neutral-900 on #E5493E ≈ 4.59:1).\n error-600 (#C92A2A) drops that to 3.28:1 — AA fail. text.on-error-strong\n resolves to neutral-0 across modes (no dark flip) so the darker hover fill\n stays legible. Mirrors hx-toast precedent (commit 300e21ab0); routed\n through the semantic tier in 3.2.1 token-cascade remediation. */\n .button--danger:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-danger-bg-hover, #c92a2a));\n --hx-button-color: var(--hx-color-text-on-error-strong, #ffffff);\n }\n\n /* Pressed state binds explicitly to action.danger.bg-active (error-700,\n #A21312) + text.on-error-strong (neutral-0) = 7.96:1 AA. Base\n .button:active filter:brightness(0.8) would compound on top of bg-hover\n (#C92A2A) and produce ~3.3:1 sub-AA on the bound colors. Override the\n filter to none. HC override on action.danger.bg-active flips to HC\n error-500 so the on-error-strong (HC = #000) pair is AA in HC too. */\n .button--danger:active {\n --hx-button-bg: var(--hx-button-active-bg, var(--hx-color-action-danger-bg-active, #a21312));\n --hx-button-color: var(--hx-color-text-on-error-strong, #ffffff);\n filter: none;\n }\n\n .button--ghost {\n --hx-button-bg: transparent;\n /* primary-500 (#429797) text on white surface = 3.44:1 — fails AA.\n primary-600 (#0F7078) on white = 5.82:1 — AA pass. */\n --hx-button-color: var(--hx-color-action-ghost-fg, #0f7078);\n --hx-button-border-color: transparent;\n }\n\n .button--ghost:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-ghost-bg-hover, #ebf8f8));\n }\n\n .button--outline {\n --hx-button-bg: transparent;\n --hx-button-color: var(--hx-color-text-primary, #0d1825);\n --hx-button-border-color: var(--hx-color-border-strong, #66787b);\n }\n\n .button--outline:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-surface-raised, #f5f8f3));\n }\n\n /* on-primary token resolves to neutral-900 (#0D1825) — tuned for primary-500.\n primary-600 (#0F7078) drops the pair to 3.07:1 — AA fail. text.on-primary-strong\n resolves to neutral-0 across modes (no dark flip) for the darker hover fill.\n Mirrors hx-toast precedent (commit 300e21ab0); routed through the semantic\n tier in 3.2.1 token-cascade remediation. */\n .button--primary:hover {\n --hx-button-bg: var(--hx-button-hover-bg, var(--hx-color-action-primary-bg-hover, #0f7078));\n --hx-button-color: var(--hx-color-text-on-primary-strong, #ffffff);\n }\n\n /* Pressed state binds explicitly to action.primary.bg-active (primary-700,\n #0F6363) + text.on-primary-strong (neutral-0) = 7.03:1 AA. The base\n .button:active filter:brightness(0.8) would compound on top of bg-hover\n (#0F7078) and produce ~3.7:1 sub-AA on the bound colors. Override the\n filter to none so the action.*.bg-active token is what actually paints. */\n .button--primary:active {\n --hx-button-bg: var(--hx-button-active-bg, var(--hx-color-action-primary-bg-active, #0f6363));\n --hx-button-color: var(--hx-color-text-on-primary-strong, #ffffff);\n filter: none;\n }\n\n /* ─── Disabled ─── */\n\n /* Note: opacity is applied on :host([disabled]) above — do NOT add opacity here.\n Stacking opacity on both :host and .button[disabled] would multiply to 0.25. */\n .button[disabled] {\n cursor: not-allowed;\n }\n\n /* ─── Loading State ─── */\n\n .button--loading {\n position: relative;\n cursor: wait;\n }\n\n .button__spinner {\n width: 1em;\n height: 1em;\n flex-shrink: 0;\n animation: hx-spin var(--hx-duration-spinner, 750ms) linear infinite;\n }\n\n @keyframes hx-spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n\n .button__spinner {\n animation: none;\n opacity: var(--hx-opacity-muted, 0.6);\n }\n }\n\n /* ─── Inverted Mode ─── */\n\n /* Inline-fallback contract for the on-dark-* tokens in this section:\n the literal rgba(255, 255, 255, 0.X) arms are a LIGHT-MODE-only last\n resort (cold-start, CSS-not-loaded). At runtime, hx-theme injects\n the dark.* override (overlay-black-* for the strong border and the\n surface.on-dark-overlay-* fills) so dark-mode inverted buttons stay\n visible on the now-light surface.inverse (#EBEEE9). The inline white\n overlays would render invisible (≈1.1:1) on a light surface, but\n they never paint when the theme is mounted. If a future change\n moves these into a context where hx-theme is not guaranteed,\n replace with mode-aware tokens. */\n\n /* Override text color and filter-based hover/active for all variants */\n :host([inverted]) .button {\n color: var(--hx-button-inverted-color, var(--hx-color-text-inverse, #ffffff));\n filter: none;\n }\n\n :host([inverted]) .button:hover {\n filter: none;\n }\n\n :host([inverted]) .button:active {\n filter: none;\n }\n\n :host([inverted]) .button:focus-visible {\n /* WCAG 1.4.11: focus indicator needs ≥3:1 against adjacent colors.\n border-on-dark-strong (overlay-white-70) ≈ 5:1 on neutral-900 — passes.\n The lower-alpha siblings used to live in border.* but were sub-3:1\n against any plausible surface and could not honour a border contract;\n they're now surface.on-dark-overlay-{default,subtle} (translucent\n fills, not borders) and used elsewhere in this file. See\n tokens.json color.surface.on-dark-overlay-* for canonical ratios. */\n outline-color: var(\n --hx-button-inverted-focus-ring-color,\n var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7))\n );\n }\n\n /* Primary inverted — resting bg routes through action.primary.bg-inverted-rest\n so dark mode can flip the fill to primary-600. surface.inverse becomes light\n (#EBEEE9) in dark mode; primary-500 on #EBEEE9 = 2.94:1 (sub-3:1 UI floor\n fail for the inverted-button boundary). primary-600 on #EBEEE9 = 4.97:1\n (AA pass). Light mode tracks action.primary.bg-inverted-rest's base value\n (primary-500, 5.20:1 on dark surface.inverse).\n\n Override path note (codex round-11): this binds --hx-button-bg directly,\n matching the cascade convention every other .button--{variant} rule uses\n (light primary at line 89, danger at 120, secondary, tertiary, ghost). The\n consumer override path for inverted-primary rest is\n --hx-color-action-primary-bg-inverted-rest, NOT --hx-button-bg — the same\n pattern as light primary (consumers override --hx-color-action-primary-bg).\n Pinned by dark-mode-resolution.test.ts:185-197 across both modes. */\n :host([inverted]) .button--primary {\n --hx-button-bg: var(--hx-color-action-primary-bg-inverted-rest, #429797);\n }\n\n /* Primary inverted — hover/pressed lift to action.primary.bg-inverted-hover\n (primary-400, light teal). The base :host([inverted]) .button rule binds\n color to text.inverse, which flips by mode (neutral-0 in light, neutral-900\n in dark). On a permanent light-teal fill, white text drops to 2.4:1 in\n light mode (AA fail). Pin color to text.on-primary (neutral-900, no\n dark-mode flip) for both hover and active so the foreground is dark in\n both modes — neutral-900 on primary-400 = 7.27:1 (AA pass).\n Pressed === hover visually in inverted mode is acceptable UX (the\n transient absence of pointer over the button signals release).\n The fallback chain wraps --hx-button-active-bg (highest precedence) and\n --hx-button-hover-bg so consumer overrides on either prop apply under\n :host([inverted]) — the two share a paint here, so either knob is\n honored, with active-bg winning when both are set. */\n :host([inverted]) .button--primary:hover,\n :host([inverted]) .button--primary:active {\n --hx-button-bg: var(\n --hx-button-active-bg,\n var(--hx-button-hover-bg, var(--hx-color-action-primary-bg-inverted-hover, #6ab1b1))\n );\n color: var(\n --hx-button-inverted-primary-interactive-color,\n var(--hx-color-text-on-primary, #0d1825)\n );\n }\n\n /* Danger inverted — sister to primary. Hover/pressed lift to\n action.danger.bg-inverted-hover (error-400, #FC7264). Same foreground\n contract: text.inverse fails in light mode (white on light red ≈ 2.6:1);\n pin to text.on-error (neutral-900, no dark-mode flip) for 6.58:1 in both\n modes. Same active-bg → hover-bg → semantic fallback chain as primary. */\n :host([inverted]) .button--danger:hover,\n :host([inverted]) .button--danger:active {\n --hx-button-bg: var(\n --hx-button-active-bg,\n var(--hx-button-hover-bg, var(--hx-color-action-danger-bg-inverted-hover, #fc7264))\n );\n color: var(\n --hx-button-inverted-danger-interactive-color,\n var(--hx-color-text-on-error, #0d1825)\n );\n }\n\n /* Secondary inverted — white border and translucent hover fill */\n :host([inverted]) .button--secondary {\n --hx-button-border-color: var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7));\n }\n\n :host([inverted]) .button--secondary:hover {\n --hx-button-bg: var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3));\n }\n\n /* Tertiary inverted — resting at the subtle overlay (10%) lifts to the default\n overlay (30%) on hover so the runtime hover delta is visually distinct, not\n collapsed onto a single token. */\n :host([inverted]) .button--tertiary {\n --hx-button-bg: var(--hx-color-surface-on-dark-overlay-subtle, rgba(255, 255, 255, 0.1));\n --hx-button-border-color: transparent;\n }\n\n :host([inverted]) .button--tertiary:hover {\n --hx-button-bg: var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3));\n }\n\n /* Ghost inverted — transparent base, translucent hover bg */\n :host([inverted]) .button--ghost {\n --hx-button-bg: transparent;\n --hx-button-border-color: transparent;\n }\n\n :host([inverted]) .button--ghost:hover {\n --hx-button-bg: var(\n --hx-button-inverted-ghost-hover-bg,\n var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3))\n );\n }\n\n /* Outline inverted — white border */\n :host([inverted]) .button--outline {\n --hx-button-border-color: var(--hx-color-border-on-dark-strong, rgba(255, 255, 255, 0.7));\n }\n\n :host([inverted]) .button--outline:hover {\n --hx-button-bg: var(--hx-color-surface-on-dark-overlay-default, rgba(255, 255, 255, 0.3));\n }\n\n /* ─── Prefix / Suffix / Label ─── */\n\n .button__prefix,\n .button__suffix {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .button__label {\n flex: 1 1 auto;\n }\n\n /* ─── High Contrast Mode (forced-colors) ─── */\n\n @media (forced-colors: active) {\n .button {\n /* Ensure button outline is visible in Windows High Contrast mode.\n ButtonText/ButtonFace are system colors recognized by the browser. */\n forced-color-adjust: none;\n background-color: ButtonFace;\n color: ButtonText;\n border: 2px solid ButtonText;\n }\n\n .button:hover {\n /* Hover affordance must survive in HC. Highlight/HighlightText is the\n OS-level \"selected\" pair, mirroring the forcedColorsInteractive mixin's\n hover contract — kept inline since this component owns its bespoke HC\n block (XOR rule). */\n background-color: Highlight;\n color: HighlightText;\n border-color: Highlight;\n }\n\n .button:focus-visible {\n outline: 3px solid Highlight;\n outline-offset: 2px;\n }\n\n .button[disabled] {\n background-color: ButtonFace;\n color: GrayText;\n border-color: GrayText;\n opacity: 1;\n }\n\n :host([disabled]) {\n opacity: 1;\n }\n\n .button--loading .button__spinner {\n /* Ensure spinner is visible in HCM */\n forced-color-adjust: auto;\n }\n }\n`;\n","import { html, nothing, type TemplateResult, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { HelixElement } from '../../base/index.js';\nimport { mixinDelegatesAria } from '../../mixins/index.js';\nimport { helixButtonStyles } from './hx-button.styles.js';\nimport { devWarn } from '../../utils/dev-warn.js';\n\n/** Detail for the hx-click event dispatched by hx-button. */\nexport interface HxButtonClickDetail {\n originalEvent: MouseEvent;\n}\n\n/**\n * A production-grade button component for user interaction. Supports multiple\n * visual variants, sizes, loading state, prefix/suffix slots, anchor rendering,\n * and full ElementInternals form association.\n *\n * @summary Primary interactive element for triggering actions and form submission.\n *\n * @tag hx-button\n *\n * @slot - Default slot for button label text or content.\n * @slot prefix - Icon or content rendered before the label.\n * @slot suffix - Icon or content rendered after the label.\n *\n * @fires {CustomEvent<{originalEvent: MouseEvent}>} hx-click - Dispatched when\n * the button is clicked and is neither disabled nor loading.\n *\n * @csspart button - The native button or anchor element.\n * @csspart label - The label text wrapper span.\n * @csspart prefix - The prefix slot container span.\n * @csspart suffix - The suffix slot container span.\n * @csspart spinner - The loading spinner SVG element.\n *\n * @cssprop [--hx-button-bg=var(--hx-color-action-primary-bg)] - Button background color (3.2.1 cascade — variant rules route through action.{primary,secondary,ghost,danger}.bg).\n * @cssprop [--hx-button-hover-bg] - Hover background override (primary and danger variants only). Other variants (secondary/outline, ghost) keep their hover fills routed through their semantic action.* tokens and do not consume this hook. Under [inverted] for primary/danger, hover and active share a paint (combined :hover, :active rule), so this override applies to both states unless --hx-button-active-bg also takes precedence.\n * @cssprop [--hx-button-active-bg] - Pressed/active background override (primary and danger variants only, including their inverted modes). Takes precedence over --hx-button-hover-bg in the fallback chain. Standard-mode primary/danger default to action.{primary,danger}.bg-active (with filter:none) for AA-pinned pressed contrast. Inverted-mode primary/danger reuse action.{primary,danger}.bg-inverted-hover (combined :hover, :active rule); setting --hx-button-active-bg under [inverted] therefore overrides the lifted hover fill as well as the pressed fill — the two share a paint in inverted mode. Other variants do not consume this hook.\n * @cssprop [--hx-button-color=var(--hx-color-text-on-primary)] - Button text color (variants route through text.on-{role} / text.on-{role}-strong).\n * @cssprop [--hx-button-border-color=transparent] - Button border color (secondary/outline variants route through action.secondary.border).\n * @cssprop [--hx-button-border-radius=var(--hx-border-radius-md)] - Button border radius.\n * @cssprop [--hx-button-font-family=var(--hx-font-family-sans)] - Button font family.\n * @cssprop [--hx-button-font-weight=var(--hx-font-weight-semibold)] - Button font weight.\n * @cssprop [--hx-button-focus-ring-color=var(--hx-focus-ring-color)] - Focus ring color.\n *\n * @cssprop [--hx-button-inverted-color=var(--hx-color-text-inverse)] - Text color when inverted (resolves to neutral-0).\n * @cssprop [--hx-button-inverted-primary-interactive-color=var(--hx-color-text-on-primary)] - Foreground override for inverted primary hover and pressed (combined :hover, :active rule). Defaults to text.on-primary (neutral-900, no dark-mode flip) so dark text rides the lifted primary-400 fill — text.inverse on light teal collapses to ~2.4:1 in light mode.\n * @cssprop [--hx-button-inverted-danger-interactive-color=var(--hx-color-text-on-error)] - Foreground override for inverted danger hover and pressed (combined :hover, :active rule). Defaults to text.on-error (neutral-900); same rationale as the primary override.\n * @cssprop [--hx-button-inverted-ghost-hover-bg=var(--hx-color-surface-on-dark-overlay-default)] - Ghost hover bg when inverted (overlay-white-30 — translucent fill, not a border; contrast not applicable).\n * @cssprop [--hx-button-inverted-focus-ring-color=var(--hx-color-border-on-dark-strong)] - Focus ring color when inverted (overlay-white-70 ≈ 5:1 vs neutral-900 — clears WCAG 1.4.11 3:1 floor for non-text UI).\n *\n * @cssprop [--hx-color-action-primary-bg] - Primary variant resting fill (3.2.1 semantic action layer).\n * @cssprop [--hx-color-action-primary-bg-hover] - Primary variant hover fill.\n * @cssprop [--hx-color-action-primary-bg-active] - Primary variant active/pressed fill.\n * @cssprop [--hx-color-action-secondary-fg] - Secondary/outline variant fg (resolves to primary-600 light, primary-400 dark). Consumed only by .button--secondary; the actual border/surface paint for outline currently routes through --hx-color-border-strong / --hx-color-surface-raised in styles, with this token reserved for the foreground.\n * @cssprop [--hx-color-action-secondary-border] - Secondary/outline variant border (3.2.1 semantic; outline still routes through --hx-color-border-strong by default).\n * @cssprop [--hx-color-action-secondary-bg-hover] - Secondary/outline variant hover fill (3.2.1 semantic; outline still routes through --hx-color-surface-raised by default).\n * @cssprop [--hx-color-action-ghost-fg] - Ghost variant fg.\n * @cssprop [--hx-color-action-ghost-bg-hover] - Ghost variant hover fill.\n * @cssprop [--hx-color-action-danger-bg] - Danger variant resting fill.\n * @cssprop [--hx-color-action-danger-bg-hover] - Danger variant hover fill.\n * @cssprop [--hx-color-action-danger-bg-active] - Danger variant active fill.\n * @cssprop [--hx-color-action-primary-bg-inverted-hover] - Primary variant hover/pressed fill on dark/inverted surface (resolves to primary-400, 7.27:1 on neutral-900).\n * @cssprop [--hx-color-action-danger-bg-inverted-hover] - Danger variant hover/pressed fill on dark/inverted surface (resolves to error-400, 6.58:1 on neutral-900).\n * @cssprop [--hx-color-text-on-primary] - Foreground for primary fill (resolves to neutral-900 — AA-tuned for primary-500).\n * @cssprop [--hx-color-text-on-primary-strong] - Foreground for primary-hover fill (resolves to neutral-0 across modes).\n * @cssprop [--hx-color-text-on-error] - Foreground for danger fill (resolves to neutral-900).\n * @cssprop [--hx-color-text-on-error-strong] - Foreground for danger-hover fill (resolves to neutral-0 across modes).\n * @cssprop [--hx-color-text-primary] - Foreground for tertiary variant on surface.sunken.\n * @cssprop [--hx-color-surface-sunken] - Tertiary variant resting fill.\n * @cssprop [--hx-color-surface-raised] - Tertiary variant hover fill.\n * @cssprop [--hx-color-surface-on-dark-overlay-subtle] - Inverted-tertiary resting fill (overlay-white-10 — translucent fill, not a border).\n * @cssprop [--hx-color-surface-on-dark-overlay-default] - Inverted-tertiary hover fill + inverted-secondary/ghost/outline hover fill (overlay-white-30 — translucent fill, not a border).\n * @cssprop [--hx-color-border-on-dark-strong] - Inverted-secondary/outline border + inverted focus-visible outline (overlay-white-70 ≈ 5:1 — clears WCAG 1.4.11 3:1 floor).\n */\n@customElement('hx-button')\nexport class HelixButton extends mixinDelegatesAria(HelixElement) {\n // 3.2.1: forced-colors deference is owned by the bespoke @media block in\n // hx-button.styles.ts (covers loading/disabled/focus, not just the base).\n // Do NOT also compose forcedColorsInteractive here — the mixin's docstring\n // forbids dual composition (XOR rule) and the dual approach was flagged in\n // the token-cascade campaign findings.\n static override styles = [helixButtonStyles];\n\n // ─── Form Association ───\n\n /** @internal */\n static override formAssociated = true;\n\n // ─── Public Properties ───\n\n /**\n * Visual style variant of the button.\n * @attr variant\n */\n @property({ type: String, reflect: true })\n variant: 'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost' | 'outline' = 'primary';\n\n /**\n * Size of the button.\n * @attr hx-size\n */\n @property({ type: String, reflect: true, attribute: 'hx-size' })\n size: 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Whether the button is disabled. Prevents all interaction and form actions.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Whether the button is in a loading state. Shows spinner, prevents interaction,\n * and sets aria-busy. Does not set the disabled attribute.\n * @attr loading\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * The type attribute for the underlying button element. Ignored when href is set.\n * @attr type\n */\n @property({ type: String })\n type: 'button' | 'submit' | 'reset' = 'button';\n\n /**\n * When set, renders an anchor element instead of a button.\n * @attr href\n */\n @property({ type: String })\n href: string | undefined = undefined;\n\n /**\n * Anchor target attribute. Only used when href is set.\n * @attr target\n */\n @property({ type: String })\n target: string | undefined = undefined;\n\n /**\n * Form field name submitted via ElementInternals.setFormValue on submit.\n * @attr name\n */\n @property({ type: String })\n name: string | undefined = undefined;\n\n /**\n * Form field value submitted via ElementInternals.setFormValue on submit.\n * @attr value\n */\n @property({ type: String })\n value: string | undefined = undefined;\n\n /**\n * When true, the button stretches to fill its container width.\n * Sets the host to `display: block` and the inner element to `width: 100%`.\n * @attr full\n */\n @property({ type: Boolean, reflect: true })\n full = false;\n\n /**\n * When true, flips button colors for placement on dark or gradient backgrounds.\n * Forces text to white and adjusts hover/focus ring colors across all variants.\n *\n * **Mode scope:** `[inverted]` is validated for placement on a dark *region*\n * within a light-mode-active page (hero banners, gradient sections, dark\n * cards). It is NOT validated for use within a dark-mode-active root\n * context: in dark mode, `surface.inverse` flips to a light surface\n * (neutral-100), and the lifted `-400` hover/active fills lose UI-floor\n * contrast against it (primary 2.10:1, danger 2.32:1 vs WCAG 1.4.11's 3:1\n * floor). Mode-aware fill stops + foreground for the dark-mode-inverted\n * combination are tracked as a 3.2.x follow-up.\n *\n * @attr inverted\n */\n @property({ type: Boolean, reflect: true })\n inverted = false;\n\n /**\n * Accessible label for icon-only or text-less buttons.\n * Required when the button has no visible text content.\n *\n * Accepts both `accessible-label` and the standard `aria-label` HTML attribute.\n * `accessible-label` takes precedence when both are set.\n *\n * @attr accessible-label\n */\n @property({ type: String, attribute: 'accessible-label' })\n accessibleLabel: string = '';\n\n /**\n * Returns the effective label for the button, checking accessible-label first,\n * then the aria-label attribute, falling back to empty string.\n * @internal\n */\n private get _effectiveLabel(): string {\n return this.accessibleLabel?.trim() || this.ariaLabel?.trim() || '';\n }\n\n // ─── Form API ───\n\n protected override _onFormDisabled(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n // ─── Lifecycle ───\n\n /** @internal */\n private static readonly _VALID_VARIANTS = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'danger',\n 'ghost',\n 'outline',\n ] as const;\n\n // Prevents double-warn on browsers that fire slotchange for empty initial slots.\n private _emptySlotWarnEmitted = false;\n\n override firstUpdated(changedProperties: PropertyValues<this>): void {\n super.firstUpdated(changedProperties);\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n const hasContent = (slot?.assignedNodes({ flatten: true }) ?? []).some(\n (n) => n.nodeType !== Node.TEXT_NODE || (n.textContent?.trim().length ?? 0) > 0,\n );\n if (!hasContent && !this._effectiveLabel) {\n this._emptySlotWarnEmitted = true;\n devWarn(\n 'hx-button',\n 'hx-button has no slot content and no accessible-label — button will have no accessible name.',\n );\n }\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (changedProperties.has('variant')) {\n const validVariants: string[] = [...HelixButton._VALID_VARIANTS];\n if (!validVariants.includes(this.variant)) {\n devWarn(\n 'hx-button',\n `Invalid variant \"${this.variant}\". Expected one of: ${validVariants.join(', ')}. Clamping to \"primary\".`,\n );\n this.variant = 'primary';\n }\n }\n }\n\n // ─── Slot Handlers ───\n\n /** @internal */\n private _handleDefaultSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n const hasContent = slot\n .assignedNodes({ flatten: true })\n .some((n) => n.nodeType !== Node.TEXT_NODE || (n.textContent?.trim().length ?? 0) > 0);\n if (!hasContent && !this._effectiveLabel && !this._emptySlotWarnEmitted) {\n devWarn(\n 'hx-button',\n 'hx-button has no slot content and no accessible-label — button will have no accessible name.',\n );\n }\n // Only reset once content arrives so the guard stays armed for browsers\n // that fire a second slotchange for the same empty initial slot.\n if (hasContent) {\n this._emptySlotWarnEmitted = false;\n }\n }\n\n // ─── Event Handling ───\n\n /**\n * @private\n * @internal\n */\n private _handleClick(e: MouseEvent): void {\n if (this.disabled || this.loading) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n /**\n * Dispatched when the button is clicked.\n * @event hx-click\n */\n this.dispatchEvent(\n new CustomEvent<{ originalEvent: MouseEvent }>('hx-click', {\n bubbles: true,\n composed: true,\n detail: { originalEvent: e },\n }),\n );\n\n // Handle form submission/reset if form-associated and not in anchor mode\n if (this.href === undefined && this.type === 'submit' && this._internals.form) {\n if (this.name !== undefined && this.value !== undefined) {\n this._internals.setFormValue(this.value);\n }\n this._internals.form.requestSubmit();\n } else if (this.href === undefined && this.type === 'reset' && this._internals.form) {\n this._internals.form.reset();\n }\n }\n\n // ─── Render Helpers ───\n\n /**\n * @private\n * @internal\n */\n private _renderSpinner(): TemplateResult {\n return html`\n <svg\n class=\"button__spinner\"\n part=\"spinner\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <circle\n class=\"button__spinner-track\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n opacity=\"0.3\"\n />\n <path\n class=\"button__spinner-arc\"\n d=\"M12 2a10 10 0 0 1 10 10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n />\n </svg>\n `;\n }\n\n /**\n * @private\n * @internal\n */\n private _renderInner(): TemplateResult {\n return html`\n ${this.loading ? this._renderSpinner() : nothing}\n <span part=\"prefix\" class=\"button__prefix\">\n <slot name=\"prefix\"></slot>\n </span>\n <span part=\"label\" class=\"button__label\">\n <slot @slotchange=${this._handleDefaultSlotChange}></slot>\n </span>\n <span part=\"suffix\" class=\"button__suffix\">\n <slot name=\"suffix\"></slot>\n </span>\n `;\n }\n\n // ─── Render ───\n\n override render() {\n const classes = {\n button: true,\n [`button--${this.variant}`]: true,\n [`button--${this.size}`]: true,\n 'button--loading': this.loading,\n };\n\n if (this.href !== undefined) {\n return html`\n <a\n part=\"button\"\n class=${classMap(classes)}\n href=${this.disabled || this.loading ? nothing : ifDefined(this.href)}\n target=${ifDefined(this.target)}\n rel=${this.target === '_blank' ? 'noopener noreferrer' : nothing}\n aria-label=${this._effectiveLabel || nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n tabindex=${this.disabled ? '-1' : nothing}\n @click=${this._handleClick}\n >\n ${this._renderInner()}\n </a>\n `;\n }\n\n return html`\n <button\n part=\"button\"\n class=${classMap(classes)}\n ?disabled=${this.disabled}\n type=${this.type}\n aria-label=${this._effectiveLabel || nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n @click=${this._handleClick}\n >\n ${this._renderInner()}\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-button': HelixButton;\n }\n interface HTMLElementEventMap {\n 'hx-click': CustomEvent<{ originalEvent: MouseEvent }>;\n }\n}\n"],"names":["helixButtonStyles","css","HelixButton","mixinDelegatesAria","HelixElement","_a","_b","disabled","changedProperties","slot","n","validVariants","devWarn","e","hasContent","html","nothing","classes","classMap","ifDefined","__decorateClass","property","customElement"],"mappings":";;;;;;;AAEO,MAAMA,IAAoBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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