@konstructio/ui 0.1.2-alpha.44 → 0.1.2-alpha.46
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/components/AlertDialog/AlertDialog.js +39 -37
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +23 -26
- package/dist/components/Badge/Badge.variants.js +1 -1
- package/dist/components/Button/Button.variants.js +108 -98
- package/dist/components/Checkbox/Checkbox.js +104 -100
- package/dist/components/Checkbox/Checkbox.variants.js +30 -7
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +9 -10
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
- package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -32
- 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.variants.js +10 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +4 -4
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +16 -7
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +92 -74
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +53 -29
- package/dist/components/PhoneNumberInput/components/Wrapper.js +139 -120
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +3 -3
- package/dist/components/{Dropdown → Select}/components/List/List.js +48 -43
- package/dist/components/{Dropdown → Select}/components/List/List.variants.js +8 -5
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.js +20 -20
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +3 -2
- package/dist/components/{Dropdown → Select}/components/Wrapper.js +70 -70
- package/dist/components/Select/contexts/index.js +6 -0
- package/dist/components/{Dropdown/contexts/dropdown.context.js → Select/contexts/select.context.js} +2 -2
- package/dist/components/Select/contexts/select.hook.js +11 -0
- package/dist/components/Select/contexts/select.provider.js +58 -0
- package/dist/components/{Dropdown → Select}/hooks/useNavigationList.js +3 -3
- package/dist/components/{Dropdown/hooks/useDropdown.js → Select/hooks/useSelect.js} +33 -33
- package/dist/components/Switch/Switch.js +153 -125
- package/dist/components/Switch/Switch.variants.js +15 -6
- package/dist/components/Typography/Typography.js +25 -27
- package/dist/components/Typography/Typography.variants.js +2 -2
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +14 -14
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +10 -10
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/index.js +77 -74
- package/dist/{index-CPU02rhe.js → index-D6KzX_ef.js} +13 -12
- package/dist/index.d.ts +106 -60
- package/dist/index.js +109 -106
- package/dist/package.json +4 -4
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +6 -5
- package/dist/ui/theme.css +27 -0
- package/dist/x-BXShoIAM.js +8 -0
- package/package.json +4 -4
- package/dist/components/Dropdown/Dropdown.js +0 -48
- package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
- package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -58
- package/dist/components/Dropdown/contexts/index.js +0 -6
- /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
- /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
- /package/dist/components/{Dropdown → Select}/constants/index.js +0 -0
- /package/dist/components/{Dropdown → Select}/constants/pagination.js +0 -0
|
@@ -1,55 +1,71 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Badge as
|
|
2
|
+
import { Badge as b } from "../../../Badge/Badge.js";
|
|
3
3
|
import { Button as i } from "../../../Button/Button.js";
|
|
4
|
-
import { DatePicker as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useDateFilterDropdown as
|
|
8
|
-
import { C as
|
|
4
|
+
import { DatePicker as g } from "../../../Datepicker/DatePicker.js";
|
|
5
|
+
import { filterButtonIconVariants as x, filterButtonVariants as w } from "../../Filter.variants.js";
|
|
6
|
+
import { cn as t } from "../../../../utils/index.js";
|
|
7
|
+
import { useDateFilterDropdown as y } from "./DateFilterDropdown.hook.js";
|
|
8
|
+
import { C as k } from "../../../../chevron-down-DgT-uSF9.js";
|
|
9
9
|
const R = ({
|
|
10
|
-
label:
|
|
10
|
+
label: d,
|
|
11
11
|
position: l = "left",
|
|
12
|
-
onApply:
|
|
12
|
+
onApply: s
|
|
13
13
|
}) => {
|
|
14
14
|
const {
|
|
15
|
-
id:
|
|
15
|
+
id: p,
|
|
16
16
|
appliedDay: n,
|
|
17
|
-
isOpen:
|
|
18
|
-
selectedDay:
|
|
19
|
-
wrapperRef:
|
|
20
|
-
handleApply:
|
|
17
|
+
isOpen: r,
|
|
18
|
+
selectedDay: o,
|
|
19
|
+
wrapperRef: m,
|
|
20
|
+
handleApply: c,
|
|
21
21
|
handleOpen: f,
|
|
22
22
|
handleSelect: h,
|
|
23
23
|
handleReset: u
|
|
24
|
-
} =
|
|
25
|
-
return /* @__PURE__ */ a("div", { ref:
|
|
24
|
+
} = y({ onApply: s });
|
|
25
|
+
return /* @__PURE__ */ a("div", { ref: m, className: "relative", children: [
|
|
26
26
|
/* @__PURE__ */ a(
|
|
27
27
|
"button",
|
|
28
28
|
{
|
|
29
|
-
className:
|
|
30
|
-
"text-slate-700":
|
|
29
|
+
className: t(w(), {
|
|
30
|
+
"text-slate-700": r
|
|
31
31
|
}),
|
|
32
32
|
onClick: f,
|
|
33
33
|
children: [
|
|
34
|
-
|
|
35
|
-
n && /* @__PURE__ */ e(
|
|
34
|
+
d,
|
|
35
|
+
n && /* @__PURE__ */ e(b, { label: n }),
|
|
36
36
|
/* @__PURE__ */ e(
|
|
37
|
-
|
|
37
|
+
k,
|
|
38
38
|
{
|
|
39
|
-
className:
|
|
40
|
-
"rotate-180":
|
|
41
|
-
"text-blue-600": t
|
|
39
|
+
className: t(x(), {
|
|
40
|
+
"rotate-180 text-blue-600 dark:text-aurora-500": r
|
|
42
41
|
})
|
|
43
42
|
}
|
|
44
43
|
)
|
|
45
44
|
]
|
|
46
45
|
}
|
|
47
46
|
),
|
|
48
|
-
|
|
47
|
+
r && /* @__PURE__ */ a(
|
|
49
48
|
"div",
|
|
50
49
|
{
|
|
51
|
-
className:
|
|
52
|
-
"absolute
|
|
50
|
+
className: t(
|
|
51
|
+
"absolute",
|
|
52
|
+
"top-full",
|
|
53
|
+
"mt-1",
|
|
54
|
+
"bg-white",
|
|
55
|
+
"rounded-md",
|
|
56
|
+
"shadow-md",
|
|
57
|
+
"animate-in",
|
|
58
|
+
"fade-in-0",
|
|
59
|
+
"z-10",
|
|
60
|
+
"border",
|
|
61
|
+
"border-gray-200",
|
|
62
|
+
"flex",
|
|
63
|
+
"flex-col",
|
|
64
|
+
"gap-4",
|
|
65
|
+
"py-4",
|
|
66
|
+
"px-6",
|
|
67
|
+
"dark:bg-metal-800",
|
|
68
|
+
"dark:border-metal-700",
|
|
53
69
|
{
|
|
54
70
|
"left-0": l === "left",
|
|
55
71
|
"right-0": l === "right"
|
|
@@ -57,29 +73,46 @@ const R = ({
|
|
|
57
73
|
),
|
|
58
74
|
children: [
|
|
59
75
|
/* @__PURE__ */ e(
|
|
60
|
-
|
|
76
|
+
g,
|
|
61
77
|
{
|
|
62
78
|
className: "p-0",
|
|
63
79
|
arrowClassName: "-top-1 right-0",
|
|
64
|
-
monthsClassName:
|
|
65
|
-
|
|
66
|
-
|
|
80
|
+
monthsClassName: t(
|
|
81
|
+
"shadow-none",
|
|
82
|
+
"p-0",
|
|
83
|
+
"w-auto",
|
|
84
|
+
"dark:border-transparent"
|
|
85
|
+
),
|
|
86
|
+
defaultSelected: o,
|
|
87
|
+
defaultMonth: o,
|
|
67
88
|
onSelect: h
|
|
68
89
|
},
|
|
69
|
-
|
|
90
|
+
o?.toISOString() ?? p
|
|
70
91
|
),
|
|
71
|
-
/* @__PURE__ */ a(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
/* @__PURE__ */ a(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: t(
|
|
96
|
+
"flex",
|
|
97
|
+
"justify-end",
|
|
98
|
+
"items-center",
|
|
99
|
+
"gap-4",
|
|
100
|
+
"py-2"
|
|
101
|
+
),
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ e(
|
|
104
|
+
i,
|
|
105
|
+
{
|
|
106
|
+
variant: "secondary",
|
|
107
|
+
appearance: "compact",
|
|
108
|
+
onClick: u,
|
|
109
|
+
children: "Reset"
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ e(i, { appearance: "compact", onClick: c, children: "Apply" })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
)
|
|
83
116
|
]
|
|
84
117
|
}
|
|
85
118
|
)
|
|
@@ -1,43 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { resetEvent as
|
|
6
|
-
const
|
|
7
|
-
disabled:
|
|
8
|
-
className:
|
|
9
|
-
onClick:
|
|
10
|
-
...
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as m } from "react";
|
|
3
|
+
import { Button as i } from "../../../Button/Button.js";
|
|
4
|
+
import { cn as c } from "../../../../utils/index.js";
|
|
5
|
+
import { resetEvent as p } from "../../events/index.js";
|
|
6
|
+
const d = ({
|
|
7
|
+
disabled: e,
|
|
8
|
+
className: r,
|
|
9
|
+
onClick: t,
|
|
10
|
+
...o
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
}, [
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
12
|
+
const n = m(() => {
|
|
13
|
+
p(), t?.();
|
|
14
|
+
}, [t]);
|
|
15
|
+
return /* @__PURE__ */ a(
|
|
16
|
+
i,
|
|
17
17
|
{
|
|
18
18
|
type: "button",
|
|
19
|
-
variant: "
|
|
19
|
+
variant: "link",
|
|
20
20
|
appearance: "compact",
|
|
21
21
|
version: "alternate",
|
|
22
|
-
onClick:
|
|
23
|
-
disabled:
|
|
24
|
-
className:
|
|
25
|
-
|
|
26
|
-
"hover:text-slate-700",
|
|
27
|
-
"disabled:text-aurora-500/60",
|
|
28
|
-
"bg-transparent",
|
|
29
|
-
"hover:bg-transparent",
|
|
30
|
-
"hover:text-aurora-500",
|
|
31
|
-
"border-transparent",
|
|
32
|
-
"dark:hover:text-aurora-500",
|
|
33
|
-
"dark:hover:bg-aurora-900",
|
|
34
|
-
e
|
|
35
|
-
),
|
|
36
|
-
...a,
|
|
22
|
+
onClick: n,
|
|
23
|
+
disabled: e,
|
|
24
|
+
className: c("hover:no-underline", r),
|
|
25
|
+
...o,
|
|
37
26
|
children: "Reset"
|
|
38
27
|
}
|
|
39
28
|
);
|
|
40
29
|
};
|
|
41
30
|
export {
|
|
42
|
-
|
|
31
|
+
d as ResetButton
|
|
43
32
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var e = /* @__PURE__ */ ((t) => (t.OPEN = "@konstrtuctio/
|
|
1
|
+
var e = /* @__PURE__ */ ((t) => (t.OPEN = "@konstrtuctio/KonstructFilter/event-OPEN", t.RESET = "@konstrtuctio/KonstructFilter/event-RESET", t))(e || {});
|
|
2
2
|
const n = (t) => document.dispatchEvent(
|
|
3
|
-
new CustomEvent("@konstrtuctio/
|
|
3
|
+
new CustomEvent("@konstrtuctio/KonstructFilter/event-OPEN", { detail: t })
|
|
4
4
|
), o = () => document.dispatchEvent(new CustomEvent(
|
|
5
|
-
"@konstrtuctio/
|
|
5
|
+
"@konstrtuctio/KonstructFilter/event-RESET"
|
|
6
6
|
/* RESET */
|
|
7
7
|
));
|
|
8
8
|
export {
|
|
@@ -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: N,
|
|
28
|
+
onRemove: H,
|
|
29
|
+
status: k = 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(k), [_, B] = g(z), [$, C] = g(T), [X, G] = g(E);
|
|
36
|
+
te(() => () => {
|
|
37
|
+
n.current && clearTimeout(n.current);
|
|
38
|
+
}, []);
|
|
39
|
+
const a = k !== t.Default ? k : 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), N?.(i);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (r.size > K) {
|
|
53
|
+
c(t.Error), N?.(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), N?.(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 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-[calc(100px+1rem)]" }),
|
|
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-[60px]", "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
|
+
};
|
|
@@ -11,7 +11,8 @@ const a = r(
|
|
|
11
11
|
"focus-visible:outline-none",
|
|
12
12
|
"focus-visible:ring-1",
|
|
13
13
|
"h-10",
|
|
14
|
-
"placeholder:text-
|
|
14
|
+
"placeholder:text-zinc-400",
|
|
15
|
+
"dark:placeholder:text-metal-300",
|
|
15
16
|
"px-2.5",
|
|
16
17
|
"py-2",
|
|
17
18
|
"rounded",
|
|
@@ -40,7 +41,14 @@ const a = r(
|
|
|
40
41
|
variants: {
|
|
41
42
|
variant: {
|
|
42
43
|
default: "",
|
|
43
|
-
error:
|
|
44
|
+
error: [
|
|
45
|
+
"pr-8",
|
|
46
|
+
"border-red-600",
|
|
47
|
+
"focus-visible:border-red-600",
|
|
48
|
+
"focus-visible:ring-transparent",
|
|
49
|
+
"dark:border-red-500",
|
|
50
|
+
"kubefirst-dark:border-red-500"
|
|
51
|
+
]
|
|
44
52
|
}
|
|
45
53
|
},
|
|
46
54
|
defaultVariants: {
|
|
@@ -10,10 +10,10 @@ const t = r(
|
|
|
10
10
|
"focus-within:border-aurora-500",
|
|
11
11
|
"transition-colors",
|
|
12
12
|
"duration-150",
|
|
13
|
-
"dark:border-
|
|
14
|
-
"dark:bg-
|
|
15
|
-
"dark:data-[state=open]:border-
|
|
16
|
-
"dark:focus-within:border-
|
|
13
|
+
"dark:border-metal-700",
|
|
14
|
+
"dark:bg-metal-800",
|
|
15
|
+
"dark:data-[state=open]:border-metal-700",
|
|
16
|
+
"dark:focus-within:border-metal-700"
|
|
17
17
|
],
|
|
18
18
|
{
|
|
19
19
|
variants: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { cn as s } from "../../../../utils/index.js";
|
|
3
|
+
import { C as l } from "../../../../chevron-up-DrQr2Fwd.js";
|
|
4
|
+
import { usePhoneNumberContext as c } from "../../contexts/phone-number.hook.js";
|
|
5
|
+
const u = () => {
|
|
6
|
+
const { selectedCountry: o, isOpenSelector: t, handleOpenSelector: a } = c(), { flag: n } = o;
|
|
6
7
|
return /* @__PURE__ */ r(
|
|
7
8
|
"button",
|
|
8
9
|
{
|
|
@@ -12,9 +13,17 @@ const m = () => {
|
|
|
12
13
|
children: [
|
|
13
14
|
/* @__PURE__ */ e(n, {}),
|
|
14
15
|
/* @__PURE__ */ e(
|
|
15
|
-
|
|
16
|
+
l,
|
|
16
17
|
{
|
|
17
|
-
className:
|
|
18
|
+
className: s(
|
|
19
|
+
"transition-all",
|
|
20
|
+
"duration-100",
|
|
21
|
+
"data-[state=open]:rotate-0",
|
|
22
|
+
"data-[state=closed]:rotate-180",
|
|
23
|
+
"w-5",
|
|
24
|
+
"h-5",
|
|
25
|
+
"text-slate-400"
|
|
26
|
+
),
|
|
18
27
|
"data-state": t ? "open" : "closed"
|
|
19
28
|
}
|
|
20
29
|
)
|
|
@@ -23,5 +32,5 @@ const m = () => {
|
|
|
23
32
|
);
|
|
24
33
|
};
|
|
25
34
|
export {
|
|
26
|
-
|
|
35
|
+
u as FlagContent
|
|
27
36
|
};
|