prometeo-design-system 2.0.3 → 2.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.
Files changed (50) hide show
  1. package/dist/Avatar.es.js +1 -1
  2. package/dist/Button-DsbEyjth.js +183 -0
  3. package/dist/Button.es.js +2 -151
  4. package/dist/{CardProfile-BiYr6kY9.js → CardProfile-BhFog7j5.js} +1 -1
  5. package/dist/CardProfile.es.js +1 -1
  6. package/dist/CheckBox.es.js +1 -1
  7. package/dist/CheckboxFormik.es.js +1 -1
  8. package/dist/DatePicker.es.js +2 -2
  9. package/dist/DialogModal.es.js +1 -1
  10. package/dist/DrawerDesktop.es.js +128 -53
  11. package/dist/DrawerMobile.es.js +204 -37
  12. package/dist/DropZone.es.js +1 -1
  13. package/dist/Header.es.js +1 -1
  14. package/dist/Icons/Icons.d.ts +1 -0
  15. package/dist/Icons.es.js +29 -12
  16. package/dist/Input.es.js +45 -44
  17. package/dist/InputFormik.es.js +1 -1
  18. package/dist/InputMultiple.es.js +1 -1
  19. package/dist/{LayoutGeneric-jDE96L2N.js → LayoutGeneric-p4Pll4Cm.js} +1 -1
  20. package/dist/LayoutGeneric.es.js +1 -1
  21. package/dist/Logo.es.js +1 -1
  22. package/dist/Menu.es.js +1 -1
  23. package/dist/OtpInput.es.js +1 -1
  24. package/dist/Pagination.es.js +1 -1
  25. package/dist/ProfilePictureUpload.es.js +1 -1
  26. package/dist/ProgressBar.es.js +1 -1
  27. package/dist/Select.es.js +1 -1
  28. package/dist/SelectFormik.es.js +1 -1
  29. package/dist/Skeleton.es.js +1 -1
  30. package/dist/Spinner.es.js +1 -1
  31. package/dist/Steps.es.js +1 -1
  32. package/dist/SwipeContainer.es.js +1 -1
  33. package/dist/Switch.es.js +1 -1
  34. package/dist/TabLinks.es.js +1 -1
  35. package/dist/Table.es.js +1 -1
  36. package/dist/TextArea.es.js +1 -1
  37. package/dist/Tooltip.es.js +1 -1
  38. package/dist/components/Drawer/DrawerDesktop.d.ts +4 -2
  39. package/dist/components/Drawer/DrawerDesktop_old.d.ts +15 -0
  40. package/dist/components/Drawer/DrawerMobile.d.ts +16 -13
  41. package/dist/components/Drawer/DrawerMobile_old.d.ts +18 -0
  42. package/dist/components/Drawer/useDrawerMobile.d.ts +1 -1
  43. package/dist/{jsx-runtime-ByW6EXIE.js → jsx-runtime-DKDX3adD.js} +94 -96
  44. package/dist/lib/utils.d.ts +1 -0
  45. package/dist/prometeo-design-system.css +1 -1
  46. package/dist/prometeo-design-system.es.js +17 -17
  47. package/package.json +1 -1
  48. package/dist/components/Drawer/DrawerDesktopV2.d.ts +0 -11
  49. package/dist/index-BOQuZ0gG.js +0 -34
  50. /package/dist/pages/{Drawer.d.ts → DrawersPage.d.ts} +0 -0
package/dist/Avatar.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as p } from "./cn-B6yFEsav.js";
3
3
  import { motion as u } from "framer-motion";
4
4
  import { useState as f } from "react";
