@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,181 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { df as IconLoader, iv as iconSizeSm } from "../../index-Cbojl4_Q.js";
4
+ import Body from "../Body/index.js";
5
+ import Button from "../Button/index.js";
6
+ import ButtonGroup from "../ButtonGroup/index.js";
7
+ import Flex from "../Flex/index.js";
8
+ import Heading from "../Heading/index.js";
9
+ import Link from "../Link/index.js";
10
+ import { R as RichText } from "../../index-D6hvbziL.js";
11
+ import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
12
+ import { getObjectColor } from "../../foundations/token/getObjectColor/index.js";
13
+ import { e as colorBorderCritical, f as colorBorderWarning, d as colorBorderSuccess, k as colorBorderInformation } from "../../BorderColor-BummoQ1-.js";
14
+ import { h as colorObjectCritical, i as colorObjectWarning, e as colorObjectSuccess, j as colorObjectInformation } from "../../ObjectColor-BZDBuV8H.js";
15
+ import styled from "styled-components";
16
+ import forcedColors from "../../foundations/media-query/forcedColors/index.js";
17
+ import { getBackgroundColor } from "../../foundations/token/getBackgroundColor/index.js";
18
+ import { getBorderRadius } from "../../foundations/token/getBorderRadius/index.js";
19
+ import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js";
20
+ import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
21
+ import { getIconColor } from "../../foundations/token/getIconColor/index.js";
22
+ import { getSpacing } from "../../foundations/token/getSpacing/index.js";
23
+ import { c as colorBackgroundNeutral } from "../../BackgroundColor-JObp_2xA.js";
24
+ import { b as borderRadiusMd } from "../../BorderRadius-ClUShVLu.js";
25
+ import { g as borderWidthMd } from "../../BorderWidth-DfOlyKK7.js";
26
+ import { d as colorIconInverse } from "../../IconColor-CtC9WUgr.js";
27
+ import { s as spacingMd, c as spacingSm } from "../../Spacing-D0HQH9YJ.js";
28
+ import { f as filterProps } from "../../filterProps-Cewck8OH.js";
29
+ const notificationStatusVariants = {
30
+ info: {
31
+ borderColor: getBorderColor(colorBorderInformation),
32
+ background: getObjectColor(colorObjectInformation),
33
+ icon: "NotificationInfo"
34
+ },
35
+ success: {
36
+ borderColor: getBorderColor(colorBorderSuccess),
37
+ background: getObjectColor(colorObjectSuccess),
38
+ icon: "NotificationTick"
39
+ },
40
+ warning: {
41
+ borderColor: getBorderColor(colorBorderWarning),
42
+ background: getObjectColor(colorObjectWarning),
43
+ icon: "NotificationError"
44
+ },
45
+ error: {
46
+ borderColor: getBorderColor(colorBorderCritical),
47
+ background: getObjectColor(colorObjectCritical),
48
+ icon: "NotificationError"
49
+ }
50
+ };
51
+ const notificationStatusInfo = "info";
52
+ const notificationStatusSuccess = "success";
53
+ const notificationStatusWarning = "warning";
54
+ const notificationStatusError = "error";
55
+ const NotificationStyled = styled.div.withConfig({
56
+ shouldForwardProp: filterProps(),
57
+ displayName: "NotificationStyled",
58
+ componentId: "sc-17ezdxf-0"
59
+ })({
60
+ display: "flex",
61
+ borderWidth: getBorderWidth(borderWidthMd),
62
+ borderRadius: getBorderRadius(borderRadiusMd),
63
+ borderStyle: "solid"
64
+ }, ({
65
+ status
66
+ }) => {
67
+ const {
68
+ borderColor
69
+ } = notificationStatusVariants[status];
70
+ return {
71
+ ...forcedColors({
72
+ borderColor: "CanvasText"
73
+ }),
74
+ borderColor
75
+ };
76
+ }, ({
77
+ bottomSpacing = spacingMd
78
+ }) => getBottomSpacing({
79
+ bottomSpacing
80
+ }));
81
+ const NotificationSidebarStyled = styled.div.withConfig({
82
+ shouldForwardProp: filterProps(),
83
+ displayName: "NotificationSidebarStyled",
84
+ componentId: "sc-17ezdxf-1"
85
+ })({
86
+ ...forcedColors({
87
+ color: "Canvas"
88
+ }),
89
+ color: getIconColor(colorIconInverse),
90
+ padding: getSpacing(spacingSm),
91
+ display: "flex",
92
+ alignItems: "center"
93
+ }, ({
94
+ status
95
+ }) => {
96
+ const {
97
+ background
98
+ } = notificationStatusVariants[status];
99
+ return {
100
+ ...forcedColors({
101
+ background: "CanvasText"
102
+ }),
103
+ background
104
+ };
105
+ });
106
+ const NotificationWrapperStyled = styled.div.withConfig({
107
+ shouldForwardProp: filterProps(),
108
+ displayName: "NotificationWrapperStyled",
109
+ componentId: "sc-17ezdxf-2"
110
+ })({
111
+ padding: getSpacing(spacingMd),
112
+ flexGrow: 1,
113
+ background: getBackgroundColor(colorBackgroundNeutral),
114
+ borderRadius: getBorderRadius(borderRadiusMd),
115
+ "& > *:last-child": {
116
+ marginBottom: "0px"
117
+ }
118
+ });
119
+ const statusLabels = {
120
+ [notificationStatusError]: "Fehler",
121
+ [notificationStatusInfo]: "Information",
122
+ [notificationStatusWarning]: "Warnung",
123
+ [notificationStatusSuccess]: "Erfolgreich"
124
+ };
125
+ const getContents = (contents) => {
126
+ return contents.map((content) => {
127
+ if ("Heading" === content.component) {
128
+ return /* @__PURE__ */ jsx(Heading, { ...content, bottomSpacing: "Xs", children: content.children }, content.uid);
129
+ }
130
+ if ("Body" === content.component) {
131
+ return /* @__PURE__ */ jsx(Body, { ...content, bottomSpacing: "Sm", children: content.children }, content.uid);
132
+ }
133
+ if ("RichText" === content.component) {
134
+ return /* @__PURE__ */ jsx(RichText, { ...content, bottomSpacing: "Sm" }, content.uid);
135
+ }
136
+ if ("Link" === content.component) {
137
+ return /* @__PURE__ */ jsx(Link, { ...content, bottomSpacing: "Sm", children: content.children }, content.uid);
138
+ }
139
+ if ("Button" === content.component || "ButtonAsLink" === content.component) {
140
+ return /* @__PURE__ */ jsx(Button, { ...content, bottomSpacing: "Sm", children: content.children }, content.uid);
141
+ }
142
+ if ("ButtonGroup" === content.component) {
143
+ return /* @__PURE__ */ jsx(ButtonGroup, { ...content, bottomSpacing: "Sm" }, content.uid);
144
+ }
145
+ if ("Flex" === content.component) {
146
+ return /* @__PURE__ */ jsx(Flex, { ...content, bottomSpacing: "Sm", children: content.children }, content.uid);
147
+ }
148
+ return null;
149
+ });
150
+ };
151
+ const getNotificationLabel = (status, contents) => {
152
+ const statusLabel = statusLabels[status];
153
+ const heading = contents.filter((content) => content.component === "Heading");
154
+ const body = contents.filter((content) => content.component === "Body");
155
+ if (heading.length > 0) return `${statusLabel}: ${heading[0].children}`;
156
+ if (body.length > 0) return `${statusLabel}: ${body[0].children}`;
157
+ return statusLabel;
158
+ };
159
+ const Notification = ({
160
+ contents,
161
+ status = notificationStatusInfo,
162
+ uid,
163
+ ...props
164
+ }) => {
165
+ const {
166
+ icon
167
+ } = notificationStatusVariants[status];
168
+ const label = getNotificationLabel(status, contents);
169
+ const notificationId = `notification-${uid}`;
170
+ return /* @__PURE__ */ jsxs(NotificationStyled, { ...props, status, role: "group", "aria-live": [notificationStatusError, notificationStatusWarning].indexOf(status) === -1 ? "polite" : "assertive", "aria-atomic": false, "aria-label": label, id: notificationId, children: [
171
+ /* @__PURE__ */ jsx(NotificationSidebarStyled, { status, children: /* @__PURE__ */ jsx(IconLoader, { name: icon, size: iconSizeSm }) }),
172
+ /* @__PURE__ */ jsx(NotificationWrapperStyled, { children: getContents(contents) })
173
+ ] });
174
+ };
175
+ export {
176
+ Notification as default,
177
+ notificationStatusError,
178
+ notificationStatusInfo,
179
+ notificationStatusSuccess,
180
+ notificationStatusWarning
181
+ };
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import styled from "styled-components";
4
+ import { getBackgroundColor } from "../../foundations/token/getBackgroundColor/index.js";
5
+ import { b as colorBackgroundOverlayStatic } from "../../BackgroundColor-JObp_2xA.js";
6
+ import { f as filterProps } from "../../filterProps-Cewck8OH.js";
7
+ const overlayAppearancePrimary = "primary";
8
+ const overlayAppearanceSecondary = "secondary";
9
+ const OverlayStyled = styled.div.withConfig({
10
+ shouldForwardProp: filterProps(),
11
+ displayName: "OverlayStyled",
12
+ componentId: "sc-1fdzrvx-0"
13
+ })({
14
+ height: "100%",
15
+ width: "100%"
16
+ }, ({
17
+ appearance = overlayAppearancePrimary
18
+ }) => {
19
+ return appearance === overlayAppearanceSecondary ? {
20
+ background: getBackgroundColor(colorBackgroundOverlayStatic)
21
+ } : {
22
+ background: "#0d0d0d99"
23
+ };
24
+ });
25
+ const Overlay = ({
26
+ children,
27
+ ...props
28
+ }) => /* @__PURE__ */ jsx(OverlayStyled, { ...props, children });
29
+ export {
30
+ Overlay as default,
31
+ overlayAppearancePrimary,
32
+ overlayAppearanceSecondary
33
+ };
@@ -0,0 +1,282 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Fieldset from "../Fieldset/index.js";
4
+ import { i as inputStateError } from "../../props-Czq9XX2J.js";
5
+ import { e as spacing2Xs, s as spacingMd, c as spacingSm, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
6
+ import { useState, useEffect } from "react";
7
+ import Grid from "../Grid/index.js";
8
+ import { df as IconLoader, iu as iconSizeMd } from "../../index-Cbojl4_Q.js";
9
+ import { B as Badge } from "../../index-C0N671c1.js";
10
+ import ColorSwatch from "../ColorSwatch/index.js";
11
+ import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-CA52y1-B.js";
12
+ import styled from "styled-components";
13
+ import Image, { aspectRatio1_1 } from "../Image/index.js";
14
+ import { v as viewport } from "../../index-Ck2bCrhT.js";
15
+ import GridItem from "../GridItem/index.js";
16
+ import { s as screenreaderOnly } from "../../index-DQhtQZ85.js";
17
+ import forcedColors from "../../foundations/media-query/forcedColors/index.js";
18
+ import { getBackgroundColor } from "../../foundations/token/getBackgroundColor/index.js";
19
+ import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
20
+ import { getBorderRadius } from "../../foundations/token/getBorderRadius/index.js";
21
+ import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js";
22
+ import { getFontWeight } from "../../foundations/token/getFontWeight/index.js";
23
+ import { getHoverColor } from "../../foundations/token/getHoverColor/index.js";
24
+ import { getOpacity } from "../../foundations/token/getOpacity/index.js";
25
+ import { getSpacing } from "../../foundations/token/getSpacing/index.js";
26
+ import { getTextColor } from "../../foundations/token/getTextColor/index.js";
27
+ import { c as colorBackgroundNeutral } from "../../BackgroundColor-JObp_2xA.js";
28
+ import { b as borderRadiusMd } from "../../BorderRadius-ClUShVLu.js";
29
+ import { a as borderWidthFocus, d as borderWidthSelected } from "../../BorderWidth-DfOlyKK7.js";
30
+ import { b as fontWeightRegular, f as fontWeightBold } from "../../FontWeight-CR22KTex.js";
31
+ import { o as opacityOverlay } from "../../Opacity-smkGiwsf.js";
32
+ import { a as colorTextNeutral } from "../../TextColor-BXiR5Uq9.js";
33
+ import { f as filterProps } from "../../filterProps-Cewck8OH.js";
34
+ import { getHeadingSize } from "../../foundations/token/getHeadingSize/index.js";
35
+ import { t as textHeadingXs } from "../../HeadingSize-CfCRn3Lh.js";
36
+ import { getBodySize } from "../../foundations/token/getBodySize/index.js";
37
+ import { t as textBodyMd } from "../../TextBodySize-BcZR9mh2.js";
38
+ const PickerElementIconStyled = styled(IconLoader).withConfig({
39
+ displayName: "PickerElementIconStyled",
40
+ componentId: "sc-sucu78-0"
41
+ })({
42
+ marginLeft: "auto",
43
+ marginRight: "auto",
44
+ display: "block"
45
+ });
46
+ const PickerElementSystemIcon = (props) => /* @__PURE__ */ jsx(PickerElementIconStyled, { ...props });
47
+ const PickerElementImageStyled = styled(Image).withConfig({
48
+ displayName: "PickerElementImageStyled",
49
+ componentId: "sc-9xmld2-0"
50
+ })({
51
+ width: "96px",
52
+ height: "96px"
53
+ }, viewport.md({
54
+ width: "120px",
55
+ height: "120px"
56
+ }));
57
+ const PickerElementImage = (props) => /* @__PURE__ */ jsx(PickerElementImageStyled, { ...props, horizontalAlignment: "center", aspectRatio: aspectRatio1_1 });
58
+ const PickerGridItemStyled = styled(GridItem).withConfig({
59
+ displayName: "PickerGridItemStyled",
60
+ componentId: "sc-1lwsao6-0"
61
+ })({
62
+ display: "flex",
63
+ flexDirection: "column",
64
+ justifyContent: "stretch"
65
+ });
66
+ const PickerLabelElementStyled = styled.label.withConfig({
67
+ shouldForwardProp: filterProps(),
68
+ displayName: "PickerLabelElementStyled",
69
+ componentId: "sc-1lwsao6-1"
70
+ })({
71
+ height: "100%",
72
+ position: "relative",
73
+ cursor: "pointer"
74
+ }, ({
75
+ isDisabled
76
+ }) => {
77
+ if (!isDisabled) {
78
+ return {};
79
+ }
80
+ return {
81
+ cursor: "not-allowed",
82
+ pointerEvents: "none"
83
+ };
84
+ });
85
+ const PickerCardStyled = styled.span.withConfig({
86
+ shouldForwardProp: filterProps(),
87
+ displayName: "PickerCardStyled",
88
+ componentId: "sc-1lwsao6-2"
89
+ })(
90
+ {
91
+ height: "100%",
92
+ flexDirection: "column",
93
+ display: "flex",
94
+ justifyContent: "center",
95
+ alignItems: "center",
96
+ textAlign: "center",
97
+ padding: `${getSpacing(spacingMd)} ${getSpacing(spacingSm)}`,
98
+ gap: getSpacing(spacing2Xs),
99
+ fontWeight: getFontWeight(fontWeightRegular),
100
+ transition: `font-weight 0.3s ease-out`,
101
+ borderRadius: getBorderRadius(borderRadiusMd)
102
+ },
103
+ () => {
104
+ const backgroundColor = getBackgroundColor(colorBackgroundNeutral);
105
+ const color = getTextColor(colorTextNeutral);
106
+ return {
107
+ ...forcedColors({
108
+ border: "1px solid CanvasText"
109
+ }),
110
+ backgroundColor,
111
+ color
112
+ };
113
+ },
114
+ // everything related to "borders"
115
+ ({
116
+ isChecked
117
+ }) => {
118
+ const focusColor = getBorderColor("colorBorderFocus");
119
+ const selectedBorderColor = getBorderColor("colorBorderSelected");
120
+ const unselectedBorderColor = getBorderColor("colorBorderUnselected");
121
+ const hoverBorderColor = getBorderColor("colorBorderNeutral");
122
+ if (isChecked) {
123
+ return {
124
+ boxShadow: `inset ${selectedBorderColor} 0px 0px 0px ${getBorderWidth(borderWidthSelected)}`,
125
+ "&:focus-within": {
126
+ ...forcedColors({
127
+ outline: `${getBorderWidth(borderWidthFocus)} solid CanvasText`
128
+ }),
129
+ boxShadow: `${focusColor} 0px 0px 0px ${getBorderWidth(borderWidthFocus)}, inset ${selectedBorderColor} 0px 0px 0px ${getBorderWidth(borderWidthSelected)}`
130
+ },
131
+ "&:hover": {
132
+ ...forcedColors({
133
+ background: "SelectedItem"
134
+ }),
135
+ background: getHoverColor(colorBackgroundNeutral)
136
+ }
137
+ };
138
+ }
139
+ return {
140
+ boxShadow: `inset ${unselectedBorderColor} 0px 0px 0px 1px`,
141
+ "&:hover": {
142
+ background: getHoverColor(colorBackgroundNeutral),
143
+ boxShadow: `inset ${hoverBorderColor} 0px 0px 0px 1px`
144
+ },
145
+ "&:focus-within": {
146
+ ...forcedColors({
147
+ outline: `${getBorderWidth(borderWidthFocus)} solid CanvasText`
148
+ }),
149
+ boxShadow: `${focusColor} 0px 0px 0px 4px, inset ${unselectedBorderColor} 0px 0px 0px 1px`
150
+ }
151
+ };
152
+ },
153
+ ({
154
+ isChecked
155
+ }) => {
156
+ if (!isChecked) {
157
+ return {};
158
+ }
159
+ return {
160
+ ...forcedColors({
161
+ background: "SelectedItem",
162
+ color: "SelectedItemText"
163
+ }),
164
+ outline: "none",
165
+ fontWeight: getFontWeight(fontWeightBold)
166
+ };
167
+ },
168
+ ({
169
+ isDisabled
170
+ }) => {
171
+ if (!isDisabled) {
172
+ return {};
173
+ }
174
+ return {
175
+ opacity: getOpacity(opacityOverlay)
176
+ };
177
+ }
178
+ );
179
+ const PickerInputElementStyled = styled.input.withConfig({
180
+ displayName: "PickerInputElementStyled",
181
+ componentId: "sc-1lwsao6-3"
182
+ })(screenreaderOnly);
183
+ const PickerElementLabelStyled = styled.span.withConfig({
184
+ displayName: "PickerElementLabelStyled",
185
+ componentId: "sc-a082l8-0"
186
+ })({
187
+ display: "block"
188
+ }, getHeadingSize(textHeadingXs));
189
+ const PickerElementSuffixStyled = styled.span.withConfig({
190
+ displayName: "PickerElementSuffixStyled",
191
+ componentId: "sc-juaaw0-0"
192
+ })({
193
+ display: "block"
194
+ }, getBodySize(textBodyMd));
195
+ const createChildren = ({
196
+ value,
197
+ ...props
198
+ }) => {
199
+ const children = [];
200
+ if (props.imagePath) {
201
+ children.push(/* @__PURE__ */ jsx(PickerElementImage, { src: props.imagePath, alt: props.label }, `${value}-image`));
202
+ }
203
+ if (props.colorValue) {
204
+ children.push(/* @__PURE__ */ jsx(ColorSwatch, { color: props.colorValue, size: "md" }, `${value}-color`));
205
+ }
206
+ if (props.inlineIconName) {
207
+ children.push(/* @__PURE__ */ jsx(PickerElementSystemIcon, { size: iconSizeMd, name: props.inlineIconName }, `${value}-icon`));
208
+ }
209
+ children.push(/* @__PURE__ */ jsx(PickerElementLabelStyled, { children: renderInlineRichTextFromOpenText(props.label) }, `${value}-label`));
210
+ if (props.suffix) {
211
+ children.push(/* @__PURE__ */ jsx(PickerElementSuffixStyled, { children: renderInlineRichTextFromOpenText(props.suffix) }, `${value}-subline`));
212
+ }
213
+ if (props.badge) {
214
+ children.push(/* @__PURE__ */ jsx(Badge, { ...props.badge, bottomSpacing: spacingNone }));
215
+ }
216
+ return children;
217
+ };
218
+ const Picker = ({
219
+ labelProps = {},
220
+ inputProps = {},
221
+ ...props
222
+ }) => {
223
+ const children = createChildren(props);
224
+ const onChange = (event) => {
225
+ if (inputProps.onChange) {
226
+ inputProps.onChange(event);
227
+ }
228
+ if (props.handleChange) {
229
+ props.handleChange(props.value);
230
+ }
231
+ };
232
+ return /* @__PURE__ */ jsx(PickerLabelElementStyled, { ...labelProps, isChecked: props.isChecked === true, isDisabled: props.isDisabled === true, children: /* @__PURE__ */ jsxs(PickerCardStyled, { isChecked: props.isChecked === true, isDisabled: props.isDisabled === true, children: [
233
+ /* @__PURE__ */ jsx(PickerInputElementStyled, { ...inputProps, type: "radio", name: props.name, value: props.value, checked: props.isChecked, disabled: props.isDisabled, onChange }),
234
+ children
235
+ ] }) });
236
+ };
237
+ const Pickers = ({
238
+ gridConfig = {
239
+ sm: 12,
240
+ md: 6,
241
+ lg: 3
242
+ },
243
+ ...props
244
+ }) => {
245
+ const [checked, setChecked] = useState(props.checkedValue);
246
+ const handleChange = (value) => {
247
+ setChecked(value);
248
+ props.onUpdate(value);
249
+ };
250
+ useEffect(() => {
251
+ if (checked === props.checkedValue) {
252
+ return;
253
+ }
254
+ setChecked(props.checkedValue);
255
+ }, [props.checkedValue]);
256
+ const pickers = props.pickers.map(({
257
+ key,
258
+ ...picker
259
+ }) => {
260
+ const isChecked = checked === picker.value;
261
+ key = key ? key : picker.value;
262
+ return /* @__PURE__ */ jsx(PickerGridItemStyled, { ...gridConfig, children: /* @__PURE__ */ jsx(Picker, { ...picker, name: props.name, isChecked, isDisabled: props.disabled, handleChange, children: picker.children }) }, key);
263
+ });
264
+ return /* @__PURE__ */ jsx(Grid, { stretch: true, bottomSpacing: props.bottomSpacing, children: pickers });
265
+ };
266
+ const PickerGroup = ({
267
+ component: _component,
268
+ uid,
269
+ name,
270
+ checkedValue,
271
+ pickers,
272
+ onUpdate,
273
+ gridConfig,
274
+ status,
275
+ disabled,
276
+ ...props
277
+ }) => {
278
+ return /* @__PURE__ */ jsx(Fieldset, { ...props, status, uid: `fieldset-${uid}`, children: /* @__PURE__ */ jsx(Pickers, { uid, name, checkedValue, pickers, onUpdate, gridConfig, bottomSpacing: props.helperText || status === inputStateError && props.errorMessage ? spacingMd : spacingNone, disabled }) });
279
+ };
280
+ export {
281
+ PickerGroup as default
282
+ };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import "react/jsx-runtime";
3
+ import "../../index-DQhtQZ85.js";
4
+ import "../../renderInlineRichTextFromOpenText-CA52y1-B.js";
5
+ import { e, P, i, a, d, h, f, b, g, p, c } from "../../index-CeJsIf3Z.js";
6
+ export {
7
+ e as createScreenReaderText,
8
+ P as default,
9
+ i as internalizePriceProps,
10
+ a as priceAlignCenter,
11
+ d as priceAlignLeft,
12
+ h as priceDefaultProps,
13
+ f as priceOrientationHorizontal,
14
+ b as priceOrientationVertical,
15
+ g as priceSizeLg,
16
+ p as priceSizeMd,
17
+ c as priceSizeSm
18
+ };
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { it as iconSizeLg } from "../../index-Cbojl4_Q.js";
4
+ import Image, { aspectRatio1_1 } from "../Image/index.js";
5
+ import { f as fontWeightBold } from "../../FontWeight-CR22KTex.js";
6
+ import { a as textHeadingMd } from "../../HeadingSize-CfCRn3Lh.js";
7
+ import { s as spacingMd, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
8
+ import { B as Badge } from "../../index-C0N671c1.js";
9
+ import Body from "../Body/index.js";
10
+ import ColorSwatchGroup from "../ColorSwatchGroup/index.js";
11
+ import Heading from "../Heading/index.js";
12
+ import Link from "../Link/index.js";
13
+ import { P as Price, p as priceSizeMd, a as priceAlignCenter, b as priceOrientationVertical } from "../../index-CeJsIf3Z.js";
14
+ import styled from "styled-components";
15
+ import { getSpacing } from "../../foundations/token/getSpacing/index.js";
16
+ import Card from "../Card/index.js";
17
+ import Icon from "../Icon/index.js";
18
+ const ProductCardStyled = styled(Card).withConfig({
19
+ displayName: "ProductCardStyled",
20
+ componentId: "sc-1ps8gys-0"
21
+ })({
22
+ gap: getSpacing(spacingMd),
23
+ alignItems: "center",
24
+ position: "relative",
25
+ justifyContent: "space-between"
26
+ });
27
+ const ProductCardIconStyled = styled(Icon).withConfig({
28
+ displayName: "ProductCardIconStyled",
29
+ componentId: "sc-1ps8gys-1"
30
+ })({
31
+ position: "absolute",
32
+ right: getSpacing(spacingNone)
33
+ });
34
+ const ProductCardUpperContentStyled = styled("div").withConfig({
35
+ displayName: "ProductCardUpperContentStyled",
36
+ componentId: "sc-1ps8gys-2"
37
+ })({
38
+ gap: getSpacing(spacingMd),
39
+ alignItems: "center",
40
+ position: "relative",
41
+ display: "flex",
42
+ flexDirection: "column",
43
+ width: "100%"
44
+ });
45
+ const ProductCardImageStyled = styled(Image).withConfig({
46
+ displayName: "ProductCardImageStyled",
47
+ componentId: "sc-1ps8gys-3"
48
+ })({
49
+ height: "200px"
50
+ });
51
+ const ProductCard = ({
52
+ heading,
53
+ image,
54
+ body,
55
+ colorSwatchGroup,
56
+ badges,
57
+ price,
58
+ link,
59
+ icon,
60
+ productId,
61
+ ...props
62
+ }) => {
63
+ const headingId = `heading-${productId}`;
64
+ return /* @__PURE__ */ jsxs(ProductCardStyled, { ...props, id: `ProductCard-${productId}`, children: [
65
+ /* @__PURE__ */ jsxs(ProductCardUpperContentStyled, { children: [
66
+ image && /* @__PURE__ */ jsx("a", { href: link.href, tabIndex: -1, children: /* @__PURE__ */ jsx(ProductCardImageStyled, { ...image, aspectRatio: aspectRatio1_1 }) }),
67
+ icon && /* @__PURE__ */ jsx(ProductCardIconStyled, { ...icon, size: iconSizeLg }),
68
+ /* @__PURE__ */ jsx(Heading, { ...heading, size: textHeadingMd, weight: fontWeightBold, bottomSpacing: spacingNone, id: headingId, align: "center" }),
69
+ colorSwatchGroup && /* @__PURE__ */ jsx(ColorSwatchGroup, { ...colorSwatchGroup, bottomSpacing: spacingNone }),
70
+ badges && badges.length > 0 && badges.map((badge) => {
71
+ return /* @__PURE__ */ jsx(Badge, { ...badge, bottomSpacing: spacingNone }, badge.children);
72
+ }),
73
+ price && /* @__PURE__ */ jsx(Price, { ...price, orientation: priceOrientationVertical, align: priceAlignCenter, size: priceSizeMd, bottomSpacing: spacingNone }),
74
+ body && /* @__PURE__ */ jsx(Body, { ...body, bottomSpacing: spacingNone, align: "center" })
75
+ ] }),
76
+ /* @__PURE__ */ jsx(Link, { ...link, bottomSpacing: spacingNone, "aria-describedby": headingId })
77
+ ] });
78
+ };
79
+ export {
80
+ ProductCard as default
81
+ };