@bonprix-ds/react-accordion 1.0.6 → 1.0.8
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.d.ts +2 -20
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/src/Accordion.d.ts +14 -0
- package/dist/src/AccordionItem.d.ts +7 -0
- package/package.json +29 -28
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
declare const Accordion: {
|
|
6
|
-
({ children }: AccordionProps): default_2.JSX.Element;
|
|
7
|
-
displayName: string;
|
|
8
|
-
Item: {
|
|
9
|
-
(props: CollapsibleProps): default_2.JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default Accordion;
|
|
14
|
-
|
|
15
|
-
export declare interface AccordionProps {
|
|
16
|
-
/** Contains all of the single items. Only instances of `Accordion.Item` are expected to be here. */
|
|
17
|
-
children: ReactNode;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { }
|
|
1
|
+
export { default } from "./src/Accordion";
|
|
2
|
+
export type { Props as AccordionProps } from "./src/Accordion";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import * as e from "@radix-ui/react-accordion";
|
|
3
|
+
import { Children as t } from "react";
|
|
4
4
|
import n from "@bonprix-ds/react-collapsible";
|
|
5
5
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
//#region src/AccordionItem.tsx
|
|
@@ -9,11 +9,11 @@ o.displayName = "Accordion.Item";
|
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/Accordion.tsx
|
|
11
11
|
var s = ({ children: n }) => {
|
|
12
|
-
let o =
|
|
13
|
-
return /* @__PURE__ */ i(
|
|
12
|
+
let o = t.count(n);
|
|
13
|
+
return /* @__PURE__ */ i(e.Root, {
|
|
14
14
|
type: "multiple",
|
|
15
15
|
"data-bpds": "accordion",
|
|
16
|
-
children:
|
|
16
|
+
children: t.map(n, (e, t) => {
|
|
17
17
|
let n = t + 1 < o;
|
|
18
18
|
return /* @__PURE__ */ a(r, { children: [e, n && /* @__PURE__ */ i(c, {})] });
|
|
19
19
|
})
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/AccordionItem.tsx","../src/Accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport Collapsible, { CollapsibleProps } from \"@bonprix-ds/react-collapsible\";\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/AccordionItem.tsx","../src/Accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\n\nimport Collapsible, { CollapsibleProps } from \"@bonprix-ds/react-collapsible\";\n\n// Wrapping instead of re-exporting `Collapsible`: the package entry point resolves to the prebuilt\n// dist, which react-docgen-typescript never parses, so `Accordion.Item` would end up without a\n// props table in Storybook. Owning the component also lets it carry its own `displayName` instead\n// of relabelling `Collapsible`, which is shared with other consumers.\nconst AccordionItem = (props: CollapsibleProps) => <Collapsible {...props} />;\n\nAccordionItem.displayName = \"Accordion.Item\";\n\nexport default AccordionItem;\n","import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport React, { Children, ReactNode } from \"react\";\n\nimport AccordionItem from \"./AccordionItem\";\n\nexport interface Props {\n /** Contains all of the single items. Only instances of `Accordion.Item` are expected to be here. */\n children: ReactNode;\n}\n\nconst Accordion = ({ children }: Props) => {\n const amountOfChildren = Children.count(children);\n return (\n <AccordionPrimitive.Root type=\"multiple\" data-bpds=\"accordion\">\n {Children.map(children, (child, index) => {\n const isNotLast = index + 1 < amountOfChildren;\n return (\n <>\n {child}\n {isNotLast && <SeparationLine />}\n </>\n );\n })}\n </AccordionPrimitive.Root>\n );\n};\n\nAccordion.displayName = \"Accordion\";\n\nAccordion.Item = AccordionItem;\n\nexport default Accordion;\n\nconst SeparationLine = () => <div className=\"h-0.25 w-full bg-clr-on-bg-low\"></div>;\n"],"mappings":";;;;;;AAUA,IAAM,KAAiB,MAA4B,kBAAC,GAAD,EAAa,GAAI,EAAQ,CAAA;AAE5E,EAAc,cAAc;;;ACF5B,IAAM,KAAa,EAAE,kBAAsB;CACzC,IAAM,IAAmB,EAAS,MAAM,CAAQ;CAChD,OACE,kBAAC,EAAmB,MAApB;EAAyB,MAAK;EAAW,aAAU;EAChD,UAAA,EAAS,IAAI,IAAW,GAAO,MAAU;GACxC,IAAM,IAAY,IAAQ,IAAI;GAC9B,OACE,kBAAA,GAAA,EAAA,UAAA,CACG,GACA,KAAa,kBAAC,GAAD,CAAiB,CAAA,CAC/B,EAAA,CAAA;EAEN,CAAC;CACsB,CAAA;AAE7B;AAEA,EAAU,cAAc,aAExB,EAAU,OAAO;AAIjB,IAAM,UAAuB,kBAAC,OAAD,EAAK,WAAU,iCAAsC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** Contains all of the single items. Only instances of `Accordion.Item` are expected to be here. */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const Accordion: {
|
|
7
|
+
({ children }: Props): React.JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
Item: {
|
|
10
|
+
(props: import("@bonprix-ds/react-collapsible").CollapsibleProps): React.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default Accordion;
|
package/package.json
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonprix-ds/react-accordion",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Accordion component, implemented in React, for the Bonprix Design System.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"author": "",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/bonprix/design-system.git",
|
|
11
|
+
"directory": "packages/react/accordion"
|
|
9
12
|
},
|
|
10
|
-
"
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"!dist/tsconfig.tsbuildinfo",
|
|
16
|
+
"!dist/vite.config.d.ts",
|
|
17
|
+
"!dist/**/*.test.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
11
20
|
"sideEffects": false,
|
|
21
|
+
"module": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
12
23
|
"exports": {
|
|
13
24
|
".": {
|
|
14
25
|
"import": "./dist/index.js",
|
|
@@ -16,34 +27,24 @@
|
|
|
16
27
|
"default": "./dist/index.js"
|
|
17
28
|
}
|
|
18
29
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
],
|
|
23
|
-
"keywords": [],
|
|
24
|
-
"author": "",
|
|
25
|
-
"license": "UNLICENSED",
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/bonprix/design-system.git",
|
|
29
|
-
"directory": "packages/react/accordion"
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public",
|
|
32
|
+
"provenance": true
|
|
30
33
|
},
|
|
31
34
|
"dependencies": {
|
|
32
35
|
"@radix-ui/react-accordion": "1.2.20",
|
|
33
|
-
"@bonprix-ds/react-collapsible": "1.0.
|
|
34
|
-
"@bonprix-ds/utils": "0.2.
|
|
35
|
-
},
|
|
36
|
-
"peerDependencies": {
|
|
37
|
-
"react": "^19.0.0",
|
|
38
|
-
"react-dom": "^19.0.0"
|
|
36
|
+
"@bonprix-ds/react-collapsible": "1.0.8",
|
|
37
|
+
"@bonprix-ds/utils": "0.2.2"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"@
|
|
43
|
-
"@vitejs/plugin-react": "6.1.0",
|
|
40
|
+
"@types/react": "19.3.0",
|
|
41
|
+
"@vitejs/plugin-react": "6.1.1",
|
|
44
42
|
"rollup-preserve-directives": "1.1.3",
|
|
45
|
-
"
|
|
46
|
-
|
|
43
|
+
"vite": "8.3.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": "^19.3.0",
|
|
47
|
+
"react-dom": "^19.3.0"
|
|
47
48
|
},
|
|
48
49
|
"scripts": {
|
|
49
50
|
"build": "vite build"
|