@evoke-tech/stencil-ui-kit 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +120 -20
  2. package/dist/cjs/evoke-alert_20.cjs.entry.js +1047 -0
  3. package/dist/cjs/evoke-ui.cjs.js +2 -2
  4. package/dist/cjs/{index-B8xS0y1i.js → index-BpJ5gu8f.js} +146 -5
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/collection/collection-manifest.json +13 -1
  7. package/dist/collection/components/evoke-alert/evoke-alert.css +17 -6
  8. package/dist/collection/components/evoke-alert/evoke-alert.js +25 -1
  9. package/dist/collection/components/evoke-app-bar/evoke-app-bar.css +13 -0
  10. package/dist/collection/components/evoke-app-bar/evoke-app-bar.js +94 -0
  11. package/dist/collection/components/evoke-badge/evoke-badge.css +13 -0
  12. package/dist/collection/components/evoke-badge/evoke-badge.js +162 -0
  13. package/dist/collection/components/evoke-button/evoke-button.css +16 -2
  14. package/dist/collection/components/evoke-button/evoke-button.js +117 -5
  15. package/dist/collection/components/evoke-card/evoke-card.css +9 -1
  16. package/dist/collection/components/evoke-card/evoke-card.js +75 -1
  17. package/dist/collection/components/evoke-checkbox/evoke-checkbox.css +7 -1
  18. package/dist/collection/components/evoke-checkbox/evoke-checkbox.js +31 -2
  19. package/dist/collection/components/evoke-chip/evoke-chip.css +16 -0
  20. package/dist/collection/components/evoke-chip/evoke-chip.js +149 -0
  21. package/dist/collection/components/evoke-input/evoke-input.css +11 -3
  22. package/dist/collection/components/evoke-input/evoke-input.js +103 -13
  23. package/dist/collection/components/evoke-modal/evoke-modal.css +21 -5
  24. package/dist/collection/components/evoke-modal/evoke-modal.js +129 -4
  25. package/dist/collection/components/evoke-pagination/evoke-pagination.css +12 -0
  26. package/dist/collection/components/evoke-pagination/evoke-pagination.js +156 -0
  27. package/dist/collection/components/evoke-progress/evoke-progress.css +12 -0
  28. package/dist/collection/components/evoke-progress/evoke-progress.js +146 -0
  29. package/dist/collection/components/evoke-quantity-stepper/evoke-quantity-stepper.css +20 -0
  30. package/dist/collection/components/evoke-quantity-stepper/evoke-quantity-stepper.js +201 -0
  31. package/dist/collection/components/evoke-radio-group/evoke-radio-group.css +14 -1
  32. package/dist/collection/components/evoke-radio-group/evoke-radio-group.js +34 -8
  33. package/dist/collection/components/evoke-select/evoke-select.css +25 -4
  34. package/dist/collection/components/evoke-select/evoke-select.js +245 -15
  35. package/dist/collection/components/evoke-switch/evoke-switch.css +16 -0
  36. package/dist/collection/components/evoke-switch/evoke-switch.js +151 -0
  37. package/dist/collection/components/evoke-table/evoke-table.css +20 -0
  38. package/dist/collection/components/evoke-table/evoke-table.js +222 -0
  39. package/dist/collection/components/evoke-tabs/evoke-tabs.css +20 -0
  40. package/dist/collection/components/evoke-tabs/evoke-tabs.js +179 -0
  41. package/dist/collection/components/evoke-textarea/evoke-textarea.css +19 -0
  42. package/dist/collection/components/evoke-textarea/evoke-textarea.js +328 -0
  43. package/dist/collection/components/evoke-toast/evoke-toast.css +24 -0
  44. package/dist/collection/components/evoke-toast/evoke-toast.js +225 -0
  45. package/dist/collection/components/evoke-tooltip/evoke-tooltip.css +22 -0
  46. package/dist/collection/components/evoke-tooltip/evoke-tooltip.js +119 -0
  47. package/dist/collection/utils/icons.js +29 -0
  48. package/dist/components/evoke-alert.js +1 -1
  49. package/dist/components/evoke-app-bar.d.ts +11 -0
  50. package/dist/components/evoke-app-bar.js +1 -0
  51. package/dist/components/evoke-badge.d.ts +11 -0
  52. package/dist/components/evoke-badge.js +1 -0
  53. package/dist/components/evoke-button.js +1 -1
  54. package/dist/components/evoke-card.js +1 -1
  55. package/dist/components/evoke-checkbox.js +1 -1
  56. package/dist/components/evoke-chip.d.ts +11 -0
  57. package/dist/components/evoke-chip.js +1 -0
  58. package/dist/components/evoke-input.js +1 -1
  59. package/dist/components/evoke-modal.js +1 -1
  60. package/dist/components/evoke-pagination.d.ts +11 -0
  61. package/dist/components/evoke-pagination.js +1 -0
  62. package/dist/components/evoke-progress.d.ts +11 -0
  63. package/dist/components/evoke-progress.js +1 -0
  64. package/dist/components/evoke-quantity-stepper.d.ts +11 -0
  65. package/dist/components/evoke-quantity-stepper.js +1 -0
  66. package/dist/components/evoke-radio-group.js +1 -1
  67. package/dist/components/evoke-select.js +1 -1
  68. package/dist/components/evoke-switch.d.ts +11 -0
  69. package/dist/components/evoke-switch.js +1 -0
  70. package/dist/components/evoke-table.d.ts +11 -0
  71. package/dist/components/evoke-table.js +1 -0
  72. package/dist/components/evoke-tabs.d.ts +11 -0
  73. package/dist/components/evoke-tabs.js +1 -0
  74. package/dist/components/evoke-textarea.d.ts +11 -0
  75. package/dist/components/evoke-textarea.js +1 -0
  76. package/dist/components/evoke-toast.d.ts +11 -0
  77. package/dist/components/evoke-toast.js +1 -0
  78. package/dist/components/evoke-tooltip.d.ts +11 -0
  79. package/dist/components/evoke-tooltip.js +1 -0
  80. package/dist/components/icons.js +1 -0
  81. package/dist/esm/evoke-alert_20.entry.js +1026 -0
  82. package/dist/esm/evoke-ui.js +3 -3
  83. package/dist/esm/{index-BtM1wZ-I.js → index-C-5sEjU8.js} +146 -6
  84. package/dist/esm/loader.js +3 -3
  85. package/dist/evoke-ui/evoke-ui.css +1 -1
  86. package/dist/evoke-ui/evoke-ui.esm.js +1 -1
  87. package/dist/evoke-ui/p-0841be89.entry.js +1 -0
  88. package/dist/evoke-ui/p-C-5sEjU8.js +3 -0
  89. package/dist/themes/bootstrap.css +3 -0
  90. package/dist/themes/material.css +3 -0
  91. package/dist/themes/tailwind.css +3 -0
  92. package/dist/themes/tokens.css +4 -1
  93. package/dist/types/components/evoke-alert/evoke-alert.d.ts +2 -0
  94. package/dist/types/components/evoke-app-bar/evoke-app-bar.d.ts +14 -0
  95. package/dist/types/components/evoke-badge/evoke-badge.d.ts +17 -0
  96. package/dist/types/components/evoke-button/evoke-button.d.ts +12 -2
  97. package/dist/types/components/evoke-card/evoke-card.d.ts +9 -0
  98. package/dist/types/components/evoke-checkbox/evoke-checkbox.d.ts +5 -0
  99. package/dist/types/components/evoke-chip/evoke-chip.d.ts +14 -0
  100. package/dist/types/components/evoke-input/evoke-input.d.ts +9 -1
  101. package/dist/types/components/evoke-modal/evoke-modal.d.ts +19 -1
  102. package/dist/types/components/evoke-pagination/evoke-pagination.d.ts +15 -0
  103. package/dist/types/components/evoke-progress/evoke-progress.d.ts +13 -0
  104. package/dist/types/components/evoke-quantity-stepper/evoke-quantity-stepper.d.ts +18 -0
  105. package/dist/types/components/evoke-radio-group/evoke-radio-group.d.ts +4 -2
  106. package/dist/types/components/evoke-select/evoke-select.d.ts +31 -6
  107. package/dist/types/components/evoke-switch/evoke-switch.d.ts +15 -0
  108. package/dist/types/components/evoke-table/evoke-table.d.ts +29 -0
  109. package/dist/types/components/evoke-tabs/evoke-tabs.d.ts +21 -0
  110. package/dist/types/components/evoke-textarea/evoke-textarea.d.ts +28 -0
  111. package/dist/types/components/evoke-toast/evoke-toast.d.ts +24 -0
  112. package/dist/types/components/evoke-tooltip/evoke-tooltip.d.ts +17 -0
  113. package/dist/types/components.d.ts +1237 -18
  114. package/dist/types/utils/icons.d.ts +25 -0
  115. package/package.json +11 -4
  116. package/dist/cjs/evoke-alert_6.cjs.entry.js +0 -172
  117. package/dist/cjs/evoke-card.cjs.entry.js +0 -20
  118. package/dist/cjs/evoke-modal.cjs.entry.js +0 -34
  119. package/dist/esm/evoke-alert_6.entry.js +0 -165
  120. package/dist/esm/evoke-card.entry.js +0 -18
  121. package/dist/esm/evoke-modal.entry.js +0 -32
  122. package/dist/evoke-ui/p-243075cd.entry.js +0 -1
  123. package/dist/evoke-ui/p-605d4757.entry.js +0 -1
  124. package/dist/evoke-ui/p-9a6eaeb6.entry.js +0 -1
  125. package/dist/evoke-ui/p-BtM1wZ-I.js +0 -3
