@mci-ui/mci-ui 0.0.88 → 0.0.89

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