@vodafone_de/brix-components 17.1.2 → 18.0.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/{BorderRadius-Co-IV3fn.js → BorderRadius-0jhn76gB.js} +2 -2
- package/dist/{BorderWidth-OZWeXaq_.js → BorderWidth-CwrNKc0Q.js} +2 -2
- package/dist/ButtonAppearanceHelper-3qIbHGWJ.js +102 -0
- package/dist/CornerStyle-n77nckhh.js +7 -0
- package/dist/{colorUtils-CfSj2Iqa.js → colorUtils-c9PiZEci.js} +1 -1
- package/dist/components/Accordion/index.js +8 -4
- package/dist/components/Accordion/validate.d.ts +2 -2
- package/dist/components/AccordionGroup/validate.d.ts +2 -2
- package/dist/components/ArtDirectedImage/index.js +3 -3
- package/dist/components/ArtDirectedImage/validate.d.ts +0 -9
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/validate.d.ts +1 -1
- package/dist/components/BottomBar/index.js +5 -5
- package/dist/components/Button/ButtonAppearanceHelper.test.d.ts +1 -0
- package/dist/components/Button/index.js +2 -2
- package/dist/components/Button/validate.d.ts +1 -1
- package/dist/components/ButtonAsLink/index.js +1 -1
- package/dist/components/ButtonGroup/validate.d.ts +1 -1
- package/dist/components/Calendar/components/Footer/helpers/getFooterText.test.d.ts +1 -0
- package/dist/components/Calendar/index.js +66 -62
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Carousel/index.js +1 -1
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/Collapsible/index.js +1 -1
- package/dist/components/ColorSwatch/index.js +2 -2
- package/dist/components/ConsentMessage/index.js +1 -1
- package/dist/components/Container/index.js +1 -1
- package/dist/components/DateInput/index.js +2 -2
- package/dist/components/Dialog/index.js +8 -3
- package/dist/components/Dialog/validate.d.ts +1 -1
- package/dist/components/DiscoveryCard/index.js +5 -5
- package/dist/components/DiscoveryCard/validate.d.ts +3 -12
- package/dist/components/DiscoveryCardGroup/index.js +2 -2
- package/dist/components/DiscoveryCardGroup/validate.d.ts +9 -36
- package/dist/components/EnergySnippet/validate.d.ts +1 -1
- package/dist/components/FeatureCardGroup/components/FeatureCard/index.js +9 -8
- package/dist/components/FeatureCardGroup/components/FeatureCard/validate.d.ts +2 -11
- package/dist/components/FeatureCardGroup/index.js +1 -1
- package/dist/components/FeatureCardGroup/validate.d.ts +6 -15
- package/dist/components/Fieldset/index.js +8 -3
- package/dist/components/Fieldset/validate.d.ts +3 -3
- package/dist/components/FilterGroup/index.js +2 -2
- package/dist/components/FilterGroup/validate.d.ts +5 -5
- package/dist/components/Footnote/index.js +1 -1
- package/dist/components/FootnoteContent/index.js +1 -1
- package/dist/components/FootnoteSection/index.js +1 -1
- package/dist/components/FootnoteSection/validate.d.ts +2 -2
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Form/validate.d.ts +4 -4
- package/dist/components/GoogleMap/index.js +31 -19
- package/dist/components/GoogleMap/props.d.ts +13 -1
- package/dist/components/GoogleMap/styled.d.ts +1 -1
- package/dist/components/GoogleMap/validate.d.ts +12 -3
- package/dist/components/Grid/index.js +2 -2
- package/dist/components/GridItem/index.js +2 -2
- package/dist/components/IconButton/index.js +4 -4
- package/dist/components/IconButton/validate.d.ts +1 -1
- package/dist/components/IconLoader/validate.d.ts +1 -1
- package/dist/components/IconSnippet/index.js +14 -24
- package/dist/components/IconSnippet/validate.d.ts +3 -3
- package/dist/components/IconSnippetList/index.js +1 -1
- package/dist/components/IconSnippetList/validate.d.ts +3 -3
- package/dist/components/Image/index.js +4 -52
- package/dist/components/Image/validate.d.ts +0 -9
- package/dist/components/ImageHeader/index.js +25 -19
- package/dist/components/ImageHeader/styled.d.ts +17 -0
- package/dist/components/ImageHeader/validate.d.ts +3 -12
- package/dist/components/InfoBanner/index.js +1 -1
- package/dist/components/InfoBanner/validate.d.ts +2 -2
- package/dist/components/InlineLink/index.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Input/validate.d.ts +1 -0
- package/dist/components/Legend/index.d.ts +1 -1
- package/dist/components/Legend/index.js +54 -68
- package/dist/components/Legend/validate.d.ts +6 -6
- package/dist/components/Link/index.js +1 -1
- package/dist/components/Link/validate.d.ts +1 -1
- package/dist/components/LinkAsButton/index.js +1 -1
- package/dist/components/LinkAsButton/validate.d.ts +1 -1
- package/dist/components/LinkList/index.js +25 -15
- package/dist/components/LinkList/styled.d.ts +1 -1
- package/dist/components/LinkListItem/index.js +15 -342
- package/dist/components/LinkListItem/props.d.ts +0 -4
- package/dist/components/LinkListItem/styled.d.ts +1 -1
- package/dist/components/LinkListItem/validate.d.ts +2 -3
- package/dist/components/LoadingSpinner/index.js +11 -10
- package/dist/components/LocalStyle/index.js +1 -1
- package/dist/components/MediaText/index.js +2 -2
- package/dist/components/MediaText/validate.d.ts +1 -10
- package/dist/components/Notification/index.js +20 -34
- package/dist/components/Notification/validate.d.ts +3 -3
- package/dist/components/OpenTextFootnoteAdapter/index.js +3 -3
- package/dist/components/PasswordInput/index.js +2 -2
- package/dist/components/PickerGroup/components/Picker/index.js +2 -2
- package/dist/components/PickerGroup/components/Picker/validate.d.ts +1 -1
- package/dist/components/PickerGroup/index.js +1 -1
- package/dist/components/PickerGroup/validate.d.ts +1 -1
- package/dist/components/Price/index.d.ts +0 -1
- package/dist/components/Price/index.js +61 -8
- package/dist/components/Price/props.d.ts +6 -6
- package/dist/components/ProductCard/index.js +4 -4
- package/dist/components/ProductCard/validate.d.ts +3 -12
- package/dist/components/QuickLinkList/components/QuickLink/index.js +2 -2
- package/dist/components/QuickLinkList/index.js +1 -1
- package/dist/components/RadioGroup/index.js +2 -2
- package/dist/components/Rating/index.js +1 -1
- package/dist/components/RichText/index.js +1 -1
- package/dist/components/RichText/parseHtml.d.ts +2 -1
- package/dist/components/RichTextContentful/getOptions.d.ts +6 -2
- package/dist/components/RichTextContentful/helpers/listHelpers.d.ts +1 -0
- package/dist/components/RichTextContentful/index.js +1 -1
- package/dist/components/RichTextContentful/props.d.ts +2 -1
- package/dist/components/RichTextContentful/styled.d.ts +5 -1
- package/dist/components/SearchInput/index.js +2 -2
- package/dist/components/SelectInput/index.js +1 -1
- package/dist/components/SuggestInput/components/SuggestInputList/index.d.ts +1 -1
- package/dist/components/SuggestInput/components/SuggestInputList/props.d.ts +0 -2
- package/dist/components/SuggestInput/index.js +20 -22
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/TabGroup/index.js +11 -4
- package/dist/components/TabGroup/validate.d.ts +2 -2
- package/dist/components/Table/index.js +2 -2
- package/dist/components/TabularPrice/index.js +3 -2
- package/dist/components/TextList/components/TextListItem/index.js +1 -1
- package/dist/components/TextList/index.js +1 -1
- package/dist/components/Textarea/index.js +1 -1
- package/dist/components/TimeInput/index.js +2 -2
- package/dist/components/ToggleButtonProvider/validate.d.ts +8 -8
- package/dist/components/Tray/index.d.ts +1 -1
- package/dist/components/Tray/index.js +20 -14
- package/dist/components/Tray/validate.d.ts +1 -1
- package/dist/components/UtilityLink/index.js +1 -18
- package/dist/components/Video/componentName.d.ts +1 -0
- package/dist/components/Video/i18n.d.ts +42 -0
- package/dist/components/Video/index.d.ts +5 -0
- package/dist/components/Video/index.js +902 -0
- package/dist/components/Video/props.d.ts +52 -0
- package/dist/components/Video/styled.d.ts +2 -0
- package/dist/components/Video/validate.d.ts +84 -0
- package/dist/components/Video/validate.test.d.ts +1 -0
- package/dist/components/YouTubeVideo/index.js +1 -1
- package/dist/contentful/props/index.d.ts +2 -0
- package/dist/contentful/registry/ContentFulComponentName.d.ts +1 -1
- package/dist/contentful/registry/SupportedBrixProps.d.ts +2 -2
- package/dist/contentful/registry/index.js +1 -1
- package/dist/contentful/validation/index.d.ts +1 -0
- package/dist/contentful/validation/index.js +38 -9
- package/dist/{cssVars-DIZd9rHN.js → cssVars-DKs5LlTN.js} +112 -108
- package/dist/foundations/BrixComponentProps/componentNames.d.ts +1 -1
- package/dist/foundations/BrixComponentProps/validate.d.ts +3 -0
- package/dist/foundations/GlobalStyle/index.js +1 -1
- package/dist/foundations/colorMaps.d.ts +18 -0
- package/dist/foundations/cssVars.d.ts +1 -7
- package/dist/foundations/cssVars.test.d.ts +1 -0
- package/dist/foundations/layout/index.js +23 -6
- package/dist/foundations/typographyAndIconSizeCssVars.d.ts +7 -0
- package/dist/getSizesFromGridConfig-C-GBct4J.js +28 -0
- package/dist/{index-XoIBkRyI.js → index-BLp5wi_X.js} +199 -171
- package/dist/{index-B7QEcUdq.js → index-BXTweg2t.js} +26 -52
- package/dist/{index-BR6u6rvI.js → index-CW-UuGll.js} +2 -2
- package/dist/{index-iCvdBgcJ.js → index-C_6tWuWh.js} +1 -1
- package/dist/{index-C9M-9a7m.js → index-Cms5ie2I.js} +4 -4
- package/dist/{index-DQ_p1dIc.js → index-CpuHeI4h.js} +2 -2
- package/dist/{index-BIa9NKUU.js → index-DqdKVD9N.js} +3 -3
- package/dist/{index-B0jIyAgf.js → index-E0RMtc9X.js} +1 -1
- package/dist/{index-CWByESA7.js → index-h88pZ6zH.js} +2 -2
- package/dist/{index-Dn3We7oE.js → index-p9ZTAIzJ.js} +3 -3
- package/dist/index-xzvddlgp.js +345 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +227 -222
- package/dist/opentext/index.js +1 -1
- package/dist/opentext/map/googleMap.d.ts +2 -1
- package/dist/{props-BPxy0GPb.js → props-Bod9bL2v.js} +4 -4
- package/dist/{props-P3bM0HEk.js → props-E4PNCuS6.js} +1 -4
- package/dist/props-n71pckjd.js +5 -0
- package/dist/{styled-DRNdxc1V.js → styled-BJ9cE7xy.js} +2 -2
- package/dist/styled-BrSdmb0C.js +52 -0
- package/dist/{styled-bzTYGIm_.js → styled-DDY0xAl_.js} +1 -1
- package/dist/{styled-DhKlciPC.js → styled-Dfbxuq_p.js} +1 -1
- package/dist/styled-R9Zq1ahD.js +21 -0
- package/dist/{styled-DYgC4qQm.js → styled-ldBsCamo.js} +2 -2
- package/dist/{youTubeVideo-BOudL3DM.js → youTubeVideo-CsdIB_iu.js} +30 -56
- package/package.json +2 -1
- package/dist/ButtonAppearanceHelper-BQUk7S3X.js +0 -92
- package/dist/components/AccordionGroup/stories/scrollToViewFixedHeaderStoryObj.d.ts +0 -2
- package/dist/components/Carousel/stories/productCards.d.ts +0 -8
- package/dist/components/Flex/stories/alignCenterArgs.d.ts +0 -2
- package/dist/components/Flex/stories/alignEndArgs.d.ts +0 -2
- package/dist/components/Flex/stories/alignStartArgs.d.ts +0 -2
- package/dist/components/Flex/stories/autoAndFullItemArgs.d.ts +0 -2
- package/dist/components/Flex/stories/autoAndFullItemVerticalArgs.d.ts +0 -2
- package/dist/components/Flex/stories/fullAndAutoItemArgs.d.ts +0 -2
- package/dist/components/Flex/stories/fullAndAutoItemVerticalArgs.d.ts +0 -2
- package/dist/components/Flex/stories/justifyBetweenArgs.d.ts +0 -2
- package/dist/components/Flex/stories/justifyBetweenVerticalArgs.d.ts +0 -2
- package/dist/components/Flex/stories/justifyCenterArgs.d.ts +0 -2
- package/dist/components/Flex/stories/justifyCenterVerticalArgs.d.ts +0 -2
- package/dist/components/Flex/stories/justifyEndArgs.d.ts +0 -2
- package/dist/components/Flex/stories/justifyEndVerticalArgs.d.ts +0 -2
- package/dist/components/Flex/stories/justifyStartArgs.d.ts +0 -2
- package/dist/components/Flex/stories/justifyStartVerticalArgs.d.ts +0 -2
- package/dist/components/Flex/stories/twoFullItemsArgs.d.ts +0 -2
- package/dist/components/Flex/stories/twoFullItemsVerticalArgs.d.ts +0 -2
- package/dist/components/Flex/stories/xlGapSpacingArgs.d.ts +0 -2
- package/dist/components/Grid/stories/alignGridCenterArgs.d.ts +0 -2
- package/dist/components/Grid/stories/alignGridItemArgs.d.ts +0 -2
- package/dist/components/Grid/stories/alignGridRightArgs.d.ts +0 -2
- package/dist/components/Grid/stories/grid12Args.d.ts +0 -2
- package/dist/components/Grid/stories/grid222222Args.d.ts +0 -2
- package/dist/components/Grid/stories/grid3333Args.d.ts +0 -2
- package/dist/components/Grid/stories/grid363Args.d.ts +0 -2
- package/dist/components/Grid/stories/grid444Args.d.ts +0 -2
- package/dist/components/Grid/stories/grid64Args.d.ts +0 -2
- package/dist/components/Grid/stories/grid66Args.d.ts +0 -2
- package/dist/components/Grid/stories/grid75Args.d.ts +0 -2
- package/dist/components/Grid/stories/nestingArgs.d.ts +0 -2
- package/dist/components/Grid/stories/noSpacingArgs.d.ts +0 -2
- package/dist/components/Grid/stories/offsetArgs.d.ts +0 -2
- package/dist/components/Grid/stories/responsiveArgs.d.ts +0 -2
- package/dist/components/Grid/stories/stretchArgs.d.ts +0 -2
- package/dist/components/Grid/stories/tagOrderedListArgs.d.ts +0 -2
- package/dist/components/Grid/stories/tagUnorderedListArgs.d.ts +0 -2
- package/dist/getSizesFromGridConfig-BqDW79mt.js +0 -48
|
@@ -106,6 +106,7 @@ export declare const minimalPropsSchema: z.ZodObject<{
|
|
|
106
106
|
ToggleButtonProvider: "ToggleButtonProvider";
|
|
107
107
|
Tray: "Tray";
|
|
108
108
|
UtilityLink: "UtilityLink";
|
|
109
|
+
Video: "Video";
|
|
109
110
|
YouTubeVideo: "YouTubeVideo";
|
|
110
111
|
}>;
|
|
111
112
|
uid: z.ZodString;
|
|
@@ -215,6 +216,7 @@ export declare const cmsBrixComponentPropsSchema: z.ZodObject<{
|
|
|
215
216
|
ToggleButtonProvider: "ToggleButtonProvider";
|
|
216
217
|
Tray: "Tray";
|
|
217
218
|
UtilityLink: "UtilityLink";
|
|
219
|
+
Video: "Video";
|
|
218
220
|
YouTubeVideo: "YouTubeVideo";
|
|
219
221
|
}>;
|
|
220
222
|
uid: z.ZodString;
|
|
@@ -385,6 +387,7 @@ export declare const cmsPatternPropsSchema: z.ZodObject<{
|
|
|
385
387
|
ToggleButtonProvider: "ToggleButtonProvider";
|
|
386
388
|
Tray: "Tray";
|
|
387
389
|
UtilityLink: "UtilityLink";
|
|
390
|
+
Video: "Video";
|
|
388
391
|
YouTubeVideo: "YouTubeVideo";
|
|
389
392
|
}>;
|
|
390
393
|
uid: z.ZodString;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Color } from './token/base/baseColors';
|
|
2
|
+
import { BackgroundColor } from './types/BackgroundColor';
|
|
3
|
+
import { BorderColor } from './types/BorderColor';
|
|
4
|
+
import { IconColor } from './types/IconColor';
|
|
5
|
+
import { ObjectColor } from './types/ObjectColor';
|
|
6
|
+
import { TextColor } from './types/TextColor';
|
|
7
|
+
import { Theme } from './types/Theme';
|
|
8
|
+
/**
|
|
9
|
+
* Raw color token maps used to generate the CSS custom properties in cssVars.tsx.
|
|
10
|
+
* Kept in their own file so cssVars.tsx itself stays focused on the CSS variable
|
|
11
|
+
* string generation (which needs to stay a single file, see cssVars.test.ts).
|
|
12
|
+
*/
|
|
13
|
+
export declare const baseColors: Record<Color, string>;
|
|
14
|
+
export declare const backgroundColors: Record<BackgroundColor, Record<Theme, Color>>;
|
|
15
|
+
export declare const borderColors: Record<BorderColor, Record<Theme, Color>>;
|
|
16
|
+
export declare const iconColors: Record<IconColor, Record<Theme, Color>>;
|
|
17
|
+
export declare const objectColors: Record<ObjectColor, Record<Theme, Color>>;
|
|
18
|
+
export declare const textColors: Record<TextColor, Record<Theme, Color>>;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { BackgroundColor } from './types/BackgroundColor';
|
|
3
|
-
import { ObjectColor } from './types/ObjectColor';
|
|
4
|
-
import { Theme } from './types/Theme';
|
|
5
|
-
export declare const baseColors: Record<Color, string>;
|
|
6
|
-
export declare const backgroundColors: Record<BackgroundColor, Record<Theme, Color>>;
|
|
7
|
-
export declare const objectColors: Record<ObjectColor, Record<Theme, Color>>;
|
|
1
|
+
export { backgroundColors, baseColors, objectColors } from './colorMaps';
|
|
8
2
|
export declare const cssVarsString: string;
|
|
9
3
|
export declare const cssVars: import('styled-components').RuleSet<object>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { m as mediumMediaQuery, l as largeMediaQuery } from "../../index-CG4uiVbZ.js";
|
|
2
2
|
import { g as getSpacing } from "../../index-l-i-mIeP.js";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const translatedProps = Object.fromEntries(Object.entries(layoutProps).filter(([key]) => !responsiveKeys.includes(key)));
|
|
3
|
+
const spacingKeys = ["top", "bottom", "left", "right", "marginTop", "marginLeft", "marginRight"];
|
|
4
|
+
const responsiveKeys = ["flexDirection", "justifyContent", "alignItems", "alignSelf", "width", "height", "minWidth", "maxWidth", "minHeight", "maxHeight"];
|
|
5
|
+
const applySpacingProps = (translatedProps, layoutProps) => {
|
|
7
6
|
spacingKeys.forEach((key) => {
|
|
8
7
|
if (layoutProps[key] !== void 0) {
|
|
9
8
|
translatedProps[key] = getSpacing(layoutProps[key]);
|
|
10
9
|
}
|
|
11
10
|
});
|
|
11
|
+
};
|
|
12
|
+
const applyStickyOrFixedTopOffset = (translatedProps, layoutProps) => {
|
|
12
13
|
if (layoutProps.top && (layoutProps.position === "sticky" || layoutProps.position === "fixed")) {
|
|
13
14
|
translatedProps.top = `calc(var(--header-height) + ${translatedProps.top})`;
|
|
14
15
|
}
|
|
16
|
+
};
|
|
17
|
+
const applyResponsiveProps = (translatedProps, layoutProps) => {
|
|
15
18
|
let mdStyles = {};
|
|
16
19
|
let lgStyles = {};
|
|
17
20
|
responsiveKeys.forEach((key) => {
|
|
@@ -40,10 +43,24 @@ const translateLayoutPropsToCss = (layoutProps) => {
|
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
45
|
});
|
|
43
|
-
|
|
46
|
+
return {
|
|
47
|
+
mdStyles,
|
|
48
|
+
lgStyles
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const translateLayoutPropsToCss = (layoutProps) => {
|
|
52
|
+
const translatedProps = Object.fromEntries(Object.entries(layoutProps).filter(([key]) => !responsiveKeys.includes(key)));
|
|
53
|
+
const mutableProps = translatedProps;
|
|
54
|
+
applySpacingProps(mutableProps, layoutProps);
|
|
55
|
+
applyStickyOrFixedTopOffset(mutableProps, layoutProps);
|
|
56
|
+
const {
|
|
57
|
+
mdStyles,
|
|
58
|
+
lgStyles
|
|
59
|
+
} = applyResponsiveProps(mutableProps, layoutProps);
|
|
60
|
+
if (Object.keys(mdStyles).length !== 0) mutableProps[`@media ${mediumMediaQuery}`] = {
|
|
44
61
|
...mdStyles
|
|
45
62
|
};
|
|
46
|
-
if (Object.keys(lgStyles).length !== 0)
|
|
63
|
+
if (Object.keys(lgStyles).length !== 0) mutableProps[`@media ${largeMediaQuery}`] = {
|
|
47
64
|
...lgStyles
|
|
48
65
|
};
|
|
49
66
|
return translatedProps;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography (body/heading font-size and line-height) and icon-size CSS custom properties.
|
|
3
|
+
* Split out of cssVars.tsx because this part of the CSS var string is purely breakpoint-driven
|
|
4
|
+
* (no color token lookups), unlike the rest of cssVarsString which the cssVars.test.ts regression
|
|
5
|
+
* test parses for color-map wiring.
|
|
6
|
+
*/
|
|
7
|
+
export declare const typographyAndIconSizeCssVars = "\n :root {\n --bodyMdFontSize: var(--fontSize16);\n --bodyMdLineHeight: var(--lineHeight125);\n\n @media screen and (min-width: 768px) {\n --bodyMdFontSize: var(--fontSize18);\n --bodyMdLineHeight: var(--lineHeight144);\n }\n\n --bodySmFontSize: var(--fontSize14);\n --bodySmLineHeight: var(--lineHeight128);\n\n --headingXlFontSize: var(--fontSize32);\n --headingXlLineHeight: var(--lineHeight125);\n\n @media screen and (min-width: 768px) {\n --headingXlFontSize: var(--fontSize56);\n --headingXlLineHeight: var(--lineHeight114);\n }\n @media screen and (min-width: 1025px) {\n --headingXlFontSize: var(--fontSize64);\n --headingXlLineHeight: var(--lineHeight112);\n }\n\n --headingLgFontSize: var(--fontSize28);\n --headingLgLineHeight: var(--lineHeight128);\n\n @media screen and (min-width: 768px) {\n --headingLgFontSize: var(--fontSize40);\n --headingLgLineHeight: var(--lineHeight120);\n }\n @media screen and (min-width: 1025px) {\n --headingLgFontSize: var(--fontSize56);\n --headingLgLineHeight: var(--lineHeight114);\n }\n\n --headingMdFontSize: var(--fontSize24);\n --headingMdLineHeight: var(--lineHeight133);\n\n @media screen and (min-width: 768px) {\n --headingMdFontSize: var(--fontSize32);\n --headingMdLineHeight: var(--lineHeight125);\n }\n @media screen and (min-width: 1025px) {\n --headingMdFontSize: var(--fontSize40);\n --headingMdLineHeight: var(--lineHeight120);\n }\n\n --headingSmFontSize: var(--fontSize20);\n --headingSmLineHeight: var(--lineHeight140);\n\n @media screen and (min-width: 768px) {\n --headingSmFontSize: var(--fontSize24);\n --headingSmLineHeight: var(--lineHeight133);\n }\n @media screen and (min-width: 1025px) {\n --headingSmFontSize: var(--fontSize28);\n --headingSmLineHeight: var(--lineHeight128);\n }\n\n --headingXsFontSize: var(--fontSize18);\n --headingXsLineHeight: var(--lineHeight144);\n\n @media screen and (min-width: 768px) {\n --headingXsFontSize: var(--fontSize20);\n --headingXsLineHeight: var(--lineHeight140);\n }\n @media screen and (min-width: 1025px) {\n --headingXsFontSize: var(--fontSize20);\n --headingXsLineHeight: var(--lineHeight140);\n }\n }\n :root {\n --iconSize2xs: 16px;\n --iconSizeXs: 20px;\n --iconSizeSm: 20px;\n --iconSizeMd: 24px;\n --iconSizeLg: 32px;\n --iconSizeXl: 36px;\n --iconSize2xl: 40px;\n --iconSize3xl: 48px;\n --iconSize4xl: 56px;\n --iconSize5xl: 64px;\n --iconSize6xl: 72px;\n --iconSize7xl: 84px;\n --iconSize8xl: 96px;\n --iconSize9xl: 120px;\n\n @media screen and (min-width: 768px) {\n --iconSize2xs: 16px;\n --iconSizeXs: 20px;\n --iconSizeSm: 24px;\n --iconSizeMd: 32px;\n --iconSizeLg: 36px;\n --iconSizeXl: 40px;\n --iconSize2xl: 48px;\n --iconSize3xl: 56px;\n --iconSize4xl: 64px;\n --iconSize5xl: 72px;\n --iconSize6xl: 84px;\n --iconSize7xl: 96px;\n --iconSize8xl: 120px;\n --iconSize9xl: 192px;\n }\n }\n";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { m as maxWidthBreakpoint, c as containerMaxWidth } from "./index-C_6tWuWh.js";
|
|
2
|
+
import { b as breakpoint_medium, a as breakpoint_large } from "./index-CG4uiVbZ.js";
|
|
3
|
+
const toVw = (cols) => cols ? `${cols / 12 * 100}vw` : void 0;
|
|
4
|
+
const toPx = (cols) => cols ? `${containerMaxWidth * cols / 12}px` : void 0;
|
|
5
|
+
const getSizesFromGridConfig = (gridConfig, containerContext = false) => {
|
|
6
|
+
const sm = toVw(gridConfig.sm) ?? "100vw";
|
|
7
|
+
const smPx = toPx(gridConfig.sm) ?? "1240px";
|
|
8
|
+
const md = toVw(gridConfig.md);
|
|
9
|
+
const mdPx = toPx(gridConfig.md);
|
|
10
|
+
const lg = toVw(gridConfig.lg);
|
|
11
|
+
const lgPx = toPx(gridConfig.lg);
|
|
12
|
+
const segments = [];
|
|
13
|
+
if (md && sm !== md) {
|
|
14
|
+
segments.push(`(max-width: ${breakpoint_medium}) ${sm}`);
|
|
15
|
+
}
|
|
16
|
+
if (lg) {
|
|
17
|
+
segments.push(`(max-width: ${breakpoint_large}) ${md ?? sm}`);
|
|
18
|
+
}
|
|
19
|
+
const finalVw = lg ?? md ?? sm;
|
|
20
|
+
const finalPx = lgPx ?? mdPx ?? smPx;
|
|
21
|
+
if (!containerContext) {
|
|
22
|
+
return [...segments, finalVw].join(", ");
|
|
23
|
+
}
|
|
24
|
+
return [...segments, `(max-width: ${maxWidthBreakpoint}px) ${finalVw}, ${finalPx}`].join(", ");
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
getSizesFromGridConfig as g
|
|
28
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { isValidElement, cloneElement, createElement, useEffect } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { c as spanTagName, d as divTagName, g as headingHtmlTags, f as supTagName, e as strongTagName, r as olTagName, u as ulTagName } from "./tags-BeNegJAK.js";
|
|
4
4
|
import { c as spacingSm, b as spacingNone, s as spacingMd } from "./Spacing-Dj-qX3Z5.js";
|
|
5
5
|
import parse, { Element, domToReact } from "html-react-parser";
|
|
6
6
|
import Body from "./components/Body/index.js";
|
|
@@ -18,12 +18,13 @@ import { f as colorBorderSubtle, a as colorBorderNeutral } from "./BorderColor-B
|
|
|
18
18
|
import { a as fontWeightBold, f as fontWeightRegular } from "./FontWeight-C8c-UnWu.js";
|
|
19
19
|
import { a as colorTextNeutral } from "./TextColor-DsntmDNw.js";
|
|
20
20
|
import Divider from "./components/Divider/index.js";
|
|
21
|
+
import { getBottomSpacing } from "./foundations/token/getBottomSpacing/index.js";
|
|
22
|
+
import { s as shouldForwardProp } from "./shouldForwardProp-CONMmlMa.js";
|
|
21
23
|
import { translateLayoutPropsToCss } from "./foundations/layout/index.js";
|
|
22
24
|
import { getBodySize } from "./foundations/token/getBodySize/index.js";
|
|
23
|
-
import { getBottomSpacing } from "./foundations/token/getBottomSpacing/index.js";
|
|
24
25
|
import { a as textBodySm, t as textBodyMd } from "./TextBodySize-CP9q4gRv.js";
|
|
25
|
-
import { s as shouldForwardProp } from "./shouldForwardProp-CONMmlMa.js";
|
|
26
26
|
import "./index-Dgu9iIhb.js";
|
|
27
|
+
import "./props-GrMT6XLD.js";
|
|
27
28
|
import "./hooks/useLinkComponent/index.js";
|
|
28
29
|
import { t as textHeadingXs, a as textHeadingSm, b as textHeadingMd, c as textHeadingLg, d as textHeadingXl } from "./HeadingSize-O__w72MO.js";
|
|
29
30
|
var ElementType;
|
|
@@ -430,7 +431,8 @@ const createListItems = (content, listType) => content.map((item, index) => ({
|
|
|
430
431
|
uid: `contentful-${listType}-item-${index}`,
|
|
431
432
|
richText: {
|
|
432
433
|
component: richTextContentfulComponentName,
|
|
433
|
-
html: wrapInDocument(item.content)
|
|
434
|
+
html: wrapInDocument(item.content),
|
|
435
|
+
paragraphSpacing: spacingNone
|
|
434
436
|
}
|
|
435
437
|
}));
|
|
436
438
|
const getCellDataValue = (cell, key) => {
|
|
@@ -546,29 +548,29 @@ const contentfulHeaderlessTableToTableProps = (tableRows) => {
|
|
|
546
548
|
footCells: footerRow ? mapTableCells(footerRow, false, true) : void 0
|
|
547
549
|
};
|
|
548
550
|
};
|
|
549
|
-
const getOptions$1 = (
|
|
551
|
+
const getOptions$1 = (tagProps = {}) => {
|
|
550
552
|
const options = {
|
|
551
553
|
renderMark: {
|
|
552
554
|
[MARKS.BOLD]: (text) => {
|
|
553
|
-
return /* @__PURE__ */ jsx(Body, { tag: "strong", children: text });
|
|
555
|
+
return /* @__PURE__ */ jsx(Body, { tag: "strong", bottomSpacing: spacingNone, children: text });
|
|
554
556
|
},
|
|
555
557
|
[MARKS.ITALIC]: (text) => {
|
|
556
|
-
return /* @__PURE__ */ jsx(Body, { tag: "span", children: text });
|
|
558
|
+
return /* @__PURE__ */ jsx(Body, { tag: "span", bottomSpacing: spacingNone, children: text });
|
|
557
559
|
},
|
|
558
560
|
[MARKS.UNDERLINE]: (text) => {
|
|
559
|
-
return /* @__PURE__ */ jsx(Body, { tag: "span", children: text });
|
|
561
|
+
return /* @__PURE__ */ jsx(Body, { tag: "span", bottomSpacing: spacingNone, children: text });
|
|
560
562
|
},
|
|
561
563
|
[MARKS.CODE]: (text) => {
|
|
562
|
-
return /* @__PURE__ */ jsx(Body, { tag: "span", children: text });
|
|
564
|
+
return /* @__PURE__ */ jsx(Body, { tag: "span", bottomSpacing: spacingNone, children: text });
|
|
563
565
|
},
|
|
564
566
|
[MARKS.SUPERSCRIPT]: (text) => {
|
|
565
|
-
return /* @__PURE__ */ jsx(Body, { tag: "sup", children: text });
|
|
567
|
+
return /* @__PURE__ */ jsx(Body, { tag: "sup", bottomSpacing: spacingNone, children: text });
|
|
566
568
|
},
|
|
567
569
|
[MARKS.SUBSCRIPT]: (text) => {
|
|
568
|
-
return /* @__PURE__ */ jsx(Body, { tag: "span", children: text });
|
|
570
|
+
return /* @__PURE__ */ jsx(Body, { tag: "span", bottomSpacing: spacingNone, children: text });
|
|
569
571
|
},
|
|
570
572
|
[MARKS.STRIKETHROUGH]: (text) => {
|
|
571
|
-
return /* @__PURE__ */ jsx(Body, { tag: "span", children: text });
|
|
573
|
+
return /* @__PURE__ */ jsx(Body, { tag: "span", bottomSpacing: spacingNone, children: text });
|
|
572
574
|
}
|
|
573
575
|
},
|
|
574
576
|
renderNode: {
|
|
@@ -576,34 +578,34 @@ const getOptions$1 = (paragraphSpacing = void 0, tagProps = {}) => {
|
|
|
576
578
|
if (node.data.nestedPatch) {
|
|
577
579
|
return children;
|
|
578
580
|
}
|
|
579
|
-
return /* @__PURE__ */ jsx(Body, { ...tagProps.p, bottomSpacing:
|
|
581
|
+
return /* @__PURE__ */ jsx(Body, { ...tagProps.p, bottomSpacing: spacingNone, children });
|
|
580
582
|
},
|
|
581
583
|
[BLOCKS.HEADING_1]: (_block, children) => {
|
|
582
|
-
return /* @__PURE__ */ jsx(Heading, { size: "xl", children });
|
|
584
|
+
return /* @__PURE__ */ jsx(Heading, { size: "xl", bottomSpacing: spacingNone, children });
|
|
583
585
|
},
|
|
584
586
|
[BLOCKS.HEADING_2]: (_block, children) => {
|
|
585
|
-
return /* @__PURE__ */ jsx(Heading, { size: "lg", children });
|
|
587
|
+
return /* @__PURE__ */ jsx(Heading, { size: "lg", bottomSpacing: spacingNone, children });
|
|
586
588
|
},
|
|
587
589
|
[BLOCKS.HEADING_3]: (_block, children) => {
|
|
588
|
-
return /* @__PURE__ */ jsx(Heading, { size: "md", children });
|
|
590
|
+
return /* @__PURE__ */ jsx(Heading, { size: "md", bottomSpacing: spacingNone, children });
|
|
589
591
|
},
|
|
590
592
|
[BLOCKS.HEADING_4]: (_block, children) => {
|
|
591
|
-
return /* @__PURE__ */ jsx(Heading, { size: "sm", children });
|
|
593
|
+
return /* @__PURE__ */ jsx(Heading, { size: "sm", bottomSpacing: spacingNone, children });
|
|
592
594
|
},
|
|
593
595
|
[BLOCKS.HEADING_5]: (_block, children) => {
|
|
594
|
-
return /* @__PURE__ */ jsx(Heading, { size: "xs", children });
|
|
596
|
+
return /* @__PURE__ */ jsx(Heading, { size: "xs", bottomSpacing: spacingNone, children });
|
|
595
597
|
},
|
|
596
598
|
[BLOCKS.HEADING_6]: (_block, children) => {
|
|
597
|
-
return /* @__PURE__ */ jsx(Heading, { tag: "h6", size: "xs", children });
|
|
599
|
+
return /* @__PURE__ */ jsx(Heading, { tag: "h6", size: "xs", bottomSpacing: spacingNone, children });
|
|
598
600
|
},
|
|
599
601
|
[BLOCKS.OL_LIST]: (block, _children) => {
|
|
600
|
-
return /* @__PURE__ */ jsx(TextList, { tag: "ol", items: createListItems(block.content, "ol") });
|
|
602
|
+
return /* @__PURE__ */ jsx(TextList, { tag: "ol", items: createListItems(block.content, "ol"), bottomSpacing: spacingNone });
|
|
601
603
|
},
|
|
602
604
|
[BLOCKS.UL_LIST]: (block, _children) => {
|
|
603
|
-
return /* @__PURE__ */ jsx(TextList, { tag: "ul", items: createListItems(block.content, "ul") });
|
|
605
|
+
return /* @__PURE__ */ jsx(TextList, { tag: "ul", items: createListItems(block.content, "ul"), bottomSpacing: spacingNone });
|
|
604
606
|
},
|
|
605
607
|
[BLOCKS.HR]: () => {
|
|
606
|
-
return /* @__PURE__ */ jsx(Divider, {});
|
|
608
|
+
return /* @__PURE__ */ jsx(Divider, { bottomSpacing: spacingNone });
|
|
607
609
|
},
|
|
608
610
|
[BLOCKS.TABLE]: (node) => {
|
|
609
611
|
const tableRows = node.content.filter((row) => row.nodeType === BLOCKS.TABLE_ROW);
|
|
@@ -648,15 +650,31 @@ const RichTextContentfulStyled = styled.div.withConfig({
|
|
|
648
650
|
shouldForwardProp,
|
|
649
651
|
displayName: "RichTextContentfulStyled",
|
|
650
652
|
componentId: "sc-114rr0m-0"
|
|
651
|
-
})(
|
|
652
|
-
|
|
653
|
-
}) => ({
|
|
654
|
-
...getBottomSpacing({
|
|
653
|
+
})(
|
|
654
|
+
({
|
|
655
655
|
bottomSpacing
|
|
656
|
-
})
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
})
|
|
656
|
+
}) => ({
|
|
657
|
+
...getBottomSpacing({
|
|
658
|
+
bottomSpacing
|
|
659
|
+
})
|
|
660
|
+
}),
|
|
661
|
+
/**
|
|
662
|
+
* The spacing between content blocks is owned by this container instead of the
|
|
663
|
+
* individual blocks. An inline root (`span`) must stay in the phrasing content
|
|
664
|
+
* flow, so it cannot become a flex container.
|
|
665
|
+
*/
|
|
666
|
+
({
|
|
667
|
+
as,
|
|
668
|
+
paragraphSpacing = spacingMd
|
|
669
|
+
}) => as === spanTagName ? {} : {
|
|
670
|
+
display: "flex",
|
|
671
|
+
flexDirection: "column",
|
|
672
|
+
gap: getSpacing(paragraphSpacing)
|
|
673
|
+
},
|
|
674
|
+
({
|
|
675
|
+
layout
|
|
676
|
+
}) => layout && translateLayoutPropsToCss(layout)
|
|
677
|
+
);
|
|
660
678
|
const richTextContentfulTags = [divTagName, spanTagName];
|
|
661
679
|
const RichTextContentful = ({
|
|
662
680
|
html,
|
|
@@ -667,8 +685,8 @@ const RichTextContentful = ({
|
|
|
667
685
|
...props
|
|
668
686
|
}) => {
|
|
669
687
|
var _a;
|
|
670
|
-
const rendered = documentToReactComponents(html, getOptions$1(
|
|
671
|
-
return /* @__PURE__ */ jsx(RichTextContentfulStyled, { ...props, as: (_a = tagProps.root) == null ? void 0 : _a.tag, bottomSpacing, layout, children: rendered });
|
|
688
|
+
const rendered = documentToReactComponents(html, getOptions$1(tagProps));
|
|
689
|
+
return /* @__PURE__ */ jsx(RichTextContentfulStyled, { ...props, as: (_a = tagProps.root) == null ? void 0 : _a.tag, paragraphSpacing, bottomSpacing, layout, children: rendered });
|
|
672
690
|
};
|
|
673
691
|
const TableCell = ({
|
|
674
692
|
richText,
|
|
@@ -732,154 +750,164 @@ const mapSizeToTag = {
|
|
|
732
750
|
h5: textHeadingXs,
|
|
733
751
|
h6: textHeadingXs
|
|
734
752
|
};
|
|
753
|
+
const footnoteScreenReaderLabel = "Details zur Fußnote";
|
|
735
754
|
const getTableAlign = (align) => {
|
|
736
755
|
return align === tableAlignLeft || align === tableAlignRight ? align : void 0;
|
|
737
756
|
};
|
|
738
|
-
const
|
|
739
|
-
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
757
|
+
const findChildElement = (node, name) => node.children.find((child) => child instanceof Element && child.name === name);
|
|
758
|
+
const getTextListItemHtml = (listItemNode) => {
|
|
759
|
+
const childrenHtml = render(listItemNode.children);
|
|
760
|
+
if (childrenHtml.trim()) {
|
|
761
|
+
return childrenHtml;
|
|
762
|
+
}
|
|
763
|
+
return render(listItemNode).replace(/^<li[^>]*>/, "").replace(/<\/li>$/, "");
|
|
764
|
+
};
|
|
765
|
+
const createTextListItems = (listNode, listKey, itemProps) => listNode.children.flatMap((child, itemIndex) => {
|
|
766
|
+
if (!(child instanceof Element) || child.name !== "li") {
|
|
767
|
+
return [];
|
|
768
|
+
}
|
|
769
|
+
return [{
|
|
770
|
+
...itemProps,
|
|
771
|
+
uid: `${listKey}-item-${itemIndex}`,
|
|
772
|
+
richText: {
|
|
773
|
+
component: richTextComponentName,
|
|
774
|
+
html: getTextListItemHtml(child)
|
|
744
775
|
}
|
|
745
|
-
|
|
776
|
+
}];
|
|
777
|
+
});
|
|
778
|
+
const parseTableCells = (tr) => tr.children.filter((cell) => cell instanceof Element && (cell.name === "td" || cell.name === "th")).map((cell) => {
|
|
779
|
+
const attribs = cell.attribs || {};
|
|
780
|
+
return {
|
|
781
|
+
richText: {
|
|
782
|
+
component: richTextComponentName,
|
|
783
|
+
html: render(cell.children)
|
|
784
|
+
},
|
|
785
|
+
align: getTableAlign(attribs.align),
|
|
786
|
+
as: cell.name === "th" ? "th" : "td",
|
|
787
|
+
colSpan: attribs.colspan ? parseInt(attribs.colspan, 10) : void 0,
|
|
788
|
+
scope: attribs.scope
|
|
746
789
|
};
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
790
|
+
});
|
|
791
|
+
const parseTableColumns = (thead) => {
|
|
792
|
+
const tr = thead && findChildElement(thead, "tr");
|
|
793
|
+
if (!tr) {
|
|
794
|
+
return [];
|
|
795
|
+
}
|
|
796
|
+
return tr.children.filter((child) => child instanceof Element && child.name === "th").map((th, i) => {
|
|
797
|
+
const attribs = th.attribs || {};
|
|
798
|
+
return {
|
|
799
|
+
key: attribs.key || `col${i}`,
|
|
800
|
+
label: {
|
|
801
|
+
component: richTextComponentName,
|
|
802
|
+
html: render(th.children)
|
|
803
|
+
},
|
|
804
|
+
align: getTableAlign(attribs.align)
|
|
805
|
+
};
|
|
806
|
+
});
|
|
807
|
+
};
|
|
808
|
+
const parseTableRows = (tbody) => {
|
|
809
|
+
var _a;
|
|
810
|
+
if (!tbody) {
|
|
811
|
+
return {
|
|
812
|
+
rows: [],
|
|
813
|
+
sideHeader: false
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
const sideheaderAttrib = (_a = tbody.attribs) == null ? void 0 : _a.sideheader;
|
|
817
|
+
const sideHeader = typeof sideheaderAttrib !== "undefined" && (sideheaderAttrib === "" || sideheaderAttrib === "true");
|
|
818
|
+
const rows = tbody.children.filter((child) => child instanceof Element && child.name === "tr").map((tr, i) => ({
|
|
819
|
+
key: `row${i}`,
|
|
820
|
+
cells: parseTableCells(tr)
|
|
821
|
+
}));
|
|
822
|
+
return {
|
|
823
|
+
rows,
|
|
824
|
+
sideHeader
|
|
825
|
+
};
|
|
826
|
+
};
|
|
827
|
+
const parseTableFootCells = (tfoot) => {
|
|
828
|
+
const tr = tfoot && findChildElement(tfoot, "tr");
|
|
829
|
+
return tr ? parseTableCells(tr) : [];
|
|
830
|
+
};
|
|
831
|
+
const getTableProps = (domNode) => {
|
|
832
|
+
const thead = findChildElement(domNode, "thead");
|
|
833
|
+
const tbody = findChildElement(domNode, "tbody");
|
|
834
|
+
const tfoot = findChildElement(domNode, "tfoot");
|
|
835
|
+
const {
|
|
836
|
+
rows,
|
|
837
|
+
sideHeader
|
|
838
|
+
} = parseTableRows(tbody);
|
|
839
|
+
const footCells = parseTableFootCells(tfoot);
|
|
840
|
+
return {
|
|
841
|
+
columns: parseTableColumns(thead),
|
|
842
|
+
rows,
|
|
843
|
+
sideHeader,
|
|
844
|
+
footCells: footCells.length ? footCells : void 0
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
const renderHeading = (domNode, key, options, paragraphSpacing, headingProps) => /* @__PURE__ */ jsx(Heading, { ...headingProps, size: mapSizeToTag[domNode.name], bottomSpacing: paragraphSpacing, children: domToReact(domNode.children, options) }, key);
|
|
848
|
+
const renderList = (domNode, key, listProps, itemProps, tag) => /* @__PURE__ */ jsx(TextList, { ...listProps, ...tag ? {
|
|
849
|
+
tag
|
|
850
|
+
} : {}, items: createTextListItems(domNode, key, itemProps) }, key);
|
|
851
|
+
const renderTable = (domNode, key) => /* @__PURE__ */ jsx(TableWrapper, { ...getTableProps(domNode) }, key);
|
|
852
|
+
const renderStrong = (domNode, key, options, strongProps) => /* @__PURE__ */ jsx(Body, { ...strongProps, tag: strongTagName, children: domToReact(domNode.children, options) }, key);
|
|
853
|
+
const renderSmall = (domNode, key, options, smallProps) => /* @__PURE__ */ jsx(Body, { ...smallProps, size: textBodySm, children: domToReact(domNode.children, options) }, key);
|
|
854
|
+
const renderSup = (domNode, key, options, supProps, uidState) => {
|
|
855
|
+
const children = domToReact(domNode.children, options);
|
|
856
|
+
if (Number.isInteger(parseInt(children))) {
|
|
857
|
+
uidState.current += 1;
|
|
858
|
+
return /* @__PURE__ */ jsx(FootnoteLink, { uid: `footnote-link-${uidState.current}-${children}`, contentUid: `footnote-content-${children}`, screenReaderLabel: footnoteScreenReaderLabel, children }, key);
|
|
859
|
+
}
|
|
860
|
+
return /* @__PURE__ */ jsx(Body, { ...supProps, tag: supTagName, children }, key);
|
|
861
|
+
};
|
|
862
|
+
const renderParagraph = (domNode, key, options, paragraphSpacing, pProps) => {
|
|
863
|
+
if (domNode.children.some((child) => child instanceof Element && (child.name === "ol" || child.name === "ul"))) {
|
|
864
|
+
return domToReact(domNode.children, options);
|
|
865
|
+
}
|
|
866
|
+
return /* @__PURE__ */ jsx(Body, { ...pProps, bottomSpacing: paragraphSpacing, children: domToReact(domNode.children, options) }, key);
|
|
867
|
+
};
|
|
868
|
+
const renderLink = (domNode, key, options, aProps, uidState) => {
|
|
869
|
+
const linkLabel = domToReact(domNode.children, options);
|
|
870
|
+
const isNumber = parseInt(linkLabel, 10);
|
|
871
|
+
const href = domNode.attribs.href;
|
|
872
|
+
const isAnchor = href && href.indexOf("#") === 0;
|
|
873
|
+
if (!isNaN(isNumber) && isAnchor) {
|
|
874
|
+
return /* @__PURE__ */ jsx(FootnoteLink, { uid: `${uidState.current}`, contentUid: href.replace("#", ""), screenReaderLabel: footnoteScreenReaderLabel, children: linkLabel }, key);
|
|
875
|
+
}
|
|
876
|
+
return /* @__PURE__ */ jsx(InlineLink, { ...aProps, href: domNode.attribs.href, target: domNode.attribs.target, children: domToReact(domNode.children, options) }, key);
|
|
877
|
+
};
|
|
878
|
+
const tagHandlers = {
|
|
879
|
+
li: () => null,
|
|
880
|
+
ol: (domNode, key, ctx) => renderList(domNode, key, ctx.additionalProps.ol, ctx.additionalProps.li, olTagName),
|
|
881
|
+
ul: (domNode, key, ctx) => renderList(domNode, key, ctx.additionalProps.ul, ctx.additionalProps.li),
|
|
882
|
+
table: (domNode, key) => renderTable(domNode, key),
|
|
883
|
+
strong: (domNode, key, ctx) => renderStrong(domNode, key, ctx.options, ctx.additionalProps.strong),
|
|
884
|
+
small: (domNode, key, ctx) => renderSmall(domNode, key, ctx.options, ctx.additionalProps.small),
|
|
885
|
+
sup: (domNode, key, ctx) => renderSup(domNode, key, ctx.options, ctx.additionalProps.sup, ctx.uidState),
|
|
886
|
+
p: (domNode, key, ctx) => renderParagraph(domNode, key, ctx.options, ctx.paragraphSpacing, ctx.additionalProps.p),
|
|
887
|
+
a: (domNode, key, ctx) => renderLink(domNode, key, ctx.options, ctx.additionalProps.a, ctx.uidState)
|
|
888
|
+
};
|
|
889
|
+
for (const headingTag of headingHtmlTags) {
|
|
890
|
+
tagHandlers[headingTag] = (domNode, key, ctx) => renderHeading(domNode, key, ctx.options, ctx.paragraphSpacing, ctx.additionalProps.heading);
|
|
891
|
+
}
|
|
892
|
+
const getOptions = (paragraphSpacing, additionalProps = {}) => {
|
|
893
|
+
const uidState = {
|
|
894
|
+
current: 0
|
|
761
895
|
};
|
|
762
896
|
const options = {
|
|
763
897
|
replace(domNode, index) {
|
|
764
|
-
if (domNode instanceof Element) {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
return null;
|
|
771
|
-
}
|
|
772
|
-
if ("ol" === domNode.name) {
|
|
773
|
-
return /* @__PURE__ */ jsx(TextList, { ...additionalProps.ol, tag: olTagName, items: createTextListItems(domNode, key) }, key);
|
|
774
|
-
}
|
|
775
|
-
if ("ul" === domNode.name) {
|
|
776
|
-
return /* @__PURE__ */ jsx(TextList, { ...additionalProps.ul, items: createTextListItems(domNode, key) }, key);
|
|
777
|
-
}
|
|
778
|
-
if (domNode.name === "table") {
|
|
779
|
-
const thead = domNode.children.find((child) => child instanceof Element && child.name === "thead");
|
|
780
|
-
const tbody = domNode.children.find((child) => child instanceof Element && child.name === "tbody");
|
|
781
|
-
const tfoot = domNode.children.find((child) => child instanceof Element && child.name === "tfoot");
|
|
782
|
-
let columns = [];
|
|
783
|
-
if (thead) {
|
|
784
|
-
const tr = thead.children.find((child) => child instanceof Element && child.name === "tr");
|
|
785
|
-
if (tr) {
|
|
786
|
-
columns = tr.children.filter((child) => child instanceof Element && child.name === "th").map((th, i) => {
|
|
787
|
-
const attribs = th.attribs || {};
|
|
788
|
-
const align = getTableAlign(attribs.align);
|
|
789
|
-
return {
|
|
790
|
-
key: attribs.key || `col${i}`,
|
|
791
|
-
label: {
|
|
792
|
-
component: richTextComponentName,
|
|
793
|
-
html: render(th.children)
|
|
794
|
-
},
|
|
795
|
-
align
|
|
796
|
-
};
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
let rows = [];
|
|
801
|
-
let sideHeader = false;
|
|
802
|
-
if (tbody) {
|
|
803
|
-
if (tbody.attribs && typeof tbody.attribs.sideheader !== "undefined") {
|
|
804
|
-
sideHeader = tbody.attribs.sideheader === "" || tbody.attribs.sideheader === "true";
|
|
805
|
-
}
|
|
806
|
-
rows = tbody.children.filter((child) => child instanceof Element && child.name === "tr").map((tr, i) => ({
|
|
807
|
-
key: `row${i}`,
|
|
808
|
-
cells: tr.children.filter((cell) => cell instanceof Element && (cell.name === "td" || cell.name === "th")).map((cell) => {
|
|
809
|
-
const attribs = cell.attribs || {};
|
|
810
|
-
const align = getTableAlign(attribs.align);
|
|
811
|
-
const as = cell.name === "th" ? "th" : "td";
|
|
812
|
-
const colSpan = attribs.colspan ? parseInt(attribs.colspan, 10) : void 0;
|
|
813
|
-
const scope = attribs.scope;
|
|
814
|
-
return {
|
|
815
|
-
richText: {
|
|
816
|
-
component: richTextComponentName,
|
|
817
|
-
html: render(cell.children)
|
|
818
|
-
},
|
|
819
|
-
align,
|
|
820
|
-
as,
|
|
821
|
-
colSpan,
|
|
822
|
-
scope
|
|
823
|
-
};
|
|
824
|
-
})
|
|
825
|
-
}));
|
|
826
|
-
}
|
|
827
|
-
let footCells = [];
|
|
828
|
-
if (tfoot) {
|
|
829
|
-
const tr = tfoot.children.find((child) => child instanceof Element && child.name === "tr");
|
|
830
|
-
if (tr) {
|
|
831
|
-
footCells = tr.children.filter((cell) => cell instanceof Element && (cell.name === "td" || cell.name === "th")).map((cell) => {
|
|
832
|
-
const attribs = cell.attribs || {};
|
|
833
|
-
const align = getTableAlign(attribs.align);
|
|
834
|
-
const as = cell.name === "th" ? "th" : "td";
|
|
835
|
-
const colSpan = attribs.colspan ? parseInt(attribs.colspan, 10) : void 0;
|
|
836
|
-
const scope = attribs.scope;
|
|
837
|
-
return {
|
|
838
|
-
richText: {
|
|
839
|
-
component: richTextComponentName,
|
|
840
|
-
html: render(cell.children)
|
|
841
|
-
},
|
|
842
|
-
align,
|
|
843
|
-
as,
|
|
844
|
-
colSpan,
|
|
845
|
-
scope
|
|
846
|
-
};
|
|
847
|
-
});
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
return /* @__PURE__ */ jsx(TableWrapper, { columns, rows, sideHeader, footCells: footCells.length ? footCells : void 0 }, key);
|
|
851
|
-
}
|
|
852
|
-
if ("strong" === domNode.name) {
|
|
853
|
-
return /* @__PURE__ */ jsx(Body, { ...additionalProps.strong, tag: strongTagName, children: domToReact(domNode.children, options) }, key);
|
|
854
|
-
}
|
|
855
|
-
if ("small" === domNode.name) {
|
|
856
|
-
return /* @__PURE__ */ jsx(Body, { ...additionalProps.small, size: textBodySm, children: domToReact(domNode.children, options) }, key);
|
|
857
|
-
}
|
|
858
|
-
if ("sup" === domNode.name) {
|
|
859
|
-
const children = domToReact(domNode.children, options);
|
|
860
|
-
if (Number.isInteger(parseInt(children))) {
|
|
861
|
-
uid += 1;
|
|
862
|
-
return /* @__PURE__ */ jsx(FootnoteLink, { uid: `footnote-link-${uid}-${children}`, contentUid: `footnote-content-${children}`, screenReaderLabel: "Details zur Fußnote", children }, key);
|
|
863
|
-
}
|
|
864
|
-
return /* @__PURE__ */ jsx(Body, { ...additionalProps.sup, tag: supTagName, children }, key);
|
|
865
|
-
}
|
|
866
|
-
if ("p" === domNode.name) {
|
|
867
|
-
if (domNode.children.some((child) => child instanceof Element && (child.name === "ol" || child.name === "ul"))) {
|
|
868
|
-
return domToReact(domNode.children, options);
|
|
869
|
-
}
|
|
870
|
-
return /* @__PURE__ */ jsx(Body, { ...additionalProps.p, bottomSpacing: paragraphSpacing, children: domToReact(domNode.children, options) }, key);
|
|
871
|
-
}
|
|
872
|
-
if ("a" === domNode.name) {
|
|
873
|
-
const linkLabel = domToReact(domNode.children, options);
|
|
874
|
-
const isNumber = parseInt(linkLabel, 10);
|
|
875
|
-
const href = domNode.attribs.href;
|
|
876
|
-
const isAnchor = href && href.indexOf("#") === 0;
|
|
877
|
-
if (!isNaN(isNumber) && isAnchor) {
|
|
878
|
-
return /* @__PURE__ */ jsx(FootnoteLink, { uid: `${uid}`, contentUid: href.replace("#", ""), screenReaderLabel: "Details zur Fußnote", children: linkLabel }, key);
|
|
879
|
-
}
|
|
880
|
-
return /* @__PURE__ */ jsx(InlineLink, { ...additionalProps.a, href: domNode.attribs.href, target: domNode.attribs.target, children: domToReact(domNode.children, options) }, key);
|
|
881
|
-
}
|
|
898
|
+
if (!(domNode instanceof Element)) {
|
|
899
|
+
return void 0;
|
|
900
|
+
}
|
|
901
|
+
const handler = tagHandlers[domNode.name];
|
|
902
|
+
if (!handler) {
|
|
903
|
+
return void 0;
|
|
882
904
|
}
|
|
905
|
+
return handler(domNode, `rt-${domNode.name}-${index}`, {
|
|
906
|
+
options,
|
|
907
|
+
paragraphSpacing,
|
|
908
|
+
additionalProps,
|
|
909
|
+
uidState
|
|
910
|
+
});
|
|
883
911
|
}
|
|
884
912
|
};
|
|
885
913
|
return options;
|