@definable/ui 0.1.31 → 0.1.35
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/components/alert-dialog.js +15 -15
- package/dist/components/alert.js +21 -21
- package/dist/components/avatar.js +7 -7
- package/dist/components/badge.js +10 -10
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +20 -18
- package/dist/components/calendar.js +26 -26
- package/dist/components/card.js +27 -27
- package/dist/components/carousel.js +39 -39
- package/dist/components/checkbox.js +7 -7
- package/dist/components/collapse.js +17 -17
- package/dist/components/command-menu.js +30 -30
- package/dist/components/command.js +55 -55
- package/dist/components/confirmation-modal.js +23 -23
- package/dist/components/context-menu.js +30 -30
- package/dist/components/dialog.js +33 -33
- package/dist/components/drawer.js +7 -7
- package/dist/components/dropdown-menu.js +16 -16
- package/dist/components/dropzone.js +3 -3
- package/dist/components/image-cropper-modal.js +57 -57
- package/dist/components/image-cropper.js +45 -45
- package/dist/components/input.js +9 -9
- package/dist/components/loader.js +4 -4
- package/dist/components/loading-placeholder.js +4 -4
- package/dist/components/mention.js +18 -18
- package/dist/components/modal.js +39 -39
- package/dist/components/picker.js +30 -30
- package/dist/components/popover.js +7 -7
- package/dist/components/progress.js +13 -13
- package/dist/components/radio-group.js +19 -19
- package/dist/components/scroll-area.js +20 -20
- package/dist/components/select.js +28 -28
- package/dist/components/selection-bar.js +18 -18
- package/dist/components/separator.js +8 -8
- package/dist/components/sheet.js +28 -28
- package/dist/components/skeleton.js +8 -8
- package/dist/components/slider.js +13 -13
- package/dist/components/stepper.js +1 -1
- package/dist/components/switch.js +8 -8
- package/dist/components/table-empty.js +6 -6
- package/dist/components/table-mobile.js +36 -36
- package/dist/components/table.js +80 -80
- package/dist/components/tabs.js +16 -16
- package/dist/components/textarea.js +9 -9
- package/dist/components/tooltip.js +5 -5
- package/dist/components/use-toast.js +9 -9
- package/dist/index.js +1 -1
- package/dist/{stepper-modal-JXpOXOV2.js → stepper-modal-Bh6gsg8o.js} +79 -79
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Button as
|
|
1
|
+
import { jsxs as l, Fragment as j, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useRef as S, useCallback as s } from "react";
|
|
3
|
+
import { Button as f } from "./button.js";
|
|
4
4
|
import { RotateCw as F, X as O, Upload as U } from "lucide-react";
|
|
5
5
|
import { ImageCropperModal as A } from "./image-cropper-modal.js";
|
|
6
6
|
import { cn as E } from "../lib/utils.js";
|
|
7
7
|
function Y({
|
|
8
8
|
value: c,
|
|
9
|
-
onChange:
|
|
10
|
-
size:
|
|
9
|
+
onChange: o,
|
|
10
|
+
size: i = 120,
|
|
11
11
|
className: g,
|
|
12
12
|
placeholder: b = "Upload Image",
|
|
13
13
|
title: v = "Crop Your Image",
|
|
14
14
|
outputSize: x = 200
|
|
15
15
|
}) {
|
|
16
|
-
const [C,
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
16
|
+
const [C, m] = h(!1), [y, n] = h(null), a = S(null), N = s((r) => {
|
|
17
|
+
var d;
|
|
18
|
+
const t = (d = r.target.files) == null ? void 0 : d[0];
|
|
19
|
+
if (t) {
|
|
20
20
|
const p = new FileReader();
|
|
21
|
-
p.onload = (
|
|
21
|
+
p.onload = (k) => {
|
|
22
22
|
var u;
|
|
23
|
-
const M = (u =
|
|
24
|
-
|
|
25
|
-
}, p.readAsDataURL(
|
|
23
|
+
const M = (u = k.target) == null ? void 0 : u.result;
|
|
24
|
+
n(M), m(!0);
|
|
25
|
+
}, p.readAsDataURL(t);
|
|
26
26
|
}
|
|
27
27
|
r.target.value = "";
|
|
28
|
-
}, []),
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
-
}, []),
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
c ? /* @__PURE__ */
|
|
28
|
+
}, []), w = s((r) => {
|
|
29
|
+
o(r), n(null);
|
|
30
|
+
}, [o]), I = s(() => {
|
|
31
|
+
m(!1), n(null), a.current && (a.current.value = "");
|
|
32
|
+
}, []), R = s(() => {
|
|
33
|
+
o(null);
|
|
34
|
+
}, [o]);
|
|
35
|
+
return /* @__PURE__ */ l(j, { children: [
|
|
36
|
+
/* @__PURE__ */ l("div", { className: E("space-y-3", g), children: [
|
|
37
|
+
c ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-3", children: [
|
|
38
38
|
/* @__PURE__ */ e(
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
|
-
className: "rounded-full border-2 border-
|
|
42
|
-
style: { width:
|
|
41
|
+
className: "rounded-full border-2 border-light overflow-hidden bg-secondary",
|
|
42
|
+
style: { width: i, height: i },
|
|
43
43
|
children: /* @__PURE__ */ e(
|
|
44
44
|
"img",
|
|
45
45
|
{
|
|
@@ -50,15 +50,15 @@ function Y({
|
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
53
|
+
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
54
|
+
/* @__PURE__ */ l(
|
|
55
|
+
f,
|
|
56
56
|
{
|
|
57
57
|
variant: "outline",
|
|
58
58
|
size: "sm",
|
|
59
59
|
onClick: (r) => {
|
|
60
|
-
var
|
|
61
|
-
r.stopPropagation(), (
|
|
60
|
+
var t;
|
|
61
|
+
r.stopPropagation(), (t = a.current) == null || t.click();
|
|
62
62
|
},
|
|
63
63
|
children: [
|
|
64
64
|
/* @__PURE__ */ e(F, { className: "h-3 w-3 mr-1" }),
|
|
@@ -66,12 +66,12 @@ function Y({
|
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
69
|
+
/* @__PURE__ */ l(
|
|
70
|
+
f,
|
|
71
71
|
{
|
|
72
72
|
variant: "outline",
|
|
73
73
|
size: "sm",
|
|
74
|
-
onClick:
|
|
74
|
+
onClick: R,
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ e(O, { className: "h-3 w-3 mr-1" }),
|
|
77
77
|
"Remove"
|
|
@@ -79,35 +79,35 @@ function Y({
|
|
|
79
79
|
}
|
|
80
80
|
)
|
|
81
81
|
] })
|
|
82
|
-
] }) : /* @__PURE__ */
|
|
82
|
+
] }) : /* @__PURE__ */ l(
|
|
83
83
|
"button",
|
|
84
84
|
{
|
|
85
85
|
onClick: (r) => {
|
|
86
|
-
var
|
|
87
|
-
r.stopPropagation(), (
|
|
86
|
+
var t;
|
|
87
|
+
r.stopPropagation(), (t = a.current) == null || t.click();
|
|
88
88
|
},
|
|
89
|
-
className: "w-full border-2 border-dashed border-
|
|
89
|
+
className: "w-full border-2 border-dashed border-light rounded-lg p-6 hover:border-primary/50 hover:bg-primary/2 transition-colors group",
|
|
90
90
|
children: [
|
|
91
91
|
/* @__PURE__ */ e(
|
|
92
92
|
"div",
|
|
93
93
|
{
|
|
94
94
|
className: "mx-auto rounded-full bg-primary/10 flex items-center justify-center group-hover:bg-primary/15 transition-colors mb-3",
|
|
95
|
-
style: { width: Math.min(
|
|
95
|
+
style: { width: Math.min(i / 2, 60), height: Math.min(i / 2, 60) },
|
|
96
96
|
children: /* @__PURE__ */ e(U, { className: "h-6 w-6 text-primary" })
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-
|
|
100
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-
|
|
99
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-primary mb-1", children: b }),
|
|
100
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-tertiary", children: "Click to browse" })
|
|
101
101
|
]
|
|
102
102
|
}
|
|
103
103
|
),
|
|
104
104
|
/* @__PURE__ */ e(
|
|
105
105
|
"input",
|
|
106
106
|
{
|
|
107
|
-
ref:
|
|
107
|
+
ref: a,
|
|
108
108
|
type: "file",
|
|
109
109
|
accept: "image/*",
|
|
110
|
-
onChange:
|
|
110
|
+
onChange: N,
|
|
111
111
|
className: "hidden"
|
|
112
112
|
}
|
|
113
113
|
)
|
|
@@ -116,9 +116,9 @@ function Y({
|
|
|
116
116
|
A,
|
|
117
117
|
{
|
|
118
118
|
isOpen: C,
|
|
119
|
-
onClose:
|
|
120
|
-
imageSrc:
|
|
121
|
-
onCrop:
|
|
119
|
+
onClose: I,
|
|
120
|
+
imageSrc: y,
|
|
121
|
+
onCrop: w,
|
|
122
122
|
title: v,
|
|
123
123
|
outputSize: x
|
|
124
124
|
}
|
package/dist/components/input.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
const l =
|
|
5
|
-
({ className: r, type: o, ...
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { cn as d } from "../lib/utils.js";
|
|
4
|
+
const l = i.forwardRef(
|
|
5
|
+
({ className: r, type: o, ...t }, e) => /* @__PURE__ */ a(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
8
|
type: o,
|
|
9
|
-
className:
|
|
10
|
-
"h-10 w-full rounded-lg border-2 border-
|
|
9
|
+
className: d(
|
|
10
|
+
"h-10 w-full rounded-lg border-2 border-light bg-secondary px-4 py-2 text-sm text-primary outline-none transition-colors placeholder:text-tertiary focus:border-primary disabled:cursor-not-allowed disabled:opacity-50",
|
|
11
11
|
r
|
|
12
12
|
),
|
|
13
|
-
ref:
|
|
14
|
-
...
|
|
13
|
+
ref: e,
|
|
14
|
+
...t
|
|
15
15
|
}
|
|
16
16
|
)
|
|
17
17
|
);
|
|
@@ -16,7 +16,7 @@ function h({
|
|
|
16
16
|
sm: "gap-0.5",
|
|
17
17
|
md: "gap-1",
|
|
18
18
|
lg: "gap-1.5"
|
|
19
|
-
},
|
|
19
|
+
}, y = {
|
|
20
20
|
hidden: { opacity: 0, y: 20 },
|
|
21
21
|
visible: (i) => ({
|
|
22
22
|
opacity: 1,
|
|
@@ -32,14 +32,14 @@ function h({
|
|
|
32
32
|
a.div,
|
|
33
33
|
{
|
|
34
34
|
custom: i,
|
|
35
|
-
variants:
|
|
35
|
+
variants: y,
|
|
36
36
|
initial: "hidden",
|
|
37
37
|
animate: "visible",
|
|
38
38
|
className: `${o[n]} rounded-full ${m ? "bg-primary/80" : "bg-primary/60"}`
|
|
39
39
|
},
|
|
40
40
|
i
|
|
41
41
|
)) });
|
|
42
|
-
return s ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-
|
|
42
|
+
return s ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-secondary flex items-center justify-center z-[9999]", children: /* @__PURE__ */ r(
|
|
43
43
|
a.div,
|
|
44
44
|
{
|
|
45
45
|
className: "text-center",
|
|
@@ -56,7 +56,7 @@ function h({
|
|
|
56
56
|
transition: { delay: 0.3, duration: 0.3 },
|
|
57
57
|
children: [
|
|
58
58
|
/* @__PURE__ */ e("h2", { className: "text-lg font-medium mb-2", children: c }),
|
|
59
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-
|
|
59
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-tertiary", children: d })
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as o, Fragment as a } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
2
|
+
import { cn as f } from "../lib/utils.js";
|
|
3
3
|
function b({
|
|
4
4
|
className: t,
|
|
5
5
|
count: n = 1,
|
|
6
6
|
animate: e = !0,
|
|
7
7
|
variant: r = "shimmer"
|
|
8
8
|
}) {
|
|
9
|
-
return /* @__PURE__ */ o(a, { children: Array.from({ length: n }).map((
|
|
9
|
+
return /* @__PURE__ */ o(a, { children: Array.from({ length: n }).map((m, i) => /* @__PURE__ */ o(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
|
-
className:
|
|
13
|
-
"relative overflow-hidden bg-
|
|
12
|
+
className: f(
|
|
13
|
+
"relative overflow-hidden bg-hover/30 rounded",
|
|
14
14
|
e && r === "shimmer" && "before:absolute before:inset-0 before:-translate-x-full before:animate-[shimmer_2s_infinite] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent",
|
|
15
15
|
e && r === "pulse" && "animate-pulse",
|
|
16
16
|
t
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import x, { forwardRef as b } from "react";
|
|
3
|
-
import { MentionsInput as
|
|
3
|
+
import { MentionsInput as y, Mention as v } from "react-mentions";
|
|
4
4
|
import { cn as n } from "../lib/utils.js";
|
|
5
|
-
const w = (e, t, i, a, r) => /* @__PURE__ */
|
|
5
|
+
const w = (e, t, i, a, r) => /* @__PURE__ */ l(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
8
|
className: n(
|
|
@@ -18,9 +18,9 @@ const w = (e, t, i, a, r) => /* @__PURE__ */ d(
|
|
|
18
18
|
className: "h-full w-full object-cover"
|
|
19
19
|
}
|
|
20
20
|
) }),
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
22
22
|
/* @__PURE__ */ o("span", { className: "font-medium", children: e.display }),
|
|
23
|
-
e.subtitle && /* @__PURE__ */ o("span", { className: "text-xs text-
|
|
23
|
+
e.subtitle && /* @__PURE__ */ o("span", { className: "text-xs text-tertiary", children: e.subtitle })
|
|
24
24
|
] })
|
|
25
25
|
]
|
|
26
26
|
}
|
|
@@ -31,14 +31,14 @@ const w = (e, t, i, a, r) => /* @__PURE__ */ d(
|
|
|
31
31
|
placeholder: i = "Type @ to mention someone",
|
|
32
32
|
data: a,
|
|
33
33
|
disabled: r = !1,
|
|
34
|
-
className:
|
|
34
|
+
className: d,
|
|
35
35
|
inputClassName: s,
|
|
36
36
|
suggestionItemClassName: m,
|
|
37
37
|
trigger: p = "@",
|
|
38
|
-
displayTransform:
|
|
39
|
-
onKeyDown:
|
|
40
|
-
},
|
|
41
|
-
const
|
|
38
|
+
displayTransform: c = _,
|
|
39
|
+
onKeyDown: u
|
|
40
|
+
}, h) => {
|
|
41
|
+
const g = {
|
|
42
42
|
control: {
|
|
43
43
|
fontSize: 14,
|
|
44
44
|
fontWeight: "normal",
|
|
@@ -108,31 +108,31 @@ const w = (e, t, i, a, r) => /* @__PURE__ */ d(
|
|
|
108
108
|
}, []), /* @__PURE__ */ o(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
|
-
ref:
|
|
112
|
-
className: n("relative w-full",
|
|
111
|
+
ref: h,
|
|
112
|
+
className: n("relative w-full", d),
|
|
113
113
|
children: /* @__PURE__ */ o(
|
|
114
|
-
|
|
114
|
+
y,
|
|
115
115
|
{
|
|
116
116
|
value: e,
|
|
117
117
|
onChange: t,
|
|
118
|
-
style: { ...
|
|
118
|
+
style: { ...g, ...f },
|
|
119
119
|
placeholder: i,
|
|
120
120
|
disabled: r,
|
|
121
121
|
a11ySuggestionsListLabel: "Suggested mentions",
|
|
122
122
|
className: n(
|
|
123
|
-
"w-full rounded-md bg-transparent text-sm placeholder:text-
|
|
123
|
+
"w-full rounded-md bg-transparent text-sm placeholder:text-tertiary resize-none font-normal",
|
|
124
124
|
s
|
|
125
125
|
),
|
|
126
126
|
suggestionsPortalHost: typeof document < "u" ? document.body : void 0,
|
|
127
127
|
allowSuggestionsAboveCursor: !0,
|
|
128
|
-
onKeyDown:
|
|
128
|
+
onKeyDown: u,
|
|
129
129
|
children: /* @__PURE__ */ o(
|
|
130
|
-
|
|
130
|
+
v,
|
|
131
131
|
{
|
|
132
132
|
trigger: p,
|
|
133
133
|
data: a,
|
|
134
134
|
renderSuggestion: w,
|
|
135
|
-
displayTransform:
|
|
135
|
+
displayTransform: c,
|
|
136
136
|
appendSpaceOnAdd: !0,
|
|
137
137
|
className: n(
|
|
138
138
|
"text-primary font-medium",
|
package/dist/components/modal.js
CHANGED
|
@@ -27,20 +27,20 @@ const P = (r) => {
|
|
|
27
27
|
};
|
|
28
28
|
function I({
|
|
29
29
|
isOpen: r,
|
|
30
|
-
onClose:
|
|
31
|
-
title:
|
|
32
|
-
description:
|
|
33
|
-
icon:
|
|
34
|
-
children:
|
|
30
|
+
onClose: n,
|
|
31
|
+
title: a,
|
|
32
|
+
description: d,
|
|
33
|
+
icon: i,
|
|
34
|
+
children: u,
|
|
35
35
|
footer: s,
|
|
36
|
-
size:
|
|
37
|
-
showClose:
|
|
36
|
+
size: y = "md",
|
|
37
|
+
showClose: v = !0,
|
|
38
38
|
className: f,
|
|
39
|
-
isContentScrollable:
|
|
40
|
-
mainClassName:
|
|
41
|
-
contentClassName:
|
|
39
|
+
isContentScrollable: w = !0,
|
|
40
|
+
mainClassName: g,
|
|
41
|
+
contentClassName: N,
|
|
42
42
|
header: c,
|
|
43
|
-
headerClassName:
|
|
43
|
+
headerClassName: b,
|
|
44
44
|
zIndexClassName: k = "z-[50]",
|
|
45
45
|
mobileSheet: m
|
|
46
46
|
}) {
|
|
@@ -50,36 +50,36 @@ function I({
|
|
|
50
50
|
L,
|
|
51
51
|
{
|
|
52
52
|
isOpen: r,
|
|
53
|
-
onClose:
|
|
54
|
-
header: c || (
|
|
55
|
-
|
|
53
|
+
onClose: n,
|
|
54
|
+
header: c || (a || d || i ? /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
|
|
55
|
+
i && /* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-lg flex items-center justify-center", children: i }),
|
|
56
56
|
/* @__PURE__ */ t("div", { children: [
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
a && /* @__PURE__ */ e("h2", { className: "text-sm font-medium", children: a }),
|
|
58
|
+
d && /* @__PURE__ */ e("p", { className: "text-sm text-tertiary", children: d })
|
|
59
59
|
] })
|
|
60
60
|
] }) : void 0),
|
|
61
61
|
footer: /* @__PURE__ */ e("div", { className: "flex gap-2 justify-end", children: s }),
|
|
62
62
|
className: l(f, "w-full max-w-full"),
|
|
63
63
|
position: x || "bottom",
|
|
64
|
-
headerClassName: l(
|
|
64
|
+
headerClassName: l(b, "w-full max-w-full"),
|
|
65
65
|
enableFullscreen: !1,
|
|
66
|
-
children:
|
|
66
|
+
children: u
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
x.key === "Escape" && r &&
|
|
72
|
-
}, [r,
|
|
73
|
-
H(() => (document.addEventListener("keydown",
|
|
74
|
-
const o =
|
|
70
|
+
const h = F((x) => {
|
|
71
|
+
x.key === "Escape" && r && n();
|
|
72
|
+
}, [r, n]);
|
|
73
|
+
H(() => (document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h)), [h]);
|
|
74
|
+
const o = a || d || i || c, j = /* @__PURE__ */ e(E, { children: r && /* @__PURE__ */ e("div", { className: l("fixed inset-0 z-50 overflow-hidden", k), children: /* @__PURE__ */ t("div", { className: l("min-h-full flex items-center justify-center p-4", g), children: [
|
|
75
75
|
/* @__PURE__ */ e(
|
|
76
76
|
p.div,
|
|
77
77
|
{
|
|
78
78
|
initial: { opacity: 0 },
|
|
79
79
|
animate: { opacity: 1 },
|
|
80
80
|
exit: { opacity: 0 },
|
|
81
|
-
className: "fixed inset-0 bg-
|
|
82
|
-
onClick:
|
|
81
|
+
className: "fixed inset-0 bg-secondary/80 backdrop-blur-sm",
|
|
82
|
+
onClick: n
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
85
|
/* @__PURE__ */ t(
|
|
@@ -90,40 +90,40 @@ function I({
|
|
|
90
90
|
exit: { opacity: 0, scale: 0.95 },
|
|
91
91
|
transition: { duration: 0.1, ease: "easeOut" },
|
|
92
92
|
className: l(
|
|
93
|
-
"relative transform rounded-lg bg-
|
|
93
|
+
"relative transform rounded-lg bg-secondary shadow-xl border border-light flex flex-col max-h-[85vh] overflow-hidden",
|
|
94
94
|
f
|
|
95
95
|
),
|
|
96
|
-
style: P(
|
|
96
|
+
style: P(y),
|
|
97
97
|
children: [
|
|
98
|
-
o && /* @__PURE__ */ t("div", { className: "flex-shrink-0 rounded-t-lg bg-card flex items-center justify-between p-2 border-b border-
|
|
98
|
+
o && /* @__PURE__ */ t("div", { className: "flex-shrink-0 rounded-t-lg bg-card flex items-center justify-between p-2 border-b border-light", children: [
|
|
99
99
|
c || /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
|
|
100
|
-
|
|
100
|
+
i && /* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-lg flex items-center justify-center", children: i }),
|
|
101
101
|
/* @__PURE__ */ t("div", { children: [
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
a && /* @__PURE__ */ e("h2", { className: "text-sm font-small", children: a }),
|
|
103
|
+
d && /* @__PURE__ */ e("p", { className: "text-sm text-tertiary", children: d })
|
|
104
104
|
] })
|
|
105
105
|
] }),
|
|
106
|
-
|
|
106
|
+
v && /* @__PURE__ */ e(
|
|
107
107
|
"button",
|
|
108
108
|
{
|
|
109
|
-
onClick:
|
|
110
|
-
className: "p-1.5 rounded-md hover:bg-
|
|
109
|
+
onClick: n,
|
|
110
|
+
className: "p-1.5 rounded-md hover:bg-hover text-tertiary",
|
|
111
111
|
children: /* @__PURE__ */ t("div", { className: "flex justify-center items-center", children: [
|
|
112
112
|
/* @__PURE__ */ e(z, { className: "h-4 w-4" }),
|
|
113
|
-
/* @__PURE__ */ e("kbd", { className: "ml-2 text-[10px] text-
|
|
113
|
+
/* @__PURE__ */ e("kbd", { className: "ml-2 text-[10px] text-tertiary bg-hover px-1.5 py-0.5 rounded", children: "ESC" })
|
|
114
114
|
] })
|
|
115
115
|
}
|
|
116
116
|
)
|
|
117
117
|
] }),
|
|
118
118
|
/* @__PURE__ */ e("div", { className: l(
|
|
119
119
|
"flex-1 min-h-0",
|
|
120
|
-
|
|
120
|
+
w ? "overflow-y-auto" : "",
|
|
121
121
|
!s && !o ? "rounded-lg" : "",
|
|
122
122
|
!s && o ? "rounded-b-lg" : "",
|
|
123
123
|
s && !o ? "rounded-t-lg" : "",
|
|
124
|
-
|
|
125
|
-
), children:
|
|
126
|
-
s && /* @__PURE__ */ e("div", { className: "flex-shrink-0 flex items-center justify-end gap-2 px-4 py-3 border-t border-
|
|
124
|
+
N
|
|
125
|
+
), children: u }),
|
|
126
|
+
s && /* @__PURE__ */ e("div", { className: "flex-shrink-0 flex items-center justify-end gap-2 px-4 py-3 border-t border-light bg-card rounded-b-lg", children: s })
|
|
127
127
|
]
|
|
128
128
|
}
|
|
129
129
|
)
|
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import o from "react-mobile-picker";
|
|
4
4
|
import { cn as l } from "../lib/utils.js";
|
|
5
5
|
import { Button as D } from "./button.js";
|
|
6
6
|
import { ChevronRight as j } from "lucide-react";
|
|
7
7
|
import { Drawer as z, DrawerTrigger as O, DrawerContent as P, DrawerHeader as T, DrawerTitle as V, DrawerFooter as H } from "./drawer.js";
|
|
8
8
|
function E({
|
|
9
9
|
label: n,
|
|
10
|
-
options:
|
|
10
|
+
options: s,
|
|
11
11
|
value: a,
|
|
12
|
-
onChange:
|
|
13
|
-
trigger:
|
|
14
|
-
className:
|
|
15
|
-
pickerClassName:
|
|
16
|
-
description:
|
|
17
|
-
drawerProps:
|
|
12
|
+
onChange: f,
|
|
13
|
+
trigger: x,
|
|
14
|
+
className: u,
|
|
15
|
+
pickerClassName: g,
|
|
16
|
+
description: c,
|
|
17
|
+
drawerProps: v
|
|
18
18
|
}) {
|
|
19
|
-
const [
|
|
20
|
-
r && h(a),
|
|
21
|
-
},
|
|
19
|
+
const [b, d] = p(!1), [m, h] = p(a), y = (r) => {
|
|
20
|
+
r && h(a), d(r);
|
|
21
|
+
}, i = s.find((r) => r.value === a), w = { column: m }, N = (r) => {
|
|
22
22
|
h(r.column);
|
|
23
|
-
},
|
|
24
|
-
|
|
23
|
+
}, k = () => {
|
|
24
|
+
f(m), d(!1);
|
|
25
25
|
};
|
|
26
|
-
return /* @__PURE__ */ t(z, { open:
|
|
26
|
+
return /* @__PURE__ */ t(z, { open: b, onOpenChange: y, ...v, children: [
|
|
27
27
|
/* @__PURE__ */ e(O, { asChild: !0, children: /* @__PURE__ */ e(
|
|
28
28
|
"div",
|
|
29
29
|
{
|
|
30
|
-
className: l("cursor-pointer select-none",
|
|
31
|
-
children:
|
|
30
|
+
className: l("cursor-pointer select-none", u),
|
|
31
|
+
children: x || /* @__PURE__ */ t("div", { className: "flex items-center justify-between p-3.5 bg-hover/20 hover:bg-hover/30 active:scale-[0.98] rounded-xl border border-light transition-all group", children: [
|
|
32
32
|
/* @__PURE__ */ t("div", { className: "flex flex-col gap-0.5 text-left", children: [
|
|
33
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-black uppercase tracking-[0.2em] text-
|
|
33
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-black uppercase tracking-[0.2em] text-tertiary/45", children: n }),
|
|
34
34
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
35
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-bold text-
|
|
36
|
-
|
|
35
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-bold text-primary", children: (i == null ? void 0 : i.label) || a }),
|
|
36
|
+
c && /* @__PURE__ */ t("span", { className: "text-[10px] text-tertiary/50 font-medium truncate max-w-[120px]", children: [
|
|
37
37
|
"• ",
|
|
38
|
-
|
|
38
|
+
c
|
|
39
39
|
] })
|
|
40
40
|
] })
|
|
41
41
|
] }),
|
|
42
|
-
/* @__PURE__ */ e("div", { className: "w-7 min-w-[28px] h-7 rounded-full bg-
|
|
42
|
+
/* @__PURE__ */ e("div", { className: "w-7 min-w-[28px] h-7 rounded-full bg-hover/30 flex items-center justify-center group-hover:bg-hover/50 transition-colors", children: /* @__PURE__ */ e(j, { className: "w-4 h-4 text-tertiary/60" }) })
|
|
43
43
|
] })
|
|
44
44
|
}
|
|
45
45
|
) }),
|
|
46
46
|
/* @__PURE__ */ t(P, { children: [
|
|
47
47
|
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(V, { children: n }) }),
|
|
48
|
-
/* @__PURE__ */ e("div", { className: "px-6 pt-0 space-y-5 pb-10", children: /* @__PURE__ */ t("div", { className: "relative h-[220px] bg-card
|
|
48
|
+
/* @__PURE__ */ e("div", { className: "px-6 pt-0 space-y-5 pb-10", children: /* @__PURE__ */ t("div", { className: "relative h-[220px] bg-card dark:bg-hover/10 rounded-[32px] overflow-hidden border border-light shadow-sm", children: [
|
|
49
49
|
/* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-1/2 -translate-y-1/2 h-[56px] bg-primary/[0.04] dark:bg-primary/10 border-y border-primary/10 rounded-2xl pointer-events-none z-10" }),
|
|
50
50
|
/* @__PURE__ */ e(
|
|
51
|
-
|
|
51
|
+
o,
|
|
52
52
|
{
|
|
53
53
|
value: w,
|
|
54
|
-
onChange:
|
|
54
|
+
onChange: N,
|
|
55
55
|
height: 220,
|
|
56
56
|
itemHeight: 56,
|
|
57
|
-
className: l(
|
|
58
|
-
children: /* @__PURE__ */ e(
|
|
57
|
+
className: l(g),
|
|
58
|
+
children: /* @__PURE__ */ e(o.Column, { name: "column", children: s.map((r) => /* @__PURE__ */ e(o.Item, { value: r.value, children: ({ selected: C }) => /* @__PURE__ */ e(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
className: l(
|
|
62
62
|
"flex items-center justify-center h-full px-6 text-center transition-all duration-300 ease-out",
|
|
63
|
-
C ? "text-primary text-xl font-bold tracking-tight" : "text-
|
|
63
|
+
C ? "text-primary text-xl font-bold tracking-tight" : "text-tertiary/30 text-base font-medium scale-95"
|
|
64
64
|
),
|
|
65
65
|
children: r.label
|
|
66
66
|
}
|
|
@@ -73,8 +73,8 @@ function E({
|
|
|
73
73
|
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ t(
|
|
74
74
|
D,
|
|
75
75
|
{
|
|
76
|
-
onClick:
|
|
77
|
-
className: "w-full h-12 rounded-2xl text-base font-bold shadow-lg shadow-primary/10 bg-primary text-
|
|
76
|
+
onClick: k,
|
|
77
|
+
className: "w-full h-12 rounded-2xl text-base font-bold shadow-lg shadow-primary/10 bg-primary text-white hover:opacity-95 active:scale-[0.98] transition-all",
|
|
78
78
|
children: [
|
|
79
79
|
"Confirm ",
|
|
80
80
|
n
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as t from "@radix-ui/react-popover";
|
|
4
4
|
import { cn as s } from "../lib/utils.js";
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const f = t.Root, c = t.Trigger, m = n.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, ...d }, i) => /* @__PURE__ */ o(t.Portal, { children: /* @__PURE__ */ o(
|
|
6
|
+
t.Content,
|
|
7
7
|
{
|
|
8
8
|
ref: i,
|
|
9
9
|
align: a,
|
|
10
10
|
sideOffset: r,
|
|
11
11
|
className: s(
|
|
12
|
-
"z-50 w-72 rounded-md border bg-
|
|
12
|
+
"z-50 w-72 rounded-md border bg-card p-4 text-primary shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
13
13
|
e
|
|
14
14
|
),
|
|
15
15
|
...d
|
|
16
16
|
}
|
|
17
17
|
) }));
|
|
18
|
-
m.displayName =
|
|
18
|
+
m.displayName = t.Content.displayName;
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
f as Popover,
|
|
21
21
|
m as PopoverContent,
|
|
22
22
|
c as PopoverTrigger
|
|
23
23
|
};
|