welcome-ui 8.1.0-alpha.0 → 8.1.0-alpha.1

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 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 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";
3
+ import a, { css as h, th as l, up as J, system as K, useTheme as B } from "@xstyled/styled-components";
4
+ import j, { useState as L, useMemo as Q, Children as F, useEffect as U, cloneElement as H } from "react";
5
5
  import { Shape as X } from "./Shape.mjs";
6
- import { forwardRef as c } from "./System.mjs";
6
+ import { forwardRef as m } 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
- `, j = a.divBox`
40
+ `, v = 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
- ${j} {
73
+ ${v} {
74
74
  margin-top: xl;
75
75
  }
76
76
 
77
77
  &[data-enter] {
78
78
  opacity: 1;
79
79
 
80
- ${j} {
80
+ ${v} {
81
81
  margin-top: 0;
82
82
  }
83
83
  }
84
84
  `, z = a(x).attrs({ lines: 2, variant: "h4" })`
85
85
  margin: 0;
86
- `, v = "4rem", b = "6rem", nt = a.divBox`
86
+ `, b = "4rem", w = "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 - ${v});
95
+ max-height: calc(100vh - 2 * 5rem - ${b});
96
96
  flex-shrink: 0;
97
97
 
98
98
  @media (min-width: md) {
99
- max-height: calc(100vh - 2 * 5rem - ${b});
99
+ max-height: calc(100vh - 2 * 5rem - ${w});
100
100
  }
101
101
  }
102
102
 
103
103
  ${T} {
104
104
  background-color: neutral-90;
105
- max-height: calc(100vh - 2 * 5rem - ${v});
105
+ max-height: calc(100vh - 2 * 5rem - ${b});
106
106
 
107
107
  @media (min-width: md) {
108
- max-height: calc(100vh - 2 * 5rem - ${b});
108
+ max-height: calc(100vh - 2 * 5rem - ${w});
109
109
  }
110
110
  }
