@bonprix-ds/react-pagination 1.1.11 → 1.1.13

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,3 +1,3 @@
1
- import { calculateItems as e } from "./src/utils.js";
2
- import t from "./src/Pagination.js";
3
- export { e as calculateItems, t as default };
1
+ import e from "./src/Pagination.js";
2
+ import { calculateItems as t } from "./src/utils.js";
3
+ export { t as calculateItems, e as default };
@@ -6,7 +6,7 @@ import "react";
6
6
  import { tv as r } from "tailwind-variants";
7
7
  import { useBreakpointUp as i } from "@bonprix-ds/utils";
8
8
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
9
- //#region src/Pagination.tsx
9
+ // src/Pagination.tsx
10
10
  var s = r({
11
11
  base: "preflight flex items-center justify-center gap-2",
12
12
  slots: {
@@ -54,7 +54,6 @@ var s = r({
54
54
  className: "typography-button inline-block w-8 text-center text-clr-on-bg-high",
55
55
  children: "…"
56
56
  });
57
- //#endregion
58
57
  export { c as default };
59
58
 
60
59
  //# sourceMappingURL=Pagination.js.map
@@ -2,7 +2,7 @@ import "react";
2
2
  import e from "@bonprix-ds/react-icon-button";
3
3
  import { ArrowLeftIcon as t, ArrowRightIcon as n } from "@bonprix-ds/react-icon/icons";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
- //#region src/PaginationArrow.tsx
5
+ // src/PaginationArrow.tsx
6
6
  var i = ({ position: i = "left", href: a, onClick: o, disabled: s = !1 }) => s ? /* @__PURE__ */ r("div", { className: "h-8 w-8" }) : /* @__PURE__ */ r(e, {
7
7
  component: "a",
8
8
  href: a,
@@ -12,7 +12,6 @@ var i = ({ position: i = "left", href: a, onClick: o, disabled: s = !1 }) => s ?
12
12
  label: i === "left" ? "vorherige Seite" : "nächste Seite",
13
13
  icon: r(i === "left" ? t : n, {})
14
14
  });
15
- //#endregion
16
15
  export { i as default };
17
16
 
18
17
  //# sourceMappingURL=PaginationArrow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationArrow.js","names":["IconButton","PaginationArrow","disabled","event","onClick","position","jsx","ArrowLeftIcon","ArrowRightIcon"],"sources":["../../src/PaginationArrow.tsx"],"sourcesContent":["import React from \"react\";\n\nimport IconButton from \"@bonprix-ds/react-icon-button\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"@bonprix-ds/react-icon/icons\";\n\nexport interface PaginationArrowProps {\n position: \"left\" | \"right\";\n onClick: () => void;\n href: string;\n disabled?: boolean;\n}\n\nconst PaginationArrow = ({ position = \"left\", href, onClick, disabled = false }: PaginationArrowProps) => {\n const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {\n event.preventDefault();\n onClick();\n };\n\n if (disabled) {\n return <div className=\"h-8 w-8\"></div>;\n }\n\n const previousPageLabel = \"vorherige Seite\";\n const nextPageLabel = \"nächste Seite\";\n const label = position === \"left\" ? previousPageLabel : nextPageLabel;\n const icon = position === \"left\" ? <ArrowLeftIcon /> : <ArrowRightIcon />;\n\n return <IconButton component=\"a\" href={href} onClick={handleClick} label={label} icon={icon} />;\n};\n\nexport default PaginationArrow;\n"],"mappings":";;;;;AAYA,IAAMC,KAAmB,EAAE,cAAW,QAAQ,SAAM,YAAS,cAAW,SAMlEC,IACK,kBAAC,OAAD,EAAK,WAAU,UAAe,CAAA,IAQhC,kBAACF,GAAD;CAAY,WAAU;CAAU;CAAM,UAdxB,MAA+C;EAElE,AADAG,EAAM,eAAe,GACrBC,EAAQ;CACV;CAW0E,OAH5DC,MAAa,SAAS,oBAAoB;CAG+B,MAFpDC,EAAtBD,MAAa,SAAUE,IAAoBC,GAArB,CAAgB,CAAqB;AAEsB,CAAA"}
1
+ {"version":3,"file":"PaginationArrow.js","names":["IconButton","PaginationArrow","disabled","event","onClick","position","jsx","ArrowLeftIcon","ArrowRightIcon"],"sources":["../../src/PaginationArrow.tsx"],"sourcesContent":["import React, { MouseEvent } from \"react\";\n\nimport IconButton from \"@bonprix-ds/react-icon-button\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"@bonprix-ds/react-icon/icons\";\n\nexport interface PaginationArrowProps {\n position: \"left\" | \"right\";\n onClick: () => void;\n href: string;\n disabled?: boolean;\n}\n\nconst PaginationArrow = ({ position = \"left\", href, onClick, disabled = false }: PaginationArrowProps) => {\n const handleClick = (event: MouseEvent<HTMLAnchorElement>) => {\n event.preventDefault();\n onClick();\n };\n\n if (disabled) {\n return <div className=\"h-8 w-8\"></div>;\n }\n\n const previousPageLabel = \"vorherige Seite\";\n const nextPageLabel = \"nächste Seite\";\n const label = position === \"left\" ? previousPageLabel : nextPageLabel;\n const icon = position === \"left\" ? <ArrowLeftIcon /> : <ArrowRightIcon />;\n\n return <IconButton component=\"a\" href={href} onClick={handleClick} label={label} icon={icon} />;\n};\n\nexport default PaginationArrow;\n"],"mappings":";;;;;AAYA,IAAMC,KAAmB,EAAE,cAAW,QAAQ,SAAM,YAAS,cAAW,SAMlEC,IACK,kBAAC,OAAD,EAAK,WAAU,UAAe,CAAA,IAQhC,kBAACF,GAAD;CAAY,WAAU;CAAU;CAAM,UAdxB,MAAyC;EAE5D,AADAG,EAAM,eAAe,GACrBC,EAAQ;CACV;CAW0E,OAH5DC,MAAa,SAAS,oBAAoB;CAG+B,MAFpDC,EAAtBD,MAAa,SAAUE,IAAoBC,GAArB,CAAgB,CAAqB;AAEsB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import "react";
2
2
  import { tv as e } from "tailwind-variants";
3
3
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
- //#region src/PaginationItem.tsx
4
+ // src/PaginationItem.tsx
5
5
  var r = e({
6
6
  base: "preflight typography-button group relative inline-block w-8 text-center align-middle leading-8 text-clr-on-bg-high",
7
7
  slots: { indicator: "absolute bottom-0 start-0 w-full bg-clr-primary" },
@@ -27,7 +27,6 @@ var r = e({
27
27
  children: [e, /* @__PURE__ */ t("span", { className: d() })]
28
28
  });
29
29
  };
30
- //#endregion
31
30
  export { i as default };
32
31
 
33
32
  //# sourceMappingURL=PaginationItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationItem.js","names":["generateClasses","tv","PaginationItem","props","otherProps","Component","component","handleClick","event","onClick","base","current","pageNumber","indicator"],"sources":["../../src/PaginationItem.tsx"],"sourcesContent":["import React, { ComponentProps, ElementType } from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nconst generateClasses = tv({\n base: \"preflight typography-button group relative inline-block w-8 text-center align-middle leading-8 text-clr-on-bg-high\",\n slots: {\n indicator: \"absolute bottom-0 start-0 w-full bg-clr-primary\",\n },\n variants: {\n current: {\n true: {\n indicator: \"h-1\",\n base: \"outline-none\",\n },\n false: {\n base: \"outline-2 outline-offset-2 outline-clr-on-bg-high focus-visible:rounded-sm focus-visible:outline\",\n indicator: \"group-hover:h-[0.0625rem] group-focus:group-hover:h-0\",\n },\n },\n },\n});\n\ninterface BaseProps {\n pageNumber: number;\n current?: boolean;\n}\n\ntype Props<C extends ElementType> = BaseProps & {\n component?: C;\n} & Omit<ComponentProps<C>, keyof BaseProps | \"component\">;\n\nconst PaginationItem = <C extends ElementType>({ pageNumber, current = false, component = \"a\" as C, ...props }: Props<C>) => {\n const { onClick, ...otherProps } = props;\n const Component: ElementType = component;\n const { base, indicator } = generateClasses({ current });\n const handleClick = (event: React.MouseEvent) => {\n event.preventDefault();\n // oxlint-disable-next-line @typescript-eslint/no-unsafe-call\n onClick?.();\n };\n\n return (\n <Component {...otherProps} className={base()} onClick={handleClick} aria-current={current ? \"page\" : undefined}>\n {pageNumber}\n <span className={indicator()}></span>\n </Component>\n );\n};\n\nexport default PaginationItem;\n"],"mappings":";;;;AAGA,IAAMA,IAAkBC,EAAG;CACzB,MAAM;CACN,OAAO,EACL,WAAW,kDACb;CACA,UAAU,EACR,SAAS;EACP,MAAM;GACJ,WAAW;GACX,MAAM;EACR;EACA,OAAO;GACL,MAAM;GACN,WAAW;EACb;CACF,EACF;AACF,CAAC,GAWKC,KAAyC,EAAE,eAAY,aAAU,IAAO,eAAY,KAAU,GAAGC,QAAsB;CAC3H,IAAM,EAAE,YAAS,GAAGC,MAAeD,GAC7BE,IAAyBC,GACzB,EAAE,SAAM,iBAAcN,EAAgB,EAAE,WAAQ,CAAC,GACjDO,KAAe,MAA4B;EAG/C,AAFAC,EAAM,eAAe,GAErBC,IAAU;CACZ;CAEA,OACE,kBAACJ,GAAD;EAAW,GAAID;EAAY,WAAWM,EAAK;EAAG,SAASH;EAAa,gBAAcI,IAAU,SAAS,KAAA;EAArG,UAAA,CACGC,GACD,kBAAC,QAAD,EAAM,WAAWC,EAAU,EAAS,CAAA,CAC3B;;AAEf"}
1
+ {"version":3,"file":"PaginationItem.js","names":["generateClasses","tv","PaginationItem","props","otherProps","Component","component","handleClick","event","onClick","base","current","pageNumber","indicator"],"sources":["../../src/PaginationItem.tsx"],"sourcesContent":["import React, { ComponentProps, ElementType, MouseEvent } from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nconst generateClasses = tv({\n base: \"preflight typography-button group relative inline-block w-8 text-center align-middle leading-8 text-clr-on-bg-high\",\n slots: {\n indicator: \"absolute bottom-0 start-0 w-full bg-clr-primary\",\n },\n variants: {\n current: {\n true: {\n indicator: \"h-1\",\n base: \"outline-none\",\n },\n false: {\n base: \"outline-2 outline-offset-2 outline-clr-on-bg-high focus-visible:rounded-sm focus-visible:outline\",\n indicator: \"group-hover:h-[0.0625rem] group-focus:group-hover:h-0\",\n },\n },\n },\n});\n\ninterface BaseProps {\n pageNumber: number;\n current?: boolean;\n}\n\ntype Props<C extends ElementType> = BaseProps & {\n component?: C;\n} & Omit<ComponentProps<C>, keyof BaseProps | \"component\">;\n\nconst PaginationItem = <C extends ElementType>({ pageNumber, current = false, component = \"a\" as C, ...props }: Props<C>) => {\n const { onClick, ...otherProps } = props;\n const Component: ElementType = component;\n const { base, indicator } = generateClasses({ current });\n const handleClick = (event: MouseEvent) => {\n event.preventDefault();\n // oxlint-disable-next-line @typescript-eslint/no-unsafe-call\n onClick?.();\n };\n\n return (\n <Component {...otherProps} className={base()} onClick={handleClick} aria-current={current ? \"page\" : undefined}>\n {pageNumber}\n <span className={indicator()}></span>\n </Component>\n );\n};\n\nexport default PaginationItem;\n"],"mappings":";;;;AAGA,IAAMA,IAAkBC,EAAG;CACzB,MAAM;CACN,OAAO,EACL,WAAW,kDACb;CACA,UAAU,EACR,SAAS;EACP,MAAM;GACJ,WAAW;GACX,MAAM;EACR;EACA,OAAO;GACL,MAAM;GACN,WAAW;EACb;CACF,EACF;AACF,CAAC,GAWKC,KAAyC,EAAE,eAAY,aAAU,IAAO,eAAY,KAAU,GAAGC,QAAsB;CAC3H,IAAM,EAAE,YAAS,GAAGC,MAAeD,GAC7BE,IAAyBC,GACzB,EAAE,SAAM,iBAAcN,EAAgB,EAAE,WAAQ,CAAC,GACjDO,KAAe,MAAsB;EAGzC,AAFAC,EAAM,eAAe,GAErBC,IAAU;CACZ;CAEA,OACE,kBAACJ,GAAD;EAAW,GAAID;EAAY,WAAWM,EAAK;EAAG,SAASH;EAAa,gBAAcI,IAAU,SAAS,KAAA;EAArG,UAAA,CACGC,GACD,kBAAC,QAAD,EAAM,WAAWC,EAAU,EAAS,CAAA,CAC3B;;AAEf"}
package/dist/src/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/utils.ts
1
+ // src/utils.ts
2
2
  var e = (e, t, n = 7) => {
3
3
  let r = [];
4
4
  if (t <= n) {
@@ -27,7 +27,6 @@ var e = (e, t, n = 7) => {
27
27
  ];
28
28
  }
29
29
  };
30
- //#endregion
31
30
  export { e as calculateItems };
32
31
 
33
32
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-pagination",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "Pagination component, implemented in React, for the Bonprix Design System.",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -32,15 +32,15 @@
32
32
  "provenance": true
33
33
  },
34
34
  "dependencies": {
35
- "@bonprix-ds/react-icon": "1.3.2",
36
- "@bonprix-ds/react-icon-button": "1.2.5",
37
- "@bonprix-ds/utils": "0.5.0"
35
+ "@bonprix-ds/react-icon": "1.4.0",
36
+ "@bonprix-ds/react-icon-button": "1.2.7",
37
+ "@bonprix-ds/utils": "0.6.0"
38
38
  },
39
39
  "devDependencies": {
40
+ "@bonprix-ds/vite-config": "0.0.0",
40
41
  "@types/react": "19.3.0",
41
- "vite": "8.3.3",
42
- "vitest": "5.0.5",
43
- "@bonprix-ds/vite-config": "0.0.0"
42
+ "vite": "8.3.8",
43
+ "vitest": "5.1.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": "^19",