@bonprix-ds/react-side-sheet 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,86 @@
1
+ import { ComponentProps } from 'react';
2
+ import { default as default_2 } from 'react';
3
+ import { ElementType } from 'react';
4
+ import { IconType } from '@bonprix-ds/react-icon';
5
+ import { ReactNode } from 'react';
6
+ import { TitleLevel } from '@bonprix-ds/utils';
7
+
8
+ declare interface SheetButtonBaseProps {
9
+ /** The label of the button. */
10
+ children: string;
11
+ /** If used, an icon will be additionally shown. The value is a name of one icon from our icon set. */
12
+ icon?: IconType;
13
+ /** The position of the icon relative to the content. */
14
+ iconPosition?: "start" | "end";
15
+ }
16
+
17
+ declare type SheetButtonProps<C extends ElementType> = SheetButtonBaseProps & {
18
+ /** The semantic component to render the Button. Preferrably `"button"`. Native props will be passed to this component. */
19
+ component?: C;
20
+ } & Omit<ComponentProps<C>, keyof SheetButtonBaseProps | "component">;
21
+
22
+ declare interface SheetButtonSectionProps {
23
+ /** Primary and secondary buttons should be placed inside this section. */
24
+ children: ReactNode;
25
+ }
26
+
27
+ declare interface SheetContentProps {
28
+ /** The content of the content section. */
29
+ children: ReactNode;
30
+ /** If `true`, the horizontal padding around the content will be removed. */
31
+ disableHorizontalPadding?: boolean;
32
+ }
33
+
34
+ declare interface SheetProps {
35
+ /** All of the subcomponents should be placed inside this property. */
36
+ children: ReactNode;
37
+ /** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */
38
+ isOpen: boolean;
39
+ /** Callback function, that is triggered when the sheet is attempted to be closed.
40
+ *
41
+ * It will be called in following cases:
42
+ * - Click on backdrop
43
+ * - Swipe down to close
44
+ * - Click on "close" icon button in the upper-right corner
45
+ * - Click on any button (PrimaryButton or SecondaryButton)
46
+ *
47
+ * Should be used in conjunction with `isOpen`. */
48
+ onClose: () => void;
49
+ /** Callback to execute when clicking back icon. */
50
+ onBack?: () => void;
51
+ /** The z-index of the sheet.. */
52
+ zIndex?: number;
53
+ }
54
+
55
+ declare interface SheetTitleProps {
56
+ /** The text content. */
57
+ children: string;
58
+ /** An optional subline that is displayed right below the title. */
59
+ subline?: string;
60
+ /** The heading level for the title. */
61
+ level?: TitleLevel;
62
+ }
63
+
64
+ declare const SideSheet: {
65
+ (props: SideSheetProps): default_2.JSX.Element;
66
+ displayName: string;
67
+ Title: ({ children, subline, level }: SheetTitleProps) => default_2.JSX.Element;
68
+ Content: ({ children, disableHorizontalPadding }: SheetContentProps) => default_2.JSX.Element;
69
+ ButtonSection: ({ children }: SheetButtonSectionProps) => default_2.JSX.Element;
70
+ PrimaryButton: <C extends default_2.ElementType>({ children, icon, iconPosition, loading, component, ...props }: SheetButtonBaseProps & {
71
+ component?: C | undefined;
72
+ } & Omit<default_2.ComponentProps<C>, keyof SheetButtonBaseProps | "component"> & {
73
+ loading?: boolean;
74
+ }) => default_2.JSX.Element;
75
+ SecondaryButton: <C extends default_2.ElementType>({ children, icon, iconPosition, component, ...props }: SheetButtonProps<C>) => default_2.JSX.Element;
76
+ };
77
+ export default SideSheet;
78
+
79
+ export declare interface SideSheetProps extends SheetProps {
80
+ /** When set to false, interaction with outside elements will be disabled and only dialog content will be visible to screen readers. */
81
+ modeless?: boolean;
82
+ /** Makes the Sheet of 400px fixed or able to expand up to 600px depending on the content */
83
+ hasDynamicWidth?: boolean;
84
+ }
85
+
86
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import e from "./src/SideSheet2.js";
2
+ export { e as default };
@@ -0,0 +1,2 @@
1
+ [data-bpds=side-sheet] .button-section-container{inline-size:100%;container-type:inline-size}@container (width>=31.25rem){[data-bpds=side-sheet] .button-section{flex-direction:row!important}}
2
+ /*$vite$:1*/
@@ -0,0 +1,10 @@
1
+ import e, { ButtonSection as t, Content as n, PrimaryButton as r, SecondaryButton as i, Title as a } from "./SideSheetRoot.js";
2
+ import "react";
3
+ import { jsx as o } from "react/jsx-runtime";
4
+ //#region src/SideSheet.tsx
5
+ var s = (t) => /* @__PURE__ */ o(e, { ...t });
6
+ s.displayName = "SideSheet", s.Title = a, s.Content = n, s.ButtonSection = t, s.PrimaryButton = r, s.SecondaryButton = i;
7
+ //#endregion
8
+ export { s as default };
9
+
10
+ //# sourceMappingURL=SideSheet2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideSheet2.js","names":[],"sources":["../../src/SideSheet.tsx"],"sourcesContent":["import React from \"react\";\n\nimport SideSheetRoot, { ButtonSection, Content, PrimaryButton, SecondaryButton, Title, type Props } from \"./SideSheetRoot\";\n\nexport type { Props, SheetButtonProps } from \"./SideSheetRoot\";\n\nconst SideSheet = (props: Props) => <SideSheetRoot {...props} />;\n\nSideSheet.displayName = \"SideSheet\";\n\nSideSheet.Title = Title;\nSideSheet.Content = Content;\nSideSheet.ButtonSection = ButtonSection;\nSideSheet.PrimaryButton = PrimaryButton;\nSideSheet.SecondaryButton = SecondaryButton;\n\nexport default SideSheet;\n"],"mappings":";;;;AAMA,IAAM,KAAa,MAAiB,kBAAC,GAAD,EAAe,GAAI,EAAQ,CAAA;AAE/D,EAAU,cAAc,aAExB,EAAU,QAAQ,GAClB,EAAU,UAAU,GACpB,EAAU,gBAAgB,GAC1B,EAAU,gBAAgB,GAC1B,EAAU,kBAAkB"}
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { createContext as e } from "react";
3
+ //#region src/SideSheetContext.ts
4
+ var t = e({
5
+ onClose: () => null,
6
+ onBack: () => null
7
+ });
8
+ //#endregion
9
+ export { t as default };
10
+
11
+ //# sourceMappingURL=SideSheetContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideSheetContext.js","names":[],"sources":["../../src/SideSheetContext.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\n\nexport interface SideSheetContextProps {\n onClose: () => void;\n onBack?: () => void;\n}\n\nconst SideSheetContext = createContext<SideSheetContextProps>({\n onClose: () => null,\n onBack: () => null,\n});\n\nexport default SideSheetContext;\n"],"mappings":";;;AASA,IAAM,IAAmB,EAAqC;CAC5D,eAAe;CACf,cAAc;AAChB,CAAC"}
@@ -0,0 +1,167 @@
1
+ "use client";
2
+ import e from "./SideSheetContext.js";
3
+ import t from "./useConsumeSideSheet.js";
4
+ /* empty css */
5
+ import "react";
6
+ import { backdrop as n, fadeAnimation as r, slideAnimation as i } from "@bonprix-ds/internal-components";
7
+ import a from "@bonprix-ds/react-button";
8
+ import o from "@bonprix-ds/react-icon-button";
9
+ import s from "@bonprix-ds/react-typography";
10
+ import { ZIndexContext as c, useBreakpointDown as l, useInnerOpen as u, usePrefersReducedMotion as d } from "@bonprix-ds/utils";
11
+ import { twMerge as f } from "tailwind-merge";
12
+ import { tv as p } from "tailwind-variants";
13
+ import * as m from "@radix-ui/react-dialog";
14
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
15
+ //#region src/SideSheetRoot.tsx
16
+ var _ = p({
17
+ slots: {
18
+ modal: "preflight fixed h-dvh flex flex-col bg-clr-bg-modal -end-100 top-0 outline-none",
19
+ header: "px-4 py-6",
20
+ titleAndIcons: "flex gap-2 items-center",
21
+ scrollArea: "h-full scroll-area relative",
22
+ buttonSection: "w-full flex flex-col gap-3 px-4 pt-6 shrink-0",
23
+ backdrop: n(),
24
+ contentWrapper: "flex flex-col w-full grow typography-body1 text-clr-primary pb-6 overflow-hidden"
25
+ },
26
+ variants: {
27
+ disableHorizontalPadding: { false: { scrollArea: "px-4" } },
28
+ prefersReducedMotion: {
29
+ false: {
30
+ modal: i(),
31
+ backdrop: r()
32
+ },
33
+ true: { modal: "end-0" }
34
+ },
35
+ hasDynamicWidth: {
36
+ false: { modal: "w-100" },
37
+ true: { modal: "min-w-100 w-fit max-w-150" }
38
+ }
39
+ }
40
+ }), v = ({ children: t, isOpen: n, modeless: r = !1, onClose: i, onBack: a, zIndex: o = 9999, hasDynamicWidth: s = !1 }) => {
41
+ let f = d(), p = l("m"), { modal: v, backdrop: y, contentWrapper: b } = _({
42
+ hasDynamicWidth: s,
43
+ prefersReducedMotion: f
44
+ }), { innerOpen: x } = u(n);
45
+ return p ? void 0 : /* @__PURE__ */ h(m.Root, {
46
+ open: x,
47
+ modal: !r,
48
+ children: /* @__PURE__ */ g(m.Portal, { children: [/* @__PURE__ */ h(m.Overlay, {
49
+ className: y(),
50
+ onClick: i,
51
+ style: { zIndex: o }
52
+ }), /* @__PURE__ */ h(m.Content, {
53
+ className: v(),
54
+ style: { zIndex: o },
55
+ "aria-describedby": void 0,
56
+ onOpenAutoFocus: (e) => {
57
+ e.preventDefault(), e.target.focus();
58
+ },
59
+ tabIndex: -1,
60
+ "data-bpds": "side-sheet",
61
+ "data-bpds-modeless": r,
62
+ "data-bpds-has-dynamic-width": s,
63
+ "aria-modal": !r,
64
+ children: /* @__PURE__ */ h(c.Provider, {
65
+ value: o,
66
+ children: /* @__PURE__ */ h(e.Provider, {
67
+ value: {
68
+ onClose: i,
69
+ onBack: a
70
+ },
71
+ children: /* @__PURE__ */ h("div", {
72
+ className: b(),
73
+ children: t
74
+ })
75
+ })
76
+ })
77
+ })] })
78
+ });
79
+ }, y = ({ children: e, subline: n, level: r = "h3" }) => {
80
+ let { onBack: i, onClose: a } = t(), { header: c, titleAndIcons: l } = _();
81
+ return /* @__PURE__ */ g("div", {
82
+ className: c(),
83
+ children: [/* @__PURE__ */ g("div", {
84
+ className: l(),
85
+ children: [
86
+ i && /* @__PURE__ */ h(o, {
87
+ onClick: i,
88
+ icon: "arrow-left",
89
+ label: "Zurück",
90
+ variant: "tertiary",
91
+ size: "small"
92
+ }),
93
+ /* @__PURE__ */ h(m.Title, {
94
+ asChild: !0,
95
+ children: /* @__PURE__ */ h("div", {
96
+ className: "grow",
97
+ children: /* @__PURE__ */ h(s, {
98
+ variant: "bonprix-h6",
99
+ component: r,
100
+ className: "line-clamp-2",
101
+ children: e
102
+ })
103
+ })
104
+ }),
105
+ /* @__PURE__ */ h(m.Close, {
106
+ asChild: !0,
107
+ children: /* @__PURE__ */ h(o, {
108
+ onClick: a,
109
+ icon: "closer",
110
+ label: "Schließen",
111
+ variant: "tertiary",
112
+ size: "small"
113
+ })
114
+ })
115
+ ]
116
+ }), n && /* @__PURE__ */ h(s, { children: n })]
117
+ });
118
+ }, b = ({ children: e, disableHorizontalPadding: t = !1 }) => {
119
+ let { scrollArea: n } = _({ disableHorizontalPadding: t });
120
+ return /* @__PURE__ */ h("div", {
121
+ className: n(),
122
+ "data-bpds-disable-horizontal-padding": t,
123
+ children: e
124
+ });
125
+ }, x = ({ children: e }) => {
126
+ let { buttonSection: t } = _();
127
+ return /* @__PURE__ */ h("div", {
128
+ className: "button-section-container",
129
+ children: /* @__PURE__ */ h("div", {
130
+ className: f(t(), "button-section"),
131
+ children: e
132
+ })
133
+ });
134
+ }, S = ({ children: e, icon: n, iconPosition: r, loading: i, component: o = "button", ...s }) => {
135
+ let { onClick: c, ...l } = s, u = o, { onClose: d } = t(), f = (e) => {
136
+ c?.(e), d();
137
+ };
138
+ return /* @__PURE__ */ h(a, {
139
+ component: u,
140
+ ...l,
141
+ variant: "primary",
142
+ onClick: f,
143
+ icon: n,
144
+ iconPosition: r,
145
+ size: "large",
146
+ loading: i,
147
+ children: e
148
+ });
149
+ }, C = ({ children: e, icon: n, iconPosition: r, component: i = "button", ...o }) => {
150
+ let s = i, { onClose: c } = t();
151
+ return /* @__PURE__ */ h(a, {
152
+ component: s,
153
+ ...o,
154
+ variant: "secondary",
155
+ type: "button",
156
+ onClick: c,
157
+ icon: n,
158
+ iconPosition: r,
159
+ size: "large",
160
+ children: e
161
+ });
162
+ };
163
+ v.displayName = "SideSheet";
164
+ //#endregion
165
+ export { x as ButtonSection, b as Content, S as PrimaryButton, C as SecondaryButton, y as Title, v as default };
166
+
167
+ //# sourceMappingURL=SideSheetRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideSheetRoot.js","names":[],"sources":["../../src/SideSheetRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { backdrop, fadeAnimation, slideAnimation } from \"@bonprix-ds/internal-components\";\nimport Button from \"@bonprix-ds/react-button\";\nimport type { IconType } from \"@bonprix-ds/react-icon\";\nimport IconButton from \"@bonprix-ds/react-icon-button\";\nimport Typography from \"@bonprix-ds/react-typography\";\nimport { TitleLevel, useBreakpointDown, useInnerOpen, usePrefersReducedMotion, ZIndexContext } from \"@bonprix-ds/utils\";\nimport { twMerge } from \"tailwind-merge\";\nimport React, { ComponentProps, ElementType, ReactNode } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\n\nimport SideSheetContext from \"./SideSheetContext\";\nimport useConsumeSideSheet from \"./useConsumeSideSheet\";\n\nimport \"./SideSheet.css\";\n\nconst generateClasses = tv({\n slots: {\n modal: \"preflight fixed h-dvh flex flex-col bg-clr-bg-modal -end-100 top-0 outline-none\",\n header: \"px-4 py-6\",\n titleAndIcons: \"flex gap-2 items-center\",\n scrollArea: \"h-full scroll-area relative\",\n buttonSection: \"w-full flex flex-col gap-3 px-4 pt-6 shrink-0\",\n backdrop: backdrop(),\n contentWrapper: \"flex flex-col w-full grow typography-body1 text-clr-primary pb-6 overflow-hidden\",\n },\n variants: {\n disableHorizontalPadding: {\n false: { scrollArea: \"px-4\" },\n },\n prefersReducedMotion: {\n false: {\n modal: slideAnimation(),\n backdrop: fadeAnimation(),\n },\n true: {\n modal: \"end-0\",\n },\n },\n hasDynamicWidth: {\n false: {\n modal: \"w-100\",\n },\n true: {\n modal: \"min-w-100 w-fit max-w-150\",\n },\n },\n },\n});\n\ninterface SheetProps {\n /** All of the subcomponents should be placed inside this property. */\n children: ReactNode;\n /** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */\n isOpen: boolean;\n /** Callback function, that is triggered when the sheet is attempted to be closed.\n *\n * It will be called in following cases:\n * - Click on backdrop\n * - Swipe down to close\n * - Click on \"close\" icon button in the upper-right corner\n * - Click on any button (PrimaryButton or SecondaryButton)\n *\n * Should be used in conjunction with `isOpen`. */\n onClose: () => void;\n /** Callback to execute when clicking back icon. */\n onBack?: () => void;\n /** The z-index of the sheet.. */\n zIndex?: number;\n}\n\nexport interface SheetTitleProps {\n /** The text content. */\n children: string;\n /** An optional subline that is displayed right below the title. */\n subline?: string;\n /** The heading level for the title. */\n level?: TitleLevel;\n}\n\nexport interface SheetButtonSectionProps {\n /** Primary and secondary buttons should be placed inside this section. */\n children: ReactNode;\n}\n\nexport interface SheetContentProps {\n /** The content of the content section. */\n children: ReactNode;\n /** If `true`, the horizontal padding around the content will be removed. */\n disableHorizontalPadding?: boolean;\n}\n\nexport interface SheetButtonBaseProps {\n /** The label of the button. */\n children: string;\n /** If used, an icon will be additionally shown. The value is a name of one icon from our icon set. */\n icon?: IconType;\n /** The position of the icon relative to the content. */\n iconPosition?: \"start\" | \"end\";\n}\n\nexport type SheetButtonProps<C extends ElementType> = SheetButtonBaseProps & {\n /** The semantic component to render the Button. Preferrably `\"button\"`. Native props will be passed to this component. */\n component?: C;\n} & Omit<ComponentProps<C>, keyof SheetButtonBaseProps | \"component\">;\n\ntype SheetPrimaryButtonProps<C extends ElementType> = SheetButtonProps<C> & {\n /** If `true`, a loading spinner will be shown instead of the content. */\n loading?: boolean;\n};\n\nexport interface Props extends SheetProps {\n /** When set to false, interaction with outside elements will be disabled and only dialog content will be visible to screen readers. */\n modeless?: boolean;\n /** Makes the Sheet of 400px fixed or able to expand up to 600px depending on the content */\n hasDynamicWidth?: boolean;\n}\n\nconst SideSheetRoot = ({ children, isOpen, modeless = false, onClose, onBack, zIndex = 9999, hasDynamicWidth = false }: Props) => {\n const prefersReducedMotion = usePrefersReducedMotion();\n const isMobile = useBreakpointDown(\"m\");\n const { modal: modalClass, backdrop, contentWrapper } = generateClasses({ hasDynamicWidth, prefersReducedMotion });\n\n const { innerOpen } = useInnerOpen(isOpen);\n\n if (isMobile) return;\n\n const shiftFocusProgrammatically = (event: Event) => {\n event.preventDefault();\n const target = event.target as HTMLElement;\n target.focus();\n };\n\n return (\n <DialogPrimitive.Root open={innerOpen} modal={!modeless}>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className={backdrop()} onClick={onClose} style={{ zIndex }} />\n <DialogPrimitive.Content\n className={modalClass()}\n style={{ zIndex }}\n aria-describedby={undefined}\n onOpenAutoFocus={shiftFocusProgrammatically}\n tabIndex={-1}\n data-bpds=\"side-sheet\"\n data-bpds-modeless={modeless}\n data-bpds-has-dynamic-width={hasDynamicWidth}\n aria-modal={!modeless}\n >\n <ZIndexContext.Provider value={zIndex}>\n <SideSheetContext.Provider value={{ onClose, onBack }}>\n <div className={contentWrapper()}>{children}</div>\n </SideSheetContext.Provider>\n </ZIndexContext.Provider>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n\nexport const Title = ({ children, subline, level = \"h3\" }: SheetTitleProps) => {\n const { onBack, onClose } = useConsumeSideSheet();\n const { header, titleAndIcons } = generateClasses();\n return (\n <div className={header()}>\n <div className={titleAndIcons()}>\n {onBack && <IconButton onClick={onBack} icon=\"arrow-left\" label=\"Zurück\" variant=\"tertiary\" size=\"small\" />}\n <DialogPrimitive.Title asChild>\n <div className=\"grow\">\n <Typography variant=\"bonprix-h6\" component={level} className=\"line-clamp-2\">\n {children}\n </Typography>\n </div>\n </DialogPrimitive.Title>\n <DialogPrimitive.Close asChild>\n <IconButton onClick={onClose} icon=\"closer\" label=\"Schließen\" variant=\"tertiary\" size=\"small\" />\n </DialogPrimitive.Close>\n </div>\n {subline && <Typography>{subline}</Typography>}\n </div>\n );\n};\n\nexport const Content = ({ children, disableHorizontalPadding = false }: SheetContentProps) => {\n const { scrollArea } = generateClasses({ disableHorizontalPadding });\n return (\n <div className={scrollArea()} data-bpds-disable-horizontal-padding={disableHorizontalPadding}>\n {children}\n </div>\n );\n};\n\nexport const ButtonSection = ({ children }: SheetButtonSectionProps) => {\n const { buttonSection } = generateClasses();\n return (\n <div className=\"button-section-container\">\n <div className={twMerge(buttonSection(), \"button-section\")}>{children}</div>\n </div>\n );\n};\n\nexport const PrimaryButton = <C extends ElementType>({\n children,\n icon,\n iconPosition,\n loading,\n component = \"button\" as C,\n ...props\n}: SheetPrimaryButtonProps<C>) => {\n const { onClick, ...otherProps } = props;\n const Component: ElementType = component;\n const { onClose } = useConsumeSideSheet();\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n onClick?.(event);\n onClose();\n };\n return (\n <Button\n component={Component}\n {...otherProps}\n variant=\"primary\"\n onClick={handleClick}\n icon={icon}\n iconPosition={iconPosition}\n size=\"large\"\n loading={loading}\n >\n {children}\n </Button>\n );\n};\n\nexport const SecondaryButton = <C extends ElementType>({\n children,\n icon,\n iconPosition,\n component = \"button\" as C,\n ...props\n}: SheetButtonProps<C>) => {\n const Component: ElementType = component;\n const { onClose } = useConsumeSideSheet();\n return (\n <Button\n component={Component}\n {...props}\n variant=\"secondary\"\n type=\"button\"\n onClick={onClose}\n icon={icon}\n iconPosition={iconPosition}\n size=\"large\"\n >\n {children}\n </Button>\n );\n};\n\nSideSheetRoot.displayName = \"SideSheet\";\n\nexport default SideSheetRoot;\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,IAAM,IAAkB,EAAG;CACzB,OAAO;EACL,OAAO;EACP,QAAQ;EACR,eAAe;EACf,YAAY;EACZ,eAAe;EACf,UAAU,EAAS;EACnB,gBAAgB;CAClB;CACA,UAAU;EACR,0BAA0B,EACxB,OAAO,EAAE,YAAY,OAAO,EAC9B;EACA,sBAAsB;GACpB,OAAO;IACL,OAAO,EAAe;IACtB,UAAU,EAAc;GAC1B;GACA,MAAM,EACJ,OAAO,QACT;EACF;EACA,iBAAiB;GACf,OAAO,EACL,OAAO,QACT;GACA,MAAM,EACJ,OAAO,4BACT;EACF;CACF;AACF,CAAC,GAsEK,KAAiB,EAAE,aAAU,WAAQ,cAAW,IAAO,YAAS,WAAQ,YAAS,MAAM,qBAAkB,SAAmB;CAChI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EACQ;EACd,MAAK;EAEJ;CACK,CAAA;AAEZ;AAEA,EAAc,cAAc"}
@@ -0,0 +1,8 @@
1
+ import e from "./SideSheetContext.js";
2
+ import { useContext as t } from "react";
3
+ //#region src/useConsumeSideSheet.ts
4
+ var n = () => t(e);
5
+ //#endregion
6
+ export { n as default };
7
+
8
+ //# sourceMappingURL=useConsumeSideSheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConsumeSideSheet.js","names":[],"sources":["../../src/useConsumeSideSheet.ts"],"sourcesContent":["import { useContext } from \"react\";\n\nimport SideSheetContext from \"./SideSheetContext\";\n\nconst useConsumeSideSheet = () => {\n return useContext(SideSheetContext);\n};\n\nexport default useConsumeSideSheet;\n"],"mappings":";;;AAIA,IAAM,UACG,EAAW,CAAgB"}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@bonprix-ds/react-side-sheet",
3
+ "version": "1.0.0",
4
+ "description": "SideSheet 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": [
12
+ "**/*.css"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "types": "./dist/index.d.ts",
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "keywords": [],
26
+ "author": "",
27
+ "license": "UNLICENSED",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/bonprix/design-system.git",
31
+ "directory": "packages/react/side-sheet"
32
+ },
33
+ "dependencies": {
34
+ "@radix-ui/react-dialog": "1.1.23",
35
+ "tailwind-merge": "2.6.1",
36
+ "@bonprix-ds/react-icon": "1.1.3",
37
+ "@bonprix-ds/internal-components": "0.1.5",
38
+ "@bonprix-ds/react-button": "1.0.0",
39
+ "@bonprix-ds/utils": "0.2.1",
40
+ "@bonprix-ds/react-typography": "1.0.4",
41
+ "@bonprix-ds/react-icon-button": "1.1.5"
42
+ },
43
+ "peerDependencies": {
44
+ "react": "^19.0.0",
45
+ "react-dom": "^19.0.0",
46
+ "tailwind-variants": "0.3.1"
47
+ },
48
+ "devDependencies": {
49
+ "vite": "8.2.2",
50
+ "@types/react": "19.2.18",
51
+ "@vitejs/plugin-react": "6.1.1",
52
+ "rollup-preserve-directives": "1.1.3",
53
+ "unplugin-dts": "1.0.3",
54
+ "@microsoft/api-extractor": "7.59.0"
55
+ },
56
+ "scripts": {
57
+ "build": "vite build"
58
+ }
59
+ }