@konstructio/ui 0.1.2-alpha.55 → 0.1.2-alpha.56

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 (56) hide show
  1. package/dist/assets/icons/components/BookOpen.d.ts +3 -0
  2. package/dist/assets/icons/components/BookOpen.js +32 -0
  3. package/dist/assets/icons/components/DollarSign.d.ts +3 -0
  4. package/dist/assets/icons/components/DollarSign.js +30 -0
  5. package/dist/assets/icons/components/LightBulb.d.ts +3 -0
  6. package/dist/assets/icons/components/LightBulb.js +43 -0
  7. package/dist/assets/icons/components/index.d.ts +3 -0
  8. package/dist/assets/icons/components/index.js +114 -108
  9. package/dist/assets/icons/index.js +114 -108
  10. package/dist/components/Autocomplete/Autocomplete.js +41 -40
  11. package/dist/components/Autocomplete/Autocomplete.types.d.ts +2 -0
  12. package/dist/components/ButtonGroup/ButtonGroup.js +97 -79
  13. package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +2 -0
  14. package/dist/components/ButtonGroup/ButtonGroup.variants.d.ts +5 -4
  15. package/dist/components/ButtonGroup/ButtonGroup.variants.js +33 -25
  16. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +95 -246
  17. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.types.d.ts +0 -2
  18. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.d.ts +0 -4
  19. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +9 -13
  20. package/dist/components/Checkbox/Checkbox.js +152 -144
  21. package/dist/components/Checkbox/Checkbox.types.d.ts +2 -0
  22. package/dist/components/Counter/Counter.js +43 -42
  23. package/dist/components/Counter/Counter.types.d.ts +2 -0
  24. package/dist/components/DateRangePicker/DateRangePicker.js +94 -93
  25. package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +2 -0
  26. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
  27. package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
  28. package/dist/components/ImageUpload/ImageUpload.d.ts +1 -1
  29. package/dist/components/ImageUpload/ImageUpload.js +51 -50
  30. package/dist/components/ImageUpload/ImageUpload.types.d.ts +2 -0
  31. package/dist/components/Input/Input.js +72 -58
  32. package/dist/components/Input/Input.types.d.ts +4 -0
  33. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +2 -0
  34. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +40 -39
  35. package/dist/components/PhoneNumberInput/PhoneNumberInput.types.d.ts +2 -0
  36. package/dist/components/PhoneNumberInput/components/Wrapper.js +164 -163
  37. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +172 -116
  38. package/dist/components/Range/Range.js +26 -24
  39. package/dist/components/Range/Range.types.d.ts +2 -0
  40. package/dist/components/Select/Select.types.d.ts +1 -0
  41. package/dist/components/Select/Select.variants.js +2 -1
  42. package/dist/components/Select/components/Wrapper.js +74 -73
  43. package/dist/components/Slider/Slider.js +30 -20
  44. package/dist/components/Slider/Slider.types.d.ts +2 -0
  45. package/dist/components/Switch/Switch.js +89 -87
  46. package/dist/components/Switch/Switch.types.d.ts +2 -0
  47. package/dist/components/TagSelect/TagSelect.types.d.ts +2 -0
  48. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +47 -46
  49. package/dist/components/TextArea/TextArea.js +27 -26
  50. package/dist/components/TextArea/TextArea.types.d.ts +2 -0
  51. package/dist/icons.d.ts +1 -1
  52. package/dist/icons.js +114 -108
  53. package/dist/package.json +17 -17
  54. package/dist/{proxy-i19-YB39.js → proxy-BhEKW5n7.js} +1903 -1757
  55. package/dist/styles.css +1 -1
  56. package/package.json +17 -17
@@ -1,10 +1,10 @@
1
- import { jsxs as h, jsx as s } from "react/jsx-runtime";
2
- import p, { forwardRef as y, useId as _, useRef as L, useState as W } from "react";
1
+ import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
+ import p, { forwardRef as y, useId as W, useRef as $, useState as T } from "react";
3
3
  import { cn as i } from "../../utils/index.js";
