@bonprix-ds/react-side-sheet 1.0.1 → 1.0.2

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 CHANGED
@@ -1,86 +1,2 @@
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
- export 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
- export 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
- export declare interface SheetButtonSectionProps {
23
- /** Primary and secondary buttons should be placed inside this section. */
24
- children: ReactNode;
25
- }
26
-
27
- export 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
- export 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 { }
1
+ export { default } from "./src/SideSheet";
2
+ export type { Props as SideSheetProps, SheetButtonBaseProps, SheetButtonProps, SheetButtonSectionProps, SheetContentProps, SheetTitleProps, } from "./src/SideSheet";
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { type Props } from "./SideSheetRoot";
3
+ export type { Props, SheetButtonBaseProps, SheetButtonProps, SheetButtonSectionProps, SheetContentProps, SheetTitleProps, } from "./SideSheetRoot";
4
+ declare const SideSheet: {
5
+ (props: Props): React.JSX.Element;
6
+ displayName: string;
7
+ Title: ({ children, subline, level }: import("./SideSheetRoot").SheetTitleProps) => React.JSX.Element;
8
+ Content: ({ children, disableHorizontalPadding }: import("./SideSheetRoot").SheetContentProps) => React.JSX.Element;
9
+ ButtonSection: ({ children }: import("./SideSheetRoot").SheetButtonSectionProps) => React.JSX.Element;
10
+ PrimaryButton: <C extends React.ElementType>({ children, icon, iconPosition, loading, component, ...props }: import("./SideSheetRoot").SheetButtonBaseProps & {
11
+ component?: C | undefined;
12
+ } & Omit<React.ComponentProps<C>, keyof import("./SideSheetRoot").SheetButtonBaseProps | "component"> & {
13
+ loading?: boolean;
14
+ }) => React.JSX.Element;
15
+ SecondaryButton: <C extends React.ElementType>({ children, icon, iconPosition, component, ...props }: import("./SideSheetRoot").SheetButtonProps<C>) => React.JSX.Element;
16
+ };
17
+ export default SideSheet;
@@ -0,0 +1,6 @@
1
+ export interface SideSheetContextProps {
2
+ onClose: () => void;
3
+ onBack?: () => void;
4
+ }
5
+ declare const SideSheetContext: import("react").Context<SideSheetContextProps>;
6
+ export default SideSheetContext;
@@ -0,0 +1,74 @@
1
+ import React, { ComponentProps, ElementType, ReactNode } from "react";
2
+ import type { IconType } from "@bonprix-ds/react-icon";
3
+ import { TitleLevel } from "@bonprix-ds/utils";
4
+ import "./SideSheet.css";
5
+ interface SheetProps {
6
+ /** All of the subcomponents should be placed inside this property. */
7
+ children: ReactNode;
8
+ /** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */
9
+ isOpen: boolean;
10
+ /** Callback function, that is triggered when the sheet is attempted to be closed.
11
+ *
12
+ * It will be called in following cases:
13
+ * - Click on backdrop
14
+ * - Swipe down to close
15
+ * - Click on "close" icon button in the upper-right corner
16
+ * - Click on any button (PrimaryButton or SecondaryButton)
17
+ *
18
+ * Should be used in conjunction with `isOpen`. */
19
+ onClose: () => void;
20
+ /** Callback to execute when clicking back icon. */
21
+ onBack?: () => void;
22
+ /** The z-index of the sheet.. */
23
+ zIndex?: number;
24
+ }
25
+ export interface SheetTitleProps {
26
+ /** The text content. */
27
+ children: string;
28
+ /** An optional subline that is displayed right below the title. */
29
+ subline?: string;
30
+ /** The heading level for the title. */
31
+ level?: TitleLevel;
32
+ }
33
+ export interface SheetButtonSectionProps {
34
+ /** Primary and secondary buttons should be placed inside this section. */
35
+ children: ReactNode;
36
+ }
37
+ export interface SheetContentProps {
38
+ /** The content of the content section. */
39
+ children: ReactNode;
40
+ /** If `true`, the horizontal padding around the content will be removed. */
41
+ disableHorizontalPadding?: boolean;
42
+ }
43
+ export interface SheetButtonBaseProps {
44
+ /** The label of the button. */
45
+ children: string;
46
+ /** If used, an icon will be additionally shown. The value is a name of one icon from our icon set. */
47
+ icon?: IconType;
48
+ /** The position of the icon relative to the content. */
49
+ iconPosition?: "start" | "end";
50
+ }
51
+ export type SheetButtonProps<C extends ElementType> = SheetButtonBaseProps & {
52
+ /** The semantic component to render the Button. Preferrably `"button"`. Native props will be passed to this component. */
53
+ component?: C;
54
+ } & Omit<ComponentProps<C>, keyof SheetButtonBaseProps | "component">;
55
+ type SheetPrimaryButtonProps<C extends ElementType> = SheetButtonProps<C> & {
56
+ /** If `true`, a loading spinner will be shown instead of the content. */
57
+ loading?: boolean;
58
+ };
59
+ export interface Props extends SheetProps {
60
+ /** When set to false, interaction with outside elements will be disabled and only dialog content will be visible to screen readers. */
61
+ modeless?: boolean;
62
+ /** Makes the Sheet of 400px fixed or able to expand up to 600px depending on the content */
63
+ hasDynamicWidth?: boolean;
64
+ }
65
+ declare const SideSheetRoot: {
66
+ ({ children, isOpen, modeless, onClose, onBack, zIndex, hasDynamicWidth }: Props): React.JSX.Element | undefined;
67
+ displayName: string;
68
+ };
69
+ export declare const Title: ({ children, subline, level }: SheetTitleProps) => React.JSX.Element;
70
+ export declare const Content: ({ children, disableHorizontalPadding }: SheetContentProps) => React.JSX.Element;
71
+ export declare const ButtonSection: ({ children }: SheetButtonSectionProps) => React.JSX.Element;
72
+ export declare const PrimaryButton: <C extends ElementType>({ children, icon, iconPosition, loading, component, ...props }: SheetPrimaryButtonProps<C>) => React.JSX.Element;
73
+ export declare const SecondaryButton: <C extends ElementType>({ children, icon, iconPosition, component, ...props }: SheetButtonProps<C>) => React.JSX.Element;
74
+ export default SideSheetRoot;
@@ -2,33 +2,33 @@
2
2
  import e from "./SideSheetContext.js";
