@vodafone_de/brix-components 7.0.7 → 7.0.8

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 (71) hide show
  1. package/README.md +1 -0
  2. package/dist/{FontWeight-DEBGHbtO.js → FontWeight-CR22KTex.js} +2 -2
  3. package/dist/components/Accordion/index.js +1 -1
  4. package/dist/components/Badge/index.js +1 -1
  5. package/dist/components/Body/index.js +1 -1
  6. package/dist/components/Button/index.js +2 -2
  7. package/dist/components/ButtonAsLink/index.js +1 -1
  8. package/dist/components/ButtonGroup/index.js +1 -1
  9. package/dist/components/Card/index.js +1 -1
  10. package/dist/components/Carousel/components/CarouselContext.d.ts +3 -2
  11. package/dist/components/Carousel/index.js +42 -53
  12. package/dist/components/Carousel/utils/useScrollSpy.d.ts +2 -0
  13. package/dist/components/ConsentMessage/index.js +1 -1
  14. package/dist/components/ConsentMessage/styled.d.ts +1 -1
  15. package/dist/components/DemoBox/index.js +2 -4
  16. package/dist/components/Dialog/index.js +1 -1
  17. package/dist/components/Dialog/styled.d.ts +1 -1
  18. package/dist/components/DiscoveryCard/index.js +5 -5
  19. package/dist/components/DiscoveryCard/styled.d.ts +1 -1
  20. package/dist/components/DiscoveryCardGroup/index.js +1 -1
  21. package/dist/components/GoogleMap/styled.d.ts +1 -1
  22. package/dist/components/Grid/index.js +1 -1
  23. package/dist/components/GridItem/index.js +1 -1
  24. package/dist/components/Heading/index.js +2 -2
  25. package/dist/components/IconButton/index.js +1 -1
  26. package/dist/components/IconSnippet/index.js +4 -5
  27. package/dist/components/IconSnippet/props.d.ts +2 -2
  28. package/dist/components/IconSnippet/styled.d.ts +1 -1
  29. package/dist/components/IconSnippetList/index.js +1 -1
  30. package/dist/components/ImageHeader/index.js +4 -4
  31. package/dist/components/ImageHeader/styled.d.ts +4 -4
  32. package/dist/components/InlineLink/index.js +1 -1
  33. package/dist/components/Legend/index.js +1 -1
  34. package/dist/components/Link/index.js +1 -1
  35. package/dist/components/LinkAsButton/index.js +1 -1
  36. package/dist/components/LinkList/index.js +1 -1
  37. package/dist/components/LinkListItem/index.js +2 -2
  38. package/dist/components/Notification/index.js +1 -1
  39. package/dist/components/PickerGroup/index.js +2 -2
  40. package/dist/components/Price/index.js +1 -1
  41. package/dist/components/ProductCard/index.js +3 -3
  42. package/dist/components/RichText/index.js +1 -1
  43. package/dist/components/SearchInput/index.js +1 -1
  44. package/dist/components/SearchInput/styled.d.ts +1 -1
  45. package/dist/components/Stepper/index.js +2 -2
  46. package/dist/components/SuggestInput/index.js +1 -1
  47. package/dist/components/TabularPrice/index.js +1 -1
  48. package/dist/components/TextList/index.js +2 -2
  49. package/dist/components/Tray/index.js +1 -1
  50. package/dist/components/YoutubeVideo/index.js +2 -1
  51. package/dist/hooks/useViewport/index.js +22 -5
  52. package/dist/{index-D2J2U7wz.js → index-BeSd-V81.js} +2 -2
  53. package/dist/{index-DrySIh-D.js → index-C5GzK6_0.js} +1 -1
  54. package/dist/{index-57IF0yrd.js → index-C7meHOM4.js} +2 -2
  55. package/dist/{index-CKvLGUdD.js → index-ZHkR70j3.js} +1 -1
  56. package/dist/{index-WLBo71sp.js → index-aUJfXBUI.js} +1 -1
  57. package/dist/index.d.ts +0 -4
  58. package/dist/index.js +119 -129
  59. package/dist/{styled-DLS1p_AJ.js → styled-BSqC5P9h.js} +1 -1
  60. package/dist/{tags-Bz98Tkqt.js → tags-DI6H1biK.js} +0 -2
  61. package/package.json +1 -1
  62. package/dist/components/MediaText/index.d.ts +0 -5
  63. package/dist/components/MediaText/index.js +0 -121
  64. package/dist/components/MediaText/props.d.ts +0 -42
  65. package/dist/components/MediaText/styled.d.ts +0 -4
  66. package/dist/components/Rating/assets/StarSVG.d.ts +0 -3
  67. package/dist/components/Rating/index.d.ts +0 -6
  68. package/dist/components/Rating/index.js +0 -153
  69. package/dist/components/Rating/props.d.ts +0 -22
  70. package/dist/components/Rating/styled.d.ts +0 -6
  71. package/dist/index-Cs0Hw0dj.js +0 -25