@@ -0,0 +1,183 @@
1
+ import { j as f } from "./jsx-runtime-DKDX3adD.js";
2
+ import { c as g } from "./cn-B6yFEsav.js";
3
+ import { clsx as B } from "clsx";
4
+ import { useAnimationControls as E, motion as j } from "framer-motion";
5
+ import { memo as P, useCallback as w, useMemo as h } from "react";
6
+ const C = (l) => typeof l == "boolean" ? `${l}` : l === 0 ? "0" : l, V = B, _ = (l, d) => (e) => {
7
+ var m;
8
+ if (d?.variants == null) return V(l, e?.class, e?.className);
9
+ const { variants: v, defaultVariants: t } = d, n = Object.keys(v).map((s) => {
10
+ const u = e?.[s], i = t?.[s];
11
+ if (u === null) return null;
12
+ const o = C(u) || C(i);
13
+ return v[s][o];
14
+ }), r = e && Object.entries(e).reduce((s, u) => {
15
+ let [i, o] = u;
16
+ return o === void 0 || (s[i] = o), s;
17
+ }, {}), a = d == null || (m = d.compoundVariants) === null || m === void 0 ? void 0 : m.reduce((s, u) => {
18
+ let { class: i, className: o, ...p } = u;
19
+ return Object.entries(p).every((y) => {
20
+ let [b, x] = y;
21
+ return Array.isArray(x) ? x.includes({
22
+ ...t,
23
+ ...r
24
+ }[b]) : {
25
+ ...t,
26
+ ...r
27
+ }[b] === x;
28
+ }) ? [
29
+ ...s,
30
+ i,
31
+ o
32
+ ] : s;
33
+ }, []);
34
+ return V(l, n, a, e?.class, e?.className);
35
+ }, $ = _(
36
+ "flex items-center justify-center cursor-pointer focus:outline-none font-semibold rounded-md transition-colors",
37
+ {
38
+ variants: {
39
+ variant: {
40
+ filled: "",
41
+ outline: "bg-transparent border-1",
42
+ text: "bg-transparent border-0"
43
+ },
44
+ color: {
45
+ primary: "",
46
+ secondary: ""
47
+ },
48
+ size: {
49
+ small: "h-[40px] w-[123px] w-fit px-2 py-3 text-sm",
50
+ medium: "h-[48px] w-[134px] w-fit px-2 py-3 text-base",
51
+ large: "h-[56px] w-[145px] w-fit px-4 py-3 text-base"
52
+ },
53
+ disabled: {
54
+ true: "opacity-50 cursor-not-allowed",
55
+ false: ""
56
+ },
57
+ loading: {
58
+ true: "cursor-wait",
59
+ false: ""
60
+ },
61
+ customSize: {
62
+ true: "px-4 py-2",
63
+ false: ""
64
+ }
65
+ },
66
+ compoundVariants: [
67
+ {
68
+ variant: "filled",
69
+ color: "primary",
70
+ class: "bg-primary-default-default text-neutral-strong-default border-0 hover:bg-primary-default-hover hover:text-neutral-strong-hover focus:bg-primary-default-pressed focus:text-neutral-strong-focused active:bg-primary-pressed active:text-neutral-strong-pressed disabled:bg-primary-medium-disabled disabled:text-neutral-strong-disabled"
71
+ },
72
+ {
73
+ variant: "filled",
74
+ color: "secondary",
75
+ class: "bg-neutral-strong-medium-default text-neutral-strong-default hover:bg-neutral-medium-hover hover:text-neutral-strong-hover focus:bg-neutral-medium-pressed focus:text-neutral-strong-pressed active:bg-neutral-medium-pressed disabled:bg-primary-default-disabled disabled:text-neutral-strong-disabled"
76
+ },
77
+ {
78
+ variant: "outline",
79
+ color: "primary",
80
+ class: "text-primary-medium-default border-primary-medium-default hover:bg-neutral-default-hover hover:text-primary-medium-hover hover:border-primary-medium-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed focus:border-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed active:border-primary-medium-pressed disabled:border-primary-disabled disabled:text-primary-disabled"
81
+ },
82
+ {
83
+ variant: "outline",
84
+ color: "secondary",
85
+ class: "text-neutral-strong-default border-neutral-strong-default hover:bg-neutral-default-hover hover:text-neutral-strong-hover hover:border-neutral-strong-hover focus:bg-neutral-default-pressed focus:text-neutral-strong-pressed focus:border-neutral-strong-pressed active:bg-neutral-default-pressed active:text-neutral-strong-pressed active:border-neutral-strong-pressed disabled:border-neutral-disabled disabled:text-neutral-disabled"
86
+ },
87
+ {
88
+ variant: "text",
89
+ color: "primary",
90
+ class: "text-primary-medium-default hover:bg-neutral-default-hover hover:text-primary-medium-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed disabled:text-primary-medium-disabled"
91
+ },
92
+ {
93
+ variant: "text",
94
+ color: "secondary",
95
+ class: "text-neutral-strong-default hover:bg-neutral-default-hover hover:text-primary-default-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed disabled:text-primary-medium-disabled"
96
+ }
97
+ ],
98
+ defaultVariants: {
99
+ variant: "filled",
100
+ color: "primary",
101
+ size: "medium",
102
+ disabled: !1,
103
+ loading: !1,
104
+ customSize: !1
105
+ }
106
+ }
107
+ );
108
+ function z({
109
+ label: l = "Selene",
110
+ onClick: d,
111
+ icon: e,
112
+ contentClassName: m,
113
+ loadingText: v = "Cargando...",
114
+ animate: t = !0,
115
+ animateIcon: n = !0,
116
+ isLoading: r = !1,
117
+ disabled: a = !1,
118
+ type: s = "button",
119
+ variant: u = "filled",
120
+ color: i = "primary",
121
+ size: o = "medium",
122
+ children: p,
123
+ Spinner: y,
124
+ className: b,
125
+ form: x,
126
+ ...N
127
+ }) {
128
+ const c = E(), H = w(() => {
129
+ !t || a || r || !n || c.start({ rotate: 90 });
130
+ }, [t, a, r, n, c]), S = w(() => {
131
+ !t || a || r || !n || c.start({ rotate: 0 });
132
+ }, [t, a, r, n, c]), k = h(() => g(
133
+ $({
134
+ variant: u,
135
+ color: i,
136
+ size: o,
137
+ disabled: a || r,
138
+ loading: r
139
+ }),
140
+ b
141
+ ), [u, i, o, a, r, b]), O = h(() => ({
142
+ whileHover: t && !a && !r ? { scale: 1.05 } : {},
143
+ whileTap: t && !a && !r ? { scale: 0.98 } : {},
144
+ transition: { type: "spring", stiffness: 400, damping: 17 }
145
+ }), [t, a, r]), A = h(() => r ? /* @__PURE__ */ f.jsxs("div", { className: "flex items-center gap-2", children: [
146
+ y,
147
+ o !== "small" && /* @__PURE__ */ f.jsx("span", { children: v })
148
+ ] }) : p || /* @__PURE__ */ f.jsxs("span", { className: g("flex items-center gap-2", m), children: [
149
+ e && /* @__PURE__ */ f.jsx(
150
+ j.div,
151
+ {
152
+ animate: n ? c : void 0,
153
+ transition: {
154
+ type: "spring",
155
+ stiffness: 400,
156
+ damping: 17
157
+ },
158
+ children: e
159
+ }
160
+ ),
161
+ l && /* @__PURE__ */ f.jsx("span", { children: l })
162
+ ] }), [r, p, e, l, y, o, v, n, c, m]);
163
+ return /* @__PURE__ */ f.jsx(
164
+ j.button,
165
+ {
166
+ form: x,
167
+ onClick: d,
168
+ className: k,
169
+ ...O,
170
+ onHoverStart: H,
171
+ onHoverEnd: S,
172
+ disabled: a || r,
173
+ type: s,
174
+ ...N,
175
+ children: A
176
+ }
177
+ );
178
+ }
179
+ const W = P(z);
180
+ export {
181
+ W as B,
182
+ _ as c
183
+ };
package/dist/Button.es.js CHANGED
@@ -1,153 +1,4 @@
1
- import { j as o } from "./jsx-runtime-ByW6EXIE.js";
2
- import { c as x } from "./cn-B6yFEsav.js";
3
- import { c as N } from "./index-BOQuZ0gG.js";
4
- import { useAnimationControls as k, motion as y } from "framer-motion";
5
- import { memo as z, useCallback as g, useMemo as i } from "react";
6
- const A = N(
7
- "flex items-center justify-center cursor-pointer focus:outline-none font-semibold rounded-md transition-colors",
8
- {
9
- variants: {
10
- variant: {
11
- filled: "",
12
- outline: "bg-transparent border-1",
13
- text: "bg-transparent border-0"
14
- },
15
- color: {
16
- primary: "",
17
- secondary: ""
18
- },
19
- size: {
20
- small: "h-[40px] w-[123px] w-fit px-2 py-3 text-sm",
21
- medium: "h-[48px] w-[134px] w-fit px-2 py-3 text-base",
22
- large: "h-[56px] w-[145px] w-fit px-4 py-3 text-base"
23
- },
24
- disabled: {
25
- true: "opacity-50 cursor-not-allowed",
26
- false: ""
27
- },
28
- loading: {
29
- true: "cursor-wait",
30
- false: ""
31
- },
32
- customSize: {
33
- true: "px-4 py-2",
34
- false: ""
35
- }
36
- },
37
- compoundVariants: [
38
- {
39
- variant: "filled",
40
- color: "primary",
41
- class: "bg-primary-default-default text-neutral-strong-default border-0 hover:bg-primary-default-hover hover:text-neutral-strong-hover focus:bg-primary-default-pressed focus:text-neutral-strong-focused active:bg-primary-pressed active:text-neutral-strong-pressed disabled:bg-primary-medium-disabled disabled:text-neutral-strong-disabled"
42
- },
43
- {
44
- variant: "filled",
45
- color: "secondary",
46
- class: "bg-neutral-strong-medium-default text-neutral-strong-default hover:bg-neutral-medium-hover hover:text-neutral-strong-hover focus:bg-neutral-medium-pressed focus:text-neutral-strong-pressed active:bg-neutral-medium-pressed disabled:bg-primary-default-disabled disabled:text-neutral-strong-disabled"
47
- },
48
- {
49
- variant: "outline",
50
- color: "primary",
51
- class: "text-primary-medium-default border-primary-medium-default hover:bg-neutral-default-hover hover:text-primary-medium-hover hover:border-primary-medium-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed focus:border-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed active:border-primary-medium-pressed disabled:border-primary-disabled disabled:text-primary-disabled"
52
- },
53
- {
54
- variant: "outline",
55
- color: "secondary",
56
- class: "text-neutral-strong-default border-neutral-strong-default hover:bg-neutral-default-hover hover:text-neutral-strong-hover hover:border-neutral-strong-hover focus:bg-neutral-default-pressed focus:text-neutral-strong-pressed focus:border-neutral-strong-pressed active:bg-neutral-default-pressed active:text-neutral-strong-pressed active:border-neutral-strong-pressed disabled:border-neutral-disabled disabled:text-neutral-disabled"
57
- },
58
- {
59
- variant: "text",
60
- color: "primary",
61
- class: "text-primary-medium-default hover:bg-neutral-default-hover hover:text-primary-medium-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed disabled:text-primary-medium-disabled"
62
- },
63
- {
64
- variant: "text",
65
- color: "secondary",
66
- class: "text-neutral-strong-default hover:bg-neutral-default-hover hover:text-primary-default-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed disabled:text-primary-medium-disabled"
67
- }
68
- ],
69
- defaultVariants: {
70
- variant: "filled",
71
- color: "primary",
72
- size: "medium",
73
- disabled: !1,
74
- loading: !1,
75
- customSize: !1
76
- }
77
- }
78
- );
79
- function M({
80
- label: l = "Selene",
81
- onClick: h,
82
- icon: u,
83
- contentClassName: m,
84
- loadingText: p = "Cargando...",
85
- animate: t = !0,
86
- animateIcon: s = !0,
87
- isLoading: e = !1,
88
- disabled: r = !1,
89
- type: w = "button",
90
- variant: f = "filled",
91
- color: c = "primary",
92
- size: d = "medium",
93
- children: n,
94
- Spinner: b,
95
- className: v,
96
- form: j,
97
- ...C
98
- }) {
99
- const a = k(), H = g(() => {
100
- !t || r || e || !s || a.start({ rotate: 90 });
101
- }, [t, r, e, s, a]), S = g(() => {
102
- !t || r || e || !s || a.start({ rotate: 0 });
103
- }, [t, r, e, s, a]), E = i(() => x(
104
- A({
105
- variant: f,
106
- color: c,
107
- size: d,
108
- disabled: r || e,
109
- loading: e
110
- }),
111
- v
112
- ), [f, c, d, r, e, v]), V = i(() => ({
113
- whileHover: t && !r && !e ? { scale: 1.05 } : {},
114
- whileTap: t && !r && !e ? { scale: 0.98 } : {},
115
- transition: { type: "spring", stiffness: 400, damping: 17 }
116
- }), [t, r, e]), B = i(() => e ? /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2", children: [
117
- b,
118
- d !== "small" && /* @__PURE__ */ o.jsx("span", { children: p })
119
- ] }) : n || /* @__PURE__ */ o.jsxs("span", { className: x("flex items-center gap-2", m), children: [
120
- u && /* @__PURE__ */ o.jsx(
121
- y.div,
122
- {
123
- animate: s ? a : void 0,
124
- transition: {
125
- type: "spring",
126
- stiffness: 400,
127
- damping: 17
128
- },
129
- children: u
130
- }
131
- ),
132
- l && /* @__PURE__ */ o.jsx("span", { children: l })
133
- ] }), [e, n, u, l, b, d, p, s, a, m]);
134
- return /* @__PURE__ */ o.jsx(
135
- y.button,
136
- {
137
- form: j,
138
- onClick: h,
139
- className: E,
140
- ...V,
141
- onHoverStart: H,
142
- onHoverEnd: S,
143
- disabled: r || e,
144
- type: w,
145
- ...C,
146
- children: B
147
- }
148
- );
149
- }
150
- const F = z(M);
1
+ import { B as f } from "./Button-DsbEyjth.js";
151
2
  export {
152
- F as default
3
+ f as default
153
4
  };
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as l } from "./cn-B6yFEsav.js";
3
3
  import { motion as i, AnimatePresence as u } from "framer-motion";
