aeico-components 0.1.3 → 0.1.5

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 (218) hide show
  1. package/dist/alert.cjs +6 -0
  2. package/dist/alert.cjs.map +1 -0
  3. package/dist/alert.js +6 -0
  4. package/dist/alert.js.map +1 -0
  5. package/dist/badge.cjs +6 -0
  6. package/dist/badge.cjs.map +1 -0
  7. package/dist/badge.js +6 -0
  8. package/dist/badge.js.map +1 -0
  9. package/dist/breadcrumb.cjs +7 -0
  10. package/dist/breadcrumb.cjs.map +1 -0
  11. package/dist/breadcrumb.js +7 -0
  12. package/dist/breadcrumb.js.map +1 -0
  13. package/dist/button-group.cjs +6 -0
  14. package/dist/button-group.cjs.map +1 -0
  15. package/dist/button-group.js +6 -0
  16. package/dist/button-group.js.map +1 -0
  17. package/dist/button.cjs +6 -0
  18. package/dist/button.cjs.map +1 -0
  19. package/dist/button.js +6 -0
  20. package/dist/button.js.map +1 -0
  21. package/dist/card.cjs +6 -0
  22. package/dist/card.cjs.map +1 -0
  23. package/dist/card.js +6 -0
  24. package/dist/card.js.map +1 -0
  25. package/dist/checkbox.cjs +6 -0
  26. package/dist/checkbox.cjs.map +1 -0
  27. package/dist/checkbox.js +6 -0
  28. package/dist/checkbox.js.map +1 -0
  29. package/dist/chunks/aeico-component.cjs +17 -0
  30. package/dist/chunks/aeico-component.cjs.map +1 -0
  31. package/dist/chunks/aeico-component.js +18 -0
  32. package/dist/chunks/aeico-component.js.map +1 -0
  33. package/dist/chunks/aeico-field.cjs +179 -0
  34. package/dist/chunks/aeico-field.cjs.map +1 -0
  35. package/dist/chunks/aeico-field.js +180 -0
  36. package/dist/chunks/aeico-field.js.map +1 -0
  37. package/dist/chunks/alert.cjs +170 -0
  38. package/dist/chunks/alert.cjs.map +1 -0
  39. package/dist/chunks/alert.js +171 -0
  40. package/dist/chunks/alert.js.map +1 -0
  41. package/dist/chunks/badge.cjs +85 -0
  42. package/dist/chunks/badge.cjs.map +1 -0
  43. package/dist/chunks/badge.js +86 -0
  44. package/dist/chunks/badge.js.map +1 -0
  45. package/dist/chunks/breadcrumb-item.cjs +261 -0
  46. package/dist/chunks/breadcrumb-item.cjs.map +1 -0
  47. package/dist/chunks/breadcrumb-item.js +262 -0
  48. package/dist/chunks/breadcrumb-item.js.map +1 -0
  49. package/dist/chunks/button-group.cjs +79 -0
  50. package/dist/chunks/button-group.cjs.map +1 -0
  51. package/dist/chunks/button-group.js +80 -0
  52. package/dist/chunks/button-group.js.map +1 -0
  53. package/dist/chunks/button.cjs +348 -0
  54. package/dist/chunks/button.cjs.map +1 -0
  55. package/dist/chunks/button.js +349 -0
  56. package/dist/chunks/button.js.map +1 -0
  57. package/dist/chunks/card.cjs +93 -0
  58. package/dist/chunks/card.cjs.map +1 -0
  59. package/dist/chunks/card.js +94 -0
  60. package/dist/chunks/card.js.map +1 -0
  61. package/dist/chunks/checkbox.cjs +73 -0
  62. package/dist/chunks/checkbox.cjs.map +1 -0
  63. package/dist/chunks/checkbox.js +74 -0
  64. package/dist/chunks/checkbox.js.map +1 -0
  65. package/dist/chunks/color.cjs +4 -0
  66. package/dist/chunks/color.cjs.map +1 -0
  67. package/dist/chunks/color.js +5 -0
  68. package/dist/chunks/color.js.map +1 -0
  69. package/dist/chunks/detail.cjs +143 -0
  70. package/dist/chunks/detail.cjs.map +1 -0
  71. package/dist/chunks/detail.js +144 -0
  72. package/dist/chunks/detail.js.map +1 -0
  73. package/dist/chunks/dialog.cjs +117 -0
  74. package/dist/chunks/dialog.cjs.map +1 -0
  75. package/dist/chunks/dialog.js +118 -0
  76. package/dist/chunks/dialog.js.map +1 -0
  77. package/dist/chunks/divider.cjs +80 -0
  78. package/dist/chunks/divider.cjs.map +1 -0
  79. package/dist/chunks/divider.js +81 -0
  80. package/dist/chunks/divider.js.map +1 -0
  81. package/dist/chunks/dropdown-button.cjs +534 -0
  82. package/dist/chunks/dropdown-button.cjs.map +1 -0
  83. package/dist/chunks/dropdown-button.js +535 -0
  84. package/dist/chunks/dropdown-button.js.map +1 -0
  85. package/dist/chunks/icon-button.cjs +35 -0
  86. package/dist/chunks/icon-button.cjs.map +1 -0
  87. package/dist/chunks/icon-button.js +36 -0
  88. package/dist/chunks/icon-button.js.map +1 -0
  89. package/dist/chunks/icon.cjs +78 -0
  90. package/dist/chunks/icon.cjs.map +1 -0
  91. package/dist/chunks/icon.js +79 -0
  92. package/dist/chunks/icon.js.map +1 -0
  93. package/dist/chunks/navbar.cjs +142 -0
  94. package/dist/chunks/navbar.cjs.map +1 -0
  95. package/dist/chunks/navbar.js +143 -0
  96. package/dist/chunks/navbar.js.map +1 -0
  97. package/dist/chunks/radio.cjs +181 -0
  98. package/dist/chunks/radio.cjs.map +1 -0
  99. package/dist/chunks/radio.js +182 -0
  100. package/dist/chunks/radio.js.map +1 -0
  101. package/dist/chunks/select.cjs +350 -0
  102. package/dist/chunks/select.cjs.map +1 -0
  103. package/dist/chunks/select.js +351 -0
  104. package/dist/chunks/select.js.map +1 -0
  105. package/dist/chunks/size.cjs +4 -0
  106. package/dist/chunks/size.cjs.map +1 -0
  107. package/dist/chunks/size.js +5 -0
  108. package/dist/chunks/size.js.map +1 -0
  109. package/dist/chunks/slider.cjs +648 -0
  110. package/dist/chunks/slider.cjs.map +1 -0
  111. package/dist/chunks/slider.js +649 -0
  112. package/dist/chunks/slider.js.map +1 -0
  113. package/dist/chunks/switch.cjs +73 -0
  114. package/dist/chunks/switch.cjs.map +1 -0
  115. package/dist/chunks/switch.js +74 -0
  116. package/dist/chunks/switch.js.map +1 -0
  117. package/dist/chunks/tab-panel.cjs +165 -0
  118. package/dist/chunks/tab-panel.cjs.map +1 -0
  119. package/dist/chunks/tab-panel.js +166 -0
  120. package/dist/chunks/tab-panel.js.map +1 -0
  121. package/dist/chunks/tag.cjs +108 -0
  122. package/dist/chunks/tag.cjs.map +1 -0
  123. package/dist/chunks/tag.js +109 -0
  124. package/dist/chunks/tag.js.map +1 -0
  125. package/dist/chunks/text-input.cjs +59 -0
  126. package/dist/chunks/text-input.cjs.map +1 -0
  127. package/dist/chunks/text-input.js +60 -0
  128. package/dist/chunks/text-input.js.map +1 -0
  129. package/dist/chunks/variables.cjs +372 -0
  130. package/dist/chunks/variables.cjs.map +1 -0
  131. package/dist/chunks/variables.js +373 -0
  132. package/dist/chunks/variables.js.map +1 -0
  133. package/dist/detail.cjs +6 -0
  134. package/dist/detail.cjs.map +1 -0
  135. package/dist/detail.js +6 -0
  136. package/dist/detail.js.map +1 -0
  137. package/dist/dialog.cjs +6 -0
  138. package/dist/dialog.cjs.map +1 -0
  139. package/dist/dialog.js +6 -0
  140. package/dist/dialog.js.map +1 -0
  141. package/dist/divider.cjs +6 -0
  142. package/dist/divider.cjs.map +1 -0
  143. package/dist/divider.js +6 -0
  144. package/dist/divider.js.map +1 -0
  145. package/dist/dropdown.cjs +7 -0
  146. package/dist/dropdown.cjs.map +1 -0
  147. package/dist/dropdown.js +7 -0
  148. package/dist/dropdown.js.map +1 -0
  149. package/dist/icon-button.cjs +6 -0
  150. package/dist/icon-button.cjs.map +1 -0
  151. package/dist/icon-button.js +6 -0
  152. package/dist/icon-button.js.map +1 -0
  153. package/dist/icon.cjs +6 -0
  154. package/dist/icon.cjs.map +1 -0
  155. package/dist/icon.js +6 -0
  156. package/dist/icon.js.map +1 -0
  157. package/dist/index.cjs +93 -4168
  158. package/dist/index.cjs.map +1 -1
  159. package/dist/index.js +92 -4167
  160. package/dist/index.js.map +1 -1
  161. package/dist/navbar.cjs +6 -0
  162. package/dist/navbar.cjs.map +1 -0
  163. package/dist/navbar.js +6 -0
  164. package/dist/navbar.js.map +1 -0
  165. package/dist/radio-group.cjs +7 -0
  166. package/dist/radio-group.cjs.map +1 -0
  167. package/dist/radio-group.js +7 -0
  168. package/dist/radio-group.js.map +1 -0
  169. package/dist/select.cjs +99 -0
  170. package/dist/select.cjs.map +1 -0
  171. package/dist/select.js +99 -0
  172. package/dist/select.js.map +1 -0
  173. package/dist/slider.cjs +6 -0
  174. package/dist/slider.cjs.map +1 -0
  175. package/dist/slider.js +6 -0
  176. package/dist/slider.js.map +1 -0
  177. package/dist/switch.cjs +6 -0
  178. package/dist/switch.cjs.map +1 -0
  179. package/dist/switch.js +6 -0
  180. package/dist/switch.js.map +1 -0
  181. package/dist/tabs.cjs +8 -0
  182. package/dist/tabs.cjs.map +1 -0
  183. package/dist/tabs.js +8 -0
  184. package/dist/tabs.js.map +1 -0
  185. package/dist/tag.cjs +5 -0
  186. package/dist/tag.cjs.map +1 -0
  187. package/dist/tag.js +5 -0
  188. package/dist/tag.js.map +1 -0
  189. package/dist/text-input.cjs +6 -0
  190. package/dist/text-input.cjs.map +1 -0
  191. package/dist/text-input.js +6 -0
  192. package/dist/text-input.js.map +1 -0
  193. package/dist/types/aeico-field.d.ts +5 -5
  194. package/dist/types/button/button.d.ts +2 -1
  195. package/dist/types/checkbox/checkbox.d.ts +5 -5
  196. package/dist/types/index.d.ts +2 -0
  197. package/dist/types/progress-bar/defines.d.ts +1 -0
  198. package/dist/types/progress-bar/index.d.ts +3 -0
  199. package/dist/types/progress-bar/progress-bar.d.ts +37 -0
  200. package/dist/types/radio-group/radio-group.d.ts +1 -1
  201. package/dist/types/select/select.d.ts +1 -1
  202. package/dist/types/switch/switch.d.ts +5 -5
  203. package/package.json +16 -4
  204. package/src/aeico-field.ts +12 -8
  205. package/src/button/button.ts +11 -13
  206. package/src/checkbox/checkbox.ts +4 -4
  207. package/src/index.ts +2 -0
  208. package/src/navbar/navbar.ts +1 -3
  209. package/src/progress-bar/defines.ts +8 -0
  210. package/src/progress-bar/index.ts +3 -0
  211. package/src/progress-bar/progress-bar.ts +80 -0
  212. package/src/radio-group/radio-group.ts +1 -1
  213. package/src/select/select.ts +1 -1
  214. package/src/styles/components/progress-bar.css +44 -0
  215. package/src/switch/switch.ts +4 -4
  216. package/src/tabs/tab.ts +1 -1
  217. package/src/tabs/tabs.ts +1 -2
  218. package/src/utils.ts +1 -0
