@definable/ui 0.1.30 → 0.1.32

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.
@@ -12,46 +12,46 @@ function O({
12
12
  title: U = "Crop Your Image",
13
13
  outputSize: h = 200
14
14
  }) {
15
- const [t, w] = x({ x: 0, y: 0, size: 100 }), [N, y] = x(!1), [k, z] = x(!1), [C, X] = x({ x: 0, y: 0 }), [r, Y] = x({ width: 0, height: 0 }), D = L(null), b = L(null), A = m(() => {
16
- if (b.current) {
17
- const e = b.current, i = 400, a = e.naturalWidth / e.naturalHeight;
18
- let n, o;
19
- a > 1 ? (n = i, o = i / a) : (o = i, n = i * a), Y({ width: n, height: o });
20
- const l = Math.min(n, o) * 0.6;
15
+ const [t, w] = x({ x: 0, y: 0, size: 100 }), [N, y] = x(!1), [C, z] = x(!1), [k, X] = x({ x: 0, y: 0 }), [r, Y] = x({ width: 0, height: 0 }), D = L(null), p = L(null), A = m(() => {
16
+ if (p.current) {
17
+ const e = p.current, o = 400, a = e.naturalWidth / e.naturalHeight;
18
+ let n, i;
19
+ a > 1 ? (n = o, i = o / a) : (i = o, n = o * a), Y({ width: n, height: i });
20
+ const l = Math.min(n, i) * 0.6;
21
21
  w({
22
22
  x: (n - l) / 2,
23
- y: (o - l) / 2,
23
+ y: (i - l) / 2,
24
24
  size: l
25
25
  });
26
26
  }
27
- }, []), p = m((e, i) => {
27
+ }, []), b = m((e, o) => {
28
28
  e.preventDefault();
29
- const a = e.currentTarget.getBoundingClientRect(), n = e.clientX - a.left, o = e.clientY - a.top;
30
- if (i === "resize") {
29
+ const a = e.currentTarget.getBoundingClientRect(), n = e.clientX - a.left, i = e.clientY - a.top;
30
+ if (o === "resize") {
31
31
  z(!0);
32
- const l = t.x + t.size / 2, u = t.y + t.size / 2, c = Math.sqrt((n - l) ** 2 + (o - u) ** 2);
32
+ const l = t.x + t.size / 2, u = t.y + t.size / 2, c = Math.sqrt((n - l) ** 2 + (i - u) ** 2);
33
33
  X({ x: c, y: 0 });
34
34
  } else
35
- y(!0), X({ x: n - t.x, y: o - t.y });
35
+ y(!0), X({ x: n - t.x, y: i - t.y });
36
36
  }, [t]), B = m((e) => {
37
- if (!N && !k) return;
38
- const i = e.currentTarget.getBoundingClientRect(), a = e.clientX - i.left, n = e.clientY - i.top;
39
- if (k) {
40
- const o = t.x + t.size / 2, l = t.y + t.size / 2, u = Math.sqrt((a - o) ** 2 + (n - l) ** 2), c = Math.max(50, Math.min(Math.min(r.width, r.height), u * 2));
37
+ if (!N && !C) return;
38
+ const o = e.currentTarget.getBoundingClientRect(), a = e.clientX - o.left, n = e.clientY - o.top;
39
+ if (C) {
40
+ const i = t.x + t.size / 2, l = t.y + t.size / 2, u = Math.sqrt((a - i) ** 2 + (n - l) ** 2), c = Math.max(50, Math.min(Math.min(r.width, r.height), u * 2));
41
41
  w({
42
- x: Math.max(0, Math.min(r.width - c, o - c / 2)),
42
+ x: Math.max(0, Math.min(r.width - c, i - c / 2)),
43
43
  y: Math.max(0, Math.min(r.height - c, l - c / 2)),
44
44
  size: c
45
45
  });
46
46
  } else if (N) {
47
- const o = a - C.x, l = n - C.y, u = r.width - t.size, c = r.height - t.size;
47
+ const i = a - k.x, l = n - k.y, u = r.width - t.size, c = r.height - t.size;
48
48
  w((R) => ({
49
49
  ...R,
50
- x: Math.max(0, Math.min(u, o)),
50
+ x: Math.max(0, Math.min(u, i)),
51
51
  y: Math.max(0, Math.min(c, l))
52
52
  }));
53
53
  }
54
- }, [N, k, C, r, t]), $ = m(() => {
54
+ }, [N, C, k, r, t]), $ = m(() => {
55
55
  y(!1), z(!1);
56
56
  }, []), H = m(() => {
57
57
  if (r.width && r.height) {
@@ -63,13 +63,13 @@ function O({
63
63
  });
64
64
  }
65
65
  }, [r]), W = m(() => {
66
- if (!D.current || !b.current) return;
67
- const e = D.current, i = e.getContext("2d");
68
- if (!i) return;
69
- const a = b.current;
66
+ if (!D.current || !p.current) return;
67
+ const e = D.current, o = e.getContext("2d");
68
+ if (!o) return;
69
+ const a = p.current;
70
70
  e.width = h, e.height = h;
71
- const n = a.naturalWidth / r.width, o = a.naturalHeight / r.height, l = t.x * n, u = t.y * o, c = t.size * Math.min(n, o);
72
- i.beginPath(), i.arc(h / 2, h / 2, h / 2, 0, Math.PI * 2), i.clip(), i.drawImage(
71
+ const n = a.naturalWidth / r.width, i = a.naturalHeight / r.height, l = t.x * n, u = t.y * i, c = t.size * Math.min(n, i);
72
+ o.beginPath(), o.arc(h / 2, h / 2, h / 2, 0, Math.PI * 2), o.clip(), o.drawImage(
73
73
  a,
74
74
  l,
75
75
  u,
@@ -140,7 +140,7 @@ function O({
140
140
  /* @__PURE__ */ s(
141
141
  "img",
142
142
  {
143
- ref: b,
143
+ ref: p,
144
144
  src: f,
145
145
  alt: "Crop preview",
146
146
  className: "block",
@@ -159,7 +159,7 @@ function O({
159
159
  width: t.size,
160
160
  height: t.size
161
161
  },
162
- onMouseDown: (e) => p(e, "move"),
162
+ onMouseDown: (e) => b(e, "move"),
163
163
  children: [
164
164
  /* @__PURE__ */ s("div", { className: "w-full h-full rounded-full border-2 border-primary border-dashed" }),
165
165
  /* @__PURE__ */ s(
@@ -167,7 +167,7 @@ function O({
167
167
  {
168
168
  className: "absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-nw-resize -top-2.5 -right-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",
169
169
  onMouseDown: (e) => {
170
- e.stopPropagation(), p(e, "resize");
170
+ e.stopPropagation(), b(e, "resize");
171
171
  },
172
172
  children: /* @__PURE__ */ s("div", { className: "w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors" })
173
173
  }
@@ -177,7 +177,7 @@ function O({
177
177
  {
178
178
  className: "absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-ne-resize -bottom-2.5 -right-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",
179
179
  onMouseDown: (e) => {
180
- e.stopPropagation(), p(e, "resize");
180
+ e.stopPropagation(), b(e, "resize");
181
181
  },
182
182
  children: /* @__PURE__ */ s("div", { className: "w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors" })
183
183
  }
@@ -187,7 +187,7 @@ function O({
187
187
  {
188
188
  className: "absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-sw-resize -bottom-2.5 -left-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",
189
189
  onMouseDown: (e) => {
190
- e.stopPropagation(), p(e, "resize");
190
+ e.stopPropagation(), b(e, "resize");
191
191
  },
192
192
  children: /* @__PURE__ */ s("div", { className: "w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors" })
193
193
  }
@@ -197,7 +197,7 @@ function O({
197
197
  {
198
198
  className: "absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-se-resize -top-2.5 -left-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",
199
199
  onMouseDown: (e) => {
200
- e.stopPropagation(), p(e, "resize");
200
+ e.stopPropagation(), b(e, "resize");
201
201
  },
202
202
  children: /* @__PURE__ */ s("div", { className: "w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors" })
203
203
  }
@@ -222,7 +222,7 @@ function O({
222
222
  /* @__PURE__ */ s(
223
223
  "div",
224
224
  {
225
- className: "rounded-full border-2 border-border bg-background overflow-hidden mx-auto",
225
+ className: "rounded-full border-2 border-light bg-secondary overflow-hidden mx-auto",
226
226
  style: { width: 80, height: 80 },
227
227
  children: /* @__PURE__ */ s(
228
228
  "div",
@@ -1,45 +1,45 @@
1
- import { jsxs as t, Fragment as j, jsx as e } from "react/jsx-runtime";
2
- import { useState as f, useRef as S, useCallback as i } from "react";
3
- import { Button as h } from "./button.js";
1
+ import { jsxs as o, Fragment as j, jsx as e } from "react/jsx-runtime";
2
+ import { useState as h, useRef as S, useCallback as n } from "react";
3
+ import { Button as f } from "./button.js";
4
4
  import { RotateCw as F, X as O, Upload as U } from "lucide-react";
5
5
  import { ImageCropperModal as A } from "./image-cropper-modal.js";
6
6
  import { cn as E } from "../lib/utils.js";
7
7
  function Y({
8
8
  value: c,
9
9
  onChange: a,
10
- size: n = 120,
10
+ size: i = 120,
11
11
  className: g,
12
12
  placeholder: b = "Upload Image",
13
13
  title: v = "Crop Your Image",
14
14
  outputSize: x = 200
15
15
  }) {
16
- const [C, d] = f(!1), [N, s] = f(null), l = S(null), w = i((r) => {
17
- var m;
18
- const o = (m = r.target.files) == null ? void 0 : m[0];
19
- if (o) {
16
+ const [C, m] = h(!1), [N, s] = h(null), l = S(null), w = n((r) => {
17
+ var d;
18
+ const t = (d = r.target.files) == null ? void 0 : d[0];
19
+ if (t) {
20
20
  const p = new FileReader();
21
- p.onload = (R) => {
21
+ p.onload = (k) => {
22
22
  var u;
23
- const M = (u = R.target) == null ? void 0 : u.result;
24
- s(M), d(!0);
25
- }, p.readAsDataURL(o);
23
+ const M = (u = k.target) == null ? void 0 : u.result;
24
+ s(M), m(!0);
25
+ }, p.readAsDataURL(t);
26
26
  }
27
27
  r.target.value = "";
28
- }, []), y = i((r) => {
28
+ }, []), y = n((r) => {
29
29
  a(r), s(null);
30
- }, [a]), k = i(() => {
31
- d(!1), s(null), l.current && (l.current.value = "");
32
- }, []), I = i(() => {
30
+ }, [a]), I = n(() => {
31
+ m(!1), s(null), l.current && (l.current.value = "");
32
+ }, []), R = n(() => {
33
33
  a(null);
34
34
  }, [a]);
35
- return /* @__PURE__ */ t(j, { children: [
36
- /* @__PURE__ */ t("div", { className: E("space-y-3", g), children: [
37
- c ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-3", children: [
35
+ return /* @__PURE__ */ o(j, { children: [
36
+ /* @__PURE__ */ o("div", { className: E("space-y-3", g), children: [
37
+ c ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-3", children: [
38
38
  /* @__PURE__ */ e(
39
39
  "div",
40
40
  {
41
- className: "rounded-full border-2 border-border/50 overflow-hidden bg-background",
42
- style: { width: n, height: n },
41
+ className: "rounded-full border-2 border-light overflow-hidden bg-secondary",
42
+ style: { width: i, height: i },
43
43
  children: /* @__PURE__ */ e(
44
44
  "img",
45
45
  {
@@ -50,15 +50,15 @@ function Y({
50
50
  )
51
51
  }
52
52
  ),
53
- /* @__PURE__ */ t("div", { className: "flex gap-2", children: [
54
- /* @__PURE__ */ t(
55
- h,
53
+ /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
54
+ /* @__PURE__ */ o(
55
+ f,
56
56
  {
57
57
  variant: "outline",
58
58
  size: "sm",
59
59
  onClick: (r) => {
60
- var o;
61
- r.stopPropagation(), (o = l.current) == null || o.click();
60
+ var t;
61
+ r.stopPropagation(), (t = l.current) == null || t.click();
62
62
  },
63
63
  children: [
64
64
  /* @__PURE__ */ e(F, { className: "h-3 w-3 mr-1" }),
@@ -66,12 +66,12 @@ function Y({
66
66
  ]
67
67
  }
68
68
  ),
69
- /* @__PURE__ */ t(
70
- h,
69
+ /* @__PURE__ */ o(
70
+ f,
71
71
  {
72
72
  variant: "outline",
73
73
  size: "sm",
74
- onClick: I,
74
+ onClick: R,
75
75
  children: [
76
76
  /* @__PURE__ */ e(O, { className: "h-3 w-3 mr-1" }),
77
77
  "Remove"
@@ -79,20 +79,20 @@ function Y({
79
79
  }
80
80
  )
81
81
  ] })
82
- ] }) : /* @__PURE__ */ t(
82
+ ] }) : /* @__PURE__ */ o(
83
83
  "button",
84
84
  {
85
85
  onClick: (r) => {
86
- var o;
87
- r.stopPropagation(), (o = l.current) == null || o.click();
86
+ var t;
87
+ r.stopPropagation(), (t = l.current) == null || t.click();
88
88
  },
89
- className: "w-full border-2 border-dashed border-border/50 rounded-lg p-6 hover:border-primary/50 hover:bg-primary/2 transition-colors group",
89
+ className: "w-full border-2 border-dashed border-light rounded-lg p-6 hover:border-primary/50 hover:bg-primary/2 transition-colors group",
90
90
  children: [
91
91
  /* @__PURE__ */ e(
92
92
  "div",
93
93
  {
94
94
  className: "mx-auto rounded-full bg-primary/10 flex items-center justify-center group-hover:bg-primary/15 transition-colors mb-3",
95
- style: { width: Math.min(n / 2, 60), height: Math.min(n / 2, 60) },
95
+ style: { width: Math.min(i / 2, 60), height: Math.min(i / 2, 60) },
96
96
  children: /* @__PURE__ */ e(U, { className: "h-6 w-6 text-primary" })
97
97
  }
98
98
  ),
@@ -116,7 +116,7 @@ function Y({
116
116
  A,
117
117
  {
118
118
  isOpen: C,
119
- onClose: k,
119
+ onClose: I,
120
120
  imageSrc: N,
121
121
  onCrop: y,
122
122
  title: v,
@@ -7,7 +7,7 @@ const l = n.forwardRef(
7
7
  {
8
8
  type: o,
9
9
  className: a(
10
- "h-10 w-full rounded-lg border-2 border-border bg-background px-4 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary disabled:cursor-not-allowed disabled:opacity-50",
10
+ "h-10 w-full rounded-lg border-2 border-light bg-secondary px-4 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary disabled:cursor-not-allowed disabled:opacity-50",
11
11
  r
12
12
  ),
13
13
  ref: t,
@@ -39,7 +39,7 @@ function h({
39
39
  },
40
40
  i
41
41
  )) });
42
- return s ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-background flex items-center justify-center z-[9999]", children: /* @__PURE__ */ r(
42
+ return s ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-secondary flex items-center justify-center z-[9999]", children: /* @__PURE__ */ r(
43
43
  a.div,
44
44
  {
45
45
  className: "text-center",
@@ -30,55 +30,55 @@ function I({
30
30
  onClose: i,
31
31
  title: d,
32
32
  description: a,
33
- icon: n,
34
- children: h,
35
- footer: s,
33
+ icon: s,
34
+ children: x,
35
+ footer: n,
36
36
  size: g = "md",
37
37
  showClose: w = !0,
38
38
  className: f,
39
- isContentScrollable: b = !0,
40
- mainClassName: v,
41
- contentClassName: y,
39
+ isContentScrollable: v = !0,
40
+ mainClassName: y,
41
+ contentClassName: N,
42
42
  header: c,
43
- headerClassName: N,
43
+ headerClassName: b,
44
44
  zIndexClassName: k = "z-[50]",
45
45
  mobileSheet: m
46
46
  }) {
47
47
  if (m != null && m.enable && r && window.innerWidth < 768) {
48
- const { position: x } = m;
48
+ const { position: h } = m;
49
49
  return /* @__PURE__ */ e(
50
50
  L,
51
51
  {
52
52
  isOpen: r,
53
53
  onClose: i,
54
- header: c || (d || a || n ? /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
55
- n && /* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-lg flex items-center justify-center", children: n }),
54
+ header: c || (d || a || s ? /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
55
+ s && /* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-lg flex items-center justify-center", children: s }),
56
56
  /* @__PURE__ */ t("div", { children: [
57
57
  d && /* @__PURE__ */ e("h2", { className: "text-sm font-medium", children: d }),
58
58
  a && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: a })
59
59
  ] })
60
60
  ] }) : void 0),
61
- footer: /* @__PURE__ */ e("div", { className: "flex gap-2 justify-end", children: s }),
61
+ footer: /* @__PURE__ */ e("div", { className: "flex gap-2 justify-end", children: n }),
62
62
  className: l(f, "w-full max-w-full"),
63
- position: x || "bottom",
64
- headerClassName: l(N, "w-full max-w-full"),
63
+ position: h || "bottom",
64
+ headerClassName: l(b, "w-full max-w-full"),
65
65
  enableFullscreen: !1,
66
- children: h
66
+ children: x
67
67
  }
68
68
  );
69
69
  }
70
- const u = F((x) => {
71
- x.key === "Escape" && r && i();
70
+ const u = F((h) => {
71
+ h.key === "Escape" && r && i();
72
72
  }, [r, i]);
73
73
  H(() => (document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u)), [u]);
74
- const o = d || a || n || c, j = /* @__PURE__ */ e(E, { children: r && /* @__PURE__ */ e("div", { className: l("fixed inset-0 z-50 overflow-hidden", k), children: /* @__PURE__ */ t("div", { className: l("min-h-full flex items-center justify-center p-4", v), children: [
74
+ const o = d || a || s || c, j = /* @__PURE__ */ e(E, { children: r && /* @__PURE__ */ e("div", { className: l("fixed inset-0 z-50 overflow-hidden", k), children: /* @__PURE__ */ t("div", { className: l("min-h-full flex items-center justify-center p-4", y), children: [
75
75
  /* @__PURE__ */ e(
76
76
  p.div,
77
77
  {
78
78
  initial: { opacity: 0 },
79
79
  animate: { opacity: 1 },
80
80
  exit: { opacity: 0 },
81
- className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
81
+ className: "fixed inset-0 bg-secondary/80 backdrop-blur-sm",
82
82
  onClick: i
83
83
  }
84
84
  ),
@@ -90,14 +90,14 @@ function I({
90
90
  exit: { opacity: 0, scale: 0.95 },
91
91
  transition: { duration: 0.1, ease: "easeOut" },
92
92
  className: l(
93
- "relative transform rounded-lg bg-background shadow-xl border border-border/50 flex flex-col max-h-[85vh] overflow-hidden",
93
+ "relative transform rounded-lg bg-secondary shadow-xl border border-light flex flex-col max-h-[85vh] overflow-hidden",
94
94
  f
95
95
  ),
96
96
  style: P(g),
97
97
  children: [
98
- o && /* @__PURE__ */ t("div", { className: "flex-shrink-0 rounded-t-lg bg-card flex items-center justify-between p-2 border-b border-border/50", children: [
98
+ o && /* @__PURE__ */ t("div", { className: "flex-shrink-0 rounded-t-lg bg-card flex items-center justify-between p-2 border-b border-light", children: [
99
99
  c || /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
100
- n && /* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-lg flex items-center justify-center", children: n }),
100
+ s && /* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-lg flex items-center justify-center", children: s }),
101
101
  /* @__PURE__ */ t("div", { children: [
102
102
  d && /* @__PURE__ */ e("h2", { className: "text-sm font-small", children: d }),
103
103
  a && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: a })
@@ -117,13 +117,13 @@ function I({
117
117
  ] }),
118
118
  /* @__PURE__ */ e("div", { className: l(
119
119
  "flex-1 min-h-0",
120
- b ? "overflow-y-auto" : "",
121
- !s && !o ? "rounded-lg" : "",
122
- !s && o ? "rounded-b-lg" : "",
123
- s && !o ? "rounded-t-lg" : "",
124
- y
125
- ), children: h }),
126
- s && /* @__PURE__ */ e("div", { className: "flex-shrink-0 flex items-center justify-end gap-2 px-4 py-3 border-t border-border/50 bg-card rounded-b-lg", children: s })
120
+ v ? "overflow-y-auto" : "",
121
+ !n && !o ? "rounded-lg" : "",
122
+ !n && o ? "rounded-b-lg" : "",
123
+ n && !o ? "rounded-t-lg" : "",
124
+ N
125
+ ), children: x }),
126
+ n && /* @__PURE__ */ e("div", { className: "flex-shrink-0 flex items-center justify-end gap-2 px-4 py-3 border-t border-light bg-card rounded-b-lg", children: n })
127
127
  ]
128
128
  }
129
129
  )
@@ -28,7 +28,7 @@ function E({
28
28
  "div",
29
29
  {
30
30
  className: l("cursor-pointer select-none", g),
31
- children: f || /* @__PURE__ */ t("div", { className: "flex items-center justify-between p-3.5 bg-muted/20 hover:bg-muted/30 active:scale-[0.98] rounded-xl border border-border/40 transition-all group", children: [
31
+ children: f || /* @__PURE__ */ t("div", { className: "flex items-center justify-between p-3.5 bg-muted/20 hover:bg-muted/30 active:scale-[0.98] rounded-xl border border-light transition-all group", children: [
32
32
  /* @__PURE__ */ t("div", { className: "flex flex-col gap-0.5 text-left", children: [
33
33
  /* @__PURE__ */ e("span", { className: "text-[10px] font-black uppercase tracking-[0.2em] text-muted-foreground/45", children: n }),
34
34
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
@@ -45,7 +45,7 @@ function E({
45
45
  ) }),
46
46
  /* @__PURE__ */ t(P, { children: [
47
47
  /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(V, { children: n }) }),
48
- /* @__PURE__ */ e("div", { className: "px-6 pt-0 space-y-5 pb-10", children: /* @__PURE__ */ t("div", { className: "relative h-[220px] bg-card/60 dark:bg-muted/10 rounded-[32px] overflow-hidden border border-border/10 shadow-sm", children: [
48
+ /* @__PURE__ */ e("div", { className: "px-6 pt-0 space-y-5 pb-10", children: /* @__PURE__ */ t("div", { className: "relative h-[220px] bg-card dark:bg-muted/10 rounded-[32px] overflow-hidden border border-light shadow-sm", children: [
49
49
  /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-1/2 -translate-y-1/2 h-[56px] bg-primary/[0.04] dark:bg-primary/10 border-y border-primary/10 rounded-2xl pointer-events-none z-10" }),
50
50
  /* @__PURE__ */ e(
51
51
  i,
@@ -9,7 +9,7 @@ const I = e.Root, E = e.Group, L = e.Value, R = a.forwardRef(({ className: o, ch
9
9
  {
10
10
  ref: n,
11
11
  className: i(
12
- "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
12
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-secondary px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
13
13
  o
14
14
  ),
15
15
  ...r,
@@ -21,7 +21,7 @@ const I = e.Root, E = e.Group, L = e.Value, R = a.forwardRef(({ className: o, ch
21
21
  ));
22
22
  R.displayName = e.Trigger.displayName;
23
23
  const g = a.forwardRef(({ className: o, children: s, position: r = "popper", searchable: n, onSearch: m, searchPlaceholder: p = "Search...", ...f }, d) => {
24
- const [b, y] = a.useState(""), u = a.useRef(null);
24
+ const [y, b] = a.useState(""), u = a.useRef(null);
25
25
  a.useEffect(() => {
26
26
  n && u.current && setTimeout(() => {
27
27
  var l;
@@ -29,7 +29,7 @@ const g = a.forwardRef(({ className: o, children: s, position: r = "popper", sea
29
29
  }, 50);
30
30
  }, [n]);
31
31
  const w = (l) => {
32
- y(l.target.value), m && m(l.target.value);
32
+ b(l.target.value), m && m(l.target.value);
33
33
  }, h = (l) => {
34
34
  l.stopPropagation();
35
35
  }, x = (l) => {
@@ -58,7 +58,7 @@ const g = a.forwardRef(({ className: o, children: s, position: r = "popper", sea
58
58
  C,
59
59
  {
60
60
  ref: u,
61
- value: b,
61
+ value: y,
62
62
  onChange: w,
63
63
  onClick: h,
64
64
  onKeyDown: x,
@@ -17,7 +17,7 @@ function w({
17
17
  initial: { y: 100, opacity: 0 },
18
18
  animate: { y: 0, opacity: 1 },
19
19
  exit: { y: 100, opacity: 0 },
20
- className: "fixed bottom-4 left-1/2 -translate-x-1/2 w-fit bg-background rounded-lg border shadow-lg z-50",
20
+ className: "fixed bottom-4 left-1/2 -translate-x-1/2 w-fit bg-secondary rounded-lg border shadow-lg z-50",
21
21
  children: /* @__PURE__ */ i("div", { className: "flex items-center gap-6 px-4 py-2", children: [
22
22
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2 text-sm font-medium", children: [
23
23
  /* @__PURE__ */ e("span", { className: "bg-primary text-primary-foreground w-8 h-8 rounded-lg flex items-center justify-center", children: l }),
@@ -1,26 +1,26 @@
1
1
  import { jsxs as l, jsx as t, Fragment as R } from "react/jsx-runtime";
2
2
  import { Minimize2 as B, Maximize2 as I, X as M } from "lucide-react";
3
- import { Button as b } from "./button.js";
3
+ import { Button as y } from "./button.js";
4
4
  import { useState as X, useRef as q, useEffect as m } from "react";
5
5
  import { cn as u } from "../lib/utils.js";
6
- import { AnimatePresence as D, motion as y } from "framer-motion";
6
+ import { AnimatePresence as D, motion as g } from "framer-motion";
7
7
  import { createPortal as G } from "react-dom";
8
8
  let a = [];
9
9
  function W({
10
10
  isOpen: i,
11
11
  onClose: s,
12
- children: g,
12
+ children: b,
13
13
  header: v,
14
14
  footer: f,
15
15
  className: N,
16
- enableFullscreen: k = !0,
16
+ enableFullscreen: w = !0,
17
17
  position: c = "right",
18
- headerClassName: w = "",
18
+ headerClassName: k = "",
19
19
  disableOutsideClose: h = !1
20
20
  }) {
21
- const [n, P] = X(!1), r = q(null);
22
- if (m(() => (i ? a.push(r) : a = a.filter((e) => e !== r), () => {
23
- a = a.filter((e) => e !== r);
21
+ const [r, P] = X(!1), n = q(null);
22
+ if (m(() => (i ? a.push(n) : a = a.filter((e) => e !== n), () => {
23
+ a = a.filter((e) => e !== n);
24
24
  }), [i]), m(() => {
25
25
  const e = (o) => {
26
26
  var p;
@@ -28,14 +28,14 @@ function W({
28
28
  const A = a.some(
29
29
  (x) => x.current && x.current.contains(o.target)
30
30
  ), F = (p = o.target) == null ? void 0 : p.closest("[data-sheet-close]");
31
- !A && !F && r.current && !r.current.contains(o.target) && s();
31
+ !A && !F && n.current && !n.current.contains(o.target) && s();
32
32
  };
33
- return i && !n && document.addEventListener("mousedown", e), () => {
33
+ return i && !r && document.addEventListener("mousedown", e), () => {
34
34
  document.removeEventListener("mousedown", e);
35
35
  };
36
- }, [i, n, h]), m(() => {
36
+ }, [i, r, h]), m(() => {
37
37
  const e = (o) => {
38
- o.key === "Escape" && i && a[a.length - 1] === r && s();
38
+ o.key === "Escape" && i && a[a.length - 1] === n && s();
39
39
  };
40
40
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
41
41
  }, [i]), !i) return null;
@@ -43,25 +43,25 @@ function W({
43
43
  e.stopPropagation(), s();
44
44
  }, z = /* @__PURE__ */ l("div", { className: "flex flex-col h-full", children: [
45
45
  /* @__PURE__ */ l("div", { className: u(
46
- "flex items-center bg-card justify-between py-4 px-4 h-header border-b border-border/50",
47
- w
46
+ "flex items-center bg-card justify-between py-4 px-4 h-header border-b border-light",
47
+ k
48
48
  ), children: [
49
49
  /* @__PURE__ */ t("div", { className: "text-sm font-medium", children: v }),
50
50
  /* @__PURE__ */ l("div", { className: "flex items-center gap-1 ml-auto", children: [
51
- k && /* @__PURE__ */ t(
52
- b,
51
+ w && /* @__PURE__ */ t(
52
+ y,
53
53
  {
54
54
  variant: "ghost",
55
55
  size: "icon",
56
56
  className: "h-7 w-7",
57
57
  onClick: (e) => {
58
- e.stopPropagation(), P(!n);
58
+ e.stopPropagation(), P(!r);
59
59
  },
60
- children: n ? /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(I, { className: "h-3.5 w-3.5" })
60
+ children: r ? /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(I, { className: "h-3.5 w-3.5" })
61
61
  }
62
62
  ),
63
63
  /* @__PURE__ */ t(
64
- b,
64
+ y,
65
65
  {
66
66
  variant: "ghost",
67
67
  size: "icon",
@@ -73,8 +73,8 @@ function W({
73
73
  )
74
74
  ] })
75
75
  ] }),
76
- /* @__PURE__ */ t("div", { className: "flex-1 overflow-auto", children: g }),
77
- f && /* @__PURE__ */ t("div", { className: "border-t border-border/50 bg-card py-2 px-3", children: /* @__PURE__ */ t("div", { className: "text-sm", children: f }) })
76
+ /* @__PURE__ */ t("div", { className: "flex-1 overflow-auto", children: b }),
77
+ f && /* @__PURE__ */ t("div", { className: "border-t border-light bg-card py-2 px-3", children: /* @__PURE__ */ t("div", { className: "text-sm", children: f }) })
78
78
  ] }), C = () => c === "left" ? {
79
79
  initial: { x: -100, opacity: 0 },
80
80
  animate: { x: 0, opacity: 1 },
@@ -87,9 +87,9 @@ function W({
87
87
  initial: { x: 100, opacity: 0 },
88
88
  animate: { x: 0, opacity: 1 },
89
89
  exit: { x: 100, opacity: 0 }
90
- }, L = () => n ? "inset-4 rounded-lg" : c === "left" ? "inset-y-0 left-0 border-r" : c === "bottom" ? "inset-x-0 bottom-0 border-t" : "inset-y-0 right-0 border-l", d = C(), S = L(), j = /* @__PURE__ */ t(D, { children: i && /* @__PURE__ */ l(R, { children: [
90
+ }, L = () => r ? "inset-4 rounded-lg" : c === "left" ? "inset-y-0 left-0 border-r" : c === "bottom" ? "inset-x-0 bottom-0 border-t" : "inset-y-0 right-0 border-l", d = C(), S = L(), j = /* @__PURE__ */ t(D, { children: i && /* @__PURE__ */ l(R, { children: [
91
91
  /* @__PURE__ */ t(
92
- y.div,
92
+ g.div,
93
93
  {
94
94
  initial: { opacity: 0 },
95
95
  animate: { opacity: 1 },
@@ -98,15 +98,15 @@ function W({
98
98
  e.stopPropagation(), s();
99
99
  },
100
100
  className: u(
101
- "fixed inset-0 z-[100] bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
102
- n ? "block" : "hidden"
101
+ "fixed inset-0 z-[100] bg-secondary/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
102
+ r ? "block" : "hidden"
103
103
  )
104
104
  }
105
105
  ),
106
106
  /* @__PURE__ */ t(
107
- y.div,
107
+ g.div,
108
108
  {
109
- ref: r,
109
+ ref: n,
110
110
  initial: d.initial,
111
111
  animate: d.animate,
112
112
  exit: d.exit,
@@ -115,7 +115,7 @@ function W({
115
115
  ease: [0.32, 0.72, 0, 1]
116
116
  },
117
117
  className: u(
118
- "fixed z-[100] bg-background shadow-lg flex flex-col border-border/50",
118
+ "fixed z-[100] bg-secondary shadow-lg flex flex-col border-light",
119
119
  S,
120
120
  N
121
121
  ),