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.
package/dist/Breadcrumb.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Breadcrumb.css';
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { c as
|
|
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
|
-
|
|
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
|
-
},
|
|
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.",
|
|
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
|
-
},
|
|
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
|
-
}(),
|
|
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,
|
|
38
|
-
return { x: r, y: n, top: i, right:
|
|
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
|
-
},
|
|
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,
|
|
50
|
-
return !(
|
|
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
|
-
},
|
|
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/,
|
|
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
|
|
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
|
|
81
|
-
}),
|
|
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 (
|
|
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 = !
|
|
87
|
-
devicePixelContentBoxSize: x(Math.round(B * devicePixelRatio), Math.round(T * devicePixelRatio),
|
|
88
|
-
borderBoxSize: x(
|
|
89
|
-
contentBoxSize: x(B, T,
|
|
90
|
-
contentRect: new
|
|
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
|
-
},
|
|
94
|
-
var n =
|
|
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
|
|
98
|
+
return s;
|
|
98
99
|
case y.BORDER_BOX:
|
|
99
100
|
return i;
|
|
100
101
|
default:
|
|
101
|
-
return
|
|
102
|
+
return o;
|
|
102
103
|
}
|
|
103
|
-
},
|
|
104
|
+
}, Ce = /* @__PURE__ */ function() {
|
|
104
105
|
function e(t) {
|
|
105
|
-
var r =
|
|
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
|
-
}(),
|
|
110
|
-
if (
|
|
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
|
-
},
|
|
116
|
+
}, Ne = function() {
|
|
116
117
|
var e = 1 / 0, t = [];
|
|
117
|
-
g.forEach(function(
|
|
118
|
-
if (
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
var
|
|
122
|
-
|
|
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
|
-
|
|
125
|
-
}),
|
|
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() && (
|
|
137
|
+
i.isActive() && (ce(i.target) > e ? r.activeTargets.push(i) : r.skippedTargets.push(i));
|
|
137
138
|
});
|
|
138
139
|
});
|
|
139
|
-
},
|
|
140
|
+
}, ke = function() {
|
|
140
141
|
var e = 0;
|
|
141
|
-
for (K(e);
|
|
142
|
-
e =
|
|
143
|
-
return
|
|
144
|
-
}, L,
|
|
145
|
-
return
|
|
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
|
-
},
|
|
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
|
|
153
|
+
return De();
|
|
153
154
|
}).observe(r, n), L = function() {
|
|
154
155
|
r.textContent = "".concat(t ? t-- : t++);
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
|
|
158
|
+
le.push(e), L();
|
|
159
|
+
}, Le = function(e) {
|
|
160
|
+
Me(function() {
|
|
160
161
|
requestAnimationFrame(e);
|
|
161
162
|
});
|
|
162
|
-
}, N = 0,
|
|
163
|
+
}, N = 0, We = function() {
|
|
163
164
|
return !!N;
|
|
164
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
191
|
-
|
|
191
|
+
if (t === void 0 && (t = Ae), !W) {
|
|
192
|
+
W = !0;
|
|
192
193
|
var n = Z(t);
|
|
193
|
-
|
|
194
|
+
Le(function() {
|
|
194
195
|
var i = !1;
|
|
195
196
|
try {
|
|
196
|
-
i =
|
|
197
|
+
i = ke();
|
|
197
198
|
} finally {
|
|
198
|
-
if (
|
|
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,
|
|
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
|
|
223
|
+
}(), P = new Pe(), ee = function(e) {
|
|
223
224
|
!N && e > 0 && P.start(), N += e, !N && P.stop();
|
|
224
|
-
},
|
|
225
|
-
return !G(e) && !
|
|
226
|
-
},
|
|
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 =
|
|
235
|
-
return
|
|
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
|
-
}(),
|
|
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
|
|
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),
|
|
255
|
-
te(i.observationTargets, r) < 0 && (
|
|
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),
|
|
258
|
-
i >= 0 && (
|
|
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
|
-
}(),
|
|
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
|
|
292
|
-
root:
|
|
293
|
-
list:
|
|
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
|
-
},
|
|
300
|
+
}, A = ne(ue), ve = Oe(
|
|
300
301
|
({
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
...
|
|
308
|
-
},
|
|
309
|
-
const
|
|
309
|
+
...a
|
|
310
|
+
}, l) => {
|
|
311
|
+
const u = a.href || a.to, f = !!(r && !o);
|
|
310
312
|
let v;
|
|
311
|
-
return
|
|
312
|
-
s ? /* @__PURE__ */ w("span", { className:
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
|
|
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":
|
|
317
|
-
"aria-disabled": !
|
|
318
|
-
...
|
|
319
|
-
className:
|
|
320
|
-
ref:
|
|
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(
|
|
323
|
-
|
|
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
|
-
|
|
331
|
-
const k =
|
|
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(
|
|
338
|
+
separator: n = /* @__PURE__ */ w(re, { name: "angle-right-b", size: "md" }),
|
|
337
339
|
...i
|
|
338
|
-
},
|
|
339
|
-
const
|
|
340
|
-
const p =
|
|
341
|
-
return ze(
|
|
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
|
-
...
|
|
348
|
+
...c.props
|
|
347
349
|
});
|
|
348
|
-
}), { endGradient:
|
|
349
|
-
return /* @__PURE__ */
|
|
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:
|
|
352
|
-
|
|
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
|
-
|
|
357
|
-
const
|
|
358
|
-
Item:
|
|
359
|
-
}),
|
|
360
|
-
const e = M(null), t = M(), r = M(), [n, i] = X(!1), [
|
|
361
|
-
|
|
362
|
-
}, l = q((
|
|
363
|
-
const d = 1 -
|
|
364
|
-
|
|
365
|
-
}, []),
|
|
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:
|
|
368
|
-
} = e, b = p -
|
|
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
|
-
}, [
|
|
372
|
+
}, [o, l]), f = xe(
|
|
371
373
|
() => we(
|
|
372
|
-
(
|
|
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
|
-
] =
|
|
381
|
-
|
|
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
|
-
[
|
|
388
|
+
[o]
|
|
387
389
|
);
|
|
388
390
|
$(() => {
|
|
389
|
-
const
|
|
390
|
-
return
|
|
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
|
|
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:
|
|
409
|
+
) : null, listRef: e, onListScroll: u, startGradient: v };
|
|
408
410
|
};
|
|
409
411
|
export {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
+
et as Breadcrumb,
|
|
413
|
+
de as BreadcrumbComponent
|
|
412
414
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BreadcrumbItemOptions } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* @name Breadcrumb.Item
|
|
4
4
|
*/
|
|
5
|
-
export declare const Item: import('
|
|
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:
|
|
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 {};
|