@bonprix-ds/react-link-group 1.0.2 → 1.0.4

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/index.js CHANGED
@@ -1,46 +1,2 @@
1
- import "react";
2
- import { tv as e } from "tailwind-variants";
3
- import { tabStyleContainerBase as t, tabStyleContainerVariant as n, tabStyleLabelClass as r, tabStyleLabelContainerBase as i, tabStyleLabelContainerVariant as a, tabStyleList as o } from "@bonprix-ds/internal-components";
4
- import { jsx as s } from "react/jsx-runtime";
5
- //#region src/LinkGroup.tsx
6
- var c = e({ base: o }), l = ({ children: e }) => /* @__PURE__ */ s("nav", {
7
- "data-bpds": "link-group",
8
- className: "preflight",
9
- children: /* @__PURE__ */ s("ul", {
10
- className: c(),
11
- children: e
12
- })
13
- }), u = e({
14
- slots: {
15
- item: "flex",
16
- link: [t, n],
17
- linkLabel: [
18
- i,
19
- a,
20
- r
21
- ]
22
- },
23
- variants: { current: {
24
- true: { link: "after:border-b-4 after:h-1 after:border-current" },
25
- false: { link: "hover:after:border-b-2 hover:after:border-current" }
26
- } }
27
- });
28
- l.Item = ({ children: e, current: t = !1, component: n = "a", ...r }) => {
29
- let i = n, { link: a, item: o, linkLabel: c } = u({ current: t });
30
- return /* @__PURE__ */ s("li", {
31
- className: o(),
32
- children: /* @__PURE__ */ s(i, {
33
- className: a(),
34
- ...r,
35
- "aria-current": t ? "page" : void 0,
36
- children: /* @__PURE__ */ s("span", {
37
- className: c(),
38
- children: e
39
- })
40
- })
41
- });
42
- };
43
- //#endregion
44
- export { l as default };
45
-
46
- //# sourceMappingURL=index.js.map
1
+ import e from "./src/LinkGroup.js";
2
+ export { e as default };
@@ -0,0 +1,46 @@
1
+ import "react";
2
+ import { tv as e } from "tailwind-variants";
3
+ import { tabStyleContainerBase as t, tabStyleContainerVariant as n, tabStyleLabelClass as r, tabStyleLabelContainerBase as i, tabStyleLabelContainerVariant as a, tabStyleList as o } from "@bonprix-ds/internal-components";
4
+ import { jsx as s } from "react/jsx-runtime";
5
+ //#region src/LinkGroup.tsx
6
+ var c = e({ base: o }), l = ({ children: e }) => /* @__PURE__ */ s("nav", {
7
+ "data-bpds": "link-group",
8
+ className: "preflight",
9
+ children: /* @__PURE__ */ s("ul", {
10
+ className: c(),
11
+ children: e
12
+ })
13
+ }), u = e({
14
+ slots: {
15
+ item: "flex",
16
+ link: [t, n],
17
+ linkLabel: [
18
+ i,
19
+ a,
20
+ r
21
+ ]
22
+ },
23
+ variants: { current: {
24
+ true: { link: "after:h-1 after:border-b-4 after:border-current" },
25
+ false: { link: "hover:after:border-b-2 hover:after:border-current" }
26
+ } }
27
+ });
28
+ l.Item = ({ children: e, current: t = !1, component: n = "a", ...r }) => {
29
+ let i = n, { link: a, item: o, linkLabel: c } = u({ current: t });
30
+ return /* @__PURE__ */ s("li", {
31
+ className: o(),
32
+ children: /* @__PURE__ */ s(i, {
33
+ className: a(),
34
+ ...r,
35
+ "aria-current": t ? "page" : void 0,
36
+ children: /* @__PURE__ */ s("span", {
37
+ className: c(),
38
+ children: e
39
+ })
40
+ })
41
+ });
42
+ };
43
+ //#endregion
44
+ export { l as default };
45
+
46
+ //# sourceMappingURL=LinkGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkGroup.js","names":["generateListClasses","tv","tabStyleList","LinkGroup","generateLinkClasses","tabStyleContainerBase","tabStyleContainerVariant","tabStyleLabelContainerBase","tabStyleLabelContainerVariant","tabStyleLabelClass","props","Component","component","item","link","current","linkLabel"],"sources":["../../src/LinkGroup.tsx"],"sourcesContent":["import React, { ComponentProps, ElementType, ReactNode } from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport {\n tabStyleContainerBase,\n tabStyleContainerVariant,\n tabStyleLabelClass,\n tabStyleLabelContainerBase,\n tabStyleLabelContainerVariant,\n tabStyleList,\n} from \"@bonprix-ds/internal-components\";\n\nexport interface Props {\n /** The content of the LinkGroup. Only put `LinkGroup.Item`s inside. */\n children: ReactNode;\n}\n\nconst generateListClasses = tv({\n base: tabStyleList,\n});\n\nconst LinkGroup = ({ children }: Props) => {\n return (\n <nav data-bpds=\"link-group\" className=\"preflight\">\n <ul className={generateListClasses()}>{children}</ul>\n </nav>\n );\n};\n\n// The links in this component are used in a group on our page, so we exclude `rel` and `target` intentionally here.\nexport interface BaseItemProps {\n /** The content of the link. */\n children: string;\n /** Whether the link is the current page. Will be used to set the `aria-current` attribute. */\n current?: boolean;\n}\n\ntype ItemProps<C extends ElementType> = BaseItemProps & {\n /** The semantic component to render the LinkGroup.Item. Preferrably `\"a\"` or something like `Link` from NextJS. Native props will be passed to this component. */\n component?: C;\n} & Omit<ComponentProps<C>, keyof BaseItemProps | \"component\">;\n\nconst generateLinkClasses = tv({\n slots: {\n item: \"flex\",\n link: [tabStyleContainerBase, tabStyleContainerVariant],\n linkLabel: [tabStyleLabelContainerBase, tabStyleLabelContainerVariant, tabStyleLabelClass],\n },\n variants: {\n current: {\n true: {\n link: \"after:h-1 after:border-b-4 after:border-current\",\n },\n false: {\n link: \"hover:after:border-b-2 hover:after:border-current\",\n },\n },\n },\n});\n\nconst Item = <C extends ElementType>({ children, current = false, component = \"a\" as C, ...props }: ItemProps<C>) => {\n const Component: ElementType = component;\n const { link, item, linkLabel } = generateLinkClasses({ current });\n return (\n <li className={item()}>\n <Component className={link()} {...props} aria-current={current ? \"page\" : undefined}>\n <span className={linkLabel()}>{children}</span>\n </Component>\n </li>\n );\n};\n\nLinkGroup.Item = Item;\n\nexport default LinkGroup;\n"],"mappings":";;;;;AAiBA,IAAMA,IAAsBC,EAAG,EAC7B,MAAMC,EACR,CAAC,GAEKC,KAAa,EAAE,kBAEjB,kBAAC,OAAD;CAAK,aAAU;CAAa,WAAU;CACpC,UAAA,kBAAC,MAAD;EAAI,WAAWH,EAAoB;EAAI;CAAa,CAAA;AACjD,CAAA,GAiBHI,IAAsBH,EAAG;CAC7B,OAAO;EACL,MAAM;EACN,MAAM,CAACI,GAAuBC,CAAwB;EACtD,WAAW;GAACC;GAA4BC;GAA+BC;EAAkB;CAC3F;CACA,UAAU,EACR,SAAS;EACP,MAAM,EACJ,MAAM,kDACR;EACA,OAAO,EACL,MAAM,oDACR;CACF,EACF;AACF,CAAC;AAcD,EAAU,QAZ2B,EAAE,aAAU,aAAU,IAAO,eAAY,KAAU,GAAGC,QAA0B;CACnH,IAAMC,IAAyBC,GACzB,EAAE,SAAM,SAAM,iBAAcR,EAAoB,EAAE,WAAQ,CAAC;CACjE,OACE,kBAAC,MAAD;EAAI,WAAWS,EAAK;EAClB,UAAA,kBAACF,GAAD;GAAW,WAAWG,EAAK;GAAG,GAAIJ;GAAO,gBAAcK,IAAU,SAAS,KAAA;GACxE,UAAA,kBAAC,QAAD;IAAM,WAAWC,EAAU;IAAI;GAAe,CAAA;EACrC,CAAA;CACT,CAAA;AAER"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-link-group",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "LinkGroup component, implemented in React, for the Bonprix Design System.",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -32,17 +32,16 @@
32
32
  "provenance": true