package/dist/index.cjs CHANGED
@@ -1,4078 +1,44 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
6
- const aeico = require("aeico");
7
- const aeicoLocalize = require("aeico-localize");
8
- const SVG_NS = "http://www.w3.org/2000/svg";
9
- function toKebab(str) {
10
- const cleaned = str.replace(/^[_\d]+/, "");
11
- return cleaned.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
12
- }
13
- const TAG_NAME_PREFIX = "ae";
14
- class AeicoComponent extends aeico.AeicoElement {
15
- static register(name) {
16
- const tagName = name || `${TAG_NAME_PREFIX}-${this.tagName || toKebab(this.name)}`;
17
- super.register(tagName);
18
- }
19
- }
20
- class AeicoField extends AeicoComponent {
21
- constructor() {
22
- super(...arguments);
23
- /**
24
- * The underlying form control element (input, select, etc.)
25
- * Subclasses should set this to their specific element
26
- */
27
- __publicField(this, "fieldElement", null);
28
- __publicField(this, "resetBtn", null);
29
- __publicField(this, "clearBtn", null);
30
- __publicField(this, "boundOnChange", () => this.setValue(this.getValue(), { silent: false, action: "change" }));
31
- __publicField(this, "boundOnReset", () => this.onReset());
32
- __publicField(this, "boundOnClear", () => this.onClear());
33
- }
34
- /**
35
- * Lifecycle: Component connected to DOM
36
- */
37
- connectedCallback() {
38
- super.connectedCallback();
39
- }
40
- /**
41
- * Lifecycle: Component disconnected from DOM
42
- */
43
- disconnectedCallback() {
44
- super.disconnectedCallback();
45
- }
46
- /**
47
- * Render action buttons (clear/reset) using this.builder.
48
- * Must be called from within a build() callback.
49
- */
50
- renderActionButtons(force = false) {
51
- this.renderClearButton(force);
52
- this.renderResetButton(force);
53
- }
54
- renderResetButton(force = false) {
55
- const { button } = aeico.tags;
56
- if (force || this.resettable) {
57
- this.resetBtn = button({
58
- className: "reset-btn",
59
- textContent: this.resetText || "↺",
60
- title: aeicoLocalize.t("buttons.reset", "↺"),
61
- "@click": this.boundOnReset
62
- });
63
- }
64
- }
65
- renderClearButton(force = false) {
66
- const { button } = aeico.tags;
67
- if (force || this.clearable) {
68
- this.clearBtn = button({
69
- className: "clear-btn",
70
- textContent: this.clearText || "✕",
71
- title: aeicoLocalize.t("buttons.clear", "✕"),
72
- "@click": this.boundOnClear
73
- });
74
- }
75
- }
76
- /**
77
- * Watcher for disabled property
78
- */
79
- onDisabledChanged(newValue) {
80
- if (this.fieldElement) {
81
- this.fieldElement.disabled = Boolean(newValue);
82
- }
83
- }
84
- /**
85
- * Render the field component
86
- * Override in subclass to provide custom rendering
87
- */
88
- render() {
89
- }
90
- /**
91
- * Get current value from the field element
92
- * Default implementation returns the value property of fieldElement
93
- * Override in subclasses if needed (e.g., checkbox uses checked instead of value)
94
- *
95
- * @returns Current field value
96
- */
97
- getValue() {
98
- var _a2;
99
- return ((_a2 = this.fieldElement) == null ? void 0 : _a2.value) || "";
100
- }
101
- /**
102
- * Write value to the underlying UI element and sync props
103
- * Subclasses must override this to update their specific UI element
104
- *
105
- * @param _value New value to write to the element
106
- */
107
- writeValue(_value2) {
108
- }
109
- /**
110
- * Get event payload for change events
111
- * Override in subclasses to customize event data (e.g., { checked, oldChecked } for checkbox)
112
- *
113
- * @param value New value
114
- * @param oldValue Previous value
115
- * @param action Action type
116
- * @returns Event payload object
117
- */
118
- getEventPayload(value, oldValue, action) {
119
- return { value, oldValue, action };
120
- }
121
- /**
122
- * Update field value programmatically (internal method)
123
- * Subclasses should provide type-safe public wrappers (e.g., change() method)
124
- *
125
- * @param value New value
126
- * @param options.silent If true, won't emit change event (default: true)
127
- * @param options.action Action type for the event (default: 'change')
128
- */
129
- setValue(value, options) {
130
- const oldValue = this.getValue();
131
- this.value = value;
132
- this.writeValue(value);
133
- if ((options == null ? void 0 : options.silent) === false) {
134
- const payload = this.getEventPayload(value, oldValue, options.action || "change");
135
- this.emit("change", { detail: payload });
136
- }
137
- }
138
- /**
139
- * Reset field to specified value or default value
140
- *
141
- * @param value Value to reset to, defaults to defaultValue prop
142
- * @param options.silent If false, will emit reset event (default: true)
143
- */
144
- reset(value, options) {
145
- const resetValue = value !== void 0 ? value : this.defaultValue;
146
- this.setValue(resetValue, { ...options, action: "reset" });
147
- }
148
- /**
149
- * Clear the field value
150
- *
151
- * @param options.silent If false, will emit clear event (default: true)
152
- */
153
- clear(options) {
154
- this.setValue("", { ...options, action: "clear" });
155
- }
156
- /**
157
- * Handle clear button click
158
- * Clears the field and dispatches event
159
- */
160
- onClear() {
161
- this.clear({ silent: false });
162
- }
163
- /**
164
- * Handle reset button click
165
- * Resets to default value and dispatches event
166
- */
167
- onReset() {
168
- this.reset(void 0, { silent: false });
169
- }
170
- }
171
- /**
172
- * Define base field properties (extends AeicoElement properties)
173
- */
174
- __publicField(AeicoField, "props", {
175
- value: { type: String },
176
- defaultValue: { type: String },
177
- resettable: { type: Boolean },
178
- resetText: { type: String },
179
- clearable: { type: Boolean },
180
- clearText: { type: String },
181
- size: { type: String },
182
- disabled: { type: Boolean }
183
- });
184
- /**
185
- * Property watchers
186
- */
187
- __publicField(AeicoField, "watchers", {
188
- disabled: "onDisabledChanged"
189
- });
190
- const styleVariables = `:root,
191
- :host {
192
- --ae-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
193
- "Noto Sans", "Liberation Sans", Arial, sans-serif,
194
- "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
195
- --ae-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas,
196
- "Liberation Mono", "Courier New", monospace;
197
- font-family: var(--ae-font-sans-serif);
198
- --blue: #0e639c;
199
- --green: #28a745;
200
- --red: #dc3545;
201
- --yellow: #ffc107;
202
- --cyan: #17a2b8;
203
- --gray: #6e6e6e;
204
- --slate: #64748b;
205
- --dark: #343a40;
206
- --light: #f8f9fa;
207
- }
208
-
209
- :root,
210
- :host {
211
- /* Blue */
212
- --blue-100: color-mix(in srgb, var(--blue) 20%, white);
213
- --blue-200: color-mix(in srgb, var(--blue) 40%, white);
214
- --blue-300: color-mix(in srgb, var(--blue) 60%, white);
215
- --blue-400: color-mix(in srgb, var(--blue) 80%, white);
216
- --blue-500: var(--blue);
217
- --blue-600: color-mix(in srgb, var(--blue) 80%, black);
218
- --blue-700: color-mix(in srgb, var(--blue) 60%, black);
219
- --blue-800: color-mix(in srgb, var(--blue) 40%, black);
220
- --blue-900: color-mix(in srgb, var(--blue) 20%, black);
221
-
222
- /* Green */
223
- --green-100: color-mix(in srgb, var(--green) 20%, white);
224
- --green-200: color-mix(in srgb, var(--green) 40%, white);
225
- --green-300: color-mix(in srgb, var(--green) 60%, white);
226
- --green-400: color-mix(in srgb, var(--green) 80%, white);
227
- --green-500: var(--green);
228
- --green-600: color-mix(in srgb, var(--green) 80%, black);
229
- --green-700: color-mix(in srgb, var(--green) 60%, black);
230
- --green-800: color-mix(in srgb, var(--green) 40%, black);
231
- --green-900: color-mix(in srgb, var(--green) 20%, black);
232
-
233
- /* Red */
234
- --red-100: color-mix(in srgb, var(--red) 20%, white);
235
- --red-200: color-mix(in srgb, var(--red) 40%, white);
236
- --red-300: color-mix(in srgb, var(--red) 60%, white);
237
- --red-400: color-mix(in srgb, var(--red) 80%, white);
238
- --red-500: var(--red);
239
- --red-600: color-mix(in srgb, var(--red) 80%, black);
240
- --red-700: color-mix(in srgb, var(--red) 60%, black);
241
- --red-800: color-mix(in srgb, var(--red) 40%, black);
242
- --red-900: color-mix(in srgb, var(--red) 20%, black);
243
-
244
- /* Yellow */
245
- --yellow-100: color-mix(in srgb, var(--yellow) 20%, white);
246
- --yellow-200: color-mix(in srgb, var(--yellow) 40%, white);
247
- --yellow-300: color-mix(in srgb, var(--yellow) 60%, white);
248
- --yellow-400: color-mix(in srgb, var(--yellow) 80%, white);
249
- --yellow-500: var(--yellow);
250
- --yellow-600: color-mix(in srgb, var(--yellow) 80%, black);
251
- --yellow-700: color-mix(in srgb, var(--yellow) 60%, black);
252
- --yellow-800: color-mix(in srgb, var(--yellow) 40%, black);
253
- --yellow-900: color-mix(in srgb, var(--yellow) 20%, black);
254
-
255
- /* Cyan */
256
- --cyan-100: color-mix(in srgb, var(--cyan) 20%, white);
257
- --cyan-200: color-mix(in srgb, var(--cyan) 40%, white);
258
- --cyan-300: color-mix(in srgb, var(--cyan) 60%, white);
259
- --cyan-400: color-mix(in srgb, var(--cyan) 80%, white);
260
- --cyan-500: var(--cyan);
261
- --cyan-600: color-mix(in srgb, var(--cyan) 80%, black);
262
- --cyan-700: color-mix(in srgb, var(--cyan) 60%, black);
263
- --cyan-800: color-mix(in srgb, var(--cyan) 40%, black);
264
- --cyan-900: color-mix(in srgb, var(--cyan) 20%, black);
265
-
266
- /* Gray (neutral — base #6e6e6e) */
267
- --gray-100: color-mix(in srgb, var(--gray) 20%, white);
268
- --gray-200: color-mix(in srgb, var(--gray) 40%, white);
269
- --gray-300: color-mix(in srgb, var(--gray) 60%, white);
270
- --gray-400: color-mix(in srgb, var(--gray) 80%, white);
271
- --gray-500: var(--gray);
272
- --gray-600: color-mix(in srgb, var(--gray) 80%, black);
273
- --gray-700: color-mix(in srgb, var(--gray) 60%, black);
274
- --gray-800: color-mix(in srgb, var(--gray) 40%, black);
275
- --gray-900: color-mix(in srgb, var(--gray) 20%, black);
276
-
277
- /* Slate (blue-gray — base #64748b, used for 'secondary') */
278
- --slate-100: color-mix(in srgb, var(--slate) 20%, white);
279
- --slate-200: color-mix(in srgb, var(--slate) 40%, white);
280
- --slate-300: color-mix(in srgb, var(--slate) 60%, white);
281
- --slate-400: color-mix(in srgb, var(--slate) 80%, white);
282
- --slate-500: var(--slate);
283
- --slate-600: color-mix(in srgb, var(--slate) 80%, black);
284
- --slate-700: color-mix(in srgb, var(--slate) 60%, black);
285
- --slate-800: color-mix(in srgb, var(--slate) 40%, black);
286
- --slate-900: color-mix(in srgb, var(--slate) 20%, black);
287
-
288
- /* Dark (base #343a40) */
289
- --dark-100: color-mix(in srgb, var(--dark) 20%, white);
290
- --dark-200: color-mix(in srgb, var(--dark) 40%, white);
291
- --dark-300: color-mix(in srgb, var(--dark) 60%, white);
292
- --dark-400: color-mix(in srgb, var(--dark) 80%, white);
293
- --dark-500: var(--dark);
294
- --dark-600: color-mix(in srgb, var(--dark) 80%, black);
295
- --dark-700: color-mix(in srgb, var(--dark) 60%, black);
296
- --dark-800: color-mix(in srgb, var(--dark) 40%, black);
297
- --dark-900: color-mix(in srgb, var(--dark) 20%, black);
298
-
299
- /* Light (base #f8f9fa) */
300
- --light-100: color-mix(in srgb, var(--light) 20%, white);
301
- --light-200: color-mix(in srgb, var(--light) 40%, white);
302
- --light-300: color-mix(in srgb, var(--light) 60%, white);
303
- --light-400: color-mix(in srgb, var(--light) 80%, white);
304
- --light-500: var(--light);
305
- --light-600: color-mix(in srgb, var(--light) 80%, black);
306
- --light-700: color-mix(in srgb, var(--light) 60%, black);
307
- --light-800: color-mix(in srgb, var(--light) 40%, black);
308
- --light-900: color-mix(in srgb, var(--light) 20%, black);
309
- }
310
-
311
- :root,
312
- :host {
313
- /* Hover / active mix (light default — overridden in § 6 dark) */
314
- --color-mix-hover: black 10%;
315
- --color-mix-active: black 20%;
316
-
317
- /* Primary (Blue) */
318
- --color-primary: var(--blue-500);
319
- --color-primary-hover: color-mix(in srgb, var(--color-primary), var(--color-mix-hover));
320
- --color-primary-active: color-mix(in srgb, var(--color-primary), var(--color-mix-active));
321
- --color-primary-disabled: color-mix(in srgb, var(--blue) 50%, var(--gray-500));
322
-
323
- /* Success (Green) */
324
- --color-success: var(--green-500);
325
- --color-success-hover: color-mix(in srgb, var(--color-success), var(--color-mix-hover));
326
- --color-success-active: color-mix(in srgb, var(--color-success), var(--color-mix-active));
327
- --color-success-disabled: color-mix(in srgb, var(--green) 50%, var(--gray-500));
328
-
329
- /* Danger (Red) */
330
- --color-danger: var(--red-500);
331
- --color-danger-hover: color-mix(in srgb, var(--color-danger), var(--color-mix-hover));
332
- --color-danger-active: color-mix(in srgb, var(--color-danger), var(--color-mix-active));
333
- --color-danger-disabled: color-mix(in srgb, var(--red) 50%, var(--gray-500));
334
-
335
- /* Warning (Yellow) */
336
- --color-warning: var(--yellow-500);
337
- --color-warning-hover: color-mix(in srgb, var(--color-warning), var(--color-mix-hover));
338
- --color-warning-active: color-mix(in srgb, var(--color-warning), var(--color-mix-active));
339
- --color-warning-disabled: color-mix(in srgb, var(--yellow) 50%, var(--gray-500));
340
-
341
- /* Info (Cyan) */
342
- --color-info: var(--cyan-500);
343
- --color-info-hover: color-mix(in srgb, var(--color-info), var(--color-mix-hover));
344
- --color-info-active: color-mix(in srgb, var(--color-info), var(--color-mix-active));
345
- --color-info-disabled: color-mix(in srgb, var(--cyan) 50%, var(--gray-500));
346
-
347
- /* Secondary (Slate) — base differs per theme, overridden in § 6 dark */
348
- --color-secondary: var(--slate-500);
349
- --color-secondary-hover: color-mix(in srgb, var(--color-secondary), var(--color-mix-hover));
350
- --color-secondary-active: color-mix(in srgb, var(--color-secondary), var(--color-mix-active));
351
- --color-secondary-text: var(--slate-700);
352
-
353
- /* On-solid — text color on filled (saturated) backgrounds.
354
- Fixed white: blue/green/red/cyan buttons always have white text.
355
- Does NOT follow --color-text-main. */
356
- --color-on-solid: white;
357
- }
358
-
359
-
360
- .theme-light,
361
- :root[theme="light"],
362
- :host([theme="light"]),
363
- :host-context([theme="light"]),
364
- :where(:root),
365
- :host {
366
- color-scheme: light;
367
-
368
- /* Gray UI aliases — lighter palette steps for elements on white background */
369
- --color-gray-dark: var(--gray-400);
370
- --color-gray: var(--gray-300);
371
- --color-gray-light: var(--gray-200);
372
- --color-gray-lighter: var(--gray-100);
373
- --color-gray-lightest: color-mix(in srgb, var(--gray) 10%, white);
374
-
375
- /* Text */
376
- --color-text-main: var(--dark-700);
377
- --color-text-muted: var(--gray-600);
378
- --color-text-disabled: var(--gray-300);
379
- --color-text-link: var(--blue-500);
380
- --color-text-link-hover: var(--blue-700);
381
-
382
- /* Surfaces */
383
- --surface-sunken: var(--light-500);
384
- --surface-base: white;
385
- --surface-raised: var(--light-500);
386
- --surface-overlay: white;
387
- --color-overlay: rgba(0, 0, 0, 0.4);
388
-
389
- /* Borders */
390
- --border-subtle: rgba(0, 0, 0, 0.08);
391
- --border-default: rgba(0, 0, 0, 0.15);
392
- --border-hover: rgba(0, 0, 0, 0.25);
393
- --border-focus: var(--color-primary);
394
- --border-disabled: rgba(0, 0, 0, 0.06);
395
-
396
- /* Focus ring */
397
- --focus-ring: rgb(from var(--blue) r g b / 0.30);
398
- --focus-ring-sm: rgb(from var(--blue) r g b / 0.15);
399
-
400
- /* Subtle intent tokens — light context */
401
- --color-primary-bg-subtle: rgb(from var(--blue) r g b / 0.08);
402
- --color-primary-border-subtle: rgb(from var(--blue) r g b / 0.40);
403
- --color-primary-text-emphasis: var(--blue-700);
404
-
405
- --color-success-bg-subtle: rgb(from var(--green) r g b / 0.08);
406
- --color-success-border-subtle: rgb(from var(--green) r g b / 0.40);
407
- --color-success-text-emphasis: var(--green-700);
408
-
409
- --color-danger-bg-subtle: rgb(from var(--red) r g b / 0.08);
410
- --color-danger-border-subtle: rgb(from var(--red) r g b / 0.40);
411
- --color-danger-text-emphasis: var(--red-700);
412
-
413
- --color-warning-bg-subtle: rgb(from var(--yellow) r g b / 0.08);
414
- --color-warning-border-subtle: rgb(from var(--yellow) r g b / 0.40);
415
- --color-warning-text-emphasis: var(--yellow-700);
416
-
417
- --color-info-bg-subtle: rgb(from var(--cyan) r g b / 0.08);
418
- --color-info-border-subtle: rgb(from var(--cyan) r g b / 0.40);
419
- --color-info-text-emphasis: var(--cyan-700);
420
-
421
- --color-secondary-bg-subtle: rgb(from var(--slate) r g b / 0.08);
422
- --color-secondary-border-subtle: rgb(from var(--slate) r g b / 0.40);
423
- --color-secondary-text-emphasis: var(--slate-700);
424
-
425
- --color-light-bg-subtle: var(--gray-100); /* opaque on white: ~#e2e2e2 */
426
- --color-light-border-subtle: var(--gray-200); /* opaque on white: ~#c4c4c4 */
427
-
428
- --color-dark-bg-subtle: var(--dark-100); /* opaque on white: ~#d6d8d9 */
429
- --color-dark-border-subtle: var(--dark-300); /* opaque on white: ~#85898c */
430
-
431
- /* Component tokens — light defaults */
432
- --action-btn-bg: var(--gray-200);
433
- --action-btn-bg-hover: var(--color-primary);
434
- --action-btn-color: var(--gray-600);
435
- --action-btn-color-hover: white;
436
-
437
- --clear-btn-bg-hover: var(--color-danger);
438
- --clear-btn-color-hover: white;
439
-
440
- --reset-btn-border-radius: 2px;
441
- --reset-btn-bg: var(--action-btn-bg);
442
- --reset-btn-bg-hover: var(--action-btn-bg-hover);
443
- --reset-btn-color: var(--action-btn-color);
444
- --reset-btn-color-hover: var(--action-btn-color-hover);
445
- --reset-btn-transition: all 0.12s;
446
-
447
- --clear-btn-border-radius: 2px;
448
- --clear-btn-bg: var(--action-btn-bg);
449
- --clear-btn-color: var(--action-btn-color);
450
- --clear-btn-transition: all 0.12s;
451
- }
452
-
453
- :root,
454
- :host {
455
- --size-scale: 1;
456
- --size-base: calc(1rem * var(--size-scale)); /* 16px */
457
- --size-xl: round(calc(var(--size-l) * 1.125), 1px); /* 23px */
458
- --size-l: round(calc(var(--size-m) * 1.125 * 1.125), 1px); /* 20px */
459
- --size-m: var(--size-base); /* 16px */
460
- --size-s: round(calc(var(--size-m) / 1.125), 1px); /* 14px */
461
- --size-xs: round(calc(var(--size-s) / 1.125), 1px); /* 12px */
462
- --size-2xs: round(calc(var(--size-xs) / 1.125), 1px); /* 11px */
463
- --size-3xs: round(calc(var(--size-2xs) / 1.125), 1px); /* 10px */
464
- }
465
-
466
- /* Layout tokens — defined on :root so all light DOM elements can use them */
467
- :root,
468
- :host {
469
- --container-max-width: 1280px;
470
- --container-padding-x: 1.5rem;
471
- }
472
-
473
- .theme-dark,
474
- :root[theme="dark"],
475
- :host([theme="dark"]),
476
- :host-context([theme="dark"]) {
477
- color-scheme: dark;
478
-
479
- /* Hover / active — slightly gentler on dark backgrounds */
480
- --color-mix-hover: black 8%;
481
- --color-mix-active: black 16%;
482
-
483
- /* Gray UI aliases — darker palette steps for elements on dark background */
484
- --color-gray-dark: var(--gray-800);
485
- --color-gray: var(--gray-700);
486
- --color-gray-light: var(--gray-600);
487
- --color-gray-lighter: var(--gray-500);
488
- --color-gray-lightest: var(--gray-400);
489
-
490
- /* Secondary — deeper base on dark background */
491
- --color-secondary: var(--slate-700);
492
- --color-secondary-text: var(--slate-300);
493
-
494
- /* Text */
495
- --color-text-main: white;
496
- --color-text-muted: var(--gray-200);
497
- --color-text-disabled: var(--gray-500);
498
- --color-text-link: var(--blue-300);
499
- --color-text-link-hover: var(--blue-200);
500
-
501
- /* Surfaces */
502
- --surface-sunken: var(--gray-900);
503
- --surface-base: color-mix(in srgb, var(--gray) 27%, black);
504
- --surface-raised: color-mix(in srgb, var(--gray) 34%, black);
505
- --surface-overlay: color-mix(in srgb, var(--gray) 38%, black);
506
- --color-overlay: rgba(0, 0, 0, 0.6);
507
-
508
- /* Borders */
509
- --border-subtle: rgba(255, 255, 255, 0.08);
510
- --border-default: rgba(255, 255, 255, 0.12);
511
- --border-hover: rgba(255, 255, 255, 0.20);
512
- --border-focus: var(--color-primary);
513
- --border-disabled: rgba(255, 255, 255, 0.06);
514
-
515
- /* Focus ring */
516
- --focus-ring: rgb(from var(--blue) r g b / 0.25);
517
- --focus-ring-sm: rgb(from var(--blue) r g b / 0.10);
518
-
519
- /* Subtle intent tokens — dark context (more alpha, lighter text-emphasis) */
520
- --color-primary-bg-subtle: rgb(from var(--blue) r g b / 0.10);
521
- --color-primary-border-subtle: rgb(from var(--blue) r g b / 0.30);
522
- --color-primary-text-emphasis: var(--blue-300);
523
-
524
- --color-success-bg-subtle: rgb(from var(--green) r g b / 0.10);
525
- --color-success-border-subtle: rgb(from var(--green) r g b / 0.30);
526
- --color-success-text-emphasis: var(--green-300);
527
-
528
- --color-danger-bg-subtle: rgb(from var(--red) r g b / 0.10);
529
- --color-danger-border-subtle: rgb(from var(--red) r g b / 0.30);
530
- --color-danger-text-emphasis: var(--red-300);
531
-
532
- --color-warning-bg-subtle: rgb(from var(--yellow) r g b / 0.10);
533
- --color-warning-border-subtle: rgb(from var(--yellow) r g b / 0.30);
534
- --color-warning-text-emphasis: var(--yellow-300);
535
-
536
- --color-info-bg-subtle: rgb(from var(--cyan) r g b / 0.10);
537
- --color-info-border-subtle: rgb(from var(--cyan) r g b / 0.30);
538
- --color-info-text-emphasis: var(--cyan-300);
539
-
540
- --color-secondary-bg-subtle: rgb(from var(--slate) r g b / 0.10);
541
- --color-secondary-border-subtle: rgb(from var(--slate) r g b / 0.30);
542
- --color-secondary-text-emphasis: var(--slate-300);
543
-
544
- --color-light-bg-subtle: rgb(from var(--light) r g b / 0.20);
545
- --color-light-border-subtle: rgb(from var(--light) r g b / 0.25);
546
-
547
- --color-dark-bg-subtle: rgb(from var(--dark) r g b / 0.30);
548
- --color-dark-border-subtle: rgb(from var(--dark) r g b / 0.50);
549
-
550
- /* Component tokens — dark overrides */
551
- --action-btn-bg: var(--color-gray);
552
- --action-btn-bg-hover: color-mix(in srgb, var(--blue) 25%, var(--gray-800));
553
- --action-btn-color: var(--gray-400);
554
- --action-btn-color-hover: var(--cyan-300);
555
- --clear-btn-bg-hover: color-mix(in srgb, var(--red) 25%, var(--gray-800));
556
- --clear-btn-color-hover: var(--red-300);
557
- }
558
- `;
559
- const sizeCSS = ':host([size="xs"]) { font-size: var(--size-xs); }\n:host([size="sm"]) { font-size: var(--size-s); }\n:host([size="md"]) { font-size: var(--size-m); }\n:host([size="lg"]) { font-size: var(--size-l); }\n:host([size="xl"]) { font-size: var(--size-xl); }\n:host([size="3xs"]) { font-size: var(--size-3xs); }\n:host([size="2xs"]) { font-size: var(--size-2xs); }\n';
560
- const style$a = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--size-base);\n\n /* Layout variables */\n --input-field-gap: 4px;\n \n /* Input element variables */\n --input-font-size: 1em;\n --input-padding: 0.333em 0.583em;\n --input-border-width: 1px;\n --input-border-radius: 2px;\n --input-border-color: var(--border-subtle);\n --input-border-color-hover: var(--border-default);\n --input-border-color-focus: var(--border-focus);\n --input-bg: var(--surface-base);\n --input-bg-hover: var(--surface-raised);\n --input-bg-focus: var(--surface-raised);\n --input-color: var(--color-text-muted);\n --input-placeholder-color: var(--color-text-disabled);\n --input-transition: border-color 0.12s, background 0.12s;\n}\n\n.input-container {\n display: flex;\n align-items: center;\n gap: var(--input-field-gap);\n width: 100%;\n}\n\ninput {\n flex: 1;\n min-width: 0;\n font-size: var(--input-font-size);\n padding: var(--input-padding);\n border: var(--input-border-width) solid var(--input-border-color);\n border-radius: var(--input-border-radius);\n background: var(--input-bg);\n color: var(--input-color);\n transition: var(--input-transition);\n}\n\ninput::placeholder {\n color: var(--input-placeholder-color);\n}\n\ninput:focus {\n outline: none;\n border-color: var(--input-border-color-focus);\n background: var(--input-bg-focus);\n}\n\ninput:hover:not(:focus) {\n border-color: var(--input-border-color-hover);\n background: var(--input-bg-hover);\n}\n\ninput:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* Clear button styles */\n.clear-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--clear-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--clear-btn-bg);\n color: var(--clear-btn-color);\n transition: var(--clear-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.clear-btn:hover {\n background: var(--clear-btn-bg-hover);\n color: var(--clear-btn-color-hover);\n}\n\n/* Reset button styles */\n.reset-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--reset-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.reset-btn:hover {\n background: var(--reset-btn-bg-hover);\n color: var(--reset-btn-color-hover);\n}\n\n\n\n";
561
- class TextInput extends AeicoField {
562
- constructor() {
563
- super(...arguments);
564
- __publicField(this, "fieldElement", null);
565
- }
566
- render() {
567
- return aeico.html(({ div, input }) => {
568
- div({ className: "input-container" }, () => {
569
- this.fieldElement = input({
570
- type: this.type || "text",
571
- placeholder: this.placeholder || "",
572
- "@input": this.boundOnChange
573
- });
574
- this.renderActionButtons();
575
- });
576
- if (this.fieldElement && this.value != null) {
577
- this.fieldElement.value = String(this.value);
578
- }
579
- this.updateClearButtonVisibility();
580
- });
581
- }
582
- /**
583
- * Update clear button visibility based on input value
584
- */
585
- updateClearButtonVisibility() {
586
- if (this.clearBtn && this.fieldElement) {
587
- const hasValue = this.fieldElement.value.length > 0;
588
- this.clearBtn.style.display = hasValue ? "" : "none";
589
- }
590
- }
591
- /**
592
- * Write value to the input element (DOM only)
593
- */
594
- writeValue(value) {
595
- const strValue = String(value || "");
596
- if (this.fieldElement) {
597
- this.fieldElement.value = strValue;
598
- }
599
- this.updateClearButtonVisibility();
600
- }
601
- }
602
- __publicField(TextInput, "tagName", "text-input");
603
- __publicField(TextInput, "props", {
604
- placeholder: { type: String },
605
- type: { type: String }
606
- });
607
- __publicField(TextInput, "styles", [styleVariables, sizeCSS, style$a]);
608
- TextInput.register();
609
- const style$9 = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--size-base);\n\n /* Layout variables */\n --select-field-gap: 2px;\n\n /* Trigger variables */\n --select-font-size: 1em;\n --select-padding: 0.333em 0.583em;\n --select-border-width: 1px;\n --select-border-radius: 2px;\n --select-border-color: var(--border-subtle);\n --select-border-color-hover: var(--border-default);\n --select-border-color-focus: var(--border-focus);\n --select-bg: var(--surface-base);\n --select-bg-hover: var(--surface-raised);\n --select-bg-focus: var(--surface-raised);\n --select-color: var(--color-text-muted);\n --select-transition: border-color 0.12s, background 0.12s;\n\n /* Arrow */\n --select-arrow-color: var(--color-text-muted);\n --select-arrow-size: 0.75em;\n\n /* Dropdown */\n --select-dropdown-bg: var(--surface-overlay);\n --select-dropdown-border: var(--border-default);\n --select-dropdown-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n --select-dropdown-border-radius: 2px;\n --select-dropdown-max-height: 240px;\n --select-dropdown-z-index: 1000;\n}\n\n.container {\n display: flex;\n align-items: center;\n gap: var(--select-field-gap);\n width: 100%;\n position: relative;\n}\n\n.trigger {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 0.333em;\n font-size: var(--select-font-size);\n padding: var(--select-padding);\n border: var(--select-border-width) solid var(--select-border-color);\n border-radius: var(--select-border-radius);\n background: var(--select-bg);\n color: var(--select-color);\n cursor: pointer;\n transition: var(--select-transition);\n user-select: none;\n outline: none;\n box-sizing: border-box;\n}\n\n.trigger:hover:not(.disabled) {\n border-color: var(--select-border-color-hover);\n background: var(--select-bg-hover);\n}\n\n.trigger.open {\n border-color: var(--select-border-color-focus);\n background: var(--select-bg-focus);\n}\n\n.trigger.disabled {\n opacity: 0.5;\n cursor: default;\n pointer-events: none;\n}\n\n.value {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.placeholder {\n color: var(--color-text-disabled);\n}\n\n.selected-list {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n align-items: center;\n padding: 2px 0;\n}\n\n/* Non-expandable (default): single-row, clip overflow */\n.trigger:has(.selected-list--clipped) {\n flex-wrap: nowrap;\n}\n\n.selected-list--clipped {\n flex-wrap: nowrap;\n overflow: hidden;\n}\n\n.overflow-indicator {\n flex-shrink: 0;\n align-self: center;\n padding: 1px 6px;\n background: color-mix(in srgb, var(--color-primary) 12%, transparent);\n color: var(--color-primary);\n border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);\n border-radius: 3px;\n font-size: 0.82em;\n line-height: 1.6;\n cursor: default;\n user-select: none;\n}\n\n.arrow {\n flex-shrink: 0;\n align-self: center;\n font-size: var(--select-arrow-size);\n color: var(--select-arrow-color);\n transition: transform 0.12s;\n pointer-events: none;\n line-height: 1;\n}\n\n.trigger.open .arrow {\n transform: rotate(180deg);\n}\n\n.dropdown {\n display: none;\n position: absolute;\n z-index: var(--select-dropdown-z-index);\n background: var(--select-dropdown-bg);\n border: 1px solid var(--select-dropdown-border);\n border-radius: var(--select-dropdown-border-radius);\n box-shadow: var(--select-dropdown-shadow);\n max-height: var(--select-dropdown-max-height);\n overflow-y: auto;\n min-width: 100%;\n box-sizing: border-box;\n}\n\n.dropdown.open {\n display: block;\n}\n\n.dropdown.position-bottom {\n top: 100%;\n left: 0;\n margin-top: 2px;\n}\n\n.dropdown.position-top {\n bottom: 100%;\n left: 0;\n margin-bottom: 2px;\n}\n\n.dropdown.position-left {\n right: 100%;\n top: 0;\n margin-right: 2px;\n}\n\n.dropdown.position-right {\n left: 100%;\n top: 0;\n margin-left: 2px;\n}\n\n.clear-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--clear-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--clear-btn-bg);\n color: var(--clear-btn-color);\n transition: var(--clear-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.clear-btn:hover {\n background: var(--clear-btn-bg-hover);\n color: var(--clear-btn-color-hover);\n}\n\n.reset-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--reset-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n}\n\n.reset-btn:hover {\n background: var(--reset-btn-bg-hover);\n color: var(--reset-btn-color-hover);\n}\n";
610
- const colorCSS = ':host {\n --color-solid: var(--color-gray);\n --color-solid-hover: color-mix(in srgb, var(--color-solid), var(--color-mix-hover));\n --color-solid-active: color-mix(in srgb, var(--color-solid), var(--color-mix-active));\n --color-on-solid: var(--color-text-main);\n --color-border: var(--color-gray);\n --color-border-hover: color-mix(in srgb, var(--color-border), var(--color-mix-hover));\n --color-accent: var(--color-text-muted);\n --color-accent-hover: var(--color-text-main);\n --color-subtle: var(--border-subtle);\n --color-subtle-hover: var(--border-default);\n --color-bg-subtle: var(--border-subtle);\n --color-text-subtle: var(--color-text-muted);\n --color-border-subtle: var(--border-default);\n}\n\n:host([color="primary"]) {\n --color-solid: var(--color-primary);\n --color-on-solid: white;\n --color-border: var(--color-primary);\n --color-accent: var(--color-text-link);\n --color-accent-hover: var(--color-text-link-hover);\n --color-subtle: var(--color-primary-bg-subtle);\n --color-subtle-hover: rgb(from var(--blue) r g b / 0.15);\n --color-bg-subtle: var(--color-primary-bg-subtle);\n --color-text-subtle: var(--color-primary-text-emphasis);\n --color-border-subtle: var(--color-primary-border-subtle);\n}\n\n:host([color="secondary"]) {\n --color-solid: var(--color-secondary);\n --color-on-solid: white;\n --color-border: var(--color-secondary-hover);\n --color-accent: var(--color-secondary-text-emphasis);\n --color-accent-hover: var(--color-text-main);\n --color-subtle: rgb(from var(--slate) r g b / 0.06);\n --color-subtle-hover: rgb(from var(--slate) r g b / 0.12);\n --color-bg-subtle: var(--color-secondary-bg-subtle);\n --color-text-subtle: var(--color-secondary-text-emphasis);\n --color-border-subtle: var(--color-secondary-border-subtle);\n}\n\n:host([color="success"]) {\n --color-solid: var(--color-success);\n --color-on-solid: white;\n --color-border: var(--color-success);\n --color-accent: var(--color-success-text-emphasis);\n --color-accent-hover: var(--color-success-hover);\n --color-subtle: var(--color-success-bg-subtle);\n --color-subtle-hover: rgb(from var(--green) r g b / 0.15);\n --color-bg-subtle: var(--color-success-bg-subtle);\n --color-text-subtle: var(--color-success-text-emphasis);\n --color-border-subtle: var(--color-success-border-subtle);\n}\n\n:host([color="danger"]) {\n --color-solid: var(--color-danger);\n --color-on-solid: white;\n --color-border: var(--color-danger);\n --color-accent: var(--color-danger-text-emphasis);\n --color-accent-hover: var(--color-danger-hover);\n --color-subtle: var(--color-danger-bg-subtle);\n --color-subtle-hover: rgb(from var(--red) r g b / 0.15);\n --color-bg-subtle: var(--color-danger-bg-subtle);\n --color-text-subtle: var(--color-danger-text-emphasis);\n --color-border-subtle: var(--color-danger-border-subtle);\n}\n\n:host([color="warning"]) {\n --color-solid: var(--color-warning);\n --color-on-solid: var(--gray-900);\n --color-border: var(--color-warning);\n --color-accent: var(--color-warning-text-emphasis);\n --color-accent-hover: var(--color-warning-hover);\n --color-subtle: var(--color-warning-bg-subtle);\n --color-subtle-hover: rgb(from var(--yellow) r g b / 0.15);\n --color-bg-subtle: var(--color-warning-bg-subtle);\n --color-text-subtle: var(--color-warning-text-emphasis);\n --color-border-subtle: var(--color-warning-border-subtle);\n}\n\n:host([color="info"]) {\n --color-solid: var(--color-info);\n --color-on-solid: white;\n --color-border: var(--color-info);\n --color-accent: var(--color-info-text-emphasis);\n --color-accent-hover: var(--color-info-hover);\n --color-subtle: var(--color-info-bg-subtle);\n --color-subtle-hover: rgb(from var(--cyan) r g b / 0.15);\n --color-bg-subtle: var(--color-info-bg-subtle);\n --color-text-subtle: var(--color-info-text-emphasis);\n --color-border-subtle: var(--color-info-border-subtle);\n}\n\n:host([color="light"]) {\n --color-solid: var(--light);\n --color-on-solid: var(--gray-900);\n --color-border: var(--border-hover);\n --color-subtle: var(--color-light-bg-subtle);\n --color-subtle-hover: var(--color-light-border-subtle);\n --color-bg-subtle: var(--color-light-bg-subtle);\n --color-text-subtle: var(--color-text-muted);\n --color-border-subtle: var(--color-light-border-subtle);\n}\n\n:host([color="dark"]) {\n --color-solid: var(--dark-500);\n --color-on-solid: white;\n --color-border: var(--dark-500);\n --color-accent: var(--color-text-main);\n --color-accent-hover: var(--color-text-main);\n --color-subtle: var(--color-dark-bg-subtle);\n --color-subtle-hover: var(--color-dark-border-subtle);\n --color-bg-subtle: var(--color-dark-bg-subtle);\n --color-text-subtle: var(--color-text-main);\n --color-border-subtle: var(--color-dark-border-subtle);\n}\n';
611
- const tagStyle = ':host {\n display: inline-flex;\n align-items: center;\n --tag-solid-bg: var(--color-solid);\n --tag-solid-color: var(--color-on-solid);\n --tag-border: var(--color-border);\n --tag-accent: var(--color-accent);\n --tag-subtle-bg: var(--color-bg-subtle);\n --tag-subtle-color: var(--color-text-subtle);\n --tag-subtle-border: var(--color-border-subtle);\n}\n\n.tag {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n font-family: inherit;\n font-weight: 500;\n white-space: nowrap;\n vertical-align: middle;\n line-height: 1.2;\n font-size: 1em;\n padding: 0.15em 0.5em 0.15em 0.6em;\n border-radius: 4px;\n border: 1px solid var(--tag-solid-bg);\n background: var(--tag-solid-bg);\n color: var(--tag-solid-color);\n max-width: 160px;\n min-width: 0;\n}\n\n:host([variant="outlined"]) .tag {\n background: transparent;\n border-color: var(--tag-border);\n color: var(--tag-accent);\n}\n\n:host([variant="faint"]) .tag {\n background: var(--tag-subtle-bg);\n border-color: var(--tag-subtle-border);\n color: var(--tag-subtle-color);\n}\n\n:host([variant="subtle"]) .tag {\n background: var(--tag-subtle-bg);\n border-color: transparent;\n color: var(--tag-subtle-color);\n}\n\n:host([variant="text"]) .tag {\n background: transparent;\n border-color: transparent;\n color: var(--tag-accent);\n padding-left: 0;\n padding-right: 0;\n}\n\n\n:host([pill]) .tag { border-radius: 999px; }\n\n.tag-content {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n::slotted(ae-icon) { font-size: 1.1em; }\n\n.tag-dismiss {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n opacity: 0.55;\n line-height: 1;\n font-size: 1em;\n padding: 0 1px;\n border-radius: 2px;\n background: transparent;\n border: none;\n color: inherit;\n font-family: inherit;\n transition: opacity 0.1s, background 0.1s;\n}\n\n:host([dismissible]) .tag-dismiss {\n display: inline-flex;\n}\n\n.tag-dismiss:hover {\n opacity: 1;\n background: color-mix(in srgb, currentColor 15%, transparent);\n}\n\n/* disabled: button remains visible but is inert */\n:host([disabled]) .tag-dismiss {\n opacity: 0.4;\n pointer-events: none;\n cursor: default;\n}\n\n:host([disabled]) .tag {\n opacity: 0.6;\n}\n';
612
- var __create$d = Object.create;
613
- var __defProp$d = Object.defineProperty;
614
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
615
- var __knownSymbol$d = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
616
- var __typeError$d = (msg) => {
617
- throw TypeError(msg);
618
- };
619
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
620
- var __decoratorStart$d = (base) => [, , , __create$d((base == null ? void 0 : base[__knownSymbol$d("metadata")]) ?? null)];
621
- var __decoratorStrings$d = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
622
- var __expectFn$d = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$d("Function expected") : fn;
623
- var __decoratorContext$d = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$d[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$d("Already initialized") : fns.push(__expectFn$d(fn || null)) });
624
- var __decoratorMetadata$d = (array, target) => __defNormalProp$d(target, __knownSymbol$d("metadata"), array[3]);
625
- var __runInitializers$d = (array, flags, self, value) => {
626
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
627
- return value;
628
- };
629
- var __decorateElement$d = (array, flags, name, decorators, target, extra) => {
630
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
631
- var j = array.length + 1, key = __decoratorStrings$d[k + 5];
632
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
633
- var desc = (target = target.prototype, __getOwnPropDesc$c({ get [name]() {
634
- return __privateGet$c(this, extra);
635
- }, set [name](x) {
636
- return __privateSet$c(this, extra, x);
637
- } }, name));
638
- for (var i = decorators.length - 1; i >= 0; i--) {
639
- ctx = __decoratorContext$d(k, name, done = {}, array[3], extraInitializers);
640
- {
641
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
642
- access.get = (x) => x[name];
643
- access.set = (x, y) => x[name] = y;
644
- }
645
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
646
- if (it === void 0) __expectFn$d(it) && (desc[key] = it);
647
- else if (typeof it !== "object" || it === null) __typeError$d("Object expected");
648
- else __expectFn$d(fn = it.get) && (desc.get = fn), __expectFn$d(fn = it.set) && (desc.set = fn), __expectFn$d(fn = it.init) && initializers.unshift(fn);
649
- }
650
- return desc && __defProp$d(target, name, desc), target;
651
- };
652
- var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, key + "", value);
653
- var __accessCheck$c = (obj, member, msg) => member.has(obj) || __typeError$d("Cannot " + msg);
654
- var __privateGet$c = (obj, member, getter) => (__accessCheck$c(obj, member, "read from private field"), member.get(obj));
655
- var __privateAdd$c = (obj, member, value) => member.has(obj) ? __typeError$d("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
656
- var __privateSet$c = (obj, member, value, setter) => (__accessCheck$c(obj, member, "write to private field"), member.set(obj, value), value);
657
- var _pill_dec$1, _disabled_dec$5, _dismissible_dec, _size_dec$3, _variant_dec$5, _color_dec$8, _a$d, _init$d, _color$7, _variant$4, _size$2, _dismissible, _disabled$4, _pill$1;
658
- class Tag extends (_a$d = AeicoComponent, _color_dec$8 = [aeico.prop({ type: String })], _variant_dec$5 = [aeico.prop({ type: String })], _size_dec$3 = [aeico.prop({ type: String })], _dismissible_dec = [aeico.prop({ type: Boolean })], _disabled_dec$5 = [aeico.prop({ type: Boolean })], _pill_dec$1 = [aeico.prop({ type: Boolean })], _a$d) {
659
- constructor() {
660
- super(...arguments);
661
- __privateAdd$c(this, _color$7, __runInitializers$d(_init$d, 8, this)), __runInitializers$d(_init$d, 11, this);
662
- __privateAdd$c(this, _variant$4, __runInitializers$d(_init$d, 12, this)), __runInitializers$d(_init$d, 15, this);
663
- __privateAdd$c(this, _size$2, __runInitializers$d(_init$d, 16, this)), __runInitializers$d(_init$d, 19, this);
664
- __privateAdd$c(this, _dismissible, __runInitializers$d(_init$d, 20, this, false)), __runInitializers$d(_init$d, 23, this);
665
- __privateAdd$c(this, _disabled$4, __runInitializers$d(_init$d, 24, this, false)), __runInitializers$d(_init$d, 27, this);
666
- __privateAdd$c(this, _pill$1, __runInitializers$d(_init$d, 28, this, false)), __runInitializers$d(_init$d, 31, this);
667
- }
668
- render() {
669
- return aeico.html(({ span, button, slot }) => {
670
- span({ part: "tag", className: "tag" }, () => {
671
- slot({ name: "start" });
672
- span({ className: "tag-content" }, () => {
673
- slot();
674
- });
675
- slot({ name: "end" });
676
- button(
677
- {
678
- type: "button",
679
- className: "tag-dismiss",
680
- "aria-label": "dismiss",
681
- "@click": (e) => {
682
- e.stopPropagation();
683
- if (this.disabled) return;
684
- this.emit("dismiss");
685
- }
686
- },
687
- () => {
688
- span({ textContent: "×" });
689
- }
690
- );
691
- });
692
- });
693
- }
694
- }
695
- _init$d = __decoratorStart$d(_a$d);
696
- _color$7 = /* @__PURE__ */ new WeakMap();
697
- _variant$4 = /* @__PURE__ */ new WeakMap();
698
- _size$2 = /* @__PURE__ */ new WeakMap();
699
- _dismissible = /* @__PURE__ */ new WeakMap();
700
- _disabled$4 = /* @__PURE__ */ new WeakMap();
701
- _pill$1 = /* @__PURE__ */ new WeakMap();
702
- __decorateElement$d(_init$d, 4, "color", _color_dec$8, Tag, _color$7);
703
- __decorateElement$d(_init$d, 4, "variant", _variant_dec$5, Tag, _variant$4);
704
- __decorateElement$d(_init$d, 4, "size", _size_dec$3, Tag, _size$2);
705
- __decorateElement$d(_init$d, 4, "dismissible", _dismissible_dec, Tag, _dismissible);
706
- __decorateElement$d(_init$d, 4, "disabled", _disabled_dec$5, Tag, _disabled$4);
707
- __decorateElement$d(_init$d, 4, "pill", _pill_dec$1, Tag, _pill$1);
708
- __decoratorMetadata$d(_init$d, Tag);
709
- __publicField$d(Tag, "styles", [styleVariables, sizeCSS, colorCSS, tagStyle]);
710
- Tag.register();
711
- var __create$c = Object.create;
712
- var __defProp$c = Object.defineProperty;
713
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
714
- var __knownSymbol$c = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
715
- var __typeError$c = (msg) => {
716
- throw TypeError(msg);
717
- };
718
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
719
- var __name = (target, value) => __defProp$c(target, "name", { value, configurable: true });
720
- var __decoratorStart$c = (base) => [, , , __create$c((base == null ? void 0 : base[__knownSymbol$c("metadata")]) ?? null)];
721
- var __decoratorStrings$c = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
722
- var __expectFn$c = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$c("Function expected") : fn;
723
- var __decoratorContext$c = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$c[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$c("Already initialized") : fns.push(__expectFn$c(fn || null)) });
724
- var __decoratorMetadata$c = (array, target) => __defNormalProp$c(target, __knownSymbol$c("metadata"), array[3]);
725
- var __runInitializers$c = (array, flags, self, value) => {
726
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
727
- return value;
728
- };
729
- var __decorateElement$c = (array, flags, name, decorators, target, extra) => {
730
- var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
731
- var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings$c[k + 5];
732
- var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
733
- var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc$b(k < 4 ? target : { get [name]() {
734
- return __privateGet$b(this, extra);
735
- }, set [name](x) {
736
- return __privateSet$b(this, extra, x);
737
- } }, name));
738
- k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
739
- for (var i = decorators.length - 1; i >= 0; i--) {
740
- ctx = __decoratorContext$c(k, name, done = {}, array[3], extraInitializers);
741
- if (k) {
742
- ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
743
- if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet$b : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
744
- if (k > 2) access.set = p ? (x, y) => __privateSet$b(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
745
- }
746
- it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
747
- if (k ^ 4 || it === void 0) __expectFn$c(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
748
- else if (typeof it !== "object" || it === null) __typeError$c("Object expected");
749
- else __expectFn$c(fn = it.get) && (desc.get = fn), __expectFn$c(fn = it.set) && (desc.set = fn), __expectFn$c(fn = it.init) && initializers.unshift(fn);
750
- }
751
- return k || __decoratorMetadata$c(array, target), desc && __defProp$c(target, name, desc), p ? k ^ 4 ? extra : desc : target;
752
- };
753
- var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
754
- var __accessCheck$b = (obj, member, msg) => member.has(obj) || __typeError$c("Cannot " + msg);
755
- var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError$c('Cannot use the "in" operator on this value') : member.has(obj);
756
- var __privateGet$b = (obj, member, getter) => (__accessCheck$b(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
757
- var __privateAdd$b = (obj, member, value) => member.has(obj) ? __typeError$c("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
758
- var __privateSet$b = (obj, member, value, setter) => (__accessCheck$b(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
759
- var __privateMethod = (obj, member, method) => (__accessCheck$b(obj, member, "access private method"), method);
760
- var _defaultValue_dec, _value_dec$1, _expandable_dec, _multiple_dec, _placeholder_dec, _position_dec, _options_dec$1, __expanded_dec, _a$c, _init$c, __expanded, _options$1, _position, _placeholder, _multiple, _expandable;
761
- class Select extends (_a$c = AeicoField, __expanded_dec = [aeico.prop({ type: Boolean, observe: false, reflect: false })], _options_dec$1 = [aeico.prop({ type: Array })], _position_dec = [aeico.prop({ type: String })], _placeholder_dec = [aeico.prop({ type: String })], _multiple_dec = [aeico.prop({ type: Boolean })], _expandable_dec = [aeico.prop({ type: Boolean })], _value_dec$1 = [aeico.prop({
762
- type: String,
763
- parser: (v) => {
764
- if (v === null || v === void 0) return void 0;
765
- try {
766
- return JSON.parse(v);
767
- } catch {
768
- return v;
769
- }
770
- },
771
- formatter: (v) => {
772
- if (v === null || v === void 0) return "";
773
- if (Array.isArray(v)) return JSON.stringify(v);
774
- return String(v);
775
- }
776
- })], _defaultValue_dec = [aeico.prop({
777
- type: String,
778
- parser: (v) => {
779
- if (v === null || v === void 0) return void 0;
780
- try {
781
- return JSON.parse(v);
782
- } catch {
783
- return v;
784
- }
785
- },
786
- formatter: (v) => {
787
- if (v === null || v === void 0) return "";
788
- if (Array.isArray(v)) return JSON.stringify(v);
789
- return String(v);
790
- }
791
- })], _a$c) {
792
- constructor() {
793
- super(...arguments);
794
- __publicField$c(this, "fieldElement", null);
795
- __publicField$c(this, "_isOpen", false);
796
- __publicField$c(this, "_triggerEl", null);
797
- __publicField$c(this, "_dropdownEl", null);
798
- __publicField$c(this, "_slotEl", null);
799
- __publicField$c(this, "_slotOptionData", []);
800
- __publicField$c(this, "_selectedListEl", null);
801
- __privateAdd$b(this, __expanded, __runInitializers$c(_init$c, 8, this, false)), __runInitializers$c(_init$c, 11, this);
802
- __privateAdd$b(this, _options$1, __runInitializers$c(_init$c, 12, this)), __runInitializers$c(_init$c, 15, this);
803
- __privateAdd$b(this, _position, __runInitializers$c(_init$c, 16, this)), __runInitializers$c(_init$c, 19, this);
804
- __privateAdd$b(this, _placeholder, __runInitializers$c(_init$c, 20, this)), __runInitializers$c(_init$c, 23, this);
805
- __privateAdd$b(this, _multiple, __runInitializers$c(_init$c, 24, this, false)), __runInitializers$c(_init$c, 27, this);
806
- __privateAdd$b(this, _expandable, __runInitializers$c(_init$c, 28, this, false)), __runInitializers$c(_init$c, 31, this);
807
- __publicField$c(this, "value", __runInitializers$c(_init$c, 32, this)), __runInitializers$c(_init$c, 35, this);
808
- __publicField$c(this, "defaultValue", __runInitializers$c(_init$c, 36, this)), __runInitializers$c(_init$c, 39, this);
809
- __publicField$c(this, "_handleOutsideClick", (e) => {
810
- if (!e.composedPath().includes(this)) {
811
- this._closeDropdown();
812
- }
813
- });
814
- __publicField$c(this, "_handleOptionSelect", (e) => {
815
- const { value, label } = e.detail;
816
- if (!this._slotOptionData.find((o) => o.value === value)) {
817
- this._slotOptionData = [
818
- ...this._slotOptionData.filter((o) => o.value !== value),
819
- { value, label }
820
- ];
821
- }
822
- if (this.multiple) {
823
- const current = this._getMultiValues();
824
- const idx = current.findIndex((v) => String(v) === value);
825
- const next = idx >= 0 ? current.filter((_, i) => i !== idx) : [...current, value];
826
- this.setValue(next, { silent: false, action: "change" });
827
- } else {
828
- this.setValue(value, { silent: false, action: "change" });
829
- this._closeDropdown();
830
- }
831
- });
832
- }
833
- writeValue(_value2) {
834
- }
835
- getValue() {
836
- if (this.multiple) return this._getMultiValues();
837
- return this.value || "";
838
- }
839
- _getMultiValues() {
840
- if (Array.isArray(this.value)) return this.value;
841
- if (this.value != null && this.value !== "") return [this.value];
842
- return [];
843
- }
844
- onDisabledChanged(_newValue) {
845
- }
846
- onUpdated(_changedProps) {
847
- if (!this.multiple || this.expandable) {
848
- if (this._expanded) this._expanded = false;
849
- return;
850
- }
851
- const list = this._selectedListEl;
852
- if (!list) return;
853
- const overflowing = list.scrollWidth > list.clientWidth + 1;
854
- if (overflowing !== this._expanded) this._expanded = overflowing;
855
- }
856
- _findLabel(value) {
857
- const strVal = String(value);
858
- if (Array.isArray(this.options)) {
859
- for (const opt of this.options) {
860
- if (this._isSelectOption(opt)) {
861
- if (String(opt.value) === strVal) return aeicoLocalize.t(opt.label, opt.label);
862
- } else {
863
- if (String(opt) === strVal) return strVal;
864
- }
865
- }
866
- }
867
- for (const opt of this._slotOptionData) {
868
- if (opt.value === strVal) return opt.label;
869
- }
870
- return strVal;
871
- }
872
- _onSlotChange() {
873
- var _a2;
874
- if (!this._slotEl) return;
875
- const data = [];
876
- for (const el of this._slotEl.assignedElements({ flatten: true })) {
877
- if (el.tagName.toLowerCase() !== "ae-select-option") continue;
878
- const optEl = el;
879
- data.push({
880
- value: optEl.value ?? el.getAttribute("value") ?? "",
881
- label: optEl.label || ((_a2 = el.textContent) == null ? void 0 : _a2.trim()) || ""
882
- });
883
- }
884
- this._slotOptionData = data;
885
- this.update();
886
- }
887
- _toggleDropdown() {
888
- if (this._isOpen) {
889
- this._closeDropdown();
890
- } else {
891
- this._openDropdown();
892
- }
893
- }
894
- _openDropdown() {
895
- this._isOpen = true;
896
- this._syncOpenState();
897
- }
898
- _closeDropdown() {
899
- this._isOpen = false;
900
- this._syncOpenState();
901
- }
902
- _syncOpenState() {
903
- var _a2, _b;
904
- (_a2 = this._triggerEl) == null ? void 0 : _a2.classList.toggle("open", this._isOpen);
905
- (_b = this._dropdownEl) == null ? void 0 : _b.classList.toggle("open", this._isOpen);
906
- }
907
- connectedCallback() {
908
- super.connectedCallback();
909
- document.addEventListener("click", this._handleOutsideClick);
910
- this.addEventListener("selectoption", this._handleOptionSelect);
911
- }
912
- disconnectedCallback() {
913
- super.disconnectedCallback();
914
- document.removeEventListener("click", this._handleOutsideClick);
915
- this.removeEventListener("selectoption", this._handleOptionSelect);
916
- }
917
- _syncSlotOptionsSelected() {
918
- if (!this._slotEl) return;
919
- const multiValues = this._getMultiValues();
920
- for (const el of this._slotEl.assignedElements({ flatten: true })) {
921
- if (el.tagName.toLowerCase() !== "ae-select-option") continue;
922
- const optEl = el;
923
- const optVal = optEl.value ?? el.getAttribute("value") ?? "";
924
- const isSelected = this.multiple ? multiValues.some((v) => String(v) === optVal) : this.value != null && this.value !== "" && String(this.value) === optVal;
925
- optEl.selected = isSelected ? true : void 0;
926
- }
927
- }
928
- render() {
929
- const position = this.position || "bottom";
930
- const multiValues = this.multiple ? this._getMultiValues() : [];
931
- const hasMultiSelection = this.multiple && multiValues.length > 0;
932
- const selectedLabel = !this.multiple && this.value != null && this.value !== "" ? this._findLabel(this.value) : "";
933
- const isDisabled = Boolean(this.disabled);
934
- this._selectedListEl = null;
935
- this._syncSlotOptionsSelected();
936
- return aeico.html(({ div, span, slot }) => {
937
- div({ className: "container" }, () => {
938
- this._triggerEl = div(
939
- {
940
- className: `trigger${this._isOpen ? " open" : ""}${isDisabled ? " disabled" : ""}`,
941
- "@click": () => {
942
- if (isDisabled) return;
943
- this._toggleDropdown();
944
- }
945
- },
946
- () => {
947
- if (this.multiple) {
948
- if (hasMultiSelection) {
949
- this._selectedListEl = div(
950
- {
951
- className: `selected-list${!this.expandable ? " selected-list--clipped" : ""}`
952
- },
953
- () => {
954
- for (const v of multiValues) {
955
- const lbl = this._findLabel(v);
956
- aeico.tags.aeTag({
957
- key: `sel-${v}`,
958
- color: "default",
959
- variant: "faint",
960
- dismissible: true,
961
- disabled: isDisabled,
962
- textContent: lbl,
963
- "@dismiss": (e) => {
964
- e.stopPropagation();
965
- if (isDisabled) return;
966
- const next = multiValues.filter((item) => String(item) !== String(v));
967
- this.setValue(next, { silent: false, action: "change" });
968
- }
969
- });
970
- }
971
- }
972
- );
973
- if (!this.expandable && this._expanded) {
974
- span({ className: "overflow-indicator", textContent: "…" });
975
- }
976
- } else {
977
- span({ className: "value placeholder", textContent: this.placeholder || "" });
978
- }
979
- } else {
980
- if (selectedLabel) {
981
- span({ className: "value", textContent: selectedLabel });
982
- } else {
983
- span({ className: "value placeholder", textContent: this.placeholder || "" });
984
- }
985
- }
986
- span({ className: "arrow", textContent: "▾" });
987
- }
988
- );
989
- this._dropdownEl = div(
990
- {
991
- className: `dropdown position-${position}${this._isOpen ? " open" : ""}`
992
- },
993
- () => {
994
- this._renderProgrammaticOptions();
995
- this._slotEl = slot({
996
- "@slotchange": () => this._onSlotChange()
997
- });
998
- }
999
- );
1000
- this.renderActionButtons();
1001
- });
1002
- });
1003
- }
1004
- _renderProgrammaticOptions() {
1005
- if (!Array.isArray(this.options)) return;
1006
- const { aeSelectOption } = aeico.tags;
1007
- const multiValues = this.multiple ? this._getMultiValues() : [];
1008
- for (const opt of this.options) {
1009
- if (this._isSelectOption(opt)) {
1010
- const isSelected = this.multiple ? multiValues.some((v) => String(v) === String(opt.value)) : this.value != null && String(opt.value) === String(this.value);
1011
- aeSelectOption({
1012
- key: `opt-${opt.value}`,
1013
- value: String(opt.value),
1014
- label: opt.label,
1015
- textContent: aeicoLocalize.t(opt.label, opt.label),
1016
- selected: isSelected ? true : void 0
1017
- });
1018
- } else {
1019
- const isSelected = this.multiple ? multiValues.some((v) => String(v) === String(opt)) : this.value != null && String(opt) === String(this.value);
1020
- aeSelectOption({
1021
- key: `opt-${opt}`,
1022
- value: String(opt),
1023
- textContent: String(opt),
1024
- selected: isSelected ? true : void 0
1025
- });
1026
- }
1027
- }
1028
- }
1029
- _isSelectOption(option) {
1030
- return option !== null && typeof option === "object" && typeof option.label === "string" && (typeof option.value === "string" || typeof option.value === "number");
1031
- }
1032
- }
1033
- _init$c = __decoratorStart$c(_a$c);
1034
- __expanded = /* @__PURE__ */ new WeakMap();
1035
- _options$1 = /* @__PURE__ */ new WeakMap();
1036
- _position = /* @__PURE__ */ new WeakMap();
1037
- _placeholder = /* @__PURE__ */ new WeakMap();
1038
- _multiple = /* @__PURE__ */ new WeakMap();
1039
- _expandable = /* @__PURE__ */ new WeakMap();
1040
- __decorateElement$c(_init$c, 4, "_expanded", __expanded_dec, Select, __expanded);
1041
- __decorateElement$c(_init$c, 4, "options", _options_dec$1, Select, _options$1);
1042
- __decorateElement$c(_init$c, 4, "position", _position_dec, Select, _position);
1043
- __decorateElement$c(_init$c, 4, "placeholder", _placeholder_dec, Select, _placeholder);
1044
- __decorateElement$c(_init$c, 4, "multiple", _multiple_dec, Select, _multiple);
1045
- __decorateElement$c(_init$c, 4, "expandable", _expandable_dec, Select, _expandable);
1046
- __decorateElement$c(_init$c, 5, "value", _value_dec$1, Select);
1047
- __decorateElement$c(_init$c, 5, "defaultValue", _defaultValue_dec, Select);
1048
- __decoratorMetadata$c(_init$c, Select);
1049
- __publicField$c(Select, "tagName", "select");
1050
- __publicField$c(Select, "styles", [styleVariables, sizeCSS, style$9]);
1051
- Select.register();
1052
- const style$8 = `:host {
1053
- display: block;
1054
- flex: 1;
1055
- min-width: 0;
1056
- font-size: var(--size-base);
1057
-
1058
- /* Default color when no [color] attribute — overridden by color.css :host([color=...]) */
1059
- --color-solid: var(--color-primary);
1060
- }
1061
-
1062
- .range-container {
1063
- display: flex;
1064
- align-items: center;
1065
- gap: 6px;
1066
- width: 100%;
1067
- height: 26px;
1068
- }
1069
-
1070
- input[type="range"] {
1071
- flex: 1;
1072
- margin: 0;
1073
- }
1074
-
1075
- .input-range,
1076
- .slider-input,
1077
- input[type="range"] {
1078
- -webkit-appearance: none;
1079
- appearance: none;
1080
- width: 100%;
1081
- height: 0.333em;
1082
- border-radius: 2px;
1083
- background: var(--border-subtle);
1084
- outline: none;
1085
- cursor: pointer;
1086
- margin: 0;
1087
- }
1088
-
1089
- .input-range {
1090
- margin: 10px 0;
1091
- }
1092
-
1093
- .input-range::-webkit-slider-thumb,
1094
- .slider-input::-webkit-slider-thumb,
1095
- input[type="range"]::-webkit-slider-thumb {
1096
- -webkit-appearance: none;
1097
- appearance: none;
1098
- width: 1.167em;
1099
- height: 1.167em;
1100
- border-radius: 50%;
1101
- background: var(--color-solid);
1102
- cursor: pointer;
1103
- transition: background 0.12s, transform 0.12s;
1104
- }
1105
-
1106
- .input-range::-webkit-slider-thumb:hover,
1107
- .slider-input::-webkit-slider-thumb:hover,
1108
- input[type="range"]:hover::-webkit-slider-thumb {
1109
- background: var(--color-solid-hover);
1110
- transform: scale(1.1);
1111
- }
1112
-
1113
- .input-range::-webkit-slider-thumb:active,
1114
- .slider-input::-webkit-slider-thumb:active,
1115
- input[type="range"]:active::-webkit-slider-thumb {
1116
- background: var(--color-solid-hover);
1117
- transform: scale(1.2);
1118
- }
1119
-
1120
- .input-range:focus::-webkit-slider-thumb,
1121
- .slider-input:focus::-webkit-slider-thumb,
1122
- input[type="range"]:focus::-webkit-slider-thumb {
1123
- background: var(--color-solid);
1124
- outline: none;
1125
- box-shadow: none;
1126
- }
1127
-
1128
- .input-range:focus:hover::-webkit-slider-thumb,
1129
- .slider-input:focus:hover::-webkit-slider-thumb,
1130
- input[type="range"]:focus:hover::-webkit-slider-thumb {
1131
- background: var(--color-solid-hover);
1132
- outline: none;
1133
- box-shadow: none;
1134
- }
1135
-
1136
- .input-range:focus:active::-webkit-slider-thumb,
1137
- .slider-input:focus:active::-webkit-slider-thumb,
1138
- input[type="range"]:focus:active::-webkit-slider-thumb {
1139
- background: var(--color-solid-hover);
1140
- outline: none;
1141
- box-shadow: none;
1142
- }
1143
-
1144
- .input-range::-moz-range-thumb,
1145
- .slider-input::-moz-range-thumb,
1146
- input[type="range"]::-moz-range-thumb {
1147
- width: 1.167em;
1148
- height: 1.167em;
1149
- border: none;
1150
- border-radius: 50%;
1151
- background: var(--color-solid);
1152
- cursor: pointer;
1153
- transition: background 0.12s, transform 0.12s;
1154
- }
1155
-
1156
- .input-range::-moz-range-thumb:hover,
1157
- .slider-input::-moz-range-thumb:hover,
1158
- input[type="range"]:hover::-moz-range-thumb {
1159
- background: var(--color-solid-hover);
1160
- transform: scale(1.1);
1161
- }
1162
-
1163
- .input-range::-moz-range-thumb:active,
1164
- .slider-input::-moz-range-thumb:active,
1165
- input[type="range"]:active::-moz-range-thumb {
1166
- background: var(--color-solid-hover);
1167
- transform: scale(1.2);
1168
- }
1169
-
1170
- .input-range:focus::-moz-range-thumb,
1171
- .slider-input:focus::-moz-range-thumb,
1172
- input[type="range"]:focus::-moz-range-thumb {
1173
- background: var(--color-solid);
1174
- outline: none;
1175
- box-shadow: none;
1176
- }
1177
-
1178
- .input-range:focus:hover::-moz-range-thumb,
1179
- .slider-input:focus:hover::-moz-range-thumb,
1180
- input[type="range"]:focus:hover::-moz-range-thumb {
1181
- background: var(--color-solid-hover);
1182
- outline: none;
1183
- box-shadow: none;
1184
- }
1185
-
1186
- .input-range:focus:active::-moz-range-thumb,
1187
- .slider-input:focus:active::-moz-range-thumb,
1188
- input[type="range"]:focus:active::-moz-range-thumb {
1189
- background: var(--color-solid-hover);
1190
- outline: none;
1191
- box-shadow: none;
1192
- }
1193
-
1194
- .input-range:disabled,
1195
- .slider-input:disabled,
1196
- input[type="range"]:disabled {
1197
- opacity: 0.5;
1198
- cursor: not-allowed;
1199
- }
1200
-
1201
- .input-range:disabled::-webkit-slider-thumb,
1202
- .slider-input:disabled::-webkit-slider-thumb,
1203
- input[type="range"]:disabled::-webkit-slider-thumb {
1204
- cursor: not-allowed;
1205
- }
1206
-
1207
- .input-range:disabled::-moz-range-thumb,
1208
- .slider-input:disabled::-moz-range-thumb,
1209
- input[type="range"]:disabled::-moz-range-thumb {
1210
- cursor: not-allowed;
1211
- }
1212
-
1213
- .value-label {
1214
- min-width: 14px;
1215
- text-align: center;
1216
- font-size: 12px;
1217
- color: var(--color-text-muted);
1218
- font-weight: 500;
1219
- font-variant-numeric: tabular-nums;
1220
- pointer-events: none;
1221
- user-select: none;
1222
- }
1223
-
1224
- .reset-btn {
1225
- width: 1.333em;
1226
- height: 1.333em;
1227
- border: none;
1228
- border-radius: var(--reset-btn-border-radius);
1229
- cursor: pointer;
1230
- display: flex;
1231
- align-items: center;
1232
- justify-content: center;
1233
- background: var(--reset-btn-bg);
1234
- color: var(--reset-btn-color);
1235
- transition: var(--reset-btn-transition);
1236
- flex-shrink: 0;
1237
- }
1238
-
1239
- .reset-btn:hover {
1240
- background: var(--reset-btn-bg-hover);
1241
- color: var(--reset-btn-color-hover);
1242
- }
1243
-
1244
- .clear-btn {
1245
- width: 1.333em;
1246
- height: 1.333em;
1247
- border: none;
1248
- border-radius: var(--clear-btn-border-radius);
1249
- cursor: pointer;
1250
- display: flex;
1251
- align-items: center;
1252
- justify-content: center;
1253
- background: var(--clear-btn-bg);
1254
- color: var(--clear-btn-color);
1255
- transition: var(--clear-btn-transition);
1256
- flex-shrink: 0;
1257
- }
1258
-
1259
- .clear-btn:hover {
1260
- background: var(--clear-btn-bg-hover);
1261
- color: var(--clear-btn-color-hover);
1262
- }
1263
-
1264
-
1265
-
1266
- .input-range,
1267
- .slider-input,
1268
- input[type="range"] {
1269
- height: 0.333em;
1270
- }
1271
-
1272
- .input-range::-webkit-slider-thumb,
1273
- .slider-input::-webkit-slider-thumb,
1274
- input[type="range"]::-webkit-slider-thumb {
1275
- width: 1.167em;
1276
- height: 1.167em;
1277
- }
1278
-
1279
- .input-range::-moz-range-thumb,
1280
- .slider-input::-moz-range-thumb,
1281
- input[type="range"]::-moz-range-thumb {
1282
- width: 1.167em;
1283
- height: 1.167em;
1284
- }
1285
-
1286
- .value-label {
1287
- font-size: 1em;
1288
- }
1289
-
1290
- .value-input {
1291
- width: 56px;
1292
- padding: 0 4px;
1293
- height: 22px;
1294
- border: 1px solid var(--border-subtle);
1295
- border-radius: 4px;
1296
- background: transparent;
1297
- color: var(--color-text);
1298
- font-size: 12px;
1299
- text-align: center;
1300
- outline: none;
1301
- flex-shrink: 0;
1302
- }
1303
-
1304
- .value-input:focus {
1305
- border-color: var(--color-solid);
1306
- }
1307
-
1308
- .value-input:disabled {
1309
- opacity: 0.4;
1310
- cursor: not-allowed;
1311
- }
1312
-
1313
- :host([tracked]) .input-range,
1314
- :host([tracked]) .slider-input,
1315
- :host([tracked]) input[type="range"] {
1316
- background: linear-gradient(
1317
- to right,
1318
- var(--color-solid) var(--fill-pct, 0%),
1319
- var(--border-subtle) var(--fill-pct, 0%)
1320
- );
1321
- }
1322
-
1323
- .range-wrapper {
1324
- flex: 1;
1325
- min-width: 0;
1326
- display: flex;
1327
- flex-direction: column;
1328
- position: relative; /* marks-container positions against this */
1329
- }
1330
-
1331
- .range-wrapper input[type="range"] {
1332
- width: 100%;
1333
- flex: none;
1334
- }
1335
-
1336
- /* Marks are absolutely positioned so they don't affect range-wrapper's layout height */
1337
- .marks-container {
1338
- position: absolute;
1339
- top: 100%;
1340
- left: 7px; /* inset by half thumb so 0%/100% align with track ends */
1341
- right: 7px;
1342
- height: 18px;
1343
- margin-top: 2px;
1344
- overflow: visible;
1345
- }
1346
-
1347
- .mark {
1348
- position: absolute;
1349
- transform: translateX(-50%);
1350
- display: flex;
1351
- flex-direction: column;
1352
- align-items: center;
1353
- gap: 2px;
1354
- pointer-events: none;
1355
- user-select: none;
1356
- }
1357
-
1358
- .mark::before {
1359
- content: '';
1360
- display: block;
1361
- width: 1px;
1362
- height: 4px;
1363
- background: var(--border-default, var(--border-subtle));
1364
- border-radius: 1px;
1365
- }
1366
-
1367
- .mark-label {
1368
- font-size: 10px;
1369
- color: var(--color-text-muted);
1370
- white-space: nowrap;
1371
- }
1372
-
1373
- /* When marks are active, add padding-bottom to make room for the absolute-positioned marks */
1374
- :host([marks]) .range-container {
1375
- padding-bottom: 24px; /* marks-container height (18px) + margin-top (2px) + extra (4px) */
1376
- height: auto;
1377
- }
1378
- `;
1379
- var __create$b = Object.create;
1380
- var __defProp$b = Object.defineProperty;
1381
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
1382
- var __knownSymbol$b = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
1383
- var __typeError$b = (msg) => {
1384
- throw TypeError(msg);
1385
- };
1386
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1387
- var __decoratorStart$b = (base) => [, , , __create$b((base == null ? void 0 : base[__knownSymbol$b("metadata")]) ?? null)];
1388
- var __decoratorStrings$b = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
1389
- var __expectFn$b = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$b("Function expected") : fn;
1390
- var __decoratorContext$b = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$b[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$b("Already initialized") : fns.push(__expectFn$b(fn || null)) });
1391
- var __decoratorMetadata$b = (array, target) => __defNormalProp$b(target, __knownSymbol$b("metadata"), array[3]);
1392
- var __runInitializers$b = (array, flags, self, value) => {
1393
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
1394
- return value;
1395
- };
1396
- var __decorateElement$b = (array, flags, name, decorators, target, extra) => {
1397
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
1398
- var j = array.length + 1, key = __decoratorStrings$b[k + 5];
1399
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
1400
- var desc = (target = target.prototype, __getOwnPropDesc$a({ get [name]() {
1401
- return __privateGet$a(this, extra);
1402
- }, set [name](x) {
1403
- return __privateSet$a(this, extra, x);
1404
- } }, name));
1405
- for (var i = decorators.length - 1; i >= 0; i--) {
1406
- ctx = __decoratorContext$b(k, name, done = {}, array[3], extraInitializers);
1407
- {
1408
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
1409
- access.get = (x) => x[name];
1410
- access.set = (x, y) => x[name] = y;
1411
- }
1412
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
1413
- if (it === void 0) __expectFn$b(it) && (desc[key] = it);
1414
- else if (typeof it !== "object" || it === null) __typeError$b("Object expected");
1415
- else __expectFn$b(fn = it.get) && (desc.get = fn), __expectFn$b(fn = it.set) && (desc.set = fn), __expectFn$b(fn = it.init) && initializers.unshift(fn);
1416
- }
1417
- return desc && __defProp$b(target, name, desc), target;
1418
- };
1419
- var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
1420
- var __accessCheck$a = (obj, member, msg) => member.has(obj) || __typeError$b("Cannot " + msg);
1421
- var __privateGet$a = (obj, member, getter) => (__accessCheck$a(obj, member, "read from private field"), member.get(obj));
1422
- var __privateAdd$a = (obj, member, value) => member.has(obj) ? __typeError$b("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
1423
- var __privateSet$a = (obj, member, value, setter) => (__accessCheck$a(obj, member, "write to private field"), member.set(obj, value), value);
1424
- var _marks_dec, _tracked_dec, _editable_dec, _step_dec, _max_dec, _min_dec, _percentage_dec, _options_dec, _a$b, _init$b, _options, _percentage, _min, _max, _step, _editable, _tracked, _marks;
1425
- class Slider extends (_a$b = AeicoField, _options_dec = [aeico.prop({ type: Array })], _percentage_dec = [aeico.prop({ type: Boolean })], _min_dec = [aeico.prop({ type: Number })], _max_dec = [aeico.prop({ type: Number })], _step_dec = [aeico.prop({ type: Number })], _editable_dec = [aeico.prop({ type: Boolean })], _tracked_dec = [aeico.prop({ type: Boolean })], _marks_dec = [aeico.prop({
1426
- type: Array,
1427
- // bare attribute (<ae-slider marks>) → true; JSON array → MarkItem[]
1428
- parser: (value) => {
1429
- if (value === null) return void 0;
1430
- if (value === "" || value === "true") return true;
1431
- if (value === "false") return false;
1432
- try {
1433
- return JSON.parse(value);
1434
- } catch {
1435
- return true;
1436
- }
1437
- }
1438
- })], _a$b) {
1439
- constructor() {
1440
- super();
1441
- __publicField$b(this, "fieldElement", null);
1442
- __publicField$b(this, "_valueLabel", null);
1443
- __publicField$b(this, "_numberInput", null);
1444
- __publicField$b(this, "_boundOnRangeInput");
1445
- __publicField$b(this, "_boundOnNumberInput");
1446
- __privateAdd$a(this, _options, __runInitializers$b(_init$b, 8, this, [])), __runInitializers$b(_init$b, 11, this);
1447
- __privateAdd$a(this, _percentage, __runInitializers$b(_init$b, 12, this, false)), __runInitializers$b(_init$b, 15, this);
1448
- __privateAdd$a(this, _min, __runInitializers$b(_init$b, 16, this, 0)), __runInitializers$b(_init$b, 19, this);
1449
- __privateAdd$a(this, _max, __runInitializers$b(_init$b, 20, this, 100)), __runInitializers$b(_init$b, 23, this);
1450
- __privateAdd$a(this, _step, __runInitializers$b(_init$b, 24, this, 1)), __runInitializers$b(_init$b, 27, this);
1451
- __privateAdd$a(this, _editable, __runInitializers$b(_init$b, 28, this, false)), __runInitializers$b(_init$b, 31, this);
1452
- __privateAdd$a(this, _tracked, __runInitializers$b(_init$b, 32, this, false)), __runInitializers$b(_init$b, 35, this);
1453
- __privateAdd$a(this, _marks, __runInitializers$b(_init$b, 36, this)), __runInitializers$b(_init$b, 39, this);
1454
- this._boundOnRangeInput = this._onRangeInput.bind(this);
1455
- this._boundOnNumberInput = this._onNumberInput.bind(this);
1456
- }
1457
- _normalizeOptions() {
1458
- if (!Array.isArray(this.options) || this.options.length === 0) return null;
1459
- const opts = this.options.map(
1460
- (opt) => this._isSliderOption(opt) ? { label: opt.label, value: String(opt.value) } : { label: String(opt), value: String(opt) }
1461
- );
1462
- const allNumeric = opts.every((o) => o.value !== "" && !isNaN(Number(o.value)));
1463
- if (allNumeric) {
1464
- return [...opts].sort((a, b) => Number(a.value) - Number(b.value)).map((o) => ({ ...o, rangeValue: Number(o.value) }));
1465
- } else {
1466
- return opts.map((o, i) => ({ ...o, rangeValue: i }));
1467
- }
1468
- }
1469
- _getRangeAttrs(normalized) {
1470
- if (normalized && normalized.length >= 1) {
1471
- const vals = normalized.map((o) => o.rangeValue);
1472
- const min = Math.min(...vals);
1473
- const max = Math.max(...vals);
1474
- const sorted = [...vals].sort((a, b) => a - b);
1475
- let minGap = Infinity;
1476
- for (let i = 1; i < sorted.length; i++) {
1477
- const d = sorted[i] - sorted[i - 1];
1478
- if (d > 0 && d < minGap) minGap = d;
1479
- }
1480
- return {
1481
- min: String(min),
1482
- max: String(max),
1483
- step: minGap === Infinity ? "1" : String(minGap),
1484
- inOptionsMode: true
1485
- };
1486
- }
1487
- return {
1488
- min: String(this.min),
1489
- max: String(this.max),
1490
- step: String(this.step),
1491
- inOptionsMode: false
1492
- };
1493
- }
1494
- _toRangeValue(value, normalized) {
1495
- if (value == null || value === "") return "";
1496
- if (normalized) {
1497
- const found = normalized.find((o) => o.value === value);
1498
- return found !== void 0 ? String(found.rangeValue) : "";
1499
- }
1500
- return value;
1501
- }
1502
- _fromRangeValue(rv, normalized) {
1503
- var _a2, _b;
1504
- if (normalized) {
1505
- const n = Number(rv);
1506
- return ((_a2 = normalized.find((o) => o.rangeValue === n)) == null ? void 0 : _a2.value) ?? ((_b = normalized[0]) == null ? void 0 : _b.value) ?? rv;
1507
- }
1508
- return rv;
1509
- }
1510
- _displayLabel(value, normalized) {
1511
- var _a2;
1512
- if (value == null || value === "") return "";
1513
- const label = normalized ? ((_a2 = normalized.find((o) => o.value === value)) == null ? void 0 : _a2.label) ?? value : value;
1514
- return this.percentage ? `${label}%` : label;
1515
- }
1516
- _maxValueLabelWidth(normalized, attrs) {
1517
- const candidates = normalized ? normalized.map((o) => this._displayLabel(o.value, normalized)) : [this._displayLabel(attrs.min, null), this._displayLabel(attrs.max, null)];
1518
- const maxLen = Math.max(...candidates.map((l) => l.length), 1);
1519
- return `${maxLen}ch`;
1520
- }
1521
- _updateTrackFill() {
1522
- if (!this.tracked || !this.fieldElement) return;
1523
- const min = Number(this.fieldElement.min);
1524
- const max = Number(this.fieldElement.max);
1525
- const val = Number(this.fieldElement.value);
1526
- const range = max - min || 1;
1527
- const pct = Math.max(0, Math.min(100, (val - min) / range * 100));
1528
- this.style.setProperty("--fill-pct", `${pct}%`);
1529
- }
1530
- _getMarksData(normalized, attrs) {
1531
- const minVal = Number(attrs.min);
1532
- const maxVal = Number(attrs.max);
1533
- const range = maxVal - minVal || 1;
1534
- const marks = this.marks;
1535
- if (Array.isArray(marks)) {
1536
- const result = [];
1537
- for (const m of marks) {
1538
- const isObj = m !== null && typeof m === "object";
1539
- const numVal = isObj ? m.value : m;
1540
- if (numVal < minVal || numVal > maxVal) continue;
1541
- const rawLabel = isObj ? m.label ?? String(numVal) : String(numVal);
1542
- result.push({
1543
- value: String(numVal),
1544
- label: this.percentage ? `${rawLabel}%` : rawLabel,
1545
- pct: (numVal - minVal) / range * 100
1546
- });
1547
- }
1548
- return result;
1549
- }
1550
- if (normalized) {
1551
- return normalized.map((o) => ({
1552
- value: o.value,
1553
- label: this.percentage ? `${o.label}%` : o.label,
1554
- pct: (o.rangeValue - minVal) / range * 100
1555
- }));
1556
- }
1557
- return [
1558
- { value: attrs.min, label: this.percentage ? `${minVal}%` : String(minVal), pct: 0 },
1559
- { value: attrs.max, label: this.percentage ? `${maxVal}%` : String(maxVal), pct: 100 }
1560
- ];
1561
- }
1562
- writeValue(value) {
1563
- const normalized = this._normalizeOptions();
1564
- const rv = this._toRangeValue(value, normalized);
1565
- if (this.fieldElement && rv !== "" && this.fieldElement.value !== rv) {
1566
- this.fieldElement.value = rv;
1567
- }
1568
- if (this._valueLabel) {
1569
- this._valueLabel.textContent = this._displayLabel(value, normalized);
1570
- }
1571
- if (this._numberInput && !normalized && this._numberInput.value !== rv) {
1572
- this._numberInput.value = rv;
1573
- }
1574
- this._updateTrackFill();
1575
- }
1576
- getValue() {
1577
- if (!this.fieldElement) return "";
1578
- return this._fromRangeValue(this.fieldElement.value, this._normalizeOptions());
1579
- }
1580
- render() {
1581
- const normalized = this._normalizeOptions();
1582
- const attrs = this._getRangeAttrs(normalized);
1583
- return aeico.html(({ div, input, span }) => {
1584
- div({ className: "range-container" }, () => {
1585
- div({ key: "range-wrapper", className: "range-wrapper" }, () => {
1586
- this.fieldElement = input({
1587
- key: "range",
1588
- type: "range",
1589
- min: attrs.min,
1590
- max: attrs.max,
1591
- step: attrs.step,
1592
- "@input": this._boundOnRangeInput,
1593
- "@change": this.boundOnChange
1594
- });
1595
- if (this.marks) {
1596
- const marksData = this._getMarksData(normalized, attrs);
1597
- div({ key: "marks", className: "marks-container" }, () => {
1598
- for (const m of marksData) {
1599
- aeico.tags.span(
1600
- {
1601
- key: `mark-${m.value}`,
1602
- className: "mark",
1603
- style: { left: `${m.pct}%` }
1604
- },
1605
- () => {
1606
- aeico.tags.span({ className: "mark-label", textContent: m.label });
1607
- }
1608
- );
1609
- }
1610
- });
1611
- }
1612
- });
1613
- this._valueLabel = span({
1614
- key: "label",
1615
- className: "value-label",
1616
- style: { minWidth: this._maxValueLabelWidth(normalized, attrs) },
1617
- textContent: this._displayLabel(this.value, normalized)
1618
- });
1619
- this.renderActionButtons();
1620
- if (this.editable) {
1621
- this._numberInput = input({
1622
- key: "number",
1623
- type: "number",
1624
- className: "value-input",
1625
- min: attrs.min,
1626
- max: attrs.max,
1627
- step: attrs.step,
1628
- // Disabled in options mode: valid values are discrete, free text makes no sense
1629
- disabled: attrs.inOptionsMode,
1630
- "@input": this._boundOnNumberInput
1631
- });
1632
- } else {
1633
- this._numberInput = null;
1634
- }
1635
- });
1636
- if (this.value != null) this.writeValue(this.value);
1637
- });
1638
- }
1639
- _onRangeInput() {
1640
- if (!this.fieldElement) return;
1641
- const normalized = this._normalizeOptions();
1642
- const actualValue = this._fromRangeValue(this.fieldElement.value, normalized);
1643
- if (this._valueLabel) {
1644
- this._valueLabel.textContent = this._displayLabel(actualValue, normalized);
1645
- }
1646
- if (this._numberInput && !normalized) {
1647
- this._numberInput.value = this.fieldElement.value;
1648
- }
1649
- this._updateTrackFill();
1650
- }
1651
- _onNumberInput() {
1652
- if (!this._numberInput || !this.fieldElement) return;
1653
- const v = this._numberInput.value;
1654
- if (this.fieldElement.value === v) return;
1655
- this.fieldElement.value = v;
1656
- if (this._valueLabel) {
1657
- this._valueLabel.textContent = this._displayLabel(v, null);
1658
- }
1659
- }
1660
- clear(options) {
1661
- var _a2, _b;
1662
- const normalized = this._normalizeOptions();
1663
- const attrs = this._getRangeAttrs(normalized);
1664
- const clearTo = normalized ? ((_a2 = normalized.find((o) => String(o.rangeValue) === attrs.min)) == null ? void 0 : _a2.value) ?? ((_b = normalized[0]) == null ? void 0 : _b.value) ?? attrs.min : attrs.min;
1665
- this.setValue(clearTo, { ...options, action: "clear" });
1666
- }
1667
- _isSliderOption(opt) {
1668
- return opt !== null && typeof opt === "object" && "label" in opt && "value" in opt;
1669
- }
1670
- }
1671
- _init$b = __decoratorStart$b(_a$b);
1672
- _options = /* @__PURE__ */ new WeakMap();
1673
- _percentage = /* @__PURE__ */ new WeakMap();
1674
- _min = /* @__PURE__ */ new WeakMap();
1675
- _max = /* @__PURE__ */ new WeakMap();
1676
- _step = /* @__PURE__ */ new WeakMap();
1677
- _editable = /* @__PURE__ */ new WeakMap();
1678
- _tracked = /* @__PURE__ */ new WeakMap();
1679
- _marks = /* @__PURE__ */ new WeakMap();
1680
- __decorateElement$b(_init$b, 4, "options", _options_dec, Slider, _options);
1681
- __decorateElement$b(_init$b, 4, "percentage", _percentage_dec, Slider, _percentage);
1682
- __decorateElement$b(_init$b, 4, "min", _min_dec, Slider, _min);
1683
- __decorateElement$b(_init$b, 4, "max", _max_dec, Slider, _max);
1684
- __decorateElement$b(_init$b, 4, "step", _step_dec, Slider, _step);
1685
- __decorateElement$b(_init$b, 4, "editable", _editable_dec, Slider, _editable);
1686
- __decorateElement$b(_init$b, 4, "tracked", _tracked_dec, Slider, _tracked);
1687
- __decorateElement$b(_init$b, 4, "marks", _marks_dec, Slider, _marks);
1688
- __decoratorMetadata$b(_init$b, Slider);
1689
- __publicField$b(Slider, "tagName", "slider");
1690
- __publicField$b(Slider, "styles", [styleVariables, sizeCSS, colorCSS, style$8]);
1691
- Slider.register();
1692
- const styles$1 = ":host {\n display: block;\n flex: 1;\n min-width: 0;\n font-size: var(--size-base);\n\n /* Layout */\n --checkbox-field-gap: 4px;\n\n /* Checkbox */\n --checkbox-size: 1.167em;\n --checkbox-border-width: 1px;\n --checkbox-border-radius: 2px;\n --checkbox-border-color: var(--border-subtle);\n --checkbox-bg: var(--surface-base);\n --checkbox-accent-color: var(--color-solid);\n\n /* Default color when no [color] attribute — overridden by color.css :host([color=...]) */\n --color-solid: var(--color-primary);\n}\n\n.checkbox-container {\n display: flex;\n align-items: center;\n gap: var(--checkbox-field-gap);\n width: 100%;\n}\n\n.checkbox-wrapper {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.field-input {\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n cursor: pointer;\n border: var(--checkbox-border-width) solid var(--checkbox-border-color);\n border-radius: var(--checkbox-border-radius);\n background: var(--checkbox-bg);\n accent-color: var(--checkbox-accent-color);\n margin: 0;\n flex-shrink: 0;\n}\n\n.field-input:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* action buttons */\n.reset-btn,\n.clear-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--reset-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.reset-btn:hover {\n background: var(--reset-btn-bg-hover);\n color: var(--reset-btn-color-hover);\n}\n\n.clear-btn:hover {\n background: var(--clear-btn-bg-hover);\n color: var(--clear-btn-color-hover);\n}\n";
1693
- class Checkbox extends AeicoField {
1694
- constructor() {
1695
- super(...arguments);
1696
- __publicField(this, "fieldElement", null);
1697
- }
1698
- getValue() {
1699
- var _a2;
1700
- return ((_a2 = this.fieldElement) == null ? void 0 : _a2.checked) ?? false;
1701
- }
1702
- writeValue(checked) {
1703
- if (this.fieldElement) {
1704
- this.fieldElement.checked = Boolean(checked);
1705
- }
1706
- }
1707
- getEventPayload(checked, oldChecked, action) {
1708
- return { checked, oldChecked, action };
1709
- }
1710
- setValue(checked, options) {
1711
- const oldChecked = this.getValue();
1712
- this.checked = checked;
1713
- this.writeValue(checked);
1714
- if ((options == null ? void 0 : options.silent) === false) {
1715
- this.emit("change", {
1716
- detail: this.getEventPayload(checked, oldChecked, options.action || "change")
1717
- });
1718
- }
1719
- }
1720
- reset(checked, options) {
1721
- this.setValue(checked !== void 0 ? checked : this.defaultChecked ?? false, {
1722
- ...options,
1723
- action: "reset"
1724
- });
1725
- }
1726
- clear(options) {
1727
- this.setValue(false, { ...options, action: "clear" });
1728
- }
1729
- render() {
1730
- return aeico.html(({ div, input }) => {
1731
- div({ className: "checkbox-container", variant: this.variant }, () => {
1732
- div({ className: "checkbox-wrapper" }, () => {
1733
- this.fieldElement = input({
1734
- type: "checkbox",
1735
- className: "field-input",
1736
- checked: Boolean(this.checked),
1737
- disabled: Boolean(this.disabled),
1738
- "@change": this.boundOnChange
1739
- });
1740
- });
1741
- this.renderActionButtons();
1742
- });
1743
- });
1744
- }
1745
- }
1746
- __publicField(Checkbox, "tagName", "checkbox");
1747
- __publicField(Checkbox, "props", {
1748
- checked: { type: Boolean },
1749
- defaultChecked: { type: Boolean },
1750
- variant: { type: String }
1751
- });
1752
- __publicField(Checkbox, "styles", [styleVariables, sizeCSS, colorCSS, styles$1]);
1753
- Checkbox.register();
1754
- const style$7 = ':host {\n display: inline-flex;\n align-items: center;\n gap: var(--rg-gap, 0.286em);\n font-size: var(--size-m);\n --rg-solid-bg: var(--color-solid);\n --rg-solid-bg-hover: var(--color-solid-hover);\n --rg-solid-bg-active: var(--color-solid-active);\n --rg-solid-color: var(--color-on-solid);\n --rg-solid-color-hover: var(--color-on-solid-hover, var(--color-on-solid));\n --rg-border: var(--color-border);\n --rg-border-hover: var(--color-border-hover);\n --rg-accent: var(--color-accent);\n --rg-accent-hover: var(--color-accent-hover);\n --rg-subtle-bg: var(--color-subtle);\n --rg-subtle-bg-hover: var(--color-subtle-hover);\n\n --rg-font-size: 1em;\n --rg-height: 2.286em;\n --rg-padding: 0.429em 1.071em;\n --rg-min-width: 4.571em;\n --rg-radius: 4px;\n --rg-font-weight: 400;\n\n --color-unselected: var(--surface-base);\n --color-unselected-hover: var(--color-gray-lighter);\n}\n\n:host([size="xs"]) { --rg-radius: 3px; }\n:host([size="sm"]) { --rg-radius: 3px; }\n\n.rg-container {\n display: inline-flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 6px;\n}\n\nslot {\n display: none;\n}\n\n.rg-radio-option {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n font-size: var(--rg-font-size);\n color: var(--color-text-main);\n user-select: none;\n}\n\n.rg-radio-input {\n width: 14px;\n height: 14px;\n accent-color: var(--rg-solid-bg, var(--color-primary));\n cursor: pointer;\n margin: 0;\n flex-shrink: 0;\n}\n\n.rg-radio-label {\n line-height: 1.5;\n}\n\n.rg-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-family: inherit;\n font-size: var(--rg-font-size);\n font-weight: 400;\n height: var(--rg-height);\n padding: var(--rg-padding);\n min-width: var(--rg-min-width);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;\n outline: none;\n border-radius: var(--rg-radius);\n\n background: var(--color-unselected);\n border: 1px solid var(--color-gray-light);\n color: var(--color-text-muted);\n}\n\n.rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--color-unselected-hover);\n border-color: var(--color-gray-light);\n color: var(--color-text-main);\n}\n\n.rg-btn.selected {\n background: var(--rg-solid-bg);\n border-color: var(--rg-solid-bg);\n color: var(--rg-solid-color);\n font-weight: 500;\n box-shadow: 0 1px 4px rgb(from black r g b / 0.22);\n}\n\n.rg-btn.selected:hover:not(:disabled) {\n background: var(--rg-solid-bg-hover);\n border-color: var(--rg-solid-bg-hover);\n}\n\n.rg-btn:active:not(:disabled):not(.selected) {\n background: var(--rg-subtle-bg-hover);\n transform: translateY(1px);\n}\n\n.rg-btn:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n:host([variant="outlined"]) .rg-btn {\n background: transparent;\n border-color: var(--rg-border);\n color: var(--rg-accent);\n}\n:host([variant="outlined"]) .rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--rg-subtle-bg);\n border-color: var(--rg-accent);\n color: var(--rg-accent-hover);\n}\n:host([variant="outlined"]) .rg-btn.selected {\n background: var(--rg-solid-bg);\n border-color: var(--rg-solid-bg);\n color: var(--rg-solid-color);\n}\n\n:host([variant="subtle"]) .rg-btn {\n background: transparent;\n border-color: transparent;\n color: var(--rg-accent);\n}\n:host([variant="subtle"]) .rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--rg-subtle-bg);\n border-color: transparent;\n color: var(--rg-accent-hover);\n}\n:host([variant="subtle"]) .rg-btn.selected {\n background: var(--rg-subtle-bg-hover);\n border-color: transparent;\n color: var(--rg-accent-hover);\n font-weight: 600;\n box-shadow: none;\n}\n\n:host([variant="filled"]) .rg-btn:not(.selected) {\n background: var(--surface-base);\n border-color: var(--border-default);\n color: var(--color-text-muted);\n}\n\n:host([variant="filled"]) .rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--surface-raised);\n border-color: var(--border-hover);\n color: var(--color-text-main);\n}\n\n:host([mode="button"]) .rg-container {\n gap: 6px;\n}\n\n:host([mode="button-group"]) .rg-container {\n gap: 0;\n}\n\n:host([mode="button-group"]) .rg-btn:not(.first):not(.only) {\n margin-left: -1px;\n}\n\n:host([mode="button-group"]) .rg-btn.first {\n border-radius: var(--rg-radius) 0 0 var(--rg-radius);\n}\n:host([mode="button-group"]) .rg-btn.inner {\n border-radius: 0;\n}\n:host([mode="button-group"]) .rg-btn.last {\n border-radius: 0 var(--rg-radius) var(--rg-radius) 0;\n}\n:host([mode="button-group"]) .rg-btn.only {\n border-radius: var(--rg-radius);\n}\n\n:host([mode="button-group"]) .rg-btn:hover:not(:disabled),\n:host([mode="button-group"]) .rg-btn.selected {\n position: relative;\n z-index: 1;\n}\n\n:host([mode="segmented"]) .rg-container {\n gap: 2px;\n background: var(--surface-raised);\n border: 1px solid var(--border-subtle);\n border-radius: calc(var(--rg-radius) + 2px);\n padding: 2px;\n flex-wrap: nowrap;\n}\n\n:host([mode="segmented"]) .rg-btn {\n background: transparent;\n border-color: transparent;\n color: var(--color-text-muted);\n border-radius: var(--rg-radius);\n min-width: var(--rg-min-width);\n box-shadow: none;\n font-weight: 400;\n}\n\n:host([mode="segmented"]) .rg-btn:hover:not(:disabled):not(.selected) {\n background: var(--rg-subtle-bg);\n border-color: transparent;\n color: var(--color-text-secondary, var(--color-text-main));\n}\n\n:host([mode="segmented"]) .rg-btn.selected {\n background: var(--rg-solid-bg);\n border-color: transparent;\n color: var(--rg-solid-color);\n font-weight: 500;\n box-shadow: 0 1px 4px rgb(from black r g b / 0.35);\n}\n\n:host([mode="segmented"]) .rg-btn.selected:hover:not(:disabled) {\n background: var(--rg-solid-bg-hover);\n}\n\n:host([mode="segmented"]:not([color])) .rg-btn.selected {\n background: var(--color-gray-lighter);\n color: var(--color-text-main);\n}\n\n:host([mode="segmented"][variant="outlined"]) .rg-container {\n border-color: var(--rg-border);\n}\n:host([mode="segmented"][variant="outlined"]) .rg-btn.selected {\n background: var(--rg-solid-bg);\n border-color: transparent;\n color: var(--rg-solid-color);\n}\n\n.reset-btn,\n.clear-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n font-family: inherit;\n padding: 0;\n\n width: 1.333em;\n height: 1.333em;\n border-radius: var(--reset-btn-border-radius);\n border: none;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n}\n\n.reset-btn:hover { background: var(--reset-btn-bg-hover); color: var(--reset-btn-color-hover); }\n.clear-btn:hover { background: var(--clear-btn-bg-hover); color: var(--clear-btn-color-hover); }\n\n:host([mode="button"]) .reset-btn,\n:host([mode="button"]) .clear-btn,\n:host([mode="button-group"]) .reset-btn,\n:host([mode="button-group"]) .clear-btn,\n:host([mode="segmented"]) .reset-btn,\n:host([mode="segmented"]) .clear-btn {\n height: var(--rg-height);\n width: var(--rg-height);\n border-radius: var(--rg-radius);\n font-size: var(--rg-font-size);\n}\n\n:host([mode="button"]) .reset-btn,\n:host([mode="button"]) .clear-btn,\n:host([mode="button-group"]) .reset-btn,\n:host([mode="button-group"]) .clear-btn,\n:host([mode="segmented"]) .reset-btn,\n:host([mode="segmented"]) .clear-btn {\n background: transparent;\n border: 1px solid var(--color-gray-light);\n color: var(--color-text-muted);\n}\n\n:host([mode="button"]) .reset-btn:hover,\n:host([mode="button-group"]) .reset-btn:hover,\n:host([mode="segmented"]) .reset-btn:hover {\n background: var(--border-subtle);\n border-color: var(--color-gray-lighter);\n color: var(--color-text-main);\n}\n\n:host([mode="button"]) .clear-btn:hover,\n:host([mode="button-group"]) .clear-btn:hover,\n:host([mode="segmented"]) .clear-btn:hover {\n background: rgb(from var(--red) r g b / 0.10);\n border-color: var(--color-gray-lighter);\n color: var(--color-danger);\n}\n\n:host([variant="outlined"][mode="button"]) .reset-btn,\n:host([variant="outlined"][mode="button"]) .clear-btn,\n:host([variant="outlined"][mode="button-group"]) .reset-btn,\n:host([variant="outlined"][mode="button-group"]) .clear-btn,\n:host([variant="outlined"][mode="segmented"]) .reset-btn,\n:host([variant="outlined"][mode="segmented"]) .clear-btn {\n background: transparent;\n border-color: var(--rg-border);\n color: var(--rg-accent);\n}\n\n:host([variant="outlined"][mode="button"]) .reset-btn:hover,\n:host([variant="outlined"][mode="button-group"]) .reset-btn:hover,\n:host([variant="outlined"][mode="segmented"]) .reset-btn:hover {\n background: var(--border-subtle);\n border-color: var(--rg-border-hover);\n color: var(--rg-accent-hover);\n}\n\n:host([variant="outlined"][mode="button"]) .clear-btn:hover,\n:host([variant="outlined"][mode="button-group"]) .clear-btn:hover,\n:host([variant="outlined"][mode="segmented"]) .clear-btn:hover {\n background: rgb(from var(--red) r g b / 0.10);\n border-color: var(--rg-border-hover);\n color: var(--color-danger);\n}\n\n:host([variant="subtle"][mode="button"]) .reset-btn,\n:host([variant="subtle"][mode="button"]) .clear-btn,\n:host([variant="subtle"][mode="button-group"]) .reset-btn,\n:host([variant="subtle"][mode="button-group"]) .clear-btn,\n:host([variant="subtle"][mode="segmented"]) .reset-btn,\n:host([variant="subtle"][mode="segmented"]) .clear-btn {\n background: transparent;\n border-color: transparent;\n color: var(--rg-accent);\n}\n\n:host([variant="subtle"][mode="button"]) .reset-btn:hover,\n:host([variant="subtle"][mode="button-group"]) .reset-btn:hover,\n:host([variant="subtle"][mode="segmented"]) .reset-btn:hover {\n background: var(--border-subtle);\n border-color: transparent;\n color: var(--rg-accent-hover);\n}\n\n:host([variant="subtle"][mode="button"]) .clear-btn:hover,\n:host([variant="subtle"][mode="button-group"]) .clear-btn:hover,\n:host([variant="subtle"][mode="segmented"]) .clear-btn:hover {\n background: rgb(from var(--red) r g b / 0.10);\n border-color: transparent;\n color: var(--color-danger);\n}\n';
1755
- const _RadioGroup = class _RadioGroup extends AeicoField {
1756
- constructor() {
1757
- super();
1758
- __publicField(this, "fieldElement", null);
1759
- __publicField(this, "_slotEl", null);
1760
- __publicField(this, "_slotOptions", []);
1761
- __publicField(this, "_groupName");
1762
- // Single handler for radio inputs — handles both select and deselect.
1763
- // Only uses `click` (not `change`) because `change` fires before `click`;
1764
- // if we set value in `change`, the `click` handler would see the updated
1765
- // value and immediately deselect.
1766
- __publicField(this, "_boundOnRadioClick", (e) => {
1767
- const input = e.target;
1768
- const current = this.value ?? "";
1769
- if (input.value === current) {
1770
- if (this.allowEmpty) {
1771
- input.checked = false;
1772
- this.setValue("", { silent: false, action: "change" });
1773
- }
1774
- } else {
1775
- this.setValue(input.value, { silent: false, action: "change" });
1776
- }
1777
- });
1778
- __publicField(this, "_boundOnButtonClick", (e) => {
1779
- const btn = e.currentTarget;
1780
- const val = btn.dataset.value ?? "";
1781
- const current = this.value ?? "";
1782
- if (val === current) {
1783
- if (this.allowEmpty) {
1784
- this.setValue("", { silent: false, action: "change" });
1785
- }
1786
- } else {
1787
- this.setValue(val, { silent: false, action: "change" });
1788
- }
1789
- });
1790
- this._groupName = `rg-${++_RadioGroup._instanceCount}`;
1791
- }
1792
- _optLabel(opt) {
1793
- if (opt !== null && typeof opt === "object") {
1794
- return aeicoLocalize.t(String(opt.label), String(opt.label));
1795
- }
1796
- return String(opt);
1797
- }
1798
- _optValue(opt) {
1799
- if (opt !== null && typeof opt === "object") return String(opt.value);
1800
- return String(opt);
1801
- }
1802
- _allOptions() {
1803
- const from_props = (Array.isArray(this.options) ? this.options : []).map((o) => ({
1804
- label: this._optLabel(o),
1805
- value: this._optValue(o)
1806
- }));
1807
- const from_slot = this._slotOptions.map((el) => {
1808
- var _a2;
1809
- return {
1810
- label: ((_a2 = el.textContent) == null ? void 0 : _a2.trim()) || el.value,
1811
- value: el.value,
1812
- disabled: el.disabled
1813
- };
1814
- });
1815
- return [...from_props, ...from_slot];
1816
- }
1817
- _onSlotChange() {
1818
- if (!this._slotEl) return;
1819
- this._slotOptions = this._slotEl.assignedElements({ flatten: true }).filter(
1820
- (el) => el.tagName.toLowerCase() === "ae-radio"
1821
- );
1822
- this.update();
1823
- }
1824
- getValue() {
1825
- return this.value ?? "";
1826
- }
1827
- writeValue(_value2) {
1828
- }
1829
- onReset() {
1830
- this.setValue(this.defaultValue ?? "", { silent: false, action: "reset" });
1831
- }
1832
- onClear() {
1833
- this.setValue("", { silent: false, action: "clear" });
1834
- }
1835
- render() {
1836
- const mode = this.mode || "default";
1837
- const opts = this._allOptions();
1838
- const current = this.value ?? "";
1839
- return aeico.html(({ div, slot }) => {
1840
- div({ className: "rg-container" }, () => {
1841
- if (mode === "default") {
1842
- this._renderRadio(opts, current);
1843
- } else {
1844
- this._renderButtons(opts, current, mode);
1845
- }
1846
- });
1847
- if (this.allowEmpty) this.renderClearButton();
1848
- this.renderResetButton();
1849
- this._slotEl = slot({
1850
- style: { display: "none" },
1851
- "@slotchange": () => this._onSlotChange()
1852
- });
1853
- });
1854
- }
1855
- _renderRadio(opts, current) {
1856
- const { label, input, span } = aeico.tags;
1857
- for (const opt of opts) {
1858
- const isChecked = opt.value === current;
1859
- label({ key: `opt-${opt.value}`, className: "rg-radio-option" }, () => {
1860
- const el = input({
1861
- type: "radio",
1862
- className: "rg-radio-input",
1863
- name: this._groupName,
1864
- value: opt.value,
1865
- disabled: Boolean(this.disabled) || Boolean(opt.disabled),
1866
- "@click": this._boundOnRadioClick
1867
- });
1868
- el.checked = isChecked;
1869
- if (!this.fieldElement) this.fieldElement = el;
1870
- span({ className: "rg-radio-label", textContent: opt.label });
1871
- });
1872
- }
1873
- }
1874
- _renderButtons(opts, current, mode) {
1875
- const { button } = aeico.tags;
1876
- const count = opts.length;
1877
- for (let i = 0; i < count; i++) {
1878
- const opt = opts[i];
1879
- const isSelected = opt.value === current;
1880
- let posClass = "";
1881
- if (mode === "button-group") {
1882
- if (count === 1) posClass = " only";
1883
- else if (i === 0) posClass = " first";
1884
- else if (i === count - 1) posClass = " last";
1885
- else posClass = " inner";
1886
- }
1887
- button({
1888
- key: `opt-${opt.value}`,
1889
- className: `rg-btn${isSelected ? " selected" : ""}${posClass}`,
1890
- textContent: opt.label,
1891
- disabled: Boolean(this.disabled) || Boolean(opt.disabled),
1892
- "data-value": opt.value,
1893
- "@click": this._boundOnButtonClick
1894
- });
1895
- }
1896
- }
1897
- };
1898
- __publicField(_RadioGroup, "_instanceCount", 0);
1899
- __publicField(_RadioGroup, "tagName", "radio-group");
1900
- __publicField(_RadioGroup, "props", {
1901
- options: { type: Array },
1902
- mode: { type: String },
1903
- color: { type: String },
1904
- variant: { type: String },
1905
- size: { type: String },
1906
- allowEmpty: { type: Boolean }
1907
- });
1908
- __publicField(_RadioGroup, "styles", [styleVariables, sizeCSS, colorCSS, style$7]);
1909
- let RadioGroup = _RadioGroup;
1910
- RadioGroup.register();
1911
- class Radio extends AeicoComponent {
1912
- }
1913
- __publicField(Radio, "tagName", "radio");
1914
- /** No shadow DOM — this element is a transparent data/content carrier. */
1915
- __publicField(Radio, "useShadowDOM", false);
1916
- __publicField(Radio, "props", {
1917
- value: { type: String },
1918
- disabled: { type: Boolean }
1919
- });
1920
- Radio.register();
1921
- const styles = ":host {\n display: block;\n font-size: var(--size-base);\n\n --switch-field-gap: 4px;\n\n --toggle-width: 2.667em;\n --toggle-height: 1.333em;\n --toggle-slider-size: 1em;\n --toggle-gap: calc((var(--toggle-height) - var(--toggle-slider-size)) / 2);\n --toggle-border-radius: calc(var(--toggle-height) / 2);\n --toggle-bg: var(--color-gray);\n --toggle-bg-checked: var(--color-solid);\n --toggle-slider-bg: white;\n --toggle-transition: 0.2s;\n\n /* Default color when no [color] attribute — overridden by color.css :host([color=...]) */\n --color-solid: var(--color-primary);\n}\n\n.switch-container {\n display: flex;\n align-items: center;\n gap: var(--switch-field-gap);\n}\n\n.switch-wrapper {\n position: relative;\n display: inline-flex;\n align-items: center;\n width: var(--toggle-width);\n height: var(--toggle-height);\n flex-shrink: 0;\n}\n\n.field-input {\n position: absolute;\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n margin: 0;\n z-index: 1;\n border: none;\n border-radius: 0;\n background: none;\n accent-color: unset;\n}\n\n.field-input:disabled {\n cursor: not-allowed;\n}\n\n.toggle-slider {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--toggle-bg);\n border-radius: var(--toggle-border-radius);\n transition: var(--toggle-transition);\n pointer-events: none;\n}\n\n.toggle-slider::before {\n content: '';\n position: absolute;\n height: var(--toggle-slider-size);\n width: var(--toggle-slider-size);\n left: var(--toggle-gap);\n top: var(--toggle-gap);\n background: var(--toggle-slider-bg);\n border-radius: 50%;\n transition: var(--toggle-transition);\n}\n\n.field-input:checked + .toggle-slider {\n background: var(--toggle-bg-checked);\n}\n\n.field-input:checked + .toggle-slider::before {\n transform: translateX(calc(var(--toggle-width) - var(--toggle-height)));\n}\n\n.field-input:disabled + .toggle-slider {\n opacity: 0.5;\n pointer-events: auto;\n}\n\n/* action buttons */\n.reset-btn,\n.clear-btn {\n width: 1.333em;\n height: 1.333em;\n border: none;\n border-radius: var(--reset-btn-border-radius);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--reset-btn-bg);\n color: var(--reset-btn-color);\n transition: var(--reset-btn-transition);\n flex-shrink: 0;\n line-height: 1;\n}\n\n.reset-btn:hover {\n background: var(--reset-btn-bg-hover);\n color: var(--reset-btn-color-hover);\n}\n\n.clear-btn:hover {\n background: var(--clear-btn-bg-hover);\n color: var(--clear-btn-color-hover);\n}\n";
1922
- class Switch extends AeicoField {
1923
- constructor() {
1924
- super(...arguments);
1925
- __publicField(this, "fieldElement", null);
1926
- }
1927
- getValue() {
1928
- var _a2;
1929
- return ((_a2 = this.fieldElement) == null ? void 0 : _a2.checked) ?? false;
1930
- }
1931
- writeValue(checked) {
1932
- if (this.fieldElement) {
1933
- this.fieldElement.checked = Boolean(checked);
1934
- }
1935
- }
1936
- getEventPayload(checked, oldChecked, action) {
1937
- return { checked, oldChecked, action };
1938
- }
1939
- setValue(checked, options) {
1940
- const oldChecked = this.getValue();
1941
- this.checked = checked;
1942
- this.writeValue(checked);
1943
- if ((options == null ? void 0 : options.silent) === false) {
1944
- this.emit("change", {
1945
- detail: this.getEventPayload(checked, oldChecked, options.action || "change")
1946
- });
1947
- }
1948
- }
1949
- reset(checked, options) {
1950
- this.setValue(checked !== void 0 ? checked : this.defaultChecked ?? false, {
1951
- ...options,
1952
- action: "reset"
1953
- });
1954
- }
1955
- clear(options) {
1956
- this.setValue(false, { ...options, action: "clear" });
1957
- }
1958
- render() {
1959
- return aeico.html(({ div, input, span }) => {
1960
- div({ className: "switch-container" }, () => {
1961
- div({ className: "switch-wrapper" }, () => {
1962
- this.fieldElement = input({
1963
- type: "checkbox",
1964
- className: "field-input",
1965
- checked: Boolean(this.checked),
1966
- disabled: Boolean(this.disabled),
1967
- "@change": this.boundOnChange
1968
- });
1969
- span({ className: "toggle-slider" });
1970
- });
1971
- this.renderActionButtons();
1972
- });
1973
- });
1974
- }
1975
- }
1976
- __publicField(Switch, "tagName", "switch");
1977
- __publicField(Switch, "props", {
1978
- checked: { type: Boolean },
1979
- defaultChecked: { type: Boolean }
1980
- });
1981
- __publicField(Switch, "styles", [styleVariables, sizeCSS, colorCSS, styles]);
1982
- Switch.register();
1983
- const style$6 = ":host {\n display: block;\n}\n\n/* Hide the separator template slot visually */\n.sep-template {\n display: none !important;\n}\n\n.list {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n list-style: none;\n margin: 0;\n padding: 0;\n font-size: inherit;\n line-height: 1.5;\n}\n";
1984
- var __create$a = Object.create;
1985
- var __defProp$a = Object.defineProperty;
1986
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
1987
- var __knownSymbol$a = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
1988
- var __typeError$a = (msg) => {
1989
- throw TypeError(msg);
1990
- };
1991
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1992
- var __decoratorStart$a = (base) => [, , , __create$a((base == null ? void 0 : base[__knownSymbol$a("metadata")]) ?? null)];
1993
- var __decoratorStrings$a = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
1994
- var __expectFn$a = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$a("Function expected") : fn;
1995
- var __decoratorContext$a = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$a[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$a("Already initialized") : fns.push(__expectFn$a(fn || null)) });
1996
- var __decoratorMetadata$a = (array, target) => __defNormalProp$a(target, __knownSymbol$a("metadata"), array[3]);
1997
- var __runInitializers$a = (array, flags, self, value) => {
1998
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
1999
- return value;
2000
- };
2001
- var __decorateElement$a = (array, flags, name, decorators, target, extra) => {
2002
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
2003
- var j = array.length + 1, key = __decoratorStrings$a[k + 5];
2004
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
2005
- var desc = (target = target.prototype, __getOwnPropDesc$9({ get [name]() {
2006
- return __privateGet$9(this, extra);
2007
- }, set [name](x) {
2008
- return __privateSet$9(this, extra, x);
2009
- } }, name));
2010
- for (var i = decorators.length - 1; i >= 0; i--) {
2011
- ctx = __decoratorContext$a(k, name, done = {}, array[3], extraInitializers);
2012
- {
2013
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
2014
- access.get = (x) => x[name];
2015
- access.set = (x, y) => x[name] = y;
2016
- }
2017
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
2018
- if (it === void 0) __expectFn$a(it) && (desc[key] = it);
2019
- else if (typeof it !== "object" || it === null) __typeError$a("Object expected");
2020
- else __expectFn$a(fn = it.get) && (desc.get = fn), __expectFn$a(fn = it.set) && (desc.set = fn), __expectFn$a(fn = it.init) && initializers.unshift(fn);
2021
- }
2022
- return desc && __defProp$a(target, name, desc), target;
2023
- };
2024
- var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
2025
- var __accessCheck$9 = (obj, member, msg) => member.has(obj) || __typeError$a("Cannot " + msg);
2026
- var __privateGet$9 = (obj, member, getter) => (__accessCheck$9(obj, member, "read from private field"), member.get(obj));
2027
- var __privateAdd$9 = (obj, member, value) => member.has(obj) ? __typeError$a("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2028
- var __privateSet$9 = (obj, member, value, setter) => (__accessCheck$9(obj, member, "write to private field"), member.set(obj, value), value);
2029
- var _color_dec$7, _separator_dec, _a$a, _init$a, _separator, _color$6;
2030
- class Breadcrumb extends (_a$a = AeicoComponent, _separator_dec = [aeico.prop({ type: String })], _color_dec$7 = [aeico.prop({ type: String })], _a$a) {
2031
- constructor() {
2032
- super(...arguments);
2033
- __privateAdd$9(this, _separator, __runInitializers$a(_init$a, 8, this, "/")), __runInitializers$a(_init$a, 11, this);
2034
- __privateAdd$9(this, _color$6, __runInitializers$a(_init$a, 12, this)), __runInitializers$a(_init$a, 15, this);
2035
- __publicField$a(this, "_itemsSlot", null);
2036
- __publicField$a(this, "_sepSlot", null);
2037
- __publicField$a(this, "_syncSeparators", () => {
2038
- const items = this._getItems();
2039
- const sepEl = this._getSepElement();
2040
- items.forEach((item, i) => {
2041
- item.querySelectorAll("[data-ae-sep]").forEach((n) => n.remove());
2042
- const isLast = i === items.length - 1;
2043
- if (isLast) {
2044
- item.setAttribute("aria-current", "page");
2045
- } else {
2046
- item.removeAttribute("aria-current");
2047
- }
2048
- if (i === 0) return;
2049
- const wrapper = document.createElement("span");
2050
- wrapper.setAttribute("slot", "separator");
2051
- wrapper.setAttribute("data-ae-sep", "");
2052
- wrapper.setAttribute("aria-hidden", "true");
2053
- if (sepEl) {
2054
- wrapper.appendChild(sepEl.cloneNode(true));
2055
- } else {
2056
- wrapper.textContent = this.separator;
2057
- }
2058
- item.prepend(wrapper);
2059
- });
2060
- });
2061
- }
2062
- render() {
2063
- return aeico.html(({ nav, ol, slot }) => {
2064
- nav({ "aria-label": "breadcrumb", part: "nav" }, () => {
2065
- ol({ part: "list", className: "list" }, () => {
2066
- this._itemsSlot = slot({
2067
- "@slotchange": () => this._syncSeparators()
2068
- });
2069
- });
2070
- });
2071
- this._sepSlot = slot({
2072
- name: "separator",
2073
- className: "sep-template",
2074
- "@slotchange": () => this._syncSeparators()
2075
- });
2076
- });
2077
- }
2078
- onUpdated() {
2079
- this._syncSeparators();
2080
- }
2081
- _getItems() {
2082
- var _a2;
2083
- return ((_a2 = this._itemsSlot) == null ? void 0 : _a2.assignedElements()) ?? [];
2084
- }
2085
- _getSepElement() {
2086
- var _a2;
2087
- return ((_a2 = this._sepSlot) == null ? void 0 : _a2.assignedElements()[0]) ?? null;
2088
- }
2089
- }
2090
- _init$a = __decoratorStart$a(_a$a);
2091
- _separator = /* @__PURE__ */ new WeakMap();
2092
- _color$6 = /* @__PURE__ */ new WeakMap();
2093
- __decorateElement$a(_init$a, 4, "separator", _separator_dec, Breadcrumb, _separator);
2094
- __decorateElement$a(_init$a, 4, "color", _color_dec$7, Breadcrumb, _color$6);
2095
- __decoratorMetadata$a(_init$a, Breadcrumb);
2096
- __publicField$a(Breadcrumb, "tagName", "breadcrumb");
2097
- __publicField$a(Breadcrumb, "styles", [styleVariables, colorCSS, style$6]);
2098
- Breadcrumb.register();
2099
- const style$5 = `:host {
2100
- display: contents;
2101
- }
2102
-
2103
- .item {
2104
- display: inline-flex;
2105
- align-items: center;
2106
- list-style: none;
2107
- white-space: nowrap;
2108
- }
2109
-
2110
- /* Separator — uses a fixed muted color that does NOT follow the breadcrumb's color prop */
2111
- .sep {
2112
- display: inline-flex;
2113
- align-items: center;
2114
- color: var(--color-text-muted);
2115
- padding: 0 0.35em;
2116
- user-select: none;
2117
- pointer-events: none;
2118
- flex-shrink: 0;
2119
- font-size: 0.85em;
2120
- }
2121
-
2122
- /* Hide separator on the first item */
2123
- :host(:first-child) .sep,
2124
- :host(:first-of-type) .sep {
2125
- display: none;
2126
- }
2127
-
2128
- .label {
2129
- display: inline-flex;
2130
- align-items: center;
2131
- color: var(--color-text-muted);
2132
- }
2133
-
2134
- /* Current page — last item */
2135
- :host([aria-current="page"]) .label {
2136
- color: var(--color-text-main);
2137
- font-weight: 500;
2138
- cursor: default;
2139
- }
2140
-
2141
- /* Link items */
2142
- .label a {
2143
- color: var(--color-accent, var(--color-text-link));
2144
- text-decoration: none;
2145
- outline: none;
2146
- }
2147
-
2148
- .label a:hover {
2149
- color: var(--color-accent-hover, var(--color-text-link-hover));
2150
- text-decoration: underline;
2151
- }
2152
-
2153
- .label a:focus-visible {
2154
- outline: 2px solid var(--color-accent, var(--focus-ring-color));
2155
- outline-offset: 2px;
2156
- border-radius: 2px;
2157
- }
2158
- `;
2159
- var __create$9 = Object.create;
2160
- var __defProp$9 = Object.defineProperty;
2161
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
2162
- var __knownSymbol$9 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
2163
- var __typeError$9 = (msg) => {
2164
- throw TypeError(msg);
2165
- };
2166
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2167
- var __decoratorStart$9 = (base) => [, , , __create$9((base == null ? void 0 : base[__knownSymbol$9("metadata")]) ?? null)];
2168
- var __decoratorStrings$9 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
2169
- var __expectFn$9 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$9("Function expected") : fn;
2170
- var __decoratorContext$9 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$9[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$9("Already initialized") : fns.push(__expectFn$9(fn || null)) });
2171
- var __decoratorMetadata$9 = (array, target) => __defNormalProp$9(target, __knownSymbol$9("metadata"), array[3]);
2172
- var __runInitializers$9 = (array, flags, self, value) => {
2173
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
2174
- return value;
2175
- };
2176
- var __decorateElement$9 = (array, flags, name, decorators, target, extra) => {
2177
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
2178
- var j = array.length + 1, key = __decoratorStrings$9[k + 5];
2179
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
2180
- var desc = (target = target.prototype, __getOwnPropDesc$8({ get [name]() {
2181
- return __privateGet$8(this, extra);
2182
- }, set [name](x) {
2183
- return __privateSet$8(this, extra, x);
2184
- } }, name));
2185
- for (var i = decorators.length - 1; i >= 0; i--) {
2186
- ctx = __decoratorContext$9(k, name, done = {}, array[3], extraInitializers);
2187
- {
2188
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
2189
- access.get = (x) => x[name];
2190
- access.set = (x, y) => x[name] = y;
2191
- }
2192
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
2193
- if (it === void 0) __expectFn$9(it) && (desc[key] = it);
2194
- else if (typeof it !== "object" || it === null) __typeError$9("Object expected");
2195
- else __expectFn$9(fn = it.get) && (desc.get = fn), __expectFn$9(fn = it.set) && (desc.set = fn), __expectFn$9(fn = it.init) && initializers.unshift(fn);
2196
- }
2197
- return desc && __defProp$9(target, name, desc), target;
2198
- };
2199
- var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
2200
- var __accessCheck$8 = (obj, member, msg) => member.has(obj) || __typeError$9("Cannot " + msg);
2201
- var __privateGet$8 = (obj, member, getter) => (__accessCheck$8(obj, member, "read from private field"), member.get(obj));
2202
- var __privateAdd$8 = (obj, member, value) => member.has(obj) ? __typeError$9("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2203
- var __privateSet$8 = (obj, member, value, setter) => (__accessCheck$8(obj, member, "write to private field"), member.set(obj, value), value);
2204
- var _href_dec$1, _a$9, _init$9, _href$1;
2205
- class BreadcrumbItem extends (_a$9 = AeicoComponent, _href_dec$1 = [aeico.prop({ type: String })], _a$9) {
2206
- constructor() {
2207
- super(...arguments);
2208
- __privateAdd$8(this, _href$1, __runInitializers$9(_init$9, 8, this)), __runInitializers$9(_init$9, 11, this);
2209
- }
2210
- render() {
2211
- return aeico.html(({ li, span, slot, a }) => {
2212
- li({ part: "item", className: "item" }, () => {
2213
- span({ part: "separator", className: "sep", "aria-hidden": "true" }, () => {
2214
- slot({ name: "separator" });
2215
- });
2216
- span({ part: "label", className: "label" }, () => {
2217
- if (this.href) {
2218
- a({ href: this.href, part: "link" }, () => {
2219
- slot();
2220
- });
2221
- } else {
2222
- slot();
2223
- }
2224
- });
2225
- });
2226
- });
2227
- }
2228
- }
2229
- _init$9 = __decoratorStart$9(_a$9);
2230
- _href$1 = /* @__PURE__ */ new WeakMap();
2231
- __decorateElement$9(_init$9, 4, "href", _href_dec$1, BreadcrumbItem, _href$1);
2232
- __decoratorMetadata$9(_init$9, BreadcrumbItem);
2233
- __publicField$9(BreadcrumbItem, "tagName", "breadcrumb-item");
2234
- __publicField$9(BreadcrumbItem, "styles", [styleVariables, style$5]);
2235
- BreadcrumbItem.register();
2236
- const buttonStyle = `:host {
2237
- display: inline-block;
2238
- --btn-solid-bg: var(--color-solid);
2239
- --btn-solid-bg-hover: var(--color-solid-hover);
2240
- --btn-solid-bg-active: var(--color-solid-active);
2241
- --btn-solid-color: var(--color-on-solid);
2242
- --btn-solid-color-hover: var(--color-on-solid-hover);
2243
- --btn-border: var(--color-border);
2244
- --btn-border-hover: var(--color-border-hover);
2245
- --btn-accent: var(--color-accent);
2246
- --btn-accent-hover: var(--color-accent-hover);
2247
- --btn-subtle-bg: var(--color-subtle);
2248
- --btn-subtle-bg-hover: var(--color-subtle-hover);
2249
- }
2250
-
2251
- button {
2252
- display: inline-flex;
2253
- align-items: center;
2254
- justify-content: center;
2255
- gap: 6px;
2256
- font-family: inherit;
2257
- font-weight: 400;
2258
- text-align: center;
2259
- white-space: nowrap;
2260
- vertical-align: middle;
2261
- user-select: none;
2262
- cursor: pointer;
2263
- transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
2264
- outline: none;
2265
- position: relative;
2266
- padding: 0.429em 1.071em;
2267
- font-size: 1em;
2268
- line-height: 1.5;
2269
- border-radius: var(--_btn-r-tl, 4px) var(--_btn-r-tr, 4px) var(--_btn-r-br, 4px) var(--_btn-r-bl, 4px);
2270
- min-width: 4.571em;
2271
- height: 2.286em;
2272
- width: 100%;
2273
-
2274
- background: var(--btn-solid-bg);
2275
- border: 1px solid var(--btn-solid-bg);
2276
- color: var(--btn-solid-color);
2277
- }
2278
-
2279
- button:focus { outline: none; }
2280
- button:active { transform: translateY(1px); }
2281
-
2282
- button:hover:not(:disabled) {
2283
- background: var(--btn-solid-bg-hover);
2284
- border-color: var(--btn-border-hover);
2285
- color: var(--btn-solid-color-hover, var(--btn-solid-color));
2286
- }
2287
-
2288
- button:active:not(:disabled) { background: var(--btn-solid-bg-active); }
2289
-
2290
- button:disabled {
2291
- opacity: 0.5;
2292
- cursor: not-allowed;
2293
- }
2294
-
2295
- :host([size="xs"]) button { border-radius: var(--_btn-r-tl, 3px) var(--_btn-r-tr, 3px) var(--_btn-r-br, 3px) var(--_btn-r-bl, 3px); }
2296
- :host([size="sm"]) button { border-radius: var(--_btn-r-tl, 3px) var(--_btn-r-tr, 3px) var(--_btn-r-br, 3px) var(--_btn-r-bl, 3px); }
2297
-
2298
- /* --- Variants --- */
2299
-
2300
- :host([variant="outlined"]) button {
2301
- background: transparent;
2302
- border-color: var(--btn-border);
2303
- color: var(--btn-accent);
2304
- }
2305
-
2306
- :host([variant="outlined"]) button:hover:not(:disabled) {
2307
- background: var(--btn-subtle-bg);
2308
- border-color: var(--btn-border-hover);
2309
- color: var(--btn-accent-hover);
2310
- }
2311
-
2312
- :host([variant="outlined"]) button:active:not(:disabled) {
2313
- background: var(--btn-subtle-bg-hover);
2314
- }
2315
-
2316
- :host([variant="subtle"]) button {
2317
- background: var(--btn-subtle-bg);
2318
- border-color: transparent;
2319
- color: var(--btn-accent);
2320
- }
2321
-
2322
- :host([variant="subtle"]) button:hover:not(:disabled) {
2323
- background: var(--btn-subtle-bg-hover);
2324
- color: var(--btn-accent-hover);
2325
- }
2326
-
2327
- :host([variant="subtle"]) button:active:not(:disabled) {
2328
- background: var(--btn-subtle-bg-hover);
2329
- }
2330
-
2331
- :host([variant="faint"]) button {
2332
- background: var(--btn-subtle-bg);
2333
- border-color: var(--btn-border);
2334
- color: var(--btn-accent);
2335
- }
2336
-
2337
- :host([variant="faint"]) button:hover:not(:disabled) {
2338
- background: var(--btn-subtle-bg-hover);
2339
- border-color: var(--btn-border-hover);
2340
- color: var(--btn-accent-hover);
2341
- }
2342
-
2343
- :host([variant="faint"]) button:active:not(:disabled) {
2344
- background: var(--btn-subtle-bg-hover);
2345
- }
2346
-
2347
- :host([variant="text"]) button {
2348
- background: transparent;
2349
- border-color: transparent;
2350
- color: var(--btn-accent);
2351
- min-width: auto;
2352
- padding-left: 4px;
2353
- padding-right: 4px;
2354
- }
2355
-
2356
- :host([variant="text"]) button:hover:not(:disabled) {
2357
- background: var(--btn-subtle-bg);
2358
- color: var(--btn-accent-hover);
2359
- }
2360
-
2361
- :host([variant="text"]) button:active:not(:disabled) {
2362
- background: var(--btn-subtle-bg-hover);
2363
- }
2364
-
2365
- /* Icon-only: single ae-icon child → square compact layout */
2366
- :host([icon-only]) {
2367
- display: inline-flex;
2368
- }
2369
-
2370
- :host([icon-only]:not([size])) {
2371
- font-size: var(--size-m);
2372
- }
2373
-
2374
- :host([icon-only]) button {
2375
- padding: 0;
2376
- min-width: auto;
2377
- width: 2.286em;
2378
- height: 2.286em;
2379
- line-height: 1;
2380
- }
2381
-
2382
- :host([icon-only]) ::slotted(ae-icon) {
2383
- font-size: 1.5em;
2384
- }
2385
-
2386
- :host([active]) button {
2387
- background: var(--btn-solid-bg-active);
2388
- border-color: var(--btn-border-hover);
2389
- color: var(--btn-solid-color-hover, var(--btn-solid-color));
2390
- }
2391
-
2392
- .btn-icon {
2393
- padding: 0;
2394
- min-width: auto;
2395
- width: 2.286em;
2396
- height: 2.286em;
2397
- display: inline-flex;
2398
- align-items: center;
2399
- justify-content: center;
2400
- border-radius: 4px;
2401
- }
2402
-
2403
- .btn-icon.btn-lg {
2404
- width: 2.857em;
2405
- height: 2.857em;
2406
- }
2407
-
2408
- .btn-circle {
2409
- border-radius: 50%;
2410
- }
2411
-
2412
- :host([block]) {
2413
- display: block;
2414
- }
2415
-
2416
- button.btn-loading {
2417
- position: relative;
2418
- pointer-events: none;
2419
- color: transparent;
2420
- }
2421
-
2422
- button.btn-loading::before {
2423
- content: '';
2424
- position: absolute;
2425
- width: 1em;
2426
- height: 1em;
2427
- border: 2px solid currentColor;
2428
- border-top-color: transparent;
2429
- border-radius: 50%;
2430
- animation: btn-spin 0.6s linear infinite;
2431
- color: currentColor;
2432
- opacity: 0.8;
2433
- }
2434
-
2435
- @keyframes btn-spin {
2436
- to {
2437
- transform: rotate(360deg);
2438
- }
2439
- }
2440
-
2441
- .btn-icon-left {
2442
- margin-right: -2px;
2443
- }
2444
-
2445
- .btn-icon-right {
2446
- margin-left: -2px;
2447
- }
2448
-
2449
- `;
2450
- var __create$8 = Object.create;
2451
- var __defProp$8 = Object.defineProperty;
2452
- var __knownSymbol$8 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
2453
- var __typeError$8 = (msg) => {
2454
- throw TypeError(msg);
2455
- };
2456
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2457
- var __decoratorStart$8 = (base) => [, , , __create$8((base == null ? void 0 : base[__knownSymbol$8("metadata")]) ?? null)];
2458
- var __decoratorStrings$8 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
2459
- var __expectFn$8 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$8("Function expected") : fn;
2460
- var __decoratorContext$8 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$8[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$8("Already initialized") : fns.push(__expectFn$8(fn || null)) });
2461
- var __decoratorMetadata$8 = (array, target) => __defNormalProp$8(target, __knownSymbol$8("metadata"), array[3]);
2462
- var __runInitializers$8 = (array, flags, self, value) => {
2463
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
2464
- return value;
2465
- };
2466
- var __decorateElement$8 = (array, flags, name, decorators, target, extra) => {
2467
- var it, done, ctx, access, k = flags & 7, s = false, p = false;
2468
- var j = array.length + 1;
2469
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
2470
- target = target.prototype, k < 5;
2471
- for (var i = decorators.length - 1; i >= 0; i--) {
2472
- ctx = __decoratorContext$8(k, name, done = {}, array[3], extraInitializers);
2473
- {
2474
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
2475
- access.get = (x) => x[name];
2476
- access.set = (x, y) => x[name] = y;
2477
- }
2478
- it = (0, decorators[i])(void 0, ctx), done._ = 1;
2479
- __expectFn$8(it) && initializers.unshift(it);
2480
- }
2481
- return target;
2482
- };
2483
- var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
2484
- var _block_dec, _active_dec$1, _type_dec$1, _disabled_dec$4, _size_dec$2, _variant_dec$4, _color_dec$6, _a$8, _init$8;
2485
- class Button extends (_a$8 = AeicoComponent, _color_dec$6 = [aeico.prop({ type: String })], _variant_dec$4 = [aeico.prop({ type: String })], _size_dec$2 = [aeico.prop({ type: String })], _disabled_dec$4 = [aeico.prop({ type: Boolean })], _type_dec$1 = [aeico.prop({ type: String })], _active_dec$1 = [aeico.prop({ type: Boolean })], _block_dec = [aeico.prop({ type: Boolean })], _a$8) {
2486
- constructor() {
2487
- super(...arguments);
2488
- __publicField$8(this, "color", __runInitializers$8(_init$8, 8, this)), __runInitializers$8(_init$8, 11, this);
2489
- __publicField$8(this, "variant", __runInitializers$8(_init$8, 12, this)), __runInitializers$8(_init$8, 15, this);
2490
- __publicField$8(this, "size", __runInitializers$8(_init$8, 16, this)), __runInitializers$8(_init$8, 19, this);
2491
- __publicField$8(this, "disabled", __runInitializers$8(_init$8, 20, this)), __runInitializers$8(_init$8, 23, this);
2492
- __publicField$8(this, "type", __runInitializers$8(_init$8, 24, this)), __runInitializers$8(_init$8, 27, this);
2493
- __publicField$8(this, "active", __runInitializers$8(_init$8, 28, this)), __runInitializers$8(_init$8, 31, this);
2494
- __publicField$8(this, "block", __runInitializers$8(_init$8, 32, this)), __runInitializers$8(_init$8, 35, this);
2495
- __publicField$8(this, "buttonElement", null);
2496
- __publicField$8(this, "_autoAriaLabel", false);
2497
- __publicField$8(this, "_handleSlotChange", () => {
2498
- var _a2;
2499
- const slot = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("slot:not([name])");
2500
- const nodes = (slot == null ? void 0 : slot.assignedNodes()) ?? [];
2501
- const elements = nodes.filter((n) => n.nodeType === Node.ELEMENT_NODE);
2502
- const hasText = nodes.some(
2503
- (n) => n.nodeType === Node.TEXT_NODE && n.textContent.trim() !== ""
2504
- );
2505
- const isIconOnly = !hasText && elements.length === 1 && elements[0].tagName.toLowerCase() === "ae-icon";
2506
- if (isIconOnly) {
2507
- this.setAttribute("icon-only", "");
2508
- if (!this.hasAttribute("aria-label") || this._autoAriaLabel) {
2509
- this.setAttribute("aria-label", elements[0].getAttribute("name") ?? "");
2510
- this._autoAriaLabel = true;
2511
- }
2512
- } else {
2513
- this.removeAttribute("icon-only");
2514
- if (this._autoAriaLabel) {
2515
- this.removeAttribute("aria-label");
2516
- this._autoAriaLabel = false;
2517
- }
2518
- }
2519
- });
2520
- }
2521
- onMounted() {
2522
- var _a2;
2523
- const slot = (_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("slot:not([name])");
2524
- if (slot) this.listen(slot, "slotchange", this._handleSlotChange);
2525
- this._handleSlotChange();
2526
- }
2527
- render() {
2528
- return aeico.html(({ button, slot }) => {
2529
- this.buttonElement = button(
2530
- {
2531
- type: this.type || "button",
2532
- disabled: this.disabled,
2533
- part: "button",
2534
- "aria-pressed": this.active,
2535
- "aria-disabled": this.disabled
2536
- },
2537
- () => {
2538
- slot();
2539
- }
2540
- );
2541
- });
2542
- }
2543
- /**
2544
- * Programmatically click the button
2545
- */
2546
- click() {
2547
- if (!this.disabled && this.buttonElement) {
2548
- this.buttonElement.click();
2549
- }
2550
- }
2551
- /**
2552
- * Focus the button
2553
- */
2554
- focus() {
2555
- if (this.buttonElement) {
2556
- this.buttonElement.focus();
2557
- }
2558
- }
2559
- /**
2560
- * Blur the button
2561
- */
2562
- blur() {
2563
- if (this.buttonElement) {
2564
- this.buttonElement.blur();
2565
- }
2566
- }
2567
- }
2568
- _init$8 = __decoratorStart$8(_a$8);
2569
- __decorateElement$8(_init$8, 5, "color", _color_dec$6, Button);
2570
- __decorateElement$8(_init$8, 5, "variant", _variant_dec$4, Button);
2571
- __decorateElement$8(_init$8, 5, "size", _size_dec$2, Button);
2572
- __decorateElement$8(_init$8, 5, "disabled", _disabled_dec$4, Button);
2573
- __decorateElement$8(_init$8, 5, "type", _type_dec$1, Button);
2574
- __decorateElement$8(_init$8, 5, "active", _active_dec$1, Button);
2575
- __decorateElement$8(_init$8, 5, "block", _block_dec, Button);
2576
- __decoratorMetadata$8(_init$8, Button);
2577
- __publicField$8(Button, "styles", [styleVariables, sizeCSS, colorCSS, buttonStyle]);
2578
- Button.register();
2579
- const style$4 = ":host {\n display: inline-block;\n position: relative;\n\n --dropdown-z-index: 1000;\n --dropdown-bg: var(--surface-overlay, #fff);\n --dropdown-border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));\n --dropdown-border-radius: var(--ae-radius-md, 6px);\n --dropdown-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n --dropdown-min-width: 10rem;\n --dropdown-padding: 0.25rem 0;\n}\n\n.trigger-wrapper {\n display: flex;\n align-items: stretch;\n height: 100%;\n}\n\n/* Internal trigger rendered when `label` prop is set.\n Uses --dropdown-trigger-* variables. Context components (e.g. ae-navbar)\n map their own tokens to these variables via ::slotted(ae-dropdown). */\n.trigger-label {\n display: inline-flex;\n align-items: center;\n height: var(--dropdown-trigger-height, auto);\n padding: 0 var(--dropdown-trigger-padding-x, 0.75rem);\n color: var(--dropdown-trigger-color, inherit);\n background: var(--dropdown-trigger-bg, none);\n border: none;\n border-radius: var(--dropdown-trigger-radius, 0);\n -webkit-appearance: none;\n appearance: none;\n cursor: pointer;\n font: inherit;\n font-size: var(--dropdown-trigger-font-size, inherit);\n white-space: nowrap;\n transition: color 0.15s ease, background-color 0.15s ease;\n outline-offset: 2px;\n}\n\n.trigger-label:hover {\n color: var(--dropdown-trigger-hover-color, inherit);\n background-color: var(--dropdown-trigger-hover-bg, transparent);\n}\n\n:host([disabled]) .trigger-label {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n/* Bootstrap-style CSS border caret — shadow DOM only, no global injection needed */\n.ae-dropdown-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-left: 0.3em;\n vertical-align: 0.2em;\n flex-shrink: 0;\n}\n.ae-dropdown-arrow--bottom {\n border-top: 0.35em solid;\n border-right: 0.35em solid transparent;\n border-left: 0.35em solid transparent;\n}\n.ae-dropdown-arrow--top {\n border-bottom: 0.35em solid;\n border-right: 0.35em solid transparent;\n border-left: 0.35em solid transparent;\n}\n.ae-dropdown-arrow--right {\n border-left: 0.35em solid;\n border-top: 0.35em solid transparent;\n border-bottom: 0.35em solid transparent;\n}\n.ae-dropdown-arrow--left {\n border-right: 0.35em solid;\n border-top: 0.35em solid transparent;\n border-bottom: 0.35em solid transparent;\n}\n\n.panel {\n display: none;\n position: absolute;\n z-index: var(--dropdown-z-index);\n background: var(--dropdown-bg);\n border: var(--dropdown-border);\n border-radius: var(--dropdown-border-radius);\n box-shadow: var(--dropdown-shadow);\n min-width: var(--dropdown-min-width);\n padding: var(--dropdown-padding);\n box-sizing: border-box;\n /* Prevent panel from being wider than viewport */\n max-width: calc(100vw - 16px);\n}\n\n.panel.open {\n display: block;\n}\n\n/* placement variants */\n.panel.placement-bottom-start {\n top: 100%;\n left: 0;\n margin-top: 4px;\n}\n\n.panel.placement-bottom-end {\n top: 100%;\n right: 0;\n margin-top: 4px;\n}\n\n.panel.placement-bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: 4px;\n}\n\n.panel.placement-top-start {\n bottom: 100%;\n left: 0;\n margin-bottom: 4px;\n}\n\n.panel.placement-top-end {\n bottom: 100%;\n right: 0;\n margin-bottom: 4px;\n}\n\n.panel.placement-top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: 4px;\n}\n\n/* right placements */\n.panel.placement-right-start {\n top: 0;\n left: 100%;\n margin-left: 4px;\n}\n\n.panel.placement-right-end {\n bottom: 0;\n left: 100%;\n margin-left: 4px;\n}\n\n.panel.placement-right {\n top: 50%;\n left: 100%;\n transform: translateY(-50%);\n margin-left: 4px;\n}\n\n/* left placements */\n.panel.placement-left-start {\n top: 0;\n right: 100%;\n margin-right: 4px;\n}\n\n.panel.placement-left-end {\n bottom: 0;\n right: 100%;\n margin-right: 4px;\n}\n\n.panel.placement-left {\n top: 50%;\n right: 100%;\n transform: translateY(-50%);\n margin-right: 4px;\n}\n";
2580
- const style$3 = `:host {
2581
- display: block;
2582
-
2583
- --dropdown-item-padding: 0.5rem 0.875rem;
2584
- --dropdown-item-bg: transparent;
2585
- --dropdown-item-bg-hover: var(--surface-raised, rgba(0, 0, 0, 0.05));
2586
- --dropdown-item-bg-active: var(--surface-raised-active, rgba(0, 0, 0, 0.1));
2587
- --dropdown-item-color: var(--color-text-main, inherit);
2588
- --dropdown-item-color-disabled: var(--color-text-disabled, rgba(0, 0, 0, 0.35));
2589
- --dropdown-item-font-size: 0.9375rem;
2590
- --dropdown-item-gap: 0.5rem;
2591
- --dropdown-item-transition: background 0.1s;
2592
- --dropdown-item-border-radius: var(--ae-radius-sm, 4px);
2593
- }
2594
-
2595
- .item {
2596
- display: flex;
2597
- align-items: center;
2598
- gap: var(--dropdown-item-gap);
2599
- width: 100%;
2600
- padding: var(--dropdown-item-padding);
2601
- font-size: var(--dropdown-item-font-size);
2602
- font-family: inherit;
2603
- color: var(--dropdown-item-color);
2604
- background: var(--dropdown-item-bg);
2605
- border: none;
2606
- border-radius: var(--dropdown-item-border-radius);
2607
- text-align: left;
2608
- text-decoration: none;
2609
- cursor: pointer;
2610
- user-select: none;
2611
- white-space: nowrap;
2612
- box-sizing: border-box;
2613
- transition: var(--dropdown-item-transition);
2614
- outline: none;
2615
- }
2616
-
2617
- .item:hover:not(:disabled):not([aria-disabled="true"]) {
2618
- background: var(--dropdown-item-bg-hover);
2619
- }
2620
-
2621
- .item:active:not(:disabled):not([aria-disabled="true"]) {
2622
- background: var(--dropdown-item-bg-active);
2623
- }
2624
-
2625
- .item:focus-visible {
2626
- background: var(--dropdown-item-bg-hover);
2627
- outline: 2px solid var(--color-primary, #0e639c);
2628
- outline-offset: -2px;
2629
- }
2630
-
2631
- /* disabled */
2632
- :host([disabled]) .item,
2633
- .item:disabled {
2634
- color: var(--dropdown-item-color-disabled);
2635
- cursor: default;
2636
- pointer-events: none;
2637
- }
2638
-
2639
- /* Active item — current selection, current route, etc. */
2640
- :host([active]) .item {
2641
- background: var(--dropdown-item-bg-selected, rgba(0, 0, 0, 0.06));
2642
- color: var(--dropdown-item-color-active, var(--color-primary, #0e639c));
2643
- font-weight: 500;
2644
- }
2645
-
2646
- /* Checkbox mode — fixed-width indicator column */
2647
- .check-indicator {
2648
- display: inline-flex;
2649
- align-items: center;
2650
- justify-content: center;
2651
- width: 1em;
2652
- flex-shrink: 0;
2653
- }
2654
-
2655
- /* CSS-drawn checkmark (border trick) */
2656
- .check-indicator::after {
2657
- content: '';
2658
- display: block;
2659
- width: 0.3em;
2660
- height: 0.55em;
2661
- border-right: 0.125em solid currentColor;
2662
- border-bottom: 0.125em solid currentColor;
2663
- transform: rotate(45deg) translateY(-0.1em);
2664
- opacity: 0;
2665
- transition: opacity 0.1s;
2666
- }
2667
-
2668
- :host([checked]) .check-indicator::after {
2669
- opacity: 1;
2670
- }
2671
- `;
2672
- const style$2 = ":host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n width: 1em;\n height: 1em;\n color: inherit;\n flex-shrink: 0;\n line-height: 0;\n vertical-align: middle;\n}\n\n:host([color]) {\n color: var(--color-solid);\n}\n\n.icon-svg {\n display: block;\n width: 100%;\n height: 100%;\n fill: var(--icon-fill, currentColor);\n stroke: var(--icon-stroke, none);\n stroke-width: var(--icon-stroke-width, 2);\n stroke-linecap: var(--icon-stroke-linecap, round);\n stroke-linejoin: var(--icon-stroke-linejoin, round);\n pointer-events: none;\n overflow: visible;\n}\n";
2673
- const defaultViewBox = "0 0 24 24";
2674
- class IconRegistry {
2675
- static add(icons) {
2676
- for (const [name, data] of Object.entries(icons)) {
2677
- if (typeof data === "string") {
2678
- this._icons.set(name, { path: data, viewBox: defaultViewBox });
2679
- } else {
2680
- this._icons.set(name, data);
2681
- }
2682
- }
2683
- }
2684
- static get(name) {
2685
- return this._icons.get(name);
2686
- }
2687
- static has(name) {
2688
- return this._icons.has(name);
2689
- }
2690
- }
2691
- __publicField(IconRegistry, "_icons", /* @__PURE__ */ new Map());
2692
- class Icon extends AeicoComponent {
2693
- render() {
2694
- const def = this.name ? IconRegistry.get(this.name) : void 0;
2695
- const numericSize = Number(this.size);
2696
- if (this.size !== void 0 && !isNaN(numericSize) && numericSize > 0) {
2697
- this.style.setProperty("font-size", `${numericSize}px`);
2698
- } else {
2699
- this.style.removeProperty("font-size");
2700
- }
2701
- const useStroke = this.stroke ?? (def == null ? void 0 : def.stroke) ?? false;
2702
- const useStrokeWidth = this.strokeWidth ?? (def == null ? void 0 : def.strokeWidth) ?? 2;
2703
- if (useStroke) {
2704
- this.style.setProperty("--icon-fill", "none");
2705
- this.style.setProperty("--icon-stroke", "currentColor");
2706
- this.style.setProperty("--icon-stroke-width", String(useStrokeWidth));
2707
- } else {
2708
- this.style.removeProperty("--icon-fill");
2709
- this.style.removeProperty("--icon-stroke");
2710
- this.style.removeProperty("--icon-stroke-width");
2711
- }
2712
- if (!def) return;
2713
- return aeico.html(({ svg, path }) => {
2714
- svg(
2715
- {
2716
- className: "icon-svg",
2717
- viewBox: def.viewBox ?? defaultViewBox,
2718
- "aria-hidden": "true",
2719
- xmlns: SVG_NS
2720
- },
2721
- () => {
2722
- path({ d: def.path });
2723
- }
2724
- );
2725
- });
2726
- }
2727
- }
2728
- __publicField(Icon, "tagName", "icon");
2729
- __publicField(Icon, "props", {
2730
- name: { type: String },
2731
- size: { type: String },
2732
- color: { type: String },
2733
- stroke: { type: Boolean },
2734
- strokeWidth: { type: Number }
2735
- });
2736
- __publicField(Icon, "styles", [styleVariables, sizeCSS, colorCSS, style$2]);
2737
- Icon.register();
2738
- var __create$7 = Object.create;
2739
- var __defProp$7 = Object.defineProperty;
2740
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
2741
- var __knownSymbol$7 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
2742
- var __typeError$7 = (msg) => {
2743
- throw TypeError(msg);
2744
- };
2745
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2746
- var __decoratorStart$7 = (base) => [, , , __create$7((base == null ? void 0 : base[__knownSymbol$7("metadata")]) ?? null)];
2747
- var __decoratorStrings$7 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
2748
- var __expectFn$7 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$7("Function expected") : fn;
2749
- var __decoratorContext$7 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$7[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$7("Already initialized") : fns.push(__expectFn$7(fn || null)) });
2750
- var __decoratorMetadata$7 = (array, target) => __defNormalProp$7(target, __knownSymbol$7("metadata"), array[3]);
2751
- var __runInitializers$7 = (array, flags, self, value) => {
2752
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
2753
- return value;
2754
- };
2755
- var __decorateElement$7 = (array, flags, name, decorators, target, extra) => {
2756
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
2757
- var j = array.length + 1, key = __decoratorStrings$7[k + 5];
2758
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
2759
- var desc = (target = target.prototype, __getOwnPropDesc$7({ get [name]() {
2760
- return __privateGet$7(this, extra);
2761
- }, set [name](x) {
2762
- return __privateSet$7(this, extra, x);
2763
- } }, name));
2764
- for (var i = decorators.length - 1; i >= 0; i--) {
2765
- ctx = __decoratorContext$7(k, name, done = {}, array[3], extraInitializers);
2766
- {
2767
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
2768
- access.get = (x) => x[name];
2769
- access.set = (x, y) => x[name] = y;
2770
- }
2771
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
2772
- if (it === void 0) __expectFn$7(it) && (desc[key] = it);
2773
- else if (typeof it !== "object" || it === null) __typeError$7("Object expected");
2774
- else __expectFn$7(fn = it.get) && (desc.get = fn), __expectFn$7(fn = it.set) && (desc.set = fn), __expectFn$7(fn = it.init) && initializers.unshift(fn);
2775
- }
2776
- return desc && __defProp$7(target, name, desc), target;
2777
- };
2778
- var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
2779
- var __accessCheck$7 = (obj, member, msg) => member.has(obj) || __typeError$7("Cannot " + msg);
2780
- var __privateGet$7 = (obj, member, getter) => (__accessCheck$7(obj, member, "read from private field"), member.get(obj));
2781
- var __privateAdd$7 = (obj, member, value) => member.has(obj) ? __typeError$7("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2782
- var __privateSet$7 = (obj, member, value, setter) => (__accessCheck$7(obj, member, "write to private field"), member.set(obj, value), value);
2783
- var _active_dec, _checked_dec, _type_dec, _href_dec, _disabled_dec$3, _value_dec, _a$7, _init$7, _value, _disabled$3, _href, _type, _checked, _active;
2784
- class DropdownItem extends (_a$7 = AeicoComponent, _value_dec = [aeico.prop({ type: String })], _disabled_dec$3 = [aeico.prop({ type: Boolean })], _href_dec = [aeico.prop({ type: String })], _type_dec = [aeico.prop({ type: String })], _checked_dec = [aeico.prop({ type: Boolean })], _active_dec = [aeico.prop({ type: Boolean })], _a$7) {
2785
- constructor() {
2786
- super(...arguments);
2787
- __privateAdd$7(this, _value, __runInitializers$7(_init$7, 8, this)), __runInitializers$7(_init$7, 11, this);
2788
- __privateAdd$7(this, _disabled$3, __runInitializers$7(_init$7, 12, this, false)), __runInitializers$7(_init$7, 15, this);
2789
- __privateAdd$7(this, _href, __runInitializers$7(_init$7, 16, this)), __runInitializers$7(_init$7, 19, this);
2790
- __privateAdd$7(this, _type, __runInitializers$7(_init$7, 20, this)), __runInitializers$7(_init$7, 23, this);
2791
- __privateAdd$7(this, _checked, __runInitializers$7(_init$7, 24, this, false)), __runInitializers$7(_init$7, 27, this);
2792
- __privateAdd$7(this, _active, __runInitializers$7(_init$7, 28, this, false)), __runInitializers$7(_init$7, 31, this);
2793
- __publicField$7(this, "_handleClick", (e) => {
2794
- var _a2;
2795
- if (this.disabled) {
2796
- e.preventDefault();
2797
- e.stopPropagation();
2798
- return;
2799
- }
2800
- if (this.type === "checkbox") {
2801
- this.checked = !this.checked;
2802
- }
2803
- const label = ((_a2 = this.textContent) == null ? void 0 : _a2.trim()) ?? "";
2804
- this.dispatchEvent(
2805
- new CustomEvent("_item-select", {
2806
- bubbles: true,
2807
- composed: true,
2808
- detail: { value: this.value ?? "", label, checked: this.checked }
2809
- })
2810
- );
2811
- });
2812
- }
2813
- connectedCallback() {
2814
- super.connectedCallback();
2815
- this.listen("click", this._handleClick);
2816
- this.setAttribute("role", "menuitem");
2817
- }
2818
- render() {
2819
- const isCheckbox = this.type === "checkbox";
2820
- const sharedProps = {
2821
- part: "item",
2822
- className: "item",
2823
- "aria-checked": isCheckbox ? String(this.checked) : void 0
2824
- };
2825
- return aeico.html(({ button, a, span, slot }) => {
2826
- const children = () => {
2827
- if (isCheckbox) span({ className: "check-indicator", "aria-hidden": "true" });
2828
- slot();
2829
- };
2830
- if (this.href) {
2831
- a(
2832
- {
2833
- ...sharedProps,
2834
- href: this.disabled ? void 0 : this.href,
2835
- "aria-disabled": this.disabled || void 0
2836
- },
2837
- children
2838
- );
2839
- } else {
2840
- button(
2841
- {
2842
- ...sharedProps,
2843
- type: "button",
2844
- disabled: this.disabled
2845
- },
2846
- children
2847
- );
2848
- }
2849
- });
2850
- }
2851
- }
2852
- _init$7 = __decoratorStart$7(_a$7);
2853
- _value = /* @__PURE__ */ new WeakMap();
2854
- _disabled$3 = /* @__PURE__ */ new WeakMap();
2855
- _href = /* @__PURE__ */ new WeakMap();
2856
- _type = /* @__PURE__ */ new WeakMap();
2857
- _checked = /* @__PURE__ */ new WeakMap();
2858
- _active = /* @__PURE__ */ new WeakMap();
2859
- __decorateElement$7(_init$7, 4, "value", _value_dec, DropdownItem, _value);
2860
- __decorateElement$7(_init$7, 4, "disabled", _disabled_dec$3, DropdownItem, _disabled$3);
2861
- __decorateElement$7(_init$7, 4, "href", _href_dec, DropdownItem, _href);
2862
- __decorateElement$7(_init$7, 4, "type", _type_dec, DropdownItem, _type);
2863
- __decorateElement$7(_init$7, 4, "checked", _checked_dec, DropdownItem, _checked);
2864
- __decorateElement$7(_init$7, 4, "active", _active_dec, DropdownItem, _active);
2865
- __decoratorMetadata$7(_init$7, DropdownItem);
2866
- __publicField$7(DropdownItem, "tagName", "dropdown-item");
2867
- __publicField$7(DropdownItem, "styles", [styleVariables, style$3]);
2868
- DropdownItem.register();
2869
- var __create$6 = Object.create;
2870
- var __defProp$6 = Object.defineProperty;
2871
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
2872
- var __knownSymbol$6 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
2873
- var __typeError$6 = (msg) => {
2874
- throw TypeError(msg);
2875
- };
2876
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2877
- var __decoratorStart$6 = (base) => [, , , __create$6((base == null ? void 0 : base[__knownSymbol$6("metadata")]) ?? null)];
2878
- var __decoratorStrings$6 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
2879
- var __expectFn$6 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$6("Function expected") : fn;
2880
- var __decoratorContext$6 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$6[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$6("Already initialized") : fns.push(__expectFn$6(fn || null)) });
2881
- var __decoratorMetadata$6 = (array, target) => __defNormalProp$6(target, __knownSymbol$6("metadata"), array[3]);
2882
- var __runInitializers$6 = (array, flags, self, value) => {
2883
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
2884
- return value;
2885
- };
2886
- var __decorateElement$6 = (array, flags, name, decorators, target, extra) => {
2887
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
2888
- var j = array.length + 1, key = __decoratorStrings$6[k + 5];
2889
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
2890
- var desc = (target = target.prototype, __getOwnPropDesc$6({ get [name]() {
2891
- return __privateGet$6(this, extra);
2892
- }, set [name](x) {
2893
- return __privateSet$6(this, extra, x);
2894
- } }, name));
2895
- for (var i = decorators.length - 1; i >= 0; i--) {
2896
- ctx = __decoratorContext$6(k, name, done = {}, array[3], extraInitializers);
2897
- {
2898
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
2899
- access.get = (x) => x[name];
2900
- access.set = (x, y) => x[name] = y;
2901
- }
2902
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
2903
- if (it === void 0) __expectFn$6(it) && (desc[key] = it);
2904
- else if (typeof it !== "object" || it === null) __typeError$6("Object expected");
2905
- else __expectFn$6(fn = it.get) && (desc.get = fn), __expectFn$6(fn = it.set) && (desc.set = fn), __expectFn$6(fn = it.init) && initializers.unshift(fn);
2906
- }
2907
- return desc && __defProp$6(target, name, desc), target;
2908
- };
2909
- var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
2910
- var __accessCheck$6 = (obj, member, msg) => member.has(obj) || __typeError$6("Cannot " + msg);
2911
- var __privateGet$6 = (obj, member, getter) => (__accessCheck$6(obj, member, "read from private field"), member.get(obj));
2912
- var __privateAdd$6 = (obj, member, value) => member.has(obj) ? __typeError$6("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2913
- var __privateSet$6 = (obj, member, value, setter) => (__accessCheck$6(obj, member, "write to private field"), member.set(obj, value), value);
2914
- var _label_dec, _disabled_dec$2, _closeOnSelect_dec$1, _open_dec$1, _placement_dec$1, _a$6, _init$6, _placement$1, _open$1, _closeOnSelect$1, _disabled$2, _label;
2915
- class Dropdown extends (_a$6 = AeicoComponent, _placement_dec$1 = [aeico.prop({ type: String })], _open_dec$1 = [aeico.prop({ type: Boolean })], _closeOnSelect_dec$1 = [aeico.prop({ type: Boolean })], _disabled_dec$2 = [aeico.prop({ type: Boolean })], _label_dec = [aeico.prop({ type: String })], _a$6) {
2916
- constructor() {
2917
- super(...arguments);
2918
- __privateAdd$6(this, _placement$1, __runInitializers$6(_init$6, 8, this, "bottom-start")), __runInitializers$6(_init$6, 11, this);
2919
- __privateAdd$6(this, _open$1, __runInitializers$6(_init$6, 12, this, false)), __runInitializers$6(_init$6, 15, this);
2920
- __privateAdd$6(this, _closeOnSelect$1, __runInitializers$6(_init$6, 16, this, true)), __runInitializers$6(_init$6, 19, this);
2921
- __privateAdd$6(this, _disabled$2, __runInitializers$6(_init$6, 20, this, false)), __runInitializers$6(_init$6, 23, this);
2922
- __privateAdd$6(this, _label, __runInitializers$6(_init$6, 24, this, "")), __runInitializers$6(_init$6, 27, this);
2923
- __publicField$6(this, "_outsideClickHandler", null);
2924
- __publicField$6(this, "_handleTriggerClick", () => {
2925
- this.toggle();
2926
- });
2927
- __publicField$6(this, "_handleItemSelect", (e) => {
2928
- this.emit("select", { detail: e.detail });
2929
- if (this.closeOnSelect) {
2930
- this._closePanel();
2931
- }
2932
- });
2933
- __publicField$6(this, "_handleKeydown", (e) => {
2934
- if (e.key === "Escape" && this.open) {
2935
- e.stopPropagation();
2936
- this._closePanel();
2937
- }
2938
- });
2939
- }
2940
- connectedCallback() {
2941
- super.connectedCallback();
2942
- this.listen("_item-select", this._handleItemSelect);
2943
- this.listen("keydown", this._handleKeydown);
2944
- this._outsideClickHandler = (e) => {
2945
- if (!this.open) return;
2946
- const path = e.composedPath();
2947
- if (!path.includes(this)) {
2948
- this._closePanel();
2949
- }
2950
- };
2951
- document.addEventListener("click", this._outsideClickHandler);
2952
- }
2953
- disconnectedCallback() {
2954
- super.disconnectedCallback();
2955
- if (this._outsideClickHandler) {
2956
- document.removeEventListener("click", this._outsideClickHandler);
2957
- this._outsideClickHandler = null;
2958
- }
2959
- }
2960
- /** Opens the dropdown panel. */
2961
- show() {
2962
- if (this.disabled || this.open) return;
2963
- this.open = true;
2964
- this.emit("open");
2965
- }
2966
- /** Closes the dropdown panel. */
2967
- hide() {
2968
- if (!this.open) return;
2969
- this.open = false;
2970
- this.emit("close");
2971
- }
2972
- /** Toggles the dropdown panel open/closed. */
2973
- toggle() {
2974
- if (this.open) {
2975
- this.hide();
2976
- } else {
2977
- this.show();
2978
- }
2979
- }
2980
- _closePanel() {
2981
- if (this.open) this.hide();
2982
- }
2983
- render() {
2984
- const placementClass = `placement-${this.placement}`;
2985
- const hasLabel = !!this.label;
2986
- const dir = this.placement.split("-")[0];
2987
- return aeico.html(({ div, slot, button, span }) => {
2988
- div(
2989
- {
2990
- className: "trigger-wrapper",
2991
- "aria-haspopup": "menu",
2992
- "aria-expanded": String(this.open),
2993
- "@click": this.disabled ? void 0 : this._handleTriggerClick
2994
- },
2995
- () => {
2996
- if (hasLabel) {
2997
- button(
2998
- {
2999
- className: "trigger-label",
3000
- type: "button",
3001
- disabled: this.disabled || void 0
3002
- },
3003
- () => {
3004
- span({ text: this.label });
3005
- span({
3006
- className: `ae-dropdown-arrow ae-dropdown-arrow--${dir}`,
3007
- "aria-hidden": "true"
3008
- });
3009
- }
3010
- );
3011
- } else {
3012
- slot({ name: "trigger" });
3013
- }
3014
- }
3015
- );
3016
- div(
3017
- {
3018
- part: "panel",
3019
- className: { panel: true, open: this.open, [placementClass]: true },
3020
- role: "menu"
3021
- },
3022
- () => {
3023
- slot();
3024
- }
3025
- );
3026
- });
3027
- }
3028
- }
3029
- _init$6 = __decoratorStart$6(_a$6);
3030
- _placement$1 = /* @__PURE__ */ new WeakMap();
3031
- _open$1 = /* @__PURE__ */ new WeakMap();
3032
- _closeOnSelect$1 = /* @__PURE__ */ new WeakMap();
3033
- _disabled$2 = /* @__PURE__ */ new WeakMap();
3034
- _label = /* @__PURE__ */ new WeakMap();
3035
- __decorateElement$6(_init$6, 4, "placement", _placement_dec$1, Dropdown, _placement$1);
3036
- __decorateElement$6(_init$6, 4, "open", _open_dec$1, Dropdown, _open$1);
3037
- __decorateElement$6(_init$6, 4, "closeOnSelect", _closeOnSelect_dec$1, Dropdown, _closeOnSelect$1);
3038
- __decorateElement$6(_init$6, 4, "disabled", _disabled_dec$2, Dropdown, _disabled$2);
3039
- __decorateElement$6(_init$6, 4, "label", _label_dec, Dropdown, _label);
3040
- __decoratorMetadata$6(_init$6, Dropdown);
3041
- __publicField$6(Dropdown, "tagName", "dropdown");
3042
- __publicField$6(Dropdown, "styles", [styleVariables, style$4]);
3043
- Dropdown.register();
3044
- var __create$5 = Object.create;
3045
- var __defProp$5 = Object.defineProperty;
3046
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
3047
- var __knownSymbol$5 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
3048
- var __typeError$5 = (msg) => {
3049
- throw TypeError(msg);
3050
- };
3051
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3052
- var __decoratorStart$5 = (base) => [, , , __create$5((base == null ? void 0 : base[__knownSymbol$5("metadata")]) ?? null)];
3053
- var __decoratorStrings$5 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
3054
- var __expectFn$5 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$5("Function expected") : fn;
3055
- var __decoratorContext$5 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$5[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$5("Already initialized") : fns.push(__expectFn$5(fn || null)) });
3056
- var __decoratorMetadata$5 = (array, target) => __defNormalProp$5(target, __knownSymbol$5("metadata"), array[3]);
3057
- var __runInitializers$5 = (array, flags, self, value) => {
3058
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
3059
- return value;
3060
- };
3061
- var __decorateElement$5 = (array, flags, name, decorators, target, extra) => {
3062
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
3063
- var j = array.length + 1, key = __decoratorStrings$5[k + 5];
3064
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
3065
- var desc = (target = target.prototype, __getOwnPropDesc$5({ get [name]() {
3066
- return __privateGet$5(this, extra);
3067
- }, set [name](x) {
3068
- return __privateSet$5(this, extra, x);
3069
- } }, name));
3070
- for (var i = decorators.length - 1; i >= 0; i--) {
3071
- ctx = __decoratorContext$5(k, name, done = {}, array[3], extraInitializers);
3072
- {
3073
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
3074
- access.get = (x) => x[name];
3075
- access.set = (x, y) => x[name] = y;
3076
- }
3077
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
3078
- if (it === void 0) __expectFn$5(it) && (desc[key] = it);
3079
- else if (typeof it !== "object" || it === null) __typeError$5("Object expected");
3080
- else __expectFn$5(fn = it.get) && (desc.get = fn), __expectFn$5(fn = it.set) && (desc.set = fn), __expectFn$5(fn = it.init) && initializers.unshift(fn);
3081
- }
3082
- return desc && __defProp$5(target, name, desc), target;
3083
- };
3084
- var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
3085
- var __accessCheck$5 = (obj, member, msg) => member.has(obj) || __typeError$5("Cannot " + msg);
3086
- var __privateGet$5 = (obj, member, getter) => (__accessCheck$5(obj, member, "read from private field"), member.get(obj));
3087
- var __privateAdd$5 = (obj, member, value) => member.has(obj) ? __typeError$5("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3088
- var __privateSet$5 = (obj, member, value, setter) => (__accessCheck$5(obj, member, "write to private field"), member.set(obj, value), value);
3089
- var _closeOnSelect_dec, _placement_dec, _disabled_dec$1, _size_dec$1, _color_dec$5, _variant_dec$3, _a$5, _init$5, _variant$3, _color$5, _size$1, _disabled$1, _placement, _closeOnSelect;
3090
- class DropdownButton extends (_a$5 = AeicoComponent, _variant_dec$3 = [aeico.prop({ type: String })], _color_dec$5 = [aeico.prop({ type: String })], _size_dec$1 = [aeico.prop({ type: String })], _disabled_dec$1 = [aeico.prop({ type: Boolean })], _placement_dec = [aeico.prop({ type: String })], _closeOnSelect_dec = [aeico.prop({ type: Boolean })], _a$5) {
3091
- constructor() {
3092
- super(...arguments);
3093
- __privateAdd$5(this, _variant$3, __runInitializers$5(_init$5, 8, this, "filled")), __runInitializers$5(_init$5, 11, this);
3094
- __privateAdd$5(this, _color$5, __runInitializers$5(_init$5, 12, this, "default")), __runInitializers$5(_init$5, 15, this);
3095
- __privateAdd$5(this, _size$1, __runInitializers$5(_init$5, 16, this, "md")), __runInitializers$5(_init$5, 19, this);
3096
- __privateAdd$5(this, _disabled$1, __runInitializers$5(_init$5, 20, this, false)), __runInitializers$5(_init$5, 23, this);
3097
- __privateAdd$5(this, _placement, __runInitializers$5(_init$5, 24, this, "bottom-start")), __runInitializers$5(_init$5, 27, this);
3098
- __privateAdd$5(this, _closeOnSelect, __runInitializers$5(_init$5, 28, this, true)), __runInitializers$5(_init$5, 31, this);
3099
- __publicField$5(this, "_dropdownEl", null);
3100
- }
3101
- show() {
3102
- var _a2;
3103
- if (this.disabled) return;
3104
- (_a2 = this._dropdownEl) == null ? void 0 : _a2.show();
3105
- }
3106
- hide() {
3107
- var _a2;
3108
- (_a2 = this._dropdownEl) == null ? void 0 : _a2.hide();
3109
- }
3110
- toggle() {
3111
- var _a2;
3112
- if (this.disabled) return;
3113
- (_a2 = this._dropdownEl) == null ? void 0 : _a2.toggle();
3114
- }
3115
- get open() {
3116
- var _a2;
3117
- return ((_a2 = this._dropdownEl) == null ? void 0 : _a2.open) ?? false;
3118
- }
3119
- render() {
3120
- const dir = this.placement.split("-")[0];
3121
- return aeico.html(({ aeDropdown, aeButton, slot, span }) => {
3122
- this._dropdownEl = aeDropdown(
3123
- {
3124
- placement: this.placement,
3125
- "close-on-select": this.closeOnSelect
3126
- },
3127
- () => {
3128
- aeButton(
3129
- {
3130
- slot: "trigger",
3131
- variant: this.variant,
3132
- color: this.color,
3133
- size: this.size,
3134
- disabled: this.disabled || void 0
3135
- },
3136
- () => {
3137
- slot({ name: "label" });
3138
- span({ className: `caret caret--${dir}`, "aria-hidden": "true" });
3139
- }
3140
- );
3141
- slot();
3142
- }
3143
- );
3144
- });
3145
- }
3146
- }
3147
- _init$5 = __decoratorStart$5(_a$5);
3148
- _variant$3 = /* @__PURE__ */ new WeakMap();
3149
- _color$5 = /* @__PURE__ */ new WeakMap();
3150
- _size$1 = /* @__PURE__ */ new WeakMap();
3151
- _disabled$1 = /* @__PURE__ */ new WeakMap();
3152
- _placement = /* @__PURE__ */ new WeakMap();
3153
- _closeOnSelect = /* @__PURE__ */ new WeakMap();
3154
- __decorateElement$5(_init$5, 4, "variant", _variant_dec$3, DropdownButton, _variant$3);
3155
- __decorateElement$5(_init$5, 4, "color", _color_dec$5, DropdownButton, _color$5);
3156
- __decorateElement$5(_init$5, 4, "size", _size_dec$1, DropdownButton, _size$1);
3157
- __decorateElement$5(_init$5, 4, "disabled", _disabled_dec$1, DropdownButton, _disabled$1);
3158
- __decorateElement$5(_init$5, 4, "placement", _placement_dec, DropdownButton, _placement);
3159
- __decorateElement$5(_init$5, 4, "closeOnSelect", _closeOnSelect_dec, DropdownButton, _closeOnSelect);
3160
- __decoratorMetadata$5(_init$5, DropdownButton);
3161
- __publicField$5(DropdownButton, "tagName", "dropdown-button");
3162
- __publicField$5(DropdownButton, "styles", [
3163
- ":host { display: inline-block; }",
3164
- ".caret { display: inline-block; width: 0; height: 0; margin-left: 0.3em; vertical-align: 0.2em; flex-shrink: 0; }",
3165
- ".caret--bottom { border-top: 0.35em solid; border-right: 0.35em solid transparent; border-left: 0.35em solid transparent; }",
3166
- ".caret--top { border-bottom: 0.35em solid; border-right: 0.35em solid transparent; border-left: 0.35em solid transparent; }",
3167
- ".caret--right { border-left: 0.35em solid; border-top: 0.35em solid transparent; border-bottom: 0.35em solid transparent; }",
3168
- ".caret--left { border-right: 0.35em solid; border-top: 0.35em solid transparent; border-bottom: 0.35em solid transparent; }"
3169
- ]);
3170
- DropdownButton.register();
3171
- const buttonGroupStyle = ":host {\n display: inline-flex;\n align-items: stretch;\n gap: 8px;\n}\n\n:host([block]) {\n display: flex;\n width: 100%;\n}\n\n:host([block]) ::slotted(ae-button) {\n flex: 1;\n}\n\n:host([compact]) {\n gap: 0;\n}\n\n/* Raise hovered/focused button so its border shows above neighbours */\n:host([compact]) ::slotted(ae-button:hover),\n:host([compact]) ::slotted(ae-button:focus-within) {\n position: relative;\n z-index: 1;\n}\n";
3172
- class ButtonGroup extends AeicoComponent {
3173
- constructor() {
3174
- super(...arguments);
3175
- __publicField(this, "slotEl", null);
3176
- }
3177
- connectedCallback() {
3178
- super.connectedCallback();
3179
- if (this.variant === void 0) this.variant = "filled";
3180
- if (this.color === void 0) this.color = "default";
3181
- if (this.size === void 0) this.size = "md";
3182
- }
3183
- render() {
3184
- return aeico.html(({ slot }) => {
3185
- this.slotEl = slot({
3186
- "@slotchange": () => this._syncChildren()
3187
- });
3188
- this._syncChildren();
3189
- });
3190
- }
3191
- _getButtons() {
3192
- if (!this.slotEl) return [];
3193
- return this.slotEl.assignedElements({ flatten: true }).filter((el) => {
3194
- const tag = el.tagName.toLowerCase();
3195
- return tag === "ae-button" || tag === "ae-dropdown-button";
3196
- });
3197
- }
3198
- _syncChildren() {
3199
- const buttons = this._getButtons();
3200
- const r = this.size === "xs" || this.size === "sm" ? 3 : 4;
3201
- buttons.forEach((btn, i) => {
3202
- btn.variant = this.variant;
3203
- btn.color = this.color;
3204
- btn.size = this.size;
3205
- if (this.disabled) {
3206
- btn.disabled = true;
3207
- } else {
3208
- btn.disabled = false;
3209
- }
3210
- if (this.compact) {
3211
- const isFirst = i === 0;
3212
- const isLast = i === buttons.length - 1;
3213
- btn.style.marginLeft = isFirst ? "" : "-1px";
3214
- btn.style.setProperty("--_btn-r-tl", isFirst ? `${r}px` : "0");
3215
- btn.style.setProperty("--_btn-r-bl", isFirst ? `${r}px` : "0");
3216
- btn.style.setProperty("--_btn-r-tr", isLast ? `${r}px` : "0");
3217
- btn.style.setProperty("--_btn-r-br", isLast ? `${r}px` : "0");
3218
- } else {
3219
- btn.style.marginLeft = "";
3220
- this._clearRadius(btn);
3221
- }
3222
- });
3223
- }
3224
- _clearRadius(btn) {
3225
- btn.style.removeProperty("--_btn-r-tl");
3226
- btn.style.removeProperty("--_btn-r-tr");
3227
- btn.style.removeProperty("--_btn-r-br");
3228
- btn.style.removeProperty("--_btn-r-bl");
3229
- }
3230
- }
3231
- __publicField(ButtonGroup, "props", {
3232
- variant: { type: String },
3233
- color: { type: String },
3234
- size: { type: String },
3235
- compact: { type: Boolean },
3236
- block: { type: Boolean },
3237
- disabled: { type: Boolean }
3238
- });
3239
- __publicField(ButtonGroup, "styles", [styleVariables, buttonGroupStyle]);
3240
- ButtonGroup.register();
3241
- const badgeStyle = ':host {\n display: inline-flex;\n align-items: center;\n --badge-solid-bg: var(--color-solid);\n --badge-solid-color: var(--color-on-solid);\n --badge-border: var(--color-border);\n --badge-accent: var(--color-accent);\n --badge-subtle-bg: var(--color-bg-subtle);\n --badge-subtle-color: var(--color-text-subtle);\n --badge-subtle-border: var(--color-border-subtle);\n}\n\n.badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n font-family: inherit;\n font-weight: 500;\n white-space: nowrap;\n vertical-align: middle;\n line-height: 1.2;\n font-size: 1em;\n padding: 0.15em 0.6em;\n border-radius: 4px;\n border: 1px solid var(--badge-solid-bg);\n background: var(--badge-solid-bg);\n color: var(--badge-solid-color);\n}\n\n/* Default (no [variant]) = filled */\n\n/* --- Variants --- */\n\n:host([variant="outlined"]) .badge {\n background: transparent;\n border-color: var(--badge-border);\n color: var(--badge-accent);\n}\n\n:host([variant="faint"]) .badge {\n background: var(--badge-subtle-bg);\n border-color: var(--badge-subtle-border);\n color: var(--badge-subtle-color);\n}\n\n:host([variant="subtle"]) .badge {\n background: var(--badge-subtle-bg);\n border-color: transparent;\n color: var(--badge-subtle-color);\n}\n\n:host([variant="text"]) .badge {\n background: transparent;\n border-color: transparent;\n color: var(--badge-accent);\n padding-left: 0;\n padding-right: 0;\n}\n\n:host([pill]) .badge {\n border-radius: 999px;\n}\n\n/* Icon slots */\n::slotted(ae-icon) {\n font-size: 1.1em;\n}\n';
3242
- var __create$4 = Object.create;
3243
- var __defProp$4 = Object.defineProperty;
3244
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
3245
- var __knownSymbol$4 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
3246
- var __typeError$4 = (msg) => {
3247
- throw TypeError(msg);
3248
- };
3249
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3250
- var __decoratorStart$4 = (base) => [, , , __create$4((base == null ? void 0 : base[__knownSymbol$4("metadata")]) ?? null)];
3251
- var __decoratorStrings$4 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
3252
- var __expectFn$4 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$4("Function expected") : fn;
3253
- var __decoratorContext$4 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$4[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$4("Already initialized") : fns.push(__expectFn$4(fn || null)) });
3254
- var __decoratorMetadata$4 = (array, target) => __defNormalProp$4(target, __knownSymbol$4("metadata"), array[3]);
3255
- var __runInitializers$4 = (array, flags, self, value) => {
3256
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
3257
- return value;
3258
- };
3259
- var __decorateElement$4 = (array, flags, name, decorators, target, extra) => {
3260
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
3261
- var j = array.length + 1, key = __decoratorStrings$4[k + 5];
3262
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
3263
- var desc = (target = target.prototype, __getOwnPropDesc$4({ get [name]() {
3264
- return __privateGet$4(this, extra);
3265
- }, set [name](x) {
3266
- return __privateSet$4(this, extra, x);
3267
- } }, name));
3268
- for (var i = decorators.length - 1; i >= 0; i--) {
3269
- ctx = __decoratorContext$4(k, name, done = {}, array[3], extraInitializers);
3270
- {
3271
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
3272
- access.get = (x) => x[name];
3273
- access.set = (x, y) => x[name] = y;
3274
- }
3275
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
3276
- if (it === void 0) __expectFn$4(it) && (desc[key] = it);
3277
- else if (typeof it !== "object" || it === null) __typeError$4("Object expected");
3278
- else __expectFn$4(fn = it.get) && (desc.get = fn), __expectFn$4(fn = it.set) && (desc.set = fn), __expectFn$4(fn = it.init) && initializers.unshift(fn);
3279
- }
3280
- return desc && __defProp$4(target, name, desc), target;
3281
- };
3282
- var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, key + "", value);
3283
- var __accessCheck$4 = (obj, member, msg) => member.has(obj) || __typeError$4("Cannot " + msg);
3284
- var __privateGet$4 = (obj, member, getter) => (__accessCheck$4(obj, member, "read from private field"), member.get(obj));
3285
- var __privateAdd$4 = (obj, member, value) => member.has(obj) ? __typeError$4("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3286
- var __privateSet$4 = (obj, member, value, setter) => (__accessCheck$4(obj, member, "write to private field"), member.set(obj, value), value);
3287
- var _pill_dec, _size_dec, _variant_dec$2, _color_dec$4, _a$4, _init$4, _color$4, _variant$2, _size, _pill;
3288
- class Badge extends (_a$4 = AeicoComponent, _color_dec$4 = [aeico.prop({ type: String })], _variant_dec$2 = [aeico.prop({ type: String })], _size_dec = [aeico.prop({ type: String })], _pill_dec = [aeico.prop({ type: Boolean })], _a$4) {
3289
- constructor() {
3290
- super(...arguments);
3291
- __privateAdd$4(this, _color$4, __runInitializers$4(_init$4, 8, this, "default")), __runInitializers$4(_init$4, 11, this);
3292
- __privateAdd$4(this, _variant$2, __runInitializers$4(_init$4, 12, this, "filled")), __runInitializers$4(_init$4, 15, this);
3293
- __privateAdd$4(this, _size, __runInitializers$4(_init$4, 16, this, "md")), __runInitializers$4(_init$4, 19, this);
3294
- __privateAdd$4(this, _pill, __runInitializers$4(_init$4, 20, this, false)), __runInitializers$4(_init$4, 23, this);
3295
- }
3296
- render() {
3297
- return aeico.html(({ span, slot }) => {
3298
- span({ part: "badge", className: "badge" }, () => {
3299
- slot({ name: "start" });
3300
- slot();
3301
- slot({ name: "end" });
3302
- });
3303
- });
3304
- }
3305
- }
3306
- _init$4 = __decoratorStart$4(_a$4);
3307
- _color$4 = /* @__PURE__ */ new WeakMap();
3308
- _variant$2 = /* @__PURE__ */ new WeakMap();
3309
- _size = /* @__PURE__ */ new WeakMap();
3310
- _pill = /* @__PURE__ */ new WeakMap();
3311
- __decorateElement$4(_init$4, 4, "color", _color_dec$4, Badge, _color$4);
3312
- __decorateElement$4(_init$4, 4, "variant", _variant_dec$2, Badge, _variant$2);
3313
- __decorateElement$4(_init$4, 4, "size", _size_dec, Badge, _size);
3314
- __decorateElement$4(_init$4, 4, "pill", _pill_dec, Badge, _pill);
3315
- __decoratorMetadata$4(_init$4, Badge);
3316
- __publicField$4(Badge, "styles", [styleVariables, sizeCSS, colorCSS, badgeStyle]);
3317
- Badge.register();
3318
- const alertStyle = `.alert {
3319
- position: relative;
3320
- padding: 12px 16px;
3321
- margin-bottom: 12px;
3322
- border-radius: 4px;
3323
- font-size: 12px;
3324
- line-height: 1.6;
3325
- background-color: var(--alert-solid-bg);
3326
- color: var(--alert-solid-color);
3327
- border: 1px solid var(--alert-solid-bg);
3328
- }
3329
-
3330
- .alert:last-child {
3331
- margin-bottom: 0;
3332
- }
3333
-
3334
- :host {
3335
- --color-solid: var(--color-primary);
3336
- --color-on-solid: var(--color-text-main);
3337
- --color-border: var(--color-primary);
3338
- --color-bg-subtle: var(--color-primary-bg-subtle);
3339
- --color-text-subtle: var(--color-primary-text-emphasis);
3340
- --color-border-subtle: var(--color-primary-border-subtle);
3341
-
3342
- --alert-solid-bg: var(--color-solid);
3343
- --alert-solid-color: var(--color-on-solid);
3344
- --alert-border: var(--color-border);
3345
- --alert-subtle-bg: var(--color-bg-subtle);
3346
- --alert-subtle-color: var(--color-text-subtle);
3347
- --alert-subtle-border:var(--color-border-subtle);
3348
- }
3349
-
3350
-
3351
- :host([variant="faint"]) .alert {
3352
- background-color: var(--alert-subtle-bg);
3353
- color: var(--alert-subtle-color);
3354
- border-color: var(--alert-subtle-border);
3355
- }
3356
-
3357
- :host([variant="subtle"]) .alert {
3358
- background-color: var(--alert-subtle-bg);
3359
- color: var(--alert-subtle-color);
3360
- border-color: transparent;
3361
- }
3362
-
3363
- :host([variant="filled"]) .alert {
3364
- background-color: var(--alert-solid-bg);
3365
- color: var(--alert-solid-color);
3366
- border-color: var(--alert-solid-bg);
3367
- }
3368
-
3369
- :host([variant="outlined"]) .alert {
3370
- background-color: transparent;
3371
- color: var(--alert-subtle-color);
3372
- border-color: var(--alert-border);
3373
- }
3374
-
3375
- :host([dismissible]) .alert {
3376
- padding-right: 40px;
3377
- }
3378
-
3379
- :host([icon]) .alert {
3380
- display: flex;
3381
- align-items: flex-start;
3382
- gap: 10px;
3383
- }
3384
-
3385
- :host([icon]) .alert::before {
3386
- content: '';
3387
- flex-shrink: 0;
3388
- width: 16px;
3389
- height: 16px;
3390
- margin-top: 2px;
3391
- }
3392
-
3393
- .alert-close {
3394
- position: absolute;
3395
- top: 50%;
3396
- right: 12px;
3397
- transform: translateY(-50%);
3398
- background: transparent;
3399
- border: none;
3400
- color: inherit;
3401
- opacity: 0.6;
3402
- cursor: pointer;
3403
- padding: 4px;
3404
- font-size: 18px;
3405
- line-height: 1;
3406
- transition: opacity 0.15s;
3407
- }
3408
-
3409
- .alert-close:hover {
3410
- opacity: 1;
3411
- }
3412
-
3413
- :host([size="sm"]) .alert {
3414
- padding: 8px 12px;
3415
- font-size: 11px;
3416
- }
3417
-
3418
- :host([size="lg"]) .alert {
3419
- padding: 16px 20px;
3420
- font-size: 13px;
3421
- }
3422
- `;
3423
- class Alert extends AeicoComponent {
3424
- constructor() {
3425
- super(...arguments);
3426
- __publicField(this, "_handleClose", () => {
3427
- this.emit("alert-close", { detail: { target: this } });
3428
- this.remove();
3429
- });
3430
- }
3431
- render() {
3432
- return aeico.html(({ div, slot, button, span }) => {
3433
- div(
3434
- {
3435
- className: "alert",
3436
- role: "alert",
3437
- part: "alert",
3438
- style: { display: this.invisible ? "none" : "" }
3439
- },
3440
- () => {
3441
- slot();
3442
- if (this.dismissible) {
3443
- button(
3444
- {
3445
- className: "alert-close",
3446
- "@click": () => this._handleClose(),
3447
- title: aeicoLocalize.t("alert.close", "Close alert")
3448
- },
3449
- () => {
3450
- span({ "aria-hidden": "true", textContent: "×" });
3451
- }
3452
- );
3453
- }
3454
- }
3455
- );
3456
- });
3457
- }
3458
- show() {
3459
- if (this.invisible) {
3460
- this.invisible = false;
3461
- }
3462
- }
3463
- hide() {
3464
- this.invisible = true;
3465
- }
3466
- }
3467
- __publicField(Alert, "props", {
3468
- color: { type: String },
3469
- variant: { type: String },
3470
- size: { type: String },
3471
- dismissible: { type: Boolean },
3472
- invisible: { type: Boolean }
3473
- });
3474
- __publicField(Alert, "useStyles", ["alert"]);
3475
- __publicField(Alert, "styles", [styleVariables, colorCSS, alertStyle]);
3476
- Alert.register();
3477
- const style$1 = ":host {\n display: contents;\n}\n\ndialog {\n display: none;\n flex-direction: column;\n border: none;\n border-radius: 8px;\n padding: 0;\n max-width: min(90vw, 600px);\n max-height: 90vh;\n background: var(--surface-overlay);\n color: var(--color-text-main);\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n overflow: hidden;\n}\n\ndialog[open] {\n display: flex;\n animation: dialog-slide-in 0.2s ease;\n}\n\ndialog::backdrop {\n background: var(--color-overlay);\n animation: dialog-backdrop-in 0.2s ease;\n}\n\n@keyframes dialog-backdrop-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes dialog-slide-in {\n from {\n opacity: 0;\n transform: scale(0.96) translateY(-8px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n}\n\nheader {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 16px 20px;\n border-bottom: 1px solid var(--border-subtle);\n flex-shrink: 0;\n}\n\n.label {\n flex: 1;\n font-size: var(--size-m, 1rem);\n font-weight: 500;\n margin: 0;\n color: var(--color-text-main);\n}\n\n.close-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 28px;\n height: 28px;\n padding: 0;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: var(--color-text-muted);\n font-size: 18px;\n line-height: 1;\n cursor: pointer;\n transition: background 0.15s, color 0.15s;\n}\n\n.close-btn:hover {\n background: var(--border-subtle);\n color: var(--color-text-main);\n}\n\n.body {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n}\n\nfooter {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n padding: 12px 20px;\n border-top: 1px solid var(--border-subtle);\n flex-shrink: 0;\n}\n\n::slotted([data-align-left]) {\n margin-right: auto;\n}\n";
3478
- class Dialog extends AeicoComponent {
3479
- constructor() {
3480
- super(...arguments);
3481
- __publicField(this, "_dialogEl", null);
3482
- __publicField(this, "_hasFooter", false);
3483
- __publicField(this, "_handleDialogClick", (e) => {
3484
- const mouseEvent = e;
3485
- const path = mouseEvent.composedPath();
3486
- for (const el of path) {
3487
- if (el instanceof Element && el.hasAttribute("data-close")) {
3488
- this.close();
3489
- return;
3490
- }
3491
- if (el === this._dialogEl) break;
3492
- }
3493
- if (this.modal !== false && this.closeOnOverlayClick !== false) {
3494
- if (mouseEvent.target === this._dialogEl) {
3495
- const rect = this._dialogEl.getBoundingClientRect();
3496
- const outside = mouseEvent.clientX < rect.left || mouseEvent.clientX > rect.right || mouseEvent.clientY < rect.top || mouseEvent.clientY > rect.bottom;
3497
- if (outside) {
3498
- this.close();
3499
- }
3500
- }
3501
- }
3502
- });
3503
- __publicField(this, "_handleNativeClose", () => {
3504
- this.emit("close", { detail: { target: this } });
3505
- });
3506
- __publicField(this, "_handleFooterSlotChange", (e) => {
3507
- const slotEl = e.target;
3508
- const hasContent = slotEl.assignedElements().length > 0;
3509
- if (hasContent !== this._hasFooter) {
3510
- this._hasFooter = hasContent;
3511
- this.update();
3512
- }
3513
- });
3514
- }
3515
- render() {
3516
- return aeico.html(({ dialog, div, header, footer, span, button, slot }) => {
3517
- this._dialogEl = dialog(
3518
- {
3519
- "@click": this._handleDialogClick,
3520
- "@close": this._handleNativeClose,
3521
- style: {
3522
- width: this.width || "",
3523
- height: this.height || ""
3524
- }
3525
- },
3526
- () => {
3527
- if (this.header !== false) {
3528
- header({}, () => {
3529
- slot({ name: "header" }, () => {
3530
- span({ className: "label", textContent: this.label || "" });
3531
- });
3532
- if (this.closable !== false) {
3533
- button({
3534
- className: "close-btn",
3535
- textContent: "×",
3536
- "@click": () => this.close()
3537
- });
3538
- }
3539
- });
3540
- }
3541
- div({ className: "body" }, () => {
3542
- slot();
3543
- });
3544
- footer(
3545
- {
3546
- style: { display: this._hasFooter ? "" : "none" }
3547
- },
3548
- () => {
3549
- slot({ name: "footer", "@slotchange": this._handleFooterSlotChange });
3550
- }
3551
- );
3552
- }
3553
- );
3554
- });
3555
- }
3556
- open() {
3557
- if (!this._dialogEl) return;
3558
- if (this.modal !== false) {
3559
- this._dialogEl.showModal();
3560
- } else {
3561
- this._dialogEl.show();
3562
- }
3563
- this.emit("open", { detail: { target: this } });
3564
- }
3565
- close() {
3566
- var _a2;
3567
- (_a2 = this._dialogEl) == null ? void 0 : _a2.close();
3568
- }
3569
- isOpen() {
3570
- var _a2;
3571
- return ((_a2 = this._dialogEl) == null ? void 0 : _a2.open) ?? false;
3572
- }
3573
- }
3574
- __publicField(Dialog, "props", {
3575
- label: { type: String },
3576
- width: { type: String },
3577
- height: { type: String },
3578
- modal: { type: Boolean },
3579
- closable: { type: Boolean },
3580
- header: { type: Boolean },
3581
- closeOnOverlayClick: { type: Boolean }
3582
- });
3583
- __publicField(Dialog, "styles", [styleVariables, style$1]);
3584
- Dialog.register();
3585
- class IconButton extends AeicoComponent {
3586
- render() {
3587
- return aeico.html(({ aeButton, aeIcon }) => {
3588
- aeButton(
3589
- {
3590
- color: this.color,
3591
- variant: this.variant,
3592
- size: this.size,
3593
- disabled: this.disabled
3594
- },
3595
- () => {
3596
- aeIcon({ name: this.icon });
3597
- }
3598
- );
3599
- });
3600
- }
3601
- }
3602
- __publicField(IconButton, "tagName", "icon-button");
3603
- __publicField(IconButton, "props", {
3604
- icon: { type: String },
3605
- size: { type: String },
3606
- color: { type: String },
3607
- variant: { type: String },
3608
- disabled: { type: Boolean }
3609
- });
3610
- __publicField(IconButton, "styles", [":host { display: contents; }"]);
3611
- IconButton.register();
3612
- const tabsStyle = ':host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n[part="tab-nav"] {\n display: flex;\n flex-shrink: 0;\n border-bottom: 1px solid var(--ae-tabs-border-color, var(--border-default));\n}\n\n[part="panels"] {\n flex: 1;\n overflow: auto;\n}\n';
3613
- class Tabs extends AeicoComponent {
3614
- constructor() {
3615
- super(...arguments);
3616
- __publicField(this, "_observer", null);
3617
- __publicField(this, "_handleTabClick", (e) => {
3618
- const pairs = this._getPairs();
3619
- const target = e.target;
3620
- const index = pairs.findIndex(([tab]) => tab === target);
3621
- if (index !== -1) this.selectTab(index);
3622
- });
3623
- }
3624
- get _tabs() {
3625
- return [...this.children].filter(
3626
- (el) => el.tagName.toLowerCase() === "ae-tab"
3627
- );
3628
- }
3629
- get _panels() {
3630
- return [...this.children].filter(
3631
- (el) => el.tagName.toLowerCase() === "ae-tab-panel"
3632
- );
3633
- }
3634
- _getPairs() {
3635
- const tabs = this._tabs;
3636
- const panels = this._panels;
3637
- const idMap = /* @__PURE__ */ new Map();
3638
- for (const panel of panels) {
3639
- const id = panel.id;
3640
- if (id) idMap.set(id, panel);
3641
- }
3642
- const usedPanels = /* @__PURE__ */ new Set();
3643
- const pairs = [];
3644
- for (const tab of tabs) {
3645
- const panelId = tab.panel;
3646
- if (panelId) {
3647
- const panel = idMap.get(panelId) ?? null;
3648
- if (panel) usedPanels.add(panel);
3649
- pairs.push([tab, panel]);
3650
- }
3651
- }
3652
- const unmatchedPanels = panels.filter((p) => !usedPanels.has(p));
3653
- let posIndex = 0;
3654
- for (const tab of tabs) {
3655
- if (!tab.panel) {
3656
- pairs.push([tab, unmatchedPanels[posIndex] ?? null]);
3657
- posIndex++;
3658
- }
3659
- }
3660
- return pairs;
3661
- }
3662
- connectedCallback() {
3663
- super.connectedCallback();
3664
- this.listen("_tab-click", this._handleTabClick);
3665
- this._observer = new MutationObserver(() => this.update());
3666
- this._observer.observe(this, { childList: true });
3667
- }
3668
- disconnectedCallback() {
3669
- var _a2;
3670
- super.disconnectedCallback();
3671
- (_a2 = this._observer) == null ? void 0 : _a2.disconnect();
3672
- this._observer = null;
3673
- }
3674
- onUpdated() {
3675
- this._syncActive();
3676
- }
3677
- _syncActive() {
3678
- const activeIndex = this.activeIndex ?? 0;
3679
- const pairs = this._getPairs();
3680
- pairs.forEach(([tab, panel], i) => {
3681
- const isActive = i === activeIndex;
3682
- if (isActive) {
3683
- tab.setAttribute("active", "");
3684
- panel == null ? void 0 : panel.setAttribute("active", "");
3685
- } else {
3686
- tab.removeAttribute("active");
3687
- panel == null ? void 0 : panel.removeAttribute("active");
3688
- }
3689
- });
3690
- }
3691
- selectTab(index) {
3692
- const pairs = this._getPairs();
3693
- if (index === (this.activeIndex ?? 0) || index >= pairs.length) return;
3694
- this.activeIndex = index;
3695
- this.emit("change", { detail: { index } });
3696
- }
3697
- render() {
3698
- return aeico.html(({ nav, div, slot }) => {
3699
- nav({ part: "tab-nav", role: "tablist" }, () => {
3700
- slot({ name: "tab" });
3701
- });
3702
- div({ part: "panels" }, () => {
3703
- slot();
3704
- });
3705
- });
3706
- }
3707
- }
3708
- __publicField(Tabs, "props", {
3709
- activeIndex: { type: Number }
3710
- });
3711
- __publicField(Tabs, "styles", [styleVariables, tabsStyle]);
3712
- Tabs.register();
3713
- const tabStyle = ":host {\n display: inline-flex;\n cursor: pointer;\n margin-bottom: -1px;\n}\n\nbutton {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n background: none;\n border: none;\n border-bottom: 2px solid transparent;\n cursor: pointer;\n font-size: inherit;\n font-family: inherit;\n color: var(--ae-tab-color, #909090);\n font-size: var(--ae-tab-font-size, inherit);\n transition: color 0.15s, border-color 0.15s;\n outline: none;\n white-space: nowrap;\n user-select: none;\n}\n\nbutton:hover {\n color: var(--ae-tab-hover-color, var(--color-primary));\n}\n\nbutton:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: -2px;\n}\n\n:host([active]) button {\n color: var(--ae-tab-active-color, var(--color-primary));\n border-bottom-color: var(--ae-tab-active-color, var(--color-primary));\n}\n\n:host([disabled]) button {\n opacity: 0.4;\n cursor: not-allowed;\n pointer-events: none;\n}\n";
3714
- class Tab extends AeicoComponent {
3715
- constructor() {
3716
- super(...arguments);
3717
- __publicField(this, "_handleClick", () => {
3718
- if (this.disabled) return;
3719
- this.dispatchEvent(
3720
- new CustomEvent("_tab-click", {
3721
- bubbles: true,
3722
- composed: true
3723
- })
3724
- );
3725
- });
3726
- }
3727
- connectedCallback() {
3728
- this.setAttribute("slot", "tab");
3729
- super.connectedCallback();
3730
- this.listen("click", this._handleClick);
3731
- }
3732
- render() {
3733
- return aeico.html(({ button, slot }) => {
3734
- button(
3735
- {
3736
- part: "tab",
3737
- type: "button",
3738
- role: "tab",
3739
- "aria-selected": this.active,
3740
- "aria-disabled": this.disabled,
3741
- disabled: this.disabled
3742
- },
3743
- () => {
3744
- slot();
3745
- }
3746
- );
3747
- });
3748
- }
3749
- }
3750
- __publicField(Tab, "props", {
3751
- active: { type: Boolean },
3752
- disabled: { type: Boolean },
3753
- panel: { type: String }
3754
- });
3755
- __publicField(Tab, "styles", [tabStyle]);
3756
- Tab.register();
3757
- const tabPanelStyle = ":host {\n display: none;\n padding: 16px 0;\n}\n\n:host([active]) {\n display: block;\n}\n";
3758
- class TabPanel extends AeicoComponent {
3759
- render() {
3760
- return aeico.html(({ slot }) => {
3761
- slot();
3762
- });
3763
- }
3764
- }
3765
- __publicField(TabPanel, "styles", [tabPanelStyle]);
3766
- TabPanel.register();
3767
- const style = ":host {\n display: block;\n width: 100%;\n height: var(--thickness, 1px);\n flex-shrink: 0;\n\n /* Override colorCSS default --color-border from gray to the subtle border token */\n --color-border: var(--border-default);\n\n background: var(--color-border);\n}\n\n:host([vertical]) {\n display: inline-block;\n width: var(--thickness, 1px);\n height: 1lh;\n vertical-align: middle;\n}\n";
3768
- var __create$3 = Object.create;
3769
- var __defProp$3 = Object.defineProperty;
3770
- var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
3771
- var __knownSymbol$3 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
3772
- var __typeError$3 = (msg) => {
3773
- throw TypeError(msg);
3774
- };
3775
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3776
- var __decoratorStart$3 = (base) => [, , , __create$3((base == null ? void 0 : base[__knownSymbol$3("metadata")]) ?? null)];
3777
- var __decoratorStrings$3 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
3778
- var __expectFn$3 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$3("Function expected") : fn;
3779
- var __decoratorContext$3 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$3[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$3("Already initialized") : fns.push(__expectFn$3(fn || null)) });
3780
- var __decoratorMetadata$3 = (array, target) => __defNormalProp$3(target, __knownSymbol$3("metadata"), array[3]);
3781
- var __runInitializers$3 = (array, flags, self, value) => {
3782
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
3783
- return value;
3784
- };
3785
- var __decorateElement$3 = (array, flags, name, decorators, target, extra) => {
3786
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
3787
- var j = array.length + 1, key = __decoratorStrings$3[k + 5];
3788
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
3789
- var desc = (target = target.prototype, __getOwnPropDesc$3({ get [name]() {
3790
- return __privateGet$3(this, extra);
3791
- }, set [name](x) {
3792
- return __privateSet$3(this, extra, x);
3793
- } }, name));
3794
- for (var i = decorators.length - 1; i >= 0; i--) {
3795
- ctx = __decoratorContext$3(k, name, done = {}, array[3], extraInitializers);
3796
- {
3797
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
3798
- access.get = (x) => x[name];
3799
- access.set = (x, y) => x[name] = y;
3800
- }
3801
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
3802
- if (it === void 0) __expectFn$3(it) && (desc[key] = it);
3803
- else if (typeof it !== "object" || it === null) __typeError$3("Object expected");
3804
- else __expectFn$3(fn = it.get) && (desc.get = fn), __expectFn$3(fn = it.set) && (desc.set = fn), __expectFn$3(fn = it.init) && initializers.unshift(fn);
3805
- }
3806
- return desc && __defProp$3(target, name, desc), target;
3807
- };
3808
- var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
3809
- var __accessCheck$3 = (obj, member, msg) => member.has(obj) || __typeError$3("Cannot " + msg);
3810
- var __privateGet$3 = (obj, member, getter) => (__accessCheck$3(obj, member, "read from private field"), member.get(obj));
3811
- var __privateAdd$3 = (obj, member, value) => member.has(obj) ? __typeError$3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3812
- var __privateSet$3 = (obj, member, value, setter) => (__accessCheck$3(obj, member, "write to private field"), member.set(obj, value), value);
3813
- var _color_dec$3, _thickness_dec, _vertical_dec, _a$3, _init$3, _vertical, _thickness, _color$3;
3814
- class Divider extends (_a$3 = AeicoComponent, _vertical_dec = [aeico.prop({ type: Boolean })], _thickness_dec = [aeico.prop({ type: String })], _color_dec$3 = [aeico.prop({ type: String })], _a$3) {
3815
- constructor() {
3816
- super(...arguments);
3817
- __privateAdd$3(this, _vertical, __runInitializers$3(_init$3, 8, this, false)), __runInitializers$3(_init$3, 11, this);
3818
- __privateAdd$3(this, _thickness, __runInitializers$3(_init$3, 12, this)), __runInitializers$3(_init$3, 15, this);
3819
- __privateAdd$3(this, _color$3, __runInitializers$3(_init$3, 16, this)), __runInitializers$3(_init$3, 19, this);
3820
- }
3821
- render() {
3822
- if (this.thickness) {
3823
- this.style.setProperty("--thickness", this.thickness);
3824
- } else {
3825
- this.style.removeProperty("--thickness");
3826
- }
3827
- }
3828
- }
3829
- _init$3 = __decoratorStart$3(_a$3);
3830
- _vertical = /* @__PURE__ */ new WeakMap();
3831
- _thickness = /* @__PURE__ */ new WeakMap();
3832
- _color$3 = /* @__PURE__ */ new WeakMap();
3833
- __decorateElement$3(_init$3, 4, "vertical", _vertical_dec, Divider, _vertical);
3834
- __decorateElement$3(_init$3, 4, "thickness", _thickness_dec, Divider, _thickness);
3835
- __decorateElement$3(_init$3, 4, "color", _color_dec$3, Divider, _color$3);
3836
- __decoratorMetadata$3(_init$3, Divider);
3837
- __publicField$3(Divider, "tagName", "divider");
3838
- __publicField$3(Divider, "styles", [styleVariables, colorCSS, style]);
3839
- Divider.register();
3840
- const cardStyle = ':host {\n display: block;\n\n --card-bg: var(--color-bg-subtle);\n --card-color: var(--color-text-subtle);\n --card-border: var(--color-border-subtle);\n --card-divider: var(--color-border-subtle);\n}\n\n:host([variant="faint"]) {\n --card-bg: var(--color-bg-subtle);\n --card-color: var(--color-text-subtle);\n --card-border: var(--color-border-subtle);\n --card-divider: var(--color-border-subtle);\n}\n\n:host([variant="subtle"]) {\n --card-border: transparent;\n --card-divider: transparent;\n}\n\n:host([variant="filled"]) {\n --card-bg: var(--color-solid);\n --card-color: var(--color-on-solid);\n --card-border: var(--color-solid);\n --card-divider: color-mix(in srgb, var(--color-solid), black 15%);\n}\n\n:host([variant="outlined"]) {\n --card-bg: transparent;\n --card-color: var(--color-text-subtle);\n --card-border: var(--color-border);\n --card-divider: var(--color-border-subtle);\n}\n\n.card {\n border: 1px solid var(--card-border);\n border-radius: 8px;\n background: var(--card-bg);\n color: var(--card-color);\n overflow: hidden;\n}\n\n.header,\n.footer {\n display: none;\n padding: 10px 16px;\n font-size: 14px;\n font-weight: 500;\n}\n\n:host([has-header]) .header {\n display: block;\n border-bottom: 1px solid var(--card-divider);\n}\n\n:host([has-footer]) .footer {\n display: block;\n border-top: 1px solid var(--card-divider);\n}\n\n.body {\n padding: 16px;\n}\n';
3841
- var __create$2 = Object.create;
3842
- var __defProp$2 = Object.defineProperty;
3843
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
3844
- var __knownSymbol$2 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
3845
- var __typeError$2 = (msg) => {
3846
- throw TypeError(msg);
3847
- };
3848
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3849
- var __decoratorStart$2 = (base) => [, , , __create$2((base == null ? void 0 : base[__knownSymbol$2("metadata")]) ?? null)];
3850
- var __decoratorStrings$2 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
3851
- var __expectFn$2 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$2("Function expected") : fn;
3852
- var __decoratorContext$2 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$2[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$2("Already initialized") : fns.push(__expectFn$2(fn || null)) });
3853
- var __decoratorMetadata$2 = (array, target) => __defNormalProp$2(target, __knownSymbol$2("metadata"), array[3]);
3854
- var __runInitializers$2 = (array, flags, self, value) => {
3855
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
3856
- return value;
3857
- };
3858
- var __decorateElement$2 = (array, flags, name, decorators, target, extra) => {
3859
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
3860
- var j = array.length + 1, key = __decoratorStrings$2[k + 5];
3861
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
3862
- var desc = (target = target.prototype, __getOwnPropDesc$2({ get [name]() {
3863
- return __privateGet$2(this, extra);
3864
- }, set [name](x) {
3865
- return __privateSet$2(this, extra, x);
3866
- } }, name));
3867
- for (var i = decorators.length - 1; i >= 0; i--) {
3868
- ctx = __decoratorContext$2(k, name, done = {}, array[3], extraInitializers);
3869
- {
3870
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
3871
- access.get = (x) => x[name];
3872
- access.set = (x, y) => x[name] = y;
3873
- }
3874
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
3875
- if (it === void 0) __expectFn$2(it) && (desc[key] = it);
3876
- else if (typeof it !== "object" || it === null) __typeError$2("Object expected");
3877
- else __expectFn$2(fn = it.get) && (desc.get = fn), __expectFn$2(fn = it.set) && (desc.set = fn), __expectFn$2(fn = it.init) && initializers.unshift(fn);
3878
- }
3879
- return desc && __defProp$2(target, name, desc), target;
3880
- };
3881
- var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
3882
- var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
3883
- var __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), member.get(obj));
3884
- var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3885
- var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, "write to private field"), member.set(obj, value), value);
3886
- var _variant_dec$1, _color_dec$2, _a$2, _init$2, _color$2, _variant$1;
3887
- class Card extends (_a$2 = AeicoComponent, _color_dec$2 = [aeico.prop({ type: String })], _variant_dec$1 = [aeico.prop({ type: String })], _a$2) {
3888
- constructor() {
3889
- super(...arguments);
3890
- __privateAdd$2(this, _color$2, __runInitializers$2(_init$2, 8, this, "default")), __runInitializers$2(_init$2, 11, this);
3891
- __privateAdd$2(this, _variant$1, __runInitializers$2(_init$2, 12, this, "filled")), __runInitializers$2(_init$2, 15, this);
3892
- }
3893
- render() {
3894
- return aeico.html(({ div, header, footer, slot }) => {
3895
- div({ className: "card", part: "card" }, () => {
3896
- header({ className: "header", part: "header" }, () => {
3897
- slot({ name: "header", "@slotchange": (e) => this._onHeaderSlotChange(e) });
3898
- });
3899
- div({ className: "body", part: "body" }, () => {
3900
- slot();
3901
- });
3902
- footer({ className: "footer", part: "footer" }, () => {
3903
- slot({ name: "footer", "@slotchange": (e) => this._onFooterSlotChange(e) });
3904
- });
3905
- });
3906
- });
3907
- }
3908
- _onHeaderSlotChange(e) {
3909
- const slot = e.target;
3910
- this.toggleAttribute("has-header", slot.assignedNodes({ flatten: true }).length > 0);
3911
- }
3912
- _onFooterSlotChange(e) {
3913
- const slot = e.target;
3914
- this.toggleAttribute("has-footer", slot.assignedNodes({ flatten: true }).length > 0);
3915
- }
3916
- }
3917
- _init$2 = __decoratorStart$2(_a$2);
3918
- _color$2 = /* @__PURE__ */ new WeakMap();
3919
- _variant$1 = /* @__PURE__ */ new WeakMap();
3920
- __decorateElement$2(_init$2, 4, "color", _color_dec$2, Card, _color$2);
3921
- __decorateElement$2(_init$2, 4, "variant", _variant_dec$1, Card, _variant$1);
3922
- __decoratorMetadata$2(_init$2, Card);
3923
- __publicField$2(Card, "tagName", "card");
3924
- __publicField$2(Card, "styles", [styleVariables, colorCSS, cardStyle]);
3925
- Card.register();
3926
- const navbarStyle = ':host {\n /* layout — padding lives in .inner so document * { padding:0 } cannot override it */\n display: block;\n position: static;\n top: auto;\n z-index: var(--ae-navbar-z-index, 100);\n box-sizing: border-box;\n height: var(--ae-navbar-height, 3.25rem);\n border-radius: var(--ae-navbar-radius, 0);\n\n /* color */\n background: var(--ae-navbar-bg, var(--surface-base));\n color: var(--ae-navbar-color, var(--color-text-main));\n border-bottom: var(--ae-navbar-border-width, 1px) solid var(--ae-navbar-border-color, var(--border-default));\n box-shadow: var(--ae-navbar-shadow, none);\n\n /* layout tokens — declared here so they are clearly part of the public API */\n --ae-navbar-radius: 0;\n /* Default padding-x references the global layout token so ae-navbar content\n automatically aligns with .container / .container-fluid in light DOM.\n Override with --ae-navbar-padding-x to decouple if needed. */\n --ae-navbar-padding-x: var(--container-padding-x, 1.5rem);\n --ae-navbar-gap: 0.5rem;\n\n /* link style tokens — text mode defaults.\n CSS custom properties inherit into slotted content, so\n ::slotted(a[slot="start"]) can reference --ae-navbar-height. */\n --ae-navbar-link-color: inherit;\n --ae-navbar-link-font-size: inherit;\n --ae-navbar-link-padding-x: 0.75rem; /* horizontal padding only; height fills vertically */\n --ae-navbar-link-radius: 0;\n --ae-navbar-link-hover-color: var(--color-text-link-hover);\n --ae-navbar-link-hover-bg: transparent;\n --ae-navbar-link-active-color: var(--color-text-link);\n --ae-navbar-link-active-font-weight: 600;\n}\n\n:host([sticky]) {\n position: sticky;\n top: 0;\n}\n\n:host([color]) {\n --ae-navbar-bg: var(--color-solid);\n --ae-navbar-color: var(--color-on-solid);\n --ae-navbar-border-color: transparent;\n --ae-navbar-link-hover-color: var(--color-on-solid);\n --ae-navbar-link-active-color: var(--color-on-solid);\n}\n\n/* block preset: hover shows a subtle filled block */\n:host([appearance="block"]) {\n --ae-navbar-link-hover-bg: var(--color-bg-subtle);\n --ae-navbar-link-hover-color: inherit;\n}\n\n/* block preset on colored navbar: use semi-transparent white */\n:host([color][appearance="block"]) {\n --ae-navbar-link-hover-bg: rgba(255, 255, 255, 0.15);\n --ae-navbar-link-hover-color: var(--color-on-solid);\n}\n\n.inner {\n display: flex;\n align-items: center;\n height: 100%;\n padding: 0 var(--ae-navbar-padding-x);\n gap: var(--ae-navbar-gap);\n box-sizing: border-box;\n}\n\n[part="brand"] {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n}\n\n/* nav wraps start + end; takes all remaining space */\n[part="nav"] {\n flex: 1 1 auto;\n display: flex;\n align-self: stretch; /* stretch to host height so children can fill it */\n align-items: stretch;\n min-width: 0;\n}\n\n[part="start"],\n[part="end"] {\n flex: 0 0 auto;\n display: flex;\n align-self: stretch;\n}\n\n[part="start"] {\n align-items: stretch; /* slotted <a> will stretch to full height */\n gap: var(--ae-navbar-start-gap, 0);\n}\n\n[part="end"] {\n align-items: center; /* buttons / avatars stay vertically centred */\n gap: var(--ae-navbar-end-gap, 0.5rem);\n margin-left: auto;\n}\n\n/* hamburger — hidden on desktop */\n[part="hamburger"] {\n display: none;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n flex-shrink: 0;\n width: var(--ae-navbar-hamburger-size, 2rem);\n height: var(--ae-navbar-hamburger-size, 2rem);\n margin-left: auto;\n padding: 0;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n color: var(--ae-navbar-hamburger-color, inherit);\n}\n\n[part="hamburger"]:hover {\n background: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n[part="hamburger"] span {\n display: block;\n width: 18px;\n height: 2px;\n background: currentColor;\n border-radius: 1px;\n transition: transform 0.2s ease, opacity 0.2s ease;\n}\n\n/* Brand link — sensible defaults, no full-height stretch */\n::slotted(a[slot="brand"]) {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-weight: 700;\n font-size: 1.05rem;\n text-decoration: none;\n white-space: nowrap;\n}\n\n/* Nav links (start / end slots) — fill full navbar height for block hover effect */\n::slotted(a[slot="start"]),\n::slotted(a[slot="end"]) {\n display: inline-flex;\n align-items: center;\n height: var(--ae-navbar-height, 3.25rem); /* full-height hover area */\n /* !important overrides document-level * { padding: 0 } reset */\n padding: 0 var(--ae-navbar-link-padding-x) !important;\n border-radius: var(--ae-navbar-link-radius);\n color: var(--ae-navbar-link-color);\n font-size: var(--ae-navbar-link-font-size);\n text-decoration: none;\n white-space: nowrap;\n transition: color 0.15s ease, background-color 0.15s ease;\n outline-offset: 2px;\n}\n\n::slotted(a[slot="start"]:hover),\n::slotted(a[slot="end"]:hover) {\n color: var(--ae-navbar-link-hover-color);\n background-color: var(--ae-navbar-link-hover-bg);\n}\n\n::slotted(a[slot="start"][aria-current="page"]),\n::slotted(a[slot="end"][aria-current="page"]) {\n color: var(--ae-navbar-link-active-color);\n font-weight: var(--ae-navbar-link-active-font-weight);\n}\n\n/* ae-dropdown inside navbar — map navbar tokens to dropdown trigger API */\n::slotted(ae-dropdown) {\n align-self: stretch;\n --dropdown-trigger-height: 100%;\n --dropdown-trigger-padding-x: var(--ae-navbar-link-padding-x);\n --dropdown-trigger-color: var(--ae-navbar-link-color);\n --dropdown-trigger-bg: none;\n --dropdown-trigger-radius: var(--ae-navbar-link-radius);\n --dropdown-trigger-font-size: var(--ae-navbar-link-font-size);\n --dropdown-trigger-hover-color: var(--ae-navbar-link-hover-color);\n --dropdown-trigger-hover-bg: var(--ae-navbar-link-hover-bg);\n}\n\n@media (max-width: 768px) {\n /* collapse the nav container */\n [part="nav"] {\n display: none;\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n flex-direction: column;\n align-items: stretch;\n gap: 0;\n padding: 0.5rem 0;\n background: var(--ae-navbar-mobile-bg, var(--ae-navbar-bg, var(--surface-base)));\n border-bottom: 1px solid var(--ae-navbar-border-color, var(--border-default));\n box-shadow: var(--ae-navbar-mobile-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));\n z-index: 1;\n }\n\n :host([open]) [part="nav"] {\n display: flex;\n }\n\n /* stack start/end vertically inside the panel */\n [part="start"],\n [part="end"] {\n flex-direction: column;\n align-items: flex-start;\n align-self: auto;\n gap: 0;\n margin-left: 0;\n width: 100%;\n }\n\n /* Mobile: links revert to auto height and add vertical padding */\n ::slotted(a[slot="start"]),\n ::slotted(a[slot="end"]) {\n height: auto;\n width: 100%;\n padding: 0.75rem var(--ae-navbar-link-padding-x);\n border-radius: 0;\n }\n\n /* show hamburger */\n [part="hamburger"] {\n display: flex;\n }\n\n /* hamburger → × animation */\n :host([open]) [part="hamburger"] span:nth-child(1) {\n transform: translateY(7px) rotate(45deg);\n }\n\n :host([open]) [part="hamburger"] span:nth-child(2) {\n opacity: 0;\n transform: scaleX(0);\n }\n\n :host([open]) [part="hamburger"] span:nth-child(3) {\n transform: translateY(-7px) rotate(-45deg);\n }\n}\n';
3927
- var __create$1 = Object.create;
3928
- var __defProp$1 = Object.defineProperty;
3929
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
3930
- var __knownSymbol$1 = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
3931
- var __typeError$1 = (msg) => {
3932
- throw TypeError(msg);
3933
- };
3934
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3935
- var __decoratorStart$1 = (base) => [, , , __create$1((base == null ? void 0 : base[__knownSymbol$1("metadata")]) ?? null)];
3936
- var __decoratorStrings$1 = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
3937
- var __expectFn$1 = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError$1("Function expected") : fn;
3938
- var __decoratorContext$1 = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings$1[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError$1("Already initialized") : fns.push(__expectFn$1(fn || null)) });
3939
- var __decoratorMetadata$1 = (array, target) => __defNormalProp$1(target, __knownSymbol$1("metadata"), array[3]);
3940
- var __runInitializers$1 = (array, flags, self, value) => {
3941
- for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
3942
- return value;
3943
- };
3944
- var __decorateElement$1 = (array, flags, name, decorators, target, extra) => {
3945
- var fn, it, done, ctx, access, k = flags & 7, s = false, p = false;
3946
- var j = array.length + 1, key = __decoratorStrings$1[k + 5];
3947
- var initializers = array[j - 1] = [], extraInitializers = array[j] || (array[j] = []);
3948
- var desc = (target = target.prototype, __getOwnPropDesc$1({ get [name]() {
3949
- return __privateGet$1(this, extra);
3950
- }, set [name](x) {
3951
- return __privateSet$1(this, extra, x);
3952
- } }, name));
3953
- for (var i = decorators.length - 1; i >= 0; i--) {
3954
- ctx = __decoratorContext$1(k, name, done = {}, array[3], extraInitializers);
3955
- {
3956
- ctx.static = s, ctx.private = p, access = ctx.access = { has: (x) => name in x };
3957
- access.get = (x) => x[name];
3958
- access.set = (x, y) => x[name] = y;
3959
- }
3960
- it = (0, decorators[i])({ get: desc.get, set: desc.set }, ctx), done._ = 1;
3961
- if (it === void 0) __expectFn$1(it) && (desc[key] = it);
3962
- else if (typeof it !== "object" || it === null) __typeError$1("Object expected");
3963
- else __expectFn$1(fn = it.get) && (desc.get = fn), __expectFn$1(fn = it.set) && (desc.set = fn), __expectFn$1(fn = it.init) && initializers.unshift(fn);
3964
- }
3965
- return desc && __defProp$1(target, name, desc), target;
3966
- };
3967
- var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
3968
- var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
3969
- var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), member.get(obj));
3970
- var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
3971
- var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
3972
- var _open_dec, _appearance_dec, _sticky_dec, _color_dec$1, _a$1, _init$1, _color$1, _sticky, _appearance, _open;
3973
- class Navbar extends (_a$1 = AeicoComponent, _color_dec$1 = [aeico.prop({ type: String })], _sticky_dec = [aeico.prop({ type: Boolean })], _appearance_dec = [aeico.prop({ type: String })], _open_dec = [aeico.prop({ type: Boolean })], _a$1) {
3974
- constructor() {
3975
- super(...arguments);
3976
- __privateAdd$1(this, _color$1, __runInitializers$1(_init$1, 8, this)), __runInitializers$1(_init$1, 11, this);
3977
- __privateAdd$1(this, _sticky, __runInitializers$1(_init$1, 12, this, false)), __runInitializers$1(_init$1, 15, this);
3978
- __privateAdd$1(this, _appearance, __runInitializers$1(_init$1, 16, this, "text")), __runInitializers$1(_init$1, 19, this);
3979
- __privateAdd$1(this, _open, __runInitializers$1(_init$1, 20, this, false)), __runInitializers$1(_init$1, 23, this);
3980
- __publicField$1(this, "_outsideClickHandler", null);
3981
- __publicField$1(this, "_handleInnerClick", (e) => {
3982
- if (!this.open) return;
3983
- const path = e.composedPath();
3984
- if (path.some((el) => el.tagName === "A")) {
3985
- this._closeMenu();
3986
- }
3987
- });
3988
- __publicField$1(this, "_toggleMenu", () => {
3989
- this.open = !this.open;
3990
- });
3991
- __publicField$1(this, "_closeMenu", () => {
3992
- if (this.open) this.open = false;
3993
- });
3994
- }
3995
- connectedCallback() {
3996
- super.connectedCallback();
3997
- this.listen("click", this._handleInnerClick);
3998
- this._outsideClickHandler = (e) => {
3999
- var _a2;
4000
- if (!this.contains(e.target) && !((_a2 = this.shadowRoot) == null ? void 0 : _a2.contains(e.target))) {
4001
- this._closeMenu();
4002
- }
4003
- };
4004
- document.addEventListener("click", this._outsideClickHandler);
4005
- }
4006
- disconnectedCallback() {
4007
- super.disconnectedCallback();
4008
- if (this._outsideClickHandler) {
4009
- document.removeEventListener("click", this._outsideClickHandler);
4010
- this._outsideClickHandler = null;
4011
- }
4012
- }
4013
- /** Toggle the mobile menu open/closed. */
4014
- toggleMenu() {
4015
- this.open = !this.open;
4016
- }
4017
- render() {
4018
- return aeico.html(({ div, nav, button, span, slot }) => {
4019
- div({ class: "inner" }, () => {
4020
- div({ part: "brand" }, () => {
4021
- slot({ name: "brand" });
4022
- });
4023
- nav({ part: "nav", "aria-label": "Main navigation" }, () => {
4024
- div({ part: "start" }, () => {
4025
- slot({ name: "start" });
4026
- });
4027
- div({ part: "end" }, () => {
4028
- slot({ name: "end" });
4029
- });
4030
- });
4031
- button(
4032
- {
4033
- part: "hamburger",
4034
- type: "button",
4035
- "aria-expanded": String(this.open),
4036
- "aria-label": "Toggle navigation",
4037
- "@click": this._toggleMenu
4038
- },
4039
- () => {
4040
- span({ "aria-hidden": "true" });
4041
- span({ "aria-hidden": "true" });
4042
- span({ "aria-hidden": "true" });
4043
- }
4044
- );
4045
- });
4046
- });
4047
- }
4048
- }
4049
- _init$1 = __decoratorStart$1(_a$1);
4050
- _color$1 = /* @__PURE__ */ new WeakMap();
4051
- _sticky = /* @__PURE__ */ new WeakMap();
4052
- _appearance = /* @__PURE__ */ new WeakMap();
4053
- _open = /* @__PURE__ */ new WeakMap();
4054
- __decorateElement$1(_init$1, 4, "color", _color_dec$1, Navbar, _color$1);
4055
- __decorateElement$1(_init$1, 4, "sticky", _sticky_dec, Navbar, _sticky);
4056
- __decorateElement$1(_init$1, 4, "appearance", _appearance_dec, Navbar, _appearance);
4057
- __decorateElement$1(_init$1, 4, "open", _open_dec, Navbar, _open);
4058
- __decoratorMetadata$1(_init$1, Navbar);
4059
- __publicField$1(Navbar, "tagName", "navbar");
4060
- __publicField$1(Navbar, "styles", [styleVariables, colorCSS, navbarStyle]);
4061
- Navbar.register();
4062
- const detailStyle = ':host {\n display: block;\n\n --detail-bg: var(--color-solid);\n --detail-color: var(--color-on-solid);\n --detail-border: var(--color-solid);\n --detail-header-bg: color-mix(in srgb, var(--color-solid), black 10%);\n --detail-radius: 6px;\n}\n\n:host([variant="faint"]) {\n --detail-bg: var(--color-bg-subtle);\n --detail-color: var(--color-text-subtle);\n --detail-border: var(--color-border-subtle);\n --detail-header-bg: var(--color-bg-subtle);\n}\n\n:host([variant="subtle"]) {\n --detail-bg: transparent;\n --detail-color: var(--color-text-main);\n --detail-border: transparent;\n --detail-header-bg: transparent;\n}\n\n:host([variant="filled"]) {\n --detail-bg: var(--color-solid);\n --detail-color: var(--color-on-solid);\n --detail-border: var(--color-solid);\n --detail-header-bg: color-mix(in srgb, var(--color-solid), black 10%);\n}\n\n:host([variant="outlined"]) {\n --detail-bg: transparent;\n --detail-color: var(--color-text-subtle);\n --detail-border: var(--color-border);\n --detail-header-bg: transparent;\n}\n\n:host([disabled]) {\n opacity: 0.5;\n pointer-events: none;\n}\n\n.detail {\n border: 1px solid var(--detail-border);\n border-radius: var(--detail-radius);\n color: var(--detail-color);\n background: var(--detail-bg);\n overflow: hidden;\n}\n\n.summary {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 10px 14px;\n background: var(--detail-header-bg);\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n font-weight: 500;\n border: none;\n cursor: pointer;\n text-align: left;\n outline-offset: -2px;\n user-select: none;\n}\n\n.summary:hover {\n filter: brightness(0.93);\n}\n\n.summary:focus-visible {\n outline: 2px solid var(--color-border);\n}\n\nslot[name="summary"] {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0;\n}\n\n.label {\n flex: 1;\n}\n\nslot[name="expand"],\nslot[name="collapse"] {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n}\n\nslot[name="collapse"] {\n display: none;\n}\n\n:host([open]) slot[name="expand"] {\n display: none;\n}\n\n:host([open]) slot[name="collapse"] {\n display: inline-flex;\n}\n\n.content-outer {\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.25s ease;\n}\n\n:host([open]) .content-outer {\n grid-template-rows: 1fr;\n}\n\n.content {\n overflow: hidden;\n padding: 0 14px;\n transition: padding 0.25s ease;\n}\n\n:host([open]) .content {\n padding: 12px 14px;\n}\n\n';
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const textInput = require("./chunks/text-input.cjs");
4
+ const select = require("./chunks/select.cjs");
5
+ const slider = require("./chunks/slider.cjs");
6
+ const checkbox = require("./chunks/checkbox.cjs");
7
+ const radio = require("./chunks/radio.cjs");
8
+ const _switch = require("./chunks/switch.cjs");
9
+ const breadcrumbItem = require("./chunks/breadcrumb-item.cjs");
10
+ const button = require("./chunks/button.cjs");
11
+ const dropdownButton = require("./chunks/dropdown-button.cjs");
12
+ const buttonGroup = require("./chunks/button-group.cjs");
13
+ const badge = require("./chunks/badge.cjs");
14
+ const tag = require("./chunks/tag.cjs");
15
+ const alert = require("./chunks/alert.cjs");
16
+ const dialog = require("./chunks/dialog.cjs");
17
+ const icon = require("./chunks/icon.cjs");
18
+ const iconButton = require("./chunks/icon-button.cjs");
19
+ const tabPanel = require("./chunks/tab-panel.cjs");
20
+ const divider = require("./chunks/divider.cjs");
21
+ const card = require("./chunks/card.cjs");
22
+ const navbar = require("./chunks/navbar.cjs");
23
+ const detail = require("./chunks/detail.cjs");
24
+ const aeico = require("aeico");
25
+ const aeicoComponent = require("./chunks/aeico-component.cjs");
26
+ const variables = require("./chunks/variables.cjs");
27
+ const color = require("./chunks/color.cjs");
28
+ const style = ":host {\n display: block;\n --progress-height: 8px;\n --color-solid: var(--color-primary);\n}\n\n.progress-track {\n width: 100%;\n height: var(--progress-height);\n background: var(--border-subtle);\n border-radius: calc(var(--progress-height) / 2);\n overflow: hidden;\n}\n\n.progress-bar {\n display: block;\n height: 100%;\n border-radius: inherit;\n background: var(--progress-bar-color, var(--color-solid));\n width: 0%;\n transition: width 0.35s ease;\n position: relative;\n}\n\n/* animated: shimmer sweep on top of the solid fill */\n:host([animated]) .progress-bar::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n rgba(255, 255, 255, 0.35) 50%,\n transparent 100%\n );\n background-size: 200% 100%;\n animation: progress-shimmer 1.4s linear infinite;\n}\n\n@keyframes progress-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n}\n";
4063
29
  var __create = Object.create;
