@webstrail/ui-library 1.0.2 → 1.0.3

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 (43) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +4 -6
  4. package/dist/index.js +1248 -817
  5. package/dist/index.js.map +1 -1
  6. package/dist/style.css +1 -1
  7. package/package.json +3 -19
  8. package/dist/UIProvider-C3ae0nQV.cjs +0 -2
  9. package/dist/UIProvider-C3ae0nQV.cjs.map +0 -1
  10. package/dist/UIProvider-CHECrDaZ.js +0 -466
  11. package/dist/UIProvider-CHECrDaZ.js.map +0 -1
  12. package/dist/core/config/globalConfig.d.ts +0 -54
  13. package/dist/core/config/index.d.ts +0 -1
  14. package/dist/core/index.d.ts +0 -4
  15. package/dist/core/theme/defaultTheme.d.ts +0 -7
  16. package/dist/core/theme/deriveTokens.d.ts +0 -16
  17. package/dist/core/theme/index.d.ts +0 -2
  18. package/dist/core/types/common.d.ts +0 -32
  19. package/dist/core/types/config.d.ts +0 -70
  20. package/dist/core/types/index.d.ts +0 -3
  21. package/dist/core/types/tokens.d.ts +0 -65
  22. package/dist/core/utils/styles.d.ts +0 -19
  23. package/dist/core.cjs +0 -2
  24. package/dist/core.cjs.map +0 -1
  25. package/dist/core.js +0 -344
  26. package/dist/core.js.map +0 -1
  27. package/dist/react/components/Button/Button.d.ts +0 -2
  28. package/dist/react/components/Button/Button.types.d.ts +0 -52
  29. package/dist/react/components/Button/index.d.ts +0 -2
  30. package/dist/react/index.d.ts +0 -6
  31. package/dist/react.cjs +0 -2
  32. package/dist/react.cjs.map +0 -1
  33. package/dist/react.js +0 -9
  34. package/dist/react.js.map +0 -1
  35. package/dist/web-components/button/button.element.d.ts +0 -59
  36. package/dist/web-components/button/button.styles.d.ts +0 -1
  37. package/dist/web-components/button/button.types.d.ts +0 -21
  38. package/dist/web-components/button/index.d.ts +0 -3
  39. package/dist/web-components/index.d.ts +0 -1
  40. package/dist/web-components.cjs +0 -269
  41. package/dist/web-components.cjs.map +0 -1
  42. package/dist/web-components.js +0 -503
  43. package/dist/web-components.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,505 +1,916 @@