33
33
  },
34
34
  "dependencies": {
35
- "@bonprix-ds/internal-components": "0.2.1"
35
+ "@bonprix-ds/internal-components": "0.2.3"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/react": "19.3.0",
39
- "@vitejs/plugin-react": "6.1.1",
40
- "rollup-preserve-directives": "1.1.3",
41
- "vite": "8.3.0"
39
+ "vite": "8.3.2",
40
+ "@bonprix-ds/vite-config": "0.0.0"
42
41
  },
43
42
  "peerDependencies": {
44
- "react": "^19.3.0",
45
- "react-dom": "^19.3.0",
43
+ "react": "^19",
44
+ "react-dom": "^19",
46
45
  "tailwind-variants": "0.3.1"
47
46
  },
48
47
  "scripts": {
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/LinkGroup.tsx"],"sourcesContent":["import React, { ComponentProps, ElementType, ReactNode } from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport {\n tabStyleContainerBase,\n tabStyleContainerVariant,\n tabStyleLabelClass,\n tabStyleLabelContainerBase,\n tabStyleLabelContainerVariant,\n tabStyleList,\n} from \"@bonprix-ds/internal-components\";\n\nexport interface Props {\n /** The content of the LinkGroup. Only put `LinkGroup.Item`s inside. */\n children: ReactNode;\n}\n\nconst generateListClasses = tv({\n base: tabStyleList,\n});\n\nconst LinkGroup = ({ children }: Props) => {\n return (\n <nav data-bpds=\"link-group\" className=\"preflight\">\n <ul className={generateListClasses()}>{children}</ul>\n </nav>\n );\n};\n\n// The links in this component are used in a group on our page, so we exclude `rel` and `target` intentionally here.\nexport interface BaseItemProps {\n /** The content of the link. */\n children: string;\n /** Whether the link is the current page. Will be used to set the `aria-current` attribute. */\n current?: boolean;\n}\n\ntype ItemProps<C extends ElementType> = BaseItemProps & {\n /** The semantic component to render the LinkGroup.Item. Preferrably `\"a\"` or something like `Link` from NextJS. Native props will be passed to this component. */\n component?: C;\n} & Omit<ComponentProps<C>, keyof BaseItemProps | \"component\">;\n\nconst generateLinkClasses = tv({\n slots: {\n item: \"flex\",\n link: [tabStyleContainerBase, tabStyleContainerVariant],\n linkLabel: [tabStyleLabelContainerBase, tabStyleLabelContainerVariant, tabStyleLabelClass],\n },\n variants: {\n current: {\n true: {\n link: \"after:border-b-4 after:h-1 after:border-current\",\n },\n false: {\n link: \"hover:after:border-b-2 hover:after:border-current\",\n },\n },\n },\n});\n\nconst Item = <C extends ElementType>({ children, current = false, component = \"a\" as C, ...props }: ItemProps<C>) => {\n const Component: ElementType = component;\n const { link, item, linkLabel } = generateLinkClasses({ current });\n return (\n <li className={item()}>\n <Component className={link()} {...props} aria-current={current ? \"page\" : undefined}>\n <span className={linkLabel()}>{children}</span>\n </Component>\n </li>\n );\n};\n\nLinkGroup.Item = Item;\n\nexport default LinkGroup;\n"],"mappings":";;;;;AAiBA,IAAM,IAAsB,EAAG,EAC7B,MAAM,EACR,CAAC,GAEK,KAAa,EAAE,kBAEjB,kBAAC,OAAD;CAAK,aAAU;CAAa,WAAU;CACpC,UAAA,kBAAC,MAAD;EAAI,WAAW,EAAoB;EAAI;CAAa,CAAA;AACjD,CAAA,GAiBH,IAAsB,EAAG;CAC7B,OAAO;EACL,MAAM;EACN,MAAM,CAAC,GAAuB,CAAwB;EACtD,WAAW;GAAC;GAA4B;GAA+B;EAAkB;CAC3F;CACA,UAAU,EACR,SAAS;EACP,MAAM,EACJ,MAAM,kDACR;EACA,OAAO,EACL,MAAM,oDACR;CACF,EACF;AACF,CAAC;AAcD,EAAU,QAZ2B,EAAE,aAAU,aAAU,IAAO,eAAY,KAAU,GAAG,QAA0B;CACnH,IAAM,IAAyB,GACzB,EAAE,SAAM,SAAM,iBAAc,EAAoB,EAAE,WAAQ,CAAC;CACjE,OACE,kBAAC,MAAD;EAAI,WAAW,EAAK;EAClB,UAAA,kBAAC,GAAD;GAAW,WAAW,EAAK;GAAG,GAAI;GAAO,gBAAc,IAAU,SAAS,KAAA;GACxE,UAAA,kBAAC,QAAD;IAAM,WAAW,EAAU;IAAI;GAAe,CAAA;EACrC,CAAA;CACT,CAAA;AAER"}