4
4
  import m from "./Avatar.es.js";
@@ -1,4 +1,4 @@
1
- import { C as a } from "./CardProfile-BiYr6kY9.js";
1
+ import { C as a } from "./CardProfile-BhFog7j5.js";
2
2
  export {
3
3
  a as CardProfile
4
4
  };
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { Icons as l } from "./Icons.es.js";
3
3
  import { useId as o, useRef as d } from "react";
4
4
  const k = ({ className: s, disabled: e, ...a }) => {
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { Icons as x } from "./Icons.es.js";
3
3
  import { c as r } from "./cn-B6yFEsav.js";
4
4
  import { useField as h, ErrorMessage as p } from "formik";
@@ -1,11 +1,11 @@
1
- import { j as $ } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as $ } from "./jsx-runtime-DKDX3adD.js";
2
2
  import m, { createContext as mn, useContext as hn, useCallback as q, useRef as Se, useLayoutEffect as yn, useState as he, useEffect as _e, useMemo as fe, memo as pn } from "react";
3
3
  import { InputMultiple as gn } from "./InputMultiple.es.js";
4
4
  import wn from "./Input.es.js";
5
5
  import { createPortal as bn } from "react-dom";
6
6
  import { Icons as Mt } from "./Icons.es.js";
7
7
  import { c as Be } from "./cn-B6yFEsav.js";
