@publicplan/kern-react-kit 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2626 @@
1
+ import { __export } from "./chunk-CTAAG5j7.js";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
4
+
5
+ //#region src/lib/cn.ts
6
+ function cn(...classes) {
7
+ return classes.filter((cls) => typeof cls === "string" && cls.trim().length > 0).map((cls) => cls.trim()).join(" ").replace(/\s+/g, " ").trim();
8
+ }
9
+
10
+ //#endregion
11
+ //#region \0@oxc-project+runtime@0.93.0/helpers/objectWithoutPropertiesLoose.js
12
+ function _objectWithoutPropertiesLoose(r, e) {
13
+ if (null == r) return {};
14
+ var t = {};
15
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
16
+ if (e.includes(n)) continue;
17
+ t[n] = r[n];
18
+ }
19
+ return t;
20
+ }
21
+
22
+ //#endregion
23
+ //#region \0@oxc-project+runtime@0.93.0/helpers/objectWithoutProperties.js
24
+ function _objectWithoutProperties(e, t) {
25
+ if (null == e) return {};
26
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
27
+ if (Object.getOwnPropertySymbols) {
28
+ var s = Object.getOwnPropertySymbols(e);
29
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
30
+ }
31
+ return i;
32
+ }
33
+
34
+ //#endregion
35
+ //#region \0@oxc-project+runtime@0.93.0/helpers/typeof.js
36
+ function _typeof(o) {
37
+ "@babel/helpers - typeof";
38
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
39
+ return typeof o$1;
40
+ } : function(o$1) {
41
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
42
+ }, _typeof(o);
43
+ }
44
+
45
+ //#endregion
46
+ //#region \0@oxc-project+runtime@0.93.0/helpers/toPrimitive.js
47
+ function toPrimitive(t, r) {
48
+ if ("object" != _typeof(t) || !t) return t;
49
+ var e = t[Symbol.toPrimitive];
50
+ if (void 0 !== e) {
51
+ var i = e.call(t, r || "default");
52
+ if ("object" != _typeof(i)) return i;
53
+ throw new TypeError("@@toPrimitive must return a primitive value.");
54
+ }
55
+ return ("string" === r ? String : Number)(t);
56
+ }
57
+
58
+ //#endregion
59
+ //#region \0@oxc-project+runtime@0.93.0/helpers/toPropertyKey.js
60
+ function toPropertyKey(t) {
61
+ var i = toPrimitive(t, "string");
62
+ return "symbol" == _typeof(i) ? i : i + "";
63
+ }
64
+
65
+ //#endregion
66
+ //#region \0@oxc-project+runtime@0.93.0/helpers/defineProperty.js
67
+ function _defineProperty(e, r, t) {
68
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
69
+ value: t,
70
+ enumerable: !0,
71
+ configurable: !0,
72
+ writable: !0
73
+ }) : e[r] = t, e;
74
+ }
75
+
76
+ //#endregion
77
+ //#region \0@oxc-project+runtime@0.93.0/helpers/objectSpread2.js
78
+ function ownKeys(e, r) {
79
+ var t = Object.keys(e);
80
+ if (Object.getOwnPropertySymbols) {
81
+ var o = Object.getOwnPropertySymbols(e);
82
+ r && (o = o.filter(function(r$1) {
83
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
84
+ })), t.push.apply(t, o);
85
+ }
86
+ return t;
87
+ }
88
+ function _objectSpread2(e) {
89
+ for (var r = 1; r < arguments.length; r++) {
90
+ var t = null != arguments[r] ? arguments[r] : {};
91
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
92
+ _defineProperty(e, r$1, t[r$1]);
93
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
94
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
95
+ });
96
+ }
97
+ return e;
98
+ }
99
+
100
+ //#endregion
101
+ //#region src/components/Accordion/Content.tsx
102
+ const _excluded$95 = ["children", "className"];
103
+ const AccordionContent = (_ref) => {
104
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$95);
105
+ return /* @__PURE__ */ jsx("section", _objectSpread2(_objectSpread2({}, rest), {}, {
106
+ className: cn("kern-accordion__body", className),
107
+ children: /* @__PURE__ */ jsx("p", {
108
+ className: "kern-body",
109
+ children
110
+ })
111
+ }));
112
+ };
113
+ AccordionContent.displayName = "Accordion.Content";
114
+
115
+ //#endregion
116
+ //#region src/components/Accordion/Root.tsx
117
+ const _excluded$94 = [
118
+ "className",
119
+ "children",
120
+ "isOpened",
121
+ "position",
122
+ "totalItems"
123
+ ];
124
+ const AccordionRoot = (_ref) => {
125
+ let { className, children, isOpened, position = 0, totalItems = 0 } = _ref, rest = _objectWithoutProperties(_ref, _excluded$94);
126
+ return /* @__PURE__ */ jsxs("details", _objectSpread2(_objectSpread2(_objectSpread2({}, rest), {}, { className: cn("kern-accordion", className) }, isOpened ? { open: true } : {}), {}, { children: [position > 0 && totalItems > 0 && /* @__PURE__ */ jsx("span", {
127
+ className: "kern-sr-only",
128
+ children: `Item ${position} of ${totalItems}`
129
+ }), children] }));
130
+ };
131
+ AccordionRoot.displayName = "Accordion.Root";
132
+
133
+ //#endregion
134
+ //#region src/components/Title/Title.tsx
135
+ const _excluded$93 = [
136
+ "variant",
137
+ "textWrapper",
138
+ "title",
139
+ "children",
140
+ "className"
141
+ ];
142
+ const Title = (_ref) => {
143
+ let { variant = "default", textWrapper = "h2", title, children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$93);
144
+ const Wrapper = textWrapper;
145
+ const titleClass = cn("kern-title", `kern-title--${variant}`, className);
146
+ return /* @__PURE__ */ jsx(Wrapper, _objectSpread2(_objectSpread2({}, rest), {}, {
147
+ className: titleClass,
148
+ children: children || title
149
+ }));
150
+ };
151
+
152
+ //#endregion
153
+ //#region src/components/Accordion/Group.tsx
154
+ const _excluded$92 = [
155
+ "aria-label",
156
+ "className",
157
+ "title",
158
+ "children"
159
+ ];
160
+ const AccordionGroup = (_ref) => {
161
+ let { "aria-label": ariaLabel, className, title, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$92);
162
+ const totalItems = React.Children.count(children);
163
+ const isAccordionItem = (child) => {
164
+ if (!React.isValidElement(child)) return false;
165
+ return child.type === AccordionRoot;
166
+ };
167
+ return /* @__PURE__ */ jsxs("div", _objectSpread2(_objectSpread2({}, rest), {}, {
168
+ role: "group",
169
+ "aria-label": [ariaLabel && `${ariaLabel},`, `${totalItems} Elemente`].filter(Boolean).join(" "),
170
+ className: cn("kern-accordion-group", className),
171
+ children: [title && /* @__PURE__ */ jsx(Title, _objectSpread2({}, title)), React.Children.map(children, (child, index) => isAccordionItem(child) ? React.cloneElement(child, {
172
+ position: index + 1,
173
+ totalItems
174
+ }) : child)]
175
+ }));
176
+ };
177
+ AccordionGroup.displayName = "Accordion.Group";
178
+
179
+ //#endregion
180
+ //#region src/components/Accordion/Summary.tsx
181
+ const _excluded$91 = ["title", "className"];
182
+ const AccordionSummary = (_ref) => {
183
+ let { title, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$91);
184
+ return /* @__PURE__ */ jsx("summary", _objectSpread2(_objectSpread2({}, rest), {}, {
185
+ className: cn("kern-accordion__header", className),
186
+ children: /* @__PURE__ */ jsx(Title, _objectSpread2({}, title))
187
+ }));
188
+ };
189
+ AccordionSummary.displayName = "Accordion.Summary";
190
+
191
+ //#endregion
192
+ //#region src/components/Accordion/index.ts
193
+ var Accordion_exports = /* @__PURE__ */ __export({
194
+ Content: () => AccordionContent,
195
+ Group: () => AccordionGroup,
196
+ Root: () => AccordionRoot,
197
+ Summary: () => AccordionSummary
198
+ });
199
+
200
+ //#endregion
201
+ //#region src/components/Alert/Body.tsx
202
+ const _excluded$90 = ["children", "className"];
203
+ const AlertBody = (_ref) => {
204
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$90);
205
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
206
+ className: cn("kern-alert__body", className),
207
+ children
208
+ }));
209
+ };
210
+ AlertBody.displayName = "Alert.Body";
211
+
212
+ //#endregion
213
+ //#region src/components/Icon/Icon.tsx
214
+ const _excluded$89 = [
215
+ "name",
216
+ "aria-hidden",
217
+ "size",
218
+ "role",
219
+ "className"
220
+ ];
221
+ const Icon = (_ref) => {
222
+ let { name = "home", "aria-hidden": ariaHidden = true, size = "default", role, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$89);
223
+ return /* @__PURE__ */ jsx("span", _objectSpread2(_objectSpread2({}, rest), {}, {
224
+ className: cn("kern-icon", `kern-icon--${name}`, `kern-icon--${size}`, className),
225
+ "aria-hidden": ariaHidden,
226
+ role
227
+ }));
228
+ };
229
+
230
+ //#endregion
231
+ //#region src/components/Alert/Context.ts
232
+ const AlertVariantContext = createContext("info");
233
+ function useAlertVariant() {
234
+ return useContext(AlertVariantContext);
235
+ }
236
+
237
+ //#endregion
238
+ //#region src/components/Alert/Header.tsx
239
+ const _excluded$88 = [
240
+ "hasIcon",
241
+ "icon",
242
+ "title",
243
+ "className"
244
+ ];
245
+ const AlertHeader = (_ref) => {
246
+ let { hasIcon = true, icon, title, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$88);
247
+ const variant = useAlertVariant();
248
+ return /* @__PURE__ */ jsxs("div", _objectSpread2(_objectSpread2({}, rest), {}, {
249
+ className: cn("kern-alert__header", className),
250
+ children: [hasIcon && /* @__PURE__ */ jsx(Icon, _objectSpread2(_objectSpread2({}, icon), {}, { name: variant })), title && /* @__PURE__ */ jsx(Title, {
251
+ title,
252
+ textWrapper: "span"
253
+ })]
254
+ }));
255
+ };
256
+ AlertHeader.displayName = "Alert.Header";
257
+
258
+ //#endregion
259
+ //#region src/components/Link/Link.tsx
260
+ const _excluded$87 = [
261
+ "variant",
262
+ "icon",
263
+ "iconLeft",
264
+ "title",
265
+ "target",
266
+ "children",
267
+ "isStretched",
268
+ "className"
269
+ ];
270
+ const getIcon$1 = (iconProps) => iconProps ? /* @__PURE__ */ jsx(Icon, {
271
+ name: iconProps.name,
272
+ size: iconProps.size
273
+ }) : null;
274
+ const Link = (_ref) => {
275
+ let { variant = "default", icon, iconLeft, title, target = "_self", children, isStretched, className } = _ref, props = _objectWithoutProperties(_ref, _excluded$87);
276
+ const linkText = title !== null && title !== void 0 ? title : children;
277
+ const linkClass = cn(isStretched ? "kern-link--stretched" : "kern-link", variant === "small" && "kern-link--small", className);
278
+ return /* @__PURE__ */ jsxs("a", _objectSpread2(_objectSpread2({}, props), {}, {
279
+ className: linkClass,
280
+ target: (icon === null || icon === void 0 ? void 0 : icon.name) === "open-in-new" ? "_blank" : target,
281
+ children: [
282
+ iconLeft && getIcon$1(icon),
283
+ linkText,
284
+ !iconLeft && getIcon$1(icon)
285
+ ]
286
+ }));
287
+ };
288
+ Link.isInteractive = true;
289
+
290
+ //#endregion
291
+ //#region src/components/Alert/Link.tsx
292
+ const AlertLink = (props) => {
293
+ return /* @__PURE__ */ jsx(Link, _objectSpread2(_objectSpread2({}, props), {}, { className: cn("kern-alert__link", props.className) }));
294
+ };
295
+ AlertLink.displayName = "Alert.Link";
296
+
297
+ //#endregion
298
+ //#region src/components/Alert/Root.tsx
299
+ const _excluded$86 = [
300
+ "children",
301
+ "variant",
302
+ "className"
303
+ ];
304
+ const AlertRoot = (_ref) => {
305
+ let { children = null, variant, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$86);
306
+ return /* @__PURE__ */ jsx(AlertVariantContext.Provider, {
307
+ value: variant,
308
+ children: /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
309
+ className: cn("kern-alert", `kern-alert--${variant}`, className),
310
+ role: "alert",
311
+ children
312
+ }))
313
+ });
314
+ };
315
+ AlertRoot.displayName = "Alert.Root";
316
+
317
+ //#endregion
318
+ //#region src/components/Alert/index.ts
319
+ var Alert_exports = /* @__PURE__ */ __export({
320
+ Body: () => AlertBody,
321
+ Header: () => AlertHeader,
322
+ Link: () => AlertLink,
323
+ Root: () => AlertRoot
324
+ });
325
+
326
+ //#endregion
327
+ //#region src/components/Card/Body.tsx
328
+ const _excluded$85 = ["className", "children"];
329
+ const CardBody = (_ref) => {
330
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$85);
331
+ return /* @__PURE__ */ jsx("section", _objectSpread2(_objectSpread2({ className: cn("kern-card__body", className) }, rest), {}, { children: /* @__PURE__ */ jsx("p", {
332
+ className: "kern-body",
333
+ children
334
+ }) }));
335
+ };
336
+ CardBody.displayName = "Card.Body";
337
+
338
+ //#endregion
339
+ //#region src/components/Card/Container.tsx
340
+ const _excluded$84 = ["className", "children"];
341
+ const CardContainer = (_ref) => {
342
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$84);
343
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
344
+ className: cn("kern-card__container", className),
345
+ children
346
+ }));
347
+ };
348
+ CardContainer.displayName = "Card.Container";
349
+
350
+ //#endregion
351
+ //#region src/components/Card/Footer.tsx
352
+ const _excluded$83 = ["className", "children"];
353
+ const CardFooter = (_ref) => {
354
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$83);
355
+ return /* @__PURE__ */ jsx("footer", _objectSpread2(_objectSpread2({}, rest), {}, {
356
+ className: cn("kern-card__footer", className),
357
+ children
358
+ }));
359
+ };
360
+ CardFooter.displayName = "Card.Footer";
361
+
362
+ //#endregion
363
+ //#region src/components/Card/Header.tsx
364
+ const _excluded$82 = ["className", "children"];
365
+ const CardHeader = (_ref) => {
366
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$82);
367
+ return /* @__PURE__ */ jsx("header", _objectSpread2(_objectSpread2({}, rest), {}, {
368
+ className: cn("kern-card__header", className),
369
+ children
370
+ }));
371
+ };
372
+ CardHeader.displayName = "Card.Header";
373
+
374
+ //#endregion
375
+ //#region src/components/Card/Media.tsx
376
+ const _excluded$81 = [
377
+ "src",
378
+ "alt",
379
+ "width",
380
+ "height",
381
+ "className"
382
+ ];
383
+ const CardMedia = (_ref) => {
384
+ let { src, alt, width, height, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$81);
385
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
386
+ className: cn("kern-card__media", className),
387
+ children: /* @__PURE__ */ jsx("img", {
388
+ src,
389
+ alt,
390
+ width,
391
+ height
392
+ })
393
+ }));
394
+ };
395
+ CardMedia.displayName = "Card.Media";
396
+
397
+ //#endregion
398
+ //#region src/components/Card/Preline.tsx
399
+ const _excluded$80 = ["className", "children"];
400
+ const CardPreline = (_ref) => {
401
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$80);
402
+ return /* @__PURE__ */ jsx("p", _objectSpread2(_objectSpread2({}, rest), {}, {
403
+ className: cn("kern-preline", className),
404
+ children
405
+ }));
406
+ };
407
+ CardPreline.displayName = "Card.Preline";
408
+
409
+ //#endregion
410
+ //#region src/components/Card/Root.tsx
411
+ const _excluded$79 = [
412
+ "className",
413
+ "style",
414
+ "children",
415
+ "active",
416
+ "size",
417
+ "isCardHug"
418
+ ];
419
+ const CardRoot = (_ref) => {
420
+ let { className, style, children, active = false, size = "medium", isCardHug = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$79);
421
+ return /* @__PURE__ */ jsx("article", _objectSpread2(_objectSpread2({}, rest), {}, {
422
+ className: cn("kern-card", active && "kern-card--active", size && `kern-card--${size}`, isCardHug && ` kern-card--hug`, className),
423
+ style,
424
+ children
425
+ }));
426
+ };
427
+ CardRoot.displayName = "Card.Root";
428
+
429
+ //#endregion
430
+ //#region src/components/Card/Subline.tsx
431
+ const _excluded$78 = ["className", "children"];
432
+ const CardSubline = (_ref) => {
433
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$78);
434
+ return /* @__PURE__ */ jsx("h3", _objectSpread2(_objectSpread2({}, rest), {}, {
435
+ className: cn("kern-subline", className),
436
+ children
437
+ }));
438
+ };
439
+ CardSubline.displayName = "Card.Subline";
440
+
441
+ //#endregion
442
+ //#region src/components/Card/Title.tsx
443
+ const _excluded$77 = [
444
+ "className",
445
+ "children",
446
+ "textWrapper"
447
+ ];
448
+ const CardTitle = (_ref) => {
449
+ let { className, children, textWrapper = "h2" } = _ref, rest = _objectWithoutProperties(_ref, _excluded$77);
450
+ return /* @__PURE__ */ jsx(textWrapper, _objectSpread2(_objectSpread2({}, rest), {}, {
451
+ className: cn("kern-title", className),
452
+ children
453
+ }));
454
+ };
455
+ CardTitle.displayName = "Card.Title";
456
+
457
+ //#endregion
458
+ //#region src/components/Card/index.ts
459
+ var Card_exports = /* @__PURE__ */ __export({
460
+ Body: () => CardBody,
461
+ Container: () => CardContainer,
462
+ Footer: () => CardFooter,
463
+ Header: () => CardHeader,
464
+ Media: () => CardMedia,
465
+ Preline: () => CardPreline,
466
+ Root: () => CardRoot,
467
+ Subline: () => CardSubline,
468
+ Title: () => CardTitle
469
+ });
470
+
471
+ //#endregion
472
+ //#region src/components/DescriptionList/Heading.tsx
473
+ const _excluded$76 = [
474
+ "title",
475
+ "children",
476
+ "className"
477
+ ];
478
+ const DescriptionListHeading = (_ref) => {
479
+ let { title, children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$76);
480
+ return /* @__PURE__ */ jsxs("div", _objectSpread2(_objectSpread2({}, rest), {}, {
481
+ className: cn("kern-description-list__heading", className),
482
+ children: [/* @__PURE__ */ jsx(Title, _objectSpread2({}, title)), children]
483
+ }));
484
+ };
485
+ DescriptionListHeading.displayName = "DescriptionList.Heading";
486
+
487
+ //#endregion
488
+ //#region src/components/DescriptionList/Item.tsx
489
+ const _excluded$75 = ["children", "className"];
490
+ const DescriptionListItem = (_ref) => {
491
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$75);
492
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
493
+ className: cn(`kern-description-list-item`, className),
494
+ children
495
+ }));
496
+ };
497
+ DescriptionListItem.displayName = "DescriptionList.Item";
498
+
499
+ //#endregion
500
+ //#region src/components/DescriptionList/Key.tsx
501
+ const _excluded$74 = ["children", "className"];
502
+ const DescriptionListKey = (_ref) => {
503
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$74);
504
+ return /* @__PURE__ */ jsx("dt", _objectSpread2(_objectSpread2({}, rest), {}, {
505
+ className: cn("kern-description-list-item__key", className),
506
+ children
507
+ }));
508
+ };
509
+ DescriptionListKey.displayName = "DescriptionList.Key";
510
+
511
+ //#endregion
512
+ //#region src/components/DescriptionList/Root.tsx
513
+ const _excluded$73 = [
514
+ "variant",
515
+ "children",
516
+ "className"
517
+ ];
518
+ const DescriptionListRoot = (_ref) => {
519
+ let { variant = "row", children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$73);
520
+ return /* @__PURE__ */ jsx("dl", _objectSpread2(_objectSpread2({}, rest), {}, {
521
+ className: cn("kern-description-list", variant === "column" && "kern-description-list--col", className),
522
+ children
523
+ }));
524
+ };
525
+ DescriptionListRoot.displayName = "DescriptionList.Root";
526
+
527
+ //#endregion
528
+ //#region src/components/DescriptionList/Value.tsx
529
+ const _excluded$72 = ["children", "className"];
530
+ const DescriptionListValue = (_ref) => {
531
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$72);
532
+ return /* @__PURE__ */ jsx("dd", _objectSpread2(_objectSpread2({}, rest), {}, {
533
+ className: cn("kern-description-list-item__value", className),
534
+ children
535
+ }));
536
+ };
537
+ DescriptionListValue.displayName = "DescriptionList.Value";
538
+
539
+ //#endregion
540
+ //#region src/components/DescriptionList/index.ts
541
+ var DescriptionList_exports = /* @__PURE__ */ __export({
542
+ Heading: () => DescriptionListHeading,
543
+ Item: () => DescriptionListItem,
544
+ Key: () => DescriptionListKey,
545
+ Root: () => DescriptionListRoot,
546
+ Value: () => DescriptionListValue
547
+ });
548
+
549
+ //#endregion
550
+ //#region src/components/Button/Button.tsx
551
+ const _excluded$71 = [
552
+ "variant",
553
+ "isBlock",
554
+ "icon",
555
+ "iconOnly",
556
+ "iconLeft",
557
+ "text",
558
+ "children",
559
+ "className"
560
+ ];
561
+ const getIcon = (iconProps) => iconProps ? /* @__PURE__ */ jsx(Icon, {
562
+ name: iconProps.name,
563
+ size: iconProps.size
564
+ }) : null;
565
+ const IconOnlyLabel = ({ labelText }) => {
566
+ if (!labelText) return null;
567
+ return /* @__PURE__ */ jsx("span", {
568
+ className: "kern-label kern-sr-only",
569
+ children: labelText.replace(/^./, (c) => c.toUpperCase())
570
+ });
571
+ };
572
+ const Button = (_ref) => {
573
+ let { variant = "primary", isBlock, icon, iconOnly, iconLeft, text, children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$71);
574
+ const classes = cn("kern-btn", isBlock && "kern-btn--block", `kern-btn--${variant}`, className);
575
+ const iconElement = getIcon(icon);
576
+ if (iconOnly) return /* @__PURE__ */ jsxs("button", _objectSpread2(_objectSpread2({}, rest), {}, {
577
+ className: classes,
578
+ children: [iconElement, /* @__PURE__ */ jsx(IconOnlyLabel, { labelText: text || (icon === null || icon === void 0 ? void 0 : icon.name) })]
579
+ }));
580
+ return /* @__PURE__ */ jsxs("button", _objectSpread2(_objectSpread2({}, rest), {}, {
581
+ className: classes,
582
+ children: [
583
+ iconLeft && iconElement,
584
+ text && /* @__PURE__ */ jsx("span", {
585
+ className: "kern-label",
586
+ children: children || text
587
+ }),
588
+ !iconLeft && iconElement
589
+ ]
590
+ }));
591
+ };
592
+ Button.isInteractive = true;
593
+
594
+ //#endregion
595
+ //#region src/components/Dialog/Context.ts
596
+ const DialogContext = createContext(null);
597
+ const useDialogContext = () => {
598
+ const context = useContext(DialogContext);
599
+ if (!context) throw new Error("Dialog sub-components must be used within Dialog.Root");
600
+ return context;
601
+ };
602
+
603
+ //#endregion
604
+ //#region src/components/Dialog/Button.tsx
605
+ const _excluded$70 = ["onClick", "title"];
606
+ const DialogButton = (_ref) => {
607
+ let { onClick, title } = _ref, props = _objectWithoutProperties(_ref, _excluded$70);
608
+ const { closeDialog } = useDialogContext();
609
+ return /* @__PURE__ */ jsx(Button, _objectSpread2(_objectSpread2({}, props), {}, {
610
+ text: title,
611
+ onClick: (e) => {
612
+ if (onClick) onClick(e, { closeDialog });
613
+ else closeDialog();
614
+ }
615
+ }));
616
+ };
617
+ DialogButton.displayName = "Dialog.Button";
618
+
619
+ //#endregion
620
+ //#region src/components/Dialog/Content.tsx
621
+ const _excluded$69 = ["className", "children"];
622
+ const DialogContent = (_ref) => {
623
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$69);
624
+ return /* @__PURE__ */ jsx("section", _objectSpread2(_objectSpread2({ className: cn("kern-dialog__body", className) }, rest), {}, { children: typeof children === "string" ? /* @__PURE__ */ jsx("p", {
625
+ className: "kern-body",
626
+ children
627
+ }) : children }));
628
+ };
629
+ DialogContent.displayName = "Dialog.Content";
630
+
631
+ //#endregion
632
+ //#region src/components/Dialog/Footer.tsx
633
+ const _excluded$68 = ["className", "children"];
634
+ const DialogFooter = (_ref) => {
635
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$68);
636
+ return /* @__PURE__ */ jsx("footer", _objectSpread2(_objectSpread2({}, rest), {}, {
637
+ className: cn("kern-dialog__footer", className),
638
+ children
639
+ }));
640
+ };
641
+ DialogFooter.displayName = "Dialog.Footer";
642
+
643
+ //#endregion
644
+ //#region src/components/Dialog/Header.tsx
645
+ const _excluded$67 = [
646
+ "dialogTitle",
647
+ "hasCloseButton",
648
+ "aria-label",
649
+ "className"
650
+ ];
651
+ const DialogHeader = (_ref) => {
652
+ let { dialogTitle, hasCloseButton = true, "aria-label": ariaLabel = "Schließen", className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$67);
653
+ const { closeDialog, id } = useDialogContext();
654
+ const headerClass = cn("kern-dialog__header", className);
655
+ return /* @__PURE__ */ jsxs("header", _objectSpread2(_objectSpread2({}, rest), {}, {
656
+ className: headerClass,
657
+ children: [/* @__PURE__ */ jsx("h2", {
658
+ id,
659
+ className: "kern-title kern-title--large",
660
+ children: dialogTitle
661
+ }), hasCloseButton && /* @__PURE__ */ jsxs("button", {
662
+ type: "button",
663
+ className: "kern-btn kern-btn--tertiary",
664
+ onClick: closeDialog,
665
+ "aria-label": ariaLabel,
666
+ children: [/* @__PURE__ */ jsx("span", {
667
+ className: "kern-icon kern-icon--close",
668
+ "aria-hidden": "true"
669
+ }), /* @__PURE__ */ jsx("span", {
670
+ className: "kern-sr-only",
671
+ children: ariaLabel
672
+ })]
673
+ })]
674
+ }));
675
+ };
676
+ DialogHeader.displayName = "Dialog.Header";
677
+
678
+ //#endregion
679
+ //#region src/components/Dialog/Modal.tsx
680
+ const _excluded$66 = ["className", "children"];
681
+ const DialogModal = (_ref) => {
682
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$66);
683
+ const { dialogRef, closeDialog, isOpen, disableOverlayClose, id } = useDialogContext();
684
+ const handleOverlayClick = (e) => {
685
+ if (disableOverlayClose && e.target === dialogRef.current) e.preventDefault();
686
+ else if (e.target === dialogRef.current) closeDialog();
687
+ };
688
+ const handleKeyDown = (e) => {
689
+ if (e.key === "Escape") {
690
+ e.stopPropagation();
691
+ closeDialog();
692
+ return;
693
+ }
694
+ if (e.key !== "Tab") return;
695
+ const dialog = dialogRef.current;
696
+ if (!dialog) return;
697
+ const focusables = dialog.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
698
+ if (!focusables.length) return;
699
+ const first = focusables[0];
700
+ const last = focusables[focusables.length - 1];
701
+ if (e.shiftKey && document.activeElement === first) {
702
+ e.preventDefault();
703
+ last.focus();
704
+ } else if (!e.shiftKey && document.activeElement === last) {
705
+ e.preventDefault();
706
+ first.focus();
707
+ }
708
+ };
709
+ useEffect(() => {
710
+ var _focusables$;
711
+ if (!isOpen) return;
712
+ const dialog = dialogRef.current;
713
+ if (!dialog) return;
714
+ ((_focusables$ = dialog.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])")[0]) !== null && _focusables$ !== void 0 ? _focusables$ : dialog).focus();
715
+ }, [isOpen, dialogRef]);
716
+ return /* @__PURE__ */ jsx("dialog", _objectSpread2(_objectSpread2({}, rest), {}, {
717
+ className: cn("kern-dialog", className),
718
+ ref: dialogRef,
719
+ onClick: handleOverlayClick,
720
+ onKeyDown: handleKeyDown,
721
+ open: isOpen,
722
+ "aria-labelledby": id,
723
+ "aria-modal": "true",
724
+ children: /* @__PURE__ */ jsx("form", {
725
+ method: "dialog",
726
+ className: "kern-dialog__form",
727
+ children
728
+ })
729
+ }));
730
+ };
731
+ DialogModal.displayName = "Dialog.Modal";
732
+
733
+ //#endregion
734
+ //#region src/components/Dialog/Root.tsx
735
+ const _excluded$65 = [
736
+ "disableOverlayClose",
737
+ "children",
738
+ "id"
739
+ ];
740
+ const DialogRoot = (_ref) => {
741
+ let { disableOverlayClose = false, children, id } = _ref, rest = _objectWithoutProperties(_ref, _excluded$65);
742
+ const [isOpen, setIsOpen] = useState(false);
743
+ const dialogRef = useRef(null);
744
+ const openDialog = () => {
745
+ var _dialogRef$current, _dialogRef$current$sh;
746
+ setIsOpen(true);
747
+ (_dialogRef$current = dialogRef.current) === null || _dialogRef$current === void 0 || (_dialogRef$current$sh = _dialogRef$current.showModal) === null || _dialogRef$current$sh === void 0 || _dialogRef$current$sh.call(_dialogRef$current);
748
+ };
749
+ const closeDialog = () => {
750
+ var _dialogRef$current2, _dialogRef$current2$c;
751
+ setIsOpen(false);
752
+ (_dialogRef$current2 = dialogRef.current) === null || _dialogRef$current2 === void 0 || (_dialogRef$current2$c = _dialogRef$current2.close) === null || _dialogRef$current2$c === void 0 || _dialogRef$current2$c.call(_dialogRef$current2);
753
+ };
754
+ const contextValue = {
755
+ isOpen,
756
+ openDialog,
757
+ closeDialog,
758
+ dialogRef,
759
+ disableOverlayClose,
760
+ id: id !== null && id !== void 0 ? id : "kern-modal"
761
+ };
762
+ return /* @__PURE__ */ jsx(DialogContext.Provider, {
763
+ value: contextValue,
764
+ children: /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, { children }))
765
+ });
766
+ };
767
+ DialogRoot.displayName = "Dialog.Root";
768
+
769
+ //#endregion
770
+ //#region src/components/Dialog/Trigger.tsx
771
+ const DialogTrigger = ({ children }) => {
772
+ const { openDialog } = useDialogContext();
773
+ if (React.isValidElement(children) && children.type === Button) {
774
+ var _children$props$class;
775
+ return React.cloneElement(children, {
776
+ onClick: (e) => {
777
+ if (children.props.onClick) children.props.onClick(e);
778
+ openDialog();
779
+ },
780
+ onKeyDown: (e) => {
781
+ if (children.props.onKeyDown) children.props.onKeyDown(e);
782
+ if (e.key === "Enter" || e.key === " ") {
783
+ e.preventDefault();
784
+ openDialog();
785
+ }
786
+ },
787
+ className: (_children$props$class = children.props.className) !== null && _children$props$class !== void 0 ? _children$props$class : ""
788
+ });
789
+ }
790
+ return /* @__PURE__ */ jsx("div", {
791
+ onClick: openDialog,
792
+ role: "button",
793
+ tabIndex: 0,
794
+ onKeyDown: (e) => {
795
+ if (e.key === "Enter" || e.key === " ") {
796
+ e.preventDefault();
797
+ openDialog();
798
+ }
799
+ },
800
+ children
801
+ });
802
+ };
803
+ DialogTrigger.displayName = "DialogTrigger";
804
+
805
+ //#endregion
806
+ //#region src/components/Dialog/index.ts
807
+ var Dialog_exports = /* @__PURE__ */ __export({
808
+ Button: () => DialogButton,
809
+ Content: () => DialogContent,
810
+ Footer: () => DialogFooter,
811
+ Header: () => DialogHeader,
812
+ Modal: () => DialogModal,
813
+ Root: () => DialogRoot,
814
+ Trigger: () => DialogTrigger
815
+ });
816
+
817
+ //#endregion
818
+ //#region src/components/Fieldset/Content.tsx
819
+ const FieldsetContent = ({ children, horizontal, className, style }) => /* @__PURE__ */ jsx("div", {
820
+ className: cn(`kern-fieldset__body${horizontal ? " kern-fieldset__body--horizontal" : ""}`, className),
821
+ style,
822
+ children
823
+ });
824
+ FieldsetContent.displayName = "Fieldset.Content";
825
+
826
+ //#endregion
827
+ //#region src/components/Fieldset/Error.tsx
828
+ const _excluded$64 = [
829
+ "children",
830
+ "className",
831
+ "id"
832
+ ];
833
+ const FieldsetError = (_ref) => {
834
+ let { children, className, id } = _ref, rest = _objectWithoutProperties(_ref, _excluded$64);
835
+ const errorId = id || `error-${Math.random().toString(36).substr(2, 9)}`;
836
+ return /* @__PURE__ */ jsxs("p", _objectSpread2(_objectSpread2({}, rest), {}, {
837
+ className: cn(`kern-error`, className),
838
+ id: errorId,
839
+ role: "alert",
840
+ children: [/* @__PURE__ */ jsx(Icon, {
841
+ name: "danger",
842
+ size: "default"
843
+ }), /* @__PURE__ */ jsx("span", {
844
+ className: "kern-body",
845
+ children
846
+ })]
847
+ }));
848
+ };
849
+ FieldsetError.displayName = "Fieldset.Error";
850
+
851
+ //#endregion
852
+ //#region src/components/Fieldset/Hint.tsx
853
+ const _excluded$63 = [
854
+ "children",
855
+ "className",
856
+ "id"
857
+ ];
858
+ const FieldsetHint = (_ref) => {
859
+ let { children, className, id } = _ref, rest = _objectWithoutProperties(_ref, _excluded$63);
860
+ const hintId = id || `hint-${Math.random().toString(36).substr(2, 9)}`;
861
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
862
+ className: cn(`kern-hint`, className),
863
+ id: hintId,
864
+ children
865
+ }));
866
+ };
867
+ FieldsetHint.displayName = "Fieldset.Hint";
868
+
869
+ //#endregion
870
+ //#region src/components/Fieldset/Legend.tsx
871
+ const _excluded$62 = ["children", "hasOptionalLabel"];
872
+ const FieldsetLegend = (_ref) => {
873
+ let { children, hasOptionalLabel } = _ref, rest = _objectWithoutProperties(_ref, _excluded$62);
874
+ return /* @__PURE__ */ jsxs("legend", _objectSpread2(_objectSpread2({}, rest), {}, {
875
+ className: cn(`kern-label`, rest.className),
876
+ children: [children, hasOptionalLabel && /* @__PURE__ */ jsx("span", {
877
+ className: "kern-label__optional",
878
+ children: "- Optional"
879
+ })]
880
+ }));
881
+ };
882
+ FieldsetLegend.displayName = "Fieldset.Legend";
883
+
884
+ //#endregion
885
+ //#region src/components/Input/Primitives/Checkbox/CheckboxInput.tsx
886
+ const _excluded$61 = ["erroneous", "required"];
887
+ const CheckboxInput$1 = forwardRef((_ref, ref) => {
888
+ let { erroneous = false, required } = _ref, rest = _objectWithoutProperties(_ref, _excluded$61);
889
+ return /* @__PURE__ */ jsx("input", _objectSpread2(_objectSpread2({}, rest), {}, {
890
+ ref,
891
+ type: "checkbox",
892
+ required,
893
+ className: cn("kern-form-check__checkbox", erroneous && "kern-form-check__checkbox--error", rest.className)
894
+ }));
895
+ });
896
+
897
+ //#endregion
898
+ //#region src/components/Input/Primitives/Email/EmailInput.tsx
899
+ const _excluded$60 = [
900
+ "erroneous",
901
+ "autoComplete",
902
+ "required"
903
+ ];
904
+ const EmailInput$1 = forwardRef((_ref, ref) => {
905
+ let { erroneous = false, autoComplete = "email", required } = _ref, rest = _objectWithoutProperties(_ref, _excluded$60);
906
+ return /* @__PURE__ */ jsx("input", _objectSpread2(_objectSpread2({}, rest), {}, {
907
+ ref,
908
+ required,
909
+ type: "email",
910
+ autoComplete,
911
+ className: cn("kern-form-input__input", erroneous && "kern-form-input__input--error", rest.className)
912
+ }));
913
+ });
914
+
915
+ //#endregion
916
+ //#region src/components/Input/Primitives/Error.tsx
917
+ const _excluded$59 = ["className", "message"];
918
+ const InputError = (_ref) => {
919
+ let { className, message } = _ref, props = _objectWithoutProperties(_ref, _excluded$59);
920
+ return /* @__PURE__ */ jsxs("p", _objectSpread2(_objectSpread2({
921
+ className: cn("kern-error", className),
922
+ role: "alert"
923
+ }, props), {}, { children: [/* @__PURE__ */ jsx(Icon, { name: "danger" }), /* @__PURE__ */ jsx("span", {
924
+ className: "kern-body",
925
+ children: message
926
+ })] }));
927
+ };
928
+
929
+ //#endregion
930
+ //#region src/components/Input/Primitives/File/FileInput.tsx
931
+ const _excluded$58 = [
932
+ "supportedFormats",
933
+ "erroneous",
934
+ "required"
935
+ ];
936
+ const FileInput$1 = forwardRef((_ref, ref) => {
937
+ var _rest$accept;
938
+ let { supportedFormats = [], erroneous = false, required } = _ref, rest = _objectWithoutProperties(_ref, _excluded$58);
939
+ return /* @__PURE__ */ jsx("input", _objectSpread2(_objectSpread2({}, rest), {}, {
940
+ ref,
941
+ type: "file",
942
+ required,
943
+ accept: (_rest$accept = rest.accept) !== null && _rest$accept !== void 0 ? _rest$accept : supportedFormats.join(","),
944
+ className: cn("kern-form-input__input", erroneous && "kern-form-input__input--error", rest.className)
945
+ }));
946
+ });
947
+
948
+ //#endregion
949
+ //#region src/components/Input/Primitives/Hint.tsx
950
+ const _excluded$57 = ["className", "children"];
951
+ const Hint = (_ref) => {
952
+ let { className, children } = _ref, props = _objectWithoutProperties(_ref, _excluded$57);
953
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({ className: cn("kern-hint", className) }, props), {}, { children }));
954
+ };
955
+
956
+ //#endregion
957
+ //#region src/components/Label/Label.tsx
958
+ const _excluded$56 = [
959
+ "variant",
960
+ "textWrapper",
961
+ "className",
962
+ "children",
963
+ "text"
964
+ ];
965
+ const Label = (_ref) => {
966
+ let { variant = "default", textWrapper = "label", className, children, text } = _ref, rest = _objectWithoutProperties(_ref, _excluded$56);
967
+ const Wrapper = textWrapper;
968
+ const labelClass = cn("kern-label", variant ? `kern-label--${variant}` : "", className, className);
969
+ return /* @__PURE__ */ jsx(Wrapper, _objectSpread2(_objectSpread2({ className: labelClass }, rest), {}, { children: text || children }));
970
+ };
971
+
972
+ //#endregion
973
+ //#region src/components/Input/Primitives/Label.tsx
974
+ const _excluded$55 = ["children", "isOptional"];
975
+ const Label$1 = (_ref) => {
976
+ let { children, isOptional } = _ref, props = _objectWithoutProperties(_ref, _excluded$55);
977
+ return /* @__PURE__ */ jsxs(Label, _objectSpread2(_objectSpread2({ textWrapper: "label" }, props), {}, { children: [children, isOptional && /* @__PURE__ */ jsx("span", {
978
+ className: "kern-label__optional",
979
+ children: "– Optional"
980
+ })] }));
981
+ };
982
+
983
+ //#endregion
984
+ //#region src/components/Input/Primitives/Password/PasswordInput.tsx
985
+ const _excluded$54 = [
986
+ "erroneous",
987
+ "required",
988
+ "autoComplete"
989
+ ];
990
+ const PasswordInput$1 = forwardRef((_ref, ref) => {
991
+ let { erroneous = false, required, autoComplete = "password" } = _ref, rest = _objectWithoutProperties(_ref, _excluded$54);
992
+ return /* @__PURE__ */ jsx("input", _objectSpread2(_objectSpread2({}, rest), {}, {
993
+ ref,
994
+ type: "password",
995
+ required,
996
+ autoComplete,
997
+ className: cn("kern-form-input__input", erroneous && "kern-form-input__input--error", rest.className)
998
+ }));
999
+ });
1000
+
1001
+ //#endregion
1002
+ //#region src/components/Input/Primitives/Radio/RadioInput.tsx
1003
+ const _excluded$53 = [
1004
+ "erroneous",
1005
+ "required",
1006
+ "autoComplete"
1007
+ ];
1008
+ const RadioInput$1 = forwardRef((_ref, ref) => {
1009
+ let { erroneous = false, required, autoComplete } = _ref, rest = _objectWithoutProperties(_ref, _excluded$53);
1010
+ return /* @__PURE__ */ jsx("input", _objectSpread2(_objectSpread2({}, rest), {}, {
1011
+ ref,
1012
+ type: "radio",
1013
+ required,
1014
+ autoComplete,
1015
+ className: cn("kern-form-check__radio", erroneous && "kern-form-check__radio--error", rest.className)
1016
+ }));
1017
+ });
1018
+
1019
+ //#endregion
1020
+ //#region src/components/Input/Primitives/Root.tsx
1021
+ const _excluded$52 = ["className", "erroneous"];
1022
+ const Root = (_ref) => {
1023
+ let { className, erroneous } = _ref, props = _objectWithoutProperties(_ref, _excluded$52);
1024
+ return /* @__PURE__ */ jsx("div", _objectSpread2({ className: cn("kern-form-input", erroneous && "kern-form-input--error", className) }, props));
1025
+ };
1026
+
1027
+ //#endregion
1028
+ //#region src/components/Input/Primitives/Select/SelectInput.tsx
1029
+ const _excluded$51 = [
1030
+ "erroneous",
1031
+ "required",
1032
+ "autoComplete",
1033
+ "options"
1034
+ ];
1035
+ const SelectInput$1 = forwardRef((_ref, ref) => {
1036
+ let { erroneous = false, required, autoComplete = "", options = [] } = _ref, rest = _objectWithoutProperties(_ref, _excluded$51);
1037
+ return /* @__PURE__ */ jsx("div", {
1038
+ className: "kern-form-input__select-wrapper",
1039
+ children: /* @__PURE__ */ jsx("select", _objectSpread2(_objectSpread2({}, rest), {}, {
1040
+ ref,
1041
+ className: cn("kern-form-input__select", erroneous && "kern-form-input__select--error", rest.className),
1042
+ required,
1043
+ autoComplete,
1044
+ children: options.map((option) => /* @__PURE__ */ jsx("option", {
1045
+ value: option.value,
1046
+ children: option.label
1047
+ }, option.value))
1048
+ }))
1049
+ });
1050
+ });
1051
+
1052
+ //#endregion
1053
+ //#region src/components/Input/Primitives/Tel/TelInput.tsx
1054
+ const _excluded$50 = ["erroneous", "required"];
1055
+ const TelInput$1 = forwardRef((_ref, ref) => {
1056
+ let { erroneous = false, required } = _ref, rest = _objectWithoutProperties(_ref, _excluded$50);
1057
+ return /* @__PURE__ */ jsx("input", _objectSpread2(_objectSpread2({}, rest), {}, {
1058
+ ref,
1059
+ required,
1060
+ type: "tel",
1061
+ autoComplete: "tel",
1062
+ "aria-describedby": rest["aria-describedby"],
1063
+ className: cn("kern-form-input__input", erroneous && "kern-form-input__input--error", rest.className)
1064
+ }));
1065
+ });
1066
+
1067
+ //#endregion
1068
+ //#region src/components/Input/Primitives/Text/TextInput.tsx
1069
+ const _excluded$49 = [
1070
+ "erroneous",
1071
+ "required",
1072
+ "autoComplete"
1073
+ ];
1074
+ const TextInput$1 = forwardRef((_ref, ref) => {
1075
+ let { erroneous = false, required, autoComplete } = _ref, rest = _objectWithoutProperties(_ref, _excluded$49);
1076
+ return /* @__PURE__ */ jsx("input", _objectSpread2(_objectSpread2({}, rest), {}, {
1077
+ ref,
1078
+ type: "text",
1079
+ className: cn("kern-form-input__input", erroneous && "kern-form-input__input--error", rest.className),
1080
+ required,
1081
+ autoComplete
1082
+ }));
1083
+ });
1084
+
1085
+ //#endregion
1086
+ //#region src/components/Input/Primitives/Textarea/TextareaInput.tsx
1087
+ const _excluded$48 = [
1088
+ "erroneous",
1089
+ "required",
1090
+ "autoComplete"
1091
+ ];
1092
+ const TextareaInput$1 = forwardRef((_ref, ref) => {
1093
+ let { erroneous = false, required, autoComplete } = _ref, rest = _objectWithoutProperties(_ref, _excluded$48);
1094
+ return /* @__PURE__ */ jsx("textarea", _objectSpread2(_objectSpread2({}, rest), {}, {
1095
+ ref,
1096
+ required,
1097
+ autoComplete,
1098
+ className: cn("kern-form-input__input", erroneous && "kern-form-input__input--error", rest.className)
1099
+ }));
1100
+ });
1101
+
1102
+ //#endregion
1103
+ //#region src/components/Input/Primitives/Url/UrlInput.tsx
1104
+ const _excluded$47 = [
1105
+ "erroneous",
1106
+ "required",
1107
+ "autoComplete"
1108
+ ];
1109
+ const UrlInput$1 = forwardRef((_ref, ref) => {
1110
+ let { erroneous = false, required, autoComplete = "url" } = _ref, rest = _objectWithoutProperties(_ref, _excluded$47);
1111
+ return /* @__PURE__ */ jsx("input", _objectSpread2(_objectSpread2({}, rest), {}, {
1112
+ required,
1113
+ autoComplete,
1114
+ ref,
1115
+ type: "url",
1116
+ "aria-describedby": rest["aria-describedby"],
1117
+ className: cn("kern-form-input__input", erroneous && "kern-form-input__input--error", rest.className)
1118
+ }));
1119
+ });
1120
+
1121
+ //#endregion
1122
+ //#region src/components/Input/Primitives/index.ts
1123
+ var Primitives_exports = /* @__PURE__ */ __export({
1124
+ Checkbox: () => CheckboxInput$1,
1125
+ Email: () => EmailInput$1,
1126
+ Error: () => InputError,
1127
+ File: () => FileInput$1,
1128
+ Hint: () => Hint,
1129
+ Label: () => Label$1,
1130
+ Password: () => PasswordInput$1,
1131
+ Radio: () => RadioInput$1,
1132
+ Root: () => Root,
1133
+ Select: () => SelectInput$1,
1134
+ Tel: () => TelInput$1,
1135
+ Text: () => TextInput$1,
1136
+ Textarea: () => TextareaInput$1,
1137
+ Url: () => UrlInput$1
1138
+ });
1139
+
1140
+ //#endregion
1141
+ //#region src/components/Input/Checkbox/index.tsx
1142
+ const _excluded$46 = [
1143
+ "id",
1144
+ "error",
1145
+ "disabled",
1146
+ "hasOptionalLabel",
1147
+ "label",
1148
+ "className",
1149
+ "style"
1150
+ ];
1151
+ const CheckboxInput = (_ref) => {
1152
+ let { id, error = false, disabled = false, hasOptionalLabel = false, label, className, style } = _ref, rest = _objectWithoutProperties(_ref, _excluded$46);
1153
+ const isErrorString = typeof error === "string";
1154
+ const errorId = `${id}-error`;
1155
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
1156
+ if (isErrorString) describedBy.push(errorId);
1157
+ return /* @__PURE__ */ jsxs("div", {
1158
+ className: cn("kern-form-check", isErrorString && "kern-form-check--error", className),
1159
+ style,
1160
+ children: [
1161
+ /* @__PURE__ */ jsx(CheckboxInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
1162
+ id,
1163
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
1164
+ erroneous: isErrorString ? true : error,
1165
+ disabled
1166
+ })),
1167
+ /* @__PURE__ */ jsx(Label$1, {
1168
+ htmlFor: id,
1169
+ isOptional: hasOptionalLabel,
1170
+ children: label
1171
+ }),
1172
+ isErrorString && /* @__PURE__ */ jsx(InputError, {
1173
+ id: errorId,
1174
+ message: error
1175
+ })
1176
+ ]
1177
+ });
1178
+ };
1179
+ CheckboxInput.isInteractive = true;
1180
+
1181
+ //#endregion
1182
+ //#region src/components/Fieldset/Root.tsx
1183
+ const FieldsetRoot = ({ children, id, className, style, error = false }) => {
1184
+ const countCheckboxes = (children$1) => {
1185
+ return React.Children.toArray(children$1).reduce((count, child) => {
1186
+ if (React.isValidElement(child)) {
1187
+ if (child.type === CheckboxInput) return count + 1;
1188
+ if (child.props && child.props.children) return count + countCheckboxes(child.props.children);
1189
+ }
1190
+ return count;
1191
+ }, 0);
1192
+ };
1193
+ const checkboxCount = countCheckboxes(children);
1194
+ const hintText = checkboxCount ? `${checkboxCount} Optionen verfügbar.` : "hint-text kern-input-error";
1195
+ return /* @__PURE__ */ jsx("fieldset", {
1196
+ className: cn(`kern-fieldset`, error && "kern-fieldset--error", className),
1197
+ style,
1198
+ id,
1199
+ role: "group",
1200
+ "aria-describedby": hintText,
1201
+ children
1202
+ });
1203
+ };
1204
+ FieldsetRoot.displayName = "Fieldset.Root";
1205
+
1206
+ //#endregion
1207
+ //#region src/components/Fieldset/index.ts
1208
+ var Fieldset_exports = /* @__PURE__ */ __export({
1209
+ Content: () => FieldsetContent,
1210
+ Error: () => FieldsetError,
1211
+ Hint: () => FieldsetHint,
1212
+ Legend: () => FieldsetLegend,
1213
+ Root: () => FieldsetRoot
1214
+ });
1215
+
1216
+ //#endregion
1217
+ //#region src/components/Grid/Column.tsx
1218
+ const _excluded$45 = [
1219
+ "children",
1220
+ "breakpoint",
1221
+ "width",
1222
+ "isOffset",
1223
+ "offsetWidth",
1224
+ "alignItem",
1225
+ "className"
1226
+ ];
1227
+ const GridColumn = (_ref) => {
1228
+ let { children, breakpoint, width, isOffset, offsetWidth, alignItem, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$45);
1229
+ const classes = cn(...[
1230
+ isOffset && offsetWidth && breakpoint && width ? `kern-col-${width + offsetWidth} kern-col-${breakpoint}-${width} kern-col-${breakpoint}-offset-${offsetWidth}` : breakpoint && width ? `kern-col-${breakpoint}-${width}` : width ? `kern-col-${width}` : "kern-col",
1231
+ alignItem ? `kern-align-self-${alignItem}` : "",
1232
+ className
1233
+ ]);
1234
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1235
+ className: classes,
1236
+ children
1237
+ }));
1238
+ };
1239
+ GridColumn.displayName = "Grid.Column";
1240
+
1241
+ //#endregion
1242
+ //#region src/components/Grid/Root.tsx
1243
+ const _excluded$44 = [
1244
+ "type",
1245
+ "className",
1246
+ "children"
1247
+ ];
1248
+ const GridRoot = (_ref) => {
1249
+ let { type, className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$44);
1250
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1251
+ className: cn(type ? `kern-container-${type}` : "kern-container", className),
1252
+ children
1253
+ }));
1254
+ };
1255
+ GridRoot.displayName = "Grid.Root";
1256
+
1257
+ //#endregion
1258
+ //#region src/components/Grid/Row.tsx
1259
+ const _excluded$43 = [
1260
+ "children",
1261
+ "alignItems",
1262
+ "horizontalAlignment",
1263
+ "className"
1264
+ ];
1265
+ const GridRow = (_ref) => {
1266
+ let { children, alignItems, horizontalAlignment, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$43);
1267
+ const rowClasses = cn("kern-row", alignItems && `kern-align-items-${alignItems}`, horizontalAlignment && `kern-justify-content-${horizontalAlignment}`, className);
1268
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1269
+ className: rowClasses,
1270
+ children
1271
+ }));
1272
+ };
1273
+ GridRow.displayName = "Grid.Row";
1274
+
1275
+ //#endregion
1276
+ //#region src/components/Grid/index.ts
1277
+ var Grid_exports = /* @__PURE__ */ __export({
1278
+ Column: () => GridColumn,
1279
+ Root: () => GridRoot,
1280
+ Row: () => GridRow
1281
+ });
1282
+
1283
+ //#endregion
1284
+ //#region src/components/Lists/Root.tsx
1285
+ const _excluded$42 = [
1286
+ "children",
1287
+ "className",
1288
+ "size",
1289
+ "type"
1290
+ ];
1291
+ const ListsRoot = (_ref) => {
1292
+ let { children, className, size = "default", type = "bullet" } = _ref, rest = _objectWithoutProperties(_ref, _excluded$42);
1293
+ const Component = type === "number" ? "ol" : "ul";
1294
+ const listClasses = cn("kern-list", size !== "default" && `kern-list--${size}`, type && `kern-list--${type}`, className);
1295
+ return /* @__PURE__ */ jsx(Component, _objectSpread2(_objectSpread2({}, rest), {}, {
1296
+ className: listClasses,
1297
+ children
1298
+ }));
1299
+ };
1300
+ ListsRoot.displayName = "Lists.Root";
1301
+
1302
+ //#endregion
1303
+ //#region src/components/Lists/Item.tsx
1304
+ const ListsItem = ({ children, text, className, style }) => /* @__PURE__ */ jsxs("li", {
1305
+ className,
1306
+ style,
1307
+ children: [React.Children.map(children, (child) => React.isValidElement(child) ? React.cloneElement(child, { style: _objectSpread2(_objectSpread2({}, style), child.props && child.props.style) }) : child), text && /* @__PURE__ */ jsx("span", { children: text })]
1308
+ });
1309
+ ListsItem.displayName = "Lists.Item";
1310
+
1311
+ //#endregion
1312
+ //#region src/components/Lists/Bullet.tsx
1313
+ const _excluded$41 = [
1314
+ "title",
1315
+ "items",
1316
+ "className"
1317
+ ];
1318
+ const ListsBullet = (_ref) => {
1319
+ let { title, items, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$41);
1320
+ return /* @__PURE__ */ jsxs("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1321
+ className: cn(className),
1322
+ children: [/* @__PURE__ */ jsx("div", {
1323
+ className: "kern-body kern-body--bold",
1324
+ children: title
1325
+ }), /* @__PURE__ */ jsx("ul", {
1326
+ className: "kern-list kern-list--bullet",
1327
+ children: items.map((item, index) => /* @__PURE__ */ jsx("li", { children: item }, index))
1328
+ })]
1329
+ }));
1330
+ };
1331
+ ListsBullet.displayName = "Lists.Bullet";
1332
+
1333
+ //#endregion
1334
+ //#region src/components/Lists/Number.tsx
1335
+ const _excluded$40 = [
1336
+ "children",
1337
+ "className",
1338
+ "size",
1339
+ "type"
1340
+ ];
1341
+ const ListsNumber = (_ref) => {
1342
+ let { children, className, size = "default", type } = _ref, rest = _objectWithoutProperties(_ref, _excluded$40);
1343
+ return /* @__PURE__ */ jsx("ol", _objectSpread2(_objectSpread2({}, rest), {}, {
1344
+ className: cn("kern-list", size && `kern-list--${size}`, type && `kern-list--${type}`, className),
1345
+ children
1346
+ }));
1347
+ };
1348
+ ListsNumber.displayName = "Lists.Number";
1349
+
1350
+ //#endregion
1351
+ //#region src/components/Lists/index.ts
1352
+ var Lists_exports = /* @__PURE__ */ __export({
1353
+ Bullet: () => ListsBullet,
1354
+ Item: () => ListsItem,
1355
+ Number: () => ListsNumber,
1356
+ Root: () => ListsRoot
1357
+ });
1358
+
1359
+ //#endregion
1360
+ //#region src/components/Progress/Root.tsx
1361
+ const _excluded$39 = [
1362
+ "value",
1363
+ "max",
1364
+ "className",
1365
+ "children",
1366
+ "progressId"
1367
+ ];
1368
+ const ProgressContext = React.createContext(null);
1369
+ const useProgressContext = () => {
1370
+ const context = React.useContext(ProgressContext);
1371
+ if (!context) throw new Error("Progress subcomponents must be used within Progress.Root");
1372
+ return context;
1373
+ };
1374
+ const ProgressRoot = (_ref) => {
1375
+ let { value = 0, max = 100, className, children, progressId: propProgressId } = _ref, rest = _objectWithoutProperties(_ref, _excluded$39);
1376
+ const percentage = Math.round(value / max * 100);
1377
+ const progressId = React.useMemo(() => propProgressId || `progress-${Math.random().toString(36).slice(2, 11)}`, [propProgressId]);
1378
+ const contextValue = {
1379
+ value,
1380
+ max,
1381
+ percentage,
1382
+ progressId
1383
+ };
1384
+ return /* @__PURE__ */ jsx(ProgressContext.Provider, {
1385
+ value: contextValue,
1386
+ children: /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1387
+ className: cn("kern-progress", className),
1388
+ children
1389
+ }))
1390
+ });
1391
+ };
1392
+ ProgressRoot.displayName = "Progress.Root";
1393
+
1394
+ //#endregion
1395
+ //#region src/components/Progress/Bar.tsx
1396
+ const _excluded$38 = ["className", "aria-label"];
1397
+ const ProgressBar = (_ref) => {
1398
+ let { className, "aria-label": ariaLabel } = _ref, rest = _objectWithoutProperties(_ref, _excluded$38);
1399
+ const { value, max, progressId } = useProgressContext();
1400
+ return /* @__PURE__ */ jsx("progress", _objectSpread2(_objectSpread2({}, rest), {}, {
1401
+ id: progressId,
1402
+ value,
1403
+ "aria-label": ariaLabel || `Progress: ${value.toString()}%`,
1404
+ max,
1405
+ className
1406
+ }));
1407
+ };
1408
+ ProgressBar.displayName = "Progress.Bar";
1409
+
1410
+ //#endregion
1411
+ //#region src/components/Progress/Cancel.tsx
1412
+ const _excluded$37 = ["children", "onCancel"];
1413
+ const ProgressCancel = (_ref) => {
1414
+ let { children = "Abbrechen", onCancel } = _ref, rest = _objectWithoutProperties(_ref, _excluded$37);
1415
+ return /* @__PURE__ */ jsx(Button, _objectSpread2(_objectSpread2({}, rest), {}, {
1416
+ variant: "tertiary",
1417
+ text: typeof children === "string" ? children : void 0,
1418
+ icon: {
1419
+ name: "close",
1420
+ size: "small"
1421
+ },
1422
+ iconLeft: true,
1423
+ onClick: onCancel,
1424
+ children: typeof children !== "string" ? children : void 0
1425
+ }));
1426
+ };
1427
+ ProgressCancel.displayName = "Progress.Cancel";
1428
+
1429
+ //#endregion
1430
+ //#region src/components/Progress/Header.tsx
1431
+ const ProgressHeader = ({ className, style, children }) => {
1432
+ return /* @__PURE__ */ jsx("div", {
1433
+ className: cn("kern-progress__header", className),
1434
+ style: _objectSpread2({
1435
+ display: "flex",
1436
+ width: "100%",
1437
+ justifyContent: "space-between",
1438
+ alignItems: "center"
1439
+ }, style),
1440
+ children
1441
+ });
1442
+ };
1443
+ ProgressHeader.displayName = "Progress.Header";
1444
+
1445
+ //#endregion
1446
+ //#region src/components/Progress/Label.tsx
1447
+ const _excluded$36 = ["className", "children"];
1448
+ const ProgressLabel = (_ref) => {
1449
+ let { className, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$36);
1450
+ const { progressId } = useProgressContext();
1451
+ return /* @__PURE__ */ jsx("label", _objectSpread2(_objectSpread2({}, rest), {}, {
1452
+ className: cn("kern-label", className),
1453
+ htmlFor: progressId,
1454
+ children
1455
+ }));
1456
+ };
1457
+ ProgressLabel.displayName = "Progress.Label";
1458
+
1459
+ //#endregion
1460
+ //#region src/components/Progress/Percentage.tsx
1461
+ const ProgressPercentage = ({ className, style, formatter }) => {
1462
+ const { percentage } = useProgressContext();
1463
+ const displayText = formatter ? formatter(percentage) : `${percentage}%`;
1464
+ return /* @__PURE__ */ jsx("span", {
1465
+ className: cn("kern-body--small", className),
1466
+ style: _objectSpread2({ color: "var(--kern-color-layout-text-muted, #404565)" }, style),
1467
+ children: displayText
1468
+ });
1469
+ };
1470
+ ProgressPercentage.displayName = "Progress.Percentage";
1471
+
1472
+ //#endregion
1473
+ //#region src/components/Progress/index.ts
1474
+ var Progress_exports = /* @__PURE__ */ __export({
1475
+ Bar: () => ProgressBar,
1476
+ Cancel: () => ProgressCancel,
1477
+ Header: () => ProgressHeader,
1478
+ Label: () => ProgressLabel,
1479
+ Percentage: () => ProgressPercentage,
1480
+ Root: () => ProgressRoot
1481
+ });
1482
+
1483
+ //#endregion
1484
+ //#region src/components/Summary/Heading.tsx
1485
+ const _excluded$35 = [
1486
+ "title",
1487
+ "number",
1488
+ "className"
1489
+ ];
1490
+ const SummaryHeading = (_ref) => {
1491
+ var _useContext;
1492
+ let { title, number, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$35);
1493
+ const headingID = (_useContext = useContext(SummaryContext)) === null || _useContext === void 0 ? void 0 : _useContext.headingID;
1494
+ return /* @__PURE__ */ jsxs("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1495
+ className: cn("kern-summary__header", className),
1496
+ children: [number && /* @__PURE__ */ jsx("span", {
1497
+ className: "kern-number",
1498
+ children: number
1499
+ }), title && /* @__PURE__ */ jsx(Title, _objectSpread2(_objectSpread2({}, title), {}, { id: headingID }))]
1500
+ }));
1501
+ };
1502
+ SummaryHeading.displayName = "Summary.Heading";
1503
+
1504
+ //#endregion
1505
+ //#region src/components/Summary/Root.tsx
1506
+ const _excluded$34 = [
1507
+ "variant",
1508
+ "headingID",
1509
+ "children",
1510
+ "className",
1511
+ "style"
1512
+ ];
1513
+ const SummaryContext = React.createContext(null);
1514
+ const useSummaryContext = () => {
1515
+ const context = React.useContext(SummaryContext);
1516
+ if (!context) throw new Error("Summary subcomponents must be used within Summary.Root");
1517
+ return context;
1518
+ };
1519
+ const SummaryRoot = (_ref) => {
1520
+ let { variant = "row", headingID, children, className = "", style = {} } = _ref, rest = _objectWithoutProperties(_ref, _excluded$34);
1521
+ if (!React.Children.toArray(children).some((child) => React.isValidElement(child) && child.type === SummaryHeading)) throw new Error("Summary requires a Summary.Heading subcomponent.");
1522
+ const contextValue = { headingID };
1523
+ const summaryClass = cn("kern-summary", variant === "column" && "kern-description-list--col", className);
1524
+ return /* @__PURE__ */ jsx(SummaryContext.Provider, {
1525
+ value: contextValue,
1526
+ children: /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1527
+ className: summaryClass,
1528
+ style,
1529
+ children
1530
+ }))
1531
+ });
1532
+ };
1533
+ SummaryRoot.displayName = "Summary.Root";
1534
+
1535
+ //#endregion
1536
+ //#region src/components/Summary/Actions.tsx
1537
+ const _excluded$33 = ["children", "className"];
1538
+ const SummaryActions = (_ref) => {
1539
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$33);
1540
+ const headingID = useSummaryContext().headingID;
1541
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1542
+ className: cn("kern-summary__actions", className),
1543
+ children: React.Children.map(children, (child) => React.isValidElement(child) ? React.cloneElement(child, { "aria-describedBy": headingID }) : child)
1544
+ }));
1545
+ };
1546
+ SummaryActions.displayName = "Summary.Actions";
1547
+
1548
+ //#endregion
1549
+ //#region src/components/Summary/Body.tsx
1550
+ const _excluded$32 = ["children", "className"];
1551
+ const SummaryBody = (_ref) => {
1552
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$32);
1553
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1554
+ className: cn("kern-summary__body", className),
1555
+ children
1556
+ }));
1557
+ };
1558
+ SummaryBody.displayName = "Summary.Body";
1559
+
1560
+ //#endregion
1561
+ //#region src/components/Summary/Group.tsx
1562
+ const _excluded$31 = ["children", "className"];
1563
+ const SummaryGroup = (_ref) => {
1564
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$31);
1565
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1566
+ className: cn("kern-summary-group", className),
1567
+ children
1568
+ }));
1569
+ };
1570
+ SummaryGroup.displayName = "Summary.Group";
1571
+
1572
+ //#endregion
1573
+ //#region src/components/Heading/Heading.tsx
1574
+ const _excluded$30 = [
1575
+ "className",
1576
+ "headerElement",
1577
+ "type",
1578
+ "title",
1579
+ "children"
1580
+ ];
1581
+ const Heading = (_ref) => {
1582
+ let { className, headerElement = "h1", type, title, children } = _ref, rest = _objectWithoutProperties(_ref, _excluded$30);
1583
+ const Wrapper = headerElement;
1584
+ const headingClass = cn(`kern-heading-${type}`, className);
1585
+ return /* @__PURE__ */ jsx(Wrapper, _objectSpread2(_objectSpread2({}, rest), {}, {
1586
+ className: headingClass,
1587
+ children: children || title
1588
+ }));
1589
+ };
1590
+
1591
+ //#endregion
1592
+ //#region src/components/Summary/GroupHeading.tsx
1593
+ const _excluded$29 = ["heading", "className"];
1594
+ const SummaryGroupHeading = (_ref) => {
1595
+ let { heading, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$29);
1596
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1597
+ className: cn("kern-summary-group__header", className),
1598
+ children: /* @__PURE__ */ jsx(Heading, _objectSpread2({}, heading))
1599
+ }));
1600
+ };
1601
+ SummaryGroupHeading.displayName = "Summary.GroupHeading";
1602
+
1603
+ //#endregion
1604
+ //#region src/components/Summary/index.ts
1605
+ var Summary_exports = /* @__PURE__ */ __export({
1606
+ Actions: () => SummaryActions,
1607
+ Body: () => SummaryBody,
1608
+ Group: () => SummaryGroup,
1609
+ GroupHeading: () => SummaryGroupHeading,
1610
+ Heading: () => SummaryHeading,
1611
+ Root: () => SummaryRoot
1612
+ });
1613
+
1614
+ //#endregion
1615
+ //#region src/components/Table/Body.tsx
1616
+ const _excluded$28 = ["children", "className"];
1617
+ const TableBody = (_ref) => {
1618
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$28);
1619
+ return /* @__PURE__ */ jsx("tbody", _objectSpread2(_objectSpread2({}, rest), {}, {
1620
+ className: cn("kern-table__body", className),
1621
+ children
1622
+ }));
1623
+ };
1624
+ TableBody.displayName = "Table.Body";
1625
+
1626
+ //#endregion
1627
+ //#region src/components/Table/Cell.tsx
1628
+ const _excluded$27 = [
1629
+ "numeric",
1630
+ "children",
1631
+ "className"
1632
+ ];
1633
+ const TableCell = (_ref) => {
1634
+ let { numeric, children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$27);
1635
+ const cellClasses = cn("kern-table__cell", numeric ? "kern-table__cell--numeric" : "", className);
1636
+ return /* @__PURE__ */ jsx("td", _objectSpread2(_objectSpread2({}, rest), {}, {
1637
+ className: cellClasses,
1638
+ children
1639
+ }));
1640
+ };
1641
+ TableCell.displayName = "Table.Cell";
1642
+
1643
+ //#endregion
1644
+ //#region src/components/Table/Column.tsx
1645
+ const _excluded$26 = [
1646
+ "numeric",
1647
+ "scope",
1648
+ "children",
1649
+ "className"
1650
+ ];
1651
+ const TableColumn = (_ref) => {
1652
+ let { numeric, scope, children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$26);
1653
+ const columnClasses = cn("kern-table__header", numeric ? "kern-table__header--numeric" : "", className);
1654
+ return /* @__PURE__ */ jsx("th", _objectSpread2(_objectSpread2({}, rest), {}, {
1655
+ scope,
1656
+ className: columnClasses,
1657
+ children
1658
+ }));
1659
+ };
1660
+ TableColumn.displayName = "Table.Column";
1661
+
1662
+ //#endregion
1663
+ //#region src/components/Table/Footer.tsx
1664
+ const _excluded$25 = ["children", "className"];
1665
+ const TableFooter = (_ref) => {
1666
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$25);
1667
+ return /* @__PURE__ */ jsx("tfoot", _objectSpread2(_objectSpread2({}, rest), {}, {
1668
+ className: cn("kern-table__footer", className),
1669
+ children
1670
+ }));
1671
+ };
1672
+ TableFooter.displayName = "Table.Footer";
1673
+
1674
+ //#endregion
1675
+ //#region src/components/Table/Header.tsx
1676
+ const _excluded$24 = ["children", "className"];
1677
+ const TableHeader = (_ref) => {
1678
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$24);
1679
+ return /* @__PURE__ */ jsx("thead", _objectSpread2(_objectSpread2({}, rest), {}, {
1680
+ className: cn("kern-table__head", className),
1681
+ children
1682
+ }));
1683
+ };
1684
+ TableHeader.displayName = "Table.Header";
1685
+
1686
+ //#endregion
1687
+ //#region src/components/Table/Root.tsx
1688
+ const _excluded$23 = [
1689
+ "caption",
1690
+ "striped",
1691
+ "responsive",
1692
+ "variant",
1693
+ "children",
1694
+ "className"
1695
+ ];
1696
+ const TableRoot = (_ref) => {
1697
+ let { caption = "", striped = false, responsive = false, variant = "default", children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$23);
1698
+ const captionId = useId();
1699
+ const tableClasses = cn("kern-table", striped ? "kern-table--striped" : "", variant === "small" ? "kern-table--small" : "", className);
1700
+ const table = /* @__PURE__ */ jsxs("table", _objectSpread2(_objectSpread2({}, rest), {}, {
1701
+ className: tableClasses,
1702
+ "aria-describedby": caption ? captionId : void 0,
1703
+ children: [caption && /* @__PURE__ */ jsx("caption", {
1704
+ id: captionId,
1705
+ className: "kern-title",
1706
+ children: caption
1707
+ }), children]
1708
+ }));
1709
+ return responsive ? /* @__PURE__ */ jsx("div", {
1710
+ className: "kern-table-responsive",
1711
+ tabIndex: 0,
1712
+ children: table
1713
+ }) : table;
1714
+ };
1715
+ TableRoot.displayName = "Table.Root";
1716
+
1717
+ //#endregion
1718
+ //#region src/components/Table/Row.tsx
1719
+ const _excluded$22 = ["children", "className"];
1720
+ const TableRow = (_ref) => {
1721
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$22);
1722
+ return /* @__PURE__ */ jsx("tr", _objectSpread2(_objectSpread2({}, rest), {}, {
1723
+ className: cn("kern-table__row", className),
1724
+ children
1725
+ }));
1726
+ };
1727
+ TableRow.displayName = "Table.Row";
1728
+
1729
+ //#endregion
1730
+ //#region src/components/Table/index.ts
1731
+ var Table_exports = /* @__PURE__ */ __export({
1732
+ Body: () => TableBody,
1733
+ Cell: () => TableCell,
1734
+ Column: () => TableColumn,
1735
+ Footer: () => TableFooter,
1736
+ Header: () => TableHeader,
1737
+ Root: () => TableRoot,
1738
+ Row: () => TableRow
1739
+ });
1740
+
1741
+ //#endregion
1742
+ //#region src/components/TaskList/Item.tsx
1743
+ const TaskListItem = ({ number, title, href, asParagraph = false, status, statusLabel, titleId, statusId, stretchedLink = true, className = "", style = {} }) => {
1744
+ const linkClasses = cn("kern-link", stretchedLink && "kern-link--stretched");
1745
+ const isInteractive = !!href && !asParagraph;
1746
+ const isNonInteractive = asParagraph || !href;
1747
+ const describedBy = status && statusId ? statusId : void 0;
1748
+ return /* @__PURE__ */ jsxs("li", {
1749
+ className: cn("kern-task-list__item", className),
1750
+ style,
1751
+ tabIndex: isNonInteractive ? -1 : void 0,
1752
+ "data-noninteractive": isNonInteractive ? "true" : void 0,
1753
+ onMouseDown: isNonInteractive ? (e) => e.currentTarget.focus() : void 0,
1754
+ children: [number !== void 0 && number !== null ? /* @__PURE__ */ jsx("span", {
1755
+ className: "kern-number",
1756
+ children: number
1757
+ }) : null, /* @__PURE__ */ jsxs("div", {
1758
+ className: "kern-task-list__title",
1759
+ id: titleId,
1760
+ children: [asParagraph ? /* @__PURE__ */ jsx("p", {
1761
+ className: "kern-body",
1762
+ "aria-describedby": describedBy,
1763
+ onMouseDown: (e) => e.currentTarget.focus(),
1764
+ children: title
1765
+ }) : isInteractive ? /* @__PURE__ */ jsx("a", {
1766
+ href,
1767
+ className: linkClasses,
1768
+ "aria-describedby": describedBy,
1769
+ children: title
1770
+ }) : /* @__PURE__ */ jsx("span", {
1771
+ className: "kern-link",
1772
+ "aria-describedby": describedBy,
1773
+ tabIndex: -1,
1774
+ "data-noninteractive": "true",
1775
+ onMouseDown: (e) => e.currentTarget.focus(),
1776
+ children: title
1777
+ }), status && statusLabel ? /* @__PURE__ */ jsx("div", {
1778
+ className: "kern-task-list__status",
1779
+ id: statusId,
1780
+ children: /* @__PURE__ */ jsxs("span", {
1781
+ className: cn("kern-badge", `kern-badge--${status}`),
1782
+ children: [status === "success" && /* @__PURE__ */ jsx("span", {
1783
+ className: cn("kern-icon", "kern-icon--success", "kern-icon--sm"),
1784
+ "aria-hidden": "true"
1785
+ }), /* @__PURE__ */ jsx("span", {
1786
+ className: "kern-label kern-label--small",
1787
+ children: statusLabel
1788
+ })]
1789
+ })
1790
+ }) : null]
1791
+ })]
1792
+ });
1793
+ };
1794
+ TaskListItem.displayName = "TaskList.Item";
1795
+
1796
+ //#endregion
1797
+ //#region src/components/TaskList/List.tsx
1798
+ const _excluded$21 = [
1799
+ "children",
1800
+ "items",
1801
+ "className",
1802
+ "style"
1803
+ ];
1804
+ const TaskList$1 = (_ref) => {
1805
+ let { children, items, className, style } = _ref, rest = _objectWithoutProperties(_ref, _excluded$21);
1806
+ const listRef = useRef(null);
1807
+ const onKeyDown = useCallback((e) => {
1808
+ var _ref2, _list$closest;
1809
+ const list = listRef.current;
1810
+ if (!list) return;
1811
+ const boundary = (_ref2 = (_list$closest = list.closest("[data-tasklist-group]")) !== null && _list$closest !== void 0 ? _list$closest : list.closest("[data-tasklist-root]")) !== null && _ref2 !== void 0 ? _ref2 : list;
1812
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
1813
+ const nonInteractive = Array.from(boundary.querySelectorAll("li[data-noninteractive=\"true\"]"));
1814
+ if (!nonInteractive.length) return;
1815
+ const target = document.activeElement || e.target;
1816
+ const currentIndex = nonInteractive.findIndex((el) => el === target || el.contains(target));
1817
+ if (currentIndex === -1) {
1818
+ e.preventDefault();
1819
+ if (e.key === "ArrowDown") {
1820
+ const nextEl = nonInteractive.find((el) => !!(target.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING));
1821
+ (nextEl !== null && nextEl !== void 0 ? nextEl : nonInteractive[0]).focus();
1822
+ } else {
1823
+ var _prevEl;
1824
+ let prevEl;
1825
+ for (let i = nonInteractive.length - 1; i >= 0; i--) {
1826
+ const el = nonInteractive[i];
1827
+ if (target.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING) {
1828
+ prevEl = el;
1829
+ break;
1830
+ }
1831
+ }
1832
+ ((_prevEl = prevEl) !== null && _prevEl !== void 0 ? _prevEl : nonInteractive[nonInteractive.length - 1]).focus();
1833
+ }
1834
+ return;
1835
+ }
1836
+ e.preventDefault();
1837
+ const dir = e.key === "ArrowDown" ? 1 : -1;
1838
+ const nextIndex = (currentIndex + dir + nonInteractive.length) % nonInteractive.length;
1839
+ nonInteractive[nextIndex].focus();
1840
+ return;
1841
+ }
1842
+ }, []);
1843
+ return /* @__PURE__ */ jsx("ul", _objectSpread2(_objectSpread2({}, rest), {}, {
1844
+ ref: listRef,
1845
+ onKeyDown,
1846
+ className: cn("kern-task-list__list", className),
1847
+ style,
1848
+ children: items ? items.map((rest$1, i) => /* @__PURE__ */ jsx(TaskListItem, _objectSpread2({}, rest$1), i)) : children
1849
+ }));
1850
+ };
1851
+ TaskList$1.displayName = "TaskList.List";
1852
+
1853
+ //#endregion
1854
+ //#region src/components/TaskList/Group.tsx
1855
+ const _excluded$20 = [
1856
+ "children",
1857
+ "className",
1858
+ "style"
1859
+ ];
1860
+ const TaskListGroup = (_ref) => {
1861
+ let { children, className, style } = _ref, rest = _objectWithoutProperties(_ref, _excluded$20);
1862
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1863
+ "data-tasklist-group": true,
1864
+ className: cn("kern-task-list-group", className),
1865
+ style,
1866
+ children
1867
+ }));
1868
+ };
1869
+ TaskListGroup.displayName = "TaskList.Group";
1870
+
1871
+ //#endregion
1872
+ //#region src/components/TaskList/Heading.tsx
1873
+ const TaskListHeading = ({ title, type = "medium", headerElement = "h2", className = "", style = {} }) => /* @__PURE__ */ jsx("div", {
1874
+ className: cn("kern-task-list__header", className),
1875
+ style,
1876
+ children: /* @__PURE__ */ jsx(Heading, {
1877
+ headerElement,
1878
+ type,
1879
+ title
1880
+ })
1881
+ });
1882
+ TaskListHeading.displayName = "TaskList.Heading";
1883
+
1884
+ //#endregion
1885
+ //#region src/components/TaskList/Root.tsx
1886
+ const _excluded$19 = ["children", "className"];
1887
+ const TaskListRoot = (_ref) => {
1888
+ let { children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$19);
1889
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
1890
+ className: cn("kern-task-list", className),
1891
+ children
1892
+ }));
1893
+ };
1894
+ TaskListRoot.displayName = "TaskList.Root";
1895
+
1896
+ //#endregion
1897
+ //#region src/components/TaskList/index.ts
1898
+ var TaskList_exports = /* @__PURE__ */ __export({
1899
+ Group: () => TaskListGroup,
1900
+ Heading: () => TaskListHeading,
1901
+ Item: () => TaskListItem,
1902
+ List: () => TaskList$1,
1903
+ Root: () => TaskListRoot
1904
+ });
1905
+
1906
+ //#endregion
1907
+ //#region src/components/Badge/Badge.tsx
1908
+ const _excluded$18 = [
1909
+ "title",
1910
+ "variant",
1911
+ "className",
1912
+ "icon",
1913
+ "showIcon"
1914
+ ];
1915
+ const Badge = (_ref) => {
1916
+ let { title, variant, className, icon, showIcon = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$18);
1917
+ return /* @__PURE__ */ jsxs("span", _objectSpread2(_objectSpread2({}, rest), {}, {
1918
+ role: "status",
1919
+ className: cn(`kern-badge kern-badge--${variant}`, className),
1920
+ children: [showIcon && /* @__PURE__ */ jsx(Icon, _objectSpread2(_objectSpread2({}, icon), {}, {
1921
+ "aria-hidden": true,
1922
+ name: variant
1923
+ })), /* @__PURE__ */ jsxs("span", {
1924
+ className: "kern-label kern-label-small",
1925
+ children: [/* @__PURE__ */ jsx("span", {
1926
+ className: "kern-label kern-sr-only",
1927
+ children: variant.replace(/^./, (c) => c.toUpperCase())
1928
+ }), title]
1929
+ })]
1930
+ }));
1931
+ };
1932
+
1933
+ //#endregion
1934
+ //#region src/components/Body/Body.tsx
1935
+ const _excluded$17 = [
1936
+ "isBold",
1937
+ "isMuted",
1938
+ "size",
1939
+ "children",
1940
+ "text",
1941
+ "className"
1942
+ ];
1943
+ const Body = (_ref) => {
1944
+ let { isBold, isMuted, size, children, text, className } = _ref, restProps = _objectWithoutProperties(_ref, _excluded$17);
1945
+ const textClasses = cn("kern-body", size && `kern-body--${size}`, isBold && "kern-body--bold", isMuted && "kern-body--muted", className);
1946
+ return /* @__PURE__ */ jsx("p", _objectSpread2(_objectSpread2({ className: textClasses }, restProps), {}, { children: children || text }));
1947
+ };
1948
+
1949
+ //#endregion
1950
+ //#region src/components/Divider/Divider.tsx
1951
+ const _excluded$16 = ["className"];
1952
+ const Divider = (_ref) => {
1953
+ let { className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$16);
1954
+ return /* @__PURE__ */ jsx("hr", _objectSpread2(_objectSpread2({}, rest), {}, {
1955
+ className: cn("kern-divider", className),
1956
+ "aria-hidden": "true"
1957
+ }));
1958
+ };
1959
+
1960
+ //#endregion
1961
+ //#region src/components/Input/Date/index.tsx
1962
+ const _excluded$15 = [
1963
+ "id",
1964
+ "error",
1965
+ "label",
1966
+ "dateType",
1967
+ "hasOptionalLabel"
1968
+ ];
1969
+ const dateInputClassNames = {
1970
+ day: "kern-form-input__input--width-2",
1971
+ month: "kern-form-input__input--width-2",
1972
+ year: "kern-form-input__input--width-4"
1973
+ };
1974
+ const DateInput = (_ref) => {
1975
+ let { id, error = false, label, dateType, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$15);
1976
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
1977
+ return /* @__PURE__ */ jsxs(Root, {
1978
+ erroneous: false,
1979
+ children: [/* @__PURE__ */ jsx(Label$1, {
1980
+ htmlFor: id,
1981
+ isOptional: hasOptionalLabel,
1982
+ children: label
1983
+ }), /* @__PURE__ */ jsx(TextInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
1984
+ className: dateInputClassNames[dateType],
1985
+ id,
1986
+ inputMode: "numeric",
1987
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
1988
+ erroneous: error
1989
+ }))]
1990
+ });
1991
+ };
1992
+ DateInput.isInteractive = true;
1993
+
1994
+ //#endregion
1995
+ //#region src/components/Input/Email/index.tsx
1996
+ const _excluded$14 = [
1997
+ "id",
1998
+ "error",
1999
+ "hintText",
2000
+ "label",
2001
+ "hasOptionalLabel"
2002
+ ];
2003
+ const EmailInput = (_ref) => {
2004
+ let { id, error = false, hintText, label, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$14);
2005
+ const errorId = `${id}-error`;
2006
+ const hintId = `${id}-hint`;
2007
+ const isErrorString = typeof error === "string";
2008
+ const hasHint = Boolean(hintText);
2009
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
2010
+ if (isErrorString) describedBy.push(errorId);
2011
+ if (hasHint) describedBy.push(hintId);
2012
+ return /* @__PURE__ */ jsxs(Root, {
2013
+ erroneous: isErrorString,
2014
+ children: [
2015
+ /* @__PURE__ */ jsx(Label$1, {
2016
+ htmlFor: id,
2017
+ isOptional: hasOptionalLabel,
2018
+ children: label
2019
+ }),
2020
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2021
+ id: hintId,
2022
+ children: hintText
2023
+ }),
2024
+ /* @__PURE__ */ jsx(EmailInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2025
+ id,
2026
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2027
+ erroneous: isErrorString ? true : error
2028
+ })),
2029
+ isErrorString && /* @__PURE__ */ jsx(InputError, {
2030
+ id: errorId,
2031
+ message: error
2032
+ })
2033
+ ]
2034
+ });
2035
+ };
2036
+ EmailInput.isInteractive = true;
2037
+
2038
+ //#endregion
2039
+ //#region src/components/Input/File/index.tsx
2040
+ const _excluded$13 = [
2041
+ "id",
2042
+ "errorMessage",
2043
+ "hintText",
2044
+ "title",
2045
+ "supportedFormats",
2046
+ "hasOptionalLabel"
2047
+ ];
2048
+ const FileInput = (_ref) => {
2049
+ let { id, errorMessage, hintText, title, supportedFormats, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$13);
2050
+ const errorId = `${id}-error`;
2051
+ const hintId = `${id}-hint`;
2052
+ const erroneous = Boolean(errorMessage);
2053
+ const hasHint = Boolean(hintText) || supportedFormats && supportedFormats.length > 0;
2054
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
2055
+ if (errorMessage) describedBy.push(errorId);
2056
+ if (hasHint) describedBy.push(hintId);
2057
+ return /* @__PURE__ */ jsxs(Root, {
2058
+ erroneous,
2059
+ children: [
2060
+ /* @__PURE__ */ jsx(Label$1, {
2061
+ htmlFor: id,
2062
+ isOptional: hasOptionalLabel,
2063
+ children: title
2064
+ }),
2065
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2066
+ id: hintId,
2067
+ children: hintText || `Erlaubte Formate: ${supportedFormats.join(", ")}`
2068
+ }),
2069
+ /* @__PURE__ */ jsx(FileInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2070
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2071
+ erroneous,
2072
+ supportedFormats
2073
+ })),
2074
+ errorMessage && /* @__PURE__ */ jsx(InputError, {
2075
+ id: errorId,
2076
+ message: errorMessage
2077
+ })
2078
+ ]
2079
+ });
2080
+ };
2081
+ FileInput.isInteractive = true;
2082
+
2083
+ //#endregion
2084
+ //#region src/components/Input/Number/index.tsx
2085
+ const _excluded$12 = [
2086
+ "id",
2087
+ "error",
2088
+ "hintText",
2089
+ "label",
2090
+ "hasOptionalLabel"
2091
+ ];
2092
+ const NumberInput = (_ref) => {
2093
+ let { id, error = false, hintText, label, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$12);
2094
+ const errorId = `${id}-error`;
2095
+ const hintId = `${id}-hint`;
2096
+ const isErrorString = typeof error === "string";
2097
+ const hasHint = Boolean(hintText);
2098
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
2099
+ if (isErrorString) describedBy.push(errorId);
2100
+ if (hasHint) describedBy.push(hintId);
2101
+ return /* @__PURE__ */ jsxs(Root, {
2102
+ erroneous: isErrorString,
2103
+ children: [
2104
+ /* @__PURE__ */ jsx(Label$1, {
2105
+ htmlFor: id,
2106
+ isOptional: hasOptionalLabel,
2107
+ children: label
2108
+ }),
2109
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2110
+ id: hintId,
2111
+ children: hintText
2112
+ }),
2113
+ /* @__PURE__ */ jsx(TextInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2114
+ id,
2115
+ inputMode: "numeric",
2116
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2117
+ erroneous: isErrorString ? true : error
2118
+ })),
2119
+ isErrorString && /* @__PURE__ */ jsx(InputError, {
2120
+ id: errorId,
2121
+ message: error
2122
+ })
2123
+ ]
2124
+ });
2125
+ };
2126
+ NumberInput.isInteractive = true;
2127
+
2128
+ //#endregion
2129
+ //#region src/components/Input/Password/index.tsx
2130
+ const _excluded$11 = [
2131
+ "id",
2132
+ "error",
2133
+ "hintText",
2134
+ "label",
2135
+ "hasOptionalLabel"
2136
+ ];
2137
+ const PasswordInput = (_ref) => {
2138
+ let { id, error = false, hintText, label, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$11);
2139
+ const errorId = `${id}-error`;
2140
+ const hintId = `${id}-hint`;
2141
+ const isErrorString = typeof error === "string";
2142
+ const hasHint = Boolean(hintText);
2143
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
2144
+ if (isErrorString) describedBy.push(errorId);
2145
+ if (hasHint) describedBy.push(hintId);
2146
+ return /* @__PURE__ */ jsxs(Root, {
2147
+ erroneous: isErrorString,
2148
+ children: [
2149
+ /* @__PURE__ */ jsx(Label$1, {
2150
+ htmlFor: id,
2151
+ isOptional: hasOptionalLabel,
2152
+ children: label
2153
+ }),
2154
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2155
+ id: hintId,
2156
+ children: hintText
2157
+ }),
2158
+ /* @__PURE__ */ jsx(PasswordInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2159
+ id,
2160
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2161
+ erroneous: isErrorString ? true : error
2162
+ })),
2163
+ isErrorString && /* @__PURE__ */ jsx(InputError, {
2164
+ id: errorId,
2165
+ message: error
2166
+ })
2167
+ ]
2168
+ });
2169
+ };
2170
+ PasswordInput.isInteractive = true;
2171
+
2172
+ //#endregion
2173
+ //#region src/components/Input/Radio/index.tsx
2174
+ const _excluded$10 = [
2175
+ "id",
2176
+ "error",
2177
+ "disabled",
2178
+ "label",
2179
+ "className",
2180
+ "hasOptionalLabel"
2181
+ ];
2182
+ const RadioInput = (_ref) => {
2183
+ let { id, error = false, disabled = false, label, className = "", hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$10);
2184
+ return /* @__PURE__ */ jsxs("div", {
2185
+ className: cn("kern-form-check", className),
2186
+ children: [/* @__PURE__ */ jsx(RadioInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2187
+ id,
2188
+ erroneous: error,
2189
+ disabled
2190
+ })), /* @__PURE__ */ jsx(Label$1, {
2191
+ htmlFor: id,
2192
+ isOptional: hasOptionalLabel,
2193
+ children: label
2194
+ })]
2195
+ });
2196
+ };
2197
+ RadioInput.isInteractive = true;
2198
+
2199
+ //#endregion
2200
+ //#region src/components/Input/Select/index.tsx
2201
+ const _excluded$9 = [
2202
+ "id",
2203
+ "errorMessage",
2204
+ "hintText",
2205
+ "label",
2206
+ "hasOptionalLabel",
2207
+ "options"
2208
+ ];
2209
+ const SelectInput = (_ref) => {
2210
+ let { id, errorMessage, hintText, label, hasOptionalLabel = false, options = [] } = _ref, props = _objectWithoutProperties(_ref, _excluded$9);
2211
+ const errorId = `${id}-error`;
2212
+ const hintId = `${id}-hint`;
2213
+ const erroneous = Boolean(errorMessage);
2214
+ const hasHint = Boolean(hintText);
2215
+ const describedBy = props["aria-describedby"] ? [props["aria-describedby"]] : [];
2216
+ if (errorMessage) describedBy.push(errorId);
2217
+ if (hasHint) describedBy.push(hintId);
2218
+ return /* @__PURE__ */ jsxs(Root, {
2219
+ erroneous,
2220
+ children: [
2221
+ /* @__PURE__ */ jsx(Label$1, {
2222
+ htmlFor: id,
2223
+ isOptional: hasOptionalLabel,
2224
+ children: label
2225
+ }),
2226
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2227
+ id: hintId,
2228
+ children: hintText
2229
+ }),
2230
+ /* @__PURE__ */ jsx(SelectInput$1, _objectSpread2(_objectSpread2({}, props), {}, {
2231
+ id,
2232
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2233
+ erroneous,
2234
+ options
2235
+ })),
2236
+ errorMessage && /* @__PURE__ */ jsx(InputError, {
2237
+ id: errorId,
2238
+ message: errorMessage
2239
+ })
2240
+ ]
2241
+ });
2242
+ };
2243
+ SelectInput.isInteractive = true;
2244
+
2245
+ //#endregion
2246
+ //#region src/components/Input/Tel/index.tsx
2247
+ const _excluded$8 = [
2248
+ "id",
2249
+ "error",
2250
+ "hintText",
2251
+ "label",
2252
+ "hasOptionalLabel"
2253
+ ];
2254
+ const TelInput = (_ref) => {
2255
+ let { id, error = false, hintText, label, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$8);
2256
+ const errorId = `${id}-error`;
2257
+ const hintId = `${id}-hint`;
2258
+ const isErrorString = typeof error === "string";
2259
+ const hasHint = Boolean(hintText);
2260
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
2261
+ if (isErrorString) describedBy.push(errorId);
2262
+ if (hasHint) describedBy.push(hintId);
2263
+ return /* @__PURE__ */ jsxs(Root, {
2264
+ erroneous: isErrorString,
2265
+ children: [
2266
+ /* @__PURE__ */ jsx(Label$1, {
2267
+ htmlFor: id,
2268
+ isOptional: hasOptionalLabel,
2269
+ children: label
2270
+ }),
2271
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2272
+ id: hintId,
2273
+ children: hintText
2274
+ }),
2275
+ /* @__PURE__ */ jsx(TelInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2276
+ id,
2277
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2278
+ erroneous: isErrorString ? true : error
2279
+ })),
2280
+ isErrorString && /* @__PURE__ */ jsx(InputError, {
2281
+ id: errorId,
2282
+ message: error
2283
+ })
2284
+ ]
2285
+ });
2286
+ };
2287
+ TelInput.isInteractive = true;
2288
+
2289
+ //#endregion
2290
+ //#region src/components/Input/Text/index.tsx
2291
+ const _excluded$7 = [
2292
+ "id",
2293
+ "hintText",
2294
+ "label",
2295
+ "error",
2296
+ "hasOptionalLabel"
2297
+ ];
2298
+ const TextInput = (_ref) => {
2299
+ let { id, hintText, label, error = false, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$7);
2300
+ const isErrorString = typeof error === "string";
2301
+ const errorId = `${id}-error`;
2302
+ const hintId = `${id}-hint`;
2303
+ const hasHint = Boolean(hintText);
2304
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
2305
+ if (isErrorString) describedBy.push(errorId);
2306
+ if (hasHint) describedBy.push(hintId);
2307
+ return /* @__PURE__ */ jsxs(Root, {
2308
+ erroneous: isErrorString,
2309
+ children: [
2310
+ /* @__PURE__ */ jsx(Label$1, {
2311
+ htmlFor: id,
2312
+ isOptional: hasOptionalLabel,
2313
+ children: label
2314
+ }),
2315
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2316
+ id: hintId,
2317
+ children: hintText
2318
+ }),
2319
+ /* @__PURE__ */ jsx(TextInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2320
+ id,
2321
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2322
+ erroneous: isErrorString ? true : error
2323
+ })),
2324
+ isErrorString && /* @__PURE__ */ jsx(InputError, {
2325
+ id: errorId,
2326
+ message: error
2327
+ })
2328
+ ]
2329
+ });
2330
+ };
2331
+ TextInput.isInteractive = true;
2332
+
2333
+ //#endregion
2334
+ //#region src/components/Input/Textarea/index.tsx
2335
+ const _excluded$6 = [
2336
+ "id",
2337
+ "error",
2338
+ "hintText",
2339
+ "label",
2340
+ "hasOptionalLabel"
2341
+ ];
2342
+ const TextareaInput = (_ref) => {
2343
+ let { id, error = false, hintText, label, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$6);
2344
+ const errorId = `${id}-error`;
2345
+ const hintId = `${id}-hint`;
2346
+ const isErrorString = typeof error === "string";
2347
+ const hasHint = Boolean(hintText);
2348
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
2349
+ if (isErrorString) describedBy.push(errorId);
2350
+ if (hasHint) describedBy.push(hintId);
2351
+ return /* @__PURE__ */ jsxs(Root, {
2352
+ erroneous: isErrorString,
2353
+ children: [
2354
+ /* @__PURE__ */ jsx(Label$1, {
2355
+ htmlFor: id,
2356
+ isOptional: hasOptionalLabel,
2357
+ children: label
2358
+ }),
2359
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2360
+ id: hintId,
2361
+ children: hintText
2362
+ }),
2363
+ /* @__PURE__ */ jsx(TextareaInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2364
+ id,
2365
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2366
+ erroneous: isErrorString ? true : error
2367
+ })),
2368
+ isErrorString && /* @__PURE__ */ jsx(InputError, {
2369
+ id: errorId,
2370
+ message: error
2371
+ })
2372
+ ]
2373
+ });
2374
+ };
2375
+ TextareaInput.isInteractive = true;
2376
+
2377
+ //#endregion
2378
+ //#region src/components/Input/Url/index.tsx
2379
+ const _excluded$5 = [
2380
+ "id",
2381
+ "error",
2382
+ "hintText",
2383
+ "label",
2384
+ "hasOptionalLabel"
2385
+ ];
2386
+ const UrlInput = (_ref) => {
2387
+ let { id, error = false, hintText, label, hasOptionalLabel = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$5);
2388
+ const errorId = `${id}-error`;
2389
+ const hintId = `${id}-hint`;
2390
+ const isErrorString = typeof error === "string";
2391
+ const hasHint = Boolean(hintText);
2392
+ const describedBy = rest["aria-describedby"] ? [rest["aria-describedby"]] : [];
2393
+ if (isErrorString) describedBy.push(errorId);
2394
+ if (hasHint) describedBy.push(hintId);
2395
+ return /* @__PURE__ */ jsxs(Root, {
2396
+ erroneous: isErrorString,
2397
+ children: [
2398
+ /* @__PURE__ */ jsx(Label$1, {
2399
+ htmlFor: id,
2400
+ isOptional: hasOptionalLabel,
2401
+ children: label
2402
+ }),
2403
+ hasHint && /* @__PURE__ */ jsx(Hint, {
2404
+ id: hintId,
2405
+ children: hintText
2406
+ }),
2407
+ /* @__PURE__ */ jsx(UrlInput$1, _objectSpread2(_objectSpread2({}, rest), {}, {
2408
+ id,
2409
+ "aria-describedby": describedBy.length > 0 ? describedBy.join(" ") : void 0,
2410
+ erroneous: isErrorString ? true : error
2411
+ })),
2412
+ isErrorString && /* @__PURE__ */ jsx(InputError, {
2413
+ id: errorId,
2414
+ message: error
2415
+ })
2416
+ ]
2417
+ });
2418
+ };
2419
+ UrlInput.isInteractive = true;
2420
+
2421
+ //#endregion
2422
+ //#region src/components/Kopfzeile/Kopfzeile.tsx
2423
+ const _excluded$4 = [
2424
+ "label",
2425
+ "fluid",
2426
+ "flag",
2427
+ "breakpoints",
2428
+ "className"
2429
+ ];
2430
+ const Kopfzeile = (_ref) => {
2431
+ let { label = "Offizielle Website - Bundesrepublik Deutschland", fluid = false, flag = true, breakpoints, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$4);
2432
+ const kopfzeileClass = cn("kern-kopfzeile", className);
2433
+ let customStyle = null;
2434
+ if (breakpoints) {
2435
+ const rules = breakpoints.split(",").map((bp) => {
2436
+ const [minWidth, maxWidth] = bp.split(":").map((s) => s.trim());
2437
+ return `@media (min-width: ${minWidth}) { .kern-container { max-width: ${maxWidth} !important; } }`;
2438
+ }).join("\n");
2439
+ customStyle = /* @__PURE__ */ jsx("style", { children: rules });
2440
+ }
2441
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
2442
+ className: kopfzeileClass,
2443
+ role: "banner",
2444
+ children: /* @__PURE__ */ jsx("div", {
2445
+ className: `kern-container${fluid ? "-fluid" : ""}`,
2446
+ children: /* @__PURE__ */ jsxs("div", {
2447
+ className: "kern-kopfzeile__content",
2448
+ children: [flag && /* @__PURE__ */ jsx("span", {
2449
+ className: "kern-kopfzeile__flagge",
2450
+ "aria-hidden": "true",
2451
+ children: /* @__PURE__ */ jsxs("svg", {
2452
+ xmlns: "http://www.w3.org/2000/svg",
2453
+ fill: "none",
2454
+ viewBox: "0 0 24 16",
2455
+ style: { maxWidth: 24 },
2456
+ children: [
2457
+ /* @__PURE__ */ jsx("path", {
2458
+ fill: "#000",
2459
+ d: "M0 .5h24v5.333H0z"
2460
+ }),
2461
+ /* @__PURE__ */ jsx("path", {
2462
+ fill: "red",
2463
+ d: "M0 5.833h24v5.333H0z"
2464
+ }),
2465
+ /* @__PURE__ */ jsx("path", {
2466
+ fill: "#FACA2C",
2467
+ d: "M0 11.167h24V16.5H0z"
2468
+ })
2469
+ ]
2470
+ })
2471
+ }), /* @__PURE__ */ jsx("span", {
2472
+ className: "kern-kopfzeile__label",
2473
+ children: label
2474
+ })]
2475
+ })
2476
+ })
2477
+ })), customStyle] });
2478
+ };
2479
+
2480
+ //#endregion
2481
+ //#region src/components/Loader/Loader.tsx
2482
+ const _excluded$3 = [
2483
+ "visible",
2484
+ "srDescription",
2485
+ "className"
2486
+ ];
2487
+ const Loader = (_ref) => {
2488
+ let { visible = false, srDescription = "Wird geladen...", className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$3);
2489
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, rest), {}, {
2490
+ className: cn("kern-loader", visible && "kern-loader--visible", className),
2491
+ role: "status",
2492
+ "aria-atomic": "true",
2493
+ children: /* @__PURE__ */ jsx("span", {
2494
+ className: "kern-sr-only",
2495
+ children: srDescription
2496
+ })
2497
+ }));
2498
+ };
2499
+
2500
+ //#endregion
2501
+ //#region src/components/Preline/Preline.tsx
2502
+ const _excluded$2 = [
2503
+ "variant",
2504
+ "text",
2505
+ "children",
2506
+ "className"
2507
+ ];
2508
+ const Preline = (_ref) => {
2509
+ let { variant = "default", text, children, className } = _ref, rest = _objectWithoutProperties(_ref, _excluded$2);
2510
+ const prelineClass = cn("kern-preline", `kern-preline--${variant}`, className);
2511
+ return /* @__PURE__ */ jsx("p", _objectSpread2(_objectSpread2({}, rest), {}, {
2512
+ className: prelineClass,
2513
+ children: children || text
2514
+ }));
2515
+ };
2516
+
2517
+ //#endregion
2518
+ //#region src/components/Subline/Subline.tsx
2519
+ const _excluded$1 = [
2520
+ "text",
2521
+ "children",
2522
+ "className",
2523
+ "variant"
2524
+ ];
2525
+ const Subline = (_ref) => {
2526
+ let { text, children, className, variant = "default" } = _ref, rest = _objectWithoutProperties(_ref, _excluded$1);
2527
+ const sublineClass = cn("kern-subline", `kern-subline--${variant}`, className);
2528
+ return /* @__PURE__ */ jsx("p", _objectSpread2(_objectSpread2({}, rest), {}, {
2529
+ className: sublineClass,
2530
+ children: children || text
2531
+ }));
2532
+ };
2533
+
2534
+ //#endregion
2535
+ //#region src/components/ThemeProvider/ThemeProvider.tsx
2536
+ const _excluded = [
2537
+ "theme",
2538
+ "children",
2539
+ "global",
2540
+ "className",
2541
+ "style"
2542
+ ];
2543
+ const flattenThemeToVariables = (obj, prefix = "--kern") => {
2544
+ const variables = {};
2545
+ const toKebabCase = (str) => {
2546
+ return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2547
+ };
2548
+ const traverse = (current, path) => {
2549
+ if (current && typeof current === "object" && !Array.isArray(current)) Object.entries(current).forEach(([key, value]) => {
2550
+ if (typeof value === "string" || typeof value === "number") {
2551
+ const kebabKey = toKebabCase(key);
2552
+ const variableName = [...path, kebabKey].join("-");
2553
+ variables[variableName] = String(value);
2554
+ } else if (typeof value === "object" && value !== null && !Array.isArray(value)) {
2555
+ const kebabKey = toKebabCase(key);
2556
+ traverse(value, [...path, kebabKey]);
2557
+ }
2558
+ });
2559
+ };
2560
+ traverse(obj, [prefix]);
2561
+ return variables;
2562
+ };
2563
+ const generateModeCSS = (theme, _mode) => {
2564
+ const variables = flattenThemeToVariables(theme);
2565
+ return Object.entries(variables).map(([key, value]) => ` ${key}: ${value};`).join("\n");
2566
+ };
2567
+ const ThemeProvider = (_ref) => {
2568
+ let { theme = {}, children, global = true, className = "", style = {} } = _ref, props = _objectWithoutProperties(_ref, _excluded);
2569
+ const { light, dark, color, metric, typography, component } = theme;
2570
+ const id = useId();
2571
+ const uniqueId = useMemo(() => id.replace(/:/g, "-"), [id]);
2572
+ const baseTheme = {
2573
+ color,
2574
+ metric,
2575
+ typography,
2576
+ component
2577
+ };
2578
+ const baseStyle = Object.keys(baseTheme).some((key) => baseTheme[key]) ? flattenThemeToVariables(baseTheme) : {};
2579
+ const lightCSS = light ? generateModeCSS(light, "light") : "";
2580
+ const darkCSS = dark ? generateModeCSS(dark, "dark") : "";
2581
+ const modeCSS = global ? `
2582
+ ${lightCSS ? `[data-kern-theme="light"] { ${lightCSS} }` : ""}
2583
+ ${darkCSS ? `[data-kern-theme="dark"] { ${darkCSS} }` : ""}
2584
+ `.trim() : `
2585
+ ${lightCSS ? `.kern-theme-provider-${uniqueId}[data-kern-theme="light"], .kern-theme-provider-${uniqueId} [data-kern-theme="light"], .kern-theme-provider-${uniqueId}[data-kern-theme="light"] *, .kern-theme-provider-${uniqueId} [data-kern-theme="light"] * { ${lightCSS} }` : ""}
2586
+ ${darkCSS ? `.kern-theme-provider-${uniqueId}[data-kern-theme="dark"], .kern-theme-provider-${uniqueId} [data-kern-theme="dark"], .kern-theme-provider-${uniqueId}[data-kern-theme="dark"] *, .kern-theme-provider-${uniqueId} [data-kern-theme="dark"] * { ${darkCSS} }` : ""}
2587
+ `.trim();
2588
+ const baseCSS = Object.keys(baseStyle).length > 0 ? global ? `
2589
+ :root {
2590
+ ${Object.entries(baseStyle).map(([key, value]) => `${key}: ${value};`).join("\n ")}
2591
+ }
2592
+ ` : `
2593
+ .kern-theme-provider-${uniqueId}, .kern-theme-provider-${uniqueId} * {
2594
+ ${Object.entries(baseStyle).map(([key, value]) => `${key}: ${value};`).join("\n ")}
2595
+ }
2596
+ ` : "";
2597
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2598
+ modeCSS && /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: modeCSS } }),
2599
+ baseCSS && /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: baseCSS } }),
2600
+ /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({}, props), {}, {
2601
+ className: `kern-theme-provider-${uniqueId} ${className || ""}`,
2602
+ style: _objectSpread2(_objectSpread2({}, style), baseStyle),
2603
+ children
2604
+ }))
2605
+ ] });
2606
+ };
2607
+
2608
+ //#endregion
2609
+ //#region src/index.ts
2610
+ const Accordion = Object.assign(AccordionRoot, Accordion_exports);
2611
+ const Alert = Object.assign(AlertRoot, Alert_exports);
2612
+ const Card = Object.assign(CardRoot, Card_exports);
2613
+ const DescriptionList = Object.assign(DescriptionListRoot, DescriptionList_exports);
2614
+ const Dialog = Object.assign(DialogRoot, Dialog_exports);
2615
+ const Fieldset = Object.assign(FieldsetRoot, Fieldset_exports);
2616
+ const Grid = Object.assign(GridRoot, Grid_exports);
2617
+ const InputPrimitive = Object.assign(Root, Primitives_exports);
2618
+ const Lists = Object.assign(ListsRoot, Lists_exports);
2619
+ const Table = Object.assign(TableRoot, Table_exports);
2620
+ const Progress = Object.assign(ProgressRoot, Progress_exports);
2621
+ const Summary = Object.assign(SummaryRoot, Summary_exports);
2622
+ const TaskList = Object.assign(TaskListRoot, TaskList_exports);
2623
+
2624
+ //#endregion
2625
+ export { Accordion, Alert, Badge, Body, Button, Card, CheckboxInput, DateInput, DescriptionList, Dialog, Divider, EmailInput, Fieldset, FileInput, Grid, Heading, Icon, InputPrimitive, Kopfzeile, Label, Link, Lists, Loader, NumberInput, PasswordInput, Preline, Progress, RadioInput, SelectInput, Subline, Summary, Table, TaskList, TelInput, TextInput, TextareaInput, ThemeProvider, Title, UrlInput };
2626
+ //# sourceMappingURL=index.js.map