@vodafone_de/brix-components 7.1.10 → 7.1.11

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 (56) hide show
  1. package/dist/{TableHead-C2zQ4jce.js → TableHead-ogeZ901P.js} +12 -12
  2. package/dist/{TableWrapper-C8SpplcL.js → TableWrapper-Og83COGw.js} +1 -1
  3. package/dist/components/Badge/index.js +8 -4
  4. package/dist/components/Badge/props.d.ts +8 -3
  5. package/dist/components/Body/index.js +1 -1
  6. package/dist/components/Button/index.js +1 -1
  7. package/dist/components/ButtonAsLink/index.js +1 -1
  8. package/dist/components/Carousel/index.js +1 -1
  9. package/dist/components/DateInput/index.js +1 -0
  10. package/dist/components/Dialog/index.js +7 -5
  11. package/dist/components/DiscoveryCard/index.js +6 -6
  12. package/dist/components/Fieldset/index.js +1 -0
  13. package/dist/components/FilterGroup/index.js +1 -1
  14. package/dist/components/FootnoteLink/index.js +4 -52
  15. package/dist/components/Heading/index.js +1 -1
  16. package/dist/components/IconSnippet/index.js +1 -1
  17. package/dist/components/ImageHeader/index.js +2 -2
  18. package/dist/components/InlineLink/index.js +10 -11
  19. package/dist/components/Input/index.js +1 -0
  20. package/dist/components/Legend/index.js +12 -2
  21. package/dist/components/LoadingSpinner/index.js +1 -1
  22. package/dist/components/MediaText/index.js +1 -1
  23. package/dist/components/Notification/index.js +1 -1
  24. package/dist/components/OpenTextFootnoteAdapter/index.js +1 -1
  25. package/dist/components/PickerGroup/index.js +1 -1
  26. package/dist/components/Price/index.js +2 -2
  27. package/dist/components/ProductCard/index.js +1 -1
  28. package/dist/components/Rating/index.js +4 -3
  29. package/dist/components/RichText/index.js +1 -1
  30. package/dist/components/RichtTextContentful/index.js +1 -1
  31. package/dist/components/ScreenreaderOnly/index.js +3 -14
  32. package/dist/components/SelectInput/index.js +1 -0
  33. package/dist/components/SuggestInput/index.js +17 -13
  34. package/dist/components/SuggestInput/props.d.ts +2 -1
  35. package/dist/components/Table/index.d.ts +1 -1
  36. package/dist/components/Table/index.js +7 -7
  37. package/dist/components/Table/props.d.ts +1 -1
  38. package/dist/components/TabularPrice/index.js +2 -2
  39. package/dist/components/TextList/index.js +1 -1
  40. package/dist/components/Textarea/index.js +1 -0
  41. package/dist/components/TimeInput/index.js +1 -0
  42. package/dist/contentful/index.js +4 -4
  43. package/dist/contentful/live-preview-inspector/index.js +1 -1
  44. package/dist/contentful/live-preview-renderer/index.js +1 -1
  45. package/dist/contentful/renderer/index.js +1 -1
  46. package/dist/{index-CifS-Z_9.js → index-Cmrx-D-0.js} +3 -3
  47. package/dist/{index-CHzok6W_.js → index-Cv2XdnwK.js} +5 -1
  48. package/dist/index-DSF1zGyd.js +24 -0
  49. package/dist/index-UJLGt4uV.js +54 -0
  50. package/dist/{index-DLvMM1Dq.js → index-tT4JzApY.js} +1 -1
  51. package/dist/index.js +146 -146
  52. package/dist/{mapContentToComponents-DLxIwtHo.js → mapContentToComponents-CbN3OD_t.js} +7 -5
  53. package/dist/{styled-BBO2jrba.js → styled-CIwf9Ebu.js} +20 -0
  54. package/package.json +1 -1
  55. package/dist/screenreaderOnly-Dv2v6MAr.js +0 -11
  56. package/dist/styled-CH1kr8ZR.js +0 -14
@@ -135,7 +135,7 @@ const SuggestInputList = ({
135
135
  const isSelected = index === selectedOption;
136
136
  return /* @__PURE__ */ jsx(SuggestInputListItemStyled, { ref: (el) => {
137
137
  listItemsRef.current[index] = el;
138
- }, onMouseDown: () => pickOption(listItem.label), "aria-selected": isSelected ? "true" : void 0, isSelected, role: "option", id: `${uid}-item-${index}`, children: highlightQuery(listItem.label, query) }, listItem.label);
138
+ }, onMouseDown: () => pickOption(listItem.value), "aria-selected": isSelected ? "true" : void 0, isSelected, role: "option", id: `${uid}-item-${index}`, "data-value": listItem.value, children: highlightQuery(listItem.label, query) }, listItem.label);
139
139
  }) }) });
