@publicplan/kern-react-kit 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +119 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +24 -0
- package/dist/index.d.cts +29 -9
- package/dist/index.d.ts +29 -9
- package/dist/index.js +119 -37
- package/dist/index.js.map +1 -1
- package/dist/skills/kern-react-kit/SKILL.md +343 -0
- package/dist/skills/kern-react-kit/references/COMPONENTS.md +686 -0
- package/dist/skills/kern-react-kit/references/REFERENCE.md +316 -0
- package/dist/skills/skills.index.json +10 -0
- package/package.json +10 -4
package/dist/index.css
CHANGED
|
@@ -92,3 +92,27 @@
|
|
|
92
92
|
font-size: inherit;
|
|
93
93
|
line-height: inherit;
|
|
94
94
|
}
|
|
95
|
+
|
|
96
|
+
.kern-btn > .kern-icon {
|
|
97
|
+
color: var(--kern-color-action-default, #1A3DA5);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.kern-btn--primary > .kern-icon {
|
|
101
|
+
color: var(--kern-color-action-on-default, #FFF);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.kern-badge--info .kern-icon {
|
|
105
|
+
color: var(--kern-color-feedback-info, #006490);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.kern-badge--success .kern-icon {
|
|
109
|
+
color: var(--kern-color-feedback-success, #006B51);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.kern-badge--warning .kern-icon {
|
|
113
|
+
color: var(--kern-color-feedback-warning, #8A4F00);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.kern-badge--danger .kern-icon {
|
|
117
|
+
color: var(--kern-color-feedback-danger, #BD0F09);
|
|
118
|
+
}
|
package/dist/index.d.cts
CHANGED
|
@@ -395,6 +395,7 @@ interface ListsRootProps extends Omit<React.ComponentPropsWithoutRef<'ol' | 'ul'
|
|
|
395
395
|
style?: React.CSSProperties;
|
|
396
396
|
size?: 'default' | 'large' | 'small';
|
|
397
397
|
type?: 'bullet' | 'number' | 'link';
|
|
398
|
+
horizontal?: boolean;
|
|
398
399
|
}
|
|
399
400
|
declare const ListsRoot: React.FC<ListsRootProps>;
|
|
400
401
|
//#endregion
|
|
@@ -590,13 +591,14 @@ interface TaskListRootProps extends React.ComponentPropsWithoutRef<'div'> {}
|
|
|
590
591
|
declare const TaskListRoot: React.FC<TaskListRootProps>;
|
|
591
592
|
//#endregion
|
|
592
593
|
//#region src/components/Badge/Badge.d.ts
|
|
593
|
-
interface BadgeProps extends React.ComponentPropsWithoutRef<'span'> {
|
|
594
|
+
interface BadgeProps extends React$1.ComponentPropsWithoutRef<'span'> {
|
|
594
595
|
variant: 'info' | 'success' | 'warning' | 'danger';
|
|
595
596
|
title: string;
|
|
596
|
-
icon?:
|
|
597
|
+
icon?: React$1.ReactNode;
|
|
598
|
+
iconSize?: 'small' | 'default' | 'large' | 'x-large';
|
|
597
599
|
showIcon?: boolean;
|
|
598
600
|
}
|
|
599
|
-
declare const Badge: React.FC<BadgeProps>;
|
|
601
|
+
declare const Badge: React$1.FC<BadgeProps>;
|
|
600
602
|
//#endregion
|
|
601
603
|
//#region src/components/Body/Body.d.ts
|
|
602
604
|
interface BodyProps extends Omit<React.ComponentPropsWithoutRef<'p'>, 'text'> {
|
|
@@ -609,16 +611,30 @@ interface BodyProps extends Omit<React.ComponentPropsWithoutRef<'p'>, 'text'> {
|
|
|
609
611
|
declare const Body: React.FC<BodyProps>;
|
|
610
612
|
//#endregion
|
|
611
613
|
//#region src/components/Button/Button.d.ts
|
|
612
|
-
|
|
614
|
+
type CommonProps = {
|
|
613
615
|
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
614
616
|
isBlock?: boolean;
|
|
615
|
-
icon?: IconProps;
|
|
617
|
+
icon?: IconProps | React$1.ReactNode;
|
|
618
|
+
iconSize?: 'small' | 'default' | 'large' | 'x-large';
|
|
616
619
|
iconOnly?: boolean;
|
|
617
620
|
iconLeft?: boolean;
|
|
618
621
|
text?: string | null;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
+
children?: React$1.ReactNode;
|
|
623
|
+
className?: string;
|
|
624
|
+
};
|
|
625
|
+
type ButtonAsButton = CommonProps & Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'className'> & {
|
|
626
|
+
as?: 'button';
|
|
627
|
+
href?: never;
|
|
628
|
+
target?: never;
|
|
629
|
+
};
|
|
630
|
+
type ButtonAsAnchor = CommonProps & Omit<React$1.AnchorHTMLAttributes<HTMLAnchorElement>, 'type' | 'className'> & {
|
|
631
|
+
as: 'a';
|
|
632
|
+
href: string;
|
|
633
|
+
target?: '_self' | '_blank';
|
|
634
|
+
disabled?: boolean;
|
|
635
|
+
};
|
|
636
|
+
type ButtonProps = ButtonAsButton | ButtonAsAnchor;
|
|
637
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
622
638
|
//#endregion
|
|
623
639
|
//#region src/components/Divider/Divider.d.ts
|
|
624
640
|
declare const Divider: React.FC<React.ComponentPropsWithoutRef<'hr'>>;
|
|
@@ -759,6 +775,10 @@ interface KopfzeileProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
|
759
775
|
}
|
|
760
776
|
declare const Kopfzeile: React.FC<KopfzeileProps>;
|
|
761
777
|
//#endregion
|
|
778
|
+
//#region src/components/LinkButton/LinkButton.d.ts
|
|
779
|
+
type LinkButtonProps = Omit<ButtonAsAnchor, 'as'>;
|
|
780
|
+
declare const LinkButton: React$1.FC<LinkButtonProps>;
|
|
781
|
+
//#endregion
|
|
762
782
|
//#region src/components/Loader/Loader.d.ts
|
|
763
783
|
interface LoaderProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'role' | 'aria-atomic'> {
|
|
764
784
|
visible?: boolean;
|
|
@@ -1090,5 +1110,5 @@ declare const Progress: react11.FC<ProgressRootProps> & typeof index_d_exports$9
|
|
|
1090
1110
|
declare const Summary: react11.FC<SummaryProps> & typeof index_d_exports$10;
|
|
1091
1111
|
declare const TaskList: react11.FC<TaskListRootProps> & typeof index_d_exports$12;
|
|
1092
1112
|
//#endregion
|
|
1093
|
-
export { Accordion, type AccordionContentProps, type AccordionGroupProps, type AccordionRootProps, type AccordionSummaryProps, Alert, type AlertBodyProps, type AlertHeaderProps, type AlertRootProps, Badge, type BadgeProps, Body, Button, type ButtonProps, Card, type CardBodyProps, type CardContainerProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardPrelineProps, type CardRootProps, type CardSublineProps, type CardTitleProps, CheckboxInput, type CheckboxInputProps, DateInput, type DateInputProps, DescriptionList, type DescriptionListItemProps, type DescriptionListKeyProps, type DescriptionListRootProps, type DescriptionListValueProps, Dialog, type DialogButtonProps, type DialogContentProps, type DialogFooterProps, type DialogHeaderProps, type DialogModalProps, type DialogRootProps, type DialogTriggerProps, Divider, EmailInput, type EmailInputProps, Fieldset, type FieldsetContentProps, type FieldsetErrorProps, type FieldsetHintProps, type FieldsetLegendProps, type FieldsetRootProps, FileInput, type FileInputProps, Grid, type GridColumnProps, type GridRootProps, type GridRowProps, Heading, Icon, type IconProps, type InputErrorProps, type HintProps as InputHintProps, type LabelProps as InputLabelProps, InputPrimitive, type RootProps as InputRootProps, Kopfzeile, type KopfzeileProps, Label, type LabelProps$1 as LabelProps, Link, type LinkProps, Lists, type ListsBulletProps, type ListsItemProps, type ListsNumberProps, type ListsRootProps, Loader, type LoaderProps, NumberInput, type NumberInputProps, PasswordInput, type PasswordInputProps, Preline, type PrelineProps, Progress, type ProgressBarProps, type ProgressHeaderProps, type ProgressLabelProps, type ProgressRootProps, RadioInput, type RadioInputProps, SelectInput, type SelectInputProps, Subline, type SublineProps, Summary, type SummaryActionsProps, type SummaryBodyProps, type SummaryGroupHeadingProps, type SummaryGroupProps, type SummaryHeadingProps, type SummaryProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, type TableRootProps, type TableRowProps, TaskList, type TaskListHeadingProps, type TaskListItemProps, type TaskListProps, type TaskListRootProps, TelInput, type TelInputProps, TextInput, type TextInputProps, TextareaInput, type TextareaInputProps, type Theme, ThemeProvider, type ThemeProviderProps, Title, type TitleProps, UrlInput, type UrlInputProps };
|
|
1113
|
+
export { Accordion, type AccordionContentProps, type AccordionGroupProps, type AccordionRootProps, type AccordionSummaryProps, Alert, type AlertBodyProps, type AlertHeaderProps, type AlertRootProps, Badge, type BadgeProps, Body, Button, type ButtonProps, Card, type CardBodyProps, type CardContainerProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardPrelineProps, type CardRootProps, type CardSublineProps, type CardTitleProps, CheckboxInput, type CheckboxInputProps, DateInput, type DateInputProps, DescriptionList, type DescriptionListItemProps, type DescriptionListKeyProps, type DescriptionListRootProps, type DescriptionListValueProps, Dialog, type DialogButtonProps, type DialogContentProps, type DialogFooterProps, type DialogHeaderProps, type DialogModalProps, type DialogRootProps, type DialogTriggerProps, Divider, EmailInput, type EmailInputProps, Fieldset, type FieldsetContentProps, type FieldsetErrorProps, type FieldsetHintProps, type FieldsetLegendProps, type FieldsetRootProps, FileInput, type FileInputProps, Grid, type GridColumnProps, type GridRootProps, type GridRowProps, Heading, Icon, type IconProps, type InputErrorProps, type HintProps as InputHintProps, type LabelProps as InputLabelProps, InputPrimitive, type RootProps as InputRootProps, Kopfzeile, type KopfzeileProps, Label, type LabelProps$1 as LabelProps, Link, LinkButton, type LinkProps, Lists, type ListsBulletProps, type ListsItemProps, type ListsNumberProps, type ListsRootProps, Loader, type LoaderProps, NumberInput, type NumberInputProps, PasswordInput, type PasswordInputProps, Preline, type PrelineProps, Progress, type ProgressBarProps, type ProgressHeaderProps, type ProgressLabelProps, type ProgressRootProps, RadioInput, type RadioInputProps, SelectInput, type SelectInputProps, Subline, type SublineProps, Summary, type SummaryActionsProps, type SummaryBodyProps, type SummaryGroupHeadingProps, type SummaryGroupProps, type SummaryHeadingProps, type SummaryProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, type TableRootProps, type TableRowProps, TaskList, type TaskListHeadingProps, type TaskListItemProps, type TaskListProps, type TaskListRootProps, TelInput, type TelInputProps, TextInput, type TextInputProps, TextareaInput, type TextareaInputProps, type Theme, ThemeProvider, type ThemeProviderProps, Title, type TitleProps, UrlInput, type UrlInputProps };
|
|
1094
1114
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -393,6 +393,7 @@ interface ListsRootProps extends Omit<React.ComponentPropsWithoutRef<'ol' | 'ul'
|
|
|
393
393
|
style?: React.CSSProperties;
|
|
394
394
|
size?: 'default' | 'large' | 'small';
|
|
395
395
|
type?: 'bullet' | 'number' | 'link';
|
|
396
|
+
horizontal?: boolean;
|
|
396
397
|
}
|
|
397
398
|
declare const ListsRoot: React.FC<ListsRootProps>;
|
|
398
399
|
//#endregion
|
|
@@ -588,13 +589,14 @@ interface TaskListRootProps extends React.ComponentPropsWithoutRef<'div'> {}
|
|
|
588
589
|
declare const TaskListRoot: React.FC<TaskListRootProps>;
|
|
589
590
|
//#endregion
|
|
590
591
|
//#region src/components/Badge/Badge.d.ts
|
|
591
|
-
interface BadgeProps extends React.ComponentPropsWithoutRef<'span'> {
|
|
592
|
+
interface BadgeProps extends React$1.ComponentPropsWithoutRef<'span'> {
|
|
592
593
|
variant: 'info' | 'success' | 'warning' | 'danger';
|
|
593
594
|
title: string;
|
|
594
|
-
icon?:
|
|
595
|
+
icon?: React$1.ReactNode;
|
|
596
|
+
iconSize?: 'small' | 'default' | 'large' | 'x-large';
|
|
595
597
|
showIcon?: boolean;
|
|
596
598
|
}
|
|
597
|
-
declare const Badge: React.FC<BadgeProps>;
|
|
599
|
+
declare const Badge: React$1.FC<BadgeProps>;
|
|
598
600
|
//#endregion
|
|
599
601
|
//#region src/components/Body/Body.d.ts
|
|
600
602
|
interface BodyProps extends Omit<React.ComponentPropsWithoutRef<'p'>, 'text'> {
|
|
@@ -607,16 +609,30 @@ interface BodyProps extends Omit<React.ComponentPropsWithoutRef<'p'>, 'text'> {
|
|
|
607
609
|
declare const Body: React.FC<BodyProps>;
|
|
608
610
|
//#endregion
|
|
609
611
|
//#region src/components/Button/Button.d.ts
|
|
610
|
-
|
|
612
|
+
type CommonProps = {
|
|
611
613
|
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
612
614
|
isBlock?: boolean;
|
|
613
|
-
icon?: IconProps;
|
|
615
|
+
icon?: IconProps | React$1.ReactNode;
|
|
616
|
+
iconSize?: 'small' | 'default' | 'large' | 'x-large';
|
|
614
617
|
iconOnly?: boolean;
|
|
615
618
|
iconLeft?: boolean;
|
|
616
619
|
text?: string | null;
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
+
children?: React$1.ReactNode;
|
|
621
|
+
className?: string;
|
|
622
|
+
};
|
|
623
|
+
type ButtonAsButton = CommonProps & Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'className'> & {
|
|
624
|
+
as?: 'button';
|
|
625
|
+
href?: never;
|
|
626
|
+
target?: never;
|
|
627
|
+
};
|
|
628
|
+
type ButtonAsAnchor = CommonProps & Omit<React$1.AnchorHTMLAttributes<HTMLAnchorElement>, 'type' | 'className'> & {
|
|
629
|
+
as: 'a';
|
|
630
|
+
href: string;
|
|
631
|
+
target?: '_self' | '_blank';
|
|
632
|
+
disabled?: boolean;
|
|
633
|
+
};
|
|
634
|
+
type ButtonProps = ButtonAsButton | ButtonAsAnchor;
|
|
635
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
620
636
|
//#endregion
|
|
621
637
|
//#region src/components/Divider/Divider.d.ts
|
|
622
638
|
declare const Divider: React.FC<React.ComponentPropsWithoutRef<'hr'>>;
|
|
@@ -757,6 +773,10 @@ interface KopfzeileProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
|
757
773
|
}
|
|
758
774
|
declare const Kopfzeile: React.FC<KopfzeileProps>;
|
|
759
775
|
//#endregion
|
|
776
|
+
//#region src/components/LinkButton/LinkButton.d.ts
|
|
777
|
+
type LinkButtonProps = Omit<ButtonAsAnchor, 'as'>;
|
|
778
|
+
declare const LinkButton: React$1.FC<LinkButtonProps>;
|
|
779
|
+
//#endregion
|
|
760
780
|
//#region src/components/Loader/Loader.d.ts
|
|
761
781
|
interface LoaderProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'role' | 'aria-atomic'> {
|
|
762
782
|
visible?: boolean;
|
|
@@ -1088,5 +1108,5 @@ declare const Progress: react11.FC<ProgressRootProps> & typeof index_d_exports$9
|
|
|
1088
1108
|
declare const Summary: react11.FC<SummaryProps> & typeof index_d_exports$10;
|
|
1089
1109
|
declare const TaskList: react11.FC<TaskListRootProps> & typeof index_d_exports$12;
|
|
1090
1110
|
//#endregion
|
|
1091
|
-
export { Accordion, type AccordionContentProps, type AccordionGroupProps, type AccordionRootProps, type AccordionSummaryProps, Alert, type AlertBodyProps, type AlertHeaderProps, type AlertRootProps, Badge, type BadgeProps, Body, Button, type ButtonProps, Card, type CardBodyProps, type CardContainerProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardPrelineProps, type CardRootProps, type CardSublineProps, type CardTitleProps, CheckboxInput, type CheckboxInputProps, DateInput, type DateInputProps, DescriptionList, type DescriptionListItemProps, type DescriptionListKeyProps, type DescriptionListRootProps, type DescriptionListValueProps, Dialog, type DialogButtonProps, type DialogContentProps, type DialogFooterProps, type DialogHeaderProps, type DialogModalProps, type DialogRootProps, type DialogTriggerProps, Divider, EmailInput, type EmailInputProps, Fieldset, type FieldsetContentProps, type FieldsetErrorProps, type FieldsetHintProps, type FieldsetLegendProps, type FieldsetRootProps, FileInput, type FileInputProps, Grid, type GridColumnProps, type GridRootProps, type GridRowProps, Heading, Icon, type IconProps, type InputErrorProps, type HintProps as InputHintProps, type LabelProps as InputLabelProps, InputPrimitive, type RootProps as InputRootProps, Kopfzeile, type KopfzeileProps, Label, type LabelProps$1 as LabelProps, Link, type LinkProps, Lists, type ListsBulletProps, type ListsItemProps, type ListsNumberProps, type ListsRootProps, Loader, type LoaderProps, NumberInput, type NumberInputProps, PasswordInput, type PasswordInputProps, Preline, type PrelineProps, Progress, type ProgressBarProps, type ProgressHeaderProps, type ProgressLabelProps, type ProgressRootProps, RadioInput, type RadioInputProps, SelectInput, type SelectInputProps, Subline, type SublineProps, Summary, type SummaryActionsProps, type SummaryBodyProps, type SummaryGroupHeadingProps, type SummaryGroupProps, type SummaryHeadingProps, type SummaryProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, type TableRootProps, type TableRowProps, TaskList, type TaskListHeadingProps, type TaskListItemProps, type TaskListProps, type TaskListRootProps, TelInput, type TelInputProps, TextInput, type TextInputProps, TextareaInput, type TextareaInputProps, type Theme, ThemeProvider, type ThemeProviderProps, Title, type TitleProps, UrlInput, type UrlInputProps };
|
|
1111
|
+
export { Accordion, type AccordionContentProps, type AccordionGroupProps, type AccordionRootProps, type AccordionSummaryProps, Alert, type AlertBodyProps, type AlertHeaderProps, type AlertRootProps, Badge, type BadgeProps, Body, Button, type ButtonProps, Card, type CardBodyProps, type CardContainerProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardPrelineProps, type CardRootProps, type CardSublineProps, type CardTitleProps, CheckboxInput, type CheckboxInputProps, DateInput, type DateInputProps, DescriptionList, type DescriptionListItemProps, type DescriptionListKeyProps, type DescriptionListRootProps, type DescriptionListValueProps, Dialog, type DialogButtonProps, type DialogContentProps, type DialogFooterProps, type DialogHeaderProps, type DialogModalProps, type DialogRootProps, type DialogTriggerProps, Divider, EmailInput, type EmailInputProps, Fieldset, type FieldsetContentProps, type FieldsetErrorProps, type FieldsetHintProps, type FieldsetLegendProps, type FieldsetRootProps, FileInput, type FileInputProps, Grid, type GridColumnProps, type GridRootProps, type GridRowProps, Heading, Icon, type IconProps, type InputErrorProps, type HintProps as InputHintProps, type LabelProps as InputLabelProps, InputPrimitive, type RootProps as InputRootProps, Kopfzeile, type KopfzeileProps, Label, type LabelProps$1 as LabelProps, Link, LinkButton, type LinkProps, Lists, type ListsBulletProps, type ListsItemProps, type ListsNumberProps, type ListsRootProps, Loader, type LoaderProps, NumberInput, type NumberInputProps, PasswordInput, type PasswordInputProps, Preline, type PrelineProps, Progress, type ProgressBarProps, type ProgressHeaderProps, type ProgressLabelProps, type ProgressRootProps, RadioInput, type RadioInputProps, SelectInput, type SelectInputProps, Subline, type SublineProps, Summary, type SummaryActionsProps, type SummaryBodyProps, type SummaryGroupHeadingProps, type SummaryGroupProps, type SummaryHeadingProps, type SummaryProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, type TableRootProps, type TableRowProps, TaskList, type TaskListHeadingProps, type TaskListItemProps, type TaskListProps, type TaskListRootProps, TelInput, type TelInputProps, TextInput, type TextInputProps, TextareaInput, type TextareaInputProps, type Theme, ThemeProvider, type ThemeProviderProps, Title, type TitleProps, UrlInput, type UrlInputProps };
|
|
1092
1112
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -267,7 +267,7 @@ const _excluded$86 = [
|
|
|
267
267
|
"isStretched",
|
|
268
268
|
"className"
|
|
269
269
|
];
|
|
270
|
-
const getIcon
|
|
270
|
+
const getIcon = (iconProps) => iconProps ? /* @__PURE__ */ jsx(Icon, {
|
|
271
271
|
name: iconProps.name,
|
|
272
272
|
size: iconProps.size
|
|
273
273
|
}) : null;
|
|
@@ -279,9 +279,9 @@ const Link = (_ref) => {
|
|
|
279
279
|
className: linkClass,
|
|
280
280
|
target: (icon === null || icon === void 0 ? void 0 : icon.name) === "open-in-new" ? "_blank" : target,
|
|
281
281
|
children: [
|
|
282
|
-
iconLeft && getIcon
|
|
282
|
+
iconLeft && getIcon(icon),
|
|
283
283
|
linkText,
|
|
284
|
-
!iconLeft && getIcon
|
|
284
|
+
!iconLeft && getIcon(icon)
|
|
285
285
|
]
|
|
286
286
|
}));
|
|
287
287
|
};
|
|
@@ -552,16 +552,18 @@ const _excluded$70 = [
|
|
|
552
552
|
"variant",
|
|
553
553
|
"isBlock",
|
|
554
554
|
"icon",
|
|
555
|
+
"iconSize",
|
|
555
556
|
"iconOnly",
|
|
556
557
|
"iconLeft",
|
|
557
558
|
"text",
|
|
558
559
|
"children",
|
|
559
560
|
"className"
|
|
561
|
+
], _excluded2 = [
|
|
562
|
+
"href",
|
|
563
|
+
"target",
|
|
564
|
+
"disabled"
|
|
560
565
|
];
|
|
561
|
-
const
|
|
562
|
-
name: iconProps.name,
|
|
563
|
-
size: iconProps.size
|
|
564
|
-
}) : null;
|
|
566
|
+
const isIconProps = (icon) => typeof icon === "object" && icon !== null && "name" in icon && !React.isValidElement(icon);
|
|
565
567
|
const IconOnlyLabel = ({ labelText }) => {
|
|
566
568
|
if (!labelText) return null;
|
|
567
569
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -569,26 +571,80 @@ const IconOnlyLabel = ({ labelText }) => {
|
|
|
569
571
|
children: labelText.replace(/^./, (c) => c.toUpperCase())
|
|
570
572
|
});
|
|
571
573
|
};
|
|
572
|
-
const Button = (
|
|
573
|
-
|
|
574
|
+
const Button = React.forwardRef((props, ref) => {
|
|
575
|
+
const { variant = "primary", isBlock, icon, iconSize = "default", iconOnly, iconLeft, text, children, className } = props, rest = _objectWithoutProperties(props, _excluded$70);
|
|
574
576
|
const classes = cn("kern-btn", isBlock && "kern-btn--block", `kern-btn--${variant}`, className);
|
|
575
|
-
|
|
576
|
-
if (
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
577
|
+
let iconElement = null;
|
|
578
|
+
if (icon && (typeof icon === "object" && "name" in icon && icon.name.length > 0 || React.isValidElement(icon))) {
|
|
579
|
+
if (isIconProps(icon)) iconElement = /* @__PURE__ */ jsx(Icon, {
|
|
580
|
+
name: icon.name,
|
|
581
|
+
size: icon.size
|
|
582
|
+
});
|
|
583
|
+
else if (React.isValidElement(icon)) iconElement = /* @__PURE__ */ jsx("span", {
|
|
584
|
+
className: cn("kern-icon", `kern-icon--${iconSize}`),
|
|
585
|
+
style: {
|
|
586
|
+
mask: "none",
|
|
587
|
+
WebkitMask: "none",
|
|
588
|
+
background: "none",
|
|
589
|
+
display: "inline-flex"
|
|
590
|
+
},
|
|
591
|
+
"aria-hidden": true,
|
|
592
|
+
children: icon
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
if ("as" in props && props.as === "a" && props.href) {
|
|
596
|
+
const _ref = rest, { href, target, disabled } = _ref, anchorRest = _objectWithoutProperties(_ref, _excluded2);
|
|
597
|
+
if (iconOnly) {
|
|
598
|
+
const labelText = text || (isIconProps(icon) ? icon.name : void 0);
|
|
599
|
+
const ariaDisabled = disabled ? {
|
|
600
|
+
"aria-disabled": true,
|
|
601
|
+
tabIndex: -1,
|
|
602
|
+
onClick: (e) => e.preventDefault(),
|
|
603
|
+
href: void 0
|
|
604
|
+
} : {};
|
|
605
|
+
return /* @__PURE__ */ jsxs("a", _objectSpread2(_objectSpread2(_objectSpread2({
|
|
606
|
+
ref,
|
|
607
|
+
href,
|
|
608
|
+
target,
|
|
609
|
+
className: classes
|
|
610
|
+
}, anchorRest), ariaDisabled), {}, { children: [iconElement, /* @__PURE__ */ jsx(IconOnlyLabel, { labelText })] }));
|
|
611
|
+
}
|
|
612
|
+
return /* @__PURE__ */ jsxs("a", _objectSpread2(_objectSpread2({
|
|
613
|
+
ref,
|
|
614
|
+
href,
|
|
615
|
+
target,
|
|
616
|
+
className: classes
|
|
617
|
+
}, anchorRest), {}, { children: [
|
|
583
618
|
iconLeft && iconElement,
|
|
584
|
-
|
|
619
|
+
/* @__PURE__ */ jsx("span", {
|
|
585
620
|
className: "kern-label",
|
|
586
621
|
children: children || text
|
|
587
622
|
}),
|
|
588
623
|
!iconLeft && iconElement
|
|
589
|
-
]
|
|
590
|
-
}
|
|
591
|
-
|
|
624
|
+
] }));
|
|
625
|
+
}
|
|
626
|
+
const buttonRest = rest;
|
|
627
|
+
if (iconOnly) {
|
|
628
|
+
const labelText = text || (isIconProps(icon) ? icon.name : void 0);
|
|
629
|
+
return /* @__PURE__ */ jsxs("button", _objectSpread2(_objectSpread2({
|
|
630
|
+
ref,
|
|
631
|
+
type: "button",
|
|
632
|
+
className: classes
|
|
633
|
+
}, buttonRest), {}, { children: [iconElement, /* @__PURE__ */ jsx(IconOnlyLabel, { labelText })] }));
|
|
634
|
+
}
|
|
635
|
+
return /* @__PURE__ */ jsxs("button", _objectSpread2(_objectSpread2({
|
|
636
|
+
ref,
|
|
637
|
+
type: "button",
|
|
638
|
+
className: classes
|
|
639
|
+
}, buttonRest), {}, { children: [
|
|
640
|
+
iconLeft && iconElement,
|
|
641
|
+
text && /* @__PURE__ */ jsx("span", {
|
|
642
|
+
className: "kern-label",
|
|
643
|
+
children: children || text
|
|
644
|
+
}),
|
|
645
|
+
!iconLeft && iconElement
|
|
646
|
+
] }));
|
|
647
|
+
});
|
|
592
648
|
Button.isInteractive = true;
|
|
593
649
|
|
|
594
650
|
//#endregion
|
|
@@ -1196,7 +1252,6 @@ const FieldsetRoot = ({ children, id, className, style, error = false }) => {
|
|
|
1196
1252
|
className: cn(`kern-fieldset`, error && "kern-fieldset--error", className),
|
|
1197
1253
|
style,
|
|
1198
1254
|
id,
|
|
1199
|
-
role: "group",
|
|
1200
1255
|
"aria-describedby": hintText,
|
|
1201
1256
|
children
|
|
1202
1257
|
});
|
|
@@ -1286,12 +1341,13 @@ const _excluded$41 = [
|
|
|
1286
1341
|
"children",
|
|
1287
1342
|
"className",
|
|
1288
1343
|
"size",
|
|
1289
|
-
"type"
|
|
1344
|
+
"type",
|
|
1345
|
+
"horizontal"
|
|
1290
1346
|
];
|
|
1291
1347
|
const ListsRoot = (_ref) => {
|
|
1292
|
-
let { children, className, size = "default", type = "bullet" } = _ref, rest = _objectWithoutProperties(_ref, _excluded$41);
|
|
1348
|
+
let { children, className, size = "default", type = "bullet", horizontal = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$41);
|
|
1293
1349
|
const Component = type === "number" ? "ol" : "ul";
|
|
1294
|
-
const listClasses = cn("kern-list", size !== "default" && `kern-list--${size}`, type && `kern-list--${type}`, className);
|
|
1350
|
+
const listClasses = cn("kern-list", size !== "default" && `kern-list--${size}`, type && `kern-list--${type}`, horizontal && "kern-list--horizontal", className);
|
|
1295
1351
|
return /* @__PURE__ */ jsx(Component, _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
1296
1352
|
className: listClasses,
|
|
1297
1353
|
children
|
|
@@ -1875,23 +1931,39 @@ const _excluded$18 = [
|
|
|
1875
1931
|
"variant",
|
|
1876
1932
|
"className",
|
|
1877
1933
|
"icon",
|
|
1934
|
+
"iconSize",
|
|
1878
1935
|
"showIcon"
|
|
1879
1936
|
];
|
|
1880
1937
|
const Badge = (_ref) => {
|
|
1881
|
-
let { title, variant, className, icon, showIcon = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$18);
|
|
1938
|
+
let { title, variant, className, icon, iconSize = "default", showIcon = false } = _ref, rest = _objectWithoutProperties(_ref, _excluded$18);
|
|
1939
|
+
const customIconElement = icon ? /* @__PURE__ */ jsx("span", {
|
|
1940
|
+
className: cn("kern-icon", `kern-icon--${iconSize}`),
|
|
1941
|
+
style: {
|
|
1942
|
+
mask: "none",
|
|
1943
|
+
WebkitMask: "none",
|
|
1944
|
+
background: "none",
|
|
1945
|
+
display: "inline-flex"
|
|
1946
|
+
},
|
|
1947
|
+
"aria-hidden": true,
|
|
1948
|
+
children: icon
|
|
1949
|
+
}) : null;
|
|
1882
1950
|
return /* @__PURE__ */ jsxs("span", _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
1883
1951
|
role: "status",
|
|
1884
1952
|
className: cn(`kern-badge kern-badge--${variant}`, className),
|
|
1885
|
-
children: [
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1953
|
+
children: [
|
|
1954
|
+
customIconElement,
|
|
1955
|
+
!icon && showIcon && /* @__PURE__ */ jsx(Icon, {
|
|
1956
|
+
"aria-hidden": true,
|
|
1957
|
+
name: variant
|
|
1958
|
+
}),
|
|
1959
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1960
|
+
className: "kern-label kern-label-small",
|
|
1961
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1962
|
+
className: "kern-label kern-sr-only",
|
|
1963
|
+
children: variant.replace(/^./, (c) => c.toUpperCase())
|
|
1964
|
+
}), title]
|
|
1965
|
+
})
|
|
1966
|
+
]
|
|
1895
1967
|
}));
|
|
1896
1968
|
};
|
|
1897
1969
|
|
|
@@ -2442,6 +2514,16 @@ const Kopfzeile = (_ref) => {
|
|
|
2442
2514
|
})), customStyle] });
|
|
2443
2515
|
};
|
|
2444
2516
|
|
|
2517
|
+
//#endregion
|
|
2518
|
+
//#region src/components/LinkButton/LinkButton.tsx
|
|
2519
|
+
const LinkButton = (props) => {
|
|
2520
|
+
if (!props.href) {
|
|
2521
|
+
console.error("href ist für LinkButton erforderlich");
|
|
2522
|
+
return null;
|
|
2523
|
+
}
|
|
2524
|
+
return /* @__PURE__ */ jsx(Button, _objectSpread2({ as: "a" }, props));
|
|
2525
|
+
};
|
|
2526
|
+
|
|
2445
2527
|
//#endregion
|
|
2446
2528
|
//#region src/components/Loader/Loader.tsx
|
|
2447
2529
|
const _excluded$3 = [
|
|
@@ -2587,5 +2669,5 @@ const Summary = Object.assign(SummaryRoot, Summary_exports);
|
|
|
2587
2669
|
const TaskList = Object.assign(TaskListRoot, TaskList_exports);
|
|
2588
2670
|
|
|
2589
2671
|
//#endregion
|
|
2590
|
-
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 };
|
|
2672
|
+
export { Accordion, Alert, Badge, Body, Button, Card, CheckboxInput, DateInput, DescriptionList, Dialog, Divider, EmailInput, Fieldset, FileInput, Grid, Heading, Icon, InputPrimitive, Kopfzeile, Label, Link, LinkButton, Lists, Loader, NumberInput, PasswordInput, Preline, Progress, RadioInput, SelectInput, Subline, Summary, Table, TaskList, TelInput, TextInput, TextareaInput, ThemeProvider, Title, UrlInput };
|
|
2591
2673
|
//# sourceMappingURL=index.js.map
|