@konstructio/ui 0.0.12-alpha.2 → 0.0.12-alpha.21

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 (93) hide show
  1. package/dist/{Modal-DZUwNzSW.js → Modal-B-E9uaA6.js} +354 -346
  2. package/dist/components/Alert/Alert.js +1 -1
  3. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  4. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  5. package/dist/components/AlertDialog/components/index.js +1 -1
  6. package/dist/components/Autocomplete/Autocomplete.variants.js +0 -1
  7. package/dist/components/Breadcrumb/Breadcrumb.variants.js +18 -15
  8. package/dist/components/Checkbox/Checkbox.js +1 -1
  9. package/dist/components/Command/Command.js +32 -0
  10. package/dist/components/Command/Command.variants.js +97 -0
  11. package/dist/components/Command/components/Command.js +8 -0
  12. package/dist/components/Command/components/CommandEmpty.js +15 -0
  13. package/dist/components/Command/components/CommandGroup.js +19 -0
  14. package/dist/components/Command/components/CommandInput.js +84 -0
  15. package/dist/components/Command/components/CommandItem.js +29 -0
  16. package/dist/components/Command/components/CommandList.js +16 -0
  17. package/dist/components/Command/components/CommandSeparator.js +16 -0
  18. package/dist/components/Command/components/CommandShortcut.js +19 -0
  19. package/dist/components/Command/components/DialogContent.js +31 -0
  20. package/dist/components/Command/components/DialogOverlay.js +19 -0
  21. package/dist/components/Command/components/index.js +20 -0
  22. package/dist/components/Command/contexts/Command.context.js +13 -0
  23. package/dist/components/Command/contexts/Command.provider.js +24 -0
  24. package/dist/components/Command/contexts/index.js +6 -0
  25. package/dist/components/Dropdown/Dropdown.js +6 -6
  26. package/dist/components/Dropdown/Dropdown.variants.js +22 -3
  27. package/dist/components/Dropdown/components/List/List.js +42 -16
  28. package/dist/components/Dropdown/components/List/List.variants.js +7 -5
  29. package/dist/components/Dropdown/components/ListItem/ListItem.js +26 -21
  30. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +6 -4
  31. package/dist/components/Dropdown/components/Wrapper.js +97 -63
  32. package/dist/components/Dropdown/contexts/dropdown.context.js +1 -1
  33. package/dist/components/Dropdown/contexts/dropdown.provider.js +9 -9
  34. package/dist/components/Input/Input.js +112 -67
  35. package/dist/components/Input/Input.variants.js +5 -6
  36. package/dist/components/Loading/Loading.js +102 -21
  37. package/dist/components/Loading/Loading.variants.js +13 -14
  38. package/dist/components/Modal/Modal.js +3 -3
  39. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -4
  40. package/dist/components/Modal/components/index.js +1 -1
  41. package/dist/components/NumberInput/NumberInput.js +88 -88
  42. package/dist/components/NumberInput/NumberInput.variants.js +23 -19
  43. package/dist/components/Range/Range.js +1 -1
  44. package/dist/components/Sidebar/Sidebar.variants.js +2 -1
  45. package/dist/components/Sidebar/components/Logo/Logo.variants.js +9 -17
  46. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +2 -2
  47. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +6 -5
  48. package/dist/components/Slider/Slider.js +1 -1
  49. package/dist/components/Switch/Switch.js +99 -101
  50. package/dist/components/Switch/Switch.variants.js +4 -4
  51. package/dist/components/Table/Table.js +31 -0
  52. package/dist/components/Table/Table.variants.js +78 -0
  53. package/dist/components/Table/components/Body.js +28 -0
  54. package/dist/components/Table/components/Filter.js +9 -0
  55. package/dist/components/Table/components/Head.js +28 -0
  56. package/dist/components/Table/components/Row.js +34 -0
  57. package/dist/components/Tag/Tag.js +17 -5
  58. package/dist/components/Tag/Tag.variants.js +11 -1
  59. package/dist/components/TagSelect/TagSelect.js +6 -71
  60. package/dist/components/TagSelect/TagSelect.variants.js +29 -50
  61. package/dist/components/TagSelect/components/Item/Item.js +23 -0
  62. package/dist/components/TagSelect/components/Item/Item.variants.js +31 -0
  63. package/dist/components/TagSelect/components/List/List.js +13 -0
  64. package/dist/components/TagSelect/components/List/List.variants.js +37 -0
  65. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +88 -0
  66. package/dist/components/TagSelect/components/index.js +8 -0
  67. package/dist/components/TagSelect/contexts/TagSelect.context.js +19 -0
  68. package/dist/components/TagSelect/contexts/TagSelect.hook.js +11 -0
  69. package/dist/components/TagSelect/contexts/TagSelect.provider.js +69 -0
  70. package/dist/components/TagSelect/contexts/index.js +6 -0
  71. package/dist/components/TagSelect/hooks/useTagSelect.js +22 -27
  72. package/dist/components/TextArea/TextArea.js +28 -22
  73. package/dist/components/TextArea/TextArea.variants.js +0 -1
  74. package/dist/components/Toast/Toast.js +141 -128
  75. package/dist/components/Toast/Toast.variants.js +2 -3
  76. package/dist/components/Typography/Typography.js +23 -22
  77. package/dist/components/Typography/Typography.variants.js +49 -22
  78. package/dist/components/index.js +22 -20
  79. package/dist/{index-C6WtlN_F.js → index-BzaHYXkt.js} +1 -1
  80. package/dist/{index-Z1voPZOH.js → index-CbTU3cnP.js} +1 -1
  81. package/dist/index-CzSBQN5S.js +432 -0
  82. package/dist/index-D7QNmo_D.js +422 -0
  83. package/dist/index-DUA6Y_AE.js +126 -0
  84. package/dist/{index-B33at13_.js → index-D_76wh4w.js} +1 -1
  85. package/dist/index-DyKo5ZJT.js +446 -0
  86. package/dist/index.d.ts +85 -17
  87. package/dist/index.js +18 -16
  88. package/dist/package.json +26 -24
  89. package/dist/styles.css +1 -1
  90. package/dist/utils/index.js +320 -322
  91. package/package.json +26 -24
  92. package/dist/index-3jTPaVvh.js +0 -551
  93. package/dist/index-BTeAm7mx.js +0 -19133