140
140
  };
141
141
  const SuggestInputFormElementStyled = styled.div.withConfig({
@@ -209,6 +209,7 @@ const SuggestInputFormElement = forwardRef(({
209
209
  }, ref) => {
210
210
  return /* @__PURE__ */ jsx(SuggestInputFormElementStyled, { ...props, ref, children });
211
211
  });
212
+ SuggestInputFormElement.displayName = "SuggestInputFormElement";
212
213
  const SuggestInput = forwardRef(({
213
214
  bottomSpacing = spacingMd,
214
215
  isLoading = false,
@@ -225,6 +226,7 @@ const SuggestInput = forwardRef(({
225
226
  placeholder,
226
227
  ...props
227
228
  }, outerRef) => {
229
+ var _a;
228
230
  const initialValueState = !props.value ? "" : props.value;
229
231
  const [buttonIcon, setButtonIcon] = useState("ChevronDown");
230
232
  const [selectedOption, setSelectedOption] = useState(-1);
@@ -258,13 +260,13 @@ const SuggestInput = forwardRef(({
258
260
  setConfirmedValue(props.value);
259
261
  }, [props.value]);
260
262
  useEffect(() => {
261
- var _a;
263
+ var _a2;
262
264
  document.addEventListener("click", onClick);
263
- (_a = formElementRef.current) == null ? void 0 : _a.addEventListener("keydown", onKeyDown);
265
+ (_a2 = formElementRef.current) == null ? void 0 : _a2.addEventListener("keydown", onKeyDown);
264
266
  return () => {
265
- var _a2;
267
+ var _a3;
266
268
  document.removeEventListener("click", onClick);
267
- (_a2 = formElementRef.current) == null ? void 0 : _a2.removeEventListener("keydown", onKeyDown);
269
+ (_a3 = formElementRef.current) == null ? void 0 : _a3.removeEventListener("keydown", onKeyDown);
268
270
  };
269
271
  });
270
272
  const closeList = () => {
@@ -300,16 +302,17 @@ const SuggestInput = forwardRef(({
300
302
  onUpdate && onUpdate(userInput);
301
303
  };
302
304
  const pickOption = (value2) => {
303
- var _a;
304
- (_a = inputRef.current) == null ? void 0 : _a.focus();
305
+ var _a2;
306
+ const pickedListItem = listItems == null ? void 0 : listItems.find((listItem) => listItem.value === value2);
307
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
305
308
  setShowList(false);
306
309
  setValue(value2);
307
310
  setConfirmedValue(value2);
308
- onPick && onPick(value2);
311
+ onPick && pickedListItem && onPick(pickedListItem);
309
312
  onClose && onClose();
310
313
  };
311
314
  const onClick = (event) => {
312
- if (formElementRef.current && !formElementRef.current.contains(event.target)) {
315
+ if (formElementRef.current && !formElementRef.current.contains(event.target) && showList && !formElementRef.current.contains(document.activeElement)) {
313
316
  formElementRef.current.blur();
314
317
  closeList();
315
318
  }
@@ -322,7 +325,7 @@ const SuggestInput = forwardRef(({
322
325
  });
323
326
  };
324
327
  const onKeyDown = (event) => {
325
- var _a;
328
+ var _a2;
326
329
  switch (event.key) {
327
330
  case "ArrowDown":
328
331
  if (!showList) setShowList(true);
@@ -346,8 +349,8 @@ const SuggestInput = forwardRef(({
346
349
  break;
347
350
  case "Enter":
348
351
  if (showList) {
349
- pickOption(listItemsRef.current[selectedOption].innerText);
350
- (_a = inputRef.current) == null ? void 0 : _a.setSelectionRange(value.length, value.length);
352
+ pickOption(listItemsRef.current[selectedOption].dataset.value);
353
+ (_a2 = inputRef.current) == null ? void 0 : _a2.setSelectionRange(value.length, value.length);
351
354
  }
352
355
  break;
353
356
  case "Escape":
@@ -363,7 +366,7 @@ const SuggestInput = forwardRef(({
363
366
  /* @__PURE__ */ jsx(InputStyled, { ...inputProps, ref: inputRef, onChange: (e) => handleChange(e.target.value), onClick: () => {
364
367
  if (disabled) return;
365
368
  setShowList(true);
366
- }, role: "combobox", value, ...{
369
+ }, role: "combobox", value: (_a = listItems == null ? void 0 : listItems.find((listItem) => listItem.value === value)) == null ? void 0 : _a.label, ...{
367
370
  "aria-expanded": showList,
368
371
  "aria-controls": "listbox",
369
372
  "aria-activedescendant": selectedOption > -1 ? `${uid}-item-${selectedOption}` : void 0,
@@ -386,6 +389,7 @@ const SuggestInput = forwardRef(({
386
389
  /* @__PURE__ */ jsx(FormHelperMessage, { id: messageId, status, message: inputStateError === status ? errorMessage : helperText })
387
390
  ] });
388
391
  });
392
+ SuggestInput.displayName = "SuggestInput";
389
393
  export {
390
394
  SuggestInput as default
391
395
  };
@@ -5,6 +5,7 @@ export interface SuggestInputItemProps {
5
5
  icon?: IconName;
6
6
  image?: string;
7
7
  label: string;
8
+ value: string;
8
9
  }
9
10
  export interface SuggestInputProps extends InputSharedProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'accept' | 'alt' | 'capture' | 'checked' | 'formEncType' | 'formTarget' | 'height' | 'max' | 'min' | 'multiple' | 'size' | 'step' | 'type' | 'width' | 'readOnly'> {
10
11
  value?: string;
@@ -19,7 +20,7 @@ export interface SuggestInputProps extends InputSharedProps, Omit<InputHTMLAttri
19
20
  /**
20
21
  * function that is called when an option from the list is picked
21
22
  */
22
- onPick?: (value: string) => void;
23
+ onPick?: (value: SuggestInputItemProps) => void;
23
24
  /**
24
25
  * function that is called when the input or the list is closed (either by clicking the close button or escape key)
25
26
  */
@@ -4,5 +4,5 @@ import { default as TableFoot } from './components/TableFoot';
4
4
  import { default as TableHead } from './components/TableHead';
5
5
  import { default as TableWrapper } from './components/TableWrapper';
6
6
  import { TableContext, TableProvider } from './TableContext';
7
- export { TableWrapper, TableHead, TableBody, TableFoot, TableCell, TableContext, TableProvider };
7
+ export { TableBody, TableCell, TableContext, TableFoot, TableHead, TableProvider, TableWrapper };
8
8
  export default TableWrapper;
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { a, c, d, b, T, e } from "../../TableHead-C2zQ4jce.js";
3
- import { T as TableWrapper } from "../../TableWrapper-C8SpplcL.js";
2
+ import { T, a, b, c, d, e } from "../../TableHead-ogeZ901P.js";
3
+ import { T as TableWrapper } from "../../TableWrapper-Og83COGw.js";
4
4
  export {
5
- a as TableBody,
6
- c as TableCell,
7
- d as TableContext,
8
- b as TableFoot,
9
- T as TableHead,
5
+ T as TableBody,
6
+ a as TableCell,
7
+ b as TableContext,
8
+ c as TableFoot,
9
+ d as TableHead,
10
10
  e as TableProvider,
11
11
  TableWrapper,
12
12
  TableWrapper as default
@@ -1,4 +1,4 @@
1
- import { HTMLAttributes, ReactNode, ReactElement } from 'react';
1
+ import { HTMLAttributes, ReactElement, ReactNode } from 'react';
2
2
  import { PatternProps } from '../../foundations/PatternProps';
3
3
  export type TableColumn = {
4
4
  key: string;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "react/jsx-runtime";
3
- import { T } from "../../index-DLvMM1Dq.js";
4
- import "../ScreenreaderOnly/index.js";
3
+ import { T } from "../../index-tT4JzApY.js";
4
+ import "../../index-DSF1zGyd.js";
5
5
  import "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
6
6
  export {
7
7
  T as default
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "react/jsx-runtime";
3
- import { a, T } from "../../index-CifS-Z_9.js";
3
+ import { a, T } from "../../index-Cmrx-D-0.js";
4
4
  import "../../tags-38kBhOn6.js";
5
5
  import "../../Spacing-BMQelJYr.js";
6
6
  import "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
@@ -159,6 +159,7 @@ const Textarea = forwardRef(({
159
159
  /* @__PURE__ */ jsx(FormHelperMessage, { id: messageId, status, message: inputStateError === status ? errorMessage : helperText })
160
160
  ] });
161
161
  });
162
+ Textarea.displayName = "Textarea";
162
163
  export {
163
164
  Textarea as default
164
165
  };
@@ -101,6 +101,7 @@ const TimeInput = forwardRef(({
101
101
  /* @__PURE__ */ jsx(FormHelperMessage, { id: messageId, status: internalStatus, message: inputStateError === internalStatus ? errorMessage : helperText })
102
102
  ] });
103
103
  });
104
+ TimeInput.displayName = "TimeInput";
104
105
  export {
105
106
  TimeInput as default
106
107
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import "react/jsx-runtime";
3
3
  import "@contentful/live-preview/react";
4
- import "../components/ScreenreaderOnly/index.js";
5
- import "../components/FootnoteLink/index.js";
4
+ import "../index-DSF1zGyd.js";
5
+ import "../index-UJLGt4uV.js";
6
6
  import "html-react-parser";
7
7
  import "../components/Body/index.js";
8
8
  import "../styled-BXtzJJFu.js";
@@ -12,12 +12,12 @@ import "../styled-Cz2kpbgE.js";
12
12
  import "../styled-Dmb8-99g.js";
13
13
  import "../NotificationErrorIcon-DMnAJgPN.js";
14
14
  import "../styled-B1bxWqtW.js";
15
- import "../styled-BBO2jrba.js";
15
+ import "../styled-CIwf9Ebu.js";
16
16
  import "../hooks/useLinkComponent/index.js";
17
17
  import "../styled-BBG87P4U.js";
18
18
  import "../styled-BlHKbHF4.js";
19
19
  import "../styled-VuUKI7PE.js";
20
20
  import "../styled-BKWEE3dx.js";
21
21
  import "../components/InlineLink/index.js";
22
- import "../TableHead-C2zQ4jce.js";
22
+ import "../TableHead-ogeZ901P.js";
23
23
  import "../styled-BYYivuzh.js";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "react/jsx-runtime";
3
3
  import "@contentful/live-preview/react";
4
- import { L } from "../../mapContentToComponents-DLxIwtHo.js";
4
+ import { L } from "../../mapContentToComponents-CbN3OD_t.js";
5
5
  export {
6
6
  L as LivePreviewInspector
7
7
  };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, Fragment } from "react/jsx-runtime";
3
3
  import { useContentfulLiveUpdates, ContentfulLivePreviewProvider } from "@contentful/live-preview/react";
4
- import { m as mapContentToComponents } from "../../mapContentToComponents-DLxIwtHo.js";
4
+ import { m as mapContentToComponents } from "../../mapContentToComponents-CbN3OD_t.js";
5
5
  const BrixLiveRendererComponents = ({
6
6
  data
7
7
  }) => {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, Fragment } from "react/jsx-runtime";
3
3
  import LivePreviewRenderer from "../live-preview-renderer/index.js";
4
- import { m as mapContentToComponents } from "../../mapContentToComponents-DLxIwtHo.js";
4
+ import { m as mapContentToComponents } from "../../mapContentToComponents-CbN3OD_t.js";
5
5
  const Renderer = ({
6
6
  content,
7
7
  isDraftMode
@@ -2,11 +2,11 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { cloneElement } from "react";
3
3
  import parse, { Element, domToReact } from "html-react-parser";
4
4
  import Body from "./components/Body/index.js";
5
- import FootnoteLink from "./components/FootnoteLink/index.js";
5
+ import { F as FootnoteLink } from "./index-UJLGt4uV.js";
6
6
  import Heading from "./components/Heading/index.js";
7
7
  import InlineLink from "./components/InlineLink/index.js";
8
- import { T as TableHead, a as TableBody, b as TableFoot } from "./TableHead-C2zQ4jce.js";
9
- import { T as TableWrapper } from "./TableWrapper-C8SpplcL.js";
8
+ import { d as TableHead, T as TableBody, c as TableFoot } from "./TableHead-ogeZ901P.js";
9
+ import { T as TableWrapper } from "./TableWrapper-Og83COGw.js";
10
10
  import { k as headingHtmlTags, o as olTagName, q as strongTagName, r as supTagName, u as ulTagName } from "./tags-38kBhOn6.js";
11
11
  import { s as spacingNone } from "./Spacing-BMQelJYr.js";
12
12
  import { r as renderInlineRichTextFromOpenText } from "./renderInlineRichTextFromOpenText-RvOG3QbI.js";
@@ -8,6 +8,7 @@ import { r as renderInlineRichTextFromOpenText } from "./renderInlineRichTextFro
8
8
  import { s as sanitizeLinkProps } from "./sanitizeLinkProps-D2Kkovy1.js";
9
9
  import styled from "styled-components";
10
10
  import { g as getButtonAppearance } from "./ButtonAppearanceHelper-D2SlSoU8.js";
11
+ import { v as viewport } from "./index-Ck2bCrhT.js";
11
12
  import { getBodySize } from "./foundations/token/getBodySize/index.js";
12
13
  import { getBorderRadius } from "./foundations/token/getBorderRadius/index.js";
13
14
  import { getBottomSpacing } from "./foundations/token/getBottomSpacing/index.js";
@@ -63,7 +64,10 @@ const ButtonAsLinkStyled = styled.span.withConfig({
63
64
  }, getBodySize(textBodyMd), ({
64
65
  width = "auto"
65
66
  }) => ({
66
- width: "full" === width ? "100%" : "fit-content"
67
+ width: "100%",
68
+ ...viewport.md({
69
+ width: "full" === width ? "100%" : "fit-content"
70
+ })
67
71
  }), ({
68
72
  appearance = primaryAppearance
69
73
  }) => getButtonAppearance(appearance), ({
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import styled from "styled-components";
3
+ import { a as filterProps } from "./filterProps-BWnAPYBL.js";
4
+ const screenreaderOnly = {
5
+ position: "absolute",
6
+ left: "-10000px",
7
+ top: "auto",
8
+ width: "1px",
9
+ height: "1px",
10
+ overflow: "hidden"
11
+ };
12
+ const ScreenReaderOnlyStyled = styled.span.withConfig({
13
+ shouldForwardProp: filterProps(),
14
+ displayName: "ScreenReaderOnlyStyled",
15
+ componentId: "sc-1r7az4k-0"
16
+ })(screenreaderOnly);
17
+ const ScreenreaderOnly = ({
18
+ children,
19
+ ...props
20
+ }) => /* @__PURE__ */ jsx(ScreenReaderOnlyStyled, { ...props, children });
21
+ export {
22
+ ScreenreaderOnly as S,
23
+ screenreaderOnly as s
24
+ };
@@ -0,0 +1,54 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { S as ScreenreaderOnly } from "./index-DSF1zGyd.js";
3
+ import styled from "styled-components";
4
+ import InlineLink from "./components/InlineLink/index.js";
5
+ import { getFontWeight } from "./foundations/token/getFontWeight/index.js";
6
+ import { getSpacing } from "./foundations/token/getSpacing/index.js";
7
+ import { e as spacing2Xs } from "./Spacing-BMQelJYr.js";
8
+ const FootnoteLinkStyled = styled(InlineLink).withConfig({
9
+ displayName: "FootnoteLinkStyled",
10
+ componentId: "sc-ydos3j-0"
11
+ })({
12
+ verticalAlign: "top",
13
+ fontSize: "0.7em",
14
+ fontWeight: getFontWeight("bold"),
15
+ textDecoration: "none",
16
+ display: "inline-block",
17
+ "& a": {
18
+ paddingLeft: getSpacing(spacing2Xs),
19
+ paddingRight: getSpacing(spacing2Xs),
20
+ verticalAlign: "baseline",
21
+ fontSize: "inherit"
22
+ }
23
+ });
24
+ const FootnoteLink = ({
25
+ uid,
26
+ contentUid,
27
+ screenReaderLabel,
28
+ children,
29
+ component: _component
30
+ }) => {
31
+ const onClick = (event) => {
32
+ const linkbackToContent = document.getElementById(`back-${contentUid}`);
33
+ if (!linkbackToContent) {
34
+ return;
35
+ }
36
+ linkbackToContent.setAttribute("href", `#${uid}`);
37
+ const details = linkbackToContent.closest("details");
38
+ if (details && null === details.getAttribute("open")) {
39
+ event.preventDefault();
40
+ details.setAttribute("open", "open");
41
+ setTimeout(() => {
42
+ event.target.click();
43
+ }, 15);
44
+ }
45
+ };
46
+ return /* @__PURE__ */ jsxs(FootnoteLinkStyled, { id: uid, href: `#${contentUid}`, onClick, children: [
47
+ children,
48
+ /* @__PURE__ */ jsx(ScreenreaderOnly, { children: screenReaderLabel })
49
+ ] });
50
+ };
51
+ export {
52
+ FootnoteLink as F,
53
+ FootnoteLinkStyled as a
54
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import ScreenreaderOnly from "./components/ScreenreaderOnly/index.js";
2
+ import { S as ScreenreaderOnly } from "./index-DSF1zGyd.js";
3
3
  import styled from "styled-components";
4
4
  import { getBottomSpacing } from "./foundations/token/getBottomSpacing/index.js";
5
5
  import { getFontWeight } from "./foundations/token/getFontWeight/index.js";