@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,8 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { tooltipVariants } from './Tooltip.variants';
|
|
4
|
+
export interface TooltipProps extends PropsWithChildren, VariantProps<typeof tooltipVariants> {
|
|
5
|
+
content: ReactNode | string;
|
|
6
|
+
className?: string;
|
|
7
|
+
wrapperClassName?: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const tooltipVariants: (props?: ({
|
|
2
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
3
|
+
position?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export declare const arrowVariants: (props?: ({
|
|
6
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
7
|
+
position?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { c as r } from "../../index-BwYCDOHZ.js";
|
|
2
|
+
const e = r(
|
|
3
|
+
[
|
|
4
|
+
"absolute",
|
|
5
|
+
"w-max",
|
|
6
|
+
"p-2.5",
|
|
7
|
+
"rounded-lg",
|
|
8
|
+
"shadow-md",
|
|
9
|
+
"transition-all",
|
|
10
|
+
"ease-linear",
|
|
11
|
+
"opacity-0",
|
|
12
|
+
"duration-250",
|
|
13
|
+
"aria-expanded:opacity-100",
|
|
14
|
+
"delay-100"
|
|
15
|
+
],
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
theme: {
|
|
19
|
+
kubefirst: "bg-kubefirst-purple-light",
|
|
20
|
+
konstruct: "bg-orange-500",
|
|
21
|
+
colony: "bg-red-700"
|
|
22
|
+
},
|
|
23
|
+
position: {
|
|
24
|
+
top: ["-top-[110%]", "left-[50%]", "-translate-x-1/2"],
|
|
25
|
+
bottom: ["-bottom-[110%]", "right-[50%]", "translate-x-1/2"],
|
|
26
|
+
right: ["top-1/2", "ml-1", "left-[100%]", "-translate-y-2/4"],
|
|
27
|
+
left: ["top-1/2", "mr-1", "right-[100%]", "-translate-y-2/4"]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
theme: "kubefirst",
|
|
32
|
+
position: "right"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
), o = r(["absolute", "w-0", "h-0"], {
|
|
36
|
+
variants: {
|
|
37
|
+
theme: {
|
|
38
|
+
kubefirst: "border-kubefirst-purple-light",
|
|
39
|
+
konstruct: "border-orange-500",
|
|
40
|
+
colony: "border-red-700"
|
|
41
|
+
},
|
|
42
|
+
position: {
|
|
43
|
+
top: [
|
|
44
|
+
"top-full",
|
|
45
|
+
"right-1/2",
|
|
46
|
+
"translate-x-2/4",
|
|
47
|
+
"border-l-4",
|
|
48
|
+
"border-l-transparent",
|
|
49
|
+
"border-r-4",
|
|
50
|
+
"border-r-transparent",
|
|
51
|
+
"border-t-4"
|
|
52
|
+
],
|
|
53
|
+
bottom: [
|
|
54
|
+
"bottom-full",
|
|
55
|
+
"right-1/2",
|
|
56
|
+
"translate-x-2/4",
|
|
57
|
+
"border-l-4",
|
|
58
|
+
"border-l-transparent",
|
|
59
|
+
"border-r-4",
|
|
60
|
+
"border-r-transparent",
|
|
61
|
+
"border-b-4"
|
|
62
|
+
],
|
|
63
|
+
right: [
|
|
64
|
+
"right-full",
|
|
65
|
+
"top-1/2",
|
|
66
|
+
"-translate-y-2/4",
|
|
67
|
+
"border-t-4",
|
|
68
|
+
"border-t-transparent",
|
|
69
|
+
"border-b-4",
|
|
70
|
+
"border-b-transparent",
|
|
71
|
+
"border-r-4"
|
|
72
|
+
],
|
|
73
|
+
left: [
|
|
74
|
+
"left-full",
|
|
75
|
+
"top-1/2",
|
|
76
|
+
"-translate-y-2/4",
|
|
77
|
+
"border-t-4",
|
|
78
|
+
"border-t-transparent",
|
|
79
|
+
"border-b-4",
|
|
80
|
+
"border-b-transparent",
|
|
81
|
+
"border-l-4"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
defaultVariants: {
|
|
86
|
+
theme: "kubefirst",
|
|
87
|
+
position: "right"
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
o as arrowVariants,
|
|
92
|
+
e as tooltipVariants
|
|
93
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useRef as l, useState as i, useEffect as u } from "react";
|
|
2
|
+
const c = () => {
|
|
3
|
+
const e = l(null), [o, n] = i(!1);
|
|
4
|
+
return u(() => {
|
|
5
|
+
var s, r;
|
|
6
|
+
const t = new AbortController();
|
|
7
|
+
return (s = e.current) == null || s.addEventListener(
|
|
8
|
+
"mouseenter",
|
|
9
|
+
() => n(!0),
|
|
10
|
+
{ signal: t.signal }
|
|
11
|
+
), (r = e.current) == null || r.addEventListener(
|
|
12
|
+
"mouseleave",
|
|
13
|
+
() => n(!1),
|
|
14
|
+
{ signal: t.signal }
|
|
15
|
+
), () => {
|
|
16
|
+
t.abort();
|
|
17
|
+
};
|
|
18
|
+
}, []), {
|
|
19
|
+
isVisible: o,
|
|
20
|
+
componentRef: e
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
c as useTooltip
|
|
25
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './AlertDialog/AlertDialog';
|
|
2
|
+
export * from './Autocomplete/Autocomplete';
|
|
3
|
+
export * from './Breadcrumb/Breadcrumb';
|
|
4
|
+
export * from './Button/Button';
|
|
5
|
+
export * from './Checkbox/Checkbox';
|
|
6
|
+
export * from './Dropdown/Dropdown';
|
|
7
|
+
export * from './Input/Input';
|
|
8
|
+
export * from './Modal/Modal';
|
|
9
|
+
export * from './NumberInput/NumberInput';
|
|
10
|
+
export * from './ProgressBar/ProgressBar';
|
|
11
|
+
export * from './Radio/Radio';
|
|
12
|
+
export * from './Range/Range';
|
|
13
|
+
export * from './Slider/Slider';
|
|
14
|
+
export * from './Switch/Switch';
|
|
15
|
+
export * from './Tag/Tag';
|
|
16
|
+
export * from './TagSelect/TagSelect';
|
|
17
|
+
export * from './TextArea/TextArea';
|
|
18
|
+
export * from './Toast/Toast';
|
|
19
|
+
export * from './Tooltip/Tooltip';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AlertDialog as e } from "./AlertDialog/AlertDialog.js";
|
|
2
|
+
import { Autocomplete as p } from "./Autocomplete/Autocomplete.js";
|
|
3
|
+
import { Breadcrumb as x } from "./Breadcrumb/Breadcrumb.js";
|
|
4
|
+
import { Button as a } from "./Button/Button.js";
|
|
5
|
+
import { Checkbox as u } from "./Checkbox/Checkbox.js";
|
|
6
|
+
import { Dropdown as d } from "./Dropdown/Dropdown.js";
|
|
7
|
+
import { Input as i } from "./Input/Input.js";
|
|
8
|
+
import { M as T } from "../Modal-CO0_SnXD.js";
|
|
9
|
+
import { NumberInput as b } from "./NumberInput/NumberInput.js";
|
|
10
|
+
import { ProgressBar as B } from "./ProgressBar/ProgressBar.js";
|
|
11
|
+
import { Radio as h } from "./Radio/Radio.js";
|
|
12
|
+
import { Range as D } from "./Range/Range.js";
|
|
13
|
+
import { Slider as M } from "./Slider/Slider.js";
|
|
14
|
+
import { Switch as k } from "./Switch/Switch.js";
|
|
15
|
+
import { Tag as N } from "./Tag/Tag.js";
|
|
16
|
+
import { TagSelect as j } from "./TagSelect/TagSelect.js";
|
|
17
|
+
import { TextArea as v } from "./TextArea/TextArea.js";
|
|
18
|
+
import { Toast as z } from "./Toast/Toast.js";
|
|
19
|
+
import { Tooltip as F } from "./Tooltip/Tooltip.js";
|
|
20
|
+
export {
|
|
21
|
+
e as AlertDialog,
|
|
22
|
+
p as Autocomplete,
|
|
23
|
+
x as Breadcrumb,
|
|
24
|
+
a as Button,
|
|
25
|
+
u as Checkbox,
|
|
26
|
+
d as Dropdown,
|
|
27
|
+
i as Input,
|
|
28
|
+
T as Modal,
|
|
29
|
+
b as NumberInput,
|
|
30
|
+
B as ProgressBar,
|
|
31
|
+
h as Radio,
|
|
32
|
+
D as Range,
|
|
33
|
+
M as Slider,
|
|
34
|
+
k as Switch,
|
|
35
|
+
N as Tag,
|
|
36
|
+
j as TagSelect,
|
|
37
|
+
v as TextArea,
|
|
38
|
+
z as Toast,
|
|
39
|
+
F as Tooltip
|
|
40
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as i } from "react";
|
|
3
|
+
import { a as n } from "../js.cookie-OLEfuq_g.js";
|
|
4
|
+
import { isClient as s } from "../utils/index.js";
|
|
5
|
+
import { ThemeContext as f } from "./theme.context.js";
|
|
6
|
+
const v = ({ children: r, theme: e }) => {
|
|
7
|
+
const [t, o] = i(() => {
|
|
8
|
+
if (e)
|
|
9
|
+
return e;
|
|
10
|
+
if (s)
|
|
11
|
+
return n.get("konstruct-theme");
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ m(f.Provider, { value: { theme: t, setTheme: o }, children: r });
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
v as ThemeProvider
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useToggle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useToggle: (initialState?: boolean) => [boolean, (value?: boolean) => void];
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { b as m, d as h, u as U } from "./index-8vgf-x5i.js";
|
|
3
|
+
import { P as b, d as z } from "./index-BJ7FQg17.js";
|
|
4
|
+
import { u as T } from "./index-CCavb-1K.js";
|
|
5
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
6
|
+
import { R as H } from "./index-2hJuj4UN.js";
|
|
7
|
+
function K(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
8
|
+
const s = m(r);
|
|
9
|
+
i.useEffect(() => {
|
|
10
|
+
const n = (t) => {
|
|
11
|
+
t.key === "Escape" && s(t);
|
|
12
|
+
};
|
|
13
|
+
return e.addEventListener("keydown", n, { capture: !0 }), () => e.removeEventListener("keydown", n, { capture: !0 });
|
|
14
|
+
}, [s, e]);
|
|
15
|
+
}
|
|
16
|
+
var j = "DismissableLayer", p = "dismissableLayer.update", X = "dismissableLayer.pointerDownOutside", Y = "dismissableLayer.focusOutside", g, B = i.createContext({
|
|
17
|
+
layers: /* @__PURE__ */ new Set(),
|
|
18
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
19
|
+
branches: /* @__PURE__ */ new Set()
|
|
20
|
+
}), x = i.forwardRef(
|
|
21
|
+
(r, e) => {
|
|
22
|
+
const {
|
|
23
|
+
disableOutsidePointerEvents: s = !1,
|
|
24
|
+
onEscapeKeyDown: n,
|
|
25
|
+
onPointerDownOutside: t,
|
|
26
|
+
onFocusOutside: o,
|
|
27
|
+
onInteractOutside: l,
|
|
28
|
+
onDismiss: u,
|
|
29
|
+
...v
|
|
30
|
+
} = r, c = i.useContext(B), [d, N] = i.useState(null), f = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = i.useState({}), W = T(e, (a) => N(a)), D = Array.from(c.layers), [k] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), I = D.indexOf(k), L = d ? D.indexOf(d) : -1, _ = c.layersWithOutsidePointerEventsDisabled.size > 0, C = L >= I, M = G((a) => {
|
|
31
|
+
const E = a.target, R = [...c.branches].some((y) => y.contains(E));
|
|
32
|
+
!C || R || (t == null || t(a), l == null || l(a), a.defaultPrevented || u == null || u());
|
|
33
|
+
}, f), O = J((a) => {
|
|
34
|
+
const E = a.target;
|
|
35
|
+
[...c.branches].some((y) => y.contains(E)) || (o == null || o(a), l == null || l(a), a.defaultPrevented || u == null || u());
|
|
36
|
+
}, f);
|
|
37
|
+
return K((a) => {
|
|
38
|
+
L === c.layers.size - 1 && (n == null || n(a), !a.defaultPrevented && u && (a.preventDefault(), u()));
|
|
39
|
+
}, f), i.useEffect(() => {
|
|
40
|
+
if (d)
|
|
41
|
+
return s && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (g = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), w(), () => {
|
|
42
|
+
s && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = g);
|
|
43
|
+
};
|
|
44
|
+
}, [d, f, s, c]), i.useEffect(() => () => {
|
|
45
|
+
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), w());
|
|
46
|
+
}, [d, c]), i.useEffect(() => {
|
|
47
|
+
const a = () => F({});
|
|
48
|
+
return document.addEventListener(p, a), () => document.removeEventListener(p, a);
|
|
49
|
+
}, []), /* @__PURE__ */ P(
|
|
50
|
+
b.div,
|
|
51
|
+
{
|
|
52
|
+
...v,
|
|
53
|
+
ref: W,
|
|
54
|
+
style: {
|
|
55
|
+
pointerEvents: _ ? C ? "auto" : "none" : void 0,
|
|
56
|
+
...r.style
|
|
57
|
+
},
|
|
58
|
+
onFocusCapture: h(r.onFocusCapture, O.onFocusCapture),
|
|
59
|
+
onBlurCapture: h(r.onBlurCapture, O.onBlurCapture),
|
|
60
|
+
onPointerDownCapture: h(
|
|
61
|
+
r.onPointerDownCapture,
|
|
62
|
+
M.onPointerDownCapture
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
x.displayName = j;
|
|
69
|
+
var q = "DismissableLayerBranch", S = i.forwardRef((r, e) => {
|
|
70
|
+
const s = i.useContext(B), n = i.useRef(null), t = T(e, n);
|
|
71
|
+
return i.useEffect(() => {
|
|
72
|
+
const o = n.current;
|
|
73
|
+
if (o)
|
|
74
|
+
return s.branches.add(o), () => {
|
|
75
|
+
s.branches.delete(o);
|
|
76
|
+
};
|
|
77
|
+
}, [s.branches]), /* @__PURE__ */ P(b.div, { ...r, ref: t });
|
|
78
|
+
});
|
|
79
|
+
S.displayName = q;
|
|
80
|
+
function G(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
81
|
+
const s = m(r), n = i.useRef(!1), t = i.useRef(() => {
|
|
82
|
+
});
|
|
83
|
+
return i.useEffect(() => {
|
|
84
|
+
const o = (u) => {
|
|
85
|
+
if (u.target && !n.current) {
|
|
86
|
+
let v = function() {
|
|
87
|
+
A(
|
|
88
|
+
X,
|
|
89
|
+
s,
|
|
90
|
+
c,
|
|
91
|
+
{ discrete: !0 }
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
const c = { originalEvent: u };
|
|
95
|
+
u.pointerType === "touch" ? (e.removeEventListener("click", t.current), t.current = v, e.addEventListener("click", t.current, { once: !0 })) : v();
|
|
96
|
+
} else
|
|
97
|
+
e.removeEventListener("click", t.current);
|
|
98
|
+
n.current = !1;
|
|
99
|
+
}, l = window.setTimeout(() => {
|
|
100
|
+
e.addEventListener("pointerdown", o);
|
|
101
|
+
}, 0);
|
|
102
|
+
return () => {
|
|
103
|
+
window.clearTimeout(l), e.removeEventListener("pointerdown", o), e.removeEventListener("click", t.current);
|
|
104
|
+
};
|
|
105
|
+
}, [e, s]), {
|
|
106
|
+
// ensures we check React component tree (not just DOM tree)
|
|
107
|
+
onPointerDownCapture: () => n.current = !0
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function J(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
111
|
+
const s = m(r), n = i.useRef(!1);
|
|
112
|
+
return i.useEffect(() => {
|
|
113
|
+
const t = (o) => {
|
|
114
|
+
o.target && !n.current && A(Y, s, { originalEvent: o }, {
|
|
115
|
+
discrete: !1
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
|
|
119
|
+
}, [e, s]), {
|
|
120
|
+
onFocusCapture: () => n.current = !0,
|
|
121
|
+
onBlurCapture: () => n.current = !1
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function w() {
|
|
125
|
+
const r = new CustomEvent(p);
|
|
126
|
+
document.dispatchEvent(r);
|
|
127
|
+
}
|
|
128
|
+
function A(r, e, s, { discrete: n }) {
|
|
129
|
+
const t = s.originalEvent.target, o = new CustomEvent(r, { bubbles: !1, cancelable: !0, detail: s });
|
|
130
|
+
e && t.addEventListener(r, e, { once: !0 }), n ? z(t, o) : t.dispatchEvent(o);
|
|
131
|
+
}
|
|
132
|
+
var ne = x, re = S, Q = "Portal", V = i.forwardRef((r, e) => {
|
|
133
|
+
var u;
|
|
134
|
+
const { container: s, ...n } = r, [t, o] = i.useState(!1);
|
|
135
|
+
U(() => o(!0), []);
|
|
136
|
+
const l = s || t && ((u = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : u.body);
|
|
137
|
+
return l ? H.createPortal(/* @__PURE__ */ P(b.div, { ...n, ref: e }), l) : null;
|
|
138
|
+
});
|
|
139
|
+
V.displayName = Q;
|
|
140
|
+
export {
|
|
141
|
+
re as B,
|
|
142
|
+
x as D,
|
|
143
|
+
V as P,
|
|
144
|
+
ne as R
|
|
145
|
+
};
|