1
- import { camelToKebab as zi, configureWebstrail as Fi, defaultButtonStyles as Ai, defaultColors as Oi, defaultLayout as Ri, defaultResolvedConfig as Mi, defaultTypography as Vi, getWebstrailConfig as Di, normalizeButtonSize as ji, normalizeDimension as Gi, resetWebstrailConfig as Hi, resolveEffectiveButtonConfig as Ui, subscribeWebstrailConfig as Pi } from "./core.js";
2
- import { u as pn } from "./UIProvider-CHECrDaZ.js";
3
- import { B as Zi, U as Ji, a as Qi, d as Xi, c as Yi, e as mi, g as yi, f as li, h as Ni, m as Si, r as Ci, s as si, b as nr } from "./UIProvider-CHECrDaZ.js";
4
- import { jsxs as q, jsx as c } from "react/jsx-runtime";
5
- import { forwardRef as on, useId as fn, useRef as tn, useState as N, useImperativeHandle as bn, useEffect as wn, createContext as Bn, useContext as qn } from "react";
6
- import { WbButton as ir, buttonStyles as rr, registerWbButton as cr } from "./web-components.js";
7
- const En = "_container_106aw_1", Tn = "_floatingContainer_106aw_15", zn = "_label_106aw_23", Fn = "_requiredAsterisk_106aw_43", An = "_outerWrapper_106aw_55", On = "_inputWrapper_106aw_69", Rn = "_outerIconBox_106aw_77", Mn = "_hasError_106aw_135", Vn = "_disabled_106aw_143", Dn = "_withFloatingLabel_106aw_185", jn = "_floatingLabel_106aw_241", Gn = "_floatingLabelText_106aw_285", Hn = "_withStartIcon_106aw_327", Un = "_floated_106aw_335", Pn = "_input_106aw_69", Kn = "_floatingInput_106aw_437", Zn = "_withEndIcon_106aw_477", Jn = "_startIcon_106aw_485", Qn = "_endIcon_106aw_487", Xn = "_helperText_106aw_507", Yn = "_errorMessage_106aw_519", f = {
8
- container: En,
9
- floatingContainer: Tn,
10
- label: zn,
11
- requiredAsterisk: Fn,
12
- outerWrapper: An,
13
- inputWrapper: On,
14
- outerIconBox: Rn,
15
- hasError: Mn,
16
- disabled: Vn,
17
- withFloatingLabel: Dn,
18
- floatingLabel: jn,
19
- floatingLabelText: Gn,
20
- withStartIcon: Hn,
21
- floated: Un,
22
- input: Pn,
23
- floatingInput: Kn,
24
- withEndIcon: Zn,
25
- startIcon: Jn,
26
- endIcon: Qn,
27
- helperText: Xn,
28
- errorMessage: Yn
1
+ import { jsxs as F, jsx as u } from "react/jsx-runtime";
2
+ import { createContext as Le, useContext as Ie, useMemo as ke, forwardRef as ce, useId as ge, useRef as fe, useState as N, useImperativeHandle as $e, useEffect as ze } from "react";
3
+ const Oe = "_button_cc9s7_1", Ve = "_sizeSmall_cc9s7_57", De = "_sizeMedium_cc9s7_71", He = "_sizeLarge_cc9s7_85", Pe = "_variantPrimary_cc9s7_101", Ge = "_loading_cc9s7_113", Ue = "_variantSecondary_cc9s7_143", je = "_variantOutline_cc9s7_171", Ze = "_variantGhost_cc9s7_227", Ke = "_variantDanger_cc9s7_275", Je = "_fullWidth_cc9s7_305", Qe = "_disabled_cc9s7_315", Xe = "_spinner_cc9s7_349", Ye = "_icon_cc9s7_369", J = {
4
+ button: Oe,
5
+ sizeSmall: Ve,
6
+ sizeMedium: De,
7
+ sizeLarge: He,
8
+ variantPrimary: Pe,
9
+ loading: Ge,
10
+ variantSecondary: Ue,
11
+ variantOutline: je,
12
+ variantGhost: Ze,
13
+ variantDanger: Ke,
14
+ fullWidth: Je,
15
+ disabled: Qe,
16
+ spinner: Xe,
17
+ icon: Ye
29
18
  };
30
- function d(...rn) {
31
- const k = [];
32
- for (const t of rn)
33
- if (t) {
34
- if (typeof t == "string" || typeof t == "number") {
35
- const x = String(t).trim();
36
- x && k.push(x);
37
- } else if (Array.isArray(t)) {
38
- if (t.length > 0) {
39
- const x = d(...t);
40
- x && k.push(x);
19
+ function b(...o) {
20
+ const t = [];
21
+ for (const i of o)
22
+ if (i) {
23
+ if (typeof i == "string" || typeof i == "number") {
24
+ const c = String(i).trim();
25
+ c && t.push(c);
26
+ } else if (Array.isArray(i)) {
27
+ if (i.length > 0) {
28
+ const c = b(...i);
29
+ c && t.push(c);
41
30
  }
42
- } else if (typeof t == "object") {
43
- for (const [x, I] of Object.entries(t))
44
- if (I) {
45
- const h = x.trim();
46
- h && k.push(h);
31
+ } else if (typeof i == "object") {
32
+ for (const [c, r] of Object.entries(i))
33
+ if (r) {
34
+ const f = c.trim();
35
+ f && t.push(f);
47
36
  }
48
37
  }
49
38
  }
50
- return k.join(" ");
39
+ return t.join(" ");
51
40
  }
52
- const mn = on(function({
53
- id: k,
54
- label: t,
55
- floatingLabel: x,
56
- helperText: I,
57
- errorMessage: h,
58
- required: L = !1,
59
- disabled: b = !1,
60
- readOnly: E = !1,
61
- startIcon: z,
62
- endIcon: _,
63
- startIconPlacement: $ = "inside",
64
- endIconPlacement: M = "inside",
65
- outerStartIcon: H,
66
- outerEndIcon: p,
67
- className: n,
68
- style: e,
69
- styles: Q,
70
- slotClassNames: a,
71
- slotStyles: r,
72
- "data-testid": u,
73
- onChange: i,
74
- onFocus: W,
75
- onBlur: V,
76
- ...A
77
- }, O) {
78
- const U = fn(), g = k || `wui-input-${U}`, D = I ? `${g}-helper` : void 0, w = h ? `${g}-error` : void 0, R = tn(null), { resolved: X, getCombinedStyle: B } = pn("input", Q), j = !!h, P = x ?? (X == null ? void 0 : X.floatingLabel) ?? !0, Y = A.value !== void 0, [m, C] = N(
79
- A.defaultValue ?? ""
80
- ), [s, y] = N(!1), Z = Y ? A.value : m, nn = Z != null && String(Z).trim().length > 0, cn = s || !!nn, S = (G) => {
81
- y(!0), W == null || W(G);
82
- }, un = (G) => {
83
- y(!1), V == null || V(G);
84
- }, _n = (G) => {
85
- Y || C(G.target.value), i == null || i(G);
86
- }, dn = !!(P && t), an = H ?? ($ === "outside" ? z : void 0), o = $ === "outside" ? void 0 : z, T = p ?? (M === "outside" ? _ : void 0), K = M === "outside" ? void 0 : _, hn = !!(an || T), xn = d(
41
+ const Fe = {
42
+ colors: {
43
+ primary: "#2491eb",
44
+ secondary: "#406993",
45
+ text: "#1f2937",
46
+ textSecondary: "#6b7280",
47
+ border: "#d1d5db",
48
+ background: "#ffffff",
49
+ error: "#dc2626",
50
+ success: "#16a34a",
51
+ disabled: "#9ca3af",
52
+ disabledBackground: "#f3f4f6",
53
+ disabledText: "#9ca3af",
54
+ focusRing: "rgba(36, 145, 235, 0.35)"
55
+ },
56
+ typography: {
57
+ fontFamily: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif',
58
+ fontSizeSmall: "12px",
59
+ fontSizeMedium: "14px",
60
+ fontSizeLarge: "16px",
61
+ fontWeightNormal: 400,
62
+ fontWeightMedium: 500,
63
+ fontWeightBold: 600
64
+ },
65
+ layout: {
66
+ borderRadiusSmall: "6px",
67
+ borderRadiusMedium: "8px",
68
+ borderRadiusLarge: "12px"
69
+ },
70
+ button: {
71
+ height: "40px",
72
+ borderRadius: "8px",
73
+ fontSize: "14px",
74
+ fontWeight: 500,
75
+ backgroundColor: "#2491eb",
76
+ textColor: "#ffffff",
77
+ borderColor: "transparent",
78
+ hoverBackgroundColor: "#1d78c4",
79
+ hoverTextColor: "#ffffff",
80
+ activeBackgroundColor: "#1565a0",
81
+ disabledBackgroundColor: "#f3f4f6",
82
+ disabledTextColor: "#9ca3af",
83
+ disabledBorderColor: "#e5e7eb",
84
+ focusRingColor: "rgba(36, 145, 235, 0.35)",
85
+ padding: "0 16px",
86
+ transition: "all 0.15s ease-in-out"
87
+ },
88
+ input: {
89
+ height: "42px",
90
+ borderRadius: "8px",
91
+ borderColor: "#d1d5db",
92
+ textColor: "#1f2937",
93
+ placeholderColor: "#9ca3af",
94
+ backgroundColor: "#ffffff",
95
+ focusBorderColor: "#2491eb",
96
+ focusRingColor: "rgba(36, 145, 235, 0.25)",
97
+ errorBorderColor: "#dc2626",
98
+ disabledBackgroundColor: "#f3f4f6",
99
+ disabledTextColor: "#9ca3af",
100
+ disabledBorderColor: "#e5e7eb",
101
+ labelColor: "#374151",
102
+ helperColor: "#6b7280",
103
+ errorColor: "#dc2626",
104
+ fontSize: "14px",
105
+ padding: "0 14px",
106
+ floatingLabel: !0
107
+ },
108
+ select: {
109
+ height: "42px",
110
+ borderRadius: "8px",
111
+ borderColor: "#d1d5db",
112
+ textColor: "#1f2937",
113
+ placeholderColor: "#9ca3af",
114
+ backgroundColor: "#ffffff",
115
+ focusBorderColor: "#2491eb",
116
+ focusRingColor: "rgba(36, 145, 235, 0.25)",
117
+ errorBorderColor: "#dc2626",
118
+ disabledBackgroundColor: "#f3f4f6",
119
+ disabledTextColor: "#9ca3af",
120
+ dropdownBackgroundColor: "#ffffff",
121
+ dropdownBorderColor: "#e5e7eb",
122
+ dropdownShadow: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
123
+ optionTextColor: "#1f2937",
124
+ optionHoverBackgroundColor: "#f3f4f6",
125
+ optionHoverTextColor: "#1f2937",
126
+ optionSelectedBackgroundColor: "#eff6ff",
127
+ optionSelectedTextColor: "#2491eb",
128
+ optionSelectedHoverBackgroundColor: "#dbeafe",
129
+ optionCheckColor: "#2491eb",
130
+ optionBorderRadius: "6px",
131
+ optionPadding: "8px 12px",
132
+ optionFontSize: "14px",
133
+ optionFontWeight: 400,
134
+ optionSelectedFontWeight: 500,
135
+ labelColor: "#374151",
136
+ errorColor: "#dc2626",
137
+ fontSize: "14px",
138
+ floatingLabel: !0
139
+ },
140
+ checkbox: {
141
+ size: "18px",
142
+ borderRadius: "4px",
143
+ borderColor: "#d1d5db",
144
+ checkedColor: "#2491eb",
145
+ checkmarkColor: "#ffffff",
146
+ backgroundColor: "#ffffff",
147
+ focusRingColor: "rgba(36, 145, 235, 0.35)",
148
+ disabledColor: "#d1d5db",
149
+ disabledBackgroundColor: "#f3f4f6",
150
+ labelColor: "#1f2937",
151
+ fontSize: "14px"
152
+ },
153
+ textarea: {
154
+ minHeight: "100px",
155
+ borderRadius: "8px",
156
+ borderColor: "#d1d5db",
157
+ textColor: "#1f2937",
158
+ placeholderColor: "#9ca3af",
159
+ backgroundColor: "#ffffff",
160
+ focusBorderColor: "#2491eb",
161
+ focusRingColor: "rgba(36, 145, 235, 0.25)",
162
+ errorBorderColor: "#dc2626",
163
+ disabledBackgroundColor: "#f3f4f6",
164
+ disabledTextColor: "#9ca3af",
165
+ disabledBorderColor: "#e5e7eb",
166
+ labelColor: "#374151",
167
+ helperColor: "#6b7280",
168
+ errorColor: "#dc2626",
169
+ counterColor: "#9ca3af",
170
+ fontSize: "14px",
171
+ padding: "10px 14px",
172
+ floatingLabel: !0
173
+ },
174
+ radio: {
175
+ size: "18px",
176
+ color: "#2491eb",
177
+ checkedColor: "#2491eb",
178
+ labelColor: "#1f2937",
179
+ descriptionColor: "#6b7280",
180
+ fontSize: "14px"
181
+ },
182
+ switch: {
183
+ width: "40px",
184
+ height: "22px",
185
+ thumbSize: "16px",
186
+ thumbColor: "#ffffff",
187
+ trackColor: "#e2e8f0",
188
+ trackCheckedColor: "#2491eb",
189
+ focusRingColor: "rgba(36, 145, 235, 0.35)",
190
+ borderRadius: "9999px",
191
+ disabledOpacity: 0.5,
192
+ labelColor: "#1f2937",
193
+ descriptionColor: "#6b7280",
194
+ fontSize: "14px"
195
+ }
196
+ }, be = Le(Fe);
197
+ be.displayName = "UIContext";
198
+ function me() {
199
+ return Ie(be);
200
+ }
201
+ function we(o) {
202
+ return typeof o == "object" && o !== null && !Array.isArray(o);
203
+ }
204
+ function xe(o, t = 0.1) {
205
+ if (!o || typeof o != "string") return "rgba(36, 145, 235, 0.1)";
206
+ const i = o.trim(), c = i.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);
207
+ if (c) {
208
+ const d = parseInt(c[1], 16), h = parseInt(c[2], 16), x = parseInt(c[3], 16);
209
+ return `rgba(${d}, ${h}, ${x}, ${t})`;
210
+ }
211
+ const r = i.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
212
+ if (r) {
213
+ const d = parseInt(r[1] + r[1], 16), h = parseInt(r[2] + r[2], 16), x = parseInt(r[3] + r[3], 16);
214
+ return `rgba(${d}, ${h}, ${x}, ${t})`;
215
+ }
216
+ const f = Math.round(t * 100);
217
+ return `color-mix(in srgb, ${i} ${f}%, #ffffff)`;
218
+ }
219
+ function ye(o, t = 0.25) {
220
+ if (!o || typeof o != "string") return "rgba(36, 145, 235, 0.25)";
221
+ const i = o.trim(), c = i.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);
222
+ if (c) {
223
+ const d = parseInt(c[1], 16), h = parseInt(c[2], 16), x = parseInt(c[3], 16);
224
+ return `rgba(${d}, ${h}, ${x}, ${t})`;
225
+ }
226
+ const r = i.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
227
+ if (r) {
228
+ const d = parseInt(r[1] + r[1], 16), h = parseInt(r[2] + r[2], 16), x = parseInt(r[3] + r[3], 16);
229
+ return `rgba(${d}, ${h}, ${x}, ${t})`;
230
+ }
231
+ const f = Math.round(t * 100);
232
+ return `color-mix(in srgb, ${i} ${f}%, transparent)`;
233
+ }
234
+ function Be(o, t = 0.12) {
235
+ if (!o || typeof o != "string") return "#1d78c4";
236
+ const i = o.trim(), c = i.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);
237
+ if (c) {
238
+ const d = Math.max(0, 1 - t), h = Math.round(parseInt(c[1], 16) * d), x = Math.round(parseInt(c[2], 16) * d), l = Math.round(parseInt(c[3], 16) * d), v = (I) => I.toString(16).padStart(2, "0");
239
+ return `#${v(h)}${v(x)}${v(l)}`;
240
+ }
241
+ const r = i.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
242
+ if (r) {
243
+ const d = Math.max(0, 1 - t), h = Math.round(parseInt(r[1] + r[1], 16) * d), x = Math.round(parseInt(r[2] + r[2], 16) * d), l = Math.round(parseInt(r[3] + r[3], 16) * d), v = (I) => I.toString(16).padStart(2, "0");
244
+ return `#${v(h)}${v(x)}${v(l)}`;
245
+ }
246
+ const f = Math.round((1 - t) * 100);
247
+ return `color-mix(in srgb, ${i} ${f}%, #000000)`;
248
+ }
249
+ function Ce(o) {
250
+ const t = xe(o, 0.1), i = xe(o, 0.18), c = ye(o, 0.25), r = Be(o, 0.12), f = Be(o, 0.22), d = xe(o, 0.08);
251
+ return {
252
+ colors: {
253
+ primary: o,
254
+ focusRing: c
255
+ },
256
+ select: {
257
+ focusBorderColor: o,
258
+ focusRingColor: c,
259
+ optionSelectedTextColor: o,
260
+ optionCheckColor: o,
261
+ optionSelectedBackgroundColor: t,
262
+ optionSelectedHoverBackgroundColor: i
263
+ },
264
+ button: {
265
+ backgroundColor: o,
266
+ hoverBackgroundColor: r,
267
+ activeBackgroundColor: f,
268
+ focusRingColor: c,
269
+ outlineColor: o,
270
+ outlineBorderColor: o,
271
+ outlineHoverBackgroundColor: d,
272
+ ghostColor: o,
273
+ ghostHoverBackgroundColor: d
274
+ },
275
+ input: {
276
+ focusBorderColor: o,
277
+ focusRingColor: c
278
+ },
279
+ checkbox: {
280
+ checkedColor: o,
281
+ focusRingColor: c
282
+ },
283
+ textarea: {
284
+ focusBorderColor: o,
285
+ focusRingColor: c
286
+ },
287
+ radio: {
288
+ color: o,
289
+ checkedColor: o,
290
+ focusRingColor: c
291
+ },
292
+ switch: {
293
+ trackCheckedColor: o,
294
+ focusRingColor: c
295
+ }
296
+ };
297
+ }
298
+ function he(o, ...t) {
299
+ let i = { ...o };
300
+ for (const c of t) {
301
+ if (!c || !we(c))
302
+ continue;
303
+ const r = { ...i };
304
+ for (const f of Object.keys(c)) {
305
+ const d = c[f];
306
+ if (d === void 0)
307
+ continue;
308
+ const h = r[f];
309
+ we(h) && we(d) ? r[f] = he(
310
+ h,
311
+ d
312
+ ) : r[f] = d;
313
+ }
314
+ i = r;
315
+ }
316
+ return i;
317
+ }
318
+ function Se(o, t) {
319
+ var c;
320
+ if (!t)
321
+ return { ...o };
322
+ const i = (c = t.colors) == null ? void 0 : c.primary;
323
+ if (i && typeof i == "string") {
324
+ const r = Ce(i);
325
+ return he(o, r, t);
326
+ }
327
+ return he(o, t);
328
+ }
329
+ const Ne = /* @__PURE__ */ new Set([
330
+ "fontWeight",
331
+ "opacity",
332
+ "zIndex",
333
+ "lineHeight",
334
+ "flex",
335
+ "flexGrow",
336
+ "flexShrink",
337
+ "order"
338
+ ]);
339
+ function se(o) {
340
+ return o.replace(/([A-Z])/g, "-$1").toLowerCase();
341
+ }
342
+ function en(o, t) {
343
+ return typeof t == "number" && !Ne.has(o) ? `${t}px` : String(t);
344
+ }
345
+ function nn(o, t, i) {
346
+ return he(
347
+ o,
348
+ t,
349
+ i
350
+ );
351
+ }
352
+ function _e(o, t) {
353
+ if (!o)
354
+ return {};
355
+ const i = {};
356
+ for (const [c, r] of Object.entries(o))
357
+ if (!(r == null || r === "") && (typeof r == "string" || typeof r == "number")) {
358
+ const f = `--${t}-${se(c)}`;
359
+ i[f] = en(c, r);
360
+ }
361
+ return i;
362
+ }
363
+ function de(o, t) {
364
+ const i = me(), c = Fe[o], r = i[o];
365
+ return ke(() => {
366
+ const f = nn(
367
+ c,
368
+ r,
369
+ t
370
+ ), d = _e(
371
+ f,
372
+ `wui-${o}`
373
+ );
374
+ return {
375
+ resolved: f,
376
+ cssVars: d,
377
+ getCombinedStyle: (x) => x ? {
378
+ ...d,
379
+ ...x
380
+ } : d
381
+ };
382
+ }, [o, c, r, t]);
383
+ }
384
+ const rn = ce(function({
385
+ children: t,
386
+ label: i,
387
+ variant: c = "primary",
388
+ size: r = "medium",
389
+ loading: f = !1,
390
+ loadingText: d,
391
+ disabled: h = !1,
392
+ startIcon: x,
393
+ endIcon: l,
394
+ fullWidth: v = !1,
395
+ className: I,
396
+ style: E,
397
+ styles: V,
398
+ type: k = "button",
399
+ ...e
400
+ }, n) {
401
+ const { getCombinedStyle: U } = de("button", V), _ = {
402
+ primary: J.variantPrimary,
403
+ secondary: J.variantSecondary,
404
+ outline: J.variantOutline,
405
+ ghost: J.variantGhost,
406
+ danger: J.variantDanger
407
+ }[c], p = {
408
+ small: J.sizeSmall,
409
+ medium: J.sizeMedium,
410
+ large: J.sizeLarge
411
+ }[r], g = h || f, a = b(
412
+ "wui-button",
413
+ J.button,
414
+ _,
415
+ p,
416
+ v && J.fullWidth,
417
+ f && J.loading,
418
+ g && J.disabled,
419
+ I
420
+ );
421
+ return /* @__PURE__ */ F(
422
+ "button",
423
+ {
424
+ ref: n,
425
+ type: k,
426
+ className: a,
427
+ style: U(E),
428
+ disabled: g,
429
+ "aria-busy": f || void 0,
430
+ "aria-disabled": g || void 0,
431
+ ...e,
432
+ children: [
433
+ f ? /* @__PURE__ */ u("span", { className: J.spinner, "aria-hidden": "true" }) : x ? /* @__PURE__ */ u("span", { className: J.icon, children: x }) : null,
434
+ f && d ? /* @__PURE__ */ u("span", { children: d }) : i !== void 0 ? /* @__PURE__ */ u("span", { children: i }) : t,
435
+ !f && l && /* @__PURE__ */ u("span", { className: J.icon, children: l })
436
+ ]
437
+ }
438
+ );
439
+ });
440
+ rn.displayName = "Button";
441
+ const cn = "_container_106aw_1", on = "_floatingContainer_106aw_15", an = "_label_106aw_23", tn = "_requiredAsterisk_106aw_43", dn = "_outerWrapper_106aw_55", un = "_inputWrapper_106aw_69", fn = "_outerIconBox_106aw_77", pn = "_hasError_106aw_135", _n = "_disabled_106aw_143", bn = "_withFloatingLabel_106aw_185", hn = "_floatingLabel_106aw_241", gn = "_floatingLabelText_106aw_285", vn = "_withStartIcon_106aw_327", wn = "_floated_106aw_335", xn = "_input_106aw_69", kn = "_floatingInput_106aw_437", In = "_withEndIcon_106aw_477", $n = "_startIcon_106aw_485", ln = "_endIcon_106aw_487", Bn = "_helperText_106aw_507", Ln = "_errorMessage_106aw_519", $ = {
442
+ container: cn,
443
+ floatingContainer: on,
444
+ label: an,
445
+ requiredAsterisk: tn,
446
+ outerWrapper: dn,
447
+ inputWrapper: un,
448
+ outerIconBox: fn,
449
+ hasError: pn,
450
+ disabled: _n,
451
+ withFloatingLabel: bn,
452
+ floatingLabel: hn,
453
+ floatingLabelText: gn,
454
+ withStartIcon: vn,
455
+ floated: wn,
456
+ input: xn,
457
+ floatingInput: kn,
458
+ withEndIcon: In,
459
+ startIcon: $n,
460
+ endIcon: ln,
461
+ helperText: Bn,
462
+ errorMessage: Ln
463
+ }, zn = ce(function({
464
+ id: t,
465
+ label: i,
466
+ floatingLabel: c,
467
+ helperText: r,
468
+ errorMessage: f,
469
+ required: d = !1,
470
+ disabled: h = !1,
471
+ readOnly: x = !1,
472
+ startIcon: l,
473
+ endIcon: v,
474
+ startIconPlacement: I = "inside",
475
+ endIconPlacement: E = "inside",
476
+ outerStartIcon: V,
477
+ outerEndIcon: k,
478
+ className: e,
479
+ style: n,
480
+ styles: U,
481
+ slotClassNames: _,
482
+ slotStyles: p,
483
+ "data-testid": g,
484
+ onChange: a,
485
+ onFocus: A,
486
+ onBlur: D,
487
+ ...M
488
+ }, q) {
489
+ const j = ge(), B = t || `wui-input-${j}`, H = r ? `${B}-helper` : void 0, L = f ? `${B}-error` : void 0, O = fe(null), { resolved: Y, getCombinedStyle: R } = de("input", U), P = !!f, Z = c ?? (Y == null ? void 0 : Y.floatingLabel) ?? !0, m = M.value !== void 0, [y, ee] = N(
490
+ M.defaultValue ?? ""
491
+ ), [ne, C] = N(!1), Q = m ? M.value : y, re = Q != null && String(Q).trim().length > 0, oe = ne || !!re, s = (G) => {
492
+ C(!0), A == null || A(G);
493
+ }, ue = (G) => {
494
+ C(!1), D == null || D(G);
495
+ }, pe = (G) => {
496
+ m || ee(G.target.value), a == null || a(G);
497
+ }, ae = !!(Z && i), te = V ?? (I === "outside" ? l : void 0), w = I === "outside" ? void 0 : l, W = k ?? (E === "outside" ? v : void 0), K = E === "outside" ? void 0 : v, ve = !!(te || W), We = b(
87
498
  "wui-input-container",
88
- f.container,
89
- dn && f.floatingContainer,
90
- n
91
- ), In = d(
499
+ $.container,
500
+ ae && $.floatingContainer,
501
+ e
502
+ ), Te = b(
92
503
  "wui-input-wrapper",
93
- f.inputWrapper,
94
- dn && f.withFloatingLabel,
95
- j && f.hasError,
96
- b && f.disabled,
97
- a == null ? void 0 : a.wrapper
98
- ), Ln = d(
504
+ $.inputWrapper,
505
+ ae && $.withFloatingLabel,
506
+ P && $.hasError,
507
+ h && $.disabled,
508
+ _ == null ? void 0 : _.wrapper
509
+ ), Ee = b(
99
510
  "wui-input-field",
100
- f.input,
101
- dn && f.floatingInput,
102
- cn && f.floated,
103
- !!o && f.withStartIcon,
104
- !!K && f.withEndIcon,
105
- a == null ? void 0 : a.input
106
- ), $n = [w, D].filter(Boolean).join(" ") || void 0, gn = /* @__PURE__ */ q("div", { className: In, style: r == null ? void 0 : r.wrapper, children: [
107
- P && t && /* @__PURE__ */ c(
511
+ $.input,
512
+ ae && $.floatingInput,
513
+ oe && $.floated,
514
+ !!w && $.withStartIcon,
515
+ !!K && $.withEndIcon,
516
+ _ == null ? void 0 : _.input
517
+ ), Me = [L, H].filter(Boolean).join(" ") || void 0, le = /* @__PURE__ */ F("div", { className: Te, style: p == null ? void 0 : p.wrapper, children: [
518
+ Z && i && /* @__PURE__ */ u(
108
519
  "label",
109
520
  {
110
- htmlFor: g,
111
- className: d(
521
+ htmlFor: B,
522
+ className: b(
112
523
  "wui-input-floating-label",
113
- f.floatingLabel,
114
- !!o && f.withStartIcon,
115
- cn && f.floated,
116
- (a == null ? void 0 : a.floatingLabel) || (a == null ? void 0 : a.label)
524
+ $.floatingLabel,
525
+ !!w && $.withStartIcon,
526
+ oe && $.floated,
527
+ (_ == null ? void 0 : _.floatingLabel) || (_ == null ? void 0 : _.label)
117
528
  ),
118
- style: (r == null ? void 0 : r.floatingLabel) || (r == null ? void 0 : r.label),
119
- children: /* @__PURE__ */ q("span", { className: f.floatingLabelText, children: [
120
- t,
121
- L && /* @__PURE__ */ c("span", { className: f.requiredAsterisk, "aria-hidden": "true", children: "*" })
529
+ style: (p == null ? void 0 : p.floatingLabel) || (p == null ? void 0 : p.label),
530
+ children: /* @__PURE__ */ F("span", { className: $.floatingLabelText, children: [
531
+ i,
532
+ d && /* @__PURE__ */ u("span", { className: $.requiredAsterisk, "aria-hidden": "true", children: "*" })
122
533
  ] })
123
534
  }
124
535
  ),
125
- o && /* @__PURE__ */ c("span", { className: f.startIcon, children: o }),
126
- /* @__PURE__ */ c(
536
+ w && /* @__PURE__ */ u("span", { className: $.startIcon, children: w }),
537
+ /* @__PURE__ */ u(
127
538
  "input",
128
539
  {
129
540
  ref: (G) => {
130
- R.current = G, typeof O == "function" ? O(G) : O && (O.current = G);
541
+ O.current = G, typeof q == "function" ? q(G) : q && (q.current = G);
131
542
  },
132
- id: g,
133
- disabled: b,
134
- readOnly: E,
135
- required: L,
136
- "aria-invalid": j ? "true" : "false",
137
- "aria-describedby": $n,
138
- className: Ln,
139
- style: r == null ? void 0 : r.input,
140
- onChange: _n,
141
- onFocus: S,
142
- onBlur: un,
143
- ...A
543
+ id: B,
544
+ disabled: h,
545
+ readOnly: x,
546
+ required: d,
547
+ "aria-invalid": P ? "true" : "false",
548
+ "aria-describedby": Me,
549
+ className: Ee,
550
+ style: p == null ? void 0 : p.input,
551
+ onChange: pe,
552
+ onFocus: s,
553
+ onBlur: ue,
554
+ ...M
144
555
  }
145
556
  ),
146
- K && /* @__PURE__ */ c("span", { className: f.endIcon, children: K })
147
- ] }), Wn = hn ? /* @__PURE__ */ q(
557
+ K && /* @__PURE__ */ u("span", { className: $.endIcon, children: K })
558
+ ] }), qe = ve ? /* @__PURE__ */ F(
148
559
  "div",
149
560
  {
150
- className: d(
561
+ className: b(
151
562
  "wui-input-outer-wrapper",
152
- f.outerWrapper,
153
- a == null ? void 0 : a.outerWrapper
563
+ $.outerWrapper,
564
+ _ == null ? void 0 : _.outerWrapper
154
565
  ),
155
- style: r == null ? void 0 : r.outerWrapper,
566
+ style: p == null ? void 0 : p.outerWrapper,
156
567
  children: [
157
- an && /* @__PURE__ */ c(
568
+ te && /* @__PURE__ */ u(
158
569
  "div",
159
570
  {
160
- className: d(
571
+ className: b(
161
572
  "wui-input-outer-icon",
162
573
  "wui-input-outer-start-icon",
163
- f.outerIconBox,
164
- b && f.disabled,
165
- j && f.hasError,
166
- (a == null ? void 0 : a.outerIconBox) || (a == null ? void 0 : a.outerStartIcon)
574
+ $.outerIconBox,
575
+ h && $.disabled,
576
+ P && $.hasError,
577
+ (_ == null ? void 0 : _.outerIconBox) || (_ == null ? void 0 : _.outerStartIcon)
167
578
  ),
168
- style: (r == null ? void 0 : r.outerIconBox) || (r == null ? void 0 : r.outerStartIcon),
579
+ style: (p == null ? void 0 : p.outerIconBox) || (p == null ? void 0 : p.outerStartIcon),
169
580
  onClick: () => {
170
581
  var G;
171
- return !b && ((G = R.current) == null ? void 0 : G.focus());
582
+ return !h && ((G = O.current) == null ? void 0 : G.focus());
172
583
  },
173
- children: an
584
+ children: te
174
585
  }
175
586
  ),
176
- gn,
177
- T && /* @__PURE__ */ c(
587
+ le,
588
+ W && /* @__PURE__ */ u(
178
589
  "div",
179
590
  {
180
- className: d(
591
+ className: b(
181
592
  "wui-input-outer-icon",
182
593
  "wui-input-outer-end-icon",
183
- f.outerIconBox,
184
- b && f.disabled,
185
- j && f.hasError,
186
- (a == null ? void 0 : a.outerIconBox) || (a == null ? void 0 : a.outerEndIcon)
594
+ $.outerIconBox,
595
+ h && $.disabled,
596
+ P && $.hasError,
597
+ (_ == null ? void 0 : _.outerIconBox) || (_ == null ? void 0 : _.outerEndIcon)
187
598
  ),
188
- style: (r == null ? void 0 : r.outerIconBox) || (r == null ? void 0 : r.outerEndIcon),
599
+ style: (p == null ? void 0 : p.outerIconBox) || (p == null ? void 0 : p.outerEndIcon),
189
600
  onClick: () => {
190
601
  var G;
191
- return !b && ((G = R.current) == null ? void 0 : G.focus());
602
+ return !h && ((G = O.current) == null ? void 0 : G.focus());
192
603
  },
193
- children: T
604
+ children: W
194
605
  }
195
606
  )
196
607
  ]
197
608
  }
198
- ) : gn;
199
- return /* @__PURE__ */ q("div", { className: xn, style: B(e), "data-testid": u, children: [
200
- !P && t && /* @__PURE__ */ q(
609
+ ) : le;
610
+ return /* @__PURE__ */ F("div", { className: We, style: R(n), "data-testid": g, children: [
611
+ !Z && i && /* @__PURE__ */ F(
201
612
  "label",
202
613
  {
203
- htmlFor: g,
204
- className: d("wui-input-label", f.label, a == null ? void 0 : a.label),
205
- style: r == null ? void 0 : r.label,
614
+ htmlFor: B,
615
+ className: b("wui-input-label", $.label, _ == null ? void 0 : _.label),
616
+ style: p == null ? void 0 : p.label,
206
617
  children: [
207
- t,
208
- L && /* @__PURE__ */ c("span", { className: f.requiredAsterisk, "aria-hidden": "true", children: "*" })
618
+ i,
619
+ d && /* @__PURE__ */ u("span", { className: $.requiredAsterisk, "aria-hidden": "true", children: "*" })
209
620
  ]
210
621
  }
211
622
  ),
212
- Wn,
213
- j ? /* @__PURE__ */ c(
623
+ qe,
624
+ P ? /* @__PURE__ */ u(
214
625
  "span",
215
626
  {
216
- id: w,
627
+ id: L,
217
628
  role: "alert",
218
- className: d(
629
+ className: b(
219
630
  "wui-input-error",
220
- f.errorMessage,
221
- a == null ? void 0 : a.errorMessage
631
+ $.errorMessage,
632
+ _ == null ? void 0 : _.errorMessage
222
633
  ),
223
- style: r == null ? void 0 : r.errorMessage,
224
- children: h
634
+ style: p == null ? void 0 : p.errorMessage,
635
+ children: f
225
636
  }
226
- ) : I ? /* @__PURE__ */ c(
637
+ ) : r ? /* @__PURE__ */ u(
227
638
  "span",
228
639
  {
229
- id: D,
230
- className: d(
640
+ id: H,
641
+ className: b(
231
642
  "wui-input-helper",
232
- f.helperText,
233
- a == null ? void 0 : a.helperText
643
+ $.helperText,
644
+ _ == null ? void 0 : _.helperText
234
645
  ),
235
- style: r == null ? void 0 : r.helperText,
236
- children: I
646
+ style: p == null ? void 0 : p.helperText,
647
+ children: r
237
648
  }
238
649
  ) : null
239
650
  ] });
240
651
  });
241
- mn.displayName = "Input";
242
- const yn = "_container_1mwsv_1", ln = "_disabled_1mwsv_27", Nn = "_hiddenInput_1mwsv_37", Sn = "_box_1mwsv_55", Cn = "_checked_1mwsv_91", sn = "_indeterminate_1mwsv_93", ne = "_icon_1mwsv_103", ee = "_label_1mwsv_123", en = {
243
- container: yn,
244
- disabled: ln,
245
- hiddenInput: Nn,
246
- box: Sn,
247
- checked: Cn,
248
- indeterminate: sn,
249
- icon: ne,
250
- label: ee
251
- }, ie = on(function({
252
- label: k,
253
- checked: t,
254
- defaultChecked: x = !1,
255
- indeterminate: I = !1,
256
- disabled: h = !1,
257
- onChange: L,
258
- className: b,
259
- style: E,
260
- styles: z,
261
- slotClassNames: _,
262
- slotStyles: $,
263
- "data-testid": M,
264
- ...H
265
- }, p) {
266
- const n = tn(null);
267
- bn(p, () => n.current);
268
- const e = t !== void 0, [Q, a] = N(x), r = e ? t : Q, { getCombinedStyle: u } = pn("checkbox", z);
269
- wn(() => {
270
- n.current && (n.current.indeterminate = !!I);
271
- }, [I]);
272
- const i = (A) => {
273
- h || (e || a(A.target.checked), L == null || L(A));
274
- }, W = d(
652
+ zn.displayName = "Input";
653
+ const Fn = "_container_1mwsv_1", An = "_disabled_1mwsv_27", Rn = "_hiddenInput_1mwsv_37", Wn = "_box_1mwsv_55", Tn = "_checked_1mwsv_91", En = "_indeterminate_1mwsv_93", Mn = "_icon_1mwsv_103", qn = "_label_1mwsv_123", ie = {
654
+ container: Fn,
655
+ disabled: An,
656
+ hiddenInput: Rn,
657
+ box: Wn,
658
+ checked: Tn,
659
+ indeterminate: En,
660
+ icon: Mn,
661
+ label: qn
662
+ }, On = ce(function({
663
+ label: t,
664
+ checked: i,
665
+ defaultChecked: c = !1,
666
+ indeterminate: r = !1,
667
+ disabled: f = !1,
668
+ onChange: d,
669
+ className: h,
670
+ style: x,
671
+ styles: l,
672
+ slotClassNames: v,
673
+ slotStyles: I,
674
+ "data-testid": E,
675
+ ...V
676
+ }, k) {
677
+ const e = fe(null);
678
+ $e(k, () => e.current);
679
+ const n = i !== void 0, [U, _] = N(c), p = n ? i : U, { getCombinedStyle: g } = de("checkbox", l);
680
+ ze(() => {
681
+ e.current && (e.current.indeterminate = !!r);
682
+ }, [r]);
683
+ const a = (M) => {
684
+ f || (n || _(M.target.checked), d == null || d(M));
685
+ }, A = b(
275
686
  "wui-checkbox-container",
276
- en.container,
277
- h && en.disabled,
278
- _ == null ? void 0 : _.container,
279
- b
280
- ), V = d(
687
+ ie.container,
688
+ f && ie.disabled,
689
+ v == null ? void 0 : v.container,
690
+ h
691
+ ), D = b(
281
692
  "wui-checkbox-box",
282
- en.box,
283
- r && en.checked,
284
- I && en.indeterminate,
285
- _ == null ? void 0 : _.box
693
+ ie.box,
694
+ p && ie.checked,
695
+ r && ie.indeterminate,
696
+ v == null ? void 0 : v.box
286
697
  );
287
- return /* @__PURE__ */ q("label", { className: W, style: u(E), "data-testid": M, children: [
288
- /* @__PURE__ */ c(
698
+ return /* @__PURE__ */ F("label", { className: A, style: g(x), "data-testid": E, children: [
699
+ /* @__PURE__ */ u(
289
700
  "input",
290
701
  {
291
- ref: n,
702
+ ref: e,
292
703
  type: "checkbox",
293
- checked: r,
294
- disabled: h,
295
- onChange: i,
296
- className: en.hiddenInput,
297
- "aria-checked": I ? "mixed" : r,
298
- ...H
704
+ checked: p,
705
+ disabled: f,
706
+ onChange: a,
707
+ className: ie.hiddenInput,
708
+ "aria-checked": r ? "mixed" : p,
709
+ ...V
299
710
  }
300
711
  ),
301
- /* @__PURE__ */ c("span", { className: V, style: $ == null ? void 0 : $.box, children: I ? /* @__PURE__ */ c(
712
+ /* @__PURE__ */ u("span", { className: D, style: I == null ? void 0 : I.box, children: r ? /* @__PURE__ */ u(
302
713
  "svg",
303
714
  {
304
- className: d(en.icon, _ == null ? void 0 : _.icon),
305
- style: $ == null ? void 0 : $.icon,
715
+ className: b(ie.icon, v == null ? void 0 : v.icon),
716
+ style: I == null ? void 0 : I.icon,
306
717
  viewBox: "0 0 24 24",
307
718
  "aria-hidden": "true",
308
- children: /* @__PURE__ */ c("line", { x1: "5", y1: "12", x2: "19", y2: "12", strokeWidth: "3" })
719
+ children: /* @__PURE__ */ u("line", { x1: "5", y1: "12", x2: "19", y2: "12", strokeWidth: "3" })
309
720
  }
310
- ) : r ? /* @__PURE__ */ c(
721
+ ) : p ? /* @__PURE__ */ u(
311
722
  "svg",
312
723
  {
313
- className: d(en.icon, _ == null ? void 0 : _.icon),
314
- style: $ == null ? void 0 : $.icon,
724
+ className: b(ie.icon, v == null ? void 0 : v.icon),
725
+ style: I == null ? void 0 : I.icon,
315
726
  viewBox: "0 0 24 24",
316
727
  "aria-hidden": "true",
317
- children: /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12", strokeWidth: "3" })
728
+ children: /* @__PURE__ */ u("polyline", { points: "20 6 9 17 4 12", strokeWidth: "3" })
318
729
  }
319
730
  ) : null }),
320
- k && /* @__PURE__ */ c(
731
+ t && /* @__PURE__ */ u(
321
732
  "span",
322
733
  {
323
- className: d("wui-checkbox-label", en.label, _ == null ? void 0 : _.label),
324
- style: $ == null ? void 0 : $.label,
325
- children: k
734
+ className: b("wui-checkbox-label", ie.label, v == null ? void 0 : v.label),
735
+ style: I == null ? void 0 : I.label,
736
+ children: t
326
737
  }
327
738
  )
328
739
  ] });
329
740
  });
330
- ie.displayName = "Checkbox";
331
- const re = "_container_q8gl5_1", ce = "_floatingContainer_q8gl5_15", de = "_selectWrapper_q8gl5_23", ae = "_withFloatingLabel_q8gl5_33", oe = "_selectWrapperOpen_q8gl5_41", ue = "_label_q8gl5_49", te = "_requiredAsterisk_q8gl5_69", pe = "_floatingLabel_q8gl5_81", _e = "_floatingLabelText_q8gl5_125", fe = "_floated_q8gl5_167", he = "_trigger_q8gl5_199", be = "_hasError_q8gl5_199", ge = "_disabled_q8gl5_209", we = "_open_q8gl5_273", ve = "_value_q8gl5_315", ke = "_placeholder_q8gl5_329", xe = "_floatingPlaceholder_q8gl5_337", Ie = "_arrow_q8gl5_359", Le = "_arrowOpen_q8gl5_379", $e = "_dropdown_q8gl5_387", We = "_option_q8gl5_431", Be = "_optionActive_q8gl5_467", qe = "_optionSelected_q8gl5_477", Ee = "_optionDisabled_q8gl5_519", Te = "_checkIcon_q8gl5_531", ze = "_errorMessage_q8gl5_553", v = {
332
- container: re,
333
- floatingContainer: ce,
334
- selectWrapper: de,
335
- withFloatingLabel: ae,
336
- selectWrapperOpen: oe,
337
- label: ue,
338
- requiredAsterisk: te,
339
- floatingLabel: pe,
340
- floatingLabelText: _e,
341
- floated: fe,
342
- trigger: he,
343
- hasError: be,
344
- disabled: ge,
345
- open: we,
346
- value: ve,
347
- placeholder: ke,
348
- floatingPlaceholder: xe,
349
- arrow: Ie,
350
- arrowOpen: Le,
351
- dropdown: $e,
352
- option: We,
353
- optionActive: Be,
354
- optionSelected: qe,
355
- optionDisabled: Ee,
356
- checkIcon: Te,
357
- errorMessage: ze
358
- }, Fe = on(function({
359
- options: k,
360
- value: t,
361
- defaultValue: x,
362
- placeholder: I = "Select an option...",
363
- label: h,
364
- floatingLabel: L,
365
- errorMessage: b,
366
- disabled: E = !1,
367
- required: z = !1,
368
- onChange: _,
369
- name: $,
370
- className: M,
371
- style: H,
372
- styles: p,
373
- slotClassNames: n,
374
- slotStyles: e,
375
- "data-testid": Q,
376
- id: a
377
- }, r) {
378
- const u = fn(), i = a || `wui-select-${u}`, W = `${i}-label`, V = `${i}-listbox`, A = b ? `${i}-error` : void 0, O = t !== void 0, [U, g] = N(x), D = O ? t : U, [w, R] = N(!1), [X, B] = N(!1), [j, P] = N(-1), Y = tn(null), m = tn(null), { resolved: C, getCombinedStyle: s } = pn("select", p), y = !!b, Z = L ?? (C == null ? void 0 : C.floatingLabel) ?? !0, nn = !!(Z && h), cn = w || X || !!D, S = k.find((o) => o.value === D);
379
- wn(() => {
380
- if (!w) return;
381
- const o = (T) => {
382
- Y.current && !Y.current.contains(T.target) && R(!1);
741
+ On.displayName = "Checkbox";
742
+ const Vn = "_container_q8gl5_1", Dn = "_floatingContainer_q8gl5_15", Hn = "_selectWrapper_q8gl5_23", Pn = "_withFloatingLabel_q8gl5_33", Gn = "_selectWrapperOpen_q8gl5_41", Un = "_label_q8gl5_49", jn = "_requiredAsterisk_q8gl5_69", Zn = "_floatingLabel_q8gl5_81", Kn = "_floatingLabelText_q8gl5_125", Jn = "_floated_q8gl5_167", Qn = "_trigger_q8gl5_199", Xn = "_hasError_q8gl5_199", Yn = "_disabled_q8gl5_209", mn = "_open_q8gl5_273", yn = "_value_q8gl5_315", Cn = "_placeholder_q8gl5_329", Sn = "_floatingPlaceholder_q8gl5_337", Nn = "_arrow_q8gl5_359", sn = "_arrowOpen_q8gl5_379", er = "_dropdown_q8gl5_387", nr = "_option_q8gl5_431", rr = "_optionActive_q8gl5_467", ir = "_optionSelected_q8gl5_477", cr = "_optionDisabled_q8gl5_519", or = "_checkIcon_q8gl5_531", ar = "_errorMessage_q8gl5_553", z = {
743
+ container: Vn,
744
+ floatingContainer: Dn,
745
+ selectWrapper: Hn,
746
+ withFloatingLabel: Pn,
747
+ selectWrapperOpen: Gn,
748
+ label: Un,
749
+ requiredAsterisk: jn,
750
+ floatingLabel: Zn,
751
+ floatingLabelText: Kn,
752
+ floated: Jn,
753
+ trigger: Qn,
754
+ hasError: Xn,
755
+ disabled: Yn,
756
+ open: mn,
757
+ value: yn,
758
+ placeholder: Cn,
759
+ floatingPlaceholder: Sn,
760
+ arrow: Nn,
761
+ arrowOpen: sn,
762
+ dropdown: er,
763
+ option: nr,
764
+ optionActive: rr,
765
+ optionSelected: ir,
766
+ optionDisabled: cr,
767
+ checkIcon: or,
768
+ errorMessage: ar
769
+ }, tr = ce(function({
770
+ options: t,
771
+ value: i,
772
+ defaultValue: c,
773
+ placeholder: r = "Select an option...",
774
+ label: f,
775
+ floatingLabel: d,
776
+ errorMessage: h,
777
+ disabled: x = !1,
778
+ required: l = !1,
779
+ onChange: v,
780
+ name: I,
781
+ className: E,
782
+ style: V,
783
+ styles: k,
784
+ slotClassNames: e,
785
+ slotStyles: n,
786
+ "data-testid": U,
787
+ id: _
788
+ }, p) {
789
+ const g = ge(), a = _ || `wui-select-${g}`, A = `${a}-label`, D = `${a}-listbox`, M = h ? `${a}-error` : void 0, q = i !== void 0, [j, B] = N(c), H = q ? i : j, [L, O] = N(!1), [Y, R] = N(!1), [P, Z] = N(-1), m = fe(null), y = fe(null), { resolved: ee, getCombinedStyle: ne } = de("select", k), C = !!h, Q = d ?? (ee == null ? void 0 : ee.floatingLabel) ?? !0, re = !!(Q && f), oe = L || Y || !!H, s = t.find((w) => w.value === H);
790
+ ze(() => {
791
+ if (!L) return;
792
+ const w = (W) => {
793
+ m.current && !m.current.contains(W.target) && O(!1);
383
794
  };
384
- return document.addEventListener("mousedown", o), () => {
385
- document.removeEventListener("mousedown", o);
795
+ return document.addEventListener("mousedown", w), () => {
796
+ document.removeEventListener("mousedown", w);
386
797
  };
387
- }, [w]);
388
- const un = (o) => {
389
- var T;
390
- o.disabled || E || (O || g(o.value), _ == null || _(o.value), R(!1), (T = m.current) == null || T.focus());
391
- }, _n = (o) => {
392
- if (!E)
393
- if (o.key === "ArrowDown" || o.key === "ArrowUp") {
394
- if (o.preventDefault(), !w) {
395
- R(!0), P(0);
798
+ }, [L]);
799
+ const ue = (w) => {
800
+ var W;
801
+ w.disabled || x || (q || B(w.value), v == null || v(w.value), O(!1), (W = y.current) == null || W.focus());
802
+ }, pe = (w) => {
803
+ if (!x)
804
+ if (w.key === "ArrowDown" || w.key === "ArrowUp") {
805
+ if (w.preventDefault(), !L) {
806
+ O(!0), Z(0);
396
807
  return;
397
808
  }
398
- const T = o.key === "ArrowDown" ? 1 : -1;
399
- let K = j + T;
400
- K < 0 && (K = k.length - 1), K >= k.length && (K = 0), P(K);
401
- } else o.key === "Enter" || o.key === " " ? (o.preventDefault(), w && j >= 0 && k[j] ? un(k[j]) : R((T) => !T)) : o.key === "Escape" && w && (o.preventDefault(), R(!1));
402
- }, dn = d(
809
+ const W = w.key === "ArrowDown" ? 1 : -1;
810
+ let K = P + W;
811
+ K < 0 && (K = t.length - 1), K >= t.length && (K = 0), Z(K);
812
+ } else w.key === "Enter" || w.key === " " ? (w.preventDefault(), L && P >= 0 && t[P] ? ue(t[P]) : O((W) => !W)) : w.key === "Escape" && L && (w.preventDefault(), O(!1));
813
+ }, ae = b(
403
814
  "wui-select-container",
404
- v.container,
405
- nn && v.floatingContainer,
406
- n == null ? void 0 : n.container,
407
- M
408
- ), an = d(
815
+ z.container,
816
+ re && z.floatingContainer,
817
+ e == null ? void 0 : e.container,
818
+ E
819
+ ), te = b(
409
820
  "wui-select-trigger",
410
- v.trigger,
411
- w && v.open,
412
- y && v.hasError,
413
- E && v.disabled,
414
- n == null ? void 0 : n.trigger
821
+ z.trigger,
822
+ L && z.open,
823
+ C && z.hasError,
824
+ x && z.disabled,
825
+ e == null ? void 0 : e.trigger
415
826
  );
416
- return /* @__PURE__ */ q(
827
+ return /* @__PURE__ */ F(
417
828
  "div",
418
829
  {
419
- ref: (o) => {
420
- Y.current = o, typeof r == "function" ? r(o) : r && (r.current = o);
830
+ ref: (w) => {
831
+ m.current = w, typeof p == "function" ? p(w) : p && (p.current = w);
421
832
  },
422
- className: dn,
423
- style: s(H),
424
- "data-testid": Q,
833
+ className: ae,
834
+ style: ne(V),
835
+ "data-testid": U,
425
836
  children: [
426
- !Z && h && /* @__PURE__ */ q(
837
+ !Q && f && /* @__PURE__ */ F(
427
838
  "label",
428
839
  {
429
- id: W,
430
- className: d("wui-select-label", v.label, n == null ? void 0 : n.label),
431
- style: e == null ? void 0 : e.label,
840
+ id: A,
841
+ className: b("wui-select-label", z.label, e == null ? void 0 : e.label),
842
+ style: n == null ? void 0 : n.label,
432
843
  onClick: () => {
433
- var o;
434
- return !E && ((o = m.current) == null ? void 0 : o.focus());
844
+ var w;
845
+ return !x && ((w = y.current) == null ? void 0 : w.focus());
435
846
  },
436
847
  children: [
437
- h,
438
- z && /* @__PURE__ */ c("span", { className: v.requiredAsterisk, "aria-hidden": "true", children: "*" })
848
+ f,
849
+ l && /* @__PURE__ */ u("span", { className: z.requiredAsterisk, "aria-hidden": "true", children: "*" })
439
850
  ]
440
851
  }
441
852
  ),
442
- $ && /* @__PURE__ */ c("input", { type: "hidden", name: $, value: D || "" }),
443
- /* @__PURE__ */ q(
853
+ I && /* @__PURE__ */ u("input", { type: "hidden", name: I, value: H || "" }),
854
+ /* @__PURE__ */ F(
444
855
  "div",
445
856
  {
446
- className: d(
857
+ className: b(
447
858
  "wui-select-wrapper",
448
- v.selectWrapper,
449
- nn && v.withFloatingLabel,
450
- w && v.selectWrapperOpen,
451
- n == null ? void 0 : n.wrapper
859
+ z.selectWrapper,
860
+ re && z.withFloatingLabel,
861
+ L && z.selectWrapperOpen,
862
+ e == null ? void 0 : e.wrapper
452
863
  ),
453
- style: e == null ? void 0 : e.wrapper,
864
+ style: n == null ? void 0 : n.wrapper,
454
865
  children: [
455
- /* @__PURE__ */ q(
866
+ /* @__PURE__ */ F(
456
867
  "button",
457
868
  {
458
- ref: m,
459
- id: i,
869
+ ref: y,
870
+ id: a,
460
871
  type: "button",
461
872
  role: "combobox",
462
- "aria-expanded": w,
873
+ "aria-expanded": L,
463
874
  "aria-haspopup": "listbox",
464
- "aria-controls": V,
465
- "aria-labelledby": h ? W : void 0,
466
- "aria-invalid": y ? "true" : "false",
467
- "aria-describedby": A,
468
- disabled: E,
469
- onClick: () => !E && R((o) => !o),
470
- onFocus: () => B(!0),
471
- onBlur: () => B(!1),
472
- onKeyDown: _n,
473
- className: an,
474
- style: e == null ? void 0 : e.trigger,
875
+ "aria-controls": D,
876
+ "aria-labelledby": f ? A : void 0,
877
+ "aria-invalid": C ? "true" : "false",
878
+ "aria-describedby": M,
879
+ disabled: x,
880
+ onClick: () => !x && O((w) => !w),
881
+ onFocus: () => R(!0),
882
+ onBlur: () => R(!1),
883
+ onKeyDown: pe,
884
+ className: te,
885
+ style: n == null ? void 0 : n.trigger,
475
886
  children: [
476
- /* @__PURE__ */ c(
887
+ /* @__PURE__ */ u(
477
888
  "span",
478
889
  {
479
- className: d(
890
+ className: b(
480
891
  "wui-select-value",
481
- v.value,
482
- !S && v.placeholder,
483
- nn && !S && v.floatingPlaceholder,
484
- cn && v.floated,
485
- S ? n == null ? void 0 : n.value : n == null ? void 0 : n.placeholder
892
+ z.value,
893
+ !s && z.placeholder,
894
+ re && !s && z.floatingPlaceholder,
895
+ oe && z.floated,
896
+ s ? e == null ? void 0 : e.value : e == null ? void 0 : e.placeholder
486
897
  ),
487
- style: S ? e == null ? void 0 : e.value : e == null ? void 0 : e.placeholder,
488
- children: S ? S.label : I
898
+ style: s ? n == null ? void 0 : n.value : n == null ? void 0 : n.placeholder,
899
+ children: s ? s.label : r
489
900
  }
490
901
  ),
491
- /* @__PURE__ */ c(
902
+ /* @__PURE__ */ u(
492
903
  "span",
493
904
  {
494
- className: d(
905
+ className: b(
495
906
  "wui-select-arrow",
496
- v.arrow,
497
- w && v.arrowOpen,
498
- n == null ? void 0 : n.arrow
907
+ z.arrow,
908
+ L && z.arrowOpen,
909
+ e == null ? void 0 : e.arrow
499
910
  ),
500
- style: e == null ? void 0 : e.arrow,
911
+ style: n == null ? void 0 : n.arrow,
501
912
  "aria-hidden": "true",
502
- children: /* @__PURE__ */ c(
913
+ children: /* @__PURE__ */ u(
503
914
  "svg",
504
915
  {
505
916
  width: "14",
@@ -508,7 +919,7 @@ const re = "_container_q8gl5_1", ce = "_floatingContainer_q8gl5_15", de = "_sele
508
919
  fill: "none",
509
920
  stroke: "currentColor",
510
921
  strokeWidth: "2.5",
511
- children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
922
+ children: /* @__PURE__ */ u("polyline", { points: "6 9 12 15 18 9" })
512
923
  }
513
924
  )
514
925
  }
@@ -516,78 +927,78 @@ const re = "_container_q8gl5_1", ce = "_floatingContainer_q8gl5_15", de = "_sele
516
927
  ]
517
928
  }
518
929
  ),
519
- nn && /* @__PURE__ */ c(
930
+ re && /* @__PURE__ */ u(
520
931
  "label",
521
932
  {
522
- id: W,
523
- htmlFor: i,
524
- className: d(
933
+ id: A,
934
+ htmlFor: a,
935
+ className: b(
525
936
  "wui-select-floating-label",
526
- v.floatingLabel,
527
- cn && v.floated,
528
- (n == null ? void 0 : n.floatingLabel) || (n == null ? void 0 : n.label)
937
+ z.floatingLabel,
938
+ oe && z.floated,
939
+ (e == null ? void 0 : e.floatingLabel) || (e == null ? void 0 : e.label)
529
940
  ),
530
- style: (e == null ? void 0 : e.floatingLabel) || (e == null ? void 0 : e.label),
941
+ style: (n == null ? void 0 : n.floatingLabel) || (n == null ? void 0 : n.label),
531
942
  onClick: () => {
532
- var o;
533
- return !E && ((o = m.current) == null ? void 0 : o.focus());
943
+ var w;
944
+ return !x && ((w = y.current) == null ? void 0 : w.focus());
534
945
  },
535
- children: /* @__PURE__ */ q("span", { className: v.floatingLabelText, children: [
536
- h,
537
- z && /* @__PURE__ */ c("span", { className: v.requiredAsterisk, "aria-hidden": "true", children: "*" })
946
+ children: /* @__PURE__ */ F("span", { className: z.floatingLabelText, children: [
947
+ f,
948
+ l && /* @__PURE__ */ u("span", { className: z.requiredAsterisk, "aria-hidden": "true", children: "*" })
538
949
  ] })
539
950
  }
540
951
  ),
541
- w && /* @__PURE__ */ c(
952
+ L && /* @__PURE__ */ u(
542
953
  "ul",
543
954
  {
544
- id: V,
955
+ id: D,
545
956
  role: "listbox",
546
- "aria-labelledby": h ? W : void 0,
547
- className: d(
957
+ "aria-labelledby": f ? A : void 0,
958
+ className: b(
548
959
  "wui-select-dropdown",
549
- v.dropdown,
550
- n == null ? void 0 : n.dropdown
960
+ z.dropdown,
961
+ e == null ? void 0 : e.dropdown
551
962
  ),
552
- style: e == null ? void 0 : e.dropdown,
553
- children: k.map((o, T) => {
554
- const K = o.value === D, hn = T === j;
555
- return /* @__PURE__ */ q(
963
+ style: n == null ? void 0 : n.dropdown,
964
+ children: t.map((w, W) => {
965
+ const K = w.value === H, ve = W === P;
966
+ return /* @__PURE__ */ F(
556
967
  "li",
557
968
  {
558
969
  role: "option",
559
970
  "aria-selected": K,
560
- "aria-disabled": o.disabled || void 0,
561
- className: d(
971
+ "aria-disabled": w.disabled || void 0,
972
+ className: b(
562
973
  "wui-select-option",
563
- v.option,
564
- K && v.optionSelected,
565
- hn && v.optionActive,
566
- o.disabled && v.optionDisabled,
567
- n == null ? void 0 : n.option,
568
- K && (n == null ? void 0 : n.selectedOption)
974
+ z.option,
975
+ K && z.optionSelected,
976
+ ve && z.optionActive,
977
+ w.disabled && z.optionDisabled,
978
+ e == null ? void 0 : e.option,
979
+ K && (e == null ? void 0 : e.selectedOption)
569
980
  ),
570
981
  style: {
571
- ...e == null ? void 0 : e.option,
572
- ...K ? e == null ? void 0 : e.selectedOption : void 0
982
+ ...n == null ? void 0 : n.option,
983
+ ...K ? n == null ? void 0 : n.selectedOption : void 0
573
984
  },
574
- onClick: () => un(o),
985
+ onClick: () => ue(w),
575
986
  children: [
576
- /* @__PURE__ */ c("span", { children: o.label }),
577
- K && /* @__PURE__ */ c(
987
+ /* @__PURE__ */ u("span", { children: w.label }),
988
+ K && /* @__PURE__ */ u(
578
989
  "svg",
579
990
  {
580
- className: d(v.checkIcon, n == null ? void 0 : n.checkIcon),
581
- style: e == null ? void 0 : e.checkIcon,
991
+ className: b(z.checkIcon, e == null ? void 0 : e.checkIcon),
992
+ style: n == null ? void 0 : n.checkIcon,
582
993
  viewBox: "0 0 24 24",
583
994
  strokeWidth: "3",
584
995
  "aria-hidden": "true",
585
- children: /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12" })
996
+ children: /* @__PURE__ */ u("polyline", { points: "20 6 9 17 4 12" })
586
997
  }
587
998
  )
588
999
  ]
589
1000
  },
590
- o.value
1001
+ w.value
591
1002
  );
592
1003
  })
593
1004
  }
@@ -595,308 +1006,308 @@ const re = "_container_q8gl5_1", ce = "_floatingContainer_q8gl5_15", de = "_sele
595
1006
  ]
596
1007
  }
597
1008
  ),
598
- y && /* @__PURE__ */ c(
1009
+ C && /* @__PURE__ */ u(
599
1010
  "span",
600
1011
  {
601
- id: A,
1012
+ id: M,
602
1013
  role: "alert",
603
- className: d(
1014
+ className: b(
604
1015
  "wui-select-error",
605
- v.errorMessage,
606
- n == null ? void 0 : n.errorMessage
1016
+ z.errorMessage,
1017
+ e == null ? void 0 : e.errorMessage
607
1018
  ),
608
- style: e == null ? void 0 : e.errorMessage,
609
- children: b
1019
+ style: n == null ? void 0 : n.errorMessage,
1020
+ children: h
610
1021
  }
611
1022
  )
612
1023
  ]
613
1024
  }
614
1025
  );
615
1026
  });
616
- Fe.displayName = "Select";
617
- const Ae = "_container_1f8v3_1", Oe = "_floatingContainer_1f8v3_15", Re = "_label_1f8v3_23", Me = "_requiredAsterisk_1f8v3_43", Ve = "_wrapper_1f8v3_55", De = "_withFloatingLabel_1f8v3_79", je = "_hasError_1f8v3_105", Ge = "_disabled_1f8v3_123", He = "_floatingLabel_1f8v3_135", Ue = "_floatingLabelText_1f8v3_179", Pe = "_floated_1f8v3_221", Ke = "_textarea_1f8v3_277", Ze = "_floatingTextarea_1f8v3_317", Je = "_footer_1f8v3_349", Qe = "_helperText_1f8v3_365", Xe = "_errorMessage_1f8v3_375", Ye = "_counter_1f8v3_387", F = {
618
- container: Ae,
619
- floatingContainer: Oe,
620
- label: Re,
621
- requiredAsterisk: Me,
622
- wrapper: Ve,
623
- withFloatingLabel: De,
624
- hasError: je,
625
- disabled: Ge,
626
- floatingLabel: He,
627
- floatingLabelText: Ue,
628
- floated: Pe,
629
- textarea: Ke,
630
- floatingTextarea: Ze,
631
- footer: Je,
632
- helperText: Qe,
633
- errorMessage: Xe,
634
- counter: Ye
635
- }, me = on(function({
636
- id: k,
637
- label: t,
638
- floatingLabel: x,
639
- helperText: I,
640
- errorMessage: h,
641
- required: L = !1,
642
- disabled: b = !1,
643
- readOnly: E = !1,
644
- rows: z = 4,
645
- maxLength: _,
646
- showCount: $ = !1,
647
- value: M,
648
- defaultValue: H,
649
- onChange: p,
650
- onFocus: n,
651
- onBlur: e,
652
- className: Q,
653
- style: a,
654
- styles: r,
655
- slotClassNames: u,
656
- slotStyles: i,
657
- "data-testid": W,
658
- ...V
659
- }, A) {
660
- const O = fn(), U = k || `wui-textarea-${O}`, g = I ? `${U}-helper` : void 0, D = h ? `${U}-error` : void 0, w = M !== void 0, [R, X] = N(
661
- H !== void 0 ? String(H) : ""
662
- ), [B, j] = N(!1), P = w ? String(M ?? "") : R, Y = P != null && String(P).trim().length > 0, { resolved: m, getCombinedStyle: C } = pn("textarea", r), s = !!h, y = x ?? (m == null ? void 0 : m.floatingLabel) ?? !0, Z = !!(y && t), nn = B || !!Y, cn = (T) => {
663
- w || X(T.target.value), p == null || p(T);
664
- }, S = (T) => {
665
- j(!0), n == null || n(T);
666
- }, un = (T) => {
667
- j(!1), e == null || e(T);
668
- }, _n = d(
1027
+ tr.displayName = "Select";
1028
+ const dr = "_container_1f8v3_1", ur = "_floatingContainer_1f8v3_15", fr = "_label_1f8v3_23", pr = "_requiredAsterisk_1f8v3_43", _r = "_wrapper_1f8v3_55", br = "_withFloatingLabel_1f8v3_79", hr = "_hasError_1f8v3_105", gr = "_disabled_1f8v3_123", vr = "_floatingLabel_1f8v3_135", wr = "_floatingLabelText_1f8v3_179", xr = "_floated_1f8v3_221", kr = "_textarea_1f8v3_277", Ir = "_floatingTextarea_1f8v3_317", $r = "_footer_1f8v3_349", lr = "_helperText_1f8v3_365", Br = "_errorMessage_1f8v3_375", Lr = "_counter_1f8v3_387", T = {
1029
+ container: dr,
1030
+ floatingContainer: ur,
1031
+ label: fr,
1032
+ requiredAsterisk: pr,
1033
+ wrapper: _r,
1034
+ withFloatingLabel: br,
1035
+ hasError: hr,
1036
+ disabled: gr,
1037
+ floatingLabel: vr,
1038
+ floatingLabelText: wr,
1039
+ floated: xr,
1040
+ textarea: kr,
1041
+ floatingTextarea: Ir,
1042
+ footer: $r,
1043
+ helperText: lr,
1044
+ errorMessage: Br,
1045
+ counter: Lr
1046
+ }, zr = ce(function({
1047
+ id: t,
1048
+ label: i,
1049
+ floatingLabel: c,
1050
+ helperText: r,
1051
+ errorMessage: f,
1052
+ required: d = !1,
1053
+ disabled: h = !1,
1054
+ readOnly: x = !1,
1055
+ rows: l = 4,
1056
+ maxLength: v,
1057
+ showCount: I = !1,
1058
+ value: E,
1059
+ defaultValue: V,
1060
+ onChange: k,
1061
+ onFocus: e,
1062
+ onBlur: n,
1063
+ className: U,
1064
+ style: _,
1065
+ styles: p,
1066
+ slotClassNames: g,
1067
+ slotStyles: a,
1068
+ "data-testid": A,
1069
+ ...D
1070
+ }, M) {
1071
+ const q = ge(), j = t || `wui-textarea-${q}`, B = r ? `${j}-helper` : void 0, H = f ? `${j}-error` : void 0, L = E !== void 0, [O, Y] = N(
1072
+ V !== void 0 ? String(V) : ""
1073
+ ), [R, P] = N(!1), Z = L ? String(E ?? "") : O, m = Z != null && String(Z).trim().length > 0, { resolved: y, getCombinedStyle: ee } = de("textarea", p), ne = !!f, C = c ?? (y == null ? void 0 : y.floatingLabel) ?? !0, Q = !!(C && i), re = R || !!m, oe = (W) => {
1074
+ L || Y(W.target.value), k == null || k(W);
1075
+ }, s = (W) => {
1076
+ P(!0), e == null || e(W);
1077
+ }, ue = (W) => {
1078
+ P(!1), n == null || n(W);
1079
+ }, pe = b(
669
1080
  "wui-textarea-container",
670
- F.container,
671
- Z && F.floatingContainer,
672
- u == null ? void 0 : u.container,
673
- Q
674
- ), dn = d(
1081
+ T.container,
1082
+ Q && T.floatingContainer,
1083
+ g == null ? void 0 : g.container,
1084
+ U
1085
+ ), ae = b(
675
1086
  "wui-textarea-wrapper",
676
- F.wrapper,
677
- Z && F.withFloatingLabel,
678
- s && F.hasError,
679
- b && F.disabled,
680
- u == null ? void 0 : u.wrapper
681
- ), an = d(
1087
+ T.wrapper,
1088
+ Q && T.withFloatingLabel,
1089
+ ne && T.hasError,
1090
+ h && T.disabled,
1091
+ g == null ? void 0 : g.wrapper
1092
+ ), te = b(
682
1093
  "wui-textarea-field",
683
- F.textarea,
684
- Z && F.floatingTextarea,
685
- nn && F.floated,
686
- u == null ? void 0 : u.textarea
687
- ), o = [D, g].filter(Boolean).join(" ") || void 0;
688
- return /* @__PURE__ */ q("div", { className: _n, style: C(a), "data-testid": W, children: [
689
- !y && t && /* @__PURE__ */ q(
1094
+ T.textarea,
1095
+ Q && T.floatingTextarea,
1096
+ re && T.floated,
1097
+ g == null ? void 0 : g.textarea
1098
+ ), w = [H, B].filter(Boolean).join(" ") || void 0;
1099
+ return /* @__PURE__ */ F("div", { className: pe, style: ee(_), "data-testid": A, children: [
1100
+ !C && i && /* @__PURE__ */ F(
690
1101
  "label",
691
1102
  {
692
- htmlFor: U,
693
- className: d("wui-textarea-label", F.label, u == null ? void 0 : u.label),
694
- style: i == null ? void 0 : i.label,
1103
+ htmlFor: j,
1104
+ className: b("wui-textarea-label", T.label, g == null ? void 0 : g.label),
1105
+ style: a == null ? void 0 : a.label,
695
1106
  children: [
696
- t,
697
- L && /* @__PURE__ */ c("span", { className: F.requiredAsterisk, "aria-hidden": "true", children: "*" })
1107
+ i,
1108
+ d && /* @__PURE__ */ u("span", { className: T.requiredAsterisk, "aria-hidden": "true", children: "*" })
698
1109
  ]
699
1110
  }
700
1111
  ),
701
- /* @__PURE__ */ q("div", { className: dn, style: i == null ? void 0 : i.wrapper, children: [
702
- Z && /* @__PURE__ */ c(
1112
+ /* @__PURE__ */ F("div", { className: ae, style: a == null ? void 0 : a.wrapper, children: [
1113
+ Q && /* @__PURE__ */ u(
703
1114
  "label",
704
1115
  {
705
- htmlFor: U,
706
- className: d(
1116
+ htmlFor: j,
1117
+ className: b(
707
1118
  "wui-textarea-floating-label",
708
- F.floatingLabel,
709
- nn && F.floated,
710
- (u == null ? void 0 : u.floatingLabel) || (u == null ? void 0 : u.label)
1119
+ T.floatingLabel,
1120
+ re && T.floated,
1121
+ (g == null ? void 0 : g.floatingLabel) || (g == null ? void 0 : g.label)
711
1122
  ),
712
- style: (i == null ? void 0 : i.floatingLabel) || (i == null ? void 0 : i.label),
713
- children: /* @__PURE__ */ q("span", { className: F.floatingLabelText, children: [
714
- t,
715
- L && /* @__PURE__ */ c("span", { className: F.requiredAsterisk, "aria-hidden": "true", children: "*" })
1123
+ style: (a == null ? void 0 : a.floatingLabel) || (a == null ? void 0 : a.label),
1124
+ children: /* @__PURE__ */ F("span", { className: T.floatingLabelText, children: [
1125
+ i,
1126
+ d && /* @__PURE__ */ u("span", { className: T.requiredAsterisk, "aria-hidden": "true", children: "*" })
716
1127
  ] })
717
1128
  }
718
1129
  ),
719
- /* @__PURE__ */ c(
1130
+ /* @__PURE__ */ u(
720
1131
  "textarea",
721
1132
  {
722
- ref: A,
723
- id: U,
724
- rows: z,
725
- maxLength: _,
726
- value: w ? M : void 0,
727
- defaultValue: w ? void 0 : H,
728
- onChange: cn,
729
- onFocus: S,
730
- onBlur: un,
731
- disabled: b,
732
- readOnly: E,
733
- required: L,
734
- "aria-invalid": s ? "true" : "false",
735
- "aria-describedby": o,
736
- className: an,
737
- style: i == null ? void 0 : i.textarea,
738
- ...V
1133
+ ref: M,
1134
+ id: j,
1135
+ rows: l,
1136
+ maxLength: v,
1137
+ value: L ? E : void 0,
1138
+ defaultValue: L ? void 0 : V,
1139
+ onChange: oe,
1140
+ onFocus: s,
1141
+ onBlur: ue,
1142
+ disabled: h,
1143
+ readOnly: x,
1144
+ required: d,
1145
+ "aria-invalid": ne ? "true" : "false",
1146
+ "aria-describedby": w,
1147
+ className: te,
1148
+ style: a == null ? void 0 : a.textarea,
1149
+ ...D
739
1150
  }
740
1151
  )
741
1152
  ] }),
742
- /* @__PURE__ */ q("div", { className: F.footer, children: [
743
- s ? /* @__PURE__ */ c(
1153
+ /* @__PURE__ */ F("div", { className: T.footer, children: [
1154
+ ne ? /* @__PURE__ */ u(
744
1155
  "span",
745
1156
  {
746
- id: D,
1157
+ id: H,
747
1158
  role: "alert",
748
- className: d(
1159
+ className: b(
749
1160
  "wui-textarea-error",
750
- F.errorMessage,
751
- u == null ? void 0 : u.errorMessage
1161
+ T.errorMessage,
1162
+ g == null ? void 0 : g.errorMessage
752
1163
  ),
753
- style: i == null ? void 0 : i.errorMessage,
754
- children: h
1164
+ style: a == null ? void 0 : a.errorMessage,
1165
+ children: f
755
1166
  }
756
- ) : I ? /* @__PURE__ */ c(
1167
+ ) : r ? /* @__PURE__ */ u(
757
1168
  "span",
758
1169
  {
759
- id: g,
760
- className: d(
1170
+ id: B,
1171
+ className: b(
761
1172
  "wui-textarea-helper",
762
- F.helperText,
763
- u == null ? void 0 : u.helperText
1173
+ T.helperText,
1174
+ g == null ? void 0 : g.helperText
764
1175
  ),
765
- style: i == null ? void 0 : i.helperText,
766
- children: I
1176
+ style: a == null ? void 0 : a.helperText,
1177
+ children: r
767
1178
  }
768
- ) : /* @__PURE__ */ c("span", {}),
769
- $ && /* @__PURE__ */ c(
1179
+ ) : /* @__PURE__ */ u("span", {}),
1180
+ I && /* @__PURE__ */ u(
770
1181
  "span",
771
1182
  {
772
- className: d(
1183
+ className: b(
773
1184
  "wui-textarea-counter",
774
- F.counter,
775
- u == null ? void 0 : u.counter
1185
+ T.counter,
1186
+ g == null ? void 0 : g.counter
776
1187
  ),
777
- style: i == null ? void 0 : i.counter,
1188
+ style: a == null ? void 0 : a.counter,
778
1189
  "aria-live": "polite",
779
- children: _ !== void 0 ? `${P.length} / ${_}` : P.length
1190
+ children: v !== void 0 ? `${Z.length} / ${v}` : Z.length
780
1191
  }
781
1192
  )
782
1193
  ] })
783
1194
  ] });
784
1195
  });
785
- me.displayName = "Textarea";
786
- const ye = "_container_1ek6o_1", le = "_disabled_1ek6o_29", Ne = "_radio_1ek6o_39", Se = "_labelWrapper_1ek6o_71", Ce = "_label_1ek6o_71", se = "_labelChecked_1ek6o_99", ni = "_description_1ek6o_109", ei = "_groupContainer_1ek6o_121", ii = "_groupLabel_1ek6o_135", ri = "_optionsVertical_1ek6o_149", ci = "_optionsHorizontal_1ek6o_161", di = "_groupError_1ek6o_175", l = {
787
- container: ye,
788
- disabled: le,
789
- radio: Ne,
790
- labelWrapper: Se,
791
- label: Ce,
792
- labelChecked: se,
793
- description: ni,
794
- groupContainer: ei,
795
- groupLabel: ii,
796
- optionsVertical: ri,
797
- optionsHorizontal: ci,
798
- groupError: di
799
- }, vn = Bn(null);
800
- function ai() {
801
- return qn(vn);
1196
+ zr.displayName = "Textarea";
1197
+ const Fr = "_container_1ek6o_1", Ar = "_disabled_1ek6o_29", Rr = "_radio_1ek6o_39", Wr = "_labelWrapper_1ek6o_71", Tr = "_label_1ek6o_71", Er = "_labelChecked_1ek6o_99", Mr = "_description_1ek6o_109", qr = "_groupContainer_1ek6o_121", Or = "_groupLabel_1ek6o_135", Vr = "_optionsVertical_1ek6o_149", Dr = "_optionsHorizontal_1ek6o_161", Hr = "_groupError_1ek6o_175", S = {
1198
+ container: Fr,
1199
+ disabled: Ar,
1200
+ radio: Rr,
1201
+ labelWrapper: Wr,
1202
+ label: Tr,
1203
+ labelChecked: Er,
1204
+ description: Mr,
1205
+ groupContainer: qr,
1206
+ groupLabel: Or,
1207
+ optionsVertical: Vr,
1208
+ optionsHorizontal: Dr,
1209
+ groupError: Hr
1210
+ }, Ae = Le(null);
1211
+ function Pr() {
1212
+ return Ie(Ae);
802
1213
  }
803
- const kn = on(function({
804
- label: k,
805
- description: t,
806
- value: x,
807
- size: I,
808
- color: h,
809
- checked: L,
810
- defaultChecked: b = !1,
811
- disabled: E = !1,
812
- onChange: z,
813
- name: _,
814
- className: $,
815
- style: M,
816
- styles: H,
817
- slotClassNames: p,
818
- slotStyles: n,
819
- "data-testid": e,
820
- id: Q,
821
- ...a
822
- }, r) {
823
- const u = tn(null);
824
- bn(r, () => u.current);
825
- const i = ai(), W = !!i, V = _ || (i == null ? void 0 : i.name), A = W ? (i == null ? void 0 : i.value) !== void 0 && x !== void 0 ? i.value === x : L !== void 0 ? L : b : L !== void 0 ? L : void 0, [O, U] = N(b), g = W ? A : L !== void 0 ? L : O, D = E || !!(i != null && i.disabled), w = I ?? (i == null ? void 0 : i.size), R = h ?? (i == null ? void 0 : i.color), X = {
826
- ...(i == null ? void 0 : i.groupStyles) || {},
827
- ...H || {},
828
- ...w !== void 0 ? { size: w } : {},
829
- ...R !== void 0 ? { color: R } : {}
830
- }, { resolved: B, getCombinedStyle: j } = pn("radio", X), P = R || (B == null ? void 0 : B.color) || (B == null ? void 0 : B.checkedColor), Y = w !== void 0 ? typeof w == "number" ? `${w}px` : w : (B == null ? void 0 : B.size) !== void 0 ? typeof B.size == "number" ? `${B.size}px` : B.size : void 0, m = (y) => {
831
- var Z;
832
- D || (!W && L === void 0 && U(y.target.checked), i && x !== void 0 && ((Z = i.onChange) == null || Z.call(i, x)), z == null || z(y));
833
- }, C = d(
1214
+ const Re = ce(function({
1215
+ label: t,
1216
+ description: i,
1217
+ value: c,
1218
+ size: r,
1219
+ color: f,
1220
+ checked: d,
1221
+ defaultChecked: h = !1,
1222
+ disabled: x = !1,
1223
+ onChange: l,
1224
+ name: v,
1225
+ className: I,
1226
+ style: E,
1227
+ styles: V,
1228
+ slotClassNames: k,
1229
+ slotStyles: e,
1230
+ "data-testid": n,
1231
+ id: U,
1232
+ ..._
1233
+ }, p) {
1234
+ const g = fe(null);
1235
+ $e(p, () => g.current);
1236
+ const a = Pr(), A = !!a, D = v || (a == null ? void 0 : a.name), M = A ? (a == null ? void 0 : a.value) !== void 0 && c !== void 0 ? a.value === c : d !== void 0 ? d : h : d !== void 0 ? d : void 0, [q, j] = N(h), B = A ? M : d !== void 0 ? d : q, H = x || !!(a != null && a.disabled), L = r ?? (a == null ? void 0 : a.size), O = f ?? (a == null ? void 0 : a.color), Y = {
1237
+ ...(a == null ? void 0 : a.groupStyles) || {},
1238
+ ...V || {},
1239
+ ...L !== void 0 ? { size: L } : {},
1240
+ ...O !== void 0 ? { color: O } : {}
1241
+ }, { resolved: R, getCombinedStyle: P } = de("radio", Y), Z = O || (R == null ? void 0 : R.color) || (R == null ? void 0 : R.checkedColor), m = L !== void 0 ? typeof L == "number" ? `${L}px` : L : (R == null ? void 0 : R.size) !== void 0 ? typeof R.size == "number" ? `${R.size}px` : R.size : void 0, y = (C) => {
1242
+ var Q;
1243
+ H || (!A && d === void 0 && j(C.target.checked), a && c !== void 0 && ((Q = a.onChange) == null || Q.call(a, c)), l == null || l(C));
1244
+ }, ee = b(
834
1245
  "wui-radio-container",
835
- l.container,
836
- D && l.disabled,
837
- p == null ? void 0 : p.container,
838
- $
839
- ), s = d(
1246
+ S.container,
1247
+ H && S.disabled,
1248
+ k == null ? void 0 : k.container,
1249
+ I
1250
+ ), ne = b(
840
1251
  "wui-radio-input",
841
- l.radio,
842
- (p == null ? void 0 : p.radio) || (p == null ? void 0 : p.control)
1252
+ S.radio,
1253
+ (k == null ? void 0 : k.radio) || (k == null ? void 0 : k.control)
843
1254
  );
844
- return /* @__PURE__ */ q("label", { className: C, style: j(M), "data-testid": e, children: [
845
- /* @__PURE__ */ c(
1255
+ return /* @__PURE__ */ F("label", { className: ee, style: P(E), "data-testid": n, children: [
1256
+ /* @__PURE__ */ u(
846
1257
  "input",
847
1258
  {
848
- ref: u,
849
- id: Q,
1259
+ ref: g,
1260
+ id: U,
850
1261
  type: "radio",
851
- name: V,
852
- value: x,
853
- checked: g,
854
- defaultChecked: W ? void 0 : b,
855
- disabled: D,
856
- onChange: m,
857
- className: s,
1262
+ name: D,
1263
+ value: c,
1264
+ checked: B,
1265
+ defaultChecked: A ? void 0 : h,
1266
+ disabled: H,
1267
+ onChange: y,
1268
+ className: ne,
858
1269
  style: {
859
- ...P ? { accentColor: P } : void 0,
860
- ...Y ? { width: Y, height: Y } : void 0,
861
- ...(n == null ? void 0 : n.radio) || (n == null ? void 0 : n.control)
1270
+ ...Z ? { accentColor: Z } : void 0,
1271
+ ...m ? { width: m, height: m } : void 0,
1272
+ ...(e == null ? void 0 : e.radio) || (e == null ? void 0 : e.control)
862
1273
  },
863
- ...a
1274
+ ..._
864
1275
  }
865
1276
  ),
866
- (k || t) && /* @__PURE__ */ q(
1277
+ (t || i) && /* @__PURE__ */ F(
867
1278
  "span",
868
1279
  {
869
- className: d(
1280
+ className: b(
870
1281
  "wui-radio-label-wrapper",
871
- l.labelWrapper,
872
- p == null ? void 0 : p.labelWrapper
1282
+ S.labelWrapper,
1283
+ k == null ? void 0 : k.labelWrapper
873
1284
  ),
874
- style: n == null ? void 0 : n.labelWrapper,
1285
+ style: e == null ? void 0 : e.labelWrapper,
875
1286
  children: [
876
- k && /* @__PURE__ */ c(
1287
+ t && /* @__PURE__ */ u(
877
1288
  "span",
878
1289
  {
879
- className: d(
1290
+ className: b(
880
1291
  "wui-radio-label",
881
- l.label,
882
- g && l.labelChecked,
883
- p == null ? void 0 : p.label,
884
- g && (p == null ? void 0 : p.labelChecked)
1292
+ S.label,
1293
+ B && S.labelChecked,
1294
+ k == null ? void 0 : k.label,
1295
+ B && (k == null ? void 0 : k.labelChecked)
885
1296
  ),
886
- style: n == null ? void 0 : n.label,
887
- children: k
1297
+ style: e == null ? void 0 : e.label,
1298
+ children: t
888
1299
  }
889
1300
  ),
890
- t && /* @__PURE__ */ c(
1301
+ i && /* @__PURE__ */ u(
891
1302
  "span",
892
1303
  {
893
- className: d(
1304
+ className: b(
894
1305
  "wui-radio-description",
895
- l.description,
896
- p == null ? void 0 : p.description
1306
+ S.description,
1307
+ k == null ? void 0 : k.description
897
1308
  ),
898
- style: n == null ? void 0 : n.description,
899
- children: t
1309
+ style: e == null ? void 0 : e.description,
1310
+ children: i
900
1311
  }
901
1312
  )
902
1313
  ]
@@ -904,195 +1315,195 @@ const kn = on(function({
904
1315
  )
905
1316
  ] });
906
1317
  });
907
- kn.displayName = "Radio";
908
- const oi = on(function({
909
- name: k,
910
- value: t,
911
- defaultValue: x,
912
- onChange: I,
913
- options: h,
914
- direction: L = "vertical",
915
- label: b,
916
- errorMessage: E,
917
- disabled: z = !1,
918
- size: _,
919
- color: $,
920
- children: M,
921
- styles: H,
922
- className: p,
923
- style: n,
924
- "data-testid": e
925
- }, Q) {
926
- const a = fn(), r = k || `wui-radiogroup-${a}`, u = t !== void 0, [i, W] = N(x), V = u ? t : i, A = (g) => {
927
- z || (u || W(g), I == null || I(g));
928
- }, O = d(
1318
+ Re.displayName = "Radio";
1319
+ const Gr = ce(function({
1320
+ name: t,
1321
+ value: i,
1322
+ defaultValue: c,
1323
+ onChange: r,
1324
+ options: f,
1325
+ direction: d = "vertical",
1326
+ label: h,
1327
+ errorMessage: x,
1328
+ disabled: l = !1,
1329
+ size: v,
1330
+ color: I,
1331
+ children: E,
1332
+ styles: V,
1333
+ className: k,
1334
+ style: e,
1335
+ "data-testid": n
1336
+ }, U) {
1337
+ const _ = ge(), p = t || `wui-radiogroup-${_}`, g = i !== void 0, [a, A] = N(c), D = g ? i : a, M = (B) => {
1338
+ l || (g || A(B), r == null || r(B));
1339
+ }, q = b(
929
1340
  "wui-radiogroup-container",
930
- l.groupContainer,
931
- p
932
- ), U = L === "horizontal" ? l.optionsHorizontal : l.optionsVertical;
933
- return /* @__PURE__ */ c(
934
- vn.Provider,
1341
+ S.groupContainer,
1342
+ k
1343
+ ), j = d === "horizontal" ? S.optionsHorizontal : S.optionsVertical;
1344
+ return /* @__PURE__ */ u(
1345
+ Ae.Provider,
935
1346
  {
936
1347
  value: {
937
- name: r,
938
- value: V,
939
- onChange: A,
940
- disabled: z,
941
- size: _,
942
- color: $,
943
- groupStyles: H
1348
+ name: p,
1349
+ value: D,
1350
+ onChange: M,
1351
+ disabled: l,
1352
+ size: v,
1353
+ color: I,
1354
+ groupStyles: V
944
1355
  },
945
- children: /* @__PURE__ */ q(
1356
+ children: /* @__PURE__ */ F(
946
1357
  "div",
947
1358
  {
948
- ref: Q,
1359
+ ref: U,
949
1360
  role: "radiogroup",
950
- "aria-label": typeof b == "string" ? b : void 0,
951
- className: O,
952
- style: n,
953
- "data-testid": e,
1361
+ "aria-label": typeof h == "string" ? h : void 0,
1362
+ className: q,
1363
+ style: e,
1364
+ "data-testid": n,
954
1365
  children: [
955
- b && /* @__PURE__ */ c("span", { className: l.groupLabel, children: b }),
956
- /* @__PURE__ */ c("div", { className: U, children: h ? h.map((g) => /* @__PURE__ */ c(
957
- kn,
1366
+ h && /* @__PURE__ */ u("span", { className: S.groupLabel, children: h }),
1367
+ /* @__PURE__ */ u("div", { className: j, children: f ? f.map((B) => /* @__PURE__ */ u(
1368
+ Re,
958
1369
  {
959
- value: g.value,
960
- label: g.label,
961
- description: g.description,
962
- disabled: g.disabled,
963
- size: g.size,
964
- color: g.color,
965
- styles: g.styles
1370
+ value: B.value,
1371
+ label: B.label,
1372
+ description: B.description,
1373
+ disabled: B.disabled,
1374
+ size: B.size,
1375
+ color: B.color,
1376
+ styles: B.styles
966
1377
  },
967
- g.value
968
- )) : M }),
969
- E && /* @__PURE__ */ c("span", { role: "alert", className: l.groupError, children: E })
1378
+ B.value
1379
+ )) : E }),
1380
+ x && /* @__PURE__ */ u("span", { role: "alert", className: S.groupError, children: x })
970
1381
  ]
971
1382
  }
972
1383
  )
973
1384
  }
974
1385
  );
975
1386
  });
976
- oi.displayName = "RadioGroup";
977
- const ui = "_container_1f1un_1", ti = "_disabled_1f1un_29", pi = "_hiddenInput_1f1un_39", _i = "_track_1f1un_59", fi = "_checked_1f1un_101", hi = "_thumb_1f1un_111", bi = "_sizeSmall_1f1un_165", gi = "_sizeMedium_1f1un_179", wi = "_sizeLarge_1f1un_193", vi = "_icon_1f1un_209", ki = "_labelWrapper_1f1un_231", xi = "_label_1f1un_231", Ii = "_description_1f1un_253", J = {
978
- container: ui,
979
- disabled: ti,
980
- hiddenInput: pi,
981
- track: _i,
982
- checked: fi,
983
- thumb: hi,
984
- sizeSmall: bi,
985
- sizeMedium: gi,
986
- sizeLarge: wi,
987
- icon: vi,
988
- labelWrapper: ki,
989
- label: xi,
990
- description: Ii
991
- }, Li = {
992
- small: J.sizeSmall,
993
- medium: J.sizeMedium,
994
- large: J.sizeLarge
995
- }, $i = on(function({
996
- checked: k,
997
- defaultChecked: t = !1,
998
- onChange: x,
999
- disabled: I = !1,
1000
- size: h = "medium",
1001
- label: L,
1002
- description: b,
1003
- checkedIcon: E,
1004
- uncheckedIcon: z,
1005
- name: _,
1006
- value: $,
1007
- className: M,
1008
- style: H,
1009
- styles: p,
1010
- slotClassNames: n,
1011
- slotStyles: e,
1012
- "data-testid": Q,
1013
- id: a,
1014
- ...r
1015
- }, u) {
1016
- const i = tn(null);
1017
- bn(u, () => i.current);
1018
- const W = k !== void 0, [V, A] = N(t), O = W ? k : V, { getCombinedStyle: U } = pn("switch", p), g = (X) => {
1019
- if (I) return;
1020
- const B = X.target.checked;
1021
- W || A(B), x == null || x(B, X);
1022
- }, D = d(
1387
+ Gr.displayName = "RadioGroup";
1388
+ const Ur = "_container_1f1un_1", jr = "_disabled_1f1un_29", Zr = "_hiddenInput_1f1un_39", Kr = "_track_1f1un_59", Jr = "_checked_1f1un_101", Qr = "_thumb_1f1un_111", Xr = "_sizeSmall_1f1un_165", Yr = "_sizeMedium_1f1un_179", mr = "_sizeLarge_1f1un_193", yr = "_icon_1f1un_209", Cr = "_labelWrapper_1f1un_231", Sr = "_label_1f1un_231", Nr = "_description_1f1un_253", X = {
1389
+ container: Ur,
1390
+ disabled: jr,
1391
+ hiddenInput: Zr,
1392
+ track: Kr,
1393
+ checked: Jr,
1394
+ thumb: Qr,
1395
+ sizeSmall: Xr,
1396
+ sizeMedium: Yr,
1397
+ sizeLarge: mr,
1398
+ icon: yr,
1399
+ labelWrapper: Cr,
1400
+ label: Sr,
1401
+ description: Nr
1402
+ }, sr = {
1403
+ small: X.sizeSmall,
1404
+ medium: X.sizeMedium,
1405
+ large: X.sizeLarge
1406
+ }, ei = ce(function({
1407
+ checked: t,
1408
+ defaultChecked: i = !1,
1409
+ onChange: c,
1410
+ disabled: r = !1,
1411
+ size: f = "medium",
1412
+ label: d,
1413
+ description: h,
1414
+ checkedIcon: x,
1415
+ uncheckedIcon: l,
1416
+ name: v,
1417
+ value: I,
1418
+ className: E,
1419
+ style: V,
1420
+ styles: k,
1421
+ slotClassNames: e,
1422
+ slotStyles: n,
1423
+ "data-testid": U,
1424
+ id: _,
1425
+ ...p
1426
+ }, g) {
1427
+ const a = fe(null);
1428
+ $e(g, () => a.current);
1429
+ const A = t !== void 0, [D, M] = N(i), q = A ? t : D, { getCombinedStyle: j } = de("switch", k), B = (Y) => {
1430
+ if (r) return;
1431
+ const R = Y.target.checked;
1432
+ A || M(R), c == null || c(R, Y);
1433
+ }, H = b(
1023
1434
  "wui-switch-container",
1024
- J.container,
1025
- I && J.disabled,
1026
- n == null ? void 0 : n.container,
1027
- M
1028
- ), w = d(
1435
+ X.container,
1436
+ r && X.disabled,
1437
+ e == null ? void 0 : e.container,
1438
+ E
1439
+ ), L = b(
1029
1440
  "wui-switch-track",
1030
- J.track,
1031
- Li[h],
1032
- O && J.checked,
1033
- n == null ? void 0 : n.track
1034
- ), R = d("wui-switch-thumb", J.thumb, n == null ? void 0 : n.thumb);
1035
- return /* @__PURE__ */ q("label", { className: D, style: U(H), "data-testid": Q, children: [
1036
- /* @__PURE__ */ c(
1441
+ X.track,
1442
+ sr[f],
1443
+ q && X.checked,
1444
+ e == null ? void 0 : e.track
1445
+ ), O = b("wui-switch-thumb", X.thumb, e == null ? void 0 : e.thumb);
1446
+ return /* @__PURE__ */ F("label", { className: H, style: j(V), "data-testid": U, children: [
1447
+ /* @__PURE__ */ u(
1037
1448
  "input",
1038
1449
  {
1039
- ref: i,
1040
- id: a,
1450
+ ref: a,
1451
+ id: _,
1041
1452
  type: "checkbox",
1042
1453
  role: "switch",
1043
- name: _,
1044
- value: $,
1045
- checked: O,
1046
- disabled: I,
1047
- onChange: g,
1048
- className: J.hiddenInput,
1049
- "aria-checked": O,
1050
- ...r
1454
+ name: v,
1455
+ value: I,
1456
+ checked: q,
1457
+ disabled: r,
1458
+ onChange: B,
1459
+ className: X.hiddenInput,
1460
+ "aria-checked": q,
1461
+ ...p
1051
1462
  }
1052
1463
  ),
1053
- /* @__PURE__ */ c("span", { className: w, style: e == null ? void 0 : e.track, "aria-hidden": "true", children: /* @__PURE__ */ c("span", { className: R, style: e == null ? void 0 : e.thumb, children: O ? E && /* @__PURE__ */ c(
1464
+ /* @__PURE__ */ u("span", { className: L, style: n == null ? void 0 : n.track, "aria-hidden": "true", children: /* @__PURE__ */ u("span", { className: O, style: n == null ? void 0 : n.thumb, children: q ? x && /* @__PURE__ */ u(
1054
1465
  "span",
1055
1466
  {
1056
- className: d(J.icon, n == null ? void 0 : n.icon),
1057
- style: e == null ? void 0 : e.icon,
1058
- children: E
1467
+ className: b(X.icon, e == null ? void 0 : e.icon),
1468
+ style: n == null ? void 0 : n.icon,
1469
+ children: x
1059
1470
  }
1060
- ) : z && /* @__PURE__ */ c(
1471
+ ) : l && /* @__PURE__ */ u(
1061
1472
  "span",
1062
1473
  {
1063
- className: d(J.icon, n == null ? void 0 : n.icon),
1064
- style: e == null ? void 0 : e.icon,
1065
- children: z
1474
+ className: b(X.icon, e == null ? void 0 : e.icon),
1475
+ style: n == null ? void 0 : n.icon,
1476
+ children: l
1066
1477
  }
1067
1478
  ) }) }),
1068
- (L || b) && /* @__PURE__ */ q(
1479
+ (d || h) && /* @__PURE__ */ F(
1069
1480
  "span",
1070
1481
  {
1071
- className: d(
1482
+ className: b(
1072
1483
  "wui-switch-label-wrapper",
1073
- J.labelWrapper,
1074
- n == null ? void 0 : n.labelWrapper
1484
+ X.labelWrapper,
1485
+ e == null ? void 0 : e.labelWrapper
1075
1486
  ),
1076
- style: e == null ? void 0 : e.labelWrapper,
1487
+ style: n == null ? void 0 : n.labelWrapper,
1077
1488
  children: [
1078
- L && /* @__PURE__ */ c(
1489
+ d && /* @__PURE__ */ u(
1079
1490
  "span",
1080
1491
  {
1081
- className: d("wui-switch-label", J.label, n == null ? void 0 : n.label),
1082
- style: e == null ? void 0 : e.label,
1083
- children: L
1492
+ className: b("wui-switch-label", X.label, e == null ? void 0 : e.label),
1493
+ style: n == null ? void 0 : n.label,
1494
+ children: d
1084
1495
  }
1085
1496
  ),
1086
- b && /* @__PURE__ */ c(
1497
+ h && /* @__PURE__ */ u(
1087
1498
  "span",
1088
1499
  {
1089
- className: d(
1500
+ className: b(
1090
1501
  "wui-switch-description",
1091
- J.description,
1092
- n == null ? void 0 : n.description
1502
+ X.description,
1503
+ e == null ? void 0 : e.description
1093
1504
  ),
1094
- style: e == null ? void 0 : e.description,
1095
- children: b
1505
+ style: n == null ? void 0 : n.description,
1506
+ children: h
1096
1507
  }
1097
1508
  )
1098
1509
  ]
@@ -1100,47 +1511,67 @@ const ui = "_container_1f1un_1", ti = "_disabled_1f1un_29", pi = "_hiddenInput_1
1100
1511
  )
1101
1512
  ] });
1102
1513
  });
1103
- $i.displayName = "Switch";
1514
+ ei.displayName = "Switch";
1515
+ const ni = ({
1516
+ children: o,
1517
+ config: t,
1518
+ wrapWithContainer: i = !1,
1519
+ className: c,
1520
+ style: r
1521
+ }) => {
1522
+ const f = Ie(be), d = ke(() => Se(f, t), [f, t]), h = ke(() => {
1523
+ if (!i) return {};
1524
+ const l = _e(
1525
+ d.colors,
1526
+ "wui-color"
1527
+ ), v = _e(
1528
+ d.typography,
1529
+ "wui-typography"
1530
+ ), I = _e(
1531
+ d.layout,
1532
+ "wui-layout"
1533
+ );
1534
+ return {
1535
+ ...l,
1536
+ ...v,
1537
+ ...I,
1538
+ ...r
1539
+ };
1540
+ }, [i, d, r]), x = i ? /* @__PURE__ */ u(
1541
+ "div",
1542
+ {
1543
+ className: c ? `wui-provider-root ${c}` : "wui-provider-root",
1544
+ style: h,
1545
+ children: o
1546
+ }
1547
+ ) : o;
1548
+ return /* @__PURE__ */ u(be.Provider, { value: d, children: x });
1549
+ };
1550
+ ni.displayName = "UIProvider";
1104
1551
  export {
1105
- Zi as Button,
1106
- ie as Checkbox,
1107
- mn as Input,
1108
- kn as Radio,
1109
- oi as RadioGroup,
1110
- vn as RadioGroupContext,
1111
- Fe as Select,
1112
- $i as Switch,
1113
- me as Textarea,
1114
- Ji as UIContext,
1115
- Qi as UIProvider,
1116
- ir as WbButton,
1117
- rr as buttonStyles,
1118
- zi as camelToKebab,
1119
- d as classNames,
1120
- Fi as configureWebstrail,
1121
- Xi as deepMerge,
1122
- Ai as defaultButtonStyles,
1123
- Oi as defaultColors,
1124
- Ri as defaultLayout,
1125
- Mi as defaultResolvedConfig,
1126
- Vi as defaultTypography,
1127
- Yi as defaultUIConfig,
1128
- mi as deriveTokensFromPrimary,
1129
- yi as getDarkerShade,
1130
- li as getFocusRingColor,
1131
- Ni as getSubtleBackgroundColor,
1132
- Di as getWebstrailConfig,
1133
- Si as mergeUIConfig,
1134
- ji as normalizeButtonSize,
1135
- Gi as normalizeDimension,
1136
- cr as registerWbButton,
1137
- Hi as resetWebstrailConfig,
1138
- Ci as resolveComponentStyles,
1139
- Ui as resolveEffectiveButtonConfig,
1140
- si as stylesToCssVars,
1141
- Pi as subscribeWebstrailConfig,
1142
- pn as useComponentStyles,
1143
- ai as useRadioGroup,
1144
- nr as useUI
1552
+ rn as Button,
1553
+ On as Checkbox,
1554
+ zn as Input,
1555
+ Re as Radio,
1556
+ Gr as RadioGroup,
1557
+ Ae as RadioGroupContext,
1558
+ tr as Select,
1559
+ ei as Switch,
1560
+ zr as Textarea,
1561
+ be as UIContext,
1562
+ ni as UIProvider,
1563
+ b as classNames,
1564
+ he as deepMerge,
1565
+ Fe as defaultUIConfig,
1566
+ Ce as deriveTokensFromPrimary,
1567
+ Be as getDarkerShade,
1568
+ ye as getFocusRingColor,
1569
+ xe as getSubtleBackgroundColor,
1570
+ Se as mergeUIConfig,
1571
+ nn as resolveComponentStyles,
1572
+ _e as stylesToCssVars,
1573
+ de as useComponentStyles,
1574
+ Pr as useRadioGroup,
1575
+ me as useUI
1145
1576
  };
1146
1577
  //# sourceMappingURL=index.js.map