@epilot/volt-ui 1.1.1 → 1.1.2-alpha.2
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/components/badge/badge.d.ts +1 -1
- package/dist/components/button/button.d.ts +2 -0
- package/dist/index.cjs.js +1 -51
- package/dist/index.cjs10.js +1 -0
- package/dist/index.cjs100.js +1 -0
- package/dist/index.cjs101.js +1 -0
- package/dist/index.cjs102.js +1 -0
- package/dist/index.cjs103.js +1 -0
- package/dist/index.cjs104.js +1 -0
- package/dist/index.cjs105.js +1 -0
- package/dist/index.cjs106.js +1 -0
- package/dist/index.cjs11.js +1 -0
- package/dist/index.cjs12.js +1 -0
- package/dist/index.cjs13.js +1 -0
- package/dist/index.cjs14.js +1 -0
- package/dist/index.cjs15.js +1 -0
- package/dist/index.cjs16.js +1 -0
- package/dist/index.cjs17.js +1 -0
- package/dist/index.cjs18.js +1 -0
- package/dist/index.cjs19.js +1 -0
- package/dist/index.cjs20.js +1 -0
- package/dist/index.cjs21.js +1 -0
- package/dist/index.cjs22.js +1 -0
- package/dist/index.cjs23.js +1 -0
- package/dist/index.cjs24.js +1 -0
- package/dist/index.cjs25.js +1 -0
- package/dist/index.cjs26.js +1 -0
- package/dist/index.cjs27.js +1 -0
- package/dist/index.cjs28.js +1 -0
- package/dist/index.cjs29.js +1 -0
- package/dist/index.cjs30.js +1 -0
- package/dist/index.cjs31.js +1 -0
- package/dist/index.cjs32.js +1 -0
- package/dist/index.cjs33.js +1 -0
- package/dist/index.cjs34.js +1 -0
- package/dist/index.cjs35.js +1 -0
- package/dist/index.cjs36.js +1 -0
- package/dist/index.cjs37.js +1 -0
- package/dist/index.cjs38.js +1 -0
- package/dist/index.cjs39.js +1 -0
- package/dist/index.cjs4.js +1 -0
- package/dist/index.cjs40.js +5 -0
- package/dist/index.cjs41.js +1 -0
- package/dist/index.cjs42.js +1 -0
- package/dist/index.cjs43.js +1 -0
- package/dist/index.cjs44.js +7 -0
- package/dist/index.cjs45.js +1 -0
- package/dist/index.cjs46.js +1 -0
- package/dist/index.cjs47.js +1 -0
- package/dist/index.cjs48.js +1 -0
- package/dist/index.cjs49.js +1 -0
- package/dist/index.cjs5.js +1 -0
- package/dist/index.cjs50.js +1 -0
- package/dist/index.cjs51.js +1 -0
- package/dist/index.cjs52.js +1 -0
- package/dist/index.cjs53.js +1 -0
- package/dist/index.cjs54.js +1 -0
- package/dist/index.cjs55.js +1 -0
- package/dist/index.cjs56.js +1 -0
- package/dist/index.cjs57.js +1 -0
- package/dist/index.cjs58.js +1 -0
- package/dist/index.cjs59.js +1 -0
- package/dist/index.cjs6.js +1 -0
- package/dist/index.cjs60.js +1 -0
- package/dist/index.cjs61.js +1 -0
- package/dist/index.cjs62.js +1 -0
- package/dist/index.cjs63.js +1 -0
- package/dist/index.cjs64.js +1 -0
- package/dist/index.cjs65.js +1 -0
- package/dist/index.cjs66.js +1 -0
- package/dist/index.cjs67.js +1 -0
- package/dist/index.cjs68.js +1 -0
- package/dist/index.cjs69.js +1 -0
- package/dist/index.cjs7.js +1 -0
- package/dist/index.cjs70.js +1 -0
- package/dist/index.cjs71.js +1 -0
- package/dist/index.cjs72.js +1 -0
- package/dist/index.cjs73.js +1 -0
- package/dist/index.cjs74.js +1 -0
- package/dist/index.cjs75.js +1 -0
- package/dist/index.cjs76.js +1 -0
- package/dist/index.cjs77.js +1 -0
- package/dist/index.cjs78.js +1 -0
- package/dist/index.cjs79.js +1 -0
- package/dist/index.cjs8.js +1 -0
- package/dist/index.cjs80.js +1 -0
- package/dist/index.cjs81.js +1 -0
- package/dist/index.cjs82.js +1 -0
- package/dist/index.cjs83.js +1 -0
- package/dist/index.cjs84.js +1 -0
- package/dist/index.cjs85.js +1 -0
- package/dist/index.cjs86.js +1 -0
- package/dist/index.cjs87.js +1 -0
- package/dist/index.cjs88.js +1 -0
- package/dist/index.cjs89.js +1 -0
- package/dist/index.cjs9.js +1 -0
- package/dist/index.cjs90.js +1 -0
- package/dist/index.cjs91.js +4 -0
- package/dist/index.cjs92.js +1 -0
- package/dist/index.cjs93.js +1 -0
- package/dist/index.cjs94.js +1 -0
- package/dist/index.cjs95.js +1 -0
- package/dist/index.cjs96.js +1 -0
- package/dist/index.cjs97.js +38 -0
- package/dist/index.cjs98.js +1 -0
- package/dist/index.cjs99.js +1 -0
- package/dist/index.es.js +125 -11648
- package/dist/index.es10.js +29 -0
- package/dist/index.es100.js +68 -0
- package/dist/index.es101.js +6 -0
- package/dist/index.es102.js +25 -0
- package/dist/index.es103.js +25 -0
- package/dist/index.es104.js +15 -0
- package/dist/index.es105.js +30 -0
- package/dist/index.es106.js +7 -0
- package/dist/index.es11.js +250 -0
- package/dist/index.es12.js +230 -0
- package/dist/index.es13.js +34 -0
- package/dist/index.es14.js +40 -0
- package/dist/index.es15.js +43 -0
- package/dist/index.es16.js +115 -0
- package/dist/index.es17.js +24 -0
- package/dist/index.es18.js +36 -0
- package/dist/index.es19.js +137 -0
- package/dist/index.es20.js +50 -0
- package/dist/index.es21.js +54 -0
- package/dist/index.es22.js +74 -0
- package/dist/index.es23.js +172 -0
- package/dist/index.es24.js +89 -0
- package/dist/index.es25.js +113 -0
- package/dist/index.es26.js +85 -0
- package/dist/index.es27.js +61 -0
- package/dist/index.es28.js +746 -0
- package/dist/index.es29.js +17 -0
- package/dist/index.es30.js +2763 -0
- package/dist/index.es31.js +62 -0
- package/dist/index.es32.js +35 -0
- package/dist/index.es33.js +126 -0
- package/dist/index.es34.js +862 -0
- package/dist/index.es35.js +20 -0
- package/dist/index.es36.js +331 -0
- package/dist/index.es37.js +132 -0
- package/dist/index.es38.js +24 -0
- package/dist/index.es39.js +243 -0
- package/dist/index.es4.js +6 -0
- package/dist/index.es40.js +262 -0
- package/dist/index.es41.js +251 -0
- package/dist/index.es42.js +238 -0
- package/dist/index.es43.js +239 -0
- package/dist/index.es44.js +127 -0
- package/dist/index.es45.js +163 -0
- package/dist/index.es46.js +29 -0
- package/dist/index.es47.js +32 -0
- package/dist/index.es48.js +9 -0
- package/dist/index.es49.js +70 -0
- package/dist/index.es5.js +50 -0
- package/dist/index.es50.js +127 -0
- package/dist/index.es51.js +17 -0
- package/dist/index.es52.js +137 -0
- package/dist/index.es53.js +13 -0
- package/dist/index.es54.js +221 -0
- package/dist/index.es55.js +16 -0
- package/dist/index.es56.js +71 -0
- package/dist/index.es57.js +36 -0
- package/dist/index.es58.js +50 -0
- package/dist/index.es59.js +54 -0
- package/dist/index.es6.js +66 -0
- package/dist/index.es60.js +52 -0
- package/dist/index.es61.js +11 -0
- package/dist/index.es62.js +11 -0
- package/dist/index.es63.js +32 -0
- package/dist/index.es64.js +8 -0
- package/dist/index.es65.js +27 -0
- package/dist/index.es66.js +183 -0
- package/dist/index.es67.js +10 -0
- package/dist/index.es68.js +11 -0
- package/dist/index.es69.js +32 -0
- package/dist/index.es7.js +167 -0
- package/dist/index.es70.js +48 -0
- package/dist/index.es71.js +120 -0
- package/dist/index.es72.js +50 -0
- package/dist/index.es73.js +312 -0
- package/dist/index.es74.js +6 -0
- package/dist/index.es75.js +50 -0
- package/dist/index.es76.js +13 -0
- package/dist/index.es77.js +6 -0
- package/dist/index.es78.js +50 -0
- package/dist/index.es79.js +14 -0
- package/dist/index.es8.js +39 -0
- package/dist/index.es80.js +208 -0
- package/dist/index.es81.js +24 -0
- package/dist/index.es82.js +402 -0
- package/dist/index.es83.js +17 -0
- package/dist/index.es84.js +32 -0
- package/dist/index.es85.js +27 -0
- package/dist/index.es86.js +31 -0
- package/dist/index.es87.js +7 -0
- package/dist/index.es88.js +7 -0
- package/dist/index.es89.js +5 -0
- package/dist/index.es9.js +33 -0
- package/dist/index.es90.js +26 -0
- package/dist/index.es91.js +112 -0
- package/dist/index.es92.js +18 -0
- package/dist/index.es93.js +527 -0
- package/dist/index.es94.js +130 -0
- package/dist/index.es95.js +136 -0
- package/dist/index.es96.js +67 -0
- package/dist/index.es97.js +71 -0
- package/dist/index.es98.js +11 -0
- package/dist/index.es99.js +16 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __rest as E, __assign as r } from "./index.es85.js";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { zeroRightClassName as I, fullWidthClassName as Z } from "./index.es88.js";
|
|
4
|
+
import { effectCar as W } from "./index.es89.js";
|
|
5
|
+
import { useMergeRefs as z } from "./index.es90.js";
|
|
6
|
+
var l = function() {
|
|
7
|
+
}, m = a.forwardRef(function(e, d) {
|
|
8
|
+
var o = a.useRef(null), n = a.useState({
|
|
9
|
+
onScrollCapture: l,
|
|
10
|
+
onWheelCapture: l,
|
|
11
|
+
onTouchMoveCapture: l
|
|
12
|
+
}), f = n[0], v = n[1], h = e.forwardProps, t = e.children, u = e.className, C = e.removeScrollBar, R = e.enabled, g = e.shards, P = e.sideCar, S = e.noRelative, b = e.noIsolation, w = e.inert, N = e.allowPinchZoom, i = e.as, M = i === void 0 ? "div" : i, _ = e.gapMode, B = E(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), k = P, s = z([o, d]), c = r(r({}, B), f);
|
|
13
|
+
return a.createElement(
|
|
14
|
+
a.Fragment,
|
|
15
|
+
null,
|
|
16
|
+
R && a.createElement(k, { sideCar: W, removeScrollBar: C, shards: g, noRelative: S, noIsolation: b, inert: w, setCallbacks: v, allowPinchZoom: !!N, lockRef: o, gapMode: _ }),
|
|
17
|
+
h ? a.cloneElement(a.Children.only(t), r(r({}, c), { ref: s })) : a.createElement(M, r({}, c, { className: u, ref: s }), t)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
m.defaultProps = {
|
|
21
|
+
enabled: !0,
|
|
22
|
+
removeScrollBar: !0,
|
|
23
|
+
inert: !1
|
|
24
|
+
};
|
|
25
|
+
m.classNames = {
|
|
26
|
+
fullWidth: Z,
|
|
27
|
+
zeroRight: I
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
m as RemoveScroll
|
|
31
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cn as l } from "./index.es4.js";
|
|
3
|
+
import { cva as e } from "./index.es32.js";
|
|
4
|
+
const n = e(
|
|
5
|
+
"volt-text-gray-light volt-flex volt-h-auto volt-cursor-text volt-whitespace-nowrap volt-items-center volt-justify-center volt-gap-2 volt-text-sm volt-font-normal volt-select-none volt-group-data-[disabled=true]/input-group:opacity-50",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
align: {
|
|
9
|
+
start: "volt-order-first",
|
|
10
|
+
end: "volt-order-last"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
align: "start"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
), p = ({
|
|
18
|
+
className: o,
|
|
19
|
+
align: t = "start",
|
|
20
|
+
...r
|
|
21
|
+
}) => /* @__PURE__ */ a(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
role: "group",
|
|
25
|
+
"data-slot": "input-group-addon",
|
|
26
|
+
"data-align": t,
|
|
27
|
+
className: l(n({ align: t }), o),
|
|
28
|
+
...r
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
export {
|
|
32
|
+
p as FieldGroupAddon
|
|
33
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import { assignRef as o } from "./index.es101.js";
|
|
3
|
+
import { useCallbackRef as l } from "./index.es102.js";
|
|
4
|
+
var s = typeof window < "u" ? f.useLayoutEffect : f.useEffect, c = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
function v(e, m) {
|
|
6
|
+
var t = l(null, function(n) {
|
|
7
|
+
return e.forEach(function(u) {
|
|
8
|
+
return o(u, n);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
return s(function() {
|
|
12
|
+
var n = c.get(t);
|
|
13
|
+
if (n) {
|
|
14
|
+
var u = new Set(n), r = new Set(e), i = t.current;
|
|
15
|
+
u.forEach(function(a) {
|
|
16
|
+
r.has(a) || o(a, null);
|
|
17
|
+
}), r.forEach(function(a) {
|
|
18
|
+
u.has(a) || o(a, i);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
c.set(t, e);
|
|
22
|
+
}, [e]), t;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
v as useMergeRefs
|
|
26
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { __spreadArray as x } from "./index.es85.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { RemoveScrollBar as A } from "./index.es97.js";
|
|
4
|
+
import { styleSingleton as I } from "./index.es98.js";
|
|
5
|
+
import { nonPassive as s } from "./index.es99.js";
|
|
6
|
+
import { locationCouldBeScrolled as T, handleScroll as W } from "./index.es100.js";
|
|
7
|
+
var b = function(t) {
|
|
8
|
+
return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
|
|
9
|
+
}, Y = function(t) {
|
|
10
|
+
return [t.deltaX, t.deltaY];
|
|
11
|
+
}, B = function(t) {
|
|
12
|
+
return t && "current" in t ? t.current : t;
|
|
13
|
+
}, F = function(t, c) {
|
|
14
|
+
return t[0] === c[0] && t[1] === c[1];
|
|
15
|
+
}, K = function(t) {
|
|
16
|
+
return `
|
|
17
|
+
.block-interactivity-`.concat(t, ` {pointer-events: none;}
|
|
18
|
+
.allow-interactivity-`).concat(t, ` {pointer-events: all;}
|
|
19
|
+
`);
|
|
20
|
+
}, O = 0, f = [];
|
|
21
|
+
function G(t) {
|
|
22
|
+
var c = n.useRef([]), E = n.useRef([0, 0]), d = n.useRef(), h = n.useState(O++)[0], m = n.useState(I)[0], g = n.useRef(t);
|
|
23
|
+
n.useEffect(function() {
|
|
24
|
+
g.current = t;
|
|
25
|
+
}, [t]), n.useEffect(function() {
|
|
26
|
+
if (t.inert) {
|
|
27
|
+
document.body.classList.add("block-interactivity-".concat(h));
|
|
28
|
+
var e = x([t.lockRef.current], (t.shards || []).map(B), !0).filter(Boolean);
|
|
29
|
+
return e.forEach(function(r) {
|
|
30
|
+
return r.classList.add("allow-interactivity-".concat(h));
|
|
31
|
+
}), function() {
|
|
32
|
+
document.body.classList.remove("block-interactivity-".concat(h)), e.forEach(function(r) {
|
|
33
|
+
return r.classList.remove("allow-interactivity-".concat(h));
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}, [t.inert, t.lockRef.current, t.shards]);
|
|
38
|
+
var k = n.useCallback(function(e, r) {
|
|
39
|
+
if ("touches" in e && e.touches.length === 2 || e.type === "wheel" && e.ctrlKey)
|
|
40
|
+
return !g.current.allowPinchZoom;
|
|
41
|
+
var l = b(e), o = E.current, u = "deltaX" in e ? e.deltaX : o[0] - l[0], i = "deltaY" in e ? e.deltaY : o[1] - l[1], a, C = e.target, v = Math.abs(u) > Math.abs(i) ? "h" : "v";
|
|
42
|
+
if ("touches" in e && v === "h" && C.type === "range")
|
|
43
|
+
return !1;
|
|
44
|
+
var y = T(v, C);
|
|
45
|
+
if (!y)
|
|
46
|
+
return !0;
|
|
47
|
+
if (y ? a = v : (a = v === "v" ? "h" : "v", y = T(v, C)), !y)
|
|
48
|
+
return !1;
|
|
49
|
+
if (!d.current && "changedTouches" in e && (u || i) && (d.current = a), !a)
|
|
50
|
+
return !0;
|
|
51
|
+
var P = d.current || a;
|
|
52
|
+
return W(P, r, e, P === "h" ? u : i);
|
|
53
|
+
}, []), S = n.useCallback(function(e) {
|
|
54
|
+
var r = e;
|
|
55
|
+
if (!(!f.length || f[f.length - 1] !== m)) {
|
|
56
|
+
var l = "deltaY" in r ? Y(r) : b(r), o = c.current.filter(function(a) {
|
|
57
|
+
return a.name === r.type && (a.target === r.target || r.target === a.shadowParent) && F(a.delta, l);
|
|
58
|
+
})[0];
|
|
59
|
+
if (o && o.should) {
|
|
60
|
+
r.cancelable && r.preventDefault();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (!o) {
|
|
64
|
+
var u = (g.current.shards || []).map(B).filter(Boolean).filter(function(a) {
|
|
65
|
+
return a.contains(r.target);
|
|
66
|
+
}), i = u.length > 0 ? k(r, u[0]) : !g.current.noIsolation;
|
|
67
|
+
i && r.cancelable && r.preventDefault();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, []), R = n.useCallback(function(e, r, l, o) {
|
|
71
|
+
var u = { name: e, delta: r, target: l, should: o, shadowParent: Q(l) };
|
|
72
|
+
c.current.push(u), setTimeout(function() {
|
|
73
|
+
c.current = c.current.filter(function(i) {
|
|
74
|
+
return i !== u;
|
|
75
|
+
});
|
|
76
|
+
}, 1);
|
|
77
|
+
}, []), w = n.useCallback(function(e) {
|
|
78
|
+
E.current = b(e), d.current = void 0;
|
|
79
|
+
}, []), L = n.useCallback(function(e) {
|
|
80
|
+
R(e.type, Y(e), e.target, k(e, t.lockRef.current));
|
|
81
|
+
}, []), M = n.useCallback(function(e) {
|
|
82
|
+
R(e.type, b(e), e.target, k(e, t.lockRef.current));
|
|
83
|
+
}, []);
|
|
84
|
+
n.useEffect(function() {
|
|
85
|
+
return f.push(m), t.setCallbacks({
|
|
86
|
+
onScrollCapture: L,
|
|
87
|
+
onWheelCapture: L,
|
|
88
|
+
onTouchMoveCapture: M
|
|
89
|
+
}), document.addEventListener("wheel", S, s), document.addEventListener("touchmove", S, s), document.addEventListener("touchstart", w, s), function() {
|
|
90
|
+
f = f.filter(function(e) {
|
|
91
|
+
return e !== m;
|
|
92
|
+
}), document.removeEventListener("wheel", S, s), document.removeEventListener("touchmove", S, s), document.removeEventListener("touchstart", w, s);
|
|
93
|
+
};
|
|
94
|
+
}, []);
|
|
95
|
+
var X = t.removeScrollBar, D = t.inert;
|
|
96
|
+
return n.createElement(
|
|
97
|
+
n.Fragment,
|
|
98
|
+
null,
|
|
99
|
+
D ? n.createElement(m, { styles: K(h) }) : null,
|
|
100
|
+
X ? n.createElement(A, { noRelative: t.noRelative, gapMode: t.gapMode }) : null
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function Q(t) {
|
|
104
|
+
for (var c = null; t !== null; )
|
|
105
|
+
t instanceof ShadowRoot && (c = t.host, t = t.host), t = t.parentNode;
|
|
106
|
+
return c;
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
G as RemoveScrollSideCar,
|
|
110
|
+
Y as getDeltaXY,
|
|
111
|
+
b as getTouchXY
|
|
112
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __rest as o, __assign as d } from "./index.es85.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
var i = function(r) {
|
|
4
|
+
var e = r.sideCar, a = o(r, ["sideCar"]);
|
|
5
|
+
if (!e)
|
|
6
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
7
|
+
var t = e.read();
|
|
8
|
+
if (!t)
|
|
9
|
+
throw new Error("Sidecar medium not found");
|
|
10
|
+
return n.createElement(t, d({}, a));
|
|
11
|
+
};
|
|
12
|
+
i.isSideCarExport = !0;
|
|
13
|
+
function p(r, e) {
|
|
14
|
+
return r.useMedium(e), i;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
p as exportSidecar
|
|
18
|
+
};
|