@webstrail/ui-library 0.0.0-stage → 1.0.1
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.
- package/LICENSE +21 -0
- package/README.md +524 -3
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.types.d.ts +45 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +38 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.types.d.ts +87 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +2 -0
- package/dist/components/Radio/Radio.types.d.ts +119 -0
- package/dist/components/Radio/RadioGroup.d.ts +2 -0
- package/dist/components/Radio/RadioGroupContext.d.ts +13 -0
- package/dist/components/Radio/index.d.ts +4 -0
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.types.d.ts +100 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +2 -0
- package/dist/components/Switch/Switch.types.d.ts +82 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +2 -0
- package/dist/components/Textarea/Textarea.types.d.ts +61 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/config/config.types.d.ts +232 -0
- package/dist/config/defaultConfig.d.ts +2 -0
- package/dist/config/mergeConfig.d.ts +28 -0
- package/dist/context/UIContext.d.ts +6 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useComponentStyles.d.ts +26 -0
- package/dist/hooks/useUI.d.ts +6 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +1577 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/UIProvider.d.ts +20 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/style.css +1 -0
- package/dist/types/common.d.ts +41 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/classNames.d.ts +11 -0
- package/dist/utils/resolveStyles.d.ts +28 -0
- package/package.json +104 -6
package/dist/index.js
ADDED
|
@@ -0,0 +1,1577 @@
|
|
|
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
|
|
18
|
+
};
|
|
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);
|
|
30
|
+
}
|
|
31
|
+
} else if (typeof i == "object") {
|
|
32
|
+
for (const [c, n] of Object.entries(i))
|
|
33
|
+
if (n) {
|
|
34
|
+
const f = c.trim();
|
|
35
|
+
f && t.push(f);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return t.join(" ");
|
|
40
|
+
}
|
|
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 ve(o) {
|
|
202
|
+
return typeof o == "object" && o !== null && !Array.isArray(o);
|
|
203
|
+
}
|
|
204
|
+
function we(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), w = parseInt(c[3], 16);
|
|
209
|
+
return `rgba(${d}, ${h}, ${w}, ${t})`;
|
|
210
|
+
}
|
|
211
|
+
const n = i.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
|
|
212
|
+
if (n) {
|
|
213
|
+
const d = parseInt(n[1] + n[1], 16), h = parseInt(n[2] + n[2], 16), w = parseInt(n[3] + n[3], 16);
|
|
214
|
+
return `rgba(${d}, ${h}, ${w}, ${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), w = parseInt(c[3], 16);
|
|
224
|
+
return `rgba(${d}, ${h}, ${w}, ${t})`;
|
|
225
|
+
}
|
|
226
|
+
const n = i.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
|
|
227
|
+
if (n) {
|
|
228
|
+
const d = parseInt(n[1] + n[1], 16), h = parseInt(n[2] + n[2], 16), w = parseInt(n[3] + n[3], 16);
|
|
229
|
+
return `rgba(${d}, ${h}, ${w}, ${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), w = Math.round(parseInt(c[2], 16) * d), l = Math.round(parseInt(c[3], 16) * d), x = (I) => I.toString(16).padStart(2, "0");
|
|
239
|
+
return `#${x(h)}${x(w)}${x(l)}`;
|
|
240
|
+
}
|
|
241
|
+
const n = i.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
|
|
242
|
+
if (n) {
|
|
243
|
+
const d = Math.max(0, 1 - t), h = Math.round(parseInt(n[1] + n[1], 16) * d), w = Math.round(parseInt(n[2] + n[2], 16) * d), l = Math.round(parseInt(n[3] + n[3], 16) * d), x = (I) => I.toString(16).padStart(2, "0");
|
|
244
|
+
return `#${x(h)}${x(w)}${x(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 = we(o, 0.1), i = we(o, 0.18), c = ye(o, 0.25), n = Be(o, 0.12), f = Be(o, 0.22), d = we(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: n,
|
|
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 || !ve(c))
|
|
302
|
+
continue;
|
|
303
|
+
const n = { ...i };
|
|
304
|
+
for (const f of Object.keys(c)) {
|
|
305
|
+
const d = c[f];
|
|
306
|
+
if (d === void 0)
|
|
307
|
+
continue;
|
|
308
|
+
const h = n[f];
|
|
309
|
+
ve(h) && ve(d) ? n[f] = he(
|
|
310
|
+
h,
|
|
311
|
+
d
|
|
312
|
+
) : n[f] = d;
|
|
313
|
+
}
|
|
314
|
+
i = n;
|
|
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 n = Ce(i);
|
|
325
|
+
return he(o, n, 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 er(o, t) {
|
|
343
|
+
return typeof t == "number" && !Ne.has(o) ? `${t}px` : String(t);
|
|
344
|
+
}
|
|
345
|
+
function rr(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, n] of Object.entries(o))
|
|
357
|
+
if (!(n == null || n === "") && (typeof n == "string" || typeof n == "number")) {
|
|
358
|
+
const f = `--${t}-${se(c)}`;
|
|
359
|
+
i[f] = er(c, n);
|
|
360
|
+
}
|
|
361
|
+
return i;
|
|
362
|
+
}
|
|
363
|
+
function de(o, t) {
|
|
364
|
+
const i = me(), c = Fe[o], n = i[o];
|
|
365
|
+
return ke(() => {
|
|
366
|
+
const f = rr(
|
|
367
|
+
c,
|
|
368
|
+
n,
|
|
369
|
+
t
|
|
370
|
+
), d = _e(
|
|
371
|
+
f,
|
|
372
|
+
`wui-${o}`
|
|
373
|
+
);
|
|
374
|
+
return {
|
|
375
|
+
resolved: f,
|
|
376
|
+
cssVars: d,
|
|
377
|
+
getCombinedStyle: (w) => w ? {
|
|
378
|
+
...d,
|
|
379
|
+
...w
|
|
380
|
+
} : d
|
|
381
|
+
};
|
|
382
|
+
}, [o, c, n, t]);
|
|
383
|
+
}
|
|
384
|
+
const nr = ce(function({
|
|
385
|
+
children: t,
|
|
386
|
+
label: i,
|
|
387
|
+
variant: c = "primary",
|
|
388
|
+
size: n = "medium",
|
|
389
|
+
loading: f = !1,
|
|
390
|
+
loadingText: d,
|
|
391
|
+
disabled: h = !1,
|
|
392
|
+
startIcon: w,
|
|
393
|
+
endIcon: l,
|
|
394
|
+
fullWidth: x = !1,
|
|
395
|
+
className: I,
|
|
396
|
+
style: E,
|
|
397
|
+
styles: V,
|
|
398
|
+
type: k = "button",
|
|
399
|
+
...e
|
|
400
|
+
}, r) {
|
|
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
|
+
}[n], g = h || f, a = b(
|
|
412
|
+
"wui-button",
|
|
413
|
+
J.button,
|
|
414
|
+
_,
|
|
415
|
+
p,
|
|
416
|
+
x && J.fullWidth,
|
|
417
|
+
f && J.loading,
|
|
418
|
+
g && J.disabled,
|
|
419
|
+
I
|
|
420
|
+
);
|
|
421
|
+
return /* @__PURE__ */ F(
|
|
422
|
+
"button",
|
|
423
|
+
{
|
|
424
|
+
ref: r,
|
|
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" }) : w ? /* @__PURE__ */ u("span", { className: J.icon, children: w }) : 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
|
+
nr.displayName = "Button";
|
|
441
|
+
const ir = "_container_mdr3c_1", cr = "_floatingContainer_mdr3c_8", or = "_label_mdr3c_12", ar = "_requiredAsterisk_mdr3c_22", tr = "_outerWrapper_mdr3c_28", dr = "_inputWrapper_mdr3c_35", ur = "_outerIconBox_mdr3c_39", fr = "_hasError_mdr3c_68", pr = "_disabled_mdr3c_72", _r = "_withFloatingLabel_mdr3c_93", br = "_floatingLabel_mdr3c_121", hr = "_floatingLabelText_mdr3c_143", gr = "_withStartIcon_mdr3c_164", xr = "_floated_mdr3c_168", vr = "_input_mdr3c_35", wr = "_floatingInput_mdr3c_219", kr = "_withEndIcon_mdr3c_239", Ir = "_startIcon_mdr3c_243", $r = "_endIcon_mdr3c_244", lr = "_helperText_mdr3c_254", Br = "_errorMessage_mdr3c_260", $ = {
|
|
442
|
+
container: ir,
|
|
443
|
+
floatingContainer: cr,
|
|
444
|
+
label: or,
|
|
445
|
+
requiredAsterisk: ar,
|
|
446
|
+
outerWrapper: tr,
|
|
447
|
+
inputWrapper: dr,
|
|
448
|
+
outerIconBox: ur,
|
|
449
|
+
hasError: fr,
|
|
450
|
+
disabled: pr,
|
|
451
|
+
withFloatingLabel: _r,
|
|
452
|
+
floatingLabel: br,
|
|
453
|
+
floatingLabelText: hr,
|
|
454
|
+
withStartIcon: gr,
|
|
455
|
+
floated: xr,
|
|
456
|
+
input: vr,
|
|
457
|
+
floatingInput: wr,
|
|
458
|
+
withEndIcon: kr,
|
|
459
|
+
startIcon: Ir,
|
|
460
|
+
endIcon: $r,
|
|
461
|
+
helperText: lr,
|
|
462
|
+
errorMessage: Br
|
|
463
|
+
}, Lr = ce(function({
|
|
464
|
+
id: t,
|
|
465
|
+
label: i,
|
|
466
|
+
floatingLabel: c,
|
|
467
|
+
helperText: n,
|
|
468
|
+
errorMessage: f,
|
|
469
|
+
required: d = !1,
|
|
470
|
+
disabled: h = !1,
|
|
471
|
+
readOnly: w = !1,
|
|
472
|
+
startIcon: l,
|
|
473
|
+
endIcon: x,
|
|
474
|
+
startIconPlacement: I = "inside",
|
|
475
|
+
endIconPlacement: E = "inside",
|
|
476
|
+
outerStartIcon: V,
|
|
477
|
+
outerEndIcon: k,
|
|
478
|
+
className: e,
|
|
479
|
+
style: r,
|
|
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 = n ? `${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
|
+
), [re, C] = N(!1), Q = m ? M.value : y, ne = Q != null && String(Q).trim().length > 0, oe = re || !!ne, 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), v = I === "outside" ? void 0 : l, W = k ?? (E === "outside" ? x : void 0), K = E === "outside" ? void 0 : x, xe = !!(te || W), We = b(
|
|
498
|
+
"wui-input-container",
|
|
499
|
+
$.container,
|
|
500
|
+
ae && $.floatingContainer,
|
|
501
|
+
e
|
|
502
|
+
), Te = b(
|
|
503
|
+
"wui-input-wrapper",
|
|
504
|
+
$.inputWrapper,
|
|
505
|
+
ae && $.withFloatingLabel,
|
|
506
|
+
P && $.hasError,
|
|
507
|
+
h && $.disabled,
|
|
508
|
+
_ == null ? void 0 : _.wrapper
|
|
509
|
+
), Ee = b(
|
|
510
|
+
"wui-input-field",
|
|
511
|
+
$.input,
|
|
512
|
+
ae && $.floatingInput,
|
|
513
|
+
oe && $.floated,
|
|
514
|
+
!!v && $.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(
|
|
519
|
+
"label",
|
|
520
|
+
{
|
|
521
|
+
htmlFor: B,
|
|
522
|
+
className: b(
|
|
523
|
+
"wui-input-floating-label",
|
|
524
|
+
$.floatingLabel,
|
|
525
|
+
!!v && $.withStartIcon,
|
|
526
|
+
oe && $.floated,
|
|
527
|
+
(_ == null ? void 0 : _.floatingLabel) || (_ == null ? void 0 : _.label)
|
|
528
|
+
),
|
|
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: "*" })
|
|
533
|
+
] })
|
|
534
|
+
}
|
|
535
|
+
),
|
|
536
|
+
v && /* @__PURE__ */ u("span", { className: $.startIcon, children: v }),
|
|
537
|
+
/* @__PURE__ */ u(
|
|
538
|
+
"input",
|
|
539
|
+
{
|
|
540
|
+
ref: (G) => {
|
|
541
|
+
O.current = G, typeof q == "function" ? q(G) : q && (q.current = G);
|
|
542
|
+
},
|
|
543
|
+
id: B,
|
|
544
|
+
disabled: h,
|
|
545
|
+
readOnly: w,
|
|
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
|
|
555
|
+
}
|
|
556
|
+
),
|
|
557
|
+
K && /* @__PURE__ */ u("span", { className: $.endIcon, children: K })
|
|
558
|
+
] }), qe = xe ? /* @__PURE__ */ F(
|
|
559
|
+
"div",
|
|
560
|
+
{
|
|
561
|
+
className: b(
|
|
562
|
+
"wui-input-outer-wrapper",
|
|
563
|
+
$.outerWrapper,
|
|
564
|
+
_ == null ? void 0 : _.outerWrapper
|
|
565
|
+
),
|
|
566
|
+
style: p == null ? void 0 : p.outerWrapper,
|
|
567
|
+
children: [
|
|
568
|
+
te && /* @__PURE__ */ u(
|
|
569
|
+
"div",
|
|
570
|
+
{
|
|
571
|
+
className: b(
|
|
572
|
+
"wui-input-outer-icon",
|
|
573
|
+
"wui-input-outer-start-icon",
|
|
574
|
+
$.outerIconBox,
|
|
575
|
+
h && $.disabled,
|
|
576
|
+
P && $.hasError,
|
|
577
|
+
(_ == null ? void 0 : _.outerIconBox) || (_ == null ? void 0 : _.outerStartIcon)
|
|
578
|
+
),
|
|
579
|
+
style: (p == null ? void 0 : p.outerIconBox) || (p == null ? void 0 : p.outerStartIcon),
|
|
580
|
+
onClick: () => {
|
|
581
|
+
var G;
|
|
582
|
+
return !h && ((G = O.current) == null ? void 0 : G.focus());
|
|
583
|
+
},
|
|
584
|
+
children: te
|
|
585
|
+
}
|
|
586
|
+
),
|
|
587
|
+
le,
|
|
588
|
+
W && /* @__PURE__ */ u(
|
|
589
|
+
"div",
|
|
590
|
+
{
|
|
591
|
+
className: b(
|
|
592
|
+
"wui-input-outer-icon",
|
|
593
|
+
"wui-input-outer-end-icon",
|
|
594
|
+
$.outerIconBox,
|
|
595
|
+
h && $.disabled,
|
|
596
|
+
P && $.hasError,
|
|
597
|
+
(_ == null ? void 0 : _.outerIconBox) || (_ == null ? void 0 : _.outerEndIcon)
|
|
598
|
+
),
|
|
599
|
+
style: (p == null ? void 0 : p.outerIconBox) || (p == null ? void 0 : p.outerEndIcon),
|
|
600
|
+
onClick: () => {
|
|
601
|
+
var G;
|
|
602
|
+
return !h && ((G = O.current) == null ? void 0 : G.focus());
|
|
603
|
+
},
|
|
604
|
+
children: W
|
|
605
|
+
}
|
|
606
|
+
)
|
|
607
|
+
]
|
|
608
|
+
}
|
|
609
|
+
) : le;
|
|
610
|
+
return /* @__PURE__ */ F("div", { className: We, style: R(r), "data-testid": g, children: [
|
|
611
|
+
!Z && i && /* @__PURE__ */ F(
|
|
612
|
+
"label",
|
|
613
|
+
{
|
|
614
|
+
htmlFor: B,
|
|
615
|
+
className: b("wui-input-label", $.label, _ == null ? void 0 : _.label),
|
|
616
|
+
style: p == null ? void 0 : p.label,
|
|
617
|
+
children: [
|
|
618
|
+
i,
|
|
619
|
+
d && /* @__PURE__ */ u("span", { className: $.requiredAsterisk, "aria-hidden": "true", children: "*" })
|
|
620
|
+
]
|
|
621
|
+
}
|
|
622
|
+
),
|
|
623
|
+
qe,
|
|
624
|
+
P ? /* @__PURE__ */ u(
|
|
625
|
+
"span",
|
|
626
|
+
{
|
|
627
|
+
id: L,
|
|
628
|
+
role: "alert",
|
|
629
|
+
className: b(
|
|
630
|
+
"wui-input-error",
|
|
631
|
+
$.errorMessage,
|
|
632
|
+
_ == null ? void 0 : _.errorMessage
|
|
633
|
+
),
|
|
634
|
+
style: p == null ? void 0 : p.errorMessage,
|
|
635
|
+
children: f
|
|
636
|
+
}
|
|
637
|
+
) : n ? /* @__PURE__ */ u(
|
|
638
|
+
"span",
|
|
639
|
+
{
|
|
640
|
+
id: H,
|
|
641
|
+
className: b(
|
|
642
|
+
"wui-input-helper",
|
|
643
|
+
$.helperText,
|
|
644
|
+
_ == null ? void 0 : _.helperText
|
|
645
|
+
),
|
|
646
|
+
style: p == null ? void 0 : p.helperText,
|
|
647
|
+
children: n
|
|
648
|
+
}
|
|
649
|
+
) : null
|
|
650
|
+
] });
|
|
651
|
+
});
|
|
652
|
+
Lr.displayName = "Input";
|
|
653
|
+
const zr = "_container_1mwsv_1", Fr = "_disabled_1mwsv_27", Ar = "_hiddenInput_1mwsv_37", Rr = "_box_1mwsv_55", Wr = "_checked_1mwsv_91", Tr = "_indeterminate_1mwsv_93", Er = "_icon_1mwsv_103", Mr = "_label_1mwsv_123", ie = {
|
|
654
|
+
container: zr,
|
|
655
|
+
disabled: Fr,
|
|
656
|
+
hiddenInput: Ar,
|
|
657
|
+
box: Rr,
|
|
658
|
+
checked: Wr,
|
|
659
|
+
indeterminate: Tr,
|
|
660
|
+
icon: Er,
|
|
661
|
+
label: Mr
|
|
662
|
+
}, qr = ce(function({
|
|
663
|
+
label: t,
|
|
664
|
+
checked: i,
|
|
665
|
+
defaultChecked: c = !1,
|
|
666
|
+
indeterminate: n = !1,
|
|
667
|
+
disabled: f = !1,
|
|
668
|
+
onChange: d,
|
|
669
|
+
className: h,
|
|
670
|
+
style: w,
|
|
671
|
+
styles: l,
|
|
672
|
+
slotClassNames: x,
|
|
673
|
+
slotStyles: I,
|
|
674
|
+
"data-testid": E,
|
|
675
|
+
...V
|
|
676
|
+
}, k) {
|
|
677
|
+
const e = fe(null);
|
|
678
|
+
$e(k, () => e.current);
|
|
679
|
+
const r = i !== void 0, [U, _] = N(c), p = r ? i : U, { getCombinedStyle: g } = de("checkbox", l);
|
|
680
|
+
ze(() => {
|
|
681
|
+
e.current && (e.current.indeterminate = !!n);
|
|
682
|
+
}, [n]);
|
|
683
|
+
const a = (M) => {
|
|
684
|
+
f || (r || _(M.target.checked), d == null || d(M));
|
|
685
|
+
}, A = b(
|
|
686
|
+
"wui-checkbox-container",
|
|
687
|
+
ie.container,
|
|
688
|
+
f && ie.disabled,
|
|
689
|
+
x == null ? void 0 : x.container,
|
|
690
|
+
h
|
|
691
|
+
), D = b(
|
|
692
|
+
"wui-checkbox-box",
|
|
693
|
+
ie.box,
|
|
694
|
+
p && ie.checked,
|
|
695
|
+
n && ie.indeterminate,
|
|
696
|
+
x == null ? void 0 : x.box
|
|
697
|
+
);
|
|
698
|
+
return /* @__PURE__ */ F("label", { className: A, style: g(w), "data-testid": E, children: [
|
|
699
|
+
/* @__PURE__ */ u(
|
|
700
|
+
"input",
|
|
701
|
+
{
|
|
702
|
+
ref: e,
|
|
703
|
+
type: "checkbox",
|
|
704
|
+
checked: p,
|
|
705
|
+
disabled: f,
|
|
706
|
+
onChange: a,
|
|
707
|
+
className: ie.hiddenInput,
|
|
708
|
+
"aria-checked": n ? "mixed" : p,
|
|
709
|
+
...V
|
|
710
|
+
}
|
|
711
|
+
),
|
|
712
|
+
/* @__PURE__ */ u("span", { className: D, style: I == null ? void 0 : I.box, children: n ? /* @__PURE__ */ u(
|
|
713
|
+
"svg",
|
|
714
|
+
{
|
|
715
|
+
className: b(ie.icon, x == null ? void 0 : x.icon),
|
|
716
|
+
style: I == null ? void 0 : I.icon,
|
|
717
|
+
viewBox: "0 0 24 24",
|
|
718
|
+
"aria-hidden": "true",
|
|
719
|
+
children: /* @__PURE__ */ u("line", { x1: "5", y1: "12", x2: "19", y2: "12", strokeWidth: "3" })
|
|
720
|
+
}
|
|
721
|
+
) : p ? /* @__PURE__ */ u(
|
|
722
|
+
"svg",
|
|
723
|
+
{
|
|
724
|
+
className: b(ie.icon, x == null ? void 0 : x.icon),
|
|
725
|
+
style: I == null ? void 0 : I.icon,
|
|
726
|
+
viewBox: "0 0 24 24",
|
|
727
|
+
"aria-hidden": "true",
|
|
728
|
+
children: /* @__PURE__ */ u("polyline", { points: "20 6 9 17 4 12", strokeWidth: "3" })
|
|
729
|
+
}
|
|
730
|
+
) : null }),
|
|
731
|
+
t && /* @__PURE__ */ u(
|
|
732
|
+
"span",
|
|
733
|
+
{
|
|
734
|
+
className: b("wui-checkbox-label", ie.label, x == null ? void 0 : x.label),
|
|
735
|
+
style: I == null ? void 0 : I.label,
|
|
736
|
+
children: t
|
|
737
|
+
}
|
|
738
|
+
)
|
|
739
|
+
] });
|
|
740
|
+
});
|
|
741
|
+
qr.displayName = "Checkbox";
|
|
742
|
+
const Or = "_container_q8gl5_1", Vr = "_floatingContainer_q8gl5_15", Dr = "_selectWrapper_q8gl5_23", Hr = "_withFloatingLabel_q8gl5_33", Pr = "_selectWrapperOpen_q8gl5_41", Gr = "_label_q8gl5_49", Ur = "_requiredAsterisk_q8gl5_69", jr = "_floatingLabel_q8gl5_81", Zr = "_floatingLabelText_q8gl5_125", Kr = "_floated_q8gl5_167", Jr = "_trigger_q8gl5_199", Qr = "_hasError_q8gl5_199", Xr = "_disabled_q8gl5_209", Yr = "_open_q8gl5_273", mr = "_value_q8gl5_315", yr = "_placeholder_q8gl5_329", Cr = "_floatingPlaceholder_q8gl5_337", Sr = "_arrow_q8gl5_359", Nr = "_arrowOpen_q8gl5_379", sr = "_dropdown_q8gl5_387", en = "_option_q8gl5_431", rn = "_optionActive_q8gl5_467", nn = "_optionSelected_q8gl5_477", cn = "_optionDisabled_q8gl5_519", on = "_checkIcon_q8gl5_531", an = "_errorMessage_q8gl5_553", z = {
|
|
743
|
+
container: Or,
|
|
744
|
+
floatingContainer: Vr,
|
|
745
|
+
selectWrapper: Dr,
|
|
746
|
+
withFloatingLabel: Hr,
|
|
747
|
+
selectWrapperOpen: Pr,
|
|
748
|
+
label: Gr,
|
|
749
|
+
requiredAsterisk: Ur,
|
|
750
|
+
floatingLabel: jr,
|
|
751
|
+
floatingLabelText: Zr,
|
|
752
|
+
floated: Kr,
|
|
753
|
+
trigger: Jr,
|
|
754
|
+
hasError: Qr,
|
|
755
|
+
disabled: Xr,
|
|
756
|
+
open: Yr,
|
|
757
|
+
value: mr,
|
|
758
|
+
placeholder: yr,
|
|
759
|
+
floatingPlaceholder: Cr,
|
|
760
|
+
arrow: Sr,
|
|
761
|
+
arrowOpen: Nr,
|
|
762
|
+
dropdown: sr,
|
|
763
|
+
option: en,
|
|
764
|
+
optionActive: rn,
|
|
765
|
+
optionSelected: nn,
|
|
766
|
+
optionDisabled: cn,
|
|
767
|
+
checkIcon: on,
|
|
768
|
+
errorMessage: an
|
|
769
|
+
}, tn = ce(function({
|
|
770
|
+
options: t,
|
|
771
|
+
value: i,
|
|
772
|
+
defaultValue: c,
|
|
773
|
+
placeholder: n = "Select an option...",
|
|
774
|
+
label: f,
|
|
775
|
+
floatingLabel: d,
|
|
776
|
+
errorMessage: h,
|
|
777
|
+
disabled: w = !1,
|
|
778
|
+
required: l = !1,
|
|
779
|
+
onChange: x,
|
|
780
|
+
name: I,
|
|
781
|
+
className: E,
|
|
782
|
+
style: V,
|
|
783
|
+
styles: k,
|
|
784
|
+
slotClassNames: e,
|
|
785
|
+
slotStyles: r,
|
|
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: re } = de("select", k), C = !!h, Q = d ?? (ee == null ? void 0 : ee.floatingLabel) ?? !0, ne = !!(Q && f), oe = L || Y || !!H, s = t.find((v) => v.value === H);
|
|
790
|
+
ze(() => {
|
|
791
|
+
if (!L) return;
|
|
792
|
+
const v = (W) => {
|
|
793
|
+
m.current && !m.current.contains(W.target) && O(!1);
|
|
794
|
+
};
|
|
795
|
+
return document.addEventListener("mousedown", v), () => {
|
|
796
|
+
document.removeEventListener("mousedown", v);
|
|
797
|
+
};
|
|
798
|
+
}, [L]);
|
|
799
|
+
const ue = (v) => {
|
|
800
|
+
var W;
|
|
801
|
+
v.disabled || w || (q || B(v.value), x == null || x(v.value), O(!1), (W = y.current) == null || W.focus());
|
|
802
|
+
}, pe = (v) => {
|
|
803
|
+
if (!w)
|
|
804
|
+
if (v.key === "ArrowDown" || v.key === "ArrowUp") {
|
|
805
|
+
if (v.preventDefault(), !L) {
|
|
806
|
+
O(!0), Z(0);
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
const W = v.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 v.key === "Enter" || v.key === " " ? (v.preventDefault(), L && P >= 0 && t[P] ? ue(t[P]) : O((W) => !W)) : v.key === "Escape" && L && (v.preventDefault(), O(!1));
|
|
813
|
+
}, ae = b(
|
|
814
|
+
"wui-select-container",
|
|
815
|
+
z.container,
|
|
816
|
+
ne && z.floatingContainer,
|
|
817
|
+
e == null ? void 0 : e.container,
|
|
818
|
+
E
|
|
819
|
+
), te = b(
|
|
820
|
+
"wui-select-trigger",
|
|
821
|
+
z.trigger,
|
|
822
|
+
L && z.open,
|
|
823
|
+
C && z.hasError,
|
|
824
|
+
w && z.disabled,
|
|
825
|
+
e == null ? void 0 : e.trigger
|
|
826
|
+
);
|
|
827
|
+
return /* @__PURE__ */ F(
|
|
828
|
+
"div",
|
|
829
|
+
{
|
|
830
|
+
ref: (v) => {
|
|
831
|
+
m.current = v, typeof p == "function" ? p(v) : p && (p.current = v);
|
|
832
|
+
},
|
|
833
|
+
className: ae,
|
|
834
|
+
style: re(V),
|
|
835
|
+
"data-testid": U,
|
|
836
|
+
children: [
|
|
837
|
+
!Q && f && /* @__PURE__ */ F(
|
|
838
|
+
"label",
|
|
839
|
+
{
|
|
840
|
+
id: A,
|
|
841
|
+
className: b("wui-select-label", z.label, e == null ? void 0 : e.label),
|
|
842
|
+
style: r == null ? void 0 : r.label,
|
|
843
|
+
onClick: () => {
|
|
844
|
+
var v;
|
|
845
|
+
return !w && ((v = y.current) == null ? void 0 : v.focus());
|
|
846
|
+
},
|
|
847
|
+
children: [
|
|
848
|
+
f,
|
|
849
|
+
l && /* @__PURE__ */ u("span", { className: z.requiredAsterisk, "aria-hidden": "true", children: "*" })
|
|
850
|
+
]
|
|
851
|
+
}
|
|
852
|
+
),
|
|
853
|
+
I && /* @__PURE__ */ u("input", { type: "hidden", name: I, value: H || "" }),
|
|
854
|
+
/* @__PURE__ */ F(
|
|
855
|
+
"div",
|
|
856
|
+
{
|
|
857
|
+
className: b(
|
|
858
|
+
"wui-select-wrapper",
|
|
859
|
+
z.selectWrapper,
|
|
860
|
+
ne && z.withFloatingLabel,
|
|
861
|
+
L && z.selectWrapperOpen,
|
|
862
|
+
e == null ? void 0 : e.wrapper
|
|
863
|
+
),
|
|
864
|
+
style: r == null ? void 0 : r.wrapper,
|
|
865
|
+
children: [
|
|
866
|
+
/* @__PURE__ */ F(
|
|
867
|
+
"button",
|
|
868
|
+
{
|
|
869
|
+
ref: y,
|
|
870
|
+
id: a,
|
|
871
|
+
type: "button",
|
|
872
|
+
role: "combobox",
|
|
873
|
+
"aria-expanded": L,
|
|
874
|
+
"aria-haspopup": "listbox",
|
|
875
|
+
"aria-controls": D,
|
|
876
|
+
"aria-labelledby": f ? A : void 0,
|
|
877
|
+
"aria-invalid": C ? "true" : "false",
|
|
878
|
+
"aria-describedby": M,
|
|
879
|
+
disabled: w,
|
|
880
|
+
onClick: () => !w && O((v) => !v),
|
|
881
|
+
onFocus: () => R(!0),
|
|
882
|
+
onBlur: () => R(!1),
|
|
883
|
+
onKeyDown: pe,
|
|
884
|
+
className: te,
|
|
885
|
+
style: r == null ? void 0 : r.trigger,
|
|
886
|
+
children: [
|
|
887
|
+
/* @__PURE__ */ u(
|
|
888
|
+
"span",
|
|
889
|
+
{
|
|
890
|
+
className: b(
|
|
891
|
+
"wui-select-value",
|
|
892
|
+
z.value,
|
|
893
|
+
!s && z.placeholder,
|
|
894
|
+
ne && !s && z.floatingPlaceholder,
|
|
895
|
+
oe && z.floated,
|
|
896
|
+
s ? e == null ? void 0 : e.value : e == null ? void 0 : e.placeholder
|
|
897
|
+
),
|
|
898
|
+
style: s ? r == null ? void 0 : r.value : r == null ? void 0 : r.placeholder,
|
|
899
|
+
children: s ? s.label : n
|
|
900
|
+
}
|
|
901
|
+
),
|
|
902
|
+
/* @__PURE__ */ u(
|
|
903
|
+
"span",
|
|
904
|
+
{
|
|
905
|
+
className: b(
|
|
906
|
+
"wui-select-arrow",
|
|
907
|
+
z.arrow,
|
|
908
|
+
L && z.arrowOpen,
|
|
909
|
+
e == null ? void 0 : e.arrow
|
|
910
|
+
),
|
|
911
|
+
style: r == null ? void 0 : r.arrow,
|
|
912
|
+
"aria-hidden": "true",
|
|
913
|
+
children: /* @__PURE__ */ u(
|
|
914
|
+
"svg",
|
|
915
|
+
{
|
|
916
|
+
width: "14",
|
|
917
|
+
height: "14",
|
|
918
|
+
viewBox: "0 0 24 24",
|
|
919
|
+
fill: "none",
|
|
920
|
+
stroke: "currentColor",
|
|
921
|
+
strokeWidth: "2.5",
|
|
922
|
+
children: /* @__PURE__ */ u("polyline", { points: "6 9 12 15 18 9" })
|
|
923
|
+
}
|
|
924
|
+
)
|
|
925
|
+
}
|
|
926
|
+
)
|
|
927
|
+
]
|
|
928
|
+
}
|
|
929
|
+
),
|
|
930
|
+
ne && /* @__PURE__ */ u(
|
|
931
|
+
"label",
|
|
932
|
+
{
|
|
933
|
+
id: A,
|
|
934
|
+
htmlFor: a,
|
|
935
|
+
className: b(
|
|
936
|
+
"wui-select-floating-label",
|
|
937
|
+
z.floatingLabel,
|
|
938
|
+
oe && z.floated,
|
|
939
|
+
(e == null ? void 0 : e.floatingLabel) || (e == null ? void 0 : e.label)
|
|
940
|
+
),
|
|
941
|
+
style: (r == null ? void 0 : r.floatingLabel) || (r == null ? void 0 : r.label),
|
|
942
|
+
onClick: () => {
|
|
943
|
+
var v;
|
|
944
|
+
return !w && ((v = y.current) == null ? void 0 : v.focus());
|
|
945
|
+
},
|
|
946
|
+
children: /* @__PURE__ */ F("span", { className: z.floatingLabelText, children: [
|
|
947
|
+
f,
|
|
948
|
+
l && /* @__PURE__ */ u("span", { className: z.requiredAsterisk, "aria-hidden": "true", children: "*" })
|
|
949
|
+
] })
|
|
950
|
+
}
|
|
951
|
+
),
|
|
952
|
+
L && /* @__PURE__ */ u(
|
|
953
|
+
"ul",
|
|
954
|
+
{
|
|
955
|
+
id: D,
|
|
956
|
+
role: "listbox",
|
|
957
|
+
"aria-labelledby": f ? A : void 0,
|
|
958
|
+
className: b(
|
|
959
|
+
"wui-select-dropdown",
|
|
960
|
+
z.dropdown,
|
|
961
|
+
e == null ? void 0 : e.dropdown
|
|
962
|
+
),
|
|
963
|
+
style: r == null ? void 0 : r.dropdown,
|
|
964
|
+
children: t.map((v, W) => {
|
|
965
|
+
const K = v.value === H, xe = W === P;
|
|
966
|
+
return /* @__PURE__ */ F(
|
|
967
|
+
"li",
|
|
968
|
+
{
|
|
969
|
+
role: "option",
|
|
970
|
+
"aria-selected": K,
|
|
971
|
+
"aria-disabled": v.disabled || void 0,
|
|
972
|
+
className: b(
|
|
973
|
+
"wui-select-option",
|
|
974
|
+
z.option,
|
|
975
|
+
K && z.optionSelected,
|
|
976
|
+
xe && z.optionActive,
|
|
977
|
+
v.disabled && z.optionDisabled,
|
|
978
|
+
e == null ? void 0 : e.option,
|
|
979
|
+
K && (e == null ? void 0 : e.selectedOption)
|
|
980
|
+
),
|
|
981
|
+
style: {
|
|
982
|
+
...r == null ? void 0 : r.option,
|
|
983
|
+
...K ? r == null ? void 0 : r.selectedOption : void 0
|
|
984
|
+
},
|
|
985
|
+
onClick: () => ue(v),
|
|
986
|
+
children: [
|
|
987
|
+
/* @__PURE__ */ u("span", { children: v.label }),
|
|
988
|
+
K && /* @__PURE__ */ u(
|
|
989
|
+
"svg",
|
|
990
|
+
{
|
|
991
|
+
className: b(z.checkIcon, e == null ? void 0 : e.checkIcon),
|
|
992
|
+
style: r == null ? void 0 : r.checkIcon,
|
|
993
|
+
viewBox: "0 0 24 24",
|
|
994
|
+
strokeWidth: "3",
|
|
995
|
+
"aria-hidden": "true",
|
|
996
|
+
children: /* @__PURE__ */ u("polyline", { points: "20 6 9 17 4 12" })
|
|
997
|
+
}
|
|
998
|
+
)
|
|
999
|
+
]
|
|
1000
|
+
},
|
|
1001
|
+
v.value
|
|
1002
|
+
);
|
|
1003
|
+
})
|
|
1004
|
+
}
|
|
1005
|
+
)
|
|
1006
|
+
]
|
|
1007
|
+
}
|
|
1008
|
+
),
|
|
1009
|
+
C && /* @__PURE__ */ u(
|
|
1010
|
+
"span",
|
|
1011
|
+
{
|
|
1012
|
+
id: M,
|
|
1013
|
+
role: "alert",
|
|
1014
|
+
className: b(
|
|
1015
|
+
"wui-select-error",
|
|
1016
|
+
z.errorMessage,
|
|
1017
|
+
e == null ? void 0 : e.errorMessage
|
|
1018
|
+
),
|
|
1019
|
+
style: r == null ? void 0 : r.errorMessage,
|
|
1020
|
+
children: h
|
|
1021
|
+
}
|
|
1022
|
+
)
|
|
1023
|
+
]
|
|
1024
|
+
}
|
|
1025
|
+
);
|
|
1026
|
+
});
|
|
1027
|
+
tn.displayName = "Select";
|
|
1028
|
+
const dn = "_container_1tasa_1", un = "_floatingContainer_1tasa_8", fn = "_label_1tasa_12", pn = "_requiredAsterisk_1tasa_22", _n = "_wrapper_1tasa_28", bn = "_withFloatingLabel_1tasa_40", hn = "_hasError_1tasa_53", gn = "_disabled_1tasa_62", xn = "_floatingLabel_1tasa_68", vn = "_floatingLabelText_1tasa_90", wn = "_floated_1tasa_111", kn = "_textarea_1tasa_139", In = "_floatingTextarea_1tasa_159", $n = "_footer_1tasa_175", ln = "_helperText_1tasa_183", Bn = "_errorMessage_1tasa_188", Ln = "_counter_1tasa_194", T = {
|
|
1029
|
+
container: dn,
|
|
1030
|
+
floatingContainer: un,
|
|
1031
|
+
label: fn,
|
|
1032
|
+
requiredAsterisk: pn,
|
|
1033
|
+
wrapper: _n,
|
|
1034
|
+
withFloatingLabel: bn,
|
|
1035
|
+
hasError: hn,
|
|
1036
|
+
disabled: gn,
|
|
1037
|
+
floatingLabel: xn,
|
|
1038
|
+
floatingLabelText: vn,
|
|
1039
|
+
floated: wn,
|
|
1040
|
+
textarea: kn,
|
|
1041
|
+
floatingTextarea: In,
|
|
1042
|
+
footer: $n,
|
|
1043
|
+
helperText: ln,
|
|
1044
|
+
errorMessage: Bn,
|
|
1045
|
+
counter: Ln
|
|
1046
|
+
}, zn = ce(function({
|
|
1047
|
+
id: t,
|
|
1048
|
+
label: i,
|
|
1049
|
+
floatingLabel: c,
|
|
1050
|
+
helperText: n,
|
|
1051
|
+
errorMessage: f,
|
|
1052
|
+
required: d = !1,
|
|
1053
|
+
disabled: h = !1,
|
|
1054
|
+
readOnly: w = !1,
|
|
1055
|
+
rows: l = 4,
|
|
1056
|
+
maxLength: x,
|
|
1057
|
+
showCount: I = !1,
|
|
1058
|
+
value: E,
|
|
1059
|
+
defaultValue: V,
|
|
1060
|
+
onChange: k,
|
|
1061
|
+
onFocus: e,
|
|
1062
|
+
onBlur: r,
|
|
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 = n ? `${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), re = !!f, C = c ?? (y == null ? void 0 : y.floatingLabel) ?? !0, Q = !!(C && i), ne = 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), r == null || r(W);
|
|
1079
|
+
}, pe = b(
|
|
1080
|
+
"wui-textarea-container",
|
|
1081
|
+
T.container,
|
|
1082
|
+
Q && T.floatingContainer,
|
|
1083
|
+
g == null ? void 0 : g.container,
|
|
1084
|
+
U
|
|
1085
|
+
), ae = b(
|
|
1086
|
+
"wui-textarea-wrapper",
|
|
1087
|
+
T.wrapper,
|
|
1088
|
+
Q && T.withFloatingLabel,
|
|
1089
|
+
re && T.hasError,
|
|
1090
|
+
h && T.disabled,
|
|
1091
|
+
g == null ? void 0 : g.wrapper
|
|
1092
|
+
), te = b(
|
|
1093
|
+
"wui-textarea-field",
|
|
1094
|
+
T.textarea,
|
|
1095
|
+
Q && T.floatingTextarea,
|
|
1096
|
+
ne && T.floated,
|
|
1097
|
+
g == null ? void 0 : g.textarea
|
|
1098
|
+
), v = [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(
|
|
1101
|
+
"label",
|
|
1102
|
+
{
|
|
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,
|
|
1106
|
+
children: [
|
|
1107
|
+
i,
|
|
1108
|
+
d && /* @__PURE__ */ u("span", { className: T.requiredAsterisk, "aria-hidden": "true", children: "*" })
|
|
1109
|
+
]
|
|
1110
|
+
}
|
|
1111
|
+
),
|
|
1112
|
+
/* @__PURE__ */ F("div", { className: ae, style: a == null ? void 0 : a.wrapper, children: [
|
|
1113
|
+
Q && /* @__PURE__ */ u(
|
|
1114
|
+
"label",
|
|
1115
|
+
{
|
|
1116
|
+
htmlFor: j,
|
|
1117
|
+
className: b(
|
|
1118
|
+
"wui-textarea-floating-label",
|
|
1119
|
+
T.floatingLabel,
|
|
1120
|
+
ne && T.floated,
|
|
1121
|
+
(g == null ? void 0 : g.floatingLabel) || (g == null ? void 0 : g.label)
|
|
1122
|
+
),
|
|
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: "*" })
|
|
1127
|
+
] })
|
|
1128
|
+
}
|
|
1129
|
+
),
|
|
1130
|
+
/* @__PURE__ */ u(
|
|
1131
|
+
"textarea",
|
|
1132
|
+
{
|
|
1133
|
+
ref: M,
|
|
1134
|
+
id: j,
|
|
1135
|
+
rows: l,
|
|
1136
|
+
maxLength: x,
|
|
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: w,
|
|
1144
|
+
required: d,
|
|
1145
|
+
"aria-invalid": re ? "true" : "false",
|
|
1146
|
+
"aria-describedby": v,
|
|
1147
|
+
className: te,
|
|
1148
|
+
style: a == null ? void 0 : a.textarea,
|
|
1149
|
+
...D
|
|
1150
|
+
}
|
|
1151
|
+
)
|
|
1152
|
+
] }),
|
|
1153
|
+
/* @__PURE__ */ F("div", { className: T.footer, children: [
|
|
1154
|
+
re ? /* @__PURE__ */ u(
|
|
1155
|
+
"span",
|
|
1156
|
+
{
|
|
1157
|
+
id: H,
|
|
1158
|
+
role: "alert",
|
|
1159
|
+
className: b(
|
|
1160
|
+
"wui-textarea-error",
|
|
1161
|
+
T.errorMessage,
|
|
1162
|
+
g == null ? void 0 : g.errorMessage
|
|
1163
|
+
),
|
|
1164
|
+
style: a == null ? void 0 : a.errorMessage,
|
|
1165
|
+
children: f
|
|
1166
|
+
}
|
|
1167
|
+
) : n ? /* @__PURE__ */ u(
|
|
1168
|
+
"span",
|
|
1169
|
+
{
|
|
1170
|
+
id: B,
|
|
1171
|
+
className: b(
|
|
1172
|
+
"wui-textarea-helper",
|
|
1173
|
+
T.helperText,
|
|
1174
|
+
g == null ? void 0 : g.helperText
|
|
1175
|
+
),
|
|
1176
|
+
style: a == null ? void 0 : a.helperText,
|
|
1177
|
+
children: n
|
|
1178
|
+
}
|
|
1179
|
+
) : /* @__PURE__ */ u("span", {}),
|
|
1180
|
+
I && /* @__PURE__ */ u(
|
|
1181
|
+
"span",
|
|
1182
|
+
{
|
|
1183
|
+
className: b(
|
|
1184
|
+
"wui-textarea-counter",
|
|
1185
|
+
T.counter,
|
|
1186
|
+
g == null ? void 0 : g.counter
|
|
1187
|
+
),
|
|
1188
|
+
style: a == null ? void 0 : a.counter,
|
|
1189
|
+
"aria-live": "polite",
|
|
1190
|
+
children: x !== void 0 ? `${Z.length} / ${x}` : Z.length
|
|
1191
|
+
}
|
|
1192
|
+
)
|
|
1193
|
+
] })
|
|
1194
|
+
] });
|
|
1195
|
+
});
|
|
1196
|
+
zn.displayName = "Textarea";
|
|
1197
|
+
const Fn = "_container_1ek6o_1", An = "_disabled_1ek6o_29", Rn = "_radio_1ek6o_39", Wn = "_labelWrapper_1ek6o_71", Tn = "_label_1ek6o_71", En = "_labelChecked_1ek6o_99", Mn = "_description_1ek6o_109", qn = "_groupContainer_1ek6o_121", On = "_groupLabel_1ek6o_135", Vn = "_optionsVertical_1ek6o_149", Dn = "_optionsHorizontal_1ek6o_161", Hn = "_groupError_1ek6o_175", S = {
|
|
1198
|
+
container: Fn,
|
|
1199
|
+
disabled: An,
|
|
1200
|
+
radio: Rn,
|
|
1201
|
+
labelWrapper: Wn,
|
|
1202
|
+
label: Tn,
|
|
1203
|
+
labelChecked: En,
|
|
1204
|
+
description: Mn,
|
|
1205
|
+
groupContainer: qn,
|
|
1206
|
+
groupLabel: On,
|
|
1207
|
+
optionsVertical: Vn,
|
|
1208
|
+
optionsHorizontal: Dn,
|
|
1209
|
+
groupError: Hn
|
|
1210
|
+
}, Ae = Le(null);
|
|
1211
|
+
function Pn() {
|
|
1212
|
+
return Ie(Ae);
|
|
1213
|
+
}
|
|
1214
|
+
const Re = ce(function({
|
|
1215
|
+
label: t,
|
|
1216
|
+
description: i,
|
|
1217
|
+
value: c,
|
|
1218
|
+
size: n,
|
|
1219
|
+
color: f,
|
|
1220
|
+
checked: d,
|
|
1221
|
+
defaultChecked: h = !1,
|
|
1222
|
+
disabled: w = !1,
|
|
1223
|
+
onChange: l,
|
|
1224
|
+
name: x,
|
|
1225
|
+
className: I,
|
|
1226
|
+
style: E,
|
|
1227
|
+
styles: V,
|
|
1228
|
+
slotClassNames: k,
|
|
1229
|
+
slotStyles: e,
|
|
1230
|
+
"data-testid": r,
|
|
1231
|
+
id: U,
|
|
1232
|
+
..._
|
|
1233
|
+
}, p) {
|
|
1234
|
+
const g = fe(null);
|
|
1235
|
+
$e(p, () => g.current);
|
|
1236
|
+
const a = Pn(), A = !!a, D = x || (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 = w || !!(a != null && a.disabled), L = n ?? (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(
|
|
1245
|
+
"wui-radio-container",
|
|
1246
|
+
S.container,
|
|
1247
|
+
H && S.disabled,
|
|
1248
|
+
k == null ? void 0 : k.container,
|
|
1249
|
+
I
|
|
1250
|
+
), re = b(
|
|
1251
|
+
"wui-radio-input",
|
|
1252
|
+
S.radio,
|
|
1253
|
+
(k == null ? void 0 : k.radio) || (k == null ? void 0 : k.control)
|
|
1254
|
+
);
|
|
1255
|
+
return /* @__PURE__ */ F("label", { className: ee, style: P(E), "data-testid": r, children: [
|
|
1256
|
+
/* @__PURE__ */ u(
|
|
1257
|
+
"input",
|
|
1258
|
+
{
|
|
1259
|
+
ref: g,
|
|
1260
|
+
id: U,
|
|
1261
|
+
type: "radio",
|
|
1262
|
+
name: D,
|
|
1263
|
+
value: c,
|
|
1264
|
+
checked: B,
|
|
1265
|
+
defaultChecked: A ? void 0 : h,
|
|
1266
|
+
disabled: H,
|
|
1267
|
+
onChange: y,
|
|
1268
|
+
className: re,
|
|
1269
|
+
style: {
|
|
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)
|
|
1273
|
+
},
|
|
1274
|
+
..._
|
|
1275
|
+
}
|
|
1276
|
+
),
|
|
1277
|
+
(t || i) && /* @__PURE__ */ F(
|
|
1278
|
+
"span",
|
|
1279
|
+
{
|
|
1280
|
+
className: b(
|
|
1281
|
+
"wui-radio-label-wrapper",
|
|
1282
|
+
S.labelWrapper,
|
|
1283
|
+
k == null ? void 0 : k.labelWrapper
|
|
1284
|
+
),
|
|
1285
|
+
style: e == null ? void 0 : e.labelWrapper,
|
|
1286
|
+
children: [
|
|
1287
|
+
t && /* @__PURE__ */ u(
|
|
1288
|
+
"span",
|
|
1289
|
+
{
|
|
1290
|
+
className: b(
|
|
1291
|
+
"wui-radio-label",
|
|
1292
|
+
S.label,
|
|
1293
|
+
B && S.labelChecked,
|
|
1294
|
+
k == null ? void 0 : k.label,
|
|
1295
|
+
B && (k == null ? void 0 : k.labelChecked)
|
|
1296
|
+
),
|
|
1297
|
+
style: e == null ? void 0 : e.label,
|
|
1298
|
+
children: t
|
|
1299
|
+
}
|
|
1300
|
+
),
|
|
1301
|
+
i && /* @__PURE__ */ u(
|
|
1302
|
+
"span",
|
|
1303
|
+
{
|
|
1304
|
+
className: b(
|
|
1305
|
+
"wui-radio-description",
|
|
1306
|
+
S.description,
|
|
1307
|
+
k == null ? void 0 : k.description
|
|
1308
|
+
),
|
|
1309
|
+
style: e == null ? void 0 : e.description,
|
|
1310
|
+
children: i
|
|
1311
|
+
}
|
|
1312
|
+
)
|
|
1313
|
+
]
|
|
1314
|
+
}
|
|
1315
|
+
)
|
|
1316
|
+
] });
|
|
1317
|
+
});
|
|
1318
|
+
Re.displayName = "Radio";
|
|
1319
|
+
const Gn = ce(function({
|
|
1320
|
+
name: t,
|
|
1321
|
+
value: i,
|
|
1322
|
+
defaultValue: c,
|
|
1323
|
+
onChange: n,
|
|
1324
|
+
options: f,
|
|
1325
|
+
direction: d = "vertical",
|
|
1326
|
+
label: h,
|
|
1327
|
+
errorMessage: w,
|
|
1328
|
+
disabled: l = !1,
|
|
1329
|
+
size: x,
|
|
1330
|
+
color: I,
|
|
1331
|
+
children: E,
|
|
1332
|
+
styles: V,
|
|
1333
|
+
className: k,
|
|
1334
|
+
style: e,
|
|
1335
|
+
"data-testid": r
|
|
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), n == null || n(B));
|
|
1339
|
+
}, q = b(
|
|
1340
|
+
"wui-radiogroup-container",
|
|
1341
|
+
S.groupContainer,
|
|
1342
|
+
k
|
|
1343
|
+
), j = d === "horizontal" ? S.optionsHorizontal : S.optionsVertical;
|
|
1344
|
+
return /* @__PURE__ */ u(
|
|
1345
|
+
Ae.Provider,
|
|
1346
|
+
{
|
|
1347
|
+
value: {
|
|
1348
|
+
name: p,
|
|
1349
|
+
value: D,
|
|
1350
|
+
onChange: M,
|
|
1351
|
+
disabled: l,
|
|
1352
|
+
size: x,
|
|
1353
|
+
color: I,
|
|
1354
|
+
groupStyles: V
|
|
1355
|
+
},
|
|
1356
|
+
children: /* @__PURE__ */ F(
|
|
1357
|
+
"div",
|
|
1358
|
+
{
|
|
1359
|
+
ref: U,
|
|
1360
|
+
role: "radiogroup",
|
|
1361
|
+
"aria-label": typeof h == "string" ? h : void 0,
|
|
1362
|
+
className: q,
|
|
1363
|
+
style: e,
|
|
1364
|
+
"data-testid": r,
|
|
1365
|
+
children: [
|
|
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,
|
|
1369
|
+
{
|
|
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
|
|
1377
|
+
},
|
|
1378
|
+
B.value
|
|
1379
|
+
)) : E }),
|
|
1380
|
+
w && /* @__PURE__ */ u("span", { role: "alert", className: S.groupError, children: w })
|
|
1381
|
+
]
|
|
1382
|
+
}
|
|
1383
|
+
)
|
|
1384
|
+
}
|
|
1385
|
+
);
|
|
1386
|
+
});
|
|
1387
|
+
Gn.displayName = "RadioGroup";
|
|
1388
|
+
const Un = "_container_17pmz_1", jn = "_disabled_17pmz_15", Zn = "_hiddenInput_17pmz_20", Kn = "_track_17pmz_30", Jn = "_checked_17pmz_51", Qn = "_thumb_17pmz_56", Xn = "_sizeSmall_17pmz_83", Yn = "_sizeMedium_17pmz_90", mn = "_sizeLarge_17pmz_97", yn = "_icon_17pmz_105", Cn = "_labelWrapper_17pmz_116", Sn = "_label_17pmz_116", Nn = "_description_17pmz_127", X = {
|
|
1389
|
+
container: Un,
|
|
1390
|
+
disabled: jn,
|
|
1391
|
+
hiddenInput: Zn,
|
|
1392
|
+
track: Kn,
|
|
1393
|
+
checked: Jn,
|
|
1394
|
+
thumb: Qn,
|
|
1395
|
+
sizeSmall: Xn,
|
|
1396
|
+
sizeMedium: Yn,
|
|
1397
|
+
sizeLarge: mn,
|
|
1398
|
+
icon: yn,
|
|
1399
|
+
labelWrapper: Cn,
|
|
1400
|
+
label: Sn,
|
|
1401
|
+
description: Nn
|
|
1402
|
+
}, sn = {
|
|
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: n = !1,
|
|
1411
|
+
size: f = "medium",
|
|
1412
|
+
label: d,
|
|
1413
|
+
description: h,
|
|
1414
|
+
checkedIcon: w,
|
|
1415
|
+
uncheckedIcon: l,
|
|
1416
|
+
name: x,
|
|
1417
|
+
value: I,
|
|
1418
|
+
className: E,
|
|
1419
|
+
style: V,
|
|
1420
|
+
styles: k,
|
|
1421
|
+
slotClassNames: e,
|
|
1422
|
+
slotStyles: r,
|
|
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 (n) return;
|
|
1431
|
+
const R = Y.target.checked;
|
|
1432
|
+
A || M(R), c == null || c(R, Y);
|
|
1433
|
+
}, H = b(
|
|
1434
|
+
"wui-switch-container",
|
|
1435
|
+
X.container,
|
|
1436
|
+
n && X.disabled,
|
|
1437
|
+
e == null ? void 0 : e.container,
|
|
1438
|
+
E
|
|
1439
|
+
), L = b(
|
|
1440
|
+
"wui-switch-track",
|
|
1441
|
+
X.track,
|
|
1442
|
+
sn[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(
|
|
1448
|
+
"input",
|
|
1449
|
+
{
|
|
1450
|
+
ref: a,
|
|
1451
|
+
id: _,
|
|
1452
|
+
type: "checkbox",
|
|
1453
|
+
role: "switch",
|
|
1454
|
+
name: x,
|
|
1455
|
+
value: I,
|
|
1456
|
+
checked: q,
|
|
1457
|
+
disabled: n,
|
|
1458
|
+
onChange: B,
|
|
1459
|
+
className: X.hiddenInput,
|
|
1460
|
+
"aria-checked": q,
|
|
1461
|
+
...p
|
|
1462
|
+
}
|
|
1463
|
+
),
|
|
1464
|
+
/* @__PURE__ */ u("span", { className: L, style: r == null ? void 0 : r.track, "aria-hidden": "true", children: /* @__PURE__ */ u("span", { className: O, style: r == null ? void 0 : r.thumb, children: q ? w && /* @__PURE__ */ u(
|
|
1465
|
+
"span",
|
|
1466
|
+
{
|
|
1467
|
+
className: b(X.icon, e == null ? void 0 : e.icon),
|
|
1468
|
+
style: r == null ? void 0 : r.icon,
|
|
1469
|
+
children: w
|
|
1470
|
+
}
|
|
1471
|
+
) : l && /* @__PURE__ */ u(
|
|
1472
|
+
"span",
|
|
1473
|
+
{
|
|
1474
|
+
className: b(X.icon, e == null ? void 0 : e.icon),
|
|
1475
|
+
style: r == null ? void 0 : r.icon,
|
|
1476
|
+
children: l
|
|
1477
|
+
}
|
|
1478
|
+
) }) }),
|
|
1479
|
+
(d || h) && /* @__PURE__ */ F(
|
|
1480
|
+
"span",
|
|
1481
|
+
{
|
|
1482
|
+
className: b(
|
|
1483
|
+
"wui-switch-label-wrapper",
|
|
1484
|
+
X.labelWrapper,
|
|
1485
|
+
e == null ? void 0 : e.labelWrapper
|
|
1486
|
+
),
|
|
1487
|
+
style: r == null ? void 0 : r.labelWrapper,
|
|
1488
|
+
children: [
|
|
1489
|
+
d && /* @__PURE__ */ u(
|
|
1490
|
+
"span",
|
|
1491
|
+
{
|
|
1492
|
+
className: b("wui-switch-label", X.label, e == null ? void 0 : e.label),
|
|
1493
|
+
style: r == null ? void 0 : r.label,
|
|
1494
|
+
children: d
|
|
1495
|
+
}
|
|
1496
|
+
),
|
|
1497
|
+
h && /* @__PURE__ */ u(
|
|
1498
|
+
"span",
|
|
1499
|
+
{
|
|
1500
|
+
className: b(
|
|
1501
|
+
"wui-switch-description",
|
|
1502
|
+
X.description,
|
|
1503
|
+
e == null ? void 0 : e.description
|
|
1504
|
+
),
|
|
1505
|
+
style: r == null ? void 0 : r.description,
|
|
1506
|
+
children: h
|
|
1507
|
+
}
|
|
1508
|
+
)
|
|
1509
|
+
]
|
|
1510
|
+
}
|
|
1511
|
+
)
|
|
1512
|
+
] });
|
|
1513
|
+
});
|
|
1514
|
+
ei.displayName = "Switch";
|
|
1515
|
+
const ri = ({
|
|
1516
|
+
children: o,
|
|
1517
|
+
config: t,
|
|
1518
|
+
wrapWithContainer: i = !1,
|
|
1519
|
+
className: c,
|
|
1520
|
+
style: n
|
|
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
|
+
), x = _e(
|
|
1528
|
+
d.typography,
|
|
1529
|
+
"wui-typography"
|
|
1530
|
+
), I = _e(
|
|
1531
|
+
d.layout,
|
|
1532
|
+
"wui-layout"
|
|
1533
|
+
);
|
|
1534
|
+
return {
|
|
1535
|
+
...l,
|
|
1536
|
+
...x,
|
|
1537
|
+
...I,
|
|
1538
|
+
...n
|
|
1539
|
+
};
|
|
1540
|
+
}, [i, d, n]), w = 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: w });
|
|
1549
|
+
};
|
|
1550
|
+
ri.displayName = "UIProvider";
|
|
1551
|
+
export {
|
|
1552
|
+
nr as Button,
|
|
1553
|
+
qr as Checkbox,
|
|
1554
|
+
Lr as Input,
|
|
1555
|
+
Re as Radio,
|
|
1556
|
+
Gn as RadioGroup,
|
|
1557
|
+
Ae as RadioGroupContext,
|
|
1558
|
+
tn as Select,
|
|
1559
|
+
ei as Switch,
|
|
1560
|
+
zn as Textarea,
|
|
1561
|
+
be as UIContext,
|
|
1562
|
+
ri 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
|
+
we as getSubtleBackgroundColor,
|
|
1570
|
+
Se as mergeUIConfig,
|
|
1571
|
+
rr as resolveComponentStyles,
|
|
1572
|
+
_e as stylesToCssVars,
|
|
1573
|
+
de as useComponentStyles,
|
|
1574
|
+
Pn as useRadioGroup,
|
|
1575
|
+
me as useUI
|
|
1576
|
+
};
|
|
1577
|
+
//# sourceMappingURL=index.js.map
|