@@ -0,0 +1,1026 @@
1
+ import { h, r as registerInstance, c as createEvent, g as getElement } from './index-C-5sEjU8.js';
2
+
3
+ const PATHS = {
4
+ mail: ['M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z', 'm22 7-10 6L2 7'],
5
+ lock: ['M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2z', 'M7 11V7a5 5 0 0 1 10 0v4'],
6
+ user: ['M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2', 'M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z'],
7
+ search: ['M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z', 'm21 21-4.3-4.3'],
8
+ plus: ['M12 5v14', 'M5 12h14'],
9
+ minus: ['M5 12h14'],
10
+ check: ['M20 6 9 17l-5-5'],
11
+ x: ['M18 6 6 18', 'm6 6 12 12'],
12
+ 'chevron-down': ['m6 9 6 6 6-6'],
13
+ 'chevron-up': ['m18 15-6-6-6 6'],
14
+ 'chevron-left': ['m15 18-6-6 6-6'],
15
+ 'chevron-right': ['m9 18 6-6-6-6'],
16
+ 'arrow-right': ['M5 12h14', 'm12 5 7 7-7 7'],
17
+ 'arrow-up': ['M12 19V5', 'm5 12 7-7 7 7'],
18
+ 'arrow-down': ['M12 5v14', 'm19 12-7 7-7-7'],
19
+ sort: ['m7 15 5 5 5-5', 'm7 9 5-5 5 5'],
20
+ cart: ['M9 21a1 1 0 1 0 0-2 1 1 0 0 0 0 2z', 'M20 21a1 1 0 1 0 0-2 1 1 0 0 0 0 2z', 'M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'],
21
+ info: ['M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z', 'M12 16v-4', 'M12 8h.01'],
22
+ alert: ['M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z', 'M12 9v4', 'M12 17h.01'],
23
+ };
24
+ /** Renders a decorative inline SVG icon. */
25
+ function renderIcon(name, cls = 'evoke-icon') {
26
+ const paths = name ? PATHS[name] : undefined;
27
+ if (!paths)
28
+ return null;
29
+ return (h("svg", { class: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", focusable: "false" }, paths.map((d) => h("path", { d: d }))));
30
+ }
31
+
32
+ const evokeAlertCss = () => `evoke-alert{display:block}evoke-alert .evoke-alert{--_c:var(--evoke-info, #0891b2);display:flex;align-items:flex-start;gap:0.75rem;padding:0.75rem 1rem;border-radius:var(--evoke-radius, 8px);border:1px solid var(--_c);font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)}evoke-alert .evoke-alert--info{--_c:var(--evoke-info, #0891b2)}evoke-alert .evoke-alert--success{--_c:var(--evoke-success, #16a34a)}evoke-alert .evoke-alert--warning{--_c:var(--evoke-warning, #d97706)}evoke-alert .evoke-alert--danger{--_c:var(--evoke-danger, #dc2626)}evoke-alert .evoke-alert--subtle{background:color-mix(in srgb, var(--_c) 12%, var(--evoke-surface, #ffffff));color:var(--evoke-text, #1a1a1a)}evoke-alert .evoke-alert--subtle .evoke-alert__icon{color:var(--_c)}evoke-alert .evoke-alert--solid{background:color-mix(in srgb, var(--_c) 78%, #000);border-color:color-mix(in srgb, var(--_c) 78%, #000);color:#fff}evoke-alert .evoke-alert__icon{flex:none;width:20px;height:20px;margin-top:2px}evoke-alert .evoke-alert__content{flex:1;min-width:0}evoke-alert .evoke-alert__close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer}evoke-alert .evoke-alert__close:hover{background:color-mix(in srgb, currentColor 14%, transparent)}evoke-alert .evoke-alert__close:active{background:color-mix(in srgb, currentColor 24%, transparent)}evoke-alert .evoke-alert__close:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb, currentColor 40%, transparent)}evoke-alert .evoke-alert__close .evoke-icon{width:16px;height:16px}`;
33
+
34
+ const TYPE_ICON$1 = { info: 'info', success: 'check', warning: 'alert', danger: 'alert' };
35
+ const EvokeAlert = class {
36
+ constructor(hostRef) {
37
+ registerInstance(this, hostRef);
38
+ this.evokeDismiss = createEvent(this, "evokeDismiss");
39
+ this.type = 'info';
40
+ /** Subtle (tinted background) or solid (filled colour) */
41
+ this.appearance = 'subtle';
42
+ this.dismissible = false;
43
+ }
44
+ render() {
45
+ return (h("div", { key: 'a1b27ec91bb55baeacdcf9547f5a6680faad87e6', class: `evoke-alert evoke-alert--${this.type} evoke-alert--${this.appearance}`, role: this.type === 'danger' || this.type === 'warning' ? 'alert' : 'status' }, renderIcon(TYPE_ICON$1[this.type], 'evoke-alert__icon'), h("div", { key: '499700905c4cd7ca6de877185ed0b8a02d1d1ed9', class: "evoke-alert__content" }, h("slot", { key: '122793b5693dc905c6bfbd680ae050a12be57400' })), this.dismissible && (h("button", { key: 'a6bd557fdefc34efcf8b87552130b9a55425c381', type: "button", class: "evoke-alert__close", "aria-label": "Dismiss", onClick: () => this.evokeDismiss.emit() }, renderIcon('x', 'evoke-icon')))));
46
+ }
47
+ };
48
+ EvokeAlert.style = evokeAlertCss();
49
+
50
+ const evokeAppBarCss = () => `evoke-app-bar{display:block}evoke-app-bar[sticky]{position:sticky;top:0;z-index:50}evoke-app-bar .evoke-appbar{--_fg:var(--evoke-text, #1a1a1a);box-sizing:border-box;display:flex;align-items:center;gap:24px;min-height:64px;padding:8px 24px;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);background:var(--evoke-surface, #ffffff);color:var(--_fg);border-bottom:1px solid var(--evoke-border, #dedede)}evoke-app-bar .evoke-appbar--dark{--_fg:var(--evoke-secondary-contrast, #ffffff);background:var(--evoke-secondary, #0b1560);border-bottom-color:transparent}evoke-app-bar .evoke-appbar__logo{display:flex;align-items:center;gap:10px;font-weight:700;font-size:1.125rem;flex:none}evoke-app-bar .evoke-appbar__nav{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto}evoke-app-bar .evoke-appbar__actions{display:flex;align-items:center;gap:12px;flex:none;margin-left:auto}evoke-app-bar .evoke-appbar__nav a,evoke-app-bar .evoke-appbar__nav button{display:inline-flex;align-items:center;padding:8px 14px;font:inherit;color:inherit;text-decoration:none;background:none;border:0;border-radius:var(--evoke-radius-field, 8px);cursor:pointer;opacity:0.85;transition:background-color 0.15s, opacity 0.15s}evoke-app-bar .evoke-appbar__nav a:hover,evoke-app-bar .evoke-appbar__nav button:hover{opacity:1;background:color-mix(in srgb, currentColor 10%, transparent)}evoke-app-bar .evoke-appbar__nav a:active,evoke-app-bar .evoke-appbar__nav button:active{background:color-mix(in srgb, currentColor 18%, transparent)}evoke-app-bar .evoke-appbar__nav a[aria-current],evoke-app-bar .evoke-appbar__nav a.active{opacity:1;font-weight:600;box-shadow:inset 0 -2px 0 var(--evoke-primary, #ff5316);border-radius:0}evoke-app-bar .evoke-appbar__nav a:focus-visible,evoke-app-bar .evoke-appbar__nav button:focus-visible{outline:2px solid var(--evoke-primary, #ff5316);outline-offset:1px}`;
51
+
52
+ const EvokeAppBar = class {
53
+ constructor(hostRef) {
54
+ registerInstance(this, hostRef);
55
+ /** Light surface, or dark / brand-coloured (navy) */
56
+ this.appearance = 'light';
57
+ /** Stick to the top of the viewport while scrolling */
58
+ this.sticky = false;
59
+ /** Accessible name for the navigation landmark */
60
+ this.navLabel = 'Main';
61
+ }
62
+ render() {
63
+ return (h("header", { key: '11366baa08e286c8412eefbf82660f289fe42738', class: `evoke-appbar evoke-appbar--${this.appearance}` }, h("div", { key: '4a44bb53fc220b2c880fbafa79aecb2d195b2b85', class: "evoke-appbar__logo" }, h("slot", { key: 'bb727e24bb1058f0a6b6b4ffbe78616f639b15bd', name: "logo" })), h("nav", { key: '6d2023a4dad87266641d3cb2747218926c1750c7', class: "evoke-appbar__nav", "aria-label": this.navLabel }, h("slot", { key: 'ce4f50acddb09ebbc0c03538052cbd69e231fd2e', name: "nav" })), h("div", { key: 'ff64630598e48bf5b0b6708799247e8bcf54b184', class: "evoke-appbar__actions" }, h("slot", { key: 'e782ff890c366a72fe65df8f0544ad09c0818cc6', name: "actions" }))));
64
+ }
65
+ };
66
+ EvokeAppBar.style = evokeAppBarCss();
67
+
68
+ const evokeBadgeCss = () => `evoke-badge{display:inline-block}evoke-badge .evoke-badge-wrap{position:relative;display:inline-flex;vertical-align:middle}evoke-badge .evoke-badge{--_bg:var(--evoke-danger, #dc2626);--_fg:#fff;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;background:var(--_bg);color:var(--_fg);font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-weight:600}evoke-badge .evoke-badge--primary{--_bg:color-mix(in srgb, var(--evoke-primary, #ff5316) 82%, #000)}evoke-badge .evoke-badge--secondary{--_bg:var(--evoke-secondary, #0b1560);--_fg:var(--evoke-secondary-contrast, #ffffff)}evoke-badge .evoke-badge--danger{--_bg:color-mix(in srgb, var(--evoke-danger, #dc2626) 85%, #000)}evoke-badge .evoke-badge--success{--_bg:color-mix(in srgb, var(--evoke-success, #16a34a) 78%, #000)}evoke-badge .evoke-badge--warning{--_bg:color-mix(in srgb, var(--evoke-warning, #d97706) 78%, #000)}evoke-badge .evoke-badge--info{--_bg:color-mix(in srgb, var(--evoke-info, #0891b2) 78%, #000)}evoke-badge .evoke-badge--count{min-width:20px;height:20px;padding:0 6px;border-radius:9999px;font-size:0.75rem;line-height:1}evoke-badge .evoke-badge--dot{width:10px;height:10px;border-radius:50%}evoke-badge .evoke-badge-wrap--anchored>.evoke-badge{position:absolute;top:0;right:0;transform:translate(35%, -35%);box-shadow:0 0 0 2px var(--evoke-surface, #ffffff)}evoke-badge .evoke-badge__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}`;
69
+
70
+ const EvokeBadge = class {
71
+ constructor(hostRef) {
72
+ registerInstance(this, hostRef);
73
+ /** Number to show (count badge) */
74
+ this.count = 0;
75
+ /** Counts above this show as "max+" (e.g. 99+) */
76
+ this.max = 99;
77
+ /** Show a small status dot instead of a number */
78
+ this.dot = false;
79
+ /** Show the badge even when the count is 0 */
80
+ this.showZero = false;
81
+ this.color = 'danger';
82
+ /** Screen-reader text, e.g. "3 items in cart". A dot without a label is treated as decorative. */
83
+ this.label = '';
84
+ this.hasContent = false;
85
+ }
86
+ componentWillLoad() {
87
+ this.hasContent = Array.from(this.el.childNodes).some((n) => { var _a; return n.nodeType === 1 || (n.nodeType === 3 && !!((_a = n.textContent) === null || _a === void 0 ? void 0 : _a.trim())); });
88
+ }
89
+ render() {
90
+ const text = this.count > this.max ? `${this.max}+` : String(this.count);
91
+ const showCount = !this.dot && (this.count > 0 || this.showZero);
92
+ const bubble = this.dot ? (h("span", { class: `evoke-badge evoke-badge--dot evoke-badge--${this.color}`, role: this.label ? 'status' : undefined, "aria-label": this.label || undefined, "aria-hidden": this.label ? undefined : 'true' })) : showCount ? (h("span", { class: `evoke-badge evoke-badge--count evoke-badge--${this.color}` }, h("span", { "aria-hidden": this.label ? 'true' : undefined }, text), this.label && h("span", { class: "evoke-badge__sr" }, this.label))) : null;
93
+ return (h("span", { key: 'c49ac8a3361b9dcdfa3ebc3eacfca2079a3da60f', class: `evoke-badge-wrap ${this.hasContent ? 'evoke-badge-wrap--anchored' : ''}`.trim() }, h("slot", { key: 'b25c9150dcca4299ccae5735dcd0ea9a0c7e973a' }), bubble));
94
+ }
95
+ get el() { return getElement(this); }
96
+ };
97
+ EvokeBadge.style = evokeBadgeCss();
98
+
99
+ const evokeButtonCss = () => `evoke-button{display:inline-block}evoke-button .evoke-btn{box-sizing:border-box;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--evoke-font-size, 16px);line-height:1.5;cursor:pointer;height:var(--evoke-control-height, 56px);padding:0 var(--evoke-button-padding-x, 36px);display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;border:1px solid transparent;border-radius:var(--evoke-radius-button, 9999px);transition:filter 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.05s}evoke-button .evoke-btn--sm{height:calc(var(--evoke-control-height, 56px) * 0.75);padding:0 calc(var(--evoke-button-padding-x, 36px) * 0.6);font-size:0.875rem}evoke-button .evoke-btn--lg{height:calc(var(--evoke-control-height, 56px) * 1.15);padding:0 calc(var(--evoke-button-padding-x, 36px) * 1.2);font-size:1.125rem}evoke-button .evoke-btn--icon{padding:0;width:var(--evoke-control-height, 56px)}evoke-button .evoke-btn--icon.evoke-btn--sm{width:calc(var(--evoke-control-height, 56px) * 0.75)}evoke-button .evoke-btn--icon.evoke-btn--lg{width:calc(var(--evoke-control-height, 56px) * 1.15)}evoke-button .evoke-icon{width:1.1em;height:1.1em;flex:none}evoke-button .evoke-btn:hover:not(:disabled){filter:brightness(0.92)}evoke-button .evoke-btn:active:not(:disabled){filter:brightness(0.82);transform:translateY(1px)}evoke-button .evoke-btn:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-button .evoke-btn:disabled{opacity:0.5;cursor:not-allowed}evoke-button .evoke-btn--loading:disabled{cursor:progress;opacity:0.8}evoke-button .evoke-btn--primary{background:var(--evoke-primary, #ff5316);color:var(--evoke-primary-contrast, #ffffff)}evoke-button .evoke-btn--secondary{background:var(--evoke-secondary, #0b1560);color:var(--evoke-secondary-contrast, #ffffff)}evoke-button .evoke-btn--danger{background:var(--evoke-danger, #dc2626);color:#fff}evoke-button .evoke-btn--outline{background:transparent;color:var(--evoke-primary-text, #cc3d0d);border-color:var(--evoke-primary, #ff5316)}evoke-button .evoke-btn--ghost{background:transparent;color:var(--evoke-primary-text, #cc3d0d);border-color:transparent}evoke-button .evoke-btn--ghost:hover:not(:disabled){filter:none;background:color-mix(in srgb, var(--evoke-primary, #ff5316) 10%, transparent)}evoke-button .evoke-btn--ghost:active:not(:disabled){filter:none;background:color-mix(in srgb, var(--evoke-primary, #ff5316) 18%, transparent)}evoke-button .evoke-spinner{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:evoke-spin 0.7s linear infinite}@keyframes evoke-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){evoke-button .evoke-spinner{animation-duration:2s}}evoke-button[block]{display:block}evoke-button[block] .evoke-btn{width:100%}`;
100
+
101
+ const EvokeButton = class {
102
+ constructor(hostRef) {
103
+ registerInstance(this, hostRef);
104
+ /** Solid variants (primary, secondary, danger), outline, or ghost (text only, no border) */
105
+ this.variant = 'primary';
106
+ this.size = 'md';
107
+ this.type = 'button';
108
+ this.disabled = false;
109
+ /** Shows a spinner and blocks clicks while true */
110
+ this.loading = false;
111
+ /** Square button for icon-only use; set `accessible-label` too */
112
+ this.iconOnly = false;
113
+ /** Stretch to the full width of the container */
114
+ this.block = false;
115
+ /** Extra classes for the inner <button>, e.g. "btn btn-lg" (Bootstrap) or "shadow-lg" (Tailwind) */
116
+ this.buttonClass = '';
117
+ }
118
+ render() {
119
+ const cls = `evoke-btn evoke-btn--${this.variant} evoke-btn--${this.size} ${this.iconOnly ? 'evoke-btn--icon' : ''} ${this.loading ? 'evoke-btn--loading' : ''} ${this.buttonClass}`;
120
+ return (h("button", { key: 'f7d86f18cbcfd1d23b82cf37072f5af93c8d7ef3', type: this.type, class: cls.replace(/\s+/g, ' ').trim(), disabled: this.disabled || this.loading, "aria-busy": this.loading ? 'true' : undefined, "aria-label": this.accessibleLabel }, this.loading ? h("span", { class: "evoke-spinner", "aria-hidden": "true" }) : renderIcon(this.icon), h("slot", { key: '15d7302d67b7976d772e6b510e27b7e3f23c0634' })));
121
+ }
122
+ };
123
+ EvokeButton.style = evokeButtonCss();
124
+
125
+ const evokeCardCss = () => `evoke-card{display:block}evoke-card .evoke-card{background:var(--evoke-surface, #ffffff);color:var(--evoke-text, #1a1a1a);border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius, 8px);font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);overflow:hidden;transition:box-shadow 0.15s, border-color 0.15s, transform 0.05s}evoke-card .evoke-card--elevated{border-color:transparent;box-shadow:var(--evoke-shadow, 0 4px 12px rgba(0, 0, 0, 0.12))}evoke-card .evoke-card__media img,evoke-card .evoke-card__media video{display:block;width:100%;height:auto}evoke-card .evoke-card__header{padding:0.75rem 1rem;font-weight:600;border-bottom:1px solid var(--evoke-border, #dedede)}evoke-card .evoke-card--elevated .evoke-card__header{border-bottom-color:transparent}evoke-card .evoke-card__body{padding:1rem}evoke-card .evoke-card--clickable{cursor:pointer}evoke-card .evoke-card--clickable:hover{border-color:var(--evoke-primary, #ff5316)}evoke-card .evoke-card--elevated.evoke-card--clickable:hover{border-color:transparent;box-shadow:0 8px 24px rgba(0, 0, 0, 0.18)}evoke-card .evoke-card--clickable:active{transform:translateY(1px)}evoke-card .evoke-card--clickable:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15));border-color:var(--evoke-secondary, #0b1560)}`;
126
+
127
+ const EvokeCard = class {
128
+ constructor(hostRef) {
129
+ registerInstance(this, hostRef);
130
+ this.evokeClick = createEvent(this, "evokeClick");
131
+ this.heading = '';
132
+ /** Outlined (border) or elevated (shadow, no border) */
133
+ this.appearance = 'outlined';
134
+ /** Makes the whole card a button (hover/active/focus states, Enter/Space) */
135
+ this.clickable = false;
136
+ /** Extra classes for the card container, e.g. "shadow-md" (Tailwind) or "card" (Bootstrap) */
137
+ this.cardClass = '';
138
+ this.activate = () => {
139
+ if (this.clickable)
140
+ this.evokeClick.emit();
141
+ };
142
+ this.onKeyDown = (e) => {
143
+ if (!this.clickable || e.target !== e.currentTarget)
144
+ return;
145
+ if (e.key === 'Enter' || e.key === ' ') {
146
+ e.preventDefault();
147
+ this.activate();
148
+ }
149
+ };
150
+ }
151
+ render() {
152
+ return (h("div", { key: '770d8327a59c90f0dee5a2150de270e23024e7c2', class: `evoke-card evoke-card--${this.appearance} ${this.clickable ? 'evoke-card--clickable' : ''} ${this.cardClass}`.replace(/\s+/g, ' ').trim(), role: this.clickable ? 'button' : undefined, tabindex: this.clickable ? 0 : undefined, onClick: this.activate, onKeyDown: this.onKeyDown }, h("div", { key: '16ffd16092680ff8c42e9a13e7e7313cc0c4f1d5', class: "evoke-card__media" }, h("slot", { key: '92ba25d16ed81cad2dd4707cde97370b1e9efa33', name: "media" })), this.heading && h("div", { key: '6fd2d9d1fe8afe8074fc38cc8247f007218a7450', class: "evoke-card__header" }, this.heading), h("div", { key: 'afa26c53bfed69d01b350760428456293ebeb7fd', class: "evoke-card__body" }, h("slot", { key: '94e07c3b5f8170fae1667081cdcf39d5a869c249' }))));
153
+ }
154
+ };
155
+ EvokeCard.style = evokeCardCss();
156
+
157
+ const evokeCheckboxCss = () => `evoke-checkbox{display:block}evoke-checkbox .evoke-check{display:flex;flex-direction:column;gap:0.25rem;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);color:var(--evoke-text, #1a1a1a)}evoke-checkbox .evoke-check__row{display:inline-flex;align-items:center;gap:0.5rem;cursor:pointer;font-size:0.875rem}evoke-checkbox .evoke-check__row--disabled{opacity:0.6;cursor:not-allowed}evoke-checkbox .evoke-check__input{appearance:none;-webkit-appearance:none;margin:0;flex:none;width:16px;height:16px;border:2px solid var(--evoke-primary, #ff5316);border-radius:4px;background:var(--evoke-surface, #ffffff) center / 12px no-repeat;cursor:inherit;transition:background-color 0.15s, box-shadow 0.15s, filter 0.15s}evoke-checkbox .evoke-check__input:hover:not(:disabled){filter:brightness(0.92)}evoke-checkbox .evoke-check__input:active:not(:disabled){filter:brightness(0.8)}evoke-checkbox .evoke-check__input:checked{background-color:var(--evoke-primary, #ff5316);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")}evoke-checkbox .evoke-check__input:indeterminate{background-color:var(--evoke-primary, #ff5316);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E")}evoke-checkbox .evoke-check__input:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-checkbox .evoke-check__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-checkbox .evoke-check__error{color:var(--evoke-danger, #dc2626);font-size:0.875rem}`;
158
+
159
+ const EvokeCheckbox = class {
160
+ constructor(hostRef) {
161
+ registerInstance(this, hostRef);
162
+ this.evokeChange = createEvent(this, "evokeChange");
163
+ this.label = '';
164
+ this.checked = false;
165
+ /** Mixed state, e.g. a "select all" box when only some items are selected. Cleared on click. */
166
+ this.indeterminate = false;
167
+ this.disabled = false;
168
+ /** Error message shown below the checkbox */
169
+ this.error = '';
170
+ /** Extra classes for the inner <input> */
171
+ this.inputClass = '';
172
+ this.uid = Math.random().toString(36).slice(2, 9);
173
+ }
174
+ componentDidRender() {
175
+ if (this.inputEl)
176
+ this.inputEl.indeterminate = this.indeterminate;
177
+ }
178
+ render() {
179
+ const errId = `evoke-check-${this.uid}-err`;
180
+ return (h("div", { key: 'cc0882102020d6e748ee1c5bac124a3a2640862c', class: "evoke-check" }, h("label", { key: '62390001ac96c2c0602541eafc37559ab95ae80a', class: `evoke-check__row ${this.disabled ? 'evoke-check__row--disabled' : ''}` }, h("input", { key: 'bf8732581d0c36d3ba89c4b3c67b08ebf1268699', type: "checkbox", class: `evoke-check__input ${this.error ? 'evoke-check__input--error' : ''} ${this.inputClass}`.trim(), checked: this.checked, disabled: this.disabled, "aria-checked": this.indeterminate ? 'mixed' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.error ? errId : undefined, ref: (el) => (this.inputEl = el), onChange: (e) => {
181
+ this.indeterminate = false;
182
+ this.checked = e.target.checked;
183
+ this.evokeChange.emit(this.checked);
184
+ } }), h("span", { key: '6685db59dad6a3299179a04f67f25ca2d818c87a', class: "evoke-check__label" }, this.label, h("slot", { key: 'd2f72e8580dbfdabdd9e460642558a3b2199f098' }))), this.error && h("span", { key: '2d63862c8cc3489b8e1217fab1aa20da0fb86449', id: errId, class: "evoke-check__error", role: "alert" }, this.error)));
185
+ }
186
+ };
187
+ EvokeCheckbox.style = evokeCheckboxCss();
188
+
189
+ const evokeChipCss = () => `evoke-chip{display:inline-block}evoke-chip .evoke-chip{box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 14px;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:0.875rem;color:var(--evoke-text, #1a1a1a);background:var(--evoke-surface, #ffffff);border:1px solid var(--evoke-border, #dedede);border-radius:9999px;transition:background-color 0.15s, border-color 0.15s, filter 0.15s}evoke-chip .evoke-chip .evoke-icon{width:14px;height:14px;flex:none}evoke-chip .evoke-chip--filter{cursor:pointer;font:inherit;font-size:0.875rem}evoke-chip .evoke-chip--filter:hover:not(:disabled):not(.evoke-chip--selected){background:var(--evoke-surface-muted, #f5f5f5);border-color:var(--evoke-text-muted, #6b6b6b)}evoke-chip .evoke-chip--filter:active:not(:disabled){filter:brightness(0.9)}evoke-chip .evoke-chip--filter:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-chip .evoke-chip--selected{background:color-mix(in srgb, var(--evoke-primary, #ff5316) 14%, var(--evoke-surface, #ffffff));border-color:var(--evoke-primary, #ff5316);color:var(--evoke-text, #1a1a1a)}evoke-chip .evoke-chip--selected .evoke-icon{color:var(--evoke-primary, #ff5316)}evoke-chip .evoke-chip--filter:disabled,evoke-chip .evoke-chip--disabled{opacity:0.5;cursor:not-allowed}evoke-chip .evoke-chip--removable{padding-right:4px;background:var(--evoke-surface-muted, #f5f5f5);border-color:transparent}evoke-chip .evoke-chip__remove{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;color:inherit;background:none;border:0;border-radius:50%;cursor:pointer}evoke-chip .evoke-chip__remove:hover:not(:disabled){background:color-mix(in srgb, var(--evoke-text, #1a1a1a) 14%, transparent)}evoke-chip .evoke-chip__remove:active:not(:disabled){background:color-mix(in srgb, var(--evoke-text, #1a1a1a) 24%, transparent)}evoke-chip .evoke-chip__remove:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-chip .evoke-chip__remove:disabled{cursor:not-allowed}`;
190
+
191
+ const EvokeChip = class {
192
+ constructor(hostRef) {
193
+ registerInstance(this, hostRef);
194
+ this.evokeChange = createEvent(this, "evokeChange");
195
+ this.evokeRemove = createEvent(this, "evokeRemove");
196
+ this.label = '';
197
+ /** Selected state (filter chip) */
198
+ this.selected = false;
199
+ /** Shows a remove button instead of toggling selection */
200
+ this.removable = false;
201
+ this.disabled = false;
202
+ }
203
+ render() {
204
+ if (this.removable) {
205
+ return (h("span", { class: `evoke-chip evoke-chip--removable ${this.disabled ? 'evoke-chip--disabled' : ''}`.trim() }, h("span", { class: "evoke-chip__label" }, this.label, h("slot", null)), h("button", { type: "button", class: "evoke-chip__remove", "aria-label": `Remove ${this.label}`, disabled: this.disabled, onClick: () => this.evokeRemove.emit() }, renderIcon('x', 'evoke-icon'))));
206
+ }
207
+ return (h("button", { type: "button", class: `evoke-chip evoke-chip--filter ${this.selected ? 'evoke-chip--selected' : ''}`.trim(), "aria-pressed": this.selected ? 'true' : 'false', disabled: this.disabled, onClick: () => {
208
+ this.selected = !this.selected;
209
+ this.evokeChange.emit(this.selected);
210
+ } }, this.selected && renderIcon('check', 'evoke-icon'), h("span", { class: "evoke-chip__label" }, this.label, h("slot", null))));
211
+ }
212
+ };
213
+ EvokeChip.style = evokeChipCss();
214
+
215
+ const evokeInputCss = () => `evoke-input{display:block}evoke-input .evoke-field{display:flex;flex-direction:column;gap:0.5rem;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--evoke-font-size, 16px);color:var(--evoke-text, #1a1a1a)}evoke-input .evoke-field__label{color:var(--evoke-text, #1a1a1a)}evoke-input .evoke-field__control{position:relative}evoke-input .evoke-field__icon{position:absolute;left:16px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--evoke-text-muted, #6b6b6b);pointer-events:none}evoke-input .evoke-field__input{box-sizing:border-box;width:100%;height:var(--evoke-control-height, 56px);padding:0 24px;border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px);background:var(--evoke-surface, #ffffff);color:var(--evoke-text, #1a1a1a);font:inherit;transition:border-color 0.15s, box-shadow 0.15s, background-color 0.15s}evoke-input .evoke-field__input--icon{padding-left:44px}evoke-input .evoke-field__input::placeholder{color:var(--evoke-text-muted, #6b6b6b)}evoke-input .evoke-field__input:hover:not(:disabled):not(:focus){border-color:var(--evoke-text-muted, #6b6b6b)}evoke-input .evoke-field__input:focus{outline:none;border-color:var(--evoke-secondary, #0b1560);box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-input .evoke-field__input:disabled{opacity:0.6;cursor:not-allowed}evoke-input .evoke-field__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-input .evoke-field--filled .evoke-field__input{background:var(--evoke-surface-muted, #f5f5f5);border-color:transparent;border-bottom:2px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px) var(--evoke-radius-field, 8px) 0 0}evoke-input .evoke-field--filled .evoke-field__input:hover:not(:disabled):not(:focus){border-bottom-color:var(--evoke-text-muted, #6b6b6b)}evoke-input .evoke-field--filled .evoke-field__input:focus{box-shadow:none;border-bottom-color:var(--evoke-secondary, #0b1560)}evoke-input .evoke-field--filled .evoke-field__input:focus-visible{box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-input .evoke-field--filled .evoke-field__input--error{border-bottom-color:var(--evoke-danger, #dc2626)}evoke-input .evoke-field__hint{color:var(--evoke-text-muted, #6b6b6b);font-size:0.875rem}evoke-input .evoke-field__error{color:var(--evoke-danger, #dc2626);font-size:0.875rem}`;
216
+
217
+ const EvokeInput = class {
218
+ constructor(hostRef) {
219
+ registerInstance(this, hostRef);
220
+ this.evokeInput = createEvent(this, "evokeInput");
221
+ this.evokeChange = createEvent(this, "evokeChange");
222
+ this.label = '';
223
+ this.value = '';
224
+ this.type = 'text';
225
+ this.name = '';
226
+ this.placeholder = '';
227
+ this.disabled = false;
228
+ this.required = false;
229
+ /** Outlined (default) or filled (tinted background, bottom border) */
230
+ this.appearance = 'outlined';
231
+ /** Error message shown below the field (replaces the hint) */
232
+ this.error = '';
233
+ /** Helper text shown below the field */
234
+ this.hint = '';
235
+ /** Extra classes for the inner <input>, e.g. "form-control" (Bootstrap) */
236
+ this.inputClass = '';
237
+ this.inputId = `evoke-input-${Math.random().toString(36).slice(2, 9)}`;
238
+ }
239
+ render() {
240
+ const hasIcon = !!this.icon;
241
+ const describedBy = this.error || this.hint ? `${this.inputId}-msg` : undefined;
242
+ return (h("div", { key: '1bcce1a42e241c614eb5aacac045bf81fdf42ebd', class: `evoke-field evoke-field--${this.appearance}` }, this.label && h("label", { key: '6b0dbee7d5fad3238b22996d62d2ef23310b400b', htmlFor: this.inputId, class: "evoke-field__label" }, this.label, this.required && h("span", { key: '8258e6cc4d310d4becd7c1f4c6c511afdfffe715', "aria-hidden": "true" }, " *")), h("div", { key: 'b8b4ba4a562bdbc86be66bb413ae2ff0209e4592', class: "evoke-field__control" }, renderIcon(this.icon, 'evoke-field__icon'), h("input", { key: '059cf7679e73a950d8a891cc72432164e1ed81bd', id: this.inputId, class: `evoke-field__input ${hasIcon ? 'evoke-field__input--icon' : ''} ${this.error ? 'evoke-field__input--error' : ''} ${this.inputClass}`.replace(/\s+/g, ' ').trim(), type: this.type, name: this.name || undefined, value: this.value, placeholder: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": describedBy, onInput: (e) => {
243
+ this.value = e.target.value;
244
+ this.evokeInput.emit(this.value);
245
+ }, onChange: (e) => this.evokeChange.emit(e.target.value) })), this.error ? (h("span", { id: describedBy, class: "evoke-field__error", role: "alert" }, this.error)) : (this.hint && h("span", { id: describedBy, class: "evoke-field__hint" }, this.hint))));
246
+ }
247
+ };
248
+ EvokeInput.style = evokeInputCss();
249
+
250
+ const evokeModalCss = () => `evoke-modal .evoke-modal__backdrop{position:fixed;inset:0;background:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000;animation:evoke-fade 0.15s ease-out}evoke-modal .evoke-modal__backdrop--right{justify-content:flex-end;align-items:stretch}evoke-modal .evoke-modal{box-sizing:border-box;background:var(--evoke-surface, #ffffff);color:var(--evoke-text, #1a1a1a);font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);display:flex;flex-direction:column;max-width:100vw;box-shadow:0 20px 40px rgba(0, 0, 0, 0.25)}evoke-modal .evoke-modal:focus{outline:none}evoke-modal .evoke-modal--center{border-radius:var(--evoke-radius, 8px);max-height:90vh;width:min(92vw, 480px);animation:evoke-pop 0.15s ease-out}evoke-modal .evoke-modal--center.evoke-modal--sm{width:min(92vw, 360px)}evoke-modal .evoke-modal--center.evoke-modal--lg{width:min(92vw, 720px)}evoke-modal .evoke-modal--right{height:100%;border-radius:0;width:min(100vw, 420px);animation:evoke-slide 0.2s ease-out}evoke-modal .evoke-modal--right.evoke-modal--sm{width:min(100vw, 320px)}evoke-modal .evoke-modal--right.evoke-modal--lg{width:min(100vw, 640px)}evoke-modal .evoke-modal__header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:0.75rem 1rem;font-weight:600;border-bottom:1px solid var(--evoke-border, #dedede)}evoke-modal .evoke-modal__close{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer}evoke-modal .evoke-modal__close:hover{background:var(--evoke-surface-muted, #f5f5f5)}evoke-modal .evoke-modal__close:active{background:color-mix(in srgb, var(--evoke-text, #1a1a1a) 14%, transparent)}evoke-modal .evoke-modal__close:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-modal .evoke-modal__close .evoke-icon{width:18px;height:18px}evoke-modal .evoke-modal__body{padding:1rem;overflow:auto;flex:1}@keyframes evoke-fade{from{opacity:0}to{opacity:1}}@keyframes evoke-pop{from{opacity:0;transform:scale(0.96)}to{opacity:1;transform:none}}@keyframes evoke-slide{from{transform:translateX(100%)}to{transform:none}}@media (prefers-reduced-motion: reduce){evoke-modal .evoke-modal__backdrop,evoke-modal .evoke-modal{animation:none}}`;
251
+
252
+ const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
253
+ const EvokeModal = class {
254
+ constructor(hostRef) {
255
+ registerInstance(this, hostRef);
256
+ this.evokeClose = createEvent(this, "evokeClose");
257
+ /** Whether the modal is visible */
258
+ this.open = false;
259
+ this.heading = '';
260
+ /** Centred dialog, or a drawer sliding in from the right */
261
+ this.position = 'center';
262
+ this.size = 'md';
263
+ this.closeOnBackdrop = true;
264
+ /** Extra classes for the dialog panel */
265
+ this.modalClass = '';
266
+ this.previouslyFocused = null;
267
+ this.previousOverflow = '';
268
+ this.pendingFocus = false;
269
+ this.locked = false;
270
+ this.uid = Math.random().toString(36).slice(2, 9);
271
+ }
272
+ onOpenChange(next, prev) {
273
+ if (next && !prev)
274
+ this.onOpened();
275
+ else if (!next && prev)
276
+ this.onClosed();
277
+ }
278
+ componentDidLoad() {
279
+ if (this.open)
280
+ this.onOpened();
281
+ }
282
+ disconnectedCallback() {
283
+ if (this.locked)
284
+ this.unlockScroll();
285
+ }
286
+ componentDidRender() {
287
+ var _a;
288
+ if (this.pendingFocus && this.panel) {
289
+ this.pendingFocus = false;
290
+ ((_a = this.focusables()[0]) !== null && _a !== void 0 ? _a : this.panel).focus();
291
+ }
292
+ }
293
+ onOpened() {
294
+ this.previouslyFocused = document.activeElement;
295
+ this.pendingFocus = true;
296
+ if (!this.locked) {
297
+ this.previousOverflow = document.body.style.overflow;
298
+ document.body.style.overflow = 'hidden';
299
+ this.locked = true;
300
+ }
301
+ }
302
+ onClosed() {
303
+ var _a, _b;
304
+ this.unlockScroll();
305
+ (_b = (_a = this.previouslyFocused) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
306
+ this.previouslyFocused = null;
307
+ }
308
+ unlockScroll() {
309
+ document.body.style.overflow = this.previousOverflow;
310
+ this.locked = false;
311
+ }
312
+ focusables() {
313
+ if (!this.panel)
314
+ return [];
315
+ return Array.from(this.panel.querySelectorAll(FOCUSABLE)).filter((n) => n.offsetParent !== null);
316
+ }
317
+ close() {
318
+ this.open = false;
319
+ this.evokeClose.emit();
320
+ }
321
+ onKeydown(e) {
322
+ if (!this.open)
323
+ return;
324
+ if (e.key === 'Escape') {
325
+ e.preventDefault();
326
+ return this.close();
327
+ }
328
+ if (e.key !== 'Tab' || !this.panel)
329
+ return;
330
+ const items = this.focusables();
331
+ if (items.length === 0) {
332
+ e.preventDefault();
333
+ return this.panel.focus();
334
+ }
335
+ const first = items[0];
336
+ const last = items[items.length - 1];
337
+ const active = document.activeElement;
338
+ if (e.shiftKey && (active === first || active === this.panel)) {
339
+ e.preventDefault();
340
+ last.focus();
341
+ }
342
+ else if (!e.shiftKey && active === last) {
343
+ e.preventDefault();
344
+ first.focus();
345
+ }
346
+ }
347
+ render() {
348
+ if (!this.open)
349
+ return null;
350
+ const titleId = `evoke-modal-${this.uid}-title`;
351
+ return (h("div", { class: `evoke-modal__backdrop evoke-modal__backdrop--${this.position}`, onClick: () => this.closeOnBackdrop && this.close() }, h("div", { class: `evoke-modal evoke-modal--${this.position} evoke-modal--${this.size} ${this.modalClass}`.replace(/\s+/g, ' ').trim(), role: "dialog", "aria-modal": "true", "aria-labelledby": this.heading ? titleId : undefined, tabindex: -1, ref: (el) => (this.panel = el), onClick: (e) => e.stopPropagation() }, h("div", { class: "evoke-modal__header" }, h("span", { id: titleId }, this.heading), h("button", { type: "button", class: "evoke-modal__close", "aria-label": "Close", onClick: () => this.close() }, renderIcon('x', 'evoke-icon'))), h("div", { class: "evoke-modal__body" }, h("slot", null)))));
352
+ }
353
+ get el() { return getElement(this); }
354
+ static get watchers() { return {
355
+ "open": [{
356
+ "onOpenChange": 0
357
+ }]
358
+ }; }
359
+ };
360
+ EvokeModal.style = evokeModalCss();
361
+
362
+ const evokePaginationCss = () => `evoke-pagination{display:block}evoke-pagination .evoke-pager{display:flex;align-items:center;flex-wrap:wrap;gap:4px;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);color:var(--evoke-text, #1a1a1a)}evoke-pagination .evoke-pager__btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:40px;height:40px;padding:0 12px;font:inherit;font-size:0.9375rem;color:var(--evoke-text, #1a1a1a);background:transparent;border:1px solid transparent;border-radius:var(--evoke-radius-field, 8px);cursor:pointer;transition:background-color 0.15s, filter 0.15s}evoke-pagination .evoke-pager__btn:hover:not(:disabled):not(.evoke-pager__btn--active){background:var(--evoke-surface-muted, #f5f5f5)}evoke-pagination .evoke-pager__btn:active:not(:disabled){filter:brightness(0.85)}evoke-pagination .evoke-pager__btn:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-pagination .evoke-pager__btn:disabled{opacity:0.45;cursor:not-allowed}evoke-pagination .evoke-pager__btn--active{background:var(--evoke-primary, #ff5316);color:var(--evoke-primary-contrast, #ffffff)}evoke-pagination .evoke-pager__nav .evoke-icon{width:18px;height:18px}evoke-pagination .evoke-pager--compact .evoke-pager__nav{border-color:var(--evoke-border, #dedede);padding:0 14px}evoke-pagination .evoke-pager__gap{min-width:24px;text-align:center;color:var(--evoke-text-muted, #6b6b6b)}evoke-pagination .evoke-pager__status{padding:0 16px;font-size:0.9375rem}`;
363
+
364
+ const EvokePagination = class {
365
+ constructor(hostRef) {
366
+ registerInstance(this, hostRef);
367
+ this.evokeChange = createEvent(this, "evokeChange");
368
+ /** Current page (1-based) */
369
+ this.page = 1;
370
+ /** Total number of pages */
371
+ this.total = 1;
372
+ /** Numbered pages, or compact (Prev, "2 of 10", Next) */
373
+ this.appearance = 'numbered';
374
+ this.disabled = false;
375
+ }
376
+ go(p) {
377
+ const next = Math.min(Math.max(p, 1), Math.max(this.total, 1));
378
+ if (this.disabled || next === this.page)
379
+ return;
380
+ this.page = next;
381
+ this.evokeChange.emit(next);
382
+ }
383
+ pages() {
384
+ const t = this.total, p = this.page;
385
+ if (t <= 7)
386
+ return Array.from({ length: t }, (_, i) => i + 1);
387
+ const out = [1];
388
+ const start = Math.max(2, p - 1);
389
+ const end = Math.min(t - 1, p + 1);
390
+ if (start > 2)
391
+ out.push('…');
392
+ for (let i = start; i <= end; i++)
393
+ out.push(i);
394
+ if (end < t - 1)
395
+ out.push('…');
396
+ out.push(t);
397
+ return out;
398
+ }
399
+ render() {
400
+ const prevOff = this.disabled || this.page <= 1;
401
+ const nextOff = this.disabled || this.page >= this.total;
402
+ const prev = (h("button", { key: '702c8196b0bd4c6bfff38d355e85bda4c58ec52f', type: "button", class: "evoke-pager__btn evoke-pager__nav", "aria-label": "Previous page", disabled: prevOff, onClick: () => this.go(this.page - 1) }, renderIcon('chevron-left', 'evoke-icon'), this.appearance === 'compact' && h("span", { key: '64f68912c444b59a7a6c074e074f745585726e62' }, "Prev")));
403
+ const next = (h("button", { key: '5b7ff3fe00e16bd03e3244971bfb86c6891051c3', type: "button", class: "evoke-pager__btn evoke-pager__nav", "aria-label": "Next page", disabled: nextOff, onClick: () => this.go(this.page + 1) }, this.appearance === 'compact' && h("span", { key: '83d15b9f16dac8d810cb50d7a2a5df1c01f720cb' }, "Next"), renderIcon('chevron-right', 'evoke-icon')));
404
+ return (h("nav", { key: '5ebe89ac00b59391f425e518ae145b84742a5bb1', class: `evoke-pager evoke-pager--${this.appearance}`, "aria-label": "Pagination" }, prev, this.appearance === 'compact' ? (h("span", { class: "evoke-pager__status", "aria-live": "polite" }, this.page, " of ", this.total)) : (this.pages().map((p) => p === '…' ? (h("span", { class: "evoke-pager__gap", "aria-hidden": "true" }, "\u2026")) : (h("button", { type: "button", class: `evoke-pager__btn ${p === this.page ? 'evoke-pager__btn--active' : ''}`.trim(), "aria-label": `Page ${p}`, "aria-current": p === this.page ? 'page' : undefined, disabled: this.disabled, onClick: () => this.go(p) }, p)))), next));
405
+ }
406
+ };
407
+ EvokePagination.style = evokePaginationCss();
408
+
409
+ const evokeProgressCss = () => `evoke-progress{display:block}evoke-progress .evoke-progress--linear{position:relative;width:100%;height:8px;overflow:hidden;border-radius:9999px;background:var(--evoke-surface-muted, #f5f5f5);box-shadow:inset 0 0 0 1px var(--evoke-border, #dedede)}evoke-progress .evoke-progress__bar{height:100%;border-radius:inherit;background:var(--evoke-primary, #ff5316);transition:width 0.25s ease}evoke-progress .evoke-progress--linear.evoke-progress--indeterminate .evoke-progress__bar{position:absolute;width:40%;animation:evoke-bar 1.2s ease-in-out infinite}evoke-progress .evoke-progress--circular{display:inline-block}evoke-progress .evoke-progress--circular svg{display:block;width:100%;height:100%;transform:rotate(-90deg)}evoke-progress .evoke-progress__track{stroke:var(--evoke-border, #dedede)}evoke-progress .evoke-progress__ring{stroke:var(--evoke-primary, #ff5316);transition:stroke-dashoffset 0.25s ease}evoke-progress .evoke-progress--circular.evoke-progress--indeterminate svg{animation:evoke-spin 0.9s linear infinite}@keyframes evoke-bar{0%{left:-40%}100%{left:100%}}@keyframes evoke-spin{to{transform:rotate(270deg)}}@media (prefers-reduced-motion: reduce){evoke-progress .evoke-progress__bar,evoke-progress .evoke-progress--circular svg{animation-duration:3s !important;transition:none}}`;
410
+
411
+ const RADIUS = 18;
412
+ const CIRC = 2 * Math.PI * RADIUS;
413
+ const EvokeProgress = class {
414
+ constructor(hostRef) {
415
+ registerInstance(this, hostRef);
416
+ /** Linear bar, or circular spinner / ring */
417
+ this.type = 'linear';
418
+ /** Progress from 0 to 100 */
419
+ this.value = 0;
420
+ /** Unknown duration: animates continuously and ignores `value` */
421
+ this.indeterminate = false;
422
+ /** Accessible name, e.g. "Uploading" */
423
+ this.label = 'Loading';
424
+ /** Diameter in px for the circular type */
425
+ this.size = 40;
426
+ }
427
+ render() {
428
+ const v = Math.min(Math.max(Number(this.value) || 0, 0), 100);
429
+ const aria = {
430
+ role: 'progressbar',
431
+ 'aria-label': this.label,
432
+ 'aria-valuemin': '0',
433
+ 'aria-valuemax': '100',
434
+ 'aria-valuenow': this.indeterminate ? undefined : String(Math.round(v)),
435
+ };
436
+ if (this.type === 'circular') {
437
+ return (h("div", Object.assign({ class: `evoke-progress evoke-progress--circular ${this.indeterminate ? 'evoke-progress--indeterminate' : ''}`.trim(), style: { width: `${this.size}px`, height: `${this.size}px` } }, aria), h("svg", { viewBox: "0 0 44 44", "aria-hidden": "true", focusable: "false" }, h("circle", { class: "evoke-progress__track", cx: "22", cy: "22", r: String(RADIUS), fill: "none", "stroke-width": "4" }), h("circle", { class: "evoke-progress__ring", cx: "22", cy: "22", r: String(RADIUS), fill: "none", "stroke-width": "4", "stroke-linecap": "round", "stroke-dasharray": this.indeterminate ? `${CIRC * 0.25} ${CIRC}` : String(CIRC), "stroke-dashoffset": this.indeterminate ? undefined : String(CIRC * (1 - v / 100)) }))));
438
+ }
439
+ return (h("div", Object.assign({ class: `evoke-progress evoke-progress--linear ${this.indeterminate ? 'evoke-progress--indeterminate' : ''}`.trim() }, aria), h("div", { class: "evoke-progress__bar", style: this.indeterminate ? undefined : { width: `${v}%` } })));
440
+ }
441
+ };
442
+ EvokeProgress.style = evokeProgressCss();
443
+
444
+ const evokeQuantityStepperCss = () => `evoke-quantity-stepper{display:inline-block}evoke-quantity-stepper .evoke-qty{font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);color:var(--evoke-text, #1a1a1a)}evoke-quantity-stepper .evoke-qty--inline{display:inline-flex;align-items:center;height:calc(var(--evoke-control-height, 56px) * 0.75);border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-button, 9999px);background:var(--evoke-surface, #ffffff);overflow:hidden}evoke-quantity-stepper .evoke-qty--inline:focus-within{border-color:var(--evoke-secondary, #0b1560);box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-quantity-stepper .evoke-qty__btn{display:inline-flex;align-items:center;justify-content:center;width:calc(var(--evoke-control-height, 56px) * 0.75);height:100%;padding:0;color:var(--evoke-primary, #ff5316);background:transparent;border:0;cursor:pointer;transition:background-color 0.15s}evoke-quantity-stepper .evoke-qty__btn:hover:not(:disabled){background:color-mix(in srgb, var(--evoke-primary, #ff5316) 10%, transparent)}evoke-quantity-stepper .evoke-qty__btn:active:not(:disabled){background:color-mix(in srgb, var(--evoke-primary, #ff5316) 20%, transparent)}evoke-quantity-stepper .evoke-qty__btn:focus-visible{outline:2px solid var(--evoke-secondary, #0b1560);outline-offset:-3px}evoke-quantity-stepper .evoke-qty__btn:disabled{opacity:0.4;cursor:not-allowed}evoke-quantity-stepper .evoke-qty__btn .evoke-icon{width:16px;height:16px}evoke-quantity-stepper .evoke-qty__input{box-sizing:border-box;width:48px;height:100%;padding:0;text-align:center;font:inherit;color:var(--evoke-text, #1a1a1a);background:transparent;border:0}evoke-quantity-stepper .evoke-qty__input:focus{outline:none}evoke-quantity-stepper .evoke-qty__input:disabled{opacity:0.5}evoke-quantity-stepper .evoke-qty--compact{position:relative;display:inline-block}evoke-quantity-stepper .evoke-qty__select{box-sizing:border-box;height:calc(var(--evoke-control-height, 56px) * 0.75);padding:0 36px 0 16px;font:inherit;font-size:0.9375rem;color:var(--evoke-text, #1a1a1a);background:var(--evoke-surface, #ffffff);border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px);appearance:none;-webkit-appearance:none;cursor:pointer}evoke-quantity-stepper .evoke-qty__select:hover:not(:disabled):not(:focus){border-color:var(--evoke-text-muted, #6b6b6b)}evoke-quantity-stepper .evoke-qty__select:focus{outline:none;border-color:var(--evoke-secondary, #0b1560);box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-quantity-stepper .evoke-qty__select:disabled{opacity:0.5;cursor:not-allowed}evoke-quantity-stepper .evoke-qty__chevron{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--evoke-text-muted, #6b6b6b);pointer-events:none}`;
445
+
446
+ const EvokeQuantityStepper = class {
447
+ constructor(hostRef) {
448
+ registerInstance(this, hostRef);
449
+ this.evokeChange = createEvent(this, "evokeChange");
450
+ this.value = 1;
451
+ this.min = 1;
452
+ this.max = 99;
453
+ /** Inline (minus, value, plus) or compact with a quantity dropdown */
454
+ this.appearance = 'inline';
455
+ this.disabled = false;
456
+ /** Accessible name for the control */
457
+ this.label = 'Quantity';
458
+ this.onKeyDown = (e) => {
459
+ if (e.key === 'ArrowUp') {
460
+ e.preventDefault();
461
+ this.set(this.value + 1);
462
+ }
463
+ else if (e.key === 'ArrowDown') {
464
+ e.preventDefault();
465
+ this.set(this.value - 1);
466
+ }
467
+ };
468
+ }
469
+ clamp(n) {
470
+ return Math.min(Math.max(Math.round(n), this.min), this.max);
471
+ }
472
+ set(n) {
473
+ const next = this.clamp(Number.isFinite(n) ? n : this.value);
474
+ if (this.inputEl)
475
+ this.inputEl.value = String(next);
476
+ if (next === this.value)
477
+ return;
478
+ this.value = next;
479
+ this.evokeChange.emit(next);
480
+ }
481
+ render() {
482
+ if (this.appearance === 'compact') {
483
+ const top = Math.min(this.max, this.min + 9);
484
+ const opts = [];
485
+ for (let i = this.min; i <= top; i++)
486
+ opts.push(i);
487
+ if (!opts.includes(this.value))
488
+ opts.push(this.value);
489
+ return (h("div", { class: "evoke-qty evoke-qty--compact" }, h("select", { class: "evoke-qty__select", "aria-label": this.label, disabled: this.disabled, onChange: (e) => this.set(Number(e.target.value)) }, opts.map((n) => h("option", { value: String(n), selected: n === this.value }, "Qty: ", n))), renderIcon('chevron-down', 'evoke-qty__chevron')));
490
+ }
491
+ return (h("div", { class: "evoke-qty evoke-qty--inline", role: "group", "aria-label": this.label }, h("button", { type: "button", class: "evoke-qty__btn", "aria-label": "Decrease quantity", disabled: this.disabled || this.value <= this.min, onClick: () => this.set(this.value - 1) }, renderIcon('minus', 'evoke-icon')), h("input", { class: "evoke-qty__input", type: "text", inputmode: "numeric", pattern: "[0-9]*", "aria-label": this.label, value: String(this.value), disabled: this.disabled, ref: (el) => (this.inputEl = el), onKeyDown: this.onKeyDown, onChange: (e) => this.set(parseInt(e.target.value, 10)) }), h("button", { type: "button", class: "evoke-qty__btn", "aria-label": "Increase quantity", disabled: this.disabled || this.value >= this.max, onClick: () => this.set(this.value + 1) }, renderIcon('plus', 'evoke-icon'))));
492
+ }
493
+ };
494
+ EvokeQuantityStepper.style = evokeQuantityStepperCss();
495
+
496
+ /** Accepts an array, or a JSON string (so options can be set as an HTML attribute). */
497
+ function parseOptions(options) {
498
+ if (Array.isArray(options))
499
+ return options;
500
+ try {
501
+ const parsed = JSON.parse(options);
502
+ return Array.isArray(parsed) ? parsed : [];
503
+ }
504
+ catch (_a) {
505
+ return [];
506
+ }
507
+ }
508
+
509
+ const evokeRadioGroupCss = () => `evoke-radio-group{display:block}evoke-radio-group .evoke-radio{display:flex;flex-direction:column;gap:0.5rem;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);color:var(--evoke-text, #1a1a1a)}evoke-radio-group .evoke-radio__label{font-size:var(--evoke-font-size, 16px)}evoke-radio-group .evoke-radio__options{display:flex;flex-direction:column;gap:0.5rem}evoke-radio-group .evoke-radio__options--inline{flex-direction:row;flex-wrap:wrap;gap:1.25rem}evoke-radio-group .evoke-radio__row{display:inline-flex;align-items:center;gap:0.5rem;cursor:pointer;font-size:0.875rem}evoke-radio-group .evoke-radio__row--disabled{opacity:0.6;cursor:not-allowed}evoke-radio-group .evoke-radio__input{appearance:none;-webkit-appearance:none;margin:0;flex:none;width:16px;height:16px;border:2px solid var(--evoke-primary, #ff5316);border-radius:50%;background:var(--evoke-surface, #ffffff);cursor:inherit;transition:box-shadow 0.15s, filter 0.15s}evoke-radio-group .evoke-radio__input:hover:not(:disabled){filter:brightness(0.92)}evoke-radio-group .evoke-radio__input:checked{background:radial-gradient(circle, var(--evoke-primary, #ff5316) 0 40%, var(--evoke-surface, #ffffff) 45%)}evoke-radio-group .evoke-radio__input:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-radio-group .evoke-radio__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-radio-group .evoke-radio__error{color:var(--evoke-danger, #dc2626);font-size:0.875rem}evoke-radio-group .evoke-radio__options--segmented{flex-direction:row;gap:0;align-self:flex-start;border:1px solid var(--evoke-primary, #ff5316);border-radius:var(--evoke-radius-field, 8px);overflow:hidden}evoke-radio-group .evoke-seg{position:relative;display:inline-flex;cursor:pointer}evoke-radio-group .evoke-seg+.evoke-seg{border-left:1px solid var(--evoke-primary, #ff5316)}evoke-radio-group .evoke-seg--disabled{opacity:0.5;cursor:not-allowed}evoke-radio-group .evoke-seg__input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}evoke-radio-group .evoke-seg__text{display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--evoke-control-height, 56px) * 0.75);padding:0 20px;font-size:0.875rem;background:var(--evoke-surface, #ffffff);color:var(--evoke-primary-text, #cc3d0d);transition:background-color 0.15s, filter 0.15s}evoke-radio-group .evoke-seg:hover .evoke-seg__input:not(:disabled):not(:checked)+.evoke-seg__text{background:color-mix(in srgb, var(--evoke-primary, #ff5316) 10%, var(--evoke-surface, #ffffff))}evoke-radio-group .evoke-seg__input:checked+.evoke-seg__text{background:var(--evoke-primary, #ff5316);color:var(--evoke-primary-contrast, #ffffff)}evoke-radio-group .evoke-seg__input:active:not(:disabled)+.evoke-seg__text{filter:brightness(0.85)}evoke-radio-group .evoke-seg__input:focus-visible+.evoke-seg__text{box-shadow:inset 0 0 0 3px var(--evoke-secondary, #0b1560)}evoke-radio-group .evoke-seg__input.evoke-radio__input--error+.evoke-seg__text{color:var(--evoke-danger, #dc2626)}`;
510
+
511
+ const EvokeRadioGroup = class {
512
+ constructor(hostRef) {
513
+ registerInstance(this, hostRef);
514
+ this.evokeChange = createEvent(this, "evokeChange");
515
+ this.label = '';
516
+ /** Options as an array of { label, value, disabled? } or a JSON string of the same */
517
+ this.options = [];
518
+ this.value = '';
519
+ this.name = '';
520
+ this.disabled = false;
521
+ /** Classic radio circles, or a segmented button group */
522
+ this.appearance = 'classic';
523
+ /** Lay classic options out in a row instead of a column */
524
+ this.inline = false;
525
+ /** Error message shown below the group */
526
+ this.error = '';
527
+ this.uid = Math.random().toString(36).slice(2, 9);
528
+ }
529
+ render() {
530
+ const name = this.name || `evoke-radio-${this.uid}`;
531
+ const labelId = `${name}-label`;
532
+ const errId = `${name}-err`;
533
+ const segmented = this.appearance === 'segmented';
534
+ return (h("div", { key: 'ddf9183b0a6733b0daf79dcdb5f7dd5525d00a62', class: "evoke-radio", role: "radiogroup", "aria-labelledby": this.label ? labelId : undefined, "aria-describedby": this.error ? errId : undefined }, this.label && h("span", { key: 'f80aacb295bedb5d68a51e1005de17d8d845736e', id: labelId, class: "evoke-radio__label" }, this.label), h("div", { key: '44ee0b00ad1970f2b00dcb2789f1418f76833fcd', class: `evoke-radio__options ${this.inline && !segmented ? 'evoke-radio__options--inline' : ''} ${segmented ? 'evoke-radio__options--segmented' : ''}`.replace(/\s+/g, ' ').trim() }, parseOptions(this.options).map((o) => {
535
+ const off = this.disabled || o.disabled;
536
+ const input = (h("input", { type: "radio", class: `${segmented ? 'evoke-seg__input' : 'evoke-radio__input'} ${this.error ? 'evoke-radio__input--error' : ''}`.trim(), name: name, value: o.value, checked: o.value === this.value, disabled: off, onChange: () => {
537
+ this.value = o.value;
538
+ this.evokeChange.emit(this.value);
539
+ } }));
540
+ return segmented ? (h("label", { class: `evoke-seg ${off ? 'evoke-seg--disabled' : ''}`.trim() }, input, h("span", { class: "evoke-seg__text" }, o.label))) : (h("label", { class: `evoke-radio__row ${off ? 'evoke-radio__row--disabled' : ''}`.trim() }, input, h("span", null, o.label)));
541
+ })), this.error && h("span", { key: 'b6027efeea9334325c731eb73630c982c1a88ce2', id: errId, class: "evoke-radio__error", role: "alert" }, this.error)));
542
+ }
543
+ };
544
+ EvokeRadioGroup.style = evokeRadioGroupCss();
545
+
546
+ const evokeSelectCss = () => `evoke-select{display:block}evoke-select .evoke-field{display:flex;flex-direction:column;gap:0.5rem;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--evoke-font-size, 16px);color:var(--evoke-text, #1a1a1a)}evoke-select .evoke-field__control{position:relative}evoke-select .evoke-field__input{box-sizing:border-box;width:100%;height:var(--evoke-control-height, 56px);padding:0 48px 0 24px;border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px);background:var(--evoke-surface, #ffffff);color:var(--evoke-text, #1a1a1a);font:inherit;appearance:none;-webkit-appearance:none;cursor:pointer;transition:border-color 0.15s, box-shadow 0.15s}evoke-select .evoke-field__select--empty{color:var(--evoke-text-muted, #6b6b6b)}evoke-select .evoke-field__input:hover:not(:disabled):not(:focus){border-color:var(--evoke-text-muted, #6b6b6b)}evoke-select .evoke-field__input:focus,evoke-select .evoke-select__trigger:focus-visible{outline:none;border-color:var(--evoke-secondary, #0b1560);box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-select .evoke-field__input:disabled,evoke-select .evoke-select__trigger--disabled{opacity:0.6;cursor:not-allowed}evoke-select .evoke-field__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-select .evoke-field__chevron{position:absolute;right:16px;top:calc(var(--evoke-control-height, 56px) / 2);transform:translateY(-50%);width:18px;height:18px;color:var(--evoke-text-muted, #6b6b6b);pointer-events:none}evoke-select .evoke-field__hint{color:var(--evoke-text-muted, #6b6b6b);font-size:0.875rem}evoke-select .evoke-field__error{color:var(--evoke-danger, #dc2626);font-size:0.875rem}evoke-select .evoke-select__trigger{display:flex;align-items:center;height:auto;min-height:var(--evoke-control-height, 56px);padding-top:6px;padding-bottom:6px}evoke-select .evoke-select__value{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}evoke-select .evoke-select__placeholder{color:var(--evoke-text-muted, #6b6b6b)}evoke-select .evoke-select__chip{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 10px;border-radius:9999px;font-size:0.875rem;background:color-mix(in srgb, var(--evoke-primary, #ff5316) 12%, var(--evoke-surface, #ffffff));color:var(--evoke-text, #1a1a1a)}evoke-select .evoke-select__chip-remove{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer}evoke-select .evoke-select__chip-remove:hover{background:color-mix(in srgb, var(--evoke-text, #1a1a1a) 12%, transparent)}evoke-select .evoke-select__chip-remove:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-select .evoke-select__chip-remove .evoke-icon{width:12px;height:12px}evoke-select .evoke-select__panel{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 4px);background:var(--evoke-surface, #ffffff);border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px);box-shadow:var(--evoke-shadow, 0 4px 12px rgba(0, 0, 0, 0.12));max-height:280px;display:flex;flex-direction:column;overflow:hidden}evoke-select .evoke-select__search{box-sizing:border-box;margin:8px;padding:8px 12px;border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px);font:inherit;color:var(--evoke-text, #1a1a1a);background:var(--evoke-surface, #ffffff)}evoke-select .evoke-select__search:focus{outline:none;border-color:var(--evoke-secondary, #0b1560);box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-select .evoke-select__list{list-style:none;margin:0;padding:4px;overflow:auto}evoke-select .evoke-select__option{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-radius:calc(var(--evoke-radius-field, 8px) - 2px);cursor:pointer}evoke-select .evoke-select__option--active{background:var(--evoke-surface-muted, #f5f5f5)}evoke-select .evoke-select__option--selected{color:var(--evoke-primary-text, #cc3d0d);font-weight:500}evoke-select .evoke-select__option--disabled{opacity:0.5;cursor:not-allowed}evoke-select .evoke-select__option .evoke-icon{width:16px;height:16px;flex:none}evoke-select .evoke-select__empty{padding:12px 16px;color:var(--evoke-text-muted, #6b6b6b)}`;
547
+
548
+ const EvokeSelect = class {
549
+ constructor(hostRef) {
550
+ registerInstance(this, hostRef);
551
+ this.evokeChange = createEvent(this, "evokeChange");
552
+ this.label = '';
553
+ /** Options as an array of { label, value, disabled? } or a JSON string of the same */
554
+ this.options = [];
555
+ /** Selected value (string), or an array of values when `multiple` */
556
+ this.value = '';
557
+ this.placeholder = 'Select an option';
558
+ /** Multi-select: selected values are shown as removable chips */
559
+ this.multiple = false;
560
+ /** Adds a search box that filters the options */
561
+ this.searchable = false;
562
+ this.disabled = false;
563
+ /** Error message shown below the field (replaces the hint) */
564
+ this.error = '';
565
+ this.hint = '';
566
+ /** Extra classes for the inner <select> (single, non-searchable mode), e.g. "form-select" */
567
+ this.selectClass = '';
568
+ this.isOpen = false;
569
+ this.query = '';
570
+ this.activeIndex = 0;
571
+ this.uid = Math.random().toString(36).slice(2, 9);
572
+ this.focusSearch = false;
573
+ this.onKeyDown = (e) => {
574
+ const list = this.filtered;
575
+ const onTrigger = e.target === this.triggerEl;
576
+ switch (e.key) {
577
+ case 'ArrowDown':
578
+ case 'ArrowUp': {
579
+ e.preventDefault();
580
+ if (!this.isOpen)
581
+ return this.openPanel();
582
+ const step = e.key === 'ArrowDown' ? 1 : -1;
583
+ this.activeIndex = Math.min(Math.max(this.activeIndex + step, 0), Math.max(list.length - 1, 0));
584
+ break;
585
+ }
586
+ case 'Home':
587
+ case 'End':
588
+ if (this.isOpen && !this.searchable) {
589
+ e.preventDefault();
590
+ this.activeIndex = e.key === 'Home' ? 0 : Math.max(list.length - 1, 0);
591
+ }
592
+ break;
593
+ case 'Enter':
594
+ case ' ':
595
+ if (e.key === ' ' && !onTrigger)
596
+ return; // allow typing spaces in the search box
597
+ e.preventDefault();
598
+ if (!this.isOpen)
599
+ return this.openPanel();
600
+ if (list[this.activeIndex])
601
+ this.toggle(list[this.activeIndex]);
602
+ break;
603
+ case 'Escape':
604
+ if (this.isOpen) {
605
+ e.preventDefault();
606
+ this.closePanel();
607
+ }
608
+ break;
609
+ case 'Tab':
610
+ if (this.isOpen)
611
+ this.closePanel(false);
612
+ break;
613
+ }
614
+ };
615
+ }
616
+ get selected() {
617
+ const v = this.value;
618
+ if (Array.isArray(v))
619
+ return v;
620
+ if (!v)
621
+ return [];
622
+ if (this.multiple) {
623
+ if (v.trim().startsWith('[')) {
624
+ try {
625
+ const parsed = JSON.parse(v);
626
+ if (Array.isArray(parsed))
627
+ return parsed.map(String);
628
+ }
629
+ catch ( /* fall through to comma list */_a) { /* fall through to comma list */ }
630
+ }
631
+ return v.split(',').map((s) => s.trim()).filter(Boolean);
632
+ }
633
+ return [v];
634
+ }
635
+ get filtered() {
636
+ const q = this.query.trim().toLowerCase();
637
+ const all = parseOptions(this.options);
638
+ return q ? all.filter((o) => o.label.toLowerCase().includes(q)) : all;
639
+ }
640
+ onDocClick(e) {
641
+ if (this.isOpen && !this.el.contains(e.target))
642
+ this.closePanel(false);
643
+ }
644
+ componentDidRender() {
645
+ var _a;
646
+ if (!this.isOpen)
647
+ return;
648
+ if (this.focusSearch && this.searchEl) {
649
+ this.focusSearch = false;
650
+ this.searchEl.focus();
651
+ }
652
+ (_a = this.el.querySelector('.evoke-select__option--active')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: 'nearest' });
653
+ }
654
+ openPanel() {
655
+ if (this.disabled)
656
+ return;
657
+ const first = this.filtered.findIndex((o) => this.selected.includes(o.value));
658
+ this.activeIndex = first >= 0 ? first : 0;
659
+ this.isOpen = true;
660
+ this.focusSearch = this.searchable;
661
+ }
662
+ closePanel(refocus = true) {
663
+ var _a;
664
+ this.isOpen = false;
665
+ this.query = '';
666
+ if (refocus)
667
+ (_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.focus();
668
+ }
669
+ commit(next) {
670
+ this.value = next;
671
+ this.evokeChange.emit(next);
672
+ }
673
+ toggle(o) {
674
+ if (o.disabled)
675
+ return;
676
+ if (this.multiple) {
677
+ const cur = this.selected;
678
+ this.commit(cur.includes(o.value) ? cur.filter((v) => v !== o.value) : [...cur, o.value]);
679
+ }
680
+ else {
681
+ this.commit(o.value);
682
+ this.closePanel();
683
+ }
684
+ }
685
+ removeChip(v) {
686
+ this.commit(this.selected.filter((x) => x !== v));
687
+ }
688
+ renderNative() {
689
+ var _a;
690
+ const selectId = `evoke-select-${this.uid}`;
691
+ const msgId = `${selectId}-msg`;
692
+ const cur = (_a = this.selected[0]) !== null && _a !== void 0 ? _a : '';
693
+ return (h("div", { class: "evoke-field__control" }, h("select", { id: selectId, class: `evoke-field__input evoke-field__select ${cur === '' ? 'evoke-field__select--empty' : ''} ${this.error ? 'evoke-field__input--error' : ''} ${this.selectClass}`.replace(/\s+/g, ' ').trim(), disabled: this.disabled, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.error || this.hint ? msgId : undefined, onChange: (e) => this.commit(e.target.value) }, h("option", { value: "", disabled: true, selected: cur === '' }, this.placeholder), parseOptions(this.options).map((o) => (h("option", { value: o.value, disabled: o.disabled, selected: o.value === cur }, o.label)))), renderIcon('chevron-down', 'evoke-field__chevron')));
694
+ }
695
+ renderCustom() {
696
+ const labelId = `evoke-select-${this.uid}-label`;
697
+ const listId = `evoke-select-${this.uid}-list`;
698
+ const msgId = `evoke-select-${this.uid}-msg`;
699
+ const all = parseOptions(this.options);
700
+ const sel = this.selected;
701
+ const list = this.filtered;
702
+ const labelOf = (v) => { var _a, _b; return (_b = (_a = all.find((o) => o.value === v)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : v; };
703
+ return (h("div", { class: "evoke-field__control", onKeyDown: this.onKeyDown }, h("div", { class: `evoke-select__trigger evoke-field__input ${this.error ? 'evoke-field__input--error' : ''} ${this.disabled ? 'evoke-select__trigger--disabled' : ''}`.trim(), role: "combobox", tabindex: this.disabled ? -1 : 0, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-controls": listId, "aria-labelledby": this.label ? labelId : undefined, "aria-label": this.label ? undefined : this.placeholder, "aria-disabled": this.disabled ? 'true' : undefined, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.error || this.hint ? msgId : undefined, "aria-activedescendant": this.isOpen && list[this.activeIndex] ? `${listId}-${this.activeIndex}` : undefined, ref: (el) => (this.triggerEl = el), onClick: () => (this.isOpen ? this.closePanel() : this.openPanel()) }, h("span", { class: "evoke-select__value" }, sel.length === 0 && h("span", { class: "evoke-select__placeholder" }, this.placeholder), this.multiple
704
+ ? sel.map((v) => (h("span", { class: "evoke-select__chip" }, labelOf(v), h("button", { type: "button", class: "evoke-select__chip-remove", "aria-label": `Remove ${labelOf(v)}`, disabled: this.disabled, onClick: (e) => {
705
+ e.stopPropagation();
706
+ this.removeChip(v);
707
+ } }, renderIcon('x', 'evoke-icon')))))
708
+ : sel.length > 0 && h("span", null, labelOf(sel[0])))), renderIcon('chevron-down', 'evoke-field__chevron'), this.isOpen && (h("div", { class: "evoke-select__panel" }, this.searchable && (h("input", { class: "evoke-select__search", type: "text", placeholder: "Search\u2026", "aria-label": "Search options", "aria-controls": listId, "aria-activedescendant": list[this.activeIndex] ? `${listId}-${this.activeIndex}` : undefined, value: this.query, ref: (el) => (this.searchEl = el), onInput: (e) => {
709
+ this.query = e.target.value;
710
+ this.activeIndex = 0;
711
+ } })), h("ul", { id: listId, class: "evoke-select__list", role: "listbox", "aria-multiselectable": this.multiple ? 'true' : undefined, "aria-labelledby": this.label ? labelId : undefined }, list.map((o, i) => {
712
+ const isSel = sel.includes(o.value);
713
+ return (h("li", { id: `${listId}-${i}`, role: "option", "aria-selected": isSel ? 'true' : 'false', "aria-disabled": o.disabled ? 'true' : undefined, class: `evoke-select__option ${i === this.activeIndex ? 'evoke-select__option--active' : ''} ${isSel ? 'evoke-select__option--selected' : ''} ${o.disabled ? 'evoke-select__option--disabled' : ''}`.replace(/\s+/g, ' ').trim(), onMouseEnter: () => (this.activeIndex = i), onClick: () => this.toggle(o) }, h("span", null, o.label), isSel && renderIcon('check', 'evoke-icon')));
714
+ })), list.length === 0 && h("div", { class: "evoke-select__empty" }, "No results")))));
715
+ }
716
+ render() {
717
+ const labelId = `evoke-select-${this.uid}-label`;
718
+ const msgId = `evoke-select-${this.uid}-msg`;
719
+ const custom = this.multiple || this.searchable;
720
+ return (h("div", { key: '2bb9566731e91295db3e98b8934acee7d53bc0c7', class: "evoke-field" }, this.label && (h("label", { key: '2279b600e0770a516af752c309af43ba6fd28320', id: labelId, htmlFor: custom ? undefined : `evoke-select-${this.uid}`, class: "evoke-field__label" }, this.label)), custom ? this.renderCustom() : this.renderNative(), this.error ? (h("span", { id: msgId, class: "evoke-field__error", role: "alert" }, this.error)) : (this.hint && h("span", { id: msgId, class: "evoke-field__hint" }, this.hint))));
721
+ }
722
+ get el() { return getElement(this); }
723
+ };
724
+ EvokeSelect.style = evokeSelectCss();
725
+
726
+ const evokeSwitchCss = () => `evoke-switch{display:inline-block}evoke-switch .evoke-switch{position:relative;display:inline-flex;align-items:flex-start;gap:0.75rem;cursor:pointer;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);color:var(--evoke-text, #1a1a1a)}evoke-switch .evoke-switch--disabled{opacity:0.6;cursor:not-allowed}evoke-switch .evoke-switch__input{position:absolute;width:44px;height:24px;margin:0;opacity:0;cursor:inherit}evoke-switch .evoke-switch__track{position:relative;flex:none;width:44px;height:24px;border-radius:9999px;background:#767676;transition:background-color 0.15s, box-shadow 0.15s, filter 0.15s}evoke-switch .evoke-switch__thumb{position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3);transition:transform 0.15s}evoke-switch .evoke-switch__input:checked+.evoke-switch__track{background:var(--evoke-primary, #ff5316)}evoke-switch .evoke-switch__input:checked+.evoke-switch__track .evoke-switch__thumb{transform:translateX(20px)}evoke-switch .evoke-switch:hover .evoke-switch__input:not(:disabled)+.evoke-switch__track{filter:brightness(0.92)}evoke-switch .evoke-switch__input:active:not(:disabled)+.evoke-switch__track .evoke-switch__thumb{width:24px}evoke-switch .evoke-switch__input:checked:active:not(:disabled)+.evoke-switch__track .evoke-switch__thumb{transform:translateX(16px)}evoke-switch .evoke-switch__input:focus-visible+.evoke-switch__track{box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-switch .evoke-switch__text{display:flex;flex-direction:column;gap:2px}evoke-switch .evoke-switch__label{font-size:var(--evoke-font-size, 16px);line-height:24px}evoke-switch .evoke-switch__desc{font-size:0.875rem;color:var(--evoke-text-muted, #6b6b6b)}@media (prefers-reduced-motion: reduce){evoke-switch .evoke-switch__thumb,evoke-switch .evoke-switch__track{transition:none}}`;
727
+
728
+ const EvokeSwitch = class {
729
+ constructor(hostRef) {
730
+ registerInstance(this, hostRef);
731
+ this.evokeChange = createEvent(this, "evokeChange");
732
+ this.checked = false;
733
+ /** Optional visible label. Without a label or description it is a plain toggle. */
734
+ this.label = '';
735
+ /** Secondary text under the label */
736
+ this.description = '';
737
+ this.disabled = false;
738
+ this.uid = Math.random().toString(36).slice(2, 9);
739
+ }
740
+ render() {
741
+ const descId = `evoke-switch-${this.uid}-desc`;
742
+ return (h("label", { key: '8e3b9741c4e2f7ed93ce7f24893cc2db0d6acf9f', class: `evoke-switch ${this.disabled ? 'evoke-switch--disabled' : ''}`.trim() }, h("input", { key: 'b29122d5f8a0eb572f6f0384d537dc85543ccd66', type: "checkbox", role: "switch", class: "evoke-switch__input", checked: this.checked, disabled: this.disabled, "aria-checked": this.checked ? 'true' : 'false', "aria-label": !this.label ? this.accessibleLabel : undefined, "aria-describedby": this.description ? descId : undefined, onChange: (e) => {
743
+ this.checked = e.target.checked;
744
+ this.evokeChange.emit(this.checked);
745
+ } }), h("span", { key: 'fbecc8e67a062f7b14f9a035491f6d857ac09f71', class: "evoke-switch__track", "aria-hidden": "true" }, h("span", { key: 'ac6a8575b42fcb8424fee235016e4159ddec4fa9', class: "evoke-switch__thumb" })), (this.label || this.description) && (h("span", { key: '46357674f960e74b0f203d7bb129f605e588bb2e', class: "evoke-switch__text" }, this.label && h("span", { key: 'e4f4cee280c46587abe609d3946ed2a7a3b97d41', class: "evoke-switch__label" }, this.label), this.description && h("span", { key: '56cdbf07afaa3c64df0666ccc9d39a736188cd3d', id: descId, class: "evoke-switch__desc" }, this.description)))));
746
+ }
747
+ };
748
+ EvokeSwitch.style = evokeSwitchCss();
749
+
750
+ const evokeTableCss = () => `evoke-table{display:block}evoke-table .evoke-table__wrap{overflow-x:auto;border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius, 8px)}evoke-table .evoke-table{width:100%;border-collapse:collapse;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:0.9375rem;color:var(--evoke-text, #1a1a1a);background:var(--evoke-surface, #ffffff)}evoke-table .evoke-table__caption{padding:12px 16px;text-align:left;color:var(--evoke-text-muted, #6b6b6b)}evoke-table .evoke-table__th{padding:12px 16px;font-weight:600;background:var(--evoke-surface-muted, #f5f5f5);border-bottom:1px solid var(--evoke-border, #dedede);white-space:nowrap}evoke-table .evoke-table__td{padding:12px 16px;border-bottom:1px solid var(--evoke-border, #dedede)}evoke-table tbody tr:last-child .evoke-table__td{border-bottom:0}evoke-table .evoke-table__cell--left{text-align:left}evoke-table .evoke-table__cell--center{text-align:center}evoke-table .evoke-table__cell--right{text-align:right}evoke-table .evoke-table--striped .evoke-table__row:nth-child(even){background:var(--evoke-surface-muted, #f5f5f5)}evoke-table .evoke-table__row:hover{background:color-mix(in srgb, var(--evoke-primary, #ff5316) 6%, var(--evoke-surface, #ffffff))}evoke-table .evoke-table--striped .evoke-table__row:nth-child(even):hover{background:color-mix(in srgb, var(--evoke-primary, #ff5316) 8%, var(--evoke-surface-muted, #f5f5f5))}evoke-table .evoke-table__empty{padding:24px 16px;text-align:center;color:var(--evoke-text-muted, #6b6b6b)}evoke-table .evoke-table__sort{display:inline-flex;align-items:center;gap:6px;padding:2px 4px;margin:-2px -4px;font:inherit;font-weight:inherit;color:inherit;background:none;border:0;border-radius:4px;cursor:pointer}evoke-table .evoke-table__sort:hover{color:var(--evoke-primary-text, #cc3d0d)}evoke-table .evoke-table__sort:active{background:color-mix(in srgb, var(--evoke-text, #1a1a1a) 10%, transparent)}evoke-table .evoke-table__sort:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-table .evoke-table__sort-icon{width:14px;height:14px;color:var(--evoke-text-muted, #6b6b6b)}evoke-table .evoke-table__sort-icon--active{color:var(--evoke-primary, #ff5316)}`;
751
+
752
+ const EvokeTable = class {
753
+ constructor(hostRef) {
754
+ registerInstance(this, hostRef);
755
+ this.evokeSort = createEvent(this, "evokeSort");
756
+ /** Columns as an array of { key, label, sortable?, align? } or a JSON string of the same */
757
+ this.columns = [];
758
+ /** Rows as an array of objects keyed by column key, or a JSON string of the same */
759
+ this.rows = [];
760
+ /** Alternate row shading */
761
+ this.striped = false;
762
+ /** Allow sorting on columns marked `sortable` (or all columns if none are marked) */
763
+ this.sortable = false;
764
+ /** Visually hidden/visible table caption for screen readers */
765
+ this.caption = '';
766
+ this.emptyText = 'No data';
767
+ this.sortKey = '';
768
+ this.sortDir = 'asc';
769
+ }
770
+ parse(v) {
771
+ if (Array.isArray(v))
772
+ return v;
773
+ try {
774
+ const p = JSON.parse(v);
775
+ return Array.isArray(p) ? p : [];
776
+ }
777
+ catch (_a) {
778
+ return [];
779
+ }
780
+ }
781
+ toggleSort(key) {
782
+ this.sortDir = this.sortKey === key && this.sortDir === 'asc' ? 'desc' : 'asc';
783
+ this.sortKey = key;
784
+ this.evokeSort.emit({ key, direction: this.sortDir });
785
+ }
786
+ render() {
787
+ const cols = this.parse(this.columns);
788
+ const anyMarked = cols.some((c) => c.sortable);
789
+ const isSortable = (c) => this.sortable && (anyMarked ? !!c.sortable : true);
790
+ let rows = [...this.parse(this.rows)];
791
+ if (this.sortKey) {
792
+ const k = this.sortKey;
793
+ const dir = this.sortDir === 'asc' ? 1 : -1;
794
+ rows.sort((a, b) => {
795
+ const x = a[k], y = b[k];
796
+ if (x == null)
797
+ return 1;
798
+ if (y == null)
799
+ return -1;
800
+ return (typeof x === 'number' && typeof y === 'number' ? x - y : String(x).localeCompare(String(y), undefined, { numeric: true })) * dir;
801
+ });
802
+ }
803
+ return (h("div", { class: "evoke-table__wrap" }, h("table", { class: `evoke-table ${this.striped ? 'evoke-table--striped' : ''}`.trim() }, this.caption && h("caption", { class: "evoke-table__caption" }, this.caption), h("thead", null, h("tr", null, cols.map((c) => {
804
+ var _a;
805
+ const active = this.sortKey === c.key;
806
+ return (h("th", { scope: "col", class: `evoke-table__th evoke-table__cell--${(_a = c.align) !== null && _a !== void 0 ? _a : 'left'}`, "aria-sort": isSortable(c) ? (active ? (this.sortDir === 'asc' ? 'ascending' : 'descending') : 'none') : undefined }, isSortable(c) ? (h("button", { type: "button", class: "evoke-table__sort", onClick: () => this.toggleSort(c.key) }, c.label, renderIcon(active ? (this.sortDir === 'asc' ? 'arrow-up' : 'arrow-down') : 'sort', `evoke-table__sort-icon ${active ? 'evoke-table__sort-icon--active' : ''}`.trim()))) : (c.label)));
807
+ }))), h("tbody", null, rows.length === 0 ? (h("tr", null, h("td", { class: "evoke-table__empty", colSpan: Math.max(cols.length, 1) }, this.emptyText))) : (rows.map((r) => (h("tr", { class: "evoke-table__row" }, cols.map((c) => { var _a; return h("td", { class: `evoke-table__td evoke-table__cell--${(_a = c.align) !== null && _a !== void 0 ? _a : 'left'}` }, r[c.key] == null ? '' : String(r[c.key])); })))))))));
808
+ }
809
+ };
810
+ EvokeTable.style = evokeTableCss();
811
+
812
+ const evokeTabsCss = () => `evoke-tabs{display:block;min-width:0;max-width:100%}evoke-tabs .evoke-tabs{font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);color:var(--evoke-text, #1a1a1a)}evoke-tabs .evoke-tabs__list{display:flex;gap:4px;overflow-x:auto}evoke-tabs .evoke-tabs__tab{flex:none;font:inherit;font-size:1rem;padding:12px 20px;background:transparent;border:0;color:var(--evoke-text-muted, #6b6b6b);cursor:pointer;transition:color 0.15s, background-color 0.15s, filter 0.15s}evoke-tabs .evoke-tabs__tab:hover:not(:disabled):not(.evoke-tabs__tab--active){color:var(--evoke-text, #1a1a1a)}evoke-tabs .evoke-tabs__tab:disabled{opacity:0.5;cursor:not-allowed}evoke-tabs .evoke-tabs__tab:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-tabs .evoke-tabs--underline .evoke-tabs__list{border-bottom:1px solid var(--evoke-border, #dedede);gap:0}evoke-tabs .evoke-tabs--underline .evoke-tabs__tab{border-bottom:2px solid transparent;margin-bottom:-1px}evoke-tabs .evoke-tabs--underline .evoke-tabs__tab:hover:not(:disabled):not(.evoke-tabs__tab--active){border-bottom-color:var(--evoke-border, #dedede)}evoke-tabs .evoke-tabs--underline .evoke-tabs__tab--active{color:var(--evoke-primary-text, #cc3d0d);border-bottom-color:var(--evoke-primary, #ff5316);font-weight:500}evoke-tabs .evoke-tabs--underline .evoke-tabs__tab:active:not(:disabled){background:var(--evoke-surface-muted, #f5f5f5)}evoke-tabs .evoke-tabs--pill .evoke-tabs__tab{border-radius:var(--evoke-radius-button, 9999px);padding:8px 20px}evoke-tabs .evoke-tabs--pill .evoke-tabs__tab:hover:not(:disabled):not(.evoke-tabs__tab--active){background:var(--evoke-surface-muted, #f5f5f5)}evoke-tabs .evoke-tabs--pill .evoke-tabs__tab--active{background:var(--evoke-primary, #ff5316);color:var(--evoke-primary-contrast, #ffffff)}evoke-tabs .evoke-tabs--pill .evoke-tabs__tab:active:not(:disabled){filter:brightness(0.85)}evoke-tabs .evoke-tabs__panel{padding:16px 0}evoke-tabs .evoke-tabs__panel:focus-visible{outline:none;box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15));border-radius:var(--evoke-radius-field, 8px)}`;
813
+
814
+ const EvokeTabs = class {
815
+ constructor(hostRef) {
816
+ registerInstance(this, hostRef);
817
+ this.evokeChange = createEvent(this, "evokeChange");
818
+ /** Tabs as an array of { label, value, disabled? } or a JSON string of the same */
819
+ this.options = [];
820
+ /** Value of the active tab. Defaults to the first enabled tab. */
821
+ this.value = '';
822
+ /** Underline tabs or pill tabs */
823
+ this.appearance = 'underline';
824
+ /** Accessible name for the tab list */
825
+ this.label = '';
826
+ this.uid = Math.random().toString(36).slice(2, 9);
827
+ this.onKeyDown = (e) => {
828
+ const keys = ['ArrowRight', 'ArrowLeft', 'Home', 'End'];
829
+ if (!keys.includes(e.key))
830
+ return;
831
+ const tabs = this.tabs;
832
+ const enabled = tabs.map((t, i) => (t.disabled ? -1 : i)).filter((i) => i >= 0);
833
+ if (enabled.length === 0)
834
+ return;
835
+ e.preventDefault();
836
+ const cur = tabs.findIndex((t) => t.value === this.activeValue);
837
+ const pos = enabled.indexOf(cur);
838
+ let next = enabled[0];
839
+ if (e.key === 'ArrowRight')
840
+ next = enabled[(pos + 1) % enabled.length];
841
+ else if (e.key === 'ArrowLeft')
842
+ next = enabled[(pos - 1 + enabled.length) % enabled.length];
843
+ else if (e.key === 'End')
844
+ next = enabled[enabled.length - 1];
845
+ const btn = this.el.querySelectorAll('[role="tab"]')[next];
846
+ btn === null || btn === void 0 ? void 0 : btn.focus();
847
+ this.select(tabs[next].value);
848
+ };
849
+ }
850
+ get tabs() {
851
+ return parseOptions(this.options);
852
+ }
853
+ get activeValue() {
854
+ var _a, _b;
855
+ const tabs = this.tabs;
856
+ return tabs.some((t) => t.value === this.value && !t.disabled) ? this.value : (_b = (_a = tabs.find((t) => !t.disabled)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
857
+ }
858
+ select(v) {
859
+ if (v === this.value)
860
+ return;
861
+ this.value = v;
862
+ this.evokeChange.emit(v);
863
+ }
864
+ render() {
865
+ const active = this.activeValue;
866
+ return (h("div", { key: '0eb147989be035ae85cc6778f7c5205ff450bbf0', class: `evoke-tabs evoke-tabs--${this.appearance}` }, h("div", { key: '2bed606eed52a8186fc6fdca50c179555a57de8c', class: "evoke-tabs__list", role: "tablist", "aria-label": this.label || undefined, onKeyDown: this.onKeyDown }, this.tabs.map((t) => {
867
+ const on = t.value === active;
868
+ return (h("button", { type: "button", role: "tab", id: `evoke-tab-${this.uid}-${t.value}`, class: `evoke-tabs__tab ${on ? 'evoke-tabs__tab--active' : ''}`.trim(), "aria-selected": on ? 'true' : 'false', "aria-controls": `evoke-panel-${this.uid}`, tabindex: on ? 0 : -1, disabled: t.disabled, onClick: () => this.select(t.value) }, t.label));
869
+ })), h("div", { key: 'b80df36c152b9b189e359a1d59106eb9372d1d62', class: "evoke-tabs__panel", role: "tabpanel", id: `evoke-panel-${this.uid}`, "aria-labelledby": active ? `evoke-tab-${this.uid}-${active}` : undefined, tabindex: 0 }, h("slot", { key: 'df28c424c9fd41a51f6068d04cf1f71605207d9d' }))));
870
+ }
871
+ get el() { return getElement(this); }
872
+ };
873
+ EvokeTabs.style = evokeTabsCss();
874
+
875
+ const evokeTextareaCss = () => `evoke-textarea{display:block}evoke-textarea .evoke-field{display:flex;flex-direction:column;gap:0.5rem;font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--evoke-font-size, 16px);color:var(--evoke-text, #1a1a1a)}evoke-textarea .evoke-field__input{box-sizing:border-box;width:100%;padding:14px 24px;border:1px solid var(--evoke-border, #dedede);border-radius:var(--evoke-radius-field, 8px);background:var(--evoke-surface, #ffffff);color:var(--evoke-text, #1a1a1a);font:inherit;line-height:1.5;resize:vertical;transition:border-color 0.15s, box-shadow 0.15s}evoke-textarea .evoke-field__textarea--auto{resize:none;overflow:hidden}evoke-textarea .evoke-field__input::placeholder{color:var(--evoke-text-muted, #6b6b6b)}evoke-textarea .evoke-field__input:hover:not(:disabled):not(:focus){border-color:var(--evoke-text-muted, #6b6b6b)}evoke-textarea .evoke-field__input:focus{outline:none;border-color:var(--evoke-secondary, #0b1560);box-shadow:var(--evoke-focus-ring, 0 0 0 3px rgba(11, 21, 96, 0.15))}evoke-textarea .evoke-field__input:disabled{opacity:0.6;cursor:not-allowed}evoke-textarea .evoke-field__input--error{border-color:var(--evoke-danger, #dc2626)}evoke-textarea .evoke-field__footer{display:flex;justify-content:space-between;gap:1rem;font-size:0.875rem}evoke-textarea .evoke-field__footer:empty{display:none}evoke-textarea .evoke-field__hint{color:var(--evoke-text-muted, #6b6b6b)}evoke-textarea .evoke-field__error{color:var(--evoke-danger, #dc2626)}evoke-textarea .evoke-field__counter{margin-left:auto;color:var(--evoke-text-muted, #6b6b6b)}evoke-textarea .evoke-field__counter--full{color:var(--evoke-danger, #dc2626)}`;
876
+
877
+ const EvokeTextarea = class {
878
+ constructor(hostRef) {
879
+ registerInstance(this, hostRef);
880
+ this.evokeInput = createEvent(this, "evokeInput");
881
+ this.evokeChange = createEvent(this, "evokeChange");
882
+ this.label = '';
883
+ this.value = '';
884
+ this.name = '';
885
+ this.placeholder = '';
886
+ /** Visible rows (the minimum height when `auto-grow` is on) */
887
+ this.rows = 4;
888
+ /** Grow with the content instead of scrolling */
889
+ this.autoGrow = false;
890
+ this.disabled = false;
891
+ this.required = false;
892
+ this.error = '';
893
+ this.hint = '';
894
+ /** Extra classes for the inner <textarea> */
895
+ this.textareaClass = '';
896
+ this.uid = Math.random().toString(36).slice(2, 9);
897
+ }
898
+ componentDidRender() {
899
+ this.resize();
900
+ }
901
+ resize() {
902
+ if (!this.autoGrow || !this.el)
903
+ return;
904
+ this.el.style.height = 'auto';
905
+ this.el.style.height = `${this.el.scrollHeight}px`;
906
+ }
907
+ render() {
908
+ var _a;
909
+ const id = `evoke-textarea-${this.uid}`;
910
+ const msgId = `${id}-msg`;
911
+ const len = ((_a = this.value) !== null && _a !== void 0 ? _a : '').length;
912
+ const hasMax = typeof this.maxLength === 'number' && this.maxLength > 0;
913
+ return (h("div", { key: '5d950d88f2b9e191fd4a29e4eada4c5e4d8c779d', class: "evoke-field" }, this.label && h("label", { key: '46fee07268bedd23742d8d91018dfd47c93bd58b', htmlFor: id, class: "evoke-field__label" }, this.label, this.required && h("span", { key: '45af0e76daa25a15e0583777f5217757074c8d78', "aria-hidden": "true" }, " *")), h("textarea", { key: '917c3b5749cd5b75133bb2b71a90e036b3f4eef9', id: id, class: `evoke-field__input evoke-field__textarea ${this.autoGrow ? 'evoke-field__textarea--auto' : ''} ${this.error ? 'evoke-field__input--error' : ''} ${this.textareaClass}`.replace(/\s+/g, ' ').trim(), name: this.name || undefined, rows: this.rows, maxLength: hasMax ? this.maxLength : undefined, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.value, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.error || this.hint ? msgId : undefined, ref: (el) => (this.el = el), onInput: (e) => {
914
+ this.value = e.target.value;
915
+ this.resize();
916
+ this.evokeInput.emit(this.value);
917
+ }, onChange: (e) => this.evokeChange.emit(e.target.value) }), h("div", { key: '95530cc625c4500a7042adda05c105f03054d4f9', class: "evoke-field__footer" }, this.error ? (h("span", { id: msgId, class: "evoke-field__error", role: "alert" }, this.error)) : (h("span", { id: msgId, class: "evoke-field__hint" }, this.hint)), hasMax && h("span", { key: '3f3fb731453b76cd7d2b0fa2f6ce334ca0bfd554', class: `evoke-field__counter ${len >= this.maxLength ? 'evoke-field__counter--full' : ''}`.trim(), "aria-live": "polite" }, len, " / ", this.maxLength))));
918
+ }
919
+ };
920
+ EvokeTextarea.style = evokeTextareaCss();
921
+
922
+ const evokeToastCss = () => `evoke-toast .evoke-toast{position:fixed;left:50%;z-index:1100;box-sizing:border-box;display:flex;align-items:center;gap:12px;width:max-content;max-width:min(92vw, 480px);padding:12px 12px 12px 16px;border-radius:var(--evoke-radius, 8px);background:var(--evoke-text, #1a1a1a);color:var(--evoke-surface, #ffffff);font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:0.9375rem;box-shadow:var(--evoke-shadow, 0 4px 12px rgba(0, 0, 0, 0.12));transform:translateX(-50%);animation:evoke-toast-in 0.2s ease-out}evoke-toast .evoke-toast--bottom{bottom:24px}evoke-toast .evoke-toast--top{top:24px}evoke-toast .evoke-toast--success .evoke-toast__icon{color:#4ade80}evoke-toast .evoke-toast--danger .evoke-toast__icon{color:#f87171}evoke-toast .evoke-toast--warning .evoke-toast__icon{color:#fbbf24}evoke-toast .evoke-toast--info .evoke-toast__icon{color:#67e8f9}evoke-toast .evoke-toast__icon{flex:none;width:20px;height:20px}evoke-toast .evoke-toast__message{flex:1;min-width:0}evoke-toast .evoke-toast__action{flex:none;padding:6px 12px;font:inherit;font-weight:600;background:transparent;color:#ffb199;border:0;border-radius:var(--evoke-radius-field, 8px);cursor:pointer}evoke-toast .evoke-toast__action:hover{background:rgba(255, 255, 255, 0.12)}evoke-toast .evoke-toast__action:active{background:rgba(255, 255, 255, 0.2)}evoke-toast .evoke-toast__close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer}evoke-toast .evoke-toast__close:hover{background:rgba(255, 255, 255, 0.12)}evoke-toast .evoke-toast__action:focus-visible,evoke-toast .evoke-toast__close:focus-visible{outline:2px solid var(--evoke-surface, #ffffff);outline-offset:1px}evoke-toast .evoke-toast__close .evoke-icon{width:16px;height:16px}@keyframes evoke-toast-in{from{opacity:0;transform:translate(-50%, 8px)}to{opacity:1;transform:translate(-50%, 0)}}@media (prefers-reduced-motion: reduce){evoke-toast .evoke-toast{animation:none}}`;
923
+
924
+ const TYPE_ICON = { info: 'info', success: 'check', warning: 'alert', danger: 'alert' };
925
+ const EvokeToast = class {
926
+ constructor(hostRef) {
927
+ registerInstance(this, hostRef);
928
+ this.evokeAction = createEvent(this, "evokeAction");
929
+ this.evokeClose = createEvent(this, "evokeClose");
930
+ this.open = false;
931
+ /** Message text (or use the default slot) */
932
+ this.message = '';
933
+ this.type = 'info';
934
+ /** Label of an action button, e.g. "View cart". Leave empty for a simple message. */
935
+ this.action = '';
936
+ /** Auto-dismiss after this many ms; 0 keeps it open until closed */
937
+ this.duration = 4000;
938
+ this.position = 'bottom';
939
+ }
940
+ onOpen(next) {
941
+ this.clearTimer();
942
+ if (next)
943
+ this.startTimer();
944
+ }
945
+ componentDidLoad() {
946
+ if (this.open)
947
+ this.startTimer();
948
+ }
949
+ disconnectedCallback() {
950
+ this.clearTimer();
951
+ }
952
+ startTimer() {
953
+ if (this.duration > 0)
954
+ this.timer = setTimeout(() => this.close(), this.duration);
955
+ }
956
+ clearTimer() {
957
+ if (this.timer)
958
+ clearTimeout(this.timer);
959
+ this.timer = undefined;
960
+ }
961
+ close() {
962
+ this.clearTimer();
963
+ this.open = false;
964
+ this.evokeClose.emit();
965
+ }
966
+ render() {
967
+ if (!this.open)
968
+ return null;
969
+ const urgent = this.type === 'danger' || this.type === 'warning';
970
+ return (h("div", { class: `evoke-toast evoke-toast--${this.position} evoke-toast--${this.type}`, role: urgent ? 'alert' : 'status', "aria-live": urgent ? 'assertive' : 'polite', onMouseEnter: () => this.clearTimer(), onMouseLeave: () => this.open && this.startTimer() }, renderIcon(TYPE_ICON[this.type], 'evoke-toast__icon'), h("span", { class: "evoke-toast__message" }, this.message, h("slot", null)), this.action && (h("button", { type: "button", class: "evoke-toast__action", onClick: () => {
971
+ this.evokeAction.emit();
972
+ this.close();
973
+ } }, this.action)), h("button", { type: "button", class: "evoke-toast__close", "aria-label": "Dismiss", onClick: () => this.close() }, renderIcon('x', 'evoke-icon'))));
974
+ }
975
+ static get watchers() { return {
976
+ "open": [{
977
+ "onOpen": 0
978
+ }]
979
+ }; }
980
+ };
981
+ EvokeToast.style = evokeToastCss();
982
+
983
+ const evokeTooltipCss = () => `evoke-tooltip{display:inline-block}evoke-tooltip .evoke-tooltip{position:relative;display:inline-flex}evoke-tooltip .evoke-tooltip__bubble{--_bg:var(--evoke-text, #1a1a1a);--_fg:var(--evoke-surface, #ffffff);position:absolute;z-index:30;box-sizing:border-box;width:max-content;max-width:240px;padding:6px 10px;border-radius:calc(var(--evoke-radius-field, 8px) - 2px);background:var(--_bg);color:var(--_fg);font-family:var(--evoke-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:0.875rem;line-height:1.4;pointer-events:none;opacity:0;visibility:hidden;transition:opacity 0.12s, visibility 0.12s}evoke-tooltip .evoke-tooltip__bubble--visible{opacity:1;visibility:visible}evoke-tooltip .evoke-tooltip__bubble--light{--_bg:var(--evoke-surface, #ffffff);--_fg:var(--evoke-text, #1a1a1a);border:1px solid var(--evoke-border, #dedede);box-shadow:var(--evoke-shadow, 0 4px 12px rgba(0, 0, 0, 0.12))}evoke-tooltip .evoke-tooltip__bubble--top{bottom:calc(100% + 8px);left:50%;transform:translateX(-50%)}evoke-tooltip .evoke-tooltip__bubble--bottom{top:calc(100% + 8px);left:50%;transform:translateX(-50%)}evoke-tooltip .evoke-tooltip__bubble--left{right:calc(100% + 8px);top:50%;transform:translateY(-50%)}evoke-tooltip .evoke-tooltip__bubble--right{left:calc(100% + 8px);top:50%;transform:translateY(-50%)}evoke-tooltip .evoke-tooltip__bubble--light::after{content:'';position:absolute;width:8px;height:8px;background:var(--_bg);border:1px solid var(--evoke-border, #dedede);transform:rotate(45deg)}evoke-tooltip .evoke-tooltip__bubble--light.evoke-tooltip__bubble--top::after{bottom:-5px;left:calc(50% - 4px);border-top:0;border-left:0}evoke-tooltip .evoke-tooltip__bubble--light.evoke-tooltip__bubble--bottom::after{top:-5px;left:calc(50% - 4px);border-bottom:0;border-right:0}evoke-tooltip .evoke-tooltip__bubble--light.evoke-tooltip__bubble--left::after{right:-5px;top:calc(50% - 4px);border-bottom:0;border-left:0}evoke-tooltip .evoke-tooltip__bubble--light.evoke-tooltip__bubble--right::after{left:-5px;top:calc(50% - 4px);border-top:0;border-right:0}@media (prefers-reduced-motion: reduce){evoke-tooltip .evoke-tooltip__bubble{transition:none}}`;
984
+
985
+ const EvokeTooltip = class {
986
+ constructor(hostRef) {
987
+ registerInstance(this, hostRef);
988
+ this.text = '';
989
+ this.placement = 'top';
990
+ /** Dark, or light with an arrow */
991
+ this.theme = 'dark';
992
+ this.visible = false;
993
+ this.id = `evoke-tip-${Math.random().toString(36).slice(2, 9)}`;
994
+ this.show = () => (this.visible = true);
995
+ this.hide = () => (this.visible = false);
996
+ }
997
+ componentDidLoad() {
998
+ this.link();
999
+ // Slotted components (e.g. <evoke-button>) render their inner <button> later, so keep linking
1000
+ this.observer = new MutationObserver(() => this.link());
1001
+ this.observer.observe(this.el, { childList: true, subtree: true });
1002
+ }
1003
+ disconnectedCallback() {
1004
+ var _a;
1005
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
1006
+ }
1007
+ /** Point every focusable element inside the trigger at the tooltip text (aria-describedby) */
1008
+ link() {
1009
+ const targets = this.el.querySelectorAll('button, a[href], input, select, textarea, [tabindex]');
1010
+ targets.forEach((t) => {
1011
+ var _a;
1012
+ if (t.closest('.evoke-tooltip__bubble'))
1013
+ return;
1014
+ const ids = ((_a = t.getAttribute('aria-describedby')) !== null && _a !== void 0 ? _a : '').split(' ').filter(Boolean);
1015
+ if (!ids.includes(this.id))
1016
+ t.setAttribute('aria-describedby', [...ids, this.id].join(' '));
1017
+ });
1018
+ }
1019
+ render() {
1020
+ return (h("span", { key: '4fad6f7ab25d2d68bb6db42a02f16b36439ec504', class: "evoke-tooltip", onMouseEnter: this.show, onMouseLeave: this.hide, onFocusin: this.show, onFocusout: this.hide, onKeyDown: (e) => e.key === 'Escape' && this.hide() }, h("slot", { key: 'b1169b0a9870c3420c581d095eb0c15073df55df' }), h("span", { key: '4ee1f48be749e54c93dc7fd555f8021079d68038', id: this.id, role: "tooltip", class: `evoke-tooltip__bubble evoke-tooltip__bubble--${this.placement} evoke-tooltip__bubble--${this.theme} ${this.visible ? 'evoke-tooltip__bubble--visible' : ''}`.trim() }, this.text)));
1021
+ }
1022
+ get el() { return getElement(this); }
1023
+ };
1024
+ EvokeTooltip.style = evokeTooltipCss();
1025
+
1026
+ export { EvokeAlert as evoke_alert, EvokeAppBar as evoke_app_bar, EvokeBadge as evoke_badge, EvokeButton as evoke_button, EvokeCard as evoke_card, EvokeCheckbox as evoke_checkbox, EvokeChip as evoke_chip, EvokeInput as evoke_input, EvokeModal as evoke_modal, EvokePagination as evoke_pagination, EvokeProgress as evoke_progress, EvokeQuantityStepper as evoke_quantity_stepper, EvokeRadioGroup as evoke_radio_group, EvokeSelect as evoke_select, EvokeSwitch as evoke_switch, EvokeTable as evoke_table, EvokeTabs as evoke_tabs, EvokeTextarea as evoke_textarea, EvokeToast as evoke_toast, EvokeTooltip as evoke_tooltip };