welcome-ui 8.1.2 → 8.1.3
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/Drawer.mjs +40 -40
- package/package.json +1 -1
package/dist/Drawer.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import e from "react";
|
|
3
3
|
import a, { th as n, css as c, useTheme as x } from "@xstyled/styled-components";
|
|
4
|
-
import { CloseButton as
|
|
4
|
+
import { CloseButton as v } from "./CloseButton.mjs";
|
|
5
5
|
import { Box as l } from "./Box.mjs";
|
|
6
|
-
import { D as
|
|
6
|
+
import { D as k } from "./SYRFVSLH-jn06-eLy.mjs";
|
|
7
7
|
import { forwardRef as m } from "./System.mjs";
|
|
8
8
|
import { Text as h } from "./Text.mjs";
|
|
9
9
|
import "./Icon.mjs";
|
|
@@ -42,8 +42,8 @@ const F = (t) => {
|
|
|
42
42
|
transform: "translateX(-100%)"
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
}, g = ["sm", "md", "lg"], _ = (t,
|
|
46
|
-
switch (
|
|
45
|
+
}, g = ["sm", "md", "lg"], _ = (t, r) => {
|
|
46
|
+
switch (r) {
|
|
47
47
|
case "top":
|
|
48
48
|
case "bottom":
|
|
49
49
|
return g.includes(t) ? n(`drawers.sizes.vertical.${t}`) : {
|
|
@@ -56,11 +56,11 @@ const F = (t) => {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
}, j = a.divBox(
|
|
59
|
-
({ placement: t, size:
|
|
59
|
+
({ placement: t, size: r }) => c`
|
|
60
60
|
${n("cards.default")};
|
|
61
61
|
${n("drawers.default")};
|
|
62
62
|
${F(t)}
|
|
63
|
-
${_(
|
|
63
|
+
${_(r, t)}
|
|
64
64
|
position: fixed;
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: column;
|
|
@@ -99,35 +99,35 @@ const F = (t) => {
|
|
|
99
99
|
${n("drawers.title")};
|
|
100
100
|
`, R = a.divBox`
|
|
101
101
|
${n("drawers.content")};
|
|
102
|
-
`, P = a(
|
|
102
|
+
`, P = a(v)`
|
|
103
103
|
${n("drawers.closeButton")};
|
|
104
104
|
`, Y = a.divBox`
|
|
105
105
|
${n("drawers.footer")};
|
|
106
|
-
`, E = ({ zIndex: t = "2", ...
|
|
106
|
+
`, E = ({ zIndex: t = "2", ...r }) => {
|
|
107
107
|
const o = x();
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
-
|
|
108
|
+
return /* @__PURE__ */ e.createElement(l, { h: "0", position: "sticky", top: 0, zIndex: t }, /* @__PURE__ */ e.createElement(
|
|
109
|
+
k,
|
|
110
110
|
{
|
|
111
|
-
render: /* @__PURE__ */
|
|
111
|
+
render: /* @__PURE__ */ e.createElement(
|
|
112
112
|
P,
|
|
113
113
|
{
|
|
114
114
|
left: `calc(100% - ${o.space.lg} - ${o.buttons.sizes.sm.height})`,
|
|
115
115
|
mt: "lg",
|
|
116
|
-
...
|
|
116
|
+
...r
|
|
117
117
|
}
|
|
118
118
|
)
|
|
119
119
|
}
|
|
120
120
|
));
|
|
121
|
-
}, L = m((t,
|
|
121
|
+
}, L = m((t, r) => /* @__PURE__ */ e.createElement(R, { flex: "1", overflowY: { md: "auto" }, ref: r, ...t })), W = m((t, r) => /* @__PURE__ */ e.createElement(
|
|
122
122
|
Y,
|
|
123
123
|
{
|
|
124
124
|
bottom: { xs: 0, md: "auto" },
|
|
125
125
|
position: { xs: "sticky", md: "static" },
|
|
126
|
-
ref:
|
|
126
|
+
ref: r,
|
|
127
127
|
w: "100%",
|
|
128
128
|
...t
|
|
129
129
|
}
|
|
130
|
-
)), X = ({ children: t, zIndex:
|
|
130
|
+
)), X = ({ children: t, zIndex: r = "1", ...o }) => /* @__PURE__ */ e.createElement(
|
|
131
131
|
A,
|
|
132
132
|
{
|
|
133
133
|
alignItems: "center",
|
|
@@ -136,10 +136,10 @@ const F = (t) => {
|
|
|
136
136
|
position: { xs: "sticky", md: "static" },
|
|
137
137
|
top: { xs: 0, md: "auto" },
|
|
138
138
|
w: "100%",
|
|
139
|
-
zIndex:
|
|
139
|
+
zIndex: r,
|
|
140
140
|
...o
|
|
141
141
|
},
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ e.createElement(h, { m: "0", variant: "h3", w: "100%" }, t)
|
|
143
143
|
), q = a.divBox`
|
|
144
144
|
flex: 1;
|
|
145
145
|
margin: 0 auto;
|
|
@@ -164,20 +164,20 @@ const F = (t) => {
|
|
|
164
164
|
), H = m(
|
|
165
165
|
({
|
|
166
166
|
children: t,
|
|
167
|
-
getPersistentElements:
|
|
167
|
+
getPersistentElements: r,
|
|
168
168
|
maxWidth: o = 820,
|
|
169
169
|
store: s,
|
|
170
170
|
...i
|
|
171
171
|
}, d) => {
|
|
172
172
|
const u = x(), p = () => Array.from(
|
|
173
|
-
|
|
174
|
-
), b = !!
|
|
173
|
+
r ? r() : document.querySelectorAll("[data-wui-persistent]")
|
|
174
|
+
), b = !!r || (($) => {
|
|
175
175
|
const D = $.target;
|
|
176
176
|
return !p().some(
|
|
177
177
|
(B) => B.contains(D)
|
|
178
178
|
);
|
|
179
179
|
});
|
|
180
|
-
return /* @__PURE__ */
|
|
180
|
+
return /* @__PURE__ */ e.createElement(
|
|
181
181
|
N,
|
|
182
182
|
{
|
|
183
183
|
...i,
|
|
@@ -185,6 +185,7 @@ const F = (t) => {
|
|
|
185
185
|
getPersistentElements: p,
|
|
186
186
|
h: { _: "100%", md: "calc(100% - 3rem)" },
|
|
187
187
|
hideOnInteractOutside: b,
|
|
188
|
+
overflow: "hidden",
|
|
188
189
|
placement: "bottom",
|
|
189
190
|
ref: d,
|
|
190
191
|
store: s,
|
|
@@ -194,16 +195,16 @@ const F = (t) => {
|
|
|
194
195
|
},
|
|
195
196
|
withBackdrop: !0
|
|
196
197
|
},
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ e.createElement(l, { h: "100%", mt: { _: "xl", md: "3xl" }, overflowY: "auto", w: "100%" }, /* @__PURE__ */ e.createElement(q, { maxWidth: o }, /* @__PURE__ */ e.createElement(l, { p: { _: "0 md xl", md: "0 xl 3xl" } }, t)))
|
|
198
199
|
);
|
|
199
200
|
}
|
|
200
201
|
), Z = ({
|
|
201
202
|
action: t,
|
|
202
|
-
icon:
|
|
203
|
+
icon: r,
|
|
203
204
|
onBackButtonClick: o,
|
|
204
205
|
subtitle: s,
|
|
205
206
|
title: i
|
|
206
|
-
}) => /* @__PURE__ */
|
|
207
|
+
}) => /* @__PURE__ */ e.createElement(
|
|
207
208
|
l,
|
|
208
209
|
{
|
|
209
210
|
alignItems: { md: "center" },
|
|
@@ -213,36 +214,35 @@ const F = (t) => {
|
|
|
213
214
|
gap: "xl",
|
|
214
215
|
justifyContent: "space-between",
|
|
215
216
|
mb: "xl",
|
|
216
|
-
|
|
217
|
+
pb: "md",
|
|
217
218
|
position: "sticky",
|
|
218
|
-
py: "md",
|
|
219
219
|
top: 0,
|
|
220
220
|
zIndex: 1
|
|
221
221
|
},
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
t && /* @__PURE__ */
|
|
224
|
-
), J = ({ icon: t, size:
|
|
222
|
+
/* @__PURE__ */ e.createElement(l, { alignItems: "center", display: "flex", gap: { _: "md", md: "xl" } }, !!o && /* @__PURE__ */ e.createElement(I, { onClick: o, shape: "circle", size: "lg", variant: "ghost" }, /* @__PURE__ */ e.createElement(C, null)), !!r && /* @__PURE__ */ e.createElement(J, { icon: r }), /* @__PURE__ */ e.createElement(l, { display: "flex", flexDirection: "column", gap: "xxs" }, /* @__PURE__ */ e.createElement(h, { pr: "xl", variant: "h3" }, i), s)),
|
|
223
|
+
t && /* @__PURE__ */ e.createElement(l, { alignItems: "center", display: "flex", flexShrink: 0, gap: "md" }, t)
|
|
224
|
+
), J = ({ icon: t, size: r = "md" }) => /* @__PURE__ */ e.createElement(z, { size: r }, /* @__PURE__ */ e.createElement(t, { color: "neutral-90", size: r })), K = m(
|
|
225
225
|
({
|
|
226
226
|
children: t,
|
|
227
|
-
hideOnInteractOutside:
|
|
227
|
+
hideOnInteractOutside: r = !0,
|
|
228
228
|
placement: o = "right",
|
|
229
229
|
size: s = "lg",
|
|
230
230
|
store: i,
|
|
231
231
|
withBackdrop: d = !1,
|
|
232
232
|
withCloseButton: u = !0,
|
|
233
233
|
...p
|
|
234
|
-
}, f) => /* @__PURE__ */
|
|
234
|
+
}, f) => /* @__PURE__ */ e.createElement(
|
|
235
235
|
O,
|
|
236
236
|
{
|
|
237
|
-
backdrop: d ? /* @__PURE__ */
|
|
238
|
-
hideOnInteractOutside:
|
|
237
|
+
backdrop: d ? /* @__PURE__ */ e.createElement(w, { hideOnInteractOutside: r }) : !1,
|
|
238
|
+
hideOnInteractOutside: r,
|
|
239
239
|
modal: d,
|
|
240
240
|
ref: f,
|
|
241
|
-
render: /* @__PURE__ */
|
|
241
|
+
render: /* @__PURE__ */ e.createElement(j, { placement: o, size: s }),
|
|
242
242
|
store: i,
|
|
243
243
|
...p
|
|
244
244
|
},
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, u && /* @__PURE__ */ e.createElement(E, null), t)
|
|
246
246
|
)
|
|
247
247
|
);
|
|
248
248
|
function ct(t = {}) {
|
|
@@ -250,13 +250,13 @@ function ct(t = {}) {
|
|
|
250
250
|
}
|
|
251
251
|
const M = ({
|
|
252
252
|
hideOnInteractOutside: t = !0,
|
|
253
|
-
...
|
|
254
|
-
}) => /* @__PURE__ */
|
|
253
|
+
...r
|
|
254
|
+
}) => /* @__PURE__ */ e.createElement(w, { hideOnInteractOutside: t, ...r }), y = m(({ as: t, store: r, ...o }, s) => /* @__PURE__ */ e.createElement(
|
|
255
255
|
T,
|
|
256
256
|
{
|
|
257
257
|
ref: s,
|
|
258
|
-
render: t ? (i) => /* @__PURE__ */
|
|
259
|
-
store:
|
|
258
|
+
render: t ? (i) => /* @__PURE__ */ e.createElement(t, { ...i }) : void 0,
|
|
259
|
+
store: r,
|
|
260
260
|
...o
|
|
261
261
|
}
|
|
262
262
|
)), N = Object.assign(K, {
|