welcome-ui 8.1.0-alpha.1 → 8.1.0-alpha.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/Modal.mjs +43 -43
- package/package.json +1 -1
package/dist/Modal.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as o } from "./jsx-runtime-B7I4PJ0H.mjs";
|
|
3
|
-
import a, { css as h, th as l, up as J, system as K, useTheme as
|
|
4
|
-
import
|
|
3
|
+
import a, { css as h, th as l, up as J, system as K, useTheme as w } from "@xstyled/styled-components";
|
|
4
|
+
import F, { useState as L, useMemo as Q, Children as D, useEffect as U, cloneElement as H } from "react";
|
|
5
5
|
import { Shape as X } from "./Shape.mjs";
|
|
6
|
-
import { forwardRef as
|
|
6
|
+
import { forwardRef as c } from "./System.mjs";
|
|
7
7
|
import { Box as $ } from "./Box.mjs";
|
|
8
8
|
import { Text as x } from "./Text.mjs";
|
|
9
9
|
import { StyledSwiper as Y } from "./Swiper.mjs";
|
|
@@ -37,7 +37,7 @@ const E = "calc(100vw - 2 * 2rem);", W = "calc(100vw - 2 * 1rem);", M = "calc(10
|
|
|
37
37
|
width: 100%;
|
|
38
38
|
height: 100%;
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
40
|
+
`, j = a.divBox`
|
|
41
41
|
transition: margin-top 250ms ease-in-out;
|
|
42
42
|
|
|
43
43
|
> img,
|
|
@@ -70,20 +70,20 @@ const E = "calc(100vw - 2 * 2rem);", W = "calc(100vw - 2 * 1rem);", M = "calc(10
|
|
|
70
70
|
${N};
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
${
|
|
73
|
+
${j} {
|
|
74
74
|
margin-top: xl;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
&[data-enter] {
|
|
78
78
|
opacity: 1;
|
|
79
79
|
|
|
80
|
-
${
|
|
80
|
+
${j} {
|
|
81
81
|
margin-top: 0;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
`, z = a(x).attrs({ lines: 2, variant: "h4" })`
|
|
85
85
|
margin: 0;
|
|
86
|
-
`,
|
|
86
|
+
`, v = "4rem", b = "6rem", nt = a.divBox`
|
|
87
87
|
display: flex;
|
|
88
88
|
flex-direction: column;
|
|
89
89
|
border-radius: xxl;
|
|
@@ -92,23 +92,23 @@ const E = "calc(100vw - 2 * 2rem);", W = "calc(100vw - 2 * 1rem);", M = "calc(10
|
|
|
92
92
|
> img {
|
|
93
93
|
width: auto;
|
|
94
94
|
max-width: fit-content;
|
|
95
|
-
max-height: calc(100vh - 2 * 5rem - ${
|
|
95
|
+
max-height: calc(100vh - 2 * 5rem - ${v});
|
|
96
96
|
flex-shrink: 0;
|
|
97
97
|
|
|
98
98
|
@media (min-width: md) {
|
|
99
|
-
max-height: calc(100vh - 2 * 5rem - ${
|
|
99
|
+
max-height: calc(100vh - 2 * 5rem - ${b});
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
${T} {
|
|
104
104
|
background-color: neutral-90;
|
|
105
|
-
max-height: calc(100vh - 2 * 5rem - ${
|
|
105
|
+
max-height: calc(100vh - 2 * 5rem - ${v});
|
|
106
106
|
|
|
107
107
|
@media (min-width: md) {
|
|
108
|
-
max-height: calc(100vh - 2 * 5rem - ${
|
|
108
|
+
max-height: calc(100vh - 2 * 5rem - ${b});
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
`, at =
|
|
111
|
+
`, at = c(
|
|
112
112
|
({ children: t, customContent: e, subtitle: r, title: s }, d) => /* @__PURE__ */ o.jsxs(nt, { ref: d, children: [
|
|
113
113
|
t,
|
|
114
114
|
/* @__PURE__ */ o.jsxs(
|
|
@@ -119,7 +119,7 @@ const E = "calc(100vw - 2 * 2rem);", W = "calc(100vw - 2 * 1rem);", M = "calc(10
|
|
|
119
119
|
flexDirection: "column",
|
|
120
120
|
flexShrink: 0,
|
|
121
121
|
gap: "xxs",
|
|
122
|
-
h: { _:
|
|
122
|
+
h: { _: v, md: b },
|
|
123
123
|
justifyContent: "center",
|
|
124
124
|
px: { _: "md", md: "xl" },
|
|
125
125
|
w: "100%",
|
|
@@ -190,13 +190,13 @@ const E = "calc(100vw - 2 * 2rem);", W = "calc(100vw - 2 * 1rem);", M = "calc(10
|
|
|
190
190
|
`
|
|
191
191
|
), dt = a.sectionBox`
|
|
192
192
|
${l("modals.body")};
|
|
193
|
-
`,
|
|
193
|
+
`, ct = a.headerBox`
|
|
194
194
|
position: sticky;
|
|
195
195
|
top: 0;
|
|
196
196
|
flex-shrink: 0;
|
|
197
197
|
z-index: 1;
|
|
198
198
|
${l("modals.header")};
|
|
199
|
-
`,
|
|
199
|
+
`, mt = a(x)`
|
|
200
200
|
${l(".modals.header.subtitle")};
|
|
201
201
|
margin-bottom: 0;
|
|
202
202
|
`, ut = a.footerBox`
|
|
@@ -224,7 +224,7 @@ const E = "calc(100vw - 2 * 2rem);", W = "calc(100vw - 2 * 1rem);", M = "calc(10
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
${K}
|
|
227
|
-
`, _ =
|
|
227
|
+
`, _ = c(
|
|
228
228
|
({ hideOnInteractOutside: t, ...e }, r) => /* @__PURE__ */ o.jsx(
|
|
229
229
|
I,
|
|
230
230
|
{
|
|
@@ -245,11 +245,11 @@ _.displayName = "Backdrop";
|
|
|
245
245
|
const ft = ({ children: t }) => /* @__PURE__ */ o.jsx(T, { children: /* @__PURE__ */ o.jsx($, { h: "100%", margin: "0 auto", style: { aspectRatio: 16 / 9 }, children: t }) }), gt = Object.assign(st, {
|
|
246
246
|
AssetWithTitle: at,
|
|
247
247
|
Backdrop: _,
|
|
248
|
-
Content:
|
|
248
|
+
Content: j,
|
|
249
249
|
Iframe: ft,
|
|
250
250
|
Title: z
|
|
251
251
|
}), A = ({ isOnHeader: t, ...e }) => {
|
|
252
|
-
const r =
|
|
252
|
+
const r = w();
|
|
253
253
|
return /* @__PURE__ */ o.jsx(
|
|
254
254
|
S,
|
|
255
255
|
{
|
|
@@ -266,11 +266,11 @@ const ft = ({ children: t }) => /* @__PURE__ */ o.jsx(T, { children: /* @__PURE_
|
|
|
266
266
|
)
|
|
267
267
|
}
|
|
268
268
|
);
|
|
269
|
-
}, O =
|
|
269
|
+
}, O = c(
|
|
270
270
|
({ children: t, store: e, withClosingButton: r = !0, ...s }, d) => {
|
|
271
|
-
const { borderWidths: u, space:
|
|
272
|
-
() =>
|
|
273
|
-
if (
|
|
271
|
+
const { borderWidths: u, space: m } = w(), [y, p] = L(!1), f = e.useState("contentElement"), B = e.useState("open"), i = Q(
|
|
272
|
+
() => D.map(t, (n) => {
|
|
273
|
+
if (F.isValidElement(n)) {
|
|
274
274
|
const g = n.type;
|
|
275
275
|
return g.displayName ?? g.name ?? "";
|
|
276
276
|
}
|
|
@@ -279,32 +279,32 @@ const ft = ({ children: t }) => /* @__PURE__ */ o.jsx(T, { children: /* @__PURE_
|
|
|
279
279
|
[t]
|
|
280
280
|
), q = !(i != null && i.includes("Header")) && r, G = (n) => n === "Header" ? {
|
|
281
281
|
// if the Modal have a Body but not a Footer || have a Footer but not a Body
|
|
282
|
-
pb: i != null && i.includes("Body") && !i.includes("Footer") || i != null && i.includes("Footer") && !i.includes("Body") ?
|
|
282
|
+
pb: i != null && i.includes("Body") && !i.includes("Footer") || i != null && i.includes("Footer") && !i.includes("Body") ? m.lg : m.xxl
|
|
283
283
|
} : n === "Body" ? {
|
|
284
|
-
pb: i != null && i.includes("Footer") ?
|
|
285
|
-
pr: i != null && i.includes("Header") ?
|
|
284
|
+
pb: i != null && i.includes("Footer") ? m.lg : null,
|
|
285
|
+
pr: i != null && i.includes("Header") ? m.xxl : null
|
|
286
286
|
} : n === "Footer" ? {
|
|
287
287
|
borderWidth: y ? u.sm : "0",
|
|
288
|
-
pt: i != null && i.includes("Header") || i != null && i.includes("Body") ? null :
|
|
288
|
+
pt: i != null && i.includes("Header") || i != null && i.includes("Body") ? null : m.lg
|
|
289
289
|
} : {};
|
|
290
290
|
return U(() => {
|
|
291
|
-
|
|
292
|
-
}, [e,
|
|
291
|
+
B ? f && p(f.scrollHeight > f.offsetHeight) : p(!1);
|
|
292
|
+
}, [e, B, f]), /* @__PURE__ */ o.jsxs($, { ref: d, ...s, children: [
|
|
293
293
|
q ? /* @__PURE__ */ o.jsx(A, {}) : null,
|
|
294
|
-
|
|
295
|
-
var
|
|
294
|
+
D.map(t, (n) => {
|
|
295
|
+
var k, C;
|
|
296
296
|
if (!n) return null;
|
|
297
|
-
const g = ((
|
|
297
|
+
const g = ((k = n == null ? void 0 : n.type) == null ? void 0 : k.displayName) || ((C = n == null ? void 0 : n.type) == null ? void 0 : C.name);
|
|
298
298
|
return H(n, {
|
|
299
299
|
...G(g),
|
|
300
300
|
...n.props
|
|
301
301
|
});
|
|
302
302
|
})
|
|
303
|
-
] })
|
|
303
|
+
] });
|
|
304
304
|
}
|
|
305
305
|
);
|
|
306
306
|
O.displayName = "Content";
|
|
307
|
-
const R =
|
|
307
|
+
const R = c(({ children: t, information: e, ...r }, s) => /* @__PURE__ */ o.jsxs(ut, { ref: s, w: "100%", ...r, children: [
|
|
308
308
|
t && /* @__PURE__ */ o.jsx(xt, { children: t }),
|
|
309
309
|
e && /* @__PURE__ */ o.jsxs(ht, { children: [
|
|
310
310
|
/* @__PURE__ */ o.jsx(x, { color: "neutral-90", fontWeight: "bold", variant: "subtitle-sm", children: e.title }),
|
|
@@ -312,11 +312,11 @@ const R = m(({ children: t, information: e, ...r }, s) => /* @__PURE__ */ o.jsxs
|
|
|
312
312
|
] })
|
|
313
313
|
] }));
|
|
314
314
|
R.displayName = "Footer";
|
|
315
|
-
const V =
|
|
315
|
+
const V = c(({ icon: t, subtitle: e, title: r, ...s }, d) => /* @__PURE__ */ o.jsxs(ct, { ref: d, textAlign: t ? "center" : null, w: "100%", ...s, children: [
|
|
316
316
|
/* @__PURE__ */ o.jsx(A, { isOnHeader: !0 }),
|
|
317
317
|
t,
|
|
318
318
|
/* @__PURE__ */ o.jsx(x, { mb: e ? "lg" : 0, mt: t ? "xl" : 0, variant: "h4", children: r }),
|
|
319
|
-
e && /* @__PURE__ */ o.jsx(
|
|
319
|
+
e && /* @__PURE__ */ o.jsx(mt, { children: e })
|
|
320
320
|
] }));
|
|
321
321
|
V.displayName = "Header";
|
|
322
322
|
function zt(t) {
|
|
@@ -329,13 +329,13 @@ function zt(t) {
|
|
|
329
329
|
...s
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
|
-
const $t =
|
|
333
|
-
({ backdrop: t, hideOnInteractOutside: e, ...r }, s) => t === !0 ? /* @__PURE__ */ o.jsx(I, { hideOnInteractOutside: e, ref: s, ...r }) :
|
|
332
|
+
const $t = c(
|
|
333
|
+
({ backdrop: t, hideOnInteractOutside: e, ...r }, s) => t === !0 ? /* @__PURE__ */ o.jsx(I, { hideOnInteractOutside: e, ref: s, ...r }) : F.isValidElement(t) ? H(t, {
|
|
334
334
|
hideOnInteractOutside: e,
|
|
335
335
|
ref: s,
|
|
336
336
|
...r
|
|
337
337
|
}) : null
|
|
338
|
-
), yt =
|
|
338
|
+
), yt = c(
|
|
339
339
|
({
|
|
340
340
|
ariaLabel: t,
|
|
341
341
|
/** for render property */
|
|
@@ -344,7 +344,7 @@ const $t = m(
|
|
|
344
344
|
children: s,
|
|
345
345
|
hideOnInteractOutside: d = !0,
|
|
346
346
|
size: u = "lg",
|
|
347
|
-
store:
|
|
347
|
+
store: m,
|
|
348
348
|
...y
|
|
349
349
|
}, p) => /* @__PURE__ */ o.jsx(
|
|
350
350
|
ot,
|
|
@@ -354,17 +354,17 @@ const $t = m(
|
|
|
354
354
|
hideOnInteractOutside: d,
|
|
355
355
|
ref: p,
|
|
356
356
|
render: /* @__PURE__ */ o.jsx(e, { size: u }),
|
|
357
|
-
store:
|
|
357
|
+
store: m,
|
|
358
358
|
...y,
|
|
359
359
|
children: s
|
|
360
360
|
}
|
|
361
361
|
)
|
|
362
|
-
), P =
|
|
362
|
+
), P = c((t, e) => /* @__PURE__ */ o.jsx(dt, { ref: e, ...t }));
|
|
363
363
|
P.displayName = "Body";
|
|
364
364
|
const jt = (t) => {
|
|
365
|
-
const { modals: e } =
|
|
365
|
+
const { modals: e } = w();
|
|
366
366
|
return /* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx(X, { ...e.cover, ...t }) });
|
|
367
|
-
}, vt =
|
|
367
|
+
}, vt = c(({ as: t, store: e, ...r }, s) => /* @__PURE__ */ o.jsx(
|
|
368
368
|
it,
|
|
369
369
|
{
|
|
370
370
|
ref: s,
|