@mci-ui/mci-ui 0.0.86 → 0.0.88

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 (67) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared/ui/MciModal/MciModal.js +107 -59
  3. package/dist/shared/ui/mciAccordion/MciAccordion.js +97 -64
  4. package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +23 -21
  5. package/dist/shared/ui/mciButton/MciButton.js +47 -32
  6. package/dist/shared/ui/mciCheck/MciCheck.js +116 -92
  7. package/dist/shared/ui/mciCollapse/MciCollapse.js +86 -54
  8. package/dist/shared/ui/mciDrawer/MciDrawer.js +82 -59
  9. package/dist/shared/ui/mciInput/MciInput.js +143 -130
  10. package/dist/shared/ui/mciInput/mci-input.utils.js +10 -10
  11. package/dist/shared/ui/mciPagination/MciPagination.js +85 -63
  12. package/dist/shared/ui/mciPhone/MciPhone.js +59 -54
  13. package/dist/shared/ui/mciPhone/mci-phone.utils.js +10 -10
  14. package/dist/shared/ui/mciPicker/MciPicker.js +349 -181
  15. package/dist/shared/ui/mciSelect/MciSelect.js +150 -131
  16. package/dist/shared/ui/mciSelect/mci-select.utils.js +12 -12
  17. package/dist/shared/ui/mciSkeleton/MciSkeleton.js +16 -14
  18. package/dist/shared/ui/mciTable/MciTable.js +165 -126
  19. package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +113 -106
  20. package/dist/shared/ui/mciTabs/MciTabs.js +73 -55
  21. package/dist/shared/ui/mciTag/MciTag.js +27 -18
  22. package/dist/shared/ui/mciTextarea/MciTextarea.js +47 -35
  23. package/dist/shared/ui/mciToast/MciToast.js +118 -72
  24. package/dist/shared/ui/mciToast/mci-toast.utils.js +40 -12
  25. package/dist/shared/ui/mciToggle/MciToggle.js +58 -36
  26. package/dist/shared/ui/mciTooltip/MciTooltip.js +2 -2
  27. package/dist/shared/ui/mciUpload/MciUpload.js +172 -149
  28. package/dist/types/shared/types/mci-table.types.d.ts +1 -0
  29. package/dist/types/shared/types/ui/accordion.types.d.ts +1 -0
  30. package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -0
  31. package/dist/types/shared/types/ui/button.types.d.ts +3 -7
  32. package/dist/types/shared/types/ui/check.types.d.ts +4 -9
  33. package/dist/types/shared/types/ui/collapse.types.d.ts +1 -0
  34. package/dist/types/shared/types/ui/drawer.types.d.ts +2 -0
  35. package/dist/types/shared/types/ui/input.types.d.ts +4 -15
  36. package/dist/types/shared/types/ui/modal.types.d.ts +1 -0
  37. package/dist/types/shared/types/ui/pagination.types.d.ts +1 -0
  38. package/dist/types/shared/types/ui/phone.types.d.ts +1 -0
  39. package/dist/types/shared/types/ui/picker.types.d.ts +1 -0
  40. package/dist/types/shared/types/ui/select.types.d.ts +1 -0
  41. package/dist/types/shared/types/ui/skeleton.types.d.ts +1 -0
  42. package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
  43. package/dist/types/shared/types/ui/tag.types.d.ts +1 -0
  44. package/dist/types/shared/types/ui/textarea.types.d.ts +3 -7
  45. package/dist/types/shared/types/ui/toast.types.d.ts +1 -0
  46. package/dist/types/shared/types/ui/toggle.types.d.ts +3 -2
  47. package/dist/types/shared/types/ui/upload.types.d.ts +1 -0
  48. package/dist/types/shared/ui/MciModal/MciModal.d.ts +1 -1
  49. package/dist/types/shared/ui/mciAccordion/MciAccordion.d.ts +5 -3
  50. package/dist/types/shared/ui/mciBreadcrumb/MciBreadcrumb.d.ts +1 -1
  51. package/dist/types/shared/ui/mciButton/MciButton.d.ts +1 -1
  52. package/dist/types/shared/ui/mciCollapse/MciCollapse.d.ts +1 -1
  53. package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
  54. package/dist/types/shared/ui/mciInput/MciInput.d.ts +13 -2
  55. package/dist/types/shared/ui/mciInput/mci-input.utils.d.ts +2 -2
  56. package/dist/types/shared/ui/mciPagination/MciPagination.d.ts +1 -1
  57. package/dist/types/shared/ui/mciPhone/mci-phone.utils.d.ts +2 -2
  58. package/dist/types/shared/ui/mciSelect/mci-select.utils.d.ts +2 -2
  59. package/dist/types/shared/ui/mciSkeleton/MciSkeleton.d.ts +1 -1
  60. package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
  61. package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +2 -1
  62. package/dist/types/shared/ui/mciTabs/MciTabs.d.ts +1 -1
  63. package/dist/types/shared/ui/mciTag/MciTag.d.ts +1 -1
  64. package/dist/types/shared/ui/mciTextarea/MciTextarea.d.ts +7 -2
  65. package/dist/types/shared/ui/mciToast/mci-toast.utils.d.ts +32 -4
  66. package/dist/types/shared/ui/mciToggle/MciToggle.d.ts +1 -1
  67. package/package.json +1 -1
