@phillips/seldon 1.32.0 → 1.34.0
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/Accordion/AccordionItem.d.ts +5 -1
- package/dist/components/Accordion/AccordionItem.js +59 -58
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +39 -34
- package/dist/components/Drawer/Drawer.d.ts +23 -0
- package/dist/components/Drawer/Drawer.js +46 -0
- package/dist/components/Footer/Footer.d.ts +1 -1
- package/dist/components/Footer/Footer.js +12 -10
- package/dist/components/Social/Social.d.ts +10 -1
- package/dist/components/Social/Social.js +17 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +34 -32
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +6 -6
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +67 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +260 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +137 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +35 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +112 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +62 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll/node_modules/tslib/tslib.es6.js +27 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
- package/dist/node_modules/use-sidecar/node_modules/tslib/tslib.es6.js +21 -0
- package/dist/scss/_vars.scss +2 -0
- package/dist/scss/components/Drawer/_drawer.scss +66 -0
- package/dist/scss/components/Footer/_footer.scss +79 -32
- package/dist/scss/components/Social/_social.scss +44 -6
- package/dist/scss/components/Subscribe/_subscribe.scss +1 -0
- package/dist/scss/styles.scss +1 -0
- package/package.json +7 -6
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-context/dist/index.js +0 -52
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-primitive/dist/index.js +0 -31
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/primitive/dist/index.js +0 -9
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -14
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-context/dist/index.js +0 -52
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-id/dist/index.js +0 -13
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-primitive/dist/index.js +0 -31
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-slot/dist/index.js +0 -48
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -13
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -32
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -14
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-context/dist/index.js +0 -52
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +0 -48
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/primitive → primitive}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-compose-refs → react-compose-refs}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-id → react-id}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-collapsible/node_modules/@radix-ui/react-presence → react-presence}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-slot → react-slot}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-callback-ref → react-use-callback-ref}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-controllable-state → react-use-controllable-state}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-layout-effect → react-use-layout-effect}/dist/index.js +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var S = function(r) {
|
|
2
|
+
if (typeof document == "undefined")
|
|
3
|
+
return null;
|
|
4
|
+
var u = Array.isArray(r) ? r[0] : r;
|
|
5
|
+
return u.ownerDocument.body;
|
|
6
|
+
}, f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {}, h = 0, W = function(r) {
|
|
7
|
+
return r && (r.host || W(r.parentNode));
|
|
8
|
+
}, D = function(r, u) {
|
|
9
|
+
return u.map(function(e) {
|
|
10
|
+
if (r.contains(e))
|
|
11
|
+
return e;
|
|
12
|
+
var n = W(e);
|
|
13
|
+
return n && r.contains(n) ? n : (console.error("aria-hidden", e, "in not contained inside", r, ". Doing nothing"), null);
|
|
14
|
+
}).filter(function(e) {
|
|
15
|
+
return !!e;
|
|
16
|
+
});
|
|
17
|
+
}, E = function(r, u, e, n) {
|
|
18
|
+
var i = D(u, Array.isArray(r) ? r : [r]);
|
|
19
|
+
p[e] || (p[e] = /* @__PURE__ */ new WeakMap());
|
|
20
|
+
var o = p[e], l = [], s = /* @__PURE__ */ new Set(), b = new Set(i), y = function(t) {
|
|
21
|
+
!t || s.has(t) || (s.add(t), y(t.parentNode));
|
|
22
|
+
};
|
|
23
|
+
i.forEach(y);
|
|
24
|
+
var A = function(t) {
|
|
25
|
+
!t || b.has(t) || Array.prototype.forEach.call(t.children, function(a) {
|
|
26
|
+
if (s.has(a))
|
|
27
|
+
A(a);
|
|
28
|
+
else
|
|
29
|
+
try {
|
|
30
|
+
var c = a.getAttribute(n), w = c !== null && c !== "false", d = (f.get(a) || 0) + 1, M = (o.get(a) || 0) + 1;
|
|
31
|
+
f.set(a, d), o.set(a, M), l.push(a), d === 1 && w && v.set(a, !0), M === 1 && a.setAttribute(e, "true"), w || a.setAttribute(n, "true");
|
|
32
|
+
} catch (k) {
|
|
33
|
+
console.error("aria-hidden: cannot operate on ", a, k);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return A(u), s.clear(), h++, function() {
|
|
38
|
+
l.forEach(function(t) {
|
|
39
|
+
var a = f.get(t) - 1, c = o.get(t) - 1;
|
|
40
|
+
f.set(t, a), o.set(t, c), a || (v.has(t) || t.removeAttribute(n), v.delete(t)), c || t.removeAttribute(e);
|
|
41
|
+
}), h--, h || (f = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {});
|
|
42
|
+
};
|
|
43
|
+
}, C = function(r, u, e) {
|
|
44
|
+
e === void 0 && (e = "data-aria-hidden");
|
|
45
|
+
var n = Array.from(Array.isArray(r) ? r : [r]), i = S(r);
|
|
46
|
+
return i ? (n.push.apply(n, Array.from(i.querySelectorAll("[aria-live]"))), E(n, i, e, "aria-hidden")) : function() {
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
C as hideOthers
|
|
52
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __assign as m } from "../../node_modules/tslib/tslib.es6.js";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { RemoveScroll as e } from "./UI.js";
|
|
4
|
+
import t from "./sidecar.js";
|
|
5
|
+
var s = r.forwardRef(function(a, o) {
|
|
6
|
+
return r.createElement(e, m({}, a, { ref: o, sideCar: t }));
|
|
7
|
+
});
|
|
8
|
+
s.classNames = e.classNames;
|
|
9
|
+
export {
|
|
10
|
+
s as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { __spreadArray as x } from "../../node_modules/tslib/tslib.es6.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { RemoveScrollBar as A } from "../../../react-remove-scroll-bar/dist/es2015/component.js";
|
|
4
|
+
import { styleSingleton as I } from "../../../react-style-singleton/dist/es2015/component.js";
|
|
5
|
+
import { nonPassive as s } from "./aggresiveCapture.js";
|
|
6
|
+
import { locationCouldBeScrolled as T, handleScroll as W } from "./handleScroll.js";
|
|
7
|
+
var k = 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
|
+
}, O = function(t) {
|
|
16
|
+
return `
|
|
17
|
+
.block-interactivity-`.concat(t, ` {pointer-events: none;}
|
|
18
|
+
.allow-interactivity-`).concat(t, ` {pointer-events: all;}
|
|
19
|
+
`);
|
|
20
|
+
}, Q = 0, f = [];
|
|
21
|
+
function G(t) {
|
|
22
|
+
var c = n.useRef([]), E = n.useRef([0, 0]), d = n.useRef(), v = n.useState(Q++)[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(v));
|
|
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(v));
|
|
31
|
+
}), function() {
|
|
32
|
+
document.body.classList.remove("block-interactivity-".concat(v)), e.forEach(function(r) {
|
|
33
|
+
return r.classList.remove("allow-interactivity-".concat(v));
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}, [t.inert, t.lockRef.current, t.shards]);
|
|
38
|
+
var y = n.useCallback(function(e, r) {
|
|
39
|
+
if ("touches" in e && e.touches.length === 2)
|
|
40
|
+
return !g.current.allowPinchZoom;
|
|
41
|
+
var l = k(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, h = Math.abs(u) > Math.abs(i) ? "h" : "v";
|
|
42
|
+
if ("touches" in e && h === "h" && C.type === "range")
|
|
43
|
+
return !1;
|
|
44
|
+
var b = T(h, C);
|
|
45
|
+
if (!b)
|
|
46
|
+
return !0;
|
|
47
|
+
if (b ? a = h : (a = h === "v" ? "h" : "v", b = T(h, C)), !b)
|
|
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, !0);
|
|
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) : k(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 ? y(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: Z(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 = k(e), d.current = void 0;
|
|
79
|
+
}, []), L = n.useCallback(function(e) {
|
|
80
|
+
R(e.type, Y(e), e.target, y(e, t.lockRef.current));
|
|
81
|
+
}, []), M = n.useCallback(function(e) {
|
|
82
|
+
R(e.type, k(e), e.target, y(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: O(v) }) : null,
|
|
100
|
+
X ? n.createElement(A, { gapMode: t.gapMode }) : null
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function Z(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
|
+
k as getTouchXY
|
|
112
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __rest as k, __assign as r } from "../../node_modules/tslib/tslib.es6.js";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { fullWidthClassName as E, zeroRightClassName as I } from "../../../react-remove-scroll-bar/dist/es2015/constants.js";
|
|
4
|
+
import { effectCar as Z } from "./medium.js";
|
|
5
|
+
import { useMergeRefs as W } from "../../../use-callback-ref/dist/es2015/useMergeRef.js";
|
|
6
|
+
var o = function() {
|
|
7
|
+
}, m = a.forwardRef(function(e, d) {
|
|
8
|
+
var l = a.useRef(null), n = a.useState({
|
|
9
|
+
onScrollCapture: o,
|
|
10
|
+
onWheelCapture: o,
|
|
11
|
+
onTouchMoveCapture: o
|
|
12
|
+
}), f = n[0], h = n[1], u = e.forwardProps, t = e.children, v = e.className, C = e.removeScrollBar, g = e.enabled, P = e.shards, R = e.sideCar, S = e.noIsolation, b = e.inert, w = e.allowPinchZoom, s = e.as, N = s === void 0 ? "div" : s, M = e.gapMode, _ = k(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), B = R, i = W([l, d]), c = r(r({}, _), f);
|
|
13
|
+
return a.createElement(
|
|
14
|
+
a.Fragment,
|
|
15
|
+
null,
|
|
16
|
+
g && a.createElement(B, { sideCar: Z, removeScrollBar: C, shards: P, noIsolation: S, inert: b, setCallbacks: h, allowPinchZoom: !!w, lockRef: l, gapMode: M }),
|
|
17
|
+
u ? a.cloneElement(a.Children.only(t), r(r({}, c), { ref: i })) : a.createElement(N, r({}, c, { className: v, ref: i }), t)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
m.defaultProps = {
|
|
21
|
+
enabled: !0,
|
|
22
|
+
removeScrollBar: !0,
|
|
23
|
+
inert: !1
|
|
24
|
+
};
|
|
25
|
+
m.classNames = {
|
|
26
|
+
fullWidth: E,
|
|
27
|
+
zeroRight: I
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
m as RemoveScroll
|
|
31
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var r = !1;
|
|
2
|
+
if (typeof window != "undefined")
|
|
3
|
+
try {
|
|
4
|
+
var e = Object.defineProperty({}, "passive", {
|
|
5
|
+
get: function() {
|
|
6
|
+
return r = !0, !0;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
window.addEventListener("test", e, e), window.removeEventListener("test", e, e);
|
|
10
|
+
} catch {
|
|
11
|
+
r = !1;
|
|
12
|
+
}
|
|
13
|
+
var a = r ? { passive: !1 } : !1;
|
|
14
|
+
export {
|
|
15
|
+
a as nonPassive
|
|
16
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var p = function(r) {
|
|
2
|
+
return r.tagName === "TEXTAREA";
|
|
3
|
+
}, w = function(r, e) {
|
|
4
|
+
var o = window.getComputedStyle(r);
|
|
5
|
+
return (
|
|
6
|
+
// not-not-scrollable
|
|
7
|
+
o[e] !== "hidden" && // contains scroll inside self
|
|
8
|
+
!(o.overflowY === o.overflowX && !p(r) && o[e] === "visible")
|
|
9
|
+
);
|
|
10
|
+
}, y = function(r) {
|
|
11
|
+
return w(r, "overflowY");
|
|
12
|
+
}, H = function(r) {
|
|
13
|
+
return w(r, "overflowX");
|
|
14
|
+
}, R = function(r, e) {
|
|
15
|
+
var o = e.ownerDocument, t = e;
|
|
16
|
+
do {
|
|
17
|
+
typeof ShadowRoot != "undefined" && t instanceof ShadowRoot && (t = t.host);
|
|
18
|
+
var a = g(r, t);
|
|
19
|
+
if (a) {
|
|
20
|
+
var n = b(r, t), i = n[1], l = n[2];
|
|
21
|
+
if (i > l)
|
|
22
|
+
return !0;
|
|
23
|
+
}
|
|
24
|
+
t = t.parentNode;
|
|
25
|
+
} while (t && t !== o.body);
|
|
26
|
+
return !1;
|
|
27
|
+
}, B = function(r) {
|
|
28
|
+
var e = r.scrollTop, o = r.scrollHeight, t = r.clientHeight;
|
|
29
|
+
return [
|
|
30
|
+
e,
|
|
31
|
+
o,
|
|
32
|
+
t
|
|
33
|
+
];
|
|
34
|
+
}, V = function(r) {
|
|
35
|
+
var e = r.scrollLeft, o = r.scrollWidth, t = r.clientWidth;
|
|
36
|
+
return [
|
|
37
|
+
e,
|
|
38
|
+
o,
|
|
39
|
+
t
|
|
40
|
+
];
|
|
41
|
+
}, g = function(r, e) {
|
|
42
|
+
return r === "v" ? y(e) : H(e);
|
|
43
|
+
}, b = function(r, e) {
|
|
44
|
+
return r === "v" ? B(e) : V(e);
|
|
45
|
+
}, D = function(r, e) {
|
|
46
|
+
return r === "h" && e === "rtl" ? -1 : 1;
|
|
47
|
+
}, W = function(r, e, o, t, a) {
|
|
48
|
+
var n = D(r, window.getComputedStyle(e).direction), i = n * t, l = o.target, f = e.contains(l), c = !1, d = i > 0, s = 0, h = 0;
|
|
49
|
+
do {
|
|
50
|
+
var u = b(r, l), v = u[0], m = u[1], C = u[2], S = m - C - n * v;
|
|
51
|
+
(v || S) && g(r, l) && (s += S, h += v), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
|
|
52
|
+
} while (
|
|
53
|
+
// portaled content
|
|
54
|
+
!f && l !== document.body || // self content
|
|
55
|
+
f && (e.contains(l) || e === l)
|
|
56
|
+
);
|
|
57
|
+
return (d && (Math.abs(s) < 1 || !a) || !d && (Math.abs(h) < 1 || !a)) && (c = !0), c;
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
W as handleScroll,
|
|
61
|
+
R as locationCouldBeScrolled
|
|
62
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var p = function() {
|
|
2
|
+
return p = Object.assign || function(e) {
|
|
3
|
+
for (var n, r = 1, o = arguments.length; r < o; r++) {
|
|
4
|
+
n = arguments[r];
|
|
5
|
+
for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
|
|
6
|
+
}
|
|
7
|
+
return e;
|
|
8
|
+
}, p.apply(this, arguments);
|
|
9
|
+
};
|
|
10
|
+
function c(t, e) {
|
|
11
|
+
var n = {};
|
|
12
|
+
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
13
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
14
|
+
for (var o = 0, r = Object.getOwnPropertySymbols(t); o < r.length; o++)
|
|
15
|
+
e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]]);
|
|
16
|
+
return n;
|
|
17
|
+
}
|
|
18
|
+
function l(t, e, n) {
|
|
19
|
+
if (n || arguments.length === 2) for (var r = 0, o = e.length, a; r < o; r++)
|
|
20
|
+
(a || !(r in e)) && (a || (a = Array.prototype.slice.call(e, 0, r)), a[r] = e[r]);
|
|
21
|
+
return t.concat(a || Array.prototype.slice.call(e));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
p as __assign,
|
|
25
|
+
c as __rest,
|
|
26
|
+
l as __spreadArray
|
|
27
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { styleSingleton as f } from "../../../react-style-singleton/dist/es2015/component.js";
|
|
3
|
+
import { noScrollbarsClassName as p, zeroRightClassName as g, fullWidthClassName as l, removedBarSizeVariable as v } from "./constants.js";
|
|
4
|
+
import { getGapWidth as m } from "./utils.js";
|
|
5
|
+
var b = f(), e = "data-scroll-locked", h = function(n, a, o, t) {
|
|
6
|
+
var r = n.left, i = n.top, s = n.right, c = n.gap;
|
|
7
|
+
return o === void 0 && (o = "margin"), `
|
|
8
|
+
.`.concat(p, ` {
|
|
9
|
+
overflow: hidden `).concat(t, `;
|
|
10
|
+
padding-right: `).concat(c, "px ").concat(t, `;
|
|
11
|
+
}
|
|
12
|
+
body[`).concat(e, `] {
|
|
13
|
+
overflow: hidden `).concat(t, `;
|
|
14
|
+
overscroll-behavior: contain;
|
|
15
|
+
`).concat([
|
|
16
|
+
a && "position: relative ".concat(t, ";"),
|
|
17
|
+
o === "margin" && `
|
|
18
|
+
padding-left: `.concat(r, `px;
|
|
19
|
+
padding-top: `).concat(i, `px;
|
|
20
|
+
padding-right: `).concat(s, `px;
|
|
21
|
+
margin-left:0;
|
|
22
|
+
margin-top:0;
|
|
23
|
+
margin-right: `).concat(c, "px ").concat(t, `;
|
|
24
|
+
`),
|
|
25
|
+
o === "padding" && "padding-right: ".concat(c, "px ").concat(t, ";")
|
|
26
|
+
].filter(Boolean).join(""), `
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.`).concat(g, ` {
|
|
30
|
+
right: `).concat(c, "px ").concat(t, `;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(l, ` {
|
|
34
|
+
margin-right: `).concat(c, "px ").concat(t, `;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(g, " .").concat(g, ` {
|
|
38
|
+
right: 0 `).concat(t, `;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.`).concat(l, " .").concat(l, ` {
|
|
42
|
+
margin-right: 0 `).concat(t, `;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
body[`).concat(e, `] {
|
|
46
|
+
`).concat(v, ": ").concat(c, `px;
|
|
47
|
+
}
|
|
48
|
+
`);
|
|
49
|
+
}, u = function() {
|
|
50
|
+
var n = parseInt(document.body.getAttribute(e) || "0", 10);
|
|
51
|
+
return isFinite(n) ? n : 0;
|
|
52
|
+
}, x = function() {
|
|
53
|
+
d.useEffect(function() {
|
|
54
|
+
return document.body.setAttribute(e, (u() + 1).toString()), function() {
|
|
55
|
+
var n = u() - 1;
|
|
56
|
+
n <= 0 ? document.body.removeAttribute(e) : document.body.setAttribute(e, n.toString());
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
59
|
+
}, C = function(n) {
|
|
60
|
+
var a = n.noRelative, o = n.noImportant, t = n.gapMode, r = t === void 0 ? "margin" : t;
|
|
61
|
+
x();
|
|
62
|
+
var i = d.useMemo(function() {
|
|
63
|
+
return m(r);
|
|
64
|
+
}, [r]);
|
|
65
|
+
return d.createElement(b, { styles: h(i, !a, r, o ? "" : "!important") });
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
C as RemoveScrollBar,
|
|
69
|
+
e as lockAttribute,
|
|
70
|
+
x as useLockAttribute
|
|
71
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var a = {
|
|
2
|
+
left: 0,
|
|
3
|
+
top: 0,
|
|
4
|
+
right: 0,
|
|
5
|
+
gap: 0
|
|
6
|
+
}, e = function(t) {
|
|
7
|
+
return parseInt(t || "", 10) || 0;
|
|
8
|
+
}, o = function(t) {
|
|
9
|
+
var n = window.getComputedStyle(document.body), i = n[t === "padding" ? "paddingLeft" : "marginLeft"], r = n[t === "padding" ? "paddingTop" : "marginTop"], d = n[t === "padding" ? "paddingRight" : "marginRight"];
|
|
10
|
+
return [e(i), e(r), e(d)];
|
|
11
|
+
}, f = function(t) {
|
|
12
|
+
if (t === void 0 && (t = "margin"), typeof window == "undefined")
|
|
13
|
+
return a;
|
|
14
|
+
var n = o(t), i = document.documentElement.clientWidth, r = window.innerWidth;
|
|
15
|
+
return {
|
|
16
|
+
left: n[0],
|
|
17
|
+
top: n[1],
|
|
18
|
+
right: n[2],
|
|
19
|
+
gap: Math.max(0, r - i + n[2] - n[0])
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
f as getGapWidth,
|
|
24
|
+
a as zeroGap
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { stylesheetSingleton as r } from "./singleton.js";
|
|
3
|
+
var i = function() {
|
|
4
|
+
var t = r();
|
|
5
|
+
return function(e, n) {
|
|
6
|
+
o.useEffect(function() {
|
|
7
|
+
return t.add(e), function() {
|
|
8
|
+
t.remove();
|
|
9
|
+
};
|
|
10
|
+
}, [e && n]);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
i as styleHookSingleton
|
|
15
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getNonce as o } from "../../../get-nonce/dist/es2015/index.js";
|
|
2
|
+
function r() {
|
|
3
|
+
if (!document)
|
|
4
|
+
return null;
|
|
5
|
+
var t = document.createElement("style");
|
|
6
|
+
t.type = "text/css";
|
|
7
|
+
var e = o();
|
|
8
|
+
return e && t.setAttribute("nonce", e), t;
|
|
9
|
+
}
|
|
10
|
+
function l(t, e) {
|
|
11
|
+
t.styleSheet ? t.styleSheet.cssText = e : t.appendChild(document.createTextNode(e));
|
|
12
|
+
}
|
|
13
|
+
function a(t) {
|
|
14
|
+
var e = document.head || document.getElementsByTagName("head")[0];
|
|
15
|
+
e.appendChild(t);
|
|
16
|
+
}
|
|
17
|
+
var c = function() {
|
|
18
|
+
var t = 0, e = null;
|
|
19
|
+
return {
|
|
20
|
+
add: function(n) {
|
|
21
|
+
t == 0 && (e = r()) && (l(e, n), a(e)), t++;
|
|
22
|
+
},
|
|
23
|
+
remove: function() {
|
|
24
|
+
t--, !t && e && (e.parentNode && e.parentNode.removeChild(e), e = null);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
c as stylesheetSingleton
|
|
30
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import { assignRef as o } from "./assignRef.js";
|
|
3
|
+
import { useCallbackRef as l } from "./useRef.js";
|
|
4
|
+
var s = typeof window != "undefined" ? 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,25 @@
|
|
|
1
|
+
import { useState as u } from "react";
|
|
2
|
+
function n(c, r) {
|
|
3
|
+
var e = u(function() {
|
|
4
|
+
return {
|
|
5
|
+
// value
|
|
6
|
+
value: c,
|
|
7
|
+
// last callback
|
|
8
|
+
callback: r,
|
|
9
|
+
// "memoized" public interface
|
|
10
|
+
facade: {
|
|
11
|
+
get current() {
|
|
12
|
+
return e.value;
|
|
13
|
+
},
|
|
14
|
+
set current(a) {
|
|
15
|
+
var t = e.value;
|
|
16
|
+
t !== a && (e.value = a, e.callback(a, t));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
})[0];
|
|
21
|
+
return e.callback = r, e.facade;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
n as useCallbackRef
|
|
25
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __rest as o, __assign as d } from "../../node_modules/tslib/tslib.es6.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
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { __assign as d } from "../../node_modules/tslib/tslib.es6.js";
|
|
2
|
+
function l(r) {
|
|
3
|
+
return r;
|
|
4
|
+
}
|
|
5
|
+
function h(r, t) {
|
|
6
|
+
t === void 0 && (t = l);
|
|
7
|
+
var e = [], o = !1, c = {
|
|
8
|
+
read: function() {
|
|
9
|
+
if (o)
|
|
10
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
11
|
+
return e.length ? e[e.length - 1] : r;
|
|
12
|
+
},
|
|
13
|
+
useMedium: function(u) {
|
|
14
|
+
var n = t(u, o);
|
|
15
|
+
return e.push(n), function() {
|
|
16
|
+
e = e.filter(function(i) {
|
|
17
|
+
return i !== n;
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
assignSyncMedium: function(u) {
|
|
22
|
+
for (o = !0; e.length; ) {
|
|
23
|
+
var n = e;
|
|
24
|
+
e = [], n.forEach(u);
|
|
25
|
+
}
|
|
26
|
+
e = {
|
|
27
|
+
push: function(i) {
|
|
28
|
+
return u(i);
|
|
29
|
+
},
|
|
30
|
+
filter: function() {
|
|
31
|
+
return e;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
assignMedium: function(u) {
|
|
36
|
+
o = !0;
|
|
37
|
+
var n = [];
|
|
38
|
+
if (e.length) {
|
|
39
|
+
var i = e;
|
|
40
|
+
e = [], i.forEach(u), n = e;
|
|
41
|
+
}
|
|
42
|
+
var s = function() {
|
|
43
|
+
var f = n;
|
|
44
|
+
n = [], f.forEach(u);
|
|
45
|
+
}, a = function() {
|
|
46
|
+
return Promise.resolve().then(s);
|
|
47
|
+
};
|
|
48
|
+
a(), e = {
|
|
49
|
+
push: function(f) {
|
|
50
|
+
n.push(f), a();
|
|
51
|
+
},
|
|
52
|
+
filter: function(f) {
|
|
53
|
+
return n = n.filter(f), e;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return c;
|
|
59
|
+
}
|
|
60
|
+
function v(r) {
|
|
61
|
+
r === void 0 && (r = {});
|
|
62
|
+
var t = h(null);
|
|
63
|
+
return t.options = d({ async: !0, ssr: !1 }, r), t;
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
v as createSidecarMedium
|
|
67
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var p = function() {
|
|
2
|
+
return p = Object.assign || function(o) {
|
|
3
|
+
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
4
|
+
t = arguments[r];
|
|
5
|
+
for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && (o[a] = t[a]);
|
|
6
|
+
}
|
|
7
|
+
return o;
|
|
8
|
+
}, p.apply(this, arguments);
|
|
9
|
+
};
|
|
10
|
+
function u(e, o) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && o.indexOf(r) < 0 && (t[r] = e[r]);
|
|
13
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
14
|
+
for (var n = 0, r = Object.getOwnPropertySymbols(e); n < r.length; n++)
|
|
15
|
+
o.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[n]) && (t[r[n]] = e[r[n]]);
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
p as __assign,
|
|
20
|
+
u as __rest
|
|
21
|
+
};
|