@bonprix-ds/react-side-sheet 1.2.1 → 1.3.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.js CHANGED
@@ -1,2 +1 @@
1
- import e from "./src/SideSheet.js";
2
- export { e as default };
1
+ export { default } from "./src/SideSheet.js";
@@ -1,10 +1,9 @@
1
1
  import e, { ButtonSection as t, Content as n, PrimaryButton as r, SecondaryButton as i, Title as a } from "./SideSheetRoot.js";
2
2
  import "react";
3
3
  import { jsx as o } from "react/jsx-runtime";
4
- //#region src/SideSheet.tsx
4
+ // src/SideSheet.tsx
5
5
  var s = (t) => /* @__PURE__ */ o(e, { ...t });
6
6
  s.displayName = "SideSheet", s.Title = a, s.Content = n, s.ButtonSection = t, s.PrimaryButton = r, s.SecondaryButton = i;
7
- //#endregion
8
7
  export { s as default };
9
8
 
10
9
  //# sourceMappingURL=SideSheet.js.map
@@ -1,6 +1,8 @@
1
1
  export interface SideSheetContextProps {
2
2
  onClose: () => void;
3
3
  onBack?: () => void;
4
+ closeButtonLabel: string;
5
+ backButtonLabel: string;
4
6
  }
5
7
  declare const SideSheetContext: import("react").Context<SideSheetContextProps>;
6
8
  export default SideSheetContext;
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import { createContext as e } from "react";
3
- //#region src/SideSheetContext.ts
3
+ // src/SideSheetContext.ts
4
4
  var t = e({
5
5
  onClose: () => null,
6
- onBack: () => null
6
+ onBack: () => null,
7
+ closeButtonLabel: "Schließen",
8
+ backButtonLabel: "Zurück"
7
9
  });
8
- //#endregion
9
10
  export { t as default };
10
11
 
11
12
  //# sourceMappingURL=SideSheetContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetContext.js","names":["SideSheetContext","createContext"],"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,IAAMA,IAAmBC,EAAqC;CAC5D,eAAe;CACf,cAAc;AAChB,CAAC"}
1
+ {"version":3,"file":"SideSheetContext.js","names":["SideSheetContext","createContext"],"sources":["../../src/SideSheetContext.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\n\nexport interface SideSheetContextProps {\n onClose: () => void;\n onBack?: () => void;\n closeButtonLabel: string;\n backButtonLabel: string;\n}\n\nconst SideSheetContext = createContext<SideSheetContextProps>({\n onClose: () => null,\n onBack: () => null,\n closeButtonLabel: \"Schließen\",\n backButtonLabel: \"Zurück\",\n});\n\nexport default SideSheetContext;\n"],"mappings":";;;AAWA,IAAMA,IAAmBC,EAAqC;CAC5D,eAAe;CACf,cAAc;CACd,kBAAkB;CAClB,iBAAiB;AACnB,CAAC"}
@@ -14,12 +14,18 @@ interface SheetProps {
14
14
  * - Click on "close" icon button in the upper-right corner
15
15
  * - Click on any button (PrimaryButton or SecondaryButton)
16
16
  *
17
- * Should be used in conjunction with `open`. */
17
+ * Should be used in conjunction with `open`.
18
+ *
19
+ * Once the sheet has closed, focus returns to the element that had it before the sheet opened. */
18
20
  onClose: () => void;
19
21
  /** Callback to execute when clicking back icon. */
20
22
  onBack?: () => void;
21
23
  /** The z-index of the sheet.. */
22
24
  zIndex?: number;
25
+ /** The accessible name of the close button. */
26
+ closeButtonLabel?: string;
27
+ /** The accessible name of the back button. */
28
+ backButtonLabel?: string;
23
29
  }