8
- import vt from "./Button.es.js";
8
+ import { B as vt } from "./Button-DsbEyjth.js";
9
9
  function Mn(e, t, n = "long") {
10
10
  return new Intl.DateTimeFormat("en-US", {
11
11
  // Enforces engine to render the time. Without the option JavaScriptCore omits it.
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { forwardRef as u, useState as p, useImperativeHandle as f, useRef as g } from "react";
3
3
  import { c as i } from "./cn-B6yFEsav.js";
4
4
  const x = u(({
@@ -1,67 +1,142 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
- import { c as d } from "./index-BOQuZ0gG.js";
3
- import { forwardRef as j, useState as D, useRef as x, useCallback as s, useImperativeHandle as b } from "react";
4
- import { Drawer as o } from "vaul";
5
- import { Icons as v } from "./Icons.es.js";
6
- import { c as m } from "./cn-B6yFEsav.js";
7
- const C = d("text-sm cursor-pointer font-medium shadow-sm transition-all absolute z-30", {
8
- variants: {
9
- direction: {
10
- left: "right-4 top-4",
11
- right: "left-4 top-4"
12
- }
13
- }
14
- }), O = d("right-0 top-0 bottom-0 fixed z-50 outline-none w-full md:w-[450px] lg:w-[550px] xl:w-[600px] h-full flex flex-col", {
15
- variants: {
16
- direction: {
17
- left: "left-0",
18
- right: "right-0"
19
- }
20
- }
21
- }), N = j(({ children: t, direction: r, modal: a = !1, className: c, onClose: i, defaultOpen: w = !1 }, h) => {
22
- const [l, n] = D(w), f = x(i);
23
- f.current = i;
24
- const u = s(() => {
1
+ import { j as s } from "./jsx-runtime-DKDX3adD.js";
2
+ import { c as b } from "./cn-B6yFEsav.js";
3
+ import { c as y, B as h } from "./Button-DsbEyjth.js";
4
+ import { createPortal as g } from "react-dom";
5
+ import { Icons as C } from "./Icons.es.js";
6
+ import { forwardRef as k, useState as j, useRef as x, useEffect as v, useCallback as l, useImperativeHandle as D } from "react";
7
+ const O = k((e, a) => {
8
+ const [t, n] = j(e.defaultOpen || !1), o = x(e.onClose), {
9
+ modal: c = !1,
10
+ children: d,
11
+ className: u,
12
+ direction: f = "left",
13
+ attachToParent: i = !1,
14
+ closeOnOverlayClick: p = !1
15
+ } = e;
16
+ v(() => {
17
+ o.current = e.onClose;
18
+ }, [e.onClose]);
19
+ const r = l(() => {
25
20
  n(!0);
26
- }, []), p = s(() => {
27
- n(!1);
28
- }, []), g = s(() => {
29
- n(!1), f.current?.();
21
+ }, []), m = l(() => {
22
+ n(!1), o.current?.();
30
23
  }, []);
31
- return b(h, () => ({
32
- open: u,
33
- close: p,
34
- isOpen: l
35
- }), [u, p, l]), /* @__PURE__ */ e.jsx(o.Root, { direction: r, open: l, onOpenChange: g, modal: a, children: /* @__PURE__ */ e.jsxs(o.Portal, { children: [
36
- /* @__PURE__ */ e.jsx(o.Overlay, { className: "fixed inset-0 bg-black/60 z-50" }),
37
- /* @__PURE__ */ e.jsxs(
38
- o.Content,
24
+ D(a, () => ({
25
+ open: r,
26
+ close: m,
27
+ isOpen: t
28
+ }), [t, r, m]);
29
+ const w = /* @__PURE__ */ s.jsx(
30
+ z,
31
+ {
32
+ isOpen: t,
33
+ close: m,
34
+ direction: f,
35
+ modal: c,
36
+ className: u,
37
+ attachToParent: i,
38
+ closeOnOverlayClick: p,
39
+ children: d
40
+ }
41
+ );
42
+ return i ? w : g(w, document.body);
43
+ });
44
+ O.displayName = "DrawerDesktopV2";
45
+ const z = ({ children: e, direction: a = "left", isOpen: t, close: n, modal: o = !1, className: c, attachToParent: d = !1, closeOnOverlayClick: u = !1 }) => {
46
+ v(() => {
47
+ if (t && o) {
48
+ const r = window.scrollY;
49
+ return document.body.style.position = "fixed", document.body.style.top = `-${r}px`, document.body.style.width = "100%", () => {
50
+ document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, r);
51
+ };
52
+ }
53
+ }, [t, o]);
54
+ const f = y("border-neutral-strong-default", {
55
+ variants: {
56
+ isOpen: {
57
+ true: "desktop-drawer-visible",
58
+ false: "desktop-drawer-hidden"
59
+ },
60
+ direction: {
61
+ left: "left-0 border-r-[1px] border-l-0",
62
+ right: "right-0 border-l-[1px] border-r-0"
63
+ }
64
+ }
65
+ }), i = y("fixed inset-0 bg-black/60 z-[55] cursor-default", {
66
+ variants: {
67
+ isOpen: {
68
+ true: "drawer-overlay-visible",
69
+ false: "drawer-overlay-hidden"
70
+ }
71
+ }
72
+ }), p = y("", {
73
+ variants: {
74
+ direction: {
75
+ left: "right-0",
76
+ right: "left-0"
77
+ }
78
+ }
79
+ });
80
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
81
+ o && /* @__PURE__ */ s.jsx(
82
+ "div",
39
83
  {
40
- className: m(O({ direction: r }), c),
41
- style: { "--initial-transform": "calc(100% + 8px)" },
84
+ className: b(i({ isOpen: t })),
85
+ onClick: (r) => {
86
+ r.preventDefault(), r.stopPropagation(), u && n();
87
+ },
88
+ "aria-hidden": "true"
89
+ }
90
+ ),
91
+ /* @__PURE__ */ s.jsxs(
92
+ "div",
93
+ {
94
+ className: b(
95
+ "bg-neutral-strong-default p-4 pt-10 h-full top-0 z-[60] w-max overflow-y-auto",
96
+ d ? "absolute" : "fixed",
97
+ f({ isOpen: t, direction: a }),
98
+ c
99
+ ),
100
+ role: "dialog",
101
+ "aria-modal": o,
42
102
  children: [
43
- /* @__PURE__ */ e.jsx(o.Close, { className: m(C({ direction: r })), children: /* @__PURE__ */ e.jsx(v.Close, { size: 24, className: "text-neutral-default-default" }) }),
44
- /* @__PURE__ */ e.jsx("div", { className: "bg-neutral-default-default w-full flex-1 overflow-y-auto min-h-0 border-l border-neutral-strong-default", children: t })
103
+ /* @__PURE__ */ s.jsx(
104
+ h,
105
+ {
106
+ icon: /* @__PURE__ */ s.jsx(C.Close, { size: 24 }),
107
+ animate: !1,
108
+ type: "button",
109
+ size: "small",
110
+ variant: "text",
111
+ onClick: n,
112
+ label: "",
113
+ color: "secondary",
114
+ className: b(
115
+ "absolute top-0 z-50",
116
+ p({ direction: a })
117
+ ),
118
+ "aria-label": "Close drawer"
119
+ }
120
+ ),
121
+ e
45
122
  ]
46
123
  }
47
124
  )
48
- ] }) });
49
- });
50
- N.displayName = "DrawerDesktop";
51
- const E = () => {
52
- const t = x(null), r = s(() => {
53
- t.current?.open();
54
- }, []), a = s(() => {
55
- t.current?.close();
125
+ ] });
126
+ }, E = () => {
127
+ const e = x(null), a = l(() => {
128
+ e.current?.open();
129
+ }, []), t = l(() => {
130
+ e.current?.close();
56
131
  }, []);
57
132
  return {
58
- isOpen: s(() => t.current?.isOpen ?? !1, []),
59
- open: r,
60
- close: a,
61
- drawerRef: t
133
+ isOpen: l(() => e.current?.isOpen ?? !1, []),
134
+ open: a,
135
+ close: t,
136
+ drawerRef: e
62
137
  };
63
138
  };
64
139
  export {
65
- N as default,
140
+ O as default,
66
141
  E as useDrawerDesktop
67
142
  };