@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,61 @@
|
|
|
1
|
+
import { c as t } from "../../index-BwYCDOHZ.js";
|
|
2
|
+
const s = t(["flex", "gap-1.5", "items-center"], {
|
|
3
|
+
variants: {
|
|
4
|
+
theme: {
|
|
5
|
+
kubefirst: "",
|
|
6
|
+
konstruct: "",
|
|
7
|
+
colony: ""
|
|
8
|
+
},
|
|
9
|
+
size: {
|
|
10
|
+
sm: "",
|
|
11
|
+
base: "",
|
|
12
|
+
lg: "",
|
|
13
|
+
xl: ""
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
theme: "kubefirst",
|
|
18
|
+
size: "base"
|
|
19
|
+
}
|
|
20
|
+
}), a = t(["text-slate-400", "font-semibold"], {
|
|
21
|
+
variants: {
|
|
22
|
+
theme: {
|
|
23
|
+
kubefirst: "",
|
|
24
|
+
konstruct: "",
|
|
25
|
+
colony: ""
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
sm: "text-sm",
|
|
29
|
+
base: "text-base",
|
|
30
|
+
lg: "text-lg",
|
|
31
|
+
xl: "text-xl"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
theme: "kubefirst",
|
|
36
|
+
size: "base"
|
|
37
|
+
}
|
|
38
|
+
}), r = t("", {
|
|
39
|
+
variants: {
|
|
40
|
+
theme: {
|
|
41
|
+
kubefirst: "text-kubefirst-purple-light",
|
|
42
|
+
konstruct: "text-orange-500",
|
|
43
|
+
colony: "text-red-500"
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
sm: ["w-2", "h-2"],
|
|
47
|
+
base: ["w-3", "h-3"],
|
|
48
|
+
lg: ["w-4", "h-4"],
|
|
49
|
+
xl: ["w-5", "h-5"]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
theme: "kubefirst",
|
|
54
|
+
size: "base"
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
a as breadcrumbItemVariants,
|
|
59
|
+
s as breadcrumbVariants,
|
|
60
|
+
r as chevronVariants
|
|
61
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h } from "react";
|
|
3
|
+
import { S as c } from "../../index-CCavb-1K.js";
|
|
4
|
+
import { cn as u } from "../../utils/index.js";
|
|
5
|
+
import "../../contexts/theme.context.js";
|
|
6
|
+
import { useTheme as l } from "../../contexts/theme.hook.js";
|
|
7
|
+
import "../../js.cookie-OLEfuq_g.js";
|
|
8
|
+
import { buttonVariants as x } from "./Button.variants.js";
|
|
9
|
+
const T = h(
|
|
10
|
+
({
|
|
11
|
+
className: o,
|
|
12
|
+
variant: m,
|
|
13
|
+
theme: e,
|
|
14
|
+
size: r,
|
|
15
|
+
disabled: t = !1,
|
|
16
|
+
asChild: n = !1,
|
|
17
|
+
...i
|
|
18
|
+
}, s) => {
|
|
19
|
+
const p = n ? c : "button", { theme: f } = l();
|
|
20
|
+
return /* @__PURE__ */ a(
|
|
21
|
+
p,
|
|
22
|
+
{
|
|
23
|
+
ref: s,
|
|
24
|
+
className: u(
|
|
25
|
+
x({
|
|
26
|
+
variant: m,
|
|
27
|
+
disabled: t,
|
|
28
|
+
theme: e ?? f,
|
|
29
|
+
size: r,
|
|
30
|
+
className: o
|
|
31
|
+
})
|
|
32
|
+
),
|
|
33
|
+
disabled: t,
|
|
34
|
+
...i
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
T.displayName = "Button";
|
|
40
|
+
export {
|
|
41
|
+
T as Button
|
|
42
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
3
|
+
import { buttonVariants } from './Button.variants';
|
|
4
|
+
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'>, VariantProps<typeof buttonVariants> {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const buttonVariants: (props?: ({
|
|
2
|
+
variant?: "primary" | "secondary" | "danger" | "text" | null | undefined;
|
|
3
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
4
|
+
size?: "default" | null | undefined;
|
|
5
|
+
disabled?: boolean | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { c as e } from "../../index-BwYCDOHZ.js";
|
|
2
|
+
const t = e(
|
|
3
|
+
[
|
|
4
|
+
"border-2",
|
|
5
|
+
"disabled:pointer-events-none",
|
|
6
|
+
"focus-visible:outline-none",
|
|
7
|
+
"focus-visible:ring-1",
|
|
8
|
+
"focus-visible:ring-ring",
|
|
9
|
+
"gap-1",
|
|
10
|
+
"inline-flex",
|
|
11
|
+
"items-center",
|
|
12
|
+
"justify-center",
|
|
13
|
+
"rounded-md",
|
|
14
|
+
"text-base",
|
|
15
|
+
"transition-colors",
|
|
16
|
+
"whitespace-nowrap",
|
|
17
|
+
"cursor-pointer",
|
|
18
|
+
"font-semibold"
|
|
19
|
+
],
|
|
20
|
+
{
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
primary: ["text-white", "border-current"],
|
|
24
|
+
secondary: ["bg-white"],
|
|
25
|
+
danger: [
|
|
26
|
+
"border-current",
|
|
27
|
+
"bg-red-600",
|
|
28
|
+
"text-white",
|
|
29
|
+
"hover:bg-red-700"
|
|
30
|
+
],
|
|
31
|
+
text: ["bg-transparent", "border-transparent", "text-slate-500"]
|
|
32
|
+
},
|
|
33
|
+
theme: {
|
|
34
|
+
colony: "",
|
|
35
|
+
konstruct: "",
|
|
36
|
+
kubefirst: ""
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
default: "px-5 py-2"
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
true: ["text-zinc-500", "border-zinc-200", "bg-zinc-200"],
|
|
43
|
+
false: ""
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
compoundVariants: [
|
|
47
|
+
{
|
|
48
|
+
variant: "primary",
|
|
49
|
+
theme: "kubefirst",
|
|
50
|
+
disabled: !1,
|
|
51
|
+
class: ["bg-kubefirst-purple-light", "hover:bg-kubefirst-purple-dark"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
variant: "primary",
|
|
55
|
+
theme: "colony",
|
|
56
|
+
disabled: !1,
|
|
57
|
+
class: ["bg-red-700", "hover:bg-red-900"]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
variant: "primary",
|
|
61
|
+
theme: "konstruct",
|
|
62
|
+
disabled: !1,
|
|
63
|
+
class: ["bg-orange-500", "hover:bg-orange-700"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
variant: "secondary",
|
|
67
|
+
disabled: !1,
|
|
68
|
+
class: [
|
|
69
|
+
"text-kubefirst-purple-light",
|
|
70
|
+
"border-kubefirst-purple-light",
|
|
71
|
+
"hover:text-kubefirst-purple-dark",
|
|
72
|
+
"hover:border-kubefirst-purple-dark",
|
|
73
|
+
"hover:bg-purple-50"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
variant: "secondary",
|
|
78
|
+
disabled: !0,
|
|
79
|
+
class: ["border-zinc-500"]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
variant: "text",
|
|
83
|
+
disabled: !1,
|
|
84
|
+
class: ["hover:text-kubefirst-purple-dark", "hover:bg-purple-50"]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
variant: "text",
|
|
88
|
+
disabled: !0,
|
|
89
|
+
class: ["bg-transparent", "border-transparent", "text-zinc-400"]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
variant: "primary",
|
|
94
|
+
theme: "kubefirst",
|
|
95
|
+
size: "default",
|
|
96
|
+
disabled: !1
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
export {
|
|
101
|
+
t as buttonVariants
|
|
102
|
+
};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { jsxs as N, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import j, { forwardRef as S, useId as M, useCallback as A } from "react";
|
|
4
|
+
import { u as H } from "../../index-CCavb-1K.js";
|
|
5
|
+
import { c as K, a as W, d as I } from "../../index-8vgf-x5i.js";
|
|
6
|
+
import { u as $, a as q } from "../../index-BxeV34ij.js";
|
|
7
|
+
import { P as F } from "../../index-B_GWswUP.js";
|
|
8
|
+
import { P as _ } from "../../index-BJ7FQg17.js";
|
|
9
|
+
import { useToggle as V } from "../../hooks/useToggle.js";
|
|
10
|
+
import { checkboxVariants as X, labelVariants as G } from "./Checkbox.variants.js";
|
|
11
|
+
import "../../contexts/theme.context.js";
|
|
12
|
+
import { useTheme as J } from "../../contexts/theme.hook.js";
|
|
13
|
+
import "../../js.cookie-OLEfuq_g.js";
|
|
14
|
+
import { P as y } from "../../index-DQMInta3.js";
|
|
15
|
+
function w() {
|
|
16
|
+
return w = Object.assign || function(e) {
|
|
17
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
18
|
+
var t = arguments[s];
|
|
19
|
+
for (var o in t)
|
|
20
|
+
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
21
|
+
}
|
|
22
|
+
return e;
|
|
23
|
+
}, w.apply(this, arguments);
|
|
24
|
+
}
|
|
25
|
+
function Q(e, s) {
|
|
26
|
+
if (e == null) return {};
|
|
27
|
+
var t = U(e, s), o, n;
|
|
28
|
+
if (Object.getOwnPropertySymbols) {
|
|
29
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
30
|
+
for (n = 0; n < r.length; n++)
|
|
31
|
+
o = r[n], !(s.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (t[o] = e[o]);
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
function U(e, s) {
|
|
36
|
+
if (e == null) return {};
|
|
37
|
+
var t = {}, o = Object.keys(e), n, r;
|
|
38
|
+
for (r = 0; r < o.length; r++)
|
|
39
|
+
n = o[r], !(s.indexOf(n) >= 0) && (t[n] = e[n]);
|
|
40
|
+
return t;
|
|
41
|
+
}
|
|
42
|
+
var E = S(function(e, s) {
|
|
43
|
+
var t = e.color, o = t === void 0 ? "currentColor" : t, n = e.size, r = n === void 0 ? 24 : n, i = Q(e, ["color", "size"]);
|
|
44
|
+
return /* @__PURE__ */ j.createElement("svg", w({
|
|
45
|
+
ref: s,
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
width: r,
|
|
48
|
+
height: r,
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
fill: "none",
|
|
51
|
+
stroke: o,
|
|
52
|
+
strokeWidth: "2",
|
|
53
|
+
strokeLinecap: "round",
|
|
54
|
+
strokeLinejoin: "round"
|
|
55
|
+
}, i), /* @__PURE__ */ j.createElement("polyline", {
|
|
56
|
+
points: "20 6 9 17 4 12"
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
E.propTypes = {
|
|
60
|
+
color: y.string,
|
|
61
|
+
size: y.oneOfType([y.string, y.number])
|
|
62
|
+
};
|
|
63
|
+
E.displayName = "Check";
|
|
64
|
+
var O = "Checkbox", [Y, be] = K(O), [Z, ee] = Y(O), T = f.forwardRef(
|
|
65
|
+
(e, s) => {
|
|
66
|
+
const {
|
|
67
|
+
__scopeCheckbox: t,
|
|
68
|
+
name: o,
|
|
69
|
+
checked: n,
|
|
70
|
+
defaultChecked: r,
|
|
71
|
+
required: i,
|
|
72
|
+
disabled: l,
|
|
73
|
+
value: d = "on",
|
|
74
|
+
onCheckedChange: v,
|
|
75
|
+
form: u,
|
|
76
|
+
...h
|
|
77
|
+
} = e, [c, k] = f.useState(null), C = H(s, (a) => k(a)), g = f.useRef(!1), R = c ? u || !!c.closest("form") : !0, [b = !1, P] = W({
|
|
78
|
+
prop: n,
|
|
79
|
+
defaultProp: r,
|
|
80
|
+
onChange: v
|
|
81
|
+
}), B = f.useRef(b);
|
|
82
|
+
return f.useEffect(() => {
|
|
83
|
+
const a = c == null ? void 0 : c.form;
|
|
84
|
+
if (a) {
|
|
85
|
+
const x = () => P(B.current);
|
|
86
|
+
return a.addEventListener("reset", x), () => a.removeEventListener("reset", x);
|
|
87
|
+
}
|
|
88
|
+
}, [c, P]), /* @__PURE__ */ N(Z, { scope: t, state: b, disabled: l, children: [
|
|
89
|
+
/* @__PURE__ */ p(
|
|
90
|
+
_.button,
|
|
91
|
+
{
|
|
92
|
+
type: "button",
|
|
93
|
+
role: "checkbox",
|
|
94
|
+
"aria-checked": m(b) ? "mixed" : b,
|
|
95
|
+
"aria-required": i,
|
|
96
|
+
"data-state": D(b),
|
|
97
|
+
"data-disabled": l ? "" : void 0,
|
|
98
|
+
disabled: l,
|
|
99
|
+
value: d,
|
|
100
|
+
...h,
|
|
101
|
+
ref: C,
|
|
102
|
+
onKeyDown: I(e.onKeyDown, (a) => {
|
|
103
|
+
a.key === "Enter" && a.preventDefault();
|
|
104
|
+
}),
|
|
105
|
+
onClick: I(e.onClick, (a) => {
|
|
106
|
+
P((x) => m(x) ? !0 : !x), R && (g.current = a.isPropagationStopped(), g.current || a.stopPropagation());
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
R && /* @__PURE__ */ p(
|
|
111
|
+
te,
|
|
112
|
+
{
|
|
113
|
+
control: c,
|
|
114
|
+
bubbles: !g.current,
|
|
115
|
+
name: o,
|
|
116
|
+
value: d,
|
|
117
|
+
checked: b,
|
|
118
|
+
required: i,
|
|
119
|
+
disabled: l,
|
|
120
|
+
form: u,
|
|
121
|
+
style: { transform: "translateX(-100%)" },
|
|
122
|
+
defaultChecked: m(r) ? !1 : r
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
T.displayName = O;
|
|
129
|
+
var z = "CheckboxIndicator", L = f.forwardRef(
|
|
130
|
+
(e, s) => {
|
|
131
|
+
const { __scopeCheckbox: t, forceMount: o, ...n } = e, r = ee(z, t);
|
|
132
|
+
return /* @__PURE__ */ p(F, { present: o || m(r.state) || r.state === !0, children: /* @__PURE__ */ p(
|
|
133
|
+
_.span,
|
|
134
|
+
{
|
|
135
|
+
"data-state": D(r.state),
|
|
136
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
137
|
+
...n,
|
|
138
|
+
ref: s,
|
|
139
|
+
style: { pointerEvents: "none", ...e.style }
|
|
140
|
+
}
|
|
141
|
+
) });
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
L.displayName = z;
|
|
145
|
+
var te = (e) => {
|
|
146
|
+
const { control: s, checked: t, bubbles: o = !0, defaultChecked: n, ...r } = e, i = f.useRef(null), l = $(t), d = q(s);
|
|
147
|
+
f.useEffect(() => {
|
|
148
|
+
const u = i.current, h = window.HTMLInputElement.prototype, k = Object.getOwnPropertyDescriptor(h, "checked").set;
|
|
149
|
+
if (l !== t && k) {
|
|
150
|
+
const C = new Event("click", { bubbles: o });
|
|
151
|
+
u.indeterminate = m(t), k.call(u, m(t) ? !1 : t), u.dispatchEvent(C);
|
|
152
|
+
}
|
|
153
|
+
}, [l, t, o]);
|
|
154
|
+
const v = f.useRef(m(t) ? !1 : t);
|
|
155
|
+
return /* @__PURE__ */ p(
|
|
156
|
+
"input",
|
|
157
|
+
{
|
|
158
|
+
type: "checkbox",
|
|
159
|
+
"aria-hidden": !0,
|
|
160
|
+
defaultChecked: n ?? v.current,
|
|
161
|
+
...r,
|
|
162
|
+
tabIndex: -1,
|
|
163
|
+
ref: i,
|
|
164
|
+
style: {
|
|
165
|
+
...e.style,
|
|
166
|
+
...d,
|
|
167
|
+
position: "absolute",
|
|
168
|
+
pointerEvents: "none",
|
|
169
|
+
opacity: 0,
|
|
170
|
+
margin: 0
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
function m(e) {
|
|
176
|
+
return e === "indeterminate";
|
|
177
|
+
}
|
|
178
|
+
function D(e) {
|
|
179
|
+
return m(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
180
|
+
}
|
|
181
|
+
var re = T, oe = L;
|
|
182
|
+
const ve = S(
|
|
183
|
+
({
|
|
184
|
+
className: e,
|
|
185
|
+
defaultChecked: s,
|
|
186
|
+
disabled: t,
|
|
187
|
+
label: o,
|
|
188
|
+
labelClassName: n,
|
|
189
|
+
name: r,
|
|
190
|
+
theme: i,
|
|
191
|
+
variant: l,
|
|
192
|
+
onChange: d
|
|
193
|
+
}, v) => {
|
|
194
|
+
const [u, h] = V(s), c = M(), { theme: k } = J(), C = A(() => {
|
|
195
|
+
h(), d == null || d();
|
|
196
|
+
}, [d, h]);
|
|
197
|
+
return /* @__PURE__ */ N("div", { className: "flex items-center gap-2", children: [
|
|
198
|
+
/* @__PURE__ */ p(
|
|
199
|
+
re,
|
|
200
|
+
{
|
|
201
|
+
id: r ?? c,
|
|
202
|
+
checked: u,
|
|
203
|
+
ref: v,
|
|
204
|
+
name: r,
|
|
205
|
+
disabled: t,
|
|
206
|
+
className: X({
|
|
207
|
+
className: e,
|
|
208
|
+
theme: i ?? k,
|
|
209
|
+
variant: l,
|
|
210
|
+
checked: u
|
|
211
|
+
}),
|
|
212
|
+
onCheckedChange: C,
|
|
213
|
+
children: /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ p(E, { className: "w-4 h-4 stroke-2" }) })
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
o ? /* @__PURE__ */ p(
|
|
217
|
+
"label",
|
|
218
|
+
{
|
|
219
|
+
htmlFor: r ?? c,
|
|
220
|
+
className: G({
|
|
221
|
+
variant: l,
|
|
222
|
+
theme: i,
|
|
223
|
+
className: n
|
|
224
|
+
}),
|
|
225
|
+
children: o
|
|
226
|
+
}
|
|
227
|
+
) : null
|
|
228
|
+
] });
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
export {
|
|
232
|
+
ve as Checkbox
|
|
233
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { checkboxVariants } from './Checkbox.variants';
|
|
4
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'checked'>, VariantProps<typeof checkboxVariants> {
|
|
5
|
+
className?: string;
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
label?: string;
|
|
9
|
+
labelClassName?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
onChange?: () => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const checkboxVariants: (props?: ({
|
|
2
|
+
variant?: "default" | null | undefined;
|
|
3
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
4
|
+
checked?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export declare const labelVariants: (props?: ({
|
|
7
|
+
variant?: "default" | null | undefined;
|
|
8
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { c as e } from "../../index-BwYCDOHZ.js";
|
|
2
|
+
const r = e(
|
|
3
|
+
[
|
|
4
|
+
"cursor-pointer",
|
|
5
|
+
"border",
|
|
6
|
+
"rounded",
|
|
7
|
+
"w-5",
|
|
8
|
+
"h-5",
|
|
9
|
+
"flex",
|
|
10
|
+
"justify-center",
|
|
11
|
+
"items-center",
|
|
12
|
+
"text-white"
|
|
13
|
+
],
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
theme: {
|
|
20
|
+
colony: "",
|
|
21
|
+
konstruct: "",
|
|
22
|
+
kubefirst: ""
|
|
23
|
+
},
|
|
24
|
+
checked: {
|
|
25
|
+
true: "",
|
|
26
|
+
false: ""
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
compoundVariants: [
|
|
30
|
+
{
|
|
31
|
+
theme: "kubefirst",
|
|
32
|
+
class: ["border-kubefirst-purple-light"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
theme: "kubefirst",
|
|
36
|
+
checked: !0,
|
|
37
|
+
class: ["bg-kubefirst-purple-light"]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
theme: "konstruct",
|
|
41
|
+
class: ["border-orange-600"]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
theme: "konstruct",
|
|
45
|
+
checked: !0,
|
|
46
|
+
class: ["bg-orange-600"]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
theme: "colony",
|
|
50
|
+
class: ["border-red-700"]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
theme: "colony",
|
|
54
|
+
checked: !0,
|
|
55
|
+
class: ["bg-red-700"]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
defaultVariants: {
|
|
59
|
+
variant: "default",
|
|
60
|
+
theme: "kubefirst"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
), a = e(["cursor-pointer"], {
|
|
64
|
+
variants: {
|
|
65
|
+
variant: {
|
|
66
|
+
default: ""
|
|
67
|
+
},
|
|
68
|
+
theme: {
|
|
69
|
+
colony: "",
|
|
70
|
+
konstruct: "",
|
|
71
|
+
kubefirst: ""
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
variant: "default",
|
|
76
|
+
theme: "kubefirst"
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
r as checkboxVariants,
|
|
81
|
+
a as labelVariants
|
|
82
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import "./components/List/List.js";
|
|
4
|
+
import { Wrapper as i } from "./components/Wrapper.js";
|
|
5
|
+
import "./contexts/dropdown.context.js";
|
|
6
|
+
import { DropdownProvider as t } from "./contexts/dropdown.provider.js";
|
|
7
|
+
const c = m(({ ...o }, p) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(i, { ref: p, ...o }) }));
|
|
8
|
+
export {
|
|
9
|
+
c as Dropdown
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { dropdownVariants } from './Dropdown.variants';
|
|
4
|
+
export type Option = {
|
|
5
|
+
label: string | ReactNode;
|
|
6
|
+
leftIcon?: ReactNode | string;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
export interface DropdownProps extends VariantProps<typeof dropdownVariants> {
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
options: Option[];
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { c as e } from "../../index-BwYCDOHZ.js";
|
|
2
|
+
const a = e(
|
|
3
|
+
[
|
|
4
|
+
"border",
|
|
5
|
+
"cursor-pointer",
|
|
6
|
+
"ease-in-out",
|
|
7
|
+
"flex",
|
|
8
|
+
"items-center",
|
|
9
|
+
"justify-between",
|
|
10
|
+
"px-3",
|
|
11
|
+
"py-1",
|
|
12
|
+
"relative",
|
|
13
|
+
"rounded-md",
|
|
14
|
+
"transition-all",
|
|
15
|
+
"w-full",
|
|
16
|
+
"outline-none"
|
|
17
|
+
],
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
theme: {
|
|
21
|
+
konstruct: [
|
|
22
|
+
"aria-expanded:border-orange-400",
|
|
23
|
+
"aria-expanded:text-orange-400",
|
|
24
|
+
"focus-visible:bg-orange-100"
|
|
25
|
+
],
|
|
26
|
+
kubefirst: [
|
|
27
|
+
"aria-expanded:border-kubefirst-purple-light",
|
|
28
|
+
"aria-expanded:text-kubefirst-purple-dark",
|
|
29
|
+
"focus-visible:bg-purple-100"
|
|
30
|
+
],
|
|
31
|
+
colony: [
|
|
32
|
+
"aria-expanded:border-red-400",
|
|
33
|
+
"aria-expanded:text-red-400",
|
|
34
|
+
"focus-visible:bg-red-100"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
theme: "kubefirst"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
export {
|
|
44
|
+
a as dropdownVariants
|
|
45
|
+
};
|