@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.
Files changed (29) hide show
  1. package/dist/assets/icons/index.js +7 -0
  2. package/dist/components/Badge/Badge.js +36 -35
  3. package/dist/components/Counter/Counter.js +23 -23
  4. package/dist/components/ImageUpload/ImageUpload.js +8 -8
  5. package/dist/components/Input/Input.js +185 -118
  6. package/dist/components/Input/Input.variants.js +16 -20
  7. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +19 -19
  8. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +11 -15
  9. package/dist/components/MultiSelectDropdown/components/Item/Item.js +18 -26
  10. package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +8 -8
  11. package/dist/components/MultiSelectDropdown/components/List/List.js +12 -19
  12. package/dist/components/MultiSelectDropdown/components/List/List.variants.js +6 -4
  13. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +79 -65
  14. package/dist/components/PhoneNumberInput/components/Wrapper.js +43 -36
  15. package/dist/components/RadioGroup/RadioGroup.js +9 -9
  16. package/dist/components/Select/components/Wrapper.js +1 -1
  17. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
  18. package/dist/components/Typography/Typography.variants.js +6 -1
  19. package/dist/components/VirtualizedTable/VirtualizedTable.js +14 -14
  20. package/dist/components/VirtualizedTable/components/Actions/Actions.js +20 -16
  21. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +60 -60
  22. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +8 -8
  23. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +32 -21
  24. package/dist/components/VirtualizedTable/components/Header/Header.js +15 -15
  25. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +8 -8
  26. package/dist/index.d.ts +1875 -10
  27. package/dist/package.json +4 -4
  28. package/dist/styles.css +1 -1
  29. 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 d, jsx as a } from "react/jsx-runtime";
2
- import { useRef as v, useState as y, useCallback as N, useEffect as S } from "react";
3
- import { S as w } from "../../loader-juvMSJ9L.js";
4
- import { cn as u } from "../../utils/index.js";
5
- import { buttonDismissVariants as x, badgeVariants as V } from "./Badge.variants.js";
6
- import { S as D } from "../../index-BvoZGpli.js";
7
- import { X as j } from "../../x-BXShoIAM.js";
8
- const X = ({
9
- className: c,
10
- dismissible: p = !1,
11
- isSelectable: b = !0,
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: o = !1,
15
- size: n,
16
- variant: l,
14
+ loading: n = !1,
15
+ rightIcon: o,
16
+ size: l,
17
+ variant: m,
17
18
  onClick: e,
18
- onDismiss: m
19
+ onDismiss: d
19
20
  }) => {
20
- const s = v(null), [f, h] = y("visible"), g = N(
21
+ const a = y(null), [v, N] = w("visible"), g = S(
21
22
  (t) => {
22
- t.stopPropagation(), m?.(), h("hidden");
23
+ t.stopPropagation(), d?.(), N("hidden");
23
24
  },
24
- [m]
25
+ [d]
25
26
  );
26
- return S(() => {
27
+ return x(() => {
27
28
  const t = new AbortController();
28
- return s.current?.addEventListener(
29
+ return a.current?.addEventListener(
29
30
  "animationend",
30
31
  () => {
31
- s.current?.style.setProperty("display", "none"), s.current?.remove();
32
+ a.current?.style.setProperty("display", "none"), a.current?.remove();
32
33
  },
33
34
  { signal: t.signal }
34
35
  ), () => t.abort();
35
- }, []), /* @__PURE__ */ d(
36
+ }, []), /* @__PURE__ */ u(
36
37
  "span",
37
38
  {
38
- ref: s,
39
- className: u(V({ variant: l, size: n, className: c }), {
40
- "select-none": !b,
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": o,
48
+ "aria-busy": n,
48
49
  "aria-live": "polite",
49
- "data-state": f,
50
+ "data-state": v,
50
51
  children: [
51
- o && /* @__PURE__ */ a(w, { className: "h-3 w-3 animate-spin animate-duration-time-2" }),
52
- i ? /* @__PURE__ */ a(D, { className: "h-3 w-3", children: i }) : null,
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
- p && /* @__PURE__ */ d(
55
+ f ? /* @__PURE__ */ u(
55
56
  "button",
56
57
  {
57
58
  type: "button",
58
- className: u(x({ size: n, variant: l })),
59
+ className: c(D({ size: l, variant: m })),
59
60
  onClick: g,
60
61
  "aria-label": "Dismiss",
61
62
  children: [
62
- /* @__PURE__ */ a(j, { className: "h-full w-full" }),
63
- /* @__PURE__ */ a("span", { className: "sr-only", children: "Dismiss" })
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
- X as Badge
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 x } from "../../index-BKjcReYh.js";
3
- import p, { forwardRef as g, useId as $, useCallback as N } from "react";
4
- import { cn as y } from "../../utils/index.js";
5
- import { labelVariants as T, buttonVariants as P, counterVariants as W } from "./Counter.variants.js";
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: d = -1 / 0,
126
+ max: y = -1 / 0,
127
127
  min: h = 1 / 0,
128
- name: j,
129
- theme: k,
128
+ name: x,
129
+ theme: P,
130
130
  value: z,
131
131
  onChange: m
132
132
  }, I) => {
133
- const _ = $(), s = z ?? 0, E = N(() => {
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 = N(() => {
136
+ }, [s, h, m]), L = k(() => {
137
137
  let c = 0;
138
- d === -1 / 0 ? c = s + 1 : c = Math.min(d, s + 1), m?.({ target: { value: c } });
139
- }, [s, d, m]);
140
- return /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", "data-theme": k, children: [
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: j ?? _,
145
+ htmlFor: x ?? _,
146
146
  variant: "labelLarge",
147
- className: y(T()),
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: y(
162
- P({
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(x, { children: "Decrement" })
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: j,
181
- className: y(W({ className: r })),
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: y(
192
- P({
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(x, { children: "Increment" })
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: N,
27
+ onChange: k,
28
28
  onRemove: H,
29
- status: k = t.Default,
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(k), [_, B] = g(z), [$, C] = g(T), [X, G] = g(E);
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 = k !== t.Default ? k : W, y = z ?? _, o = T ?? $, h = E ?? X, x = !!b || a === t.Error, q = (i) => {
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), N?.(i);
49
+ c(t.Error), k?.(i);
50
50
  return;
51
51
  }
52
52
  if (r.size > K) {
53
- c(t.Error), N?.(i);
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), N?.(i);
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
  ),