@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,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { InputHTMLAttributes } from 'react';
|
|
3
|
+
import { inputVariants } from './Input.variants';
|
|
4
|
+
export interface InputProps extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
5
|
+
label?: string;
|
|
6
|
+
labelClassName?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
onClickIcon?: () => void;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { c as r } from "../../index-BwYCDOHZ.js";
|
|
2
|
+
const t = r(
|
|
3
|
+
[
|
|
4
|
+
"bg-transparent",
|
|
5
|
+
"border",
|
|
6
|
+
"border-zinc-200",
|
|
7
|
+
"disabled:cursor-not-allowed",
|
|
8
|
+
"disabled:opacity-50",
|
|
9
|
+
"flex",
|
|
10
|
+
"focus-visible:outline-none",
|
|
11
|
+
"focus-visible:ring-1",
|
|
12
|
+
"h-9",
|
|
13
|
+
"placeholder:text-muted-foreground",
|
|
14
|
+
"px-3",
|
|
15
|
+
"py-1",
|
|
16
|
+
"rounded-md",
|
|
17
|
+
"shadow-sm",
|
|
18
|
+
"text-base",
|
|
19
|
+
"text-zinc-700",
|
|
20
|
+
"transition-colors",
|
|
21
|
+
"w-full"
|
|
22
|
+
],
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
variant: {
|
|
26
|
+
default: "",
|
|
27
|
+
error: ["border-red-600", "pr-8", "focus-visible:ring-transparent"]
|
|
28
|
+
},
|
|
29
|
+
theme: {
|
|
30
|
+
kubefirst: "focus:ring-kubefirst-purple-light",
|
|
31
|
+
colony: "",
|
|
32
|
+
konstruct: ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
theme: "kubefirst"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
export {
|
|
42
|
+
t as inputVariants
|
|
43
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../index-2hJuj4UN.js";
|
|
3
|
+
import "./components/Body/Body.js";
|
|
4
|
+
import "./components/Footer/Footer.js";
|
|
5
|
+
import "./components/Header/Header.js";
|
|
6
|
+
import { M as d } from "../../Modal-CO0_SnXD.js";
|
|
7
|
+
import "./hooks/useModal.js";
|
|
8
|
+
export {
|
|
9
|
+
d as Modal
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { modalVariants } from './components/Wrapper/Wrapper.variants';
|
|
4
|
+
export interface ModalProps extends PropsWithChildren, VariantProps<typeof modalVariants> {
|
|
5
|
+
className?: string;
|
|
6
|
+
buttonCloseClassName?: string;
|
|
7
|
+
}
|
|
8
|
+
export type ModalChildProps = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { S as n } from "../../../../index-CCavb-1K.js";
|
|
3
|
+
import { cn as e } from "../../../../utils/index.js";
|
|
4
|
+
const i = ({ children: o, asChild: t, className: m }) => /* @__PURE__ */ r(t ? n : "div", { className: e("flex-1", m), children: o });
|
|
5
|
+
export {
|
|
6
|
+
i as Body
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { W as x } from "../../../../Modal-CO0_SnXD.js";
|
|
4
|
+
import "../../../../Combination-Cmu9JRkv.js";
|
|
5
|
+
import "../../../../index-4qm4jAkj.js";
|
|
6
|
+
import "../../../../contexts/theme.context.js";
|
|
7
|
+
import "../../../../contexts/theme.hook.js";
|
|
8
|
+
import "../../../../js.cookie-OLEfuq_g.js";
|
|
9
|
+
import "../../hooks/useModal.js";
|
|
10
|
+
import "./Wrapper.variants.js";
|
|
11
|
+
export {
|
|
12
|
+
x as Wrapper
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { modalVariants } from './Wrapper.variants';
|
|
4
|
+
export interface WrapperProps extends PropsWithChildren, VariantProps<typeof modalVariants> {
|
|
5
|
+
className?: string;
|
|
6
|
+
buttonCloseClassName?: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const modalVariants: (props?: ({
|
|
2
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
3
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
|
+
export declare const buttonCloseVariants: (props?: ({
|
|
5
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { c as t } from "../../../../index-BwYCDOHZ.js";
|
|
2
|
+
const o = t(
|
|
3
|
+
[
|
|
4
|
+
"bg-metal-1000",
|
|
5
|
+
"bg-white",
|
|
6
|
+
"border-none",
|
|
7
|
+
"flex",
|
|
8
|
+
"flex-col",
|
|
9
|
+
"justify-between",
|
|
10
|
+
"min-h-[450px]",
|
|
11
|
+
"min-w-[500px]",
|
|
12
|
+
"overflow-auto",
|
|
13
|
+
"relative",
|
|
14
|
+
"rounded-md",
|
|
15
|
+
"shadow-xs",
|
|
16
|
+
"lg:overflow-hidden"
|
|
17
|
+
],
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
theme: {
|
|
21
|
+
colony: ["shadow-red-400"],
|
|
22
|
+
konstruct: ["shadow-orange-400"],
|
|
23
|
+
kubefirst: ["shadow-kubefirst-purple-light"]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
theme: "kubefirst"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
), r = t(
|
|
31
|
+
["absolute", "right-1.5", "top-1.5", "text-inherit"],
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
theme: {
|
|
35
|
+
kubefirst: ["text-kubefirst-purple-light"],
|
|
36
|
+
konstruct: ["text-orange-400"],
|
|
37
|
+
colony: ["text-red-400"]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
theme: "kubefirst"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
export {
|
|
46
|
+
r as buttonCloseVariants,
|
|
47
|
+
o as modalVariants
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Body as e } from "./Body/Body.js";
|
|
2
|
+
import { Footer as t } from "./Footer/Footer.js";
|
|
3
|
+
import { Header as m } from "./Header/Header.js";
|
|
4
|
+
import { W as a } from "../../../Modal-CO0_SnXD.js";
|
|
5
|
+
export {
|
|
6
|
+
e as Body,
|
|
7
|
+
t as Footer,
|
|
8
|
+
m as Header,
|
|
9
|
+
a as Wrapper
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createContext as e } from "react";
|
|
2
|
+
const n = {
|
|
3
|
+
content: void 0,
|
|
4
|
+
isOpen: !1,
|
|
5
|
+
shouldShowClose: !0,
|
|
6
|
+
onOpen: () => {
|
|
7
|
+
throw new Error("onOpen not implemented");
|
|
8
|
+
},
|
|
9
|
+
onClose: () => {
|
|
10
|
+
throw new Error("onClose not implemented");
|
|
11
|
+
},
|
|
12
|
+
setContentAndOpen: () => {
|
|
13
|
+
throw new Error(
|
|
14
|
+
"ModalContext: setContentAndOpen function must be overridden"
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
}, t = e(n);
|
|
18
|
+
export {
|
|
19
|
+
t as ModalContext
|
|
20
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as t, useCallback as n } from "react";
|
|
3
|
+
import { useToggle as f } from "../../../hooks/useToggle.js";
|
|
4
|
+
import { ModalContext as h } from "./Modal.context.js";
|
|
5
|
+
const x = ({ children: s }) => {
|
|
6
|
+
const [r, l] = t(!0), [a, o] = f(!1), [u, c] = t(), e = n(() => o(!0), [o]), d = n(() => o(!1), [o]), p = (m, C = !0) => {
|
|
7
|
+
c(m), e(), l(C);
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ i(
|
|
10
|
+
h.Provider,
|
|
11
|
+
{
|
|
12
|
+
value: {
|
|
13
|
+
content: u,
|
|
14
|
+
isOpen: a,
|
|
15
|
+
shouldShowClose: r,
|
|
16
|
+
onClose: d,
|
|
17
|
+
onOpen: e,
|
|
18
|
+
setContentAndOpen: p
|
|
19
|
+
},
|
|
20
|
+
children: s
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
x as ModalProvider
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type State = {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
content: string | ReactNode;
|
|
5
|
+
shouldShowClose: boolean;
|
|
6
|
+
onOpen: () => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
setContentAndOpen: (content: string | ReactNode, showCloseButton?: boolean) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Modal.provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useModal';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const useModal: () => {
|
|
2
|
+
closeBtnRef: import('react').RefObject<HTMLButtonElement>;
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
content: string | import('react').ReactNode;
|
|
5
|
+
shouldShowClose: boolean;
|
|
6
|
+
onOpen: () => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
setContentAndOpen: (content: string | import('react').ReactNode, showCloseButton?: boolean) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useContext as l, useRef as u, useEffect as s } from "react";
|
|
2
|
+
import { ModalContext as a } from "../contexts/Modal.context.js";
|
|
3
|
+
const f = () => {
|
|
4
|
+
const t = l(a), n = u(null);
|
|
5
|
+
if (!t)
|
|
6
|
+
throw new Error("useModal must be used within a ModalProvider");
|
|
7
|
+
const { onClose: r } = t;
|
|
8
|
+
return s(() => {
|
|
9
|
+
var e;
|
|
10
|
+
const o = document.activeElement;
|
|
11
|
+
return (e = n.current) == null || e.focus(), () => {
|
|
12
|
+
o == null || o.focus();
|
|
13
|
+
};
|
|
14
|
+
}, []), s(() => {
|
|
15
|
+
const o = new AbortController(), e = (c) => {
|
|
16
|
+
c.code === "Escape" && r();
|
|
17
|
+
};
|
|
18
|
+
return window.addEventListener("keydown", e, {
|
|
19
|
+
signal: o.signal
|
|
20
|
+
}), () => {
|
|
21
|
+
o.abort();
|
|
22
|
+
};
|
|
23
|
+
}, [r]), { ...t, closeBtnRef: n };
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
f as useModal
|
|
27
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsxs as g, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import p, { forwardRef as b, useId as I, useState as _, useCallback as w } from "react";
|
|
3
|
+
import "../../contexts/theme.context.js";
|
|
4
|
+
import { useTheme as E } from "../../contexts/theme.hook.js";
|
|
5
|
+
import "../../js.cookie-OLEfuq_g.js";
|
|
6
|
+
import { labelVariants as T, buttonVariants as j, numberInputVariants as $ } from "./NumberInput.variants.js";
|
|
7
|
+
import { P as a } from "../../index-DQMInta3.js";
|
|
8
|
+
function y() {
|
|
9
|
+
return y = Object.assign || function(t) {
|
|
10
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
11
|
+
var n = arguments[i];
|
|
12
|
+
for (var e in n)
|
|
13
|
+
Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]);
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
}, y.apply(this, arguments);
|
|
17
|
+
}
|
|
18
|
+
function L(t, i) {
|
|
19
|
+
if (t == null) return {};
|
|
20
|
+
var n = W(t, i), e, r;
|
|
21
|
+
if (Object.getOwnPropertySymbols) {
|
|
22
|
+
var o = Object.getOwnPropertySymbols(t);
|
|
23
|
+
for (r = 0; r < o.length; r++)
|
|
24
|
+
e = o[r], !(i.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(t, e) && (n[e] = t[e]);
|
|
25
|
+
}
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
function W(t, i) {
|
|
29
|
+
if (t == null) return {};
|
|
30
|
+
var n = {}, e = Object.keys(t), r, o;
|
|
31
|
+
for (o = 0; o < e.length; o++)
|
|
32
|
+
r = e[o], !(i.indexOf(r) >= 0) && (n[r] = t[r]);
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
var h = b(function(t, i) {
|
|
36
|
+
var n = t.color, e = n === void 0 ? "currentColor" : n, r = t.size, o = r === void 0 ? 24 : r, f = L(t, ["color", "size"]);
|
|
37
|
+
return /* @__PURE__ */ p.createElement("svg", y({
|
|
38
|
+
ref: i,
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
+
width: o,
|
|
41
|
+
height: o,
|
|
42
|
+
viewBox: "0 0 24 24",
|
|
43
|
+
fill: "none",
|
|
44
|
+
stroke: e,
|
|
45
|
+
strokeWidth: "2",
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round"
|
|
48
|
+
}, f), /* @__PURE__ */ p.createElement("line", {
|
|
49
|
+
x1: "5",
|
|
50
|
+
y1: "12",
|
|
51
|
+
x2: "19",
|
|
52
|
+
y2: "12"
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
55
|
+
h.propTypes = {
|
|
56
|
+
color: a.string,
|
|
57
|
+
size: a.oneOfType([a.string, a.number])
|
|
58
|
+
};
|
|
59
|
+
h.displayName = "Minus";
|
|
60
|
+
function v() {
|
|
61
|
+
return v = Object.assign || function(t) {
|
|
62
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
63
|
+
var n = arguments[i];
|
|
64
|
+
for (var e in n)
|
|
65
|
+
Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]);
|
|
66
|
+
}
|
|
67
|
+
return t;
|
|
68
|
+
}, v.apply(this, arguments);
|
|
69
|
+
}
|
|
70
|
+
function V(t, i) {
|
|
71
|
+
if (t == null) return {};
|
|
72
|
+
var n = M(t, i), e, r;
|
|
73
|
+
if (Object.getOwnPropertySymbols) {
|
|
74
|
+
var o = Object.getOwnPropertySymbols(t);
|
|
75
|
+
for (r = 0; r < o.length; r++)
|
|
76
|
+
e = o[r], !(i.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(t, e) && (n[e] = t[e]);
|
|
77
|
+
}
|
|
78
|
+
return n;
|
|
79
|
+
}
|
|
80
|
+
function M(t, i) {
|
|
81
|
+
if (t == null) return {};
|
|
82
|
+
var n = {}, e = Object.keys(t), r, o;
|
|
83
|
+
for (o = 0; o < e.length; o++)
|
|
84
|
+
r = e[o], !(i.indexOf(r) >= 0) && (n[r] = t[r]);
|
|
85
|
+
return n;
|
|
86
|
+
}
|
|
87
|
+
var d = b(function(t, i) {
|
|
88
|
+
var n = t.color, e = n === void 0 ? "currentColor" : n, r = t.size, o = r === void 0 ? 24 : r, f = V(t, ["color", "size"]);
|
|
89
|
+
return /* @__PURE__ */ p.createElement("svg", v({
|
|
90
|
+
ref: i,
|
|
91
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
92
|
+
width: o,
|
|
93
|
+
height: o,
|
|
94
|
+
viewBox: "0 0 24 24",
|
|
95
|
+
fill: "none",
|
|
96
|
+
stroke: e,
|
|
97
|
+
strokeWidth: "2",
|
|
98
|
+
strokeLinecap: "round",
|
|
99
|
+
strokeLinejoin: "round"
|
|
100
|
+
}, f), /* @__PURE__ */ p.createElement("line", {
|
|
101
|
+
x1: "12",
|
|
102
|
+
y1: "5",
|
|
103
|
+
x2: "12",
|
|
104
|
+
y2: "19"
|
|
105
|
+
}), /* @__PURE__ */ p.createElement("line", {
|
|
106
|
+
x1: "5",
|
|
107
|
+
y1: "12",
|
|
108
|
+
x2: "19",
|
|
109
|
+
y2: "12"
|
|
110
|
+
}));
|
|
111
|
+
});
|
|
112
|
+
d.propTypes = {
|
|
113
|
+
color: a.string,
|
|
114
|
+
size: a.oneOfType([a.string, a.number])
|
|
115
|
+
};
|
|
116
|
+
d.displayName = "Plus";
|
|
117
|
+
const G = b(
|
|
118
|
+
({
|
|
119
|
+
className: t,
|
|
120
|
+
init: i,
|
|
121
|
+
label: n,
|
|
122
|
+
max: e = -1 / 0,
|
|
123
|
+
min: r = 1 / 0,
|
|
124
|
+
name: o,
|
|
125
|
+
theme: f,
|
|
126
|
+
onChange: s
|
|
127
|
+
}, x) => {
|
|
128
|
+
const { theme: P } = E(), m = f ?? P, k = I(), [u, O] = _(() => i || 0), N = w(() => {
|
|
129
|
+
let l = 0;
|
|
130
|
+
r === 1 / 0 ? l = u - 1 : l = Math.max(r, u - 1), O(l), s == null || s(l);
|
|
131
|
+
}, [u, r, s]), z = w(() => {
|
|
132
|
+
let l = 0;
|
|
133
|
+
e === -1 / 0 ? l = u + 1 : l = Math.min(e, u + 1), O(l), s == null || s(l);
|
|
134
|
+
}, [u, e, s]);
|
|
135
|
+
return /* @__PURE__ */ g("div", { className: "flex flex-col gap-1", children: [
|
|
136
|
+
n ? /* @__PURE__ */ c(
|
|
137
|
+
"label",
|
|
138
|
+
{
|
|
139
|
+
htmlFor: o ?? k,
|
|
140
|
+
className: T({
|
|
141
|
+
theme: m
|
|
142
|
+
}),
|
|
143
|
+
children: n
|
|
144
|
+
}
|
|
145
|
+
) : null,
|
|
146
|
+
/* @__PURE__ */ g("div", { className: "flex items-center", children: [
|
|
147
|
+
/* @__PURE__ */ c(
|
|
148
|
+
"button",
|
|
149
|
+
{
|
|
150
|
+
type: "button",
|
|
151
|
+
onClick: N,
|
|
152
|
+
className: j({ theme: m, button: "rigth" }),
|
|
153
|
+
children: /* @__PURE__ */ c(h, { className: "w-4 h-4" })
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ c(
|
|
157
|
+
"input",
|
|
158
|
+
{
|
|
159
|
+
ref: x,
|
|
160
|
+
type: "number",
|
|
161
|
+
value: u,
|
|
162
|
+
className: $({ className: t, theme: m }),
|
|
163
|
+
readOnly: !0
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ c(
|
|
167
|
+
"button",
|
|
168
|
+
{
|
|
169
|
+
type: "button",
|
|
170
|
+
onClick: z,
|
|
171
|
+
className: j({ theme: m, button: "left" }),
|
|
172
|
+
children: /* @__PURE__ */ c(d, { className: "w-4 h-4" })
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] })
|
|
176
|
+
] });
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
export {
|
|
180
|
+
G as NumberInput
|
|
181
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { numberInputVariants } from './NumberInput.variants';
|
|
3
|
+
export interface NumberInputProps extends VariantProps<typeof numberInputVariants> {
|
|
4
|
+
className?: string;
|
|
5
|
+
init?: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
max?: number;
|
|
8
|
+
min?: number;
|
|
9
|
+
name?: string;
|
|
10
|
+
onChange?: (value: number) => void;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const numberInputVariants: (props?: ({
|
|
2
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
3
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
|
+
export declare const buttonVariants: (props?: ({
|
|
5
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
6
|
+
button?: "left" | "rigth" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export declare const labelVariants: (props?: ({
|
|
9
|
+
variant?: "default" | null | undefined;
|
|
10
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|