@vodafone_de/brix-components 3.0.1 → 3.0.2
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/BackgroundColor-JObp_2xA.js +14 -0
- package/dist/BorderColor-BummoQ1-.js +24 -0
- package/dist/BorderRadius-ClUShVLu.js +10 -0
- package/dist/BorderWidth-DfOlyKK7.js +16 -0
- package/dist/CornerStyle-JEbGNArR.js +6 -0
- package/dist/FontWeight-CR22KTex.js +8 -0
- package/dist/HeadingSize-CfCRn3Lh.js +12 -0
- package/dist/IconColor-CtC9WUgr.js +10 -0
- package/dist/ObjectColor-BZDBuV8H.js +22 -0
- package/dist/Opacity-smkGiwsf.js +6 -0
- package/dist/SizeTypes-Ck_RdzIf.js +8 -0
- package/dist/Spacing-D0HQH9YJ.js +16 -0
- package/dist/TextBodySize-BcZR9mh2.js +6 -0
- package/dist/TextColor-BXiR5Uq9.js +16 -0
- package/dist/colorUtils-uLZF5UIN.js +94 -0
- package/dist/components/Accordion/index.js +195 -0
- package/dist/components/AccordionGroup/index.js +59 -0
- package/dist/components/Badge/index.js +11 -0
- package/dist/components/Body/index.js +72 -6
- package/dist/components/BottomBar/index.js +79 -0
- package/dist/components/Button/index.js +24 -0
- package/dist/components/ButtonAsLink/index.js +7 -0
- package/dist/components/ButtonGroup/index.js +34 -0
- package/dist/components/Card/index.js +18 -0
- package/dist/components/Carousel/index.js +497 -0
- package/dist/components/Checkbox/index.js +218 -0
- package/dist/components/CheckboxGroup/index.js +58 -0
- package/dist/components/Collapsible/index.js +85 -0
- package/dist/components/ColorSwatch/index.js +87 -0
- package/dist/components/ColorSwatchGroup/index.js +43 -0
- package/dist/components/Container/index.js +76 -0
- package/dist/components/DateInput/index.js +86 -0
- package/dist/components/DemoBox/index.js +21 -0
- package/dist/components/Dialog/index.js +172 -0
- package/dist/components/DiscoveryCard/index.js +130 -0
- package/dist/components/DiscoveryCardGroup/index.js +53 -0
- package/dist/components/Divider/index.js +30 -0
- package/dist/components/Fieldset/index.js +41 -0
- package/dist/components/FilterGroup/index.js +148 -0
- package/dist/components/Flex/index.js +17 -0
- package/dist/components/FlexItem/index.js +41 -0
- package/dist/components/FootnoteContent/index.js +39 -0
- package/dist/components/FootnoteLink/index.js +46 -0
- package/dist/components/Form/index.js +20 -0
- package/dist/components/FormElement/index.js +31 -0
- package/dist/components/FormHelperLabel/index.js +21 -0
- package/dist/components/FormHelperMessage/index.js +47 -0
- package/dist/components/FormHelperStatusIcon/index.js +50 -0
- package/dist/components/GoogleMap/index.js +196 -0
- package/dist/components/Grid/index.js +39 -0
- package/dist/components/GridItem/index.js +12 -0
- package/dist/components/Heading/index.js +94 -0
- package/dist/components/HifiIcon/index.js +31 -0
- package/dist/components/Icon/index.js +38 -0
- package/dist/components/IconButton/index.js +85 -0
- package/dist/components/IconSnippet/index.js +112 -0
- package/dist/components/IconSnippet/styled.d.ts +1 -1
- package/dist/components/IconSnippetList/index.js +25 -0
- package/dist/components/Image/index.js +84 -0
- package/dist/components/ImageHeader/index.js +262 -0
- package/dist/components/ImageHeader/styled.d.ts +4 -4
- package/dist/components/InlineLink/index.js +43 -0
- package/dist/components/Input/index.js +55 -0
- package/dist/components/Label/index.js +22 -0
- package/dist/components/Legend/index.js +60 -0
- package/dist/components/Link/index.js +19 -0
- package/dist/components/LinkAsButton/index.js +7 -0
- package/dist/components/LinkList/index.js +64 -0
- package/dist/components/LinkListItem/index.js +316 -0
- package/dist/components/LoadingSpinner/index.js +70 -0
- package/dist/components/Notification/index.js +181 -0
- package/dist/components/Overlay/index.js +33 -0
- package/dist/components/PickerGroup/index.js +282 -0
- package/dist/components/Price/index.js +18 -0
- package/dist/components/ProductCard/index.js +81 -0
- package/dist/components/RadioGroup/index.js +197 -0
- package/dist/components/ResponsiveImage/index.js +89 -0
- package/dist/components/RichText/index.js +7 -0
- package/dist/components/ScreenreaderOnly/index.js +6 -0
- package/dist/components/SearchInput/index.js +140 -0
- package/dist/components/SelectInput/index.js +160 -0
- package/dist/components/Stepper/index.js +205 -0
- package/dist/components/SuggestInput/index.js +387 -0
- package/dist/components/Switch/index.js +169 -0
- package/dist/components/TabularPrice/index.js +8 -0
- package/dist/components/TextList/index.js +10 -0
- package/dist/components/Textarea/index.js +156 -0
- package/dist/components/Tray/index.js +218 -0
- package/dist/easing-Dm-pO8SY.js +6 -0
- package/dist/filterProps-Cewck8OH.js +13 -0
- package/dist/foundations/GlobalStyle/index.js +3 -292
- package/dist/foundations/PatternProps/index.js +1 -0
- package/dist/foundations/media-query/forcedColors/index.js +12 -0
- package/dist/foundations/media-query/reducedMotion/index.js +21 -0
- package/dist/foundations/media-query/viewport/index.js +6 -0
- package/dist/foundations/token/getBackgroundColor/index.js +5 -0
- package/dist/foundations/token/getBodySize/index.js +13 -2
- package/dist/foundations/token/getBorderColor/index.js +5 -0
- package/dist/foundations/token/getBorderRadius/index.js +15 -0
- package/dist/foundations/token/getBorderWidth/index.js +19 -0
- package/dist/foundations/token/getBottomSpacing/index.js +14 -0
- package/dist/foundations/token/getFontWeight/index.js +13 -0
- package/dist/foundations/token/getHeadingSize/index.js +27 -0
- package/dist/foundations/token/getHoverColor/index.js +7 -0
- package/dist/foundations/token/getIconColor/index.js +5 -0
- package/dist/foundations/token/getObjectColor/index.js +5 -0
- package/dist/foundations/token/getOpacity/index.js +11 -0
- package/dist/foundations/token/getPressColor/index.js +7 -0
- package/dist/foundations/token/getSpacing/index.js +5 -0
- package/dist/foundations/token/getTextColor/index.js +5 -0
- package/dist/foundations/token/getTextDecoration/index.js +13 -0
- package/dist/getCssVar-BP6T9pFM.js +6 -0
- package/dist/hooks/useFocusWithin/index.js +36 -0
- package/dist/hooks/useForcedColors/index.js +9 -0
- package/dist/hooks/useMediaQuery/index.js +19 -0
- package/dist/hooks/useReducedMotion/index.js +9 -0
- package/dist/hooks/useThirdPartyConsent/index.js +54 -0
- package/dist/hooks/useViewport/index.js +24 -0
- package/dist/index-BXLT6ke-.js +79 -0
- package/dist/index-C4XnzWFL.js +61 -0
- package/dist/index-CeJsIf3Z.js +208 -0
- package/dist/index-Ck2bCrhT.js +32 -0
- package/dist/index-CzTqNQTT.js +79 -0
- package/dist/index-D6hvbziL.js +167 -0
- package/dist/index-DQhtQZ85.js +24 -0
- package/dist/props-Czq9XX2J.js +6 -0
- package/dist/{index-BaPlSfS3.js → renderInlineRichTextFromOpenText-CA52y1-B.js} +3 -105
- package/dist/shadow-u158mzuN.js +4 -0
- package/dist/styled-BpvuD699.js +45 -0
- package/dist/styled-CDWclYAa.js +124 -0
- package/dist/styled-CXSdomF5.js +34 -0
- package/dist/styled-CpoX5USb.js +71 -0
- package/dist/styled-DZo6MwrF.js +245 -0
- package/dist/styled-FNJyDkPV.js +165 -0
- package/dist/styled-Wlt68LfQ.js +133 -0
- package/dist/styled-ZpQohvyx.js +29 -0
- package/dist/tags-DI6H1biK.js +29 -0
- package/package.json +2 -1
- package/dist/index-BoPDwZgt.js +0 -18
|
@@ -1,296 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const forcedColorsQuery = `(forced-colors: active)`;
|
|
6
|
-
const forcedColors = (stylesInViewport) => {
|
|
7
|
-
return {
|
|
8
|
-
[`@media ${forcedColorsQuery}`]: {
|
|
9
|
-
...stylesInViewport
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
const reducedMotionQuery = `(prefers-reduced-motion)`;
|
|
14
|
-
const reducedMotion = (stylesInViewport) => {
|
|
15
|
-
return {
|
|
16
|
-
[`@media ${reducedMotionQuery}`]: {
|
|
17
|
-
...stylesInViewport
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
const breakpoint_medium_number = 768;
|
|
22
|
-
const breakpoint_medium = `${breakpoint_medium_number}px`;
|
|
23
|
-
const breakpoint_large_number = 1025;
|
|
24
|
-
const breakpoint_large = `${breakpoint_large_number}px`;
|
|
25
|
-
const mediumMediaQuery = `screen and (min-width: ${breakpoint_medium})`;
|
|
26
|
-
const largeMediaQuery = `screen and (min-width: ${breakpoint_large})`;
|
|
27
|
-
const md = (stylesInViewport) => {
|
|
28
|
-
return {
|
|
29
|
-
[`@media ${mediumMediaQuery}`]: {
|
|
30
|
-
...stylesInViewport
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
const lg = (stylesInViewport) => {
|
|
35
|
-
return {
|
|
36
|
-
[`@media ${largeMediaQuery}`]: {
|
|
37
|
-
...stylesInViewport
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
const viewport = {
|
|
42
|
-
md,
|
|
43
|
-
lg
|
|
44
|
-
};
|
|
45
|
-
const getBackgroundColor = (color) => getCssVar(color);
|
|
46
|
-
const headingSizes = {
|
|
47
|
-
xl: {
|
|
48
|
-
fontSize: getCssVar("headingXlFontSize"),
|
|
49
|
-
lineHeight: getCssVar("headingXlLineHeight")
|
|
50
|
-
},
|
|
51
|
-
lg: {
|
|
52
|
-
fontSize: getCssVar("headingLgFontSize"),
|
|
53
|
-
lineHeight: getCssVar("headingLgLineHeight")
|
|
54
|
-
},
|
|
55
|
-
md: {
|
|
56
|
-
fontSize: getCssVar("headingMdFontSize"),
|
|
57
|
-
lineHeight: getCssVar("headingMdLineHeight")
|
|
58
|
-
},
|
|
59
|
-
sm: {
|
|
60
|
-
fontSize: getCssVar("headingSmFontSize"),
|
|
61
|
-
lineHeight: getCssVar("headingSmLineHeight")
|
|
62
|
-
},
|
|
63
|
-
xs: {
|
|
64
|
-
fontSize: getCssVar("headingXsFontSize"),
|
|
65
|
-
lineHeight: getCssVar("headingXsLineHeight")
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
const getHeadingSize = (size) => headingSizes[size];
|
|
69
|
-
const getObjectColor = (color) => getCssVar(color);
|
|
70
|
-
const baseOpacity60 = "opacity60";
|
|
71
|
-
const baseOpacity38 = "opacity38";
|
|
72
|
-
const opacities = {
|
|
73
|
-
Overlay: baseOpacity60,
|
|
74
|
-
Disabled: baseOpacity38
|
|
75
|
-
};
|
|
76
|
-
const getOpacity = (opacity) => getCssVar(opacities[opacity]);
|
|
77
|
-
const colorBackgroundOverlay = "colorBackgroundOverlay";
|
|
78
|
-
const opacityOverlay = "Overlay";
|
|
79
|
-
const largeSize = "lg";
|
|
80
|
-
const loadingSpinnerOverlays = {
|
|
81
|
-
Light: `rgba(255, 255, 255, ${getOpacity(opacityOverlay)})`,
|
|
82
|
-
Dark: `rgba(38, 38, 38, ${getOpacity(opacityOverlay)})`
|
|
83
|
-
};
|
|
84
|
-
const loadingSpinnerOverlayCssVar = "loadingSpinnerOverlay";
|
|
85
|
-
const calculateSpinnerHeight = (size, bottomSpacing, label) => {
|
|
86
|
-
const spinnerHeight = spinnerSvgSizes[size];
|
|
87
|
-
const labelHeight = label ? `${mapLabelStyleToSpinnerSize[size].fontSize} * ${mapLabelStyleToSpinnerSize[size].lineHeight}` : "0px";
|
|
88
|
-
return `calc(${spinnerHeight} + ${getSpacing(bottomSpacing)} + ${labelHeight})`;
|
|
89
|
-
};
|
|
90
|
-
const spinnerSvgSizes = {
|
|
91
|
-
xs: "24px",
|
|
92
|
-
sm: "76px",
|
|
93
|
-
md: "148px",
|
|
94
|
-
lg: "300px"
|
|
95
|
-
};
|
|
96
|
-
styled.div.withConfig({
|
|
97
|
-
shouldForwardProp: filterProps(),
|
|
98
|
-
displayName: "LoadingSpinnerContainerStyled",
|
|
99
|
-
componentId: "sc-1bnjzqj-0"
|
|
100
|
-
})({
|
|
101
|
-
position: "relative",
|
|
102
|
-
height: "100%"
|
|
103
|
-
}, ({
|
|
104
|
-
coversFullPage
|
|
105
|
-
}) => {
|
|
106
|
-
if (coversFullPage) {
|
|
107
|
-
return {
|
|
108
|
-
position: "fixed",
|
|
109
|
-
zIndex: "1001"
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
return {};
|
|
113
|
-
}, ({
|
|
114
|
-
bottomSpacing = spacingNone
|
|
115
|
-
}) => getBottomSpacing({
|
|
116
|
-
bottomSpacing
|
|
117
|
-
}));
|
|
118
|
-
styled.div.withConfig({
|
|
119
|
-
shouldForwardProp: filterProps(),
|
|
120
|
-
displayName: "LoadingSpinnerContentStyled",
|
|
121
|
-
componentId: "sc-1bnjzqj-1"
|
|
122
|
-
})({
|
|
123
|
-
display: "flex",
|
|
124
|
-
flexDirection: "column",
|
|
125
|
-
minHeight: "100%",
|
|
126
|
-
width: "fit-content",
|
|
127
|
-
justifyContent: "center",
|
|
128
|
-
alignItems: "center"
|
|
129
|
-
}, ({
|
|
130
|
-
hasOverlay
|
|
131
|
-
}) => {
|
|
132
|
-
if (hasOverlay) {
|
|
133
|
-
return {
|
|
134
|
-
background: getBackgroundColor(colorBackgroundOverlay),
|
|
135
|
-
position: "absolute",
|
|
136
|
-
zIndex: 1001,
|
|
137
|
-
width: "100%",
|
|
138
|
-
left: 0,
|
|
139
|
-
top: 0
|
|
140
|
-
};
|
|
141
|
-
} else {
|
|
142
|
-
return {};
|
|
143
|
-
}
|
|
144
|
-
}, ({
|
|
145
|
-
coversFullPage
|
|
146
|
-
}) => {
|
|
147
|
-
if (coversFullPage) {
|
|
148
|
-
return {
|
|
149
|
-
position: "fixed",
|
|
150
|
-
zIndex: "1001"
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return {};
|
|
154
|
-
});
|
|
155
|
-
styled.div.withConfig({
|
|
156
|
-
shouldForwardProp: filterProps(),
|
|
157
|
-
displayName: "LoadingSpinnerChildrenStyled",
|
|
158
|
-
componentId: "sc-1bnjzqj-2"
|
|
159
|
-
})({
|
|
160
|
-
width: "100%",
|
|
161
|
-
height: "100%",
|
|
162
|
-
"> *": {
|
|
163
|
-
minHeight: "inherit"
|
|
164
|
-
}
|
|
165
|
-
}, ({
|
|
166
|
-
size = largeSize,
|
|
167
|
-
bottomSpacing = spacingNone,
|
|
168
|
-
label,
|
|
169
|
-
isActive
|
|
170
|
-
}) => {
|
|
171
|
-
return isActive ? {
|
|
172
|
-
minHeight: calculateSpinnerHeight(size, bottomSpacing, label)
|
|
173
|
-
} : {};
|
|
174
|
-
});
|
|
175
|
-
styled.svg.withConfig({
|
|
176
|
-
shouldForwardProp: filterProps(),
|
|
177
|
-
displayName: "LoadingSpinnerSVGStyled",
|
|
178
|
-
componentId: "sc-1bnjzqj-3"
|
|
179
|
-
})({
|
|
180
|
-
...forcedColors({
|
|
181
|
-
stroke: "CanvasText"
|
|
182
|
-
}),
|
|
183
|
-
zIndex: 1001,
|
|
184
|
-
stroke: getObjectColor("colorObjectBrand")
|
|
185
|
-
}, ({
|
|
186
|
-
size = largeSize
|
|
187
|
-
}) => {
|
|
188
|
-
if (size === "xs") {
|
|
189
|
-
return {
|
|
190
|
-
width: "20px",
|
|
191
|
-
height: "20px",
|
|
192
|
-
...viewport.md({
|
|
193
|
-
width: spinnerSvgSizes[size],
|
|
194
|
-
height: spinnerSvgSizes[size]
|
|
195
|
-
})
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
return {
|
|
199
|
-
width: spinnerSvgSizes[size],
|
|
200
|
-
height: spinnerSvgSizes[size]
|
|
201
|
-
};
|
|
202
|
-
});
|
|
203
|
-
const loadingSpinnerRotate = keyframes({
|
|
204
|
-
to: {
|
|
205
|
-
strokeDashoffset: 610
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
const loadingSpinnerXsRotate = keyframes({
|
|
209
|
-
to: {
|
|
210
|
-
strokeDashoffset: 166
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
const LoadingSpinnerPathStyled = styled.path.withConfig({
|
|
214
|
-
shouldForwardProp: filterProps(),
|
|
215
|
-
displayName: "LoadingSpinnerPathStyled",
|
|
216
|
-
componentId: "sc-1bnjzqj-4"
|
|
217
|
-
})({
|
|
218
|
-
fill: "none",
|
|
219
|
-
strokeLinejoin: "round",
|
|
220
|
-
strokeLinecap: "round",
|
|
221
|
-
strokeDasharray: "120 32",
|
|
222
|
-
animationDuration: "5.0s",
|
|
223
|
-
animationTimingFunction: "linear",
|
|
224
|
-
animationIterationCount: "infinite"
|
|
225
|
-
}, reducedMotion({
|
|
226
|
-
animation: "none"
|
|
227
|
-
}), css(["animation-name:", ";"], loadingSpinnerRotate));
|
|
228
|
-
styled(LoadingSpinnerPathStyled).withConfig({
|
|
229
|
-
shouldForwardProp: filterProps(),
|
|
230
|
-
displayName: "LoadingSpinnerPathOuter3Styled",
|
|
231
|
-
componentId: "sc-1bnjzqj-5"
|
|
232
|
-
})({
|
|
233
|
-
strokeWidth: 2,
|
|
234
|
-
opacity: "0.3"
|
|
235
|
-
});
|
|
236
|
-
styled(LoadingSpinnerPathStyled).withConfig({
|
|
237
|
-
shouldForwardProp: filterProps(),
|
|
238
|
-
displayName: "LoadingSpinnerPathOuter2Styled",
|
|
239
|
-
componentId: "sc-1bnjzqj-6"
|
|
240
|
-
})({
|
|
241
|
-
strokeWidth: 3,
|
|
242
|
-
opacity: "0.6"
|
|
243
|
-
});
|
|
244
|
-
styled(LoadingSpinnerPathStyled).withConfig({
|
|
245
|
-
shouldForwardProp: filterProps(),
|
|
246
|
-
displayName: "LoadingSpinnerPathOuter1Styled",
|
|
247
|
-
componentId: "sc-1bnjzqj-7"
|
|
248
|
-
})({
|
|
249
|
-
strokeWidth: 4
|
|
250
|
-
});
|
|
251
|
-
styled.path.withConfig({
|
|
252
|
-
shouldForwardProp: filterProps(),
|
|
253
|
-
displayName: "LoadingSpinnerPathCenterStyled",
|
|
254
|
-
componentId: "sc-1bnjzqj-8"
|
|
255
|
-
})({
|
|
256
|
-
...forcedColors({
|
|
257
|
-
fill: "CanvasText"
|
|
258
|
-
}),
|
|
259
|
-
fill: "#E60000"
|
|
260
|
-
});
|
|
261
|
-
styled.path.withConfig({
|
|
262
|
-
shouldForwardProp: filterProps(),
|
|
263
|
-
displayName: "LoadingSpinnerPathXsStyled",
|
|
264
|
-
componentId: "sc-1bnjzqj-9"
|
|
265
|
-
})({
|
|
266
|
-
fill: "none",
|
|
267
|
-
strokeLinecap: "butt",
|
|
268
|
-
strokeWidth: 2,
|
|
269
|
-
strokeDasharray: "48 8",
|
|
270
|
-
strokeDashoffset: 56,
|
|
271
|
-
animationDuration: "5.0s",
|
|
272
|
-
animationTimingFunction: "linear",
|
|
273
|
-
animationIterationCount: "infinite"
|
|
274
|
-
}, css(["animation-name:", ";"], loadingSpinnerXsRotate));
|
|
275
|
-
const mapLabelStyleToSpinnerSize = {
|
|
276
|
-
xs: getBodySize("md"),
|
|
277
|
-
sm: getHeadingSize("xs"),
|
|
278
|
-
md: getHeadingSize("sm"),
|
|
279
|
-
lg: getHeadingSize("lg")
|
|
280
|
-
};
|
|
281
|
-
styled(Body).withConfig({
|
|
282
|
-
shouldForwardProp: filterProps(),
|
|
283
|
-
displayName: "LoadingSpinnerLabelStyled",
|
|
284
|
-
componentId: "sc-1bnjzqj-10"
|
|
285
|
-
})(({
|
|
286
|
-
size = "lg"
|
|
287
|
-
}) => {
|
|
288
|
-
return mapLabelStyleToSpinnerSize[size];
|
|
289
|
-
}, getBottomSpacing({
|
|
290
|
-
bottomSpacing: spacingNone
|
|
291
|
-
}), {
|
|
292
|
-
textAlign: "center"
|
|
293
|
-
});
|
|
2
|
+
import { css, createGlobalStyle } from "styled-components";
|
|
3
|
+
import { l as loadingSpinnerOverlayCssVar, j as loadingSpinnerOverlays } from "../../styled-DZo6MwrF.js";
|
|
4
|
+
import { c as breakpoint_medium, a as breakpoint_large } from "../../index-Ck2bCrhT.js";
|
|
294
5
|
const colorVodafoneRed = "colorVodafoneRed";
|
|
295
6
|
const colorVodafoneRedTint = "colorVodafoneRedTint";
|
|
296
7
|
const colorRed = "colorRed";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const reducedMotionQuery = `(prefers-reduced-motion)`;
|
|
2
|
+
const noReducedMotionQuery = `(prefers-reduced-motion: no-preference)`;
|
|
3
|
+
const reducedMotion = (stylesInViewport) => {
|
|
4
|
+
return {
|
|
5
|
+
[`@media ${reducedMotionQuery}`]: {
|
|
6
|
+
...stylesInViewport
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
const noReducedMotion = (stylesInViewport) => {
|
|
11
|
+
return {
|
|
12
|
+
[`@media ${noReducedMotionQuery}`]: {
|
|
13
|
+
...stylesInViewport
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
reducedMotion as default,
|
|
19
|
+
noReducedMotion,
|
|
20
|
+
reducedMotionQuery
|
|
21
|
+
};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getCssVar } from "../../../getCssVar-BP6T9pFM.js";
|
|
2
|
+
const bodySizes = {
|
|
3
|
+
md: {
|
|
4
|
+
fontSize: getCssVar("bodyMdFontSize"),
|
|
5
|
+
lineHeight: getCssVar("bodyMdLineHeight")
|
|
6
|
+
},
|
|
7
|
+
sm: {
|
|
8
|
+
fontSize: getCssVar("bodySmFontSize"),
|
|
9
|
+
lineHeight: getCssVar("bodySmLineHeight")
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const getBodySize = (size) => bodySizes[size];
|
|
2
13
|
export {
|
|
3
|
-
|
|
14
|
+
getBodySize
|
|
4
15
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { g as getCssVar } from "../../../getCssVar-BP6T9pFM.js";
|
|
2
|
+
const baseBorderRadius0 = "borderRadius0";
|
|
3
|
+
const baseBorderRadius3 = "borderRadius3";
|
|
4
|
+
const baseBorderRadius6 = "borderRadius6";
|
|
5
|
+
const baseBorderRadius100 = "borderRadius100";
|
|
6
|
+
const borderRadii = {
|
|
7
|
+
borderRadiusNone: baseBorderRadius0,
|
|
8
|
+
borderRadiusSm: baseBorderRadius3,
|
|
9
|
+
borderRadiusMd: baseBorderRadius6,
|
|
10
|
+
borderRadiusFull: baseBorderRadius100
|
|
11
|
+
};
|
|
12
|
+
const getBorderRadius = (radius) => getCssVar(borderRadii[radius]);
|
|
13
|
+
export {
|
|
14
|
+
getBorderRadius
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { g as getCssVar } from "../../../getCssVar-BP6T9pFM.js";
|
|
2
|
+
const baseBorderWidth0 = "borderWidth0";
|
|
3
|
+
const baseBorderWidth1 = "borderWidth1";
|
|
4
|
+
const baseBorderWidth2 = "borderWidth2";
|
|
5
|
+
const baseBorderWidth4 = "borderWidth4";
|
|
6
|
+
const borderWidths = {
|
|
7
|
+
None: baseBorderWidth0,
|
|
8
|
+
Divider: baseBorderWidth1,
|
|
9
|
+
Unselected: baseBorderWidth1,
|
|
10
|
+
Selected: baseBorderWidth2,
|
|
11
|
+
Navigation: baseBorderWidth4,
|
|
12
|
+
Focus: baseBorderWidth4,
|
|
13
|
+
Sm: baseBorderWidth1,
|
|
14
|
+
Md: baseBorderWidth2
|
|
15
|
+
};
|
|
16
|
+
const getBorderWidth = (borderWidth) => getCssVar(borderWidths[borderWidth]);
|
|
17
|
+
export {
|
|
18
|
+
getBorderWidth
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { g as getCssVar } from "../../../getCssVar-BP6T9pFM.js";
|
|
2
|
+
const baseWeight300 = "fontWeightLight";
|
|
3
|
+
const baseWeight400 = "fontWeightRegular";
|
|
4
|
+
const baseWeight700 = "fontWeightBold";
|
|
5
|
+
const fontWeights = {
|
|
6
|
+
light: baseWeight300,
|
|
7
|
+
regular: baseWeight400,
|
|
8
|
+
bold: baseWeight700
|
|
9
|
+
};
|
|
10
|
+
const getFontWeight = (weight) => getCssVar(fontWeights[weight]);
|
|
11
|
+
export {
|
|
12
|
+
getFontWeight
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { g as getCssVar } from "../../../getCssVar-BP6T9pFM.js";
|
|
2
|
+
const headingSizes = {
|
|
3
|
+
xl: {
|
|
4
|
+
fontSize: getCssVar("headingXlFontSize"),
|
|
5
|
+
lineHeight: getCssVar("headingXlLineHeight")
|
|
6
|
+
},
|
|
7
|
+
lg: {
|
|
8
|
+
fontSize: getCssVar("headingLgFontSize"),
|
|
9
|
+
lineHeight: getCssVar("headingLgLineHeight")
|
|
10
|
+
},
|
|
11
|
+
md: {
|
|
12
|
+
fontSize: getCssVar("headingMdFontSize"),
|
|
13
|
+
lineHeight: getCssVar("headingMdLineHeight")
|
|
14
|
+
},
|
|
15
|
+
sm: {
|
|
16
|
+
fontSize: getCssVar("headingSmFontSize"),
|
|
17
|
+
lineHeight: getCssVar("headingSmLineHeight")
|
|
18
|
+
},
|
|
19
|
+
xs: {
|
|
20
|
+
fontSize: getCssVar("headingXsFontSize"),
|
|
21
|
+
lineHeight: getCssVar("headingXsLineHeight")
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const getHeadingSize = (size) => headingSizes[size];
|
|
25
|
+
export {
|
|
26
|
+
getHeadingSize
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { g as getCssVar } from "../../../getCssVar-BP6T9pFM.js";
|
|
2
|
+
const baseOpacity60 = "opacity60";
|
|
3
|
+
const baseOpacity38 = "opacity38";
|
|
4
|
+
const opacities = {
|
|
5
|
+
Overlay: baseOpacity60,
|
|
6
|
+
Disabled: baseOpacity38
|
|
7
|
+
};
|
|
8
|
+
const getOpacity = (opacity) => getCssVar(opacities[opacity]);
|
|
9
|
+
export {
|
|
10
|
+
getOpacity
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { g as getCssVar } from "../../../getCssVar-BP6T9pFM.js";
|
|
2
|
+
const baseTextDecorationNone = "textDecorationNone";
|
|
3
|
+
const baseTextDecorationUnderline = "textDecorationUnderline";
|
|
4
|
+
const baseTextDecorationStrikethrough = "textDecorationStrikethrough";
|
|
5
|
+
const textDecorations = {
|
|
6
|
+
None: baseTextDecorationNone,
|
|
7
|
+
Underline: baseTextDecorationUnderline,
|
|
8
|
+
Strikethrough: baseTextDecorationStrikethrough
|
|
9
|
+
};
|
|
10
|
+
const getTextDecoration = (textDecoration) => getCssVar(textDecorations[textDecoration]);
|
|
11
|
+
export {
|
|
12
|
+
getTextDecoration
|
|
13
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
function useFocusWithin(ref) {
|
|
3
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
4
|
+
const hasActiveElement = (element) => {
|
|
5
|
+
if (!document) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (!element) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return element == null ? void 0 : element.contains(document.activeElement);
|
|
12
|
+
};
|
|
13
|
+
const eventHandler = () => {
|
|
14
|
+
if (!ref || !ref.current) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
if (!ref || !ref.current) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
setIsFocused(hasActiveElement(ref == null ? void 0 : ref.current));
|
|
22
|
+
}, 300);
|
|
23
|
+
};
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
document.addEventListener("focusin", eventHandler, false);
|
|
26
|
+
document.addEventListener("focusout", eventHandler, false);
|
|
27
|
+
return () => {
|
|
28
|
+
document.removeEventListener("focusin", eventHandler, false);
|
|
29
|
+
document.removeEventListener("focusout", eventHandler, false);
|
|
30
|
+
};
|
|
31
|
+
}, [ref, setIsFocused]);
|
|
32
|
+
return isFocused;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
useFocusWithin
|
|
36
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { forcedColorsQuery } from "../../foundations/media-query/forcedColors/index.js";
|
|
2
|
+
import { useMediaQuery } from "../useMediaQuery/index.js";
|
|
3
|
+
const useForcedColors = () => {
|
|
4
|
+
const [reducedMotion] = useMediaQuery(forcedColorsQuery);
|
|
5
|
+
return reducedMotion;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
useForcedColors
|
|
9
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
const useMediaQuery = (query) => {
|
|
3
|
+
const [mediaQueryMatches, setMediaQueryMatches] = useState(false);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const mediaQuery = window.matchMedia(query);
|
|
6
|
+
const handleMediaQueryChange = (event) => {
|
|
7
|
+
setMediaQueryMatches(event.matches);
|
|
8
|
+
};
|
|
9
|
+
setMediaQueryMatches(mediaQuery.matches);
|
|
10
|
+
mediaQuery.addEventListener("change", handleMediaQueryChange);
|
|
11
|
+
return () => {
|
|
12
|
+
mediaQuery.removeEventListener("change", handleMediaQueryChange);
|
|
13
|
+
};
|
|
14
|
+
}, [query]);
|
|
15
|
+
return [mediaQueryMatches];
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
useMediaQuery
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { reducedMotionQuery } from "../../foundations/media-query/reducedMotion/index.js";
|
|
2
|
+
import { useMediaQuery } from "../useMediaQuery/index.js";
|
|
3
|
+
const useReducedMotion = () => {
|
|
4
|
+
const [reducedMotion] = useMediaQuery(reducedMotionQuery);
|
|
5
|
+
return reducedMotion;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
useReducedMotion
|
|
9
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
const consentStorageItemName = "adv_fcData";
|
|
3
|
+
const consentStorageFeature = "permissions";
|
|
4
|
+
const consentStorageKey = "LI-TPV";
|
|
5
|
+
const checkThirdPartyConsentStorage = () => {
|
|
6
|
+
try {
|
|
7
|
+
const raw = sessionStorage.getItem(consentStorageItemName);
|
|
8
|
+
if (!raw) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
const json = JSON.parse(raw);
|
|
13
|
+
if (!json[consentStorageFeature]) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (!json[consentStorageFeature][consentStorageKey]) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return "true" === json[consentStorageFeature][consentStorageKey];
|
|
20
|
+
} catch (error) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
} catch (error) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const useThirdPartyConsent = () => {
|
|
28
|
+
const [consent, setConsent] = useState(checkThirdPartyConsentStorage());
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const handleStorageChange = () => {
|
|
31
|
+
setConsent(checkThirdPartyConsentStorage());
|
|
32
|
+
};
|
|
33
|
+
window.addEventListener("storage", handleStorageChange);
|
|
34
|
+
const originalSetItem = sessionStorage.setItem;
|
|
35
|
+
sessionStorage.setItem = (key, value) => {
|
|
36
|
+
originalSetItem.call(sessionStorage, key, value);
|
|
37
|
+
if (key === consentStorageItemName) {
|
|
38
|
+
handleStorageChange();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return () => {
|
|
42
|
+
window.removeEventListener("storage", handleStorageChange);
|
|
43
|
+
sessionStorage.setItem = originalSetItem;
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
return consent;
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
checkThirdPartyConsentStorage,
|
|
50
|
+
consentStorageFeature,
|
|
51
|
+
consentStorageItemName,
|
|
52
|
+
consentStorageKey,
|
|
53
|
+
useThirdPartyConsent
|
|
54
|
+
};
|