@bonprix-ds/react-accordion 1.0.7 → 1.1.0
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 +2 -27
- package/dist/src/Accordion.d.ts +14 -0
- package/dist/src/Accordion.js +22 -0
- package/dist/src/Accordion.js.map +1 -0
- package/dist/src/AccordionItem.d.ts +7 -0
- package/dist/src/AccordionItem.js +11 -0
- package/dist/src/AccordionItem.js.map +1 -0
- package/package.json +29 -29
- package/dist/index.js.map +0 -1
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,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as t from "@radix-ui/react-accordion";
|
|
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 = e.count(n);
|
|
13
|
-
return /* @__PURE__ */ i(t.Root, {
|
|
14
|
-
type: "multiple",
|
|
15
|
-
"data-bpds": "accordion",
|
|
16
|
-
children: e.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,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;
|
|
@@ -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,14 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonprix-ds/react-accordion",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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,23 @@
|
|
|
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.
|
|
35
|
-
},
|
|
36
|
-
"peerDependencies": {
|
|
37
|
-
"react": "^19.0.0",
|
|
38
|
-
"react-dom": "^19.0.0"
|
|
36
|
+
"@bonprix-ds/react-collapsible": "1.1.0",
|
|
37
|
+
"@bonprix-ds/utils": "0.3.0"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"@
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
40
|
+
"@types/react": "19.3.0",
|
|
41
|
+
"vite": "8.3.2",
|
|
42
|
+
"@bonprix-ds/vite-config": "0.0.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": "^19",
|
|
46
|
+
"react-dom": "^19"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
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 Collapsible, { CollapsibleProps } from \"@bonprix-ds/react-collapsible\";\nimport React from \"react\";\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 React, { Children, ReactNode } from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\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":";;;;;;AASA,IAAM,KAAiB,MAA4B,kBAAC,GAAD,EAAa,GAAI,EAAQ,CAAA;AAE5E,EAAc,cAAc;;;ACD5B,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"}
|