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.
Files changed (2) hide show
  1. package/dist/Drawer.mjs +99 -90
  2. 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 m } from "./System.mjs";
4
- import n, { th as s, css as d, useTheme as u } from "@xstyled/styled-components";
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 b } from "./Button.mjs";
6
+ import { Button as v } from "./Button.mjs";
7
7
  import "./Icon.mjs";
8
- import { A as $ } from "./index-QaLwIvZS.mjs";
9
- import { Text as p } from "./Text.mjs";
10
- import { CloseButton as D } from "./CloseButton.mjs";
11
- import { D as B } from "./SYRFVSLH-B6m278Vb.mjs";
12
- import { D as k, u as v } from "./JC64G2H7-afsomHuH.mjs";
13
- import { D as C } from "./AXB53BZF-XKOjjeWO.mjs";
14
- const I = n.divBox`
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
- `, S = n.divBox(
20
- ({ size: t }) => d`
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" && d`
30
+ ${t === "sm" && c`
32
31
  height: 32;
33
32
  width: 32;
34
33
  `}
35
34
  `
36
- ), T = m(
37
- ({ children: t, maxWidth: r = 820, store: o, ...i }, a) => {
38
- const c = u();
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
- G,
52
+ N,
41
53
  {
42
- ...i,
54
+ ...a,
43
55
  autoFocusOnShow: !1,
56
+ getPersistentElements: x,
44
57
  h: { _: "100%", md: "calc(100% - 3rem)" },
45
- hideOnInteractOutside: !0,
58
+ hideOnInteractOutside: b,
59
+ overflow: "hidden",
46
60
  placement: "bottom",
47
- ref: a,
48
- store: o,
61
+ ref: m,
62
+ store: i,
49
63
  style: {
50
- borderTopLeftRadius: c.radii.xxl,
51
- borderTopRightRadius: c.radii.xxl
64
+ borderTopLeftRadius: u.radii.xxl,
65
+ borderTopRightRadius: u.radii.xxl
52
66
  },
53
67
  withBackdrop: !0,
54
- withCloseButton: !0,
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
- ), F = ({
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
- mt: "-md",
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(b, { onClick: o, shape: "circle", size: "lg", variant: "ghost", children: /* @__PURE__ */ e.jsx($, {}) }),
83
- !!r && /* @__PURE__ */ e.jsx(O, { icon: r }),
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(p, { pr: "xl", variant: "h3", children: a }),
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
- ), O = ({ icon: t, size: r = "md" }) => /* @__PURE__ */ e.jsx(S, { size: r, children: /* @__PURE__ */ e.jsx(t, { color: "neutral-90", size: r }) }), R = (t) => {
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
- }, x = ["sm", "md", "lg"], _ = (t, r) => {
135
+ }, f = ["sm", "md", "lg"], Y = (t, r) => {
124
136
  switch (r) {
125
137
  case "bottom":
126
138
  case "top":
127
- return x.includes(t) ? s(`drawers.sizes.vertical.${t}`) : {
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 x.includes(t) ? s(`drawers.sizes.horizontal.${t}`) : {
144
+ return f.includes(t) ? s(`drawers.sizes.horizontal.${t}`) : {
133
145
  width: t
134
146
  };
135
147
  }
136
- }, A = n.divBox(
137
- ({ placement: t, size: r }) => d`
148
+ }, L = n.divBox(
149
+ ({ placement: t, size: r }) => c`
138
150
  ${s("cards.default")};
139
151
  ${s("drawers.default")};
140
- ${R(t)}
141
- ${_(r, t)}
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
- ), f = n.divBox.withConfig({
167
+ ), w = n.divBox.withConfig({
156
168
  shouldForwardProp: (t) => !["hideOnInteractOutside"].includes(t)
157
169
  })(
158
- ({ hideOnInteractOutside: t }) => d`
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 && d`
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
- ), Y = n.divBox`
188
+ ), W = n.divBox`
177
189
  ${s("drawers.title")};
178
- `, E = n.divBox`
190
+ `, X = n.divBox`
179
191
  ${s("drawers.content")};
180
- `, L = n(D)`
192
+ `, q = n(C)`
181
193
  ${s("drawers.closeButton")};
182
- `, P = n.divBox`
194
+ `, z = n.divBox`
183
195
  ${s("drawers.footer")};
184
- `, h = ({ zIndex: t = "2", ...r }) => {
185
- const o = u();
186
- return /* @__PURE__ */ e.jsx(l, { h: "0", children: /* @__PURE__ */ e.jsx(
187
- B,
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
- L,
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
- }, X = m((t, r) => /* @__PURE__ */ e.jsx(E, { flex: "1", overflowY: { md: "auto" }, ref: r, ...t })), z = m((t, r) => /* @__PURE__ */ e.jsx(
203
- P,
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
- )), H = ({ children: t, zIndex: r = "1", ...o }) => /* @__PURE__ */ e.jsx(
212
- Y,
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(p, { m: "0", variant: "h3", w: "100%", children: t })
231
+ children: /* @__PURE__ */ e.jsx(g, { m: "0", variant: "h3", w: "100%", children: t })
223
232
  }
224
- ), Z = m(
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: c = !1,
232
- withCloseButton: w = !0,
233
- ...j
234
- }, y) => /* @__PURE__ */ e.jsx(
235
- k,
240
+ withBackdrop: m = !1,
241
+ withCloseButton: u = !0,
242
+ ...x
243
+ }, p) => /* @__PURE__ */ e.jsx(
244
+ O,
236
245
  {
237
- backdrop: c ? /* @__PURE__ */ e.jsx(f, { hideOnInteractOutside: r }) : !1,
246
+ backdrop: m ? /* @__PURE__ */ e.jsx(w, { hideOnInteractOutside: r }) : !1,
238
247
  hideOnInteractOutside: r,
239
- modal: c,
240
- ref: y,
241
- render: /* @__PURE__ */ e.jsx(A, { placement: o, size: i }),
248
+ modal: m,
249
+ ref: p,
250
+ render: /* @__PURE__ */ e.jsx(L, { placement: o, size: i }),
242
251
  store: a,
243
- ...j,
252
+ ...x,
244
253
  children: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
245
- w ? /* @__PURE__ */ e.jsx(h, {}) : null,
254
+ u ? /* @__PURE__ */ e.jsx(j, {}) : null,
246
255
  t
247
256
  ] })
