@vodafone_de/brix-components 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/icons/index.js +603 -0
- package/dist/index-B5AxA0A-.js +79 -0
- package/dist/index-C0N671c1.js +79 -0
- package/dist/index-Cbojl4_Q.js +7134 -0
- package/dist/index-CeJsIf3Z.js +208 -0
- package/dist/index-Ck2bCrhT.js +32 -0
- package/dist/index-D6hvbziL.js +167 -0
- package/dist/index-DQhtQZ85.js +24 -0
- package/dist/index-DUnDnTyk.js +61 -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-BPTa90Cm.js +165 -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-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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import FormElement from "../FormElement/index.js";
|
|
5
|
+
import FormHelperLabel from "../FormHelperLabel/index.js";
|
|
6
|
+
import FormHelperMessage from "../FormHelperMessage/index.js";
|
|
7
|
+
import FormHelperStatusIcon from "../FormHelperStatusIcon/index.js";
|
|
8
|
+
import { s as spacingMd, a as spacingXs } from "../../Spacing-D0HQH9YJ.js";
|
|
9
|
+
import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-CA52y1-B.js";
|
|
10
|
+
import { i as inputStateError } from "../../props-Czq9XX2J.js";
|
|
11
|
+
import { a } from "../../props-Czq9XX2J.js";
|
|
12
|
+
import { I as InputWrapperStyled, a as InputStyled } from "../../styled-CDWclYAa.js";
|
|
13
|
+
const Input = forwardRef(({
|
|
14
|
+
uid,
|
|
15
|
+
status,
|
|
16
|
+
helperText,
|
|
17
|
+
errorMessage,
|
|
18
|
+
label,
|
|
19
|
+
onUpdate,
|
|
20
|
+
type = "text",
|
|
21
|
+
bottomSpacing = spacingMd,
|
|
22
|
+
placeholder,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) => {
|
|
25
|
+
const messageId = `text-${uid}`;
|
|
26
|
+
const inputProps = {
|
|
27
|
+
...props,
|
|
28
|
+
id: uid,
|
|
29
|
+
type,
|
|
30
|
+
"aria-describedby": inputStateError !== status && helperText || inputStateError === status && errorMessage ? messageId : props["aria-describedby"],
|
|
31
|
+
"aria-invalid": inputStateError === status ? true : void 0
|
|
32
|
+
};
|
|
33
|
+
const onChange = (event) => {
|
|
34
|
+
if (props.onChange) {
|
|
35
|
+
props.onChange(event);
|
|
36
|
+
}
|
|
37
|
+
if (!onUpdate) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
onUpdate(event.target.value);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsxs(FormElement, { bottomSpacing, disabled: props.disabled, children: [
|
|
43
|
+
/* @__PURE__ */ jsx(FormHelperLabel, { label, uid }),
|
|
44
|
+
/* @__PURE__ */ jsxs(InputWrapperStyled, { status, bottomSpacing: inputStateError !== status && helperText || inputStateError === status && errorMessage ? spacingXs : void 0, children: [
|
|
45
|
+
/* @__PURE__ */ jsx(InputStyled, { ...inputProps, placeholder: renderInlineRichTextFromOpenText(placeholder), ref, onChange }),
|
|
46
|
+
/* @__PURE__ */ jsx(FormHelperStatusIcon, { status })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsx(FormHelperMessage, { id: messageId, status, message: inputStateError === status ? errorMessage : helperText })
|
|
49
|
+
] });
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
Input as default,
|
|
53
|
+
inputStateError,
|
|
54
|
+
a as inputStateSuccess
|
|
55
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-CA52y1-B.js";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import { getBodySize } from "../../foundations/token/getBodySize/index.js";
|
|
6
|
+
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
7
|
+
import { f as filterProps } from "../../filterProps-Cewck8OH.js";
|
|
8
|
+
const LabelStyled = styled.label.withConfig({
|
|
9
|
+
shouldForwardProp: filterProps(),
|
|
10
|
+
displayName: "LabelStyled",
|
|
11
|
+
componentId: "sc-1w6iej7-0"
|
|
12
|
+
})({
|
|
13
|
+
outline: "none",
|
|
14
|
+
display: "inline-block"
|
|
15
|
+
}, getBodySize("md"), getBottomSpacing);
|
|
16
|
+
const Label = ({
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}) => /* @__PURE__ */ jsx(LabelStyled, { ...props, children: renderInlineRichTextFromOpenText(children) });
|
|
20
|
+
export {
|
|
21
|
+
Label as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import Body from "../Body/index.js";
|
|
4
|
+
import Heading from "../Heading/index.js";
|
|
5
|
+
import IconSnippet, { iconSnippetAlignCenter } from "../IconSnippet/index.js";
|
|
6
|
+
import { R as RichText } from "../../index-D6hvbziL.js";
|
|
7
|
+
import styled from "styled-components";
|
|
8
|
+
const LegendStyled = styled.legend.withConfig({
|
|
9
|
+
displayName: "LegendStyled",
|
|
10
|
+
componentId: "sc-1vyrzt5-0"
|
|
11
|
+
})({
|
|
12
|
+
/**
|
|
13
|
+
* minimal hack to disable the wired position of a legend in a fieldset
|
|
14
|
+
*/
|
|
15
|
+
all: "unset",
|
|
16
|
+
width: "100%"
|
|
17
|
+
});
|
|
18
|
+
const Legend = ({
|
|
19
|
+
contents,
|
|
20
|
+
...props
|
|
21
|
+
}) => {
|
|
22
|
+
const getLegend = () => {
|
|
23
|
+
if (!contents || 0 === contents.length) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx(LegendStyled, { ...props, children: contents.map((legend) => {
|
|
27
|
+
if ("Heading" === legend.component) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Heading, { ...legend, children: legend.children }, legend.key);
|
|
29
|
+
}
|
|
30
|
+
if ("Body" === legend.component) {
|
|
31
|
+
return /* @__PURE__ */ jsx(Body, { ...legend, tag: "span", children: legend.children }, legend.key);
|
|
32
|
+
}
|
|
33
|
+
if ("RichText" === legend.component) {
|
|
34
|
+
return /* @__PURE__ */ jsx(RichText, { ...legend, tagProps: {
|
|
35
|
+
p: {
|
|
36
|
+
tag: "span"
|
|
37
|
+
}
|
|
38
|
+
}, html: legend.children }, legend.key);
|
|
39
|
+
}
|
|
40
|
+
if ("IconSnippet" === legend.component) {
|
|
41
|
+
legend.contents = legend.contents.map((content) => {
|
|
42
|
+
if ("RichText" === content.component) {
|
|
43
|
+
content.tagProps = {
|
|
44
|
+
p: {
|
|
45
|
+
tag: "span"
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return content;
|
|
50
|
+
});
|
|
51
|
+
return /* @__PURE__ */ jsx(IconSnippet, { ...legend, tag: "span", iconAlign: iconSnippetAlignCenter }, legend.key);
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}) });
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsx(Fragment, { children: getLegend() });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
Legend as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { L as LinkAsButton, a as LinkStyled, g as getLinkIcon } from "../../index-B5AxA0A-.js";
|
|
4
|
+
import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-CA52y1-B.js";
|
|
5
|
+
const isLinkAsButtonProp = (props) => {
|
|
6
|
+
return props.href === void 0;
|
|
7
|
+
};
|
|
8
|
+
const Link = (props) => {
|
|
9
|
+
if (isLinkAsButtonProp(props)) {
|
|
10
|
+
return /* @__PURE__ */ jsx(LinkAsButton, { ...props, children: props.children });
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ jsxs(LinkStyled, { ...props, children: [
|
|
13
|
+
renderInlineRichTextFromOpenText(props.children),
|
|
14
|
+
getLinkIcon(props.icon)
|
|
15
|
+
] });
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
Link as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { u as ulTagName, l as liTagName } from "../../tags-DI6H1biK.js";
|
|
4
|
+
import { s as spacingMd, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
5
|
+
import LinkListItem, { linkListItemVariantVertical, linkListItemVariantHorizontal } from "../LinkListItem/index.js";
|
|
6
|
+
import styled from "styled-components";
|
|
7
|
+
import Grid from "../Grid/index.js";
|
|
8
|
+
import GridItem from "../GridItem/index.js";
|
|
9
|
+
import forcedColors from "../../foundations/media-query/forcedColors/index.js";
|
|
10
|
+
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
11
|
+
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
12
|
+
const linkListVariantRow = "row";
|
|
13
|
+
const linkListVariantColumn = "column";
|
|
14
|
+
const LinkListStyled = styled(Grid).withConfig({
|
|
15
|
+
displayName: "LinkListStyled",
|
|
16
|
+
componentId: "sc-15vheq9-0"
|
|
17
|
+
})({
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexWrap: "wrap"
|
|
20
|
+
}, ({
|
|
21
|
+
bottomSpacing = spacingMd
|
|
22
|
+
}) => getBottomSpacing({
|
|
23
|
+
bottomSpacing
|
|
24
|
+
}), ({
|
|
25
|
+
variant,
|
|
26
|
+
elevation
|
|
27
|
+
}) => {
|
|
28
|
+
return {
|
|
29
|
+
flexDirection: variant === linkListVariantRow ? "row" : "column",
|
|
30
|
+
gap: !elevation && variant === linkListVariantColumn ? getSpacing(spacingNone) : getSpacing(spacingMd),
|
|
31
|
+
...forcedColors({
|
|
32
|
+
gap: getSpacing(spacingMd)
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
const LinkListLiStyled = styled(GridItem).withConfig({
|
|
37
|
+
displayName: "LinkListLiStyled",
|
|
38
|
+
componentId: "sc-15vheq9-1"
|
|
39
|
+
})(({
|
|
40
|
+
variant
|
|
41
|
+
}) => {
|
|
42
|
+
return {
|
|
43
|
+
width: variant === linkListVariantColumn ? "100%" : "auto"
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const LinkList = ({
|
|
47
|
+
items,
|
|
48
|
+
variant,
|
|
49
|
+
gridConfig = {
|
|
50
|
+
sm: 12,
|
|
51
|
+
md: 3,
|
|
52
|
+
lg: 2
|
|
53
|
+
},
|
|
54
|
+
...props
|
|
55
|
+
}) => {
|
|
56
|
+
return /* @__PURE__ */ jsx(LinkListStyled, { bottomSpacing: props.bottomSpacing, variant, tag: ulTagName, autoLayout: gridConfig, elevation: props.elevation, stretch: true, children: items.map((item, index) => {
|
|
57
|
+
return /* @__PURE__ */ jsx(LinkListLiStyled, { tag: liTagName, variant, children: /* @__PURE__ */ jsx(LinkListItem, { ...item, orientation: variant === linkListVariantRow ? linkListItemVariantVertical : linkListItemVariantHorizontal, elevation: props.elevation, bottomSpacing: spacingNone, isLastItemInList: index === items.length - 1 }) }, item.uid);
|
|
58
|
+
}) });
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
LinkList as default,
|
|
62
|
+
linkListVariantColumn,
|
|
63
|
+
linkListVariantRow
|
|
64
|
+
};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { iu as iconSizeMd, df as IconLoader } from "../../index-Cbojl4_Q.js";
|
|
4
|
+
import { s as spanTagName } from "../../tags-DI6H1biK.js";
|
|
5
|
+
import { s as spacingMd, a as spacingXs, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
6
|
+
import { s as smallSize } from "../../SizeTypes-Ck_RdzIf.js";
|
|
7
|
+
import { B as Badge } from "../../index-C0N671c1.js";
|
|
8
|
+
import Body from "../Body/index.js";
|
|
9
|
+
import styled from "styled-components";
|
|
10
|
+
import forcedColors from "../../foundations/media-query/forcedColors/index.js";
|
|
11
|
+
import { e as ease_in_sine } from "../../easing-Dm-pO8SY.js";
|
|
12
|
+
import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
|
|
13
|
+
import { getBorderRadius } from "../../foundations/token/getBorderRadius/index.js";
|
|
14
|
+
import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js";
|
|
15
|
+
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
16
|
+
import { getHeadingSize } from "../../foundations/token/getHeadingSize/index.js";
|
|
17
|
+
import { getHoverColor } from "../../foundations/token/getHoverColor/index.js";
|
|
18
|
+
import { getIconColor } from "../../foundations/token/getIconColor/index.js";
|
|
19
|
+
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
20
|
+
import { getTextColor } from "../../foundations/token/getTextColor/index.js";
|
|
21
|
+
import { c as colorBorderFocus, j as colorBorderSubtle } from "../../BorderColor-BummoQ1-.js";
|
|
22
|
+
import { b as borderRadiusMd, a as borderRadiusNone } from "../../BorderRadius-ClUShVLu.js";
|
|
23
|
+
import { a as borderWidthFocus, c as borderWidthSm } from "../../BorderWidth-DfOlyKK7.js";
|
|
24
|
+
import { t as textHeadingXs } from "../../HeadingSize-CfCRn3Lh.js";
|
|
25
|
+
import { b as colorIconBrand } from "../../IconColor-CtC9WUgr.js";
|
|
26
|
+
import { a as colorTextNeutral, f as colorTextBrand } from "../../TextColor-BXiR5Uq9.js";
|
|
27
|
+
import { f as filterProps } from "../../filterProps-Cewck8OH.js";
|
|
28
|
+
import Card from "../Card/index.js";
|
|
29
|
+
import Icon from "../Icon/index.js";
|
|
30
|
+
import { a as CardAppearanceColor } from "../../styled-BpvuD699.js";
|
|
31
|
+
const linkListItemVariantVertical = "vertical";
|
|
32
|
+
const linkListItemVariantHorizontal = "horizontal";
|
|
33
|
+
const focusStyles = {
|
|
34
|
+
...forcedColors({
|
|
35
|
+
outline: `${getBorderWidth(borderWidthFocus)} solid CanvasText`
|
|
36
|
+
}),
|
|
37
|
+
boxShadow: `${getBorderColor(colorBorderFocus)} 0px 0px 0px ${getBorderWidth(borderWidthFocus)}`,
|
|
38
|
+
outline: "none"
|
|
39
|
+
};
|
|
40
|
+
const hoverBackgroundColor = getHoverColor(CardAppearanceColor["primary"]);
|
|
41
|
+
const hoverStylesChangingBackground = {
|
|
42
|
+
transitionProperty: "background, color, box-shadow",
|
|
43
|
+
transitionDuration: "0.2s",
|
|
44
|
+
transitionTimingFunction: ease_in_sine,
|
|
45
|
+
"&:hover, &:focus-visible": {
|
|
46
|
+
background: hoverBackgroundColor
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const LinkListItemButtonStyled = styled.button.withConfig({
|
|
50
|
+
shouldForwardProp: filterProps(["label"]),
|
|
51
|
+
displayName: "LinkListItemButtonStyled",
|
|
52
|
+
componentId: "sc-1dmfu9f-0"
|
|
53
|
+
})({
|
|
54
|
+
width: "100%",
|
|
55
|
+
height: "100%",
|
|
56
|
+
background: "none",
|
|
57
|
+
border: "none",
|
|
58
|
+
cursor: "pointer",
|
|
59
|
+
color: getTextColor(colorTextNeutral),
|
|
60
|
+
borderRadius: getBorderRadius(borderRadiusMd),
|
|
61
|
+
"&:focus-visible": focusStyles,
|
|
62
|
+
...forcedColors({
|
|
63
|
+
border: `${getBorderWidth(borderWidthSm)} solid ButtonBorder`,
|
|
64
|
+
background: "ButtonFace",
|
|
65
|
+
color: "ButtonText"
|
|
66
|
+
})
|
|
67
|
+
}, ({
|
|
68
|
+
elevation = true,
|
|
69
|
+
orientation
|
|
70
|
+
}) => {
|
|
71
|
+
if (!elevation && orientation === linkListItemVariantHorizontal) {
|
|
72
|
+
return {
|
|
73
|
+
borderRadius: getBorderRadius(borderRadiusNone),
|
|
74
|
+
transitionProperty: "color",
|
|
75
|
+
transitionDuration: "0.2s",
|
|
76
|
+
transitionTimingFunction: ease_in_sine,
|
|
77
|
+
"&:hover, &:focus-visible": {
|
|
78
|
+
color: getTextColor(colorTextBrand)
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const buttonParent = `${LinkListItemButtonStyled.toString()} &`;
|
|
84
|
+
const LinkListItemAnchorStyled = styled.a.withConfig({
|
|
85
|
+
shouldForwardProp: filterProps(),
|
|
86
|
+
displayName: "LinkListItemAnchorStyled",
|
|
87
|
+
componentId: "sc-1dmfu9f-1"
|
|
88
|
+
})({
|
|
89
|
+
textDecoration: "none",
|
|
90
|
+
display: "block",
|
|
91
|
+
height: "100%",
|
|
92
|
+
color: getTextColor(colorTextNeutral),
|
|
93
|
+
"&:focus-visible": focusStyles,
|
|
94
|
+
"&:hover, &:focus": {
|
|
95
|
+
textDecoration: "none"
|
|
96
|
+
},
|
|
97
|
+
"&:visited": {
|
|
98
|
+
color: getTextColor(colorTextNeutral)
|
|
99
|
+
}
|
|
100
|
+
}, ({
|
|
101
|
+
elevation = true,
|
|
102
|
+
orientation
|
|
103
|
+
}) => {
|
|
104
|
+
if (!elevation && orientation === linkListItemVariantHorizontal) {
|
|
105
|
+
return {
|
|
106
|
+
borderRadius: getBorderRadius(borderRadiusNone),
|
|
107
|
+
transitionProperty: "color",
|
|
108
|
+
transitionDuration: "0.2s",
|
|
109
|
+
transitionTimingFunction: ease_in_sine,
|
|
110
|
+
"&:hover, &:focus-visible": {
|
|
111
|
+
color: getTextColor(colorTextBrand)
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
borderRadius: getBorderRadius(borderRadiusMd)
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
const parentHasFocusSelector = `${LinkListItemAnchorStyled.toString()}:focus-within &, ${LinkListItemButtonStyled.toString()}:focus-within &`;
|
|
120
|
+
const LinkListItemStyled = styled.span.withConfig({
|
|
121
|
+
shouldForwardProp: filterProps(),
|
|
122
|
+
displayName: "LinkListItemStyled",
|
|
123
|
+
componentId: "sc-1dmfu9f-2"
|
|
124
|
+
})({
|
|
125
|
+
display: "block",
|
|
126
|
+
height: "100%",
|
|
127
|
+
padding: `${getSpacing(spacingMd)} 0`
|
|
128
|
+
}, ({
|
|
129
|
+
orientation,
|
|
130
|
+
isLastItemInList = false
|
|
131
|
+
}) => {
|
|
132
|
+
if (orientation === linkListItemVariantVertical) {
|
|
133
|
+
return {
|
|
134
|
+
...hoverStylesChangingBackground,
|
|
135
|
+
borderRadius: getBorderRadius(borderRadiusMd),
|
|
136
|
+
border: `${getBorderWidth(borderWidthSm)} solid ${getBorderColor(colorBorderSubtle)}`,
|
|
137
|
+
padding: getSpacing(spacingMd),
|
|
138
|
+
[parentHasFocusSelector]: {
|
|
139
|
+
background: hoverBackgroundColor
|
|
140
|
+
},
|
|
141
|
+
...forcedColors({
|
|
142
|
+
border: `${getBorderWidth(borderWidthSm)} solid CanvasText`,
|
|
143
|
+
[buttonParent]: {
|
|
144
|
+
border: `${getBorderWidth(borderWidthSm)} solid ButtonBorder`
|
|
145
|
+
},
|
|
146
|
+
"&:hover, &:focus-visible": {
|
|
147
|
+
background: "inherit"
|
|
148
|
+
},
|
|
149
|
+
[parentHasFocusSelector]: {
|
|
150
|
+
background: "inherit"
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (!isLastItemInList) {
|
|
156
|
+
return {
|
|
157
|
+
borderBottom: `${getBorderWidth(borderWidthSm)} solid ${getBorderColor(colorBorderSubtle)}`,
|
|
158
|
+
...forcedColors({
|
|
159
|
+
borderBottom: `${getBorderWidth(borderWidthSm)} solid CanvasText}`
|
|
160
|
+
}),
|
|
161
|
+
...forcedColors({
|
|
162
|
+
[buttonParent]: {
|
|
163
|
+
borderBottom: "none"
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}, ({
|
|
169
|
+
bottomSpacing = spacingMd
|
|
170
|
+
}) => getBottomSpacing({
|
|
171
|
+
bottomSpacing
|
|
172
|
+
}));
|
|
173
|
+
const LinkListItemElevatedStyled = styled(Card).withConfig({
|
|
174
|
+
displayName: "LinkListItemElevatedStyled",
|
|
175
|
+
componentId: "sc-1dmfu9f-3"
|
|
176
|
+
})({
|
|
177
|
+
...hoverStylesChangingBackground,
|
|
178
|
+
...forcedColors({
|
|
179
|
+
[buttonParent]: {
|
|
180
|
+
border: `${getBorderWidth(borderWidthSm)} solid ButtonBorder`,
|
|
181
|
+
background: "ButtonFace",
|
|
182
|
+
color: "ButtonText"
|
|
183
|
+
}
|
|
184
|
+
}),
|
|
185
|
+
height: "100%"
|
|
186
|
+
}, () => {
|
|
187
|
+
return {
|
|
188
|
+
[parentHasFocusSelector]: {
|
|
189
|
+
background: hoverBackgroundColor
|
|
190
|
+
},
|
|
191
|
+
...forcedColors({
|
|
192
|
+
[parentHasFocusSelector]: {
|
|
193
|
+
background: "inherit"
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
const LinkListItemContentWrapperStyled = styled.span.withConfig({
|
|
199
|
+
shouldForwardProp: filterProps(),
|
|
200
|
+
displayName: "LinkListItemContentWrapperStyled",
|
|
201
|
+
componentId: "sc-1dmfu9f-4"
|
|
202
|
+
})({
|
|
203
|
+
display: "flex"
|
|
204
|
+
}, ({
|
|
205
|
+
orientation = linkListItemVariantHorizontal
|
|
206
|
+
}) => {
|
|
207
|
+
return {
|
|
208
|
+
alignItems: orientation === linkListItemVariantVertical ? "flex-start" : "center",
|
|
209
|
+
flexDirection: orientation === linkListItemVariantVertical ? "column" : "row",
|
|
210
|
+
gap: orientation === linkListItemVariantVertical ? getSpacing(spacingXs) : getSpacing(spacingNone)
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
const LinkListItemContentStyled = styled.span.withConfig({
|
|
214
|
+
shouldForwardProp: filterProps(),
|
|
215
|
+
displayName: "LinkListItemContentStyled",
|
|
216
|
+
componentId: "sc-1dmfu9f-5"
|
|
217
|
+
})({
|
|
218
|
+
flexGrow: 1,
|
|
219
|
+
display: "flex",
|
|
220
|
+
gap: getSpacing(spacingXs),
|
|
221
|
+
flexDirection: "row",
|
|
222
|
+
width: "100%"
|
|
223
|
+
}, ({
|
|
224
|
+
orientation = linkListItemVariantHorizontal
|
|
225
|
+
}) => {
|
|
226
|
+
return {
|
|
227
|
+
alignItems: orientation === linkListItemVariantVertical ? "flex-start" : "center",
|
|
228
|
+
paddingRight: orientation === linkListItemVariantVertical ? getSpacing(spacingNone) : getSpacing(spacingXs)
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
const LinkListItemVerticalContentStyled = styled.span.withConfig({
|
|
232
|
+
displayName: "LinkListItemVerticalContentStyled",
|
|
233
|
+
componentId: "sc-1dmfu9f-6"
|
|
234
|
+
})({
|
|
235
|
+
flexGrow: 1,
|
|
236
|
+
gap: getSpacing(spacingXs),
|
|
237
|
+
display: "flex",
|
|
238
|
+
flexDirection: "column"
|
|
239
|
+
});
|
|
240
|
+
const LinkListItemLabelWrapperStyled = styled.span.withConfig({
|
|
241
|
+
shouldForwardProp: filterProps(),
|
|
242
|
+
displayName: "LinkListItemLabelWrapperStyled",
|
|
243
|
+
componentId: "sc-1dmfu9f-7"
|
|
244
|
+
})({
|
|
245
|
+
display: "flex",
|
|
246
|
+
flexDirection: "column",
|
|
247
|
+
flexGrow: 1,
|
|
248
|
+
alignItems: "flex-start"
|
|
249
|
+
});
|
|
250
|
+
const LinkListLabelStyled = styled.span.withConfig({
|
|
251
|
+
shouldForwardProp: filterProps(),
|
|
252
|
+
displayName: "LinkListLabelStyled",
|
|
253
|
+
componentId: "sc-1dmfu9f-8"
|
|
254
|
+
})(getHeadingSize(textHeadingXs), {
|
|
255
|
+
textAlign: "left"
|
|
256
|
+
});
|
|
257
|
+
const LinkListItemChevronStyled = styled(Icon).withConfig({
|
|
258
|
+
displayName: "LinkListItemChevronStyled",
|
|
259
|
+
componentId: "sc-1dmfu9f-9"
|
|
260
|
+
})({
|
|
261
|
+
flexGrow: 0,
|
|
262
|
+
flexShrink: 0,
|
|
263
|
+
color: getIconColor(colorIconBrand)
|
|
264
|
+
});
|
|
265
|
+
const isLinkListItemAsButtonProp = (props) => {
|
|
266
|
+
return props.href === void 0;
|
|
267
|
+
};
|
|
268
|
+
const LinkListItem = (props) => {
|
|
269
|
+
const {
|
|
270
|
+
icon,
|
|
271
|
+
label,
|
|
272
|
+
suffix,
|
|
273
|
+
badge,
|
|
274
|
+
orientation,
|
|
275
|
+
elevation,
|
|
276
|
+
isLastItemInList
|
|
277
|
+
} = props;
|
|
278
|
+
const LinkListIcon = icon ? /* @__PURE__ */ jsx(IconLoader, { name: icon, size: iconSizeMd }) : void 0;
|
|
279
|
+
const LinkListLabel = /* @__PURE__ */ jsx(LinkListLabelStyled, { children: label });
|
|
280
|
+
const LinkListSuffix = suffix ? /* @__PURE__ */ jsx(Body, { tag: spanTagName, bottomSpacing: spacingNone, children: suffix }) : void 0;
|
|
281
|
+
const LinkListBadge = badge ? /* @__PURE__ */ jsx(Badge, { ...badge, size: smallSize, bottomSpacing: spacingNone }) : void 0;
|
|
282
|
+
const LinkListChevron = /* @__PURE__ */ jsx(LinkListItemChevronStyled, { name: "ChevronRight", size: iconSizeMd });
|
|
283
|
+
const Content = /* @__PURE__ */ jsx(LinkListItemContentWrapperStyled, { orientation, children: orientation === linkListItemVariantHorizontal ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
284
|
+
/* @__PURE__ */ jsxs(LinkListItemContentStyled, { orientation, children: [
|
|
285
|
+
LinkListIcon,
|
|
286
|
+
/* @__PURE__ */ jsxs(LinkListItemLabelWrapperStyled, { children: [
|
|
287
|
+
LinkListLabel,
|
|
288
|
+
LinkListSuffix
|
|
289
|
+
] }),
|
|
290
|
+
LinkListBadge
|
|
291
|
+
] }),
|
|
292
|
+
LinkListChevron
|
|
293
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
294
|
+
/* @__PURE__ */ jsxs(LinkListItemContentStyled, { orientation, children: [
|
|
295
|
+
/* @__PURE__ */ jsxs(LinkListItemVerticalContentStyled, { children: [
|
|
296
|
+
LinkListIcon,
|
|
297
|
+
/* @__PURE__ */ jsxs(LinkListItemLabelWrapperStyled, { children: [
|
|
298
|
+
LinkListLabel,
|
|
299
|
+
LinkListSuffix
|
|
300
|
+
] })
|
|
301
|
+
] }),
|
|
302
|
+
LinkListChevron
|
|
303
|
+
] }),
|
|
304
|
+
LinkListBadge
|
|
305
|
+
] }) });
|
|
306
|
+
const Item = elevation ? /* @__PURE__ */ jsx(LinkListItemElevatedStyled, { ...props, tag: "span", children: Content }) : /* @__PURE__ */ jsx(LinkListItemStyled, { orientation, bottomSpacing: props.bottomSpacing, isLastItemInList, children: Content });
|
|
307
|
+
if (isLinkListItemAsButtonProp(props)) {
|
|
308
|
+
return /* @__PURE__ */ jsx(LinkListItemButtonStyled, { ...props, children: Item });
|
|
309
|
+
}
|
|
310
|
+
return /* @__PURE__ */ jsx(LinkListItemAnchorStyled, { ...props, elevation, orientation, children: Item });
|
|
311
|
+
};
|
|
312
|
+
export {
|
|
313
|
+
LinkListItem as default,
|
|
314
|
+
linkListItemVariantHorizontal,
|
|
315
|
+
linkListItemVariantVertical
|
|
316
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { S as ScreenreaderOnly } from "../../index-DQhtQZ85.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-DZo6MwrF.js";
|
|
7
|
+
const LoadingSpinnerSVG = ({
|
|
8
|
+
size = "lg",
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
return /* @__PURE__ */ jsxs(LoadingSpinnerSVGStyled, { viewBox: `0 0 300 300`, ...props, size, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(LoadingSpinnerPathOuter3Styled, { ...props, d: "M185.65,40.86l-0.22,0c-28.22,0.33-57.74,11.7-78.99,30.42C79.44,93.61,62,129.95,62,163.92\n c0,26.73,9.87,51.28,27.8,69.13c16.65,16.58,39.06,26.1,61.49,26.1c53.56,0,86.71-44.64,86.71-85.99c0-17.3-4.21-32.61-12.5-45.52\n c-8.83-13.74-22.04-24.27-39.3-31.38c1.2-3.82,2.98-7.05,5.32-9.65c1.6-1.77,3.69-3.45,4.35-3.9" }),
|
|
13
|
+
/* @__PURE__ */ jsx(LoadingSpinnerPathOuter2Styled, { ...props, d: "M185.65,47.97l-0.13,0c-26.62,0.31-54.44,11.04-74.45,28.72c-25.49,21.03-41.95,55.25-41.95,87.22\n c0,24.82,9.13,47.58,25.7,64.09c15.33,15.27,35.91,24.02,56.47,24.02c49.16,0,79.6-40.94,79.6-78.88c0-15.91-3.83-29.93-11.37-41.67\n c-8.95-13.93-22.94-24.26-41.62-30.77c1.2-7.72,3.99-14.05,8.34-18.87c2.31-2.56,5.35-4.94,6.25-5.4" }),
|
|
14
|
+
/* @__PURE__ */ jsx(LoadingSpinnerPathOuter1Styled, { ...props, d: "M185.71,55.09l-0.11,0c-25.01,0.29-51.13,10.39-69.92,27.02c-23.97,19.73-39.45,51.82-39.45,81.81\n c0,22.91,8.38,43.88,23.61,59.05c14,13.95,32.76,21.95,51.45,21.95c44.77,0,72.48-37.25,72.48-71.76c0-23.89-9.47-54.49-53.55-67.42\n c0.42-7.31,2.21-19.2,10.73-28.65c2.57-2.85,6.31-5.98,8.37-7" }),
|
|
15
|
+
/* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx(LoadingSpinnerPathCenterStyled, { ...props, d: "M169.82,69.89c-12.5,15.07-12.76,33.09-12.86,40.02c-0.01,0.41-0.01,0.77-0.02,1.08l-0.12,4.83l4.7,1.14\n c32.6,7.94,49.13,26.84,49.13,56.18c0,14.26-5.74,28.76-15.74,39.76c-7.83,8.62-21.76,18.89-43.62,18.89\n c-15.25,0-30.62-6.61-42.19-18.13c-12.74-12.68-19.75-30.35-19.75-49.75c0-26.26,13.65-54.43,34.77-71.76l0.09-0.07l0.09-0.08\n C136.61,81.07,153.13,73.18,169.82,69.89 M185.71,62.2c-0.01,0-0.02,0-0.03,0c-21.67,0.25-46.87,8.88-65.38,25.32\n c-20.87,17.13-36.96,46.26-36.96,76.4c0,45.51,34.73,73.88,67.94,73.88c41.01,0,65.37-34.05,65.37-64.65\n c0-30.78-16.84-53.02-53.71-62.01c0.01-0.33,0.01-0.71,0.02-1.15c0.09-6.47,0.34-23.99,12.7-37.68c2.7-2.99,7.17-6.97,10.48-8.61\n C187.23,63.17,187.06,62.2,185.71,62.2L185.71,62.2z" }) })
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
const LoadingSpinnerXsSVG = ({
|
|
19
|
+
size = "xs",
|
|
20
|
+
...props
|
|
21
|
+
}) => {
|
|
22
|
+
return /* @__PURE__ */ jsx(LoadingSpinnerSVGStyled, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", ...props, size, children: /* @__PURE__ */ jsx(LoadingSpinnerPathXsStyled, { d: "M16.5433 9.04214C15.3747 8.41164 14.7394 8.31265 13.241 8.05992C13.241 5.27996 14.9891 2.5 14.9891 2.5C14.9891 2.5 12.2755 2.9686 10.2506 4.26907C8.86921 5.15627 7.57249 6.50626 6.75444 7.8072C5.20219 10.0571 4.92139 12.3496 5.01657 14.2428C5.12333 18.6859 8.78367 22 12.7811 22C16.7785 22 20 18.8298 20 14.7587C20 11.8889 18.6795 10.2393 16.6901 9.12291", ...props }) });
|
|
23
|
+
};
|
|
24
|
+
const LoadingSpinner = ({
|
|
25
|
+
size = "lg",
|
|
26
|
+
label,
|
|
27
|
+
hasOverlay = false,
|
|
28
|
+
children,
|
|
29
|
+
bottomSpacing,
|
|
30
|
+
isActive = false,
|
|
31
|
+
coversFullPage,
|
|
32
|
+
screenReaderLabel,
|
|
33
|
+
screenReaderLabelCompleted,
|
|
34
|
+
//This default is set as the 'wrapper' element is currently containing the majority of the content of pages from our CMS.
|
|
35
|
+
getContentElements = () => document.getElementsByClassName("wrapper"),
|
|
36
|
+
...props
|
|
37
|
+
}) => {
|
|
38
|
+
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
|
+
isActive && /* @__PURE__ */ jsxs(LoadingSpinnerContentStyled, { size, hasOverlay: coversFullPage ? true : hasOverlay, coversFullPage, children: [
|
|
40
|
+
size === "xs" ? /* @__PURE__ */ jsx(LoadingSpinnerXsSVG, { ...props, size }) : /* @__PURE__ */ jsx(LoadingSpinnerSVG, { ...props, size }),
|
|
41
|
+
label && /* @__PURE__ */ jsx(LoadingSpinnerLabelStyled, { size, children: label })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx(ScreenreaderOnly, { children: isActive ? screenReaderLabel : screenReaderLabelCompleted }),
|
|
44
|
+
children && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(LoadingSpinnerChildrenStyled, { size, label, bottomSpacing, isActive, ...{
|
|
45
|
+
inert: isActive ? true : void 0
|
|
46
|
+
}, children }) })
|
|
47
|
+
] });
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (coversFullPage) {
|
|
50
|
+
document.body.classList.toggle("HideOverflowY", isActive);
|
|
51
|
+
const contentElements = getContentElements();
|
|
52
|
+
for (const element of contentElements) {
|
|
53
|
+
element.setAttribute("aria-hidden", isActive ? "true" : "false");
|
|
54
|
+
element.toggleAttribute("inert", isActive);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return () => {
|
|
58
|
+
document.body.classList.remove("HideOverflowY");
|
|
59
|
+
const contentElements = getContentElements();
|
|
60
|
+
for (const element of contentElements) {
|
|
61
|
+
element.removeAttribute("aria-hidden");
|
|
62
|
+
element.removeAttribute("inert");
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}, [isActive, coversFullPage]);
|
|
66
|
+
return coversFullPage ? createPortal(loadingSpinner, document.body) : loadingSpinner;
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
LoadingSpinner as default
|
|
70
|
+
};
|