4064
- var __defProp2 = Object.defineProperty;
30
+ var __defProp = Object.defineProperty;
4065
31
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4066
32
  var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
4067
33
  var __typeError = (msg) => {
4068
34
  throw TypeError(msg);
4069
35
  };
4070
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
36
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4071
37
  var __decoratorStart = (base) => [, , , __create((base == null ? void 0 : base[__knownSymbol("metadata")]) ?? null)];
4072
38
  var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
4073
39
  var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
4074
40
  var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
4075
- var __decoratorMetadata = (array, target) => __defNormalProp2(target, __knownSymbol("metadata"), array[3]);
41
+ var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
4076
42
  var __runInitializers = (array, flags, self, value) => {
4077
43
  for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
4078
44
  return value;
@@ -4098,129 +64,88 @@ var __decorateElement = (array, flags, name, decorators, target, extra) => {
4098
64
  else if (typeof it !== "object" || it === null) __typeError("Object expected");
4099
65
  else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
4100
66
  }
4101
- return desc && __defProp2(target, name, desc), target;
67
+ return desc && __defProp(target, name, desc), target;
4102
68
  };
4103
- var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
69
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4104
70
  var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
4105
71
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), member.get(obj));
4106
72
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
4107
73
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
4108
- var _disabled_dec, _color_dec, _variant_dec, _summary_dec, _a, _init, _summary, _variant, _color, _disabled;
4109
- class Detail extends (_a = AeicoComponent, _summary_dec = [aeico.prop({ type: String })], _variant_dec = [aeico.prop({ type: String })], _color_dec = [aeico.prop({ type: String })], _disabled_dec = [aeico.prop({ type: Boolean })], _a) {
74
+ var _animated_dec, _color_dec, _label_dec, _value_dec, _a, _init, _value, _label, _color, _animated;
75
+ class ProgressBar extends (_a = aeicoComponent.AeicoComponent, _value_dec = [aeico.prop({ type: Number })], _label_dec = [aeico.prop({ type: String })], _color_dec = [aeico.prop({ type: String })], _animated_dec = [aeico.prop({ type: Boolean })], _a) {
4110
76
  constructor() {
4111
77
  super(...arguments);
4112
- __privateAdd(this, _summary, __runInitializers(_init, 8, this, "")), __runInitializers(_init, 11, this);
4113
- __privateAdd(this, _variant, __runInitializers(_init, 12, this, "filled")), __runInitializers(_init, 15, this);
4114
- __privateAdd(this, _color, __runInitializers(_init, 16, this, "default")), __runInitializers(_init, 19, this);
4115
- __privateAdd(this, _disabled, __runInitializers(_init, 20, this, false)), __runInitializers(_init, 23, this);
4116
- __publicField2(this, "_open", false);
4117
- __publicField2(this, "_handleSummaryClick", () => {
4118
- this.toggle();
4119
- });
4120
- }
4121
- /** Opens the detail panel. */
4122
- open() {
4123
- if (this.disabled || this._open) return;
4124
- this._open = true;
4125
- this.toggleAttribute("open", true);
4126
- this.update();
4127
- this.emit("open");
4128
- }
4129
- /** Closes the detail panel. */
4130
- close() {
4131
- if (!this._open) return;
4132
- this._open = false;
4133
- this.toggleAttribute("open", false);
4134
- this.update();
4135
- this.emit("close");
4136
- }
4137
- /** Toggles the detail panel open/closed. */
4138
- toggle() {
4139
- if (this._open) {
4140
- this.close();
4141
- } else {
4142
- this.open();
4143
- }
4144
- }
4145
- /** Returns whether the detail panel is currently open. */
4146
- isOpen() {
4147
- return this._open;
78
+ __privateAdd(this, _value, __runInitializers(_init, 8, this, 0)), __runInitializers(_init, 11, this);
79
+ __privateAdd(this, _label, __runInitializers(_init, 12, this, "")), __runInitializers(_init, 15, this);
80
+ __privateAdd(this, _color, __runInitializers(_init, 16, this, "primary")), __runInitializers(_init, 19, this);
81
+ __privateAdd(this, _animated, __runInitializers(_init, 20, this, false)), __runInitializers(_init, 23, this);
4148
82
  }
4149
83
  render() {
4150
- return aeico.html(({ div, button, span, slot }) => {
4151
- div({ className: "detail", part: "detail" }, () => {
4152
- button(
84
+ const clamped = Math.min(100, Math.max(0, this.value));
85
+ return aeico.html(({ div, span }) => {
86
+ div({ part: "base" }, () => {
87
+ div(
4153
88
  {
4154
- className: "summary",
4155
- part: "summary",
4156
- type: "button",
4157
- "aria-expanded": String(this._open),
4158
- disabled: this.disabled || void 0,
4159
- "@click": this._handleSummaryClick
89
+ part: "track",
90
+ className: "progress-track",
91
+ role: "progressbar",
92
+ "aria-valuenow": String(clamped),
93
+ "aria-valuemin": "0",
94
+ "aria-valuemax": "100",
95
+ ...this.label ? { "aria-label": this.label } : {}
4160
96
  },
4161
97
  () => {
4162
- slot({ name: "summary" }, () => {
4163
- span({ className: "label", textContent: this.summary });
98
+ span({
99
+ part: "bar",
100
+ className: "progress-bar",
101
+ style: { width: `${clamped}%` }
4164
102
  });
4165
- slot({ name: "expand" });
4166
- slot({ name: "collapse" });
4167
103
  }
4168
104
  );
4169
- div({ className: "content-outer" }, () => {
4170
- div(
4171
- {
4172
- className: "content",
4173
- part: "content",
4174
- role: "region"
4175
- },
4176
- () => {
4177
- slot();
4178
- }
4179
- );
4180
- });
4181
105
  });
4182
106
  });
4183
107
  }
4184
108
  }
4185
109
  _init = __decoratorStart(_a);
4186
- _summary = /* @__PURE__ */ new WeakMap();
4187
- _variant = /* @__PURE__ */ new WeakMap();
110
+ _value = /* @__PURE__ */ new WeakMap();
111
+ _label = /* @__PURE__ */ new WeakMap();
4188
112
  _color = /* @__PURE__ */ new WeakMap();
4189
- _disabled = /* @__PURE__ */ new WeakMap();
4190
- __decorateElement(_init, 4, "summary", _summary_dec, Detail, _summary);
4191
- __decorateElement(_init, 4, "variant", _variant_dec, Detail, _variant);
4192
- __decorateElement(_init, 4, "color", _color_dec, Detail, _color);
4193
- __decorateElement(_init, 4, "disabled", _disabled_dec, Detail, _disabled);
4194
- __decoratorMetadata(_init, Detail);
4195
- __publicField2(Detail, "tagName", "detail");
4196
- __publicField2(Detail, "styles", [styleVariables, colorCSS, detailStyle]);
4197
- Detail.register();
4198
- exports.Alert = Alert;
4199
- exports.Badge = Badge;
4200
- exports.Breadcrumb = Breadcrumb;
4201
- exports.BreadcrumbItem = BreadcrumbItem;
4202
- exports.Button = Button;
4203
- exports.ButtonGroup = ButtonGroup;
4204
- exports.Card = Card;
4205
- exports.Checkbox = Checkbox;
4206
- exports.Detail = Detail;
4207
- exports.Dialog = Dialog;
4208
- exports.Divider = Divider;
4209
- exports.Dropdown = Dropdown;
4210
- exports.DropdownButton = DropdownButton;
4211
- exports.DropdownItem = DropdownItem;
4212
- exports.Icon = Icon;
4213
- exports.IconButton = IconButton;
4214
- exports.IconRegistry = IconRegistry;
4215
- exports.Navbar = Navbar;
4216
- exports.Radio = Radio;
4217
- exports.RadioGroup = RadioGroup;
4218
- exports.Select = Select;
4219
- exports.Slider = Slider;
4220
- exports.Switch = Switch;
4221
- exports.Tab = Tab;
4222
- exports.TabPanel = TabPanel;
4223
- exports.Tabs = Tabs;
4224
- exports.Tag = Tag;
4225
- exports.TextInput = TextInput;
113
+ _animated = /* @__PURE__ */ new WeakMap();
114
+ __decorateElement(_init, 4, "value", _value_dec, ProgressBar, _value);
115
+ __decorateElement(_init, 4, "label", _label_dec, ProgressBar, _label);
116
+ __decorateElement(_init, 4, "color", _color_dec, ProgressBar, _color);
117
+ __decorateElement(_init, 4, "animated", _animated_dec, ProgressBar, _animated);
118
+ __decoratorMetadata(_init, ProgressBar);
119
+ __publicField(ProgressBar, "tagName", "progress-bar");
120
+ __publicField(ProgressBar, "styles", [variables.styleVariables, color.colorCSS, style]);
121
+ ProgressBar.register();
122
+ exports.TextInput = textInput.TextInput;
123
+ exports.Select = select.Select;
124
+ exports.Slider = slider.Slider;
125
+ exports.Checkbox = checkbox.Checkbox;
126
+ exports.Radio = radio.Radio;
127
+ exports.RadioGroup = radio.RadioGroup;
128
+ exports.Switch = _switch.Switch;
129
+ exports.Breadcrumb = breadcrumbItem.Breadcrumb;
130
+ exports.BreadcrumbItem = breadcrumbItem.BreadcrumbItem;
131
+ exports.Button = button.Button;
132
+ exports.Dropdown = dropdownButton.Dropdown;
133
+ exports.DropdownButton = dropdownButton.DropdownButton;
134
+ exports.DropdownItem = dropdownButton.DropdownItem;
135
+ exports.ButtonGroup = buttonGroup.ButtonGroup;
136
+ exports.Badge = badge.Badge;
137
+ exports.Tag = tag.Tag;
138
+ exports.Alert = alert.Alert;
139
+ exports.Dialog = dialog.Dialog;
140
+ exports.Icon = icon.Icon;
141
+ exports.IconRegistry = icon.IconRegistry;
142
+ exports.IconButton = iconButton.IconButton;
143
+ exports.Tab = tabPanel.Tab;
144
+ exports.TabPanel = tabPanel.TabPanel;
145
+ exports.Tabs = tabPanel.Tabs;
146
+ exports.Divider = divider.Divider;
147
+ exports.Card = card.Card;
148
+ exports.Navbar = navbar.Navbar;
149
+ exports.Detail = detail.Detail;
150
+ exports.ProgressBar = ProgressBar;
4226
151
  //# sourceMappingURL=index.cjs.map