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