@konstructio/ui 0.1.2-alpha.46 → 0.1.2-alpha.48

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 (40) 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 +210 -0
  4. package/dist/components/Counter/Counter.variants.js +70 -0
  5. package/dist/components/ImageUpload/ImageUpload.js +9 -9
  6. package/dist/components/ImageUpload/ImageUpload.variants.js +1 -1
  7. package/dist/components/Input/Input.js +185 -118
  8. package/dist/components/Input/Input.variants.js +16 -20
  9. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +19 -19
  10. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +11 -15
  11. package/dist/components/MultiSelectDropdown/components/Item/Item.js +18 -26
  12. package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +8 -8
  13. package/dist/components/MultiSelectDropdown/components/List/List.js +12 -19
  14. package/dist/components/MultiSelectDropdown/components/List/List.variants.js +6 -4
  15. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +79 -65
  16. package/dist/components/PhoneNumberInput/components/Wrapper.js +43 -36
  17. package/dist/components/Radio/Radio.js +47 -44
  18. package/dist/components/Radio/Radio.variants.js +12 -8
  19. package/dist/components/RadioGroup/RadioGroup.js +9 -9
  20. package/dist/components/Select/components/Wrapper.js +1 -1
  21. package/dist/components/TimePicker/TimePicker.variants.js +11 -6
  22. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
  23. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +50 -35
  24. package/dist/components/Typography/Typography.js +11 -13
  25. package/dist/components/Typography/Typography.variants.js +54 -46
  26. package/dist/components/VirtualizedTable/VirtualizedTable.js +14 -14
  27. package/dist/components/VirtualizedTable/components/Actions/Actions.js +20 -16
  28. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +60 -60
  29. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +8 -8
  30. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +32 -21
  31. package/dist/components/VirtualizedTable/components/Header/Header.js +15 -15
  32. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +8 -8
  33. package/dist/components/index.js +96 -95
  34. package/dist/index.d.ts +38 -30
  35. package/dist/index.js +110 -109
  36. package/dist/package.json +4 -4
  37. package/dist/styles.css +1 -1
  38. package/package.json +4 -4
  39. package/dist/components/NumberInput/NumberInput.js +0 -179
  40. package/dist/components/NumberInput/NumberInput.variants.js +0 -50
@@ -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
  };
