@konstructio/ui 0.0.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/LICENSE.md +21 -0
- package/README.md +19 -0
- package/dist/AlertDialogTrigger-BIbxXexQ.js +553 -0
- package/dist/Combination-Cmu9JRkv.js +479 -0
- package/dist/Modal-CO0_SnXD.js +909 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/chevron-up-Cmu1oXfj.js +54 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +3 -0
- package/dist/components/AlertDialog/AlertDialog.js +54 -0
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +13 -0
- package/dist/components/AlertDialog/AlertDialog.types.js +1 -0
- package/dist/components/AlertDialog/AlertDialog.variants.d.ts +3 -0
- package/dist/components/AlertDialog/AlertDialog.variants.js +16 -0
- package/dist/components/AlertDialog/components/AlertDialogTrigger.d.ts +3 -0
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +10 -0
- package/dist/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +6 -0
- package/dist/components/AlertDialog/components/AlertDialogTrigger.types.js +1 -0
- package/dist/components/AlertDialog/components/index.d.ts +1 -0
- package/dist/components/AlertDialog/components/index.js +4 -0
- package/dist/components/AlertDialog/hooks/index.d.ts +1 -0
- package/dist/components/AlertDialog/hooks/index.js +4 -0
- package/dist/components/AlertDialog/hooks/useAlertDialog.d.ts +7 -0
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +10 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +3 -0
- package/dist/components/Autocomplete/Autocomplete.js +84 -0
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +18 -0
- package/dist/components/Autocomplete/Autocomplete.types.js +1 -0
- package/dist/components/Autocomplete/Autocomplete.variants.d.ts +8 -0
- package/dist/components/Autocomplete/Autocomplete.variants.js +61 -0
- package/dist/components/Autocomplete/components/List.d.ts +3 -0
- package/dist/components/Autocomplete/components/List.js +57 -0
- package/dist/components/Autocomplete/components/List.types.d.ts +13 -0
- package/dist/components/Autocomplete/components/List.types.js +1 -0
- package/dist/components/Autocomplete/components/List.variants.d.ts +16 -0
- package/dist/components/Autocomplete/components/List.variants.js +81 -0
- package/dist/components/Autocomplete/hooks/index.d.ts +2 -0
- package/dist/components/Autocomplete/hooks/index.js +6 -0
- package/dist/components/Autocomplete/hooks/useAutocomplete.d.ts +17 -0
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +81 -0
- package/dist/components/Autocomplete/hooks/useNavigationList.d.ts +10 -0
- package/dist/components/Autocomplete/hooks/useNavigationList.js +78 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +3 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +460 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +11 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.js +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.variants.d.ts +12 -0
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +61 -0
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.d.ts +3 -0
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +5 -0
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/Button.js +42 -0
- package/dist/components/Button/Button.types.d.ts +7 -0
- package/dist/components/Button/Button.types.js +1 -0
- package/dist/components/Button/Button.variants.d.ts +6 -0
- package/dist/components/Button/Button.variants.js +102 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.js +233 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.types.js +1 -0
- package/dist/components/Checkbox/Checkbox.variants.d.ts +9 -0
- package/dist/components/Checkbox/Checkbox.variants.js +82 -0
- package/dist/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.js +10 -0
- package/dist/components/Dropdown/Dropdown.types.d.ts +15 -0
- package/dist/components/Dropdown/Dropdown.types.js +1 -0
- package/dist/components/Dropdown/Dropdown.variants.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.variants.js +45 -0
- package/dist/components/Dropdown/components/EmptyList.d.ts +2 -0
- package/dist/components/Dropdown/components/EmptyList.js +5 -0
- package/dist/components/Dropdown/components/List/List.d.ts +3 -0
- package/dist/components/Dropdown/components/List/List.js +25 -0
- package/dist/components/Dropdown/components/List/List.types.d.ts +8 -0
- package/dist/components/Dropdown/components/List/List.types.js +1 -0
- package/dist/components/Dropdown/components/List/List.variants.d.ts +3 -0
- package/dist/components/Dropdown/components/List/List.variants.js +34 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.d.ts +3 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.js +29 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.types.d.ts +4 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.types.js +1 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.d.ts +3 -0
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +19 -0
- package/dist/components/Dropdown/components/Wrapper.d.ts +3 -0
- package/dist/components/Dropdown/components/Wrapper.js +90 -0
- package/dist/components/Dropdown/components/index.d.ts +3 -0
- package/dist/components/Dropdown/components/index.js +8 -0
- package/dist/components/Dropdown/contexts/dropdown.context.d.ts +8 -0
- package/dist/components/Dropdown/contexts/dropdown.context.js +14 -0
- package/dist/components/Dropdown/contexts/dropdown.hook.d.ts +2 -0
- package/dist/components/Dropdown/contexts/dropdown.hook.js +11 -0
- package/dist/components/Dropdown/contexts/dropdown.provider.d.ts +2 -0
- package/dist/components/Dropdown/contexts/dropdown.provider.js +11 -0
- package/dist/components/Dropdown/contexts/index.d.ts +2 -0
- package/dist/components/Dropdown/contexts/index.js +6 -0
- package/dist/components/Dropdown/hooks/useDropdown.d.ts +11 -0
- package/dist/components/Dropdown/hooks/useDropdown.js +65 -0
- package/dist/components/Dropdown/hooks/useNavigationList.d.ts +8 -0
- package/dist/components/Dropdown/hooks/useNavigationList.js +66 -0
- package/dist/components/Input/Input.d.ts +3 -0
- package/dist/components/Input/Input.js +178 -0
- package/dist/components/Input/Input.types.d.ts +9 -0
- package/dist/components/Input/Input.types.js +1 -0
- package/dist/components/Input/Input.variants.d.ts +4 -0
- package/dist/components/Input/Input.variants.js +43 -0
- package/dist/components/Modal/Modal.d.ts +8 -0
- package/dist/components/Modal/Modal.js +10 -0
- package/dist/components/Modal/Modal.types.d.ts +12 -0
- package/dist/components/Modal/Modal.types.js +1 -0
- package/dist/components/Modal/components/Body/Body.d.ts +3 -0
- package/dist/components/Modal/components/Body/Body.js +7 -0
- package/dist/components/Modal/components/Body/Body.types.d.ts +5 -0
- package/dist/components/Modal/components/Body/Body.types.js +1 -0
- package/dist/components/Modal/components/Footer/Footer.d.ts +3 -0
- package/dist/components/Modal/components/Footer/Footer.js +6 -0
- package/dist/components/Modal/components/Footer/Footer.types.d.ts +5 -0
- package/dist/components/Modal/components/Footer/Footer.types.js +1 -0
- package/dist/components/Modal/components/Header/Header.d.ts +3 -0
- package/dist/components/Modal/components/Header/Header.js +6 -0
- package/dist/components/Modal/components/Header/Header.types.d.ts +5 -0
- package/dist/components/Modal/components/Header/Header.types.js +1 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.d.ts +3 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.js +13 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.types.d.ts +7 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.types.js +1 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.d.ts +6 -0
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +48 -0
- package/dist/components/Modal/components/index.d.ts +4 -0
- package/dist/components/Modal/components/index.js +10 -0
- package/dist/components/Modal/contexts/Modal.context.d.ts +2 -0
- package/dist/components/Modal/contexts/Modal.context.js +20 -0
- package/dist/components/Modal/contexts/Modal.provider.d.ts +4 -0
- package/dist/components/Modal/contexts/Modal.provider.js +26 -0
- package/dist/components/Modal/contexts/Modal.types.d.ts +9 -0
- package/dist/components/Modal/contexts/Modal.types.js +1 -0
- package/dist/components/Modal/contexts/index.d.ts +1 -0
- package/dist/components/Modal/contexts/index.js +4 -0
- package/dist/components/Modal/hooks/index.d.ts +1 -0
- package/dist/components/Modal/hooks/index.js +4 -0
- package/dist/components/Modal/hooks/useModal.d.ts +9 -0
- package/dist/components/Modal/hooks/useModal.js +27 -0
- package/dist/components/NumberInput/NumberInput.d.ts +3 -0
- package/dist/components/NumberInput/NumberInput.js +181 -0
- package/dist/components/NumberInput/NumberInput.types.d.ts +11 -0
- package/dist/components/NumberInput/NumberInput.types.js +1 -0
- package/dist/components/NumberInput/NumberInput.variants.d.ts +11 -0
- package/dist/components/NumberInput/NumberInput.variants.js +78 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +3 -0
- package/dist/components/ProgressBar/ProgressBar.js +37 -0
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +8 -0
- package/dist/components/ProgressBar/ProgressBar.types.js +1 -0
- package/dist/components/ProgressBar/ProgressBar.variants.d.ts +7 -0
- package/dist/components/ProgressBar/ProgressBar.variants.js +62 -0
- package/dist/components/Radio/Radio.d.ts +3 -0
- package/dist/components/Radio/Radio.js +58 -0
- package/dist/components/Radio/Radio.types.d.ts +12 -0
- package/dist/components/Radio/Radio.types.js +1 -0
- package/dist/components/Radio/Radio.variants.d.ts +3 -0
- package/dist/components/Radio/Radio.variants.js +49 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/RadioGroup/RadioGroup.js +37 -0
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +11 -0
- package/dist/components/RadioGroup/RadioGroup.types.js +1 -0
- package/dist/components/Range/Range.d.ts +3 -0
- package/dist/components/Range/Range.js +70 -0
- package/dist/components/Range/Range.types.d.ts +13 -0
- package/dist/components/Range/Range.types.js +1 -0
- package/dist/components/Range/Range.variants.d.ts +14 -0
- package/dist/components/Range/Range.variants.js +93 -0
- package/dist/components/Slider/Slider.d.ts +3 -0
- package/dist/components/Slider/Slider.js +52 -0
- package/dist/components/Slider/Slider.types.d.ts +13 -0
- package/dist/components/Slider/Slider.types.js +1 -0
- package/dist/components/Slider/Slider.variants.d.ts +11 -0
- package/dist/components/Slider/Slider.variants.js +69 -0
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch/Switch.js +176 -0
- package/dist/components/Switch/Switch.types.d.ts +10 -0
- package/dist/components/Switch/Switch.types.js +1 -0
- package/dist/components/Switch/Switch.variants.d.ts +6 -0
- package/dist/components/Switch/Switch.variants.js +58 -0
- package/dist/components/Tag/Tag.d.ts +3 -0
- package/dist/components/Tag/Tag.js +6 -0
- package/dist/components/Tag/Tag.types.d.ts +4 -0
- package/dist/components/Tag/Tag.types.js +1 -0
- package/dist/components/Tag/Tag.variants.d.ts +3 -0
- package/dist/components/Tag/Tag.variants.js +31 -0
- package/dist/components/TagSelect/TagSelect.d.ts +3 -0
- package/dist/components/TagSelect/TagSelect.js +75 -0
- package/dist/components/TagSelect/TagSelect.types.d.ts +9 -0
- package/dist/components/TagSelect/TagSelect.types.js +1 -0
- package/dist/components/TagSelect/TagSelect.variants.d.ts +9 -0
- package/dist/components/TagSelect/TagSelect.variants.js +83 -0
- package/dist/components/TagSelect/hooks/useTagSelect.d.ts +9 -0
- package/dist/components/TagSelect/hooks/useTagSelect.js +39 -0
- package/dist/components/TextArea/TextArea.d.ts +3 -0
- package/dist/components/TextArea/TextArea.js +34 -0
- package/dist/components/TextArea/TextArea.types.d.ts +10 -0
- package/dist/components/TextArea/TextArea.types.js +1 -0
- package/dist/components/TextArea/TextArea.variants.d.ts +3 -0
- package/dist/components/TextArea/TextArea.variants.js +34 -0
- package/dist/components/Toast/Toast.d.ts +3 -0
- package/dist/components/Toast/Toast.js +471 -0
- package/dist/components/Toast/Toast.types.d.ts +12 -0
- package/dist/components/Toast/Toast.types.js +1 -0
- package/dist/components/Toast/Toast.variants.d.ts +9 -0
- package/dist/components/Toast/Toast.variants.js +74 -0
- package/dist/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.js +42 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.types.js +1 -0
- package/dist/components/Tooltip/Tooltip.variants.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.variants.js +93 -0
- package/dist/components/Tooltip/hooks/useTooltip.d.ts +4 -0
- package/dist/components/Tooltip/hooks/useTooltip.js +25 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/index.js +40 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/index.js +8 -0
- package/dist/contexts/theme.context.d.ts +6 -0
- package/dist/contexts/theme.context.js +10 -0
- package/dist/contexts/theme.hook.d.ts +7 -0
- package/dist/contexts/theme.hook.js +9 -0
- package/dist/contexts/theme.provider.d.ts +7 -0
- package/dist/contexts/theme.provider.js +17 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/useToggle.d.ts +1 -0
- package/dist/hooks/useToggle.js +11 -0
- package/dist/index-2K8qjK4R.js +145 -0
- package/dist/index-2hJuj4UN.js +19069 -0
- package/dist/index-4qm4jAkj.js +92 -0
- package/dist/index-8vgf-x5i.js +118 -0
- package/dist/index-BJ7FQg17.js +35 -0
- package/dist/index-B_GWswUP.js +71 -0
- package/dist/index-BqM_XclQ.js +94 -0
- package/dist/index-BwYCDOHZ.js +44 -0
- package/dist/index-BxeV34ij.js +32 -0
- package/dist/index-CCavb-1K.js +57 -0
- package/dist/index-DFbnnPzA.js +423 -0
- package/dist/index-DQMInta3.js +663 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +50 -0
- package/dist/js.cookie-OLEfuq_g.js +74 -0
- package/dist/package.json +118 -0
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/konstruct.d.ts +4 -0
- package/dist/plugins/konstruct.js +104 -0
- package/dist/plugins/utils/colors.d.ts +206 -0
- package/dist/plugins/utils/colors.js +626 -0
- package/dist/styles.css +1 -0
- package/dist/styles.d.ts +0 -0
- package/dist/styles.js +1 -0
- package/dist/useBreadcrumb-BSMnc4Fu.js +341 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +2278 -0
- package/package.json +118 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { useState as ee } from "react";
|
|
3
|
+
var S = function() {
|
|
4
|
+
return S = Object.assign || function(t) {
|
|
5
|
+
for (var n, r = 1, a = arguments.length; r < a; r++) {
|
|
6
|
+
n = arguments[r];
|
|
7
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
}, S.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
function Z(e, t) {
|
|
13
|
+
var n = {};
|
|
14
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
15
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
16
|
+
for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
|
|
17
|
+
t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
|
|
18
|
+
return n;
|
|
19
|
+
}
|
|
20
|
+
function te(e, t, n) {
|
|
21
|
+
if (n || arguments.length === 2) for (var r = 0, a = t.length, i; r < a; r++)
|
|
22
|
+
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
23
|
+
return e.concat(i || Array.prototype.slice.call(t));
|
|
24
|
+
}
|
|
25
|
+
var N = "right-scroll-bar-position", A = "width-before-scroll-bar", re = "with-scroll-bars-hidden", ne = "--removed-body-scroll-bar-size";
|
|
26
|
+
function W(e, t) {
|
|
27
|
+
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
28
|
+
}
|
|
29
|
+
function ae(e, t) {
|
|
30
|
+
var n = ee(function() {
|
|
31
|
+
return {
|
|
32
|
+
// value
|
|
33
|
+
value: e,
|
|
34
|
+
// last callback
|
|
35
|
+
callback: t,
|
|
36
|
+
// "memoized" public interface
|
|
37
|
+
facade: {
|
|
38
|
+
get current() {
|
|
39
|
+
return n.value;
|
|
40
|
+
},
|
|
41
|
+
set current(r) {
|
|
42
|
+
var a = n.value;
|
|
43
|
+
a !== r && (n.value = r, n.callback(r, a));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
})[0];
|
|
48
|
+
return n.callback = t, n.facade;
|
|
49
|
+
}
|
|
50
|
+
var oe = typeof window < "u" ? u.useLayoutEffect : u.useEffect, D = /* @__PURE__ */ new WeakMap();
|
|
51
|
+
function ce(e, t) {
|
|
52
|
+
var n = ae(null, function(r) {
|
|
53
|
+
return e.forEach(function(a) {
|
|
54
|
+
return W(a, r);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
return oe(function() {
|
|
58
|
+
var r = D.get(n);
|
|
59
|
+
if (r) {
|
|
60
|
+
var a = new Set(r), i = new Set(e), l = n.current;
|
|
61
|
+
a.forEach(function(o) {
|
|
62
|
+
i.has(o) || W(o, null);
|
|
63
|
+
}), i.forEach(function(o) {
|
|
64
|
+
a.has(o) || W(o, l);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
D.set(n, e);
|
|
68
|
+
}, [e]), n;
|
|
69
|
+
}
|
|
70
|
+
function _(e) {
|
|
71
|
+
return e;
|
|
72
|
+
}
|
|
73
|
+
function Q(e, t) {
|
|
74
|
+
t === void 0 && (t = _);
|
|
75
|
+
var n = [], r = !1, a = {
|
|
76
|
+
read: function() {
|
|
77
|
+
if (r)
|
|
78
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
79
|
+
return n.length ? n[n.length - 1] : e;
|
|
80
|
+
},
|
|
81
|
+
useMedium: function(i) {
|
|
82
|
+
var l = t(i, r);
|
|
83
|
+
return n.push(l), function() {
|
|
84
|
+
n = n.filter(function(o) {
|
|
85
|
+
return o !== l;
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
assignSyncMedium: function(i) {
|
|
90
|
+
for (r = !0; n.length; ) {
|
|
91
|
+
var l = n;
|
|
92
|
+
n = [], l.forEach(i);
|
|
93
|
+
}
|
|
94
|
+
n = {
|
|
95
|
+
push: function(o) {
|
|
96
|
+
return i(o);
|
|
97
|
+
},
|
|
98
|
+
filter: function() {
|
|
99
|
+
return n;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
assignMedium: function(i) {
|
|
104
|
+
r = !0;
|
|
105
|
+
var l = [];
|
|
106
|
+
if (n.length) {
|
|
107
|
+
var o = n;
|
|
108
|
+
n = [], o.forEach(i), l = n;
|
|
109
|
+
}
|
|
110
|
+
var h = function() {
|
|
111
|
+
var d = l;
|
|
112
|
+
l = [], d.forEach(i);
|
|
113
|
+
}, m = function() {
|
|
114
|
+
return Promise.resolve().then(h);
|
|
115
|
+
};
|
|
116
|
+
m(), n = {
|
|
117
|
+
push: function(d) {
|
|
118
|
+
l.push(d), m();
|
|
119
|
+
},
|
|
120
|
+
filter: function(d) {
|
|
121
|
+
return l = l.filter(d), n;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return a;
|
|
127
|
+
}
|
|
128
|
+
function Xe(e, t) {
|
|
129
|
+
return t === void 0 && (t = _), Q(e, t);
|
|
130
|
+
}
|
|
131
|
+
function ie(e) {
|
|
132
|
+
e === void 0 && (e = {});
|
|
133
|
+
var t = Q(null);
|
|
134
|
+
return t.options = S({ async: !0, ssr: !1 }, e), t;
|
|
135
|
+
}
|
|
136
|
+
var G = function(e) {
|
|
137
|
+
var t = e.sideCar, n = Z(e, ["sideCar"]);
|
|
138
|
+
if (!t)
|
|
139
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
140
|
+
var r = t.read();
|
|
141
|
+
if (!r)
|
|
142
|
+
throw new Error("Sidecar medium not found");
|
|
143
|
+
return u.createElement(r, S({}, n));
|
|
144
|
+
};
|
|
145
|
+
G.isSideCarExport = !0;
|
|
146
|
+
function ue(e, t) {
|
|
147
|
+
return e.useMedium(t), G;
|
|
148
|
+
}
|
|
149
|
+
var K = ie(), O = function() {
|
|
150
|
+
}, I = u.forwardRef(function(e, t) {
|
|
151
|
+
var n = u.useRef(null), r = u.useState({
|
|
152
|
+
onScrollCapture: O,
|
|
153
|
+
onWheelCapture: O,
|
|
154
|
+
onTouchMoveCapture: O
|
|
155
|
+
}), a = r[0], i = r[1], l = e.forwardProps, o = e.children, h = e.className, m = e.removeScrollBar, d = e.enabled, b = e.shards, E = e.sideCar, w = e.noIsolation, C = e.inert, c = e.allowPinchZoom, f = e.as, v = f === void 0 ? "div" : f, y = e.gapMode, g = Z(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), p = E, s = ce([n, t]), R = S(S({}, g), a);
|
|
156
|
+
return u.createElement(
|
|
157
|
+
u.Fragment,
|
|
158
|
+
null,
|
|
159
|
+
d && u.createElement(p, { sideCar: K, removeScrollBar: m, shards: b, noIsolation: w, inert: C, setCallbacks: i, allowPinchZoom: !!c, lockRef: n, gapMode: y }),
|
|
160
|
+
l ? u.cloneElement(u.Children.only(o), S(S({}, R), { ref: s })) : u.createElement(v, S({}, R, { className: h, ref: s }), o)
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
I.defaultProps = {
|
|
164
|
+
enabled: !0,
|
|
165
|
+
removeScrollBar: !0,
|
|
166
|
+
inert: !1
|
|
167
|
+
};
|
|
168
|
+
I.classNames = {
|
|
169
|
+
fullWidth: A,
|
|
170
|
+
zeroRight: N
|
|
171
|
+
};
|
|
172
|
+
var le = function() {
|
|
173
|
+
if (typeof __webpack_nonce__ < "u")
|
|
174
|
+
return __webpack_nonce__;
|
|
175
|
+
};
|
|
176
|
+
function fe() {
|
|
177
|
+
if (!document)
|
|
178
|
+
return null;
|
|
179
|
+
var e = document.createElement("style");
|
|
180
|
+
e.type = "text/css";
|
|
181
|
+
var t = le();
|
|
182
|
+
return t && e.setAttribute("nonce", t), e;
|
|
183
|
+
}
|
|
184
|
+
function se(e, t) {
|
|
185
|
+
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
186
|
+
}
|
|
187
|
+
function de(e) {
|
|
188
|
+
var t = document.head || document.getElementsByTagName("head")[0];
|
|
189
|
+
t.appendChild(e);
|
|
190
|
+
}
|
|
191
|
+
var ve = function() {
|
|
192
|
+
var e = 0, t = null;
|
|
193
|
+
return {
|
|
194
|
+
add: function(n) {
|
|
195
|
+
e == 0 && (t = fe()) && (se(t, n), de(t)), e++;
|
|
196
|
+
},
|
|
197
|
+
remove: function() {
|
|
198
|
+
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}, he = function() {
|
|
202
|
+
var e = ve();
|
|
203
|
+
return function(t, n) {
|
|
204
|
+
u.useEffect(function() {
|
|
205
|
+
return e.add(t), function() {
|
|
206
|
+
e.remove();
|
|
207
|
+
};
|
|
208
|
+
}, [t && n]);
|
|
209
|
+
};
|
|
210
|
+
}, U = function() {
|
|
211
|
+
var e = he(), t = function(n) {
|
|
212
|
+
var r = n.styles, a = n.dynamic;
|
|
213
|
+
return e(r, a), null;
|
|
214
|
+
};
|
|
215
|
+
return t;
|
|
216
|
+
}, me = {
|
|
217
|
+
left: 0,
|
|
218
|
+
top: 0,
|
|
219
|
+
right: 0,
|
|
220
|
+
gap: 0
|
|
221
|
+
}, X = function(e) {
|
|
222
|
+
return parseInt(e || "", 10) || 0;
|
|
223
|
+
}, ge = function(e) {
|
|
224
|
+
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], a = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
225
|
+
return [X(n), X(r), X(a)];
|
|
226
|
+
}, ye = function(e) {
|
|
227
|
+
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
228
|
+
return me;
|
|
229
|
+
var t = ge(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
230
|
+
return {
|
|
231
|
+
left: t[0],
|
|
232
|
+
top: t[1],
|
|
233
|
+
right: t[2],
|
|
234
|
+
gap: Math.max(0, r - n + t[2] - t[0])
|
|
235
|
+
};
|
|
236
|
+
}, Se = U(), M = "data-scroll-locked", pe = function(e, t, n, r) {
|
|
237
|
+
var a = e.left, i = e.top, l = e.right, o = e.gap;
|
|
238
|
+
return n === void 0 && (n = "margin"), `
|
|
239
|
+
.`.concat(re, ` {
|
|
240
|
+
overflow: hidden `).concat(r, `;
|
|
241
|
+
padding-right: `).concat(o, "px ").concat(r, `;
|
|
242
|
+
}
|
|
243
|
+
body[`).concat(M, `] {
|
|
244
|
+
overflow: hidden `).concat(r, `;
|
|
245
|
+
overscroll-behavior: contain;
|
|
246
|
+
`).concat([
|
|
247
|
+
t && "position: relative ".concat(r, ";"),
|
|
248
|
+
n === "margin" && `
|
|
249
|
+
padding-left: `.concat(a, `px;
|
|
250
|
+
padding-top: `).concat(i, `px;
|
|
251
|
+
padding-right: `).concat(l, `px;
|
|
252
|
+
margin-left:0;
|
|
253
|
+
margin-top:0;
|
|
254
|
+
margin-right: `).concat(o, "px ").concat(r, `;
|
|
255
|
+
`),
|
|
256
|
+
n === "padding" && "padding-right: ".concat(o, "px ").concat(r, ";")
|
|
257
|
+
].filter(Boolean).join(""), `
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.`).concat(N, ` {
|
|
261
|
+
right: `).concat(o, "px ").concat(r, `;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.`).concat(A, ` {
|
|
265
|
+
margin-right: `).concat(o, "px ").concat(r, `;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.`).concat(N, " .").concat(N, ` {
|
|
269
|
+
right: 0 `).concat(r, `;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.`).concat(A, " .").concat(A, ` {
|
|
273
|
+
margin-right: 0 `).concat(r, `;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
body[`).concat(M, `] {
|
|
277
|
+
`).concat(ne, ": ").concat(o, `px;
|
|
278
|
+
}
|
|
279
|
+
`);
|
|
280
|
+
}, V = function() {
|
|
281
|
+
var e = parseInt(document.body.getAttribute(M) || "0", 10);
|
|
282
|
+
return isFinite(e) ? e : 0;
|
|
283
|
+
}, be = function() {
|
|
284
|
+
u.useEffect(function() {
|
|
285
|
+
return document.body.setAttribute(M, (V() + 1).toString()), function() {
|
|
286
|
+
var e = V() - 1;
|
|
287
|
+
e <= 0 ? document.body.removeAttribute(M) : document.body.setAttribute(M, e.toString());
|
|
288
|
+
};
|
|
289
|
+
}, []);
|
|
290
|
+
}, we = function(e) {
|
|
291
|
+
var t = e.noRelative, n = e.noImportant, r = e.gapMode, a = r === void 0 ? "margin" : r;
|
|
292
|
+
be();
|
|
293
|
+
var i = u.useMemo(function() {
|
|
294
|
+
return ye(a);
|
|
295
|
+
}, [a]);
|
|
296
|
+
return u.createElement(Se, { styles: pe(i, !t, a, n ? "" : "!important") });
|
|
297
|
+
}, Y = !1;
|
|
298
|
+
if (typeof window < "u")
|
|
299
|
+
try {
|
|
300
|
+
var B = Object.defineProperty({}, "passive", {
|
|
301
|
+
get: function() {
|
|
302
|
+
return Y = !0, !0;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
window.addEventListener("test", B, B), window.removeEventListener("test", B, B);
|
|
306
|
+
} catch {
|
|
307
|
+
Y = !1;
|
|
308
|
+
}
|
|
309
|
+
var k = Y ? { passive: !1 } : !1, Ce = function(e) {
|
|
310
|
+
return e.tagName === "TEXTAREA";
|
|
311
|
+
}, $ = function(e, t) {
|
|
312
|
+
if (!(e instanceof Element))
|
|
313
|
+
return !1;
|
|
314
|
+
var n = window.getComputedStyle(e);
|
|
315
|
+
return (
|
|
316
|
+
// not-not-scrollable
|
|
317
|
+
n[t] !== "hidden" && // contains scroll inside self
|
|
318
|
+
!(n.overflowY === n.overflowX && !Ce(e) && n[t] === "visible")
|
|
319
|
+
);
|
|
320
|
+
}, Ee = function(e) {
|
|
321
|
+
return $(e, "overflowY");
|
|
322
|
+
}, Re = function(e) {
|
|
323
|
+
return $(e, "overflowX");
|
|
324
|
+
}, H = function(e, t) {
|
|
325
|
+
var n = t.ownerDocument, r = t;
|
|
326
|
+
do {
|
|
327
|
+
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
328
|
+
var a = q(e, r);
|
|
329
|
+
if (a) {
|
|
330
|
+
var i = J(e, r), l = i[1], o = i[2];
|
|
331
|
+
if (l > o)
|
|
332
|
+
return !0;
|
|
333
|
+
}
|
|
334
|
+
r = r.parentNode;
|
|
335
|
+
} while (r && r !== n.body);
|
|
336
|
+
return !1;
|
|
337
|
+
}, ke = function(e) {
|
|
338
|
+
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
|
|
339
|
+
return [
|
|
340
|
+
t,
|
|
341
|
+
n,
|
|
342
|
+
r
|
|
343
|
+
];
|
|
344
|
+
}, Pe = function(e) {
|
|
345
|
+
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
|
|
346
|
+
return [
|
|
347
|
+
t,
|
|
348
|
+
n,
|
|
349
|
+
r
|
|
350
|
+
];
|
|
351
|
+
}, q = function(e, t) {
|
|
352
|
+
return e === "v" ? Ee(t) : Re(t);
|
|
353
|
+
}, J = function(e, t) {
|
|
354
|
+
return e === "v" ? ke(t) : Pe(t);
|
|
355
|
+
}, Me = function(e, t) {
|
|
356
|
+
return e === "h" && t === "rtl" ? -1 : 1;
|
|
357
|
+
}, Le = function(e, t, n, r, a) {
|
|
358
|
+
var i = Me(e, window.getComputedStyle(t).direction), l = i * r, o = n.target, h = t.contains(o), m = !1, d = l > 0, b = 0, E = 0;
|
|
359
|
+
do {
|
|
360
|
+
var w = J(e, o), C = w[0], c = w[1], f = w[2], v = c - f - i * C;
|
|
361
|
+
(C || v) && q(e, o) && (b += v, E += C), o instanceof ShadowRoot ? o = o.host : o = o.parentNode;
|
|
362
|
+
} while (
|
|
363
|
+
// portaled content
|
|
364
|
+
!h && o !== document.body || // self content
|
|
365
|
+
h && (t.contains(o) || t === o)
|
|
366
|
+
);
|
|
367
|
+
return (d && (Math.abs(b) < 1 || !a) || !d && (Math.abs(E) < 1 || !a)) && (m = !0), m;
|
|
368
|
+
}, x = function(e) {
|
|
369
|
+
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
370
|
+
}, z = function(e) {
|
|
371
|
+
return [e.deltaX, e.deltaY];
|
|
372
|
+
}, F = function(e) {
|
|
373
|
+
return e && "current" in e ? e.current : e;
|
|
374
|
+
}, Te = function(e, t) {
|
|
375
|
+
return e[0] === t[0] && e[1] === t[1];
|
|
376
|
+
}, Be = function(e) {
|
|
377
|
+
return `
|
|
378
|
+
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
379
|
+
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
380
|
+
`);
|
|
381
|
+
}, xe = 0, P = [];
|
|
382
|
+
function Ne(e) {
|
|
383
|
+
var t = u.useRef([]), n = u.useRef([0, 0]), r = u.useRef(), a = u.useState(xe++)[0], i = u.useState(U)[0], l = u.useRef(e);
|
|
384
|
+
u.useEffect(function() {
|
|
385
|
+
l.current = e;
|
|
386
|
+
}, [e]), u.useEffect(function() {
|
|
387
|
+
if (e.inert) {
|
|
388
|
+
document.body.classList.add("block-interactivity-".concat(a));
|
|
389
|
+
var c = te([e.lockRef.current], (e.shards || []).map(F), !0).filter(Boolean);
|
|
390
|
+
return c.forEach(function(f) {
|
|
391
|
+
return f.classList.add("allow-interactivity-".concat(a));
|
|
392
|
+
}), function() {
|
|
393
|
+
document.body.classList.remove("block-interactivity-".concat(a)), c.forEach(function(f) {
|
|
394
|
+
return f.classList.remove("allow-interactivity-".concat(a));
|
|
395
|
+
});
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
}, [e.inert, e.lockRef.current, e.shards]);
|
|
399
|
+
var o = u.useCallback(function(c, f) {
|
|
400
|
+
if ("touches" in c && c.touches.length === 2 || c.type === "wheel" && c.ctrlKey)
|
|
401
|
+
return !l.current.allowPinchZoom;
|
|
402
|
+
var v = x(c), y = n.current, g = "deltaX" in c ? c.deltaX : y[0] - v[0], p = "deltaY" in c ? c.deltaY : y[1] - v[1], s, R = c.target, L = Math.abs(g) > Math.abs(p) ? "h" : "v";
|
|
403
|
+
if ("touches" in c && L === "h" && R.type === "range")
|
|
404
|
+
return !1;
|
|
405
|
+
var T = H(L, R);
|
|
406
|
+
if (!T)
|
|
407
|
+
return !0;
|
|
408
|
+
if (T ? s = L : (s = L === "v" ? "h" : "v", T = H(L, R)), !T)
|
|
409
|
+
return !1;
|
|
410
|
+
if (!r.current && "changedTouches" in c && (g || p) && (r.current = s), !s)
|
|
411
|
+
return !0;
|
|
412
|
+
var j = r.current || s;
|
|
413
|
+
return Le(j, f, c, j === "h" ? g : p, !0);
|
|
414
|
+
}, []), h = u.useCallback(function(c) {
|
|
415
|
+
var f = c;
|
|
416
|
+
if (!(!P.length || P[P.length - 1] !== i)) {
|
|
417
|
+
var v = "deltaY" in f ? z(f) : x(f), y = t.current.filter(function(s) {
|
|
418
|
+
return s.name === f.type && (s.target === f.target || f.target === s.shadowParent) && Te(s.delta, v);
|
|
419
|
+
})[0];
|
|
420
|
+
if (y && y.should) {
|
|
421
|
+
f.cancelable && f.preventDefault();
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
if (!y) {
|
|
425
|
+
var g = (l.current.shards || []).map(F).filter(Boolean).filter(function(s) {
|
|
426
|
+
return s.contains(f.target);
|
|
427
|
+
}), p = g.length > 0 ? o(f, g[0]) : !l.current.noIsolation;
|
|
428
|
+
p && f.cancelable && f.preventDefault();
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}, []), m = u.useCallback(function(c, f, v, y) {
|
|
432
|
+
var g = { name: c, delta: f, target: v, should: y, shadowParent: Ae(v) };
|
|
433
|
+
t.current.push(g), setTimeout(function() {
|
|
434
|
+
t.current = t.current.filter(function(p) {
|
|
435
|
+
return p !== g;
|
|
436
|
+
});
|
|
437
|
+
}, 1);
|
|
438
|
+
}, []), d = u.useCallback(function(c) {
|
|
439
|
+
n.current = x(c), r.current = void 0;
|
|
440
|
+
}, []), b = u.useCallback(function(c) {
|
|
441
|
+
m(c.type, z(c), c.target, o(c, e.lockRef.current));
|
|
442
|
+
}, []), E = u.useCallback(function(c) {
|
|
443
|
+
m(c.type, x(c), c.target, o(c, e.lockRef.current));
|
|
444
|
+
}, []);
|
|
445
|
+
u.useEffect(function() {
|
|
446
|
+
return P.push(i), e.setCallbacks({
|
|
447
|
+
onScrollCapture: b,
|
|
448
|
+
onWheelCapture: b,
|
|
449
|
+
onTouchMoveCapture: E
|
|
450
|
+
}), document.addEventListener("wheel", h, k), document.addEventListener("touchmove", h, k), document.addEventListener("touchstart", d, k), function() {
|
|
451
|
+
P = P.filter(function(c) {
|
|
452
|
+
return c !== i;
|
|
453
|
+
}), document.removeEventListener("wheel", h, k), document.removeEventListener("touchmove", h, k), document.removeEventListener("touchstart", d, k);
|
|
454
|
+
};
|
|
455
|
+
}, []);
|
|
456
|
+
var w = e.removeScrollBar, C = e.inert;
|
|
457
|
+
return u.createElement(
|
|
458
|
+
u.Fragment,
|
|
459
|
+
null,
|
|
460
|
+
C ? u.createElement(i, { styles: Be(a) }) : null,
|
|
461
|
+
w ? u.createElement(we, { gapMode: e.gapMode }) : null
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
function Ae(e) {
|
|
465
|
+
for (var t = null; e !== null; )
|
|
466
|
+
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
467
|
+
return t;
|
|
468
|
+
}
|
|
469
|
+
const Ie = ue(K, Ne);
|
|
470
|
+
var We = u.forwardRef(function(e, t) {
|
|
471
|
+
return u.createElement(I, S({}, e, { ref: t, sideCar: Ie }));
|
|
472
|
+
});
|
|
473
|
+
We.classNames = I.classNames;
|
|
474
|
+
export {
|
|
475
|
+
We as R,
|
|
476
|
+
ie as a,
|
|
477
|
+
Xe as c,
|
|
478
|
+
ce as u
|
|
479
|
+
};
|