@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.
Files changed (141) hide show
  1. package/dist/BackgroundColor-JObp_2xA.js +14 -0
  2. package/dist/BorderColor-BummoQ1-.js +24 -0
  3. package/dist/BorderRadius-ClUShVLu.js +10 -0
  4. package/dist/BorderWidth-DfOlyKK7.js +16 -0
  5. package/dist/CornerStyle-JEbGNArR.js +6 -0
  6. package/dist/FontWeight-CR22KTex.js +8 -0
  7. package/dist/HeadingSize-CfCRn3Lh.js +12 -0
  8. package/dist/IconColor-CtC9WUgr.js +10 -0
  9. package/dist/ObjectColor-BZDBuV8H.js +22 -0
  10. package/dist/Opacity-smkGiwsf.js +6 -0
  11. package/dist/SizeTypes-Ck_RdzIf.js +8 -0
  12. package/dist/Spacing-D0HQH9YJ.js +16 -0
  13. package/dist/TextBodySize-BcZR9mh2.js +6 -0
  14. package/dist/TextColor-BXiR5Uq9.js +16 -0
  15. package/dist/colorUtils-uLZF5UIN.js +94 -0
  16. package/dist/components/Accordion/index.js +195 -0
  17. package/dist/components/AccordionGroup/index.js +59 -0
  18. package/dist/components/Badge/index.js +11 -0
  19. package/dist/components/Body/index.js +72 -6
  20. package/dist/components/BottomBar/index.js +79 -0
  21. package/dist/components/Button/index.js +24 -0
  22. package/dist/components/ButtonAsLink/index.js +7 -0
  23. package/dist/components/ButtonGroup/index.js +34 -0
  24. package/dist/components/Card/index.js +18 -0
  25. package/dist/components/Carousel/index.js +497 -0
  26. package/dist/components/Checkbox/index.js +218 -0
  27. package/dist/components/CheckboxGroup/index.js +58 -0
  28. package/dist/components/Collapsible/index.js +85 -0
  29. package/dist/components/ColorSwatch/index.js +87 -0
  30. package/dist/components/ColorSwatchGroup/index.js +43 -0
  31. package/dist/components/Container/index.js +76 -0
  32. package/dist/components/DateInput/index.js +86 -0
  33. package/dist/components/DemoBox/index.js +21 -0
  34. package/dist/components/Dialog/index.js +172 -0
  35. package/dist/components/DiscoveryCard/index.js +130 -0
  36. package/dist/components/DiscoveryCardGroup/index.js +53 -0
  37. package/dist/components/Divider/index.js +30 -0
  38. package/dist/components/Fieldset/index.js +41 -0
  39. package/dist/components/FilterGroup/index.js +148 -0
  40. package/dist/components/Flex/index.js +17 -0
  41. package/dist/components/FlexItem/index.js +41 -0
  42. package/dist/components/FootnoteContent/index.js +39 -0
  43. package/dist/components/FootnoteLink/index.js +46 -0
  44. package/dist/components/Form/index.js +20 -0
  45. package/dist/components/FormElement/index.js +31 -0
  46. package/dist/components/FormHelperLabel/index.js +21 -0
  47. package/dist/components/FormHelperMessage/index.js +47 -0
  48. package/dist/components/FormHelperStatusIcon/index.js +50 -0
  49. package/dist/components/GoogleMap/index.js +196 -0
  50. package/dist/components/Grid/index.js +39 -0
  51. package/dist/components/GridItem/index.js +12 -0
  52. package/dist/components/Heading/index.js +94 -0
  53. package/dist/components/HifiIcon/index.js +31 -0
  54. package/dist/components/Icon/index.js +38 -0
  55. package/dist/components/IconButton/index.js +85 -0
  56. package/dist/components/IconSnippet/index.js +112 -0
  57. package/dist/components/IconSnippet/styled.d.ts +1 -1
  58. package/dist/components/IconSnippetList/index.js +25 -0
  59. package/dist/components/Image/index.js +84 -0
  60. package/dist/components/ImageHeader/index.js +262 -0
  61. package/dist/components/ImageHeader/styled.d.ts +4 -4
  62. package/dist/components/InlineLink/index.js +43 -0
  63. package/dist/components/Input/index.js +55 -0
  64. package/dist/components/Label/index.js +22 -0
  65. package/dist/components/Legend/index.js +60 -0
  66. package/dist/components/Link/index.js +19 -0
  67. package/dist/components/LinkAsButton/index.js +7 -0
  68. package/dist/components/LinkList/index.js +64 -0
  69. package/dist/components/LinkListItem/index.js +316 -0
  70. package/dist/components/LoadingSpinner/index.js +70 -0
  71. package/dist/components/Notification/index.js +181 -0
  72. package/dist/components/Overlay/index.js +33 -0
  73. package/dist/components/PickerGroup/index.js +282 -0
  74. package/dist/components/Price/index.js +18 -0
  75. package/dist/components/ProductCard/index.js +81 -0
  76. package/dist/components/RadioGroup/index.js +197 -0
  77. package/dist/components/ResponsiveImage/index.js +89 -0
  78. package/dist/components/RichText/index.js +7 -0
  79. package/dist/components/ScreenreaderOnly/index.js +6 -0
  80. package/dist/components/SearchInput/index.js +140 -0
  81. package/dist/components/SelectInput/index.js +160 -0
  82. package/dist/components/Stepper/index.js +205 -0
  83. package/dist/components/SuggestInput/index.js +387 -0
  84. package/dist/components/Switch/index.js +169 -0
  85. package/dist/components/TabularPrice/index.js +8 -0
  86. package/dist/components/TextList/index.js +10 -0
  87. package/dist/components/Textarea/index.js +156 -0
  88. package/dist/components/Tray/index.js +218 -0
  89. package/dist/easing-Dm-pO8SY.js +6 -0
  90. package/dist/filterProps-Cewck8OH.js +13 -0
  91. package/dist/foundations/GlobalStyle/index.js +3 -292
  92. package/dist/foundations/PatternProps/index.js +1 -0
  93. package/dist/foundations/media-query/forcedColors/index.js +12 -0
  94. package/dist/foundations/media-query/reducedMotion/index.js +21 -0
  95. package/dist/foundations/media-query/viewport/index.js +6 -0
  96. package/dist/foundations/token/getBackgroundColor/index.js +5 -0
  97. package/dist/foundations/token/getBodySize/index.js +13 -2
  98. package/dist/foundations/token/getBorderColor/index.js +5 -0
  99. package/dist/foundations/token/getBorderRadius/index.js +15 -0
  100. package/dist/foundations/token/getBorderWidth/index.js +19 -0
  101. package/dist/foundations/token/getBottomSpacing/index.js +14 -0
  102. package/dist/foundations/token/getFontWeight/index.js +13 -0
  103. package/dist/foundations/token/getHeadingSize/index.js +27 -0
  104. package/dist/foundations/token/getHoverColor/index.js +7 -0
  105. package/dist/foundations/token/getIconColor/index.js +5 -0
  106. package/dist/foundations/token/getObjectColor/index.js +5 -0
  107. package/dist/foundations/token/getOpacity/index.js +11 -0
  108. package/dist/foundations/token/getPressColor/index.js +7 -0
  109. package/dist/foundations/token/getSpacing/index.js +5 -0
  110. package/dist/foundations/token/getTextColor/index.js +5 -0
  111. package/dist/foundations/token/getTextDecoration/index.js +13 -0
  112. package/dist/getCssVar-BP6T9pFM.js +6 -0
  113. package/dist/hooks/useFocusWithin/index.js +36 -0
  114. package/dist/hooks/useForcedColors/index.js +9 -0
  115. package/dist/hooks/useMediaQuery/index.js +19 -0
  116. package/dist/hooks/useReducedMotion/index.js +9 -0
  117. package/dist/hooks/useThirdPartyConsent/index.js +54 -0
  118. package/dist/hooks/useViewport/index.js +24 -0
  119. package/dist/icons/index.js +603 -0
  120. package/dist/index-B5AxA0A-.js +79 -0
  121. package/dist/index-C0N671c1.js +79 -0
  122. package/dist/index-Cbojl4_Q.js +7134 -0
  123. package/dist/index-CeJsIf3Z.js +208 -0
  124. package/dist/index-Ck2bCrhT.js +32 -0
  125. package/dist/index-D6hvbziL.js +167 -0
  126. package/dist/index-DQhtQZ85.js +24 -0
  127. package/dist/index-DUnDnTyk.js +61 -0
  128. package/dist/props-Czq9XX2J.js +6 -0
  129. package/dist/{index-BaPlSfS3.js → renderInlineRichTextFromOpenText-CA52y1-B.js} +3 -105
  130. package/dist/shadow-u158mzuN.js +4 -0
  131. package/dist/styled-BPTa90Cm.js +165 -0
  132. package/dist/styled-BpvuD699.js +45 -0
  133. package/dist/styled-CDWclYAa.js +124 -0
  134. package/dist/styled-CXSdomF5.js +34 -0
  135. package/dist/styled-CpoX5USb.js +71 -0
  136. package/dist/styled-DZo6MwrF.js +245 -0
  137. package/dist/styled-Wlt68LfQ.js +133 -0
  138. package/dist/styled-ZpQohvyx.js +29 -0
  139. package/dist/tags-DI6H1biK.js +29 -0
  140. package/package.json +2 -1
  141. package/dist/index-BoPDwZgt.js +0 -18