@@ -0,0 +1,210 @@
1
+ import { jsxs as f, jsx as u } from "react/jsx-runtime";
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
+ import { Typography as V } from "../Typography/Typography.js";
7
+ import { P as a } from "../../index-BOE_3f_Z.js";
8
+ function v() {
9
+ return v = Object.assign || function(e) {
10
+ for (var o = 1; o < arguments.length; o++) {
11
+ var r = arguments[o];
12
+ for (var t in r)
13
+ Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
14
+ }
15
+ return e;
16
+ }, v.apply(this, arguments);
17
+ }
18
+ function M(e, o) {
19
+ if (e == null) return {};
20
+ var r = R(e, o), t, n;
21
+ if (Object.getOwnPropertySymbols) {
22
+ var i = Object.getOwnPropertySymbols(e);
23
+ for (n = 0; n < i.length; n++)
24
+ t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
25
+ }
26
+ return r;
27
+ }
28
+ function R(e, o) {
29
+ if (e == null) return {};
30
+ var r = {}, t = Object.keys(e), n, i;
31
+ for (i = 0; i < t.length; i++)
32
+ n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
33
+ return r;
34
+ }
35
+ var O = g(function(e, o) {
36
+ var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, l = M(e, ["color", "size"]);
37
+ return /* @__PURE__ */ p.createElement("svg", v({
38
+ ref: o,
39
+ xmlns: "http://www.w3.org/2000/svg",
40
+ width: i,
41
+ height: i,
42
+ viewBox: "0 0 24 24",
43
+ fill: "none",
44
+ stroke: t,
45
+ strokeWidth: "2",
46
+ strokeLinecap: "round",
47
+ strokeLinejoin: "round"
48
+ }, l), /* @__PURE__ */ p.createElement("line", {
49
+ x1: "5",
50
+ y1: "12",
51
+ x2: "19",
52
+ y2: "12"
53
+ }));
54
+ });
55
+ O.propTypes = {
56
+ color: a.string,
57
+ size: a.oneOfType([a.string, a.number])
58
+ };
59
+ O.displayName = "Minus";
60
+ function b() {
61
+ return b = Object.assign || function(e) {
62
+ for (var o = 1; o < arguments.length; o++) {
63
+ var r = arguments[o];
64
+ for (var t in r)
65
+ Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
66
+ }
67
+ return e;
68
+ }, b.apply(this, arguments);
69
+ }
70
+ function C(e, o) {
71
+ if (e == null) return {};
72
+ var r = B(e, o), t, n;
73
+ if (Object.getOwnPropertySymbols) {
74
+ var i = Object.getOwnPropertySymbols(e);
75
+ for (n = 0; n < i.length; n++)
76
+ t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
77
+ }
78
+ return r;
79
+ }
80
+ function B(e, o) {
81
+ if (e == null) return {};
82
+ var r = {}, t = Object.keys(e), n, i;
83
+ for (i = 0; i < t.length; i++)
84
+ n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
85
+ return r;
86
+ }
87
+ var w = g(function(e, o) {
88
+ var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, l = C(e, ["color", "size"]);
89
+ return /* @__PURE__ */ p.createElement("svg", b({
90
+ ref: o,
91
+ xmlns: "http://www.w3.org/2000/svg",
92
+ width: i,
93
+ height: i,
94
+ viewBox: "0 0 24 24",
95
+ fill: "none",
96
+ stroke: t,
97
+ strokeWidth: "2",
98
+ strokeLinecap: "round",
99
+ strokeLinejoin: "round"
100
+ }, l), /* @__PURE__ */ p.createElement("line", {
101
+ x1: "12",
102
+ y1: "5",
103
+ x2: "12",
104
+ y2: "19"
105
+ }), /* @__PURE__ */ p.createElement("line", {
106
+ x1: "5",
107
+ y1: "12",
108
+ x2: "19",
109
+ y2: "12"
110
+ }));
111
+ });
112
+ w.propTypes = {
113
+ color: a.string,
114
+ size: a.oneOfType([a.string, a.number])
115
+ };
116
+ w.displayName = "Plus";
117
+ const J = g(
118
+ ({
119
+ canDecrement: e = !0,
120
+ canIncrement: o = !0,
121
+ className: r,
122
+ decrementButtonClassName: t,
123
+ incrementButtonClassName: n,
124
+ isRequired: i,
125
+ label: l,
126
+ max: y = -1 / 0,
127
+ min: h = 1 / 0,
128
+ name: x,
129
+ theme: P,
130
+ value: z,
131
+ onChange: m
132
+ }, I) => {
133
+ const _ = $(), s = z ?? 0, E = k(() => {
134
+ let c = 0;
135
+ h === 1 / 0 ? c = s - 1 : c = Math.max(h, s - 1), m?.({ target: { value: c } });
136
+ }, [s, h, m]), L = k(() => {
137
+ let c = 0;
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
+ l ? /* @__PURE__ */ f(
142
+ V,
143
+ {
144
+ component: "label",
145
+ htmlFor: x ?? _,
146
+ variant: "labelLarge",
147
+ className: d(T()),
148
+ children: [
149
+ "Number of nodes",
150
+ " ",
151
+ i && /* @__PURE__ */ u("span", { className: "text-red-600 dark:text-red-500", children: "*" })
152
+ ]
153
+ }
154
+ ) : null,
155
+ /* @__PURE__ */ f("div", { className: "flex items-center", role: "presentation", children: [
156
+ /* @__PURE__ */ f(
157
+ "button",
158
+ {
159
+ type: "button",
160
+ onClick: E,
161
+ className: d(
162
+ N({
163
+ button: "rigth",
164
+ className: t
165
+ })
166
+ ),
167
+ disabled: !e,
168
+ children: [
169
+ /* @__PURE__ */ u(O, { className: "w-4 h-4" }),
170
+ /* @__PURE__ */ u(j, { children: "Decrement" })
171
+ ]
172
+ }
173
+ ),
174
+ /* @__PURE__ */ u(
175
+ "input",
176
+ {
177
+ ref: I,
178
+ type: "number",
179
+ value: s,
180
+ name: x,
181
+ className: d(W({ className: r })),
182
+ readOnly: !0,
183
+ "aria-label": typeof l == "string" ? l : "number input"
184
+ }
185
+ ),
186
+ /* @__PURE__ */ f(
187
+ "button",
188
+ {
189
+ type: "button",
190
+ onClick: L,
191
+ className: d(
192
+ N({
193
+ button: "left",
194
+ className: n
195
+ })
196
+ ),
197
+ disabled: !o,
198
+ children: [
199
+ /* @__PURE__ */ u(w, { className: "w-4 h-4" }),
200
+ /* @__PURE__ */ u(j, { children: "Increment" })
201
+ ]
202
+ }
203
+ )
204
+ ] })
205
+ ] });
206
+ }
207
+ );
208
+ export {
209
+ J as Counter
210
+ };
@@ -0,0 +1,70 @@
1
+ import { c as e } from "../../index-D29mdTf5.js";
2
+ const t = e([
3
+ "[&::-webkit-inner-spin-button]:appearance-none",
4
+ "[&::-webkit-outer-spin-button]:appearance-none",
5
+ "[-moz-appearance:textfield]",
6
+ "appearance-none",
7
+ "border",
8
+ "border-x-0",
9
+ "focus-visible:outline-none",
10
+ "focus-visible:ring-transparent",
11
+ "h-9",
12
+ "max-w-16",
13
+ "text-right",
14
+ "px-3",
15
+ "border-gray-300",
16
+ "text-slate-800",
17
+ "bg-white",
18
+ "dark:bg-metal-800",
19
+ "dark:border-metal-700",
20
+ "dark:text-metal-50"
21
+ ]), r = e(
22
+ [
23
+ "h-9",
24
+ "w-9",
25
+ "flex",
26
+ "items-center",
27
+ "justify-center",
28
+ "border",
29
+ "text-slate-500",
30
+ "border-gray-300",
31
+ "bg-white",
32
+ "cursor-pointer",
33
+ "hover:bg-aurora-50",
34
+ "hover:text-slate-600",
35
+ "disabled:hover:bg-white",
36
+ "disabled:bg-white",
37
+ "disabled:text-slate-400",
38
+ "dark:bg-metal-800",
39
+ "dark:border-metal-700",
40
+ "dark:text-aurora-500",
41
+ "dark:hover:bg-aurora-900",
42
+ "dark:hover:text-aurora-500",
43
+ "dark:disabled:text-metal-400",
44
+ "dark:disabled:hover:bg-metal-800",
45
+ "dark:disabled:bg-metal-800",
46
+ "disabled:cursor-not-allowed"
47
+ ],
48
+ {
49
+ variants: {
50
+ button: {
51
+ left: ["rounded-e"],
52
+ rigth: ["rounded-s"]
53
+ }
54
+ }
55
+ }
56
+ ), o = e(["cursor-pointer"], {
57
+ variants: {
58
+ variant: {
59
+ default: ""
60
+ }
61
+ },
62
+ defaultVariants: {
63
+ variant: "default"
64
+ }
65
+ });
66
+ export {
67
+ r as buttonVariants,
68
+ t as counterVariants,
69
+ o as labelVariants
70
+ };
@@ -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
  ),
@@ -195,7 +195,7 @@ const pe = ({
195
195
  children: Y
196
196
  }
197
197
  ) }),
198
- (a === t.Default || a === t.Error) && /* @__PURE__ */ e("div", { className: "shrink-0 w-[calc(100px+1rem)]" }),
198
+ (a === t.Default || a === t.Error) && /* @__PURE__ */ e("div", { className: "shrink-0 w-29" }),
199
199
  a === t.Uploading && /* @__PURE__ */ e("div", { className: "shrink-0 w-10" })
200
200
  ] }),
201
201
  /* @__PURE__ */ e(
@@ -15,7 +15,7 @@ const a = t(
15
15
  }
16
16
  }
17
17
  ), r = t(
18
- ["flex", "gap-2", "h-[60px]", "items-center", "w-full"],
18
+ ["flex", "gap-2", "h-15", "items-center", "w-full"],
19
19
  {
20
20
  variants: {
21
21
  status: {