welcome-ui 10.0.0-alpha.8 → 10.0.0-alpha.9

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.
@@ -1,19 +1,20 @@
1
1
  "use client";
2
2
  import './Breadcrumb.css';
3
- import { jsxs as A, jsx as w } from "react/jsx-runtime";
4
- import { forwardRef as re, Children as me, cloneElement as ze, useRef as M, useState as X, useCallback as q, useMemo as xe, useEffect as $ } from "react";
5
- import { Icon as ne } from "./Icon.js";
6
- import { c as ie } from "./index-PAaZGbyz.js";
3
+ import { jsxs as I, jsx as w } from "react/jsx-runtime";
4
+ import { forwardRef as ge, Children as me, cloneElement as ze, useRef as M, useState as X, useCallback as q, useMemo as xe, useEffect as $ } from "react";
5
+ import { Icon as re } from "./Icon.js";
6
+ import { c as ne } from "./index-PAaZGbyz.js";
7
7
  import { t as we } from "./throttle-BDBzFeFj.js";
8
- var g = [], Oe = function() {
8
+ import { f as Oe } from "./forwardRefWithAs-8eP3ZN15.js";
9
+ var g = [], Re = function() {
9
10
  return g.some(function(e) {
10
11
  return e.activeTargets.length > 0;
11
12
  });
12
- }, Re = function() {
13
+ }, ye = function() {
13
14
  return g.some(function(e) {
14
15
  return e.skippedTargets.length > 0;
15
16
  });
16
- }, J = "ResizeObserver loop completed with undelivered notifications.", ye = function() {
17
+ }, J = "ResizeObserver loop completed with undelivered notifications.", Ee = function() {
17
18
  var e;
18
19
  typeof ErrorEvent == "function" ? e = new ErrorEvent("error", {
19
20
  message: J
@@ -24,37 +25,37 @@ var g = [], Oe = function() {
24
25
  })(y || (y = {}));
25
26
  var m = function(e) {
26
27
  return Object.freeze(e);
27
- }, Ee = /* @__PURE__ */ function() {
28
+ }, Be = /* @__PURE__ */ function() {
28
29
  function e(t, r) {
29
30
  this.inlineSize = t, this.blockSize = r, m(this);
30
31
  }
31
32
  return e;
32
- }(), oe = function() {
33
+ }(), ie = 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, m(this);
35
36
  }
36
37
  return e.prototype.toJSON = function() {
37
- var t = this, r = t.x, n = t.y, i = t.top, s = t.right, o = t.bottom, u = t.left, l = t.width, c = t.height;
38
- return { x: r, y: n, top: i, right: s, bottom: o, left: u, width: l, height: c };
38
+ var t = this, r = t.x, n = t.y, i = t.top, o = t.right, s = t.bottom, a = t.left, l = t.width, u = t.height;
39
+ return { x: r, y: n, top: i, right: o, bottom: s, left: a, width: l, 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
  }(), G = function(e) {
43
44
  return e instanceof SVGElement && "getBBox" in e;
44
- }, se = function(e) {
45
+ }, oe = function(e) {
45
46
  if (G(e)) {
46
47
  var t = e.getBBox(), r = t.width, n = t.height;
47
48
  return !r && !n;
48
49
  }
49
- var i = e, s = i.offsetWidth, o = i.offsetHeight;
50
- return !(s || o || e.getClientRects().length);
50
+ var i = e, o = i.offsetWidth, s = i.offsetHeight;
51
+ return !(o || s || e.getClientRects().length);
51
52
  }, U = function(e) {
52
53
  var t;
53
54
  if (e instanceof Element)
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
- }, Be = function(e) {
58
+ }, Te = function(e) {
58
59
  switch (e.tagName) {
59
60
  case "INPUT":
60
61
  if (e.type !== "image")
@@ -69,60 +70,60 @@ var m = function(e) {
69
70
  return !0;
70
71
  }
71
72
  return !1;
72
- }, R = typeof window < "u" ? window : {}, S = /* @__PURE__ */ new WeakMap(), Y = /auto|scroll/, Te = /^tb|vertical/, Se = /msie|trident/i.test(R.navigator && R.navigator.userAgent), f = function(e) {
73
+ }, R = typeof window < "u" ? window : {}, S = /* @__PURE__ */ new WeakMap(), Y = /auto|scroll/, Se = /^tb|vertical/, _e = /msie|trident/i.test(R.navigator && R.navigator.userAgent), h = function(e) {
73
74
  return parseFloat(e || "0");
74
75
  }, x = function(e, t, r) {
75
- 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
+ return e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = !1), new Be((r ? t : e) || 0, (r ? e : t) || 0);
76
77
  }, j = m({
77
78
  devicePixelContentBoxSize: x(),
78
79
  borderBoxSize: x(),
79
80
  contentBoxSize: x(),
80
- contentRect: new oe(0, 0, 0, 0)
81
- }), ae = function(e, t) {
81
+ contentRect: new ie(0, 0, 0, 0)
82
+ }), se = function(e, t) {
82
83
  if (t === void 0 && (t = !1), S.has(e) && !t)
83
84
  return S.get(e);
84
- if (se(e))
85
+ if (oe(e))
85
86
  return S.set(e, j), j;
86
- var r = getComputedStyle(e), n = G(e) && e.ownerSVGElement && e.getBBox(), i = !Se && r.boxSizing === "border-box", s = Te.test(r.writingMode || ""), o = !n && Y.test(r.overflowY || ""), u = !n && Y.test(r.overflowX || ""), l = n ? 0 : f(r.paddingTop), c = n ? 0 : f(r.paddingRight), v = n ? 0 : f(r.paddingBottom), h = n ? 0 : f(r.paddingLeft), E = n ? 0 : f(r.borderTopWidth), a = n ? 0 : f(r.borderRightWidth), d = n ? 0 : f(r.borderBottomWidth), p = n ? 0 : f(r.borderLeftWidth), b = h + c, z = l + v, O = p + a, D = E + d, F = u ? e.offsetHeight - D - e.clientHeight : 0, H = o ? e.offsetWidth - O - e.clientWidth : 0, he = i ? b + O : 0, pe = i ? z + D : 0, B = n ? n.width : f(r.width) - he - H, T = n ? n.height : f(r.height) - pe - F, be = B + b + H + O, ge = T + z + F + D, V = m({
87
- devicePixelContentBoxSize: x(Math.round(B * devicePixelRatio), Math.round(T * devicePixelRatio), s),
88
- borderBoxSize: x(be, ge, s),
89
- contentBoxSize: x(B, T, s),
90
- contentRect: new oe(h, l, B, T)
87
+ var r = getComputedStyle(e), n = G(e) && e.ownerSVGElement && e.getBBox(), i = !_e && r.boxSizing === "border-box", o = Se.test(r.writingMode || ""), s = !n && Y.test(r.overflowY || ""), a = !n && Y.test(r.overflowX || ""), l = n ? 0 : h(r.paddingTop), u = n ? 0 : h(r.paddingRight), f = n ? 0 : h(r.paddingBottom), v = n ? 0 : h(r.paddingLeft), E = n ? 0 : h(r.borderTopWidth), c = n ? 0 : h(r.borderRightWidth), d = n ? 0 : h(r.borderBottomWidth), p = n ? 0 : h(r.borderLeftWidth), b = v + u, z = l + f, O = p + c, D = E + d, F = a ? e.offsetHeight - D - e.clientHeight : 0, H = s ? e.offsetWidth - O - e.clientWidth : 0, fe = i ? b + O : 0, he = i ? z + D : 0, B = n ? n.width : h(r.width) - fe - H, T = n ? n.height : h(r.height) - he - F, pe = B + b + H + O, be = T + z + F + D, V = m({
88
+ devicePixelContentBoxSize: x(Math.round(B * devicePixelRatio), Math.round(T * devicePixelRatio), o),
89
+ borderBoxSize: x(pe, be, o),
90
+ contentBoxSize: x(B, T, o),
91
+ contentRect: new ie(v, l, B, T)
91
92
  });
92
93
  return S.set(e, V), V;
93
- }, ce = function(e, t, r) {
94
- var n = ae(e, r), i = n.borderBoxSize, s = n.contentBoxSize, o = n.devicePixelContentBoxSize;
94
+ }, ae = function(e, t, r) {
95
+ var n = se(e, r), i = n.borderBoxSize, o = n.contentBoxSize, s = n.devicePixelContentBoxSize;
95
96
  switch (t) {
96
97
  case y.DEVICE_PIXEL_CONTENT_BOX:
97
- return o;
98
+ return s;
98
99
  case y.BORDER_BOX:
99
100
  return i;
100
101
  default:
101
- return s;
102
+ return o;
102
103
  }
103
- }, _e = /* @__PURE__ */ function() {
104
+ }, Ce = /* @__PURE__ */ function() {
104
105
  function e(t) {
105
- var r = ae(t);
106
+ var r = se(t);
106
107
  this.target = t, this.contentRect = r.contentRect, this.borderBoxSize = m([r.borderBoxSize]), this.contentBoxSize = m([r.contentBoxSize]), this.devicePixelContentBoxSize = m([r.devicePixelContentBoxSize]);
107
108
  }
108
109
  return e;
109
- }(), le = function(e) {
110
- if (se(e))
110
+ }(), ce = function(e) {
111
+ if (oe(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
- }, Ce = function() {
116
+ }, Ne = function() {
116
117
  var e = 1 / 0, t = [];
117
- g.forEach(function(o) {
118
- if (o.activeTargets.length !== 0) {
119
- var u = [];
120
- o.activeTargets.forEach(function(c) {
121
- var v = new _e(c.target), h = le(c.target);
122
- u.push(v), c.lastReportedSize = ce(c.target, c.observedBox), h < e && (e = h);
118
+ g.forEach(function(s) {
119
+ if (s.activeTargets.length !== 0) {
120
+ var a = [];
121
+ s.activeTargets.forEach(function(u) {
122
+ var f = new Ce(u.target), v = ce(u.target);
123
+ a.push(f), u.lastReportedSize = ae(u.target, u.observedBox), v < e && (e = v);
123
124
  }), t.push(function() {
124
- o.callback.call(o.observer, u, o.observer);
125
- }), o.activeTargets.splice(0, o.activeTargets.length);
125
+ s.callback.call(s.observer, a, s.observer);
126
+ }), s.activeTargets.splice(0, s.activeTargets.length);
126
127
  }
127
128
  });
128
129
  for (var r = 0, n = t; r < n.length; r++) {
@@ -133,35 +134,35 @@ var m = function(e) {
133
134
  }, K = function(e) {
134
135
  g.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() && (le(i.target) > e ? r.activeTargets.push(i) : r.skippedTargets.push(i));
137
+ i.isActive() && (ce(i.target) > e ? r.activeTargets.push(i) : r.skippedTargets.push(i));
137
138
  });
138
139
  });
139
- }, Ne = function() {
140
+ }, ke = function() {
140
141
  var e = 0;
141
- for (K(e); Oe(); )
142
- e = Ce(), K(e);
143
- return Re() && ye(), e > 0;
144
- }, L, ue = [], ke = function() {
145
- return ue.splice(0).forEach(function(e) {
142
+ for (K(e); Re(); )
143
+ e = Ne(), K(e);
144
+ return ye() && Ee(), e > 0;
145
+ }, L, le = [], De = function() {
146
+ return le.splice(0).forEach(function(e) {
146
147
  return e();
147
148
  });
148
- }, De = function(e) {
149
+ }, Me = function(e) {
149
150
  if (!L) {
150
151
  var t = 0, r = document.createTextNode(""), n = { characterData: !0 };
151
152
  new MutationObserver(function() {
152
- return ke();
153
+ return De();
153
154
  }).observe(r, n), L = function() {
154
155
  r.textContent = "".concat(t ? t-- : t++);
155
156
  };
156
157
  }
157
- ue.push(e), L();
158
- }, Me = function(e) {
159
- De(function() {
158
+ le.push(e), L();
159
+ }, Le = function(e) {
160
+ Me(function() {
160
161
  requestAnimationFrame(e);
161
162
  });
162
- }, N = 0, Le = function() {
163
+ }, N = 0, We = function() {
163
164
  return !!N;
164
- }, Ie = 250, We = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, Q = [
165
+ }, Ae = 250, Ie = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, Q = [
165
166
  "resize",
166
167
  "load",
167
168
  "transitionend",
@@ -178,7 +179,7 @@ var m = function(e) {
178
179
  "focus"
179
180
  ], Z = function(e) {
180
181
  return e === void 0 && (e = 0), Date.now() + e;
181
- }, I = !1, Ae = function() {
182
+ }, W = !1, Pe = function() {
182
183
  function e() {
183
184
  var t = this;
184
185
  this.stopped = !0, this.listener = function() {
@@ -187,15 +188,15 @@ var m = function(e) {
187
188
  }
188
189
  return e.prototype.run = function(t) {
189
190
  var r = this;
190
- if (t === void 0 && (t = Ie), !I) {
191
- I = !0;
191
+ if (t === void 0 && (t = Ae), !W) {
192
+ W = !0;
192
193
  var n = Z(t);
193
- Me(function() {
194
+ Le(function() {
194
195
  var i = !1;
195
196
  try {
196
- i = Ne();
197
+ i = ke();
197
198
  } finally {
198
- if (I = !1, t = n - Z(), !Le())
199
+ if (W = !1, t = n - Z(), !We())
199
200
  return;
200
201
  i ? r.run(1e3) : t > 0 ? r.run(t) : r.start();
201
202
  }
@@ -205,7 +206,7 @@ var m = 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, We);
209
+ return t.observer && t.observer.observe(document.body, Ie);
209
210
  };
210
211
  document.body ? r() : R.addEventListener("DOMContentLoaded", r);
211
212
  }, e.prototype.start = function() {
@@ -219,11 +220,11 @@ var m = function(e) {
219
220
  return R.removeEventListener(r, t.listener, !0);
220
221
  }), this.stopped = !0);
221
222
  }, e;
222
- }(), P = new Ae(), ee = function(e) {
223
+ }(), P = new Pe(), ee = function(e) {
223
224
  !N && e > 0 && P.start(), N += e, !N && P.stop();
224
- }, Pe = function(e) {
225
- return !G(e) && !Be(e) && getComputedStyle(e).display === "inline";
226
- }, Ge = function() {
225
+ }, Ge = function(e) {
226
+ return !G(e) && !Te(e) && getComputedStyle(e).display === "inline";
227
+ }, Fe = 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 m = function(e) {
231
232
  };
232
233
  }
233
234
  return e.prototype.isActive = function() {
234
- var t = ce(this.target, this.observedBox, !0);
235
- return Pe(this.target) && (this.lastReportedSize = t), this.lastReportedSize.inlineSize !== t.inlineSize || this.lastReportedSize.blockSize !== t.blockSize;
235
+ var t = ae(this.target, this.observedBox, !0);
236
+ return Ge(this.target) && (this.lastReportedSize = t), this.lastReportedSize.inlineSize !== t.inlineSize || this.lastReportedSize.blockSize !== t.blockSize;
236
237
  }, e;
237
- }(), Fe = /* @__PURE__ */ function() {
238
+ }(), He = /* @__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,21 +249,21 @@ var m = function(e) {
248
249
  function e() {
249
250
  }
250
251
  return e.connect = function(t, r) {
251
- var n = new Fe(t, r);
252
+ var n = new He(t, r);
252
253
  _.set(t, n);
253
254
  }, e.observe = function(t, r, n) {
254
- var i = _.get(t), s = i.observationTargets.length === 0;
255
- te(i.observationTargets, r) < 0 && (s && g.push(i), i.observationTargets.push(new Ge(r, n && n.box)), ee(1), P.schedule());
255
+ var i = _.get(t), o = i.observationTargets.length === 0;
256
+ te(i.observationTargets, r) < 0 && (o && g.push(i), i.observationTargets.push(new Fe(r, n && n.box)), ee(1), P.schedule());
256
257
  }, e.unobserve = function(t, r) {
257
- var n = _.get(t), i = te(n.observationTargets, r), s = n.observationTargets.length === 1;
258
- i >= 0 && (s && g.splice(g.indexOf(n), 1), n.observationTargets.splice(i, 1), ee(-1));
258
+ var n = _.get(t), i = te(n.observationTargets, r), o = n.observationTargets.length === 1;
259
+ i >= 0 && (o && g.splice(g.indexOf(n), 1), n.observationTargets.splice(i, 1), ee(-1));
259
260
  }, e.disconnect = function(t) {
260
261
  var r = this, n = _.get(t);
261
262
  n.observationTargets.slice().forEach(function(i) {
262
263
  return r.unobserve(t, i.target);
263
264
  }), n.activeTargets.splice(0, n.activeTargets.length);
264
265
  }, e;
265
- }(), He = function() {
266
+ }(), Ve = 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,88 +289,89 @@ var m = function(e) {
288
289
  return "function ResizeObserver () { [polyfill code] }";
289
290
  }, e;
290
291
  }();
291
- const Ve = (e, t, r) => Math.min(Math.max(e, t), r), Xe = "_root_1oz46_2", qe = "_list_1oz46_14", ve = {
292
- root: Xe,
293
- list: qe,
292
+ const Xe = (e, t, r) => Math.min(Math.max(e, t), r), qe = "_root_1oz46_2", $e = "_list_1oz46_14", ue = {
293
+ root: qe,
294
+ list: $e,
294
295
  "start-gradient": "_start-gradient_1oz46_25",
295
296
  "end-gradient": "_end-gradient_1oz46_29",
296
297
  "item-wrapper": "_item-wrapper_1oz46_40",
297
298
  "item-content": "_item-content_1oz46_45",
298
299
  "item-separator": "_item-separator_1oz46_65"
299
- }, W = ie(ve), de = re(
300
+ }, A = ne(ue), ve = Oe(
300
301
  ({
301
- children: e,
302
- collapsed: t,
303
- "data-testid": r,
304
- icon: n,
305
- isActive: i,
302
+ as: e = "a",
303
+ children: t,
304
+ collapsed: r,
305
+ "data-testid": n,
306
+ icon: i,
307
+ isActive: o,
306
308
  separator: s,
307
- ...o
308
- }, u) => {
309
- const l = o.href || o.to, c = !!(t && !i);
309
+ ...a
310
+ }, l) => {
311
+ const u = a.href || a.to, f = !!(r && !o);
310
312
  let v;
311
- return c ? v = "ellipsis-h" : n === !0 ? v = i ? "folder-open" : "folder" : n && (v = n), /* @__PURE__ */ A("li", { "aria-label": "breadcrumb", className: W("item-wrapper"), "data-testid": r, children: [
312
- s ? /* @__PURE__ */ w("span", { className: W("item-separator"), role: "presentation", children: s }) : null,
313
- /* @__PURE__ */ A(
314
- "a",
313
+ return f ? v = "ellipsis-h" : i === !0 ? v = o ? "folder-open" : "folder" : i && (v = i), /* @__PURE__ */ I("li", { "aria-label": "breadcrumb", className: A("item-wrapper"), "data-testid": n, children: [
314
+ s ? /* @__PURE__ */ w("span", { className: A("item-separator"), role: "presentation", children: s }) : null,
315
+ /* @__PURE__ */ I(
316
+ e,
315
317
  {
316
- "aria-current": i ? "page" : void 0,
317
- "aria-disabled": !l,
318
- ...o,
319
- className: W("item-content", o.className),
320
- ref: u,
318
+ "aria-current": o ? "page" : void 0,
319
+ "aria-disabled": !u,
320
+ ...a,
321
+ className: A("item-content", a.className),
322
+ ref: l,
321
323
  children: [
322
- v ? /* @__PURE__ */ w(ne, { name: v, size: "md" }) : null,
323
- c ? null : e
324
+ v ? /* @__PURE__ */ w(re, { name: v, size: "md" }) : null,
325
+ f ? null : t
324
326
  ]
325
327
  }
326
328
  )
327
329
  ] });
328
330
  }
329
331
  );
330
- de.displayName = "Breadcrumb.Item";
331
- const k = ie(ve), fe = re(
332
+ ve.displayName = "Breadcrumb.Item";
333
+ const k = ne(ue), de = ge(
332
334
  ({
333
335
  children: e,
334
336
  icon: t,
335
337
  lastChildNotClickable: r = !0,
336
- separator: n = /* @__PURE__ */ w(ne, { name: "angle-right-b", size: "md" }),
338
+ separator: n = /* @__PURE__ */ w(re, { name: "angle-right-b", size: "md" }),
337
339
  ...i
338
- }, s) => {
339
- const o = me.toArray(e).filter(Boolean), u = o.length, l = o.map((a, d) => {
340
- const p = u === 1 || u === d + 1;
341
- return ze(a, {
340
+ }, o) => {
341
+ const s = me.toArray(e).filter(Boolean), a = s.length, l = s.map((c, d) => {
342
+ const p = a === 1 || a === d + 1;
343
+ return ze(c, {
342
344
  icon: t,
343
345
  isActive: p && r,
344
346
  key: `breadcrumb-${d}`,
345
347
  separator: p ? void 0 : n,
346
- ...a.props
348
+ ...c.props
347
349
  });
348
- }), { endGradient: c, listRef: v, onListScroll: h, startGradient: E } = $e();
349
- return /* @__PURE__ */ A("nav", { ref: s, ...i, className: k("root", i.className), children: [
350
+ }), { endGradient: u, listRef: f, onListScroll: v, startGradient: E } = Je();
351
+ return /* @__PURE__ */ I("nav", { ref: o, ...i, className: k("root", i.className), children: [
350
352
  E,
351
- /* @__PURE__ */ w("ol", { className: k("list"), dir: "rtl", onScroll: h, ref: v, children: l.reverse() }),
352
- c
353
+ /* @__PURE__ */ w("ol", { className: k("list"), dir: "rtl", onScroll: v, ref: f, children: l.reverse() }),
354
+ u
353
355
  ] });
354
356
  }
355
357
  );
356
- fe.displayName = "Breadcrumb";
357
- const Qe = Object.assign(fe, {
358
- Item: de
359
- }), $e = () => {
360
- const e = M(null), t = M(), r = M(), [n, i] = X(!1), [s, o] = X(0), u = (a, d) => {
361
- a && (a.style.transform = `scale3d(${d}, 1, 1)`);
362
- }, l = q((a) => {
363
- const d = 1 - a;
364
- u(t.current, d), u(r.current, a);
365
- }, []), c = q(() => {
358
+ de.displayName = "Breadcrumb";
359
+ const et = Object.assign(de, {
360
+ Item: ve
361
+ }), Je = () => {
362
+ const e = M(null), t = M(), r = M(), [n, i] = X(!1), [o, s] = X(0), a = (c, d) => {
363
+ c && (c.style.transform = `scale3d(${d}, 1, 1)`);
364
+ }, l = q((c) => {
365
+ const d = 1 - c;
366
+ a(t.current, d), a(r.current, c);
367
+ }, []), u = q(() => {
366
368
  const {
367
- current: { offsetWidth: a, scrollLeft: d, scrollWidth: p }
368
- } = e, b = p - a, O = Ve(Math.abs(d - s), 0, b) / b;
369
+ current: { offsetWidth: c, scrollLeft: d, scrollWidth: p }
370
+ } = e, b = p - c, O = Xe(Math.abs(d - o), 0, b) / b;
369
371
  l(O);
370
- }, [s, l]), v = xe(
372
+ }, [o, l]), f = xe(
371
373
  () => we(
372
- (a) => {
374
+ (c) => {
373
375
  const [
374
376
  {
375
377
  // Is offsetWidth really needed ?
@@ -377,21 +379,21 @@ const Qe = Object.assign(fe, {
377
379
  // @ts-ignore
378
380
  target: { offsetWidth: d, scrollLeft: p, scrollWidth: b }
379
381
  }
380
- ] = a, z = b - d;
381
- s || o(p === 0 ? 0 : z), i(z > 0);
382
+ ] = c, z = b - d;
383
+ o || s(p === 0 ? 0 : z), i(z > 0);
382
384
  },
383
385
  300,
384
386
  !1
385
387
  ),
386
- [s]
388
+ [o]
387
389
  );
388
390
  $(() => {
389
- const a = new He(v);
390
- return a.observe(e.current), () => a.disconnect();
391
+ const c = new Ve(f);
392
+ return c.observe(e.current), () => c.disconnect();
391
393
  }, []), $(() => {
392
394
  t.current && r.current && l(0);
393
395
  }, [n, l]);
394
- const h = n ? /* @__PURE__ */ w(
396
+ const v = n ? /* @__PURE__ */ w(
395
397
  "span",
396
398
  {
397
399
  className: k("start-gradient", "bg-linear-to-r from-neutral-10 to-transparent"),
@@ -404,9 +406,9 @@ const Qe = Object.assign(fe, {
404
406
  className: k("end-gradient", "bg-linear-to-l from-neutral-10 to-transparent"),
405
407
  ref: r
406
408
  }
407
- ) : null, listRef: e, onListScroll: c, startGradient: h };
409
+ ) : null, listRef: e, onListScroll: u, startGradient: v };
408
410
  };
409
411
  export {
410
- Qe as Breadcrumb,
411
- fe as BreadcrumbComponent
412
+ et as Breadcrumb,
413
+ de as BreadcrumbComponent
412
414
  };
@@ -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
  };
@@ -8,7 +8,7 @@ interface BreadcrumbOptions {
8
8
  separator?: React.ReactNode | string;
9
9
  }
10
10
  export type BreadcrumbProps = BreadcrumbOptions & ComponentPropsWithRef<'div'> & HTMLAttributes<HTMLDivElement>;
11
- interface BreadcrumbItemOptions {
11
+ export interface BreadcrumbItemOptions {
12
12
  children: React.ReactNode;
13
13
  collapsed?: boolean;
14
14
  'data-testid'?: string;
@@ -17,5 +17,4 @@ interface BreadcrumbItemOptions {
17
17
  separator?: React.ReactNode | string;
18
18
  to?: string;
19
19
  }
20
- export type BreadcrumbItemProps = BreadcrumbItemOptions & ComponentPropsWithRef<'a'> & HTMLAttributes<HTMLAnchorElement>;
21
20
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "10.0.0-alpha.8",
3
+ "version": "10.0.0-alpha.9",
4
4
  "description": "Customizable design system with react, typescript, tailwindcss and ariakit.",
5
5
  "files": [
6
6
  "dist"