@konstructio/ui 0.1.2-alpha.44 → 0.1.2-alpha.47

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 (68) hide show
  1. package/dist/components/AlertDialog/AlertDialog.js +39 -37
  2. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  3. package/dist/components/AlertDialog/components/index.js +1 -1
  4. package/dist/components/Badge/Badge.js +23 -26
  5. package/dist/components/Badge/Badge.variants.js +1 -1
  6. package/dist/components/Button/Button.variants.js +108 -98
  7. package/dist/components/Checkbox/Checkbox.js +104 -100
  8. package/dist/components/Checkbox/Checkbox.variants.js +30 -7
  9. package/dist/components/Counter/Counter.js +210 -0
  10. package/dist/components/Counter/Counter.variants.js +70 -0
  11. package/dist/components/Filter/Filter.js +1 -1
  12. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +9 -10
  13. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
  14. package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -32
  15. package/dist/components/Filter/events/index.js +3 -3
  16. package/dist/components/ImageUpload/ImageUpload.js +221 -0
  17. package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
  18. package/dist/components/Input/Input.variants.js +10 -2
  19. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +4 -4
  20. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +16 -7
  21. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +92 -74
  22. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +53 -29
  23. package/dist/components/PhoneNumberInput/components/Wrapper.js +139 -120
  24. package/dist/components/Radio/Radio.js +47 -44
  25. package/dist/components/Radio/Radio.variants.js +12 -8
  26. package/dist/components/Select/Select.js +48 -0
  27. package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +3 -3
  28. package/dist/components/{Dropdown → Select}/components/List/List.js +48 -43
  29. package/dist/components/{Dropdown → Select}/components/List/List.variants.js +8 -5
  30. package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.js +20 -20
  31. package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +3 -2
  32. package/dist/components/{Dropdown → Select}/components/Wrapper.js +70 -70
  33. package/dist/components/Select/contexts/index.js +6 -0
  34. package/dist/components/{Dropdown/contexts/dropdown.context.js → Select/contexts/select.context.js} +2 -2
  35. package/dist/components/Select/contexts/select.hook.js +11 -0
  36. package/dist/components/Select/contexts/select.provider.js +58 -0
  37. package/dist/components/{Dropdown → Select}/hooks/useNavigationList.js +3 -3
  38. package/dist/components/{Dropdown/hooks/useDropdown.js → Select/hooks/useSelect.js} +33 -33
  39. package/dist/components/Switch/Switch.js +153 -125
  40. package/dist/components/Switch/Switch.variants.js +15 -6
  41. package/dist/components/TimePicker/TimePicker.variants.js +11 -6
  42. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
  43. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +50 -35
  44. package/dist/components/Typography/Typography.js +24 -28
  45. package/dist/components/Typography/Typography.variants.js +49 -46
  46. package/dist/components/VirtualizedTable/components/Actions/Actions.js +14 -14
  47. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +10 -10
  48. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
  49. package/dist/components/index.js +84 -80
  50. package/dist/{index-CPU02rhe.js → index-D6KzX_ef.js} +13 -12
  51. package/dist/index.d.ts +134 -81
  52. package/dist/index.js +114 -110
  53. package/dist/package.json +4 -4
  54. package/dist/styles.css +1 -1
  55. package/dist/ui/civo-theme.css +6 -5
  56. package/dist/ui/theme.css +27 -0
  57. package/dist/x-BXShoIAM.js +8 -0
  58. package/package.json +4 -4
  59. package/dist/components/Dropdown/Dropdown.js +0 -48
  60. package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
  61. package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -58
  62. package/dist/components/Dropdown/contexts/index.js +0 -6
  63. package/dist/components/NumberInput/NumberInput.js +0 -179
  64. package/dist/components/NumberInput/NumberInput.variants.js +0 -50
  65. /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
  66. /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
  67. /package/dist/components/{Dropdown → Select}/constants/index.js +0 -0
  68. /package/dist/components/{Dropdown → Select}/constants/pagination.js +0 -0
