@loczer/storefront-sdk 0.242.0 → 0.243.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.
@@ -1,3 +1,4 @@
1
+ import { Drawer as DrawerPrimitive } from '@base-ui/react/drawer';
1
2
  import * as React from "react";
2
3
  type DrawerDirection = "top" | "bottom" | "left" | "right";
3
4
  type DrawerProps = {
@@ -15,26 +16,24 @@ type DrawerProps = {
15
16
  lockScroll?: boolean;
16
17
  children?: React.ReactNode;
17
18
  };
18
- declare function Drawer({ open: openProp, defaultOpen, onOpenChange, direction, children, modal, dismissible, fixed: _fixed, repositionInputs: _repositionInputs, snapPoints: _snapPoints, activeSnapPoint: _activeSnapPoint, setActiveSnapPoint: _setActiveSnapPoint, lockScroll, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
19
- declare const DrawerTrigger: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
19
+ declare function Drawer({ open, defaultOpen, onOpenChange, direction, children, modal, dismissible, fixed: _fixed, repositionInputs: _repositionInputs, snapPoints, activeSnapPoint, setActiveSnapPoint, lockScroll, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
20
+ type DrawerTriggerProps = DrawerPrimitive.Trigger.Props & {
20
21
  asChild?: boolean;
21
- } & React.RefAttributes<HTMLButtonElement>>;
22
- type DrawerPortalProps = {
23
- children?: React.ReactNode;
24
- container?: HTMLElement | null;
25
22
  };
26
- declare function DrawerPortal({ children, container }: DrawerPortalProps): React.ReactPortal | null;
27
- declare const DrawerClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
23
+ declare const DrawerTrigger: React.ForwardRefExoticComponent<Omit<DrawerTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
24
+ declare function DrawerPortal(props: React.ComponentProps<typeof DrawerPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
25
+ type DrawerCloseProps = DrawerPrimitive.Close.Props & {
28
26
  asChild?: boolean;
29
- } & React.RefAttributes<HTMLButtonElement>>;
30
- declare const DrawerOverlay: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
27
+ };
28
+ declare const DrawerClose: React.ForwardRefExoticComponent<Omit<DrawerCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
29
+ declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<Omit<import('@base-ui/react').DrawerBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "render"> & {
31
30
  onPointerDownOutside?: (event: {
32
31
  detail: {
33
32
  originalEvent: PointerEvent;
34
33
  };
35
34
  }) => void;
36
35
  } & React.RefAttributes<HTMLDivElement>>;
37
- declare const DrawerContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
36
+ declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<Omit<import('@base-ui/react').DrawerPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "render"> & {
38
37
  closeButtonClassName?: string;
39
38
  closeButtonTestId?: string;
40
39
  closeLabel?: string;
@@ -47,7 +46,7 @@ declare const DrawerContent: React.ForwardRefExoticComponent<React.HTMLAttribute
47
46
  } & React.RefAttributes<HTMLDivElement>>;
48
47
  declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
49
48
  declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
50
- declare const DrawerTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
51
- declare const DrawerDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
49
+ declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<import('@base-ui/react').DrawerTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
50
+ declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import('@base-ui/react').DrawerDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
52
51
  export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
53
52
  //# sourceMappingURL=drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/ui/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,KAAK,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAsB1D,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IACjD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,IAAI,EAAE,QAAQ,EACd,WAAmB,EACnB,YAAY,EACZ,SAAoB,EACpB,QAAQ,EACR,KAAY,EACZ,WAAkB,EAClB,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,iBAAiB,EACnC,UAAU,EAAE,WAAW,EACvB,eAAe,EAAE,gBAAgB,EACjC,kBAAkB,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CAAC,2CAE/E;AAED,KAAK,gBAAgB,GAAG,eAAe,CAAC,KAAK,CAAC,KAAK,GAAG;IACpD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,QAAA,MAAM,WAAW,yGAWhB,CAAA;AAUD,QAAA,MAAM,aAAa;2BAHM,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE;YAAE,aAAa,EAAE,YAAY,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI;wCA2BpF,CAAA;AAcD,QAAA,MAAM,aAAa;2BAPM,MAAM;wBACT,MAAM;iBACb,MAAM;2BACI,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE;YAAE,aAAa,EAAE,YAAY,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI;sBACjE,OAAO;wCAoEzB,CAAA;AAGF,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQzE;AAED,QAAA,MAAM,WAAW,mIAUf,CAAA;AAGF,QAAA,MAAM,iBAAiB,2IAUrB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAA"}
package/dist/ui/drawer.js CHANGED
@@ -1,165 +1,141 @@
1
- import { Slot as e } from "./slot.js";
2
- import { useAriaHiddenSiblings as t } from "./modal-aria.js";
3
- import * as n from "react";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import { cn as a } from "@rpcbase/ui";
6
- import { X as o } from "lucide-react";
7
- import { createPortal as s } from "react-dom";
1
+ import * as e from "react";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { cn as r } from "@rpcbase/ui";
4
+ import { X as i } from "lucide-react";
5
+ import { Drawer as a } from "@base-ui/react/drawer";
8
6
  //#region src/ui/drawer.tsx
9
- var c = 250, l = n.createContext(null), u = () => {
10
- let e = n.useContext(l);
11
- if (!e) throw Error("Drawer components must be used within <Drawer>");
12
- return e;
13
- };
14
- function d({ open: e, defaultOpen: t = !1, onOpenChange: i, direction: a = "bottom", children: o, modal: s = !0, dismissible: u = !0, fixed: d, repositionInputs: f, snapPoints: p, activeSnapPoint: m, setActiveSnapPoint: h, lockScroll: g = !0 }) {
15
- let [_, v] = n.useState(t), y = e !== void 0, b = y ? e : _, [x, S] = n.useState(b);
16
- return n.useEffect(() => {
17
- if (!x || !g || typeof document > "u") return;
18
- let e = document.body.style.overflow;
19
- return document.body.style.overflow = "hidden", () => {
20
- document.body.style.overflow = e;
21
- };
22
- }, [g, x]), n.useEffect(() => {
23
- if (b) {
24
- S(!0);
7
+ var o = e.createContext("bottom");
8
+ function s(e) {
9
+ return e === "top" ? "up" : e === "left" ? "left" : e === "right" ? "right" : "down";
10
+ }
11
+ function c({ open: e, defaultOpen: n = !1, onOpenChange: r, direction: i = "bottom", children: c, modal: l = !0, dismissible: u = !0, fixed: d, repositionInputs: f, snapPoints: p, activeSnapPoint: m, setActiveSnapPoint: h, lockScroll: g = !0 }) {
12
+ let _ = (e, t) => {
13
+ if (!e && !u && t.reason !== "close-press") {
14
+ t.cancel();
25
15
  return;
26
16
  }
27
- if (!x) return;
28
- let e = window.setTimeout(() => {
29
- S(!1);
30
- }, c);
31
- return () => window.clearTimeout(e);
32
- }, [b, x]), /* @__PURE__ */ r(l.Provider, {
33
- value: {
34
- open: b,
35
- present: x,
36
- setOpen: (e) => {
37
- y || v(e), i?.(e);
38
- },
39
- direction: a,
40
- modal: s,
41
- dismissible: u
42
- },
43
- children: o
17
+ r?.(e);
18
+ }, v = l && !g ? "trap-focus" : l;
19
+ return /* @__PURE__ */ t(o.Provider, {
20
+ value: i,
21
+ children: /* @__PURE__ */ t(a.Root, {
22
+ open: e,
23
+ defaultOpen: n,
24
+ onOpenChange: _,
25
+ modal: v,
26
+ disablePointerDismissal: !u,
27
+ swipeDirection: s(i),
28
+ snapPoints: p,
29
+ snapPoint: m,
30
+ onSnapPointChange: (e) => h?.(e),
31
+ children: c
32
+ })
44
33
  });
45
34
  }
46
- var f = n.forwardRef(({ asChild: t, onClick: n, ...i }, a) => {
47
- let { setOpen: o } = u();
48
- return /* @__PURE__ */ r(t ? e : "button", {
49
- ref: a,
50
- "data-slot": "drawer-trigger",
51
- onClick: (e) => {
52
- n?.(e), e.defaultPrevented || o(!0);
53
- },
54
- ...i
55
- });
56
- });
57
- f.displayName = "DrawerTrigger";
58
- function p({ children: e, container: i }) {
59
- let { open: a, present: o, modal: c } = u(), [l, d] = n.useState(!1), f = n.useRef(null);
60
- return n.useEffect(() => {
61
- d(!0);
62
- }, []), t(a && l && c, f), !o || !l || typeof document > "u" ? null : s(/* @__PURE__ */ r("div", {
63
- ref: f,
35
+ var l = e.forwardRef(({ asChild: n, children: r, ...i }, o) => /* @__PURE__ */ t(a.Trigger, {
36
+ ref: o,
37
+ "data-slot": "drawer-trigger",
38
+ render: n && e.isValidElement(r) ? r : void 0,
39
+ ...i,
40
+ children: n ? void 0 : r
41
+ }));
42
+ l.displayName = "DrawerTrigger";
43
+ function u(e) {
44
+ return /* @__PURE__ */ t(a.Portal, {
64
45
  "data-slot": "drawer-portal",
65
- children: e
66
- }), i ?? document.body);
67
- }
68
- var m = n.forwardRef(({ asChild: t, onClick: n, ...i }, a) => {
69
- let { setOpen: o } = u();
70
- return /* @__PURE__ */ r(t ? e : "button", {
71
- ref: a,
72
- "data-slot": "drawer-close",
73
- onClick: (e) => {
74
- n?.(e), e.defaultPrevented || o(!1);
75
- },
76
- ...i
46
+ ...e
77
47
  });
78
- });
79
- m.displayName = "DrawerClose";
80
- var h = n.forwardRef(({ className: e, onClick: t, onPointerDownOutside: n, ...i }, o) => {
81
- let { open: s, setOpen: c, dismissible: l } = u();
82
- return /* @__PURE__ */ r("div", {
83
- ref: o,
84
- "data-slot": "drawer-overlay",
85
- "data-state": s ? "open" : "closed",
86
- className: a("fixed inset-0 z-50 bg-black/50 duration-200 data-[state=open]:animate-in data-[state=closed]:pointer-events-none data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", e),
87
- onPointerDown: (e) => {
88
- n?.({ detail: { originalEvent: e.nativeEvent } });
89
- },
90
- onClick: (e) => {
91
- t?.(e), !(e.defaultPrevented || !l) && (e.stopPropagation(), c(!1));
92
- },
93
- ...i
94
- });
95
- });
96
- h.displayName = "DrawerOverlay";
97
- var g = n.forwardRef(({ className: e, children: t, closeButtonClassName: s, closeButtonTestId: c = "drawer-close", closeLabel: l = "Close", onPointerDownOutside: d, showCloseButton: f = !1, ...g }, _) => {
98
- let { direction: v, open: y, setOpen: b, dismissible: x } = u();
99
- return n.useEffect(() => {
100
- if (typeof document > "u") return;
101
- let e = (e) => {
102
- x && e.key === "Escape" && b(!1);
103
- };
104
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
105
- }, [x, b]), /* @__PURE__ */ i(p, { children: [/* @__PURE__ */ r(h, { onPointerDownOutside: d }), /* @__PURE__ */ i("div", {
106
- ref: _,
107
- "data-slot": "drawer-content",
108
- "data-drawer-direction": v,
109
- "data-state": y ? "open" : "closed",
110
- role: "dialog",
111
- "aria-modal": "true",
112
- className: a("group/drawer-content bg-background fixed z-50 flex h-auto flex-col duration-200 data-[state=open]:animate-in data-[state=closed]:pointer-events-none data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", v === "top" && "inset-x-0 top-0 mb-24 max-h-[80vh] rounded-b-lg border-b data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top", v === "bottom" && "inset-x-0 bottom-0 max-h-[95dvh] rounded-t-lg border-t data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom", v === "right" && "inset-y-0 right-0 w-3/4 border-l data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right sm:max-w-sm", v === "left" && "inset-y-0 left-0 w-3/4 border-r data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left sm:max-w-sm", e),
113
- ...g,
114
- children: [
115
- /* @__PURE__ */ r("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[drawer-direction=bottom]/drawer-content:block" }),
116
- f ? /* @__PURE__ */ r(m, {
117
- asChild: !0,
118
- children: /* @__PURE__ */ r("button", {
119
- type: "button",
120
- className: a("absolute right-4 top-2 z-20 flex size-10 items-center justify-center rounded-full bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", s),
121
- "aria-label": l,
122
- "data-testid": c,
123
- onClick: (e) => e.stopPropagation(),
124
- onPointerDown: (e) => e.stopPropagation(),
125
- children: /* @__PURE__ */ r(o, {
126
- className: "size-5",
127
- "aria-hidden": "true"
48
+ }
49
+ var d = e.forwardRef(({ asChild: n, children: r, ...i }, o) => /* @__PURE__ */ t(a.Close, {
50
+ ref: o,
51
+ "data-slot": "drawer-close",
52
+ render: n && e.isValidElement(r) ? r : void 0,
53
+ ...i,
54
+ children: n ? void 0 : r
55
+ }));
56
+ d.displayName = "DrawerClose";
57
+ var f = e.forwardRef(({ className: e, onPointerDown: n, onPointerDownOutside: i, ...o }, s) => /* @__PURE__ */ t(a.Backdrop, {
58
+ ref: s,
59
+ "data-slot": "drawer-overlay",
60
+ className: r("pointer-events-auto fixed inset-0 z-50 bg-black/50 outline-none duration-200 data-[open]:animate-in data-[closed]:pointer-events-none data-[closed]:animate-out data-[closed]:fill-mode-forwards data-[closed]:fade-out-0 data-[open]:fade-in-0", e),
61
+ onPointerDown: (e) => {
62
+ n?.(e), e.defaultPrevented || i?.({ detail: { originalEvent: e.nativeEvent } });
63
+ },
64
+ render: (e, n) => /* @__PURE__ */ t("div", {
65
+ ...e,
66
+ "data-state": n.open ? "open" : "closed"
67
+ }),
68
+ ...o
69
+ }));
70
+ f.displayName = "DrawerOverlay";
71
+ var p = e.forwardRef(({ className: s, children: c, closeButtonClassName: l, closeButtonTestId: p = "drawer-close", closeLabel: m = "Close", onPointerDownOutside: h, showCloseButton: g = !1, ..._ }, v) => {
72
+ let y = e.useContext(o);
73
+ return /* @__PURE__ */ n(u, { children: [/* @__PURE__ */ t(f, { onPointerDownOutside: h }), /* @__PURE__ */ t(a.Viewport, {
74
+ className: "pointer-events-none fixed inset-0 z-50",
75
+ children: /* @__PURE__ */ n(a.Popup, {
76
+ ref: v,
77
+ "data-slot": "drawer-content",
78
+ "data-drawer-direction": y,
79
+ "data-vaul-drawer-direction": y,
80
+ className: r("group/drawer-content bg-background pointer-events-auto fixed z-50 flex h-auto flex-col duration-200 outline-none data-[open]:animate-in data-[closed]:pointer-events-none data-[closed]:animate-out data-[closed]:fill-mode-forwards data-[closed]:fade-out-0 data-[open]:fade-in-0", y === "top" && "inset-x-0 top-0 mb-24 max-h-[80vh] rounded-b-lg border-b data-[open]:slide-in-from-top data-[closed]:slide-out-to-top", y === "bottom" && "inset-x-0 bottom-0 max-h-[95dvh] rounded-t-lg border-t data-[open]:slide-in-from-bottom data-[closed]:slide-out-to-bottom", y === "right" && "inset-y-0 right-0 w-3/4 border-l data-[open]:slide-in-from-right data-[closed]:slide-out-to-right sm:max-w-sm", y === "left" && "inset-y-0 left-0 w-3/4 border-r data-[open]:slide-in-from-left data-[closed]:slide-out-to-left sm:max-w-sm", s),
81
+ render: (e, n) => /* @__PURE__ */ t("div", {
82
+ ...e,
83
+ "data-state": n.open ? "open" : "closed"
84
+ }),
85
+ ..._,
86
+ children: [
87
+ /* @__PURE__ */ t("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[drawer-direction=bottom]/drawer-content:block" }),
88
+ g ? /* @__PURE__ */ t(d, {
89
+ asChild: !0,
90
+ children: /* @__PURE__ */ t("button", {
91
+ type: "button",
92
+ className: r("absolute right-4 top-2 z-20 flex size-10 items-center justify-center rounded-full bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", l),
93
+ "aria-label": m,
94
+ "data-testid": p,
95
+ onClick: (e) => e.stopPropagation(),
96
+ onPointerDown: (e) => e.stopPropagation(),
97
+ children: /* @__PURE__ */ t(i, {
98
+ className: "size-5",
99
+ "aria-hidden": "true"
100
+ })
128
101
  })
102
+ }) : null,
103
+ /* @__PURE__ */ t(a.Content, {
104
+ className: "contents",
105
+ children: c
129
106
  })
130
- }) : null,
131
- t
132
- ]
107
+ ]
108
+ })
133
109
  })] });
134
110
  });
135
- g.displayName = "DrawerContent";
136
- function _({ className: e, ...t }) {
137
- return /* @__PURE__ */ r("div", {
111
+ p.displayName = "DrawerContent";
112
+ function m({ className: e, ...n }) {
113
+ return /* @__PURE__ */ t("div", {
138
114
  "data-slot": "drawer-header",
139
- className: a("flex flex-col gap-0.5 p-4 group-data-[drawer-direction=bottom]/drawer-content:text-center group-data-[drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", e),
140
- ...t
115
+ className: r("flex flex-col gap-0.5 p-4 group-data-[drawer-direction=bottom]/drawer-content:text-center group-data-[drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", e),
116
+ ...n
141
117
  });
142
118
  }
143
- function v({ className: e, ...t }) {
144
- return /* @__PURE__ */ r("div", {
119
+ function h({ className: e, ...n }) {
120
+ return /* @__PURE__ */ t("div", {
145
121
  "data-slot": "drawer-footer",
146
- className: a("mt-auto flex flex-col gap-2 p-4", e),
147
- ...t
122
+ className: r("mt-auto flex flex-col gap-2 p-4", e),
123
+ ...n
148
124
  });
149
125
  }
150
- var y = n.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r("h2", {
151
- ref: n,
126
+ var g = e.forwardRef(({ className: e, ...n }, i) => /* @__PURE__ */ t(a.Title, {
127
+ ref: i,
152
128
  "data-slot": "drawer-title",
153
- className: a("text-foreground font-semibold", e),
154
- ...t
129
+ className: r("text-foreground font-semibold", e),
130
+ ...n
155
131
  }));
156
- y.displayName = "DrawerTitle";
157
- var b = n.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r("p", {
158
- ref: n,
132
+ g.displayName = "DrawerTitle";
133
+ var _ = e.forwardRef(({ className: e, ...n }, i) => /* @__PURE__ */ t(a.Description, {
134
+ ref: i,
159
135
  "data-slot": "drawer-description",
160
- className: a("text-muted-foreground text-sm", e),
161
- ...t
136
+ className: r("text-muted-foreground text-sm", e),
137
+ ...n
162
138
  }));
163
- b.displayName = "DrawerDescription";
139
+ _.displayName = "DrawerDescription";
164
140
  //#endregion
165
- export { d as Drawer, m as DrawerClose, g as DrawerContent, b as DrawerDescription, v as DrawerFooter, _ as DrawerHeader, h as DrawerOverlay, p as DrawerPortal, y as DrawerTitle, f as DrawerTrigger };
141
+ export { c as Drawer, d as DrawerClose, p as DrawerContent, _ as DrawerDescription, h as DrawerFooter, m as DrawerHeader, f as DrawerOverlay, u as DrawerPortal, g as DrawerTitle, l as DrawerTrigger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loczer/storefront-sdk",
3
- "version": "0.242.0",
3
+ "version": "0.243.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"