@yuno-payments/dashboard-design-system 0.0.121 → 0.0.122
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import * as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { normalizeDimension as
|
|
6
|
-
import { useBodyScrollLock as
|
|
7
|
-
import { useEscapeKey as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { Typography as
|
|
11
|
-
const
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { createPortal as H } from "react-dom";
|
|
4
|
+
import { cva as g } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import { normalizeDimension as p, cn as r } from "../../../lib/utils.js";
|
|
6
|
+
import { useBodyScrollLock as M } from "../../../hooks/use-body-scroll-lock.js";
|
|
7
|
+
import { useEscapeKey as R } from "../../../hooks/use-escape-key.js";
|
|
8
|
+
import { Icon as W } from "../../atoms/icon/icon.js";
|
|
9
|
+
import { Button as x } from "../../atoms/button/button.js";
|
|
10
|
+
import { Typography as b } from "../../atoms/typography/typography.js";
|
|
11
|
+
const D = g(
|
|
12
12
|
"fixed z-[1000000] bg-background shadow-lg transition-transform duration-300 ease-in-out",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
@@ -38,7 +38,7 @@ const F = x(
|
|
|
38
38
|
isOpen: !1
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
),
|
|
41
|
+
), F = g(
|
|
42
42
|
"fixed inset-0 z-[1000000] bg-black/50 transition-opacity duration-300",
|
|
43
43
|
{
|
|
44
44
|
variants: {
|
|
@@ -51,119 +51,120 @@ const F = x(
|
|
|
51
51
|
isOpen: !1
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
), K =
|
|
54
|
+
), K = i.forwardRef(
|
|
55
55
|
({
|
|
56
|
-
className:
|
|
57
|
-
side:
|
|
58
|
-
title:
|
|
59
|
-
description:
|
|
60
|
-
open:
|
|
61
|
-
onClose:
|
|
56
|
+
className: y,
|
|
57
|
+
side: s = "right",
|
|
58
|
+
title: l,
|
|
59
|
+
description: o,
|
|
60
|
+
open: a,
|
|
61
|
+
onClose: n,
|
|
62
62
|
buttons: c = [],
|
|
63
|
-
width:
|
|
64
|
-
height:
|
|
65
|
-
showHeader:
|
|
66
|
-
showFooter:
|
|
67
|
-
children:
|
|
68
|
-
headerClassName:
|
|
69
|
-
contentClassName:
|
|
70
|
-
footerClassName:
|
|
71
|
-
loading:
|
|
72
|
-
...
|
|
73
|
-
},
|
|
74
|
-
const [
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
63
|
+
width: j,
|
|
64
|
+
height: v,
|
|
65
|
+
showHeader: O = !0,
|
|
66
|
+
showFooter: N = !0,
|
|
67
|
+
children: w,
|
|
68
|
+
headerClassName: S,
|
|
69
|
+
contentClassName: k,
|
|
70
|
+
footerClassName: z,
|
|
71
|
+
loading: T = !1,
|
|
72
|
+
...V
|
|
73
|
+
}, E) => {
|
|
74
|
+
const [I, f] = i.useState(!1), [u, h] = i.useState(!1);
|
|
75
|
+
if (M(a), R(a, n), i.useEffect(() => {
|
|
76
|
+
if (a) {
|
|
77
77
|
f(!0);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
const t = setTimeout(() => h(!0), 10);
|
|
79
|
+
return () => clearTimeout(t);
|
|
80
|
+
} else {
|
|
81
|
+
h(!1);
|
|
82
|
+
const t = setTimeout(() => f(!1), 310);
|
|
83
|
+
return () => clearTimeout(t);
|
|
83
84
|
}
|
|
84
|
-
}, [
|
|
85
|
-
const
|
|
86
|
-
...
|
|
87
|
-
...
|
|
88
|
-
},
|
|
85
|
+
}, [a]), !I) return null;
|
|
86
|
+
const d = p(j), m = p(v), A = {
|
|
87
|
+
...d && (s === "left" || s === "right") ? { width: d, maxWidth: d } : {},
|
|
88
|
+
...m && (s === "top" || s === "bottom") ? { height: m, maxHeight: m } : {}
|
|
89
|
+
}, B = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
89
90
|
/* @__PURE__ */ e.jsx(
|
|
90
91
|
"div",
|
|
91
92
|
{
|
|
92
|
-
className:
|
|
93
|
-
onClick:
|
|
93
|
+
className: F({ isOpen: u }),
|
|
94
|
+
onClick: n,
|
|
94
95
|
"aria-hidden": "true"
|
|
95
96
|
}
|
|
96
97
|
),
|
|
97
98
|
/* @__PURE__ */ e.jsx(
|
|
98
99
|
"div",
|
|
99
100
|
{
|
|
100
|
-
ref:
|
|
101
|
-
className: r(
|
|
102
|
-
style:
|
|
101
|
+
ref: E,
|
|
102
|
+
className: r(D({ side: s, isOpen: u }), y),
|
|
103
|
+
style: A,
|
|
103
104
|
role: "dialog",
|
|
104
105
|
"aria-modal": "true",
|
|
105
|
-
"aria-labelledby":
|
|
106
|
-
"aria-describedby":
|
|
107
|
-
...
|
|
106
|
+
"aria-labelledby": l ? "sheet-title" : void 0,
|
|
107
|
+
"aria-describedby": o ? "sheet-description" : void 0,
|
|
108
|
+
...V,
|
|
108
109
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
109
|
-
|
|
110
|
+
O && /* @__PURE__ */ e.jsxs(
|
|
110
111
|
"div",
|
|
111
112
|
{
|
|
112
113
|
className: r(
|
|
113
114
|
"flex items-center justify-between border-b border-border p-6",
|
|
114
|
-
|
|
115
|
+
S
|
|
115
116
|
),
|
|
116
117
|
children: [
|
|
117
118
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
l && /* @__PURE__ */ e.jsx(
|
|
120
|
+
b,
|
|
120
121
|
{
|
|
121
122
|
id: "sheet-title",
|
|
122
123
|
as: "h2",
|
|
123
124
|
variant: "h3",
|
|
124
125
|
className: "font-semibold",
|
|
125
|
-
children:
|
|
126
|
+
children: l
|
|
126
127
|
}
|
|
127
128
|
),
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
o && /* @__PURE__ */ e.jsx(
|
|
130
|
+
b,
|
|
130
131
|
{
|
|
131
132
|
id: "sheet-description",
|
|
132
133
|
variant: "muted",
|
|
133
134
|
className: "text-sm",
|
|
134
|
-
children:
|
|
135
|
+
children: o
|
|
135
136
|
}
|
|
136
137
|
)
|
|
137
138
|
] }),
|
|
138
139
|
/* @__PURE__ */ e.jsx(
|
|
139
|
-
|
|
140
|
+
x,
|
|
140
141
|
{
|
|
141
142
|
variant: "ghost",
|
|
142
143
|
size: "icon",
|
|
143
|
-
onClick:
|
|
144
|
+
onClick: n,
|
|
144
145
|
"aria-label": "Close",
|
|
145
146
|
className: "h-6 w-6",
|
|
146
|
-
children: /* @__PURE__ */ e.jsx(
|
|
147
|
+
children: /* @__PURE__ */ e.jsx(W, { name: "X", size: "md" })
|
|
147
148
|
}
|
|
148
149
|
)
|
|
149
150
|
]
|
|
150
151
|
}
|
|
151
152
|
),
|
|
152
|
-
/* @__PURE__ */ e.jsx("div", { className: r("flex-1 overflow-y-auto p-6",
|
|
153
|
-
|
|
153
|
+
/* @__PURE__ */ e.jsx("div", { className: r("flex-1 overflow-y-auto p-6", k), children: w }),
|
|
154
|
+
N && c.length > 0 && /* @__PURE__ */ e.jsx(
|
|
154
155
|
"div",
|
|
155
156
|
{
|
|
156
157
|
className: r(
|
|
157
158
|
"flex items-center justify-end gap-3 border-t border-border p-6",
|
|
158
|
-
|
|
159
|
+
z
|
|
159
160
|
),
|
|
160
|
-
children: c.map((
|
|
161
|
-
|
|
161
|
+
children: c.map((t, C) => /* @__PURE__ */ e.jsx(
|
|
162
|
+
x,
|
|
162
163
|
{
|
|
163
|
-
disabled:
|
|
164
|
-
...
|
|
164
|
+
disabled: T || t.disabled,
|
|
165
|
+
...t
|
|
165
166
|
},
|
|
166
|
-
|
|
167
|
+
C
|
|
167
168
|
))
|
|
168
169
|
}
|
|
169
170
|
)
|
|
@@ -171,7 +172,7 @@ const F = x(
|
|
|
171
172
|
}
|
|
172
173
|
)
|
|
173
174
|
] });
|
|
174
|
-
return
|
|
175
|
+
return H(B, document.body);
|
|
175
176
|
}
|
|
176
177
|
);
|
|
177
178
|
K.displayName = "Sheet";
|