@@ -1,153 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useState, useEffect, useRef } from "react";
4
- import Fieldset from "../Fieldset/index.js";
5
- import styled from "styled-components";
6
- import { u as useViewport, v as viewportSm } from "../../index-Cs0Hw0dj.js";
7
- import { getBorderColor } from "../../foundations/token/getBorderColor/index.js";
8
- import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js";
9
- import { getHoverColor } from "../../foundations/token/getHoverColor/index.js";
10
- import { getObjectColor } from "../../foundations/token/getObjectColor/index.js";
11
- import { getSpacing } from "../../foundations/token/getSpacing/index.js";
12
- import { c as colorBackgroundNeutral } from "../../BackgroundColor-e0N9tdDR.js";
13
- import { c as colorBorderFocus, i as colorBorderSelected, a as colorBorderNeutral, b as colorBorderUnselected } from "../../BorderColor-BummoQ1-.js";
14
- import { a as borderWidthFocus } from "../../BorderWidth-DfOlyKK7.js";
15
- import { b as colorObjectSelected } from "../../ObjectColor-BZDBuV8H.js";
16
- import { a as spacingXs } from "../../Spacing-D0HQH9YJ.js";
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
- })([""]);
33
- const getSvgPathStyles = (props) => ({
34
- fill: props.selected ? getObjectColor(colorObjectSelected) : props.isInHoverRange ? getHoverColor(colorBackgroundNeutral) : "transparent",
35
- strokeWidth: "1px",
36
- stroke: props.selected ? getBorderColor(colorBorderSelected) : props.isInHoverRange ? getBorderColor(colorBorderNeutral) : getBorderColor(colorBorderUnselected)
37
- });
38
- const getHoverSvgPathStyles = (props) => ({
39
- fill: props.selected ? getHoverColor(colorObjectSelected) : getHoverColor(colorBackgroundNeutral),
40
- strokeWidth: "1px",
41
- stroke: props.selected ? getBorderColor(colorBorderSelected) : getBorderColor(colorBorderNeutral)
42
- });
43
- const StarsWrapperStyled = styled.div.withConfig({
44
- displayName: "StarsWrapperStyled",
45
- componentId: "sc-1nbg0l6-0"
46
- })({
47
- display: "flex",
48
- gap: getSpacing(spacingXs)
49
- });
50
- const StarLabelStyled = styled.label.withConfig({
51
- displayName: "StarLabelStyled",
52
- componentId: "sc-1nbg0l6-1"
53
- })(({
54
- selected,
55
- isInHoverRange
56
- }) => {
57
- const normalStyles = getSvgPathStyles({
58
- selected,
59
- isInHoverRange
60
- });
61
- const hoverStyles = getHoverSvgPathStyles({
62
- selected
63
- });
64
- return {
65
- cursor: "pointer",
66
- display: "inline-flex",
67
- alignItems: "center",
68
- justifyContent: "center",
69
- svg: {
70
- path: {
71
- ...normalStyles,
72
- transition: "fill 200ms, stroke 200ms"
73
- }
74
- },
75
- "&:hover svg path": {
76
- ...hoverStyles,
77
- transition: "fill 200ms, stroke 200ms"
78
- },
79
- // Apply focus-visible styles on label when input is focused
80
- "&:has(:focus-visible)": {
81
- outline: `${getBorderWidth(borderWidthFocus)} solid ${getBorderColor(colorBorderFocus)}`,
82
- outlineOffset: "2px"
83
- }
84
- };
85
- });
86
- const HiddenRadioStyled = styled.input.withConfig({
87
- displayName: "HiddenRadioStyled",
88
- componentId: "sc-1nbg0l6-2"
89
- })({
90
- border: 0,
91
- clip: "rect(0 0 0 0)",
92
- clipPath: "inset(50%)",
93
- height: "1px",
94
- margin: "-1px",
95
- overflow: "hidden",
96
- padding: 0,
97
- position: "absolute",
98
- whiteSpace: "nowrap",
99
- width: "1px"
100
- });
101
- const Rating = ({
102
- value,
103
- onUpdate,
104
- className,
105
- groupName,
106
- uid,
107
- component: _component,
108
- ...props
109
- }) => {
110
- const [internalValue, setInternalValue] = useState(value ?? 0);
111
- const [hoverValue, setHoverValue] = useState(null);
112
- useEffect(() => {
113
- if (value !== void 0) {
114
- setInternalValue(value);
115
- }
116
- }, [value]);
117
- const handleChange = (event) => {
118
- const newValue = Number(event.target.value);
119
- setInternalValue(newValue);
120
- if (onUpdate) {
121
- onUpdate(newValue);
122
- }
123
- };
124
- const handleMouseEnter = (index) => {
125
- setHoverValue(index + 1);
126
- };
127
- const handleMouseLeave = () => {
128
- setHoverValue(null);
129
- };
130
- const handleClick = (starValue) => {
131
- if (starValue === internalValue) {
132
- setInternalValue(0);
133
- if (onUpdate) {
134
- onUpdate(0);
135
- }
136
- }
137
- };
138
- const ref = useRef(null);
139
- return /* @__PURE__ */ jsx(Fieldset, { ...props, uid, ref, children: /* @__PURE__ */ jsx(StarsWrapperStyled, { className, role: "radiogroup", children: [...Array(5)].map((_, index) => {
140
- const starValue = index + 1;
141
- const isInHoverRange = hoverValue !== null && starValue <= hoverValue;
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: [
143
- /* @__PURE__ */ jsx(HiddenRadioStyled, { type: "radio", id: `${uid}-star-${starValue}`, name: groupName || uid, value: starValue, checked: starValue === internalValue, onChange: handleChange, onClick: () => handleClick(starValue) }),
144
- /* @__PURE__ */ jsx(StarSVG, {})
145
- ] }, `star-${starValue}-${uid}`);
146
- }) }) });
147
- };
148
- export {
149
- HiddenRadioStyled,
150
- StarLabelStyled,
151
- StarsWrapperStyled,
152
- Rating as default
153
- };
@@ -1,22 +0,0 @@
1
- import { FieldsetSharedProps } from '../Fieldset';
2
- /**
3
- * Props for the Rating component
4
- */
5
- export interface RatingProps extends Omit<FieldsetSharedProps, 'status' | 'errorMessage' | 'disabled' | 'helperText'> {
6
- /**
7
- * The current rating value (number of stars selected)
8
- */
9
- value?: number;
10
- /**
11
- * Callback fired when the rating value changes
12
- */
13
- onUpdate?: (value: number) => void;
14
- /**
15
- * Optional group name to identify the rating group for accessibility
16
- */
17
- groupName?: string;
18
- /**
19
- * Pin component's name from string to the concrete name
20
- */
21
- component?: 'Rating';
22
- }
@@ -1,6 +0,0 @@
1
- export declare const StarsWrapperStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
- export declare const StarLabelStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
3
- selected: boolean;
4
- isInHoverRange?: boolean;
5
- }>> & string;
6
- export declare const HiddenRadioStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
@@ -1,25 +0,0 @@
1
- import { useState, useEffect } from "react";
2
- import { l as largeMediaQuery, m as mediumMediaQuery } from "./index-Ck2bCrhT.js";
3
- import { useMediaQuery } from "./hooks/useMediaQuery/index.js";
4
- const viewportSm = "sm";
5
- const viewportMd = "md";
6
- const viewportLg = "lg";
7
- const useViewport = () => {
8
- const tablet = useMediaQuery(mediumMediaQuery);
9
- const desktop = useMediaQuery(largeMediaQuery);
10
- const [viewportState, setViewportState] = useState(viewportSm);
11
- useEffect(() => {
12
- if (desktop) {
13
- setViewportState(viewportLg);
14
- } else if (tablet) {
15
- setViewportState(viewportMd);
16
- } else {
17
- setViewportState(viewportSm);
18
- }
19
- }, [tablet, desktop]);
20
- return viewportState;
21
- };
22
- export {
23
- useViewport as u,
24
- viewportSm as v
25
- };