24
30
  type OpenProps = SheetProps & {
25
31
  /** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */
@@ -70,13 +76,17 @@ type SheetPrimaryButtonProps<C extends ElementType> = SheetButtonProps<C> & {
70
76
  loading?: boolean;
71
77
  };
72
78
  export type Props = (DeprecatedOpenProps | OpenProps) & {
73
- /** When set to false, interaction with outside elements will be disabled and only dialog content will be visible to screen readers. */
79
+ /**
80
+ * When set to false, interaction with outside elements will be disabled and only dialog content will be visible to screen readers.
81
+ *
82
+ * A modeless sheet that closes while focus is outside it, such as on a page control that closed it, leaves focus there.
83
+ */
74
84
  modeless?: boolean;
75
85
  /** Makes the Sheet of 400px fixed or able to expand up to 600px depending on the content */
76
86
  hasDynamicWidth?: boolean;
77
87
  };
78
88
  declare const SideSheetRoot: {
79
- ({ children, open, isOpen, modeless, onClose, onBack, zIndex, hasDynamicWidth }: Props): React.JSX.Element | undefined;
89
+ ({ children, open, isOpen, modeless, onClose, onBack, zIndex, hasDynamicWidth, closeButtonLabel, backButtonLabel, }: Props): React.JSX.Element | undefined;
80
90
  displayName: string;
81
91
  };
82
92
  export declare const Title: ({ children, subline, level: Level }: SheetTitleProps) => React.JSX.Element;
@@ -9,12 +9,12 @@ import { backdrop as o, fadeAnimation as s, slideAnimation as c } from "@bonprix
9
9
  import l from "@bonprix-ds/react-button";
10
10
  import u from "@bonprix-ds/react-icon-button";
11
11
  import { ArrowLeftIcon as d, CloserIcon as f } from "@bonprix-ds/react-icon/icons";
12
- import { ZIndexContext as p, useBreakpointDown as m, useInnerOpen as h, usePrefersReducedMotion as g } from "@bonprix-ds/utils";
13
- import { warnDeprecated as _ } from "@bonprix-ds/utils/deprecation";
12
+ import { ZIndexContext as p, useBreakpointDown as m, useFocusReturn as h, useInnerOpen as g, usePrefersReducedMotion as _ } from "@bonprix-ds/utils";
13
+ import { warnDeprecated as v } from "@bonprix-ds/utils/deprecation";
14
14
  import "#styles";
15
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
16
- //#region src/SideSheetRoot.tsx
17
- var b = a({
15
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
16
+ // src/SideSheetRoot.tsx
17
+ var x = a({
18
18
  slots: {
19
19
  modal: "preflight fixed -end-100 top-0 flex h-dvh flex-col bg-clr-bg-modal outline-none",
20
20
  header: "px-4 py-6",
@@ -38,111 +38,116 @@ var b = a({
38
38
  true: { modal: "w-fit min-w-100 max-w-150" }
39
39
  }
40
40
  }
41
- }), x = ({ children: t, open: i, isOpen: a, modeless: o = !1, onClose: s, onBack: c, zIndex: l = 9999, hasDynamicWidth: u = !1 }) => {
42
- a !== void 0 && _("is-open-prop");
43
- let d = g(), f = m("m"), { modal: x, backdrop: S, contentWrapper: C } = b({
41
+ }), S = ({ children: t, open: i, isOpen: a, modeless: o = !1, onClose: s, onBack: c, zIndex: l = 9999, hasDynamicWidth: u = !1, closeButtonLabel: d = "Schließen", backButtonLabel: f = "Zurück" }) => {
42
+ a !== void 0 && v("is-open-prop");
43
+ let S = _(), C = m("m"), { modal: w, backdrop: T, contentWrapper: E } = x({
44
44
  hasDynamicWidth: u,
45
- prefersReducedMotion: d
46
- }), { innerOpen: w } = h(i ?? a ?? !1), T = n(null);
47
- return f ? void 0 : /* @__PURE__ */ v(r.Root, {
48
- open: w,
45
+ prefersReducedMotion: S
46
+ }), { innerOpen: D } = g(i ?? a ?? !1), O = n(null), { returnFocus: k } = h(D, O);
47
+ return C ? void 0 : /* @__PURE__ */ y(r.Root, {
48
+ open: D,
49
49
  modal: !o,
50
- children: /* @__PURE__ */ y(r.Portal, { children: [/* @__PURE__ */ v(r.Overlay, {
51
- className: S(),
50
+ children: /* @__PURE__ */ b(r.Portal, { children: [/* @__PURE__ */ y(r.Overlay, {
51
+ className: T(),
52
52
  onClick: s,
53
53
  style: { zIndex: l }
54
- }), /* @__PURE__ */ v(r.Content, {
55
- ref: T,
56
- className: x(),
54
+ }), /* @__PURE__ */ y(r.Content, {
55
+ ref: O,
56
+ className: w(),
57
57
  style: { zIndex: l },
58
58
  "aria-describedby": void 0,
59
59
  onOpenAutoFocus: (e) => {
60
60
  e.preventDefault(), e.target.focus();
61
61
  },
62
+ onCloseAutoFocus: (e) => {
63
+ e.preventDefault(), k();
64
+ },
62
65
  onEscapeKeyDown: (e) => {
63
- (!o || T.current?.contains(e.target)) && s();
66
+ (!o || O.current?.contains(e.target)) && s();
64
67
  },
65
68
  tabIndex: -1,
66
69
  "data-bpds": "side-sheet",
67
70
  "data-bpds-modeless": o,
68
71
  "data-bpds-has-dynamic-width": u,
69
72
  "aria-modal": !o,
70
- children: /* @__PURE__ */ v(p.Provider, {
73
+ children: /* @__PURE__ */ y(p.Provider, {
71
74
  value: l,
72
- children: /* @__PURE__ */ v(e.Provider, {
75
+ children: /* @__PURE__ */ y(e.Provider, {
73
76
  value: {
74
77
  onClose: s,
75
- onBack: c
78
+ onBack: c,
79
+ closeButtonLabel: d,
80
+ backButtonLabel: f
76
81
  },
77
- children: /* @__PURE__ */ v("div", {
78
- className: C(),
82
+ children: /* @__PURE__ */ y("div", {
83
+ className: E(),
79
84
  children: t
80
85
  })
81
86
  })
82
87
  })
83
88
  })] })
84
89
  });
85
- }, S = ({ children: e, subline: n, level: i = "h3" }) => {
86
- let { onBack: a, onClose: o } = t(), { header: s, titleAndIcons: c } = b();
87
- return /* @__PURE__ */ y("div", {
88
- className: s(),
89
- children: [/* @__PURE__ */ y("div", {
90
- className: c(),
90
+ }, C = ({ children: e, subline: n, level: i = "h3" }) => {
91
+ let { onBack: a, onClose: o, closeButtonLabel: s, backButtonLabel: c } = t(), { header: l, titleAndIcons: p } = x();
92
+ return /* @__PURE__ */ b("div", {
93
+ className: l(),
94
+ children: [/* @__PURE__ */ b("div", {
95
+ className: p(),
91
96
  children: [
92
- a && /* @__PURE__ */ v(u, {
97
+ a && /* @__PURE__ */ y(u, {
93
98
  onClick: a,
94
- icon: /* @__PURE__ */ v(d, {}),
95
- label: "Zurück",
99
+ icon: /* @__PURE__ */ y(d, {}),
100
+ label: c,
96
101
  variant: "tertiary",
97
102
  size: "small"
98
103
  }),
99
- /* @__PURE__ */ v(r.Title, {
104
+ /* @__PURE__ */ y(r.Title, {
100
105
  asChild: !0,
101
- children: /* @__PURE__ */ v("div", {
106
+ children: /* @__PURE__ */ y("div", {
102
107
  className: "grow",
103
- children: /* @__PURE__ */ v(i, {
108
+ children: /* @__PURE__ */ y(i, {
104
109
  className: "typography-bonprix-h6 my-0 line-clamp-2 text-start text-clr-on-bg-high",
105
110
  children: e
106
111
  })
107
112
  })
108
113
  }),
109
- /* @__PURE__ */ v(r.Close, {
114
+ /* @__PURE__ */ y(r.Close, {
110
115
  asChild: !0,
111
- children: /* @__PURE__ */ v(u, {
116
+ children: /* @__PURE__ */ y(u, {
112
117
  onClick: o,
113
- icon: /* @__PURE__ */ v(f, {}),
114
- label: "Schließen",
118
+ icon: /* @__PURE__ */ y(f, {}),
119
+ label: s,
115
120
  variant: "tertiary",
116
121
  size: "small"
117
122
  })
118
123
  })
119
124
  ]
120
- }), n && /* @__PURE__ */ v("p", {
125
+ }), n && /* @__PURE__ */ y("p", {
121
126
  className: "typography-body1 my-0 text-start text-clr-on-bg-high",
122
127
  children: n
123
128
  })]
124
129
  });
125
- }, C = ({ children: e, disableHorizontalPadding: t = !1 }) => {
126
- let { scrollArea: n } = b({ disableHorizontalPadding: t });
127
- return /* @__PURE__ */ v("div", {
130
+ }, w = ({ children: e, disableHorizontalPadding: t = !1 }) => {
131
+ let { scrollArea: n } = x({ disableHorizontalPadding: t });
132
+ return /* @__PURE__ */ y("div", {
128
133
  className: n(),
129
134
  "data-bpds-disable-horizontal-padding": t,
130
135
  children: e
131
136
  });
132
- }, w = ({ children: e }) => {
133
- let { buttonSection: t } = b();
134
- return /* @__PURE__ */ v("div", {
137
+ }, T = ({ children: e }) => {
138
+ let { buttonSection: t } = x();
139
+ return /* @__PURE__ */ y("div", {
135
140
  className: "button-section-container",
136
- children: /* @__PURE__ */ v("div", {
141
+ children: /* @__PURE__ */ y("div", {
137
142
  className: i(t(), "button-section"),
138
143
  children: e
139
144
  })
140
145
  });
141
- }, T = ({ children: e, icon: n, iconPosition: r, loading: i, component: a = "button", ...o }) => {
146
+ }, E = ({ children: e, icon: n, iconPosition: r, loading: i, component: a = "button", ...o }) => {
142
147
  let { onClick: s, ...c } = o, u = a, { onClose: d } = t(), f = (e) => {
143
148
  s?.(e), d();
144
149
  };
145
- return /* @__PURE__ */ v(l, {
150
+ return /* @__PURE__ */ y(l, {
146
151
  component: u,
147
152
  ...c,
148
153
  variant: "primary",
@@ -153,9 +158,9 @@ var b = a({
153
158
  loading: i,
154
159
  children: e
155
160
  });
156
- }, E = ({ children: e, icon: n, iconPosition: r, component: i = "button", ...a }) => {
161
+ }, D = ({ children: e, icon: n, iconPosition: r, component: i = "button", ...a }) => {
157
162
  let o = i, { onClose: s } = t();
158
- return /* @__PURE__ */ v(l, {
163
+ return /* @__PURE__ */ y(l, {
159
164
  component: o,
160
165
  ...a,
161
166
  variant: "secondary",
@@ -167,8 +172,7 @@ var b = a({
167
172
  children: e
168
173
  });
169
174
  };
170
- x.displayName = "SideSheet";
171
- //#endregion
172
- export { w as ButtonSection, C as Content, T as PrimaryButton, E as SecondaryButton, S as Title, x as default };
175
+ S.displayName = "SideSheet";
176
+ export { T as ButtonSection, w as Content, E as PrimaryButton, D as SecondaryButton, C as Title, S as default };
173
177
 
174
178
  //# sourceMappingURL=SideSheetRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetRoot.js","names":["SideSheetContext","useConsumeSideSheet","DialogPrimitive","Button","IconButton","generateClasses","tv","backdrop","slideAnimation","fadeAnimation","SideSheetRoot","isOpen","warnDeprecated","prefersReducedMotion","usePrefersReducedMotion","isMobile","useBreakpointDown","modalClass","useInnerOpen","open","contentRef","useRef","innerOpen","modeless","onClose","event","hasDynamicWidth","ZIndexContext","zIndex","contentWrapper","Title","Level","header","titleAndIcons","onBack","ArrowLeftIcon","CloserIcon","subline","Content","scrollArea","disableHorizontalPadding","ButtonSection","twMerge","buttonSection","PrimaryButton","props","otherProps","Component","component","handleClick","onClick","SecondaryButton"],"sources":["../../src/SideSheetRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport React, { ComponentProps, ElementType, ReactNode, useRef } 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 { IconOrElement } from \"@bonprix-ds/react-icon\";\nimport IconButton from \"@bonprix-ds/react-icon-button\";\nimport { ArrowLeftIcon, CloserIcon } from \"@bonprix-ds/react-icon/icons\";\nimport { TitleLevel, useBreakpointDown, useInnerOpen, usePrefersReducedMotion, ZIndexContext } from \"@bonprix-ds/utils\";\nimport { warnDeprecated } from \"@bonprix-ds/utils/deprecation\";\n\nimport SideSheetContext from \"./SideSheetContext\";\nimport useConsumeSideSheet from \"./useConsumeSideSheet\";\n\nimport \"./SideSheet.css\";\n\nconst generateClasses = tv({\n slots: {\n modal: \"preflight fixed -end-100 top-0 flex h-dvh flex-col bg-clr-bg-modal outline-none\",\n header: \"px-4 py-6\",\n titleAndIcons: \"flex items-center gap-2\",\n scrollArea: \"scroll-area relative h-full\",\n buttonSection: \"flex w-full shrink-0 flex-col gap-3 px-4 pt-6\",\n backdrop: backdrop(),\n contentWrapper: \"typography-body1 flex w-full grow flex-col overflow-hidden pb-6 text-clr-primary\",\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: \"w-fit min-w-100 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 /** 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 * - Press of the `Escape` key (with `modeless`, only while the focus is inside the sheet)\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 `open`. */\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\ntype OpenProps = SheetProps & {\n /** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */\n open: boolean;\n /** @deprecated [is-open-prop] Use `open` instead. */\n isOpen?: never;\n};\n\ntype DeprecatedOpenProps = SheetProps & {\n open?: never;\n /**\n * Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property.\n * @deprecated [is-open-prop] Use `open` instead.\n */\n isOpen: boolean;\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 either a name of one icon from our icon set or an inline `<svg>` element. */\n icon?: IconOrElement;\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 type Props = (DeprecatedOpenProps | OpenProps) & {\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, open, isOpen, modeless = false, onClose, onBack, zIndex = 9999, hasDynamicWidth = false }: Props) => {\n if (isOpen !== undefined) warnDeprecated(\"is-open-prop\");\n const prefersReducedMotion = usePrefersReducedMotion();\n const isMobile = useBreakpointDown(\"m\");\n const { modal: modalClass, backdrop, contentWrapper } = generateClasses({ hasDynamicWidth, prefersReducedMotion });\n\n const { innerOpen } = useInnerOpen(open ?? isOpen ?? false);\n const contentRef = useRef<HTMLDivElement>(null);\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 const closeOnEscape = (event: KeyboardEvent) => {\n if (modeless && !contentRef.current?.contains(event.target as Node)) return;\n onClose();\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 ref={contentRef}\n className={modalClass()}\n style={{ zIndex }}\n aria-describedby={undefined}\n onOpenAutoFocus={shiftFocusProgrammatically}\n onEscapeKeyDown={closeOnEscape}\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: 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={<ArrowLeftIcon />} label=\"Zurück\" variant=\"tertiary\" size=\"small\" />}\n <DialogPrimitive.Title asChild>\n <div className=\"grow\">\n <Level className=\"typography-bonprix-h6 my-0 line-clamp-2 text-start text-clr-on-bg-high\">{children}</Level>\n </div>\n </DialogPrimitive.Title>\n <DialogPrimitive.Close asChild>\n <IconButton onClick={onClose} icon={<CloserIcon />} label=\"Schließen\" variant=\"tertiary\" size=\"small\" />\n </DialogPrimitive.Close>\n </div>\n {subline && <p className=\"typography-body1 my-0 text-start text-clr-on-bg-high\">{subline}</p>}\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":";;;;;;;;;;;;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AC;CACnE,OACE,kBAAC,OAAD;EAAK,WAAWkC,EAAW;EAAG,wCAAsCC;EACjE;CACE,CAAA;AAET,GAEaC,KAAiB,EAAE,kBAAwC;CACtE,IAAM,EAAE,qBAAkBpC,EAAgB;CAC1C,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD;GAAK,WAAWqC,EAAQC,EAAc,GAAG,gBAAgB;GAAI;EAAc,CAAA;CACxE,CAAA;AAET,GAEaC,KAAwC,EACnD,aACA,SACA,iBACA,YACA,eAAY,UACZ,GAAGC,QAC6B;CAChC,IAAM,EAAE,YAAS,GAAGC,MAAeD,GAC7BE,IAAyBC,GACzB,EAAE,eAAY/C,EAAoB,GAClCgD,KAAe,MAA+C;EAGlE,AADAC,IAAUzB,CAAK,GACfD,EAAQ;CACV;CACA,OACE,kBAACrB,GAAD;EACE,WAAW4C;EACX,GAAID;EACJ,SAAQ;EACR,SAASG;EACH;EACQ;EACd,MAAK;EACI;EAER;CACK,CAAA;AAEZ,GAEaE,KAA0C,EACrD,aACA,SACA,iBACA,eAAY,UACZ,GAAGN,QACsB;CACzB,IAAME,IAAyBC,GACzB,EAAE,eAAY/C,EAAoB;CACxC,OACE,kBAACE,GAAD;EACE,WAAW4C;EACX,GAAIF;EACJ,SAAQ;EACR,MAAK;EACL,SAASrB;EACH;EACQ;EACd,MAAK;EAEJ;CACK,CAAA;AAEZ;AAEA,EAAc,cAAc"}
1
+ {"version":3,"file":"SideSheetRoot.js","names":["SideSheetContext","useConsumeSideSheet","DialogPrimitive","Button","IconButton","generateClasses","tv","backdrop","slideAnimation","fadeAnimation","SideSheetRoot","isOpen","warnDeprecated","prefersReducedMotion","usePrefersReducedMotion","isMobile","useBreakpointDown","modalClass","useInnerOpen","open","contentRef","useRef","useFocusReturn","innerOpen","modeless","onClose","event","returnFocus","hasDynamicWidth","ZIndexContext","zIndex","contentWrapper","Title","Level","header","titleAndIcons","onBack","ArrowLeftIcon","backButtonLabel","CloserIcon","closeButtonLabel","subline","Content","scrollArea","disableHorizontalPadding","ButtonSection","twMerge","buttonSection","PrimaryButton","props","otherProps","Component","component","handleClick","onClick","SecondaryButton"],"sources":["../../src/SideSheetRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport React, { ComponentProps, ElementType, ReactNode, useRef } 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 { IconOrElement } from \"@bonprix-ds/react-icon\";\nimport IconButton from \"@bonprix-ds/react-icon-button\";\nimport { ArrowLeftIcon, CloserIcon } from \"@bonprix-ds/react-icon/icons\";\nimport { TitleLevel, useBreakpointDown, useFocusReturn, useInnerOpen, usePrefersReducedMotion, ZIndexContext } from \"@bonprix-ds/utils\";\nimport { warnDeprecated } from \"@bonprix-ds/utils/deprecation\";\n\nimport SideSheetContext from \"./SideSheetContext\";\nimport useConsumeSideSheet from \"./useConsumeSideSheet\";\n\nimport \"./SideSheet.css\";\n\nconst generateClasses = tv({\n slots: {\n modal: \"preflight fixed -end-100 top-0 flex h-dvh flex-col bg-clr-bg-modal outline-none\",\n header: \"px-4 py-6\",\n titleAndIcons: \"flex items-center gap-2\",\n scrollArea: \"scroll-area relative h-full\",\n buttonSection: \"flex w-full shrink-0 flex-col gap-3 px-4 pt-6\",\n backdrop: backdrop(),\n contentWrapper: \"typography-body1 flex w-full grow flex-col overflow-hidden pb-6 text-clr-primary\",\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: \"w-fit min-w-100 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 /** 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 * - Press of the `Escape` key (with `modeless`, only while the focus is inside the sheet)\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 `open`.\n *\n * Once the sheet has closed, focus returns to the element that had it before the sheet opened. */\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 /** The accessible name of the close button. */\n closeButtonLabel?: string;\n /** The accessible name of the back button. */\n backButtonLabel?: string;\n}\n\ntype OpenProps = SheetProps & {\n /** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */\n open: boolean;\n /** @deprecated [is-open-prop] Use `open` instead. */\n isOpen?: never;\n};\n\ntype DeprecatedOpenProps = SheetProps & {\n open?: never;\n /**\n * Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property.\n * @deprecated [is-open-prop] Use `open` instead.\n */\n isOpen: boolean;\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 either a name of one icon from our icon set or an inline `<svg>` element. */\n icon?: IconOrElement;\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 type Props = (DeprecatedOpenProps | OpenProps) & {\n /**\n * When set to false, interaction with outside elements will be disabled and only dialog content will be visible to screen readers.\n *\n * A modeless sheet that closes while focus is outside it, such as on a page control that closed it, leaves focus there.\n */\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 = ({\n children,\n open,\n isOpen,\n modeless = false,\n onClose,\n onBack,\n zIndex = 9999,\n hasDynamicWidth = false,\n closeButtonLabel = \"Schließen\",\n backButtonLabel = \"Zurück\",\n}: Props) => {\n if (isOpen !== undefined) warnDeprecated(\"is-open-prop\");\n const prefersReducedMotion = usePrefersReducedMotion();\n const isMobile = useBreakpointDown(\"m\");\n const { modal: modalClass, backdrop, contentWrapper } = generateClasses({ hasDynamicWidth, prefersReducedMotion });\n\n const { innerOpen } = useInnerOpen(open ?? isOpen ?? false);\n const contentRef = useRef<HTMLDivElement>(null);\n const { returnFocus } = useFocusReturn(innerOpen, contentRef);\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 const returnFocusOnceClosed = (event: Event) => {\n event.preventDefault();\n returnFocus();\n };\n\n const closeOnEscape = (event: KeyboardEvent) => {\n if (modeless && !contentRef.current?.contains(event.target as Node)) return;\n onClose();\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 ref={contentRef}\n className={modalClass()}\n style={{ zIndex }}\n aria-describedby={undefined}\n onOpenAutoFocus={shiftFocusProgrammatically}\n onCloseAutoFocus={returnFocusOnceClosed}\n onEscapeKeyDown={closeOnEscape}\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, closeButtonLabel, backButtonLabel }}>\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: Level = \"h3\" }: SheetTitleProps) => {\n const { onBack, onClose, closeButtonLabel, backButtonLabel } = useConsumeSideSheet();\n const { header, titleAndIcons } = generateClasses();\n return (\n <div className={header()}>\n <div className={titleAndIcons()}>\n {onBack && <IconButton onClick={onBack} icon={<ArrowLeftIcon />} label={backButtonLabel} variant=\"tertiary\" size=\"small\" />}\n <DialogPrimitive.Title asChild>\n <div className=\"grow\">\n <Level className=\"typography-bonprix-h6 my-0 line-clamp-2 text-start text-clr-on-bg-high\">{children}</Level>\n </div>\n </DialogPrimitive.Title>\n <DialogPrimitive.Close asChild>\n <IconButton onClick={onClose} icon={<CloserIcon />} label={closeButtonLabel} variant=\"tertiary\" size=\"small\" />\n </DialogPrimitive.Close>\n </div>\n {subline && <p className=\"typography-body1 my-0 text-start text-clr-on-bg-high\">{subline}</p>}\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":";;;;;;;;;;;;;;;;AAoBA,IAAMK,IAAkBC,EAAG;CACzB,OAAO;EACL,OAAO;EACP,QAAQ;EACR,eAAe;EACf,YAAY;EACZ,eAAe;EACf,UAAUC,EAAS;EACnB,gBAAgB;CAClB;CACA,UAAU;EACR,0BAA0B,EACxB,OAAO,EAAE,YAAY,OAAO,EAC9B;EACA,sBAAsB;GACpB,OAAO;IACL,OAAOC,EAAe;IACtB,UAAUC,EAAc;GAC1B;GACA,MAAM,EACJ,OAAO,QACT;EACF;EACA,iBAAiB;GACf,OAAO,EACL,OAAO,QACT;GACA,MAAM,EACJ,OAAO,4BACT;EACF;CACF;AACF,CAAC,GA+FKC,KAAiB,EACrB,aACA,SACA,WACA,cAAW,IACX,YACA,WACA,YAAS,MACT,qBAAkB,IAClB,sBAAmB,aACnB,qBAAkB,eACP;CACX,AAAIC,MAAW,KAAA,KAAWC,EAAe,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YAAS,GAAGC,MAAeD,GAC7BE,IAAyBC,GACzB,EAAE,eAAYnD,EAAoB,GAClCoD,KAAe,MAA+C;EAGlE,AADAC,IAAU5B,CAAK,GACfD,EAAQ;CACV;CACA,OACE,kBAACtB,GAAD;EACE,WAAWgD;EACX,GAAID;EACJ,SAAQ;EACR,SAASG;EACH;EACQ;EACd,MAAK;EACI;EAER;CACK,CAAA;AAEZ,GAEaE,KAA0C,EACrD,aACA,SACA,iBACA,eAAY,UACZ,GAAGN,QACsB;CACzB,IAAME,IAAyBC,GACzB,EAAE,eAAYnD,EAAoB;CACxC,OACE,kBAACE,GAAD;EACE,WAAWgD;EACX,GAAIF;EACJ,SAAQ;EACR,MAAK;EACL,SAASxB;EACH;EACQ;EACd,MAAK;EAEJ;CACK,CAAA;AAEZ;AAEA,EAAc,cAAc"}
@@ -1,8 +1,7 @@
1
1
  import e from "./SideSheetContext.js";
2
2
  import { useContext as t } from "react";
3
- //#region src/useConsumeSideSheet.ts
3
+ // src/useConsumeSideSheet.ts
4
4
  var n = () => t(e);
5
- //#endregion
6
5
  export { n as default };
7
6
 
8
7
  //# sourceMappingURL=useConsumeSideSheet.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonprix-ds/react-side-sheet",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "SideSheet component, implemented in React, for the Bonprix Design System.",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -41,21 +41,21 @@
41
41
  "provenance": true
42
42
  },
43
43
  "dependencies": {
44
- "@radix-ui/react-dialog": "1.1.23",
45
- "tailwind-merge": "2.5.4",
46
- "@bonprix-ds/internal-components": "0.2.4",
47
- "@bonprix-ds/react-button": "1.1.4",
48
- "@bonprix-ds/react-icon": "1.3.1",
49
- "@bonprix-ds/react-icon-button": "1.2.4",
50
- "@bonprix-ds/utils": "0.5.0"
44
+ "@bonprix-ds/internal-components": "0.2.6",
45
+ "@bonprix-ds/react-button": "1.1.6",
46
+ "@bonprix-ds/react-icon": "1.3.3",
47
+ "@bonprix-ds/react-icon-button": "1.2.6",
48
+ "@bonprix-ds/utils": "0.6.0",
49
+ "@radix-ui/react-dialog": "1.3.1",
50
+ "tailwind-merge": "2.5.4"
51
51
  },
52
52
  "devDependencies": {
53
+ "@bonprix-ds/vite-config": "0.0.0",
53
54
  "@testing-library/dom": "10.4.2",
54
55
  "@testing-library/react": "16.3.3",
55
56
  "@types/react": "19.3.0",
56
- "vite": "8.3.2",
57
- "vitest": "5.0.5",
58
- "@bonprix-ds/vite-config": "0.0.0"
57
+ "vite": "8.3.5",
58
+ "vitest": "5.0.5"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "react": "^19",