@@ -1,28 +1,30 @@
1
- import { jsx as l, jsxs as t } from "react/jsx-runtime";
2
- import { AltArrowRight as h } from "@solar-icons/react";
3
- import { cn as r } from "../../lib/utils.js";
4
- function b({
5
- items: a,
6
- variant: o = "blue",
7
- className: i
1
+ import { jsx as l, jsxs as n } from "react/jsx-runtime";
2
+ import { AltArrowRight as p } from "@solar-icons/react";
3
+ import { cn as a } from "../../lib/utils.js";
4
+ function w({
5
+ items: s,
6
+ variant: x = "blue",
7
+ darkMode: r = !1,
8
+ className: m
8
9
  }) {
9
- const n = o === "blue", m = n ? "hover:text-blue-600" : "hover:text-yellow-500", x = n ? "text-blue-600" : "text-yellow-500";
10
- return /* @__PURE__ */ l("nav", { className: r("flex items-center", i), "aria-label": "Breadcrumb", children: a.map((e, s) => {
11
- const c = s === a.length - 1;
12
- return /* @__PURE__ */ t("div", { className: "flex items-center", children: [
13
- c ? /* @__PURE__ */ t("span", { className: r("flex items-center gap-x-2 font-medium", x), children: [
10
+ const t = x === "blue", f = r ? t ? "hover:text-blue-400" : "hover:text-yellow-400" : t ? "hover:text-blue-600" : "hover:text-yellow-500", h = r ? t ? "text-blue-400" : "text-yellow-400" : t ? "text-blue-600" : "text-yellow-500", o = r ? "text-neutral-50" : "text-slate-500";
11
+ return /* @__PURE__ */ l("nav", { className: a("flex items-center", m), "aria-label": "Breadcrumb", children: s.map((e, c) => {
12
+ const i = c === s.length - 1;
13
+ return /* @__PURE__ */ n("div", { className: "flex items-center", children: [
14
+ i ? /* @__PURE__ */ n("span", { className: a("flex items-center gap-x-2 font-medium", h), children: [
14
15
  e.icon,
15
16
  /* @__PURE__ */ l("span", { children: e.label })
16
- ] }) : /* @__PURE__ */ t(
17
+ ] }) : /* @__PURE__ */ n(
17
18
  "a",
18
19
  {
19
20
  href: e.href ?? "#",
20
- onClick: (f) => {
21
- e.onClick && (f.preventDefault(), e.onClick());
21
+ onClick: (u) => {
22
+ e.onClick && (u.preventDefault(), e.onClick());
22
23
  },
23
- className: r(
24
- "flex items-center gap-x-2 transition-all text-sm font-normal text-slate-500",
25
- m
24
+ className: a(
25
+ "flex items-center gap-x-2 transition-all text-sm font-normal",
26
+ o,
27
+ f
26
28
  ),
27
29
  children: [
28
30
  e.icon,
@@ -30,10 +32,10 @@ function b({
30
32
  ]
31
33
  }
32
34
  ),
33
- !c && /* @__PURE__ */ l("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ l(h, { weight: "Linear", size: 20, className: "text-slate-500" }) })
34
- ] }, s);
35
+ !i && /* @__PURE__ */ l("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ l(p, { weight: "Linear", size: 20, className: o }) })
36
+ ] }, c);
35
37
  }) });
36
38
  }
37
39
  export {
38
- b as default
40
+ w as default
39
41
  };
@@ -1,11 +1,11 @@
1
- import { jsxs as x, jsx as l } from "react/jsx-runtime";
2
- import { cn as y } from "../../lib/utils.js";
3
- import { Star2 as m } from "@solar-icons/react";
4
- const v = {
1
+ import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
+ import { cn as x } from "../../lib/utils.js";
3
+ import { Star2 as p } from "@solar-icons/react";
4
+ const m = {
5
5
  sm: "h-9 px-2 text-sm gap-1.5 rounded-lg leading-9 min-w-9",
6
6
  md: "h-10 px-2 text-base gap-2 rounded-lg leading-10 min-w-10",
7
7
  base: "h-12 px-4 text-base gap-2 rounded-xl leading-12 min-w-12"
8
- }, p = {
8
+ }, N = {
9
9
  blue: {
10
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
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)]",
@@ -16,48 +16,63 @@ const v = {
16
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",
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
18
  }
19
- }, N = {
19
+ }, T = {
20
+ blue: {
21
+ primary: "bg-blue-500 text-black hover:bg-blue-400 active:bg-blue-300 focus:ring-2 focus:ring-blue-500",
22
+ secondary: "border border-blue-900 bg-blue-900 text-blue-500 hover:bg-blue-700 active:bg-blue-700 active:border-blue-700 focus:ring-2 focus:ring-blue-900",
23
+ outline: "border border-blue-500 text-blue-500 hover:border-blue-400 hover:text-blue-400 active:text-blue-300 active:border-blue-300 focus:ring-2 focus:ring-blue-500"
24
+ },
25
+ yellow: {
26
+ primary: "bg-yellow-400 text-slate-950 hover:bg-yellow-300 active:bg-yellow-200 focus:ring-2 focus:ring-yellow-300/40",
27
+ 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
+ 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"
29
+ }
30
+ }, _ = {
20
31
  danger: "bg-red-600 text-white hover:bg-red-700 active:bg-red-800 focus:ring-2 focus:shadow-red",
21
32
  tertiary: "bg-slate-100 text-black hover:bg-slate-200 active:bg-slate-300 focus:ring-2 focus:shadow-slate"
33
+ }, A = {
34
+ danger: "bg-red-500 text-black hover:bg-red-300 active:bg-red-200 focus:ring-2 focus:ring-red-500/35",
35
+ tertiary: "bg-neutral-300 text-white hover:bg-neutral-200 focus:ring-2 focus:ring-slate-200/80"
22
36
  };
23
- function _({
24
- children: n,
25
- text: b,
26
- icon: t,
37
+ function S({
38
+ children: u,
39
+ text: c,
40
+ icon: r,
27
41
  iconPosition: s = "left",
28
- size: c = "base",
42
+ size: g = "base",
29
43
  variant: e = "primary",
30
- color: u = "yellow",
31
- loading: r = !1,
32
- disabled: g = !1,
33
- onClick: d,
34
- className: w,
35
- type: f = "button"
44
+ color: a = "yellow",
45
+ darkMode: t = !1,
46
+ loading: l = !1,
47
+ disabled: d = !1,
48
+ className: f,
49
+ type: w = "button",
50
+ ...v
36
51
  }) {
37
- const a = n ?? b, i = e === "primary" || e === "secondary" || e === "outline" ? p[u][e] : N[e], o = g || r, h = o ? e === "outline" ? "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" : "bg-slate-200 text-slate-400 cursor-not-allowed hover:bg-slate-200 active:bg-slate-200 focus:ring-0" : "";
38
- return /* @__PURE__ */ x(
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(
39
54
  "button",
40
55
  {
41
- type: f,
42
- onClick: d,
43
- disabled: o,
44
- className: y(
56
+ ...v,
57
+ type: w,
58
+ disabled: b,
59
+ className: x(
45
60
  "inline-flex w-fit shrink-0 items-center justify-center whitespace-nowrap text-center font-medium transition-all duration-200 cursor-pointer",
46
- v[c],
61
+ m[g],
47
62
  i,
48
- !o && i,
49
- h,
50
- w
63
+ !b && i,
64
+ y,
65
+ f
51
66
  ),
52
67
  children: [
53
- t && s === "left" && !r && /* @__PURE__ */ l("span", { className: "flex items-center", children: t }),
54
- a && /* @__PURE__ */ l("span", { className: "whitespace-nowrap", children: a }),
55
- t && s === "right" && !r && /* @__PURE__ */ l("span", { className: "flex items-center", children: t }),
56
- r && /* @__PURE__ */ l(m, { weight: "Linear", size: 20, className: "animate-spin" })
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" })
57
72
  ]
58
73
  }
59
74
  );
60
75
  }
61
76
  export {
62
- _ as default
77
+ S as default
63
78
  };
@@ -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
  };