@vodafone_de/brix-components 7.1.5 → 7.1.6

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.
@@ -19,7 +19,7 @@ import "../../index-B2VrT4fo.js";
19
19
  import "../FootnoteLink/index.js";
20
20
  import "../../styled-VAsSnb5y.js";
21
21
  import "../../styled-q7r_5eaz.js";
22
- import { a as LinkStyled } from "../../index-C69FNo1a.js";
22
+ import { a as LinkStyled } from "../../index-M27FMM9r.js";
23
23
  import "../../hooks/useLinkComponent/index.js";
24
24
  import "../InlineLink/index.js";
25
25
  import "../../styled-DJWrbsIZ.js";
@@ -4,7 +4,7 @@ import styled from "styled-components";
4
4
  import DiscoveryCard, { discoveryCardOrientationVertical } from "../DiscoveryCard/index.js";
5
5
  import Grid from "../Grid/index.js";
6
6
  import GridItem from "../GridItem/index.js";
7
- import { a as LinkStyled } from "../../index-C69FNo1a.js";
7
+ import { a as LinkStyled } from "../../index-M27FMM9r.js";
8
8
  import { getSpacing } from "../../foundations/token/getSpacing/index.js";
9
9
  import { a as spacingMd } from "../../Spacing-BMQelJYr.js";
