@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.51
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/dist/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
- package/dist/DatePicker.css +1 -1
- package/dist/Modal-CjC-CIJ8.js +99 -0
- package/dist/assets/icons/index.js +7 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/chevron-up-DEfvgPCw.js +54 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +81 -53
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +41 -44
- package/dist/components/Badge/Badge.variants.js +52 -13
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -22
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +108 -98
- package/dist/components/Card/Card.variants.js +7 -12
- package/dist/components/Checkbox/Checkbox.js +108 -105
- package/dist/components/Checkbox/Checkbox.variants.js +34 -7
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Counter/Counter.js +210 -0
- package/dist/components/Counter/Counter.variants.js +70 -0
- package/dist/components/Datepicker/DatePicker.js +1587 -1353
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/Filter.variants.js +8 -7
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +71 -45
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
- package/dist/components/Filter/components/ResetButton/ResetButton.js +15 -12
- package/dist/components/Filter/events/index.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.js +221 -0
- package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
- package/dist/components/Input/Input.js +185 -118
- package/dist/components/Input/Input.variants.js +24 -19
- package/dist/components/Loading/Loading.js +1 -7
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +30 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +25 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +119 -0
- package/dist/components/MultiSelectDropdown/components/index.js +8 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
- package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +36 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +690 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +60 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +651 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +463 -482
- package/dist/components/Radio/Radio.js +47 -44
- package/dist/components/Radio/Radio.variants.js +12 -8
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +10 -10
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +17 -11
- package/dist/components/Select/components/List/List.js +172 -0
- package/dist/components/{Dropdown → Select}/components/List/List.variants.js +11 -8
- package/dist/components/Select/components/ListItem/ListItem.js +117 -0
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +5 -4
- package/dist/components/Select/components/Wrapper.js +226 -0
- package/dist/components/Select/constants/index.js +4 -0
- package/dist/components/Select/constants/pagination.js +4 -0
- package/dist/components/Select/contexts/index.js +6 -0
- package/dist/components/Select/contexts/select.context.js +36 -0
- package/dist/components/Select/contexts/select.hook.js +11 -0
- package/dist/components/Select/contexts/select.provider.js +58 -0
- package/dist/components/Select/hooks/useNavigationList.js +50 -0
- package/dist/components/Select/hooks/useSelect.js +103 -0
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +156 -129
- package/dist/components/Switch/Switch.variants.js +19 -10
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +4 -3
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/TimePicker/TimePicker.js +1 -1
- package/dist/components/TimePicker/TimePicker.variants.js +26 -14
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +57 -35
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
- package/dist/components/Toast/Toast.js +283 -256
- package/dist/components/Toast/Toast.variants.js +37 -24
- package/dist/components/Tooltip/Tooltip.js +15 -14
- package/dist/components/Tooltip/Tooltip.variants.js +5 -4
- package/dist/components/Typography/Typography.js +23 -25
- package/dist/components/Typography/Typography.variants.js +55 -52
- package/dist/components/VirtualizedTable/VirtualizedTable.js +97 -71
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +95 -33
- package/dist/components/VirtualizedTable/components/Body/Body.js +73 -21
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +94 -91
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +61 -44
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +33 -21
- package/dist/components/VirtualizedTable/components/Header/Header.js +61 -41
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +43 -22
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +106 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1858
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +8 -6
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +68 -761
- package/dist/components/index.js +94 -86
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-D2CN7Ma9.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-C1g_chDT.js → index-AV6ZtGhy.js} +2 -2
- package/dist/index-BG8O18ZY.js +93 -0
- package/dist/index-BKjcReYh.js +55 -0
- package/dist/{index-N2OStZoU.js → index-BOE_3f_Z.js} +4 -25
- package/dist/{index-Cd2vhaop.js → index-BlSRBdPy.js} +5 -6
- package/dist/index-BmVmDQGH.js +662 -0
- package/dist/index-BvoZGpli.js +60 -0
- package/dist/index-Byr10W8m.js +1873 -0
- package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
- package/dist/index-CeZcoQDw.js +479 -0
- package/dist/index-D6KzX_ef.js +135 -0
- package/dist/{index-B7t8D14s.js → index-D9SSJ6om.js} +4 -4
- package/dist/index-DKfEnhKr.js +200 -0
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/{index-ti1b9kqV.js → index-DMb4KD0b.js} +4 -4
- package/dist/{index-BAEWsOG1.js → index-DtEcCIrM.js} +1 -1
- package/dist/{index-bwWKd82e.js → index-Dy59FQl5.js} +1 -1
- package/dist/{index-C84F4YyO.js → index-gSPwC-1I.js} +10 -11
- package/dist/{index-Bnb0ezr3.js → index-vcSp8YRZ.js} +11 -12
- package/dist/index.d.ts +2142 -99
- package/dist/index.js +116 -106
- package/dist/libphonenumber-FTwQ9nyV.js +11549 -0
- package/dist/loader-juvMSJ9L.js +5 -0
- package/dist/package.json +43 -33
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +194 -168
- package/dist/ui/theme.css +27 -0
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/x-BXShoIAM.js +8 -0
- package/dist/{x-4F_5p77m.js → x-Eoa9FJjA.js} +1 -1
- package/package.json +43 -33
- package/dist/Modal-D-NOEWMX.js +0 -98
- package/dist/chevron-down-MZvQoT2F.js +0 -11
- package/dist/chevron-right-VYBOBhRt.js +0 -19
- package/dist/components/Dropdown/Dropdown.js +0 -42
- package/dist/components/Dropdown/components/List/List.js +0 -79
- package/dist/components/Dropdown/components/ListItem/ListItem.js +0 -67
- package/dist/components/Dropdown/components/Wrapper.js +0 -205
- package/dist/components/Dropdown/contexts/dropdown.context.js +0 -19
- package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
- package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -30
- package/dist/components/Dropdown/contexts/index.js +0 -6
- package/dist/components/Dropdown/hooks/useDropdown.js +0 -58
- package/dist/components/Dropdown/hooks/useNavigationList.js +0 -62
- package/dist/components/NumberInput/NumberInput.js +0 -179
- package/dist/components/NumberInput/NumberInput.variants.js +0 -50
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
- package/dist/index-BITvcJAz.js +0 -423
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DBbEcSUG.js +0 -31
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-DzIBBMjs.js +0 -436
- package/dist/index-os7vysFS.js +0 -131
- /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
- /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useId as ee, useRef as j, useState as g, useEffect as te } from "react";
|
|
3
|
+
import { S as ae } from "../../loader-juvMSJ9L.js";
|
|
4
|
+
import { Button as F } from "../Button/Button.js";
|
|
5
|
+
import { cn as m } from "../../utils/index.js";
|
|
6
|
+
import { labelVariants as re, inputFieldVariants as le, inputContainerVariants as ie, helperTextVariants as se, imageUploadVariants as ne } from "./ImageUpload.variants.js";
|
|
7
|
+
import { c as ce } from "../../createLucideIcon-D4r5Phnh.js";
|
|
8
|
+
import { Warning as oe } from "../../assets/icons/components/Warning.js";
|
|
9
|
+
import { X as D } from "../../x-BXShoIAM.js";
|
|
10
|
+
const de = [
|
|
11
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
12
|
+
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
13
|
+
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
14
|
+
], me = ce("image", de);
|
|
15
|
+
var t = /* @__PURE__ */ ((s) => (s.Default = "default", s.Uploading = "uploading", s.Complete = "complete", s.Error = "error", s))(t || {});
|
|
16
|
+
const pe = ({
|
|
17
|
+
className: s,
|
|
18
|
+
error: b,
|
|
19
|
+
fileName: T,
|
|
20
|
+
fileSize: E,
|
|
21
|
+
fileUrl: z,
|
|
22
|
+
helperText: R = "Logo should be 32 x 32 pixels with transparent background (larger images will be downscaled proportionally to fit). Accepted file type is SVG, PNG, JPEG. Max file size is 5MB.",
|
|
23
|
+
isRequired: L = !1,
|
|
24
|
+
label: p = "Item logo",
|
|
25
|
+
labelClassName: P,
|
|
26
|
+
name: A,
|
|
27
|
+
onChange: k,
|
|
28
|
+
onRemove: H,
|
|
29
|
+
status: N = t.Default,
|
|
30
|
+
theme: u,
|
|
31
|
+
uploadButtonText: J = "Upload logo",
|
|
32
|
+
accept: M = "image/svg+xml,image/png,image/jpeg,image/jpg",
|
|
33
|
+
maxSize: K = 5 * 1024 * 1024
|
|
34
|
+
}) => {
|
|
35
|
+
const U = ee(), f = j(null), n = j(null), [W, c] = g(N), [_, B] = g(z), [$, C] = g(T), [X, G] = g(E);
|
|
36
|
+
te(() => () => {
|
|
37
|
+
n.current && clearTimeout(n.current);
|
|
38
|
+
}, []);
|
|
39
|
+
const a = N !== t.Default ? N : W, y = z ?? _, o = T ?? $, h = E ?? X, x = !!b || a === t.Error, q = (i) => {
|
|
40
|
+
const r = i.target.files?.[0];
|
|
41
|
+
if (!r) return;
|
|
42
|
+
if (!M.split(",").map((d) => d.trim()).some((d) => {
|
|
43
|
+
if (d.includes("*")) {
|
|
44
|
+
const Z = d.split("/")[0];
|
|
45
|
+
return r.type.startsWith(Z);
|
|
46
|
+
}
|
|
47
|
+
return r.type === d;
|
|
48
|
+
})) {
|
|
49
|
+
c(t.Error), k?.(i);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (r.size > K) {
|
|
53
|
+
c(t.Error), k?.(i);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
c(t.Uploading), C(r.name), G(Q(r.size));
|
|
57
|
+
const v = new FileReader();
|
|
58
|
+
v.onloadend = () => {
|
|
59
|
+
B(v.result), n.current = setTimeout(() => {
|
|
60
|
+
c(t.Complete);
|
|
61
|
+
}, 500);
|
|
62
|
+
}, v.readAsDataURL(r), k?.(i);
|
|
63
|
+
}, V = () => {
|
|
64
|
+
n.current && (clearTimeout(n.current), n.current = null), B(void 0), C(void 0), G(void 0), c(t.Default), f.current && (f.current.value = ""), H?.();
|
|
65
|
+
}, O = () => {
|
|
66
|
+
f.current?.click();
|
|
67
|
+
}, Q = (i) => {
|
|
68
|
+
if (i === 0) return "0 Bytes";
|
|
69
|
+
const r = 1024, I = ["Bytes", "KB", "MB", "GB"], w = Math.floor(Math.log(i) / Math.log(r));
|
|
70
|
+
return `${parseFloat((i / Math.pow(r, w)).toFixed(2))}${I[w]}`;
|
|
71
|
+
}, Y = b || (x ? "Invalid file format. Accepted file type is SVG, PNG, JPEG. Max file size is 5MB." : R || "Logo should be 32 x 32 pixels with transparent background (larger images will be downscaled proportionally to fit). Accepted file type is SVG, PNG, JPEG. Max file size is 5MB.");
|
|
72
|
+
return /* @__PURE__ */ l(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: m(
|
|
76
|
+
ne({
|
|
77
|
+
status: a,
|
|
78
|
+
className: s
|
|
79
|
+
})
|
|
80
|
+
),
|
|
81
|
+
"data-theme": u,
|
|
82
|
+
children: [
|
|
83
|
+
p && /* @__PURE__ */ l(
|
|
84
|
+
"label",
|
|
85
|
+
{
|
|
86
|
+
htmlFor: U,
|
|
87
|
+
className: m(
|
|
88
|
+
re({
|
|
89
|
+
className: P
|
|
90
|
+
}),
|
|
91
|
+
"cursor-pointer"
|
|
92
|
+
),
|
|
93
|
+
children: [
|
|
94
|
+
p,
|
|
95
|
+
L && /* @__PURE__ */ e("span", { className: "text-red-600 dark:text-red-500 text-xs mt-0.5", children: "*" })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ l(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: m(
|
|
103
|
+
ie({
|
|
104
|
+
status: a
|
|
105
|
+
})
|
|
106
|
+
),
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ l(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: m(
|
|
112
|
+
le({
|
|
113
|
+
status: a
|
|
114
|
+
}),
|
|
115
|
+
{
|
|
116
|
+
"justify-between": x,
|
|
117
|
+
"justify-start": !x
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
children: [
|
|
121
|
+
a === t.Uploading && /* @__PURE__ */ l(S, { children: [
|
|
122
|
+
/* @__PURE__ */ e(ae, { className: "w-5 h-5 shrink-0 animate-spin text-metal-400" }),
|
|
123
|
+
o && /* @__PURE__ */ l("div", { className: "flex flex-col items-start min-w-0 flex-1", children: [
|
|
124
|
+
/* @__PURE__ */ e("p", { className: "text-sm leading-5 truncate w-full text-slate-800 dark:text-metal-50", children: o }),
|
|
125
|
+
h && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-slate-600 dark:text-metal-300 tracking-[0.15px]", children: h })
|
|
126
|
+
] })
|
|
127
|
+
] }),
|
|
128
|
+
a === t.Complete && y && /* @__PURE__ */ l(S, { children: [
|
|
129
|
+
/* @__PURE__ */ e("div", { className: "w-8 h-8 shrink-0 relative", children: /* @__PURE__ */ e(
|
|
130
|
+
"img",
|
|
131
|
+
{
|
|
132
|
+
src: y,
|
|
133
|
+
alt: o || "Uploaded image",
|
|
134
|
+
className: "w-full h-full object-contain"
|
|
135
|
+
}
|
|
136
|
+
) }),
|
|
137
|
+
o && /* @__PURE__ */ l("div", { className: "flex flex-col items-start min-w-0 flex-1", children: [
|
|
138
|
+
/* @__PURE__ */ e("p", { className: "text-sm leading-5 truncate w-full text-slate-800 dark:text-slate-50 kubefirst-dark:text-slate-50", children: o }),
|
|
139
|
+
h && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-slate-600 dark:text-slate-400 kubefirst-dark:text-slate-400 tracking-[0.15px]", children: h })
|
|
140
|
+
] })
|
|
141
|
+
] }),
|
|
142
|
+
(a === t.Default || a === t.Error && !y) && /* @__PURE__ */ e("div", { className: "w-8 h-8 shrink-0 flex items-center justify-center", children: /* @__PURE__ */ e(me, { className: "w-8 h-8 text-slate-400 dark:text-slate-500 kubefirst-dark:text-slate-500" }) }),
|
|
143
|
+
x && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(oe, { className: "w-5 h-5 text-red-700 dark:text-red-500 kubefirst-dark:text-red-500" }) })
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
(a === t.Default || a === t.Error) && /* @__PURE__ */ e(
|
|
148
|
+
F,
|
|
149
|
+
{
|
|
150
|
+
variant: "secondary",
|
|
151
|
+
onClick: O,
|
|
152
|
+
theme: u,
|
|
153
|
+
className: "h-10 px-4 py-2 shrink-0",
|
|
154
|
+
children: J
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
a === t.Uploading && /* @__PURE__ */ e(
|
|
158
|
+
F,
|
|
159
|
+
{
|
|
160
|
+
variant: "secondary",
|
|
161
|
+
shape: "circle",
|
|
162
|
+
size: "medium",
|
|
163
|
+
onClick: V,
|
|
164
|
+
theme: u,
|
|
165
|
+
className: "shrink-0",
|
|
166
|
+
"aria-label": "Cancel upload",
|
|
167
|
+
children: /* @__PURE__ */ e(D, { className: "w-6 h-6" })
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
a === t.Complete && /* @__PURE__ */ e(
|
|
171
|
+
F,
|
|
172
|
+
{
|
|
173
|
+
variant: "secondary",
|
|
174
|
+
shape: "circle",
|
|
175
|
+
size: "medium",
|
|
176
|
+
onClick: V,
|
|
177
|
+
theme: u,
|
|
178
|
+
className: "shrink-0",
|
|
179
|
+
"aria-label": "Remove file",
|
|
180
|
+
children: /* @__PURE__ */ e(D, { className: "w-6 h-6" })
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
/* @__PURE__ */ l("div", { className: "flex w-full gap-2", children: [
|
|
187
|
+
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ e(
|
|
188
|
+
"p",
|
|
189
|
+
{
|
|
190
|
+
className: m(
|
|
191
|
+
se({
|
|
192
|
+
status: a
|
|
193
|
+
})
|
|
194
|
+
),
|
|
195
|
+
children: Y
|
|
196
|
+
}
|
|
197
|
+
) }),
|
|
198
|
+
(a === t.Default || a === t.Error) && /* @__PURE__ */ e("div", { className: "shrink-0 w-29" }),
|
|
199
|
+
a === t.Uploading && /* @__PURE__ */ e("div", { className: "shrink-0 w-10" })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ e(
|
|
202
|
+
"input",
|
|
203
|
+
{
|
|
204
|
+
ref: f,
|
|
205
|
+
id: U,
|
|
206
|
+
type: "file",
|
|
207
|
+
name: A,
|
|
208
|
+
accept: M,
|
|
209
|
+
onChange: q,
|
|
210
|
+
className: "hidden",
|
|
211
|
+
"aria-label": typeof p == "string" ? p : "File upload"
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
pe.displayName = "KonstructImageUpload";
|
|
219
|
+
export {
|
|
220
|
+
pe as ImageUpload
|
|
221
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { c as t } from "../../index-D29mdTf5.js";
|
|
2
|
+
const a = t(
|
|
3
|
+
["flex", "flex-col", "gap-2", "w-full"],
|
|
4
|
+
{
|
|
5
|
+
variants: {
|
|
6
|
+
status: {
|
|
7
|
+
default: "",
|
|
8
|
+
uploading: "",
|
|
9
|
+
complete: "",
|
|
10
|
+
error: ""
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
status: "default"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
), r = t(
|
|
18
|
+
["flex", "gap-2", "h-15", "items-center", "w-full"],
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
status: {
|
|
22
|
+
default: "",
|
|
23
|
+
uploading: "",
|
|
24
|
+
complete: "",
|
|
25
|
+
error: ""
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
status: "default"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
), s = t(
|
|
33
|
+
[
|
|
34
|
+
"flex",
|
|
35
|
+
"gap-4",
|
|
36
|
+
"grow",
|
|
37
|
+
"h-full",
|
|
38
|
+
"items-center",
|
|
39
|
+
"px-4",
|
|
40
|
+
"py-2",
|
|
41
|
+
"rounded",
|
|
42
|
+
"border",
|
|
43
|
+
"bg-white",
|
|
44
|
+
"border-gray-300",
|
|
45
|
+
"dark:bg-metal-800",
|
|
46
|
+
"dark:border-metal-700",
|
|
47
|
+
"kubefirst-dark:bg-slate-800",
|
|
48
|
+
"kubefirst-dark:border-slate-600"
|
|
49
|
+
],
|
|
50
|
+
{
|
|
51
|
+
variants: {
|
|
52
|
+
status: {
|
|
53
|
+
default: "",
|
|
54
|
+
uploading: "",
|
|
55
|
+
complete: "",
|
|
56
|
+
error: [
|
|
57
|
+
"border-red-600",
|
|
58
|
+
"dark:border-red-500",
|
|
59
|
+
"kubefirst-dark:border-red-500"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
defaultVariants: {
|
|
64
|
+
status: "default"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
), l = t([
|
|
68
|
+
"flex",
|
|
69
|
+
"gap-1",
|
|
70
|
+
"items-center",
|
|
71
|
+
"text-sm",
|
|
72
|
+
"font-medium",
|
|
73
|
+
"leading-5",
|
|
74
|
+
"text-slate-500",
|
|
75
|
+
"dark:text-slate-50",
|
|
76
|
+
"kubefirst-dark:text-slate-50"
|
|
77
|
+
]), d = t(
|
|
78
|
+
[
|
|
79
|
+
"text-xs",
|
|
80
|
+
"leading-5",
|
|
81
|
+
"text-slate-600",
|
|
82
|
+
"dark:text-slate-200",
|
|
83
|
+
"kubefirst-dark:text-slate-200"
|
|
84
|
+
],
|
|
85
|
+
{
|
|
86
|
+
variants: {
|
|
87
|
+
status: {
|
|
88
|
+
default: "",
|
|
89
|
+
uploading: "",
|
|
90
|
+
complete: "",
|
|
91
|
+
error: [
|
|
92
|
+
"text-red-700",
|
|
93
|
+
"dark:text-red-400",
|
|
94
|
+
"kubefirst-dark:text-red-500"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
defaultVariants: {
|
|
99
|
+
status: "default"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
export {
|
|
104
|
+
d as helperTextVariants,
|
|
105
|
+
a as imageUploadVariants,
|
|
106
|
+
r as inputContainerVariants,
|
|
107
|
+
s as inputFieldVariants,
|
|
108
|
+
l as labelVariants
|
|
109
|
+
};
|