248
257
  }
249
258
  )
250
259
  );
251
- function st(t = {}) {
252
- return v({ animated: !0, ...t });
260
+ function ct(t = {}) {
261
+ return S({ animated: !0, ...t });
253
262
  }
254
- const q = ({
263
+ const M = ({
255
264
  hideOnInteractOutside: t = !0,
256
265
  ...r
257
- }) => /* @__PURE__ */ e.jsx(f, { hideOnInteractOutside: t, ...r }), g = m(({ as: t, store: r, ...o }, i) => /* @__PURE__ */ e.jsx(
258
- C,
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
- )), G = Object.assign(Z, {
266
- Backdrop: q,
267
- Close: h,
268
- Content: X,
269
- Footer: z,
270
- Title: H,
271
- Trigger: g
272
- }), nt = Object.assign(T, { Header: F, Trigger: g });
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
- nt as AssetDrawer,
275
- G as Drawer,
276
- q as DrawerBackdrop,
277
- g as Trigger,
278
- st as useDrawer
283
+ dt as AssetDrawer,
284
+ N as Drawer,
285
+ M as DrawerBackdrop,
286
+ y as Trigger,
287
+ ct as useDrawer
279
288
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "8.2.0-alpha.0",
3
+ "version": "8.2.0",
4
4
  "description": "Customizable design system with react • styled-components • styled-system and ariakit.",
5
5
  "files": [
6
6
  "dist"