welcome-ui 9.0.9 → 9.0.11

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/Alert.js CHANGED
@@ -1,12 +1,13 @@
1
1
  "use client";
2
- import { jsxs as q, jsx as c } from "react/jsx-runtime";
3
- import C, { forwardRef as l, Children as d, cloneElement as _ } from "react";
4
- import { Button as y } from "./Button.js";
5
- import { CloseButton as I } from "./CloseButton.js";
6
- import { Text as b } from "./Text.js";
2
+ import { jsxs as v, jsx as r } from "react/jsx-runtime";
3
+ import C, { forwardRef as I, Children as q, cloneElement as _ } from "react";
4
+ import { Button as d } from "./Button.js";
5
+ import { CloseButton as R } from "./CloseButton.js";
6
+ import { Text as w } from "./Text.js";
7
7
  import { VariantIcon as S } from "./VariantIcon.js";
8
8
  import { c as T } from "./index-PAaZGbyz.js";
9
- const V = "_root_1c0qe_2", $ = "_icon_1c0qe_55", E = "_content_1c0qe_58", R = "_title_1c0qe_88", O = {
9
+ import { f as y } from "./forwardRefWithAs-8eP3ZN15.js";
10
+ const V = "_root_1c0qe_2", $ = "_icon_1c0qe_55", E = "_content_1c0qe_58", O = "_title_1c0qe_88", W = {
10
11
  root: V,
11
12
  "size-sm": "_size-sm_1c0qe_16",
12
13
  "size-md": "_size-md_1c0qe_19",
@@ -22,80 +23,80 @@ const V = "_root_1c0qe_2", $ = "_icon_1c0qe_55", E = "_content_1c0qe_58", R = "_
22
23
  "content-text": "_content-text_1c0qe_76",
23
24
  "content-actions": "_content-actions_1c0qe_79",
24
25
  "variant-icon": "_variant-icon_1c0qe_84",
25
- title: R,
26
+ title: O,
26
27
  "title-size-sm": "_title-size-sm_1c0qe_93",
27
28
  "title-size-md": "_title-size-md_1c0qe_96",
28
29
  "title-close-button": "_title-close-button_1c0qe_99",
29
30
  "close-button": "_close-button_1c0qe_103"
30
- }, i = T(O), D = l(
31
- ({ children: n, className: o, cta: e, handleClose: s, hideIcon: g, isFullWidth: A, size: r = "sm", variant: a, ...B }, z) => {
32
- const h = a === "beige" ? void 0 : a, m = a === "ai", u = !g, j = d.toArray(n).map((t) => t.type === x ? _(t, { hasCloseButton: !!s, variant: r }) : t), f = (t) => {
33
- var v;
31
+ }, i = T(W), D = I(
32
+ ({ children: n, className: o, cta: e, handleClose: c, hideIcon: A, isFullWidth: g, size: s = "sm", variant: a, ...B }, z) => {
33
+ const h = a === "beige" ? void 0 : a, l = a === "ai", m = !A, j = q.toArray(n).map((t) => t.type === x ? _(t, { hasCloseButton: !!c, variant: s }) : t), u = (t) => {
34
+ var p;
34
35
  if (t) {
35
- if (t.type === w)
36
+ if (t.type === b)
36
37
  return _(t, {
37
- size: r,
38
- variant: m ? "primary-ai" : void 0
38
+ size: s,
39
+ variant: l ? "primary-ai" : void 0
39
40
  });
40
41
  if (t.type === N)
41
42
  return _(t, {
42
- size: r,
43
- variant: m ? "tertiary-ai" : void 0
43
+ size: s,
44
+ variant: l ? "tertiary-ai" : void 0
44
45
  });
45
- if ((v = t.props) != null && v.children)
46
+ if ((p = t.props) != null && p.children)
46
47
  return _(t, {
47
48
  ...t.props,
48
- children: d.map(
49
+ children: q.map(
49
50
  t.props.children,
50
- (k) => f(k)
51
+ (k) => u(k)
51
52
  )
52
53
  });
53
54
  }
54
55
  return t;
55
- }, p = C.isValidElement(e) ? f(e) : e;
56
- return /* @__PURE__ */ q(
56
+ }, f = C.isValidElement(e) ? u(e) : e;
57
+ return /* @__PURE__ */ v(
57
58
  "div",
58
59
  {
59
60
  className: i(
60
61
  "root",
61
- A && "full-width",
62
- r && `size-${r}`,
62
+ g && "full-width",
63
+ s && `size-${s}`,
63
64
  a && `variant-${a}`,
64
- u && "icon",
65
+ m && "icon",
65
66
  o
66
67
  ),
67
68
  ref: z,
68
69
  ...B,
69
70
  children: [
70
- !!s && /* @__PURE__ */ c(I, { className: i("close-button"), onClick: s, size: "xs" }),
71
- u ? /* @__PURE__ */ c(S, { className: i("variant-icon"), size: r, variant: h }) : null,
72
- /* @__PURE__ */ q("div", { className: i("content"), children: [
73
- /* @__PURE__ */ c(b, { as: "div", className: i("content-text"), children: j }),
74
- !!p && /* @__PURE__ */ c("div", { className: i("content-actions"), children: p })
71
+ !!c && /* @__PURE__ */ r(R, { className: i("close-button"), onClick: c, size: "xs" }),
72
+ m ? /* @__PURE__ */ r(S, { className: i("variant-icon"), size: s, variant: h }) : null,
73
+ /* @__PURE__ */ v("div", { className: i("content"), children: [
74
+ /* @__PURE__ */ r(w, { as: "div", className: i("content-text"), children: j }),
75
+ !!f && /* @__PURE__ */ r("div", { className: i("content-actions"), children: f })
75
76
  ] })
76
77
  ]
77
78
  }
78
79
  );
79
80
  }
80
- ), w = l(
81
- ({ variant: n = "secondary", ...o }, e) => /* @__PURE__ */ c(y, { className: "shrink-0 w-fit", ref: e, ...o, variant: n })
82
- ), N = l(
83
- ({ variant: n = "tertiary", ...o }, e) => /* @__PURE__ */ c(y, { className: "shrink-0 w-fit", ref: e, ...o, variant: n })
84
- ), x = ({ children: n, hasCloseButton: o, variant: e, ...s }) => /* @__PURE__ */ c(
85
- b,
81
+ ), b = y(
82
+ ({ variant: n = "secondary", ...o }, e) => /* @__PURE__ */ r(d, { className: "shrink-0 w-fit", ref: e, ...o, variant: n })
83
+ ), N = y(
84
+ ({ variant: n = "tertiary", ...o }, e) => /* @__PURE__ */ r(d, { className: "shrink-0 w-fit", ref: e, ...o, variant: n })
85
+ ), x = ({ children: n, hasCloseButton: o, variant: e, ...c }) => /* @__PURE__ */ r(
86
+ w,
86
87
  {
87
88
  as: "span",
88
89
  className: i("title", `title-size-${e}`, o && "title-close-button"),
89
90
  variant: e,
90
- ...s,
91
+ ...c,
91
92
  children: n
92
93
  }
93
- ), P = Object.assign(D, {
94
- Button: w,
94
+ ), Q = Object.assign(D, {
95
+ Button: b,
95
96
  SecondaryButton: N,
96
97
  Title: x
97
98
  });
98
99
  export {
99
- P as Alert,
100
+ Q as Alert,
100
101
  x as AlertTitle
101
102
  };
@@ -1,19 +1,20 @@
1
1
  "use client";
2
2
  import { jsxs as te, jsx as R } from "react/jsx-runtime";
3
- import { forwardRef as re, Children as pe, cloneElement as be, useRef as M, useState as V, useCallback as X, useMemo as ge, useEffect as q } from "react";
3
+ import { forwardRef as he, Children as pe, cloneElement as be, useRef as A, useState as V, useCallback as X, useMemo as ge, useEffect as q } from "react";
4
4
  import "./Icon-BisRi8B3.js";
5
5
  import { R as me } from "./index-Dcq5gh3E.js";
6
- import { c as ne } from "./index-PAaZGbyz.js";
6
+ import { c as re } from "./index-PAaZGbyz.js";
7
7
  import { t as xe } from "./throttle-BDBzFeFj.js";
8
- var b = [], ze = function() {
8
+ import { f as ze } from "./forwardRefWithAs-8eP3ZN15.js";
9
+ var b = [], Re = function() {
9
10
  return b.some(function(e) {
10
11
  return e.activeTargets.length > 0;
11
12
  });
12
- }, Re = function() {
13
+ }, we = function() {
13
14
  return b.some(function(e) {
14
15
  return e.skippedTargets.length > 0;
15
16
  });
16
- }, $ = "ResizeObserver loop completed with undelivered notifications.", we = function() {
17
+ }, $ = "ResizeObserver loop completed with undelivered notifications.", Oe = function() {
17
18
  var e;
18
19
  typeof ErrorEvent == "function" ? e = new ErrorEvent("error", {
19
20
  message: $
@@ -24,24 +25,24 @@ var b = [], ze = function() {
24
25
  })(y || (y = {}));
25
26
  var g = function(e) {
26
27
  return Object.freeze(e);
27
- }, Oe = /* @__PURE__ */ function() {
28
+ }, Ee = /* @__PURE__ */ function() {
28
29
  function e(t, r) {
29
30
  this.inlineSize = t, this.blockSize = r, g(this);
30
31
  }
31
32
  return e;
32
- }(), ie = function() {
33
+ }(), ne = function() {
33
34
  function e(t, r, n, i) {
34
35
  return this.x = t, this.y = r, this.width = n, this.height = i, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, g(this);
35
36
  }
36
37
  return e.prototype.toJSON = function() {
37
- var t = this, r = t.x, n = t.y, i = t.top, o = t.right, s = t.bottom, l = t.left, c = t.width, v = t.height;
38
- return { x: r, y: n, top: i, right: o, bottom: s, left: l, width: c, height: v };
38
+ var t = this, r = t.x, n = t.y, i = t.top, o = t.right, s = t.bottom, c = t.left, v = t.width, u = t.height;
39
+ return { x: r, y: n, top: i, right: o, bottom: s, left: c, width: v, height: u };
39
40
  }, e.fromRect = function(t) {
40
41
  return new e(t.x, t.y, t.width, t.height);
41
42
  }, e;
42
43
  }(), P = function(e) {
43
44
  return e instanceof SVGElement && "getBBox" in e;
44
- }, oe = function(e) {
45
+ }, ie = function(e) {
45
46
  if (P(e)) {
46
47
  var t = e.getBBox(), r = t.width, n = t.height;
47
48
  return !r && !n;
@@ -54,7 +55,7 @@ var g = function(e) {
54
55
  return !0;
55
56
  var r = (t = e == null ? void 0 : e.ownerDocument) === null || t === void 0 ? void 0 : t.defaultView;
56
57
  return !!(r && e instanceof r.Element);
57
- }, Ee = function(e) {
58
+ }, ye = function(e) {
58
59
  switch (e.tagName) {
59
60
  case "INPUT":
60
61
  if (e.type !== "image")
@@ -69,29 +70,29 @@ var g = function(e) {
69
70
  return !0;
70
71
  }
71
72
  return !1;
72
- }, E = typeof window < "u" ? window : {}, S = /* @__PURE__ */ new WeakMap(), U = /auto|scroll/, ye = /^tb|vertical/, Te = /msie|trident/i.test(E.navigator && E.navigator.userAgent), d = function(e) {
73
+ }, E = typeof window < "u" ? window : {}, S = /* @__PURE__ */ new WeakMap(), U = /auto|scroll/, Te = /^tb|vertical/, Be = /msie|trident/i.test(E.navigator && E.navigator.userAgent), d = function(e) {
73
74
  return parseFloat(e || "0");
74
75
  }, z = function(e, t, r) {
75
- return e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = !1), new Oe((r ? t : e) || 0, (r ? e : t) || 0);
76
+ return e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = !1), new Ee((r ? t : e) || 0, (r ? e : t) || 0);
76
77
  }, Y = g({
77
78
  devicePixelContentBoxSize: z(),
78
79
  borderBoxSize: z(),
79
80
  contentBoxSize: z(),
80
- contentRect: new ie(0, 0, 0, 0)
81
- }), se = function(e, t) {
81
+ contentRect: new ne(0, 0, 0, 0)
82
+ }), oe = function(e, t) {
82
83
  if (t === void 0 && (t = !1), S.has(e) && !t)
83
84
  return S.get(e);
84
- if (oe(e))
85
+ if (ie(e))
85
86
  return S.set(e, Y), Y;
86
- var r = getComputedStyle(e), n = P(e) && e.ownerSVGElement && e.getBBox(), i = !Te && r.boxSizing === "border-box", o = ye.test(r.writingMode || ""), s = !n && U.test(r.overflowY || ""), l = !n && U.test(r.overflowX || ""), c = n ? 0 : d(r.paddingTop), v = n ? 0 : d(r.paddingRight), h = n ? 0 : d(r.paddingBottom), f = n ? 0 : d(r.paddingLeft), w = n ? 0 : d(r.borderTopWidth), a = n ? 0 : d(r.borderRightWidth), u = n ? 0 : d(r.borderBottomWidth), m = n ? 0 : d(r.borderLeftWidth), p = f + v, x = c + h, O = m + a, D = w + u, G = l ? e.offsetHeight - D - e.clientHeight : 0, F = s ? e.offsetWidth - O - e.clientWidth : 0, le = i ? p + O : 0, de = i ? x + D : 0, T = n ? n.width : d(r.width) - le - F, B = n ? n.height : d(r.height) - de - G, fe = T + p + F + O, he = B + x + G + D, H = g({
87
+ var r = getComputedStyle(e), n = P(e) && e.ownerSVGElement && e.getBBox(), i = !Be && r.boxSizing === "border-box", o = Te.test(r.writingMode || ""), s = !n && U.test(r.overflowY || ""), c = !n && U.test(r.overflowX || ""), v = n ? 0 : d(r.paddingTop), u = n ? 0 : d(r.paddingRight), h = n ? 0 : d(r.paddingBottom), f = n ? 0 : d(r.paddingLeft), w = n ? 0 : d(r.borderTopWidth), a = n ? 0 : d(r.borderRightWidth), l = n ? 0 : d(r.borderBottomWidth), m = n ? 0 : d(r.borderLeftWidth), p = f + u, x = v + h, O = m + a, D = w + l, G = c ? e.offsetHeight - D - e.clientHeight : 0, F = s ? e.offsetWidth - O - e.clientWidth : 0, ue = i ? p + O : 0, le = i ? x + D : 0, T = n ? n.width : d(r.width) - ue - F, B = n ? n.height : d(r.height) - le - G, de = T + p + F + O, fe = B + x + G + D, H = g({
87
88
  devicePixelContentBoxSize: z(Math.round(T * devicePixelRatio), Math.round(B * devicePixelRatio), o),
88
- borderBoxSize: z(fe, he, o),
89
+ borderBoxSize: z(de, fe, o),
89
90
  contentBoxSize: z(T, B, o),
90
- contentRect: new ie(f, c, T, B)
91
+ contentRect: new ne(f, v, T, B)
91
92
  });
92
93
  return S.set(e, H), H;
93
- }, ae = function(e, t, r) {
94
- var n = se(e, r), i = n.borderBoxSize, o = n.contentBoxSize, s = n.devicePixelContentBoxSize;
94
+ }, se = function(e, t, r) {
95
+ var n = oe(e, r), i = n.borderBoxSize, o = n.contentBoxSize, s = n.devicePixelContentBoxSize;
95
96
  switch (t) {
96
97
  case y.DEVICE_PIXEL_CONTENT_BOX:
97
98
  return s;
@@ -100,28 +101,28 @@ var g = function(e) {
100
101
  default:
101
102
  return o;
102
103
  }
103
- }, Be = /* @__PURE__ */ function() {
104
+ }, Se = /* @__PURE__ */ function() {
104
105
  function e(t) {
105
- var r = se(t);
106
+ var r = oe(t);
106
107
  this.target = t, this.contentRect = r.contentRect, this.borderBoxSize = g([r.borderBoxSize]), this.contentBoxSize = g([r.contentBoxSize]), this.devicePixelContentBoxSize = g([r.devicePixelContentBoxSize]);
107
108
  }
108
109
  return e;
109
- }(), ce = function(e) {
110
- if (oe(e))
110
+ }(), ae = function(e) {
111
+ if (ie(e))
111
112
  return 1 / 0;
112
113
  for (var t = 0, r = e.parentNode; r; )
113
114
  t += 1, r = r.parentNode;
114
115
  return t;
115
- }, Se = function() {
116
+ }, _e = function() {
116
117
  var e = 1 / 0, t = [];
117
118
  b.forEach(function(s) {
118
119
  if (s.activeTargets.length !== 0) {
119
- var l = [];
120
- s.activeTargets.forEach(function(v) {
121
- var h = new Be(v.target), f = ce(v.target);
122
- l.push(h), v.lastReportedSize = ae(v.target, v.observedBox), f < e && (e = f);
120
+ var c = [];
121
+ s.activeTargets.forEach(function(u) {
122
+ var h = new Se(u.target), f = ae(u.target);
123
+ c.push(h), u.lastReportedSize = se(u.target, u.observedBox), f < e && (e = f);
123
124
  }), t.push(function() {
124
- s.callback.call(s.observer, l, s.observer);
125
+ s.callback.call(s.observer, c, s.observer);
125
126
  }), s.activeTargets.splice(0, s.activeTargets.length);
126
127
  }
127
128
  });
@@ -133,35 +134,35 @@ var g = function(e) {
133
134
  }, j = function(e) {
134
135
  b.forEach(function(r) {
135
136
  r.activeTargets.splice(0, r.activeTargets.length), r.skippedTargets.splice(0, r.skippedTargets.length), r.observationTargets.forEach(function(i) {
136
- i.isActive() && (ce(i.target) > e ? r.activeTargets.push(i) : r.skippedTargets.push(i));
137
+ i.isActive() && (ae(i.target) > e ? r.activeTargets.push(i) : r.skippedTargets.push(i));
137
138
  });
138
139
  });
139
- }, _e = function() {
140
+ }, Ce = function() {
140
141
  var e = 0;
141
- for (j(e); ze(); )
142
- e = Se(), j(e);
143
- return Re() && we(), e > 0;
144
- }, A, ve = [], Ce = function() {
145
- return ve.splice(0).forEach(function(e) {
142
+ for (j(e); Re(); )
143
+ e = _e(), j(e);
144
+ return we() && Oe(), e > 0;
145
+ }, M, ce = [], Ne = function() {
146
+ return ce.splice(0).forEach(function(e) {
146
147
  return e();
147
148
  });
148
- }, Ne = function(e) {
149
- if (!A) {
149
+ }, ke = function(e) {
150
+ if (!M) {
150
151
  var t = 0, r = document.createTextNode(""), n = { characterData: !0 };
151
152
  new MutationObserver(function() {
152
- return Ce();
153
- }).observe(r, n), A = function() {
153
+ return Ne();
154
+ }).observe(r, n), M = function() {
154
155
  r.textContent = "".concat(t ? t-- : t++);
155
156
  };
156
157
  }
157
- ve.push(e), A();
158
- }, ke = function(e) {
159
- Ne(function() {
158
+ ce.push(e), M();
159
+ }, De = function(e) {
160
+ ke(function() {
160
161
  requestAnimationFrame(e);
161
162
  });
162
- }, N = 0, De = function() {
163
+ }, N = 0, Ae = function() {
163
164
  return !!N;
164
- }, Me = 250, Ae = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, K = [
165
+ }, Me = 250, Ie = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, K = [
165
166
  "resize",
166
167
  "load",
167
168
  "transitionend",
@@ -178,7 +179,7 @@ var g = function(e) {
178
179
  "focus"
179
180
  ], Q = function(e) {
180
181
  return e === void 0 && (e = 0), Date.now() + e;
181
- }, I = !1, Ie = function() {
182
+ }, I = !1, Le = function() {
182
183
  function e() {
183
184
  var t = this;
184
185
  this.stopped = !0, this.listener = function() {
@@ -190,12 +191,12 @@ var g = function(e) {
190
191
  if (t === void 0 && (t = Me), !I) {
191
192
  I = !0;
192
193
  var n = Q(t);
193
- ke(function() {
194
+ De(function() {
194
195
  var i = !1;
195
196
  try {
196
- i = _e();
197
+ i = Ce();
197
198
  } finally {
198
- if (I = !1, t = n - Q(), !De())
199
+ if (I = !1, t = n - Q(), !Ae())
199
200
  return;
200
201
  i ? r.run(1e3) : t > 0 ? r.run(t) : r.start();
201
202
  }
@@ -205,7 +206,7 @@ var g = function(e) {
205
206
  this.stop(), this.run();
206
207
  }, e.prototype.observe = function() {
207
208
  var t = this, r = function() {
208
- return t.observer && t.observer.observe(document.body, Ae);
209
+ return t.observer && t.observer.observe(document.body, Ie);
209
210
  };
210
211
  document.body ? r() : E.addEventListener("DOMContentLoaded", r);
211
212
  }, e.prototype.start = function() {
@@ -219,11 +220,11 @@ var g = function(e) {
219
220
  return E.removeEventListener(r, t.listener, !0);
220
221
  }), this.stopped = !0);
221
222
  }, e;
222
- }(), W = new Ie(), Z = function(e) {
223
+ }(), W = new Le(), Z = function(e) {
223
224
  !N && e > 0 && W.start(), N += e, !N && W.stop();
224
- }, Le = function(e) {
225
- return !P(e) && !Ee(e) && getComputedStyle(e).display === "inline";
226
- }, We = function() {
225
+ }, We = function(e) {
226
+ return !P(e) && !ye(e) && getComputedStyle(e).display === "inline";
227
+ }, Pe = function() {
227
228
  function e(t, r) {
228
229
  this.target = t, this.observedBox = r || y.CONTENT_BOX, this.lastReportedSize = {
229
230
  inlineSize: 0,
@@ -231,10 +232,10 @@ var g = function(e) {
231
232
  };
232
233
  }
233
234
  return e.prototype.isActive = function() {
234
- var t = ae(this.target, this.observedBox, !0);
235
- return Le(this.target) && (this.lastReportedSize = t), this.lastReportedSize.inlineSize !== t.inlineSize || this.lastReportedSize.blockSize !== t.blockSize;
235
+ var t = se(this.target, this.observedBox, !0);
236
+ return We(this.target) && (this.lastReportedSize = t), this.lastReportedSize.inlineSize !== t.inlineSize || this.lastReportedSize.blockSize !== t.blockSize;
236
237
  }, e;
237
- }(), Pe = /* @__PURE__ */ function() {
238
+ }(), Ge = /* @__PURE__ */ function() {
238
239
  function e(t, r) {
239
240
  this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = t, this.callback = r;
240
241
  }
@@ -248,11 +249,11 @@ var g = function(e) {
248
249
  function e() {
249
250
  }
250
251
  return e.connect = function(t, r) {
251
- var n = new Pe(t, r);
252
+ var n = new Ge(t, r);
252
253
  _.set(t, n);
253
254
  }, e.observe = function(t, r, n) {
254
255
  var i = _.get(t), o = i.observationTargets.length === 0;
255
- ee(i.observationTargets, r) < 0 && (o && b.push(i), i.observationTargets.push(new We(r, n && n.box)), Z(1), W.schedule());
256
+ ee(i.observationTargets, r) < 0 && (o && b.push(i), i.observationTargets.push(new Pe(r, n && n.box)), Z(1), W.schedule());
256
257
  }, e.unobserve = function(t, r) {
257
258
  var n = _.get(t), i = ee(n.observationTargets, r), o = n.observationTargets.length === 1;
258
259
  i >= 0 && (o && b.splice(b.indexOf(n), 1), n.observationTargets.splice(i, 1), Z(-1));
@@ -262,7 +263,7 @@ var g = function(e) {
262
263
  return r.unobserve(t, i.target);
263
264
  }), n.activeTargets.splice(0, n.activeTargets.length);
264
265
  }, e;
265
- }(), Ge = function() {
266
+ }(), Fe = function() {
266
267
  function e(t) {
267
268
  if (arguments.length === 0)
268
269
  throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
@@ -288,63 +289,63 @@ var g = function(e) {
288
289
  return "function ResizeObserver () { [polyfill code] }";
289
290
  }, e;
290
291
  }();
291
- const Fe = (e, t, r) => Math.min(Math.max(e, t), r), He = "_root_ce14e_2", Ve = "_list_ce14e_14", ue = {
292
- root: He,
293
- list: Ve,
292
+ const He = (e, t, r) => Math.min(Math.max(e, t), r), Ve = "_root_ce14e_2", Xe = "_list_ce14e_14", ve = {
293
+ root: Ve,
294
+ list: Xe,
294
295
  "start-gradient": "_start-gradient_ce14e_24",
295
296
  "end-gradient": "_end-gradient_ce14e_28",
296
297
  "item-wrapper": "_item-wrapper_ce14e_39",
297
298
  "item-content": "_item-content_ce14e_44",
298
299
  "item-separator": "_item-separator_ce14e_58"
299
- }, L = ne(ue), Xe = re(
300
- ({ children: e, "data-testid": t, isActive: r, separator: n, ...i }, o) => {
301
- const s = i.href || i.to;
302
- return /* @__PURE__ */ te("li", { "aria-label": "breadcrumb", className: L("item-wrapper"), "data-testid": t, children: [
303
- n ? /* @__PURE__ */ R("span", { className: L("item-separator"), role: "presentation", children: n }) : null,
300
+ }, L = re(ve), qe = ze(
301
+ ({ as: e = "a", children: t, "data-testid": r, isActive: n, separator: i, ...o }, s) => {
302
+ const c = o.href || o.to;
303
+ return /* @__PURE__ */ te("li", { "aria-label": "breadcrumb", className: L("item-wrapper"), "data-testid": r, children: [
304
+ i ? /* @__PURE__ */ R("span", { className: L("item-separator"), role: "presentation", children: i }) : null,
304
305
  /* @__PURE__ */ R(
305
- "a",
306
+ e,
306
307
  {
307
- "aria-current": r ? "page" : void 0,
308
- "aria-disabled": !s,
309
- ...i,
310
- className: L("item-content", i.className),
311
- ref: o,
312
- children: e
308
+ "aria-current": n ? "page" : void 0,
309
+ "aria-disabled": !c,
310
+ ...o,
311
+ className: L("item-content", o.className),
312
+ ref: s,
313
+ children: t
313
314
  }
314
315
  )
315
316
  ] });
316
317
  }
317
- ), k = ne(ue), qe = re(
318
+ ), k = re(ve), $e = he(
318
319
  ({ children: e, lastChildNotClickable: t = !0, separator: r = /* @__PURE__ */ R(me, { size: "xs" }), ...n }, i) => {
319
- const o = pe.toArray(e).filter(Boolean), s = o.length, l = o.map((w, a) => {
320
- const u = s === 1 || s === a + 1;
320
+ const o = pe.toArray(e).filter(Boolean), s = o.length, c = o.map((w, a) => {
321
+ const l = s === 1 || s === a + 1;
321
322
  return be(w, {
322
- isActive: u && t,
323
+ isActive: l && t,
323
324
  key: `breadcrumb-${a}`,
324
- separator: u ? void 0 : r,
325
+ separator: l ? void 0 : r,
325
326
  ...w.props
326
327
  });
327
- }), { endGradient: c, listRef: v, onListScroll: h, startGradient: f } = $e();
328
+ }), { endGradient: v, listRef: u, onListScroll: h, startGradient: f } = Je();
328
329
  return /* @__PURE__ */ te("nav", { ref: i, ...n, className: k("root", n.className), children: [
329
330
  f,
330
- /* @__PURE__ */ R("ol", { className: k("list"), dir: "rtl", onScroll: h, ref: v, children: l.reverse() }),
331
- c
331
+ /* @__PURE__ */ R("ol", { className: k("list"), dir: "rtl", onScroll: h, ref: u, children: c.reverse() }),
332
+ v
332
333
  ] });
333
334
  }
334
- ), Ze = Object.assign(qe, {
335
- Item: Xe
336
- }), $e = () => {
337
- const e = M(null), t = M(), r = M(), [n, i] = V(!1), [o, s] = V(0), l = (a, u) => {
338
- a && (a.style.transform = `scale3d(${u}, 1, 1)`);
339
- }, c = X((a) => {
340
- const u = 1 - a;
341
- l(t.current, u), l(r.current, a);
342
- }, []), v = X(() => {
335
+ ), tt = Object.assign($e, {
336
+ Item: qe
337
+ }), Je = () => {
338
+ const e = A(null), t = A(), r = A(), [n, i] = V(!1), [o, s] = V(0), c = (a, l) => {
339
+ a && (a.style.transform = `scale3d(${l}, 1, 1)`);
340
+ }, v = X((a) => {
341
+ const l = 1 - a;
342
+ c(t.current, l), c(r.current, a);
343
+ }, []), u = X(() => {
343
344
  const {
344
- current: { offsetWidth: a, scrollLeft: u, scrollWidth: m }
345
- } = e, p = m - a, O = Fe(Math.abs(u - o), 0, p) / p;
346
- c(O);
347
- }, [o, c]), h = ge(
345
+ current: { offsetWidth: a, scrollLeft: l, scrollWidth: m }
346
+ } = e, p = m - a, O = He(Math.abs(l - o), 0, p) / p;
347
+ v(O);
348
+ }, [o, v]), h = ge(
348
349
  () => xe(
349
350
  (a) => {
350
351
  const [
@@ -352,9 +353,9 @@ const Fe = (e, t, r) => Math.min(Math.max(e, t), r), He = "_root_ce14e_2", Ve =
352
353
  // Is offsetWidth really needed ?
353
354
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
354
355
  // @ts-ignore
355
- target: { offsetWidth: u, scrollLeft: m, scrollWidth: p }
356
+ target: { offsetWidth: l, scrollLeft: m, scrollWidth: p }
356
357
  }
357
- ] = a, x = p - u;
358
+ ] = a, x = p - l;
358
359
  o || s(m === 0 ? 0 : x), i(x > 0);
359
360
  },
360
361
  300,
@@ -363,11 +364,11 @@ const Fe = (e, t, r) => Math.min(Math.max(e, t), r), He = "_root_ce14e_2", Ve =
363
364
  [o]
364
365
  );
365
366
  q(() => {
366
- const a = new Ge(h);
367
+ const a = new Fe(h);
367
368
  return a.observe(e.current), () => a.disconnect();
368
369
  }, []), q(() => {
369
- t.current && r.current && c(0);
370
- }, [n, c]);
370
+ t.current && r.current && v(0);
371
+ }, [n, v]);
371
372
  const f = n ? /* @__PURE__ */ R(
372
373
  "span",
373
374
  {
@@ -381,9 +382,9 @@ const Fe = (e, t, r) => Math.min(Math.max(e, t), r), He = "_root_ce14e_2", Ve =
381
382
  className: k("end-gradient", "bg-linear-to-l from-neutral-10 to-transparent"),
382
383
  ref: r
383
384
  }
384
- ) : null, listRef: e, onListScroll: v, startGradient: f };
385
+ ) : null, listRef: e, onListScroll: u, startGradient: f };
385
386
  };
386
387
  export {
387
- Ze as Breadcrumb,
388
- qe as BreadcrumbComponent
388
+ tt as Breadcrumb,
389
+ $e as BreadcrumbComponent
389
390
  };
package/dist/Card.js CHANGED
@@ -2,18 +2,19 @@
2
2
  import { jsx as c } from "react/jsx-runtime";
3
3
  import { forwardRef as n } from "react";
4
4
  import { c as d } from "./index-PAaZGbyz.js";
5
- const a = "_root_10ds1_2", m = "_body_10ds1_13", e = {
6
- root: a,
7
- body: m
8
- }, i = d(e), l = n(
9
- ({ children: o, className: r, ...s }, t) => /* @__PURE__ */ c("div", { className: i("body", r), ref: t, ...s, children: o })
10
- ), y = n(({ alt: o, src: r, ...s }, t) => /* @__PURE__ */ c("div", { ref: t, ...s, children: /* @__PURE__ */ c("img", { alt: o, src: r }) })), _ = d(e), b = n(
11
- ({ children: o, className: r, ...s }, t) => /* @__PURE__ */ c("div", { className: _("root", r), ref: t, ...s, children: o })
12
- ), v = Object.assign(b, {
13
- Body: l,
5
+ import { f as m } from "./forwardRefWithAs-8eP3ZN15.js";
6
+ const i = "_root_10ds1_2", f = "_body_10ds1_13", e = {
7
+ root: i,
8
+ body: f
9
+ }, l = d(e), p = n(
10
+ ({ children: o, className: r, ...s }, t) => /* @__PURE__ */ c("div", { className: l("body", r), ref: t, ...s, children: o })
11
+ ), y = n(({ alt: o, src: r, ...s }, t) => /* @__PURE__ */ c("div", { ref: t, ...s, children: /* @__PURE__ */ c("img", { alt: o, src: r }) })), _ = d(e), b = m(
12
+ ({ as: o = "div", children: r, className: s, ...t }, a) => /* @__PURE__ */ c(o, { className: _("root", s), ref: a, ...t, children: r })
13
+ ), N = Object.assign(b, {
14
+ Body: p,
14
15
  Cover: y
15
16
  });
16
17
  export {
17
- v as Card,
18
+ N as Card,
18
19
  b as CardComponent
19
20
  };
package/dist/Field.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as L } from "react/jsx-runtime";
2
+ import { jsxs as L, jsx as r } from "react/jsx-runtime";
3
3
  import { createContext as q, useMemo as w, useId as A, useContext as M } from "react";
4
4
  import { Hint as R } from "./Hint.js";
5
5
  import { Label as S } from "./Label.js";
@@ -62,7 +62,7 @@ const Q = W((e, d) => {
62
62
  }),
63
63
  [s, a, i, l, c, m, u]
64
64
  );
65
- return /* @__PURE__ */ r(p.Provider, { value: j, children: /* @__PURE__ */ L("div", { ref: d, ...H, className: o("root", N && "inline", I), children: [
65
+ return /* @__PURE__ */ L("div", { ref: d, ...H, className: o("root", N && "inline", I), children: [
66
66
  /* @__PURE__ */ r(
67
67
  S,
68
68
  {
@@ -76,9 +76,9 @@ const Q = W((e, d) => {
76
76
  children: F
77
77
  }
78
78
  ),
79
- /* @__PURE__ */ r("div", { className: o("input"), children: y }),
79
+ /* @__PURE__ */ r(p.Provider, { value: j, children: /* @__PURE__ */ r("div", { className: o("input"), children: y }) }),
80
80
  l ? /* @__PURE__ */ r(R, { className: o("hint"), id: s, variant: i, ...t, children: l }) : null
81
- ] }) });
81
+ ] });
82
82
  });
83
83
  Q.displayName = "Field";
84
84
  export {
@@ -3,7 +3,7 @@ import { ButtonProps } from '../Button/types';
3
3
  import { AlertProps, AlertTitleProps } from './types';
4
4
  export declare const AlertTitle: ({ children, hasCloseButton, variant, ...rest }: AlertTitleProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export declare const Alert: React.ForwardRefExoticComponent<Omit<AlertProps, "ref"> & React.RefAttributes<HTMLDivElement>> & {
6
- Button: React.ForwardRefExoticComponent<Omit<Omit<ButtonProps, "size">, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
- SecondaryButton: React.ForwardRefExoticComponent<Omit<Omit<ButtonProps, "size">, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
+ Button: import('../../utils').FunctionComponentWithAs<"button", Omit<ButtonProps, "size">>;
7
+ SecondaryButton: import('../../utils').FunctionComponentWithAs<"button", Omit<ButtonProps, "size">>;
8
8
  Title: ({ children, hasCloseButton, variant, ...rest }: AlertTitleProps) => import("react/jsx-runtime").JSX.Element;
9
9
  };
@@ -1,5 +1,5 @@
1
- import { BreadcrumbItemProps } from './types';
1
+ import { BreadcrumbItemOptions } from './types';
2
2
  /**
3
3
  * @name Breadcrumb.Item
4
4
  */
5
- export declare const Item: import('react').ForwardRefExoticComponent<Omit<BreadcrumbItemProps, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
5
+ export declare const Item: import('../../utils').FunctionComponentWithAs<"a", BreadcrumbItemOptions>;
@@ -2,5 +2,5 @@ import { default as React } from 'react';
2
2
  import { BreadcrumbProps } from './types';
3
3
  export declare const BreadcrumbComponent: React.ForwardRefExoticComponent<Omit<BreadcrumbProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
4
  export declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<BreadcrumbProps, "ref"> & React.RefAttributes<HTMLDivElement>> & {
5
- Item: React.ForwardRefExoticComponent<Omit<import('./types').BreadcrumbItemProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
5
+ Item: import('../../utils').FunctionComponentWithAs<"a", import('./types').BreadcrumbItemOptions>;
6
6
  };
@@ -6,12 +6,11 @@ interface BreadcrumbOptions {
6
6
  separator?: React.ReactNode | string;
7
7
  }
8
8
  export type BreadcrumbProps = BreadcrumbOptions & ComponentPropsWithRef<'div'> & HTMLAttributes<HTMLDivElement>;
9
- interface BreadcrumbItemOptions {
9
+ export interface BreadcrumbItemOptions {
10
10
  children: React.ReactNode;
11
11
  'data-testid'?: string;
12
12
  isActive?: boolean;
13
13
  separator?: React.ReactNode | string;
14
14
  to?: string;
15
15
  }
16
- export type BreadcrumbItemProps = BreadcrumbItemOptions & ComponentPropsWithRef<'a'> & HTMLAttributes<HTMLAnchorElement>;
17
16
  export {};
@@ -1,9 +1,9 @@
1
- export declare const CardComponent: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
1
+ export declare const CardComponent: import('../../utils').FunctionComponentWithAs<"div", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
2
  ref?: import('react').Ref<HTMLDivElement>;
3
- }, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
4
- export declare const Card: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ }>;
4
+ export declare const Card: import('../../utils').FunctionComponentWithAs<"div", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
5
  ref?: import('react').Ref<HTMLDivElement>;
6
- }, "ref"> & import('react').RefAttributes<HTMLDivElement>> & {
6
+ }> & {
7
7
  Body: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
8
  ref?: import('react').Ref<HTMLDivElement>;
9
9
  }, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "9.0.9",
3
+ "version": "9.0.11",
4
4
  "description": "Customizable design system with react, typescript, tailwindcss and ariakit.",
5
5
  "files": [
6
6
  "dist"