@@ -1,58 +0,0 @@
1
- import { jsx as G } from "react/jsx-runtime";
2
- import { useState as e, useRef as f, useCallback as p, useEffect as T } from "react";
3
- import { DropdownContext as L } from "./dropdown.context.js";
4
- import { useToggle as N } from "../../../hooks/useToggle.js";
5
- const c = 1, O = 300, U = ({
6
- children: d,
7
- value: C,
8
- name: i,
9
- highlightSearch: E = !1,
10
- options: n,
11
- onChange: a,
12
- onBlur: u
13
- }) => {
14
- const [v, l] = e(n), F = f(E), [P, g] = N(!1), [D, I] = e(""), [S, b] = e(!0), [x, o] = e(!0), [A, s] = e(c), [_, h] = e(!1), t = f(void 0), w = p(
15
- (r, m) => {
16
- m?.current && (m.current.value = r), t.current && clearTimeout(t.current), h(!0), o(!0), s(c), a?.({ target: { value: r, name: i ?? "" } }), u?.(), t.current = setTimeout(() => {
17
- h(!1);
18
- }, O);
19
- },
20
- [a, i, u]
21
- ), y = p(
22
- (r) => {
23
- g(r), o(!0), s(c);
24
- },
25
- [g]
26
- );
27
- return T(() => {
28
- l(n);
29
- }, [n.length]), T(() => () => {
30
- t.current && clearTimeout(t.current);
31
- }, []), /* @__PURE__ */ G(
32
- L.Provider,
33
- {
34
- value: {
35
- highlightSearchEnabled: F.current,
36
- isOpen: P,
37
- searchTerm: D,
38
- value: C,
39
- canFilter: S,
40
- canContinueFetching: x,
41
- page: A,
42
- options: v,
43
- isTyping: _,
44
- setOptions: l,
45
- setPage: s,
46
- setCanContinueFetching: o,
47
- setCanFilter: b,
48
- setSearchTerm: I,
49
- setValue: w,
50
- toggleOpen: y
51
- },
52
- children: d
53
- }
54
- );
55
- };
56
- export {
57
- U as DropdownProvider
58
- };
@@ -1,6 +0,0 @@
1
- import { useDropdownContext as e } from "./dropdown.hook.js";
2
- import { DropdownProvider as t } from "./dropdown.provider.js";
3
- export {
4
- t as DropdownProvider,
5
- e as useDropdownContext
6
- };
@@ -1,179 +0,0 @@
1
- import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
- import { R as O } from "../../index-BKjcReYh.js";
3
- import f, { forwardRef as b, useId as N, useCallback as w } from "react";
4
- import { cn as y } from "../../utils/index.js";
5
- import { labelVariants as z, buttonVariants as j, numberInputVariants as _ } from "./NumberInput.variants.js";
6
- import { P as l } from "../../index-BOE_3f_Z.js";
7
- function h() {
8
- return h = Object.assign || function(e) {
9
- for (var o = 1; o < arguments.length; o++) {
10
- var r = arguments[o];
11
- for (var t in r)
12
- Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
13
- }
14
- return e;
15
- }, h.apply(this, arguments);
16
- }
17
- function E(e, o) {
18
- if (e == null) return {};
19
- var r = $(e, o), t, n;
20
- if (Object.getOwnPropertySymbols) {
21
- var i = Object.getOwnPropertySymbols(e);
22
- for (n = 0; n < i.length; n++)
23
- t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
24
- }
25
- return r;
26
- }
27
- function $(e, o) {
28
- if (e == null) return {};
29
- var r = {}, t = Object.keys(e), n, i;
30
- for (i = 0; i < t.length; i++)
31
- n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
32
- return r;
33
- }
34
- var g = b(function(e, o) {
35
- var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, u = E(e, ["color", "size"]);
36
- return /* @__PURE__ */ f.createElement("svg", h({
37
- ref: o,
38
- xmlns: "http://www.w3.org/2000/svg",
39
- width: i,
40
- height: i,
41
- viewBox: "0 0 24 24",
42
- fill: "none",
43
- stroke: t,
44
- strokeWidth: "2",
45
- strokeLinecap: "round",
46
- strokeLinejoin: "round"
47
- }, u), /* @__PURE__ */ f.createElement("line", {
48
- x1: "5",
49
- y1: "12",
50
- x2: "19",
51
- y2: "12"
52
- }));
53
- });
54
- g.propTypes = {
55
- color: l.string,
56
- size: l.oneOfType([l.string, l.number])
57
- };
58
- g.displayName = "Minus";
59
- function v() {
60
- return v = Object.assign || function(e) {
61
- for (var o = 1; o < arguments.length; o++) {
62
- var r = arguments[o];
63
- for (var t in r)
64
- Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
65
- }
66
- return e;
67
- }, v.apply(this, arguments);
68
- }
69
- function L(e, o) {
70
- if (e == null) return {};
71
- var r = W(e, o), t, n;
72
- if (Object.getOwnPropertySymbols) {
73
- var i = Object.getOwnPropertySymbols(e);
74
- for (n = 0; n < i.length; n++)
75
- t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
76
- }
77
- return r;
78
- }
79
- function W(e, o) {
80
- if (e == null) return {};
81
- var r = {}, t = Object.keys(e), n, i;
82
- for (i = 0; i < t.length; i++)
83
- n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
84
- return r;
85
- }
86
- var d = b(function(e, o) {
87
- var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, u = L(e, ["color", "size"]);
88
- return /* @__PURE__ */ f.createElement("svg", v({
89
- ref: o,
90
- xmlns: "http://www.w3.org/2000/svg",
91
- width: i,
92
- height: i,
93
- viewBox: "0 0 24 24",
94
- fill: "none",
95
- stroke: t,
96
- strokeWidth: "2",
97
- strokeLinecap: "round",
98
- strokeLinejoin: "round"
99
- }, u), /* @__PURE__ */ f.createElement("line", {
100
- x1: "12",
101
- y1: "5",
102
- x2: "12",
103
- y2: "19"
104
- }), /* @__PURE__ */ f.createElement("line", {
105
- x1: "5",
106
- y1: "12",
107
- x2: "19",
108
- y2: "12"
109
- }));
110
- });
111
- d.propTypes = {
112
- color: l.string,
113
- size: l.oneOfType([l.string, l.number])
114
- };
115
- d.displayName = "Plus";
116
- const D = b(
117
- ({
118
- className: e,
119
- label: o,
120
- max: r = -1 / 0,
121
- min: t = 1 / 0,
122
- name: n,
123
- theme: i,
124
- value: u,
125
- onChange: p
126
- }, x) => {
127
- const P = N(), a = u ?? 0, k = w(() => {
128
- let s = 0;
129
- t === 1 / 0 ? s = a - 1 : s = Math.max(t, a - 1), p?.({ target: { value: s } });
130
- }, [a, t, p]), I = w(() => {
131
- let s = 0;
132
- r === -1 / 0 ? s = a + 1 : s = Math.min(r, a + 1), p?.({ target: { value: s } });
133
- }, [a, r, p]);
134
- return /* @__PURE__ */ m("div", { className: "flex flex-col gap-1", "data-theme": i, children: [
135
- o ? /* @__PURE__ */ c("label", { htmlFor: n ?? P, className: y(z()), children: o }) : null,
136
- /* @__PURE__ */ m("div", { className: "flex items-center", role: "presentation", children: [
137
- /* @__PURE__ */ m(
138
- "button",
139
- {
140
- type: "button",
141
- onClick: k,
142
- className: y(j({ button: "rigth" })),
143
- children: [
144
- /* @__PURE__ */ c(g, { className: "w-4 h-4" }),
145
- /* @__PURE__ */ c(O, { children: "Decrement" })
146
- ]
147
- }
148
- ),
149
- /* @__PURE__ */ c(
150
- "input",
151
- {
152
- ref: x,
153
- type: "number",
154
- value: a,
155
- name: n,
156
- className: y(_({ className: e })),
157
- readOnly: !0,
158
- "aria-label": typeof o == "string" ? o : "number input"
159
- }
160
- ),
161
- /* @__PURE__ */ m(
162
- "button",
163
- {
164
- type: "button",
165
- onClick: I,
166
- className: y(j({ button: "left" })),
167
- children: [
168
- /* @__PURE__ */ c(d, { className: "w-4 h-4" }),
169
- /* @__PURE__ */ c(O, { children: "Increment" })
170
- ]
171
- }
172
- )
173
- ] })
174
- ] });
175
- }
176
- );
177
- export {
178
- D as NumberInput
179
- };
@@ -1,50 +0,0 @@
1
- import { c as e } from "../../index-D29mdTf5.js";
2
- const r = 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-200"
16
- ]), n = e(
17
- [
18
- "h-9",
19
- "w-9",
20
- "flex",
21
- "items-center",
22
- "justify-center",
23
- "border",
24
- "text-slate-400",
25
- "border-gray-200",
26
- "cursor-pointer"
27
- ],
28
- {
29
- variants: {
30
- button: {
31
- left: ["rounded-e"],
32
- rigth: ["rounded-s"]
33
- }
34
- }
35
- }
36
- ), a = e(["cursor-pointer"], {
37
- variants: {
38
- variant: {
39
- default: ""
40
- }
41
- },
42
- defaultVariants: {
43
- variant: "default"
44
- }
45
- });
46
- export {
47
- n as buttonVariants,
48
- a as labelVariants,
49
- r as numberInputVariants
50
- };