welcome-ui 8.1.1 → 8.1.2
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 +111 -102
- 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 x } 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 v } from "./SYRFVSLH-jn06-eLy.mjs";
|
|
7
|
+
import { forwardRef as m } from "./System.mjs";
|
|
8
|
+
import { Text as h } 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 C } 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,40 @@ 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 = x();
|
|
108
|
+
return /* @__PURE__ */ r.createElement(l, { h: "0", position: "sticky", top: 0, zIndex: t }, /* @__PURE__ */ r.createElement(
|
|
109
|
+
v,
|
|
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
|
-
|
|
117
|
-
top: "0",
|
|
118
|
-
zIndex: t,
|
|
119
|
-
...r
|
|
116
|
+
...e
|
|
120
117
|
}
|
|
121
118
|
)
|
|
122
119
|
}
|
|
123
120
|
));
|
|
124
|
-
},
|
|
125
|
-
|
|
121
|
+
}, L = m((t, e) => /* @__PURE__ */ r.createElement(R, { flex: "1", overflowY: { md: "auto" }, ref: e, ...t })), W = m((t, e) => /* @__PURE__ */ r.createElement(
|
|
122
|
+
Y,
|
|
126
123
|
{
|
|
127
124
|
bottom: { xs: 0, md: "auto" },
|
|
128
125
|
position: { xs: "sticky", md: "static" },
|
|
129
|
-
ref:
|
|
126
|
+
ref: e,
|
|
130
127
|
w: "100%",
|
|
131
128
|
...t
|
|
132
129
|
}
|
|
133
|
-
)),
|
|
134
|
-
|
|
130
|
+
)), X = ({ children: t, zIndex: e = "1", ...o }) => /* @__PURE__ */ r.createElement(
|
|
131
|
+
A,
|
|
135
132
|
{
|
|
136
133
|
alignItems: "center",
|
|
137
134
|
display: "flex",
|
|
@@ -139,17 +136,16 @@ const I = (t) => {
|
|
|
139
136
|
position: { xs: "sticky", md: "static" },
|
|
140
137
|
top: { xs: 0, md: "auto" },
|
|
141
138
|
w: "100%",
|
|
142
|
-
zIndex:
|
|
139
|
+
zIndex: e,
|
|
143
140
|
...o
|
|
144
141
|
},
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
),
|
|
147
|
-
overflow-y: scroll;
|
|
142
|
+
/* @__PURE__ */ r.createElement(h, { m: "0", variant: "h3", w: "100%" }, t)
|
|
143
|
+
), q = a.divBox`
|
|
148
144
|
flex: 1;
|
|
149
145
|
margin: 0 auto;
|
|
150
146
|
width: 100%;
|
|
151
|
-
`,
|
|
152
|
-
({ size: t }) =>
|
|
147
|
+
`, z = a.divBox(
|
|
148
|
+
({ size: t }) => c`
|
|
153
149
|
display: flex;
|
|
154
150
|
align-items: center;
|
|
155
151
|
justify-content: center;
|
|
@@ -160,41 +156,54 @@ const I = (t) => {
|
|
|
160
156
|
background-color: beige-20;
|
|
161
157
|
transition: background-color ${n("transitions.medium")};
|
|
162
158
|
|
|
163
|
-
${t === "sm" &&
|
|
159
|
+
${t === "sm" && c`
|
|
164
160
|
height: 32;
|
|
165
161
|
width: 32;
|
|
166
162
|
`}
|
|
167
163
|
`
|
|
168
|
-
),
|
|
169
|
-
({
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
), H = m(
|
|
165
|
+
({
|
|
166
|
+
children: t,
|
|
167
|
+
getPersistentElements: e,
|
|
168
|
+
maxWidth: o = 820,
|
|
169
|
+
store: s,
|
|
170
|
+
...i
|
|
171
|
+
}, d) => {
|
|
172
|
+
const u = x(), p = () => Array.from(
|
|
173
|
+
e ? e() : document.querySelectorAll("[data-wui-persistent]")
|
|
174
|
+
), b = !!e || (($) => {
|
|
175
|
+
const D = $.target;
|
|
176
|
+
return !p().some(
|
|
177
|
+
(B) => B.contains(D)
|
|
178
|
+
);
|
|
179
|
+
});
|
|
180
|
+
return /* @__PURE__ */ r.createElement(
|
|
181
|
+
N,
|
|
173
182
|
{
|
|
174
|
-
...
|
|
183
|
+
...i,
|
|
175
184
|
autoFocusOnShow: !1,
|
|
185
|
+
getPersistentElements: p,
|
|
176
186
|
h: { _: "100%", md: "calc(100% - 3rem)" },
|
|
177
|
-
hideOnInteractOutside:
|
|
187
|
+
hideOnInteractOutside: b,
|
|
178
188
|
placement: "bottom",
|
|
179
|
-
ref:
|
|
180
|
-
store:
|
|
189
|
+
ref: d,
|
|
190
|
+
store: s,
|
|
181
191
|
style: {
|
|
182
|
-
borderTopLeftRadius:
|
|
183
|
-
borderTopRightRadius:
|
|
192
|
+
borderTopLeftRadius: u.radii.xxl,
|
|
193
|
+
borderTopRightRadius: u.radii.xxl
|
|
184
194
|
},
|
|
185
|
-
withBackdrop: !0
|
|
186
|
-
withCloseButton: !0
|
|
195
|
+
withBackdrop: !0
|
|
187
196
|
},
|
|
188
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ r.createElement(q, { maxWidth: o }, /* @__PURE__ */ r.createElement(l, { p: { _: "xl md", md: "3xl xl" } }, t))
|
|
189
198
|
);
|
|
190
199
|
}
|
|
191
|
-
),
|
|
200
|
+
), Z = ({
|
|
192
201
|
action: t,
|
|
193
|
-
icon:
|
|
202
|
+
icon: e,
|
|
194
203
|
onBackButtonClick: o,
|
|
195
204
|
subtitle: s,
|
|
196
205
|
title: i
|
|
197
|
-
}) => /* @__PURE__ */
|
|
206
|
+
}) => /* @__PURE__ */ r.createElement(
|
|
198
207
|
l,
|
|
199
208
|
{
|
|
200
209
|
alignItems: { md: "center" },
|
|
@@ -210,58 +219,58 @@ const I = (t) => {
|
|
|
210
219
|
top: 0,
|
|
211
220
|
zIndex: 1
|
|
212
221
|
},
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
t && /* @__PURE__ */
|
|
215
|
-
),
|
|
222
|
+
/* @__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(C, null)), !!e && /* @__PURE__ */ r.createElement(J, { icon: e }), /* @__PURE__ */ r.createElement(l, { display: "flex", flexDirection: "column", gap: "xxs" }, /* @__PURE__ */ r.createElement(h, { pr: "xl", variant: "h3" }, i), s)),
|
|
223
|
+
t && /* @__PURE__ */ r.createElement(l, { alignItems: "center", display: "flex", flexShrink: 0, gap: "md" }, t)
|
|
224
|
+
), J = ({ icon: t, size: e = "md" }) => /* @__PURE__ */ r.createElement(z, { size: e }, /* @__PURE__ */ r.createElement(t, { color: "neutral-90", size: e })), K = m(
|
|
216
225
|
({
|
|
217
226
|
children: t,
|
|
218
|
-
hideOnInteractOutside:
|
|
227
|
+
hideOnInteractOutside: e = !0,
|
|
219
228
|
placement: o = "right",
|
|
220
229
|
size: s = "lg",
|
|
221
230
|
store: i,
|
|
222
|
-
withBackdrop:
|
|
223
|
-
withCloseButton:
|
|
224
|
-
...
|
|
225
|
-
},
|
|
226
|
-
|
|
231
|
+
withBackdrop: d = !1,
|
|
232
|
+
withCloseButton: u = !0,
|
|
233
|
+
...p
|
|
234
|
+
}, f) => /* @__PURE__ */ r.createElement(
|
|
235
|
+
O,
|
|
227
236
|
{
|
|
228
|
-
backdrop:
|
|
229
|
-
hideOnInteractOutside:
|
|
230
|
-
modal:
|
|
231
|
-
ref:
|
|
232
|
-
render: /* @__PURE__ */
|
|
237
|
+
backdrop: d ? /* @__PURE__ */ r.createElement(w, { hideOnInteractOutside: e }) : !1,
|
|
238
|
+
hideOnInteractOutside: e,
|
|
239
|
+
modal: d,
|
|
240
|
+
ref: f,
|
|
241
|
+
render: /* @__PURE__ */ r.createElement(j, { placement: o, size: s }),
|
|
233
242
|
store: i,
|
|
234
|
-
...
|
|
243
|
+
...p
|
|
235
244
|
},
|
|
236
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ r.createElement(r.Fragment, null, u && /* @__PURE__ */ r.createElement(E, null), t)
|
|
237
246
|
)
|
|
238
247
|
);
|
|
239
|
-
function
|
|
240
|
-
return
|
|
248
|
+
function ct(t = {}) {
|
|
249
|
+
return S({ animated: !0, ...t });
|
|
241
250
|
}
|
|
242
|
-
const
|
|
251
|
+
const M = ({
|
|
243
252
|
hideOnInteractOutside: t = !0,
|
|
244
|
-
...
|
|
245
|
-
}) => /* @__PURE__ */
|
|
246
|
-
|
|
253
|
+
...e
|
|
254
|
+
}) => /* @__PURE__ */ r.createElement(w, { hideOnInteractOutside: t, ...e }), y = m(({ as: t, store: e, ...o }, s) => /* @__PURE__ */ r.createElement(
|
|
255
|
+
T,
|
|
247
256
|
{
|
|
248
257
|
ref: s,
|
|
249
|
-
render: t ? (i) => /* @__PURE__ */
|
|
250
|
-
store:
|
|
258
|
+
render: t ? (i) => /* @__PURE__ */ r.createElement(t, { ...i }) : void 0,
|
|
259
|
+
store: e,
|
|
251
260
|
...o
|
|
252
261
|
}
|
|
253
|
-
)),
|
|
254
|
-
Trigger:
|
|
255
|
-
Backdrop:
|
|
256
|
-
Close:
|
|
257
|
-
Title:
|
|
258
|
-
Content:
|
|
259
|
-
Footer:
|
|
260
|
-
}),
|
|
262
|
+
)), N = Object.assign(K, {
|
|
263
|
+
Trigger: y,
|
|
264
|
+
Backdrop: M,
|
|
265
|
+
Close: E,
|
|
266
|
+
Title: X,
|
|
267
|
+
Content: L,
|
|
268
|
+
Footer: W
|
|
269
|
+
}), mt = Object.assign(H, { Trigger: y, Header: Z });
|
|
261
270
|
export {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
271
|
+
mt as AssetDrawer,
|
|
272
|
+
N as Drawer,
|
|
273
|
+
M as DrawerBackdrop,
|
|
274
|
+
y as Trigger,
|
|
275
|
+
ct as useDrawer
|
|
267
276
|
};
|