@vodafone_de/brix-components 7.0.5 → 7.0.7
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/components/Card/index.js +1 -1
- package/dist/components/Carousel/components/CarouselContext.d.ts +2 -3
- package/dist/components/Carousel/index.js +53 -42
- package/dist/components/DemoBox/index.js +4 -2
- package/dist/components/DiscoveryCard/index.js +1 -1
- package/dist/components/Grid/index.js +1 -1
- package/dist/components/GridItem/index.js +1 -1
- package/dist/components/Heading/index.js +1 -1
- package/dist/components/IconSnippet/index.js +5 -4
- package/dist/components/IconSnippet/props.d.ts +2 -2
- package/dist/components/IconSnippetList/index.js +1 -1
- package/dist/components/ImageHeader/index.js +1 -2
- package/dist/components/Legend/index.js +1 -1
- package/dist/components/LinkList/index.js +1 -1
- package/dist/components/LinkListItem/index.js +1 -1
- package/dist/components/MediaText/index.js +23 -25
- package/dist/components/MediaText/props.d.ts +10 -10
- package/dist/components/MediaText/styled.d.ts +3 -3
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/Rating/assets/StarSVG.d.ts +2 -2
- package/dist/components/Rating/index.js +23 -24
- package/dist/components/Rating/props.d.ts +2 -2
- package/dist/components/RichText/index.js +1 -1
- package/dist/components/SuggestInput/index.js +1 -1
- package/dist/components/TextList/index.js +2 -2
- package/dist/{index-ClmKFtnx.js → index-D2J2U7wz.js} +7 -3
- package/dist/index.js +5 -5
- package/dist/{tags-DI6H1biK.js → tags-Bz98Tkqt.js} +2 -0
- package/package.json +1 -1
- package/dist/components/Carousel/utils/useScrollSpy.d.ts +0 -2
- package/dist/index-DR3e19BE.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { d as divTagName } from "../../tags-
|
|
3
|
+
import { d as divTagName } from "../../tags-Bz98Tkqt.js";
|
|
4
4
|
import { a as CardStyled } from "../../styled-CYugcGtx.js";
|
|
5
5
|
import { C } from "../../styled-CYugcGtx.js";
|
|
6
6
|
const Card = ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC,
|
|
1
|
+
import { FC, RefObject } from 'react';
|
|
2
2
|
import { CarouselRuntimeProps } from '../props';
|
|
3
3
|
/**
|
|
4
4
|
* Can either be false to indicate that no button should be rendered
|
|
@@ -6,8 +6,7 @@ import { CarouselRuntimeProps } from '../props';
|
|
|
6
6
|
*/
|
|
7
7
|
export type CarouselButton = (() => void) | false;
|
|
8
8
|
export type CarouselState = {
|
|
9
|
-
ref:
|
|
10
|
-
visibleItems: number;
|
|
9
|
+
ref: RefObject<HTMLDivElement> | undefined;
|
|
11
10
|
interactive: number[];
|
|
12
11
|
goPrev: CarouselButton;
|
|
13
12
|
goNext: CarouselButton;
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import "@af-utils/scrollend-polyfill";
|
|
4
4
|
import { createContext, useRef, useState, useEffect, useContext, createElement } from "react";
|
|
5
5
|
import { useFocusWithin } from "../../hooks/useFocusWithin/index.js";
|
|
6
|
-
import { l as liTagName, u as ulTagName } from "../../tags-
|
|
6
|
+
import { l as liTagName, u as ulTagName } from "../../tags-Bz98Tkqt.js";
|
|
7
7
|
import { s as spacingMd } from "../../Spacing-D0HQH9YJ.js";
|
|
8
8
|
import styled from "styled-components";
|
|
9
9
|
import { a as CardStyled } from "../../styled-CYugcGtx.js";
|
|
@@ -78,7 +78,6 @@ const scrollTo = (element, left, behavior = "smooth") => {
|
|
|
78
78
|
};
|
|
79
79
|
const initialState = {
|
|
80
80
|
ref: void 0,
|
|
81
|
-
visibleItems: 1,
|
|
82
81
|
interactive: [0],
|
|
83
82
|
goPrev: false,
|
|
84
83
|
goNext: false,
|
|
@@ -99,56 +98,57 @@ const CarouselProvider = ({
|
|
|
99
98
|
const [scrollSpyIndex, setScrollSpyIndex] = useState(void 0);
|
|
100
99
|
const [interactive, setInteractive] = useState([]);
|
|
101
100
|
const [needsFirstPosition, setNeedsFirstPosition] = useState(activeIndex !== 0);
|
|
102
|
-
const [
|
|
103
|
-
const [visibleItems, setVisibleItems] = useState(1);
|
|
101
|
+
const [carouselLayoutedAttributes, setCarouselLayoutedAttributes] = useState(void 0);
|
|
104
102
|
const [goPrev, setGoPrev] = useState(false);
|
|
105
103
|
const [goNext, setGoNext] = useState(false);
|
|
106
104
|
const [numberOfIndicators, setNumberOfIndicators] = useState(0);
|
|
107
105
|
const [activeIndicator, setActiveIndicator] = useState(props.items[props.activeIndex].index);
|
|
106
|
+
const getCarouselLayoutedAttributes = () => {
|
|
107
|
+
const carouselElement = ref.current;
|
|
108
|
+
if (!carouselElement) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const itemWidth = carouselElement.querySelector("[data-carousel-item]").offsetWidth;
|
|
112
|
+
const track = carouselElement.offsetWidth;
|
|
113
|
+
const numberOfItemsThatFitOnTrack = Math.floor(track / itemWidth);
|
|
114
|
+
const visibleItems = Math.min(numberOfItemsThatFitOnTrack, props.items.length);
|
|
115
|
+
if ((carouselLayoutedAttributes == null ? void 0 : carouselLayoutedAttributes.itemWidth) !== itemWidth || (carouselLayoutedAttributes == null ? void 0 : carouselLayoutedAttributes.visibleItems) !== visibleItems) {
|
|
116
|
+
setCarouselLayoutedAttributes({
|
|
117
|
+
itemWidth,
|
|
118
|
+
visibleItems
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
};
|
|
108
122
|
useEffect(() => {
|
|
123
|
+
if (!carouselLayoutedAttributes) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
109
126
|
if (loop) {
|
|
110
127
|
const update = props.items.filter((item) => !item.ghost).length;
|
|
111
128
|
setNumberOfIndicators(update);
|
|
112
129
|
} else {
|
|
113
|
-
const update = props.items.filter((item) => !item.ghost).length - visibleItems + 1;
|
|
130
|
+
const update = props.items.filter((item) => !item.ghost).length - carouselLayoutedAttributes.visibleItems + 1;
|
|
114
131
|
setNumberOfIndicators(update);
|
|
115
132
|
}
|
|
116
|
-
}, [loop,
|
|
133
|
+
}, [loop, carouselLayoutedAttributes, props.items]);
|
|
117
134
|
useEffect(() => {
|
|
118
|
-
if (!
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (!itemWidth) {
|
|
135
|
+
if (!carouselLayoutedAttributes) {
|
|
122
136
|
return;
|
|
123
137
|
}
|
|
124
|
-
|
|
125
|
-
setVisibleItems(Math.floor(track / itemWidth));
|
|
126
|
-
}, [itemWidth]);
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
let updateInteractive = [...Array(visibleItems).keys()].map((i) => activeIndex + i);
|
|
138
|
+
let updateInteractive = [...Array(carouselLayoutedAttributes.visibleItems).keys()].map((i) => activeIndex + i);
|
|
129
139
|
if (focus) {
|
|
130
140
|
updateInteractive = [...Array(props.items.length).keys()];
|
|
131
141
|
}
|
|
132
142
|
setInteractive(updateInteractive);
|
|
133
|
-
}, [focus, activeIndex,
|
|
143
|
+
}, [focus, activeIndex, carouselLayoutedAttributes, props.items]);
|
|
134
144
|
useEffect(() => {
|
|
135
145
|
if (!(ref == null ? void 0 : ref.current)) {
|
|
136
146
|
return;
|
|
137
147
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (!(ref == null ? void 0 : ref.current)) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const itemWidth2 = ref.current.querySelector("[data-carousel-item]").offsetWidth;
|
|
146
|
-
setItemWidth(itemWidth2);
|
|
147
|
-
};
|
|
148
|
-
window.addEventListener("resize", handleResize);
|
|
149
|
-
handleResize();
|
|
148
|
+
window.addEventListener("resize", getCarouselLayoutedAttributes);
|
|
149
|
+
getCarouselLayoutedAttributes();
|
|
150
150
|
return () => {
|
|
151
|
-
window.removeEventListener("resize",
|
|
151
|
+
window.removeEventListener("resize", getCarouselLayoutedAttributes);
|
|
152
152
|
};
|
|
153
153
|
}, [ref.current]);
|
|
154
154
|
useEffect(() => {
|
|
@@ -156,25 +156,31 @@ const CarouselProvider = ({
|
|
|
156
156
|
if (!(ref == null ? void 0 : ref.current)) {
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
if (!
|
|
159
|
+
if (!carouselLayoutedAttributes) {
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
const handleScroll = (event) => {
|
|
163
|
+
if (!carouselLayoutedAttributes) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
163
166
|
const left = event.target.scrollLeft;
|
|
164
|
-
const ucurrent = getItemByScroll(left - itemWidth / 2, itemWidth, props.items);
|
|
167
|
+
const ucurrent = getItemByScroll(left - carouselLayoutedAttributes.itemWidth / 2, carouselLayoutedAttributes.itemWidth, props.items);
|
|
165
168
|
setScrollSpyIndex(ucurrent);
|
|
166
169
|
};
|
|
167
170
|
const handleScrollend = (event) => {
|
|
171
|
+
if (!carouselLayoutedAttributes) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
168
174
|
const left = event.target.scrollLeft;
|
|
169
|
-
let updateActiveIndex = getItemByScroll(left - itemWidth / 2, itemWidth, props.items);
|
|
175
|
+
let updateActiveIndex = getItemByScroll(left - carouselLayoutedAttributes.itemWidth / 2, carouselLayoutedAttributes.itemWidth, props.items);
|
|
170
176
|
if (loop) {
|
|
171
177
|
const ghosts = [];
|
|
172
|
-
for (let i = 0, x = visibleItems; i < x; i += 1) {
|
|
178
|
+
for (let i = 0, x = carouselLayoutedAttributes.visibleItems; i < x; i += 1) {
|
|
173
179
|
ghosts.push(props.items[i + updateActiveIndex].ghost);
|
|
174
180
|
}
|
|
175
181
|
if (!ghosts.includes(false)) {
|
|
176
182
|
updateActiveIndex = props.items.findIndex((item) => item.index === props.items[updateActiveIndex].index && !item.ghost);
|
|
177
|
-
const left2 = updateActiveIndex * itemWidth;
|
|
183
|
+
const left2 = updateActiveIndex * carouselLayoutedAttributes.itemWidth;
|
|
178
184
|
const behavior = "instant";
|
|
179
185
|
scrollTo(ref.current, left2, behavior);
|
|
180
186
|
}
|
|
@@ -192,31 +198,34 @@ const CarouselProvider = ({
|
|
|
192
198
|
(_a2 = ref.current) == null ? void 0 : _a2.removeEventListener("scroll", handleScroll);
|
|
193
199
|
(_b2 = ref.current) == null ? void 0 : _b2.removeEventListener("scrollend", handleScrollend);
|
|
194
200
|
};
|
|
195
|
-
}, [ref.current,
|
|
201
|
+
}, [ref.current, carouselLayoutedAttributes, props.items]);
|
|
196
202
|
useEffect(() => {
|
|
197
203
|
if (!ref.current) {
|
|
198
204
|
return;
|
|
199
205
|
}
|
|
206
|
+
if (!carouselLayoutedAttributes) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
200
209
|
if (scrollSpyIndex) {
|
|
201
210
|
return;
|
|
202
211
|
}
|
|
203
212
|
if (activeIndex === scrollSpyIndex) {
|
|
204
213
|
return;
|
|
205
214
|
}
|
|
206
|
-
const left = activeIndex * itemWidth;
|
|
215
|
+
const left = activeIndex * carouselLayoutedAttributes.itemWidth;
|
|
207
216
|
const behavior = needsFirstPosition ? "instant" : "smooth";
|
|
208
217
|
scrollTo(ref.current, left, behavior);
|
|
209
|
-
}, [activeIndex, scrollSpyIndex, ref.current,
|
|
218
|
+
}, [activeIndex, scrollSpyIndex, ref.current, carouselLayoutedAttributes]);
|
|
210
219
|
useEffect(() => {
|
|
211
|
-
if (!props.onUpdate) {
|
|
220
|
+
if (!props.onUpdate || !carouselLayoutedAttributes) {
|
|
212
221
|
return;
|
|
213
222
|
}
|
|
214
223
|
const visibleIndexes = [];
|
|
215
|
-
for (let i = 0, x = visibleItems; i < x; i += 1) {
|
|
224
|
+
for (let i = 0, x = carouselLayoutedAttributes.visibleItems; i < x; i += 1) {
|
|
216
225
|
visibleIndexes.push(props.items[i + activeIndex].index);
|
|
217
226
|
}
|
|
218
227
|
props.onUpdate(visibleIndexes);
|
|
219
|
-
}, [activeIndex]);
|
|
228
|
+
}, [activeIndex, carouselLayoutedAttributes]);
|
|
220
229
|
const movePrev = () => {
|
|
221
230
|
const prev = activeIndex > 0 ? activeIndex - 1 : props.items.length - 1;
|
|
222
231
|
setActiveIndex(prev);
|
|
@@ -241,7 +250,6 @@ const CarouselProvider = ({
|
|
|
241
250
|
return /* @__PURE__ */ jsx(CarouselContext.Provider, { value: {
|
|
242
251
|
state: {
|
|
243
252
|
ref,
|
|
244
|
-
visibleItems,
|
|
245
253
|
interactive,
|
|
246
254
|
goPrev,
|
|
247
255
|
goNext,
|
|
@@ -403,7 +411,7 @@ const CarouselIndicator = () => {
|
|
|
403
411
|
activeIndicator
|
|
404
412
|
}
|
|
405
413
|
} = useContext(CarouselContext);
|
|
406
|
-
if (!numberOfIndicators) {
|
|
414
|
+
if (!numberOfIndicators || 1 >= numberOfIndicators) {
|
|
407
415
|
return null;
|
|
408
416
|
}
|
|
409
417
|
const indicators = [...Array(numberOfIndicators).keys()];
|
|
@@ -487,6 +495,9 @@ const Carousel = ({
|
|
|
487
495
|
gridConfig = carouselDefaultGridConfig,
|
|
488
496
|
...props
|
|
489
497
|
}) => {
|
|
498
|
+
if (0 === items.length) {
|
|
499
|
+
return null;
|
|
500
|
+
}
|
|
490
501
|
activeIndex = activeIndex ? activeIndex : 0;
|
|
491
502
|
activeIndex = loop ? activeIndex + items.length : activeIndex;
|
|
492
503
|
const loopableItems = getItems(items, loop);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import IconSnippet from "../IconSnippet/index.js";
|
|
4
4
|
import { t as textHeadingXs } from "../../HeadingSize-CfCRn3Lh.js";
|
|
5
|
-
import { g as getUid } from "../../index-
|
|
5
|
+
import { g as getUid } from "../../index-D2J2U7wz.js";
|
|
6
6
|
import { D as DemoBoxStyled } from "../../styled-ODPFCF1a.js";
|
|
7
7
|
const heading = {
|
|
8
8
|
component: "Heading",
|
|
@@ -15,7 +15,9 @@ const richText = {
|
|
|
15
15
|
html: "<p>This is a placeholder.</p>",
|
|
16
16
|
uid: getUid()
|
|
17
17
|
};
|
|
18
|
-
const DemoBox = (props) => /* @__PURE__ */ jsx(DemoBoxStyled, { ...props, children: /* @__PURE__ */ jsx(IconSnippet, { size: "
|
|
18
|
+
const DemoBox = (props) => /* @__PURE__ */ jsx(DemoBoxStyled, { ...props, children: /* @__PURE__ */ jsx(IconSnippet, { size: "sm", icon: {
|
|
19
|
+
name: "Sync"
|
|
20
|
+
}, bottomSpacing: "None", contents: [heading, richText] }) });
|
|
19
21
|
export {
|
|
20
22
|
DemoBox as default
|
|
21
23
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Fragment } from "react";
|
|
4
|
-
import { R as RichText } from "../../index-
|
|
4
|
+
import { R as RichText } from "../../index-D2J2U7wz.js";
|
|
5
5
|
import { f as fontWeightBold } from "../../FontWeight-DEBGHbtO.js";
|
|
6
6
|
import { b as textHeadingSm } from "../../HeadingSize-CfCRn3Lh.js";
|
|
7
7
|
import { s as spacingMd, b as spacingNone, a as spacingXs, c as spacingSm } from "../../Spacing-D0HQH9YJ.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { l as liTagName, d as divTagName } from "../../tags-
|
|
3
|
+
import { l as liTagName, d as divTagName } from "../../tags-Bz98Tkqt.js";
|
|
4
4
|
import { s as spacingMd } from "../../Spacing-D0HQH9YJ.js";
|
|
5
5
|
import { Children, cloneElement } from "react";
|
|
6
6
|
import { G as GridStyled } from "../../styled-ZpQohvyx.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { d as divTagName } from "../../tags-
|
|
3
|
+
import { d as divTagName } from "../../tags-Bz98Tkqt.js";
|
|
4
4
|
import { G as GridItemStyled } from "../../styled-Cqp2oSjW.js";
|
|
5
5
|
const GridItem = ({
|
|
6
6
|
sm = 12,
|
|
@@ -4,7 +4,7 @@ import FootnoteLink from "../FootnoteLink/index.js";
|
|
|
4
4
|
import { a as spacingXs, c as spacingSm, s as spacingMd, f as spacingLg, d as spacingXl } from "../../Spacing-D0HQH9YJ.js";
|
|
5
5
|
import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
|
|
6
6
|
import styled from "styled-components";
|
|
7
|
-
import { h as h5TagName, a as h4TagName, b as h3TagName, c as h2TagName, e as h1TagName, f as headingHtmlTags } from "../../tags-
|
|
7
|
+
import { h as h5TagName, a as h4TagName, b as h3TagName, c as h2TagName, e as h1TagName, f as headingHtmlTags } from "../../tags-Bz98Tkqt.js";
|
|
8
8
|
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
9
9
|
import { getFontWeight } from "../../foundations/token/getFontWeight/index.js";
|
|
10
10
|
import { getHeadingSize } from "../../foundations/token/getHeadingSize/index.js";
|
|
@@ -4,9 +4,9 @@ import { df as IconLoader, it as iconSizeLg, iq as iconSize3xl, iv as iconSizeSm
|
|
|
4
4
|
import Body from "../Body/index.js";
|
|
5
5
|
import Heading from "../Heading/index.js";
|
|
6
6
|
import InlineLink from "../InlineLink/index.js";
|
|
7
|
-
import { R as RichText } from "../../index-
|
|
8
|
-
import { d as divTagName } from "../../tags-
|
|
9
|
-
import { a as spacingXs, s as spacingMd } from "../../Spacing-D0HQH9YJ.js";
|
|
7
|
+
import { R as RichText } from "../../index-D2J2U7wz.js";
|
|
8
|
+
import { d as divTagName } from "../../tags-Bz98Tkqt.js";
|
|
9
|
+
import { a as spacingXs, s as spacingMd, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
10
10
|
import Link from "../Link/index.js";
|
|
11
11
|
import styled from "styled-components";
|
|
12
12
|
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
@@ -95,10 +95,11 @@ const IconSnippet = ({
|
|
|
95
95
|
iconPosition = iconSnippetPositionLeft,
|
|
96
96
|
iconAlign = iconSnippetAlignTop,
|
|
97
97
|
tag = divTagName,
|
|
98
|
+
icon,
|
|
98
99
|
...props
|
|
99
100
|
}) => {
|
|
100
101
|
return /* @__PURE__ */ jsxs(IconSnippetStyled, { ...props, iconPosition, iconAlign, as: tag, children: [
|
|
101
|
-
/* @__PURE__ */ jsx(IconLoaderStyled, { size: size === iconSnippetSizeLarge ? iconSizeLg : size === iconSnippetSize3Xl ? iconSize3xl : iconSizeSm
|
|
102
|
+
/* @__PURE__ */ jsx(IconLoaderStyled, { ...icon, bottomSpacing: spacingNone, size: size === iconSnippetSizeLarge ? iconSizeLg : size === iconSnippetSize3Xl ? iconSize3xl : iconSizeSm }),
|
|
102
103
|
/* @__PURE__ */ jsx(IconSnippetContentStyled, { as: tag, iconPosition, children: getContents(contents) })
|
|
103
104
|
] });
|
|
104
105
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconLoaderProps } from '@vfde-react/inline-icon-library';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
3
|
import { BodyProps } from '../Body';
|
|
4
4
|
import { HeadingProps } from '../Heading';
|
|
@@ -28,7 +28,7 @@ export interface IconSnippetProps extends PatternProps, HTMLAttributes<HTMLDivEl
|
|
|
28
28
|
/**
|
|
29
29
|
* Icon
|
|
30
30
|
*/
|
|
31
|
-
icon:
|
|
31
|
+
icon: Omit<IconLoaderProps, 'size' | 'bottomSpacing'>;
|
|
32
32
|
/**
|
|
33
33
|
* contents must be an array containing any combination of HeadingProps, BodyProps, RichTextProps and/or InlineLinkProps;
|
|
34
34
|
*/
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import Grid from "../Grid/index.js";
|
|
4
4
|
import GridItem from "../GridItem/index.js";
|
|
5
5
|
import IconSnippet from "../IconSnippet/index.js";
|
|
6
|
-
import { u as ulTagName, l as liTagName } from "../../tags-
|
|
6
|
+
import { u as ulTagName, l as liTagName } from "../../tags-Bz98Tkqt.js";
|
|
7
7
|
import { b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
8
8
|
const IconSnippetList = ({
|
|
9
9
|
component: _component,
|
|
@@ -4,12 +4,11 @@ import Body from "../Body/index.js";
|
|
|
4
4
|
import { b as fontWeightLight } from "../../FontWeight-DEBGHbtO.js";
|
|
5
5
|
import { s as spacingMd, c as spacingSm, d as spacingXl, a as spacingXs, e as spacing2Xs, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
6
6
|
import { m as mediumSize } from "../../SizeTypes-Ck_RdzIf.js";
|
|
7
|
-
import { g as getUid } from "../../index-
|
|
7
|
+
import { g as getUid, R as RichText } from "../../index-D2J2U7wz.js";
|
|
8
8
|
import Button from "../Button/index.js";
|
|
9
9
|
import Container from "../Container/index.js";
|
|
10
10
|
import Heading, { headingAlignCenter } from "../Heading/index.js";
|
|
11
11
|
import { P as Price, b as priceSizeSm } from "../../index-WLBo71sp.js";
|
|
12
|
-
import { R as RichText } from "../../index-ClmKFtnx.js";
|
|
13
12
|
import styled from "styled-components";
|
|
14
13
|
import { B as Badge } from "../../index-CKvLGUdD.js";
|
|
15
14
|
import ButtonGroup from "../ButtonGroup/index.js";
|
|
@@ -3,7 +3,7 @@ import { jsx, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import Body from "../Body/index.js";
|
|
4
4
|
import Heading from "../Heading/index.js";
|
|
5
5
|
import IconSnippet, { iconSnippetAlignCenter } from "../IconSnippet/index.js";
|
|
6
|
-
import { R as RichText } from "../../index-
|
|
6
|
+
import { R as RichText } from "../../index-D2J2U7wz.js";
|
|
7
7
|
import styled from "styled-components";
|
|
8
8
|
const LegendStyled = styled.legend.withConfig({
|
|
9
9
|
displayName: "LegendStyled",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { u as ulTagName, l as liTagName } from "../../tags-
|
|
3
|
+
import { u as ulTagName, l as liTagName } from "../../tags-Bz98Tkqt.js";
|
|
4
4
|
import { s as spacingMd, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
5
5
|
import LinkListItem, { linkListItemVariantVertical, linkListItemVariantHorizontal } from "../LinkListItem/index.js";
|
|
6
6
|
import styled from "styled-components";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { iu as iconSizeMd, df as IconLoader } from "../../index-Cbojl4_Q.js";
|
|
4
|
-
import { s as spanTagName } from "../../tags-
|
|
4
|
+
import { s as spanTagName } from "../../tags-Bz98Tkqt.js";
|
|
5
5
|
import { s as spacingMd, a as spacingXs, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
6
6
|
import { s as smallSize } from "../../SizeTypes-Ck_RdzIf.js";
|
|
7
7
|
import { B as Badge } from "../../index-CKvLGUdD.js";
|
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
|
-
import Body from "../Body/index.js";
|
|
5
4
|
import Flex from "../Flex/index.js";
|
|
6
5
|
import FlexItem from "../FlexItem/index.js";
|
|
7
6
|
import Heading, { headingAlignLeft } from "../Heading/index.js";
|
|
8
7
|
import Image, { aspectRatio16_9 } from "../Image/index.js";
|
|
9
8
|
import Link from "../Link/index.js";
|
|
9
|
+
import { g as getUid, R as RichText } from "../../index-D2J2U7wz.js";
|
|
10
10
|
import YoutubeVideo from "../YoutubeVideo/index.js";
|
|
11
|
-
import { u as ulTagName, d as divTagName, l as liTagName } from "../../tags-
|
|
11
|
+
import { p as pTagName, u as ulTagName, d as divTagName, l as liTagName } from "../../tags-Bz98Tkqt.js";
|
|
12
12
|
import { a as fontWeightRegular } from "../../FontWeight-DEBGHbtO.js";
|
|
13
13
|
import { b as textHeadingSm, t as textHeadingXs } from "../../HeadingSize-CfCRn3Lh.js";
|
|
14
14
|
import { s as spacingMd, e as spacing2Xs, c as spacingSm, b as spacingNone } from "../../Spacing-D0HQH9YJ.js";
|
|
15
|
-
import { t as textBodyMd } from "../../TextBodySize-BcZR9mh2.js";
|
|
16
15
|
import { u as useViewport } from "../../index-Cs0Hw0dj.js";
|
|
17
|
-
import { g as getUid } from "../../index-DR3e19BE.js";
|
|
18
16
|
import styled from "styled-components";
|
|
19
17
|
import { v as viewport } from "../../index-Ck2bCrhT.js";
|
|
20
18
|
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
21
19
|
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
22
20
|
import { f as filterProps } from "../../filterProps-Cewck8OH.js";
|
|
23
21
|
import { a as flexOrientationVertical, f as flexOrientationHorizontal, b as flexJustifyStart } from "../../styled-B0YKfXTz.js";
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
22
|
+
const mediaTextPositionTop = "top";
|
|
23
|
+
const mediaTextPositionLeft = "left";
|
|
24
|
+
const mediaTextPositionRight = "right";
|
|
27
25
|
const MediaTextStyled = styled.div.withConfig({
|
|
28
26
|
shouldForwardProp: filterProps(),
|
|
29
27
|
displayName: "MediaTextStyled",
|
|
30
28
|
componentId: "sc-zs2pry-0"
|
|
31
29
|
})(({
|
|
32
|
-
|
|
30
|
+
position,
|
|
33
31
|
bottomSpacing = spacingMd
|
|
34
32
|
}) => ({
|
|
35
33
|
display: "flex",
|
|
36
34
|
flexDirection: "column",
|
|
37
35
|
...viewport.md({
|
|
38
|
-
flexDirection:
|
|
36
|
+
flexDirection: position === "top" ? "column" : position === "left" ? "row" : "row-reverse"
|
|
39
37
|
}),
|
|
40
38
|
...getBottomSpacing({
|
|
41
39
|
bottomSpacing
|
|
@@ -46,7 +44,7 @@ const MediaTextMediaStyled = styled.div.withConfig({
|
|
|
46
44
|
displayName: "MediaTextMediaStyled",
|
|
47
45
|
componentId: "sc-zs2pry-1"
|
|
48
46
|
})(({
|
|
49
|
-
|
|
47
|
+
position,
|
|
50
48
|
bottomSpacing = spacingMd
|
|
51
49
|
}) => ({
|
|
52
50
|
flex: 1,
|
|
@@ -54,7 +52,7 @@ const MediaTextMediaStyled = styled.div.withConfig({
|
|
|
54
52
|
bottomSpacing
|
|
55
53
|
}),
|
|
56
54
|
...viewport.md({
|
|
57
|
-
...
|
|
55
|
+
...position != mediaTextPositionTop ? {
|
|
58
56
|
marginBottom: 0
|
|
59
57
|
} : {}
|
|
60
58
|
})
|
|
@@ -64,24 +62,24 @@ const MediaTextContentStyled = styled.div.withConfig({
|
|
|
64
62
|
displayName: "MediaTextContentStyled",
|
|
65
63
|
componentId: "sc-zs2pry-2"
|
|
66
64
|
})(({
|
|
67
|
-
|
|
65
|
+
position
|
|
68
66
|
}) => ({
|
|
69
67
|
flex: 1,
|
|
70
68
|
...viewport.md({
|
|
71
|
-
...
|
|
69
|
+
...position === "left" && {
|
|
72
70
|
paddingLeft: getSpacing(spacingMd)
|
|
73
71
|
},
|
|
74
|
-
...
|
|
72
|
+
...position === "right" && {
|
|
75
73
|
paddingRight: getSpacing(spacingMd)
|
|
76
74
|
}
|
|
77
75
|
})
|
|
78
76
|
}));
|
|
79
77
|
const MediaText = ({
|
|
80
78
|
media,
|
|
81
|
-
|
|
79
|
+
position = mediaTextPositionLeft,
|
|
82
80
|
heading,
|
|
83
81
|
subline,
|
|
84
|
-
|
|
82
|
+
richText,
|
|
85
83
|
action,
|
|
86
84
|
...props
|
|
87
85
|
}) => {
|
|
@@ -96,7 +94,7 @@ const MediaText = ({
|
|
|
96
94
|
if (!media2) return null;
|
|
97
95
|
switch (media2.component) {
|
|
98
96
|
case "Image":
|
|
99
|
-
return /* @__PURE__ */ jsx(Image, { ...media2, aspectRatio: aspectRatio16_9, bottomSpacing: spacingNone });
|
|
97
|
+
return /* @__PURE__ */ jsx(Image, { ...media2, aspectRatio: media2.aspectRatio ?? aspectRatio16_9, bottomSpacing: spacingNone });
|
|
100
98
|
case "YoutubeVideo":
|
|
101
99
|
return /* @__PURE__ */ jsx(YoutubeVideo, { ...media2, bottomSpacing: spacingNone });
|
|
102
100
|
default:
|
|
@@ -105,19 +103,19 @@ const MediaText = ({
|
|
|
105
103
|
}
|
|
106
104
|
};
|
|
107
105
|
const mediaContent = useMemo(() => renderMedia(media), [media]);
|
|
108
|
-
return /* @__PURE__ */ jsxs(MediaTextStyled, {
|
|
109
|
-
/* @__PURE__ */ jsx(MediaTextMediaStyled, {
|
|
110
|
-
/* @__PURE__ */ jsxs(MediaTextContentStyled, {
|
|
106
|
+
return /* @__PURE__ */ jsxs(MediaTextStyled, { position, ...props, children: [
|
|
107
|
+
/* @__PURE__ */ jsx(MediaTextMediaStyled, { position, children: mediaContent }),
|
|
108
|
+
/* @__PURE__ */ jsxs(MediaTextContentStyled, { position, children: [
|
|
111
109
|
/* @__PURE__ */ jsx(Heading, { ...heading, id: headingId, align: headingAlignLeft, size: textHeadingSm, bottomSpacing: headingSpacing }),
|
|
112
|
-
subline && /* @__PURE__ */ jsx(Heading, { ...subline, id: sublineId, align: headingAlignLeft, size: textHeadingXs, weight: fontWeightRegular, bottomSpacing: spacingMd }),
|
|
113
|
-
/* @__PURE__ */ jsx(
|
|
110
|
+
subline && /* @__PURE__ */ jsx(Heading, { ...subline, id: sublineId, align: headingAlignLeft, size: textHeadingXs, weight: fontWeightRegular, tag: pTagName, bottomSpacing: spacingMd }),
|
|
111
|
+
/* @__PURE__ */ jsx(RichText, { ...richText, bottomSpacing: spacingMd }),
|
|
114
112
|
/* @__PURE__ */ jsx(Flex, { bottomSpacing: spacingMd, gapSpacing: spacingSm, justify: flexJustifyStart, orientation: "sm" === viewport2 ? flexOrientationVertical : flexOrientationHorizontal, as: actionFlexAs, children: action && action.map((action2) => /* @__PURE__ */ jsx(FlexItem, { as: linkFlexItemAs, bottomSpacing: spacingNone, children: /* @__PURE__ */ jsx(Link, { ...action2 }) }, action2.uid)) })
|
|
115
113
|
] })
|
|
116
114
|
] });
|
|
117
115
|
};
|
|
118
116
|
export {
|
|
119
117
|
MediaText as default,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
mediaTextPositionLeft,
|
|
119
|
+
mediaTextPositionRight,
|
|
120
|
+
mediaTextPositionTop
|
|
123
121
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { BodyProps } from '../Body/props';
|
|
3
2
|
import { HeadingProps } from '../Heading/props';
|
|
4
3
|
import { ImageProps } from '../Image';
|
|
5
4
|
import { LinkProps } from '../Link';
|
|
5
|
+
import { RichTextProps } from '../RichText';
|
|
6
6
|
import { YoutubeVideoProps } from '../YoutubeVideo';
|
|
7
7
|
import { PatternProps } from '../../foundations/PatternProps';
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export type
|
|
8
|
+
export declare const mediaTextPositionTop = "top";
|
|
9
|
+
export declare const mediaTextPositionLeft = "left";
|
|
10
|
+
export declare const mediaTextPositionRight = "right";
|
|
11
|
+
export type MediaTextPosition = typeof mediaTextPositionTop | typeof mediaTextPositionLeft | typeof mediaTextPositionRight;
|
|
12
12
|
export interface MediaTextProps extends PatternProps, HTMLAttributes<HTMLDivElement> {
|
|
13
13
|
/**
|
|
14
14
|
* Pin component's name from string to the concrete name
|
|
@@ -16,13 +16,13 @@ export interface MediaTextProps extends PatternProps, HTMLAttributes<HTMLDivElem
|
|
|
16
16
|
component?: 'MediaText';
|
|
17
17
|
/**
|
|
18
18
|
* media prop can be either an Image or a YoutubeVideo
|
|
19
|
-
* The aspect ratio is
|
|
19
|
+
* The aspect ratio is by default 16 to 9.
|
|
20
20
|
*/
|
|
21
21
|
media: Omit<ImageProps, 'bottomSpacing'> | Omit<YoutubeVideoProps, 'bottomSpacing'>;
|
|
22
22
|
/**
|
|
23
|
-
* MediaText media can be
|
|
23
|
+
* MediaText media can be positioned on top, left or right.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
position?: MediaTextPosition;
|
|
26
26
|
/**
|
|
27
27
|
* Heading
|
|
28
28
|
*/
|
|
@@ -30,11 +30,11 @@ export interface MediaTextProps extends PatternProps, HTMLAttributes<HTMLDivElem
|
|
|
30
30
|
/**
|
|
31
31
|
* Subline
|
|
32
32
|
*/
|
|
33
|
-
subline?: Omit<HeadingProps, 'size' | 'weight' | 'bottomSpacing'>;
|
|
33
|
+
subline?: Omit<HeadingProps, 'size' | 'weight' | 'tag' | 'bottomSpacing'>;
|
|
34
34
|
/**
|
|
35
35
|
* Body
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
richText: Omit<RichTextProps, 'bottomSpacing'>;
|
|
38
38
|
/**
|
|
39
39
|
* Action, list of links
|
|
40
40
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MediaTextProps } from './props';
|
|
2
|
-
export declare const MediaTextStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "
|
|
3
|
-
export declare const MediaTextMediaStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "
|
|
4
|
-
export declare const MediaTextContentStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "
|
|
2
|
+
export declare const MediaTextStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "bottomSpacing" | "position">>> & string;
|
|
3
|
+
export declare const MediaTextMediaStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "bottomSpacing" | "position">>> & string;
|
|
4
|
+
export declare const MediaTextContentStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<MediaTextProps, "position">>> & string;
|
|
@@ -7,7 +7,7 @@ import ButtonGroup from "../ButtonGroup/index.js";
|
|
|
7
7
|
import Flex from "../Flex/index.js";
|
|
8
8
|
import Heading from "../Heading/index.js";
|
|
9
9
|
import Link from "../Link/index.js";
|
|
10
|
-
import { R as RichText } from "../../index-
|
|
10
|
+
import { R as RichText } from "../../index-D2J2U7wz.js";
|
|
11
11
|
import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
|
|
12
12
|
import { getObjectColor } from "../../foundations/token/getObjectColor/index.js";
|
|
13
13
|
import { e as colorBorderCritical, f as colorBorderWarning, d as colorBorderSuccess, k as colorBorderInformation } from "../../BorderColor-BummoQ1-.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const StarSVG: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const StarSVG: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.SVGProps<SVGSVGElement>, never>> & string & Omit<(props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element, keyof React.Component<any, {}, any>>;
|
|
3
3
|
export default StarSVG;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect, useRef } from "react";
|
|
4
|
-
import { u as useViewport, v as viewportSm } from "../../index-Cs0Hw0dj.js";
|
|
5
4
|
import Fieldset from "../Fieldset/index.js";
|
|
6
5
|
import styled from "styled-components";
|
|
6
|
+
import { u as useViewport, v as viewportSm } from "../../index-Cs0Hw0dj.js";
|
|
7
7
|
import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
|
|
8
8
|
import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js";
|
|
9
9
|
import { getHoverColor } from "../../foundations/token/getHoverColor/index.js";
|
|
@@ -14,9 +14,22 @@ import { c as colorBorderFocus, i as colorBorderSelected, a as colorBorderNeutra
|
|
|
14
14
|
import { a as borderWidthFocus } from "../../BorderWidth-DfOlyKK7.js";
|
|
15
15
|
import { b as colorObjectSelected } from "../../ObjectColor-BZDBuV8H.js";
|
|
16
16
|
import { a as spacingXs } from "../../Spacing-D0HQH9YJ.js";
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const StarSVGBase = (props) => {
|
|
18
|
+
const viewport = useViewport();
|
|
19
|
+
let width = 32;
|
|
20
|
+
let height = 30.624;
|
|
21
|
+
if (viewport === viewportSm) {
|
|
22
|
+
width = 24;
|
|
23
|
+
height = 22.968;
|
|
24
|
+
}
|
|
25
|
+
return /* @__PURE__ */ jsx("svg", { style: {
|
|
26
|
+
display: "inline-block"
|
|
27
|
+
}, width, height, viewBox: "0 0 26 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx("path", { d: "M1 9.95223L9.26911 8.58599L12.8296 1L16.6847 8.44108L25 9.48408L19.1147 15.449L20.6911 23.6799L13.199 19.9252L5.85987 23.9682L7.11465 15.6831L1 9.95223Z", fill: "white", stroke: "#7E7E7E", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
28
|
+
};
|
|
29
|
+
const StarSVG = styled(StarSVGBase).withConfig({
|
|
30
|
+
displayName: "StarSVG",
|
|
31
|
+
componentId: "sc-iheyat-0"
|
|
32
|
+
})([""]);
|
|
20
33
|
const getSvgPathStyles = (props) => ({
|
|
21
34
|
fill: props.selected ? getObjectColor(colorObjectSelected) : props.isInHoverRange ? getHoverColor(colorBackgroundNeutral) : "transparent",
|
|
22
35
|
strokeWidth: "1px",
|
|
@@ -85,22 +98,9 @@ const HiddenRadioStyled = styled.input.withConfig({
|
|
|
85
98
|
whiteSpace: "nowrap",
|
|
86
99
|
width: "1px"
|
|
87
100
|
});
|
|
88
|
-
const useStarSize = () => {
|
|
89
|
-
const viewport = useViewport();
|
|
90
|
-
if (viewport === viewportSm) {
|
|
91
|
-
return {
|
|
92
|
-
width: 24,
|
|
93
|
-
height: 22.968
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
width: 32,
|
|
98
|
-
height: 30.624
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
101
|
const Rating = ({
|
|
102
102
|
value,
|
|
103
|
-
|
|
103
|
+
onUpdate,
|
|
104
104
|
className,
|
|
105
105
|
groupName,
|
|
106
106
|
uid,
|
|
@@ -109,7 +109,6 @@ const Rating = ({
|
|
|
109
109
|
}) => {
|
|
110
110
|
const [internalValue, setInternalValue] = useState(value ?? 0);
|
|
111
111
|
const [hoverValue, setHoverValue] = useState(null);
|
|
112
|
-
const starSize = useStarSize();
|
|
113
112
|
useEffect(() => {
|
|
114
113
|
if (value !== void 0) {
|
|
115
114
|
setInternalValue(value);
|
|
@@ -118,8 +117,8 @@ const Rating = ({
|
|
|
118
117
|
const handleChange = (event) => {
|
|
119
118
|
const newValue = Number(event.target.value);
|
|
120
119
|
setInternalValue(newValue);
|
|
121
|
-
if (
|
|
122
|
-
|
|
120
|
+
if (onUpdate) {
|
|
121
|
+
onUpdate(newValue);
|
|
123
122
|
}
|
|
124
123
|
};
|
|
125
124
|
const handleMouseEnter = (index) => {
|
|
@@ -131,8 +130,8 @@ const Rating = ({
|
|
|
131
130
|
const handleClick = (starValue) => {
|
|
132
131
|
if (starValue === internalValue) {
|
|
133
132
|
setInternalValue(0);
|
|
134
|
-
if (
|
|
135
|
-
|
|
133
|
+
if (onUpdate) {
|
|
134
|
+
onUpdate(0);
|
|
136
135
|
}
|
|
137
136
|
}
|
|
138
137
|
};
|
|
@@ -142,7 +141,7 @@ const Rating = ({
|
|
|
142
141
|
const isInHoverRange = hoverValue !== null && starValue <= hoverValue;
|
|
143
142
|
return /* @__PURE__ */ jsxs(StarLabelStyled, { selected: starValue <= internalValue, isInHoverRange, htmlFor: `${uid}-star-${starValue}`, onMouseEnter: () => handleMouseEnter(index), onMouseLeave: handleMouseLeave, "aria-label": `${starValue} von 5 Sternen`, children: [
|
|
144
143
|
/* @__PURE__ */ jsx(HiddenRadioStyled, { type: "radio", id: `${uid}-star-${starValue}`, name: groupName || uid, value: starValue, checked: starValue === internalValue, onChange: handleChange, onClick: () => handleClick(starValue) }),
|
|
145
|
-
/* @__PURE__ */ jsx(StarSVG, {
|
|
144
|
+
/* @__PURE__ */ jsx(StarSVG, {})
|
|
146
145
|
] }, `star-${starValue}-${uid}`);
|
|
147
146
|
}) }) });
|
|
148
147
|
};
|
|
@@ -2,7 +2,7 @@ import { FieldsetSharedProps } from '../Fieldset';
|
|
|
2
2
|
/**
|
|
3
3
|
* Props for the Rating component
|
|
4
4
|
*/
|
|
5
|
-
export interface RatingProps extends Omit<FieldsetSharedProps, 'status' | 'errorMessage' | 'disabled'> {
|
|
5
|
+
export interface RatingProps extends Omit<FieldsetSharedProps, 'status' | 'errorMessage' | 'disabled' | 'helperText'> {
|
|
6
6
|
/**
|
|
7
7
|
* The current rating value (number of stars selected)
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ export interface RatingProps extends Omit<FieldsetSharedProps, 'status' | 'error
|
|
|
10
10
|
/**
|
|
11
11
|
* Callback fired when the rating value changes
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
onUpdate?: (value: number) => void;
|
|
14
14
|
/**
|
|
15
15
|
* Optional group name to identify the rating group for accessibility
|
|
16
16
|
*/
|
|
@@ -11,7 +11,7 @@ import { I as InputWrapperStyled, a as InputStyled } from "../../styled-03irSJOQ
|
|
|
11
11
|
import { c as spacingSm, a as spacingXs, s as spacingMd } from "../../Spacing-D0HQH9YJ.js";
|
|
12
12
|
import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
|
|
13
13
|
import Body from "../Body/index.js";
|
|
14
|
-
import { g as strongTagName } from "../../tags-
|
|
14
|
+
import { g as strongTagName } from "../../tags-Bz98Tkqt.js";
|
|
15
15
|
import styled from "styled-components";
|
|
16
16
|
import Card from "../Card/index.js";
|
|
17
17
|
import forcedColors from "../../foundations/media-query/forcedColors/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
|
-
import { a, T } from "../../index-
|
|
4
|
-
import "../../tags-
|
|
3
|
+
import { a, T } from "../../index-D2J2U7wz.js";
|
|
4
|
+
import "../../tags-Bz98Tkqt.js";
|
|
5
5
|
import "../../Spacing-D0HQH9YJ.js";
|
|
6
6
|
import "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
|
|
7
7
|
export {
|
|
@@ -5,7 +5,7 @@ import Body from "./components/Body/index.js";
|
|
|
5
5
|
import FootnoteLink from "./components/FootnoteLink/index.js";
|
|
6
6
|
import Heading from "./components/Heading/index.js";
|
|
7
7
|
import InlineLink from "./components/InlineLink/index.js";
|
|
8
|
-
import { f as headingHtmlTags, o as olTagName, g as strongTagName, i as supTagName, u as ulTagName } from "./tags-
|
|
8
|
+
import { f as headingHtmlTags, o as olTagName, g as strongTagName, i as supTagName, u as ulTagName } from "./tags-Bz98Tkqt.js";
|
|
9
9
|
import { s as spacingMd, b as spacingNone } from "./Spacing-D0HQH9YJ.js";
|
|
10
10
|
import { r as renderInlineRichTextFromOpenText } from "./renderInlineRichTextFromOpenText-RvOG3QbI.js";
|
|
11
11
|
import styled from "styled-components";
|
|
@@ -17,7 +17,10 @@ import { a as fontWeightRegular } from "./FontWeight-DEBGHbtO.js";
|
|
|
17
17
|
import { a as textBodySm, t as textBodyMd } from "./TextBodySize-BcZR9mh2.js";
|
|
18
18
|
import { f as filterProps } from "./filterProps-Cewck8OH.js";
|
|
19
19
|
import { t as textHeadingXs, b as textHeadingSm, a as textHeadingMd, c as textHeadingLg, d as textHeadingXl } from "./HeadingSize-CfCRn3Lh.js";
|
|
20
|
-
import {
|
|
20
|
+
import { v4 } from "uuid";
|
|
21
|
+
const getUid = () => {
|
|
22
|
+
return v4();
|
|
23
|
+
};
|
|
21
24
|
const mapSizeToTag = {
|
|
22
25
|
h1: textHeadingXl,
|
|
23
26
|
h2: textHeadingLg,
|
|
@@ -160,5 +163,6 @@ const TextList = ({
|
|
|
160
163
|
export {
|
|
161
164
|
RichText as R,
|
|
162
165
|
TextList as T,
|
|
163
|
-
TextListItem as a
|
|
166
|
+
TextListItem as a,
|
|
167
|
+
getUid as g
|
|
164
168
|
};
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { default as default2, YoutubeVideoIframeStyled, YoutubeVideoStyled } fro
|
|
|
2
2
|
import { default as default3 } from "./components/Tray/index.js";
|
|
3
3
|
import { default as default4 } from "./components/TimeInput/index.js";
|
|
4
4
|
import { default as default5 } from "./components/Textarea/index.js";
|
|
5
|
-
import { R, T, a } from "./index-
|
|
5
|
+
import { R, T, a } from "./index-D2J2U7wz.js";
|
|
6
6
|
import { P, T as T2, c, i, g, f, h, p, a as a2, e, d, b } from "./index-WLBo71sp.js";
|
|
7
7
|
import { default as default6 } from "./components/Switch/index.js";
|
|
8
8
|
import { default as default7 } from "./components/SuggestInput/index.js";
|
|
@@ -17,7 +17,7 @@ import { default as default14 } from "./components/ProductCard/index.js";
|
|
|
17
17
|
import { default as default15 } from "./components/PickerGroup/index.js";
|
|
18
18
|
import { default as default16, overlayAppearancePrimary, overlayAppearanceSecondary } from "./components/Overlay/index.js";
|
|
19
19
|
import { default as default17, notificationStatusError, notificationStatusInfo, notificationStatusSuccess, notificationStatusWarning } from "./components/Notification/index.js";
|
|
20
|
-
import { default as default18,
|
|
20
|
+
import { default as default18, mediaTextPositionLeft, mediaTextPositionRight, mediaTextPositionTop } from "./components/MediaText/index.js";
|
|
21
21
|
import { default as default19 } from "./components/LoadingSpinner/index.js";
|
|
22
22
|
import { default as default20, linkListItemVariantHorizontal, linkListItemVariantVertical } from "./components/LinkListItem/index.js";
|
|
23
23
|
import { default as default21, linkListVariantColumn, linkListVariantRow } from "./components/LinkList/index.js";
|
|
@@ -268,9 +268,9 @@ export {
|
|
|
268
268
|
linkListItemVariantVertical,
|
|
269
269
|
linkListVariantColumn,
|
|
270
270
|
linkListVariantRow,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
271
|
+
mediaTextPositionLeft,
|
|
272
|
+
mediaTextPositionRight,
|
|
273
|
+
mediaTextPositionTop,
|
|
274
274
|
m as mediumMediaQuery,
|
|
275
275
|
noReducedMotion,
|
|
276
276
|
notificationStatusError,
|
|
@@ -5,6 +5,7 @@ const h4TagName = "h4";
|
|
|
5
5
|
const h5TagName = "h5";
|
|
6
6
|
const h6TagName = "h6";
|
|
7
7
|
const headingHtmlTags = [h1TagName, h2TagName, h3TagName, h4TagName, h5TagName, h6TagName];
|
|
8
|
+
const pTagName = "p";
|
|
8
9
|
const divTagName = "div";
|
|
9
10
|
const spanTagName = "span";
|
|
10
11
|
const strongTagName = "strong";
|
|
@@ -24,6 +25,7 @@ export {
|
|
|
24
25
|
supTagName as i,
|
|
25
26
|
liTagName as l,
|
|
26
27
|
olTagName as o,
|
|
28
|
+
pTagName as p,
|
|
27
29
|
spanTagName as s,
|
|
28
30
|
ulTagName as u
|
|
29
31
|
};
|
package/package.json
CHANGED