111
- `, at = c(
111
+ `, at = m(
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: { _: v, md: b },
122
+ h: { _: b, md: w },
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
- `, ct = a.headerBox`
193
+ `, mt = 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
- `, mt = a(x)`
199
+ `, ct = 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
- `, _ = c(
227
+ `, _ = m(
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: j,
248
+ Content: v,
249
249
  Iframe: ft,
250
250
  Title: z
251
251
  }), A = ({ isOnHeader: t, ...e }) => {
252
- const r = w();
252
+ const r = B();
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 = c(
269
+ }, O = m(
270
270
  ({ children: t, store: e, withClosingButton: r = !0, ...s }, d) => {
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)) {
271
+ const { borderWidths: u, space: c } = B(), [y, p] = L(!1), f = e.useState("contentElement"), k = e.useState("open"), i = Q(
272
+ () => F.map(t, (n) => {
273
+ if (j.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") ? m.lg : m.xxl
282
+ pb: i != null && i.includes("Body") && !i.includes("Footer") || i != null && i.includes("Footer") && !i.includes("Body") ? c.lg : c.xxl
283
283
  } : n === "Body" ? {
284
- pb: i != null && i.includes("Footer") ? m.lg : null,
285
- pr: i != null && i.includes("Header") ? m.xxl : null
284
+ pb: i != null && i.includes("Footer") ? c.lg : null,
285
+ pr: i != null && i.includes("Header") ? c.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 : m.lg
288
+ pt: i != null && i.includes("Header") || i != null && i.includes("Body") ? null : c.lg
289
289
  } : {};
290
290
  return U(() => {
291
- B ? f && p(f.scrollHeight > f.offsetHeight) : p(!1);
292
- }, [e, B, f]), /* @__PURE__ */ o.jsxs($, { ref: d, ...s, children: [
291
+ k ? f && p(f.scrollHeight > f.offsetHeight) : p(!1);
292
+ }, [e, k, f]), j.isValidElement(t) ? /* @__PURE__ */ o.jsxs($, { ref: d, ...s, children: [
293
293
  q ? /* @__PURE__ */ o.jsx(A, {}) : null,
294
- D.map(t, (n) => {
295
- var k, C;
294
+ F.map(t, (n) => {
295
+ var C, D;
296
296
  if (!n) return null;
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);
297
+ const g = ((C = n == null ? void 0 : n.type) == null ? void 0 : C.displayName) || ((D = n == null ? void 0 : n.type) == null ? void 0 : D.name);
298
298
  return H(n, {
299
299
  ...G(g),
300
300
  ...n.props
301
301
  });
302
302
  })
303
- ] });
303
+ ] }) : null;
304
304
  }
305
305
  );
306
306
  O.displayName = "Content";
307
- const R = c(({ children: t, information: e, ...r }, s) => /* @__PURE__ */ o.jsxs(ut, { ref: s, w: "100%", ...r, children: [
307
+ const R = m(({ 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 = c(({ children: t, information: e, ...r }, s) => /* @__PURE__ */ o.jsxs
312
312
  ] })
313
313
  ] }));
314
314
  R.displayName = "Footer";
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: [
315
+ const V = m(({ icon: t, subtitle: e, title: r, ...s }, d) => /* @__PURE__ */ o.jsxs(mt, { 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(mt, { children: e })
319
+ e && /* @__PURE__ */ o.jsx(ct, { 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 = c(
333
- ({ backdrop: t, hideOnInteractOutside: e, ...r }, s) => t === !0 ? /* @__PURE__ */ o.jsx(I, { hideOnInteractOutside: e, ref: s, ...r }) : F.isValidElement(t) ? H(t, {
332
+ const $t = m(
333
+ ({ backdrop: t, hideOnInteractOutside: e, ...r }, s) => t === !0 ? /* @__PURE__ */ o.jsx(I, { hideOnInteractOutside: e, ref: s, ...r }) : j.isValidElement(t) ? H(t, {
334
334
  hideOnInteractOutside: e,
335
335
  ref: s,
336
336
  ...r
337
337
  }) : null
338
- ), yt = c(
338
+ ), yt = m(
339
339
  ({
340
340
  ariaLabel: t,
341
341
  /** for render property */
@@ -344,7 +344,7 @@ const $t = c(
344
344
  children: s,
345
345
  hideOnInteractOutside: d = !0,
346
346
  size: u = "lg",
347
- store: m,
347
+ store: c,
348
348
  ...y
349
349
  }, p) => /* @__PURE__ */ o.jsx(
350
350
  ot,
@@ -354,17 +354,17 @@ const $t = c(
354
354
  hideOnInteractOutside: d,
355
355
  ref: p,
356
356
  render: /* @__PURE__ */ o.jsx(e, { size: u }),
357
- store: m,
357
+ store: c,
358
358
  ...y,
359
359
  children: s
360
360
  }
361
361
  )
362
- ), P = c((t, e) => /* @__PURE__ */ o.jsx(dt, { ref: e, ...t }));
362
+ ), P = m((t, e) => /* @__PURE__ */ o.jsx(dt, { ref: e, ...t }));
363
363
  P.displayName = "Body";
364
364
  const jt = (t) => {
365
- const { modals: e } = w();
365
+ const { modals: e } = B();
366
366
  return /* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx(X, { ...e.cover, ...t }) });
367
- }, vt = c(({ as: t, store: e, ...r }, s) => /* @__PURE__ */ o.jsx(
367
+ }, vt = m(({ as: t, store: e, ...r }, s) => /* @__PURE__ */ o.jsx(
368
368
  it,
369
369
  {
370
370
  ref: s,
@@ -1,7 +1,6 @@
1
1
  import { CreateWuiProps } from '../System';
2
2
  import { UseModal } from '.';
3
3
  export type ContentOptions = {
4
- children: JSX.Element | JSX.Element[];
5
4
  store: UseModal;
6
5
  /**
7
6
  * show or hide the closing button
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "8.1.0-alpha.0",
3
+ "version": "8.1.0-alpha.1",
4
4
  "description": "Customizable design system with react • styled-components • styled-system and ariakit.",
5
5
  "files": [
6
6
  "dist"