@bonprix-ds/react-tab-group 1.0.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.
@@ -0,0 +1,71 @@
1
+ import { default as default_2 } from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ declare interface BaseProps {
5
+ /** This property should contain all of the subcomponents of the TabGroup component (TabGroup.Item, TabGroup.Content, TabGroup.List). */
6
+ children: ReactNode;
7
+ /** The currently active tab. Should be used in conjunction with the `onChange` prop. */
8
+ activeTab: string;
9
+ /** Callback function that is called when the active tab changes. */
10
+ onChange: (value: string) => void;
11
+ /** Sets "the variant. */
12
+ variant?: TabGroupVariant;
13
+ }
14
+
15
+ declare interface TabBoxProps extends BaseProps {
16
+ variant?: "tab-box";
17
+ /** If true, the tab items will occupy the available width. */
18
+ fullWidth?: boolean;
19
+ }
20
+
21
+ declare const TabGroup: {
22
+ (props: TabGroupProps): default_2.JSX.Element;
23
+ displayName: string;
24
+ Item: {
25
+ ({ label, subLabel, icon, value }: TabGroupItemProps): default_2.JSX.Element;
26
+ displayName: string;
27
+ };
28
+ Content: {
29
+ ({ children, value }: TabGroupContentProps): default_2.JSX.Element;
30
+ displayName: string;
31
+ };
32
+ List: {
33
+ ({ children }: TabGroupListProps): default_2.JSX.Element;
34
+ displayName: string;
35
+ };
36
+ };
37
+ export default TabGroup;
38
+
39
+ declare interface TabGroupContentProps {
40
+ /** The unique identifier for the tab content. With its help the tab content can be referenced programmatically. */
41
+ value: string;
42
+ /** The content of the tab content. */
43
+ children: ReactNode;
44
+ }
45
+
46
+ declare interface TabGroupItemProps {
47
+ /** Unique identifier for the tab item. With its help the tab item can be referenced programmatically. */
48
+ value: string;
49
+ /** The label of the tab item. */
50
+ label: string;
51
+ /** The sublabel of the tab item. */
52
+ subLabel?: string;
53
+ /** The icon of the tab item. */
54
+ icon?: ReactNode;
55
+ }
56
+
57
+ declare interface TabGroupListProps {
58
+ /** Here, the TabGroup.Item subcomponents should be placed. */
59
+ children: ReactNode;
60
+ }
61
+
62
+ export declare type TabGroupProps = TabBoxProps | TabProps;
63
+
64
+ declare type TabGroupVariant = "tab" | "tab-box";
65
+
66
+ declare interface TabProps extends BaseProps {
67
+ variant?: "tab";
68
+ fullWidth?: never;
69
+ }
70
+
71
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import e from "./src/TabGroup.js";
2
+ export { e as default };
@@ -0,0 +1,13 @@
1
+ import e from "./TabGroupContent/index.js";
2
+ import t from "./TabGroupItem/TabGroupItem.js";
3
+ import n from "./TabGroupList/TabGroupList.js";
4
+ import r from "./TabGroupRoot.js";
5
+ import "react";
6
+ import { jsx as i } from "react/jsx-runtime";
7
+ //#region src/TabGroup.tsx
8
+ var a = (e) => /* @__PURE__ */ i(r, { ...e });
9
+ a.displayName = "TabGroup", a.Item = t, a.Content = e, a.List = n;
10
+ //#endregion
11
+ export { a as default };
12
+
13
+ //# sourceMappingURL=TabGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabGroup.js","names":[],"sources":["../../src/TabGroup.tsx"],"sourcesContent":["import React from \"react\";\n\nimport TabGroupContent from \"./TabGroupContent\";\nimport TabGroupItem from \"./TabGroupItem/TabGroupItem\";\nimport TabGroupList from \"./TabGroupList/TabGroupList\";\nimport TabGroupRoot, { type TabGroupProps } from \"./TabGroupRoot\";\n\nexport type { TabGroupProps, TabGroupVariant } from \"./TabGroupRoot\";\n\nconst TabGroup = (props: TabGroupProps) => <TabGroupRoot {...props} />;\n\nTabGroup.displayName = \"TabGroup\";\n\nTabGroup.Item = TabGroupItem;\nTabGroup.Content = TabGroupContent;\nTabGroup.List = TabGroupList;\n\nexport default TabGroup;\n"],"mappings":";;;;;;;AASA,IAAM,KAAY,MAAyB,kBAAC,GAAD,EAAc,GAAI,EAAQ,CAAA;AAErE,EAAS,cAAc,YAEvB,EAAS,OAAO,GAChB,EAAS,UAAU,GACnB,EAAS,OAAO"}
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import "react";
3
+ import * as e from "@radix-ui/react-tabs";
4
+ import { jsx as t } from "react/jsx-runtime";
5
+ //#region src/TabGroupContent/TabGroupContent.tsx
6
+ var n = ({ children: n, value: r }) => /* @__PURE__ */ t(e.Content, {
7
+ value: r,
8
+ children: n
9
+ });
10
+ n.displayName = "TabGroup.Content";
11
+ //#endregion
12
+ export { n as default };
13
+
14
+ //# sourceMappingURL=TabGroupContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabGroupContent.js","names":[],"sources":["../../../src/TabGroupContent/TabGroupContent.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { ReactNode } from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nexport interface TabGroupContentProps {\n /** The unique identifier for the tab content. With its help the tab content can be referenced programmatically. */\n value: string;\n /** The content of the tab content. */\n children: ReactNode;\n}\n\nconst TabGroupContent = ({ children, value }: TabGroupContentProps) => {\n return <TabsPrimitive.Content value={value}>{children}</TabsPrimitive.Content>;\n};\n\nTabGroupContent.displayName = \"TabGroup.Content\";\n\nexport default TabGroupContent;\n"],"mappings":";;;;;AAYA,IAAM,KAAmB,EAAE,aAAU,eAC5B,kBAAC,EAAc,SAAf;CAA8B;CAAQ;AAAgC,CAAA;AAG/E,EAAgB,cAAc"}
@@ -0,0 +1,7 @@
1
+ import e from "./TabGroupContent.js";
2
+ //#region src/TabGroupContent/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/TabGroupContent/index.ts"],"sourcesContent":["import TabGroupContent from \"./TabGroupContent\";\n\nexport default TabGroupContent;\n"],"mappings":";;AAEA,IAAA,IAAe"}
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { createContext as e } from "react";
3
+ //#region src/TabGroupContext.ts
4
+ var t = e({
5
+ fullWidth: !1,
6
+ variant: "tab"
7
+ });
8
+ //#endregion
9
+ export { t as default };
10
+
11
+ //# sourceMappingURL=TabGroupContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabGroupContext.js","names":[],"sources":["../../src/TabGroupContext.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\n\nimport { TabGroupVariant } from \"./TabGroup\";\n\nexport interface TabGroupContextProps {\n fullWidth?: boolean;\n variant: TabGroupVariant;\n}\n\nconst TabGroupContext = createContext<TabGroupContextProps>({\n fullWidth: false,\n variant: \"tab\",\n});\n\nexport default TabGroupContext;\n"],"mappings":";;;AAWA,IAAM,IAAkB,EAAoC;CAC1D,WAAW;CACX,SAAS;AACX,CAAC"}
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import e from "../useTabGroup.js";
3
+ import "react";
4
+ import * as t from "@radix-ui/react-tabs";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
+ import { tabStyleContainerBase as i, tabStyleContainerVariant as a, tabStyleLabelClass as o, tabStyleLabelContainerBase as s, tabStyleLabelContainerVariant as c } from "@bonprix-ds/internal-components";
7
+ import { tv as l } from "tailwind-variants";
8
+ //#region src/TabGroupItem/TabGroupItem.tsx
9
+ var u = l({
10
+ slots: {
11
+ container: [
12
+ "preflight",
13
+ i,
14
+ "hover:after:border-b-2 hover:after:border-current",
15
+ "data-[state=active]:after:border-b-4 data-[state=active]:after:h-1 data-[state=active]:after:border-current",
16
+ "text-inherit"
17
+ ],
18
+ iconContainer: "flex max-w-10 h-7",
19
+ labelContainer: s,
20
+ labelClass: o,
21
+ dummyBoldLabelClass: "h-0 font-bold invisible",
22
+ sublabelClass: "line-clamp-1"
23
+ },
24
+ variants: { variant: {
25
+ tab: {
26
+ container: a,
27
+ labelContainer: c
28
+ },
29
+ "tab-box": {
30
+ container: ["px-1 py-4 items-center focus-visible:outline outline-2 outline-offset-2 outline-current", "border-current border after:absolute data-[state=active]:after:rounded-b-sm after:rounded-b-sm flex-auto"],
31
+ labelContainer: "items-center [overflow-wrap:anywhere] text-center hyphens-auto",
32
+ labelClass: "group-data-[state=active]:font-bold"
33
+ }
34
+ } }
35
+ }), d = ({ label: i, subLabel: a, icon: o, value: s }) => {
36
+ let { variant: c } = e(), { container: l, iconContainer: d, labelContainer: f, labelClass: p, dummyBoldLabelClass: m, sublabelClass: h } = u({ variant: c });
37
+ return /* @__PURE__ */ r(t.Trigger, {
38
+ className: l(),
39
+ value: s,
40
+ "data-bpds-icon": o,
41
+ "data-bpds-has-sublabel": !!a,
42
+ children: [o && /* @__PURE__ */ n("div", {
43
+ className: d(),
44
+ children: o
45
+ }), /* @__PURE__ */ r("div", {
46
+ className: f(),
47
+ children: [
48
+ /* @__PURE__ */ n("p", {
49
+ className: p(),
50
+ children: i
51
+ }),
52
+ c === "tab-box" && /* @__PURE__ */ n("p", {
53
+ className: m(),
54
+ "aria-hidden": "true",
55
+ children: i
56
+ }),
57
+ a && /* @__PURE__ */ n("p", {
58
+ className: h(),
59
+ children: a
60
+ })
61
+ ]
62
+ })]
63
+ });
64
+ };
65
+ d.displayName = "TabGroup.Item";
66
+ //#endregion
67
+ export { d as default };
68
+
69
+ //# sourceMappingURL=TabGroupItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabGroupItem.js","names":[],"sources":["../../../src/TabGroupItem/TabGroupItem.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n tabStyleContainerBase,\n tabStyleContainerVariant,\n tabStyleLabelClass,\n tabStyleLabelContainerBase,\n tabStyleLabelContainerVariant,\n} from \"@bonprix-ds/internal-components\";\nimport React, { ReactNode } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport * as Tabs from \"@radix-ui/react-tabs\";\n\nimport useTabGroup from \"../useTabGroup\";\n\nconst generateClasses = tv({\n slots: {\n container: [\n \"preflight\",\n tabStyleContainerBase,\n \"hover:after:border-b-2 hover:after:border-current\",\n \"data-[state=active]:after:border-b-4 data-[state=active]:after:h-1 data-[state=active]:after:border-current\",\n // in order to use 'current' as color values, we need to inherit the color (primary) from TabGroupList,\n // because <button> is given a User Agent propietary color (black, not our primary)\n \"text-inherit\",\n ],\n iconContainer: \"flex max-w-10 h-7\",\n labelContainer: tabStyleLabelContainerBase,\n labelClass: tabStyleLabelClass,\n dummyBoldLabelClass: \"h-0 font-bold invisible\",\n sublabelClass: \"line-clamp-1\",\n },\n variants: {\n variant: {\n tab: {\n container: tabStyleContainerVariant,\n labelContainer: tabStyleLabelContainerVariant,\n },\n \"tab-box\": {\n container: [\n \"px-1 py-4 items-center focus-visible:outline outline-2 outline-offset-2 outline-current\",\n \"border-current border after:absolute data-[state=active]:after:rounded-b-sm after:rounded-b-sm flex-auto\",\n ],\n labelContainer: \"items-center [overflow-wrap:anywhere] text-center hyphens-auto\",\n labelClass: \"group-data-[state=active]:font-bold\",\n },\n },\n },\n});\n\nexport interface TabGroupItemProps {\n /** Unique identifier for the tab item. With its help the tab item can be referenced programmatically. */\n value: string;\n /** The label of the tab item. */\n label: string;\n /** The sublabel of the tab item. */\n subLabel?: string;\n /** The icon of the tab item. */\n icon?: ReactNode;\n}\n\nconst TabGroupItem = ({ label, subLabel, icon, value }: TabGroupItemProps) => {\n const { variant } = useTabGroup();\n const { container, iconContainer, labelContainer, labelClass, dummyBoldLabelClass, sublabelClass } = generateClasses({\n variant,\n });\n return (\n <Tabs.Trigger className={container()} value={value} data-bpds-icon={icon} data-bpds-has-sublabel={!!subLabel}>\n {icon && <div className={iconContainer()}>{icon}</div>}\n <div className={labelContainer()}>\n <p className={labelClass()}>{label}</p>\n {/* When label gets bold in active state, its box takes up more space and causes a layout shift (button gets bigger).\n By adding the 'physical copy of the label text in bold, but invisible, the space is already created and therefore layout is consistent*/}\n {variant === \"tab-box\" && (\n <p className={dummyBoldLabelClass()} aria-hidden=\"true\">\n {label}\n </p>\n )}\n\n {subLabel && <p className={sublabelClass()}>{subLabel}</p>}\n </div>\n </Tabs.Trigger>\n );\n};\n\nTabGroupItem.displayName = \"TabGroup.Item\";\n\nexport default TabGroupItem;\n"],"mappings":";;;;;;;;AAeA,IAAM,IAAkB,EAAG;CACzB,OAAO;EACL,WAAW;GACT;GACA;GACA;GACA;GAGA;EACF;EACA,eAAe;EACf,gBAAgB;EAChB,YAAY;EACZ,qBAAqB;EACrB,eAAe;CACjB;CACA,UAAU,EACR,SAAS;EACP,KAAK;GACH,WAAW;GACX,gBAAgB;EAClB;EACA,WAAW;GACT,WAAW,CACT,2FACA,0GACF;GACA,gBAAgB;GAChB,YAAY;EACd;CACF,EACF;AACF,CAAC,GAaK,KAAgB,EAAE,UAAO,aAAU,SAAM,eAA+B;CAC5E,IAAM,EAAE,eAAY,EAAY,GAC1B,EAAE,cAAW,kBAAe,mBAAgB,eAAY,wBAAqB,qBAAkB,EAAgB,EACnH,WACF,CAAC;CACD,OACE,kBAAC,EAAK,SAAN;EAAc,WAAW,EAAU;EAAU;EAAO,kBAAgB;EAAM,0BAAwB,CAAC,CAAC;EAApG,UAAA,CACG,KAAQ,kBAAC,OAAD;GAAK,WAAW,EAAc;GAAI,UAAA;EAAU,CAAA,GACrD,kBAAC,OAAD;GAAK,WAAW,EAAe;GAA/B,UAAA;IACE,kBAAC,KAAD;KAAG,WAAW,EAAW;KAAI,UAAA;IAAS,CAAA;IAGrC,MAAY,aACX,kBAAC,KAAD;KAAG,WAAW,EAAoB;KAAG,eAAY;KAC9C,UAAA;IACA,CAAA;IAGJ,KAAY,kBAAC,KAAD;KAAG,WAAW,EAAc;KAAI,UAAA;IAAY,CAAA;GACtD;EACO,CAAA,CAAA;;AAElB;AAEA,EAAa,cAAc"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import e from "../useTabGroup.js";
3
+ import "react";
4
+ import * as t from "@radix-ui/react-tabs";
5
+ import { jsx as n } from "react/jsx-runtime";
6
+ import { tabStyleList as r } from "@bonprix-ds/internal-components";
7
+ import { tv as i } from "tailwind-variants";
8
+ //#region src/TabGroupList/TabGroupList.tsx
9
+ var a = (e, t = !1) => e === "tab-box" ? `repeat(${t ? "auto-fit" : "auto-fill"}, minmax(4.6875rem, 1fr))` : "", o = i({
10
+ base: ["[&:has(button_svg)_button:not(:has(svg))_p:first-child]:mt-7"],
11
+ variants: { variant: {
12
+ tab: r,
13
+ "tab-box": "text-clr-primary grid gap-x-3 gap-y-2 scrollbar-none"
14
+ } }
15
+ }), s = ({ children: r }) => {
16
+ let { variant: i, fullWidth: s } = e();
17
+ return /* @__PURE__ */ n(t.List, {
18
+ className: o({ variant: i }),
19
+ style: { gridTemplateColumns: a(i, s) },
20
+ children: r
21
+ });
22
+ };
23
+ s.displayName = "TabGroup.List";
24
+ //#endregion
25
+ export { s as default };
26
+
27
+ //# sourceMappingURL=TabGroupList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabGroupList.js","names":[],"sources":["../../../src/TabGroupList/TabGroupList.tsx"],"sourcesContent":["\"use client\";\n\nimport { tabStyleList } from \"@bonprix-ds/internal-components\";\nimport React, { ReactNode } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport { TabGroupVariant } from \"../TabGroup\";\nimport useTabGroup from \"../useTabGroup\";\n\nconst getGridTemplateColumnsStyle = (variant: TabGroupVariant, fullWidth = false) => {\n const BOX_ITEM_MIN_WIDTH = \"4.6875rem\";\n if (variant !== \"tab-box\") return \"\";\n const repeatCount = fullWidth ? \"auto-fit\" : \"auto-fill\";\n const style = `repeat(${repeatCount}, minmax(${BOX_ITEM_MIN_WIDTH}, 1fr))`;\n return style;\n};\n\nconst generateClasses = tv({\n base: [\n // Following rule allows to align 'label' in a button with no SVG only if other buttons contain an SVG (logo or icon), according to design\n \"[&:has(button_svg)_button:not(:has(svg))_p:first-child]:mt-7\",\n ],\n variants: {\n variant: {\n tab: tabStyleList,\n \"tab-box\": \"text-clr-primary grid gap-x-3 gap-y-2 scrollbar-none\",\n },\n },\n});\n\nexport interface TabGroupListProps {\n /** Here, the TabGroup.Item subcomponents should be placed. */\n children: ReactNode;\n}\n\nconst TabGroupList = ({ children }: TabGroupListProps) => {\n const { variant, fullWidth } = useTabGroup();\n return (\n <TabsPrimitive.List\n className={generateClasses({ variant })}\n style={{ gridTemplateColumns: getGridTemplateColumnsStyle(variant, fullWidth) }}\n >\n {children}\n </TabsPrimitive.List>\n );\n};\n\nTabGroupList.displayName = \"TabGroup.List\";\n\nexport default TabGroupList;\n"],"mappings":";;;;;;;;AAUA,IAAM,KAA+B,GAA0B,IAAY,OAErE,MAAY,YAGT,UAFa,IAAY,aAAa,YACT,6BAFF,IAM9B,IAAkB,EAAG;CACzB,MAAM,CAEJ,8DACF;CACA,UAAU,EACR,SAAS;EACP,KAAK;EACL,WAAW;CACb,EACF;AACF,CAAC,GAOK,KAAgB,EAAE,kBAAkC;CACxD,IAAM,EAAE,YAAS,iBAAc,EAAY;CAC3C,OACE,kBAAC,EAAc,MAAf;EACE,WAAW,EAAgB,EAAE,WAAQ,CAAC;EACtC,OAAO,EAAE,qBAAqB,EAA4B,GAAS,CAAS,EAAE;EAE7E;CACiB,CAAA;AAExB;AAEA,EAAa,cAAc"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import e from "./TabGroupContext.js";
3
+ import "react";
4
+ import * as t from "@radix-ui/react-tabs";
5
+ import { jsx as n } from "react/jsx-runtime";
6
+ //#region src/TabGroupRoot.tsx
7
+ var r = ({ children: r, activeTab: i, onChange: a, variant: o = "tab", fullWidth: s }) => /* @__PURE__ */ n(t.Root, {
8
+ className: "preflight",
9
+ value: i,
10
+ onValueChange: a,
11
+ "data-bpds": "tab-group",
12
+ "data-bpds-active-tab": i,
13
+ "data-bpds-variant": o,
14
+ "data-bpds-full-width": s,
15
+ children: /* @__PURE__ */ n(e, {
16
+ value: {
17
+ fullWidth: s,
18
+ variant: o
19
+ },
20
+ children: r
21
+ })
22
+ });
23
+ r.displayName = "TabGroup";
24
+ //#endregion
25
+ export { r as default };
26
+
27
+ //# sourceMappingURL=TabGroupRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabGroupRoot.js","names":[],"sources":["../../src/TabGroupRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { ReactNode } from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport TabGroupContext from \"./TabGroupContext\";\n\nexport type TabGroupVariant = \"tab\" | \"tab-box\";\n\ninterface BaseProps {\n /** This property should contain all of the subcomponents of the TabGroup component (TabGroup.Item, TabGroup.Content, TabGroup.List). */\n children: ReactNode;\n /** The currently active tab. Should be used in conjunction with the `onChange` prop. */\n activeTab: string;\n /** Callback function that is called when the active tab changes. */\n onChange: (value: string) => void;\n /** Sets \"the variant. */\n variant?: TabGroupVariant;\n}\n\ninterface TabBoxProps extends BaseProps {\n variant?: \"tab-box\";\n /** If true, the tab items will occupy the available width. */\n fullWidth?: boolean;\n}\n\ninterface TabProps extends BaseProps {\n variant?: \"tab\";\n fullWidth?: never;\n}\n\nexport type TabGroupProps = TabBoxProps | TabProps;\n\nconst TabGroupRoot = ({ children, activeTab, onChange, variant = \"tab\", fullWidth }: TabGroupProps) => {\n return (\n <TabsPrimitive.Root\n className=\"preflight\"\n value={activeTab}\n onValueChange={onChange}\n data-bpds=\"tab-group\"\n data-bpds-active-tab={activeTab}\n data-bpds-variant={variant}\n data-bpds-full-width={fullWidth}\n >\n <TabGroupContext value={{ fullWidth, variant }}>{children}</TabGroupContext>\n </TabsPrimitive.Root>\n );\n};\n\nTabGroupRoot.displayName = \"TabGroup\";\n\nexport default TabGroupRoot;\n"],"mappings":";;;;;;AAiCA,IAAM,KAAgB,EAAE,aAAU,cAAW,aAAU,aAAU,OAAO,mBAEpE,kBAAC,EAAc,MAAf;CACE,WAAU;CACV,OAAO;CACP,eAAe;CACf,aAAU;CACV,wBAAsB;CACtB,qBAAmB;CACnB,wBAAsB;CAEtB,UAAA,kBAAC,GAAD;EAAiB,OAAO;GAAE;GAAW;EAAQ;EAAI;CAA0B,CAAA;AACzD,CAAA;AAIxB,EAAa,cAAc"}
@@ -0,0 +1,8 @@
1
+ import e from "./TabGroupContext.js";
2
+ import { useContext as t } from "react";
3
+ //#region src/useTabGroup.ts
4
+ var n = () => t(e);
5
+ //#endregion
6
+ export { n as default };
7
+
8
+ //# sourceMappingURL=useTabGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabGroup.js","names":[],"sources":["../../src/useTabGroup.ts"],"sourcesContent":["import { useContext } from \"react\";\n\nimport TabGroupContext from \"./TabGroupContext\";\n\nconst useTabGroup = () => {\n return useContext(TabGroupContext);\n};\n\nexport default useTabGroup;\n"],"mappings":";;;AAIA,IAAM,UACG,EAAW,CAAe"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@bonprix-ds/react-tab-group",
3
+ "version": "1.0.0",
4
+ "description": "TabGroup component, implemented in React, for the Bonprix Design System.",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "provenance": true
9
+ },
10
+ "module": "./dist/index.js",
11
+ "sideEffects": false,
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
19
+ "types": "./dist/index.d.ts",
20
+ "files": [
21
+ "dist"
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/tab-group"
30
+ },
31
+ "dependencies": {
32
+ "@radix-ui/react-tabs": "1.1.21",
33
+ "@bonprix-ds/internal-components": "0.1.5"
34
+ },
35
+ "peerDependencies": {
36
+ "react": "^19.0.0",
37
+ "react-dom": "^19.0.0",
38
+ "tailwind-variants": "0.3.1"
39
+ },
40
+ "devDependencies": {
41
+ "vite": "8.2.2",
42
+ "@types/react": "19.2.18",
43
+ "@vitejs/plugin-react": "6.1.1",
44
+ "rollup-preserve-directives": "1.1.3",
45
+ "unplugin-dts": "1.0.3",
46
+ "@microsoft/api-extractor": "7.59.0"
47
+ },
48
+ "scripts": {
49
+ "build": "vite build"
50
+ }
51
+ }