@@ -0,0 +1,14 @@
1
+ const colorBackgroundBrand = "colorBackgroundBrand";
2
+ const colorBackgroundBrandGradient = "colorBackgroundBrandGradient";
3
+ const colorBackgroundNeutral = "colorBackgroundNeutral";
4
+ const colorBackgroundSubtle = "colorBackgroundSubtle";
5
+ const colorBackgroundOverlay = "colorBackgroundOverlay";
6
+ const colorBackgroundOverlayStatic = "colorBackgroundOverlayStatic";
7
+ export {
8
+ colorBackgroundOverlay as a,
9
+ colorBackgroundOverlayStatic as b,
10
+ colorBackgroundNeutral as c,
11
+ colorBackgroundBrandGradient as d,
12
+ colorBackgroundBrand as e,
13
+ colorBackgroundSubtle as f
14
+ };
@@ -0,0 +1,24 @@
1
+ const colorBorderBrand = "colorBorderBrand";
2
+ const colorBorderNeutral = "colorBorderNeutral";
3
+ const colorBorderSubtle = "colorBorderSubtle";
4
+ const colorBorderInverse = "colorBorderInverse";
5
+ const colorBorderSuccess = "colorBorderSuccess";
6
+ const colorBorderCritical = "colorBorderCritical";
7
+ const colorBorderWarning = "colorBorderWarning";
8
+ const colorBorderInformation = "colorBorderInformation";
9
+ const colorBorderUnselected = "colorBorderUnselected";
10
+ const colorBorderSelected = "colorBorderSelected";
11
+ const colorBorderFocus = "colorBorderFocus";
12
+ export {
13
+ colorBorderNeutral as a,
14
+ colorBorderUnselected as b,
15
+ colorBorderFocus as c,
16
+ colorBorderSuccess as d,
17
+ colorBorderCritical as e,
18
+ colorBorderWarning as f,
19
+ colorBorderBrand as g,
20
+ colorBorderInverse as h,
21
+ colorBorderSelected as i,
22
+ colorBorderSubtle as j,
23
+ colorBorderInformation as k
24
+ };
@@ -0,0 +1,10 @@
1
+ const borderRadiusNone = "borderRadiusNone";
2
+ const borderRadiusSm = "borderRadiusSm";
3
+ const borderRadiusMd = "borderRadiusMd";
4
+ const borderRadiusFull = "borderRadiusFull";
5
+ export {
6
+ borderRadiusNone as a,
7
+ borderRadiusMd as b,
8
+ borderRadiusFull as c,
9
+ borderRadiusSm as d
10
+ };
@@ -0,0 +1,16 @@
1
+ const borderWidthNone = "None";
2
+ const borderWidthDivider = "Divider";
3
+ const borderWidthUnselected = "Unselected";
4
+ const borderWidthSelected = "Selected";
5
+ const borderWidthFocus = "Focus";
6
+ const borderWidthSm = "Sm";
7
+ const borderWidthMd = "Md";
8
+ export {
9
+ borderWidthFocus as a,
10
+ borderWidthUnselected as b,
11
+ borderWidthSm as c,
12
+ borderWidthSelected as d,
13
+ borderWidthDivider as e,
14
+ borderWidthNone as f,
15
+ borderWidthMd as g
16
+ };
@@ -0,0 +1,6 @@
1
+ const cornerStraight = "straight";
2
+ const cornerRounded = "rounded";
3
+ export {
4
+ cornerRounded as a,
5
+ cornerStraight as c
6
+ };
@@ -0,0 +1,8 @@
1
+ const fontWeightLight = "light";
2
+ const fontWeightRegular = "regular";
3
+ const fontWeightBold = "bold";
4
+ export {
5
+ fontWeightLight as a,
6
+ fontWeightRegular as b,
7
+ fontWeightBold as f
8
+ };
@@ -0,0 +1,12 @@
1
+ const textHeadingXl = "xl";
2
+ const textHeadingLg = "lg";
3
+ const textHeadingMd = "md";
4
+ const textHeadingSm = "sm";
5
+ const textHeadingXs = "xs";
6
+ export {
7
+ textHeadingMd as a,
8
+ textHeadingSm as b,
9
+ textHeadingLg as c,
10
+ textHeadingXl as d,
11
+ textHeadingXs as t
12
+ };
@@ -0,0 +1,10 @@
1
+ const colorIconBrand = "colorIconBrand";
2
+ const colorIconInverse = "colorIconInverse";
3
+ const colorIconSuccess = "colorIconSuccess";
4
+ const colorIconCritical = "colorIconCritical";
5
+ export {
6
+ colorIconCritical as a,
7
+ colorIconBrand as b,
8
+ colorIconSuccess as c,
9
+ colorIconInverse as d
10
+ };
@@ -0,0 +1,22 @@
1
+ const colorObjectBrand = "colorObjectBrand";
2
+ const colorObjectNeutral = "colorObjectNeutral";
3
+ const colorObjectInverse = "colorObjectInverse";
4
+ const colorObjectAccent = "colorObjectAccent";
5
+ const colorObjectSuccess = "colorObjectSuccess";
6
+ const colorObjectCritical = "colorObjectCritical";
7
+ const colorObjectWarning = "colorObjectWarning";
8
+ const colorObjectInformation = "colorObjectInformation";
9
+ const colorObjectSelected = "colorObjectSelected";
10
+ const colorObjectUnselected = "colorObjectUnselected";
11
+ export {
12
+ colorObjectInverse as a,
13
+ colorObjectSelected as b,
14
+ colorObjectBrand as c,
15
+ colorObjectUnselected as d,
16
+ colorObjectSuccess as e,
17
+ colorObjectNeutral as f,
18
+ colorObjectAccent as g,
19
+ colorObjectCritical as h,
20
+ colorObjectWarning as i,
21
+ colorObjectInformation as j
22
+ };
@@ -0,0 +1,6 @@
1
+ const opacityOverlay = "Overlay";
2
+ const opacityDisabled = "Disabled";
3
+ export {
4
+ opacityDisabled as a,
5
+ opacityOverlay as o
6
+ };
@@ -0,0 +1,8 @@
1
+ const smallSize = "sm";
2
+ const largeSize = "lg";
3
+ const mediumSize = "md";
4
+ export {
5
+ largeSize as l,
6
+ mediumSize as m,
7
+ smallSize as s
8
+ };
@@ -0,0 +1,16 @@
1
+ const spacingNone = "None";
2
+ const spacing2Xs = "2Xs";
3
+ const spacingXs = "Xs";
4
+ const spacingSm = "Sm";
5
+ const spacingMd = "Md";
6
+ const spacingLg = "Lg";
7
+ const spacingXl = "Xl";
8
+ export {
9
+ spacingXs as a,
10
+ spacingNone as b,
11
+ spacingSm as c,
12
+ spacingXl as d,
13
+ spacing2Xs as e,
14
+ spacingLg as f,
15
+ spacingMd as s
16
+ };
@@ -0,0 +1,6 @@
1
+ const textBodyMd = "md";
2
+ const textBodySm = "sm";
3
+ export {
4
+ textBodySm as a,
5
+ textBodyMd as t
6
+ };
@@ -0,0 +1,16 @@
1
+ const colorTextBrand = "colorTextBrand";
2
+ const colorTextNeutral = "colorTextNeutral";
3
+ const colorTextNeutralStatic = "colorTextNeutralStatic";
4
+ const colorTextInverse = "colorTextInverse";
5
+ const colorTextInverseStatic = "colorTextInverseStatic";
6
+ const colorTextCritical = "colorTextCritical";
7
+ const colorTextPlaceholder = "colorTextPlaceholder";
8
+ export {
9
+ colorTextNeutral as a,
10
+ colorTextNeutralStatic as b,
11
+ colorTextInverseStatic as c,
12
+ colorTextInverse as d,
13
+ colorTextPlaceholder as e,
14
+ colorTextBrand as f,
15
+ colorTextCritical as g
16
+ };
@@ -0,0 +1,94 @@
1
+ import { getTextColor } from "./foundations/token/getTextColor/index.js";
2
+ import { c as colorTextInverseStatic, a as colorTextNeutral, b as colorTextNeutralStatic, d as colorTextInverse } from "./TextColor-BXiR5Uq9.js";
3
+ const backgroundForegroundColorMapping = {
4
+ colorBackgroundBrand: getTextColor(colorTextInverseStatic),
5
+ colorBackgroundNeutral: getTextColor(colorTextNeutral),
6
+ colorBackgroundSubtle: getTextColor(colorTextNeutral),
7
+ colorObjectAccent: getTextColor(colorTextNeutralStatic),
8
+ colorObjectBrand: getTextColor(colorTextInverseStatic),
9
+ colorObjectCritical: getTextColor(colorTextInverse),
10
+ colorObjectInformation: getTextColor(colorTextInverse),
11
+ colorObjectInverse: getTextColor(colorTextNeutral),
12
+ colorObjectNeutral: getTextColor(colorTextInverse),
13
+ colorObjectSelected: getTextColor(colorTextInverse),
14
+ colorObjectUnselected: getTextColor(colorTextNeutralStatic),
15
+ colorObjectSubtle: getTextColor(colorTextNeutralStatic),
16
+ colorObjectSuccess: getTextColor(colorTextInverse),
17
+ colorObjectWarning: getTextColor(colorTextNeutralStatic),
18
+ colorBackgroundOverlay: getTextColor(colorTextNeutral),
19
+ colorBackgroundBrandGradient: getTextColor(colorTextInverseStatic),
20
+ colorBackgroundOverlayStatic: getTextColor(colorTextInverseStatic)
21
+ };
22
+ const getForegroundColor = (backgroundColor) => backgroundForegroundColorMapping[backgroundColor];
23
+ const hexToRgb = (hex) => {
24
+ hex = hex.replace(/^#/, "");
25
+ if (hex.length === 3) {
26
+ hex = hex.split("").map((char) => char + char).join("");
27
+ }
28
+ const bigint = parseInt(hex, 16);
29
+ const r = bigint >> 16 & 255;
30
+ const g = bigint >> 8 & 255;
31
+ const b = bigint & 255;
32
+ return {
33
+ r,
34
+ g,
35
+ b
36
+ };
37
+ };
38
+ const parseColorToRgbObject = (color) => {
39
+ if (color.startsWith("#")) {
40
+ return hexToRgb(color);
41
+ } else if (color.startsWith("rgb")) {
42
+ return parseRgbColorToRgbObject(color);
43
+ }
44
+ return {
45
+ r: 255,
46
+ g: 255,
47
+ b: 255
48
+ };
49
+ };
50
+ const parseRgbColorToRgbObject = (color) => {
51
+ const rgbValues = color.match(/\d+/g).map(Number);
52
+ return {
53
+ r: rgbValues[0],
54
+ g: rgbValues[1],
55
+ b: rgbValues[2]
56
+ };
57
+ };
58
+ const getComputedBackgroundColor = (element) => {
59
+ const computedStyle = window.getComputedStyle(element);
60
+ const backgroundColor = computedStyle.backgroundColor;
61
+ if (backgroundColor !== "rgba(0, 0, 0, 0)") {
62
+ return parseRgbColorToRgbObject(backgroundColor);
63
+ }
64
+ if (element.parentElement) return getComputedBackgroundColor(element.parentElement);
65
+ return {
66
+ r: 255,
67
+ g: 255,
68
+ b: 255
69
+ };
70
+ };
71
+ const getRelativeLuminance = ({
72
+ r,
73
+ g,
74
+ b
75
+ }) => {
76
+ const [red, green, blue] = [r, g, b].map((channel) => {
77
+ const c = channel / 255;
78
+ return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
79
+ });
80
+ return 0.2126 * red + 0.7152 * green + 0.0722 * blue;
81
+ };
82
+ const getContrastRatio = (color1, color2) => {
83
+ const luminance1 = getRelativeLuminance(color1);
84
+ const luminance2 = getRelativeLuminance(color2);
85
+ const lighter = Math.max(luminance1, luminance2);
86
+ const darker = Math.min(luminance1, luminance2);
87
+ return (lighter + 0.05) / (darker + 0.05);
88
+ };
89
+ export {
90
+ getComputedBackgroundColor as a,
91
+ getContrastRatio as b,
92
+ getForegroundColor as g,
93
+ parseColorToRgbObject as p
94
+ };
@@ -0,0 +1,195 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { bf as ChevronDownIcon, df as IconLoader, iu as iconSizeMd } from "../../index-Cbojl4_Q.js";
4
+ import { useRef, useState, useEffect } from "react";
5
+ import Collapsible from "../Collapsible/index.js";
6
+ import styled from "styled-components";
7
+ import Heading from "../Heading/index.js";
8
+ import forcedColors from "../../foundations/media-query/forcedColors/index.js";
9
+ import { noReducedMotion } from "../../foundations/media-query/reducedMotion/index.js";
10
+ import { a as ease_in_out_sine } from "../../easing-Dm-pO8SY.js";
11
+ import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
12
+ import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js";
13
+ import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
14
+ import { getFontWeight } from "../../foundations/token/getFontWeight/index.js";
15
+ import { getSpacing } from "../../foundations/token/getSpacing/index.js";
16
+ import { getTextColor } from "../../foundations/token/getTextColor/index.js";
17
+ import { j as colorBorderSubtle, c as colorBorderFocus } from "../../BorderColor-BummoQ1-.js";
18
+ import { f as borderWidthNone, b as borderWidthUnselected, a as borderWidthFocus } from "../../BorderWidth-DfOlyKK7.js";
19
+ import { b as fontWeightRegular, f as fontWeightBold } from "../../FontWeight-CR22KTex.js";
20
+ import { s as spacingMd, b as spacingNone, a as spacingXs } from "../../Spacing-D0HQH9YJ.js";
21
+ import { a as colorTextNeutral, f as colorTextBrand } from "../../TextColor-BXiR5Uq9.js";
22
+ import { f as filterProps } from "../../filterProps-Cewck8OH.js";
23
+ const accordionToggleExpanded = "expanded";
24
+ const accordionToggleCollapsing = "collapsing";
25
+ const accordionToggleCollapsed = "collapsed";
26
+ const openCloseDuration = "0.5s";
27
+ const AccordionStyled = styled.details.withConfig({
28
+ shouldForwardProp: filterProps(),
29
+ displayName: "AccordionStyled",
30
+ componentId: "sc-1t5leix-0"
31
+ })({
32
+ display: "flex",
33
+ flexDirection: "column"
34
+ }, {
35
+ borderStyle: "solid",
36
+ borderColor: getBorderColor(colorBorderSubtle),
37
+ borderWidth: getBorderWidth(borderWidthNone),
38
+ borderTopWidth: getBorderWidth(borderWidthUnselected),
39
+ borderBottomWidth: getBorderWidth(borderWidthUnselected),
40
+ "& + &": {
41
+ borderTopWidth: getBorderWidth(borderWidthNone)
42
+ }
43
+ }, ({
44
+ verticalScrollOffset = 0
45
+ }) => ({
46
+ scrollMarginTop: `${verticalScrollOffset}px`
47
+ }), getBottomSpacing);
48
+ const AccordionSummaryStyled = styled.summary.withConfig({
49
+ shouldForwardProp: filterProps(),
50
+ displayName: "AccordionSummaryStyled",
51
+ componentId: "sc-1t5leix-1"
52
+ })({
53
+ display: "flex",
54
+ alignItems: "center",
55
+ cursor: "pointer",
56
+ gap: `${getSpacing(spacingNone)} ${getSpacing(spacingXs)}`,
57
+ padding: `${getSpacing(spacingMd)} ${getSpacing(spacingNone)}`,
58
+ listStyleType: "none",
59
+ overflow: "hidden",
60
+ transition: `color ${openCloseDuration} ease-out`,
61
+ color: getTextColor(colorTextNeutral)
62
+ }, {
63
+ "&:hover": {
64
+ color: getTextColor(colorTextBrand)
65
+ }
66
+ }, () => {
67
+ const focusColor = getBorderColor(colorBorderFocus);
68
+ return {
69
+ "&:focus-visible": {
70
+ ...forcedColors({
71
+ outline: `${getBorderWidth(borderWidthFocus)} solid CanvasText`
72
+ }),
73
+ outline: "none",
74
+ boxShadow: `${focusColor} 0px 0px 0px ${getBorderWidth(borderWidthFocus)}`
75
+ }
76
+ };
77
+ }, {
78
+ "&::-webkit-details-marker": {
79
+ display: "none"
80
+ }
81
+ });
82
+ const AccordionHeadingStyled = styled(Heading).withConfig({
83
+ displayName: "AccordionHeadingStyled",
84
+ componentId: "sc-1t5leix-2"
85
+ })({
86
+ flex: 1,
87
+ margin: getSpacing(spacingNone),
88
+ color: "currentcolor"
89
+ }, {
90
+ fontWeight: getFontWeight(fontWeightRegular),
91
+ "details[open] &": {
92
+ fontWeight: getFontWeight(fontWeightBold)
93
+ },
94
+ ...noReducedMotion({
95
+ "details[open] &, details[open].collapsing &": {
96
+ transition: `font-weight ${openCloseDuration} ease-out`
97
+ },
98
+ "details[open].collapsing &": {
99
+ fontWeight: getFontWeight(fontWeightRegular)
100
+ }
101
+ })
102
+ });
103
+ const AccordionOpenIndicatorStyled = styled(ChevronDownIcon).withConfig({
104
+ displayName: "AccordionOpenIndicatorStyled",
105
+ componentId: "sc-1t5leix-3"
106
+ })({
107
+ transformOrigin: "center",
108
+ color: getTextColor(colorTextBrand)
109
+ }, {
110
+ transform: "rotate(0deg)",
111
+ "details[open] &": {
112
+ transform: "rotate(180deg)"
113
+ },
114
+ ...noReducedMotion({
115
+ "details[open] &, details[open].collapsing &": {
116
+ transition: `transform ${openCloseDuration} ${ease_in_out_sine}`
117
+ }
118
+ }),
119
+ "details[open].collapsing &": {
120
+ transform: "rotate(0deg)"
121
+ }
122
+ });
123
+ const Accordion = ({
124
+ uid,
125
+ children,
126
+ iconName,
127
+ heading,
128
+ headingProps,
129
+ expanded = true,
130
+ ...props
131
+ }) => {
132
+ const ref = useRef(null);
133
+ const [toggle, setToggle] = useState(expanded ? accordionToggleExpanded : accordionToggleCollapsed);
134
+ const [animated, setAnimated] = useState(true);
135
+ useEffect(() => {
136
+ const target = ref.current;
137
+ const observer = new MutationObserver(() => {
138
+ if (target == null ? void 0 : target.open) {
139
+ setAnimated(false);
140
+ setToggle(accordionToggleExpanded);
141
+ }
142
+ });
143
+ if (target) {
144
+ observer.observe(target, {
145
+ attributes: true,
146
+ attributeFilter: ["open"]
147
+ });
148
+ }
149
+ return () => observer.disconnect();
150
+ }, []);
151
+ useEffect(() => {
152
+ if (expanded && accordionToggleExpanded === toggle) {
153
+ return;
154
+ }
155
+ if (!expanded && accordionToggleCollapsed === toggle) {
156
+ return;
157
+ }
158
+ if (expanded) {
159
+ setToggle(accordionToggleExpanded);
160
+ } else if (toggle === accordionToggleExpanded) {
161
+ setToggle(accordionToggleCollapsing);
162
+ }
163
+ }, [expanded]);
164
+ const handleToggle = (event) => {
165
+ event.preventDefault();
166
+ const current = toggle;
167
+ setToggle(accordionToggleExpanded === current ? accordionToggleCollapsing : accordionToggleExpanded);
168
+ if (props.handleOnToggle) {
169
+ props.handleOnToggle(uid, accordionToggleExpanded !== current);
170
+ }
171
+ };
172
+ const onTransition = (open) => {
173
+ if (open && animated) {
174
+ setAnimated(true);
175
+ }
176
+ if (!open) {
177
+ setToggle(accordionToggleCollapsed);
178
+ }
179
+ };
180
+ const className = `${props.className ? props.className : ""} ${accordionToggleCollapsing === toggle ? "collapsing" : ""} `;
181
+ return /* @__PURE__ */ jsxs(AccordionStyled, { ref, className, open: accordionToggleCollapsed !== toggle, children: [
182
+ /* @__PURE__ */ jsxs(AccordionSummaryStyled, { onClick: handleToggle, role: "button", children: [
183
+ iconName && /* @__PURE__ */ jsx(IconLoader, { name: iconName, size: iconSizeMd }),
184
+ /* @__PURE__ */ jsx(AccordionHeadingStyled, { ...headingProps, size: "xs", children: heading }),
185
+ /* @__PURE__ */ jsx(AccordionOpenIndicatorStyled, { size: iconSizeMd })
186
+ ] }),
187
+ /* @__PURE__ */ jsx(Collapsible, { expanded: accordionToggleExpanded === toggle, animated, onTransition, children })
188
+ ] });
189
+ };
190
+ export {
191
+ accordionToggleCollapsed,
192
+ accordionToggleCollapsing,
193
+ accordionToggleExpanded,
194
+ Accordion as default
195
+ };
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { jsx, Fragment } from "react/jsx-runtime";
3
+ import Accordion from "../Accordion/index.js";
4
+ import { s as spacingMd, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
5
+ import { useState } from "react";
6
+ import styled from "styled-components";
7
+ import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
8
+ import { f as filterProps } from "../../filterProps-Cewck8OH.js";
9
+ const AccordionGroupSingleExpand = ({
10
+ bottomSpacing = spacingMd,
11
+ ...props
12
+ }) => {
13
+ const getAccordionsExpanded = () => {
14
+ const accordionItemsOpenState = {};
15
+ props.items.forEach((accordionItem) => {
16
+ accordionItemsOpenState[accordionItem.uid] = true === accordionItem.expanded;
17
+ });
18
+ return accordionItemsOpenState;
19
+ };
20
+ const [accordionExpanded, setAccordionExpanded] = useState(getAccordionsExpanded);
21
+ const handleOnToggle = (uid, expanded) => {
22
+ const nextState = {
23
+ ...accordionExpanded
24
+ };
25
+ for (const key in nextState) {
26
+ nextState[key] = false;
27
+ }
28
+ nextState[uid] = expanded;
29
+ setAccordionExpanded(nextState);
30
+ if (props.handleOnToggle) {
31
+ props.handleOnToggle(uid, expanded);
32
+ }
33
+ };
34
+ return /* @__PURE__ */ jsx(Fragment, { children: props.items.map((accordion, index) => {
35
+ const spacing = index + 1 === props.items.length ? bottomSpacing : spacingNone;
36
+ return /* @__PURE__ */ jsx(Accordion, { ...accordion, expanded: accordionExpanded[accordion.uid], handleOnToggle, bottomSpacing: spacing, verticalScrollOffset: props.verticalScrollOffset, children: accordion.children }, accordion.uid);
37
+ }) });
38
+ };
39
+ const AccordionGroupStyled = styled.div.withConfig({
40
+ shouldForwardProp: filterProps(),
41
+ displayName: "AccordionGroupStyled",
42
+ componentId: "sc-17dfswd-0"
43
+ })(getBottomSpacing);
44
+ const AccordionGroup = ({
45
+ singleExpand = false,
46
+ bottomSpacing = spacingMd,
47
+ ...props
48
+ }) => {
49
+ if (singleExpand) {
50
+ return /* @__PURE__ */ jsx(AccordionGroupStyled, { className: props.className, bottomSpacing, children: /* @__PURE__ */ jsx(AccordionGroupSingleExpand, { ...props, bottomSpacing }) });
51
+ }
52
+ return /* @__PURE__ */ jsx(AccordionGroupStyled, { bottomSpacing, children: props.items.map((accordion, index) => {
53
+ const spacing = index + 1 === props.items.length ? bottomSpacing : spacingNone;
54
+ return /* @__PURE__ */ jsx(Accordion, { ...accordion, bottomSpacing: spacing, handleOnToggle: accordion.handleOnToggle || props.handleOnToggle, children: accordion.children }, accordion.uid);
55
+ }) });
56
+ };
57
+ export {
58
+ AccordionGroup as default
59
+ };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import "react/jsx-runtime";
3
+ import "../../index-Cbojl4_Q.js";
4
+ import "../../Spacing-D0HQH9YJ.js";
5
+ import "../../SizeTypes-Ck_RdzIf.js";
6
+ import "../../renderInlineRichTextFromOpenText-CA52y1-B.js";
7
+ import { b, B } from "../../index-C0N671c1.js";
8
+ export {
9
+ b as BadgeAppearanceColor,
10
+ B as default
11
+ };
@@ -1,9 +1,75 @@
1
1
  "use client";
2
- import "react/jsx-runtime";
3
- import { c, b, d, B } from "../../index-BaPlSfS3.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { c as spacingSm, s as spacingMd } from "../../Spacing-D0HQH9YJ.js";
4
+ import { t as textBodyMd, a as textBodySm } from "../../TextBodySize-BcZR9mh2.js";
5
+ import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-CA52y1-B.js";
6
+ import styled from "styled-components";
7
+ import { getBodySize } from "../../foundations/token/getBodySize/index.js";
8
+ import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
9
+ import { getFontWeight } from "../../foundations/token/getFontWeight/index.js";
10
+ import { f as fontWeightBold } from "../../FontWeight-CR22KTex.js";
11
+ import { f as filterProps } from "../../filterProps-Cewck8OH.js";
12
+ const BodyStyled = styled.p.withConfig({
13
+ shouldForwardProp: filterProps(),
14
+ displayName: "BodyStyled",
15
+ componentId: "sc-1n7n7pv-0"
16
+ })({
17
+ outline: "none",
18
+ color: "inherit",
19
+ verticalAlign: "baseline"
20
+ }, ({
21
+ size = textBodyMd
22
+ }) => getBodySize(size), ({
23
+ weight,
24
+ tag
25
+ }) => {
26
+ if ("strong" === tag) {
27
+ return {
28
+ fontWeight: getFontWeight(fontWeightBold)
29
+ };
30
+ }
31
+ if (!weight) {
32
+ return {};
33
+ }
34
+ return {
35
+ fontWeight: getFontWeight(weight)
36
+ };
37
+ }, ({
38
+ tag
39
+ }) => {
40
+ if ("sup" === tag) {
41
+ return {
42
+ verticalAlign: "super",
43
+ fontSize: "smaller"
44
+ };
45
+ }
46
+ if ("span" === tag) {
47
+ return {
48
+ display: "inline-block"
49
+ };
50
+ }
51
+ return {};
52
+ }, ({
53
+ align
54
+ }) => ({
55
+ textAlign: align
56
+ }), getBottomSpacing);
57
+ const bodyAlignLeft = "left";
58
+ const bodyAlignCenter = "center";
59
+ const bodyAlignRight = "right";
60
+ const Body = ({
61
+ tag = "p",
62
+ bottomSpacing,
63
+ ...props
64
+ }) => {
65
+ if (!bottomSpacing) {
66
+ bottomSpacing = textBodySm === props.size ? spacingSm : spacingMd;
67
+ }
68
+ return /* @__PURE__ */ jsx(BodyStyled, { ...props, bottomSpacing, as: tag, tag, children: renderInlineRichTextFromOpenText(props.children) });
69
+ };
4
70
  export {
5
- c as bodyAlignCenter,
6
- b as bodyAlignLeft,
7
- d as bodyAlignRight,
8
- B as default
71
+ bodyAlignCenter,
72
+ bodyAlignLeft,
73
+ bodyAlignRight,
74
+ Body as default
9
75
  };