welcome-ui 8.2.0-alpha.0 → 8.2.0
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 +99 -90
- package/package.json +1 -1
package/dist/Drawer.mjs
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as e } from "./jsx-runtime-B7I4PJ0H.mjs";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import n, { th as s, css as
|
|
3
|
+
import { forwardRef as d } from "./System.mjs";
|
|
4
|
+
import n, { th as s, css as c, useTheme as h } from "@xstyled/styled-components";
|
|
5
5
|
import { Box as l } from "./Box.mjs";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as v } from "./Button.mjs";
|
|
7
7
|
import "./Icon.mjs";
|
|
8
|
-
import { A as
|
|
9
|
-
import { Text as
|
|
10
|
-
import { CloseButton as
|
|
11
|
-
import { D as
|
|
12
|
-
import { D as
|
|
13
|
-
import { D as
|
|
14
|
-
const
|
|
15
|
-
overflow-y: scroll;
|
|
8
|
+
import { A as k } from "./index-QaLwIvZS.mjs";
|
|
9
|
+
import { Text as g } from "./Text.mjs";
|
|
10
|
+
import { CloseButton as C } from "./CloseButton.mjs";
|
|
11
|
+
import { D as I } from "./SYRFVSLH-B6m278Vb.mjs";
|
|
12
|
+
import { D as O, u as S } from "./JC64G2H7-afsomHuH.mjs";
|
|
13
|
+
import { D as T } from "./AXB53BZF-XKOjjeWO.mjs";
|
|
14
|
+
const F = n.divBox`
|
|
16
15
|
flex: 1;
|
|
17
16
|
margin: 0 auto;
|
|
18
17
|
width: 100%;
|
|
19
|
-
`,
|
|
20
|
-
({ size: t }) =>
|
|
18
|
+
`, A = n.divBox(
|
|
19
|
+
({ size: t }) => c`
|
|
21
20
|
display: flex;
|
|
22
21
|
align-items: center;
|
|
23
22
|
justify-content: center;
|
|
@@ -28,35 +27,49 @@ const I = n.divBox`
|
|
|
28
27
|
background-color: beige-20;
|
|
29
28
|
transition: background-color ${s("transitions.medium")};
|
|
30
29
|
|
|
31
|
-
${t === "sm" &&
|
|
30
|
+
${t === "sm" && c`
|
|
32
31
|
height: 32;
|
|
33
32
|
width: 32;
|
|
34
33
|
`}
|
|
35
34
|
`
|
|
36
|
-
),
|
|
37
|
-
({
|
|
38
|
-
|
|
35
|
+
), R = d(
|
|
36
|
+
({
|
|
37
|
+
children: t,
|
|
38
|
+
getPersistentElements: r,
|
|
39
|
+
maxWidth: o = 820,
|
|
40
|
+
store: i,
|
|
41
|
+
...a
|
|
42
|
+
}, m) => {
|
|
43
|
+
const u = h(), x = () => Array.from(
|
|
44
|
+
r ? r() : document.querySelectorAll("[data-wui-persistent]")
|
|
45
|
+
), b = !!r || (($) => {
|
|
46
|
+
const D = $.target;
|
|
47
|
+
return !x().some(
|
|
48
|
+
(B) => B.contains(D)
|
|
49
|
+
);
|
|
50
|
+
});
|
|
39
51
|
return /* @__PURE__ */ e.jsx(
|
|
40
|
-
|
|
52
|
+
N,
|
|
41
53
|
{
|
|
42
|
-
...
|
|
54
|
+
...a,
|
|
43
55
|
autoFocusOnShow: !1,
|
|
56
|
+
getPersistentElements: x,
|
|
44
57
|
h: { _: "100%", md: "calc(100% - 3rem)" },
|
|
45
|
-
hideOnInteractOutside:
|
|
58
|
+
hideOnInteractOutside: b,
|
|
59
|
+
overflow: "hidden",
|
|
46
60
|
placement: "bottom",
|
|
47
|
-
ref:
|
|
48
|
-
store:
|
|
61
|
+
ref: m,
|
|
62
|
+
store: i,
|
|
49
63
|
style: {
|
|
50
|
-
borderTopLeftRadius:
|
|
51
|
-
borderTopRightRadius:
|
|
64
|
+
borderTopLeftRadius: u.radii.xxl,
|
|
65
|
+
borderTopRightRadius: u.radii.xxl
|
|
52
66
|
},
|
|
53
67
|
withBackdrop: !0,
|
|
54
|
-
|
|
55
|
-
children: /* @__PURE__ */ e.jsx(I, { maxWidth: r, children: /* @__PURE__ */ e.jsx(l, { p: { _: "xl md", md: "3xl xl" }, children: t }) })
|
|
68
|
+
children: /* @__PURE__ */ e.jsx(l, { h: "100%", mt: { _: "xl", md: "3xl" }, overflowY: "auto", w: "100%", children: /* @__PURE__ */ e.jsx(F, { maxWidth: o, children: /* @__PURE__ */ e.jsx(l, { p: { _: "0 md xl", md: "0 xl 3xl" }, children: t }) }) })
|
|
56
69
|
}
|
|
57
70
|
);
|
|
58
71
|
}
|
|
59
|
-
),
|
|
72
|
+
), _ = ({
|
|
60
73
|
action: t,
|
|
61
74
|
icon: r,
|
|
62
75
|
onBackButtonClick: o,
|
|
@@ -72,24 +85,23 @@ const I = n.divBox`
|
|
|
72
85
|
gap: "xl",
|
|
73
86
|
justifyContent: "space-between",
|
|
74
87
|
mb: "xl",
|
|
75
|
-
|
|
88
|
+
pb: "md",
|
|
76
89
|
position: "sticky",
|
|
77
|
-
py: "md",
|
|
78
90
|
top: 0,
|
|
79
91
|
zIndex: 1,
|
|
80
92
|
children: [
|
|
81
93
|
/* @__PURE__ */ e.jsxs(l, { alignItems: "center", display: "flex", gap: { _: "md", md: "xl" }, children: [
|
|
82
|
-
!!o && /* @__PURE__ */ e.jsx(
|
|
83
|
-
!!r && /* @__PURE__ */ e.jsx(
|
|
94
|
+
!!o && /* @__PURE__ */ e.jsx(v, { onClick: o, shape: "circle", size: "lg", variant: "ghost", children: /* @__PURE__ */ e.jsx(k, {}) }),
|
|
95
|
+
!!r && /* @__PURE__ */ e.jsx(E, { icon: r }),
|
|
84
96
|
/* @__PURE__ */ e.jsxs(l, { display: "flex", flexDirection: "column", gap: "xxs", children: [
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
97
|
+
/* @__PURE__ */ e.jsx(g, { pr: "xl", variant: "h3", children: a }),
|
|
86
98
|
i
|
|
87
99
|
] })
|
|
88
100
|
] }),
|
|
89
101
|
t ? /* @__PURE__ */ e.jsx(l, { alignItems: "center", display: "flex", flexShrink: 0, gap: "md", children: t }) : null
|
|
90
102
|
]
|
|
91
103
|
}
|
|
92
|
-
),
|
|
104
|
+
), E = ({ icon: t, size: r = "md" }) => /* @__PURE__ */ e.jsx(A, { size: r, children: /* @__PURE__ */ e.jsx(t, { color: "neutral-90", size: r }) }), P = (t) => {
|
|
93
105
|
switch (t) {
|
|
94
106
|
case "bottom":
|
|
95
107
|
return {
|
|
@@ -120,25 +132,25 @@ const I = n.divBox`
|
|
|
120
132
|
transform: "translateY(-100%)"
|
|
121
133
|
};
|
|
122
134
|
}
|
|
123
|
-
},
|
|
135
|
+
}, f = ["sm", "md", "lg"], Y = (t, r) => {
|
|
124
136
|
switch (r) {
|
|
125
137
|
case "bottom":
|
|
126
138
|
case "top":
|
|
127
|
-
return
|
|
139
|
+
return f.includes(t) ? s(`drawers.sizes.vertical.${t}`) : {
|
|
128
140
|
height: t
|
|
129
141
|
};
|
|
130
142
|
case "left":
|
|
131
143
|
case "right":
|
|
132
|
-
return
|
|
144
|
+
return f.includes(t) ? s(`drawers.sizes.horizontal.${t}`) : {
|
|
133
145
|
width: t
|
|
134
146
|
};
|
|
135
147
|
}
|
|
136
|
-
},
|
|
137
|
-
({ placement: t, size: r }) =>
|
|
148
|
+
}, L = n.divBox(
|
|
149
|
+
({ placement: t, size: r }) => c`
|
|
138
150
|
${s("cards.default")};
|
|
139
151
|
${s("drawers.default")};
|
|
140
|
-
${
|
|
141
|
-
${
|
|
152
|
+
${P(t)}
|
|
153
|
+
${Y(r, t)}
|
|
142
154
|
position: fixed;
|
|
143
155
|
display: flex;
|
|
144
156
|
flex-direction: column;
|
|
@@ -152,10 +164,10 @@ const I = n.divBox`
|
|
|
152
164
|
transform: translate(0, 0);
|
|
153
165
|
}
|
|
154
166
|
`
|
|
155
|
-
),
|
|
167
|
+
), w = n.divBox.withConfig({
|
|
156
168
|
shouldForwardProp: (t) => !["hideOnInteractOutside"].includes(t)
|
|
157
169
|
})(
|
|
158
|
-
({ hideOnInteractOutside: t }) =>
|
|
170
|
+
({ hideOnInteractOutside: t }) => c`
|
|
159
171
|
${s("drawers.backdrop")};
|
|
160
172
|
position: fixed;
|
|
161
173
|
top: 0;
|
|
@@ -165,7 +177,7 @@ const I = n.divBox`
|
|
|
165
177
|
opacity: 0;
|
|
166
178
|
transition: opacity 150ms ease-in-out;
|
|
167
179
|
|
|
168
|
-
${t &&
|
|
180
|
+
${t && c`
|
|
169
181
|
cursor: pointer;
|
|
170
182
|
`}
|
|
171
183
|
|
|
@@ -173,34 +185,31 @@ const I = n.divBox`
|
|
|
173
185
|
opacity: 1;
|
|
174
186
|
}
|
|
175
187
|
`
|
|
176
|
-
),
|
|
188
|
+
), W = n.divBox`
|
|
177
189
|
${s("drawers.title")};
|
|
178
|
-
`,
|
|
190
|
+
`, X = n.divBox`
|
|
179
191
|
${s("drawers.content")};
|
|
180
|
-
`,
|
|
192
|
+
`, q = n(C)`
|
|
181
193
|
${s("drawers.closeButton")};
|
|
182
|
-
`,
|
|
194
|
+
`, z = n.divBox`
|
|
183
195
|
${s("drawers.footer")};
|
|
184
|
-
`,
|
|
185
|
-
const o =
|
|
186
|
-
return /* @__PURE__ */ e.jsx(l, { h: "0", children: /* @__PURE__ */ e.jsx(
|
|
187
|
-
|
|
196
|
+
`, j = ({ zIndex: t = "2", ...r }) => {
|
|
197
|
+
const o = h();
|
|
198
|
+
return /* @__PURE__ */ e.jsx(l, { h: "0", position: "sticky", top: 0, zIndex: t, children: /* @__PURE__ */ e.jsx(
|
|
199
|
+
I,
|
|
188
200
|
{
|
|
189
201
|
render: /* @__PURE__ */ e.jsx(
|
|
190
|
-
|
|
202
|
+
q,
|
|
191
203
|
{
|
|
192
204
|
left: `calc(100% - ${o.space.lg} - ${o.buttons.sizes.sm.height})`,
|
|
193
205
|
mt: "lg",
|
|
194
|
-
position: "sticky",
|
|
195
|
-
top: "0",
|
|
196
|
-
zIndex: t,
|
|
197
206
|
...r
|
|
198
207
|
}
|
|
199
208
|
)
|
|
200
209
|
}
|
|
201
210
|
) });
|
|
202
|
-
},
|
|
203
|
-
|
|
211
|
+
}, H = d((t, r) => /* @__PURE__ */ e.jsx(X, { flex: "1", overflowY: { md: "auto" }, ref: r, ...t })), Z = d((t, r) => /* @__PURE__ */ e.jsx(
|
|
212
|
+
z,
|
|
204
213
|
{
|
|
205
214
|
bottom: { md: "auto", xs: 0 },
|
|
206
215
|
position: { md: "static", xs: "sticky" },
|
|
@@ -208,8 +217,8 @@ const I = n.divBox`
|
|
|
208
217
|
w: "100%",
|
|
209
218
|
...t
|
|
210
219
|
}
|
|
211
|
-
)),
|
|
212
|
-
|
|
220
|
+
)), J = ({ children: t, zIndex: r = "1", ...o }) => /* @__PURE__ */ e.jsx(
|
|
221
|
+
W,
|
|
213
222
|
{
|
|
214
223
|
alignItems: "center",
|
|
215
224
|
display: "flex",
|
|
@@ -219,61 +228,61 @@ const I = n.divBox`
|
|
|
219
228
|
w: "100%",
|
|
220
229
|
zIndex: r,
|
|
221
230
|
...o,
|
|
222
|
-
children: /* @__PURE__ */ e.jsx(
|
|
231
|
+
children: /* @__PURE__ */ e.jsx(g, { m: "0", variant: "h3", w: "100%", children: t })
|
|
223
232
|
}
|
|
224
|
-
),
|
|
233
|
+
), K = d(
|
|
225
234
|
({
|
|
226
235
|
children: t,
|
|
227
236
|
hideOnInteractOutside: r = !0,
|
|
228
237
|
placement: o = "right",
|
|
229
238
|
size: i = "lg",
|
|
230
239
|
store: a,
|
|
231
|
-
withBackdrop:
|
|
232
|
-
withCloseButton:
|
|
233
|
-
...
|
|
234
|
-
},
|
|
235
|
-
|
|
240
|
+
withBackdrop: m = !1,
|
|
241
|
+
withCloseButton: u = !0,
|
|
242
|
+
...x
|
|
243
|
+
}, p) => /* @__PURE__ */ e.jsx(
|
|
244
|
+
O,
|
|
236
245
|
{
|
|
237
|
-
backdrop:
|
|
246
|
+
backdrop: m ? /* @__PURE__ */ e.jsx(w, { hideOnInteractOutside: r }) : !1,
|
|
238
247
|
hideOnInteractOutside: r,
|
|
239
|
-
modal:
|
|
240
|
-
ref:
|
|
241
|
-
render: /* @__PURE__ */ e.jsx(
|
|
248
|
+
modal: m,
|
|
249
|
+
ref: p,
|
|
250
|
+
render: /* @__PURE__ */ e.jsx(L, { placement: o, size: i }),
|
|
242
251
|
store: a,
|
|
243
|
-
...
|
|
252
|
+
...x,
|
|
244
253
|
children: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
245
|
-
|
|
254
|
+
u ? /* @__PURE__ */ e.jsx(j, {}) : null,
|
|
246
255
|
t
|
|
247
256
|
] })
|
|
248
257
|
}
|
|
249
258
|
)
|
|
250
259
|
);
|
|
251
|
-
function
|
|
252
|
-
return
|
|
260
|
+
function ct(t = {}) {
|
|
261
|
+
return S({ animated: !0, ...t });
|
|
253
262
|
}
|
|
254
|
-
const
|
|
263
|
+
const M = ({
|
|
255
264
|
hideOnInteractOutside: t = !0,
|
|
256
265
|
...r
|
|
257
|
-
}) => /* @__PURE__ */ e.jsx(
|
|
258
|
-
|
|
266
|
+
}) => /* @__PURE__ */ e.jsx(w, { hideOnInteractOutside: t, ...r }), y = d(({ as: t, store: r, ...o }, i) => /* @__PURE__ */ e.jsx(
|
|
267
|
+
T,
|
|
259
268
|
{
|
|
260
269
|
ref: i,
|
|
261
270
|
render: t ? (a) => /* @__PURE__ */ e.jsx(t, { ...a }) : void 0,
|
|
262
271
|
store: r,
|
|
263
272
|
...o
|
|
264
273
|
}
|
|
265
|
-
)),
|
|
266
|
-
Backdrop:
|
|
267
|
-
Close:
|
|
268
|
-
Content:
|
|
269
|
-
Footer:
|
|
270
|
-
Title:
|
|
271
|
-
Trigger:
|
|
272
|
-
}),
|
|
274
|
+
)), N = Object.assign(K, {
|
|
275
|
+
Backdrop: M,
|
|
276
|
+
Close: j,
|
|
277
|
+
Content: H,
|
|
278
|
+
Footer: Z,
|
|
279
|
+
Title: J,
|
|
280
|
+
Trigger: y
|
|
281
|
+
}), dt = Object.assign(R, { Header: _, Trigger: y });
|
|
273
282
|
export {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
283
|
+
dt as AssetDrawer,
|
|
284
|
+
N as Drawer,
|
|
285
|
+
M as DrawerBackdrop,
|
|
286
|
+
y as Trigger,
|
|
287
|
+
ct as useDrawer
|
|
279
288
|
};
|