@vodafone_de/brix-components 7.0.8 → 7.0.9
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/README.md +0 -1
- package/dist/{FontWeight-CR22KTex.js → FontWeight-DEBGHbtO.js} +2 -2
- package/dist/NotificationErrorIcon-DMnAJgPN.js +83 -0
- package/dist/_5gPlusIcon-B_69VW4X.js +19443 -0
- package/dist/components/Accordion/index.js +6 -3
- package/dist/components/Accordion/props.d.ts +1 -1
- package/dist/components/Accordion/styled.d.ts +1 -1
- package/dist/components/AccordionGroup/index.js +1 -1
- package/dist/components/Badge/index.js +3 -2
- package/dist/components/Badge/props.d.ts +1 -1
- package/dist/components/Body/index.js +2 -2
- package/dist/components/Body/props.d.ts +1 -1
- package/dist/components/BottomBar/index.js +3 -3
- package/dist/components/Button/index.js +2 -2
- package/dist/components/Button/styled.d.ts +1 -1
- package/dist/components/ButtonAsLink/index.js +3 -1
- package/dist/components/ButtonAsLink/styled.d.ts +1 -1
- package/dist/components/ButtonGroup/index.js +4 -4
- package/dist/components/ButtonGroup/props.d.ts +1 -1
- package/dist/components/Card/index.js +3 -3
- package/dist/components/Card/props.d.ts +2 -2
- package/dist/components/Carousel/components/CarouselContext.d.ts +2 -3
- package/dist/components/Carousel/components/CarouselNavigation.d.ts +0 -2
- package/dist/components/Carousel/index.js +58 -47
- package/dist/components/Checkbox/index.js +3 -2
- package/dist/components/CheckboxGroup/index.js +2 -2
- package/dist/components/Collapsible/index.js +1 -1
- package/dist/components/ColorSwatch/index.js +2 -2
- package/dist/components/ColorSwatchGroup/index.js +4 -4
- package/dist/components/ColorSwatchGroup/props.d.ts +1 -1
- package/dist/components/ConsentMessage/index.js +1 -1
- package/dist/components/ConsentMessage/styled.d.ts +1 -1
- package/dist/components/Container/index.js +3 -2
- package/dist/components/Container/props.d.ts +12 -1
- package/dist/components/DateInput/index.js +4 -2
- package/dist/components/DateInput/styled.d.ts +1 -2
- package/dist/components/DemoBox/index.js +5 -3
- package/dist/components/Dialog/index.js +4 -4
- package/dist/components/Dialog/styled.d.ts +1 -1
- package/dist/components/DiscoveryCard/components/DiscoveryCardLinkedImage.d.ts +1 -1
- package/dist/components/DiscoveryCard/index.js +21 -12
- package/dist/components/DiscoveryCard/props.d.ts +3 -3
- package/dist/components/DiscoveryCard/styled.d.ts +2 -2
- package/dist/components/DiscoveryCardGroup/index.js +1 -1
- package/dist/components/Divider/index.js +1 -1
- package/dist/components/Fieldset/index.js +2 -2
- package/dist/components/FilterGroup/index.js +4 -3
- package/dist/components/FilterGroup/props.d.ts +1 -1
- package/dist/components/FilterGroup/styled.d.ts +1 -1
- package/dist/components/Flex/index.js +2 -2
- package/dist/components/FlexItem/index.js +1 -1
- package/dist/components/FootnoteContent/index.js +1 -1
- package/dist/components/FootnoteLink/index.js +10 -2
- package/dist/components/Form/index.js +1 -1
- package/dist/components/FormElement/index.js +1 -1
- package/dist/components/FormHelperStatusIcon/index.d.ts +1 -1
- package/dist/components/FormHelperStatusIcon/index.js +2 -1
- package/dist/components/FormHelperStatusIcon/styled.d.ts +1 -1
- package/dist/components/GoogleMap/components/Map/props.d.ts +1 -1
- package/dist/components/GoogleMap/index.js +2 -2
- package/dist/components/GoogleMap/styled.d.ts +1 -1
- package/dist/components/Grid/index.js +2 -2
- package/dist/components/Grid/props.d.ts +3 -3
- package/dist/components/GridItem/index.js +2 -2
- package/dist/components/GridItem/props.d.ts +2 -2
- package/dist/components/Heading/index.js +3 -10
- package/dist/components/HifiIcon/index.js +1 -1
- package/dist/components/HifiIcon/props.d.ts +2 -1
- package/dist/components/Icon/index.d.ts +2 -2
- package/dist/components/Icon/index.js +1 -3
- package/dist/components/Icon/props.d.ts +1 -2
- package/dist/components/IconButton/index.js +4 -3
- package/dist/components/IconButton/props.d.ts +1 -1
- package/dist/components/IconLoader/index.d.ts +9 -0
- package/dist/components/IconLoader/index.js +655 -0
- package/dist/components/IconLoader/props.d.ts +23 -0
- package/dist/components/IconSnippet/index.js +10 -11
- package/dist/components/IconSnippet/props.d.ts +2 -2
- package/dist/components/IconSnippet/styled.d.ts +2 -2
- package/dist/components/IconSnippetList/index.js +1 -1
- package/dist/components/Image/index.js +1 -1
- package/dist/components/ImageHeader/index.js +7 -7
- package/dist/components/ImageHeader/props.d.ts +3 -3
- package/dist/components/ImageHeader/styled.d.ts +4 -4
- package/dist/components/InlineIcon/index.d.ts +6 -0
- package/dist/components/InlineIcon/index.js +35 -0
- package/dist/components/InlineIcon/props.d.ts +42 -0
- package/dist/components/InlineIcon/styled.d.ts +4 -0
- package/dist/components/InlineLink/index.js +19 -7
- package/dist/components/InlineLink/styled.d.ts +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Label/index.js +1 -1
- package/dist/components/Legend/index.js +1 -1
- package/dist/components/Link/index.js +8 -3
- package/dist/components/Link/styled.d.ts +1 -1
- package/dist/components/LinkAsButton/index.js +1 -1
- package/dist/components/LinkList/index.js +4 -4
- package/dist/components/LinkListItem/index.js +40 -28
- package/dist/components/LinkListItem/props.d.ts +2 -2
- package/dist/components/LinkListItem/styled.d.ts +974 -3
- package/dist/components/LoadingSpinner/index.js +12 -5
- package/dist/components/MediaText/index.d.ts +5 -0
- package/dist/components/MediaText/index.js +121 -0
- package/dist/components/MediaText/props.d.ts +42 -0
- package/dist/components/MediaText/styled.d.ts +4 -0
- package/dist/components/Notification/index.js +4 -3
- package/dist/components/Notification/notificationStatusVariants.d.ts +1 -1
- package/dist/components/Overlay/index.js +1 -1
- package/dist/components/PickerGroup/components/Picker/props.d.ts +6 -4
- package/dist/components/PickerGroup/components/PickerElementIcon/index.d.ts +1 -1
- package/dist/components/PickerGroup/components/PickerElementIcon/styled.d.ts +1 -1
- package/dist/components/PickerGroup/index.js +6 -5
- package/dist/components/Price/index.js +2 -4
- package/dist/components/Price/props.d.ts +1 -9
- package/dist/components/Price/styled.d.ts +1 -1
- package/dist/components/ProductCard/index.js +8 -8
- package/dist/components/ProductCard/styled.d.ts +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/Rating/assets/StarSVG.d.ts +3 -0
- package/dist/components/Rating/index.d.ts +6 -0
- package/dist/components/Rating/index.js +153 -0
- package/dist/components/Rating/props.d.ts +22 -0
- package/dist/components/Rating/styled.d.ts +6 -0
- package/dist/components/ResponsiveImage/index.js +1 -1
- package/dist/components/RichText/index.js +1 -1
- package/dist/components/ScreenreaderOnly/index.js +1 -1
- package/dist/components/SearchInput/index.d.ts +2 -1
- package/dist/components/SearchInput/index.js +27 -26
- package/dist/components/SearchInput/props.d.ts +2 -1
- package/dist/components/SearchInput/styled.d.ts +3 -6
- package/dist/components/SelectInput/index.js +4 -2
- package/dist/components/Stepper/index.js +3 -3
- package/dist/components/SuggestInput/index.js +5 -4
- package/dist/components/SuggestInput/props.d.ts +1 -1
- package/dist/components/SuggestInput/styled.d.ts +2 -2
- package/dist/components/Switch/index.js +4 -3
- package/dist/components/TabularPrice/index.js +2 -2
- package/dist/components/TextList/index.js +2 -2
- package/dist/components/Textarea/index.js +1 -1
- package/dist/components/Textarea/styled.d.ts +1 -1
- package/dist/components/TimeInput/index.js +5 -3
- package/dist/components/TimeInput/styled.d.ts +1 -4
- package/dist/components/Tray/index.js +2 -2
- package/dist/components/Tray/props.d.ts +1 -1
- package/dist/components/YoutubeVideo/index.js +1 -2
- package/dist/components/YoutubeVideo/props.d.ts +1 -1
- package/dist/filterProps-CBnuV0LI.js +17 -0
- package/dist/foundations/GlobalStyle/index.js +2 -2
- package/dist/foundations/tags.d.ts +2 -0
- package/dist/foundations/types/PositionedIconInterface.d.ts +1 -1
- package/dist/foundations/types/SystemIconWithPosition.d.ts +1 -1
- package/dist/hooks/useLinkComponent/index.d.ts +11 -0
- package/dist/hooks/useLinkComponent/index.js +11 -0
- package/dist/hooks/useViewport/index.js +5 -22
- package/dist/icons/index.js +323 -340
- package/dist/{index-BeSd-V81.js → index-9io8adeQ.js} +3 -3
- package/dist/{index-ZHkR70j3.js → index-BdPmdY9v.js} +4 -3
- package/dist/{index-C5GzK6_0.js → index-Cqh8IRpl.js} +18 -8
- package/dist/index-Cs0Hw0dj.js +25 -0
- package/dist/{index-DQhtQZ85.js → index-GwyCjtti.js} +1 -1
- package/dist/{index-aUJfXBUI.js → index-TImInHXt.js} +5 -26
- package/dist/{index-C7meHOM4.js → index-hMlQuoyx.js} +36 -14
- package/dist/index.d.ts +9 -0
- package/dist/index.js +162 -133
- package/dist/{styled-ZpQohvyx.js → styled-BIc9Gu0G.js} +1 -1
- package/dist/{styled-BSqC5P9h.js → styled-C4eI47I1.js} +4 -4
- package/dist/{styled-DMUiOi24.js → styled-CFTspqJH.js} +2 -2
- package/dist/{styled-B0YKfXTz.js → styled-CPUu8mvT.js} +1 -1
- package/dist/{styled-03irSJOQ.js → styled-Cep52hpR.js} +1 -1
- package/dist/{styled-ODPFCF1a.js → styled-Cq-UMAjp.js} +1 -1
- package/dist/{styled-CYugcGtx.js → styled-DINwm57V.js} +1 -1
- package/dist/styled-DPHfwWsx.js +78 -0
- package/dist/{styled-Cqp2oSjW.js → styled-a-XazLSM.js} +3 -3
- package/dist/{tags-DI6H1biK.js → tags-D0ExIPLD.js} +4 -2
- package/package.json +1 -1
- package/dist/components/Carousel/utils/useScrollSpy.d.ts +0 -2
- package/dist/filterProps-Cewck8OH.js +0 -13
- package/dist/index-Cbojl4_Q.js +0 -7134
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect } from "react";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
|
-
import { S as ScreenreaderOnly } from "../../index-
|
|
6
|
-
import { L as LoadingSpinnerSVGStyled, a as LoadingSpinnerPathXsStyled, b as LoadingSpinnerPathOuter3Styled, c as LoadingSpinnerPathOuter2Styled, d as LoadingSpinnerPathOuter1Styled, e as LoadingSpinnerPathCenterStyled, f as LoadingSpinnerContainerStyled, g as LoadingSpinnerContentStyled, h as LoadingSpinnerLabelStyled, i as LoadingSpinnerChildrenStyled } from "../../styled-
|
|
5
|
+
import { S as ScreenreaderOnly } from "../../index-GwyCjtti.js";
|
|
6
|
+
import { L as LoadingSpinnerSVGStyled, a as LoadingSpinnerPathXsStyled, b as LoadingSpinnerPathOuter3Styled, c as LoadingSpinnerPathOuter2Styled, d as LoadingSpinnerPathOuter1Styled, e as LoadingSpinnerPathCenterStyled, f as LoadingSpinnerContainerStyled, g as LoadingSpinnerContentStyled, h as LoadingSpinnerLabelStyled, i as LoadingSpinnerChildrenStyled } from "../../styled-CFTspqJH.js";
|
|
7
7
|
const LoadingSpinnerSVG = ({
|
|
8
8
|
size = "lg",
|
|
9
9
|
...props
|
|
@@ -31,10 +31,11 @@ const LoadingSpinner = ({
|
|
|
31
31
|
coversFullPage,
|
|
32
32
|
screenReaderLabel,
|
|
33
33
|
screenReaderLabelCompleted,
|
|
34
|
-
//This default is set as the 'wrapper' element is currently containing the majority of the content of pages from our CMS
|
|
34
|
+
//This default is set as the 'wrapper' element is currently containing the majority of the content of pages from our CMS
|
|
35
35
|
getContentElements = () => document.getElementsByClassName("wrapper"),
|
|
36
36
|
...props
|
|
37
37
|
}) => {
|
|
38
|
+
const [hasBeenMounted, setHasBeenMounted] = useState(false);
|
|
38
39
|
const loadingSpinner = /* @__PURE__ */ jsxs(LoadingSpinnerContainerStyled, { className: props.className, role: isActive ? "progressbar" : void 0, "aria-busy": isActive && !screenReaderLabel ? true : void 0, "aria-live": "polite", "aria-label": isActive ? screenReaderLabel : void 0, coversFullPage, bottomSpacing, children: [
|
|
39
40
|
isActive && /* @__PURE__ */ jsxs(LoadingSpinnerContentStyled, { size, hasOverlay: coversFullPage ? true : hasOverlay, coversFullPage, children: [
|
|
40
41
|
size === "xs" ? /* @__PURE__ */ jsx(LoadingSpinnerXsSVG, { ...props, size }) : /* @__PURE__ */ jsx(LoadingSpinnerSVG, { ...props, size }),
|
|
@@ -45,6 +46,9 @@ const LoadingSpinner = ({
|
|
|
45
46
|
inert: isActive ? true : void 0
|
|
46
47
|
}, children }) })
|
|
47
48
|
] });
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
setHasBeenMounted(true);
|
|
51
|
+
}, []);
|
|
48
52
|
useEffect(() => {
|
|
49
53
|
if (coversFullPage) {
|
|
50
54
|
document.body.classList.toggle("HideOverflowY", isActive);
|
|
@@ -63,7 +67,10 @@ const LoadingSpinner = ({
|
|
|
63
67
|
}
|
|
64
68
|
};
|
|
65
69
|
}, [isActive, coversFullPage]);
|
|
66
|
-
|
|
70
|
+
if (coversFullPage && hasBeenMounted) {
|
|
71
|
+
return createPortal(loadingSpinner, document.body);
|
|
72
|
+
}
|
|
73
|
+
return loadingSpinner;
|
|
67
74
|
};
|
|
68
75
|
export {
|
|
69
76
|
LoadingSpinner as default
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import Flex from "../Flex/index.js";
|
|
5
|
+
import FlexItem from "../FlexItem/index.js";
|
|
6
|
+
import Heading, { headingAlignLeft } from "../Heading/index.js";
|
|
7
|
+
import Image, { aspectRatio16_9 } from "../Image/index.js";
|
|
8
|
+
import Link from "../Link/index.js";
|
|
9
|
+
import { g as getUid, R as RichText } from "../../index-9io8adeQ.js";
|
|
10
|
+
import YoutubeVideo from "../YoutubeVideo/index.js";
|
|
11
|
+
import { p as pTagName, u as ulTagName, d as divTagName, l as liTagName } from "../../tags-D0ExIPLD.js";
|
|
12
|
+
import { a as fontWeightRegular } from "../../FontWeight-DEBGHbtO.js";
|
|
13
|
+
import { b as textHeadingSm, t as textHeadingXs } from "../../HeadingSize-CfCRn3Lh.js";
|
|
14
|
+
import { s as spacingMd, e as spacing2Xs, c as spacingSm, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
15
|
+
import { u as useViewport } from "../../index-Cs0Hw0dj.js";
|
|
16
|
+
import styled from "styled-components";
|
|
17
|
+
import { v as viewport } from "../../index-Ck2bCrhT.js";
|
|
18
|
+
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
19
|
+
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
20
|
+
import { a as filterProps } from "../../filterProps-CBnuV0LI.js";
|
|
21
|
+
import { a as flexOrientationVertical, f as flexOrientationHorizontal, b as flexJustifyStart } from "../../styled-CPUu8mvT.js";
|
|
22
|
+
const mediaTextPositionTop = "top";
|
|
23
|
+
const mediaTextPositionLeft = "left";
|
|
24
|
+
const mediaTextPositionRight = "right";
|
|
25
|
+
const MediaTextStyled = styled.div.withConfig({
|
|
26
|
+
shouldForwardProp: filterProps(),
|
|
27
|
+
displayName: "MediaTextStyled",
|
|
28
|
+
componentId: "sc-zs2pry-0"
|
|
29
|
+
})(({
|
|
30
|
+
position,
|
|
31
|
+
bottomSpacing = spacingMd
|
|
32
|
+
}) => ({
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
...viewport.md({
|
|
36
|
+
flexDirection: position === "top" ? "column" : position === "left" ? "row" : "row-reverse"
|
|
37
|
+
}),
|
|
38
|
+
...getBottomSpacing({
|
|
39
|
+
bottomSpacing
|
|
40
|
+
})
|
|
41
|
+
}));
|
|
42
|
+
const MediaTextMediaStyled = styled.div.withConfig({
|
|
43
|
+
shouldForwardProp: filterProps(),
|
|
44
|
+
displayName: "MediaTextMediaStyled",
|
|
45
|
+
componentId: "sc-zs2pry-1"
|
|
46
|
+
})(({
|
|
47
|
+
position,
|
|
48
|
+
bottomSpacing = spacingMd
|
|
49
|
+
}) => ({
|
|
50
|
+
flex: 1,
|
|
51
|
+
...getBottomSpacing({
|
|
52
|
+
bottomSpacing
|
|
53
|
+
}),
|
|
54
|
+
...viewport.md({
|
|
55
|
+
...position != mediaTextPositionTop ? {
|
|
56
|
+
marginBottom: 0
|
|
57
|
+
} : {}
|
|
58
|
+
})
|
|
59
|
+
}));
|
|
60
|
+
const MediaTextContentStyled = styled.div.withConfig({
|
|
61
|
+
shouldForwardProp: filterProps(),
|
|
62
|
+
displayName: "MediaTextContentStyled",
|
|
63
|
+
componentId: "sc-zs2pry-2"
|
|
64
|
+
})(({
|
|
65
|
+
position
|
|
66
|
+
}) => ({
|
|
67
|
+
flex: 1,
|
|
68
|
+
...viewport.md({
|
|
69
|
+
...position === "left" && {
|
|
70
|
+
paddingLeft: getSpacing(spacingMd)
|
|
71
|
+
},
|
|
72
|
+
...position === "right" && {
|
|
73
|
+
paddingRight: getSpacing(spacingMd)
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
}));
|
|
77
|
+
const MediaText = ({
|
|
78
|
+
media,
|
|
79
|
+
position = mediaTextPositionLeft,
|
|
80
|
+
heading,
|
|
81
|
+
subline,
|
|
82
|
+
richText,
|
|
83
|
+
action,
|
|
84
|
+
...props
|
|
85
|
+
}) => {
|
|
86
|
+
const headingId = `heading-${getUid()}`;
|
|
87
|
+
const sublineId = `subline-${getUid()}`;
|
|
88
|
+
const viewport2 = useViewport();
|
|
89
|
+
const headingSpacing = subline ? spacing2Xs : spacingMd;
|
|
90
|
+
const hasMultipleActions = Array.isArray(action) && action.length > 1;
|
|
91
|
+
const actionFlexAs = hasMultipleActions ? ulTagName : divTagName;
|
|
92
|
+
const linkFlexItemAs = hasMultipleActions ? liTagName : divTagName;
|
|
93
|
+
const renderMedia = (media2) => {
|
|
94
|
+
if (!media2) return null;
|
|
95
|
+
switch (media2.component) {
|
|
96
|
+
case "Image":
|
|
97
|
+
return /* @__PURE__ */ jsx(Image, { ...media2, aspectRatio: media2.aspectRatio ?? aspectRatio16_9, bottomSpacing: spacingNone });
|
|
98
|
+
case "YoutubeVideo":
|
|
99
|
+
return /* @__PURE__ */ jsx(YoutubeVideo, { ...media2, bottomSpacing: spacingNone });
|
|
100
|
+
default:
|
|
101
|
+
console.warn(`Unsupported media component: ${media2.component}`);
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const mediaContent = useMemo(() => renderMedia(media), [media]);
|
|
106
|
+
return /* @__PURE__ */ jsxs(MediaTextStyled, { position, ...props, children: [
|
|
107
|
+
/* @__PURE__ */ jsx(MediaTextMediaStyled, { position, children: mediaContent }),
|
|
108
|
+
/* @__PURE__ */ jsxs(MediaTextContentStyled, { position, children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Heading, { ...heading, id: headingId, align: headingAlignLeft, size: textHeadingSm, bottomSpacing: headingSpacing }),
|
|
110
|
+
subline && /* @__PURE__ */ jsx(Heading, { ...subline, id: sublineId, align: headingAlignLeft, size: textHeadingXs, weight: fontWeightRegular, tag: pTagName, bottomSpacing: spacingMd }),
|
|
111
|
+
/* @__PURE__ */ jsx(RichText, { ...richText, bottomSpacing: spacingMd }),
|
|
112
|
+
/* @__PURE__ */ jsx(Flex, { bottomSpacing: spacingMd, gapSpacing: spacingSm, justify: flexJustifyStart, orientation: "sm" === viewport2 ? flexOrientationVertical : flexOrientationHorizontal, as: actionFlexAs, children: action && action.map((action2) => /* @__PURE__ */ jsx(FlexItem, { as: linkFlexItemAs, bottomSpacing: spacingNone, children: /* @__PURE__ */ jsx(Link, { ...action2 }) }, action2.uid)) })
|
|
113
|
+
] })
|
|
114
|
+
] });
|
|
115
|
+
};
|
|
116
|
+
export {
|
|
117
|
+
MediaText as default,
|
|
118
|
+
mediaTextPositionLeft,
|
|
119
|
+
mediaTextPositionRight,
|
|
120
|
+
mediaTextPositionTop
|
|
121
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { HeadingProps } from '../Heading/props';
|
|
3
|
+
import { ImageProps } from '../Image';
|
|
4
|
+
import { LinkProps } from '../Link';
|
|
5
|
+
import { RichTextProps } from '../RichText';
|
|
6
|
+
import { YoutubeVideoProps } from '../YoutubeVideo';
|
|
7
|
+
import { PatternProps } from '../../foundations/PatternProps';
|
|
8
|
+
export declare const mediaTextPositionTop = "top";
|
|
9
|
+
export declare const mediaTextPositionLeft = "left";
|
|
10
|
+
export declare const mediaTextPositionRight = "right";
|
|
11
|
+
export type MediaTextPosition = typeof mediaTextPositionTop | typeof mediaTextPositionLeft | typeof mediaTextPositionRight;
|
|
12
|
+
export interface MediaTextProps extends PatternProps, HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
/**
|
|
14
|
+
* Pin component's name from string to the concrete name
|
|
15
|
+
*/
|
|
16
|
+
component?: 'MediaText';
|
|
17
|
+
/**
|
|
18
|
+
* media prop can be either an Image or a YoutubeVideo
|
|
19
|
+
* The aspect ratio is by default 16 to 9.
|
|
20
|
+
*/
|
|
21
|
+
media: Omit<ImageProps, 'bottomSpacing'> | Omit<YoutubeVideoProps, 'bottomSpacing'>;
|
|
22
|
+
/**
|
|
23
|
+
* MediaText media can be positioned on top, left or right.
|
|
24
|
+
*/
|
|
25
|
+
position?: MediaTextPosition;
|
|
26
|
+
/**
|
|
27
|
+
* Heading
|
|
28
|
+
*/
|
|
29
|
+
heading: Omit<HeadingProps, 'size' | 'weight' | 'bottomSpacing'>;
|
|
30
|
+
/**
|
|
31
|
+
* Subline
|
|
32
|
+
*/
|
|
33
|
+
subline?: Omit<HeadingProps, 'size' | 'weight' | 'tag' | 'bottomSpacing'>;
|
|
34
|
+
/**
|
|
35
|
+
* Rich text
|
|
36
|
+
*/
|
|
37
|
+
richText: Omit<RichTextProps, 'bottomSpacing'>;
|
|
38
|
+
/**
|
|
39
|
+
* Action, list of links
|
|
40
|
+
*/
|
|
41
|
+
action?: LinkProps[];
|
|
42
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MediaTextProps } from './props';
|
|
2
|
+
export declare const MediaTextStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "bottomSpacing" | "position">>> & string;
|
|
3
|
+
export declare const MediaTextMediaStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "bottomSpacing" | "position">>> & string;
|
|
4
|
+
export declare const MediaTextContentStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "position">>> & string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
-
import { df as IconLoader, iv as iconSizeSm } from "../../index-Cbojl4_Q.js";
|
|
4
3
|
import Body from "../Body/index.js";
|
|
5
4
|
import Button from "../Button/index.js";
|
|
6
5
|
import ButtonGroup from "../ButtonGroup/index.js";
|
|
7
6
|
import Flex from "../Flex/index.js";
|
|
8
7
|
import Heading from "../Heading/index.js";
|
|
8
|
+
import IconLoader from "../IconLoader/index.js";
|
|
9
|
+
import { b as iconSizeSm } from "../../styled-DPHfwWsx.js";
|
|
9
10
|
import Link from "../Link/index.js";
|
|
10
|
-
import { R as RichText } from "../../index-
|
|
11
|
+
import { R as RichText } from "../../index-9io8adeQ.js";
|
|
11
12
|
import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
|
|
12
13
|
import { getObjectColor } from "../../foundations/token/getObjectColor/index.js";
|
|
13
14
|
import { e as colorBorderCritical, f as colorBorderWarning, d as colorBorderSuccess, k as colorBorderInformation } from "../../BorderColor-BummoQ1-.js";
|
|
@@ -25,7 +26,7 @@ import { b as borderRadiusMd } from "../../BorderRadius-ClUShVLu.js";
|
|
|
25
26
|
import { g as borderWidthMd } from "../../BorderWidth-DfOlyKK7.js";
|
|
26
27
|
import { d as colorIconInverse } from "../../IconColor-CtC9WUgr.js";
|
|
27
28
|
import { s as spacingMd, c as spacingSm } from "../../Spacing-D0HQH9YJ.js";
|
|
28
|
-
import {
|
|
29
|
+
import { a as filterProps } from "../../filterProps-CBnuV0LI.js";
|
|
29
30
|
const notificationStatusVariants = {
|
|
30
31
|
info: {
|
|
31
32
|
borderColor: getBorderColor(colorBorderInformation),
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { getBackgroundColor } from "../../foundations/token/getBackgroundColor/index.js";
|
|
5
5
|
import { d as colorBackgroundOverlayStatic } from "../../BackgroundColor-e0N9tdDR.js";
|
|
6
|
-
import {
|
|
6
|
+
import { a as filterProps } from "../../filterProps-CBnuV0LI.js";
|
|
7
7
|
const overlayAppearancePrimary = "primary";
|
|
8
8
|
const overlayAppearanceSecondary = "secondary";
|
|
9
9
|
const OverlayStyled = styled.div.withConfig({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconName } from '@vfde-react/inline-icon-library';
|
|
1
|
+
import { IconName } from '@vfde-react/inline-icon-library/IconName';
|
|
2
2
|
import { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
import { BadgeProps } from '../../../Badge/props';
|
|
4
4
|
import { PatternProps } from '../../../../foundations/PatternProps';
|
|
@@ -33,7 +33,7 @@ export interface PickerProps extends Omit<PatternProps, 'bottomSpacing'>, HTMLAt
|
|
|
33
33
|
*/
|
|
34
34
|
suffix?: string;
|
|
35
35
|
/**
|
|
36
|
-
* Path to an
|
|
36
|
+
* Path to an image asset
|
|
37
37
|
*/
|
|
38
38
|
imagePath?: string;
|
|
39
39
|
/**
|
|
@@ -49,16 +49,18 @@ export interface PickerProps extends Omit<PatternProps, 'bottomSpacing'>, HTMLAt
|
|
|
49
49
|
*/
|
|
50
50
|
badge?: Omit<BadgeProps, 'bottomSpacing'>;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* can only be set in apps and not in CMS
|
|
53
53
|
*/
|
|
54
54
|
handleChange?: (a: string) => void;
|
|
55
55
|
/**
|
|
56
56
|
* if there are any optional input props needed to pass down to input component
|
|
57
57
|
* all props that are passed by the PickerComponent are omitted
|
|
58
|
+
* can only be set in apps and not in CMS
|
|
58
59
|
*/
|
|
59
60
|
inputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'name' | 'value' | 'checked' | 'disabled'>;
|
|
60
61
|
/**
|
|
61
|
-
* if there are any optional
|
|
62
|
+
* if there are any optional label props needed to pass down to label component
|
|
63
|
+
* can only be set in apps and not in CMS
|
|
62
64
|
*/
|
|
63
65
|
labelProps?: Omit<InputHTMLAttributes<HTMLLabelElement>, 'children'>;
|
|
64
66
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PickerElementIconStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('
|
|
1
|
+
export declare const PickerElementIconStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('../../../IconLoader').IconLoaderProps, never>> & string & Omit<import('react').FC<import('../../../IconLoader').IconLoaderProps>, keyof import('react').Component<any, {}, any>>;
|
|
@@ -5,15 +5,16 @@ import { a as inputStateError } from "../../props-DDpgcryb.js";
|
|
|
5
5
|
import { e as spacing2Xs, s as spacingMd, c as spacingSm, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
6
6
|
import { useState, useEffect } from "react";
|
|
7
7
|
import Grid from "../Grid/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import { B as Badge } from "../../index-ZHkR70j3.js";
|
|
8
|
+
import { B as Badge } from "../../index-BdPmdY9v.js";
|
|
10
9
|
import ColorSwatch from "../ColorSwatch/index.js";
|
|
10
|
+
import { c as iconSizeMd } from "../../styled-DPHfwWsx.js";
|
|
11
11
|
import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
|
|
12
12
|
import styled from "styled-components";
|
|
13
|
+
import IconLoader from "../IconLoader/index.js";
|
|
13
14
|
import Image, { aspectRatio1_1 } from "../Image/index.js";
|
|
14
15
|
import { v as viewport } from "../../index-Ck2bCrhT.js";
|
|
15
16
|
import GridItem from "../GridItem/index.js";
|
|
16
|
-
import { s as screenreaderOnly } from "../../index-
|
|
17
|
+
import { s as screenreaderOnly } from "../../index-GwyCjtti.js";
|
|
17
18
|
import forcedColors from "../../foundations/media-query/forcedColors/index.js";
|
|
18
19
|
import { getBackgroundColor } from "../../foundations/token/getBackgroundColor/index.js";
|
|
19
20
|
import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
|
|
@@ -27,10 +28,10 @@ import { getTextColor } from "../../foundations/token/getTextColor/index.js";
|
|
|
27
28
|
import { c as colorBackgroundNeutral } from "../../BackgroundColor-e0N9tdDR.js";
|
|
28
29
|
import { b as borderRadiusMd } from "../../BorderRadius-ClUShVLu.js";
|
|
29
30
|
import { a as borderWidthFocus, d as borderWidthSelected } from "../../BorderWidth-DfOlyKK7.js";
|
|
30
|
-
import {
|
|
31
|
+
import { a as fontWeightRegular, f as fontWeightBold } from "../../FontWeight-DEBGHbtO.js";
|
|
31
32
|
import { o as opacityOverlay } from "../../Opacity-smkGiwsf.js";
|
|
32
33
|
import { a as colorTextNeutral } from "../../TextColor-DsntmDNw.js";
|
|
33
|
-
import {
|
|
34
|
+
import { a as filterProps } from "../../filterProps-CBnuV0LI.js";
|
|
34
35
|
import { getHeadingSize } from "../../foundations/token/getHeadingSize/index.js";
|
|
35
36
|
import { t as textHeadingXs } from "../../HeadingSize-CfCRn3Lh.js";
|
|
36
37
|
import { getBodySize } from "../../foundations/token/getBodySize/index.js";
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
|
-
import "../../index-
|
|
3
|
+
import "../../index-GwyCjtti.js";
|
|
4
|
+
import { c, P, g, f, p, a, e, d, b } from "../../index-TImInHXt.js";
|
|
4
5
|
import "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
|
|
5
|
-
import { c, P, i, g, f, h, p, a, e, d, b } from "../../index-aUJfXBUI.js";
|
|
6
6
|
export {
|
|
7
7
|
c as createScreenReaderText,
|
|
8
8
|
P as default,
|
|
9
|
-
i as internalizePriceProps,
|
|
10
9
|
g as priceAlignCenter,
|
|
11
10
|
f as priceAlignLeft,
|
|
12
|
-
h as priceDefaultProps,
|
|
13
11
|
p as priceOrientationHorizontal,
|
|
14
12
|
a as priceOrientationVertical,
|
|
15
13
|
e as priceSizeLg,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { PatternProps } from '../../foundations/PatternProps';
|
|
3
|
-
import { Spacing } from '../../foundations/token/types/Spacing';
|
|
4
3
|
export declare const priceOrientationHorizontal = "horizontal";
|
|
5
4
|
export declare const priceOrientationVertical = "vertical";
|
|
6
5
|
export type PriceOrientation = typeof priceOrientationHorizontal | typeof priceOrientationVertical;
|
|
@@ -27,7 +26,7 @@ export interface PriceSharedProps extends PatternProps, HTMLAttributes<HTMLDivEl
|
|
|
27
26
|
/**
|
|
28
27
|
* Main price
|
|
29
28
|
*/
|
|
30
|
-
price
|
|
29
|
+
price: string;
|
|
31
30
|
/**
|
|
32
31
|
* Product name that renders microdata attributes needed for SEO if set
|
|
33
32
|
*/
|
|
@@ -56,10 +55,3 @@ export interface PriceProps extends PriceSharedProps {
|
|
|
56
55
|
*/
|
|
57
56
|
align?: PriceAlign;
|
|
58
57
|
}
|
|
59
|
-
export declare const priceDefaultProps: Partial<PriceProps>;
|
|
60
|
-
export interface PriceInternalProps extends Omit<PriceProps, 'orientation'> {
|
|
61
|
-
$orientation: PriceOrientation;
|
|
62
|
-
bottomSpacing: Spacing;
|
|
63
|
-
align: PriceAlign;
|
|
64
|
-
}
|
|
65
|
-
export declare const internalizePriceProps: (props: PriceProps) => PriceInternalProps;
|
|
@@ -2,6 +2,6 @@ import { PriceProps, PriceSharedProps } from './props';
|
|
|
2
2
|
export declare const PriceOuterWrapperStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
3
|
export declare const PriceInnerWrapperStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, PriceProps>> & string;
|
|
4
4
|
export declare const StrikePriceStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
-
export declare const PriceOrientationStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<PriceProps, "
|
|
5
|
+
export declare const PriceOrientationStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<PriceProps, "align" | "orientation">>> & string;
|
|
6
6
|
export declare const PriceStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<PriceSharedProps, "size">>> & string;
|
|
7
7
|
export declare const PriceSuffixStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import Image, { aspectRatio1_1 } from "../Image/index.js";
|
|
5
|
-
import { f as fontWeightBold } from "../../FontWeight-CR22KTex.js";
|
|
6
|
-
import { a as textHeadingMd } from "../../HeadingSize-CfCRn3Lh.js";
|
|
7
|
-
import { s as spacingMd, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
8
|
-
import { B as Badge } from "../../index-ZHkR70j3.js";
|
|
3
|
+
import { B as Badge } from "../../index-BdPmdY9v.js";
|
|
9
4
|
import Body from "../Body/index.js";
|
|
10
5
|
import ColorSwatchGroup from "../ColorSwatchGroup/index.js";
|
|
11
6
|
import Heading from "../Heading/index.js";
|
|
7
|
+
import Image, { aspectRatio1_1 } from "../Image/index.js";
|
|
8
|
+
import { d as iconSizeLg } from "../../styled-DPHfwWsx.js";
|
|
12
9
|
import Link from "../Link/index.js";
|
|
13
|
-
import { P as Price, d as priceSizeMd, g as priceAlignCenter, a as priceOrientationVertical } from "../../index-
|
|
10
|
+
import { P as Price, d as priceSizeMd, g as priceAlignCenter, a as priceOrientationVertical } from "../../index-TImInHXt.js";
|
|
11
|
+
import { f as fontWeightBold } from "../../FontWeight-DEBGHbtO.js";
|
|
12
|
+
import { a as textHeadingMd } from "../../HeadingSize-CfCRn3Lh.js";
|
|
13
|
+
import { s as spacingMd, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
14
14
|
import styled from "styled-components";
|
|
15
|
-
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
16
15
|
import Card from "../Card/index.js";
|
|
17
16
|
import Icon from "../Icon/index.js";
|
|
17
|
+
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
18
18
|
const ProductCardStyled = styled(Card).withConfig({
|
|
19
19
|
displayName: "ProductCardStyled",
|
|
20
20
|
componentId: "sc-1ps8gys-0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CardProps } from '../Card/props';
|
|
2
2
|
import { IconProps } from '../Icon/props';
|
|
3
3
|
export declare const ProductCardStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<CardProps, CardProps>> & string & Omit<import('react').FC<CardProps>, keyof import('react').Component<any, {}, any>>;
|
|
4
|
-
export declare const ProductCardIconStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('
|
|
4
|
+
export declare const ProductCardIconStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('../IconLoader').IconLoaderProps | import('../HifiIcon').HifiIconProps | IconProps, IconProps>> & string & Omit<import('react').FC<import('../IconLoader').IconLoaderProps | import('../HifiIcon').HifiIconProps | IconProps>, keyof import('react').Component<any, {}, any>>;
|
|
5
5
|
export declare const ProductCardUpperContentStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement>, never>> & string;
|
|
6
6
|
export declare const ProductCardImageStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('../Image').ImageProps, never>> & string & Omit<import('react').FC<import('../Image').ImageProps>, keyof import('react').Component<any, {}, any>>;
|
|
@@ -19,7 +19,7 @@ import { c as borderRadiusFull } from "../../BorderRadius-ClUShVLu.js";
|
|
|
19
19
|
import { a as borderWidthFocus } from "../../BorderWidth-DfOlyKK7.js";
|
|
20
20
|
import { b as colorObjectSelected, a as colorObjectInverse } from "../../ObjectColor-BZDBuV8H.js";
|
|
21
21
|
import { a as opacityDisabled } from "../../Opacity-smkGiwsf.js";
|
|
22
|
-
import {
|
|
22
|
+
import { a as filterProps } from "../../filterProps-CBnuV0LI.js";
|
|
23
23
|
const RadioContainer = styled(Flex).withConfig({
|
|
24
24
|
shouldForwardProp: filterProps(["disabled"]),
|
|
25
25
|
displayName: "RadioContainer",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const StarSVG: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.SVGProps<SVGSVGElement>, never>> & string & Omit<(props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element, keyof React.Component<any, {}, any>>;
|
|
3
|
+
export default StarSVG;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useRef } from "react";
|
|
4
|
+
import Fieldset from "../Fieldset/index.js";
|
|
5
|
+
import styled from "styled-components";
|
|
6
|
+
import { u as useViewport, v as viewportSm } from "../../index-Cs0Hw0dj.js";
|
|
7
|
+
import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
|
|
8
|
+
import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js";
|
|
9
|
+
import { getHoverColor } from "../../foundations/token/getHoverColor/index.js";
|
|
10
|
+
import { getObjectColor } from "../../foundations/token/getObjectColor/index.js";
|
|
11
|
+
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
12
|
+
import { c as colorBackgroundNeutral } from "../../BackgroundColor-e0N9tdDR.js";
|
|
13
|
+
import { c as colorBorderFocus, i as colorBorderSelected, a as colorBorderNeutral, b as colorBorderUnselected } from "../../BorderColor-BummoQ1-.js";
|
|
14
|
+
import { a as borderWidthFocus } from "../../BorderWidth-DfOlyKK7.js";
|
|
15
|
+
import { b as colorObjectSelected } from "../../ObjectColor-BZDBuV8H.js";
|
|
16
|
+
import { a as spacingXs } from "../../Spacing-D0HQH9YJ.js";
|
|
17
|
+
const StarSVGBase = (props) => {
|
|
18
|
+
const viewport = useViewport();
|
|
19
|
+
let width = 32;
|
|
20
|
+
let height = 30.624;
|
|
21
|
+
if (viewport === viewportSm) {
|
|
22
|
+
width = 24;
|
|
23
|
+
height = 22.968;
|
|
24
|
+
}
|
|
25
|
+
return /* @__PURE__ */ jsx("svg", { style: {
|
|
26
|
+
display: "inline-block"
|
|
27
|
+
}, width, height, viewBox: "0 0 26 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx("path", { d: "M1 9.95223L9.26911 8.58599L12.8296 1L16.6847 8.44108L25 9.48408L19.1147 15.449L20.6911 23.6799L13.199 19.9252L5.85987 23.9682L7.11465 15.6831L1 9.95223Z", fill: "white", stroke: "#7E7E7E", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
28
|
+
};
|
|
29
|
+
const StarSVG = styled(StarSVGBase).withConfig({
|
|
30
|
+
displayName: "StarSVG",
|
|
31
|
+
componentId: "sc-iheyat-0"
|
|
32
|
+
})([""]);
|
|
33
|
+
const getSvgPathStyles = (props) => ({
|
|
34
|
+
fill: props.selected ? getObjectColor(colorObjectSelected) : props.isInHoverRange ? getHoverColor(colorBackgroundNeutral) : "transparent",
|
|
35
|
+
strokeWidth: "1px",
|
|
36
|
+
stroke: props.selected ? getBorderColor(colorBorderSelected) : props.isInHoverRange ? getBorderColor(colorBorderNeutral) : getBorderColor(colorBorderUnselected)
|
|
37
|
+
});
|
|
38
|
+
const getHoverSvgPathStyles = (props) => ({
|
|
39
|
+
fill: props.selected ? getHoverColor(colorObjectSelected) : getHoverColor(colorBackgroundNeutral),
|
|
40
|
+
strokeWidth: "1px",
|
|
41
|
+
stroke: props.selected ? getBorderColor(colorBorderSelected) : getBorderColor(colorBorderNeutral)
|
|
42
|
+
});
|
|
43
|
+
const StarsWrapperStyled = styled.div.withConfig({
|
|
44
|
+
displayName: "StarsWrapperStyled",
|
|
45
|
+
componentId: "sc-1nbg0l6-0"
|
|
46
|
+
})({
|
|
47
|
+
display: "flex",
|
|
48
|
+
gap: getSpacing(spacingXs)
|
|
49
|
+
});
|
|
50
|
+
const StarLabelStyled = styled.label.withConfig({
|
|
51
|
+
displayName: "StarLabelStyled",
|
|
52
|
+
componentId: "sc-1nbg0l6-1"
|
|
53
|
+
})(({
|
|
54
|
+
selected,
|
|
55
|
+
isInHoverRange
|
|
56
|
+
}) => {
|
|
57
|
+
const normalStyles = getSvgPathStyles({
|
|
58
|
+
selected,
|
|
59
|
+
isInHoverRange
|
|
60
|
+
});
|
|
61
|
+
const hoverStyles = getHoverSvgPathStyles({
|
|
62
|
+
selected
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
cursor: "pointer",
|
|
66
|
+
display: "inline-flex",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
svg: {
|
|
70
|
+
path: {
|
|
71
|
+
...normalStyles,
|
|
72
|
+
transition: "fill 200ms, stroke 200ms"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"&:hover svg path": {
|
|
76
|
+
...hoverStyles,
|
|
77
|
+
transition: "fill 200ms, stroke 200ms"
|
|
78
|
+
},
|
|
79
|
+
// Apply focus-visible styles on label when input is focused
|
|
80
|
+
"&:has(:focus-visible)": {
|
|
81
|
+
outline: `${getBorderWidth(borderWidthFocus)} solid ${getBorderColor(colorBorderFocus)}`,
|
|
82
|
+
outlineOffset: "2px"
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
const HiddenRadioStyled = styled.input.withConfig({
|
|
87
|
+
displayName: "HiddenRadioStyled",
|
|
88
|
+
componentId: "sc-1nbg0l6-2"
|
|
89
|
+
})({
|
|
90
|
+
border: 0,
|
|
91
|
+
clip: "rect(0 0 0 0)",
|
|
92
|
+
clipPath: "inset(50%)",
|
|
93
|
+
height: "1px",
|
|
94
|
+
margin: "-1px",
|
|
95
|
+
overflow: "hidden",
|
|
96
|
+
padding: 0,
|
|
97
|
+
position: "absolute",
|
|
98
|
+
whiteSpace: "nowrap",
|
|
99
|
+
width: "1px"
|
|
100
|
+
});
|
|
101
|
+
const Rating = ({
|
|
102
|
+
value,
|
|
103
|
+
onUpdate,
|
|
104
|
+
className,
|
|
105
|
+
groupName,
|
|
106
|
+
uid,
|
|
107
|
+
component: _component,
|
|
108
|
+
...props
|
|
109
|
+
}) => {
|
|
110
|
+
const [internalValue, setInternalValue] = useState(value ?? 0);
|
|
111
|
+
const [hoverValue, setHoverValue] = useState(null);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (value !== void 0) {
|
|
114
|
+
setInternalValue(value);
|
|
115
|
+
}
|
|
116
|
+
}, [value]);
|
|
117
|
+
const handleChange = (event) => {
|
|
118
|
+
const newValue = Number(event.target.value);
|
|
119
|
+
setInternalValue(newValue);
|
|
120
|
+
if (onUpdate) {
|
|
121
|
+
onUpdate(newValue);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const handleMouseEnter = (index) => {
|
|
125
|
+
setHoverValue(index + 1);
|
|
126
|
+
};
|
|
127
|
+
const handleMouseLeave = () => {
|
|
128
|
+
setHoverValue(null);
|
|
129
|
+
};
|
|
130
|
+
const handleClick = (starValue) => {
|
|
131
|
+
if (starValue === internalValue) {
|
|
132
|
+
setInternalValue(0);
|
|
133
|
+
if (onUpdate) {
|
|
134
|
+
onUpdate(0);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const ref = useRef(null);
|
|
139
|
+
return /* @__PURE__ */ jsx(Fieldset, { ...props, uid, ref, children: /* @__PURE__ */ jsx(StarsWrapperStyled, { className, role: "radiogroup", children: [...Array(5)].map((_, index) => {
|
|
140
|
+
const starValue = index + 1;
|
|
141
|
+
const isInHoverRange = hoverValue !== null && starValue <= hoverValue;
|
|
142
|
+
return /* @__PURE__ */ jsxs(StarLabelStyled, { selected: starValue <= internalValue, isInHoverRange, htmlFor: `${uid}-star-${starValue}`, onMouseEnter: () => handleMouseEnter(index), onMouseLeave: handleMouseLeave, "aria-label": `${starValue} von 5 Sternen`, children: [
|
|
143
|
+
/* @__PURE__ */ jsx(HiddenRadioStyled, { type: "radio", id: `${uid}-star-${starValue}`, name: groupName || uid, value: starValue, checked: starValue === internalValue, onChange: handleChange, onClick: () => handleClick(starValue) }),
|
|
144
|
+
/* @__PURE__ */ jsx(StarSVG, {})
|
|
145
|
+
] }, `star-${starValue}-${uid}`);
|
|
146
|
+
}) }) });
|
|
147
|
+
};
|
|
148
|
+
export {
|
|
149
|
+
HiddenRadioStyled,
|
|
150
|
+
StarLabelStyled,
|
|
151
|
+
StarsWrapperStyled,
|
|
152
|
+
Rating as default
|
|
153
|
+
};
|