@mci-ui/mci-ui 0.0.88 → 0.0.90
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.
- package/dist/index.css +1 -1
- package/dist/index.js +30 -28
- package/dist/shared/ui/MciModal/MciModal.js +30 -28
- package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +45 -25
- package/dist/shared/ui/mciButton/MciButton.js +39 -31
- package/dist/shared/ui/mciCheck/MciCheck.js +86 -76
- package/dist/shared/ui/mciDrawer/MciDrawer.js +78 -59
- package/dist/shared/ui/mciInput/MciInput.js +39 -40
- package/dist/shared/ui/mciLoader/MciLoader.js +14 -14
- package/dist/shared/ui/mciPagination/MciPagination.js +28 -18
- package/dist/shared/ui/mciPicker/MciPicker.js +54 -54
- package/dist/shared/ui/mciSelect/MciSelect.js +42 -41
- package/dist/shared/ui/mciStepper/MciStepper.js +136 -0
- package/dist/shared/ui/mciTable/MciTable.js +97 -90
- package/dist/shared/ui/mciTable/MciTableClamp2.js +4 -3
- package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +100 -79
- package/dist/shared/ui/mciTabs/FilledTabs.js +161 -0
- package/dist/shared/ui/mciTabs/MciTabs.js +5 -147
- package/dist/shared/ui/mciTabs/OutlinedTabs.js +86 -0
- package/dist/shared/ui/mciToggle/MciToggle.js +51 -43
- package/dist/shared/ui/mciUpload/MciUpload.js +129 -107
- package/dist/types/index.d.ts +1 -0
- package/dist/types/shared/types/mci-table.types.d.ts +2 -0
- package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -1
- package/dist/types/shared/types/ui/button.types.d.ts +1 -1
- package/dist/types/shared/types/ui/check.types.d.ts +1 -1
- package/dist/types/shared/types/ui/drawer.types.d.ts +1 -0
- package/dist/types/shared/types/ui/loader.types.d.ts +1 -1
- package/dist/types/shared/types/ui/pagination.types.d.ts +1 -1
- package/dist/types/shared/types/ui/stepper.types.d.ts +13 -0
- package/dist/types/shared/types/ui/tabs.types.d.ts +8 -2
- package/dist/types/shared/types/ui/toggle.types.d.ts +1 -1
- package/dist/types/shared/types/ui/upload.types.d.ts +1 -1
- package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
- package/dist/types/shared/ui/mciStepper/MciStepper.d.ts +3 -0
- package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +3 -2
- package/dist/types/shared/ui/mciTabs/FilledTabs.d.ts +2 -0
- package/dist/types/shared/ui/mciTabs/MciTabs.d.ts +3 -2
- package/dist/types/shared/ui/mciTabs/OutlinedTabs.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
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:
|
|
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-
|
|
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:
|
|
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:
|
|
32
|
-
tertiary: "bg-slate-100 text-black hover:bg-slate-200 active:bg-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:
|
|
48
|
+
children: n,
|
|
39
49
|
text: c,
|
|
40
50
|
icon: r,
|
|
41
|
-
iconPosition:
|
|
42
|
-
size:
|
|
51
|
+
iconPosition: a = "left",
|
|
52
|
+
size: i = "base",
|
|
43
53
|
variant: e = "primary",
|
|
44
|
-
color:
|
|
45
|
-
darkMode:
|
|
46
|
-
loading:
|
|
47
|
-
disabled:
|
|
48
|
-
className:
|
|
49
|
-
type:
|
|
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
|
|
53
|
-
return /* @__PURE__ */
|
|
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:
|
|
58
|
-
disabled:
|
|
59
|
-
className:
|
|
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[
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
y,
|
|
65
|
-
f
|
|
71
|
+
m[i],
|
|
72
|
+
x,
|
|
73
|
+
d
|
|
66
74
|
),
|
|
67
75
|
children: [
|
|
68
|
-
r &&
|
|
69
|
-
|
|
70
|
-
r &&
|
|
71
|
-
|
|
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
|
|
2
|
-
import { memo as
|
|
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
|
|
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 =
|
|
27
|
-
type:
|
|
36
|
+
}, A = j(function({
|
|
37
|
+
type: x = "checkbox",
|
|
28
38
|
label: c,
|
|
29
39
|
supportText: i,
|
|
30
|
-
checked:
|
|
31
|
-
onChange:
|
|
32
|
-
error:
|
|
40
|
+
checked: b,
|
|
41
|
+
onChange: m,
|
|
42
|
+
error: s,
|
|
33
43
|
disabled: n = !1,
|
|
34
|
-
required:
|
|
44
|
+
required: h = !1,
|
|
35
45
|
className: w,
|
|
36
|
-
variant: p = "
|
|
46
|
+
variant: p = "orange",
|
|
37
47
|
darkMode: e = !1,
|
|
38
|
-
name:
|
|
48
|
+
name: f,
|
|
39
49
|
value: N,
|
|
40
|
-
...
|
|
50
|
+
...k
|
|
41
51
|
}) {
|
|
42
|
-
const [y,
|
|
43
|
-
() =>
|
|
44
|
-
[
|
|
45
|
-
), C =
|
|
46
|
-
(
|
|
47
|
-
n || (
|
|
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
|
-
[
|
|
50
|
-
),
|
|
59
|
+
[b, m, n]
|
|
60
|
+
), v = d(() => {
|
|
51
61
|
if (n) {
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
container:
|
|
55
|
-
dot:
|
|
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:
|
|
68
|
+
container: u,
|
|
59
69
|
dot: "",
|
|
60
|
-
check:
|
|
70
|
+
check: t ? e ? "text-neutral-100/50" : "text-slate-400" : "text-transparent"
|
|
61
71
|
};
|
|
62
72
|
}
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
73
|
+
const r = $[p];
|
|
74
|
+
if (l) {
|
|
75
|
+
const u = o(
|
|
66
76
|
"border transition-all duration-200",
|
|
67
|
-
|
|
68
|
-
!
|
|
69
|
-
e ?
|
|
70
|
-
|
|
71
|
-
),
|
|
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
|
-
|
|
83
|
+
t ? e ? "bg-white" : r.bg : "bg-transparent"
|
|
74
84
|
);
|
|
75
85
|
return {
|
|
76
|
-
container:
|
|
77
|
-
dot:
|
|
86
|
+
container: u,
|
|
87
|
+
dot: _,
|
|
78
88
|
check: ""
|
|
79
89
|
};
|
|
80
90
|
}
|
|
81
91
|
return {
|
|
82
|
-
container:
|
|
92
|
+
container: o(
|
|
83
93
|
"border transition-all duration-200",
|
|
84
|
-
|
|
85
|
-
!
|
|
86
|
-
|
|
87
|
-
e ?
|
|
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:
|
|
100
|
+
check: t ? "text-white" : "text-transparent"
|
|
91
101
|
};
|
|
92
|
-
}, [
|
|
93
|
-
c && /* @__PURE__ */
|
|
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:
|
|
106
|
+
className: o(
|
|
97
107
|
"text-base font-medium",
|
|
98
|
-
|
|
99
|
-
!
|
|
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
|
-
|
|
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:
|
|
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,
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
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:
|
|
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
|
-
...
|
|
133
|
-
type:
|
|
134
|
-
checked:
|
|
142
|
+
...k,
|
|
143
|
+
type: x,
|
|
144
|
+
checked: t,
|
|
135
145
|
onChange: C,
|
|
136
146
|
disabled: n,
|
|
137
|
-
required:
|
|
147
|
+
required: h,
|
|
138
148
|
className: "peer sr-only",
|
|
139
|
-
"aria-invalid": !!
|
|
140
|
-
"aria-describedby":
|
|
141
|
-
name:
|
|
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:
|
|
158
|
+
className: o(
|
|
149
159
|
"relative flex items-center justify-center",
|
|
150
|
-
|
|
151
|
-
|
|
160
|
+
l ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
|
|
161
|
+
v.container
|
|
152
162
|
),
|
|
153
|
-
children:
|
|
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:
|
|
166
|
+
className: o(
|
|
157
167
|
"w-3 h-3 rounded-full transition-all duration-200",
|
|
158
|
-
|
|
159
|
-
|
|
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:
|
|
175
|
+
className: o(
|
|
166
176
|
"w-4 h-4 stroke-[2.5px] transition-opacity duration-200",
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
188
|
+
s && /* @__PURE__ */ a(
|
|
179
189
|
"p",
|
|
180
190
|
{
|
|
181
|
-
id: `${
|
|
182
|
-
className:
|
|
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:
|
|
196
|
+
children: s
|
|
187
197
|
}
|
|
188
198
|
)
|
|
189
199
|
] });
|
|
@@ -1,96 +1,115 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import
|
|
5
|
-
|
|
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:
|
|
9
|
-
children:
|
|
10
|
-
footer:
|
|
11
|
-
title:
|
|
12
|
-
description:
|
|
13
|
-
showCloseButton:
|
|
14
|
-
drawerClassName:
|
|
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:
|
|
17
|
-
closeOnOverlayClick:
|
|
18
|
-
closeOnEscape:
|
|
19
|
-
width:
|
|
20
|
-
darkMode:
|
|
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
|
|
23
|
-
|
|
24
|
-
e ? (
|
|
25
|
-
}, [e]),
|
|
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
|
|
43
|
+
const C = S(
|
|
29
44
|
() => ({
|
|
30
|
-
"--drawer-w": typeof
|
|
31
|
-
transform: e ? "translateX(0)" :
|
|
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,
|
|
34
|
-
),
|
|
35
|
-
return /* @__PURE__ */ n(
|
|
36
|
-
/* @__PURE__ */
|
|
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:
|
|
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:
|
|
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:
|
|
65
|
+
ref: m,
|
|
51
66
|
tabIndex: -1,
|
|
52
|
-
style:
|
|
53
|
-
className:
|
|
54
|
-
`fixed z-50 flex flex-col ${
|
|
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
|
-
|
|
75
|
+
R,
|
|
61
76
|
"sm:h-auto sm:rounded-2xl sm:pb-0",
|
|
62
77
|
"sm:w-[var(--drawer-w)]",
|
|
63
|
-
|
|
78
|
+
p
|
|
64
79
|
),
|
|
65
80
|
role: "dialog",
|
|
66
81
|
"aria-modal": "true",
|
|
67
82
|
"aria-hidden": !e,
|
|
68
|
-
"aria-labelledby":
|
|
83
|
+
"aria-labelledby": o ? "drawer-title" : void 0,
|
|
69
84
|
children: [
|
|
70
|
-
|
|
85
|
+
j && /* @__PURE__ */ n(
|
|
71
86
|
"div",
|
|
72
87
|
{
|
|
73
|
-
className: `flex items-start justify-between border-b ${
|
|
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
|
-
(
|
|
76
|
-
|
|
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 ${
|
|
81
|
-
children:
|
|
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
|
-
|
|
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
|
-
|
|
101
|
+
u && /* @__PURE__ */ r(
|
|
87
102
|
"button",
|
|
88
103
|
{
|
|
89
104
|
type: "button",
|
|
90
|
-
onClick:
|
|
91
|
-
className:
|
|
92
|
-
|
|
93
|
-
|
|
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__ */
|
|
122
|
+
/* @__PURE__ */ r(
|
|
104
123
|
"div",
|
|
105
124
|
{
|
|
106
|
-
className:
|
|
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:
|
|
129
|
+
children: x
|
|
111
130
|
}
|
|
112
131
|
),
|
|
113
|
-
|
|
132
|
+
b && /* @__PURE__ */ r(
|
|
114
133
|
"div",
|
|
115
134
|
{
|
|
116
|
-
className:
|
|
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
|
-
|
|
119
|
-
|
|
137
|
+
t ? "border-neutral-200" : "border-slate-200",
|
|
138
|
+
w
|
|
120
139
|
),
|
|
121
|
-
children:
|
|
140
|
+
children: b
|
|
122
141
|
}
|
|
123
142
|
)
|
|
124
143
|
]
|
|
@@ -127,5 +146,5 @@ function F({
|
|
|
127
146
|
] });
|
|
128
147
|
}
|
|
129
148
|
export {
|
|
130
|
-
|
|
149
|
+
T as default
|
|
131
150
|
};
|