@tachui/primitives 0.8.34 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { withModifiers as A, ComponentWithCSSClasses as q, createSignal as F, useLifecycle as J, createEffect as Y, isSignal as l, ColorAsset as $, h as a, text as d, ConcatenatedComponent as z, clonePropsPreservingReactivity as N, resetLifecycleState as U, createComputed as Q } from "@tachui/core";
2
- import { createComponentInstance as ee } from "@tachui/core/components";
1
+ import { withModifiers as A, ComponentWithCSSClasses as J, createSignal as z, useLifecycle as Q, createEffect as X, isSignal as l, ColorAsset as $, h as a, text as d, ConcatenatedComponent as R, clonePropsPreservingReactivity as N, resetLifecycleState as U, createComputed as ee } from "@tachui/core";
2
+ import { createComponentInstance as te } from "@tachui/core/components";
3
3
  import { T as W } from "./Text-DmpfnY1o.js";
4
- var te = Object.defineProperty, ie = (i, e, t) => e in i ? te(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, y = (i, e, t) => ie(i, typeof e != "symbol" ? e + "" : e, t);
5
- const se = {
4
+ var ie = Object.defineProperty, se = (s, e, t) => e in s ? ie(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, m = (s, e, t) => se(s, typeof e != "symbol" ? e + "" : e, t);
5
+ const ne = {
6
6
  colors: {
7
7
  primary: "#007AFF",
8
8
  secondary: "#5856D6",
@@ -31,17 +31,17 @@ const se = {
31
31
  large: { size: 18, weight: "600" }
32
32
  }
33
33
  };
34
- class I extends q {
35
- constructor(e, t = se) {
36
- super(), y(this, "props", e), y(this, "type", "component"), y(this, "id"), y(this, "mounted", !1), y(this, "cleanup", []), y(this, "stateSignal"), y(this, "setState"), y(this, "theme"), this.id = `button-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.theme = t;
37
- const [s, o] = F("normal");
38
- this.stateSignal = s, this.setState = o, this.setupDOMEventListeners();
34
+ class F extends J {
35
+ constructor(e, t = ne) {
36
+ super(), m(this, "props", e), m(this, "type", "component"), m(this, "id"), m(this, "mounted", !1), m(this, "cleanup", []), m(this, "stateSignal"), m(this, "setState"), m(this, "theme"), this.id = `button-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.theme = t;
37
+ const [i, r] = z("normal");
38
+ this.stateSignal = i, this.setState = r, this.setupDOMEventListeners();
39
39
  }
40
40
  /**
41
41
  * Set up DOM event listeners for button interactions
42
42
  */
43
43
  setupDOMEventListeners() {
44
- J(this, {
44
+ Q(this, {
45
45
  onDOMReady: (e, t) => {
46
46
  t instanceof HTMLButtonElement && this.setupReactiveStyles(t);
47
47
  }
@@ -51,12 +51,12 @@ class I extends q {
51
51
  * Set up reactive style updates based on state changes
52
52
  */
53
53
  setupReactiveStyles(e) {
54
- const t = Y(() => {
54
+ const t = X(() => {
55
55
  this.stateSignal(), this.isEnabled(), this.isLoading();
56
- const { tint: s, backgroundColor: o, foregroundColor: n } = this.props;
57
- s && l(s) ? s() : s instanceof $ && s.resolve(), o && l(o) ? o() : o instanceof $ && o.resolve(), n && l(n) ? n() : n instanceof $ && n.resolve();
58
- const r = this.getButtonStyles();
59
- this.applyStylesToElement(e, r);
56
+ const { tint: i, backgroundColor: r, foregroundColor: n } = this.props;
57
+ i && l(i) ? i() : i instanceof $ && i.resolve(), r && l(r) ? r() : r instanceof $ && r.resolve(), n && l(n) ? n() : n instanceof $ && n.resolve();
58
+ const o = this.getButtonStyles();
59
+ this.applyStylesToElement(e, o);
60
60
  });
61
61
  this.cleanup.push(() => {
62
62
  t && typeof t.dispose == "function" && t.dispose();
@@ -66,11 +66,11 @@ class I extends q {
66
66
  * Apply computed styles to the button element, respecting modifier-applied styles
67
67
  */
68
68
  applyStylesToElement(e, t) {
69
- Object.entries(t).forEach(([s, o]) => {
70
- const n = this.camelToKebabCase(s);
71
- if (typeof o == "string" || typeof o == "number") {
72
- const r = e.style.getPropertyValue(n), c = r && r !== "" && r !== "inherit";
73
- process.env.NODE_ENV === "development" && n === "font-family" && (console.log("[Button.applyButtonStyles] Font-family check:"), console.log("[Button.applyButtonStyles] property:", s, "cssProperty:", n), console.log("[Button.applyButtonStyles] currentValue:", r), console.log("[Button.applyButtonStyles] hasModifierValue:", c), console.log("[Button.applyButtonStyles] will set to:", o)), n === "transform" ? e.style.setProperty(n, String(o)) : c ? process.env.NODE_ENV === "development" && n === "font-family" && console.log("[Button.applyButtonStyles] Button SKIPPED font-family (has modifier value):", r) : (e.style.setProperty(n, String(o)), process.env.NODE_ENV === "development" && n === "font-family" && (console.log("[Button.applyButtonStyles] Button SET font-family to:", String(o)), console.log("[Button.applyButtonStyles] Element after set:", e.style.fontFamily)));
69
+ Object.entries(t).forEach(([i, r]) => {
70
+ const n = this.camelToKebabCase(i);
71
+ if (typeof r == "string" || typeof r == "number") {
72
+ const o = e.style.getPropertyValue(n), c = o && o !== "" && o !== "inherit";
73
+ process.env.NODE_ENV === "development" && n === "font-family" && (console.log("[Button.applyButtonStyles] Font-family check:"), console.log("[Button.applyButtonStyles] property:", i, "cssProperty:", n), console.log("[Button.applyButtonStyles] currentValue:", o), console.log("[Button.applyButtonStyles] hasModifierValue:", c), console.log("[Button.applyButtonStyles] will set to:", r)), n === "transform" ? e.style.setProperty(n, String(r)) : c ? process.env.NODE_ENV === "development" && n === "font-family" && console.log("[Button.applyButtonStyles] Button SKIPPED font-family (has modifier value):", o) : (e.style.setProperty(n, String(r)), process.env.NODE_ENV === "development" && n === "font-family" && (console.log("[Button.applyButtonStyles] Button SET font-family to:", String(r)), console.log("[Button.applyButtonStyles] Element after set:", e.style.fontFamily)));
74
74
  }
75
75
  });
76
76
  }
@@ -126,20 +126,20 @@ class I extends q {
126
126
  d(this.props.title || "")
127
127
  )
128
128
  );
129
- const s = ["tachui-button"];
129
+ const i = ["tachui-button"];
130
130
  return [{
131
131
  type: "element",
132
132
  tag: "button",
133
133
  props: {
134
- className: this.createClassString(this.props, s),
134
+ className: this.createClassString(this.props, i),
135
135
  type: "button",
136
136
  disabled: typeof e == "boolean" ? !e : !e(),
137
137
  // Invert enabled to disabled
138
138
  onClick: this.props.action ? () => {
139
139
  try {
140
140
  this.props.action?.();
141
- } catch (r) {
142
- console.error("Button action error:", r);
141
+ } catch (o) {
142
+ console.error("Button action error:", o);
143
143
  }
144
144
  } : void 0,
145
145
  // Pass through debug label for debug system
@@ -166,21 +166,21 @@ class I extends q {
166
166
  */
167
167
  hasColorModifiers() {
168
168
  let e = this.modifiers;
169
- return !e && this.modifierBuilder && (e = this.modifierBuilder.modifiers), !e && this.modifiableComponent && (e = this.modifiableComponent.modifiers), !e || !Array.isArray(e) ? !1 : e.some((t) => t.type === "appearance" || t.constructor?.name === "AppearanceModifier" ? t.properties && (t.properties.foregroundColor !== void 0 || t.properties.color !== void 0) : t.properties ? ["foregroundColor", "color", "textColor"].some((o) => t.properties[o] !== void 0) : !1);
169
+ return !e && this.modifierBuilder && (e = this.modifierBuilder.modifiers), !e && this.modifiableComponent && (e = this.modifiableComponent.modifiers), !e || !Array.isArray(e) ? !1 : e.some((t) => t.type === "appearance" || t.constructor?.name === "AppearanceModifier" ? t.properties && (t.properties.foregroundColor !== void 0 || t.properties.color !== void 0) : t.properties ? ["foregroundColor", "color", "textColor"].some((r) => t.properties[r] !== void 0) : !1);
170
170
  }
171
171
  /**
172
172
  * Check if the button has typography-related modifiers applied
173
173
  */
174
174
  hasTypographyModifiers() {
175
175
  let e = this.modifiers;
176
- return !e && this.modifierBuilder && (e = this.modifierBuilder.modifiers), !e && this.modifiableComponent && (e = this.modifiableComponent.modifiers), !e || !Array.isArray(e) ? !1 : e.some((s) => s.type === "typography" || s.constructor?.name === "TypographyModifier" ? s.properties && (s.properties.transform !== void 0 || s.properties.textTransform !== void 0) : !1);
176
+ return !e && this.modifierBuilder && (e = this.modifierBuilder.modifiers), !e && this.modifiableComponent && (e = this.modifiableComponent.modifiers), !e || !Array.isArray(e) ? !1 : e.some((i) => i.type === "typography" || i.constructor?.name === "TypographyModifier" ? i.properties && (i.properties.transform !== void 0 || i.properties.textTransform !== void 0) : !1);
177
177
  }
178
178
  /**
179
179
  * Check if the button has a shadow modifier applied
180
180
  */
181
181
  hasShadowModifier() {
182
182
  let e = this.modifiers;
183
- return !e && this.modifierBuilder && (e = this.modifierBuilder.modifiers), !e && this.modifiableComponent && (e = this.modifiableComponent.modifiers), !e || !Array.isArray(e) ? !1 : e.some((s) => s.type === "appearance" || s.type === "shadow" || s.constructor?.name === "AppearanceModifier" || s.constructor?.name === "ShadowModifier" ? s.properties && s.properties.shadow !== void 0 : !1);
183
+ return !e && this.modifierBuilder && (e = this.modifierBuilder.modifiers), !e && this.modifiableComponent && (e = this.modifiableComponent.modifiers), !e || !Array.isArray(e) ? !1 : e.some((i) => i.type === "appearance" || i.type === "shadow" || i.constructor?.name === "AppearanceModifier" || i.constructor?.name === "ShadowModifier" ? i.properties && i.properties.shadow !== void 0 : !1);
184
184
  }
185
185
  /**
186
186
  * Get computed button styles based on variant, size, role, and state
@@ -190,17 +190,17 @@ class I extends q {
190
190
  const {
191
191
  variant: e,
192
192
  size: t,
193
- role: s = "none",
194
- tint: o,
193
+ role: i = "none",
194
+ tint: r,
195
195
  backgroundColor: n,
196
- foregroundColor: r
197
- } = this.props, c = this.stateSignal(), u = this.isLoading(), T = this.isEnabled(), m = this.hasColorModifiers(), w = this.hasTypographyModifiers(), C = {
196
+ foregroundColor: o
197
+ } = this.props, c = this.stateSignal(), h = this.isLoading(), T = this.isEnabled(), g = this.hasColorModifiers(), v = this.hasTypographyModifiers(), w = {
198
198
  // Only set color property if no modifiers will handle it
199
199
  // This prevents conflicts between Button styles and AppearanceModifier
200
- ...!m && !r && !e && { color: "inherit" },
200
+ ...!g && !o && !e && { color: "inherit" },
201
201
  // Only set text-related properties if no typography modifiers will handle them
202
202
  // This prevents conflicts between Button styles and TypographyModifier
203
- ...!w && {
203
+ ...!v && {
204
204
  fontStyle: "inherit",
205
205
  lineHeight: "inherit",
206
206
  textTransform: "inherit",
@@ -215,40 +215,40 @@ class I extends q {
215
215
  // Let modifiers control: fontFamily, fontSize, fontWeight, letterSpacing, textAlign
216
216
  };
217
217
  if (t) {
218
- const L = this.theme.spacing[t] || this.theme.spacing.medium, Z = this.theme.borderRadius[t] || this.theme.borderRadius.medium, H = this.theme.typography[t] || this.theme.typography.medium, K = {
218
+ const k = this.theme.spacing[t] || this.theme.spacing.medium, K = this.theme.borderRadius[t] || this.theme.borderRadius.medium, H = this.theme.typography[t] || this.theme.typography.medium, q = {
219
219
  small: "32px",
220
220
  medium: "40px",
221
221
  large: "48px"
222
222
  };
223
- C.padding = `${L}px ${L * 2}px`, C.borderRadius = `${Z}px`, C.fontSize = `${H.size}px`, C.fontWeight = H.weight, C.minHeight = K[t];
223
+ w.padding = `${k}px ${k * 2}px`, w.borderRadius = `${K}px`, w.fontSize = `${H.size}px`, w.fontWeight = H.weight, w.minHeight = q[t];
224
224
  }
225
- let b = "transparent", v = "transparent", _ = "1px", k;
226
- const X = this.resolveColorValue(o), D = this.resolveColorValue(n), E = this.resolveColorValue(r);
225
+ let f = "transparent", S = "transparent", _ = "1px", C;
226
+ const Z = this.resolveColorValue(r), D = this.resolveColorValue(n), E = this.resolveColorValue(o);
227
227
  if (e) {
228
- const L = X || this.theme.colors.primary;
228
+ const k = Z || this.theme.colors.primary;
229
229
  switch (e) {
230
230
  case "filled":
231
- s === "destructive" ? b = this.theme.colors.destructive : s === "cancel" ? b = this.theme.colors.secondary : b = L, k = this.theme.colors.onPrimary;
231
+ i === "destructive" ? f = this.theme.colors.destructive : i === "cancel" ? f = this.theme.colors.secondary : f = k, C = this.theme.colors.onPrimary;
232
232
  break;
233
233
  case "outlined":
234
- v = s === "destructive" ? this.theme.colors.destructive : L, k = s === "destructive" ? this.theme.colors.destructive : L;
234
+ S = i === "destructive" ? this.theme.colors.destructive : k, C = i === "destructive" ? this.theme.colors.destructive : k;
235
235
  break;
236
236
  case "bordered":
237
- b = this.theme.colors.background, v = this.theme.colors.border;
237
+ f = this.theme.colors.background, S = this.theme.colors.border;
238
238
  break;
239
239
  case "borderedProminent":
240
- b = this.theme.colors.surface, v = this.theme.colors.primary, _ = "2px";
240
+ f = this.theme.colors.surface, S = this.theme.colors.primary, _ = "2px";
241
241
  break;
242
242
  }
243
243
  }
244
- D && (b = D), E && (k = E);
245
- let B = "1", O = "auto", M, V = "none";
246
- T ? u ? (B = "0.6", O = "none") : c === "pressed" ? (b = this.darkenColor(b, 0.1), v = this.darkenColor(v, 0.1), M = "scale(0.95)") : c === "focused" && (V = "0 0 0 3px #007AFF40") : (b = this.theme.colors.disabled, v = this.theme.colors.disabled, k = this.theme.colors.disabled, B = "0.6", O = "none");
244
+ D && (f = D), E && (C = E);
245
+ let P = "1", I = "auto", B, V = "none";
246
+ T ? h ? (P = "0.6", I = "none") : c === "pressed" ? (f = this.darkenColor(f, 0.1), S = this.darkenColor(S, 0.1), B = "scale(0.95)") : c === "focused" && (V = "0 0 0 3px #007AFF40") : (f = this.theme.colors.disabled, S = this.theme.colors.disabled, C = this.theme.colors.disabled, P = "0.6", I = "none");
247
247
  const p = {
248
- ...C
248
+ ...w
249
249
  // Size-based styles (only if size provided)
250
250
  };
251
- return e && (p.backgroundColor = b, p.borderColor = v, p.borderWidth = _, k !== void 0 && (p.color = k)), D && (p.backgroundColor = D), E && (p.color = E), p.cursor = T ? "pointer" : "not-allowed", p.opacity = B, p.pointerEvents = O, p.transform = M !== void 0 ? M : "none", this.hasShadowModifier() || (p.boxShadow = V), p.transition = "all 0.2s ease", p;
251
+ return e && (p.backgroundColor = f, p.borderColor = S, p.borderWidth = _, C !== void 0 && (p.color = C)), D && (p.backgroundColor = D), E && (p.color = E), p.cursor = T ? "pointer" : "not-allowed", p.opacity = P, p.pointerEvents = I, p.transform = B !== void 0 ? B : "none", this.hasShadowModifier() || (p.boxShadow = V), p.transition = "all 0.2s ease", p;
252
252
  }
253
253
  /**
254
254
  * Handle button press with proper state management
@@ -279,8 +279,8 @@ class I extends q {
279
279
  darkenColor(e, t) {
280
280
  if (e === "transparent") return e;
281
281
  if (e.startsWith("#")) {
282
- const s = e.slice(1), o = parseInt(s, 16), n = Math.max(0, Math.floor((o >> 16) * (1 - t))), r = Math.max(0, Math.floor((o >> 8 & 255) * (1 - t))), c = Math.max(0, Math.floor((o & 255) * (1 - t)));
283
- return `#${(n << 16 | r << 8 | c).toString(16).padStart(6, "0")}`;
282
+ const i = e.slice(1), r = parseInt(i, 16), n = Math.max(0, Math.floor((r >> 16) * (1 - t))), o = Math.max(0, Math.floor((r >> 8 & 255) * (1 - t))), c = Math.max(0, Math.floor((r & 255) * (1 - t)));
283
+ return `#${(n << 16 | o << 8 | c).toString(16).padStart(6, "0")}`;
284
284
  }
285
285
  return e;
286
286
  }
@@ -291,16 +291,16 @@ class I extends q {
291
291
  * Concatenate this button with another concatenatable component
292
292
  */
293
293
  concat(e) {
294
- const t = this.toSegment(), s = e.toSegment(), o = {
295
- totalSegments: e instanceof z ? e.segments.length + 1 : 2,
296
- accessibilityRole: e instanceof z ? this.mergeAccessibilityRoles(
294
+ const t = this.toSegment(), i = e.toSegment(), r = {
295
+ totalSegments: e instanceof R ? e.segments.length + 1 : 2,
296
+ accessibilityRole: e instanceof R ? this.mergeAccessibilityRoles(
297
297
  "composite",
298
298
  e.metadata.accessibilityRole
299
299
  ) : this.determineAccessibilityRole(e),
300
300
  semanticStructure: "inline"
301
301
  // Buttons are typically inline in concatenation
302
302
  };
303
- return new z([t, s], o);
303
+ return new R([t, i], r);
304
304
  }
305
305
  /**
306
306
  * Convert this button to a segment for concatenation
@@ -352,13 +352,13 @@ class I extends q {
352
352
  return e.deep ? this.deepClone() : this.shallowClone();
353
353
  }
354
354
  shallowClone() {
355
- const e = N(this.props), t = new I(e, this.theme);
355
+ const e = N(this.props), t = new F(e, this.theme);
356
356
  return this.syncStateToClone(t), U(t), t;
357
357
  }
358
358
  deepClone() {
359
359
  const e = N(this.props, {
360
360
  deep: !0
361
- }), t = new I(e, this.theme);
361
+ }), t = new F(e, this.theme);
362
362
  return this.syncStateToClone(t), U(t), t;
363
363
  }
364
364
  syncStateToClone(e) {
@@ -370,53 +370,59 @@ class I extends q {
370
370
  }
371
371
  }
372
372
  }
373
- function h(i, e, t = {}) {
374
- const s = typeof e == "function" ? e : void 0, n = {
373
+ function G(s, e, t = {}) {
374
+ const i = typeof e == "function" ? e : void 0, n = {
375
375
  ...e != null && typeof e != "function" ? e : t,
376
- title: i,
377
- ...s && { action: s }
378
- }, r = ee(I, n);
379
- return A(r);
376
+ title: s,
377
+ ...i && { action: i }
378
+ }, o = te(F, n);
379
+ return A(o);
380
380
  }
381
- const ge = {
381
+ function L(s) {
382
+ return (t, i, r = {}) => i == null || typeof i == "function" ? G(t, i, {
383
+ ...r,
384
+ ...s
385
+ }) : G(t, { ...i, ...s });
386
+ }
387
+ const me = {
382
388
  /**
383
389
  * Filled button (primary)
384
390
  */
385
- Filled: (i, e, t = {}) => e == null || typeof e == "function" ? h(i, e, { ...t, variant: "filled" }) : h(i, { ...e ?? {}, variant: "filled" }),
391
+ Filled: L({ variant: "filled" }),
386
392
  /**
387
393
  * Outlined button
388
394
  */
389
- Outlined: (i, e, t = {}) => e == null || typeof e == "function" ? h(i, e, { ...t, variant: "outlined" }) : h(i, { ...e ?? {}, variant: "outlined" }),
395
+ Outlined: L({ variant: "outlined" }),
390
396
  /**
391
397
  * Plain button (text only)
392
398
  */
393
- Plain: (i, e, t = {}) => e == null || typeof e == "function" ? h(i, e, { ...t, variant: "plain" }) : h(i, { ...e ?? {}, variant: "plain" }),
399
+ Plain: L({ variant: "plain" }),
394
400
  /**
395
401
  * Bordered button
396
402
  */
397
- Bordered: (i, e, t = {}) => e == null || typeof e == "function" ? h(i, e, { ...t, variant: "bordered" }) : h(i, { ...e ?? {}, variant: "bordered" }),
403
+ Bordered: L({ variant: "bordered" }),
398
404
  /**
399
405
  * Destructive button
400
406
  */
401
- Destructive: (i, e, t = {}) => e == null || typeof e == "function" ? h(i, e, { ...t, role: "destructive" }) : h(i, { ...e ?? {}, role: "destructive" }),
407
+ Destructive: L({ role: "destructive" }),
402
408
  /**
403
409
  * Cancel button
404
410
  */
405
- Cancel: (i, e, t = {}) => e == null || typeof e == "function" ? h(i, e, { ...t, role: "cancel" }) : h(i, { ...e ?? {}, role: "cancel" })
406
- }, ne = `
411
+ Cancel: L({ role: "cancel" })
412
+ }, re = `
407
413
  @keyframes spin {
408
414
  from { transform: rotate(0deg); }
409
415
  to { transform: rotate(360deg); }
410
416
  }
411
417
  `;
412
418
  if (typeof document < "u") {
413
- const i = document.createElement("style");
414
- i.textContent = ne, document.head.appendChild(i);
419
+ const s = document.createElement("style");
420
+ s.textContent = re, document.head.appendChild(s);
415
421
  }
416
- var oe = Object.defineProperty, re = (i, e, t) => e in i ? oe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, P = (i, e, t) => re(i, typeof e != "symbol" ? e + "" : e, t);
417
- class G {
422
+ var oe = Object.defineProperty, ae = (s, e, t) => e in s ? oe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, M = (s, e, t) => ae(s, typeof e != "symbol" ? e + "" : e, t);
423
+ class j {
418
424
  constructor(e) {
419
- P(this, "type", "component"), P(this, "id"), P(this, "props"), this.props = e, this.id = `enhanced-link-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
425
+ M(this, "type", "component"), M(this, "id"), M(this, "props"), this.props = e, this.id = `enhanced-link-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
420
426
  }
421
427
  resolveValue(e) {
422
428
  return l(e) ? e() : e;
@@ -429,14 +435,14 @@ class G {
429
435
  const e = this.resolveValue(this.props.target);
430
436
  if (e)
431
437
  return e;
432
- const t = this.resolveValue(this.props.destination), s = t instanceof URL ? t.toString() : t;
433
- return this.isExternalURL(s) ? "_blank" : "_self";
438
+ const t = this.resolveValue(this.props.destination), i = t instanceof URL ? t.toString() : t;
439
+ return this.isExternalURL(i) ? "_blank" : "_self";
434
440
  }
435
441
  getRoutingMode() {
436
442
  return this.resolveValue(this.props.routingMode) || "auto";
437
443
  }
438
444
  getRel() {
439
- const e = this.resolveValue(this.props.rel), t = this.getTarget(), s = this.getDestination(), n = this.isExternalURL(s) && t === "_blank" ? "noopener noreferrer" : "";
445
+ const e = this.resolveValue(this.props.rel), t = this.getTarget(), i = this.getDestination(), n = this.isExternalURL(i) && t === "_blank" ? "noopener noreferrer" : "";
440
446
  return e && n ? `${e} ${n}`.trim() : e || n;
441
447
  }
442
448
  getDownload() {
@@ -482,7 +488,7 @@ class G {
482
488
  } catch (n) {
483
489
  throw console.error("Link onBeforeNavigation error:", n), n;
484
490
  }
485
- const s = this.getTarget(), o = this.getRoutingMode();
491
+ const i = this.getTarget(), r = this.getRoutingMode();
486
492
  if (this.shouldUseInternalRouting(t)) {
487
493
  if (this.props.onInternalNavigation)
488
494
  try {
@@ -491,9 +497,9 @@ class G {
491
497
  } catch (n) {
492
498
  console.error("Link onInternalNavigation error:", n);
493
499
  }
494
- o === "spa" ? this.handleSPANavigation(t) : s === "_blank" ? window.open(t, s) : window.location.href = t;
500
+ r === "spa" ? this.handleSPANavigation(t) : i === "_blank" ? window.open(t, i) : window.location.href = t;
495
501
  } else
496
- s === "_blank" || s === "_top" || s === "_parent" ? window.open(t, s) : window.location.href = t;
502
+ i === "_blank" || i === "_top" || i === "_parent" ? window.open(t, i) : window.location.href = t;
497
503
  }
498
504
  handleSPANavigation(e) {
499
505
  typeof window < "u" && window.history && window.history.pushState ? (window.history.pushState(null, "", e), window.dispatchEvent(new PopStateEvent("popstate"))) : window.location.href = e;
@@ -513,9 +519,9 @@ class G {
513
519
  if (this.props.children)
514
520
  return this.renderChildren();
515
521
  let e;
516
- this.props.text ? e = this.props.text : l(this.props.destination) ? e = Q(() => this.getDestination()) : e = this.getDestination();
517
- const s = W(e).render();
518
- return Array.isArray(s) ? s : [s];
522
+ this.props.text ? e = this.props.text : l(this.props.destination) ? e = ee(() => this.getDestination()) : e = this.getDestination();
523
+ const i = W(e).render();
524
+ return Array.isArray(i) ? i : [i];
519
525
  }
520
526
  renderChildren() {
521
527
  const { children: e } = this.props;
@@ -523,43 +529,43 @@ class G {
523
529
  }
524
530
  renderChild(e) {
525
531
  if (typeof e == "string") {
526
- const s = W(e).render();
527
- return Array.isArray(s) ? s : [s];
532
+ const i = W(e).render();
533
+ return Array.isArray(i) ? i : [i];
528
534
  } else {
529
535
  const t = e.render();
530
536
  return Array.isArray(t) ? t : [t];
531
537
  }
532
538
  }
533
539
  render() {
534
- const e = this.renderContent(), t = this.isDisabled(), s = {
540
+ const e = this.renderContent(), t = this.isDisabled(), i = {
535
541
  id: this.id,
536
542
  "data-component": "enhanced-link"
537
543
  };
538
- l(this.props.destination) ? s.href = () => this.getDestination() : s.href = this.getDestination(), this.props.target && (l(this.props.target) ? s.target = () => this.getTarget() : s.target = this.getTarget());
539
- const o = this.getRel();
540
- o && (l(this.props.rel) || l(this.props.target) ? s.rel = () => this.getRel() : s.rel = o);
544
+ l(this.props.destination) ? i.href = () => this.getDestination() : i.href = this.getDestination(), this.props.target && (l(this.props.target) ? i.target = () => this.getTarget() : i.target = this.getTarget());
545
+ const r = this.getRel();
546
+ r && (l(this.props.rel) || l(this.props.target) ? i.rel = () => this.getRel() : i.rel = r);
541
547
  const n = this.getDownload();
542
- n !== void 0 && (l(this.props.download) ? s.download = () => this.getDownload() : n === !0 ? s.download = !0 : typeof n == "string" && (s.download = n));
543
- const r = this.getAccessibilityLabel();
544
- r && (l(this.props.accessibilityLabel) ? s["aria-label"] = () => this.getAccessibilityLabel() : s["aria-label"] = r);
548
+ n !== void 0 && (l(this.props.download) ? i.download = () => this.getDownload() : n === !0 ? i.download = !0 : typeof n == "string" && (i.download = n));
549
+ const o = this.getAccessibilityLabel();
550
+ o && (l(this.props.accessibilityLabel) ? i["aria-label"] = () => this.getAccessibilityLabel() : i["aria-label"] = o);
545
551
  const c = this.getAccessibilityHint();
546
- c && (l(this.props.accessibilityHint) ? s["aria-describedby"] = () => this.getAccessibilityHint() : s["aria-describedby"] = c);
547
- const u = this.getAccessibilityRole();
548
- return u && (l(this.props.accessibilityRole) ? s.role = () => this.getAccessibilityRole() : s.role = u), t && (s["aria-disabled"] = "true", s.tabindex = "-1"), s.onclick = (m) => this.handleClick(m), s.style = {
552
+ c && (l(this.props.accessibilityHint) ? i["aria-describedby"] = () => this.getAccessibilityHint() : i["aria-describedby"] = c);
553
+ const h = this.getAccessibilityRole();
554
+ return h && (l(this.props.accessibilityRole) ? i.role = () => this.getAccessibilityRole() : i.role = h), t && (i["aria-disabled"] = "true", i.tabindex = "-1"), i.onclick = (g) => this.handleClick(g), i.style = {
549
555
  textDecoration: "none",
550
556
  color: "inherit",
551
557
  cursor: t ? "not-allowed" : "pointer",
552
558
  opacity: t ? 0.6 : 1
553
- }, a("a", s, ...e);
559
+ }, a("a", i, ...e);
554
560
  }
555
561
  // Concatenation support
556
562
  concat(e) {
557
- const t = this.toSegment(), s = e.toSegment(), o = {
563
+ const t = this.toSegment(), i = e.toSegment(), r = {
558
564
  totalSegments: 2,
559
565
  accessibilityRole: "composite",
560
566
  semanticStructure: "inline"
561
567
  };
562
- return new z([t, s], o);
568
+ return new R([t, i], r);
563
569
  }
564
570
  toSegment() {
565
571
  return {
@@ -573,24 +579,24 @@ class G {
573
579
  return !0;
574
580
  }
575
581
  }
576
- function me(i, e) {
582
+ function ye(s, e) {
577
583
  if (e !== void 0) {
578
- const o = {
579
- text: i,
584
+ const r = {
585
+ text: s,
580
586
  destination: e
581
- }, n = new G(o);
587
+ }, n = new j(r);
582
588
  return A(n);
583
589
  }
584
- const t = i, s = new G(t);
585
- return A(s);
590
+ const t = s, i = new j(t);
591
+ return A(i);
586
592
  }
587
593
  const x = {
588
594
  /**
589
595
  * Create an external link that opens in a new tab
590
596
  */
591
- external(i, e, t = {}) {
597
+ external(s, e, t = {}) {
592
598
  return {
593
- destination: i,
599
+ destination: s,
594
600
  children: e,
595
601
  target: "_blank",
596
602
  routingMode: "external",
@@ -602,9 +608,9 @@ const x = {
602
608
  /**
603
609
  * Create an internal link for same-domain navigation
604
610
  */
605
- internal(i, e, t = {}) {
611
+ internal(s, e, t = {}) {
606
612
  return {
607
- destination: i,
613
+ destination: s,
608
614
  children: e,
609
615
  routingMode: "internal",
610
616
  target: "_self",
@@ -614,9 +620,9 @@ const x = {
614
620
  /**
615
621
  * Create a SPA link using History API
616
622
  */
617
- spa(i, e, t = {}) {
623
+ spa(s, e, t = {}) {
618
624
  return {
619
- destination: i,
625
+ destination: s,
620
626
  children: e,
621
627
  routingMode: "spa",
622
628
  target: "_self",
@@ -627,33 +633,33 @@ const x = {
627
633
  /**
628
634
  * Create an email link with optional subject and body
629
635
  */
630
- email(i, e, t, s) {
631
- let o = `mailto:${i}`;
636
+ email(s, e, t, i) {
637
+ let r = `mailto:${s}`;
632
638
  const n = new URLSearchParams();
633
- return e && n.append("subject", e), t && n.append("body", t), n.toString() && (o += `?${n.toString()}`), {
634
- destination: o,
635
- children: s || i,
636
- accessibilityLabel: `Send email to ${i}`,
639
+ return e && n.append("subject", e), t && n.append("body", t), n.toString() && (r += `?${n.toString()}`), {
640
+ destination: r,
641
+ children: i || s,
642
+ accessibilityLabel: `Send email to ${s}`,
637
643
  accessibilityHint: "Opens your email app"
638
644
  };
639
645
  },
640
646
  /**
641
647
  * Create a phone link with formatted display
642
648
  */
643
- phone(i, e) {
649
+ phone(s, e) {
644
650
  return {
645
- destination: `tel:${i.replace(/[^\d+]/g, "")}`,
646
- children: e || i,
647
- accessibilityLabel: `Call ${i}`,
651
+ destination: `tel:${s.replace(/[^\d+]/g, "")}`,
652
+ children: e || s,
653
+ accessibilityLabel: `Call ${s}`,
648
654
  accessibilityHint: "Opens your phone app"
649
655
  };
650
656
  },
651
657
  /**
652
658
  * Create a download link
653
659
  */
654
- download(i, e, t) {
660
+ download(s, e, t) {
655
661
  return {
656
- destination: i,
662
+ destination: s,
657
663
  children: t || `Download ${e || "file"}`,
658
664
  download: e || !0,
659
665
  accessibilityLabel: `Download ${e || "file"}`,
@@ -664,39 +670,39 @@ const x = {
664
670
  * Social media link utilities
665
671
  */
666
672
  social: {
667
- twitter(i, e) {
673
+ twitter(s, e) {
668
674
  return x.external(
669
- `https://twitter.com/${i}`,
670
- e || `@${i}`,
671
- { accessibilityLabel: `Visit ${i} on Twitter` }
675
+ `https://twitter.com/${s}`,
676
+ e || `@${s}`,
677
+ { accessibilityLabel: `Visit ${s} on Twitter` }
672
678
  );
673
679
  },
674
- github(i, e) {
680
+ github(s, e) {
675
681
  return x.external(
676
- `https://github.com/${i}`,
677
- e || i,
678
- { accessibilityLabel: `Visit ${i} on GitHub` }
682
+ `https://github.com/${s}`,
683
+ e || s,
684
+ { accessibilityLabel: `Visit ${s} on GitHub` }
679
685
  );
680
686
  },
681
- linkedin(i, e) {
687
+ linkedin(s, e) {
682
688
  return x.external(
683
- `https://linkedin.com/in/${i}`,
684
- e || i,
685
- { accessibilityLabel: `Visit ${i} on LinkedIn` }
689
+ `https://linkedin.com/in/${s}`,
690
+ e || s,
691
+ { accessibilityLabel: `Visit ${s} on LinkedIn` }
686
692
  );
687
693
  },
688
- instagram(i, e) {
694
+ instagram(s, e) {
689
695
  return x.external(
690
- `https://instagram.com/${i}`,
691
- e || `@${i}`,
692
- { accessibilityLabel: `Visit ${i} on Instagram` }
696
+ `https://instagram.com/${s}`,
697
+ e || `@${s}`,
698
+ { accessibilityLabel: `Visit ${s} on Instagram` }
693
699
  );
694
700
  },
695
- facebook(i, e) {
701
+ facebook(s, e) {
696
702
  return x.external(
697
- `https://facebook.com/${i}`,
698
- e || i,
699
- { accessibilityLabel: `Visit ${i} on Facebook` }
703
+ `https://facebook.com/${s}`,
704
+ e || s,
705
+ { accessibilityLabel: `Visit ${s} on Facebook` }
700
706
  );
701
707
  }
702
708
  },
@@ -704,9 +710,9 @@ const x = {
704
710
  * App store link utilities
705
711
  */
706
712
  appStore: {
707
- ios(i, e) {
713
+ ios(s, e) {
708
714
  return x.external(
709
- `https://apps.apple.com/app/id${i}`,
715
+ `https://apps.apple.com/app/id${s}`,
710
716
  e || "Download from App Store",
711
717
  {
712
718
  accessibilityLabel: "Download from the iOS App Store",
@@ -714,9 +720,9 @@ const x = {
714
720
  }
715
721
  );
716
722
  },
717
- android(i, e) {
723
+ android(s, e) {
718
724
  return x.external(
719
- `https://play.google.com/store/apps/details?id=${i}`,
725
+ `https://play.google.com/store/apps/details?id=${s}`,
720
726
  e || "Get it on Google Play",
721
727
  {
722
728
  accessibilityLabel: "Download from Google Play Store",
@@ -728,24 +734,24 @@ const x = {
728
734
  /**
729
735
  * Create a custom OpenURL action
730
736
  */
731
- openURLAction(i) {
732
- return (e) => i(e) ? "handled" : "systemAction";
737
+ openURLAction(s) {
738
+ return (e) => s(e) ? "handled" : "systemAction";
733
739
  }
734
740
  };
735
- var ae = Object.defineProperty, le = (i, e, t) => e in i ? ae(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, S = (i, e, t) => le(i, typeof e != "symbol" ? e + "" : e, t);
736
- class ce {
741
+ var le = Object.defineProperty, ce = (s, e, t) => e in s ? le(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, y = (s, e, t) => ce(s, typeof e != "symbol" ? e + "" : e, t);
742
+ class de {
737
743
  constructor(e) {
738
- S(this, "props", e), S(this, "type", "component"), S(this, "id"), S(this, "mounted", !1), S(this, "cleanup", []), S(this, "toggleElement", null), S(this, "setIsAnimating"), S(this, "handleToggle", async (s) => {
739
- if (s.preventDefault(), this.isDisabled()) return;
740
- const o = !this.getIsOn();
744
+ y(this, "props", e), y(this, "type", "component"), y(this, "id"), y(this, "mounted", !1), y(this, "cleanup", []), y(this, "toggleElement", null), y(this, "setIsAnimating"), y(this, "handleToggle", async (i) => {
745
+ if (i.preventDefault(), this.isDisabled()) return;
746
+ const r = !this.getIsOn();
741
747
  this.props.animated !== !1 && (this.setIsAnimating(!0), setTimeout(() => {
742
748
  this.setIsAnimating(!1);
743
- }, 200)), this.props.onToggle && this.props.onToggle(o);
749
+ }, 200)), this.props.onToggle && this.props.onToggle(r);
744
750
  }), this.id = `toggle-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
745
- const [, t] = F(!1);
746
- this.setIsAnimating = t, Y(() => {
747
- const s = this.getIsOn();
748
- this.toggleElement && this.toggleElement.checked !== s && (this.toggleElement.checked = s);
751
+ const [, t] = z(!1);
752
+ this.setIsAnimating = t, X(() => {
753
+ const i = this.getIsOn();
754
+ this.toggleElement && this.toggleElement.checked !== i && (this.toggleElement.checked = i);
749
755
  });
750
756
  }
751
757
  /**
@@ -843,12 +849,12 @@ class ce {
843
849
  * Render switch variant
844
850
  */
845
851
  renderSwitch() {
846
- const e = this.getIsOn(), t = this.isDisabled(), s = this.getSizeStyles(), {
847
- color: o = "#007AFF",
852
+ const e = this.getIsOn(), t = this.isDisabled(), i = this.getSizeStyles(), {
853
+ color: r = "#007AFF",
848
854
  offColor: n = "#e2e8f0",
849
- thumbColor: r = "#ffffff",
855
+ thumbColor: o = "#ffffff",
850
856
  animated: c = !0
851
- } = this.props, u = e ? o : n, T = e ? `translateX(${parseInt(s.width) - parseInt(s.thumbSize) - 2}px)` : "translateX(2px)", m = this.getInputAccessibilityProps();
857
+ } = this.props, h = e ? r : n, T = e ? `translateX(${parseInt(i.width) - parseInt(i.thumbSize) - 2}px)` : "translateX(2px)", g = this.getInputAccessibilityProps();
852
858
  return a(
853
859
  "div",
854
860
  {
@@ -859,13 +865,13 @@ class ce {
859
865
  },
860
866
  // Hidden input for form integration
861
867
  a("input", {
862
- ref: (w) => {
863
- this.toggleElement = w, w && !this.mounted && (w.addEventListener("change", this.handleToggle), this.cleanup.push(() => {
864
- w.removeEventListener("change", this.handleToggle);
868
+ ref: (v) => {
869
+ this.toggleElement = v, v && !this.mounted && (v.addEventListener("change", this.handleToggle), this.cleanup.push(() => {
870
+ v.removeEventListener("change", this.handleToggle);
865
871
  }));
866
872
  },
867
873
  type: "checkbox",
868
- id: m.id,
874
+ id: g.id,
869
875
  checked: e,
870
876
  disabled: t,
871
877
  style: {
@@ -876,19 +882,19 @@ class ce {
876
882
  margin: 0,
877
883
  cursor: t ? "not-allowed" : "pointer"
878
884
  },
879
- "aria-label": m["aria-label"],
880
- "aria-labelledby": m["aria-labelledby"],
881
- "aria-describedby": m["aria-describedby"]
885
+ "aria-label": g["aria-label"],
886
+ "aria-labelledby": g["aria-labelledby"],
887
+ "aria-describedby": g["aria-describedby"]
882
888
  }),
883
889
  // Switch track
884
890
  a(
885
891
  "div",
886
892
  {
887
893
  style: {
888
- width: s.width,
889
- height: s.height,
890
- backgroundColor: u,
891
- borderRadius: s.height,
894
+ width: i.width,
895
+ height: i.height,
896
+ backgroundColor: h,
897
+ borderRadius: i.height,
892
898
  position: "relative",
893
899
  cursor: t ? "not-allowed" : "pointer",
894
900
  opacity: t ? 0.5 : 1,
@@ -900,9 +906,9 @@ class ce {
900
906
  // Switch thumb
901
907
  a("div", {
902
908
  style: {
903
- width: s.thumbSize,
904
- height: s.thumbSize,
905
- backgroundColor: r,
909
+ width: i.thumbSize,
910
+ height: i.thumbSize,
911
+ backgroundColor: o,
906
912
  borderRadius: "50%",
907
913
  position: "absolute",
908
914
  top: "50%",
@@ -919,7 +925,7 @@ class ce {
919
925
  * Render checkbox variant
920
926
  */
921
927
  renderCheckbox() {
922
- const e = this.getIsOn(), t = this.isDisabled(), s = this.getSizeStyles(), { color: o = "#007AFF" } = this.props, n = this.getInputAccessibilityProps();
928
+ const e = this.getIsOn(), t = this.isDisabled(), i = this.getSizeStyles(), { color: r = "#007AFF" } = this.props, n = this.getInputAccessibilityProps();
923
929
  return a(
924
930
  "div",
925
931
  {
@@ -930,9 +936,9 @@ class ce {
930
936
  },
931
937
  // Hidden input
932
938
  a("input", {
933
- ref: (r) => {
934
- this.toggleElement = r, r && !this.mounted && (r.addEventListener("change", this.handleToggle), this.cleanup.push(() => {
935
- r.removeEventListener("change", this.handleToggle);
939
+ ref: (o) => {
940
+ this.toggleElement = o, o && !this.mounted && (o.addEventListener("change", this.handleToggle), this.cleanup.push(() => {
941
+ o.removeEventListener("change", this.handleToggle);
936
942
  }));
937
943
  },
938
944
  type: "checkbox",
@@ -956,11 +962,11 @@ class ce {
956
962
  "div",
957
963
  {
958
964
  style: {
959
- width: s.thumbSize,
960
- height: s.thumbSize,
961
- border: `2px solid ${e ? o : "#d1d5db"}`,
965
+ width: i.thumbSize,
966
+ height: i.thumbSize,
967
+ border: `2px solid ${e ? r : "#d1d5db"}`,
962
968
  borderRadius: "4px",
963
- backgroundColor: e ? o : "#ffffff",
969
+ backgroundColor: e ? r : "#ffffff",
964
970
  display: "flex",
965
971
  alignItems: "center",
966
972
  justifyContent: "center",
@@ -991,24 +997,24 @@ class ce {
991
997
  * Render button variant
992
998
  */
993
999
  renderButton() {
994
- const e = this.getIsOn(), t = this.isDisabled(), s = this.getSizeStyles(), { color: o = "#007AFF", offColor: n = "#f3f4f6" } = this.props;
1000
+ const e = this.getIsOn(), t = this.isDisabled(), i = this.getSizeStyles(), { color: r = "#007AFF", offColor: n = "#f3f4f6" } = this.props;
995
1001
  return a(
996
1002
  "button",
997
1003
  {
998
- ref: (r) => {
999
- r && !this.mounted && (r.addEventListener("click", this.handleToggle), this.cleanup.push(() => {
1000
- r.removeEventListener("click", this.handleToggle);
1004
+ ref: (o) => {
1005
+ o && !this.mounted && (o.addEventListener("click", this.handleToggle), this.cleanup.push(() => {
1006
+ o.removeEventListener("click", this.handleToggle);
1001
1007
  }));
1002
1008
  },
1003
1009
  type: "button",
1004
1010
  disabled: t,
1005
1011
  style: {
1006
1012
  padding: "8px 16px",
1007
- backgroundColor: e ? o : n,
1013
+ backgroundColor: e ? r : n,
1008
1014
  color: e ? "#ffffff" : "#374151",
1009
- border: `1px solid ${e ? o : "#d1d5db"}`,
1015
+ border: `1px solid ${e ? r : "#d1d5db"}`,
1010
1016
  borderRadius: "6px",
1011
- fontSize: s.fontSize,
1017
+ fontSize: i.fontSize,
1012
1018
  fontWeight: "500",
1013
1019
  cursor: t ? "not-allowed" : "pointer",
1014
1020
  opacity: t ? 0.5 : 1,
@@ -1041,13 +1047,13 @@ class ce {
1041
1047
  renderLabel(e = !1) {
1042
1048
  const t = this.resolveLabel();
1043
1049
  if (!t) return null;
1044
- const s = this.getSizeStyles();
1050
+ const i = this.getSizeStyles();
1045
1051
  return a(
1046
1052
  "span",
1047
1053
  {
1048
1054
  id: this.getLabelId(),
1049
1055
  style: {
1050
- fontSize: s.fontSize,
1056
+ fontSize: i.fontSize,
1051
1057
  color: this.isDisabled() ? "#9ca3af" : "#374151",
1052
1058
  cursor: this.isDisabled() ? "not-allowed" : "pointer"
1053
1059
  },
@@ -1060,15 +1066,15 @@ class ce {
1060
1066
  const {
1061
1067
  variant: e = "switch",
1062
1068
  labelPosition: t = "trailing",
1063
- spacing: s = 8,
1064
- accessibilityHint: o
1065
- } = this.props, n = this.renderLabel(e === "button"), r = this.renderToggleControl(), c = t === "leading" && n ? [n, r] : n ? [r, n] : [r], u = e === "button" ? a(
1069
+ spacing: i = 8,
1070
+ accessibilityHint: r
1071
+ } = this.props, n = this.renderLabel(e === "button"), o = this.renderToggleControl(), c = t === "leading" && n ? [n, o] : n ? [o, n] : [o], h = e === "button" ? a(
1066
1072
  "div",
1067
1073
  {
1068
1074
  style: {
1069
1075
  display: "flex",
1070
1076
  alignItems: "center",
1071
- gap: n ? `${s}px` : "0",
1077
+ gap: n ? `${i}px` : "0",
1072
1078
  cursor: this.isDisabled() ? "not-allowed" : "pointer"
1073
1079
  }
1074
1080
  },
@@ -1080,7 +1086,7 @@ class ce {
1080
1086
  style: {
1081
1087
  display: "flex",
1082
1088
  alignItems: "center",
1083
- gap: n ? `${s}px` : "0",
1089
+ gap: n ? `${i}px` : "0",
1084
1090
  cursor: this.isDisabled() ? "not-allowed" : "pointer"
1085
1091
  }
1086
1092
  },
@@ -1089,10 +1095,10 @@ class ce {
1089
1095
  return a(
1090
1096
  "div",
1091
1097
  {
1092
- "aria-describedby": o ? `${this.id}-hint` : void 0
1098
+ "aria-describedby": r ? `${this.id}-hint` : void 0
1093
1099
  },
1094
- u,
1095
- ...o ? [
1100
+ h,
1101
+ ...r ? [
1096
1102
  a(
1097
1103
  "div",
1098
1104
  {
@@ -1105,75 +1111,75 @@ class ce {
1105
1111
  width: "100%"
1106
1112
  }
1107
1113
  },
1108
- d(o)
1114
+ d(r)
1109
1115
  )
1110
1116
  ] : []
1111
1117
  );
1112
1118
  }
1113
1119
  }
1114
- function g(i, e = {}) {
1115
- const t = { ...e, isOn: i }, s = new ce(t);
1116
- return A(s);
1120
+ function b(s, e = {}) {
1121
+ const t = { ...e, isOn: s }, i = new de(t);
1122
+ return A(i);
1117
1123
  }
1118
- function j(i, e, t = {}) {
1119
- return g(e, { ...t, label: i });
1124
+ function Y(s, e, t = {}) {
1125
+ return b(e, { ...t, label: s });
1120
1126
  }
1121
- const ye = {
1127
+ const Se = {
1122
1128
  /**
1123
1129
  * Switch toggle (default)
1124
1130
  */
1125
- Switch(i, e = {}) {
1126
- return g(i, { ...e, variant: "switch" });
1131
+ Switch(s, e = {}) {
1132
+ return b(s, { ...e, variant: "switch" });
1127
1133
  },
1128
1134
  /**
1129
1135
  * Checkbox toggle
1130
1136
  */
1131
- Checkbox(i, e = {}) {
1132
- return g(i, { ...e, variant: "checkbox" });
1137
+ Checkbox(s, e = {}) {
1138
+ return b(s, { ...e, variant: "checkbox" });
1133
1139
  },
1134
1140
  /**
1135
1141
  * Button toggle
1136
1142
  */
1137
- Button(i, e = {}) {
1138
- return g(i, { ...e, variant: "button" });
1143
+ Button(s, e = {}) {
1144
+ return b(s, { ...e, variant: "button" });
1139
1145
  },
1140
1146
  /**
1141
1147
  * Small toggle
1142
1148
  */
1143
- Small(i, e = {}) {
1144
- return g(i, { ...e, size: "small" });
1149
+ Small(s, e = {}) {
1150
+ return b(s, { ...e, size: "small" });
1145
1151
  },
1146
1152
  /**
1147
1153
  * Large toggle
1148
1154
  */
1149
- Large(i, e = {}) {
1150
- return g(i, { ...e, size: "large" });
1155
+ Large(s, e = {}) {
1156
+ return b(s, { ...e, size: "large" });
1151
1157
  },
1152
1158
  /**
1153
1159
  * Custom color toggle
1154
1160
  */
1155
- CustomColor(i, e, t = {}) {
1156
- return g(i, { ...t, color: e });
1161
+ CustomColor(s, e, t = {}) {
1162
+ return b(s, { ...t, color: e });
1157
1163
  },
1158
1164
  /**
1159
1165
  * Toggle with leading label
1160
1166
  */
1161
- WithLeadingLabel(i, e, t = {}) {
1162
- return g(e, { ...t, label: i, labelPosition: "leading" });
1167
+ WithLeadingLabel(s, e, t = {}) {
1168
+ return b(e, { ...t, label: s, labelPosition: "leading" });
1163
1169
  },
1164
1170
  /**
1165
1171
  * Toggle with trailing label (default)
1166
1172
  */
1167
- WithTrailingLabel(i, e, t = {}) {
1168
- return g(e, { ...t, label: i, labelPosition: "trailing" });
1173
+ WithTrailingLabel(s, e, t = {}) {
1174
+ return b(e, { ...t, label: s, labelPosition: "trailing" });
1169
1175
  }
1170
- }, Se = {
1176
+ }, xe = {
1171
1177
  /**
1172
1178
  * Create a toggle group with multiple options
1173
1179
  */
1174
- createGroup(i, e = {}) {
1175
- return i.map(
1176
- (t) => j(t.label, t.isOn, {
1180
+ createGroup(s, e = {}) {
1181
+ return s.map(
1182
+ (t) => Y(t.label, t.isOn, {
1177
1183
  ...e,
1178
1184
  onToggle: t.onToggle
1179
1185
  })
@@ -1182,13 +1188,13 @@ const ye = {
1182
1188
  /**
1183
1189
  * Create exclusive toggle group (radio-like behavior)
1184
1190
  */
1185
- createExclusiveGroup(i, e, t, s = {}) {
1186
- const o = () => l(e) ? e() : e;
1187
- return i.map(
1188
- (n) => j(n.label, o() === n.key, {
1189
- ...s,
1190
- onToggle: (r) => {
1191
- r && t && t(n.key);
1191
+ createExclusiveGroup(s, e, t, i = {}) {
1192
+ const r = () => l(e) ? e() : e;
1193
+ return s.map(
1194
+ (n) => Y(n.label, r() === n.key, {
1195
+ ...i,
1196
+ onToggle: (o) => {
1197
+ o && t && t(n.key);
1192
1198
  }
1193
1199
  })
1194
1200
  );
@@ -1200,47 +1206,47 @@ const ye = {
1200
1206
  /**
1201
1207
  * Toggle all items in a group
1202
1208
  */
1203
- toggleAll(i, e) {
1204
- i.forEach((t) => {
1209
+ toggleAll(s, e) {
1210
+ s.forEach((t) => {
1205
1211
  t.onToggle && t.onToggle(e);
1206
1212
  });
1207
1213
  },
1208
1214
  /**
1209
1215
  * Get state of all toggles in a group
1210
1216
  */
1211
- getStates(i) {
1212
- return i.map((e) => l(e.isOn) ? e.isOn() : e.isOn);
1217
+ getStates(s) {
1218
+ return s.map((e) => l(e.isOn) ? e.isOn() : e.isOn);
1213
1219
  },
1214
1220
  /**
1215
1221
  * Check if all toggles are on
1216
1222
  */
1217
- allOn(i) {
1218
- return this.getStates(i).every((e) => e);
1223
+ allOn(s) {
1224
+ return this.getStates(s).every((e) => e);
1219
1225
  },
1220
1226
  /**
1221
1227
  * Check if any toggle is on
1222
1228
  */
1223
- anyOn(i) {
1224
- return this.getStates(i).some((e) => e);
1229
+ anyOn(s) {
1230
+ return this.getStates(s).some((e) => e);
1225
1231
  }
1226
1232
  }
1227
1233
  };
1228
- var de = Object.defineProperty, pe = (i, e, t) => e in i ? de(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, f = (i, e, t) => pe(i, typeof e != "symbol" ? e + "" : e, t);
1229
- class he {
1234
+ var pe = Object.defineProperty, he = (s, e, t) => e in s ? pe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, u = (s, e, t) => he(s, typeof e != "symbol" ? e + "" : e, t);
1235
+ class ue {
1230
1236
  constructor(e) {
1231
- f(this, "props", e), f(this, "type", "component"), f(this, "id"), f(this, "mounted", !1), f(this, "cleanup", []), f(this, "isOpen"), f(this, "setIsOpen"), f(this, "searchTerm"), f(this, "setSearchTerm"), f(this, "handleSelection", (r) => {
1232
- this.props.onSelectionChange && this.props.onSelectionChange(r), (this.props.variant === "dropdown" || this.props.variant === "menu") && this.setIsOpen(!1), this.setSearchTerm("");
1233
- }), f(this, "toggleOpen", () => {
1237
+ u(this, "props", e), u(this, "type", "component"), u(this, "id"), u(this, "mounted", !1), u(this, "cleanup", []), u(this, "isOpen"), u(this, "setIsOpen"), u(this, "searchTerm"), u(this, "setSearchTerm"), u(this, "handleSelection", (o) => {
1238
+ this.props.onSelectionChange && this.props.onSelectionChange(o), (this.props.variant === "dropdown" || this.props.variant === "menu") && this.setIsOpen(!1), this.setSearchTerm("");
1239
+ }), u(this, "toggleOpen", () => {
1234
1240
  this.isDisabled() || this.setIsOpen(!this.isOpen());
1235
1241
  }), this.id = `picker-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1236
- const [t, s] = F(!1), [o, n] = F("");
1237
- if (this.isOpen = t, this.setIsOpen = s, this.searchTerm = o, this.setSearchTerm = n, typeof window < "u") {
1238
- const r = (c) => {
1239
- const u = document.getElementById(this.id);
1240
- u && !u.contains(c.target) && this.setIsOpen(!1);
1242
+ const [t, i] = z(!1), [r, n] = z("");
1243
+ if (this.isOpen = t, this.setIsOpen = i, this.searchTerm = r, this.setSearchTerm = n, typeof window < "u") {
1244
+ const o = (c) => {
1245
+ const h = document.getElementById(this.id);
1246
+ h && !h.contains(c.target) && this.setIsOpen(!1);
1241
1247
  };
1242
- document.addEventListener("click", r), this.cleanup.push(() => {
1243
- document.removeEventListener("click", r);
1248
+ document.addEventListener("click", o), this.cleanup.push(() => {
1249
+ document.removeEventListener("click", o);
1244
1250
  });
1245
1251
  }
1246
1252
  }
@@ -1264,7 +1270,7 @@ class he {
1264
1270
  getFilteredOptions() {
1265
1271
  const e = this.getOptions(), t = this.searchTerm().toLowerCase();
1266
1272
  return !t || !this.props.searchable ? e : e.filter(
1267
- (s) => s.label.toLowerCase().includes(t) || s.description?.toLowerCase().includes(t)
1273
+ (i) => i.label.toLowerCase().includes(t) || i.description?.toLowerCase().includes(t)
1268
1274
  );
1269
1275
  }
1270
1276
  /**
@@ -1279,7 +1285,7 @@ class he {
1279
1285
  */
1280
1286
  getSelectedOption() {
1281
1287
  const e = this.getSelection();
1282
- return this.getOptions().find((s) => s.value === e) || null;
1288
+ return this.getOptions().find((i) => i.value === e) || null;
1283
1289
  }
1284
1290
  /**
1285
1291
  * Get picker size styles
@@ -1311,7 +1317,7 @@ class he {
1311
1317
  * Render dropdown variant
1312
1318
  */
1313
1319
  renderDropdown() {
1314
- const e = this.getSelectedOption(), t = this.getFilteredOptions(), s = this.getSizeStyles(), o = this.isOpen();
1320
+ const e = this.getSelectedOption(), t = this.getFilteredOptions(), i = this.getSizeStyles(), r = this.isOpen();
1315
1321
  return a(
1316
1322
  "div",
1317
1323
  {
@@ -1330,7 +1336,7 @@ class he {
1330
1336
  onClick: this.toggleOpen,
1331
1337
  disabled: this.isDisabled(),
1332
1338
  style: {
1333
- ...s,
1339
+ ...i,
1334
1340
  width: "100%",
1335
1341
  display: "flex",
1336
1342
  alignItems: "center",
@@ -1340,7 +1346,7 @@ class he {
1340
1346
  borderRadius: "6px",
1341
1347
  cursor: this.isDisabled() ? "not-allowed" : "pointer",
1342
1348
  opacity: this.isDisabled() ? 0.6 : 1,
1343
- ...o && {
1349
+ ...r && {
1344
1350
  borderColor: this.props.tint || "#007AFF",
1345
1351
  boxShadow: `0 0 0 1px ${this.props.tint || "#007AFF"}`
1346
1352
  }
@@ -1363,14 +1369,14 @@ class he {
1363
1369
  style: {
1364
1370
  fontSize: "12px",
1365
1371
  color: "#6b7280",
1366
- transform: o ? "rotate(180deg)" : "rotate(0deg)",
1372
+ transform: r ? "rotate(180deg)" : "rotate(0deg)",
1367
1373
  transition: "transform 0.2s"
1368
1374
  }
1369
1375
  },
1370
1376
  d("▼")
1371
1377
  )
1372
1378
  ),
1373
- ...o ? [
1379
+ ...r ? [
1374
1380
  a(
1375
1381
  "div",
1376
1382
  {
@@ -1403,8 +1409,8 @@ class he {
1403
1409
  placeholder: "Search options...",
1404
1410
  value: this.searchTerm(),
1405
1411
  onInput: (n) => {
1406
- const r = n.target;
1407
- this.setSearchTerm(r.value);
1412
+ const o = n.target;
1413
+ this.setSearchTerm(o.value);
1408
1414
  },
1409
1415
  style: {
1410
1416
  width: "100%",
@@ -1490,7 +1496,7 @@ class he {
1490
1496
  * Render segmented variant
1491
1497
  */
1492
1498
  renderSegmented() {
1493
- const e = this.getOptions(), t = this.getSelection(), s = this.getSizeStyles();
1499
+ const e = this.getOptions(), t = this.getSelection(), i = this.getSizeStyles();
1494
1500
  return a(
1495
1501
  "div",
1496
1502
  {
@@ -1504,33 +1510,33 @@ class he {
1504
1510
  "aria-label": this.props.accessibilityLabel
1505
1511
  },
1506
1512
  ...e.map(
1507
- (o, n) => a(
1513
+ (r, n) => a(
1508
1514
  "button",
1509
1515
  {
1510
1516
  type: "button",
1511
- key: String(o.value),
1512
- onClick: () => this.handleSelection(o.value),
1513
- disabled: o.disabled || this.isDisabled(),
1517
+ key: String(r.value),
1518
+ onClick: () => this.handleSelection(r.value),
1519
+ disabled: r.disabled || this.isDisabled(),
1514
1520
  role: "radio",
1515
- "aria-checked": o.value === t,
1521
+ "aria-checked": r.value === t,
1516
1522
  style: {
1517
- ...s,
1523
+ ...i,
1518
1524
  flex: 1,
1519
1525
  border: "none",
1520
1526
  borderRadius: "6px",
1521
- backgroundColor: o.value === t ? "#ffffff" : "transparent",
1522
- color: o.value === t ? "#1a1a1a" : "#6b7280",
1523
- fontWeight: o.value === t ? "600" : "400",
1524
- cursor: o.disabled || this.isDisabled() ? "not-allowed" : "pointer",
1525
- opacity: o.disabled || this.isDisabled() ? 0.5 : 1,
1526
- boxShadow: o.value === t ? "0 1px 2px rgba(0, 0, 0, 0.1)" : "none",
1527
+ backgroundColor: r.value === t ? "#ffffff" : "transparent",
1528
+ color: r.value === t ? "#1a1a1a" : "#6b7280",
1529
+ fontWeight: r.value === t ? "600" : "400",
1530
+ cursor: r.disabled || this.isDisabled() ? "not-allowed" : "pointer",
1531
+ opacity: r.disabled || this.isDisabled() ? 0.5 : 1,
1532
+ boxShadow: r.value === t ? "0 1px 2px rgba(0, 0, 0, 0.1)" : "none",
1527
1533
  transition: "all 0.2s",
1528
1534
  margin: "0",
1529
1535
  ...n === 0 && { marginRight: "1px" },
1530
1536
  ...n === e.length - 1 && { marginLeft: "1px" }
1531
1537
  }
1532
1538
  },
1533
- ...o.icon ? [
1539
+ ...r.icon ? [
1534
1540
  a(
1535
1541
  "span",
1536
1542
  {
@@ -1539,10 +1545,10 @@ class he {
1539
1545
  fontSize: "14px"
1540
1546
  }
1541
1547
  },
1542
- d(o.icon)
1548
+ d(r.icon)
1543
1549
  )
1544
1550
  ] : [],
1545
- d(o.label)
1551
+ d(r.label)
1546
1552
  )
1547
1553
  )
1548
1554
  );
@@ -1556,9 +1562,9 @@ class he {
1556
1562
  "select",
1557
1563
  {
1558
1564
  value: String(t),
1559
- onChange: (s) => {
1560
- const o = s.target, n = e.find(
1561
- (r) => String(r.value) === o.value
1565
+ onChange: (i) => {
1566
+ const r = i.target, n = e.find(
1567
+ (o) => String(o.value) === r.value
1562
1568
  );
1563
1569
  n && this.handleSelection(n.value);
1564
1570
  },
@@ -1574,14 +1580,14 @@ class he {
1574
1580
  }
1575
1581
  },
1576
1582
  ...e.map(
1577
- (s) => a(
1583
+ (i) => a(
1578
1584
  "option",
1579
1585
  {
1580
- key: String(s.value),
1581
- value: String(s.value),
1582
- disabled: s.disabled
1586
+ key: String(i.value),
1587
+ value: String(i.value),
1588
+ disabled: i.disabled
1583
1589
  },
1584
- d(s.label)
1590
+ d(i.label)
1585
1591
  )
1586
1592
  )
1587
1593
  );
@@ -1590,10 +1596,10 @@ class he {
1590
1596
  const {
1591
1597
  variant: e = "dropdown",
1592
1598
  accessibilityLabel: t,
1593
- accessibilityHint: s
1594
- } = this.props, o = {
1599
+ accessibilityHint: i
1600
+ } = this.props, r = {
1595
1601
  "aria-label": t,
1596
- "aria-describedby": s ? `${this.id}-hint` : void 0
1602
+ "aria-describedby": i ? `${this.id}-hint` : void 0
1597
1603
  };
1598
1604
  let n;
1599
1605
  switch (e) {
@@ -1609,9 +1615,9 @@ class he {
1609
1615
  }
1610
1616
  return a(
1611
1617
  "div",
1612
- o,
1618
+ r,
1613
1619
  n,
1614
- ...s ? [
1620
+ ...i ? [
1615
1621
  a(
1616
1622
  "div",
1617
1623
  {
@@ -1622,51 +1628,51 @@ class he {
1622
1628
  marginTop: "4px"
1623
1629
  }
1624
1630
  },
1625
- d(s)
1631
+ d(i)
1626
1632
  )
1627
1633
  ] : []
1628
1634
  );
1629
1635
  }
1630
1636
  }
1631
- function R(i, e, t = {}) {
1632
- const s = { ...t, selection: i, options: e }, o = new he(s);
1633
- return A(o);
1637
+ function O(s, e, t = {}) {
1638
+ const i = { ...t, selection: s, options: e }, r = new ue(i);
1639
+ return A(r);
1634
1640
  }
1635
1641
  const ve = {
1636
1642
  /**
1637
1643
  * Dropdown picker (default)
1638
1644
  */
1639
1645
  // biome-ignore lint/suspicious/noExplicitAny: Generic dropdown picker requires flexible type
1640
- Dropdown(i, e, t = {}) {
1641
- return R(i, e, { ...t, variant: "dropdown" });
1646
+ Dropdown(s, e, t = {}) {
1647
+ return O(s, e, { ...t, variant: "dropdown" });
1642
1648
  },
1643
1649
  /**
1644
1650
  * Segmented picker
1645
1651
  */
1646
1652
  // biome-ignore lint/suspicious/noExplicitAny: Generic segmented picker requires flexible type
1647
- Segmented(i, e, t = {}) {
1648
- return R(i, e, { ...t, variant: "segmented" });
1653
+ Segmented(s, e, t = {}) {
1654
+ return O(s, e, { ...t, variant: "segmented" });
1649
1655
  },
1650
1656
  /**
1651
1657
  * Wheel picker (native select)
1652
1658
  */
1653
1659
  // biome-ignore lint/suspicious/noExplicitAny: Generic wheel picker requires flexible type
1654
- Wheel(i, e, t = {}) {
1655
- return R(i, e, { ...t, variant: "wheel" });
1660
+ Wheel(s, e, t = {}) {
1661
+ return O(s, e, { ...t, variant: "wheel" });
1656
1662
  },
1657
1663
  /**
1658
1664
  * Menu picker
1659
1665
  */
1660
1666
  // biome-ignore lint/suspicious/noExplicitAny: Generic menu picker requires flexible type
1661
- Menu(i, e, t = {}) {
1662
- return R(i, e, { ...t, variant: "menu" });
1667
+ Menu(s, e, t = {}) {
1668
+ return O(s, e, { ...t, variant: "menu" });
1663
1669
  }
1664
- }, xe = {
1670
+ }, we = {
1665
1671
  /**
1666
1672
  * Create options from simple array
1667
1673
  */
1668
- fromArray(i, e) {
1669
- return i.map((t) => ({
1674
+ fromArray(s, e) {
1675
+ return s.map((t) => ({
1670
1676
  value: t,
1671
1677
  label: String(e && typeof t == "object" && t !== null ? t[e] : t)
1672
1678
  }));
@@ -1674,8 +1680,8 @@ const ve = {
1674
1680
  /**
1675
1681
  * Create options from enum
1676
1682
  */
1677
- fromEnum(i) {
1678
- return Object.entries(i).map(([e, t]) => ({
1683
+ fromEnum(s) {
1684
+ return Object.entries(s).map(([e, t]) => ({
1679
1685
  value: t,
1680
1686
  label: e.replace(/([A-Z])/g, " $1").trim()
1681
1687
  }));
@@ -1683,30 +1689,30 @@ const ve = {
1683
1689
  /**
1684
1690
  * Group options by category
1685
1691
  */
1686
- grouped(i) {
1687
- return i.reduce(
1692
+ grouped(s) {
1693
+ return s.reduce(
1688
1694
  (e, t) => {
1689
- const s = t.category || "Other";
1690
- return e[s] || (e[s] = []), e[s].push(t), e;
1695
+ const i = t.category || "Other";
1696
+ return e[i] || (e[i] = []), e[i].push(t), e;
1691
1697
  },
1692
1698
  {}
1693
1699
  );
1694
1700
  }
1695
1701
  };
1696
1702
  export {
1697
- h as B,
1698
- I as E,
1699
- me as L,
1700
- R as P,
1701
- g as T,
1702
- ge as a,
1703
- he as b,
1704
- ce as c,
1703
+ G as B,
1704
+ F as E,
1705
+ ye as L,
1706
+ O as P,
1707
+ b as T,
1708
+ me as a,
1709
+ ue as b,
1710
+ de as c,
1705
1711
  x as d,
1706
1712
  ve as e,
1707
- xe as f,
1708
- ye as g,
1709
- Se as h,
1710
- j as i,
1711
- se as j
1713
+ we as f,
1714
+ Se as g,
1715
+ xe as h,
1716
+ Y as i,
1717
+ ne as j
1712
1718
  };