@@ -1,103 +1,103 @@
1
- import { jsxs as P, jsx as u } from "react/jsx-runtime";
2
- import * as p from "react";
3
- import { forwardRef as _, useState as H, useRef as A, useId as M, useImperativeHandle as $, useEffect as j, useCallback as z } from "react";
4
- import { a as B, c as q, b as F } from "../../index-Cva-e5M4.js";
5
- import { u as O } from "../../index-B_6_jmOO.js";
6
- import { u as V, a as D } from "../../index-4ecjw_Aj.js";
7
- import { P as g } from "../../index-BTeAm7mx.js";
1
+ import { jsxs as P, jsx as i } from "react/jsx-runtime";
2
+ import * as h from "react";
3
+ import { forwardRef as _, useRef as H, useId as M, useImperativeHandle as $, useEffect as j } from "react";
4
+ import { a as z, c as B, b as q } from "../../index-Cva-e5M4.js";
5
+ import { u as A } from "../../index-B_6_jmOO.js";
6
+ import { u as F, a as O } from "../../index-4ecjw_Aj.js";
7
+ import { P as R } from "../../index-D7QNmo_D.js";
8
8
  import { cn as x } from "../../utils/index.js";
9
- import { thumbVariants as L, switchVariants as U } from "./Switch.variants.js";
10
- import { useTheme as W } from "../../contexts/theme.hook.js";
11
- var k = "Switch", [X, ie] = q(k), [G, J] = X(k), R = p.forwardRef(
12
- (e, s) => {
9
+ import { thumbVariants as V, switchVariants as D } from "./Switch.variants.js";
10
+ import { useTheme as L } from "../../contexts/theme.hook.js";
11
+ var S = "Switch", [U, ae] = B(S), [W, X] = U(S), y = h.forwardRef(
12
+ (e, d) => {
13
13
  const {
14
14
  __scopeSwitch: t,
15
- name: c,
16
- checked: n,
17
- defaultChecked: h,
18
- required: o,
19
- disabled: a,
20
- value: i = "on",
15
+ name: s,
16
+ checked: a,
17
+ defaultChecked: n,
18
+ required: u,
19
+ disabled: r,
20
+ value: o = "on",
21
21
  onCheckedChange: m,
22
- form: r,
22
+ form: c,
23
23
  ...l
24
- } = e, [d, b] = p.useState(null), v = O(s, (C) => b(C)), f = p.useRef(!1), w = d ? r || !!d.closest("form") : !0, [S = !1, T] = B({
25
- prop: n,
26
- defaultProp: h,
24
+ } = e, [p, b] = h.useState(null), w = A(d, (k) => b(k)), f = h.useRef(!1), C = p ? c || !!p.closest("form") : !0, [v = !1, g] = z({
25
+ prop: a,
26
+ defaultProp: n,
27
27
  onChange: m
28
28
  });
29
- return /* @__PURE__ */ P(G, { scope: t, checked: S, disabled: a, children: [
30
- /* @__PURE__ */ u(
31
- g.button,
29
+ return /* @__PURE__ */ P(W, { scope: t, checked: v, disabled: r, children: [
30
+ /* @__PURE__ */ i(
31
+ R.button,
32
32
  {
33
33
  type: "button",
34
34
  role: "switch",
35
- "aria-checked": S,
36
- "aria-required": o,
37
- "data-state": E(S),
38
- "data-disabled": a ? "" : void 0,
39
- disabled: a,
40
- value: i,
35
+ "aria-checked": v,
36
+ "aria-required": u,
37
+ "data-state": T(v),
38
+ "data-disabled": r ? "" : void 0,
39
+ disabled: r,
40
+ value: o,
41
41
  ...l,
42
- ref: v,
43
- onClick: F(e.onClick, (C) => {
44
- T((I) => !I), w && (f.current = C.isPropagationStopped(), f.current || C.stopPropagation());
42
+ ref: w,
43
+ onClick: q(e.onClick, (k) => {
44
+ g((I) => !I), C && (f.current = k.isPropagationStopped(), f.current || k.stopPropagation());
45
45
  })
46
46
  }
47
47
  ),
48
- w && /* @__PURE__ */ u(
49
- K,
48
+ C && /* @__PURE__ */ i(
49
+ G,
50
50
  {
51
- control: d,
51
+ control: p,
52
52
  bubbles: !f.current,
53
- name: c,
54
- value: i,
55
- checked: S,
56
- required: o,
57
- disabled: a,
58
- form: r,
53
+ name: s,
54
+ value: o,
55
+ checked: v,
56
+ required: u,
57
+ disabled: r,
58
+ form: c,
59
59
  style: { transform: "translateX(-100%)" }
60
60
  }
61
61
  )
62
62
  ] });
63
63
  }
64
64
  );
65
- R.displayName = k;
66
- var y = "SwitchThumb", N = p.forwardRef(
67
- (e, s) => {
68
- const { __scopeSwitch: t, ...c } = e, n = J(y, t);
69
- return /* @__PURE__ */ u(
70
- g.span,
65
+ y.displayName = S;
66
+ var N = "SwitchThumb", E = h.forwardRef(
67
+ (e, d) => {
68
+ const { __scopeSwitch: t, ...s } = e, a = X(N, t);
69
+ return /* @__PURE__ */ i(
70
+ R.span,
71
71
  {
72
- "data-state": E(n.checked),
73
- "data-disabled": n.disabled ? "" : void 0,
74
- ...c,
75
- ref: s
72
+ "data-state": T(a.checked),
73
+ "data-disabled": a.disabled ? "" : void 0,
74
+ ...s,
75
+ ref: d
76
76
  }
77
77
  );
78
78
  }
79
79
  );
80
- N.displayName = y;
81
- var K = (e) => {
82
- const { control: s, checked: t, bubbles: c = !0, ...n } = e, h = p.useRef(null), o = V(t), a = D(s);
83
- return p.useEffect(() => {
84
- const i = h.current, m = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(m, "checked").set;
85
- if (o !== t && l) {
86
- const d = new Event("click", { bubbles: c });
87
- l.call(i, t), i.dispatchEvent(d);
80
+ E.displayName = N;
81
+ var G = (e) => {
82
+ const { control: d, checked: t, bubbles: s = !0, ...a } = e, n = h.useRef(null), u = F(t), r = O(d);
83
+ return h.useEffect(() => {
84
+ const o = n.current, m = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(m, "checked").set;
85
+ if (u !== t && l) {
86
+ const p = new Event("click", { bubbles: s });
87
+ l.call(o, t), o.dispatchEvent(p);
88
88
  }
89
- }, [o, t, c]), /* @__PURE__ */ u(
89
+ }, [u, t, s]), /* @__PURE__ */ i(
90
90
  "input",
91
91
  {
92
92
  type: "checkbox",
93
93
  "aria-hidden": !0,
94
94
  defaultChecked: t,
95
- ...n,
95
+ ...a,
96
96
  tabIndex: -1,
97
- ref: h,
97
+ ref: n,
98
98
  style: {
99
99
  ...e.style,
100
- ...a,
100
+ ...r,
101
101
  position: "absolute",
102
102
  pointerEvents: "none",
103
103
  opacity: 0,
@@ -106,68 +106,66 @@ var K = (e) => {
106
106
  }
107
107
  );
108
108
  };
109
- function E(e) {
109
+ function T(e) {
110
110
  return e ? "checked" : "unchecked";
111
111
  }
112
- var Q = R, Y = N;
113
- const ue = _(
112
+ var J = y, K = E;
113
+ const ne = _(
114
114
  ({
115
115
  name: e,
116
- defaultChecked: s,
117
- alignment: t = "horizontal",
118
- theme: c,
119
- thumbClassName: n,
120
- className: h,
121
- label: o
122
- }, a) => {
123
- const [i, m] = H(s ?? !1), r = A(null), l = M(), { theme: d } = W(), b = c ?? d, v = e ? `${l}-${e}` : l;
124
- $(a, () => r.current, [r]), j(() => {
125
- r.current && (r.current.value = `${i}`);
126
- }, [i]);
127
- const f = z(
128
- (w) => m(w),
129
- []
130
- );
131
- return /* @__PURE__ */ P(
116
+ alignment: d = "horizontal",
117
+ theme: t,
118
+ thumbClassName: s,
119
+ className: a,
120
+ label: n,
121
+ defaultChecked: u,
122
+ onChange: r,
123
+ value: o
124
+ }, m) => {
125
+ const c = H(null), l = M(), { theme: p } = L(), b = t ?? p, w = e ? `${l}-${e}` : l;
126
+ return $(m, () => c.current, [c]), j(() => {
127
+ c.current && (c.current.value = `${o}`);
128
+ }, [o]), /* @__PURE__ */ P(
132
129
  "div",
133
130
  {
134
131
  className: x(
135
132
  "w-full flex gap-3",
136
- t === "vertical" ? "flex-col" : "flex-row"
133
+ d === "vertical" ? "flex-col" : "flex-row"
137
134
  ),
138
135
  children: [
139
- o ? /* @__PURE__ */ u(
136
+ n ? /* @__PURE__ */ i(
140
137
  "label",
141
138
  {
142
139
  className: "text-base",
143
- htmlFor: v,
140
+ htmlFor: w,
144
141
  style: { paddingRight: 15 },
145
- children: o
142
+ children: n
146
143
  }
147
144
  ) : null,
148
- /* @__PURE__ */ u(
149
- Q,
145
+ /* @__PURE__ */ i(
146
+ J,
150
147
  {
151
- id: v,
152
- defaultChecked: s,
153
- onCheckedChange: f,
154
- className: x(U({ theme: b, className: h })),
155
- "aria-label": o,
156
- children: /* @__PURE__ */ u(
157
- Y,
148
+ id: w,
149
+ defaultChecked: u,
150
+ checked: o,
151
+ onCheckedChange: (f) => r == null ? void 0 : r(f),
152
+ className: x(D({ theme: b, className: a })),
153
+ "aria-label": n,
154
+ children: /* @__PURE__ */ i(
155
+ K,
158
156
  {
159
- className: L({
157
+ className: V({
160
158
  theme: b,
161
- className: n
159
+ className: s
162
160
  })
163
161
  }
164
162
  )
165
163
  }
166
164
  ),
167
- /* @__PURE__ */ u(
165
+ /* @__PURE__ */ i(
168
166
  "input",
169
167
  {
170
- ref: r,
168
+ ref: c,
171
169
  name: e,
172
170
  type: "text",
173
171
  className: "hidden",
@@ -180,5 +178,5 @@ const ue = _(
180
178
  }
181
179
  );
182
180
  export {
183
- ue as Switch
181
+ ne as Switch
184
182
  };
@@ -1,8 +1,8 @@
1
1
  import { c as t } from "../../index-BNmRGtA6.js";
2
2
  const e = t(
3
3
  [
4
- "w-12",
5
- "h-7",
4
+ "w-[44px]",
5
+ "h-[22px]",
6
6
  "flex",
7
7
  "items-center",
8
8
  "rounded-full",
@@ -28,8 +28,8 @@ const e = t(
28
28
  ), r = t(
29
29
  [
30
30
  "block",
31
- "w-6",
32
- "h-6",
31
+ "w-[18px]",
32
+ "h-[18px]",
33
33
  "bg-white",
34
34
  "rounded-full",
35
35
  "shadow-md",
@@ -0,0 +1,31 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { cn as p } from "../../utils/index.js";
3
+ import { tableVariants as f } from "./Table.variants.js";
4
+ import { Head as s } from "./components/Head.js";
5
+ import { Row as l } from "./components/Row.js";
6
+ import { Filter as n } from "./components/Filter.js";
7
+ import { Body as c } from "./components/Body.js";
8
+ import { useTheme as d } from "../../contexts/theme.hook.js";
9
+ const o = ({ children: r, className: t, theme: m, ...e }) => {
10
+ const { theme: i } = d();
11
+ return /* @__PURE__ */ a(
12
+ "table",
13
+ {
14
+ className: p(
15
+ f({
16
+ className: t,
17
+ theme: m ?? i
18
+ })
19
+ ),
20
+ ...e,
21
+ children: r
22
+ }
23
+ );
24
+ };
25
+ o.Head = s;
26
+ o.Row = l;
27
+ o.Filter = n;
28
+ o.Body = c;
29
+ export {
30
+ o as Table
31
+ };
@@ -0,0 +1,78 @@
1
+ import { c as t } from "../../index-BNmRGtA6.js";
2
+ const r = t(
3
+ [
4
+ "table-auto",
5
+ "w-full",
6
+ "border-collapse",
7
+ "border-spacing-0",
8
+ "rounded",
9
+ "shadow-sm"
10
+ ],
11
+ {
12
+ variants: {
13
+ theme: {
14
+ kubefirst: "",
15
+ colony: "",
16
+ civo: ""
17
+ }
18
+ },
19
+ defaultVariants: {
20
+ theme: "kubefirst"
21
+ }
22
+ }
23
+ ), a = t(
24
+ [
25
+ "h-8",
26
+ "text-inherit",
27
+ "[&>td]:py-3",
28
+ "[&>td]:px-4",
29
+ "text-slate-700",
30
+ "hover:bg-zinc-100",
31
+ "hover:cursor-pointer"
32
+ ],
33
+ {
34
+ variants: {
35
+ theme: {
36
+ kubefirst: "",
37
+ colony: "",
38
+ civo: ""
39
+ },
40
+ isSelected: {
41
+ true: "bg-purple-50",
42
+ false: ""
43
+ }
44
+ }
45
+ }
46
+ ), o = t(
47
+ [
48
+ "h-[18px]",
49
+ "bg-slate-100",
50
+ "[&>tr>th]:py-3",
51
+ "[&>tr>th]:px-4",
52
+ "[&>tr>th]:uppercase",
53
+ "text-left"
54
+ ],
55
+ {
56
+ variants: {
57
+ theme: {
58
+ kubefirst: "",
59
+ colony: "",
60
+ civo: ""
61
+ }
62
+ }
63
+ }
64
+ ), s = t([], {
65
+ variants: {
66
+ theme: {
67
+ kubefirst: "",
68
+ colony: "",
69
+ civo: ""
70
+ }
71
+ }
72
+ });
73
+ export {
74
+ s as bodyVariants,
75
+ o as headVariants,
76
+ a as rowVariants,
77
+ r as tableVariants
78
+ };
@@ -0,0 +1,28 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { bodyVariants as n } from "../Table.variants.js";
3
+ import { cn as i } from "../../../utils/index.js";
4
+ import { useTheme as p } from "../../../contexts/theme.hook.js";
5
+ const d = ({
6
+ children: o,
7
+ className: t,
8
+ theme: e,
9
+ ...m
10
+ }) => {
11
+ const { theme: r } = p();
12
+ return /* @__PURE__ */ s(
13
+ "tbody",
14
+ {
15
+ className: i(
16
+ n({
17
+ className: t,
18
+ theme: e ?? r
19
+ })
20
+ ),
21
+ ...m,
22
+ children: o
23
+ }
24
+ );
25
+ };
26
+ export {
27
+ d as Body
28
+ };
@@ -0,0 +1,9 @@
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { Input as i } from "../../Input/Input.js";
3
+ const o = ({ children: s, ...r }) => /* @__PURE__ */ t("div", { className: "flex px-4 py-6 rounded-t", children: [
4
+ /* @__PURE__ */ e(i, { className: "!w-1/3", ...r }),
5
+ /* @__PURE__ */ e("div", { className: "w-1/4 flex justify-end", children: s })
6
+ ] });
7
+ export {
8
+ o as Filter
9
+ };
@@ -0,0 +1,28 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { headVariants as s } from "../Table.variants.js";
3
+ import { cn as h } from "../../../utils/index.js";
4
+ import { useTheme as n } from "../../../contexts/theme.hook.js";
5
+ const d = ({
6
+ children: e,
7
+ className: t,
8
+ theme: m,
9
+ ...o
10
+ }) => {
11
+ const { theme: r } = n();
12
+ return /* @__PURE__ */ a(
13
+ "thead",
14
+ {
15
+ className: h(
16
+ s({
17
+ className: t,
18
+ theme: m ?? r
19
+ })
20
+ ),
21
+ ...o,
22
+ children: e
23
+ }
24
+ );
25
+ };
26
+ export {
27
+ d as Head
28
+ };
@@ -0,0 +1,34 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { rowVariants as p } from "../Table.variants.js";
3
+ import { cn as a } from "../../../utils/index.js";
4
+ import { useTheme as f } from "../../../contexts/theme.hook.js";
5
+ const w = ({
6
+ children: t,
7
+ className: o,
8
+ theme: e,
9
+ width: r,
10
+ isSelected: m,
11
+ onSelect: s,
12
+ ...n
13
+ }) => {
14
+ const { theme: i } = f();
15
+ return /* @__PURE__ */ c(
16
+ "tr",
17
+ {
18
+ style: { width: r },
19
+ onClick: s,
20
+ className: a(
21
+ p({
22
+ className: o,
23
+ theme: e ?? i,
24
+ isSelected: m
25
+ })
26
+ ),
27
+ ...n,
28
+ children: t
29
+ }
30
+ );
31
+ };
32
+ export {
33
+ w as Row
34
+ };
@@ -1,7 +1,19 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { cn as i } from "../../utils/index.js";
3
- import { tagVariants as m } from "./Tag.variants.js";
4
- const n = ({ label: t, color: a }) => /* @__PURE__ */ r("div", { className: i(m({ color: a })), children: /* @__PURE__ */ r("span", { className: "text-inherit", children: t }) });
1
+ import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
+ import { S as r } from "../../index-B_6_jmOO.js";
3
+ import { cn as o } from "../../utils/index.js";
4
+ import { tagVariants as c } from "./Tag.variants.js";
5
+ const u = ({
6
+ label: i,
7
+ color: s,
8
+ rightIcon: t,
9
+ leftIcon: e,
10
+ className: l,
11
+ "data-value": m
12
+ }) => /* @__PURE__ */ n("div", { className: o(c({ color: s, className: l })), "data-value": m, children: [
13
+ e ? /* @__PURE__ */ a(r, { className: "text-inherit", children: e }) : null,
14
+ /* @__PURE__ */ a("span", { className: "text-inherit", children: i }),
15
+ t ? /* @__PURE__ */ a(r, { className: "text-inherit", children: t }) : null
16
+ ] });
5
17
  export {
6
- n as Tag
18
+ u as Tag
7
19
  };
@@ -1,6 +1,16 @@
1
1
  import { c as e } from "../../index-BNmRGtA6.js";
2
2
  const f = e(
3
- ["px-2", "py-1", "rounded-md", "w-max", "text-xs"],
3
+ [
4
+ "px-2",
5
+ "py-1",
6
+ "rounded-md",
7
+ "w-max",
8
+ "text-xs",
9
+ "flex",
10
+ "items-center",
11
+ "justify-center",
12
+ "gap-1"
13
+ ],
4
14
  {
5
15
  variants: {
6
16
  color: {
@@ -1,73 +1,8 @@
1
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as g, useId as w, useRef as C, useImperativeHandle as T, useEffect as R } from "react";
3
- import { cn as r } from "../../utils/index.js";
4
- import { Tag as d } from "../Tag/Tag.js";
5
- import { useTagSelect as S } from "./hooks/useTagSelect.js";
6
- import { tagSelectVariants as k, tagItemVariants as I, tagListVariants as V } from "./TagSelect.variants.js";
7
- import { C as j } from "../../chevron-up-DgLBQCKD.js";
8
- import { useTheme as y } from "../../contexts/theme.hook.js";
9
- const z = g(({ label: s, name: l, options: f, placeholder: h = "Select a value...", theme: o }, x) => {
10
- const c = w(), { theme: a } = y(), t = C(null), {
11
- isOpen: n,
12
- selectedTag: m,
13
- value: p,
14
- wrapperRef: b,
15
- handleClickTag: N,
16
- handleOpenDropdown: v
17
- } = S();
18
- return T(x, () => t.current, [t]), R(() => {
19
- t.current && (t.current.value = p);
20
- }, [p]), /* @__PURE__ */ u("div", { ref: b, className: "flex flex-col w-full relative", children: [
21
- s ? /* @__PURE__ */ e("label", { className: "m-2 cursor-pointer", htmlFor: l ?? c, children: s }) : null,
22
- /* @__PURE__ */ u(
23
- "div",
24
- {
25
- id: l ?? c,
26
- className: r(k({ theme: o ?? a })),
27
- role: "combobox",
28
- onClick: v,
29
- "aria-expanded": n,
30
- children: [
31
- m ? /* @__PURE__ */ e(d, { ...m }) : /* @__PURE__ */ e("span", { className: "text-base text-inherit", children: h }),
32
- /* @__PURE__ */ e(
33
- j,
34
- {
35
- className: r(
36
- "w-4 h-4 text-inherit transition-all duration-50",
37
- n ? "rotate-0" : "rotate-180"
38
- )
39
- }
40
- )
41
- ]
42
- }
43
- ),
44
- /* @__PURE__ */ e("input", { ref: t, type: "text", name: l, className: "hidden" }),
45
- n ? /* @__PURE__ */ e(
46
- "ul",
47
- {
48
- role: "listbox",
49
- className: r(V({ theme: o ?? a })),
50
- children: f.map((i) => /* @__PURE__ */ e(
51
- "li",
52
- {
53
- className: r(I({ theme: o ?? a })),
54
- role: "option",
55
- children: /* @__PURE__ */ e(
56
- "button",
57
- {
58
- type: "button",
59
- role: "button",
60
- className: "m-0 p-0 w-full",
61
- onClick: () => N(i),
62
- children: /* @__PURE__ */ e(d, { label: i.label, color: i.color })
63
- }
64
- )
65
- }
66
- ))
67
- }
68
- ) : null
69
- ] });
70
- });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as p } from "react";
3
+ import { TagSelectProvider as f } from "./contexts/TagSelect.provider.js";
4
+ import { Wrapper as i } from "./components/Wrapper/Wrapper.js";
5
+ const n = p(({ options: o, multiselect: e, ...t }, m) => /* @__PURE__ */ r(f, { defaultOptions: o, multiselect: e, children: /* @__PURE__ */ r(i, { ref: m, ...t }) }));
71
6
  export {
72
- z as TagSelect
7
+ n as TagSelect
73
8
  };