4
- import { inputVariants as $ } from "./Input.variants.js";
5
- import { Typography as u } from "../Typography/Typography.js";
6
- import { SearchIcon as T } from "../../assets/icons/components/Search.js";
7
- import { WarningIcon as S } from "../../assets/icons/components/Warning.js";
4
+ import { inputVariants as S } from "./Input.variants.js";
5
+ import { Typography as d } from "../Typography/Typography.js";
6
+ import { SearchIcon as C } from "../../assets/icons/components/Search.js";
7
+ import { WarningIcon as M } from "../../assets/icons/components/Warning.js";
8
8
  import { P as l } from "../../index-BOE_3f_Z.js";
9
9
  function g() {
10
10
  return g = Object.assign || function(t) {
@@ -16,9 +16,9 @@ function g() {
16
16
  return t;
17
17
  }, g.apply(this, arguments);
18
18
  }
19
- function C(t, r) {
19
+ function R(t, r) {
20
20
  if (t == null) return {};
21
- var n = M(t, r), e, o;
21
+ var n = A(t, r), e, o;
22
22
  if (Object.getOwnPropertySymbols) {
23
23
  var a = Object.getOwnPropertySymbols(t);
24
24
  for (o = 0; o < a.length; o++)
@@ -26,7 +26,7 @@ function C(t, r) {
26
26
  }
27
27
  return n;
28
28
  }
29
- function M(t, r) {
29
+ function A(t, r) {
30
30
  if (t == null) return {};
31
31
  var n = {}, e = Object.keys(t), o, a;
32
32
  for (a = 0; a < e.length; a++)
@@ -34,7 +34,7 @@ function M(t, r) {
34
34
  return n;
35
35
  }
36
36
  var x = y(function(t, r) {
37
- var n = t.color, e = n === void 0 ? "currentColor" : n, o = t.size, a = o === void 0 ? 24 : o, c = C(t, ["color", "size"]);
37
+ var n = t.color, e = n === void 0 ? "currentColor" : n, o = t.size, a = o === void 0 ? 24 : o, c = R(t, ["color", "size"]);
38
38
  return /* @__PURE__ */ p.createElement("svg", g({
39
39
  ref: r,
40
40
  xmlns: "http://www.w3.org/2000/svg",
@@ -70,9 +70,9 @@ function v() {
70
70
  return t;
71
71
  }, v.apply(this, arguments);
72
72
  }
73
- function R(t, r) {
73
+ function B(t, r) {
74
74
  if (t == null) return {};
75
- var n = A(t, r), e, o;
75
+ var n = D(t, r), e, o;
76
76
  if (Object.getOwnPropertySymbols) {
77
77
  var a = Object.getOwnPropertySymbols(t);
78
78
  for (o = 0; o < a.length; o++)
@@ -80,7 +80,7 @@ function R(t, r) {
80
80
  }
81
81
  return n;
82
82
  }
83
- function A(t, r) {
83
+ function D(t, r) {
84
84
  if (t == null) return {};
85
85
  var n = {}, e = Object.keys(t), o, a;
86
86
  for (a = 0; a < e.length; a++)
@@ -88,7 +88,7 @@ function A(t, r) {
88
88
  return n;
89
89
  }
90
90
  var w = y(function(t, r) {
91
- var n = t.color, e = n === void 0 ? "currentColor" : n, o = t.size, a = o === void 0 ? 24 : o, c = R(t, ["color", "size"]);
91
+ var n = t.color, e = n === void 0 ? "currentColor" : n, o = t.size, a = o === void 0 ? 24 : o, c = B(t, ["color", "size"]);
92
92
  return /* @__PURE__ */ p.createElement("svg", v({
93
93
  ref: r,
94
94
  xmlns: "http://www.w3.org/2000/svg",
@@ -113,7 +113,7 @@ w.propTypes = {
113
113
  size: l.oneOfType([l.string, l.number])
114
114
  };
115
115
  w.displayName = "Eye";
116
- const B = y(
116
+ const F = y(
117
117
  ({
118
118
  className: t,
119
119
  error: r,
@@ -122,48 +122,62 @@ const B = y(
122
122
  isRequired: o = !1,
123
123
  isSearch: a = !1,
124
124
  label: c,
125
- labelClassName: O,
126
- name: j,
127
- theme: k,
125
+ labelAction: O,
126
+ labelClassName: j,
127
+ labelWrapperClassName: k,
128
+ name: N,
129
+ theme: P,
128
130
  type: f = "text",
129
- ...N
130
- }, P) => {
131
- const b = _(), E = L(f === "password"), [d, z] = W(() => f !== "password"), m = typeof r == "string" && r.length >= 0, I = d ? w : x;
132
- return /* @__PURE__ */ h("div", { className: "flex flex-col gap-2 w-full relative", "data-theme": k, children: [
133
- c ? /* @__PURE__ */ h(
134
- u,
131
+ ...E
132
+ }, z) => {
133
+ const b = W(), I = $(f === "password"), [h, _] = T(() => f !== "password"), m = typeof r == "string" && r.length >= 0, L = h ? w : x;
134
+ return /* @__PURE__ */ u("div", { className: "flex flex-col gap-2 w-full relative", "data-theme": P, children: [
135
+ c ? /* @__PURE__ */ u(
136
+ "div",
135
137
  {
136
- component: "label",
137
- variant: "labelLarge",
138
- htmlFor: b,
139
138
  className: i(
140
- "cursor-pointer",
141
- "flex",
142
- "gap-1",
143
- "text-sm",
144
- "font-medium",
145
- O
139
+ "flex items-center justify-between",
140
+ k
146
141
  ),
147
142
  children: [
148
- c,
149
- " ",
150
- o && /* @__PURE__ */ s(
151
- u,
143
+ /* @__PURE__ */ u(
144
+ d,
152
145
  {
153
- component: "span",
146
+ component: "label",
147
+ variant: "labelLarge",
148
+ htmlFor: b,
154
149
  className: i(
155
- "text-red-600",
156
- "dark:text-red-500",
157
- "text-xs",
158
- "mt-0.5"
150
+ "cursor-pointer",
151
+ "flex",
152
+ "gap-1",
153
+ "text-sm",
154
+ "font-medium",
155
+ j
159
156
  ),
160
- children: "*"
157
+ children: [
158
+ c,
159
+ " ",
160
+ o && /* @__PURE__ */ s(
161
+ d,
162
+ {
163
+ component: "span",
164
+ className: i(
165
+ "text-red-600",
166
+ "dark:text-red-500",
167
+ "text-xs",
168
+ "mt-0.5"
169
+ ),
170
+ children: "*"
171
+ }
172
+ )
173
+ ]
161
174
  }
162
- )
175
+ ),
176
+ O
163
177
  ]
164
178
  }
165
179
  ) : null,
166
- /* @__PURE__ */ h("div", { className: "relative", children: [
180
+ /* @__PURE__ */ u("div", { className: "relative", children: [
167
181
  a ? /* @__PURE__ */ s(
168
182
  "i",
169
183
  {
@@ -178,19 +192,19 @@ const B = y(
178
192
  "text-red-700": m
179
193
  }
180
194
  ),
181
- children: /* @__PURE__ */ s(T, { className: "w-5 h-5" })
195
+ children: /* @__PURE__ */ s(C, { className: "w-5 h-5" })
182
196
  }
183
197
  ) : null,
184
198
  /* @__PURE__ */ s(
185
199
  "input",
186
200
  {
187
201
  id: c ? b : void 0,
188
- ref: P,
189
- name: j,
190
- type: d ? E.current ? "text" : f : "password",
202
+ ref: z,
203
+ name: N,
204
+ type: h ? I.current ? "text" : f : "password",
191
205
  "data-error": m,
192
206
  className: i(
193
- $({
207
+ S({
194
208
  className: t,
195
209
  variant: m ? "error" : "default"
196
210
  }),
@@ -199,7 +213,7 @@ const B = y(
199
213
  "pl-8": a
200
214
  }
201
215
  ),
202
- ...N
216
+ ...E
203
217
  }
204
218
  ),
205
219
  m ? /* @__PURE__ */ s(
@@ -213,7 +227,7 @@ const B = y(
213
227
  "top-1/2",
214
228
  "dark:text-red-500"
215
229
  ),
216
- children: /* @__PURE__ */ s(S, { className: "w-5 h-5" })
230
+ children: /* @__PURE__ */ s(M, { className: "w-5 h-5" })
217
231
  }
218
232
  ) : null,
219
233
  f === "password" && !r ? /* @__PURE__ */ s(
@@ -227,17 +241,17 @@ const B = y(
227
241
  "top-1/2"
228
242
  ),
229
243
  children: /* @__PURE__ */ s(
230
- I,
244
+ L,
231
245
  {
232
246
  className: "w-5 h-5 cursor-pointer",
233
- onClick: () => z(!d)
247
+ onClick: () => _(!h)
234
248
  }
235
249
  )
236
250
  }
237
251
  ) : null
238
252
  ] }),
239
253
  r ? /* @__PURE__ */ s(
240
- u,
254
+ d,
241
255
  {
242
256
  component: "span",
243
257
  className: i(
@@ -250,7 +264,7 @@ const B = y(
250
264
  }
251
265
  ) : null,
252
266
  !r && n ? /* @__PURE__ */ s(
253
- u,
267
+ d,
254
268
  {
255
269
  component: "span",
256
270
  variant: "body1",
@@ -268,7 +282,7 @@ const B = y(
268
282
  ] });
269
283
  }
270
284
  );
271
- B.displayName = "KonstructInput";
285
+ F.displayName = "KonstructInput";
272
286
  export {
273
- B as Input
287
+ F as Input
274
288
  };
@@ -25,8 +25,12 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement>, Varia
25
25
  isSearch?: boolean;
26
26
  /** Label text or element displayed above the input */
27
27
  label?: string | ReactNode;
28
+ /** Custom element rendered on the right side of the label (e.g. icon, button) */
29
+ labelAction?: ReactNode;
28
30
  /** Additional CSS classes for the label */
29
31
  labelClassName?: string;
32
+ /** Additional CSS classes for the label wrapper container */
33
+ labelWrapperClassName?: string;
30
34
  /** Theme override for this component */
31
35
  theme?: Theme;
32
36
  }
@@ -52,6 +52,8 @@ export interface MultiSelectDropdownProps extends VariantProps<typeof multiSelec
52
52
  label?: string;
53
53
  /** Additional CSS classes for the label */
54
54
  labelClassName?: string;
55
+ /** Additional CSS classes for the label wrapper */
56
+ labelWrapperClassName?: string;
55
57
  /** Whether multiple options can be selected */
56
58
  multiselect?: boolean;
57
59
  /** Form field name */
@@ -1,59 +1,60 @@
1
1
  import "../Item/Item.js";
2
- import { List as k } from "../List/List.js";
3
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
4
- import { forwardRef as O, useId as C, useImperativeHandle as D } from "react";
5
- import { Badge as S } from "../../../Badge/Badge.js";
2
+ import { List as O } from "../List/List.js";
3
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
4
+ import { forwardRef as C, useId as D, useImperativeHandle as S } from "react";
5
+ import { Badge as I } from "../../../Badge/Badge.js";
6
6
  import { Typography as p } from "../../../Typography/Typography.js";
7
7
  import { cn as a } from "../../../../utils/index.js";
8
- import { useMultiSelectDropdown as I } from "../../hooks/useMultiSelectDropdown.js";
9
- import { labelVariants as L, multiSelectDropdownVariants as M, wrapperVariants as R } from "../../MultiSelectDropdown.variants.js";
10
- import { X as V } from "../../../../x-B9bYxG31.js";
11
- import { LoaderIcon as j } from "../../../../assets/icons/components/Loader.js";
12
- import { C as W } from "../../../../chevron-up-DEfvgPCw.js";
13
- import { useMultiSelectDropdown as $ } from "../../contexts/MultiSelectDropdown.hook.js";
14
- const z = O(
8
+ import { useMultiSelectDropdown as L } from "../../hooks/useMultiSelectDropdown.js";
9
+ import { labelVariants as M, multiSelectDropdownVariants as R, wrapperVariants as V } from "../../MultiSelectDropdown.variants.js";
10
+ import { X as j } from "../../../../x-B9bYxG31.js";
11
+ import { LoaderIcon as W } from "../../../../assets/icons/components/Loader.js";
12
+ import { C as $ } from "../../../../chevron-up-DEfvgPCw.js";
13
+ import { useMultiSelectDropdown as z } from "../../contexts/MultiSelectDropdown.hook.js";
14
+ const B = C(
15
15
  ({
16
16
  isRequired: c,
17
- label: l,
17
+ label: n,
18
18
  labelClassName: d,
19
+ labelWrapperClassName: f,
19
20
  name: s,
20
- placeholder: f = "",
21
- theme: u,
22
- wrapperClassName: h
23
- }, x) => {
24
- const N = C(), i = s ? `${N}-name` : "id", {
21
+ placeholder: u = "",
22
+ theme: h,
23
+ wrapperClassName: x
24
+ }, N) => {
25
+ const v = D(), i = s ? `${v}-name` : "id", {
25
26
  inputRef: t,
26
27
  isLoading: w,
27
28
  isOpen: o,
28
29
  selectedOptions: m,
29
30
  onOpen: g,
30
- onRemoveOption: v
31
- } = $(), { wrapperRef: b, handleOpen: y } = I();
32
- return D(x, () => t.current, [t]), /* @__PURE__ */ n(
31
+ onRemoveOption: b
32
+ } = z(), { wrapperRef: y, handleOpen: k } = L();
33
+ return S(N, () => t.current, [t]), /* @__PURE__ */ l(
33
34
  "div",
34
35
  {
35
- ref: b,
36
+ ref: y,
36
37
  className: a(
37
- R({
38
- className: h
38
+ V({
39
+ className: x
39
40
  })
40
41
  ),
41
- "data-theme": u,
42
+ "data-theme": h,
42
43
  children: [
43
- l ? /* @__PURE__ */ n(
44
+ n ? /* @__PURE__ */ e("div", { className: a(f), children: /* @__PURE__ */ l(
44
45
  p,
45
46
  {
46
47
  component: "label",
47
48
  variant: "labelLarge",
48
49
  htmlFor: i,
49
50
  className: a(
50
- L({
51
+ M({
51
52
  className: d
52
53
  })
53
54
  ),
54
55
  onClick: () => g(!0),
55
56
  children: [
56
- l,
57
+ n,
57
58
  " ",
58
59
  c && /* @__PURE__ */ e(
59
60
  p,
@@ -65,34 +66,34 @@ const z = O(
65
66
  )
66
67
  ]
67
68
  }
68
- ) : null,
69
- /* @__PURE__ */ n(
69
+ ) }) : null,
70
+ /* @__PURE__ */ l(
70
71
  "div",
71
72
  {
72
73
  id: i,
73
- className: a(M()),
74
+ className: a(R()),
74
75
  role: "combobox",
75
- onClick: y,
76
+ onClick: k,
76
77
  "aria-expanded": o,
77
78
  children: [
78
- m.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: f }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: m.map((r) => /* @__PURE__ */ e(
79
- S,
79
+ m.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: u }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: m.map((r) => /* @__PURE__ */ e(
80
+ I,
80
81
  {
81
82
  "data-value": r.label,
82
83
  label: r.value ?? r.label ?? "",
83
84
  className: "select-none",
84
- rightIcon: /* @__PURE__ */ e(V, { onClick: () => v(r) })
85
+ rightIcon: /* @__PURE__ */ e(j, { onClick: () => b(r) })
85
86
  },
86
87
  r.id
87
88
  )) }),
88
89
  w ? /* @__PURE__ */ e(
89
- j,
90
+ W,
90
91
  {
91
92
  size: 16,
92
93
  className: "animate-spin shrink-0 text-gray-400"
93
94
  }
94
95
  ) : /* @__PURE__ */ e(
95
- W,
96
+ $,
96
97
  {
97
98
  className: a(
98
99
  "w-4 h-4 transition-all duration-50 shrink-0 text-gray-400",
@@ -113,13 +114,13 @@ const z = O(
113
114
  readOnly: !0
114
115
  }
115
116
  ),
116
- o ? /* @__PURE__ */ e(k, {}) : null
117
+ o ? /* @__PURE__ */ e(O, {}) : null
117
118
  ]
118
119
  }
119
120
  );
120
121
  }
121
122
  );
122
- z.displayName = "MultiSelectDropdownWrapper";
123
+ B.displayName = "MultiSelectDropdownWrapper";
123
124
  export {
124
- z as Wrapper
125
+ B as Wrapper
125
126
  };
@@ -32,6 +32,8 @@ export type Props = InputHTMLAttributes<HTMLInputElement> & {
32
32
  label?: string;
33
33
  /** Additional CSS classes for the label */
34
34
  labelClassName?: string;
35
+ /** Additional CSS classes for the label wrapper */
36
+ labelWrapperClassName?: string;
35
37
  /** Form field name */
36
38
  name?: string;
37
39
  /** Placeholder text for the input */