@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,54 @@
|
|
|
1
|
+
import l, { forwardRef as c } from "react";
|
|
2
|
+
import { P as a } from "./index-DQMInta3.js";
|
|
3
|
+
function p() {
|
|
4
|
+
return p = Object.assign || function(e) {
|
|
5
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
6
|
+
var t = arguments[o];
|
|
7
|
+
for (var r in t)
|
|
8
|
+
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
9
|
+
}
|
|
10
|
+
return e;
|
|
11
|
+
}, p.apply(this, arguments);
|
|
12
|
+
}
|
|
13
|
+
function u(e, o) {
|
|
14
|
+
if (e == null) return {};
|
|
15
|
+
var t = v(e, o), r, n;
|
|
16
|
+
if (Object.getOwnPropertySymbols) {
|
|
17
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
18
|
+
for (n = 0; n < i.length; n++)
|
|
19
|
+
r = i[n], !(o.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
function v(e, o) {
|
|
24
|
+
if (e == null) return {};
|
|
25
|
+
var t = {}, r = Object.keys(e), n, i;
|
|
26
|
+
for (i = 0; i < r.length; i++)
|
|
27
|
+
n = r[i], !(o.indexOf(n) >= 0) && (t[n] = e[n]);
|
|
28
|
+
return t;
|
|
29
|
+
}
|
|
30
|
+
var s = c(function(e, o) {
|
|
31
|
+
var t = e.color, r = t === void 0 ? "currentColor" : t, n = e.size, i = n === void 0 ? 24 : n, f = u(e, ["color", "size"]);
|
|
32
|
+
return /* @__PURE__ */ l.createElement("svg", p({
|
|
33
|
+
ref: o,
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
width: i,
|
|
36
|
+
height: i,
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
fill: "none",
|
|
39
|
+
stroke: r,
|
|
40
|
+
strokeWidth: "2",
|
|
41
|
+
strokeLinecap: "round",
|
|
42
|
+
strokeLinejoin: "round"
|
|
43
|
+
}, f), /* @__PURE__ */ l.createElement("polyline", {
|
|
44
|
+
points: "18 15 12 9 6 15"
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
s.propTypes = {
|
|
48
|
+
color: a.string,
|
|
49
|
+
size: a.oneOfType([a.string, a.number])
|
|
50
|
+
};
|
|
51
|
+
s.displayName = "ChevronUp";
|
|
52
|
+
export {
|
|
53
|
+
s as C
|
|
54
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { R as h, A as f, P as x, O as g, C as u, T as C, D as b, a as y, b as O } from "../../AlertDialogTrigger-BIbxXexQ.js";
|
|
3
|
+
import "../../contexts/theme.context.js";
|
|
4
|
+
import { useTheme as A } from "../../contexts/theme.hook.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "../../js.cookie-OLEfuq_g.js";
|
|
7
|
+
import { Button as a } from "../Button/Button.js";
|
|
8
|
+
import { useAlertDialog as D } from "./hooks/useAlertDialog.js";
|
|
9
|
+
const B = ({
|
|
10
|
+
buttonText: l,
|
|
11
|
+
theme: n,
|
|
12
|
+
title: o,
|
|
13
|
+
description: i,
|
|
14
|
+
onConfirm: s
|
|
15
|
+
}) => {
|
|
16
|
+
const { theme: r } = A(), { isOpen: c, handleCancel: d, handleConfirm: m, handleOpen: p } = D({
|
|
17
|
+
onConfirm: s
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ t(h, { open: c, children: [
|
|
20
|
+
/* @__PURE__ */ e(f, { text: l, theme: n, onOpen: p }),
|
|
21
|
+
/* @__PURE__ */ t(x, { children: [
|
|
22
|
+
/* @__PURE__ */ e(g, { className: "bg-black opacity-75 inset-0 fixed" }),
|
|
23
|
+
/* @__PURE__ */ t(u, { className: "bg-white rounded-md fixed top-1/2 left-1/2 -translate-y-2/4 -translate-x-2/4 flex flex-col gap-8 p-6", children: [
|
|
24
|
+
/* @__PURE__ */ e(C, { className: "font-bold text-center text-2xl", children: o }),
|
|
25
|
+
/* @__PURE__ */ e(b, { children: i }),
|
|
26
|
+
/* @__PURE__ */ t("div", { className: "flex flex-row gap-5 justify-end", children: [
|
|
27
|
+
/* @__PURE__ */ e(y, { asChild: !0, children: /* @__PURE__ */ e(
|
|
28
|
+
a,
|
|
29
|
+
{
|
|
30
|
+
type: "button",
|
|
31
|
+
theme: n ?? r,
|
|
32
|
+
variant: "secondary",
|
|
33
|
+
onClick: d,
|
|
34
|
+
children: "Cancel"
|
|
35
|
+
}
|
|
36
|
+
) }),
|
|
37
|
+
/* @__PURE__ */ e(O, { asChild: !0, children: /* @__PURE__ */ e(
|
|
38
|
+
a,
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
theme: n ?? r,
|
|
42
|
+
variant: "danger",
|
|
43
|
+
onClick: m,
|
|
44
|
+
children: "OK"
|
|
45
|
+
}
|
|
46
|
+
) })
|
|
47
|
+
] })
|
|
48
|
+
] })
|
|
49
|
+
] })
|
|
50
|
+
] });
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
B as AlertDialog
|
|
54
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { buttonAlertDialogVariants } from './AlertDialog.variants';
|
|
4
|
+
export interface AlertDialogProps extends PropsWithChildren, VariantProps<typeof buttonAlertDialogVariants> {
|
|
5
|
+
className?: string;
|
|
6
|
+
buttonText?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
onConfirm?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export type UseAlertiDialogProps = {
|
|
12
|
+
onConfirm: AlertDialogProps['onConfirm'];
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { c as t } from "../../index-BwYCDOHZ.js";
|
|
2
|
+
const r = t([], {
|
|
3
|
+
variants: {
|
|
4
|
+
theme: {
|
|
5
|
+
colony: "",
|
|
6
|
+
kubefirst: "",
|
|
7
|
+
konstruct: ""
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
defaultVariants: {
|
|
11
|
+
theme: "kubefirst"
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
r as buttonAlertDialogVariants
|
|
16
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import { A as a } from "../../../AlertDialogTrigger-BIbxXexQ.js";
|
|
3
|
+
import "../../../contexts/theme.context.js";
|
|
4
|
+
import "../../../contexts/theme.hook.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "../../../js.cookie-OLEfuq_g.js";
|
|
7
|
+
import "../../Button/Button.js";
|
|
8
|
+
export {
|
|
9
|
+
a as AlertDialogTrigger
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AlertDialogTrigger';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useAlertDialog';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useState as u, useCallback as t } from "react";
|
|
2
|
+
const d = ({ onConfirm: e }) => {
|
|
3
|
+
const [a, s] = u(!1), l = t(() => s(!0), []), c = t(() => s(!1), []), p = t(() => {
|
|
4
|
+
e == null || e(), s(!1);
|
|
5
|
+
}, [e]);
|
|
6
|
+
return { isOpen: a, handleCancel: c, handleConfirm: p, handleOpen: l };
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
d as useAlertDialog
|
|
10
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsxs as C, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as R, useRef as i, useId as A, useImperativeHandle as T } from "react";
|
|
3
|
+
import "../../contexts/theme.context.js";
|
|
4
|
+
import { useTheme as V } from "../../contexts/theme.hook.js";
|
|
5
|
+
import "../../js.cookie-OLEfuq_g.js";
|
|
6
|
+
import { useAutocomplete as g } from "./hooks/useAutocomplete.js";
|
|
7
|
+
import { List as j } from "./components/List.js";
|
|
8
|
+
import { labelVariants as y, autocompleteVariants as I } from "./Autocomplete.variants.js";
|
|
9
|
+
const O = R(
|
|
10
|
+
({
|
|
11
|
+
autoComplete: p = "off",
|
|
12
|
+
className: a,
|
|
13
|
+
label: n,
|
|
14
|
+
labelClassName: u,
|
|
15
|
+
name: l,
|
|
16
|
+
options: d,
|
|
17
|
+
placeHolderEmptyValues: h = "No values...",
|
|
18
|
+
placeHolderEmptyValuesClassName: f,
|
|
19
|
+
placeholder: x,
|
|
20
|
+
theme: N,
|
|
21
|
+
variant: r,
|
|
22
|
+
onChange: w
|
|
23
|
+
}, b) => {
|
|
24
|
+
const s = i(null), e = i(null), c = A(), { theme: v } = V(), m = N ?? v;
|
|
25
|
+
T(b, () => e.current, [e]);
|
|
26
|
+
const o = g({
|
|
27
|
+
options: d,
|
|
28
|
+
inputRef: e,
|
|
29
|
+
wrapperRef: s,
|
|
30
|
+
onChange: w
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ C("div", { ref: s, className: "relative flex flex-col", children: [
|
|
33
|
+
n ? /* @__PURE__ */ t(
|
|
34
|
+
"label",
|
|
35
|
+
{
|
|
36
|
+
htmlFor: l ?? c,
|
|
37
|
+
className: y({
|
|
38
|
+
theme: m,
|
|
39
|
+
variant: r,
|
|
40
|
+
className: u
|
|
41
|
+
}),
|
|
42
|
+
children: n
|
|
43
|
+
}
|
|
44
|
+
) : null,
|
|
45
|
+
/* @__PURE__ */ t(
|
|
46
|
+
"input",
|
|
47
|
+
{
|
|
48
|
+
ref: e,
|
|
49
|
+
id: l ?? c,
|
|
50
|
+
type: "text",
|
|
51
|
+
name: l,
|
|
52
|
+
role: "combobox",
|
|
53
|
+
autoComplete: p,
|
|
54
|
+
className: I({
|
|
55
|
+
theme: m,
|
|
56
|
+
variant: r,
|
|
57
|
+
className: a
|
|
58
|
+
}),
|
|
59
|
+
onChange: o.handleChange,
|
|
60
|
+
value: o.value,
|
|
61
|
+
placeholder: x
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
o.showOptions && /* @__PURE__ */ t("div", { className: "absolute z-10 top-full w-full rounded-md mt-1 border shadow-sm", children: /* @__PURE__ */ t(
|
|
65
|
+
j,
|
|
66
|
+
{
|
|
67
|
+
className: a,
|
|
68
|
+
inputRef: e,
|
|
69
|
+
wrapperRef: s,
|
|
70
|
+
options: o.newOptions,
|
|
71
|
+
placeholder: h,
|
|
72
|
+
placeholderClassName: f,
|
|
73
|
+
variant: r,
|
|
74
|
+
theme: m,
|
|
75
|
+
onClick: o.handleSelectValue
|
|
76
|
+
}
|
|
77
|
+
) })
|
|
78
|
+
] });
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
O.displayName = "Autocomplete";
|
|
82
|
+
export {
|
|
83
|
+
O as Autocomplete
|
|
84
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { autocompleteVariants } from './Autocomplete.variants';
|
|
4
|
+
export type Option = {
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
export interface AutocompleteProps extends VariantProps<typeof autocompleteVariants> {
|
|
8
|
+
autoComplete?: 'off';
|
|
9
|
+
className?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
labelClassName?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
options: Option[];
|
|
14
|
+
placeHolderEmptyValues?: string | ReactNode;
|
|
15
|
+
placeHolderEmptyValuesClassName?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
onChange(value: string): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const autocompleteVariants: (props?: ({
|
|
2
|
+
variant?: "default" | null | undefined;
|
|
3
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export declare const labelVariants: (props?: ({
|
|
6
|
+
variant?: "default" | null | undefined;
|
|
7
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { c as t } from "../../index-BwYCDOHZ.js";
|
|
2
|
+
const r = t(
|
|
3
|
+
[
|
|
4
|
+
"flex",
|
|
5
|
+
"w-full",
|
|
6
|
+
"rounded-md",
|
|
7
|
+
"border",
|
|
8
|
+
"border-zinc-200",
|
|
9
|
+
"bg-transparent",
|
|
10
|
+
"text-base",
|
|
11
|
+
"text-zinc-700",
|
|
12
|
+
"transition-colors",
|
|
13
|
+
"placeholder:text-muted-foreground",
|
|
14
|
+
"focus-visible:outline-none",
|
|
15
|
+
"focus-visible:ring-1",
|
|
16
|
+
"focus-visible:ring-ring",
|
|
17
|
+
"disabled:cursor-not-allowed",
|
|
18
|
+
"disabled:opacity-50",
|
|
19
|
+
"shadow-sm",
|
|
20
|
+
"py-1",
|
|
21
|
+
"px-2"
|
|
22
|
+
],
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
variant: {
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
theme: {
|
|
29
|
+
kubefirst: ["focus:ring-kubefirst-purple-light"],
|
|
30
|
+
konstruct: ["focus:focus:ring-orange-400"],
|
|
31
|
+
colony: ["focus:focus:ring-red-400"]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
theme: "kubefirst",
|
|
36
|
+
variant: "default"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
), a = t(
|
|
40
|
+
["pl-1", "mb-2", "text-base", "cursor-pointer"],
|
|
41
|
+
{
|
|
42
|
+
variants: {
|
|
43
|
+
variant: {
|
|
44
|
+
default: ""
|
|
45
|
+
},
|
|
46
|
+
theme: {
|
|
47
|
+
kubefirst: "",
|
|
48
|
+
konstruct: "",
|
|
49
|
+
colony: ""
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
variant: "default",
|
|
54
|
+
theme: "kubefirst"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
export {
|
|
59
|
+
r as autocompleteVariants,
|
|
60
|
+
a as labelVariants
|
|
61
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as f } from "react";
|
|
3
|
+
import { useNavigationUlList as p } from "../hooks/useNavigationList.js";
|
|
4
|
+
import { emptyListVariants as b, listVariants as N, listItemVariants as d, buttonVariants as x } from "./List.variants.js";
|
|
5
|
+
const y = ({
|
|
6
|
+
className: n,
|
|
7
|
+
inputRef: e,
|
|
8
|
+
options: l,
|
|
9
|
+
placeholder: a,
|
|
10
|
+
placeholderClassName: m,
|
|
11
|
+
variant: t,
|
|
12
|
+
theme: s,
|
|
13
|
+
wrapperRef: c,
|
|
14
|
+
onClick: u
|
|
15
|
+
}) => {
|
|
16
|
+
const o = f(null);
|
|
17
|
+
return p({ ulRef: o, inputRef: e, wrapperRef: c, options: l }), l.length === 0 ? /* @__PURE__ */ r(
|
|
18
|
+
"span",
|
|
19
|
+
{
|
|
20
|
+
className: b({
|
|
21
|
+
theme: s,
|
|
22
|
+
variant: t,
|
|
23
|
+
className: m
|
|
24
|
+
}),
|
|
25
|
+
children: a
|
|
26
|
+
}
|
|
27
|
+
) : /* @__PURE__ */ r(
|
|
28
|
+
"ul",
|
|
29
|
+
{
|
|
30
|
+
ref: o,
|
|
31
|
+
role: "listbox",
|
|
32
|
+
className: N({ variant: t, theme: s, className: n }),
|
|
33
|
+
children: l.map(({ value: i }) => /* @__PURE__ */ r(
|
|
34
|
+
"li",
|
|
35
|
+
{
|
|
36
|
+
role: "option",
|
|
37
|
+
tabIndex: 0,
|
|
38
|
+
className: d({ theme: s, variant: t }),
|
|
39
|
+
children: /* @__PURE__ */ r(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
type: "button",
|
|
43
|
+
role: "button",
|
|
44
|
+
className: x({ theme: s, variant: t }),
|
|
45
|
+
onClick: () => u(i),
|
|
46
|
+
children: i
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
},
|
|
50
|
+
i
|
|
51
|
+
))
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
y as List
|
|
57
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { Option } from '../Autocomplete.types';
|
|
4
|
+
import { autocompleteVariants } from '../Autocomplete.variants';
|
|
5
|
+
export interface Props extends VariantProps<typeof autocompleteVariants> {
|
|
6
|
+
className?: string;
|
|
7
|
+
inputRef: RefObject<HTMLInputElement>;
|
|
8
|
+
wrapperRef: RefObject<HTMLDivElement>;
|
|
9
|
+
options: Option[];
|
|
10
|
+
placeholder: string | ReactNode;
|
|
11
|
+
placeholderClassName?: string;
|
|
12
|
+
onClick(value: string): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const listVariants: (props?: ({
|
|
2
|
+
variant?: "default" | null | undefined;
|
|
3
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export declare const emptyListVariants: (props?: ({
|
|
6
|
+
variant?: "default" | null | undefined;
|
|
7
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export declare const listItemVariants: (props?: ({
|
|
10
|
+
variant?: "default" | null | undefined;
|
|
11
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
12
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
13
|
+
export declare const buttonVariants: (props?: ({
|
|
14
|
+
variant?: "default" | null | undefined;
|
|
15
|
+
theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
|
|
16
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { c as t } from "../../../index-BwYCDOHZ.js";
|
|
2
|
+
const a = t(["max-h-[250px]", "overflow-y-auto"], {
|
|
3
|
+
variants: {
|
|
4
|
+
variant: {
|
|
5
|
+
default: "bg-white"
|
|
6
|
+
},
|
|
7
|
+
theme: {
|
|
8
|
+
kubefirst: "",
|
|
9
|
+
konstruct: "",
|
|
10
|
+
colony: ""
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default",
|
|
15
|
+
theme: "kubefirst"
|
|
16
|
+
}
|
|
17
|
+
}), r = t(
|
|
18
|
+
["p-1", "text-center", "w-full block", "bg-white"],
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
variant: {
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
theme: {
|
|
25
|
+
kubefirst: "",
|
|
26
|
+
konstruct: "",
|
|
27
|
+
colony: ""
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: "default",
|
|
32
|
+
theme: "kubefirst"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
), o = t(["focus-visible:outline-none"], {
|
|
36
|
+
variants: {
|
|
37
|
+
variant: {
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
40
|
+
theme: {
|
|
41
|
+
kubefirst: ["focus:bg-purple-100", "hover:bg-purple-100"],
|
|
42
|
+
konstruct: ["focus:bg-orange-100", "hover:bg-orange-100"],
|
|
43
|
+
colony: ["focus:bg-red-100", "hover:bg-red-100"]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
defaultVariants: {
|
|
47
|
+
variant: "default",
|
|
48
|
+
theme: "kubefirst"
|
|
49
|
+
}
|
|
50
|
+
}), n = t(
|
|
51
|
+
[
|
|
52
|
+
"cursor-pointer",
|
|
53
|
+
"focus-visible:outline-none",
|
|
54
|
+
"px-3",
|
|
55
|
+
"py-1.5",
|
|
56
|
+
"w-full",
|
|
57
|
+
"text-left"
|
|
58
|
+
],
|
|
59
|
+
{
|
|
60
|
+
variants: {
|
|
61
|
+
variant: {
|
|
62
|
+
default: ""
|
|
63
|
+
},
|
|
64
|
+
theme: {
|
|
65
|
+
kubefirst: ["focus:bg-purple-100", "hover:bg-purple-100"],
|
|
66
|
+
konstruct: ["focus:bg-orange-100", "hover:bg-orange-100"],
|
|
67
|
+
colony: ["focus:bg-red-100", "hover:bg-red-100"]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: {
|
|
71
|
+
variant: "default",
|
|
72
|
+
theme: "kubefirst"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
export {
|
|
77
|
+
n as buttonVariants,
|
|
78
|
+
r as emptyListVariants,
|
|
79
|
+
o as listItemVariants,
|
|
80
|
+
a as listVariants
|
|
81
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChangeEvent, RefObject } from 'react';
|
|
2
|
+
import { Option } from '../Autocomplete.types';
|
|
3
|
+
type UseAutocompleteProps = {
|
|
4
|
+
options: Option[];
|
|
5
|
+
inputRef: RefObject<HTMLInputElement>;
|
|
6
|
+
wrapperRef: RefObject<HTMLDivElement>;
|
|
7
|
+
onChange(value: string): void;
|
|
8
|
+
};
|
|
9
|
+
export declare const useAutocomplete: ({ options, inputRef, wrapperRef, onChange, }: UseAutocompleteProps) => {
|
|
10
|
+
inputRef: RefObject<HTMLInputElement>;
|
|
11
|
+
newOptions: Option[];
|
|
12
|
+
showOptions: boolean;
|
|
13
|
+
value: string;
|
|
14
|
+
handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
handleSelectValue: (value: string) => void;
|
|
16
|
+
};
|
|
17
|
+
export {};
|