@indxsearch/systm 1.2.0 → 1.2.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/README.md +34 -0
- package/dist/index.es.js +91 -91
- package/dist/index.umd.js +3 -3
- package/dist/patterns.css +33 -0
- package/dist/systm.css +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -66,6 +66,40 @@ import '@indxsearch/systm/cursors.css'; // Optional custom cursors
|
|
|
66
66
|
|
|
67
67
|
All cursors automatically adapt to dark mode via `prefers-color-scheme`.
|
|
68
68
|
|
|
69
|
+
## Patterns (Optional)
|
|
70
|
+
|
|
71
|
+
Systm includes optional SVG patterns as CSS custom properties. Import the patterns stylesheet to enable:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import '@indxsearch/systm/styles.css';
|
|
75
|
+
import '@indxsearch/systm/patterns.css'; // Optional SVG patterns
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Available patterns:**
|
|
79
|
+
- `--pattern-checkerboard-light/dark` - 2x2 tight checkerboard
|
|
80
|
+
- `--pattern-checkerboard-spaced-4-light/dark` - 1x1 squares with 1px spacing
|
|
81
|
+
- `--pattern-checkerboard-spaced-6-light/dark` - 1x1 squares with 2px spacing
|
|
82
|
+
- `--pattern-checkerboard-spaced-8-light/dark` - 1x1 squares with 3px spacing
|
|
83
|
+
- `--pattern-checkerboard-spaced-10-light/dark` - 1x1 squares with 4px spacing
|
|
84
|
+
- `--pattern-grid-6-light/dark` - 6x6 grid with 1x1 dot
|
|
85
|
+
- `--pattern-grid-12-light/dark` - 12x12 grid with 1x1 dot
|
|
86
|
+
- `--pattern-grid-24-light/dark` - 24x24 grid with 1x1 dot
|
|
87
|
+
|
|
88
|
+
**Usage:**
|
|
89
|
+
```css
|
|
90
|
+
.element {
|
|
91
|
+
background-image: var(--pattern-checkerboard-light);
|
|
92
|
+
background-repeat: repeat;
|
|
93
|
+
background-size: 2px 2px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (prefers-color-scheme: dark) {
|
|
97
|
+
.element {
|
|
98
|
+
background-image: var(--pattern-checkerboard-dark);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
69
103
|
## Dependencies
|
|
70
104
|
|
|
71
105
|
- `@indxsearch/pixl` - Icon library
|
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as u from "react";
|
|
|
2
2
|
import te, { useState as tr, useEffect as So, useRef as _o, useLayoutEffect as Eo } from "react";
|
|
3
3
|
import * as _t from "react-dom";
|
|
4
4
|
import Ro from "react-dom";
|
|
5
|
-
var at = { exports: {} },
|
|
5
|
+
var at = { exports: {} }, ze = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -14,7 +14,7 @@ var at = { exports: {} }, Ue = {};
|
|
|
14
14
|
*/
|
|
15
15
|
var xn;
|
|
16
16
|
function Co() {
|
|
17
|
-
if (xn) return
|
|
17
|
+
if (xn) return ze;
|
|
18
18
|
xn = 1;
|
|
19
19
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
20
20
|
function n(r, o, s) {
|
|
@@ -32,7 +32,7 @@ function Co() {
|
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return ze.Fragment = t, ze.jsx = n, ze.jsxs = n, ze;
|
|
36
36
|
}
|
|
37
37
|
var Ye = {};
|
|
38
38
|
/**
|
|
@@ -201,10 +201,10 @@ function To() {
|
|
|
201
201
|
else m(D);
|
|
202
202
|
if (C.call(F, "key")) {
|
|
203
203
|
D = e(S);
|
|
204
|
-
var
|
|
205
|
-
return
|
|
204
|
+
var U = Object.keys(F).filter(function(z) {
|
|
205
|
+
return z !== "key";
|
|
206
206
|
});
|
|
207
|
-
$ = 0 <
|
|
207
|
+
$ = 0 < U.length ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}", H[D + $] || (U = 0 < U.length ? "{" + U.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
208
|
`A props object containing a "key" prop is being spread into JSX:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s {...props} />
|
|
@@ -213,7 +213,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
213
213
|
<%s key={someKey} {...props} />`,
|
|
214
214
|
$,
|
|
215
215
|
D,
|
|
216
|
-
|
|
216
|
+
U,
|
|
217
217
|
D
|
|
218
218
|
), H[D + $] = !0);
|
|
219
219
|
}
|
|
@@ -330,12 +330,12 @@ const Do = "_checkboxWrapper_1wbyq_1", jo = "_checkbox_1wbyq_1", Lo = "_label_1w
|
|
|
330
330
|
function kl({ children: e, className: t }) {
|
|
331
331
|
return /* @__PURE__ */ b.jsx("div", { className: `${En.container} ${En.default} ${t || ""}`, children: e });
|
|
332
332
|
}
|
|
333
|
-
const Vo = "_container_10bfq_1", $o = "_header_10bfq_11", Ho = "_title_10bfq_31",
|
|
333
|
+
const Vo = "_container_10bfq_1", $o = "_header_10bfq_11", Ho = "_title_10bfq_31", Uo = "_body_10bfq_49", Ne = {
|
|
334
334
|
container: Vo,
|
|
335
335
|
header: $o,
|
|
336
336
|
title: Ho,
|
|
337
|
-
body:
|
|
338
|
-
},
|
|
337
|
+
body: Uo
|
|
338
|
+
}, zo = ({ color: e = "black", size: t = 21 }) => {
|
|
339
339
|
const n = 0.7142857142857143, r = t, o = typeof t == "number" ? t * n : `calc(${t} * 0.7142857142857143)`;
|
|
340
340
|
return b.jsx("svg", { width: r, height: o, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: b.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 1H2V2H1V1ZM3 3H2V2H3V3ZM4 3V4H3V3H4ZM5 2H4V3H5V2ZM5 2V1H6V2H5Z", fill: e }) });
|
|
341
341
|
}, Yo = ({ color: e = "black", size: t = 21 }) => {
|
|
@@ -524,7 +524,7 @@ const pi = "_radioWrapper_1faq0_1", hi = "_radioInput_1faq0_9", mi = "_customRad
|
|
|
524
524
|
]
|
|
525
525
|
}
|
|
526
526
|
);
|
|
527
|
-
}, xi = "
|
|
527
|
+
}, xi = "_basetrack_g50sm_1", Si = "_selectedtrack_g50sm_29", _i = "_livetrack_g50sm_36", Ei = "_livetrackFaceted_g50sm_42", Ri = "_livetrackDefault_g50sm_45", Ci = "_thumbs_g50sm_48", Ti = "_disabled_g50sm_82", re = {
|
|
528
528
|
basetrack: xi,
|
|
529
529
|
selectedtrack: Si,
|
|
530
530
|
livetrack: _i,
|
|
@@ -720,19 +720,19 @@ function nr() {
|
|
|
720
720
|
var q = E.getThumbs();
|
|
721
721
|
if (q.length < 1)
|
|
722
722
|
return;
|
|
723
|
-
var Z = {}, D = E.getOffsets(),
|
|
724
|
-
if (
|
|
725
|
-
var
|
|
723
|
+
var Z = {}, D = E.getOffsets(), U = L(P, D, q, C, k, A, M), G = M(C[P].toFixed(A));
|
|
724
|
+
if (U.length) {
|
|
725
|
+
var z = U.reduce(function(ce, be, xe, it) {
|
|
726
726
|
return ce.length ? t(t([], ce, !0), [D[it[xe]].x], !1) : [D[it[xe]].x];
|
|
727
727
|
}, []);
|
|
728
|
-
if (Math.min.apply(Math,
|
|
728
|
+
if (Math.min.apply(Math, z) === D[P].x) {
|
|
729
729
|
var Y = [];
|
|
730
|
-
|
|
730
|
+
U.forEach(function(ce) {
|
|
731
731
|
Y.push(C[ce].toFixed(A));
|
|
732
732
|
}), G = Array.from(new Set(Y.sort(function(ce, be) {
|
|
733
733
|
return parseFloat(ce) - parseFloat(be);
|
|
734
734
|
}))).map(M).join(k);
|
|
735
|
-
var K = Math.min.apply(Math,
|
|
735
|
+
var K = Math.min.apply(Math, z), ee = Math.max.apply(Math, z), ae = q[U[z.indexOf(ee)]].getBoundingClientRect().width;
|
|
736
736
|
Z.left = "".concat(Math.abs(K - (ee + ae)) / 2, "px"), Z.transform = "translate(-50%, 0)";
|
|
737
737
|
} else
|
|
738
738
|
Z.visibility = "hidden";
|
|
@@ -1553,7 +1553,7 @@ function Vi(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
1553
1553
|
return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
|
|
1554
1554
|
}, [n, t]);
|
|
1555
1555
|
}
|
|
1556
|
-
var $i = "DismissableLayer", Yt = "dismissableLayer.update", Hi = "dismissableLayer.pointerDownOutside",
|
|
1556
|
+
var $i = "DismissableLayer", Yt = "dismissableLayer.update", Hi = "dismissableLayer.pointerDownOutside", Ui = "dismissableLayer.focusOutside", kn, or = u.createContext({
|
|
1557
1557
|
layers: /* @__PURE__ */ new Set(),
|
|
1558
1558
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
1559
1559
|
branches: /* @__PURE__ */ new Set()
|
|
@@ -1606,7 +1606,7 @@ var $i = "DismissableLayer", Yt = "dismissableLayer.update", Hi = "dismissableLa
|
|
|
1606
1606
|
}
|
|
1607
1607
|
);
|
|
1608
1608
|
on.displayName = $i;
|
|
1609
|
-
var
|
|
1609
|
+
var zi = "DismissableLayerBranch", Yi = u.forwardRef((e, t) => {
|
|
1610
1610
|
const n = u.useContext(or), r = u.useRef(null), o = Q(t, r);
|
|
1611
1611
|
return u.useEffect(() => {
|
|
1612
1612
|
const s = r.current;
|
|
@@ -1616,7 +1616,7 @@ var Ui = "DismissableLayerBranch", Yi = u.forwardRef((e, t) => {
|
|
|
1616
1616
|
};
|
|
1617
1617
|
}, [n.branches]), /* @__PURE__ */ b.jsx(J.div, { ...e, ref: o });
|
|
1618
1618
|
});
|
|
1619
|
-
Yi.displayName =
|
|
1619
|
+
Yi.displayName = zi;
|
|
1620
1620
|
function qi(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
1621
1621
|
const n = Oe(e), r = u.useRef(!1), o = u.useRef(() => {
|
|
1622
1622
|
});
|
|
@@ -1651,7 +1651,7 @@ function Ki(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
1651
1651
|
const n = Oe(e), r = u.useRef(!1);
|
|
1652
1652
|
return u.useEffect(() => {
|
|
1653
1653
|
const o = (s) => {
|
|
1654
|
-
s.target && !r.current && ir(
|
|
1654
|
+
s.target && !r.current && ir(Ui, n, { originalEvent: s }, {
|
|
1655
1655
|
discrete: !1
|
|
1656
1656
|
});
|
|
1657
1657
|
};
|
|
@@ -2463,7 +2463,7 @@ function de(e) {
|
|
|
2463
2463
|
function ve(e) {
|
|
2464
2464
|
return Ct() ? e instanceof HTMLElement || e instanceof se(e).HTMLElement : !1;
|
|
2465
2465
|
}
|
|
2466
|
-
function
|
|
2466
|
+
function Un(e) {
|
|
2467
2467
|
return !Ct() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof se(e).ShadowRoot;
|
|
2468
2468
|
}
|
|
2469
2469
|
const Es = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
@@ -2532,10 +2532,10 @@ function Re(e) {
|
|
|
2532
2532
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
2533
2533
|
e.assignedSlot || // DOM Element detected.
|
|
2534
2534
|
e.parentNode || // ShadowRoot detected.
|
|
2535
|
-
|
|
2535
|
+
Un(e) && e.host || // Fallback.
|
|
2536
2536
|
ge(e)
|
|
2537
2537
|
);
|
|
2538
|
-
return
|
|
2538
|
+
return Un(t) ? t.host : t;
|
|
2539
2539
|
}
|
|
2540
2540
|
function dr(e) {
|
|
2541
2541
|
const t = Re(e);
|
|
@@ -2667,7 +2667,7 @@ function Ls(e) {
|
|
|
2667
2667
|
y: a
|
|
2668
2668
|
};
|
|
2669
2669
|
}
|
|
2670
|
-
const
|
|
2670
|
+
const zn = 25;
|
|
2671
2671
|
function Fs(e, t) {
|
|
2672
2672
|
const n = se(e), r = ge(e), o = n.visualViewport;
|
|
2673
2673
|
let s = r.clientWidth, i = r.clientHeight, a = 0, d = 0;
|
|
@@ -2679,8 +2679,8 @@ function Fs(e, t) {
|
|
|
2679
2679
|
const f = Ot(r);
|
|
2680
2680
|
if (f <= 0) {
|
|
2681
2681
|
const g = r.ownerDocument, m = g.body, v = getComputedStyle(m), p = g.compatMode === "CSS1Compat" && parseFloat(v.marginLeft) + parseFloat(v.marginRight) || 0, l = Math.abs(r.clientWidth - m.clientWidth - p);
|
|
2682
|
-
l <=
|
|
2683
|
-
} else f <=
|
|
2682
|
+
l <= zn && (s -= l);
|
|
2683
|
+
} else f <= zn && (s += f);
|
|
2684
2684
|
return {
|
|
2685
2685
|
width: s,
|
|
2686
2686
|
height: i,
|
|
@@ -2762,7 +2762,7 @@ function Hs(e) {
|
|
|
2762
2762
|
height: n
|
|
2763
2763
|
};
|
|
2764
2764
|
}
|
|
2765
|
-
function
|
|
2765
|
+
function Us(e, t, n) {
|
|
2766
2766
|
const r = ve(t), o = ge(t), s = n === "fixed", i = Ae(e, !0, s, t);
|
|
2767
2767
|
let a = {
|
|
2768
2768
|
scrollLeft: 0,
|
|
@@ -2815,10 +2815,10 @@ function vr(e, t) {
|
|
|
2815
2815
|
r = qn(r, t);
|
|
2816
2816
|
return r && We(r) && Wt(r) && !un(r) ? n : r || Ms(e) || n;
|
|
2817
2817
|
}
|
|
2818
|
-
const
|
|
2818
|
+
const zs = async function(e) {
|
|
2819
2819
|
const t = this.getOffsetParent || vr, n = this.getDimensions, r = await n(e.floating);
|
|
2820
2820
|
return {
|
|
2821
|
-
reference:
|
|
2821
|
+
reference: Us(e.reference, await t(e.floating), e.strategy),
|
|
2822
2822
|
floating: {
|
|
2823
2823
|
x: 0,
|
|
2824
2824
|
y: 0,
|
|
@@ -2835,7 +2835,7 @@ const qs = {
|
|
|
2835
2835
|
getDocumentElement: ge,
|
|
2836
2836
|
getClippingRect: $s,
|
|
2837
2837
|
getOffsetParent: vr,
|
|
2838
|
-
getElementRects:
|
|
2838
|
+
getElementRects: zs,
|
|
2839
2839
|
getClientRects: js,
|
|
2840
2840
|
getDimensions: Hs,
|
|
2841
2841
|
getScale: Fe,
|
|
@@ -3186,7 +3186,7 @@ var _r = "PopperAnchor", Er = u.forwardRef(
|
|
|
3186
3186
|
Er.displayName = _r;
|
|
3187
3187
|
var hn = "PopperContent", [ya, wa] = br(hn), Rr = u.forwardRef(
|
|
3188
3188
|
(e, t) => {
|
|
3189
|
-
var D,
|
|
3189
|
+
var D, U, G, z, Y, K;
|
|
3190
3190
|
const {
|
|
3191
3191
|
__scopePopper: n,
|
|
3192
3192
|
side: r = "bottom",
|
|
@@ -3241,7 +3241,7 @@ var hn = "PopperContent", [ya, wa] = br(hn), Rr = u.forwardRef(
|
|
|
3241
3241
|
ne(() => {
|
|
3242
3242
|
M && (S == null || S());
|
|
3243
3243
|
}, [M, S]);
|
|
3244
|
-
const F = (D = A.arrow) == null ? void 0 : D.x, V = (
|
|
3244
|
+
const F = (D = A.arrow) == null ? void 0 : D.x, V = (U = A.arrow) == null ? void 0 : U.y, $ = ((G = A.arrow) == null ? void 0 : G.centerOffset) !== 0, [q, Z] = u.useState();
|
|
3245
3245
|
return ne(() => {
|
|
3246
3246
|
w && Z(window.getComputedStyle(w).zIndex);
|
|
3247
3247
|
}, [w]), /* @__PURE__ */ b.jsx(
|
|
@@ -3256,7 +3256,7 @@ var hn = "PopperContent", [ya, wa] = br(hn), Rr = u.forwardRef(
|
|
|
3256
3256
|
minWidth: "max-content",
|
|
3257
3257
|
zIndex: q,
|
|
3258
3258
|
"--radix-popper-transform-origin": [
|
|
3259
|
-
(
|
|
3259
|
+
(z = A.transformOrigin) == null ? void 0 : z.x,
|
|
3260
3260
|
(Y = A.transformOrigin) == null ? void 0 : Y.y
|
|
3261
3261
|
].join(" "),
|
|
3262
3262
|
// hide the content if using the hide middleware and should be hidden
|
|
@@ -3642,12 +3642,12 @@ jr.isSideCarExport = !0;
|
|
|
3642
3642
|
function $a(e, t) {
|
|
3643
3643
|
return e.useMedium(t), jr;
|
|
3644
3644
|
}
|
|
3645
|
-
var Lr = Va(),
|
|
3645
|
+
var Lr = Va(), Ut = function() {
|
|
3646
3646
|
}, Mt = u.forwardRef(function(e, t) {
|
|
3647
3647
|
var n = u.useRef(null), r = u.useState({
|
|
3648
|
-
onScrollCapture:
|
|
3649
|
-
onWheelCapture:
|
|
3650
|
-
onTouchMoveCapture:
|
|
3648
|
+
onScrollCapture: Ut,
|
|
3649
|
+
onWheelCapture: Ut,
|
|
3650
|
+
onTouchMoveCapture: Ut
|
|
3651
3651
|
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, d = e.className, f = e.removeScrollBar, g = e.enabled, m = e.shards, v = e.sideCar, p = e.noRelative, l = e.noIsolation, c = e.inert, h = e.allowPinchZoom, w = e.as, y = w === void 0 ? "div" : w, x = e.gapMode, R = Dr(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), _ = v, O = Fa([n, t]), T = pe(pe({}, R), o);
|
|
3652
3652
|
return u.createElement(
|
|
3653
3653
|
u.Fragment,
|
|
@@ -3669,7 +3669,7 @@ var Ha = function() {
|
|
|
3669
3669
|
if (typeof __webpack_nonce__ < "u")
|
|
3670
3670
|
return __webpack_nonce__;
|
|
3671
3671
|
};
|
|
3672
|
-
function
|
|
3672
|
+
function Ua() {
|
|
3673
3673
|
if (!document)
|
|
3674
3674
|
return null;
|
|
3675
3675
|
var e = document.createElement("style");
|
|
@@ -3677,7 +3677,7 @@ function za() {
|
|
|
3677
3677
|
var t = Ha();
|
|
3678
3678
|
return t && e.setAttribute("nonce", t), e;
|
|
3679
3679
|
}
|
|
3680
|
-
function
|
|
3680
|
+
function za(e, t) {
|
|
3681
3681
|
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
3682
3682
|
}
|
|
3683
3683
|
function Ya(e) {
|
|
@@ -3688,7 +3688,7 @@ var qa = function() {
|
|
|
3688
3688
|
var e = 0, t = null;
|
|
3689
3689
|
return {
|
|
3690
3690
|
add: function(n) {
|
|
3691
|
-
e == 0 && (t =
|
|
3691
|
+
e == 0 && (t = Ua()) && (za(t, n), Ya(t)), e++;
|
|
3692
3692
|
},
|
|
3693
3693
|
remove: function() {
|
|
3694
3694
|
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
@@ -3714,11 +3714,11 @@ var qa = function() {
|
|
|
3714
3714
|
top: 0,
|
|
3715
3715
|
right: 0,
|
|
3716
3716
|
gap: 0
|
|
3717
|
-
},
|
|
3717
|
+
}, zt = function(e) {
|
|
3718
3718
|
return parseInt(e || "", 10) || 0;
|
|
3719
3719
|
}, Za = function(e) {
|
|
3720
3720
|
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
3721
|
-
return [
|
|
3721
|
+
return [zt(n), zt(r), zt(o)];
|
|
3722
3722
|
}, Ga = function(e) {
|
|
3723
3723
|
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
3724
3724
|
return Xa;
|
|
@@ -3974,10 +3974,10 @@ var gn = u.forwardRef(function(e, t) {
|
|
|
3974
3974
|
return u.createElement(Mt, pe({}, e, { ref: t, sideCar: hc }));
|
|
3975
3975
|
});
|
|
3976
3976
|
gn.classNames = Mt.classNames;
|
|
3977
|
-
var mc = [" ", "Enter", "ArrowUp", "ArrowDown"], vc = [" ", "Enter"], Me = "Select", [kt, Nt, gc] = ji(Me), [
|
|
3977
|
+
var mc = [" ", "Enter", "ArrowUp", "ArrowDown"], vc = [" ", "Enter"], Me = "Select", [kt, Nt, gc] = ji(Me), [Ue] = Et(Me, [
|
|
3978
3978
|
gc,
|
|
3979
3979
|
At
|
|
3980
|
-
]), It = At(), [yc, Ce] =
|
|
3980
|
+
]), It = At(), [yc, Ce] = Ue(Me), [wc, bc] = Ue(Me), $r = (e) => {
|
|
3981
3981
|
const {
|
|
3982
3982
|
__scopeSelect: t,
|
|
3983
3983
|
children: n,
|
|
@@ -4064,7 +4064,7 @@ var mc = [" ", "Enter", "ArrowUp", "ArrowDown"], vc = [" ", "Enter"], Me = "Sele
|
|
|
4064
4064
|
) });
|
|
4065
4065
|
};
|
|
4066
4066
|
$r.displayName = Me;
|
|
4067
|
-
var Hr = "SelectTrigger",
|
|
4067
|
+
var Hr = "SelectTrigger", Ur = u.forwardRef(
|
|
4068
4068
|
(e, t) => {
|
|
4069
4069
|
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = It(n), i = Ce(Hr, n), a = i.disabled || r, d = Q(t, i.onTriggerChange), f = Nt(n), g = u.useRef("touch"), [m, v, p] = lo((c) => {
|
|
4070
4070
|
const h = f().filter((x) => !x.disabled), w = h.find((x) => x.value === i.value), y = uo(h, c, w);
|
|
@@ -4107,10 +4107,10 @@ var Hr = "SelectTrigger", zr = u.forwardRef(
|
|
|
4107
4107
|
) });
|
|
4108
4108
|
}
|
|
4109
4109
|
);
|
|
4110
|
-
|
|
4111
|
-
var
|
|
4110
|
+
Ur.displayName = Hr;
|
|
4111
|
+
var zr = "SelectValue", Yr = u.forwardRef(
|
|
4112
4112
|
(e, t) => {
|
|
4113
|
-
const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, d = Ce(
|
|
4113
|
+
const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, d = Ce(zr, n), { onValueNodeHasChildrenChange: f } = d, g = s !== void 0, m = Q(t, d.onValueNodeChange);
|
|
4114
4114
|
return ne(() => {
|
|
4115
4115
|
f(g);
|
|
4116
4116
|
}, [f, g]), /* @__PURE__ */ b.jsx(
|
|
@@ -4124,7 +4124,7 @@ var Ur = "SelectValue", Yr = u.forwardRef(
|
|
|
4124
4124
|
);
|
|
4125
4125
|
}
|
|
4126
4126
|
);
|
|
4127
|
-
Yr.displayName =
|
|
4127
|
+
Yr.displayName = zr;
|
|
4128
4128
|
var xc = "SelectIcon", qr = u.forwardRef(
|
|
4129
4129
|
(e, t) => {
|
|
4130
4130
|
const { __scopeSelect: n, children: r, ...o } = e;
|
|
@@ -4150,7 +4150,7 @@ var ke = "SelectContent", Xr = u.forwardRef(
|
|
|
4150
4150
|
}
|
|
4151
4151
|
);
|
|
4152
4152
|
Xr.displayName = ke;
|
|
4153
|
-
var ue = 10, [Zr, Te] =
|
|
4153
|
+
var ue = 10, [Zr, Te] = Ue(ke), _c = "SelectContentImpl", Ec = /* @__PURE__ */ et("SelectContent.RemoveScroll"), Gr = u.forwardRef(
|
|
4154
4154
|
(e, t) => {
|
|
4155
4155
|
const {
|
|
4156
4156
|
__scopeSelect: n,
|
|
@@ -4180,9 +4180,9 @@ var ue = 10, [Zr, Te] = ze(ke), _c = "SelectContentImpl", Ec = /* @__PURE__ */ e
|
|
|
4180
4180
|
}, [x]), sr();
|
|
4181
4181
|
const k = u.useCallback(
|
|
4182
4182
|
(D) => {
|
|
4183
|
-
const [
|
|
4183
|
+
const [U, ...G] = E().map((K) => K.ref.current), [z] = G.slice(-1), Y = document.activeElement;
|
|
4184
4184
|
for (const K of D)
|
|
4185
|
-
if (K === Y || (K == null || K.scrollIntoView({ block: "nearest" }), K ===
|
|
4185
|
+
if (K === Y || (K == null || K.scrollIntoView({ block: "nearest" }), K === U && _ && (_.scrollTop = 0), K === z && _ && (_.scrollTop = _.scrollHeight), K == null || K.focus(), document.activeElement !== Y)) return;
|
|
4186
4186
|
},
|
|
4187
4187
|
[E, _]
|
|
4188
4188
|
), M = u.useCallback(
|
|
@@ -4196,17 +4196,17 @@ var ue = 10, [Zr, Te] = ze(ke), _c = "SelectContentImpl", Ec = /* @__PURE__ */ e
|
|
|
4196
4196
|
u.useEffect(() => {
|
|
4197
4197
|
if (x) {
|
|
4198
4198
|
let D = { x: 0, y: 0 };
|
|
4199
|
-
const
|
|
4199
|
+
const U = (z) => {
|
|
4200
4200
|
var Y, K;
|
|
4201
4201
|
D = {
|
|
4202
|
-
x: Math.abs(Math.round(
|
|
4203
|
-
y: Math.abs(Math.round(
|
|
4202
|
+
x: Math.abs(Math.round(z.pageX) - (((Y = j.current) == null ? void 0 : Y.x) ?? 0)),
|
|
4203
|
+
y: Math.abs(Math.round(z.pageY) - (((K = j.current) == null ? void 0 : K.y) ?? 0))
|
|
4204
4204
|
};
|
|
4205
|
-
}, G = (
|
|
4206
|
-
D.x <= 10 && D.y <= 10 ?
|
|
4205
|
+
}, G = (z) => {
|
|
4206
|
+
D.x <= 10 && D.y <= 10 ? z.preventDefault() : x.contains(z.target) || A(!1), document.removeEventListener("pointermove", U), j.current = null;
|
|
4207
4207
|
};
|
|
4208
|
-
return j.current !== null && (document.addEventListener("pointermove",
|
|
4209
|
-
document.removeEventListener("pointermove",
|
|
4208
|
+
return j.current !== null && (document.addEventListener("pointermove", U), document.addEventListener("pointerup", G, { capture: !0, once: !0 })), () => {
|
|
4209
|
+
document.removeEventListener("pointermove", U), document.removeEventListener("pointerup", G, { capture: !0 });
|
|
4210
4210
|
};
|
|
4211
4211
|
}
|
|
4212
4212
|
}, [x, A, j]), u.useEffect(() => {
|
|
@@ -4216,18 +4216,18 @@ var ue = 10, [Zr, Te] = ze(ke), _c = "SelectContentImpl", Ec = /* @__PURE__ */ e
|
|
|
4216
4216
|
};
|
|
4217
4217
|
}, [A]);
|
|
4218
4218
|
const [H, S] = lo((D) => {
|
|
4219
|
-
const
|
|
4220
|
-
|
|
4219
|
+
const U = E().filter((Y) => !Y.disabled), G = U.find((Y) => Y.ref.current === document.activeElement), z = uo(U, D, G);
|
|
4220
|
+
z && setTimeout(() => z.ref.current.focus());
|
|
4221
4221
|
}), F = u.useCallback(
|
|
4222
|
-
(D,
|
|
4223
|
-
const
|
|
4224
|
-
(y.value !== void 0 && y.value ===
|
|
4222
|
+
(D, U, G) => {
|
|
4223
|
+
const z = !N.current && !G;
|
|
4224
|
+
(y.value !== void 0 && y.value === U || z) && (I(D), z && (N.current = !0));
|
|
4225
4225
|
},
|
|
4226
4226
|
[y.value]
|
|
4227
4227
|
), V = u.useCallback(() => x == null ? void 0 : x.focus(), [x]), $ = u.useCallback(
|
|
4228
|
-
(D,
|
|
4229
|
-
const
|
|
4230
|
-
(y.value !== void 0 && y.value ===
|
|
4228
|
+
(D, U, G) => {
|
|
4229
|
+
const z = !N.current && !G;
|
|
4230
|
+
(y.value !== void 0 && y.value === U || z) && W(D);
|
|
4231
4231
|
},
|
|
4232
4232
|
[y.value]
|
|
4233
4233
|
), q = r === "popper" ? Jt : Jr, Z = q === Jt ? {
|
|
@@ -4267,8 +4267,8 @@ var ue = 10, [Zr, Te] = ze(ke), _c = "SelectContentImpl", Ec = /* @__PURE__ */ e
|
|
|
4267
4267
|
D.preventDefault();
|
|
4268
4268
|
},
|
|
4269
4269
|
onUnmountAutoFocus: X(o, (D) => {
|
|
4270
|
-
var
|
|
4271
|
-
(
|
|
4270
|
+
var U;
|
|
4271
|
+
(U = y.trigger) == null || U.focus({ preventScroll: !0 }), D.preventDefault();
|
|
4272
4272
|
}),
|
|
4273
4273
|
children: /* @__PURE__ */ b.jsx(
|
|
4274
4274
|
on,
|
|
@@ -4300,14 +4300,14 @@ var ue = 10, [Zr, Te] = ze(ke), _c = "SelectContentImpl", Ec = /* @__PURE__ */ e
|
|
|
4300
4300
|
...w.style
|
|
4301
4301
|
},
|
|
4302
4302
|
onKeyDown: X(w.onKeyDown, (D) => {
|
|
4303
|
-
const
|
|
4304
|
-
if (D.key === "Tab" && D.preventDefault(), !
|
|
4305
|
-
let
|
|
4306
|
-
if (["ArrowUp", "End"].includes(D.key) && (
|
|
4307
|
-
const Y = D.target, K =
|
|
4308
|
-
|
|
4303
|
+
const U = D.ctrlKey || D.altKey || D.metaKey;
|
|
4304
|
+
if (D.key === "Tab" && D.preventDefault(), !U && D.key.length === 1 && S(D.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(D.key)) {
|
|
4305
|
+
let z = E().filter((Y) => !Y.disabled).map((Y) => Y.ref.current);
|
|
4306
|
+
if (["ArrowUp", "End"].includes(D.key) && (z = z.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(D.key)) {
|
|
4307
|
+
const Y = D.target, K = z.indexOf(Y);
|
|
4308
|
+
z = z.slice(K + 1);
|
|
4309
4309
|
}
|
|
4310
|
-
setTimeout(() => k(
|
|
4310
|
+
setTimeout(() => k(z)), D.preventDefault();
|
|
4311
4311
|
}
|
|
4312
4312
|
})
|
|
4313
4313
|
}
|
|
@@ -4343,15 +4343,15 @@ var Rc = "SelectItemAlignedPosition", Jr = u.forwardRef((e, t) => {
|
|
|
4343
4343
|
]);
|
|
4344
4344
|
a.style.minWidth = ae + "px", a.style.right = xe + "px";
|
|
4345
4345
|
}
|
|
4346
|
-
const W = v(), E = window.innerHeight - ue * 2, C = c.scrollHeight, P = window.getComputedStyle(f), N = parseInt(P.borderTopWidth, 10), k = parseInt(P.paddingTop, 10), M = parseInt(P.borderBottomWidth, 10), A = parseInt(P.paddingBottom, 10), j = N + k + C + A + M, H = Math.min(h.offsetHeight * 5, j), S = window.getComputedStyle(c), F = parseInt(S.paddingTop, 10), V = parseInt(S.paddingBottom, 10), $ = T.top + T.height / 2 - ue, q = E - $, Z = h.offsetHeight / 2, D = h.offsetTop + Z,
|
|
4347
|
-
if (
|
|
4346
|
+
const W = v(), E = window.innerHeight - ue * 2, C = c.scrollHeight, P = window.getComputedStyle(f), N = parseInt(P.borderTopWidth, 10), k = parseInt(P.paddingTop, 10), M = parseInt(P.borderBottomWidth, 10), A = parseInt(P.paddingBottom, 10), j = N + k + C + A + M, H = Math.min(h.offsetHeight * 5, j), S = window.getComputedStyle(c), F = parseInt(S.paddingTop, 10), V = parseInt(S.paddingBottom, 10), $ = T.top + T.height / 2 - ue, q = E - $, Z = h.offsetHeight / 2, D = h.offsetTop + Z, U = N + k + D, G = j - U;
|
|
4347
|
+
if (U <= $) {
|
|
4348
4348
|
const Y = W.length > 0 && h === W[W.length - 1].ref.current;
|
|
4349
4349
|
a.style.bottom = "0px";
|
|
4350
4350
|
const K = f.clientHeight - c.offsetTop - c.offsetHeight, ee = Math.max(
|
|
4351
4351
|
q,
|
|
4352
4352
|
Z + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
4353
4353
|
(Y ? V : 0) + K + M
|
|
4354
|
-
), ae =
|
|
4354
|
+
), ae = U + ee;
|
|
4355
4355
|
a.style.height = ae + "px";
|
|
4356
4356
|
} else {
|
|
4357
4357
|
const Y = W.length > 0 && h === W[0].ref.current;
|
|
@@ -4361,7 +4361,7 @@ var Rc = "SelectItemAlignedPosition", Jr = u.forwardRef((e, t) => {
|
|
|
4361
4361
|
N + c.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
4362
4362
|
(Y ? F : 0) + Z
|
|
4363
4363
|
) + G;
|
|
4364
|
-
a.style.height = ee + "px", c.scrollTop =
|
|
4364
|
+
a.style.height = ee + "px", c.scrollTop = U - $ + c.offsetTop;
|
|
4365
4365
|
}
|
|
4366
4366
|
a.style.margin = `${ue}px 0`, a.style.minHeight = H + "px", a.style.maxHeight = E + "px", r == null || r(), requestAnimationFrame(() => p.current = !0);
|
|
4367
4367
|
}
|
|
@@ -4455,7 +4455,7 @@ var Cc = "SelectPopperPosition", Jt = u.forwardRef((e, t) => {
|
|
|
4455
4455
|
);
|
|
4456
4456
|
});
|
|
4457
4457
|
Jt.displayName = Cc;
|
|
4458
|
-
var [Tc, yn] =
|
|
4458
|
+
var [Tc, yn] = Ue(ke, {}), Qt = "SelectViewport", Qr = u.forwardRef(
|
|
4459
4459
|
(e, t) => {
|
|
4460
4460
|
const { __scopeSelect: n, nonce: r, ...o } = e, s = Te(Qt, n), i = yn(Qt, n), a = Q(t, s.onViewportChange), d = u.useRef(0);
|
|
4461
4461
|
return /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
|
|
@@ -4508,7 +4508,7 @@ var [Tc, yn] = ze(ke, {}), Qt = "SelectViewport", Qr = u.forwardRef(
|
|
|
4508
4508
|
}
|
|
4509
4509
|
);
|
|
4510
4510
|
Qr.displayName = Qt;
|
|
4511
|
-
var eo = "SelectGroup", [Pc, Oc] =
|
|
4511
|
+
var eo = "SelectGroup", [Pc, Oc] = Ue(eo), Ac = u.forwardRef(
|
|
4512
4512
|
(e, t) => {
|
|
4513
4513
|
const { __scopeSelect: n, ...r } = e, o = Rt();
|
|
4514
4514
|
return /* @__PURE__ */ b.jsx(Pc, { scope: n, id: o, children: /* @__PURE__ */ b.jsx(J.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
|
|
@@ -4522,7 +4522,7 @@ var to = "SelectLabel", Mc = u.forwardRef(
|
|
|
4522
4522
|
}
|
|
4523
4523
|
);
|
|
4524
4524
|
Mc.displayName = to;
|
|
4525
|
-
var St = "SelectItem", [kc, no] =
|
|
4525
|
+
var St = "SelectItem", [kc, no] = Ue(St), ro = u.forwardRef(
|
|
4526
4526
|
(e, t) => {
|
|
4527
4527
|
const {
|
|
4528
4528
|
__scopeSelect: n,
|
|
@@ -4778,7 +4778,7 @@ function uo(e, t, n) {
|
|
|
4778
4778
|
function Wc(e, t) {
|
|
4779
4779
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
4780
4780
|
}
|
|
4781
|
-
var Vc = $r, $c =
|
|
4781
|
+
var Vc = $r, $c = Ur, Hc = Yr, Uc = qr, zc = Kr, Yc = Xr, qc = Qr, Kc = ro, Xc = oo;
|
|
4782
4782
|
const Zc = "_trigger_14rt8_1", Gc = "_icon_14rt8_33", Jc = "_content_14rt8_39", Qc = "_viewport_14rt8_47", el = "_item_14rt8_51", Je = {
|
|
4783
4783
|
trigger: Zc,
|
|
4784
4784
|
icon: Gc,
|
|
@@ -4795,9 +4795,9 @@ const Zc = "_trigger_14rt8_1", Gc = "_icon_14rt8_33", Jc = "_content_14rt8_39",
|
|
|
4795
4795
|
}) => /* @__PURE__ */ b.jsxs(Vc, { value: e, onValueChange: t, disabled: s, children: [
|
|
4796
4796
|
/* @__PURE__ */ b.jsxs($c, { className: `${Je.trigger} ${o} cursor-pointer`, children: [
|
|
4797
4797
|
/* @__PURE__ */ b.jsx(Hc, { placeholder: r }),
|
|
4798
|
-
/* @__PURE__ */ b.jsx(
|
|
4798
|
+
/* @__PURE__ */ b.jsx(Uc, { className: Je.icon, children: /* @__PURE__ */ b.jsx(zo, { size: 14, color: "currentColor" }) })
|
|
4799
4799
|
] }),
|
|
4800
|
-
/* @__PURE__ */ b.jsx(
|
|
4800
|
+
/* @__PURE__ */ b.jsx(zc, { children: /* @__PURE__ */ b.jsx(Yc, { className: Je.content, position: "popper", sideOffset: 4, children: /* @__PURE__ */ b.jsx(qc, { className: Je.viewport, children: n.map((i) => /* @__PURE__ */ b.jsx(
|
|
4801
4801
|
Kc,
|
|
4802
4802
|
{
|
|
4803
4803
|
value: i.value,
|
|
@@ -5126,13 +5126,13 @@ function $l({ children: e }) {
|
|
|
5126
5126
|
function Hl({ children: e }) {
|
|
5127
5127
|
return /* @__PURE__ */ b.jsx("tr", { className: _e.dataRow, children: e });
|
|
5128
5128
|
}
|
|
5129
|
-
function
|
|
5129
|
+
function Ul({ label: e, children: t }) {
|
|
5130
5130
|
return e || t ? /* @__PURE__ */ b.jsx("td", { children: /* @__PURE__ */ b.jsxs("div", { className: _e.cellInner, children: [
|
|
5131
5131
|
e && /* @__PURE__ */ b.jsx("span", { className: _e.cellLabel, children: e }),
|
|
5132
5132
|
t && /* @__PURE__ */ b.jsx("div", { className: _e.cellContent, children: t })
|
|
5133
5133
|
] }) }) : /* @__PURE__ */ b.jsx("td", { children: t });
|
|
5134
5134
|
}
|
|
5135
|
-
function
|
|
5135
|
+
function zl({ children: e }) {
|
|
5136
5136
|
return /* @__PURE__ */ b.jsx("span", { className: _e.value, children: e });
|
|
5137
5137
|
}
|
|
5138
5138
|
function Yl({ children: e }) {
|
|
@@ -5150,10 +5150,10 @@ export {
|
|
|
5150
5150
|
Bl as Select,
|
|
5151
5151
|
Fl as Slider,
|
|
5152
5152
|
Vl as Table,
|
|
5153
|
-
|
|
5153
|
+
Ul as TableCell,
|
|
5154
5154
|
$l as TableHeader,
|
|
5155
5155
|
Yl as TableIcon,
|
|
5156
5156
|
Hl as TableRow,
|
|
5157
|
-
|
|
5157
|
+
zl as TableValue,
|
|
5158
5158
|
Ll as ToggleSwitch
|
|
5159
5159
|
};
|