@bonprix-ds/react-bottom-sheet 1.1.0 → 1.2.1

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.
@@ -1,5 +1,5 @@
1
1
  import React, { type ComponentProps, type ElementType, type ReactNode, type RefObject } from "react";
2
- import { type IconType } from "@bonprix-ds/react-icon";
2
+ import { type IconOrElement } from "@bonprix-ds/react-icon";
3
3
  import { TitleLevel } from "@bonprix-ds/utils";
4
4
  import "./BottomSheet.css";
5
5
  interface SheetProps {
@@ -56,8 +56,8 @@ export interface SheetContentProps {
56
56
  export interface SheetButtonBaseProps {
57
57
  /** The label of the button. */
58
58
  children: string;
59
- /** If used, an icon will be additionally shown. The value is a name of one icon from our icon set. */
60
- icon?: IconType;
59
+ /** 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. */
60
+ icon?: IconOrElement;
61
61
  /** The position of the icon relative to the content. */
62
62
  iconPosition?: "start" | "end";
63
63
  }
@@ -10,12 +10,13 @@ import { tv as c } from "tailwind-variants";
10
10
  import { backdrop as l } from "@bonprix-ds/internal-components";
11
11
  import u from "@bonprix-ds/react-button";
12
12
  import d from "@bonprix-ds/react-icon-button";
13
- import { ZIndexContext as f, useInnerOpen as p, usePrefersReducedMotion as m } from "@bonprix-ds/utils";
14
- import { warnDeprecated as h } from "@bonprix-ds/utils/deprecation";
13
+ import { ArrowLeftIcon as f, CloserIcon as p } from "@bonprix-ds/react-icon/icons";
14
+ import { ZIndexContext as m, useInnerOpen as h, usePrefersReducedMotion as g } from "@bonprix-ds/utils";
15
+ import { warnDeprecated as _ } from "@bonprix-ds/utils/deprecation";
15
16
  import "#styles";
16
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
17
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
17
18
  //#region src/BottomSheetRoot.tsx
18
- var v = c({
19
+ var b = c({
19
20
  slots: {
20
21
  root: "preflight block",
21
22
  container: "max-h-[calc(100%-4rem)] rounded-none bg-clr-bg-modal shadow-none outline-none",
@@ -36,19 +37,19 @@ var v = c({
36
37
  false: { scrollArea: "px-4" },
37
38
  true: ""
38
39
  } }
39
- }), y = ({ children: t, open: c, isOpen: l, onClose: u, onBack: d, zIndex: y = 9999, ref: b }) => {
40
- l !== void 0 && h("is-open-prop");
41
- let x = m(), { root: S, container: C, dragHandleContainer: w, dragHandle: T, content: E, contentWrapper: D, backdrop: O } = v(), { isShown: k, scrollRef: A, scrollPosition: j } = n({ open: c ?? l ?? !1 }), M = j === "middle" || j === "bottom", { innerOpen: N } = p(k);
40
+ }), x = ({ children: t, open: c, isOpen: l, onClose: u, onBack: d, zIndex: f = 9999, ref: p }) => {
41
+ l !== void 0 && _("is-open-prop");
42
+ let x = g(), { root: S, container: C, dragHandleContainer: w, dragHandle: T, content: E, contentWrapper: D, backdrop: O } = b(), { isShown: k, scrollRef: A, scrollPosition: j } = n({ open: c ?? l ?? !1 }), M = j === "middle" || j === "bottom", { innerOpen: N } = h(k);
42
43
  r(N);
43
44
  let P = a(null);
44
45
  return i(() => {
45
46
  N || (P.current?.focus(), P.current = null);
46
- }, [N]), /* @__PURE__ */ g(o.Root, {
47
+ }, [N]), /* @__PURE__ */ v(o.Root, {
47
48
  open: N,
48
49
  onOpenChange: (e) => {
49
50
  e || u();
50
51
  },
51
- children: /* @__PURE__ */ _(s, {
52
+ children: /* @__PURE__ */ y(s, {
52
53
  isOpen: N,
53
54
  onClose: u,
54
55
  className: S(),
@@ -58,10 +59,10 @@ var v = c({
58
59
  style: {
59
60
  pointerEvents: void 0,
60
61
  visibility: N ? "visible" : "hidden",
61
- zIndex: y
62
+ zIndex: f
62
63
  },
63
64
  avoidKeyboard: !1,
64
- children: [/* @__PURE__ */ g(o.Content, {
65
+ children: [/* @__PURE__ */ v(o.Content, {
65
66
  forceMount: !0,
66
67
  asChild: !0,
67
68
  "aria-modal": !0,
@@ -71,19 +72,19 @@ var v = c({
71
72
  e.preventDefault(), P.current = document.activeElement, e.target.focus();
72
73
  },
73
74
  onCloseAutoFocus: (e) => e.preventDefault(),
74
- children: /* @__PURE__ */ _(s.Container, {
75
+ children: /* @__PURE__ */ y(s.Container, {
75
76
  className: C(),
76
- ref: b,
77
- children: [/* @__PURE__ */ g(s.Header, {
77
+ ref: p,
78
+ children: [/* @__PURE__ */ v(s.Header, {
78
79
  unstyled: !0,
79
80
  className: w(),
80
- children: /* @__PURE__ */ g(s.DragIndicator, {
81
+ children: /* @__PURE__ */ v(s.DragIndicator, {
81
82
  unstyled: !0,
82
83
  className: T()
83
84
  })
84
- }), /* @__PURE__ */ g(f.Provider, {
85
- value: y,
86
- children: /* @__PURE__ */ g(e.Provider, {
85
+ }), /* @__PURE__ */ v(m.Provider, {
86
+ value: f,
87
+ children: /* @__PURE__ */ v(e.Provider, {
87
88
  value: {
88
89
  scrollRef: A,
89
90
  scrollPosition: j,
@@ -91,11 +92,11 @@ var v = c({
91
92
  onBack: d,
92
93
  disableDrag: M
93
94
  },
94
- children: /* @__PURE__ */ g(s.Content, {
95
+ children: /* @__PURE__ */ v(s.Content, {
95
96
  className: E(),
96
97
  disableScroll: !0,
97
98
  disableDrag: M,
98
- children: /* @__PURE__ */ g("div", {
99
+ children: /* @__PURE__ */ v("div", {
99
100
  className: D(),
100
101
  style: { paddingBottom: "max(var(--keyboard-inset-height, 0rem), var(--app-safe-area-inset-bottom, 1rem))" },
101
102
  children: t
@@ -104,49 +105,49 @@ var v = c({
104
105
  })
105
106
  })]
106
107
  })
107
- }), /* @__PURE__ */ g(s.Backdrop, { className: O() })]
108
+ }), /* @__PURE__ */ v(s.Backdrop, { className: O() })]
108
109
  })
109
110
  });
110
- }, b = ({ children: e, subline: n, level: r = "h3" }) => {
111
- let { onBack: i, onClose: a } = t(), { header: s, titleAndIcons: c } = v();
112
- return /* @__PURE__ */ _("div", {
111
+ }, S = ({ children: e, subline: n, level: r = "h3" }) => {
112
+ let { onBack: i, onClose: a } = t(), { header: s, titleAndIcons: c } = b();
113
+ return /* @__PURE__ */ y("div", {
113
114
  className: s(),
114
- children: [/* @__PURE__ */ _("div", {
115
+ children: [/* @__PURE__ */ y("div", {
115
116
  className: c(),
116
117
  children: [
117
- i && /* @__PURE__ */ g(d, {
118
+ i && /* @__PURE__ */ v(d, {
118
119
  onClick: i,
119
- icon: "arrow-left",
120
+ icon: /* @__PURE__ */ v(f, {}),
120
121
  label: "Zurück",
121
122
  variant: "tertiary",
122
123
  size: "small"
123
124
  }),
124
- /* @__PURE__ */ g(o.Title, {
125
+ /* @__PURE__ */ v(o.Title, {
125
126
  asChild: !0,
126
- children: /* @__PURE__ */ g("div", {
127
+ children: /* @__PURE__ */ v("div", {
127
128
  className: "grow",
128
- children: /* @__PURE__ */ g(r, {
129
+ children: /* @__PURE__ */ v(r, {
129
130
  className: "typography-bonprix-h6 my-0 line-clamp-2 text-start text-clr-on-bg-high",
130
131
  children: e
131
132
  })
132
133
  })
133
134
  }),
134
- /* @__PURE__ */ g(d, {
135
+ /* @__PURE__ */ v(d, {
135
136
  onClick: a,
136
- icon: "closer",
137
+ icon: /* @__PURE__ */ v(p, {}),
137
138
  label: "Schließen",
138
139
  variant: "tertiary",
139
140
  size: "small"
140
141
  })
141
142
  ]
142
- }), n && /* @__PURE__ */ g("p", {
143
+ }), n && /* @__PURE__ */ v("p", {
143
144
  className: "typography-body1 my-0 text-start text-clr-on-bg-high",
144
145
  children: n
145
146
  })]
146
147
  });
147
- }, x = ({ children: e, disableHorizontalPadding: n = !1 }) => {
148
- let { scrollRef: r, disableDrag: i } = t(), { scrollArea: a } = v({ disableHorizontalPadding: n });
149
- return /* @__PURE__ */ g("div", {
148
+ }, C = ({ children: e, disableHorizontalPadding: n = !1 }) => {
149
+ let { scrollRef: r, disableDrag: i } = t(), { scrollArea: a } = b({ disableHorizontalPadding: n });
150
+ return /* @__PURE__ */ v("div", {
150
151
  ref: r,
151
152
  className: a(),
152
153
  style: { touchAction: i ? "auto" : "pan-down" },
@@ -154,14 +155,14 @@ var v = c({
154
155
  tabIndex: 0,
155
156
  children: e
156
157
  });
157
- }, S = ({ children: e }) => /* @__PURE__ */ g("div", {
158
+ }, w = ({ children: e }) => /* @__PURE__ */ v("div", {
158
159
  className: "button-section flex w-full shrink-0 touch-pan-down flex-col gap-3 px-4 pt-4",
159
160
  children: e
160
- }), C = ({ children: e, icon: n, iconPosition: r, loading: i, component: a = "button", ...o }) => {
161
+ }), T = ({ children: e, icon: n, iconPosition: r, loading: i, component: a = "button", ...o }) => {
161
162
  let s = a, { onClick: c, ...l } = o, { onClose: d } = t(), f = (e) => {
162
163
  c?.(e), d();
163
164
  };
164
- return /* @__PURE__ */ g(u, {
165
+ return /* @__PURE__ */ v(u, {
165
166
  component: s,
166
167
  ...l,
167
168
  variant: "primary",
@@ -172,9 +173,9 @@ var v = c({
172
173
  loading: i,
173
174
  children: e
174
175
  });
175
- }, w = ({ children: e, icon: n, iconPosition: r, component: i = "button", ...a }) => {
176
+ }, E = ({ children: e, icon: n, iconPosition: r, component: i = "button", ...a }) => {
176
177
  let o = i, { onClose: s } = t();
177
- return /* @__PURE__ */ g(u, {
178
+ return /* @__PURE__ */ v(u, {
178
179
  component: o,
179
180
  ...a,
180
181
  variant: "secondary",
@@ -185,8 +186,8 @@ var v = c({
185
186
  children: e
186
187
  });
187
188
  };
188
- y.displayName = "BottomSheet";
189
+ x.displayName = "BottomSheet";
189
190
  //#endregion
190
- export { S as ButtonSection, x as Content, C as PrimaryButton, w as SecondaryButton, b as Title, y as default };
191
+ export { w as ButtonSection, C as Content, T as PrimaryButton, E as SecondaryButton, S as Title, x as default };
191
192
 
192
193
  //# sourceMappingURL=BottomSheetRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheetRoot.js","names":["BottomSheetContext","useConsumeBottomSheet","useCreateBottomSheet","useKeepScrollPositionOnPageHide","DialogPrimitive","Button","IconButton","generateClasses","tv","backdrop","BottomSheetRoot","isOpen","warnDeprecated","prefersReducedMotion","usePrefersReducedMotion","open","disableDrag","scrollPosition","useInnerOpen","isShown","innerOpen","elementFocusedBeforeOpen","useRef","useEffect","nextOpen","onClose","Sheet","root","event","container","dragHandleContainer","dragHandle","ZIndexContext","zIndex","content","contentWrapper","Title","Level","header","titleAndIcons","onBack","subline","Content","setScrollRef","scrollArea","disableHorizontalPadding","ButtonSection","PrimaryButton","props","Component","component","otherProps","handleClick","onClick","SecondaryButton"],"sources":["../../src/BottomSheetRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport React, { useEffect, useRef, type ComponentProps, type ElementType, type ReactNode, type RefObject } from \"react\";\nimport { Sheet } from \"react-modal-sheet\";\nimport { tv } from \"tailwind-variants\";\n\nimport { backdrop } 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 { TitleLevel, useInnerOpen, usePrefersReducedMotion, ZIndexContext } from \"@bonprix-ds/utils\";\nimport { warnDeprecated } from \"@bonprix-ds/utils/deprecation\";\n\nimport BottomSheetContext from \"./BottomSheetContext\";\nimport useConsumeBottomSheet from \"./useConsumeBottomSheet\";\nimport useCreateBottomSheet from \"./useCreateBottomSheet\";\nimport useKeepScrollPositionOnPageHide from \"./useKeepScrollPositionOnPageHide\";\n\nimport \"./BottomSheet.css\";\n\nconst generateClasses = tv({\n slots: {\n root: \"preflight block\",\n container: \"max-h-[calc(100%-4rem)] rounded-none bg-clr-bg-modal shadow-none outline-none\",\n header: \"px-4 py-3\",\n titleAndIcons: \"flex touch-pan-down items-center gap-2\",\n contentWrapper: \"flex w-full flex-col\",\n content: [\n \"typography-body1 text-clr-primary\",\n // scroller must be a flexbox to fix scrollbar\n // scroller needs some padding to not cut off the focus-ring\n \"*:-mx-0.5 *:flex *:px-0.5\",\n // scroller must set min-h-0 in order to make scrolling work inside our flex context\n \"*:min-h-0\",\n ],\n dragHandleContainer: \"flex h-6 shrink-0 items-center justify-center\",\n dragHandle: \"h-1 w-8 rounded-full bg-clr-on-bg-low\",\n backdrop: backdrop(),\n scrollArea: \"scroll-area relative\",\n },\n variants: {\n disableHorizontalPadding: {\n false: { scrollArea: \"px-4\" },\n true: \"\",\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\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 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 type Props = (DeprecatedOpenProps | OpenProps) & {\n /** A reference to the root element of the sheet. */\n ref?: RefObject<HTMLDivElement>;\n};\n\nconst BottomSheetRoot = ({ children, open, isOpen, onClose, onBack, zIndex = 9999, ref }: Props) => {\n if (isOpen !== undefined) warnDeprecated(\"is-open-prop\");\n const prefersReducedMotion = usePrefersReducedMotion();\n const { root, container, dragHandleContainer, dragHandle, content, contentWrapper, backdrop } = generateClasses();\n const { isShown, scrollRef, scrollPosition } = useCreateBottomSheet({ open: open ?? isOpen ?? false });\n\n // When \"middle\" or \"bottom\", dragging is disabled to allow for regular scrolling.\n // When at \"top\", we need to enable drag to close. When `undefined`, the element is not scrollable and can be dragged, too.\n const disableDrag = scrollPosition === \"middle\" || scrollPosition === \"bottom\";\n\n const { innerOpen } = useInnerOpen(isShown);\n useKeepScrollPositionOnPageHide(innerOpen);\n\n const elementFocusedBeforeOpen = useRef<HTMLElement | null>(null);\n\n // Radix hands focus back to `Dialog.Trigger` on close, and this sheet has none: it is opened through `open`.\n // Both ends are taken over here so that the sheet itself is focused and the element that opened it gets focus back.\n const focusSheet = (event: Event) => {\n event.preventDefault();\n elementFocusedBeforeOpen.current = document.activeElement as HTMLElement | null;\n (event.target as HTMLElement).focus();\n };\n\n // Radix restores focus when its focus scope unmounts, which `forceMount` defers until react-modal-sheet has\n // animated the sheet away - and never at all where that animation does not settle. Closing is the reliable signal.\n const keepFocusWhereItIs = (event: Event) => event.preventDefault();\n\n useEffect(() => {\n if (innerOpen) return;\n elementFocusedBeforeOpen.current?.focus();\n elementFocusedBeforeOpen.current = null;\n }, [innerOpen]);\n\n const handleOpenChange = (nextOpen: boolean) => {\n if (!nextOpen) onClose();\n };\n\n return (\n <DialogPrimitive.Root open={innerOpen} onOpenChange={handleOpenChange}>\n <Sheet\n isOpen={innerOpen}\n onClose={onClose}\n className={root()}\n detent=\"content\"\n data-bpds=\"bottom-sheet\"\n prefersReducedMotion={prefersReducedMotion}\n style={{\n // We remove `pointer-events` handling from the library because it interfers with a lot of things like opened Selects that wouldn't close etc.\n pointerEvents: undefined,\n // When removing react-modal-sheet's pointerEvents handling, we need to adjust visibility because we can no longer rely on `pointer-events: none` being set on the wrapper that spans the whole page even when closed.\n visibility: innerOpen ? \"visible\" : \"hidden\",\n zIndex: zIndex,\n }}\n avoidKeyboard={false}\n >\n {/* `forceMount` leaves the mounting to the sheet, whose state machine keeps the container around for the closing animation. */}\n <DialogPrimitive.Content\n forceMount\n asChild\n aria-modal\n aria-describedby={undefined}\n tabIndex={-1}\n onOpenAutoFocus={focusSheet}\n onCloseAutoFocus={keepFocusWhereItIs}\n >\n <Sheet.Container className={container()} ref={ref}>\n <Sheet.Header unstyled className={dragHandleContainer()}>\n <Sheet.DragIndicator unstyled className={dragHandle()} />\n </Sheet.Header>\n <ZIndexContext.Provider value={zIndex}>\n <BottomSheetContext.Provider value={{ scrollRef, scrollPosition, onClose, onBack, disableDrag }}>\n <Sheet.Content\n className={content()}\n // disable default scrolling\n disableScroll\n // Dragging is still managed by `Sheet.Content` so we control it here\n disableDrag={disableDrag}\n >\n <div\n className={contentWrapper()}\n // Apply keyboard height as padding bottom to keep content above the keyboard\n style={{ paddingBottom: \"max(var(--keyboard-inset-height, 0rem), var(--app-safe-area-inset-bottom, 1rem))\" }}\n >\n {children}\n </div>\n </Sheet.Content>\n </BottomSheetContext.Provider>\n </ZIndexContext.Provider>\n </Sheet.Container>\n </DialogPrimitive.Content>\n {/* TODO: Deactivate the animation, when the user prefers reduced motion: https://github.com/Temzasse/react-modal-sheet/issues/227 */}\n {/* The backdrop carries no handler of its own: Radix dismisses the dialog on a press outside of its content. */}\n <Sheet.Backdrop className={backdrop()} />\n </Sheet>\n </DialogPrimitive.Root>\n );\n};\n\nexport default BottomSheetRoot;\n\nexport const Title = ({ children, subline, level: Level = \"h3\" }: SheetTitleProps) => {\n const { onBack, onClose } = useConsumeBottomSheet();\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 <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 <IconButton onClick={onClose} icon=\"closer\" label=\"Schließen\" variant=\"tertiary\" size=\"small\" />\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 { scrollRef: setScrollRef, disableDrag } = useConsumeBottomSheet();\n const { scrollArea } = generateClasses({ disableHorizontalPadding });\n return (\n <div\n ref={setScrollRef}\n className={scrollArea()}\n // react-modal-sheet writes this same property imperatively, but only once it has measured the element as\n // scrollable - and it bails before doing so on every open where that measurement is not ready yet, which\n // leaves the browser free to claim the downward swipe and cancel the drag. Setting it here closes that gap.\n style={{ touchAction: disableDrag ? \"auto\" : \"pan-down\" }}\n data-bpds-disable-horizontal-padding={disableHorizontalPadding}\n tabIndex={0}\n >\n {children}\n </div>\n );\n};\n\nexport const ButtonSection = ({ children }: SheetButtonSectionProps) => {\n return <div className=\"button-section flex w-full shrink-0 touch-pan-down flex-col gap-3 px-4 pt-4\">{children}</div>;\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 Component: ElementType = component;\n const { onClick, ...otherProps } = props;\n const { onClose } = useConsumeBottomSheet();\n const handleClick = (event: React.MouseEvent) => {\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 } = useConsumeBottomSheet();\n return (\n <Button component={Component} {...props} variant=\"secondary\" onClick={onClose} icon={icon} iconPosition={iconPosition} size=\"large\">\n {children}\n </Button>\n );\n};\n\nBottomSheetRoot.displayName = \"BottomSheet\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,IAAMO,IAAkBC,EAAG;CACzB,OAAO;EACL,MAAM;EACN,WAAW;EACX,QAAQ;EACR,eAAe;EACf,gBAAgB;EAChB,SAAS;GACP;GAGA;GAEA;EACF;EACA,qBAAqB;EACrB,YAAY;EACZ,UAAUC,EAAS;EACnB,YAAY;CACd;CACA,UAAU,EACR,0BAA0B;EACxB,OAAO,EAAE,YAAY,OAAO;EAC5B,MAAM;CACR,EACF;AACF,CAAC,GAmFKC,KAAmB,EAAE,aAAU,SAAM,WAAQ,YAAS,WAAQ,YAAS,MAAM,aAAiB;CAClG,AAAIC,MAAW,KAAA,KAAWC,EAAe,cAAc;CACvD,IAAMC,IAAuBC,EAAwB,GAC/C,EAAE,SAAM,cAAW,wBAAqB,eAAY,YAAS,mBAAgB,gBAAaP,EAAgB,GAC1G,EAAE,YAAS,cAAW,sBAAmBL,EAAqB,EAAE,MAAMa,KAAQJ,KAAU,GAAM,CAAC,GAI/FK,IAAcC,MAAmB,YAAYA,MAAmB,UAEhE,EAAE,iBAAcC,EAAaC,CAAO;CAC1C,EAAgCC,CAAS;CAEzC,IAAMC,IAA2BC,EAA2B,IAAI;CAwBhE,OAVAC,QAAgB;EACd,AAAIH,MACJC,EAAyB,SAAS,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AADAC,IAAUzB,CAAK,GACfH,EAAQ;CACV;CACA,OACE,kBAACpB,GAAD;EACE,WAAW4C;EACX,GAAIE;EACJ,SAAQ;EACR,SAASC;EACH;EACQ;EACd,MAAK;EACI;EAER;CACK,CAAA;AAEZ,GAEaE,KAA0C,EACrD,aACA,SACA,iBACA,eAAY,UACZ,GAAGN,QACsB;CACzB,IAAMC,IAAyBC,GACzB,EAAE,eAAYjD,EAAsB;CAC1C,OACE,kBAACI,GAAD;EAAQ,WAAW4C;EAAW,GAAID;EAAO,SAAQ;EAAY,SAASvB;EAAe;EAAoB;EAAc,MAAK;EACzH;CACK,CAAA;AAEZ;AAEA,EAAgB,cAAc"}
1
+ {"version":3,"file":"BottomSheetRoot.js","names":["BottomSheetContext","useConsumeBottomSheet","useCreateBottomSheet","useKeepScrollPositionOnPageHide","DialogPrimitive","Button","IconButton","generateClasses","tv","backdrop","BottomSheetRoot","isOpen","warnDeprecated","prefersReducedMotion","usePrefersReducedMotion","open","disableDrag","scrollPosition","useInnerOpen","isShown","innerOpen","elementFocusedBeforeOpen","useRef","useEffect","nextOpen","onClose","Sheet","root","event","container","dragHandleContainer","dragHandle","ZIndexContext","zIndex","content","contentWrapper","Title","Level","header","titleAndIcons","onBack","ArrowLeftIcon","CloserIcon","subline","Content","setScrollRef","scrollArea","disableHorizontalPadding","ButtonSection","PrimaryButton","props","Component","component","otherProps","handleClick","onClick","SecondaryButton"],"sources":["../../src/BottomSheetRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport React, { useEffect, useRef, type ComponentProps, type ElementType, type ReactNode, type RefObject } from \"react\";\nimport { Sheet } from \"react-modal-sheet\";\nimport { tv } from \"tailwind-variants\";\n\nimport { backdrop } 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, useInnerOpen, usePrefersReducedMotion, ZIndexContext } from \"@bonprix-ds/utils\";\nimport { warnDeprecated } from \"@bonprix-ds/utils/deprecation\";\n\nimport BottomSheetContext from \"./BottomSheetContext\";\nimport useConsumeBottomSheet from \"./useConsumeBottomSheet\";\nimport useCreateBottomSheet from \"./useCreateBottomSheet\";\nimport useKeepScrollPositionOnPageHide from \"./useKeepScrollPositionOnPageHide\";\n\nimport \"./BottomSheet.css\";\n\nconst generateClasses = tv({\n slots: {\n root: \"preflight block\",\n container: \"max-h-[calc(100%-4rem)] rounded-none bg-clr-bg-modal shadow-none outline-none\",\n header: \"px-4 py-3\",\n titleAndIcons: \"flex touch-pan-down items-center gap-2\",\n contentWrapper: \"flex w-full flex-col\",\n content: [\n \"typography-body1 text-clr-primary\",\n // scroller must be a flexbox to fix scrollbar\n // scroller needs some padding to not cut off the focus-ring\n \"*:-mx-0.5 *:flex *:px-0.5\",\n // scroller must set min-h-0 in order to make scrolling work inside our flex context\n \"*:min-h-0\",\n ],\n dragHandleContainer: \"flex h-6 shrink-0 items-center justify-center\",\n dragHandle: \"h-1 w-8 rounded-full bg-clr-on-bg-low\",\n backdrop: backdrop(),\n scrollArea: \"scroll-area relative\",\n },\n variants: {\n disableHorizontalPadding: {\n false: { scrollArea: \"px-4\" },\n true: \"\",\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\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 /** A reference to the root element of the sheet. */\n ref?: RefObject<HTMLDivElement>;\n};\n\nconst BottomSheetRoot = ({ children, open, isOpen, onClose, onBack, zIndex = 9999, ref }: Props) => {\n if (isOpen !== undefined) warnDeprecated(\"is-open-prop\");\n const prefersReducedMotion = usePrefersReducedMotion();\n const { root, container, dragHandleContainer, dragHandle, content, contentWrapper, backdrop } = generateClasses();\n const { isShown, scrollRef, scrollPosition } = useCreateBottomSheet({ open: open ?? isOpen ?? false });\n\n // When \"middle\" or \"bottom\", dragging is disabled to allow for regular scrolling.\n // When at \"top\", we need to enable drag to close. When `undefined`, the element is not scrollable and can be dragged, too.\n const disableDrag = scrollPosition === \"middle\" || scrollPosition === \"bottom\";\n\n const { innerOpen } = useInnerOpen(isShown);\n useKeepScrollPositionOnPageHide(innerOpen);\n\n const elementFocusedBeforeOpen = useRef<HTMLElement | null>(null);\n\n // Radix hands focus back to `Dialog.Trigger` on close, and this sheet has none: it is opened through `open`.\n // Both ends are taken over here so that the sheet itself is focused and the element that opened it gets focus back.\n const focusSheet = (event: Event) => {\n event.preventDefault();\n elementFocusedBeforeOpen.current = document.activeElement as HTMLElement | null;\n (event.target as HTMLElement).focus();\n };\n\n // Radix restores focus when its focus scope unmounts, which `forceMount` defers until react-modal-sheet has\n // animated the sheet away - and never at all where that animation does not settle. Closing is the reliable signal.\n const keepFocusWhereItIs = (event: Event) => event.preventDefault();\n\n useEffect(() => {\n if (innerOpen) return;\n elementFocusedBeforeOpen.current?.focus();\n elementFocusedBeforeOpen.current = null;\n }, [innerOpen]);\n\n const handleOpenChange = (nextOpen: boolean) => {\n if (!nextOpen) onClose();\n };\n\n return (\n <DialogPrimitive.Root open={innerOpen} onOpenChange={handleOpenChange}>\n <Sheet\n isOpen={innerOpen}\n onClose={onClose}\n className={root()}\n detent=\"content\"\n data-bpds=\"bottom-sheet\"\n prefersReducedMotion={prefersReducedMotion}\n style={{\n // We remove `pointer-events` handling from the library because it interfers with a lot of things like opened Selects that wouldn't close etc.\n pointerEvents: undefined,\n // When removing react-modal-sheet's pointerEvents handling, we need to adjust visibility because we can no longer rely on `pointer-events: none` being set on the wrapper that spans the whole page even when closed.\n visibility: innerOpen ? \"visible\" : \"hidden\",\n zIndex: zIndex,\n }}\n avoidKeyboard={false}\n >\n {/* `forceMount` leaves the mounting to the sheet, whose state machine keeps the container around for the closing animation. */}\n <DialogPrimitive.Content\n forceMount\n asChild\n aria-modal\n aria-describedby={undefined}\n tabIndex={-1}\n onOpenAutoFocus={focusSheet}\n onCloseAutoFocus={keepFocusWhereItIs}\n >\n <Sheet.Container className={container()} ref={ref}>\n <Sheet.Header unstyled className={dragHandleContainer()}>\n <Sheet.DragIndicator unstyled className={dragHandle()} />\n </Sheet.Header>\n <ZIndexContext.Provider value={zIndex}>\n <BottomSheetContext.Provider value={{ scrollRef, scrollPosition, onClose, onBack, disableDrag }}>\n <Sheet.Content\n className={content()}\n // disable default scrolling\n disableScroll\n // Dragging is still managed by `Sheet.Content` so we control it here\n disableDrag={disableDrag}\n >\n <div\n className={contentWrapper()}\n // Apply keyboard height as padding bottom to keep content above the keyboard\n style={{ paddingBottom: \"max(var(--keyboard-inset-height, 0rem), var(--app-safe-area-inset-bottom, 1rem))\" }}\n >\n {children}\n </div>\n </Sheet.Content>\n </BottomSheetContext.Provider>\n </ZIndexContext.Provider>\n </Sheet.Container>\n </DialogPrimitive.Content>\n {/* TODO: Deactivate the animation, when the user prefers reduced motion: https://github.com/Temzasse/react-modal-sheet/issues/227 */}\n {/* The backdrop carries no handler of its own: Radix dismisses the dialog on a press outside of its content. */}\n <Sheet.Backdrop className={backdrop()} />\n </Sheet>\n </DialogPrimitive.Root>\n );\n};\n\nexport default BottomSheetRoot;\n\nexport const Title = ({ children, subline, level: Level = \"h3\" }: SheetTitleProps) => {\n const { onBack, onClose } = useConsumeBottomSheet();\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 <IconButton onClick={onClose} icon={<CloserIcon />} label=\"Schließen\" variant=\"tertiary\" size=\"small\" />\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 { scrollRef: setScrollRef, disableDrag } = useConsumeBottomSheet();\n const { scrollArea } = generateClasses({ disableHorizontalPadding });\n return (\n <div\n ref={setScrollRef}\n className={scrollArea()}\n // react-modal-sheet writes this same property imperatively, but only once it has measured the element as\n // scrollable - and it bails before doing so on every open where that measurement is not ready yet, which\n // leaves the browser free to claim the downward swipe and cancel the drag. Setting it here closes that gap.\n style={{ touchAction: disableDrag ? \"auto\" : \"pan-down\" }}\n data-bpds-disable-horizontal-padding={disableHorizontalPadding}\n tabIndex={0}\n >\n {children}\n </div>\n );\n};\n\nexport const ButtonSection = ({ children }: SheetButtonSectionProps) => {\n return <div className=\"button-section flex w-full shrink-0 touch-pan-down flex-col gap-3 px-4 pt-4\">{children}</div>;\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 Component: ElementType = component;\n const { onClick, ...otherProps } = props;\n const { onClose } = useConsumeBottomSheet();\n const handleClick = (event: React.MouseEvent) => {\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 } = useConsumeBottomSheet();\n return (\n <Button component={Component} {...props} variant=\"secondary\" onClick={onClose} icon={icon} iconPosition={iconPosition} size=\"large\">\n {children}\n </Button>\n );\n};\n\nBottomSheetRoot.displayName = \"BottomSheet\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,IAAMO,IAAkBC,EAAG;CACzB,O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1
1
  {
2
2
  "name": "@bonprix-ds/react-bottom-sheet",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "BottomSheet component, implemented in React, for the Bonprix Design System.",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -43,18 +43,18 @@
43
43
  "dependencies": {
44
44
  "@radix-ui/react-dialog": "1.1.23",
45
45
  "react-modal-sheet": "5.6.0",
46
- "@bonprix-ds/internal-components": "0.2.2",
47
- "@bonprix-ds/react-button": "1.1.2",
48
- "@bonprix-ds/react-icon": "1.2.2",
49
- "@bonprix-ds/react-icon-button": "1.2.2",
50
- "@bonprix-ds/utils": "0.3.0"
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"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@testing-library/dom": "10.4.2",
54
54
  "@testing-library/react": "16.3.3",
55
55
  "@types/react": "19.3.0",
56
56
  "vite": "8.3.2",
57
- "vitest": "4.1.11",
57
+ "vitest": "5.0.5",
58
58
  "@bonprix-ds/vite-config": "0.0.0"
59
59
  },
60
60
  "peerDependencies": {