@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,341 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { useContext as J } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @remix-run/router v1.21.0
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Remix Software Inc.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
10
|
+
*
|
|
11
|
+
* @license MIT
|
|
12
|
+
*/
|
|
13
|
+
function N() {
|
|
14
|
+
return N = Object.assign ? Object.assign.bind() : function(e) {
|
|
15
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
16
|
+
var n = arguments[t];
|
|
17
|
+
for (var a in n)
|
|
18
|
+
Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
|
|
19
|
+
}
|
|
20
|
+
return e;
|
|
21
|
+
}, N.apply(this, arguments);
|
|
22
|
+
}
|
|
23
|
+
var w;
|
|
24
|
+
(function(e) {
|
|
25
|
+
e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
|
|
26
|
+
})(w || (w = {}));
|
|
27
|
+
function u(e, t) {
|
|
28
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
29
|
+
throw new Error(t);
|
|
30
|
+
}
|
|
31
|
+
function E(e, t) {
|
|
32
|
+
if (!e) {
|
|
33
|
+
typeof console < "u" && console.warn(t);
|
|
34
|
+
try {
|
|
35
|
+
throw new Error(t);
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function re(e) {
|
|
41
|
+
let {
|
|
42
|
+
pathname: t = "/",
|
|
43
|
+
search: n = "",
|
|
44
|
+
hash: a = ""
|
|
45
|
+
} = e;
|
|
46
|
+
return n && n !== "?" && (t += n.charAt(0) === "?" ? n : "?" + n), a && a !== "#" && (t += a.charAt(0) === "#" ? a : "#" + a), t;
|
|
47
|
+
}
|
|
48
|
+
function D(e) {
|
|
49
|
+
let t = {};
|
|
50
|
+
if (e) {
|
|
51
|
+
let n = e.indexOf("#");
|
|
52
|
+
n >= 0 && (t.hash = e.substr(n), e = e.substr(0, n));
|
|
53
|
+
let a = e.indexOf("?");
|
|
54
|
+
a >= 0 && (t.search = e.substr(a), e = e.substr(0, a)), e && (t.pathname = e);
|
|
55
|
+
}
|
|
56
|
+
return t;
|
|
57
|
+
}
|
|
58
|
+
var P;
|
|
59
|
+
(function(e) {
|
|
60
|
+
e.data = "data", e.deferred = "deferred", e.redirect = "redirect", e.error = "error";
|
|
61
|
+
})(P || (P = {}));
|
|
62
|
+
function se(e, t) {
|
|
63
|
+
typeof e == "string" && (e = {
|
|
64
|
+
path: e,
|
|
65
|
+
caseSensitive: !1,
|
|
66
|
+
end: !0
|
|
67
|
+
});
|
|
68
|
+
let [n, a] = T(e.path, e.caseSensitive, e.end), r = t.match(n);
|
|
69
|
+
if (!r) return null;
|
|
70
|
+
let i = r[0], o = i.replace(/(.)\/+$/, "$1"), l = r.slice(1);
|
|
71
|
+
return {
|
|
72
|
+
params: a.reduce((d, h, f) => {
|
|
73
|
+
let {
|
|
74
|
+
paramName: p,
|
|
75
|
+
isOptional: M
|
|
76
|
+
} = h;
|
|
77
|
+
if (p === "*") {
|
|
78
|
+
let A = l[f] || "";
|
|
79
|
+
o = i.slice(0, i.length - A.length).replace(/(.)\/+$/, "$1");
|
|
80
|
+
}
|
|
81
|
+
const b = l[f];
|
|
82
|
+
return M && !b ? d[p] = void 0 : d[p] = (b || "").replace(/%2F/g, "/"), d;
|
|
83
|
+
}, {}),
|
|
84
|
+
pathname: i,
|
|
85
|
+
pathnameBase: o,
|
|
86
|
+
pattern: e
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function T(e, t, n) {
|
|
90
|
+
t === void 0 && (t = !1), n === void 0 && (n = !0), E(e === "*" || !e.endsWith("*") || e.endsWith("/*"), 'Route path "' + e + '" will be treated as if it were ' + ('"' + e.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + e.replace(/\*$/, "/*") + '".'));
|
|
91
|
+
let a = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (o, l, c) => (a.push({
|
|
92
|
+
paramName: l,
|
|
93
|
+
isOptional: c != null
|
|
94
|
+
}), c ? "/?([^\\/]+)?" : "/([^\\/]+)"));
|
|
95
|
+
return e.endsWith("*") ? (a.push({
|
|
96
|
+
paramName: "*"
|
|
97
|
+
}), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, t ? void 0 : "i"), a];
|
|
98
|
+
}
|
|
99
|
+
function ie(e, t) {
|
|
100
|
+
if (t === "/") return e;
|
|
101
|
+
if (!e.toLowerCase().startsWith(t.toLowerCase()))
|
|
102
|
+
return null;
|
|
103
|
+
let n = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(n);
|
|
104
|
+
return a && a !== "/" ? null : e.slice(n) || "/";
|
|
105
|
+
}
|
|
106
|
+
function q(e, t) {
|
|
107
|
+
t === void 0 && (t = "/");
|
|
108
|
+
let {
|
|
109
|
+
pathname: n,
|
|
110
|
+
search: a = "",
|
|
111
|
+
hash: r = ""
|
|
112
|
+
} = typeof e == "string" ? D(e) : e;
|
|
113
|
+
return {
|
|
114
|
+
pathname: n ? n.startsWith("/") ? n : z(n, t) : t,
|
|
115
|
+
search: G(a),
|
|
116
|
+
hash: Y(r)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function z(e, t) {
|
|
120
|
+
let n = t.replace(/\/+$/, "").split("/");
|
|
121
|
+
return e.split("/").forEach((r) => {
|
|
122
|
+
r === ".." ? n.length > 1 && n.pop() : r !== "." && n.push(r);
|
|
123
|
+
}), n.length > 1 ? n.join("/") : "/";
|
|
124
|
+
}
|
|
125
|
+
function g(e, t, n, a) {
|
|
126
|
+
return "Cannot include a '" + e + "' character in a manually specified " + ("`to." + t + "` field [" + JSON.stringify(a) + "]. Please separate it out to the ") + ("`to." + n + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
|
|
127
|
+
}
|
|
128
|
+
function F(e) {
|
|
129
|
+
return e.filter((t, n) => n === 0 || t.route.path && t.route.path.length > 0);
|
|
130
|
+
}
|
|
131
|
+
function S(e, t) {
|
|
132
|
+
let n = F(e);
|
|
133
|
+
return t ? n.map((a, r) => r === n.length - 1 ? a.pathname : a.pathnameBase) : n.map((a) => a.pathnameBase);
|
|
134
|
+
}
|
|
135
|
+
function U(e, t, n, a) {
|
|
136
|
+
a === void 0 && (a = !1);
|
|
137
|
+
let r;
|
|
138
|
+
typeof e == "string" ? r = D(e) : (r = N({}, e), u(!r.pathname || !r.pathname.includes("?"), g("?", "pathname", "search", r)), u(!r.pathname || !r.pathname.includes("#"), g("#", "pathname", "hash", r)), u(!r.search || !r.search.includes("#"), g("#", "search", "hash", r)));
|
|
139
|
+
let i = e === "" || r.pathname === "", o = i ? "/" : r.pathname, l;
|
|
140
|
+
if (o == null)
|
|
141
|
+
l = n;
|
|
142
|
+
else {
|
|
143
|
+
let f = t.length - 1;
|
|
144
|
+
if (!a && o.startsWith("..")) {
|
|
145
|
+
let p = o.split("/");
|
|
146
|
+
for (; p[0] === ".."; )
|
|
147
|
+
p.shift(), f -= 1;
|
|
148
|
+
r.pathname = p.join("/");
|
|
149
|
+
}
|
|
150
|
+
l = f >= 0 ? t[f] : "/";
|
|
151
|
+
}
|
|
152
|
+
let c = q(r, l), d = o && o !== "/" && o.endsWith("/"), h = (i || o === ".") && n.endsWith("/");
|
|
153
|
+
return !c.pathname.endsWith("/") && (d || h) && (c.pathname += "/"), c;
|
|
154
|
+
}
|
|
155
|
+
const _ = (e) => e.join("/").replace(/\/\/+/g, "/"), G = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Y = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, V = ["post", "put", "patch", "delete"];
|
|
156
|
+
new Set(V);
|
|
157
|
+
const K = ["get", ...V];
|
|
158
|
+
new Set(K);
|
|
159
|
+
/**
|
|
160
|
+
* React Router v6.28.0
|
|
161
|
+
*
|
|
162
|
+
* Copyright (c) Remix Software Inc.
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the MIT license found in the
|
|
165
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
166
|
+
*
|
|
167
|
+
* @license MIT
|
|
168
|
+
*/
|
|
169
|
+
function x() {
|
|
170
|
+
return x = Object.assign ? Object.assign.bind() : function(e) {
|
|
171
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
172
|
+
var n = arguments[t];
|
|
173
|
+
for (var a in n)
|
|
174
|
+
Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
|
|
175
|
+
}
|
|
176
|
+
return e;
|
|
177
|
+
}, x.apply(this, arguments);
|
|
178
|
+
}
|
|
179
|
+
const C = /* @__PURE__ */ s.createContext(null);
|
|
180
|
+
process.env.NODE_ENV !== "production" && (C.displayName = "DataRouter");
|
|
181
|
+
const Q = /* @__PURE__ */ s.createContext(null);
|
|
182
|
+
process.env.NODE_ENV !== "production" && (Q.displayName = "DataRouterState");
|
|
183
|
+
const X = /* @__PURE__ */ s.createContext(null);
|
|
184
|
+
process.env.NODE_ENV !== "production" && (X.displayName = "Await");
|
|
185
|
+
const m = /* @__PURE__ */ s.createContext(null);
|
|
186
|
+
process.env.NODE_ENV !== "production" && (m.displayName = "Navigation");
|
|
187
|
+
const y = /* @__PURE__ */ s.createContext(null);
|
|
188
|
+
process.env.NODE_ENV !== "production" && (y.displayName = "Location");
|
|
189
|
+
const v = /* @__PURE__ */ s.createContext({
|
|
190
|
+
outlet: null,
|
|
191
|
+
matches: [],
|
|
192
|
+
isDataRoute: !1
|
|
193
|
+
});
|
|
194
|
+
process.env.NODE_ENV !== "production" && (v.displayName = "Route");
|
|
195
|
+
const Z = /* @__PURE__ */ s.createContext(null);
|
|
196
|
+
process.env.NODE_ENV !== "production" && (Z.displayName = "RouteError");
|
|
197
|
+
function oe(e, t) {
|
|
198
|
+
let {
|
|
199
|
+
relative: n
|
|
200
|
+
} = t === void 0 ? {} : t;
|
|
201
|
+
R() || (process.env.NODE_ENV !== "production" ? u(
|
|
202
|
+
!1,
|
|
203
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
204
|
+
// router loaded. We can help them understand how to avoid that.
|
|
205
|
+
"useHref() may be used only in the context of a <Router> component."
|
|
206
|
+
) : u(!1));
|
|
207
|
+
let {
|
|
208
|
+
basename: a,
|
|
209
|
+
navigator: r
|
|
210
|
+
} = s.useContext(m), {
|
|
211
|
+
hash: i,
|
|
212
|
+
pathname: o,
|
|
213
|
+
search: l
|
|
214
|
+
} = k(e, {
|
|
215
|
+
relative: n
|
|
216
|
+
}), c = o;
|
|
217
|
+
return a !== "/" && (c = o === "/" ? a : _([a, o])), r.createHref({
|
|
218
|
+
pathname: c,
|
|
219
|
+
search: l,
|
|
220
|
+
hash: i
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function R() {
|
|
224
|
+
return s.useContext(y) != null;
|
|
225
|
+
}
|
|
226
|
+
function $() {
|
|
227
|
+
return R() || (process.env.NODE_ENV !== "production" ? u(
|
|
228
|
+
!1,
|
|
229
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
230
|
+
// router loaded. We can help them understand how to avoid that.
|
|
231
|
+
"useLocation() may be used only in the context of a <Router> component."
|
|
232
|
+
) : u(!1)), s.useContext(y).location;
|
|
233
|
+
}
|
|
234
|
+
const I = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
235
|
+
function L(e) {
|
|
236
|
+
s.useContext(m).static || s.useLayoutEffect(e);
|
|
237
|
+
}
|
|
238
|
+
function ue() {
|
|
239
|
+
let {
|
|
240
|
+
isDataRoute: e
|
|
241
|
+
} = s.useContext(v);
|
|
242
|
+
return e ? ne() : H();
|
|
243
|
+
}
|
|
244
|
+
function H() {
|
|
245
|
+
R() || (process.env.NODE_ENV !== "production" ? u(
|
|
246
|
+
!1,
|
|
247
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
248
|
+
// router loaded. We can help them understand how to avoid that.
|
|
249
|
+
"useNavigate() may be used only in the context of a <Router> component."
|
|
250
|
+
) : u(!1));
|
|
251
|
+
let e = s.useContext(C), {
|
|
252
|
+
basename: t,
|
|
253
|
+
future: n,
|
|
254
|
+
navigator: a
|
|
255
|
+
} = s.useContext(m), {
|
|
256
|
+
matches: r
|
|
257
|
+
} = s.useContext(v), {
|
|
258
|
+
pathname: i
|
|
259
|
+
} = $(), o = JSON.stringify(S(r, n.v7_relativeSplatPath)), l = s.useRef(!1);
|
|
260
|
+
return L(() => {
|
|
261
|
+
l.current = !0;
|
|
262
|
+
}), s.useCallback(function(d, h) {
|
|
263
|
+
if (h === void 0 && (h = {}), process.env.NODE_ENV !== "production" && E(l.current, I), !l.current) return;
|
|
264
|
+
if (typeof d == "number") {
|
|
265
|
+
a.go(d);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
let f = U(d, JSON.parse(o), i, h.relative === "path");
|
|
269
|
+
e == null && t !== "/" && (f.pathname = f.pathname === "/" ? t : _([t, f.pathname])), (h.replace ? a.replace : a.push)(f, h.state, h);
|
|
270
|
+
}, [t, a, o, i, e]);
|
|
271
|
+
}
|
|
272
|
+
function k(e, t) {
|
|
273
|
+
let {
|
|
274
|
+
relative: n
|
|
275
|
+
} = t === void 0 ? {} : t, {
|
|
276
|
+
future: a
|
|
277
|
+
} = s.useContext(m), {
|
|
278
|
+
matches: r
|
|
279
|
+
} = s.useContext(v), {
|
|
280
|
+
pathname: i
|
|
281
|
+
} = $(), o = JSON.stringify(S(r, a.v7_relativeSplatPath));
|
|
282
|
+
return s.useMemo(() => U(e, JSON.parse(o), i, n === "path"), [e, o, i, n]);
|
|
283
|
+
}
|
|
284
|
+
var W = /* @__PURE__ */ function(e) {
|
|
285
|
+
return e.UseBlocker = "useBlocker", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e;
|
|
286
|
+
}(W || {}), O = /* @__PURE__ */ function(e) {
|
|
287
|
+
return e.UseBlocker = "useBlocker", e.UseLoaderData = "useLoaderData", e.UseActionData = "useActionData", e.UseRouteError = "useRouteError", e.UseNavigation = "useNavigation", e.UseRouteLoaderData = "useRouteLoaderData", e.UseMatches = "useMatches", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e.UseRouteId = "useRouteId", e;
|
|
288
|
+
}(O || {});
|
|
289
|
+
function j(e) {
|
|
290
|
+
return e + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
|
|
291
|
+
}
|
|
292
|
+
function ee(e) {
|
|
293
|
+
let t = s.useContext(C);
|
|
294
|
+
return t || (process.env.NODE_ENV !== "production" ? u(!1, j(e)) : u(!1)), t;
|
|
295
|
+
}
|
|
296
|
+
function te(e) {
|
|
297
|
+
let t = s.useContext(v);
|
|
298
|
+
return t || (process.env.NODE_ENV !== "production" ? u(!1, j(e)) : u(!1)), t;
|
|
299
|
+
}
|
|
300
|
+
function B(e) {
|
|
301
|
+
let t = te(e), n = t.matches[t.matches.length - 1];
|
|
302
|
+
return n.route.id || (process.env.NODE_ENV !== "production" ? u(!1, e + ' can only be used on routes that contain a unique "id"') : u(!1)), n.route.id;
|
|
303
|
+
}
|
|
304
|
+
function le() {
|
|
305
|
+
return B(O.UseRouteId);
|
|
306
|
+
}
|
|
307
|
+
function ne() {
|
|
308
|
+
let {
|
|
309
|
+
router: e
|
|
310
|
+
} = ee(W.UseNavigateStable), t = B(O.UseNavigateStable), n = s.useRef(!1);
|
|
311
|
+
return L(() => {
|
|
312
|
+
n.current = !0;
|
|
313
|
+
}), s.useCallback(function(r, i) {
|
|
314
|
+
i === void 0 && (i = {}), process.env.NODE_ENV !== "production" && E(n.current, I), n.current && (typeof r == "number" ? e.navigate(r) : e.navigate(r, x({
|
|
315
|
+
fromRouteId: t
|
|
316
|
+
}, i)));
|
|
317
|
+
}, [e, t]);
|
|
318
|
+
}
|
|
319
|
+
new Promise(() => {
|
|
320
|
+
});
|
|
321
|
+
const ce = () => ({
|
|
322
|
+
isInsideRouter: J(v).outlet !== null
|
|
323
|
+
});
|
|
324
|
+
export {
|
|
325
|
+
Q as D,
|
|
326
|
+
m as N,
|
|
327
|
+
v as R,
|
|
328
|
+
ue as a,
|
|
329
|
+
$ as b,
|
|
330
|
+
k as c,
|
|
331
|
+
re as d,
|
|
332
|
+
le as e,
|
|
333
|
+
C as f,
|
|
334
|
+
ce as g,
|
|
335
|
+
u as i,
|
|
336
|
+
_ as j,
|
|
337
|
+
se as m,
|
|
338
|
+
ie as s,
|
|
339
|
+
oe as u,
|
|
340
|
+
E as w
|
|
341
|
+
};
|