@mci-ui/mci-ui 0.0.86 → 0.0.87

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 (64) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared/ui/MciModal/MciModal.js +107 -59
  3. package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +23 -21
  4. package/dist/shared/ui/mciButton/MciButton.js +47 -32
  5. package/dist/shared/ui/mciCheck/MciCheck.js +116 -92
  6. package/dist/shared/ui/mciCollapse/MciCollapse.js +86 -54
  7. package/dist/shared/ui/mciDrawer/MciDrawer.js +70 -52
  8. package/dist/shared/ui/mciInput/MciInput.js +143 -130
  9. package/dist/shared/ui/mciInput/mci-input.utils.js +10 -10
  10. package/dist/shared/ui/mciPagination/MciPagination.js +85 -63
  11. package/dist/shared/ui/mciPhone/MciPhone.js +59 -54
  12. package/dist/shared/ui/mciPhone/mci-phone.utils.js +10 -10
  13. package/dist/shared/ui/mciPicker/MciPicker.js +349 -181
  14. package/dist/shared/ui/mciSelect/MciSelect.js +150 -131
  15. package/dist/shared/ui/mciSelect/mci-select.utils.js +12 -12
  16. package/dist/shared/ui/mciSkeleton/MciSkeleton.js +16 -14
  17. package/dist/shared/ui/mciTable/MciTable.js +165 -126
  18. package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +113 -106
  19. package/dist/shared/ui/mciTabs/MciTabs.js +52 -45
  20. package/dist/shared/ui/mciTag/MciTag.js +27 -18
  21. package/dist/shared/ui/mciTextarea/MciTextarea.js +47 -35
  22. package/dist/shared/ui/mciToast/MciToast.js +118 -72
  23. package/dist/shared/ui/mciToast/mci-toast.utils.js +40 -12
  24. package/dist/shared/ui/mciToggle/MciToggle.js +58 -36
  25. package/dist/shared/ui/mciTooltip/MciTooltip.js +2 -2
  26. package/dist/shared/ui/mciUpload/MciUpload.js +172 -149
  27. package/dist/types/shared/types/mci-table.types.d.ts +1 -0
  28. package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -0
  29. package/dist/types/shared/types/ui/button.types.d.ts +3 -7
  30. package/dist/types/shared/types/ui/check.types.d.ts +4 -9
  31. package/dist/types/shared/types/ui/collapse.types.d.ts +1 -0
  32. package/dist/types/shared/types/ui/drawer.types.d.ts +1 -0
  33. package/dist/types/shared/types/ui/input.types.d.ts +4 -15
  34. package/dist/types/shared/types/ui/modal.types.d.ts +1 -0
  35. package/dist/types/shared/types/ui/pagination.types.d.ts +1 -0
  36. package/dist/types/shared/types/ui/phone.types.d.ts +1 -0
  37. package/dist/types/shared/types/ui/picker.types.d.ts +1 -0
  38. package/dist/types/shared/types/ui/select.types.d.ts +1 -0
  39. package/dist/types/shared/types/ui/skeleton.types.d.ts +1 -0
  40. package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
  41. package/dist/types/shared/types/ui/tag.types.d.ts +1 -0
  42. package/dist/types/shared/types/ui/textarea.types.d.ts +3 -7
  43. package/dist/types/shared/types/ui/toast.types.d.ts +1 -0
  44. package/dist/types/shared/types/ui/toggle.types.d.ts +3 -2
  45. package/dist/types/shared/types/ui/upload.types.d.ts +1 -0
  46. package/dist/types/shared/ui/MciModal/MciModal.d.ts +1 -1
  47. package/dist/types/shared/ui/mciBreadcrumb/MciBreadcrumb.d.ts +1 -1
  48. package/dist/types/shared/ui/mciButton/MciButton.d.ts +1 -1
  49. package/dist/types/shared/ui/mciCollapse/MciCollapse.d.ts +1 -1
  50. package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
  51. package/dist/types/shared/ui/mciInput/MciInput.d.ts +13 -2
  52. package/dist/types/shared/ui/mciInput/mci-input.utils.d.ts +2 -2
  53. package/dist/types/shared/ui/mciPagination/MciPagination.d.ts +1 -1
  54. package/dist/types/shared/ui/mciPhone/mci-phone.utils.d.ts +2 -2
  55. package/dist/types/shared/ui/mciSelect/mci-select.utils.d.ts +2 -2
  56. package/dist/types/shared/ui/mciSkeleton/MciSkeleton.d.ts +1 -1
  57. package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
  58. package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +2 -1
  59. package/dist/types/shared/ui/mciTabs/MciTabs.d.ts +1 -1
  60. package/dist/types/shared/ui/mciTag/MciTag.d.ts +1 -1
  61. package/dist/types/shared/ui/mciTextarea/MciTextarea.d.ts +7 -2
  62. package/dist/types/shared/ui/mciToast/mci-toast.utils.d.ts +32 -4
  63. package/dist/types/shared/ui/mciToggle/MciToggle.d.ts +1 -1
  64. package/package.json +1 -1
