suus-component-library 0.1.16 → 0.1.18
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/dist/components/banner-hero/banner-hero.d.ts +31 -0
- package/dist/components/banner-hero/banner-hero.d.ts.map +1 -0
- package/dist/components/form/button/Button.d.ts +1 -1
- package/dist/components/form/button/Button.d.ts.map +1 -1
- package/dist/components/form/radiobutton/RadioButton.d.ts.map +1 -1
- package/dist/components/form/switch/Switch.d.ts.map +1 -1
- package/dist/components/form/textfield/TextField.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/suus-component-library.css +1 -1
- package/dist/suus-component-library.js +311 -251
- package/dist/suus-component-library.umd.cjs +5 -1
- package/package.json +2 -2
|
@@ -38,7 +38,62 @@ function l({ label: r, onClick: i, type: a = "button", disabled: o = !1, loading
|
|
|
38
38
|
})] })
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/banner-hero/banner-hero.tsx
|
|
43
|
+
var u = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 800'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23e8f3ec'/%3E%3Cstop offset='100%25' stop-color='%23d7e6dc'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='1600' height='800' fill='url(%23g)'/%3E%3C/svg%3E", d = (e) => e === "--color-juice-sugarcane" || e === "--color-juice-tamarind" || e === "--color-juice-guarana" || e === "--color-juice-icetea";
|
|
44
|
+
function f({ title: e, description: r, colorToken: i, imageBackgroundDesktop: a, imageBackgroundTablet: o, imageBackgroundMobile: c, fallbackImageSrc: f, labelButtonPrimary: p, actionButtonPrimary: m, labelButtonSecondary: h, actionButtonSecondary: g }) {
|
|
45
|
+
let [_, v] = s(null), y = a?.trim(), b = o?.trim(), x = c?.trim(), S = f?.trim() || u, C = [
|
|
46
|
+
y,
|
|
47
|
+
b,
|
|
48
|
+
x
|
|
49
|
+
].filter(Boolean).join("|"), w = !!y && _ !== C, T = d(i) ? i : void 0, E = w ? [
|
|
50
|
+
x ? `${x} 900w` : "",
|
|
51
|
+
b ? `${b} 1600w` : "",
|
|
52
|
+
`${y} 2400w`
|
|
53
|
+
].filter(Boolean).join(", ") : void 0;
|
|
54
|
+
return /* @__PURE__ */ t("div", {
|
|
55
|
+
className: "content-child-max banner-hero",
|
|
56
|
+
children: /* @__PURE__ */ n("div", {
|
|
57
|
+
className: "hero__container",
|
|
58
|
+
children: [/* @__PURE__ */ t("img", {
|
|
59
|
+
src: w ? y : S,
|
|
60
|
+
srcSet: E,
|
|
61
|
+
sizes: E ? "100vw" : void 0,
|
|
62
|
+
className: "image-banner",
|
|
63
|
+
alt: "background",
|
|
64
|
+
onError: w ? () => v(C) : void 0
|
|
65
|
+
}), /* @__PURE__ */ n("div", {
|
|
66
|
+
className: "hero__content",
|
|
67
|
+
style: i ? { color: `var(${i})` } : void 0,
|
|
68
|
+
children: [
|
|
69
|
+
e && e.split("\n").map((r, a) => /* @__PURE__ */ n("span", {
|
|
70
|
+
className: `banner--title ${i || ""}`,
|
|
71
|
+
"data-testid": "bannerHeroTitle",
|
|
72
|
+
children: [r, a < e.split("\n").length - 1 && /* @__PURE__ */ t("br", {})]
|
|
73
|
+
}, a)),
|
|
74
|
+
/* @__PURE__ */ t("p", {
|
|
75
|
+
className: "banner--description",
|
|
76
|
+
children: r && r.split("\n").map((e, i) => /* @__PURE__ */ n("span", { children: [e, i < r.split("\n").length - 1 && /* @__PURE__ */ t("br", {})] }, i))
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ n("div", {
|
|
79
|
+
className: "banner-hero-buttonbar",
|
|
80
|
+
children: [p && /* @__PURE__ */ t(l, {
|
|
81
|
+
label: p,
|
|
82
|
+
variant: "primary",
|
|
83
|
+
colorToken: T,
|
|
84
|
+
onClick: m
|
|
85
|
+
}), h && /* @__PURE__ */ t(l, {
|
|
86
|
+
label: h,
|
|
87
|
+
variant: "secondary",
|
|
88
|
+
onClick: g
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
})]
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
var p = {
|
|
42
97
|
checkboxWrapper: "_checkboxWrapper_y1lye_1",
|
|
43
98
|
checkboxInput: "_checkboxInput_y1lye_15",
|
|
44
99
|
checkboxLabel: "_checkboxLabel_y1lye_24",
|
|
@@ -52,54 +107,54 @@ var u = {
|
|
|
52
107
|
};
|
|
53
108
|
//#endregion
|
|
54
109
|
//#region src/components/form/checkbox/Checkbox.tsx
|
|
55
|
-
function
|
|
56
|
-
let
|
|
110
|
+
function m({ label: e, name: r, id: i, error: a, variant: o = "default", className: s, disabled: c, ...l }) {
|
|
111
|
+
let u = i ?? `${r}-checkbox`;
|
|
57
112
|
return /* @__PURE__ */ n("div", {
|
|
58
113
|
className: [
|
|
59
|
-
|
|
60
|
-
o === "glassy" ?
|
|
61
|
-
a ?
|
|
62
|
-
c ?
|
|
114
|
+
p.checkboxWrapper,
|
|
115
|
+
o === "glassy" ? p.checkboxWrapperGlassy : "",
|
|
116
|
+
a ? p.checkboxWrapperError : "",
|
|
117
|
+
c ? p.checkboxWrapperDisabled : "",
|
|
63
118
|
s ?? ""
|
|
64
119
|
].filter(Boolean).join(" "),
|
|
65
120
|
children: [
|
|
66
121
|
/* @__PURE__ */ t("input", {
|
|
67
122
|
type: "checkbox",
|
|
68
|
-
id:
|
|
123
|
+
id: u,
|
|
69
124
|
name: r,
|
|
70
125
|
disabled: c,
|
|
71
|
-
className:
|
|
126
|
+
className: p.checkboxInput,
|
|
72
127
|
"aria-invalid": !!a,
|
|
73
128
|
"aria-describedby": a ? `${r}-error` : void 0,
|
|
74
129
|
...l
|
|
75
130
|
}),
|
|
76
131
|
/* @__PURE__ */ n("label", {
|
|
77
|
-
htmlFor:
|
|
78
|
-
className:
|
|
132
|
+
htmlFor: u,
|
|
133
|
+
className: p.checkboxLabel,
|
|
79
134
|
children: [/* @__PURE__ */ t("span", {
|
|
80
|
-
className:
|
|
135
|
+
className: p.customCheckbox,
|
|
81
136
|
"aria-hidden": "true",
|
|
82
137
|
children: /* @__PURE__ */ t("svg", {
|
|
83
|
-
className:
|
|
138
|
+
className: p.checkIcon,
|
|
84
139
|
viewBox: "0 0 24 24",
|
|
85
140
|
focusable: "false",
|
|
86
141
|
"aria-hidden": "true",
|
|
87
142
|
children: /* @__PURE__ */ t("path", { d: "M20 6L9 17L4 12" })
|
|
88
143
|
})
|
|
89
144
|
}), /* @__PURE__ */ t("span", {
|
|
90
|
-
className:
|
|
145
|
+
className: p.checkboxText,
|
|
91
146
|
children: e
|
|
92
147
|
})]
|
|
93
148
|
}),
|
|
94
149
|
a && /* @__PURE__ */ t("span", {
|
|
95
150
|
id: `${r}-error`,
|
|
96
|
-
className:
|
|
151
|
+
className: p.errorMessage,
|
|
97
152
|
children: a
|
|
98
153
|
})
|
|
99
154
|
]
|
|
100
155
|
});
|
|
101
156
|
}
|
|
102
|
-
var
|
|
157
|
+
var h = {
|
|
103
158
|
chip: "_chip_1po0g_1",
|
|
104
159
|
chipDefault: "_chipDefault_1po0g_21",
|
|
105
160
|
chipGlassy: "_chipGlassy_1po0g_36",
|
|
@@ -108,29 +163,29 @@ var f = {
|
|
|
108
163
|
};
|
|
109
164
|
//#endregion
|
|
110
165
|
//#region src/components/form/chip/Chip.tsx
|
|
111
|
-
function
|
|
112
|
-
let [u, d] = s(a),
|
|
113
|
-
function
|
|
166
|
+
function g({ children: e, variant: n = "default", clickable: r = !0, checked: i, defaultChecked: a = !1, onCheckedChange: o, className: c, ...l }) {
|
|
167
|
+
let [u, d] = s(a), f = typeof i == "boolean", p = f ? i : u;
|
|
168
|
+
function m(e) {
|
|
114
169
|
if (!r) return;
|
|
115
|
-
let t = !
|
|
116
|
-
|
|
170
|
+
let t = !p;
|
|
171
|
+
f || d(t), o?.(t), l.onClick?.(e);
|
|
117
172
|
}
|
|
118
|
-
let g = n === "glassy" ?
|
|
173
|
+
let g = n === "glassy" ? h.chipGlassy : h.chipDefault, _ = p ? h.chipChecked : "", v = r ? "" : h.chipDisabled;
|
|
119
174
|
return r ? /* @__PURE__ */ t("button", {
|
|
120
175
|
type: "button",
|
|
121
|
-
"aria-pressed":
|
|
176
|
+
"aria-pressed": p,
|
|
122
177
|
className: [
|
|
123
|
-
|
|
178
|
+
h.chip,
|
|
124
179
|
g,
|
|
125
180
|
_,
|
|
126
181
|
c ?? ""
|
|
127
182
|
].filter(Boolean).join(" "),
|
|
128
|
-
onClick:
|
|
183
|
+
onClick: m,
|
|
129
184
|
...l,
|
|
130
185
|
children: e
|
|
131
186
|
}) : /* @__PURE__ */ t("span", {
|
|
132
187
|
className: [
|
|
133
|
-
|
|
188
|
+
h.chip,
|
|
134
189
|
g,
|
|
135
190
|
_,
|
|
136
191
|
v,
|
|
@@ -139,7 +194,7 @@ function p({ children: e, variant: n = "default", clickable: r = !0, checked: i,
|
|
|
139
194
|
children: e
|
|
140
195
|
});
|
|
141
196
|
}
|
|
142
|
-
var
|
|
197
|
+
var _ = {
|
|
143
198
|
dateInputWrapper: "_dateInputWrapper_6osqj_1",
|
|
144
199
|
inputDateField: "_inputDateField_6osqj_6",
|
|
145
200
|
inputDateFieldGlassy: "_inputDateFieldGlassy_6osqj_38",
|
|
@@ -150,8 +205,8 @@ var m = {
|
|
|
150
205
|
};
|
|
151
206
|
//#endregion
|
|
152
207
|
//#region src/components/form/date-picker/DatePicker.tsx
|
|
153
|
-
function
|
|
154
|
-
let
|
|
208
|
+
function v({ label: e, name: r, id: i, value: a = null, maxDate: s, minDate: c, error: l, variant: u = "default", className: d, ref: f, onDateChange: p, onBlur: m, disabled: h, ...g }) {
|
|
209
|
+
let v = i ?? r, S = o(null), C = s ?? /* @__PURE__ */ new Date();
|
|
155
210
|
function w(e) {
|
|
156
211
|
S.current = e, typeof f == "function" ? f(e) : f && (f.current = e);
|
|
157
212
|
}
|
|
@@ -161,69 +216,69 @@ function h({ label: e, name: r, id: i, value: a = null, maxDate: s, minDate: c,
|
|
|
161
216
|
p?.(null);
|
|
162
217
|
return;
|
|
163
218
|
}
|
|
164
|
-
p?.(
|
|
219
|
+
p?.(b(t));
|
|
165
220
|
}
|
|
166
221
|
function E() {
|
|
167
|
-
|
|
222
|
+
h || (S.current?.showPicker?.(), S.current?.focus());
|
|
168
223
|
}
|
|
169
224
|
return /* @__PURE__ */ n("div", {
|
|
170
225
|
className: "inputBlockVertical",
|
|
171
226
|
children: [
|
|
172
227
|
/* @__PURE__ */ t("label", {
|
|
173
|
-
htmlFor:
|
|
228
|
+
htmlFor: v,
|
|
174
229
|
className: ["inputLabel", u === "glassy" ? "inputLabelGlassy" : ""].filter(Boolean).join(" "),
|
|
175
230
|
children: e
|
|
176
231
|
}),
|
|
177
232
|
/* @__PURE__ */ n("div", {
|
|
178
|
-
className:
|
|
233
|
+
className: _.dateInputWrapper,
|
|
179
234
|
children: [/* @__PURE__ */ t("input", {
|
|
180
|
-
id:
|
|
235
|
+
id: v,
|
|
181
236
|
name: r,
|
|
182
237
|
ref: w,
|
|
183
238
|
type: "date",
|
|
184
|
-
value:
|
|
185
|
-
max:
|
|
186
|
-
min: c ?
|
|
187
|
-
disabled:
|
|
239
|
+
value: y(a),
|
|
240
|
+
max: y(C),
|
|
241
|
+
min: c ? y(c) : void 0,
|
|
242
|
+
disabled: h,
|
|
188
243
|
onChange: T,
|
|
189
|
-
onBlur:
|
|
244
|
+
onBlur: m,
|
|
190
245
|
className: [
|
|
191
|
-
|
|
192
|
-
u === "glassy" ?
|
|
193
|
-
l ?
|
|
246
|
+
_.inputDateField,
|
|
247
|
+
u === "glassy" ? _.inputDateFieldGlassy : "",
|
|
248
|
+
l ? _.inputError : "",
|
|
194
249
|
d ?? ""
|
|
195
250
|
].filter(Boolean).join(" "),
|
|
196
251
|
"aria-invalid": !!l,
|
|
197
252
|
"aria-describedby": l ? `${r}-error` : void 0,
|
|
198
|
-
...
|
|
253
|
+
...g
|
|
199
254
|
}), /* @__PURE__ */ t("button", {
|
|
200
255
|
type: "button",
|
|
201
|
-
className:
|
|
256
|
+
className: _.calendarIconButton,
|
|
202
257
|
onClick: E,
|
|
203
|
-
disabled:
|
|
258
|
+
disabled: h,
|
|
204
259
|
"aria-label": "Datum auswählen",
|
|
205
260
|
tabIndex: -1,
|
|
206
|
-
children: /* @__PURE__ */ t(
|
|
261
|
+
children: /* @__PURE__ */ t(x, {})
|
|
207
262
|
})]
|
|
208
263
|
}),
|
|
209
264
|
l && /* @__PURE__ */ t("span", {
|
|
210
265
|
id: `${r}-error`,
|
|
211
|
-
className:
|
|
266
|
+
className: _.errorMessage,
|
|
212
267
|
children: l
|
|
213
268
|
})
|
|
214
269
|
]
|
|
215
270
|
});
|
|
216
271
|
}
|
|
217
|
-
function
|
|
272
|
+
function y(e) {
|
|
218
273
|
return e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : "";
|
|
219
274
|
}
|
|
220
|
-
function
|
|
275
|
+
function b(e) {
|
|
221
276
|
let [t, n, r] = e.split("-").map(Number);
|
|
222
277
|
return new Date(t, n - 1, r);
|
|
223
278
|
}
|
|
224
|
-
function
|
|
279
|
+
function x() {
|
|
225
280
|
return /* @__PURE__ */ n("svg", {
|
|
226
|
-
className:
|
|
281
|
+
className: _.icon,
|
|
227
282
|
xmlns: "http://www.w3.org/2000/svg",
|
|
228
283
|
viewBox: "0 0 24 24",
|
|
229
284
|
fill: "none",
|
|
@@ -236,7 +291,7 @@ function v() {
|
|
|
236
291
|
]
|
|
237
292
|
});
|
|
238
293
|
}
|
|
239
|
-
var
|
|
294
|
+
var S = {
|
|
240
295
|
inputSelectField: "_inputSelectField_1uwtt_1",
|
|
241
296
|
inputSelectFieldGlassy: "_inputSelectFieldGlassy_1uwtt_12",
|
|
242
297
|
inputError: "_inputError_1uwtt_24",
|
|
@@ -244,7 +299,7 @@ var y = {
|
|
|
244
299
|
};
|
|
245
300
|
//#endregion
|
|
246
301
|
//#region src/components/form/dropdown/Dropdown.tsx
|
|
247
|
-
function
|
|
302
|
+
function C({ label: e, name: r, options: i, placeholder: a, error: o, variant: s = "default", className: c, disabled: l, ...u }) {
|
|
248
303
|
return /* @__PURE__ */ n("div", {
|
|
249
304
|
className: "inputBlockVertical",
|
|
250
305
|
children: [
|
|
@@ -258,9 +313,9 @@ function b({ label: e, name: r, options: i, placeholder: a, error: o, variant: s
|
|
|
258
313
|
name: r,
|
|
259
314
|
disabled: l,
|
|
260
315
|
className: [
|
|
261
|
-
|
|
262
|
-
s === "glassy" ?
|
|
263
|
-
o ?
|
|
316
|
+
S.inputSelectField,
|
|
317
|
+
s === "glassy" ? S.inputSelectFieldGlassy : "",
|
|
318
|
+
o ? S.inputError : "",
|
|
264
319
|
c ?? ""
|
|
265
320
|
].filter(Boolean).join(" "),
|
|
266
321
|
"aria-invalid": !!o,
|
|
@@ -277,13 +332,13 @@ function b({ label: e, name: r, options: i, placeholder: a, error: o, variant: s
|
|
|
277
332
|
}),
|
|
278
333
|
o && /* @__PURE__ */ t("span", {
|
|
279
334
|
id: `${r}-error`,
|
|
280
|
-
className:
|
|
335
|
+
className: S.errorMessage,
|
|
281
336
|
children: o
|
|
282
337
|
})
|
|
283
338
|
]
|
|
284
339
|
});
|
|
285
340
|
}
|
|
286
|
-
var
|
|
341
|
+
var w = {
|
|
287
342
|
appLink: "_appLink_b53rv_1",
|
|
288
343
|
appLinkDefault: "_appLinkDefault_b53rv_19",
|
|
289
344
|
appLinkGlassy: "_appLinkGlassy_b53rv_30",
|
|
@@ -293,7 +348,7 @@ var x = {
|
|
|
293
348
|
};
|
|
294
349
|
//#endregion
|
|
295
350
|
//#region src/components/form/link/Link.tsx
|
|
296
|
-
function
|
|
351
|
+
function T({ children: e, href: r, onClick: i, newTab: a = !1, showArrow: o = !0, variant: s = "default", className: c, ...l }) {
|
|
297
352
|
function u(e) {
|
|
298
353
|
r || e.preventDefault(), i?.(e);
|
|
299
354
|
}
|
|
@@ -303,24 +358,24 @@ function S({ children: e, href: r, onClick: i, newTab: a = !1, showArrow: o = !0
|
|
|
303
358
|
target: r && a ? "_blank" : void 0,
|
|
304
359
|
rel: r && a ? "noopener noreferrer" : void 0,
|
|
305
360
|
className: [
|
|
306
|
-
|
|
307
|
-
s === "glassy" ?
|
|
361
|
+
w.appLink,
|
|
362
|
+
s === "glassy" ? w.appLinkGlassy : w.appLinkDefault,
|
|
308
363
|
c ?? ""
|
|
309
364
|
].filter(Boolean).join(" "),
|
|
310
365
|
...l,
|
|
311
366
|
children: [/* @__PURE__ */ t("span", {
|
|
312
|
-
className:
|
|
367
|
+
className: w.label,
|
|
313
368
|
children: e
|
|
314
369
|
}), o && /* @__PURE__ */ t("span", {
|
|
315
|
-
className:
|
|
370
|
+
className: w.icon,
|
|
316
371
|
"aria-hidden": "true",
|
|
317
|
-
children: /* @__PURE__ */ t(
|
|
372
|
+
children: /* @__PURE__ */ t(E, {})
|
|
318
373
|
})]
|
|
319
374
|
});
|
|
320
375
|
}
|
|
321
|
-
function
|
|
376
|
+
function E() {
|
|
322
377
|
return /* @__PURE__ */ n("svg", {
|
|
323
|
-
className:
|
|
378
|
+
className: w.arrowIcon,
|
|
324
379
|
xmlns: "http://www.w3.org/2000/svg",
|
|
325
380
|
viewBox: "0 0 24 24",
|
|
326
381
|
fill: "none",
|
|
@@ -328,7 +383,7 @@ function C() {
|
|
|
328
383
|
children: [/* @__PURE__ */ t("path", { d: "M5 12H19" }), /* @__PURE__ */ t("path", { d: "M13 6L19 12L13 18" })]
|
|
329
384
|
});
|
|
330
385
|
}
|
|
331
|
-
var
|
|
386
|
+
var D = {
|
|
332
387
|
iconButton: "_iconButton_14rp3_1",
|
|
333
388
|
withFrame: "_withFrame_14rp3_17",
|
|
334
389
|
withoutFrame: "_withoutFrame_14rp3_24",
|
|
@@ -341,7 +396,7 @@ var w = {
|
|
|
341
396
|
};
|
|
342
397
|
//#endregion
|
|
343
398
|
//#region src/components/form/icon-button/IconButton.tsx
|
|
344
|
-
function
|
|
399
|
+
function O({ label: e, icon: n, variant: r = "default", frame: i = !0, active: a = !1, size: o = "default", className: s, type: c = "button", disabled: l, ...u }) {
|
|
345
400
|
return /* @__PURE__ */ t("button", {
|
|
346
401
|
type: c,
|
|
347
402
|
"aria-label": e,
|
|
@@ -349,23 +404,23 @@ function T({ label: e, icon: n, variant: r = "default", frame: i = !0, active: a
|
|
|
349
404
|
"aria-pressed": a,
|
|
350
405
|
disabled: l,
|
|
351
406
|
className: [
|
|
352
|
-
|
|
353
|
-
i ?
|
|
354
|
-
r === "glassy" ?
|
|
355
|
-
a ?
|
|
356
|
-
o === "small" ?
|
|
357
|
-
o === "large" ?
|
|
407
|
+
D.iconButton,
|
|
408
|
+
i ? D.withFrame : D.withoutFrame,
|
|
409
|
+
r === "glassy" ? D.glassy : "",
|
|
410
|
+
a ? D.active : "",
|
|
411
|
+
o === "small" ? D.small : "",
|
|
412
|
+
o === "large" ? D.large : "",
|
|
358
413
|
s ?? ""
|
|
359
414
|
].filter(Boolean).join(" "),
|
|
360
415
|
...u,
|
|
361
416
|
children: /* @__PURE__ */ t("span", {
|
|
362
|
-
className:
|
|
417
|
+
className: D.icon,
|
|
363
418
|
"aria-hidden": "true",
|
|
364
419
|
children: n
|
|
365
420
|
})
|
|
366
421
|
});
|
|
367
422
|
}
|
|
368
|
-
var
|
|
423
|
+
var k = {
|
|
369
424
|
passwordInputWrapper: "_passwordInputWrapper_18lit_1",
|
|
370
425
|
inputTextField: "_inputTextField_18lit_6",
|
|
371
426
|
inputTextFieldGlassy: "_inputTextFieldGlassy_18lit_18",
|
|
@@ -376,7 +431,7 @@ var E = {
|
|
|
376
431
|
};
|
|
377
432
|
//#endregion
|
|
378
433
|
//#region src/components/form/password/Password.tsx
|
|
379
|
-
function
|
|
434
|
+
function A({ label: e, name: r, id: i, error: a, variant: o = "default", className: c, disabled: l, ref: u, autoComplete: d = "current-password", ...f }) {
|
|
380
435
|
let [p, m] = s(!1), h = i ?? r;
|
|
381
436
|
function g() {
|
|
382
437
|
m((e) => !e);
|
|
@@ -390,7 +445,7 @@ function D({ label: e, name: r, id: i, error: a, variant: o = "default", classNa
|
|
|
390
445
|
children: e
|
|
391
446
|
}),
|
|
392
447
|
/* @__PURE__ */ n("div", {
|
|
393
|
-
className:
|
|
448
|
+
className: k.passwordInputWrapper,
|
|
394
449
|
children: [/* @__PURE__ */ t("input", {
|
|
395
450
|
id: h,
|
|
396
451
|
name: r,
|
|
@@ -399,9 +454,9 @@ function D({ label: e, name: r, id: i, error: a, variant: o = "default", classNa
|
|
|
399
454
|
disabled: l,
|
|
400
455
|
autoComplete: d,
|
|
401
456
|
className: [
|
|
402
|
-
|
|
403
|
-
o === "glassy" ?
|
|
404
|
-
a ?
|
|
457
|
+
k.inputTextField,
|
|
458
|
+
o === "glassy" ? k.inputTextFieldGlassy : "",
|
|
459
|
+
a ? k.inputError : "",
|
|
405
460
|
c ?? ""
|
|
406
461
|
].filter(Boolean).join(" "),
|
|
407
462
|
"aria-invalid": !!a,
|
|
@@ -409,25 +464,25 @@ function D({ label: e, name: r, id: i, error: a, variant: o = "default", classNa
|
|
|
409
464
|
...f
|
|
410
465
|
}), /* @__PURE__ */ t("button", {
|
|
411
466
|
type: "button",
|
|
412
|
-
className:
|
|
467
|
+
className: k.togglePasswordButton,
|
|
413
468
|
onClick: g,
|
|
414
469
|
disabled: l,
|
|
415
470
|
"aria-label": p ? "Passwort ausblenden" : "Passwort anzeigen",
|
|
416
471
|
"aria-pressed": p,
|
|
417
|
-
children: t(p ?
|
|
472
|
+
children: t(p ? M : j, {})
|
|
418
473
|
})]
|
|
419
474
|
}),
|
|
420
475
|
a && /* @__PURE__ */ t("span", {
|
|
421
476
|
id: `${r}-error`,
|
|
422
|
-
className:
|
|
477
|
+
className: k.errorMessage,
|
|
423
478
|
children: a
|
|
424
479
|
})
|
|
425
480
|
]
|
|
426
481
|
});
|
|
427
482
|
}
|
|
428
|
-
function
|
|
483
|
+
function j() {
|
|
429
484
|
return /* @__PURE__ */ n("svg", {
|
|
430
|
-
className:
|
|
485
|
+
className: k.icon,
|
|
431
486
|
xmlns: "http://www.w3.org/2000/svg",
|
|
432
487
|
viewBox: "0 0 24 24",
|
|
433
488
|
fill: "none",
|
|
@@ -439,9 +494,9 @@ function O() {
|
|
|
439
494
|
})]
|
|
440
495
|
});
|
|
441
496
|
}
|
|
442
|
-
function
|
|
497
|
+
function M() {
|
|
443
498
|
return /* @__PURE__ */ t("svg", {
|
|
444
|
-
className:
|
|
499
|
+
className: k.icon,
|
|
445
500
|
xmlns: "http://www.w3.org/2000/svg",
|
|
446
501
|
viewBox: "0 0 24 24",
|
|
447
502
|
fill: "none",
|
|
@@ -449,7 +504,7 @@ function k() {
|
|
|
449
504
|
children: /* @__PURE__ */ t("path", { d: "M17.94 17.94A10.94 10.94 0 0 1 12 20C7 20 2.73 16.11 1 12c.74-1.64 1.82-3.06 3.11-4.24m3.52-2.42A10.94 10.94 0 0 1 12 4c5 0 9.27 3.89 11 8-1.1 2.42-2.91 4.5-5.06 5.94M1 1l22 22" })
|
|
450
505
|
});
|
|
451
506
|
}
|
|
452
|
-
var
|
|
507
|
+
var N = {
|
|
453
508
|
inputWrapper: "_inputWrapper_3w4be_1",
|
|
454
509
|
inputTextField: "_inputTextField_3w4be_6",
|
|
455
510
|
inputTextFieldGlassy: "_inputTextFieldGlassy_3w4be_18",
|
|
@@ -464,12 +519,12 @@ var A = {
|
|
|
464
519
|
};
|
|
465
520
|
//#endregion
|
|
466
521
|
//#region src/components/form/postal-code/PostalCode.tsx
|
|
467
|
-
function
|
|
468
|
-
let b = i(), x = c ?? `${a}-${b}`, S = o(null), C = o(!1), [w, T] = s(""), [E, D] = s([]), [O, k] = s(!1), [
|
|
469
|
-
|
|
522
|
+
function P({ label: e, name: a, id: c, error: l, variant: u = "default", className: d, disabled: f, placeholder: p = "z.B. 8001 oder Zürich", ref: m, onChange: h, onBlur: g, onValueChange: _, onSuggestionSelect: v, ...y }) {
|
|
523
|
+
let b = i(), x = c ?? `${a}-${b}`, S = o(null), C = o(!1), [w, T] = s(""), [E, D] = s([]), [O, k] = s(!1), [A, j] = s(!1), M = w.trim().match(/^(\d+)\s+(.+)$/), P = !!M, F = M?.[1], I = M?.[2], L = P && E.some((e) => e.postalCode === F && e.locality === I), R = /^\d+$/.test(w.trim()), z = w.trim().length >= 4 && R && !O, B = z && E.some((e) => e.postalCode === w.trim()), V = z && !B;
|
|
524
|
+
A && w.trim().length >= 4 && E.length, r(() => {
|
|
470
525
|
let e = w.trim();
|
|
471
526
|
if (e.length < 2) {
|
|
472
|
-
D([]),
|
|
527
|
+
D([]), j(!1);
|
|
473
528
|
return;
|
|
474
529
|
}
|
|
475
530
|
if (C.current) {
|
|
@@ -490,10 +545,10 @@ function j({ label: e, name: a, id: c, error: l, variant: u = "default", classNa
|
|
|
490
545
|
postalCode: e.postalCode,
|
|
491
546
|
locality: e.name
|
|
492
547
|
}];
|
|
493
|
-
})).values()).slice(0, 10)),
|
|
548
|
+
})).values()).slice(0, 10)), j(!0);
|
|
494
549
|
} catch (e) {
|
|
495
550
|
if (t.signal.aborted) return;
|
|
496
|
-
console.error(e), D([]),
|
|
551
|
+
console.error(e), D([]), j(!0);
|
|
497
552
|
} finally {
|
|
498
553
|
t.signal.aborted || k(!1);
|
|
499
554
|
}
|
|
@@ -511,7 +566,7 @@ function j({ label: e, name: a, id: c, error: l, variant: u = "default", classNa
|
|
|
511
566
|
T(t), _?.(t), h?.(e);
|
|
512
567
|
}
|
|
513
568
|
function W(e) {
|
|
514
|
-
C.current = !0, T(e.label), D([]),
|
|
569
|
+
C.current = !0, T(e.label), D([]), j(!1), _?.(e.label), v?.(e), S.current && (S.current.value = e.label, S.current.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
515
570
|
}
|
|
516
571
|
return /* @__PURE__ */ n("div", {
|
|
517
572
|
className: "inputBlockVertical",
|
|
@@ -522,7 +577,7 @@ function j({ label: e, name: a, id: c, error: l, variant: u = "default", classNa
|
|
|
522
577
|
children: e
|
|
523
578
|
}),
|
|
524
579
|
/* @__PURE__ */ n("div", {
|
|
525
|
-
className:
|
|
580
|
+
className: N.inputWrapper,
|
|
526
581
|
children: [
|
|
527
582
|
/* @__PURE__ */ t("input", {
|
|
528
583
|
id: x,
|
|
@@ -537,10 +592,10 @@ function j({ label: e, name: a, id: c, error: l, variant: u = "default", classNa
|
|
|
537
592
|
onChange: U,
|
|
538
593
|
onBlur: g,
|
|
539
594
|
className: [
|
|
540
|
-
|
|
541
|
-
u === "glassy" ?
|
|
542
|
-
B || L ?
|
|
543
|
-
V || l ?
|
|
595
|
+
N.inputTextField,
|
|
596
|
+
u === "glassy" ? N.inputTextFieldGlassy : "",
|
|
597
|
+
B || L ? N.inputValid : "",
|
|
598
|
+
V || l ? N.inputError : "",
|
|
544
599
|
d ?? ""
|
|
545
600
|
].filter(Boolean).join(" "),
|
|
546
601
|
"aria-invalid": !!l || V,
|
|
@@ -548,117 +603,119 @@ function j({ label: e, name: a, id: c, error: l, variant: u = "default", classNa
|
|
|
548
603
|
...y
|
|
549
604
|
}),
|
|
550
605
|
O && /* @__PURE__ */ t("span", {
|
|
551
|
-
className:
|
|
606
|
+
className: N.loading,
|
|
552
607
|
children: "Lädt…"
|
|
553
608
|
}),
|
|
554
609
|
E.length > 0 && /* @__PURE__ */ t("ul", {
|
|
555
|
-
className:
|
|
610
|
+
className: N.suggestionList,
|
|
556
611
|
children: E.map((e) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("button", {
|
|
557
612
|
type: "button",
|
|
558
|
-
className:
|
|
613
|
+
className: N.suggestionItem,
|
|
559
614
|
onMouseDown: (e) => e.preventDefault(),
|
|
560
615
|
onClick: () => W(e),
|
|
561
616
|
children: [/* @__PURE__ */ t("span", { children: e.postalCode }), /* @__PURE__ */ t("span", {
|
|
562
|
-
className:
|
|
617
|
+
className: N.locality,
|
|
563
618
|
children: e.locality
|
|
564
619
|
})]
|
|
565
620
|
}) }, e.label))
|
|
566
621
|
}),
|
|
567
|
-
|
|
568
|
-
className:
|
|
622
|
+
A && w.trim().length >= 2 && E.length === 0 && !O && !L && !V && /* @__PURE__ */ t("div", {
|
|
623
|
+
className: N.emptyState,
|
|
569
624
|
children: "Keine Schweizer PLZ oder Ortschaft gefunden."
|
|
570
625
|
})
|
|
571
626
|
]
|
|
572
627
|
}),
|
|
573
628
|
B && /* @__PURE__ */ t("span", {
|
|
574
|
-
className:
|
|
629
|
+
className: N.successMessage,
|
|
575
630
|
children: "Gültige Schweizer Postleitzahl"
|
|
576
631
|
}),
|
|
577
632
|
L && /* @__PURE__ */ t("span", {
|
|
578
|
-
className:
|
|
633
|
+
className: N.successMessage,
|
|
579
634
|
children: "Gültige Schweizer Postleitzahl"
|
|
580
635
|
}),
|
|
581
636
|
V && /* @__PURE__ */ t("span", {
|
|
582
|
-
className:
|
|
637
|
+
className: N.errorMessage,
|
|
583
638
|
children: "Diese Schweizer Postleitzahl wurde nicht gefunden."
|
|
584
639
|
}),
|
|
585
640
|
l && /* @__PURE__ */ t("span", {
|
|
586
641
|
id: `${a}-error`,
|
|
587
|
-
className:
|
|
642
|
+
className: N.errorMessage,
|
|
588
643
|
children: l
|
|
589
644
|
})
|
|
590
645
|
]
|
|
591
646
|
});
|
|
592
647
|
}
|
|
593
|
-
var
|
|
594
|
-
radioGroup: "
|
|
595
|
-
optionGroup: "
|
|
596
|
-
optionWrapper: "
|
|
597
|
-
optionWrapperDisabled: "
|
|
598
|
-
optionButton: "
|
|
599
|
-
radioInput: "
|
|
600
|
-
errorMessage: "
|
|
601
|
-
optionTitle: "
|
|
602
|
-
optionDescription: "
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
optionButtonError: "_optionButtonError_1ba3g_173"
|
|
648
|
+
var F = {
|
|
649
|
+
radioGroup: "_radioGroup_1ho8r_5",
|
|
650
|
+
optionGroup: "_optionGroup_1ho8r_15",
|
|
651
|
+
optionWrapper: "_optionWrapper_1ho8r_22",
|
|
652
|
+
optionWrapperDisabled: "_optionWrapperDisabled_1ho8r_28",
|
|
653
|
+
optionButton: "_optionButton_1ho8r_32",
|
|
654
|
+
radioInput: "_radioInput_1ho8r_36",
|
|
655
|
+
errorMessage: "_errorMessage_1ho8r_46",
|
|
656
|
+
optionTitle: "_optionTitle_1ho8r_88",
|
|
657
|
+
optionDescription: "_optionDescription_1ho8r_105",
|
|
658
|
+
optionButtonDefault: "_optionButtonDefault_1ho8r_113",
|
|
659
|
+
optionButtonGlassy: "_optionButtonGlassy_1ho8r_141",
|
|
660
|
+
optionButtonError: "_optionButtonError_1ho8r_168"
|
|
607
661
|
};
|
|
608
662
|
//#endregion
|
|
609
663
|
//#region src/components/form/radiobutton/RadioButton.tsx
|
|
610
|
-
function
|
|
664
|
+
function I({ label: e, name: r, options: i, error: a, variant: o = "default", disabled: s, value: c, defaultValue: l, onChange: u, ...d }) {
|
|
611
665
|
let f = c !== void 0;
|
|
612
|
-
return /* @__PURE__ */
|
|
613
|
-
className:
|
|
614
|
-
"
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
children:
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
666
|
+
return /* @__PURE__ */ t("div", {
|
|
667
|
+
className: "inputBlockVertical",
|
|
668
|
+
children: /* @__PURE__ */ n("fieldset", {
|
|
669
|
+
className: [F.radioGroup].filter(Boolean).join(" "),
|
|
670
|
+
"aria-invalid": !!a,
|
|
671
|
+
"aria-describedby": a ? `${r}-error` : void 0,
|
|
672
|
+
children: [
|
|
673
|
+
e && /* @__PURE__ */ t("legend", {
|
|
674
|
+
className: o === "glassy" ? "inputLabelGlassy" : "inputLabel",
|
|
675
|
+
children: e
|
|
676
|
+
}),
|
|
677
|
+
/* @__PURE__ */ t("div", {
|
|
678
|
+
className: F.optionGroup,
|
|
679
|
+
children: i.map((e) => {
|
|
680
|
+
let i = f ? { checked: c === e.value } : { defaultChecked: l === e.value };
|
|
681
|
+
return /* @__PURE__ */ n("label", {
|
|
682
|
+
className: [F.optionWrapper, s ? F.optionWrapperDisabled : ""].filter(Boolean).join(" "),
|
|
683
|
+
children: [/* @__PURE__ */ t("input", {
|
|
684
|
+
type: "radio",
|
|
685
|
+
name: r,
|
|
686
|
+
value: e.value,
|
|
687
|
+
disabled: s,
|
|
688
|
+
className: F.radioInput,
|
|
689
|
+
onChange: u,
|
|
690
|
+
...i,
|
|
691
|
+
...d
|
|
692
|
+
}), /* @__PURE__ */ n("span", {
|
|
693
|
+
className: [
|
|
694
|
+
F.optionButton,
|
|
695
|
+
o === "glassy" ? F.optionButtonGlassy : F.optionButtonDefault,
|
|
696
|
+
a ? F.optionButtonError : ""
|
|
697
|
+
].filter(Boolean).join(" "),
|
|
698
|
+
children: [/* @__PURE__ */ t("span", {
|
|
699
|
+
className: F.optionTitle,
|
|
700
|
+
children: e.label
|
|
701
|
+
}), e.description && /* @__PURE__ */ t("span", {
|
|
702
|
+
className: F.optionDescription,
|
|
703
|
+
children: e.description
|
|
704
|
+
})]
|
|
648
705
|
})]
|
|
649
|
-
})
|
|
650
|
-
}
|
|
706
|
+
}, e.value);
|
|
707
|
+
})
|
|
708
|
+
}),
|
|
709
|
+
a && /* @__PURE__ */ t("span", {
|
|
710
|
+
id: `${r}-error`,
|
|
711
|
+
className: F.errorMessage,
|
|
712
|
+
children: a
|
|
651
713
|
})
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
id: `${r}-error`,
|
|
655
|
-
className: M.errorMessage,
|
|
656
|
-
children: a
|
|
657
|
-
})
|
|
658
|
-
]
|
|
714
|
+
]
|
|
715
|
+
})
|
|
659
716
|
});
|
|
660
717
|
}
|
|
661
|
-
var
|
|
718
|
+
var L = {
|
|
662
719
|
switchWrapper: "_switchWrapper_bre5n_1",
|
|
663
720
|
switchCheckbox: "_switchCheckbox_bre5n_7",
|
|
664
721
|
switchLabel: "_switchLabel_bre5n_15",
|
|
@@ -675,51 +732,54 @@ var P = {
|
|
|
675
732
|
};
|
|
676
733
|
//#endregion
|
|
677
734
|
//#region src/components/form/switch/Switch.tsx
|
|
678
|
-
function
|
|
735
|
+
function R({ name: e, id: r, label: i, error: a, variant: o = "default", className: s, disabled: c, ...l }) {
|
|
679
736
|
let u = r ?? `${e}-switch`;
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
className:
|
|
682
|
-
children:
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
className: [
|
|
698
|
-
children: /* @__PURE__ */
|
|
699
|
-
className:
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
children: /* @__PURE__ */ t(
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
737
|
+
return /* @__PURE__ */ t("div", {
|
|
738
|
+
className: "inputBlockHorizontal",
|
|
739
|
+
children: /* @__PURE__ */ n("div", {
|
|
740
|
+
className: [L.switchWrapper, s ?? ""].filter(Boolean).join(" "),
|
|
741
|
+
children: [
|
|
742
|
+
/* @__PURE__ */ t("input", {
|
|
743
|
+
id: u,
|
|
744
|
+
name: e,
|
|
745
|
+
type: "checkbox",
|
|
746
|
+
disabled: c,
|
|
747
|
+
className: L.switchCheckbox,
|
|
748
|
+
"aria-invalid": !!a,
|
|
749
|
+
"aria-describedby": a ? `${e}-error` : void 0,
|
|
750
|
+
...l
|
|
751
|
+
}),
|
|
752
|
+
/* @__PURE__ */ n("label", {
|
|
753
|
+
htmlFor: u,
|
|
754
|
+
className: [L.switchLabel, o === "glassy" ? L.switchLabelGlassy : L.switchLabelDefault].filter(Boolean).join(" "),
|
|
755
|
+
children: [/* @__PURE__ */ t("span", {
|
|
756
|
+
className: [L.switchBackground, o === "glassy" ? L.switchBackgroundGlassy : L.switchBackgroundDefault].filter(Boolean).join(" "),
|
|
757
|
+
children: /* @__PURE__ */ n("span", {
|
|
758
|
+
className: L.switchButton,
|
|
759
|
+
"aria-hidden": "true",
|
|
760
|
+
children: [/* @__PURE__ */ t("span", {
|
|
761
|
+
className: L.iconChecked,
|
|
762
|
+
children: /* @__PURE__ */ t(z, {})
|
|
763
|
+
}), /* @__PURE__ */ t("span", {
|
|
764
|
+
className: L.iconUnchecked,
|
|
765
|
+
children: /* @__PURE__ */ t(B, {})
|
|
766
|
+
})]
|
|
767
|
+
})
|
|
768
|
+
}), i && /* @__PURE__ */ t("span", {
|
|
769
|
+
className: L.switchText,
|
|
770
|
+
children: i
|
|
771
|
+
})]
|
|
772
|
+
}),
|
|
773
|
+
a && /* @__PURE__ */ t("span", {
|
|
774
|
+
id: `${e}-error`,
|
|
775
|
+
className: L.errorMessage,
|
|
776
|
+
children: a
|
|
777
|
+
})
|
|
778
|
+
]
|
|
779
|
+
})
|
|
720
780
|
});
|
|
721
781
|
}
|
|
722
|
-
function
|
|
782
|
+
function z() {
|
|
723
783
|
return /* @__PURE__ */ t("svg", {
|
|
724
784
|
width: "16",
|
|
725
785
|
height: "16",
|
|
@@ -735,7 +795,7 @@ function I() {
|
|
|
735
795
|
})
|
|
736
796
|
});
|
|
737
797
|
}
|
|
738
|
-
function
|
|
798
|
+
function B() {
|
|
739
799
|
return /* @__PURE__ */ t("svg", {
|
|
740
800
|
width: "16",
|
|
741
801
|
height: "16",
|
|
@@ -750,22 +810,22 @@ function L() {
|
|
|
750
810
|
})
|
|
751
811
|
});
|
|
752
812
|
}
|
|
753
|
-
var
|
|
754
|
-
|
|
755
|
-
inputTextField: "
|
|
756
|
-
inputTextFieldGlassy: "
|
|
757
|
-
inputError: "
|
|
758
|
-
errorMessage: "
|
|
813
|
+
var V = {
|
|
814
|
+
inputLabel: "_inputLabel_1p880_1",
|
|
815
|
+
inputTextField: "_inputTextField_1p880_5",
|
|
816
|
+
inputTextFieldGlassy: "_inputTextFieldGlassy_1p880_22",
|
|
817
|
+
inputError: "_inputError_1p880_44",
|
|
818
|
+
errorMessage: "_errorMessage_1p880_48"
|
|
759
819
|
};
|
|
760
820
|
//#endregion
|
|
761
821
|
//#region src/components/form/textfield/TextField.tsx
|
|
762
|
-
function
|
|
822
|
+
function H({ label: e, name: r, error: i, placeholder: a, variant: o = "default", className: s, ref: c, ...l }) {
|
|
763
823
|
return /* @__PURE__ */ n("div", {
|
|
764
|
-
className:
|
|
824
|
+
className: "inputBlockVertical",
|
|
765
825
|
children: [
|
|
766
826
|
/* @__PURE__ */ t("label", {
|
|
767
827
|
htmlFor: r,
|
|
768
|
-
className: [
|
|
828
|
+
className: [V.inputLabel, o === "glassy" ? "inputLabelGlassy" : ""].filter(Boolean).join(" "),
|
|
769
829
|
children: e
|
|
770
830
|
}),
|
|
771
831
|
/* @__PURE__ */ t("input", {
|
|
@@ -774,9 +834,9 @@ function z({ label: e, name: r, error: i, placeholder: a, variant: o = "default"
|
|
|
774
834
|
ref: c,
|
|
775
835
|
placeholder: a,
|
|
776
836
|
className: [
|
|
777
|
-
|
|
778
|
-
o === "glassy" ?
|
|
779
|
-
i ?
|
|
837
|
+
V.inputTextField,
|
|
838
|
+
o === "glassy" ? V.inputTextFieldGlassy : "",
|
|
839
|
+
i ? V.inputError : "",
|
|
780
840
|
s ?? ""
|
|
781
841
|
].filter(Boolean).join(" "),
|
|
782
842
|
"aria-invalid": !!i,
|
|
@@ -785,13 +845,13 @@ function z({ label: e, name: r, error: i, placeholder: a, variant: o = "default"
|
|
|
785
845
|
}),
|
|
786
846
|
i && /* @__PURE__ */ t("span", {
|
|
787
847
|
id: `${r}-error`,
|
|
788
|
-
className:
|
|
848
|
+
className: V.errorMessage,
|
|
789
849
|
children: i
|
|
790
850
|
})
|
|
791
851
|
]
|
|
792
852
|
});
|
|
793
853
|
}
|
|
794
|
-
var
|
|
854
|
+
var U = {
|
|
795
855
|
wrapper: "_wrapper_8acbw_1",
|
|
796
856
|
label: "_label_8acbw_7",
|
|
797
857
|
labelGlassy: "_labelGlassy_8acbw_13",
|
|
@@ -816,7 +876,7 @@ var B = {
|
|
|
816
876
|
};
|
|
817
877
|
//#endregion
|
|
818
878
|
//#region src/components/form/upload/Upload.tsx
|
|
819
|
-
function
|
|
879
|
+
function W({ label: e, name: o, id: c, file: l, error: u, variant: d = "default", accept: f = "image/*", maxSizeBytes: p = 5 * 1024 * 1024, disabled: m, className: h, onChange: g, onFileChange: _, ...v }) {
|
|
820
880
|
let y = i(), b = c ?? `${o}-${y}`, [x, S] = s(!1), [C, w] = s(l ?? null), T = l !== void 0, E = T ? l : C, D = a(() => !E || !E.type.startsWith("image/") ? null : URL.createObjectURL(E), [E]);
|
|
821
881
|
r(() => {
|
|
822
882
|
T && w(l ?? null);
|
|
@@ -847,20 +907,20 @@ function V({ label: e, name: o, id: c, file: l, error: u, variant: d = "default"
|
|
|
847
907
|
}
|
|
848
908
|
let F = Math.round(p / (1024 * 1024));
|
|
849
909
|
return /* @__PURE__ */ n("div", {
|
|
850
|
-
className: [
|
|
910
|
+
className: [U.wrapper, h ?? ""].filter(Boolean).join(" "),
|
|
851
911
|
children: [
|
|
852
912
|
/* @__PURE__ */ t("label", {
|
|
853
|
-
className: [
|
|
913
|
+
className: [U.label, d === "glassy" ? U.labelGlassy : ""].filter(Boolean).join(" "),
|
|
854
914
|
htmlFor: b,
|
|
855
915
|
children: e
|
|
856
916
|
}),
|
|
857
917
|
/* @__PURE__ */ n("div", {
|
|
858
918
|
className: [
|
|
859
|
-
|
|
860
|
-
d === "glassy" ?
|
|
861
|
-
x ?
|
|
862
|
-
u ?
|
|
863
|
-
m ?
|
|
919
|
+
U.dropzone,
|
|
920
|
+
d === "glassy" ? U.dropzoneGlassy : "",
|
|
921
|
+
x ? U.dragOver : "",
|
|
922
|
+
u ? U.errorState : "",
|
|
923
|
+
m ? U.disabled : ""
|
|
864
924
|
].filter(Boolean).join(" "),
|
|
865
925
|
onDragOver: j,
|
|
866
926
|
onDragLeave: M,
|
|
@@ -869,7 +929,7 @@ function V({ label: e, name: o, id: c, file: l, error: u, variant: d = "default"
|
|
|
869
929
|
/* @__PURE__ */ t("input", {
|
|
870
930
|
id: b,
|
|
871
931
|
name: o,
|
|
872
|
-
className:
|
|
932
|
+
className: U.hiddenInput,
|
|
873
933
|
type: "file",
|
|
874
934
|
accept: f,
|
|
875
935
|
disabled: m,
|
|
@@ -880,20 +940,20 @@ function V({ label: e, name: o, id: c, file: l, error: u, variant: d = "default"
|
|
|
880
940
|
}),
|
|
881
941
|
/* @__PURE__ */ t("label", {
|
|
882
942
|
htmlFor: b,
|
|
883
|
-
className:
|
|
943
|
+
className: U.dropzoneContent,
|
|
884
944
|
children: E ? /* @__PURE__ */ n("span", {
|
|
885
|
-
className:
|
|
945
|
+
className: U.selected,
|
|
886
946
|
children: [D && /* @__PURE__ */ t("img", {
|
|
887
|
-
className:
|
|
947
|
+
className: U.preview,
|
|
888
948
|
src: D,
|
|
889
949
|
alt: `Vorschau von ${E.name}`
|
|
890
950
|
}), /* @__PURE__ */ n("span", {
|
|
891
|
-
className:
|
|
951
|
+
className: U.fileMeta,
|
|
892
952
|
children: [/* @__PURE__ */ t("span", {
|
|
893
|
-
className:
|
|
953
|
+
className: U.fileName,
|
|
894
954
|
children: E.name
|
|
895
955
|
}), /* @__PURE__ */ n("span", {
|
|
896
|
-
className:
|
|
956
|
+
className: U.fileSize,
|
|
897
957
|
children: [
|
|
898
958
|
(E.size / 1024).toFixed(0),
|
|
899
959
|
" KB ·",
|
|
@@ -903,18 +963,18 @@ function V({ label: e, name: o, id: c, file: l, error: u, variant: d = "default"
|
|
|
903
963
|
})]
|
|
904
964
|
})]
|
|
905
965
|
}) : /* @__PURE__ */ n("span", {
|
|
906
|
-
className:
|
|
966
|
+
className: U.placeholder,
|
|
907
967
|
children: [
|
|
908
968
|
/* @__PURE__ */ t("span", {
|
|
909
|
-
className:
|
|
969
|
+
className: U.big,
|
|
910
970
|
children: "Datei hier reinziehen"
|
|
911
971
|
}),
|
|
912
972
|
/* @__PURE__ */ t("span", {
|
|
913
|
-
className:
|
|
973
|
+
className: U.small,
|
|
914
974
|
children: "…oder klicken, um auszuwählen"
|
|
915
975
|
}),
|
|
916
976
|
/* @__PURE__ */ n("span", {
|
|
917
|
-
className:
|
|
977
|
+
className: U.hint,
|
|
918
978
|
children: [
|
|
919
979
|
"Erlaubt: ",
|
|
920
980
|
f,
|
|
@@ -928,7 +988,7 @@ function V({ label: e, name: o, id: c, file: l, error: u, variant: d = "default"
|
|
|
928
988
|
}),
|
|
929
989
|
E && /* @__PURE__ */ t("button", {
|
|
930
990
|
type: "button",
|
|
931
|
-
className:
|
|
991
|
+
className: U.remove,
|
|
932
992
|
onClick: P,
|
|
933
993
|
disabled: m,
|
|
934
994
|
children: "Entfernen"
|
|
@@ -937,11 +997,11 @@ function V({ label: e, name: o, id: c, file: l, error: u, variant: d = "default"
|
|
|
937
997
|
}),
|
|
938
998
|
u && /* @__PURE__ */ t("span", {
|
|
939
999
|
id: `${o}-error`,
|
|
940
|
-
className:
|
|
1000
|
+
className: U.errorMessage,
|
|
941
1001
|
children: u
|
|
942
1002
|
})
|
|
943
1003
|
]
|
|
944
1004
|
});
|
|
945
1005
|
}
|
|
946
1006
|
//#endregion
|
|
947
|
-
export { l as Button,
|
|
1007
|
+
export { f as BannerHero, l as Button, m as Checkbox, g as Chip, v as DatePicker, C as Dropdown, O as IconButton, T as Link, A as Password, P as PostalCode, I as RadioButton, R as Switch, H as TextField, W as Upload };
|