3
3
  import t from "./useConsumeSideSheet.js";
4
4
  import "react";
5
- import { backdrop as n, fadeAnimation as r, slideAnimation as i } from "@bonprix-ds/internal-components";
6
- import a from "@bonprix-ds/react-button";
7
- import o from "@bonprix-ds/react-icon-button";
8
- import s from "@bonprix-ds/react-typography";
9
- import { ZIndexContext as c, useBreakpointDown as l, useInnerOpen as u, usePrefersReducedMotion as d } from "@bonprix-ds/utils";
10
- import { twMerge as f } from "tailwind-merge";
11
- import { tv as p } from "tailwind-variants";
12
- import * as m from "@radix-ui/react-dialog";
5
+ import * as n from "@radix-ui/react-dialog";
6
+ import { twMerge as r } from "tailwind-merge";
7
+ import { tv as i } from "tailwind-variants";
8
+ import { backdrop as a, fadeAnimation as o, slideAnimation as s } from "@bonprix-ds/internal-components";
9
+ import c from "@bonprix-ds/react-button";
10
+ import l from "@bonprix-ds/react-icon-button";
11
+ import u from "@bonprix-ds/react-typography";
12
+ import { ZIndexContext as d, useBreakpointDown as f, useInnerOpen as p, usePrefersReducedMotion as m } from "@bonprix-ds/utils";
13
13
  import "./SideSheet.css";
14
14
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
15
15
  //#region src/SideSheetRoot.tsx
