@bonprix-ds/react-accordion 1.0.8 → 1.1.1
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 +2 -27
- package/dist/src/Accordion.js +22 -0
- package/dist/src/Accordion.js.map +1 -0
- package/dist/src/AccordionItem.js +11 -0
- package/dist/src/AccordionItem.js.map +1 -0
- package/package.json +7 -8
- package/dist/index.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Children as t } from "react";
|
|
4
|
-
import n from "@bonprix-ds/react-collapsible";
|
|
5
|
-
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
//#region src/AccordionItem.tsx
|
|
7
|
-
var o = (e) => /* @__PURE__ */ i(n, { ...e });
|
|
8
|
-
o.displayName = "Accordion.Item";
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/Accordion.tsx
|
|
11
|
-
var s = ({ children: n }) => {
|
|
12
|
-
let o = t.count(n);
|
|
13
|
-
return /* @__PURE__ */ i(e.Root, {
|
|
14
|
-
type: "multiple",
|
|
15
|
-
"data-bpds": "accordion",
|
|
16
|
-
children: t.map(n, (e, t) => {
|
|
17
|
-
let n = t + 1 < o;
|
|
18
|
-
return /* @__PURE__ */ a(r, { children: [e, n && /* @__PURE__ */ i(c, {})] });
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
s.displayName = "Accordion", s.Item = o;
|
|
23
|
-
var c = () => /* @__PURE__ */ i("div", { className: "h-0.25 w-full bg-clr-on-bg-low" });
|
|
24
|
-
//#endregion
|
|
25
|
-
export { s as default };
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import e from "./src/Accordion.js";
|
|
2
|
+
export { e as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import e from "./AccordionItem.js";
|
|
2
|
+
import * as t from "@radix-ui/react-accordion";
|
|
3
|
+
import { Children as n } from "react";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
//#region src/Accordion.tsx
|
|
6
|
+
var o = ({ children: e }) => {
|
|
7
|
+
let o = n.count(e);
|
|
8
|
+
return /* @__PURE__ */ i(t.Root, {
|
|
9
|
+
type: "multiple",
|
|
10
|
+
"data-bpds": "accordion",
|
|
11
|
+
children: n.map(e, (e, t) => {
|
|
12
|
+
let n = t + 1 < o;
|
|
13
|
+
return /* @__PURE__ */ a(r, { children: [e, n && /* @__PURE__ */ i(s, {})] });
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
o.displayName = "Accordion", o.Item = e;
|
|
18
|
+
var s = () => /* @__PURE__ */ i("div", { className: "h-0.25 w-full bg-clr-on-bg-low" });
|
|
19
|
+
//#endregion
|
|
20
|
+
export { o as default };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=Accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.js","names":["_Fragment","AccordionItem","AccordionPrimitive","Accordion","amountOfChildren","Children","children","isNotLast","index","Fragment","child","SeparationLine"],"sources":["../../src/Accordion.tsx"],"sourcesContent":["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,IAAMG,KAAa,EAAE,kBAAsB;CACzC,IAAMC,IAAmBC,EAAS,MAAMC,CAAQ;CAChD,OACE,kBAACJ,EAAmB,MAApB;EAAyB,MAAK;EAAW,aAAU;EAChD,UAAAG,EAAS,IAAIC,IAAW,GAAO,MAAU;GACxC,IAAMC,IAAYC,IAAQ,IAAIJ;GAC9B,OACE,kBAAAJ,GAAA,EAAA,UAAA,CACGU,GACAH,KAAa,kBAACI,GAAD,CAAiB,CAAA,CAC/B,EAAA,CAAA;EAEN,CAAC;CACsB,CAAA;AAE7B;AAEA,EAAU,cAAc,aAExB,EAAU,OAAOV;AAIjB,IAAMU,UAAuB,kBAAC,OAAD,EAAK,WAAU,iCAAsC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "react";
|
|
3
|
+
import e from "@bonprix-ds/react-collapsible";
|
|
4
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
+
//#region src/AccordionItem.tsx
|
|
6
|
+
var n = (n) => /* @__PURE__ */ t(e, { ...n });
|
|
7
|
+
n.displayName = "Accordion.Item";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as default };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=AccordionItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.js","names":["Collapsible","AccordionItem","props"],"sources":["../../src/AccordionItem.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 relabeling `Collapsible`, which is shared with other consumers.\nconst AccordionItem = (props: CollapsibleProps) => <Collapsible {...props} />;\n\nAccordionItem.displayName = \"Accordion.Item\";\n\nexport default AccordionItem;\n"],"mappings":";;;;;AAUA,IAAMC,KAAiB,MAA4B,kBAACD,GAAD,EAAa,GAAIE,EAAQ,CAAA;AAE5E,EAAc,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonprix-ds/react-accordion",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Accordion component, implemented in React, for the Bonprix Design System.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -33,18 +33,17 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@radix-ui/react-accordion": "1.2.20",
|
|
36
|
-
"@bonprix-ds/react-collapsible": "1.
|
|
37
|
-
"@bonprix-ds/utils": "0.
|
|
36
|
+
"@bonprix-ds/react-collapsible": "1.1.1",
|
|
37
|
+
"@bonprix-ds/utils": "0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/react": "19.3.0",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"vite": "8.3.0"
|
|
41
|
+
"vite": "8.3.2",
|
|
42
|
+
"@bonprix-ds/vite-config": "0.0.0"
|
|
44
43
|
},
|
|
45
44
|
"peerDependencies": {
|
|
46
|
-
"react": "^19
|
|
47
|
-
"react-dom": "^19
|
|
45
|
+
"react": "^19",
|
|
46
|
+
"react-dom": "^19"
|
|
48
47
|
},
|
|
49
48
|
"scripts": {
|
|
50
49
|
"build": "vite build"
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|