@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,81 @@
|
|
|
1
|
+
import { useState as d, useEffect as m, useCallback as b } from "react";
|
|
2
|
+
import { filterByValue as y } from "../../../utils/index.js";
|
|
3
|
+
const S = ({
|
|
4
|
+
options: u,
|
|
5
|
+
inputRef: l,
|
|
6
|
+
wrapperRef: o,
|
|
7
|
+
onChange: r
|
|
8
|
+
}) => {
|
|
9
|
+
const [v, f] = d(() => u ?? []), [O, n] = d(!1), [g, E] = d("");
|
|
10
|
+
m(() => {
|
|
11
|
+
var s;
|
|
12
|
+
const t = new AbortController();
|
|
13
|
+
return (s = l.current) == null || s.addEventListener("focus", () => n(!0), {
|
|
14
|
+
signal: t.signal
|
|
15
|
+
}), () => {
|
|
16
|
+
t.abort();
|
|
17
|
+
};
|
|
18
|
+
}, [l]), m(() => {
|
|
19
|
+
const t = new AbortController(), s = (e) => {
|
|
20
|
+
var a;
|
|
21
|
+
e.key === "Escape" && (n(!1), (a = l.current) == null || a.blur());
|
|
22
|
+
}, c = (e) => {
|
|
23
|
+
var a;
|
|
24
|
+
(a = o.current) != null && a.contains(e.target) || n(!1);
|
|
25
|
+
};
|
|
26
|
+
return document.addEventListener("keydown", s, {
|
|
27
|
+
signal: t.signal
|
|
28
|
+
}), document.addEventListener("mousedown", c, {
|
|
29
|
+
signal: t.signal
|
|
30
|
+
}), () => {
|
|
31
|
+
t.abort();
|
|
32
|
+
};
|
|
33
|
+
}, [l, o]), m(() => {
|
|
34
|
+
var s;
|
|
35
|
+
const t = new AbortController();
|
|
36
|
+
return (s = o.current) == null || s.addEventListener(
|
|
37
|
+
"focusout",
|
|
38
|
+
(c) => {
|
|
39
|
+
var e;
|
|
40
|
+
(e = o.current) != null && e.contains(c.relatedTarget) || n(!1);
|
|
41
|
+
},
|
|
42
|
+
{ signal: t.signal }
|
|
43
|
+
), () => {
|
|
44
|
+
t.abort();
|
|
45
|
+
};
|
|
46
|
+
}, [o]);
|
|
47
|
+
const i = b(
|
|
48
|
+
(t) => {
|
|
49
|
+
if (t.length === 0)
|
|
50
|
+
f(u);
|
|
51
|
+
else {
|
|
52
|
+
const s = u.map(({ value: e }) => e), c = y(s, t).map(
|
|
53
|
+
(e) => ({ value: e })
|
|
54
|
+
);
|
|
55
|
+
f(c);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[u]
|
|
59
|
+
), k = b(
|
|
60
|
+
(t) => {
|
|
61
|
+
E(t.target.value), i(t.target.value), r == null || r(t.target.value);
|
|
62
|
+
},
|
|
63
|
+
[i, r]
|
|
64
|
+
), w = b(
|
|
65
|
+
(t) => {
|
|
66
|
+
E(t), i(t), r == null || r(t), n(!1);
|
|
67
|
+
},
|
|
68
|
+
[i, r]
|
|
69
|
+
);
|
|
70
|
+
return {
|
|
71
|
+
inputRef: l,
|
|
72
|
+
newOptions: v,
|
|
73
|
+
showOptions: O,
|
|
74
|
+
value: g,
|
|
75
|
+
handleChange: k,
|
|
76
|
+
handleSelectValue: w
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
S as useAutocomplete
|
|
81
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { Option } from '../Autocomplete.types';
|
|
3
|
+
type UseNavigationListProps = {
|
|
4
|
+
ulRef: RefObject<HTMLUListElement>;
|
|
5
|
+
inputRef: RefObject<HTMLInputElement>;
|
|
6
|
+
wrapperRef: RefObject<HTMLDivElement>;
|
|
7
|
+
options: Option[];
|
|
8
|
+
};
|
|
9
|
+
export declare const useNavigationUlList: ({ ulRef, inputRef, wrapperRef, options, }: UseNavigationListProps) => void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useRef as d, useEffect as i } from "react";
|
|
2
|
+
const y = ({
|
|
3
|
+
ulRef: c,
|
|
4
|
+
inputRef: l,
|
|
5
|
+
wrapperRef: b,
|
|
6
|
+
options: g
|
|
7
|
+
}) => {
|
|
8
|
+
const r = d(0);
|
|
9
|
+
i(() => {
|
|
10
|
+
var o, k;
|
|
11
|
+
const e = ((o = c.current) == null ? void 0 : o.querySelectorAll("li")) ?? [], t = new AbortController(), u = () => {
|
|
12
|
+
r.current < e.length - 1 ? (r.current = r.current + 1, e[r.current].focus()) : (r.current = 0, e[0].focus());
|
|
13
|
+
}, n = () => {
|
|
14
|
+
var s;
|
|
15
|
+
r.current > 0 ? (r.current = r.current - 1, e[r.current].focus()) : (r.current = 0, (s = l.current) == null || s.focus());
|
|
16
|
+
};
|
|
17
|
+
return (k = c.current) == null || k.addEventListener(
|
|
18
|
+
"keydown",
|
|
19
|
+
(s) => {
|
|
20
|
+
var w;
|
|
21
|
+
switch (s.preventDefault(), s.key) {
|
|
22
|
+
case "ArrowDown": {
|
|
23
|
+
u();
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
case "Tab": {
|
|
27
|
+
s.shiftKey ? n() : u();
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
case "ArrowUp": {
|
|
31
|
+
r.current === 0 ? (w = l.current) == null || w.focus() : n();
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case "Enter": {
|
|
35
|
+
const a = e[r.current].querySelector("button");
|
|
36
|
+
a == null || a.click();
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{ signal: t.signal }
|
|
42
|
+
), () => {
|
|
43
|
+
t.abort();
|
|
44
|
+
};
|
|
45
|
+
}, [l, c, g, r]), i(() => {
|
|
46
|
+
var t;
|
|
47
|
+
const e = new AbortController();
|
|
48
|
+
return (t = l.current) == null || t.addEventListener(
|
|
49
|
+
"keydown",
|
|
50
|
+
(u) => {
|
|
51
|
+
var n;
|
|
52
|
+
if (u.key === "ArrowDown") {
|
|
53
|
+
const o = (n = c.current) == null ? void 0 : n.querySelector("li");
|
|
54
|
+
o && o.focus();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{ signal: e.signal }
|
|
58
|
+
), () => {
|
|
59
|
+
e.abort();
|
|
60
|
+
};
|
|
61
|
+
}, [l, c, g]), i(() => {
|
|
62
|
+
var t;
|
|
63
|
+
const e = new AbortController();
|
|
64
|
+
return (t = b.current) == null || t.addEventListener(
|
|
65
|
+
"mouseenter",
|
|
66
|
+
() => {
|
|
67
|
+
var n;
|
|
68
|
+
(((n = c.current) == null ? void 0 : n.querySelectorAll("li")) ?? []).forEach((o) => o.blur());
|
|
69
|
+
},
|
|
70
|
+
{ signal: e.signal }
|
|
71
|
+
), () => {
|
|
72
|
+
e.abort();
|
|
73
|
+
};
|
|
74
|
+
}, [c, b]);
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
y as useNavigationUlList
|
|
78
|
+
};
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { jsx as g, jsxs as ee, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import q, { forwardRef as ne, Fragment as re } from "react";
|
|
4
|
+
import "../../index-2hJuj4UN.js";
|
|
5
|
+
import { N as F, s as x, w as X, u as ie, a as ae, b as B, c as D, d as I, D as oe, e as le, R as se, i as N, j as ce, m as G, f as ue, g as fe } from "../../useBreadcrumb-BSMnc4Fu.js";
|
|
6
|
+
import "../../contexts/theme.context.js";
|
|
7
|
+
import { useTheme as me } from "../../contexts/theme.hook.js";
|
|
8
|
+
import "../../js.cookie-OLEfuq_g.js";
|
|
9
|
+
import { breadcrumbVariants as de, breadcrumbItemVariants as he, chevronVariants as pe } from "./Breadcrumb.variants.js";
|
|
10
|
+
import { P as T } from "../../index-DQMInta3.js";
|
|
11
|
+
function W() {
|
|
12
|
+
return W = Object.assign || function(e) {
|
|
13
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
14
|
+
var r = arguments[n];
|
|
15
|
+
for (var i in r)
|
|
16
|
+
Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
17
|
+
}
|
|
18
|
+
return e;
|
|
19
|
+
}, W.apply(this, arguments);
|
|
20
|
+
}
|
|
21
|
+
function ve(e, n) {
|
|
22
|
+
if (e == null) return {};
|
|
23
|
+
var r = we(e, n), i, t;
|
|
24
|
+
if (Object.getOwnPropertySymbols) {
|
|
25
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
26
|
+
for (t = 0; t < a.length; t++)
|
|
27
|
+
i = a[t], !(n.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(e, i) && (r[i] = e[i]);
|
|
28
|
+
}
|
|
29
|
+
return r;
|
|
30
|
+
}
|
|
31
|
+
function we(e, n) {
|
|
32
|
+
if (e == null) return {};
|
|
33
|
+
var r = {}, i = Object.keys(e), t, a;
|
|
34
|
+
for (a = 0; a < i.length; a++)
|
|
35
|
+
t = i[a], !(n.indexOf(t) >= 0) && (r[t] = e[t]);
|
|
36
|
+
return r;
|
|
37
|
+
}
|
|
38
|
+
var K = ne(function(e, n) {
|
|
39
|
+
var r = e.color, i = r === void 0 ? "currentColor" : r, t = e.size, a = t === void 0 ? 24 : t, o = ve(e, ["color", "size"]);
|
|
40
|
+
return /* @__PURE__ */ q.createElement("svg", W({
|
|
41
|
+
ref: n,
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
width: a,
|
|
44
|
+
height: a,
|
|
45
|
+
viewBox: "0 0 24 24",
|
|
46
|
+
fill: "none",
|
|
47
|
+
stroke: i,
|
|
48
|
+
strokeWidth: "2",
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeLinejoin: "round"
|
|
51
|
+
}, o), /* @__PURE__ */ q.createElement("polyline", {
|
|
52
|
+
points: "9 18 15 12 9 6"
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
55
|
+
K.propTypes = {
|
|
56
|
+
color: T.string,
|
|
57
|
+
size: T.oneOfType([T.string, T.number])
|
|
58
|
+
};
|
|
59
|
+
K.displayName = "ChevronRight";
|
|
60
|
+
/**
|
|
61
|
+
* React Router DOM v6.28.0
|
|
62
|
+
*
|
|
63
|
+
* Copyright (c) Remix Software Inc.
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the MIT license found in the
|
|
66
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
67
|
+
*
|
|
68
|
+
* @license MIT
|
|
69
|
+
*/
|
|
70
|
+
function S() {
|
|
71
|
+
return S = Object.assign ? Object.assign.bind() : function(e) {
|
|
72
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
73
|
+
var r = arguments[n];
|
|
74
|
+
for (var i in r)
|
|
75
|
+
Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
76
|
+
}
|
|
77
|
+
return e;
|
|
78
|
+
}, S.apply(this, arguments);
|
|
79
|
+
}
|
|
80
|
+
function M(e, n) {
|
|
81
|
+
if (e == null) return {};
|
|
82
|
+
var r = {}, i = Object.keys(e), t, a;
|
|
83
|
+
for (a = 0; a < i.length; a++)
|
|
84
|
+
t = i[a], !(n.indexOf(t) >= 0) && (r[t] = e[t]);
|
|
85
|
+
return r;
|
|
86
|
+
}
|
|
87
|
+
const O = "get", P = "application/x-www-form-urlencoded";
|
|
88
|
+
function k(e) {
|
|
89
|
+
return e != null && typeof e.tagName == "string";
|
|
90
|
+
}
|
|
91
|
+
function ge(e) {
|
|
92
|
+
return k(e) && e.tagName.toLowerCase() === "button";
|
|
93
|
+
}
|
|
94
|
+
function be(e) {
|
|
95
|
+
return k(e) && e.tagName.toLowerCase() === "form";
|
|
96
|
+
}
|
|
97
|
+
function ye(e) {
|
|
98
|
+
return k(e) && e.tagName.toLowerCase() === "input";
|
|
99
|
+
}
|
|
100
|
+
function Ee(e) {
|
|
101
|
+
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
102
|
+
}
|
|
103
|
+
function xe(e, n) {
|
|
104
|
+
return e.button === 0 && // Ignore everything but left clicks
|
|
105
|
+
(!n || n === "_self") && // Let browser handle "target=_blank" etc.
|
|
106
|
+
!Ee(e);
|
|
107
|
+
}
|
|
108
|
+
let L = null;
|
|
109
|
+
function Ne() {
|
|
110
|
+
if (L === null)
|
|
111
|
+
try {
|
|
112
|
+
new FormData(
|
|
113
|
+
document.createElement("form"),
|
|
114
|
+
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
115
|
+
0
|
|
116
|
+
), L = !1;
|
|
117
|
+
} catch {
|
|
118
|
+
L = !0;
|
|
119
|
+
}
|
|
120
|
+
return L;
|
|
121
|
+
}
|
|
122
|
+
const Se = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
123
|
+
function j(e) {
|
|
124
|
+
return e != null && !Se.has(e) ? (process.env.NODE_ENV !== "production" && X(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + P + '"')), null) : e;
|
|
125
|
+
}
|
|
126
|
+
function Ce(e, n) {
|
|
127
|
+
let r, i, t, a, o;
|
|
128
|
+
if (be(e)) {
|
|
129
|
+
let s = e.getAttribute("action");
|
|
130
|
+
i = s ? x(s, n) : null, r = e.getAttribute("method") || O, t = j(e.getAttribute("enctype")) || P, a = new FormData(e);
|
|
131
|
+
} else if (ge(e) || ye(e) && (e.type === "submit" || e.type === "image")) {
|
|
132
|
+
let s = e.form;
|
|
133
|
+
if (s == null)
|
|
134
|
+
throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
|
|
135
|
+
let c = e.getAttribute("formaction") || s.getAttribute("action");
|
|
136
|
+
if (i = c ? x(c, n) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || O, t = j(e.getAttribute("formenctype")) || j(s.getAttribute("enctype")) || P, a = new FormData(s, e), !Ne()) {
|
|
137
|
+
let {
|
|
138
|
+
name: l,
|
|
139
|
+
type: f,
|
|
140
|
+
value: p
|
|
141
|
+
} = e;
|
|
142
|
+
if (f === "image") {
|
|
143
|
+
let v = l ? l + "." : "";
|
|
144
|
+
a.append(v + "x", "0"), a.append(v + "y", "0");
|
|
145
|
+
} else l && a.append(l, p);
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
if (k(e))
|
|
149
|
+
throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
|
|
150
|
+
r = O, i = null, t = P, o = e;
|
|
151
|
+
}
|
|
152
|
+
return a && t === "text/plain" && (o = a, a = void 0), {
|
|
153
|
+
action: i,
|
|
154
|
+
method: r.toLowerCase(),
|
|
155
|
+
encType: t,
|
|
156
|
+
formData: a,
|
|
157
|
+
body: o
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const Re = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"], Te = ["aria-current", "caseSensitive", "className", "end", "style", "to", "viewTransition", "children"], Le = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "viewTransition"], Oe = "6";
|
|
161
|
+
try {
|
|
162
|
+
window.__reactRouterVersion = Oe;
|
|
163
|
+
} catch {
|
|
164
|
+
}
|
|
165
|
+
const Y = /* @__PURE__ */ d.createContext({
|
|
166
|
+
isTransitioning: !1
|
|
167
|
+
});
|
|
168
|
+
process.env.NODE_ENV !== "production" && (Y.displayName = "ViewTransition");
|
|
169
|
+
const Pe = /* @__PURE__ */ d.createContext(/* @__PURE__ */ new Map());
|
|
170
|
+
process.env.NODE_ENV !== "production" && (Pe.displayName = "Fetchers");
|
|
171
|
+
process.env.NODE_ENV;
|
|
172
|
+
const _e = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", Fe = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, z = /* @__PURE__ */ d.forwardRef(function(n, r) {
|
|
173
|
+
let {
|
|
174
|
+
onClick: i,
|
|
175
|
+
relative: t,
|
|
176
|
+
reloadDocument: a,
|
|
177
|
+
replace: o,
|
|
178
|
+
state: s,
|
|
179
|
+
target: c,
|
|
180
|
+
to: l,
|
|
181
|
+
preventScrollReset: f,
|
|
182
|
+
viewTransition: p
|
|
183
|
+
} = n, v = M(n, Re), {
|
|
184
|
+
basename: C
|
|
185
|
+
} = d.useContext(F), w, b = !1;
|
|
186
|
+
if (typeof l == "string" && Fe.test(l) && (w = l, _e))
|
|
187
|
+
try {
|
|
188
|
+
let h = new URL(window.location.href), m = l.startsWith("//") ? new URL(h.protocol + l) : new URL(l), R = x(m.pathname, C);
|
|
189
|
+
m.origin === h.origin && R != null ? l = R + m.search + m.hash : b = !0;
|
|
190
|
+
} catch {
|
|
191
|
+
process.env.NODE_ENV !== "production" && X(!1, '<Link to="' + l + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
|
|
192
|
+
}
|
|
193
|
+
let y = ie(l, {
|
|
194
|
+
relative: t
|
|
195
|
+
}), E = Ue(l, {
|
|
196
|
+
replace: o,
|
|
197
|
+
state: s,
|
|
198
|
+
target: c,
|
|
199
|
+
preventScrollReset: f,
|
|
200
|
+
relative: t,
|
|
201
|
+
viewTransition: p
|
|
202
|
+
});
|
|
203
|
+
function u(h) {
|
|
204
|
+
i && i(h), h.defaultPrevented || E(h);
|
|
205
|
+
}
|
|
206
|
+
return (
|
|
207
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
208
|
+
/* @__PURE__ */ d.createElement("a", S({}, v, {
|
|
209
|
+
href: w || y,
|
|
210
|
+
onClick: b || a ? i : u,
|
|
211
|
+
ref: r,
|
|
212
|
+
target: c
|
|
213
|
+
}))
|
|
214
|
+
);
|
|
215
|
+
});
|
|
216
|
+
process.env.NODE_ENV !== "production" && (z.displayName = "Link");
|
|
217
|
+
const De = /* @__PURE__ */ d.forwardRef(function(n, r) {
|
|
218
|
+
let {
|
|
219
|
+
"aria-current": i = "page",
|
|
220
|
+
caseSensitive: t = !1,
|
|
221
|
+
className: a = "",
|
|
222
|
+
end: o = !1,
|
|
223
|
+
style: s,
|
|
224
|
+
to: c,
|
|
225
|
+
viewTransition: l,
|
|
226
|
+
children: f
|
|
227
|
+
} = n, p = M(n, Te), v = D(c, {
|
|
228
|
+
relative: p.relative
|
|
229
|
+
}), C = B(), w = d.useContext(oe), {
|
|
230
|
+
navigator: b,
|
|
231
|
+
basename: y
|
|
232
|
+
} = d.useContext(F), E = w != null && // Conditional usage is OK here because the usage of a data router is static
|
|
233
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
234
|
+
Ke(v) && l === !0, u = b.encodeLocation ? b.encodeLocation(v).pathname : v.pathname, h = C.pathname, m = w && w.navigation && w.navigation.location ? w.navigation.location.pathname : null;
|
|
235
|
+
t || (h = h.toLowerCase(), m = m ? m.toLowerCase() : null, u = u.toLowerCase()), m && y && (m = x(m, y) || m);
|
|
236
|
+
const R = u !== "/" && u.endsWith("/") ? u.length - 1 : u.length;
|
|
237
|
+
let V = h === u || !o && h.startsWith(u) && h.charAt(R) === "/", $ = m != null && (m === u || !o && m.startsWith(u) && m.charAt(u.length) === "/"), U = {
|
|
238
|
+
isActive: V,
|
|
239
|
+
isPending: $,
|
|
240
|
+
isTransitioning: E
|
|
241
|
+
}, Q = V ? i : void 0, A;
|
|
242
|
+
typeof a == "function" ? A = a(U) : A = [a, V ? "active" : null, $ ? "pending" : null, E ? "transitioning" : null].filter(Boolean).join(" ");
|
|
243
|
+
let Z = typeof s == "function" ? s(U) : s;
|
|
244
|
+
return /* @__PURE__ */ d.createElement(z, S({}, p, {
|
|
245
|
+
"aria-current": Q,
|
|
246
|
+
className: A,
|
|
247
|
+
ref: r,
|
|
248
|
+
style: Z,
|
|
249
|
+
to: c,
|
|
250
|
+
viewTransition: l
|
|
251
|
+
}), typeof f == "function" ? f(U) : f);
|
|
252
|
+
});
|
|
253
|
+
process.env.NODE_ENV !== "production" && (De.displayName = "NavLink");
|
|
254
|
+
const ke = /* @__PURE__ */ d.forwardRef((e, n) => {
|
|
255
|
+
let {
|
|
256
|
+
fetcherKey: r,
|
|
257
|
+
navigate: i,
|
|
258
|
+
reloadDocument: t,
|
|
259
|
+
replace: a,
|
|
260
|
+
state: o,
|
|
261
|
+
method: s = O,
|
|
262
|
+
action: c,
|
|
263
|
+
onSubmit: l,
|
|
264
|
+
relative: f,
|
|
265
|
+
preventScrollReset: p,
|
|
266
|
+
viewTransition: v
|
|
267
|
+
} = e, C = M(e, Le), w = We(), b = Be(c, {
|
|
268
|
+
relative: f
|
|
269
|
+
}), y = s.toLowerCase() === "get" ? "get" : "post", E = (u) => {
|
|
270
|
+
if (l && l(u), u.defaultPrevented) return;
|
|
271
|
+
u.preventDefault();
|
|
272
|
+
let h = u.nativeEvent.submitter, m = (h == null ? void 0 : h.getAttribute("formmethod")) || s;
|
|
273
|
+
w(h || u.currentTarget, {
|
|
274
|
+
fetcherKey: r,
|
|
275
|
+
method: m,
|
|
276
|
+
navigate: i,
|
|
277
|
+
replace: a,
|
|
278
|
+
state: o,
|
|
279
|
+
relative: f,
|
|
280
|
+
preventScrollReset: p,
|
|
281
|
+
viewTransition: v
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
return /* @__PURE__ */ d.createElement("form", S({
|
|
285
|
+
ref: n,
|
|
286
|
+
method: y,
|
|
287
|
+
action: b,
|
|
288
|
+
onSubmit: t ? l : E
|
|
289
|
+
}, C));
|
|
290
|
+
});
|
|
291
|
+
process.env.NODE_ENV !== "production" && (ke.displayName = "Form");
|
|
292
|
+
process.env.NODE_ENV;
|
|
293
|
+
var _;
|
|
294
|
+
(function(e) {
|
|
295
|
+
e.UseScrollRestoration = "useScrollRestoration", e.UseSubmit = "useSubmit", e.UseSubmitFetcher = "useSubmitFetcher", e.UseFetcher = "useFetcher", e.useViewTransitionState = "useViewTransitionState";
|
|
296
|
+
})(_ || (_ = {}));
|
|
297
|
+
var H;
|
|
298
|
+
(function(e) {
|
|
299
|
+
e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration";
|
|
300
|
+
})(H || (H = {}));
|
|
301
|
+
function Ve(e) {
|
|
302
|
+
return e + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
|
|
303
|
+
}
|
|
304
|
+
function J(e) {
|
|
305
|
+
let n = d.useContext(ue);
|
|
306
|
+
return n || (process.env.NODE_ENV !== "production" ? N(!1, Ve(e)) : N(!1)), n;
|
|
307
|
+
}
|
|
308
|
+
function Ue(e, n) {
|
|
309
|
+
let {
|
|
310
|
+
target: r,
|
|
311
|
+
replace: i,
|
|
312
|
+
state: t,
|
|
313
|
+
preventScrollReset: a,
|
|
314
|
+
relative: o,
|
|
315
|
+
viewTransition: s
|
|
316
|
+
} = n === void 0 ? {} : n, c = ae(), l = B(), f = D(e, {
|
|
317
|
+
relative: o
|
|
318
|
+
});
|
|
319
|
+
return d.useCallback((p) => {
|
|
320
|
+
if (xe(p, r)) {
|
|
321
|
+
p.preventDefault();
|
|
322
|
+
let v = i !== void 0 ? i : I(l) === I(f);
|
|
323
|
+
c(e, {
|
|
324
|
+
replace: v,
|
|
325
|
+
state: t,
|
|
326
|
+
preventScrollReset: a,
|
|
327
|
+
relative: o,
|
|
328
|
+
viewTransition: s
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}, [l, c, f, i, t, r, e, a, o, s]);
|
|
332
|
+
}
|
|
333
|
+
function Ae() {
|
|
334
|
+
if (typeof document > "u")
|
|
335
|
+
throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
|
|
336
|
+
}
|
|
337
|
+
let je = 0, Ie = () => "__" + String(++je) + "__";
|
|
338
|
+
function We() {
|
|
339
|
+
let {
|
|
340
|
+
router: e
|
|
341
|
+
} = J(_.UseSubmit), {
|
|
342
|
+
basename: n
|
|
343
|
+
} = d.useContext(F), r = le();
|
|
344
|
+
return d.useCallback(function(i, t) {
|
|
345
|
+
t === void 0 && (t = {}), Ae();
|
|
346
|
+
let {
|
|
347
|
+
action: a,
|
|
348
|
+
method: o,
|
|
349
|
+
encType: s,
|
|
350
|
+
formData: c,
|
|
351
|
+
body: l
|
|
352
|
+
} = Ce(i, n);
|
|
353
|
+
if (t.navigate === !1) {
|
|
354
|
+
let f = t.fetcherKey || Ie();
|
|
355
|
+
e.fetch(f, r, t.action || a, {
|
|
356
|
+
preventScrollReset: t.preventScrollReset,
|
|
357
|
+
formData: c,
|
|
358
|
+
body: l,
|
|
359
|
+
formMethod: t.method || o,
|
|
360
|
+
formEncType: t.encType || s,
|
|
361
|
+
flushSync: t.flushSync
|
|
362
|
+
});
|
|
363
|
+
} else
|
|
364
|
+
e.navigate(t.action || a, {
|
|
365
|
+
preventScrollReset: t.preventScrollReset,
|
|
366
|
+
formData: c,
|
|
367
|
+
body: l,
|
|
368
|
+
formMethod: t.method || o,
|
|
369
|
+
formEncType: t.encType || s,
|
|
370
|
+
replace: t.replace,
|
|
371
|
+
state: t.state,
|
|
372
|
+
fromRouteId: r,
|
|
373
|
+
flushSync: t.flushSync,
|
|
374
|
+
viewTransition: t.viewTransition
|
|
375
|
+
});
|
|
376
|
+
}, [e, n, r]);
|
|
377
|
+
}
|
|
378
|
+
function Be(e, n) {
|
|
379
|
+
let {
|
|
380
|
+
relative: r
|
|
381
|
+
} = n === void 0 ? {} : n, {
|
|
382
|
+
basename: i
|
|
383
|
+
} = d.useContext(F), t = d.useContext(se);
|
|
384
|
+
t || (process.env.NODE_ENV !== "production" ? N(!1, "useFormAction must be used inside a RouteContext") : N(!1));
|
|
385
|
+
let [a] = t.matches.slice(-1), o = S({}, D(e || ".", {
|
|
386
|
+
relative: r
|
|
387
|
+
})), s = B();
|
|
388
|
+
if (e == null) {
|
|
389
|
+
o.search = s.search;
|
|
390
|
+
let c = new URLSearchParams(o.search), l = c.getAll("index");
|
|
391
|
+
if (l.some((p) => p === "")) {
|
|
392
|
+
c.delete("index"), l.filter((v) => v).forEach((v) => c.append("index", v));
|
|
393
|
+
let p = c.toString();
|
|
394
|
+
o.search = p ? "?" + p : "";
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return (!e || e === ".") && a.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), i !== "/" && (o.pathname = o.pathname === "/" ? i : ce([i, o.pathname])), I(o);
|
|
398
|
+
}
|
|
399
|
+
function Ke(e, n) {
|
|
400
|
+
n === void 0 && (n = {});
|
|
401
|
+
let r = d.useContext(Y);
|
|
402
|
+
r == null && (process.env.NODE_ENV !== "production" ? N(!1, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : N(!1));
|
|
403
|
+
let {
|
|
404
|
+
basename: i
|
|
405
|
+
} = J(_.useViewTransitionState), t = D(e, {
|
|
406
|
+
relative: n.relative
|
|
407
|
+
});
|
|
408
|
+
if (!r.isTransitioning)
|
|
409
|
+
return !1;
|
|
410
|
+
let a = x(r.currentLocation.pathname, i) || r.currentLocation.pathname, o = x(r.nextLocation.pathname, i) || r.nextLocation.pathname;
|
|
411
|
+
return G(t.pathname, o) != null || G(t.pathname, a) != null;
|
|
412
|
+
}
|
|
413
|
+
const Qe = ({
|
|
414
|
+
className: e,
|
|
415
|
+
size: n,
|
|
416
|
+
steps: r,
|
|
417
|
+
theme: i
|
|
418
|
+
}) => {
|
|
419
|
+
const { theme: t } = me(), { isInsideRouter: a } = fe(), o = i ?? t;
|
|
420
|
+
return /* @__PURE__ */ g("nav", { "aria-label": "breadcrumb", children: /* @__PURE__ */ g(
|
|
421
|
+
"ol",
|
|
422
|
+
{
|
|
423
|
+
className: de({ theme: o, className: e, size: n }),
|
|
424
|
+
children: r.map(({ label: s, to: c, target: l }, f) => /* @__PURE__ */ ee(re, { children: [
|
|
425
|
+
/* @__PURE__ */ g(
|
|
426
|
+
"li",
|
|
427
|
+
{
|
|
428
|
+
className: he({ theme: o, size: n }),
|
|
429
|
+
children: c ? /* @__PURE__ */ g(te, { children: a ? /* @__PURE__ */ g(
|
|
430
|
+
z,
|
|
431
|
+
{
|
|
432
|
+
to: c,
|
|
433
|
+
target: l,
|
|
434
|
+
className: "hover:underline hover:underline-offset-2",
|
|
435
|
+
children: s
|
|
436
|
+
}
|
|
437
|
+
) : /* @__PURE__ */ g(
|
|
438
|
+
"a",
|
|
439
|
+
{
|
|
440
|
+
href: c,
|
|
441
|
+
target: l,
|
|
442
|
+
className: "hover:underline hover:underline-offset-2",
|
|
443
|
+
children: s
|
|
444
|
+
}
|
|
445
|
+
) }) : /* @__PURE__ */ g("span", { "aria-current": "page", children: s })
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
f !== r.length - 1 && /* @__PURE__ */ g("li", { children: /* @__PURE__ */ g(
|
|
449
|
+
K,
|
|
450
|
+
{
|
|
451
|
+
className: pe({ size: n, theme: o })
|
|
452
|
+
}
|
|
453
|
+
) })
|
|
454
|
+
] }, s))
|
|
455
|
+
}
|
|
456
|
+
) });
|
|
457
|
+
};
|
|
458
|
+
export {
|
|
459
|
+
Qe as Breadcrumb
|
|
460
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { breadcrumbVariants } from './Breadcrumb.variants';
|
|
3
|
+
export type Step = {
|
|
4
|
+
label: string;
|
|
5
|
+
to?: string;
|
|
6
|
+
target?: '_self' | '_blank';
|
|
7
|
+
};
|
|
8
|
+
export interface BreadcrumbProps extends VariantProps<typeof breadcrumbVariants> {
|
|
9
|
+
steps: Step[];
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const breadcrumbVariants: (props?: ({
|
|
2
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
3
|
+
size?: "base" | "sm" | "lg" | "xl" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export declare const breadcrumbItemVariants: (props?: ({
|
|
6
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
7
|
+
size?: "base" | "sm" | "lg" | "xl" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export declare const chevronVariants: (props?: ({
|
|
10
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
11
|
+
size?: "base" | "sm" | "lg" | "xl" | null | undefined;
|
|
12
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|