@@ -1,170 +1,194 @@
1
- import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
- import { memo as j, useState as S, useMemo as b, useCallback as L } from "react";
3
- import $ from "../../../assets/icons/check.svg.js";
4
- import { cn as r } from "../../lib/utils.js";
5
- const A = {
1
+ import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
+ import { memo as F, useState as S, useMemo as v, useCallback as H } from "react";
3
+ import L from "../../../assets/icons/check.svg.js";
4
+ import { cn as l } from "../../lib/utils.js";
5
+ const $ = {
6
6
  blue: {
7
7
  border: "border-blue-600",
8
8
  bg: "bg-blue-600",
9
9
  hover: "hover:border-blue-600 hover:bg-blue-100",
10
- focus: "focus:shadow-blue"
10
+ focus: "peer-focus-visible:shadow-blue",
11
+ darkFocus: "peer-focus-visible:shadow-[0_0_0_2px_var(--opacity-25,rgba(21,93,252,0.25))]",
12
+ darkBorder: "border-blue-500",
13
+ darkBg: "bg-blue-500",
14
+ darkHover: "hover:border-blue-500 hover:bg-blue-500"
11
15
  },
12
16
  yellow: {
13
17
  border: "border-yellow-500",
14
18
  bg: "bg-yellow-500",
15
- hover: "hover:border-yellow-500 hover:bg-yello-100",
16
- focus: "focus:ring-2 focus:ring-yellow-300"
19
+ hover: "hover:border-yellow-500 hover:bg-yellow-100",
20
+ focus: "peer-focus-visible:ring-2 peer-focus-visible:ring-yellow-300",
21
+ darkFocus: "peer-focus-visible:ring-2 peer-focus-visible:ring-yellow-300/40",
22
+ darkBorder: "border-yellow-500",
23
+ darkBg: "bg-yellow-500",
24
+ darkHover: "hover:border-yellow-500 hover:bg-yellow-500"
17
25
  }
18
- }, E = j(function({
19
- type: x = "checkbox",
26
+ }, A = F(function({
27
+ type: m = "checkbox",
20
28
  label: c,
21
- supportText: l,
22
- checked: i,
23
- onChange: g,
24
- error: n,
25
- disabled: a = !1,
26
- required: h = !1,
27
- className: v,
29
+ supportText: i,
30
+ checked: u,
31
+ onChange: d,
32
+ error: o,
33
+ disabled: n = !1,
34
+ required: f = !1,
35
+ className: w,
28
36
  variant: p = "yellow",
29
- name: f,
30
- value: k
37
+ darkMode: e = !1,
38
+ name: g,
39
+ value: N,
40
+ ...B
31
41
  }) {
32
- const [y, w] = S(!1), s = x === "radio", e = b(
33
- () => i ?? y,
34
- [i, y]
35
- ), N = L(
42
+ const [y, k] = S(!1), s = m === "radio", r = v(
43
+ () => u ?? y,
44
+ [u, y]
45
+ ), C = H(
36
46
  (t) => {
37
- a || (i === void 0 && w(t.target.checked), g?.(t));
47
+ n || (u === void 0 && k(t.target.checked), d?.(t));
38
48
  },
39
- [i, g, a]
40
- ), m = b(() => {
41
- if (a) {
42
- const d = "border-slate-200 bg-slate-100";
49
+ [u, d, n]
50
+ ), x = v(() => {
51
+ if (n) {
52
+ const b = e ? "border-neutral-200 bg-neutral-300/60" : "border-slate-200 bg-slate-100";
43
53
  return s ? {
44
- container: d,
45
- dot: e ? "bg-slate-300" : "bg-transparent",
46
- check: "text-slate-400"
54
+ container: b,
55
+ dot: r ? e ? "bg-neutral-100/70" : "bg-slate-300" : "bg-transparent",
56
+ check: e ? "text-neutral-100/50" : "text-slate-400"
47
57
  } : {
48
- container: d,
58
+ container: b,
49
59
  dot: "",
50
- check: e ? "text-slate-400" : "text-transparent"
60
+ check: r ? e ? "text-neutral-100/50" : "text-slate-400" : "text-transparent"
51
61
  };
52
62
  }
53
- const t = A[p];
63
+ const t = $[p];
54
64
  if (s) {
55
- const d = r(
65
+ const b = l(
56
66
  "border transition-all duration-200",
57
- e ? t.border : "border-slate-400",
58
- !e && t.hover,
59
- t.focus,
60
- e && ""
61
- ), M = r(
67
+ r ? e ? t.darkBorder : t.border : e ? "border-neutral-200 bg-transparent" : "border-slate-400",
68
+ !r && (e ? "hover:border-neutral-100 hover:bg-neutral-300" : t.hover),
69
+ e ? t.darkFocus : t.focus,
70
+ r && ""
71
+ ), j = l(
62
72
  "transition-all duration-200 rounded-full",
63
- e ? t.bg : "bg-transparent"
73
+ r ? e ? "bg-white" : t.bg : "bg-transparent"
64
74
  );
65
75
  return {
66
- container: d,
67
- dot: M,
76
+ container: b,
77
+ dot: j,
68
78
  check: ""
69
79
  };
70
80
  }
71
81
  return {
72
- container: r(
82
+ container: l(
73
83
  "border transition-all duration-200",
74
- e ? r(t.bg, t.border) : "border-slate-400",
75
- !e && t.hover,
76
- t.focus
84
+ r ? l(e ? t.darkBg : t.bg, e ? t.darkBorder : t.border) : e ? "border-neutral-200 bg-transparent" : "border-slate-400",
85
+ !r && (e ? "hover:border-neutral-100 hover:bg-neutral-300" : t.hover),
86
+ r && e && t.darkHover,
87
+ e ? t.darkFocus : t.focus
77
88
  ),
78
89
  dot: "",
79
- check: e ? "text-white" : "text-transparent"
90
+ check: r ? "text-white" : "text-transparent"
80
91
  };
81
- }, [s, e, a, p]), C = b(() => !c && !l ? null : /* @__PURE__ */ u("div", { className: "flex flex-col", children: [
82
- c && /* @__PURE__ */ u(
92
+ }, [s, r, n, p, e]), _ = v(() => !c && !i ? null : /* @__PURE__ */ h("div", { className: "flex flex-col", children: [
93
+ c && /* @__PURE__ */ h(
83
94
  "span",
84
95
  {
85
- className: r(
86
- "text-base font-medium text-slate-700",
87
- n && "text-red-600",
88
- a && "text-slate-400"
96
+ className: l(
97
+ "text-base font-medium",
98
+ o && (e ? "text-red-500" : "text-red-600"),
99
+ !o && (e ? "text-neutral-50" : "text-slate-700"),
100
+ n && (e ? "text-neutral-50/50" : "text-slate-400")
89
101
  ),
90
102
  children: [
91
103
  c,
92
- h && /* @__PURE__ */ o("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
104
+ f && /* @__PURE__ */ a("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
93
105
  ]
94
106
  }
95
107
  ),
96
- l && /* @__PURE__ */ o(
108
+ i && /* @__PURE__ */ a(
97
109
  "span",
98
110
  {
99
- className: r(
100
- "text-slate-500 text-base font-normal",
101
- a && "text-slate-400"
111
+ className: l(
112
+ "text-base font-normal",
113
+ e ? "text-neutral-100" : "text-slate-500",
114
+ n && (e ? "text-neutral-100/50" : "text-slate-400")
102
115
  ),
103
- children: l
116
+ children: i
104
117
  }
105
118
  )
106
- ] }), [c, l, n, a, h]);
107
- return /* @__PURE__ */ u("div", { className: r("flex items-start", v), children: [
108
- /* @__PURE__ */ u(
119
+ ] }), [c, i, o, n, f, e]);
120
+ return /* @__PURE__ */ h("div", { className: l("flex items-start", w), children: [
121
+ /* @__PURE__ */ h(
109
122
  "label",
110
123
  {
111
- className: r(
124
+ className: l(
112
125
  "flex items-start gap-2 select-none",
113
- a ? "cursor-not-allowed" : "cursor-pointer"
126
+ n ? "cursor-not-allowed" : "cursor-pointer"
114
127
  ),
115
128
  children: [
116
- /* @__PURE__ */ o(
129
+ /* @__PURE__ */ a(
117
130
  "input",
118
131
  {
119
- type: x,
120
- checked: e,
121
- onChange: N,
122
- disabled: a,
123
- required: h,
124
- className: "sr-only",
125
- "aria-invalid": !!n,
126
- "aria-describedby": n ? `${f}-error` : void 0,
127
- name: f,
128
- value: k
132
+ ...B,
133
+ type: m,
134
+ checked: r,
135
+ onChange: C,
136
+ disabled: n,
137
+ required: f,
138
+ className: "peer sr-only",
139
+ "aria-invalid": !!o,
140
+ "aria-describedby": o ? `${g}-error` : void 0,
141
+ name: g,
142
+ value: N
129
143
  }
130
144
  ),
131
- /* @__PURE__ */ o(
145
+ /* @__PURE__ */ a(
132
146
  "div",
133
147
  {
134
- className: r(
148
+ className: l(
135
149
  "relative flex items-center justify-center",
136
150
  s ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
137
- m.container
151
+ x.container
138
152
  ),
139
- children: s ? /* @__PURE__ */ o("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ o(
153
+ children: s ? /* @__PURE__ */ a("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ a(
140
154
  "span",
141
155
  {
142
- className: r(
156
+ className: l(
143
157
  "w-3 h-3 rounded-full transition-all duration-200",
144
- m.dot,
145
- e ? "opacity-100 scale-100" : "opacity-0 scale-50"
158
+ x.dot,
159
+ r ? "opacity-100 scale-100" : "opacity-0 scale-50"
146
160
  )
147
161
  }
148
- ) }) : /* @__PURE__ */ o(
149
- $,
162
+ ) }) : /* @__PURE__ */ a(
163
+ L,
150
164
  {
151
- className: r(
165
+ className: l(
152
166
  "w-4 h-4 stroke-[2.5px] transition-opacity duration-200",
153
- m.check,
154
- e ? "opacity-100" : "opacity-0"
167
+ x.check,
168
+ r ? "opacity-100" : "opacity-0"
155
169
  )
156
170
  }
157
171
  )
158
172
  }
159
173
  ),
160
- C
174
+ _
161
175
  ]
162
176
  }
163
177
  ),
164
- n && /* @__PURE__ */ o("p", { id: `${f}-error`, className: "mt-1 text-extra-small text-red-600", children: n })
178
+ o && /* @__PURE__ */ a(
179
+ "p",
180
+ {
181
+ id: `${g}-error`,
182
+ className: l(
183
+ "mt-1 text-extra-small",
184
+ e ? "text-red-500" : "text-red-600"
185
+ ),
186
+ children: o
187
+ }
188
+ )
165
189
  ] });
166
190
  });
167
- E.displayName = "MciCheck";
191
+ A.displayName = "MciCheck";
168
192
  export {
169
- E as default
193
+ A as default
170
194
  };
@@ -1,60 +1,92 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import { AltArrowDown as p } from "@solar-icons/react";
3
- import { useState as i, useRef as b, useEffect as x } from "react";
4
- import { cn as e } from "../../lib/utils.js";
5
- function k({
6
- title: a,
7
- children: l,
8
- defaultOpen: c = !1,
9
- icon: o,
10
- className: d,
11
- contentClassName: f
1
+ import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
+ import { AltArrowDown as N } from "@solar-icons/react";
3
+ import { useState as i, useRef as _, useEffect as j } from "react";
4
+ import { cn as t } from "../../lib/utils.js";
5
+ function R({
6
+ title: c,
7
+ children: a,
8
+ defaultOpen: u = !1,
9
+ icon: l,
10
+ darkMode: e = !1,
11
+ className: b,
12
+ contentClassName: h
12
13
  }) {
13
- const [t, m] = i(c), [u, h] = i(0), s = b(null);
14
- return x(() => {
15
- s.current && h(t ? s.current.scrollHeight : 0);
16
- }, [t]), /* @__PURE__ */ n("div", { className: e("overflow-hidden rounded-xl border border-slate-200", d), children: [
17
- /* @__PURE__ */ n(
18
- "button",
19
- {
20
- onClick: () => m(!t),
21
- className: e(
22
- "flex w-full items-center justify-between p-5 transition-all duration-300 hover:cursor-pointer",
23
- t ? "border-b border-slate-200" : "border-b border-transparent"
24
- ),
25
- children: [
26
- /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
27
- o && /* @__PURE__ */ r("span", { className: "shrink-0", children: o }),
28
- /* @__PURE__ */ r("div", { className: e("text-base font-medium text-black"), children: a })
29
- ] }),
30
- /* @__PURE__ */ r(
31
- p,
32
- {
33
- weight: "Linear",
34
- size: 20,
35
- className: e(
36
- "shrink-0 transition-transform duration-300 text-slate-400",
37
- t && "rotate-180"
14
+ const [r, d] = i(u), [p, f] = i(0), n = _(null);
15
+ j(() => {
16
+ n.current && f(r ? n.current.scrollHeight : 0);
17
+ }, [r, a]);
18
+ const g = e ? "border-neutral-200 bg-neutral-300 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]" : "border-slate-200 bg-white", m = e ? [
19
+ "bg-neutral-300/70 hover:bg-neutral-200/80",
20
+ r ? "border-b border-neutral-200 shadow-[inset_0_-1px_0_rgba(255,255,255,0.02)]" : "border-b border-transparent"
21
+ ] : [
22
+ "hover:bg-slate-50",
23
+ r ? "border-b border-slate-200" : "border-b border-transparent"
24
+ ], x = e ? "text-neutral-50 group-hover:text-white" : "text-black", w = e ? "text-neutral-100" : "text-slate-500", v = e ? "text-neutral-100 group-hover:text-neutral-50" : "text-slate-400", C = e ? "bg-[#22242A]" : "bg-white";
25
+ return /* @__PURE__ */ o(
26
+ "div",
27
+ {
28
+ className: t(
29
+ "overflow-hidden rounded-xl border",
30
+ g,
31
+ b
32
+ ),
33
+ children: [
34
+ /* @__PURE__ */ o(
35
+ "button",
36
+ {
37
+ onClick: () => d(!r),
38
+ className: t(
39
+ "group flex w-full items-center justify-between p-5 transition-all duration-300 hover:cursor-pointer",
40
+ m
41
+ ),
42
+ children: [
43
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
44
+ l && /* @__PURE__ */ s("span", { className: t("shrink-0", w), children: l }),
45
+ /* @__PURE__ */ s("div", { className: t("text-base font-medium transition-colors duration-300", x), children: c })
46
+ ] }),
47
+ /* @__PURE__ */ s(
48
+ N,
49
+ {
50
+ weight: "Linear",
51
+ size: 20,
52
+ className: t(
53
+ "shrink-0 transition-all duration-300",
54
+ v,
55
+ r && "rotate-180"
56
+ )
57
+ }
38
58
  )
39
- }
40
- )
41
- ]
42
- }
43
- ),
44
- /* @__PURE__ */ r(
45
- "div",
46
- {
47
- className: e(
48
- "overflow-hidden transition-all duration-300 ease-out"
59
+ ]
60
+ }
49
61
  ),
50
- style: {
51
- height: `${u}px`
52
- },
53
- children: /* @__PURE__ */ r("div", { ref: s, className: e("p-5", f), children: l })
54
- }
55
- )
56
- ] });
62
+ /* @__PURE__ */ s(
63
+ "div",
64
+ {
65
+ className: t(
66
+ "overflow-hidden transition-all duration-300 ease-out",
67
+ C
68
+ ),
69
+ style: {
70
+ height: `${p}px`
71
+ },
72
+ children: /* @__PURE__ */ s(
73
+ "div",
74
+ {
75
+ ref: n,
76
+ className: t(
77
+ "p-5",
78
+ e && "text-neutral-100",
79
+ h
80
+ ),
81
+ children: a
82
+ }
83
+ )
84
+ }
85
+ )
86
+ ]
87
+ }
88
+ );
57
89
  }
58
90
  export {
59
- k as default
91
+ R as default
60
92
  };
@@ -1,108 +1,126 @@
1
1
  import { jsxs as n, Fragment as j, jsx as t } from "react/jsx-runtime";
2
- import { useRef as f, useCallback as E, useEffect as h, useMemo as C } from "react";
3
- import { cn as l } from "../../lib/utils.js";
2
+ import { useRef as h, useCallback as E, useEffect as x, useMemo as C } from "react";
3
+ import { cn as i } from "../../lib/utils.js";
4
4
  import X from "../../../assets/icons/close.svg.js";
5
- function A({
5
+ function D({
6
6
  isOpen: e,
7
- onClose: i,
7
+ onClose: c,
8
8
  position: o = "right",
9
9
  children: p,
10
10
  footer: m,
11
- title: r,
12
- description: a,
13
- showCloseButton: c = !0,
14
- drawerClassName: x,
15
- contentClassName: v,
16
- closeOnOverlayClick: y = !0,
11
+ title: a,
12
+ description: s,
13
+ showCloseButton: d = !0,
14
+ drawerClassName: v,
15
+ contentClassName: y,
16
+ closeOnOverlayClick: g = !0,
17
17
  closeOnEscape: z = !0,
18
- width: s = 572
18
+ width: l = 572,
19
+ darkMode: r = !1
19
20
  }) {
20
- const d = f(null), u = f(null), b = E(() => i(), [i]);
21
- h(() => {
22
- e ? (u.current = document.activeElement, d.current?.focus()) : u.current?.focus();
23
- }, [e]), h(() => (e && (document.body.style.overflow = "hidden"), () => {
21
+ const u = h(null), b = h(null), f = E(() => c(), [c]);
22
+ x(() => {
23
+ e ? (b.current = document.activeElement, u.current?.focus()) : b.current?.focus();
24
+ }, [e]), x(() => (e && (document.body.style.overflow = "hidden"), () => {
24
25
  document.body.style.overflow = "unset";
25
26
  }), [e]);
26
27
  const w = C(
27
28
  () => ({
28
- "--drawer-w": typeof s == "number" ? `${s}px` : s,
29
+ "--drawer-w": typeof l == "number" ? `${l}px` : l,
29
30
  transform: e ? "translateX(0)" : o === "right" ? "translateX(calc(100% + 48px))" : "translateX(calc(-100% - 48px))"
30
31
  }),
31
- [e, s, o]
32
- ), g = !!(r || a || c), k = o === "right" ? "top-0 bottom-0 right-0 left-3 rounded-l-3xl rounded-r-none" : "top-0 bottom-0 left-0 right-3 rounded-r-3xl rounded-l-none", N = o === "right" ? "sm:top-6 sm:bottom-6 sm:right-6 sm:left-auto" : "sm:top-6 sm:bottom-6 sm:left-6 sm:right-auto";
32
+ [e, l, o]
33
+ ), N = !!(a || s || d), k = o === "right" ? "top-0 bottom-0 right-0 left-3 rounded-l-3xl rounded-r-none" : "top-0 bottom-0 left-0 right-3 rounded-r-3xl rounded-l-none", $ = o === "right" ? "sm:top-6 sm:bottom-6 sm:right-6 sm:left-auto" : "sm:top-6 sm:bottom-6 sm:left-6 sm:right-auto";
33
34
  return /* @__PURE__ */ n(j, { children: [
34
35
  /* @__PURE__ */ t(
35
36
  "div",
36
37
  {
37
- className: l(
38
+ className: i(
38
39
  "fixed inset-0 z-50 bg-black/40 transition-opacity duration-300",
39
40
  e ? "opacity-100 visible cursor-pointer" : "opacity-0 invisible pointer-events-none"
40
41
  ),
41
- onClick: y ? b : void 0,
42
+ onClick: g ? f : void 0,
42
43
  "aria-hidden": "true"
43
44
  }
44
45
  ),
45
46
  /* @__PURE__ */ n(
46
47
  "div",
47
48
  {
48
- ref: d,
49
+ ref: u,
49
50
  tabIndex: -1,
50
51
  style: w,
51
- className: l(
52
- "fixed z-50 flex flex-col bg-white outline-none min-h-0",
52
+ className: i(
53
+ `fixed z-50 flex flex-col ${r ? "bg-black" : "bg-white"} outline-none min-h-0`,
53
54
  "transition-[transform,opacity,visibility] duration-300 ease-in-out",
54
55
  e ? "opacity-100 visible pointer-events-auto shadow-2xl" : "opacity-0 invisible pointer-events-none shadow-none",
55
56
  k,
56
57
  "h-[100dvh]",
57
58
  "pb-[env(safe-area-inset-bottom)]",
58
- N,
59
+ $,
59
60
  "sm:h-auto sm:rounded-2xl sm:pb-0",
60
61
  "sm:w-[var(--drawer-w)]",
61
- x
62
+ v
62
63
  ),
63
64
  role: "dialog",
64
65
  "aria-modal": "true",
65
66
  "aria-hidden": !e,
66
- "aria-labelledby": r ? "drawer-title" : void 0,
67
+ "aria-labelledby": a ? "drawer-title" : void 0,
67
68
  children: [
68
- g && /* @__PURE__ */ n("div", { className: "flex items-start justify-between border-b border-slate-200 shrink-0 px-4 py-4 sm:p-6", children: [
69
- (r || a) && /* @__PURE__ */ n("div", { className: "block pr-3", children: [
70
- r && /* @__PURE__ */ t(
71
- "h2",
72
- {
73
- id: "drawer-title",
74
- className: "font-semibold text-black text-xl leading-tight sm:text-h3",
75
- children: r
76
- }
77
- ),
78
- a && /* @__PURE__ */ t("p", { className: "text-sm sm:text-base text-slate-base font-normal mt-2", children: a })
79
- ] }),
80
- c && /* @__PURE__ */ t(
81
- "button",
82
- {
83
- type: "button",
84
- onClick: b,
85
- className: "bg-slate-100 rounded-xl w-11 h-11 sm:w-12 sm:h-12 hover:cursor-pointer text-black transition flex items-center justify-center group active:scale-95",
86
- children: /* @__PURE__ */ t(X, { className: "h-5 w-5 sm:h-6 sm:w-6 transition-transform duration-300 group-hover:rotate-180" })
87
- }
88
- )
89
- ] }),
69
+ N && /* @__PURE__ */ n(
70
+ "div",
71
+ {
72
+ className: `flex items-start justify-between border-b ${r ? "border-neutral-200" : "border-slate-200"} shrink-0 px-4 py-4 sm:p-6`,
73
+ children: [
74
+ (a || s) && /* @__PURE__ */ n("div", { className: "block pr-3", children: [
75
+ a && /* @__PURE__ */ t(
76
+ "h2",
77
+ {
78
+ id: "drawer-title",
79
+ className: `font-semibold ${r ? "text-slate-50" : "text-black"} text-xl leading-tight sm:text-h3`,
80
+ children: a
81
+ }
82
+ ),
83
+ s && /* @__PURE__ */ t("p", { className: `text-sm sm:text-base ${r ? "text-neutral-50" : "text-slate-base"} font-normal mt-2`, children: s })
84
+ ] }),
85
+ d && /* @__PURE__ */ t(
86
+ "button",
87
+ {
88
+ type: "button",
89
+ onClick: f,
90
+ className: `${r ? "bg-neutral-300 text-slate-50" : "bg-slate-100 text-black"} rounded-xl w-11 h-11 sm:w-12 sm:h-12 hover:cursor-pointer transition flex items-center justify-center group active:scale-95`,
91
+ children: /* @__PURE__ */ t(
92
+ X,
93
+ {
94
+ className: "h-5 w-5 sm:h-6 sm:w-6 transition-transform duration-300 group-hover:rotate-180"
95
+ }
96
+ )
97
+ }
98
+ )
99
+ ]
100
+ }
101
+ ),
90
102
  /* @__PURE__ */ t(
91
103
  "div",
92
104
  {
93
- className: l(
105
+ className: i(
94
106
  "flex-1 min-h-0 overflow-y-auto scrollbar-thin scrollbar-thumb-slate-200 px-4 py-4 sm:p-6",
95
- v
107
+ y
96
108
  ),
97
109
  children: p
98
110
  }
99
111
  ),
100
- m && /* @__PURE__ */ t("div", { className: "shrink-0 flex items-center justify-end border-t border-slate-200 px-4 py-4 sm:p-6 gap-3 [&>*]:w-fit [&>*]:shrink-0 [&>*]:whitespace-nowrap", children: m })
112
+ m && /* @__PURE__ */ t(
113
+ "div",
114
+ {
115
+ className: `shrink-0 flex items-center justify-end border-t ${r ? "border-neutral-200" : "border-slate-200"} px-4 py-4 sm:p-6 gap-3 [&>*]:w-fit [&>*]:shrink-0 [&>*]:whitespace-nowrap`,
116
+ children: m
117
+ }
118
+ )
101
119
  ]
102
120
  }
103
121
  )
104
122
  ] });
105
123
  }
106
124
  export {
107
- A as default
125
+ D as default
108
126
  };