@vodafone_de/brix-components 7.0.9 → 7.0.10

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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { B as ButtonAsLink, g as getButtonIcon } from "../../index-hMlQuoyx.js";
3
+ import { B as ButtonAsLink, g as getButtonIcon } from "../../index-hNV7tcRV.js";
4
4
  import { r as renderInlineRichTextFromOpenText } from "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
5
5
  import { B as ButtonStyled } from "../../styled-C4eI47I1.js";
6
6
  const buttonFullWidth = "full";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "react/jsx-runtime";
3
- import { B } from "../../index-hMlQuoyx.js";
3
+ import { B } from "../../index-hNV7tcRV.js";
4
4
  import "../../hooks/useLinkComponent/index.js";
5
5
  import "../../filterProps-CBnuV0LI.js";
6
6
  import "../../renderInlineRichTextFromOpenText-RvOG3QbI.js";
@@ -45,9 +45,7 @@ const InlineLinkStyled = styled.span.withConfig({
45
45
  }
46
46
  });
47
47
  const InlineLink = (props) => {
48
- const {
49
- LinkComponent
50
- } = useLinkComponent();
48
+ const LinkComponent = useLinkComponent();
51
49
  return /* @__PURE__ */ jsx(InlineLinkStyled, { ...props, children: /* @__PURE__ */ jsx(LinkComponent, { ...filterPropsForUnstyledComponent(props), children: props.children }) });
52
50
  };
53
51
  export {
@@ -11,9 +11,7 @@ const Link = (props) => {
11
11
  if (isLinkAsButtonProp(props)) {
12
12
  return /* @__PURE__ */ jsx(LinkAsButton, { ...props, children: props.children });
13
13
  }
14
- const {
15
- LinkComponent
16
- } = useLinkComponent();
14
+ const LinkComponent = useLinkComponent();
17
15
  return /* @__PURE__ */ jsx(LinkStyled, { ...props, children: /* @__PURE__ */ jsxs(LinkComponent, { ...filterPropsForUnstyledComponent(props), children: [
18
16
  renderInlineRichTextFromOpenText(props.children),
19
17
  getLinkIcon(props.icon)
@@ -327,9 +327,7 @@ const LinkListItem = (props) => {
327
327
  if (isLinkListItemAsButtonProp(props)) {
328
328
  return /* @__PURE__ */ jsx(LinkListItemButtonStyled, { ...props, children: Item });
329
329
  }
330
- const {
331
- LinkComponent
332
- } = useLinkComponent();
330
+ const LinkComponent = useLinkComponent();
333
331
  return /* @__PURE__ */ jsx(LinkListItemAnchorStyled, { elevation, orientation, children: /* @__PURE__ */ jsx(LinkComponent, { ...filterPropsForUnstyledComponent(props), children: Item }) });
334
332
  };
335
333
  export {
@@ -1,11 +1,21 @@
1
- import { ComponentType } from 'react';
2
- import { ButtonAsLinkProps } from '../../components/ButtonAsLink';
3
- import { InlineLinkProps } from '../../components/InlineLink';
4
- import { LinkProps } from '../../components/Link';
5
- import { LinkListItemProps } from '../../components/LinkListItem';
6
- export type LinkComponentProps = LinkListItemProps | LinkProps | ButtonAsLinkProps | InlineLinkProps;
7
- export type LinkContextType = {
8
- LinkComponent: ComponentType<LinkComponentProps>;
9
- };
1
+ import { AnchorHTMLAttributes, ComponentType } from 'react';
2
+ /**
3
+ * Props of the link component.
4
+ */
5
+ export type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement>;
6
+ /**
7
+ * Type of the context.
8
+ */
9
+ export type LinkContextType = ComponentType<LinkComponentProps>;
10
+ /**
11
+ * Default link component using `<a>`.
12
+ */
13
+ export declare const DefaultLinkComponent: LinkContextType;
14
+ /**
15
+ * Context for providing a custom link component.
16
+ */
10
17
  export declare const LinkContext: import('react').Context<LinkContextType>;
18
+ /**
19
+ * Hook to access the current link component from context.
20
+ */
11
21
  export declare const useLinkComponent: () => LinkContextType;
@@ -1,11 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { createContext, useContext } from "react";
3
- const defaultContext = {
4
- LinkComponent: (props) => /* @__PURE__ */ jsx("a", { ...props })
5
- };
6
- const LinkContext = createContext(defaultContext);
3
+ const DefaultLinkComponent = (props) => /* @__PURE__ */ jsx("a", { ...props });
4
+ const LinkContext = createContext(DefaultLinkComponent);
7
5
  const useLinkComponent = () => useContext(LinkContext);
8
6
  export {
7
+ DefaultLinkComponent,
9
8
  LinkContext,
10
9
  useLinkComponent
11
10
  };
@@ -69,9 +69,7 @@ const ButtonAsLinkStyled = styled.span.withConfig({
69
69
  bottomSpacing
70
70
  }));
71
71
  const ButtonAsLink = (props) => {
72
- const {
73
- LinkComponent
74
- } = useLinkComponent();
72
+ const LinkComponent = useLinkComponent();
75
73
  return /* @__PURE__ */ jsx(ButtonAsLinkStyled, { ...props, children: /* @__PURE__ */ jsxs(LinkComponent, { ...filterPropsForUnstyledComponent(props), children: [
76
74
  renderInlineRichTextFromOpenText(props.children),
77
75
  getButtonIcon(props == null ? void 0 : props.icon)
package/dist/index.js CHANGED
@@ -67,7 +67,7 @@ import { default as default63 } from "./components/Checkbox/index.js";
67
67
  import { default as default64 } from "./components/Carousel/index.js";
68
68
  import { default as default65 } from "./components/Card/index.js";
69
69
  import { default as default66 } from "./components/ButtonGroup/index.js";
70
- import { B } from "./index-hMlQuoyx.js";
70
+ import { B } from "./index-hNV7tcRV.js";
71
71
  import { default as default67, buttonAutoWidth, buttonFullWidth } from "./components/Button/index.js";
72
72
  import { default as default68 } from "./components/BottomBar/index.js";
73
73
  import { default as default69, bodyAlignCenter, bodyAlignLeft, bodyAlignRight } from "./components/Body/index.js";
@@ -98,7 +98,7 @@ import { u } from "./index-Cs0Hw0dj.js";
98
98
  import { checkThirdPartyConsentStorage, consentStorageFeature, consentStorageItemName, consentStorageKey, useThirdPartyConsent } from "./hooks/useThirdPartyConsent/index.js";
99
99
  import { useReducedMotion } from "./hooks/useReducedMotion/index.js";
100
100
  import { useMediaQuery } from "./hooks/useMediaQuery/index.js";
101
- import { LinkContext, useLinkComponent } from "./hooks/useLinkComponent/index.js";
101
+ import { DefaultLinkComponent, LinkContext, useLinkComponent } from "./hooks/useLinkComponent/index.js";
102
102
  import { useForcedColors } from "./hooks/useForcedColors/index.js";
103
103
  import { useFocusWithin } from "./hooks/useFocusWithin/index.js";
104
104
  import { a as a4, i } from "./props-DDpgcryb.js";
@@ -127,6 +127,7 @@ export {
127
127
  default57 as Container,
128
128
  ContainerAppearanceColor,
129
129
  default56 as DateInput,
130
+ DefaultLinkComponent,
130
131
  default55 as DemoBox,
131
132
  default54 as Dialog,
132
133
  default53 as DiscoveryCard,
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.0.9",
4
+ "version": "7.0.10",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
7
7
  ".": {