10
10
  const DiscoveryCardGroupGridStyled = styled(Grid).withConfig({
@@ -13,13 +13,12 @@ const FootnoteLinkStyled = styled(InlineLink).withConfig({
13
13
  verticalAlign: "top",
14
14
  fontSize: "0.7em",
15
15
  fontWeight: getFontWeight("bold"),
16
- paddingLeft: getSpacing(spacing2Xs),
17
- paddingRight: getSpacing(spacing2Xs),
18
16
  textDecoration: "none",
19
17
  display: "inline-block",
20
18
  "& a": {
21
19
  textDecoration: "underline",
22
- padding: 0,
20
+ paddingLeft: getSpacing(spacing2Xs),
21
+ paddingRight: getSpacing(spacing2Xs),
23
22
  verticalAlign: "baseline",
24
23
  fontSize: "inherit"
25
24
  }
@@ -1,3 +1,3 @@
1
1
  import { ReactNode } from 'react';
2
- import { default as PositionedIconInterface } from '../../foundations/types/PositionedIconInterface';
3
- export declare const getLinkIcon: (icon: PositionedIconInterface) => ReactNode;
2
+ import { LinkProps } from './props';
3
+ export declare const getLinkIcon: (icon: LinkProps["icon"], iconPosition: LinkProps["iconPosition"]) => ReactNode;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { L as LinkAsButton, a as LinkStyled, g as getLinkIcon } from "../../index-C69FNo1a.js";
3
+ import { L as LinkAsButton, p as primaryAppearance, a as LinkStyled, g as getLinkIcon } from "../../index-M27FMM9r.js";
4
4
  import { useLinkComponent } from "../../hooks/useLinkComponent/index.js";
5
5
  import { f as filterPropsForUnstyledComponent } from "../../filterProps-CTn92eZw.js";
6
6
  import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
@@ -11,15 +11,16 @@ const isLinkAsButtonProp = (props) => {
11
11
  const Link = ({
12
12
  className,
13
13
  bottomSpacing,
14
+ appearance = primaryAppearance,
14
15
  ...props
15
16
  }) => {
16
17
  if (isLinkAsButtonProp(props)) {
17
- return /* @__PURE__ */ jsx(LinkAsButton, { className, bottomSpacing, ...props, children: props.children });
18
+ return /* @__PURE__ */ jsx(LinkAsButton, { className, bottomSpacing, appearance, ...props, children: props.children });
18
19
  }
19
20
  const LinkComponent = useLinkComponent();
20
- return /* @__PURE__ */ jsx(LinkStyled, { className, bottomSpacing, children: /* @__PURE__ */ jsxs(LinkComponent, { ...sanitizeLinkProps(filterPropsForUnstyledComponent(props)), children: [
21
+ return /* @__PURE__ */ jsx(LinkStyled, { className, bottomSpacing, appearance, children: /* @__PURE__ */ jsxs(LinkComponent, { ...sanitizeLinkProps(filterPropsForUnstyledComponent(props)), children: [
21
22
  renderInlineRichTextFromOpenText(props.children),
22
- getLinkIcon(props.icon)
23
+ getLinkIcon(props.icon, props.iconPosition)
23
24
  ] }) });
24
25
  };
25
26
  export {
@@ -1,17 +1,29 @@
1
+ import { IconName } from '@vfde-react/inline-icon-library/IconName';
1
2
  import { AnchorHTMLAttributes, ReactNode } from 'react';
2
3
  import { PatternProps } from '../../foundations/PatternProps';
3
- import { default as PositionedIconInterface } from '../../foundations/types/PositionedIconInterface';
4
- export interface LinkedSharedProps {
4
+ import { primaryAppearance, secondaryAppearance } from '../../foundations/types/Appearance';
5
+ import { leftPosition, rightPosition } from '../../foundations/types/PositionType';
6
+ export type LinkAppearance = typeof primaryAppearance | typeof secondaryAppearance;
7
+ export type LinkIconPosition = typeof leftPosition | typeof rightPosition;
8
+ export interface LinkSharedProps {
5
9
  /**
6
- * icon object contain name and position, object is optional and name and position is mandatory.
10
+ * Name of the icon to be used
7
11
  */
8
- icon: PositionedIconInterface;
12
+ icon: IconName;
13
+ /**
14
+ * Position of the icon in relation to text
15
+ */
16
+ iconPosition: LinkIconPosition;
17
+ /**
18
+ * Different appearances for emphasis
19
+ */
20
+ appearance?: LinkAppearance;
9
21
  /**
10
22
  * Pin component's name from string to the concrete name
11
23
  */
12
24
  component?: 'Link' | 'LinkAsButton';
13
25
  }
14
- export interface LinkProps extends LinkedSharedProps, PatternProps, AnchorHTMLAttributes<HTMLAnchorElement> {
26
+ export interface LinkProps extends LinkSharedProps, PatternProps, AnchorHTMLAttributes<HTMLAnchorElement> {
15
27
  /**
16
28
  * Link has mandatory children
17
29
  */
@@ -21,8 +33,8 @@ export interface LinkProps extends LinkedSharedProps, PatternProps, AnchorHTMLAt
21
33
  */
22
34
  component?: 'Link';
23
35
  /**
24
- * As long as href is given, this pattern is rendered as a link and
25
- * if it is left out, then a button is rendered
36
+ * As long as href is given, this pattern is rendered as an <a> and
37
+ * if it is left out, then a <button> is rendered
26
38
  */
27
39
  href: string;
28
40
  }
@@ -1,4 +1,4 @@
1
1
  import { CSSObject } from 'styled-components';
2
- import { LinkProps } from './props';
3
- export declare const linkBaseCssObject: CSSObject;
4
- export declare const LinkStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<LinkProps, "bottomSpacing">>> & string;
2
+ import { LinkProps, LinkSharedProps } from './props';
3
+ export declare const getLinkStyles: (appearance: LinkSharedProps["appearance"]) => CSSObject;
4
+ export declare const LinkStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<LinkProps, "appearance" | "bottomSpacing">>> & string;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "react/jsx-runtime";
3
- import { L } from "../../index-C69FNo1a.js";
3
+ import { L } from "../../index-M27FMM9r.js";
4
4
  import "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
5
5
  export {
6
6
  L as default
@@ -1,7 +1,7 @@
1
1
  import { ButtonHTMLAttributes, ReactNode } from 'react';
2
- import { LinkedSharedProps } from '../Link/props';
2
+ import { LinkSharedProps } from '../Link/props';
3
3
  import { PatternProps } from '../../foundations/PatternProps';
4
- export interface LinkAsButtonProps extends LinkedSharedProps, PatternProps, ButtonHTMLAttributes<HTMLButtonElement> {
4
+ export interface LinkAsButtonProps extends LinkSharedProps, PatternProps, ButtonHTMLAttributes<HTMLButtonElement> {
5
5
  /**
6
6
  * Pin component's name from string to the concrete name
7
7
  */
@@ -5,7 +5,7 @@ import { u as ulTagName, l as liTagName } from "../../tags-38kBhOn6.js";
5
5
  import { s as spacingNone } from "../../Spacing-BMQelJYr.js";
6
6
  import { L as LinkListStyled, b as LinkListLiStyled, l as linkListVariantRow } from "../../styled-BlHKbHF4.js";
7
7
  import { a } from "../../styled-BlHKbHF4.js";
8
- import { l as linkListItemVariantVertical, a as linkListItemVariantHorizontal } from "../../styled-BM1Yo9eD.js";
8
+ import { l as linkListItemVariantVertical, a as linkListItemVariantHorizontal } from "../../styled-SllFJc7o.js";
9
9
  const LinkList = ({
10
10
  items,
11
11
  variant,
@@ -10,8 +10,8 @@ import { s as spacingNone } from "../../Spacing-BMQelJYr.js";
10
10
  import { useLinkComponent } from "../../hooks/useLinkComponent/index.js";
11
11
  import { f as filterPropsForUnstyledComponent } from "../../filterProps-CTn92eZw.js";
12
12
  import { s as sanitizeLinkProps } from "../../sanitizeLinkProps-D2Kkovy1.js";
13
- import { L as LinkListItemElevatedStyled, b as LinkListItemStyled, c as LinkListItemButtonStyled, d as LinkListItemAnchorStyled, e as LinkListItemContentWrapperStyled, a as linkListItemVariantHorizontal, f as LinkListItemContentStyled, g as LinkListItemLabelWrapperStyled, h as LinkListItemVerticalContentStyled, i as LinkListItemChevronStyled, j as LinkListLabelStyled, k as LinkListSuffixStyled } from "../../styled-BM1Yo9eD.js";
14
- import { l } from "../../styled-BM1Yo9eD.js";
13
+ import { L as LinkListItemElevatedStyled, b as LinkListItemStyled, c as LinkListItemButtonStyled, d as LinkListItemAnchorStyled, e as LinkListItemContentWrapperStyled, a as linkListItemVariantHorizontal, f as LinkListItemContentStyled, g as LinkListItemLabelWrapperStyled, h as LinkListItemVerticalContentStyled, i as LinkListItemChevronStyled, j as LinkListLabelStyled, k as LinkListSuffixStyled } from "../../styled-SllFJc7o.js";
14
+ import { l } from "../../styled-SllFJc7o.js";
15
15
  const isLinkListItemAsButtonProp = (props) => {
16
16
  return props.href === void 0;
17
17
  };
@@ -14,7 +14,7 @@ import "../NotificationErrorIcon-DMnAJgPN.js";
14
14
  import "../styled-RnVr222F.js";
15
15
  import "../styled-B-_SmQSA.js";
16
16
  import "../hooks/useLinkComponent/index.js";
17
- import "../styled-BM1Yo9eD.js";
17
+ import "../styled-SllFJc7o.js";
18
18
  import "../styled-BlHKbHF4.js";
19
19
  import "../styled-DOK4C5Ml.js";
20
20
  import "../styled-D8a-ap4J.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-wTK3ndvI.js";
4
+ import { L } from "../../mapContentToComponents-BobPnbKM.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-wTK3ndvI.js";
4
+ import { m as mapContentToComponents } from "../../mapContentToComponents-BobPnbKM.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-wTK3ndvI.js";
4
+ import { m as mapContentToComponents } from "../../mapContentToComponents-BobPnbKM.js";
5
5
  const Renderer = ({
6
6
  content,
7
7
  isDraftMode
@@ -0,0 +1,6 @@
1
+ export declare const primaryAppearance = "primary";
2
+ export declare const secondaryAppearance = "secondary";
3
+ export declare const tertiaryAppearance = "tertiary";
4
+ export declare const successAppearance = "success";
5
+ type AppearanceType = typeof primaryAppearance | typeof secondaryAppearance | typeof tertiaryAppearance | typeof successAppearance;
6
+ export default AppearanceType;
@@ -16,46 +16,51 @@ import { getTextColor } from "./foundations/token/getTextColor/index.js";
16
16
  import { c as colorBorderFocus } from "./BorderColor-CYdSW9dg.js";
17
17
  import { a as borderWidthFocus } from "./BorderWidth-eg_mz82k.js";
18
18
  import { t as textBodyMd } from "./TextBodySize-BcZR9mh2.js";
19
- import { f as colorTextBrand } from "./TextColor-DsntmDNw.js";
20
- const getLinkIcon = (icon) => /* @__PURE__ */ jsx(ButtonIconStyled, { name: icon.name, iconPosition: icon.position, size: iconSizeSm });
21
- const linkBaseCssObject = {
22
- ...forcedColors({
23
- color: "LinkText"
24
- }),
25
- display: "flex",
26
- width: "fit-content",
27
- flexWrap: "nowrap",
28
- alignItems: "center",
29
- justifyContent: "center",
30
- cursor: "pointer",
31
- gap: `${getSpacing(spacingNone)} ${getSpacing(spacingXs)}`,
32
- ...getBodySize(textBodyMd),
33
- "&:focus-within": {
19
+ import { f as colorTextBrand, a as colorTextNeutral } from "./TextColor-DsntmDNw.js";
20
+ const getLinkIcon = (icon, iconPosition) => /* @__PURE__ */ jsx(ButtonIconStyled, { name: icon, iconPosition, size: iconSizeSm });
21
+ const primaryAppearance = "primary";
22
+ const getLinkStyles = (appearance) => {
23
+ return {
34
24
  ...forcedColors({
35
- outline: `${getBorderWidth(borderWidthFocus)} solid CanvasText`
25
+ color: "LinkText"
36
26
  }),
37
- boxShadow: `${getBorderColor(colorBorderFocus)} 0px 0px 0px ${getBorderWidth(borderWidthFocus)}`,
38
- outline: "none",
39
- textDecoration: "underline"
40
- },
41
- color: getTextColor(colorTextBrand),
42
- "&:visited": {
43
- ...forcedColors({
44
- color: "VisitedText"
45
- }),
46
- color: getTextColor(colorTextBrand)
47
- },
48
- background: "transparent",
49
- textDecoration: "none",
50
- "&:hover": {
51
- textDecoration: "underline"
52
- }
27
+ display: "flex",
28
+ width: "fit-content",
29
+ flexWrap: "nowrap",
30
+ alignItems: "center",
31
+ justifyContent: "center",
32
+ cursor: "pointer",
33
+ gap: `${getSpacing(spacingNone)} ${getSpacing(spacingXs)}`,
34
+ ...getBodySize(textBodyMd),
35
+ "&:focus-within": {
36
+ ...forcedColors({
37
+ outline: `${getBorderWidth(borderWidthFocus)} solid CanvasText`
38
+ }),
39
+ boxShadow: `${getBorderColor(colorBorderFocus)} 0px 0px 0px ${getBorderWidth(borderWidthFocus)}`,
40
+ outline: "none",
41
+ textDecoration: "underline"
42
+ },
43
+ color: appearance === primaryAppearance ? getTextColor(colorTextBrand) : getTextColor(colorTextNeutral),
44
+ "&:visited": {
45
+ ...forcedColors({
46
+ color: "VisitedText"
47
+ }),
48
+ color: appearance === primaryAppearance ? getTextColor(colorTextBrand) : getTextColor(colorTextNeutral)
49
+ },
50
+ background: "transparent",
51
+ textDecoration: "none",
52
+ "&:hover": {
53
+ textDecoration: "underline"
54
+ }
55
+ };
53
56
  };
54
57
  const LinkStyled = styled.span.withConfig({
55
58
  shouldForwardProp: filterProps(["href"]),
56
59
  displayName: "LinkStyled",
57
60
  componentId: "sc-1eekm6o-0"
58
- })(linkBaseCssObject, {
61
+ })(({
62
+ appearance = primaryAppearance
63
+ }) => getLinkStyles(appearance), {
59
64
  "& a": {
60
65
  color: "inherit",
61
66
  display: "flex",
@@ -74,17 +79,20 @@ const LinkAsButtonStyled = styled.button.withConfig({
74
79
  shouldForwardProp: filterProps(),
75
80
  displayName: "LinkAsButtonStyled",
76
81
  componentId: "sc-d0hr7z-0"
77
- })(linkBaseCssObject, ({
82
+ })(({
83
+ appearance = primaryAppearance
84
+ }) => getLinkStyles(appearance), ({
78
85
  bottomSpacing = spacingMd
79
86
  }) => getBottomSpacing({
80
87
  bottomSpacing
81
88
  }));
82
89
  const LinkAsButton = (props) => /* @__PURE__ */ jsxs(LinkAsButtonStyled, { ...props, children: [
83
90
  renderInlineRichTextFromOpenText(props.children),
84
- getLinkIcon(props.icon)
91
+ getLinkIcon(props.icon, props.iconPosition)
85
92
  ] });
86
93
  export {
87
94
  LinkAsButton as L,
88
95
  LinkStyled as a,
89
- getLinkIcon as g
96
+ getLinkIcon as g,
97
+ primaryAppearance as p
90
98
  };
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import { default as default24 } from "./components/LocalStyle/index.js";
27
27
  import { default as default25 } from "./components/LoadingSpinner/index.js";
28
28
  import { default as default26 } from "./components/LinkListItem/index.js";
29
29
  import { default as default27 } from "./components/LinkList/index.js";
30
- import { L } from "./index-C69FNo1a.js";
30
+ import { L } from "./index-M27FMM9r.js";
31
31
  import { default as default28 } from "./components/Link/index.js";
32
32
  import { default as default29 } from "./components/Legend/index.js";
33
33
  import { default as default30 } from "./components/Label/index.js";
@@ -110,9 +110,9 @@ import { useForcedColors } from "./hooks/useForcedColors/index.js";
110
110
  import { useFocusWithin } from "./hooks/useFocusWithin/index.js";
111
111
  import "react/jsx-runtime";
112
112
  import "@contentful/live-preview/react";
113
- import { L as L2 } from "./mapContentToComponents-wTK3ndvI.js";
113
+ import { L as L2 } from "./mapContentToComponents-BobPnbKM.js";
114
114
  import { a as a4, l as l2 } from "./styled-BlHKbHF4.js";
115
- import { a as a5, l as l3 } from "./styled-BM1Yo9eD.js";
115
+ import { a as a5, l as l3 } from "./styled-SllFJc7o.js";
116
116
  import { a as a6, i as i2 } from "./props-DDpgcryb.js";
117
117
  import { I as I2, f as f2, i as i3, g as g2, h, j, d as d2, c as c2, b as b2, e as e2, a as a7, k, l as l4 } from "./props-7dcsjRUx.js";
118
118
  import { I as I3 } from "./styled-RnVr222F.js";
@@ -21,7 +21,7 @@ import "react";
21
21
  import "./styled-Djetw1lK.js";
22
22
  import "./styled-VAsSnb5y.js";
23
23
  import "./hooks/useLinkComponent/index.js";
24
- import { l as linkListItemVariantVertical, a as linkListItemVariantHorizontal } from "./styled-BM1Yo9eD.js";
24
+ import { l as linkListItemVariantVertical, a as linkListItemVariantHorizontal } from "./styled-SllFJc7o.js";
25
25
  import { l as linkListVariantRow, a as linkListVariantColumn } from "./styled-BlHKbHF4.js";
26
26
  import "./styled-DOK4C5Ml.js";
27
27
  import "./styled-D8a-ap4J.js";
@@ -240,7 +240,8 @@ const LinkListItemVerticalContentStyled = styled.span.withConfig({
240
240
  gap: getSpacing(spacingXs),
241
241
  display: "flex",
242
242
  flexDirection: "column",
243
- flexShrink: 1
243
+ flexShrink: 1,
244
+ minWidth: 0
244
245
  });
245
246
  const LinkListItemLabelWrapperStyled = styled.span.withConfig({
246
247
  shouldForwardProp: filterProps(),
@@ -258,7 +259,10 @@ const LinkListLabelStyled = styled.span.withConfig({
258
259
  displayName: "LinkListLabelStyled",
259
260
  componentId: "sc-1dmfu9f-8"
260
261
  })(getHeadingSize(textHeadingXs), {
261
- textAlign: "left"
262
+ textAlign: "left",
263
+ overflowWrap: "break-word",
264
+ hyphens: "auto",
265
+ maxWidth: "100%"
262
266
  });
263
267
  const LinkListSuffixStyled = styled(Body).withConfig({
264
268
  displayName: "LinkListSuffixStyled",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vodafone_de/brix-components",
3
3
  "description": "Brix is the digital design system for vodafone.de",
4
- "version": "7.1.5",
4
+ "version": "7.1.6",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
7
7
  ".": {