prometeo-design-system 6.4.0 → 6.4.4

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,65 +1,65 @@
1
- import { j as c } from "./jsx-runtime-GkKLlHH4.js";
2
- import { forwardRef as Pe, memo as B, useState as S, useRef as Y, useCallback as R, useEffect as T, useImperativeHandle as Ye, Children as D, isValidElement as J, createElement as A, cloneElement as pe } from "react";
1
+ import { j as x } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { forwardRef as Ye, memo as W, useState as B, useRef as D, useCallback as X, useEffect as R, useImperativeHandle as De, Children as T, isValidElement as Q, createElement as S, cloneElement as xe } from "react";
3
3
  import { createPortal as je } from "react-dom";
4
- import { c as p } from "./cn-B6yFEsav.js";
5
- import { c as De } from "./index-BOQuZ0gG.js";
6
- const Te = 50, xe = Pe(
7
- ({ children: o, onClose: x, className: u, attachToParent: i = !1, zindex: h = 40, debugMode: t = !1, safeMarginSize: d = 24, title: g, scroll: m = "content", size: ue = "medium", unmountChildrenOnClose: v = !0 }, he) => {
8
- const [y, Q] = S(!1), [W, F] = S(null), [me, z] = S(
9
- () => v ? y : !0
10
- ), Z = Y(x), O = Y(W), M = Y(null), f = Y(null), L = Y(/* @__PURE__ */ new Set());
11
- Z.current = x, O.current = W;
12
- const ee = R((r) => {
13
- F(r ?? {}), Q(!0);
14
- }, []), H = R(() => {
15
- Q(!1), Z.current?.(O.current);
4
+ import { c as u } from "./cn-B6yFEsav.js";
5
+ import { c as Te } from "./index-BOQuZ0gG.js";
6
+ const Re = 50, ue = Ye(
7
+ function({ children: i, onClose: d, className: f, attachToParent: h = !1, zindex: c = 40, debugMode: n = !1, safeMarginSize: E = 24, title: b, scroll: P = "content", size: he = "medium", unmountChildrenOnClose: v = !0 }, me) {
8
+ const [g, Z] = B(!1), [F, z] = B(null), [Ee, O] = B(
9
+ () => v ? g : !0
10
+ ), M = D(d), L = D(F), ee = D(null), p = D(null), H = D(/* @__PURE__ */ new Set());
11
+ M.current = d, L.current = F;
12
+ const te = X((r) => {
13
+ z(r ?? {}), Z(!0);
14
+ }, []), G = X(() => {
15
+ Z(!1), M.current?.(L.current);
16
16
  }, []);
17
- T(() => {
18
- L.current.forEach((r) => {
17
+ R(() => {
18
+ H.current.forEach((r) => {
19
19
  try {
20
- r(y);
20
+ r(g);
21
21
  } catch {
22
22
  }
23
23
  });
24
- }, [y]), Ye(
25
- he,
24
+ }, [g]), De(
25
+ me,
26
26
  () => ({
27
- open: ee,
28
- close: H,
29
- isOpen: y,
30
- getContext: () => O.current,
31
- subscribeOpenChange: (r) => (L.current.add(r), () => {
32
- L.current.delete(r);
27
+ open: te,
28
+ close: G,
29
+ isOpen: g,
30
+ getContext: () => L.current,
31
+ subscribeOpenChange: (r) => (H.current.add(r), () => {
32
+ H.current.delete(r);
33
33
  })
34
34
  }),
35
- [ee, H, y]
36
- ), T(() => {
37
- v && y && z(!0);
38
- }, [y, v]), T(() => {
35
+ [te, G, g]
36
+ ), R(() => {
37
+ v && g && O(!0);
38
+ }, [g, v]), R(() => {
39
39
  if (v) {
40
- if (y) {
41
- f.current && (clearTimeout(f.current), f.current = null);
40
+ if (g) {
41
+ p.current && (clearTimeout(p.current), p.current = null);
42
42
  return;
43
43
  }
44
- return f.current && clearTimeout(f.current), f.current = setTimeout(() => {
45
- z(!1), F(null), f.current = null;
46
- }, Te), () => {
47
- f.current && (clearTimeout(f.current), f.current = null);
44
+ return p.current && clearTimeout(p.current), p.current = setTimeout(() => {
45
+ O(!1), z(null), p.current = null;
46
+ }, Re), () => {
47
+ p.current && (clearTimeout(p.current), p.current = null);
48
48
  };
49
49
  }
50
- }, [y, v]), T(() => {
50
+ }, [g, v]), R(() => {
51
51
  if (!v) return;
52
- const r = M.current;
52
+ const r = ee.current;
53
53
  if (!r) return;
54
54
  const e = (w) => {
55
- const n = r.hasAttribute("open");
56
- w.target === r && (!["opacity", "display", "transform"].includes(w.propertyName) || n || (f.current && (clearTimeout(f.current), f.current = null), z(!1), F(null)));
55
+ const t = r.hasAttribute("open");
56
+ w.target === r && (!["opacity", "display", "transform"].includes(w.propertyName) || t || (p.current && (clearTimeout(p.current), p.current = null), O(!1), z(null)));
57
57
  };
58
58
  return r.addEventListener("transitionend", e), r.addEventListener("transitioncancel", e), () => {
59
59
  r.removeEventListener("transitionend", e), r.removeEventListener("transitioncancel", e);
60
60
  };
61
61
  }, [v]);
62
- const Ee = De("max-h-[calc(100%-80px)]", {
62
+ const ge = Te("max-h-[calc(100%-80px)]", {
63
63
  variants: {
64
64
  size: {
65
65
  medium: " max-w-[min(740px,calc(100%-32px))]",
@@ -67,9 +67,9 @@ const Te = 50, xe = Pe(
67
67
  }
68
68
  }
69
69
  });
70
- let X, G;
71
- typeof o == "function" ? (X = o(W), G = D.toArray(X)) : (X = o, G = D.toArray(X));
72
- const ge = (r) => {
70
+ let k, _;
71
+ typeof i == "function" ? (k = i(F), _ = T.toArray(k)) : (k = i, _ = T.toArray(k));
72
+ const ye = (r) => {
73
73
  const e = {
74
74
  headerProps: null,
75
75
  titleContent: null,
@@ -84,125 +84,125 @@ const Te = 50, xe = Pe(
84
84
  footerExpandX: !1,
85
85
  footerExpandY: !1
86
86
  }
87
- }, w = (n) => {
88
- if (!J(n)) return;
89
- const a = n.props;
90
- n.type === N ? (e.allExpandInfo.headerExpandX = e.allExpandInfo.headerExpandX || !!a?.expandX, e.allExpandInfo.headerExpandY = e.allExpandInfo.headerExpandY || !!a?.expandY) : n.type === C ? (e.allExpandInfo.contentExpandX = e.allExpandInfo.contentExpandX || !!a?.expandX, e.allExpandInfo.contentExpandY = e.allExpandInfo.contentExpandY || !!a?.expandY) : n.type === I && (e.allExpandInfo.footerExpandX = e.allExpandInfo.footerExpandX || !!a?.expandX, e.allExpandInfo.footerExpandY = e.allExpandInfo.footerExpandY || !!a?.expandY), a?.children && D.toArray(a.children).forEach(w);
87
+ }, w = (t) => {
88
+ if (!Q(t)) return;
89
+ const o = t.props;
90
+ t.type === I ? (e.allExpandInfo.headerExpandX = e.allExpandInfo.headerExpandX || !!o?.expandX, e.allExpandInfo.headerExpandY = e.allExpandInfo.headerExpandY || !!o?.expandY) : t.type === C ? (e.allExpandInfo.contentExpandX = e.allExpandInfo.contentExpandX || !!o?.expandX, e.allExpandInfo.contentExpandY = e.allExpandInfo.contentExpandY || !!o?.expandY) : t.type === N && (e.allExpandInfo.footerExpandX = e.allExpandInfo.footerExpandX || !!o?.expandX, e.allExpandInfo.footerExpandY = e.allExpandInfo.footerExpandY || !!o?.expandY), o?.children && T.toArray(o.children).forEach(w);
91
91
  };
92
- return r.forEach((n) => {
93
- if (w(n), !J(n)) {
94
- e.middleChildren.push(n);
92
+ return r.forEach((t) => {
93
+ if (w(t), !Q(t)) {
94
+ e.middleChildren.push(t);
95
95
  return;
96
96
  }
97
- if (n.type === j && !e.titleContent) {
98
- e.titleContent = n;
97
+ if (t.type === j && !e.titleContent) {
98
+ e.titleContent = t;
99
99
  return;
100
100
  }
101
- if (n.type === N && !e.headerProps) {
102
- const a = n.props;
103
- e.headerProps = a;
101
+ if (t.type === I && !e.headerProps) {
102
+ const o = t.props;
103
+ e.headerProps = o;
104
104
  return;
105
105
  }
106
- if (n.type === C && !e.contentProps) {
107
- const a = n.props;
108
- e.contentProps = a;
106
+ if (t.type === C && !e.contentProps) {
107
+ const o = t.props;
108
+ e.contentProps = o;
109
109
  return;
110
110
  }
111
- if (n.type === I && !e.footerProps) {
112
- const a = n.props;
113
- e.footerProps = a;
111
+ if (t.type === N && !e.footerProps) {
112
+ const o = t.props;
113
+ e.footerProps = o;
114
114
  return;
115
115
  }
116
- e.middleChildren.push(n);
116
+ e.middleChildren.push(t);
117
117
  }), e;
118
- }, ye = (r, e, w, n) => {
119
- const a = (l, K) => {
120
- if (!J(l))
118
+ }, be = (r, e, w, t) => {
119
+ const o = (l, V) => {
120
+ if (!Q(l))
121
121
  return l;
122
- const s = l.props, P = l.key ?? `dialog-child-${K}`;
122
+ const s = l.props, Y = l.key ?? `dialog-child-${V}`;
123
123
  if (l.type === j)
124
- return /* @__PURE__ */ A(j, { ...s, debugMode: t, key: P }, s.children);
125
- if (l.type === N)
126
- return /* @__PURE__ */ A(N, { ...s, debugMode: t, expandWeight: e, key: P }, s.children);
127
- if (l.type === C)
128
- return /* @__PURE__ */ A(C, { ...s, debugMode: t, scroll: m, expandWeight: w, key: P }, s.children);
124
+ return /* @__PURE__ */ S(j, { ...s, debugMode: n, key: Y }, s.children);
129
125
  if (l.type === I)
130
- return /* @__PURE__ */ A(I, { ...s, debugMode: t, expandWeight: n, key: P }, s.children);
126
+ return /* @__PURE__ */ S(I, { ...s, debugMode: n, expandWeight: e, key: Y }, s.children);
127
+ if (l.type === C)
128
+ return /* @__PURE__ */ S(C, { ...s, debugMode: n, scroll: P, expandWeight: w, key: Y }, s.children);
129
+ if (l.type === N)
130
+ return /* @__PURE__ */ S(N, { ...s, debugMode: n, expandWeight: t, key: Y }, s.children);
131
131
  if (l.type === "form") {
132
- const V = s?.children ? D.toArray(s.children).map((U, q) => a(U, q)) : [];
133
- return pe(l, {
134
- key: P,
132
+ const U = s?.children ? T.toArray(s.children).map((q, J) => o(q, J)) : [];
133
+ return xe(l, {
134
+ key: Y,
135
135
  ...s,
136
- className: p(s?.className, "contents")
137
- }, ...V);
136
+ className: u(s?.className, "contents")
137
+ }, ...U);
138
138
  }
139
139
  if (s?.children) {
140
- const V = D.toArray(s.children).map((U, q) => a(U, q));
141
- return pe(l, { key: P }, ...V);
140
+ const U = T.toArray(s.children).map((q, J) => o(q, J));
141
+ return xe(l, { key: Y }, ...U);
142
142
  }
143
143
  return l;
144
144
  };
145
- return r.map((l, K) => a(l, K));
145
+ return r.map((l, V) => o(l, V));
146
146
  };
147
- let { headerProps: te, titleContent: k, contentProps: ne, footerProps: re, middleChildren: be, allExpandInfo: E } = ge(G), b = te ? { ...te } : null, _ = ne ? { ...ne } : null, $ = re ? { ...re } : null;
148
- !b && g && (b = { title: g, children: null }, k = null), b && k && b.title && (b = {
149
- ...b,
147
+ let { headerProps: ne, titleContent: A, contentProps: re, footerProps: oe, middleChildren: ve, allExpandInfo: m } = ye(_), y = ne ? { ...ne } : null, $ = re ? { ...re } : null, K = oe ? { ...oe } : null;
148
+ !y && b && (y = { title: b, children: null }, A = null), y && A && y.title && (y = {
149
+ ...y,
150
150
  title: "",
151
- children: k
152
- }, k = null);
153
- const ve = E.headerExpandX || E.contentExpandX || E.footerExpandX, oe = E.headerExpandY || E.contentExpandY || E.footerExpandY, we = [E.headerExpandY, E.contentExpandY, E.footerExpandY].filter(Boolean).length, ae = E.contentExpandY ? we > 1 ? 2 : 1 : void 0, le = E.headerExpandY ? 1 : void 0, se = E.footerExpandY ? 1 : void 0, ie = ye(be, le, ae, se), Ce = b ? /* @__PURE__ */ c.jsx(N, { ...b, debugMode: t, expandWeight: le, children: b.children }) : null, de = (_ ? /* @__PURE__ */ c.jsx(C, { ..._, debugMode: t, scroll: m, expandWeight: ae, children: _.children }) : null) ?? (ie.length ? ie : null), Ne = $ ? /* @__PURE__ */ c.jsx(I, { ...$, debugMode: t, expandWeight: se, children: $.children }) : null, Ie = ve ? "w-full" : "w-auto", fe = {
154
- "--safe-margin-size": `${d}px`
151
+ children: A
152
+ }, A = null);
153
+ const we = m.headerExpandX || m.contentExpandX || m.footerExpandX, ae = m.headerExpandY || m.contentExpandY || m.footerExpandY, Ce = [m.headerExpandY, m.contentExpandY, m.footerExpandY].filter(Boolean).length, le = m.contentExpandY ? Ce > 1 ? 2 : 1 : void 0, se = m.headerExpandY ? 1 : void 0, ie = m.footerExpandY ? 1 : void 0, de = be(ve, se, le, ie), Ie = y ? /* @__PURE__ */ x.jsx(I, { ...y, debugMode: n, expandWeight: se, children: y.children }) : null, fe = ($ ? /* @__PURE__ */ x.jsx(C, { ...$, debugMode: n, scroll: P, expandWeight: le, children: $.children }) : null) ?? (de.length ? de : null), Ne = K ? /* @__PURE__ */ x.jsx(N, { ...K, debugMode: n, expandWeight: ie, children: K.children }) : null, Pe = we ? "w-full" : "w-auto", ce = {
154
+ "--safe-margin-size": `${E}px`
155
155
  };
156
- oe && (fe.height = `calc(100% - ${d * 2}px)`);
157
- const ce = /* @__PURE__ */ c.jsx(
156
+ ae && (ce.height = `calc(100% - ${E * 2}px)`);
157
+ const pe = /* @__PURE__ */ x.jsx(
158
158
  "dialog",
159
159
  {
160
- ref: M,
161
- open: y,
162
- className: p(
160
+ ref: ee,
161
+ open: g,
162
+ className: u(
163
163
  "prometeo-dialog fixed inset-0 w-screen h-screen z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1.5px]",
164
164
  "open:flex",
165
165
  "hidden"
166
166
  ),
167
- style: { zIndex: h },
168
- onClick: H,
169
- children: /* @__PURE__ */ c.jsxs(
167
+ style: { zIndex: c },
168
+ onClick: G,
169
+ children: /* @__PURE__ */ x.jsxs(
170
170
  "div",
171
171
  {
172
172
  onClick: (r) => r.stopPropagation(),
173
- className: p(
173
+ className: u(
174
174
  "prometeo-dialog-panel bg-neutral-default-default rounded-lg shadow-lg border-neutral-strong-default border relative ",
175
- Ie,
176
- m === "content" ? "" : "prometeo-scrollbar-thin!",
175
+ Pe,
176
+ P === "content" ? "" : "prometeo-scrollbar-thin!",
177
177
  // scroll === 'dialog' && 'overflow-auto ',
178
178
  "flex flex-col ",
179
- Ee({ size: ue })
179
+ ge({ size: he })
180
180
  // className
181
181
  ),
182
- style: fe,
182
+ style: ce,
183
183
  children: [
184
- /* @__PURE__ */ c.jsx(
184
+ /* @__PURE__ */ x.jsx(
185
185
  "div",
186
186
  {
187
- className: p(
187
+ className: u(
188
188
  "absolute bg-transparent z-[-1] -top-(--safe-margin-size) -left-(--safe-margin-size) -right-(--safe-margin-size) -bottom-(--safe-margin-size)",
189
- t && "after:content-['SECURE_MARGIN'] after:text-red-300 after:prometeo-fonts-label-small after:ml-2 "
189
+ n && "after:content-['SECURE_MARGIN'] after:text-red-300 after:prometeo-fonts-label-small after:ml-2 "
190
190
  ),
191
191
  style: {
192
- background: t ? "#FF393973" : "auto",
193
- border: t ? "solid 1px #FF3939" : ""
192
+ background: n ? "#FF393973" : "auto",
193
+ border: n ? "solid 1px #FF3939" : ""
194
194
  }
195
195
  }
196
196
  ),
197
- (!v || me) && /* @__PURE__ */ c.jsxs("div", { className: p(
197
+ (!v || Ee) && /* @__PURE__ */ x.jsxs("div", { className: u(
198
198
  "flex flex-col h-auto prometeo-scrollbar-thin!",
199
- oe && "flex-1 min-h-0",
200
- m === "dialog" && "overflow-auto *:min-w-max *:min-h-max",
201
- m === "content" && "overflow-hidden",
202
- u
199
+ ae && "flex-1 min-h-0",
200
+ P === "dialog" && "overflow-auto *:min-w-max *:min-h-max",
201
+ P === "content" && "overflow-hidden",
202
+ f
203
203
  ), children: [
204
- Ce,
205
- m === "dialog" ? /* @__PURE__ */ c.jsx("div", { className: "flex flex-col flex-1", children: de }) : de,
204
+ Ie,
205
+ P === "dialog" ? /* @__PURE__ */ x.jsx("div", { className: "flex flex-col flex-1", children: fe }) : fe,
206
206
  Ne
207
207
  ] })
208
208
  ]
@@ -210,97 +210,97 @@ const Te = 50, xe = Pe(
210
210
  )
211
211
  }
212
212
  );
213
- return i ? ce : je(ce, document.body);
213
+ return h ? pe : je(pe, document.body);
214
214
  }
215
215
  );
216
- xe.displayName = "Dialog";
217
- const C = B(({ children: o, className: x, debugMode: u, scroll: i, expandX: h, expandY: t, expandWeight: d }) => {
218
- const g = p(
216
+ ue.displayName = "Dialog";
217
+ const C = W(({ children: a, className: i, debugMode: d, scroll: f, expandX: h, expandY: c, expandWeight: n }) => {
218
+ const E = u(
219
219
  h && "w-full min-w-0",
220
- t && "flex-1 min-h-0"
221
- ), m = t ? { flexGrow: d ?? 1, flexBasis: 0 } : void 0;
222
- return /* @__PURE__ */ c.jsx("div", { style: m, className: p(
220
+ c && "flex-1 min-h-0"
221
+ ), b = c ? { flexGrow: n ?? 1, flexBasis: 0 } : void 0;
222
+ return /* @__PURE__ */ x.jsx("div", { style: b, className: u(
223
223
  "flex flex-col p-4 prometeo-scrollbar-thin!",
224
- u && "border-2 border-dashed border-red-500 bg-red-200/40 relative after:content-['CONTENT'] after:absolute after:top-2 after:left-1/2 after:w-max after:h-full after:text-red-500 ",
225
- g,
226
- x,
224
+ d && "border-2 border-dashed border-red-500 bg-red-200/40 relative after:content-['CONTENT'] after:absolute after:top-2 after:left-1/2 after:w-max after:h-full after:text-red-500 ",
225
+ E,
226
+ i,
227
227
  // Para scroll='content', este componente necesita su propio scroll y altura mínima
228
- i === "content" && "overflow-y-auto min-h-0 flex-1 ",
228
+ f === "content" && "overflow-y-auto min-h-0 flex-1 ",
229
229
  // Para scroll='dialog', el contenido debe ocupar todo el espacio disponible pero sin scroll
230
- i === "dialog" && "flex-1 min-h-max "
231
- ), children: o });
230
+ f === "dialog" && "flex-1 min-h-max "
231
+ ), children: a });
232
232
  });
233
233
  C.displayName = "DialogContent";
234
- const j = B(({ children: o, className: x, debugMode: u, expandX: i, expandY: h }) => {
235
- const t = p(
236
- i && "w-full min-w-0",
234
+ const j = W(({ children: a, className: i, debugMode: d, expandX: f, expandY: h }) => {
235
+ const c = u(
236
+ f && "w-full min-w-0",
237
237
  h && "flex-1 min-h-0"
238
238
  );
239
- return /* @__PURE__ */ c.jsx("h1", { className: p("prometeo-fonts-headline-small text-neutral-strong-default w-max", u && 'bg-red-400/40 relative after:content-["TITLE"] after:absolute after:top-0 after:-translate-y-5 after:left-0 after:w-max after:h-full after:text-red-500 after:prometeo-fonts-label-large', t, x), children: o });
239
+ return /* @__PURE__ */ x.jsx("h1", { className: u("prometeo-fonts-headline-small text-neutral-strong-default w-max", d && 'bg-red-400/40 relative after:content-["TITLE"] after:absolute after:top-0 after:-translate-y-5 after:left-0 after:w-max after:h-full after:text-red-500 after:prometeo-fonts-label-large', c, i), children: a });
240
240
  });
241
241
  j.displayName = "DialogTitle";
242
- const N = B(({ children: o, className: x, title: u, debugMode: i, expandX: h, expandY: t, expandWeight: d }) => {
243
- const g = p(
242
+ const I = W(({ children: a, className: i, title: d, debugMode: f, expandX: h, expandY: c, expandWeight: n }) => {
243
+ const E = u(
244
244
  h && "w-full min-w-0",
245
- t && "flex-1 min-h-0"
246
- ), m = t ? { flexGrow: d ?? 1, flexBasis: 0 } : void 0;
247
- return /* @__PURE__ */ c.jsxs("div", { style: m, className: p(
245
+ c && "flex-1 min-h-0"
246
+ ), b = c ? { flexGrow: n ?? 1, flexBasis: 0 } : void 0;
247
+ return /* @__PURE__ */ x.jsxs("div", { style: b, className: u(
248
248
  "px-6 pt-8 pb-4 flex flex-col",
249
- g,
250
- i && "border-2 border-dashed border-red-600 bg-red-200/40! relative after:content-['HEADER'] after:absolute after:top-1 after:left-1/2 after:w-max after:h-full after:text-red-500",
251
- x
249
+ E,
250
+ f && "border-2 border-dashed border-red-600 bg-red-200/40! relative after:content-['HEADER'] after:absolute after:top-1 after:left-1/2 after:w-max after:h-full after:text-red-500",
251
+ i
252
252
  ), children: [
253
- u && /* @__PURE__ */ c.jsx(j, { debugMode: i, children: u }),
254
- o
253
+ d && /* @__PURE__ */ x.jsx(j, { debugMode: f, children: d }),
254
+ a
255
255
  ] });
256
256
  });
257
- N.displayName = "DialogHeader";
258
- const I = B(({ children: o, className: x, debugMode: u, expandX: i, expandY: h, expandWeight: t }) => {
259
- const d = p(
260
- i && "w-full min-w-0",
257
+ I.displayName = "DialogHeader";
258
+ const N = W(({ children: a, className: i, debugMode: d, expandX: f, expandY: h, expandWeight: c }) => {
259
+ const n = u(
260
+ f && "w-full min-w-0",
261
261
  h && "flex-1 min-h-0 flex-col"
262
- ), g = h ? { flexGrow: t ?? 1, flexBasis: 0 } : void 0;
263
- return /* @__PURE__ */ c.jsx("div", { style: g, className: p(
264
- u && "border-2 border-dashed border-red-600 bg-red-200/40! relative after:content-['FOOTER'] after:absolute after:top-1 after:left-1/2 after:w-max after:h-full after:text-red-500",
262
+ ), E = h ? { flexGrow: c ?? 1, flexBasis: 0 } : void 0;
263
+ return /* @__PURE__ */ x.jsx("div", { style: E, className: u(
264
+ d && "border-2 border-dashed border-red-600 bg-red-200/40! relative after:content-['FOOTER'] after:absolute after:top-1 after:left-1/2 after:w-max after:h-full after:text-red-500",
265
265
  "border-t border-neutral-strong-default p-4 w-full flex flex-row justify-end gap-4",
266
- d,
267
- x
268
- ), children: o });
266
+ n,
267
+ i
268
+ ), children: a });
269
269
  });
270
- I.displayName = "DialogFooter";
271
- const Re = Object.assign(xe, {
270
+ N.displayName = "DialogFooter";
271
+ const Xe = Object.assign(ue, {
272
272
  Content: C,
273
- Header: N,
274
- Footer: I,
273
+ Header: I,
274
+ Footer: N,
275
275
  Title: j
276
276
  });
277
- Re.displayName = "DialogModal";
278
- const Fe = () => {
279
- const o = Y(null), [x, u] = S(!1), i = R((d) => {
280
- o.current?.open(d);
281
- }, []), h = R(() => {
282
- o.current?.close();
277
+ Xe.displayName = "DialogModal";
278
+ const ze = () => {
279
+ const a = D(null), [i, d] = B(!1), f = X((n) => {
280
+ a.current?.open(n);
281
+ }, []), h = X(() => {
282
+ a.current?.close();
283
283
  }, []);
284
- T(() => {
285
- const d = o.current?.subscribeOpenChange;
286
- if (!d) return;
287
- const g = d((m) => {
288
- u(m);
284
+ R(() => {
285
+ const n = a.current?.subscribeOpenChange;
286
+ if (!n) return;
287
+ const E = n((b) => {
288
+ d(b);
289
289
  });
290
290
  return () => {
291
- g && g();
291
+ E && E();
292
292
  };
293
- }, [o.current?.subscribeOpenChange]);
294
- const t = R(() => o.current?.getContext() ?? null, []);
293
+ }, [a.current?.subscribeOpenChange]);
294
+ const c = X(() => a.current?.getContext() ?? null, []);
295
295
  return {
296
- ref: o,
297
- open: i,
296
+ ref: a,
297
+ open: f,
298
298
  close: h,
299
- isOpen: x,
300
- getContext: t
299
+ isOpen: i,
300
+ getContext: c
301
301
  };
302
302
  };
303
303
  export {
304
- Re as default,
305
- Fe as useDialogControl
304
+ Xe as default,
305
+ ze as useDialogControl
306
306
  };
@@ -2,54 +2,54 @@ import { j as l } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { c as k } from "./cn-B6yFEsav.js";
3
3
  import { c as R } from "./index-BOQuZ0gG.js";
4
4
  import { createPortal as B } from "react-dom";
5
- import { forwardRef as L, useRef as d, useState as O, useEffect as o, useCallback as N, useImperativeHandle as Y } from "react";
5
+ import { forwardRef as L, useRef as d, useState as D, useEffect as o, useCallback as N, useImperativeHandle as Y } from "react";
6
6
  import F from "./Button.es.js";
7
7
  import { Close as H } from "./Icons/Close.es.js";
8
- import { u as Z } from "./useDrawerControl-Cy-mkJxV.js";
9
- const $ = L((s, f) => {
10
- const c = d(null), [e, m] = O(s.defaultOpen || !1), [t, y] = O(null), b = d(s.onClose), i = d(t), u = d(/* @__PURE__ */ new Set()), {
8
+ import { u as Z, b as _, a as ee } from "./useDrawerControl-CTqQK4zm.js";
9
+ const M = L((s, f) => {
10
+ const c = d(null), [e, m] = D(s.defaultOpen || !1), [t, y] = D(null), b = d(s.onClose), i = d(t), u = d(/* @__PURE__ */ new Set()), {
11
11
  modal: p = !1,
12
12
  children: a,
13
- className: w,
13
+ className: v,
14
14
  direction: C = "left",
15
15
  attachToParent: x = !1,
16
16
  closeOnOverlayClick: r = !1,
17
17
  hideCloseButton: T = !1,
18
- unmountChildrenOnClose: h = !1,
18
+ unmountChildrenOnClose: w = !1,
19
19
  zindex: S = 35
20
- } = s, g = d(r), j = d(e);
20
+ } = s, g = d(r), O = d(e);
21
21
  i.current = t;
22
- const [V, P] = O(() => !h);
22
+ const [V, P] = D(() => !w);
23
23
  o(() => {
24
- h && e && P(!0);
25
- }, [e, h]), o(() => {
26
- j.current = e;
24
+ w && e && P(!0);
25
+ }, [e, w]), o(() => {
26
+ O.current = e;
27
27
  }, [e]), o(() => {
28
28
  i.current = t;
29
29
  }, [t]), o(() => {
30
30
  g.current = r;
31
31
  }, [r]);
32
- const z = (n) => {
32
+ const j = (n) => {
33
33
  if (!c.current)
34
34
  return;
35
35
  const E = c.current;
36
- E && !E.contains(n.target) && g.current && j.current && v();
36
+ E && !E.contains(n.target) && g.current && O.current && h();
37
37
  };
38
38
  o(() => {
39
39
  if (!g.current || p || !e)
40
40
  return;
41
41
  const n = setTimeout(() => {
42
- document.addEventListener("click", z);
42
+ document.addEventListener("click", j);
43
43
  }, 0);
44
44
  return () => {
45
- clearTimeout(n), document.removeEventListener("click", z);
45
+ clearTimeout(n), document.removeEventListener("click", j);
46
46
  };
47
47
  }, [r, e, p]), o(() => {
48
48
  b.current = s.onClose;
49
49
  }, [s.onClose]);
50
- const D = N((n) => {
50
+ const z = N((n) => {
51
51
  y(n ?? null), m(!0);
52
- }, []), v = N(() => {
52
+ }, []), h = N(() => {
53
53
  m(!1), b.current?.(i.current), setTimeout(() => y(null), 300);
54
54
  }, []);
55
55
  o(() => {
@@ -62,37 +62,37 @@ const $ = L((s, f) => {
62
62
  }, [e]), Y(
63
63
  f,
64
64
  () => ({
65
- open: D,
66
- close: v,
65
+ open: z,
66
+ close: h,
67
67
  isOpen: e,
68
68
  subscribeOpenChange: (n) => (u.current.add(n), () => {
69
69
  u.current.delete(n);
70
70
  }),
71
71
  getContext: () => i.current
72
72
  }),
73
- [e, D, v]
73
+ [e, z, h]
74
74
  );
75
75
  const I = /* @__PURE__ */ l.jsx(
76
- q,
76
+ $,
77
77
  {
78
78
  context: t,
79
79
  ref: c,
80
80
  isOpen: e,
81
- close: v,
81
+ close: h,
82
82
  direction: C,
83
83
  modal: p,
84
- className: w,
84
+ className: v,
85
85
  attachToParent: x,
86
86
  closeOnOverlayClick: r,
87
87
  hideCloseButton: T,
88
88
  zindex: S,
89
- children: (!h || V) && (typeof a == "function" ? a(t) : a)
89
+ children: (!w || V) && (typeof a == "function" ? a(t) : a)
90
90
  }
91
91
  );
92
92
  return x ? I : B(I, document.body);
93
93
  });
94
- $.displayName = "DrawerDesktopV2";
95
- const q = ({
94
+ M.displayName = "DrawerDesktopV2";
95
+ const $ = ({
96
96
  ref: s,
97
97
  children: f,
98
98
  direction: c = "left",
@@ -114,7 +114,7 @@ const q = ({
114
114
  };
115
115
  }
116
116
  }, [e, t]);
117
- const w = R("border-neutral-strong-default", {
117
+ const v = R("border-neutral-strong-default", {
118
118
  variants: {
119
119
  isOpen: {
120
120
  true: "desktop-drawer-visible",
@@ -162,7 +162,7 @@ const q = ({
162
162
  className: k(
163
163
  "bg-neutral-strong-default h-full top-0 z-60 w-max overflow-y-auto",
164
164
  b ? "absolute" : "fixed",
165
- w({ isOpen: e, direction: c }),
165
+ v({ isOpen: e, direction: c }),
166
166
  !u && "p-4 pt-10",
167
167
  y
168
168
  ),
@@ -197,6 +197,8 @@ const q = ({
197
197
  ] });
198
198
  };
199
199
  export {
200
- $ as default,
201
- Z as useDrawerControl
200
+ M as default,
201
+ Z as useDrawerControl,
202
+ _ as useDrawerDesktop,
203
+ ee as useDrawerMobile
202
204
  };