@konstructio/ui 0.1.2-alpha.47 → 0.1.2-alpha.49
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/assets/icons/index.js +7 -0
- package/dist/components/Badge/Badge.js +36 -35
- package/dist/components/Counter/Counter.js +23 -23
- package/dist/components/ImageUpload/ImageUpload.js +8 -8
- package/dist/components/Input/Input.js +185 -118
- package/dist/components/Input/Input.variants.js +16 -20
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +19 -19
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +11 -15
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +18 -26
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +8 -8
- package/dist/components/MultiSelectDropdown/components/List/List.js +12 -19
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +6 -4
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +79 -65
- package/dist/components/PhoneNumberInput/components/Wrapper.js +43 -36
- package/dist/components/RadioGroup/RadioGroup.js +9 -9
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Typography/Typography.variants.js +6 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +14 -14
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +20 -16
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +60 -60
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +8 -8
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +32 -21
- package/dist/components/VirtualizedTable/components/Header/Header.js +15 -15
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +8 -8
- package/dist/index.d.ts +1875 -10
- package/dist/package.json +4 -4
- package/dist/styles.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { S as a } from "../../loader-juvMSJ9L.js";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
const L = (t) => /* @__PURE__ */ e.createElement("svg", { width: 9, height: 9, viewBox: "0 0 9 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M8.16667 0.8225L7.34417 0L4.08333 3.26083L0.8225 0L0 0.8225L3.26083 4.08333L0 7.34417L0.8225 8.16667L4.08333 4.90583L7.34417 8.16667L8.16667 7.34417L4.90583 4.08333L8.16667 0.8225Z", fill: "#364153" }));
|
|
4
|
+
export {
|
|
5
|
+
a as Loader,
|
|
6
|
+
L as X
|
|
7
|
+
};
|
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { S as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { buttonDismissVariants as
|
|
6
|
-
import { S as
|
|
7
|
-
import { X as
|
|
8
|
-
const
|
|
9
|
-
className:
|
|
10
|
-
dismissible:
|
|
11
|
-
isSelectable:
|
|
1
|
+
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as y, useState as w, useCallback as S, useEffect as x } from "react";
|
|
3
|
+
import { S as V } from "../../loader-juvMSJ9L.js";
|
|
4
|
+
import { cn as c } from "../../utils/index.js";
|
|
5
|
+
import { buttonDismissVariants as D, badgeVariants as j } from "./Badge.variants.js";
|
|
6
|
+
import { S as p } from "../../index-BvoZGpli.js";
|
|
7
|
+
import { X as E } from "../../x-BXShoIAM.js";
|
|
8
|
+
const q = ({
|
|
9
|
+
className: b,
|
|
10
|
+
dismissible: f = !1,
|
|
11
|
+
isSelectable: h = !0,
|
|
12
12
|
label: r,
|
|
13
13
|
leftIcon: i,
|
|
14
|
-
loading:
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
loading: n = !1,
|
|
15
|
+
rightIcon: o,
|
|
16
|
+
size: l,
|
|
17
|
+
variant: m,
|
|
17
18
|
onClick: e,
|
|
18
|
-
onDismiss:
|
|
19
|
+
onDismiss: d
|
|
19
20
|
}) => {
|
|
20
|
-
const
|
|
21
|
+
const a = y(null), [v, N] = w("visible"), g = S(
|
|
21
22
|
(t) => {
|
|
22
|
-
t.stopPropagation(),
|
|
23
|
+
t.stopPropagation(), d?.(), N("hidden");
|
|
23
24
|
},
|
|
24
|
-
[
|
|
25
|
+
[d]
|
|
25
26
|
);
|
|
26
|
-
return
|
|
27
|
+
return x(() => {
|
|
27
28
|
const t = new AbortController();
|
|
28
|
-
return
|
|
29
|
+
return a.current?.addEventListener(
|
|
29
30
|
"animationend",
|
|
30
31
|
() => {
|
|
31
|
-
|
|
32
|
+
a.current?.style.setProperty("display", "none"), a.current?.remove();
|
|
32
33
|
},
|
|
33
34
|
{ signal: t.signal }
|
|
34
35
|
), () => t.abort();
|
|
35
|
-
}, []), /* @__PURE__ */
|
|
36
|
+
}, []), /* @__PURE__ */ u(
|
|
36
37
|
"span",
|
|
37
38
|
{
|
|
38
|
-
ref:
|
|
39
|
-
className:
|
|
40
|
-
"select-none": !
|
|
39
|
+
ref: a,
|
|
40
|
+
className: c(j({ variant: m, size: l, className: b }), {
|
|
41
|
+
"select-none": !h,
|
|
41
42
|
"cursor-pointer": e
|
|
42
43
|
}),
|
|
43
44
|
role: e ? "button" : void 0,
|
|
44
45
|
onClick: e,
|
|
45
46
|
tabIndex: e ? 0 : void 0,
|
|
46
47
|
"aria-label": e ? `${r} badge` : void 0,
|
|
47
|
-
"aria-busy":
|
|
48
|
+
"aria-busy": n,
|
|
48
49
|
"aria-live": "polite",
|
|
49
|
-
"data-state":
|
|
50
|
+
"data-state": v,
|
|
50
51
|
children: [
|
|
51
|
-
|
|
52
|
-
i ? /* @__PURE__ */
|
|
52
|
+
n && /* @__PURE__ */ s(V, { className: "h-3 w-3 animate-spin animate-duration-time-2" }),
|
|
53
|
+
i ? /* @__PURE__ */ s(p, { className: "h-3 w-3", children: i }) : null,
|
|
53
54
|
r,
|
|
54
|
-
|
|
55
|
+
f ? /* @__PURE__ */ u(
|
|
55
56
|
"button",
|
|
56
57
|
{
|
|
57
58
|
type: "button",
|
|
58
|
-
className:
|
|
59
|
+
className: c(D({ size: l, variant: m })),
|
|
59
60
|
onClick: g,
|
|
60
61
|
"aria-label": "Dismiss",
|
|
61
62
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ s(E, { className: "h-full w-full" }),
|
|
64
|
+
/* @__PURE__ */ s("span", { className: "sr-only", children: "Dismiss" })
|
|
64
65
|
]
|
|
65
66
|
}
|
|
66
|
-
)
|
|
67
|
+
) : o ? /* @__PURE__ */ s(p, { className: "h-3 w-3", children: o }) : null
|
|
67
68
|
]
|
|
68
69
|
}
|
|
69
70
|
);
|
|
70
71
|
};
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
q as Badge
|
|
73
74
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as f, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { R as
|
|
3
|
-
import p, { forwardRef as g, useId as $, useCallback as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { labelVariants as T, buttonVariants as
|
|
2
|
+
import { R as j } from "../../index-BKjcReYh.js";
|
|
3
|
+
import p, { forwardRef as g, useId as $, useCallback as k } from "react";
|
|
4
|
+
import { cn as d } from "../../utils/index.js";
|
|
5
|
+
import { labelVariants as T, buttonVariants as N, counterVariants as W } from "./Counter.variants.js";
|
|
6
6
|
import { Typography as V } from "../Typography/Typography.js";
|
|
7
7
|
import { P as a } from "../../index-BOE_3f_Z.js";
|
|
8
8
|
function v() {
|
|
@@ -123,32 +123,32 @@ const J = g(
|
|
|
123
123
|
incrementButtonClassName: n,
|
|
124
124
|
isRequired: i,
|
|
125
125
|
label: l,
|
|
126
|
-
max:
|
|
126
|
+
max: y = -1 / 0,
|
|
127
127
|
min: h = 1 / 0,
|
|
128
|
-
name:
|
|
129
|
-
theme:
|
|
128
|
+
name: x,
|
|
129
|
+
theme: P,
|
|
130
130
|
value: z,
|
|
131
131
|
onChange: m
|
|
132
132
|
}, I) => {
|
|
133
|
-
const _ = $(), s = z ?? 0, E =
|
|
133
|
+
const _ = $(), s = z ?? 0, E = k(() => {
|
|
134
134
|
let c = 0;
|
|
135
135
|
h === 1 / 0 ? c = s - 1 : c = Math.max(h, s - 1), m?.({ target: { value: c } });
|
|
136
|
-
}, [s, h, m]), L =
|
|
136
|
+
}, [s, h, m]), L = k(() => {
|
|
137
137
|
let c = 0;
|
|
138
|
-
|
|
139
|
-
}, [s,
|
|
140
|
-
return /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", "data-theme":
|
|
138
|
+
y === -1 / 0 ? c = s + 1 : c = Math.min(y, s + 1), m?.({ target: { value: c } });
|
|
139
|
+
}, [s, y, m]);
|
|
140
|
+
return /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", "data-theme": P, children: [
|
|
141
141
|
l ? /* @__PURE__ */ f(
|
|
142
142
|
V,
|
|
143
143
|
{
|
|
144
144
|
component: "label",
|
|
145
|
-
htmlFor:
|
|
145
|
+
htmlFor: x ?? _,
|
|
146
146
|
variant: "labelLarge",
|
|
147
|
-
className:
|
|
147
|
+
className: d(T()),
|
|
148
148
|
children: [
|
|
149
149
|
"Number of nodes",
|
|
150
150
|
" ",
|
|
151
|
-
i && /* @__PURE__ */ u("span", { className: "text-red-600", children: "*" })
|
|
151
|
+
i && /* @__PURE__ */ u("span", { className: "text-red-600 dark:text-red-500", children: "*" })
|
|
152
152
|
]
|
|
153
153
|
}
|
|
154
154
|
) : null,
|
|
@@ -158,8 +158,8 @@ const J = g(
|
|
|
158
158
|
{
|
|
159
159
|
type: "button",
|
|
160
160
|
onClick: E,
|
|
161
|
-
className:
|
|
162
|
-
|
|
161
|
+
className: d(
|
|
162
|
+
N({
|
|
163
163
|
button: "rigth",
|
|
164
164
|
className: t
|
|
165
165
|
})
|
|
@@ -167,7 +167,7 @@ const J = g(
|
|
|
167
167
|
disabled: !e,
|
|
168
168
|
children: [
|
|
169
169
|
/* @__PURE__ */ u(O, { className: "w-4 h-4" }),
|
|
170
|
-
/* @__PURE__ */ u(
|
|
170
|
+
/* @__PURE__ */ u(j, { children: "Decrement" })
|
|
171
171
|
]
|
|
172
172
|
}
|
|
173
173
|
),
|
|
@@ -177,8 +177,8 @@ const J = g(
|
|
|
177
177
|
ref: I,
|
|
178
178
|
type: "number",
|
|
179
179
|
value: s,
|
|
180
|
-
name:
|
|
181
|
-
className:
|
|
180
|
+
name: x,
|
|
181
|
+
className: d(W({ className: r })),
|
|
182
182
|
readOnly: !0,
|
|
183
183
|
"aria-label": typeof l == "string" ? l : "number input"
|
|
184
184
|
}
|
|
@@ -188,8 +188,8 @@ const J = g(
|
|
|
188
188
|
{
|
|
189
189
|
type: "button",
|
|
190
190
|
onClick: L,
|
|
191
|
-
className:
|
|
192
|
-
|
|
191
|
+
className: d(
|
|
192
|
+
N({
|
|
193
193
|
button: "left",
|
|
194
194
|
className: n
|
|
195
195
|
})
|
|
@@ -197,7 +197,7 @@ const J = g(
|
|
|
197
197
|
disabled: !o,
|
|
198
198
|
children: [
|
|
199
199
|
/* @__PURE__ */ u(w, { className: "w-4 h-4" }),
|
|
200
|
-
/* @__PURE__ */ u(
|
|
200
|
+
/* @__PURE__ */ u(j, { children: "Increment" })
|
|
201
201
|
]
|
|
202
202
|
}
|
|
203
203
|
)
|
|
@@ -24,19 +24,19 @@ const pe = ({
|
|
|
24
24
|
label: p = "Item logo",
|
|
25
25
|
labelClassName: P,
|
|
26
26
|
name: A,
|
|
27
|
-
onChange:
|
|
27
|
+
onChange: k,
|
|
28
28
|
onRemove: H,
|
|
29
|
-
status:
|
|
29
|
+
status: N = t.Default,
|
|
30
30
|
theme: u,
|
|
31
31
|
uploadButtonText: J = "Upload logo",
|
|
32
32
|
accept: M = "image/svg+xml,image/png,image/jpeg,image/jpg",
|
|
33
33
|
maxSize: K = 5 * 1024 * 1024
|
|
34
34
|
}) => {
|
|
35
|
-
const U = ee(), f = j(null), n = j(null), [W, c] = g(
|
|
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
36
|
te(() => () => {
|
|
37
37
|
n.current && clearTimeout(n.current);
|
|
38
38
|
}, []);
|
|
39
|
-
const a =
|
|
39
|
+
const a = N !== t.Default ? N : W, y = z ?? _, o = T ?? $, h = E ?? X, x = !!b || a === t.Error, q = (i) => {
|
|
40
40
|
const r = i.target.files?.[0];
|
|
41
41
|
if (!r) return;
|
|
42
42
|
if (!M.split(",").map((d) => d.trim()).some((d) => {
|
|
@@ -46,11 +46,11 @@ const pe = ({
|
|
|
46
46
|
}
|
|
47
47
|
return r.type === d;
|
|
48
48
|
})) {
|
|
49
|
-
c(t.Error),
|
|
49
|
+
c(t.Error), k?.(i);
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
if (r.size > K) {
|
|
53
|
-
c(t.Error),
|
|
53
|
+
c(t.Error), k?.(i);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
c(t.Uploading), C(r.name), G(Q(r.size));
|
|
@@ -59,7 +59,7 @@ const pe = ({
|
|
|
59
59
|
B(v.result), n.current = setTimeout(() => {
|
|
60
60
|
c(t.Complete);
|
|
61
61
|
}, 500);
|
|
62
|
-
}, v.readAsDataURL(r),
|
|
62
|
+
}, v.readAsDataURL(r), k?.(i);
|
|
63
63
|
}, V = () => {
|
|
64
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
65
|
}, O = () => {
|
|
@@ -92,7 +92,7 @@ const pe = ({
|
|
|
92
92
|
),
|
|
93
93
|
children: [
|
|
94
94
|
p,
|
|
95
|
-
L && /* @__PURE__ */ e("span", { className: "text-red-600 text-xs mt-0.5", children: "*" })
|
|
95
|
+
L && /* @__PURE__ */ e("span", { className: "text-red-600 dark:text-red-500 text-xs mt-0.5", children: "*" })
|
|
96
96
|
]
|
|
97
97
|
}
|
|
98
98
|
),
|