@bonprix-ds/react-pagination 1.1.12 → 1.1.14

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 };
@@ -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 +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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-pagination",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
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.3",
36
- "@bonprix-ds/react-icon-button": "1.2.6",
37
- "@bonprix-ds/utils": "0.6.0"
35
+ "@bonprix-ds/react-icon": "1.4.1",
36
+ "@bonprix-ds/react-icon-button": "1.2.8",
37
+ "@bonprix-ds/utils": "0.7.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@bonprix-ds/vite-config": "0.0.0",
41
41
  "@types/react": "19.3.0",
42
- "vite": "8.3.5",
43
- "vitest": "5.0.5"
42
+ "vite": "8.3.8",
43
+ "vitest": "5.1.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": "^19",