16
- var _ = p({
16
+ var _ = i({
17
17
  slots: {
18
18
  modal: "preflight fixed h-dvh flex flex-col bg-clr-bg-modal -end-100 top-0 outline-none",
19
19
  header: "px-4 py-6",
20
20
  titleAndIcons: "flex gap-2 items-center",
21
21
  scrollArea: "h-full scroll-area relative",
22
22
  buttonSection: "w-full flex flex-col gap-3 px-4 pt-6 shrink-0",
23
- backdrop: n(),
23
+ backdrop: a(),
24
24
  contentWrapper: "flex flex-col w-full grow typography-body1 text-clr-primary pb-6 overflow-hidden"
25
25
  },
26
26
  variants: {
27
27
  disableHorizontalPadding: { false: { scrollArea: "px-4" } },
28
28
  prefersReducedMotion: {
29
29
  false: {
30
- modal: i(),
31
- backdrop: r()
30
+ modal: s(),
31
+ backdrop: o()
32
32
  },
33
33
  true: { modal: "end-0" }
34
34
  },
@@ -37,36 +37,36 @@ var _ = p({
37
37
  true: { modal: "min-w-100 w-fit max-w-150" }
38
38
  }
39
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, {
40
+ }), v = ({ children: t, isOpen: r, modeless: i = !1, onClose: a, onBack: o, zIndex: s = 9999, hasDynamicWidth: c = !1 }) => {
41
+ let l = m(), u = f("m"), { modal: v, backdrop: y, contentWrapper: b } = _({
42
+ hasDynamicWidth: c,
43
+ prefersReducedMotion: l
44
+ }), { innerOpen: x } = p(r);
45
+ return u ? void 0 : /* @__PURE__ */ h(n.Root, {
46
46
  open: x,
47
- modal: !r,
48
- children: /* @__PURE__ */ g(m.Portal, { children: [/* @__PURE__ */ h(m.Overlay, {
47
+ modal: !i,
48
+ children: /* @__PURE__ */ g(n.Portal, { children: [/* @__PURE__ */ h(n.Overlay, {
49
49
  className: y(),
50
- onClick: i,
51
- style: { zIndex: o }
52
- }), /* @__PURE__ */ h(m.Content, {
50
+ onClick: a,
51
+ style: { zIndex: s }
52
+ }), /* @__PURE__ */ h(n.Content, {
53
53
  className: v(),
54
- style: { zIndex: o },
54
+ style: { zIndex: s },
55
55
  "aria-describedby": void 0,
56
56
  onOpenAutoFocus: (e) => {
57
57
  e.preventDefault(), e.target.focus();
58
58
  },
59
59
  tabIndex: -1,
60
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,
61
+ "data-bpds-modeless": i,
62
+ "data-bpds-has-dynamic-width": c,
63
+ "aria-modal": !i,
64
+ children: /* @__PURE__ */ h(d.Provider, {
65
+ value: s,
66
66
  children: /* @__PURE__ */ h(e.Provider, {
67
67
  value: {
68
- onClose: i,
69
- onBack: a
68
+ onClose: a,
69
+ onBack: o
70
70
  },
71
71
  children: /* @__PURE__ */ h("div", {
72
72
  className: b(),
@@ -76,36 +76,36 @@ var _ = p({
76
76
  })
77
77
  })] })
78
78
  });
79
- }, y = ({ children: e, subline: n, level: r = "h3" }) => {
80
- let { onBack: i, onClose: a } = t(), { header: c, titleAndIcons: l } = _();
79
+ }, y = ({ children: e, subline: r, level: i = "h3" }) => {
80
+ let { onBack: a, onClose: o } = t(), { header: s, titleAndIcons: c } = _();
81
81
  return /* @__PURE__ */ g("div", {
82
- className: c(),
82
+ className: s(),
83
83
  children: [/* @__PURE__ */ g("div", {
84
- className: l(),
84
+ className: c(),
85
85
  children: [
86
- i && /* @__PURE__ */ h(o, {
87
- onClick: i,
86
+ a && /* @__PURE__ */ h(l, {
87
+ onClick: a,
88
88
  icon: "arrow-left",
89
89
  label: "Zurück",
90
90
  variant: "tertiary",
91
91
  size: "small"
92
92
  }),
93
- /* @__PURE__ */ h(m.Title, {
93
+ /* @__PURE__ */ h(n.Title, {
94
94
  asChild: !0,
95
95
  children: /* @__PURE__ */ h("div", {
96
96
  className: "grow",
97
- children: /* @__PURE__ */ h(s, {
97
+ children: /* @__PURE__ */ h(u, {
98
98
  variant: "bonprix-h6",
99
- component: r,
99
+ component: i,
100
100
  className: "line-clamp-2",
101
101
  children: e
102
102
  })
103
103
  })
104
104
  }),
105
- /* @__PURE__ */ h(m.Close, {
105
+ /* @__PURE__ */ h(n.Close, {
106
106
  asChild: !0,
107
- children: /* @__PURE__ */ h(o, {
108
- onClick: a,
107
+ children: /* @__PURE__ */ h(l, {
108
+ onClick: o,
109
109
  icon: "closer",
110
110
  label: "Schließen",
111
111
  variant: "tertiary",
@@ -113,7 +113,7 @@ var _ = p({
113
113
  })
114
114
  })
115
115
  ]
116
- }), n && /* @__PURE__ */ h(s, { children: n })]
116
+ }), r && /* @__PURE__ */ h(u, { children: r })]
117
117
  });
118
118
  }, b = ({ children: e, disableHorizontalPadding: t = !1 }) => {
119
119
  let { scrollArea: n } = _({ disableHorizontalPadding: t });
@@ -127,15 +127,15 @@ var _ = p({
127
127
  return /* @__PURE__ */ h("div", {
128
128
  className: "button-section-container",
129
129
  children: /* @__PURE__ */ h("div", {
130
- className: f(t(), "button-section"),
130
+ className: r(t(), "button-section"),
131
131
  children: e
132
132
  })
133
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();
134
+ }, S = ({ children: e, icon: n, iconPosition: r, loading: i, component: a = "button", ...o }) => {
135
+ let { onClick: s, ...l } = o, u = a, { onClose: d } = t(), f = (e) => {
136
+ s?.(e), d();
137
137
  };
138
- return /* @__PURE__ */ h(a, {
138
+ return /* @__PURE__ */ h(c, {
139
139
  component: u,
140
140
  ...l,
141
141
  variant: "primary",
@@ -146,14 +146,14 @@ var _ = p({
146
146
  loading: i,
147
147
  children: e
148
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,
149
+ }, C = ({ children: e, icon: n, iconPosition: r, component: i = "button", ...a }) => {
150
+ let o = i, { onClose: s } = t();
151
+ return /* @__PURE__ */ h(c, {
152
+ component: o,
153
+ ...a,
154
154
  variant: "secondary",
155
155
  type: "button",
156
- onClick: c,
156
+ onClick: s,
157
157
  icon: n,
158
158
  iconPosition: r,
159
159
  size: "large",
@@ -1 +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,Y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AQ;EACR,MAAK;EACL,SAAS;EACH;EACQ;EACd,MAAK;EAEJ;CACK,CAAA;AAEZ;AAEA,EAAc,cAAc"}
1
+ {"version":3,"file":"SideSheetRoot.js","names":[],"sources":["../../src/SideSheetRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport React, { ComponentProps, ElementType, ReactNode } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { tv } from \"tailwind-variants\";\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\";\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 // oxlint-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":";;;;;;;;;;;;;;;AAmBA,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,E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AAA;AAEZ,GAEa,KAA0C,EACrD,aACA,SACA,iBACA,eAAY,UACZ,GAAG,QACsB;CACzB,IAAM,IAAyB,GACzB,EAAE,eAAY,EAAoB;CACxC,OACE,kBAAC,GAAD;EACE,WAAW;EACX,GAAI;EACJ,SAAQ;EACR,MAAK;EACL,SAAS;EACH;EACQ;EACd,MAAK;EAEJ;CACK,CAAA;AAEZ;AAEA,EAAc,cAAc"}
@@ -0,0 +1,2 @@
1
+ declare const useConsumeSideSheet: () => import("./SideSheetContext").SideSheetContextProps;
2
+ export default useConsumeSideSheet;
package/package.json CHANGED
@@ -1,16 +1,27 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-side-sheet",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "SideSheet component, implemented in React, for the Bonprix Design System.",
5
- "type": "module",
6
- "publishConfig": {
7
- "access": "public",
8
- "provenance": true
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/side-sheet"
9
12
  },
10
- "module": "./dist/index.js",
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": [
12
21
  "**/*.css"
13
22
  ],
23
+ "module": "./dist/index.js",
24
+ "types": "./dist/index.d.ts",
14
25
  "exports": {
15
26
  ".": {
16
27
  "import": "./dist/index.js",
@@ -18,42 +29,32 @@
18
29
  "default": "./dist/index.js"
19
30
  }
20
31
  },
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
+ "publishConfig": {
33
+ "access": "public",
34
+ "provenance": true
32
35
  },
33
36
  "dependencies": {
34
37
  "@radix-ui/react-dialog": "1.1.23",
35
38
  "tailwind-merge": "2.6.1",
36
- "@bonprix-ds/internal-components": "0.2.0",
37
- "@bonprix-ds/react-button": "1.1.0",
38
- "@bonprix-ds/react-icon": "1.2.0",
39
- "@bonprix-ds/react-icon-button": "1.2.0",
39
+ "@bonprix-ds/react-button": "1.1.1",
40
+ "@bonprix-ds/internal-components": "0.2.1",
41
+ "@bonprix-ds/react-icon": "1.2.1",
42
+ "@bonprix-ds/react-icon-button": "1.2.1",
40
43
  "@bonprix-ds/react-typography": "1.0.4",
41
44
  "@bonprix-ds/utils": "0.2.2"
42
45
  },
43
- "peerDependencies": {
44
- "react": "^19.0.0",
45
- "react-dom": "^19.0.0",
46
- "tailwind-variants": "0.3.1"
47
- },
48
46
  "devDependencies": {
49
- "vite": "8.2.2",
50
- "@types/react": "19.2.18",
47
+ "@types/react": "19.3.0",
51
48
  "@vitejs/plugin-react": "6.1.1",
52
49
  "rollup-preserve-directives": "1.1.3",
53
- "unplugin-dts": "1.1.0",
54
- "@microsoft/api-extractor": "7.59.1",
50
+ "vite": "8.3.0",
55
51
  "@bonprix-ds/vite-config": "0.0.0"
56
52
  },
53
+ "peerDependencies": {
54
+ "react": "^19.3.0",
55
+ "react-dom": "^19.3.0",
56
+ "tailwind-variants": "0.3.1"
57
+ },
57
58
  "scripts": {
58
59
  "build": "vite build"
59
60
  }