prometeo-design-system 2.3.1 → 2.3.3

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 (62) hide show
  1. package/dist/Avatar.es.js +1 -1
  2. package/dist/{Button-Bc0LYLfg.js → Button-DsbEyjth.js} +1 -1
  3. package/dist/Button.es.js +1 -1
  4. package/dist/{CardProfile-BiYr6kY9.js → CardProfile-BhFog7j5.js} +1 -1
  5. package/dist/CardProfile.es.js +1 -1
  6. package/dist/CheckBox.es.js +1 -1
  7. package/dist/CheckboxFormik.es.js +1 -1
  8. package/dist/DatePicker.es.js +2 -2
  9. package/dist/DialogModal.es.js +35 -31
  10. package/dist/DrawerDesktop.es.js +2 -2
  11. package/dist/DrawerMobile.es.js +1 -1
  12. package/dist/DropZone.es.js +1 -1
  13. package/dist/Header.es.js +1 -1
  14. package/dist/Icons/Icons.d.ts +48 -46
  15. package/dist/Icons.es.js +93 -90
  16. package/dist/Image.es.js +1 -1
  17. package/dist/ImageGallery-DnoRTpCr.js +317 -0
  18. package/dist/ImageGallery.es.js +1 -1
  19. package/dist/Input.es.js +1 -1
  20. package/dist/InputFormik.es.js +1 -1
  21. package/dist/InputMultiple.es.js +1 -1
  22. package/dist/{LayoutGeneric-jDE96L2N.js → LayoutGeneric-p4Pll4Cm.js} +1 -1
  23. package/dist/LayoutGeneric.es.js +1 -1
  24. package/dist/Logo.es.js +1 -1
  25. package/dist/Menu.es.js +1 -1
  26. package/dist/OtpInput.es.js +1 -1
  27. package/dist/Pagination.es.js +1 -1
  28. package/dist/ProfilePictureUpload.es.js +1 -1
  29. package/dist/ProgressBar.es.js +1 -1
  30. package/dist/SegmentedButton.es.js +1 -1
  31. package/dist/Select.es.js +368 -185
  32. package/dist/SelectFormik.es.js +90 -72
  33. package/dist/Skeleton.es.js +35 -34
  34. package/dist/Spinner.es.js +1 -1
  35. package/dist/Steps.es.js +1 -1
  36. package/dist/SwipeContainer.es.js +1 -1
  37. package/dist/Switch.es.js +31 -28
  38. package/dist/TabLinks.es.js +35 -33
  39. package/dist/Table.es.js +1 -1
  40. package/dist/TextArea.es.js +1 -1
  41. package/dist/Tooltip.es.js +1 -1
  42. package/dist/components/Dialog/Dialog.d.ts +7 -6
  43. package/dist/components/Dialog/useDialogControl.d.ts +4 -3
  44. package/dist/components/Select/Select.d.ts +33 -13
  45. package/dist/components/SelectFormik/SelectFormik.d.ts +4 -2
  46. package/dist/components/Skeleton/Skeleton.d.ts +5 -2
  47. package/dist/components/Switch/Switch.d.ts +5 -2
  48. package/dist/components/TabLinks/TabLinks.d.ts +2 -2
  49. package/dist/exports/Select.d.ts +1 -1
  50. package/dist/hooks/useDragScroll.d.ts +29 -0
  51. package/dist/hooks/useLabelBackground.d.ts +5 -0
  52. package/dist/index.d.ts +8 -8
  53. package/dist/{jsx-runtime-ByW6EXIE.js → jsx-runtime-DKDX3adD.js} +94 -96
  54. package/dist/pages/SelectsPage.d.ts +2 -0
  55. package/dist/prometeo-design-system.css +1 -1
  56. package/dist/prometeo-design-system.es.js +6 -6
  57. package/dist/useDragScroll-CHN9OMwn.js +165 -0
  58. package/package.json +4 -4
  59. package/src/styles/intellisense.css +5 -0
  60. package/dist/ImageGallery-O5Y4oBrD.js +0 -352
  61. package/dist/lib/utils.d.ts +0 -1
  62. package/dist/preview/Select.d.ts +0 -2
@@ -1,49 +1,67 @@
1
- import { j as t } from "./jsx-runtime-ByW6EXIE.js";
2
- import { Icons as h } from "./Icons.es.js";
3
- import { c as i } from "./cn-B6yFEsav.js";
4
- import { useField as P, ErrorMessage as M } from "formik";
5
- import { useState as w, useRef as R, useEffect as L } from "react";
6
- import B from "./Spinner.es.js";
7
- const T = ({
8
- label: N,
9
- name: A,
10
- placeholder: v = "",
11
- disabled: g,
12
- containerClassName: k,
13
- className: C,
14
- options: o = [],
15
- multiple: n = !1,
16
- emptyMessage: D = "No hay opciones disponibles",
17
- labelVariant: b = "default",
18
- isFetching: O = !1
1
+ import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
+ import { Icons as g } from "./Icons.es.js";
3
+ import { c as d } from "./cn-B6yFEsav.js";
4
+ import { useField as $, ErrorMessage as q } from "formik";
5
+ import { memo as G, useState as k, useRef as H, useEffect as J } from "react";
6
+ import K from "./Spinner.es.js";
7
+ const Q = ({
8
+ label: C,
9
+ name: I,
10
+ placeholder: b = "",
11
+ disabled: j,
12
+ containerClassName: S,
13
+ className: D,
14
+ options: c = [],
15
+ multiple: i = !1,
16
+ emptyMessage: z = "No hay opciones disponibles",
17
+ labelVariant: w = "default",
18
+ isFetching: E = !1,
19
+ returnFullObject: m = !1
20
+ // Por defecto false para mantener compatibilidad
19
21
  }) => {
20
- const [r, y, u] = P(A), [l, c] = w(!1), [f, j] = w(!1), m = R(null), x = y.touched && y.error, d = r.value && (Array.isArray(r.value) ? r.value.length > 0 : r.value.toString().length > 0), S = () => b === "static" || d || l || f ? "-top-3 left-2 scale-90" : "top-1/2 -translate-y-1/2 scale-100", V = () => r.value ? Array.isArray(r.value) ? o.filter((e) => r.value.includes(e.id)) : o.filter((e) => e.id === r.value) : [], z = (e) => {
21
- if (n) {
22
- const a = Array.isArray(r.value) ? r.value : [], s = a.includes(e.id) ? a.filter((p) => p !== e.id) : [...a, e.id];
23
- u.setValue(s);
22
+ const [r, N, o] = $(I), [l, x] = k(!1), [p, A] = k(!1), h = H(null), v = N.touched && N.error, u = (e) => e ? typeof e == "object" && e.id !== void 0 ? e.id : e : null, V = () => r.value ? Array.isArray(r.value) ? r.value.map(u) : u(r.value) : i ? [] : null, f = r.value && (Array.isArray(r.value) ? r.value.length > 0 : typeof r.value == "object" ? r.value.id : r.value?.toString().length > 0), O = () => w === "static" || f || l || p ? "-top-3 left-2 scale-90" : "top-1/2 -translate-y-1/2 scale-100", P = () => {
23
+ if (!r.value) return [];
24
+ const e = V();
25
+ return Array.isArray(e) ? c.filter((a) => e.includes(a.id)) : c.filter((a) => a.id === e);
26
+ }, F = (e) => {
27
+ if (i) {
28
+ const a = Array.isArray(r.value) ? r.value.map(u) : [], s = a.includes(e.id);
29
+ if (m) {
30
+ const n = Array.isArray(r.value) ? r.value : [], y = s ? n.filter((B) => u(B) !== e.id) : [...n, e];
31
+ o.setValue(y);
32
+ } else {
33
+ const n = s ? a.filter((y) => y !== e.id) : [...a, e.id];
34
+ o.setValue(n);
35
+ }
24
36
  } else
25
- u.setValue(e.id), c(!1);
26
- }, E = (e) => {
27
- e.stopPropagation(), u.setValue(n ? [] : "");
28
- }, F = (e, a) => {
29
- if (a?.stopPropagation(), n && Array.isArray(r.value)) {
30
- const s = r.value.filter(
31
- (p) => p !== e
32
- );
33
- u.setValue(s);
34
- }
37
+ o.setValue(m ? e : e.id), x(!1);
38
+ }, M = (e) => {
39
+ e.stopPropagation(), o.setValue(i ? [] : "");
40
+ }, R = (e, a) => {
41
+ if (a?.stopPropagation(), i && Array.isArray(r.value))
42
+ if (m) {
43
+ const s = r.value.filter(
44
+ (n) => u(n) !== e
45
+ );
46
+ o.setValue(s);
47
+ } else {
48
+ const s = r.value.filter(
49
+ (n) => n !== e
50
+ );
51
+ o.setValue(s);
52
+ }
35
53
  };
36
- L(() => {
54
+ J(() => {
37
55
  const e = (a) => {
38
- m.current && !m.current.contains(a.target) && c(!1);
56
+ h.current && !h.current.contains(a.target) && x(!1);
39
57
  };
40
58
  return l && document.addEventListener("mousedown", e), () => {
41
59
  document.removeEventListener("mousedown", e);
42
60
  };
43
61
  }, [l]);
44
- const I = () => {
45
- const e = V();
46
- return e.length === 0 ? v ? /* @__PURE__ */ t.jsx("span", { className: "text-neutral-medium-default opacity-50", children: v }) : null : n ? /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-1 flex-wrap py-1", children: e.map((a) => /* @__PURE__ */ t.jsxs(
62
+ const L = () => {
63
+ const e = P();
64
+ return e.length === 0 ? b ? /* @__PURE__ */ t.jsx("span", { className: "text-neutral-medium-default opacity-50", children: b }) : null : i ? /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-1 flex-wrap py-1", children: e.map((a) => /* @__PURE__ */ t.jsxs(
47
65
  "div",
48
66
  {
49
67
  className: "inline-flex items-center gap-1 px-2 py-1 bg-primary-default-default text-white text-xs rounded-md",
@@ -53,12 +71,12 @@ const T = ({
53
71
  "button",
54
72
  {
55
73
  onMouseDown: (s) => {
56
- s.preventDefault(), F(a.id, s);
74
+ s.preventDefault(), R(a.id, s);
57
75
  },
58
76
  className: "flex-shrink-0 hover:bg-primary-strong-default rounded-sm p-0.5 transition-colors",
59
77
  type: "button",
60
78
  tabIndex: -1,
61
- children: /* @__PURE__ */ t.jsx(h.Close, { size: 12, className: "" })
79
+ children: /* @__PURE__ */ t.jsx(g.Close, { size: 12, className: "" })
62
80
  }
63
81
  )
64
82
  ]
@@ -69,57 +87,57 @@ const T = ({
69
87
  return /* @__PURE__ */ t.jsxs(
70
88
  "div",
71
89
  {
72
- className: i("relative w-full bg-inherit", k),
73
- ref: m,
90
+ className: d("relative w-full bg-inherit", S),
91
+ ref: h,
74
92
  children: [
75
93
  /* @__PURE__ */ t.jsxs("div", { className: "relative bg-inherit", children: [
76
94
  /* @__PURE__ */ t.jsxs(
77
95
  "div",
78
96
  {
79
- onClick: () => !g && c(!l),
80
- onFocus: () => j(!0),
81
- onBlur: () => j(!1),
82
- className: i(
97
+ onClick: () => !j && x(!l),
98
+ onFocus: () => A(!0),
99
+ onBlur: () => A(!1),
100
+ className: d(
83
101
  "w-full px-3 h-12 text-left border-1 rounded-lg transition-all duration-300 ease-in-out text-neutral-default-default",
84
102
  "flex items-center justify-between bg-transparent focus:outline-none",
85
- d || l || f ? " border-primary-default-focused ring-primary-default-focused ring-[2px]" : x ? "ring-error-default-default ring-[2px]" : "border-neutral-default-default hover:border-primary-default-hover",
86
- g && "opacity-50 cursor-not-allowed pointer-events-none",
87
- C
103
+ f || l || p ? " border-primary-default-focused ring-primary-default-focused ring-[2px]" : v ? "ring-error-default-default ring-[2px]" : "border-neutral-default-default hover:border-primary-default-hover",
104
+ j && "opacity-50 cursor-not-allowed pointer-events-none",
105
+ D
88
106
  ),
89
107
  children: [
90
108
  /* @__PURE__ */ t.jsx(
91
109
  "label",
92
110
  {
93
- className: i(
111
+ className: d(
94
112
  "absolute pointer-events-none bg-inherit px-1 z-10",
95
- b === "default" && "transition-all duration-200 ease-in-out",
113
+ w === "default" && "transition-all duration-200 ease-in-out",
96
114
  "text-md",
97
- S(),
98
- d || l || f ? "text-primary-default-default" : x ? "text-red-500" : "text-neutral-medium-default",
115
+ O(),
116
+ f || l || p ? "text-primary-default-default" : v ? "text-red-500" : "text-neutral-medium-default",
99
117
  "left-3"
100
118
  ),
101
- children: N
119
+ children: C
102
120
  }
103
121
  ),
104
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0", children: I() }),
122
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0", children: L() }),
105
123
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 ml-2", children: [
106
- d && /* @__PURE__ */ t.jsx(
124
+ f && /* @__PURE__ */ t.jsx(
107
125
  "button",
108
126
  {
109
127
  onMouseDown: (e) => {
110
- e.preventDefault(), e.stopPropagation(), E(e);
128
+ e.preventDefault(), e.stopPropagation(), M(e);
111
129
  },
112
130
  className: "text-neutral-medium-default hover:text-neutral-default-default transition-colors",
113
131
  type: "button",
114
132
  tabIndex: -1,
115
- children: /* @__PURE__ */ t.jsx(h.Close, { size: 16, className: "" })
133
+ children: /* @__PURE__ */ t.jsx(g.Close, { size: 16, className: "" })
116
134
  }
117
135
  ),
118
- O ? /* @__PURE__ */ t.jsx(B, { size: 20, variant: "clip" }) : /* @__PURE__ */ t.jsx(
119
- h.ChevronDown,
136
+ E ? /* @__PURE__ */ t.jsx(K, { size: 20, variant: "clip" }) : /* @__PURE__ */ t.jsx(
137
+ g.ChevronDown,
120
138
  {
121
139
  size: 20,
122
- className: i(
140
+ className: d(
123
141
  "transition-transform text-neutral-default-default",
124
142
  l ? "rotate-180" : ""
125
143
  )
@@ -129,24 +147,24 @@ const T = ({
129
147
  ]
130
148
  }
131
149
  ),
132
- l && /* @__PURE__ */ t.jsx("div", { className: "absolute z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-md shadow-lg max-h-60 overflow-auto", children: o.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: D }) : o.map((e) => {
133
- const a = n ? Array.isArray(r.value) && r.value.includes(e.id) : r.value === e.id;
150
+ l && /* @__PURE__ */ t.jsx("div", { className: "absolute z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-md shadow-lg max-h-60 overflow-auto", children: c.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: z }) : c.map((e) => {
151
+ const a = V(), s = i ? Array.isArray(a) && a.includes(e.id) : a === e.id;
134
152
  return /* @__PURE__ */ t.jsxs(
135
153
  "div",
136
154
  {
137
- onMouseDown: (s) => {
138
- s.preventDefault(), z(e), s.stopPropagation();
155
+ onMouseDown: (n) => {
156
+ n.preventDefault(), F(e), n.stopPropagation();
139
157
  },
140
- className: i(
158
+ className: d(
141
159
  "px-3 py-2 cursor-pointer flex items-center transition-colors",
142
- a ? "bg-primary-default-default text-white" : "hover:bg-neutral-medium-selected text-neutral-default-default"
160
+ s ? "bg-primary-default-default text-white" : "hover:bg-neutral-medium-selected text-neutral-default-default"
143
161
  ),
144
162
  children: [
145
- n && /* @__PURE__ */ t.jsx(
163
+ i && /* @__PURE__ */ t.jsx(
146
164
  "input",
147
165
  {
148
166
  type: "checkbox",
149
- checked: a,
167
+ checked: s,
150
168
  onChange: () => {
151
169
  },
152
170
  className: "mr-2 pointer-events-none"
@@ -159,8 +177,8 @@ const T = ({
159
177
  );
160
178
  }) })
161
179
  ] }),
162
- x && /* @__PURE__ */ t.jsx(
163
- M,
180
+ v && /* @__PURE__ */ t.jsx(
181
+ q,
164
182
  {
165
183
  name: r.name,
166
184
  component: "span",
@@ -170,7 +188,7 @@ const T = ({
170
188
  ]
171
189
  }
172
190
  );
173
- };
191
+ }, _ = G(Q);
174
192
  export {
175
- T as default
193
+ _ as default
176
194
  };
@@ -1,28 +1,25 @@
1
- import { j as x } from "./jsx-runtime-ByW6EXIE.js";
2
- import { c as P } from "./cn-B6yFEsav.js";
3
- import { useRef as $, useCallback as B, useLayoutEffect as E } from "react";
4
- const A = (b) => {
5
- const e = $(null), { debugMode: y = !1, className: p = "", children: f, shape: h = "rounded", animation: u = "shimmer", onlyContainer: l = !1 } = b;
1
+ import { j as x } from "./jsx-runtime-DKDX3adD.js";
2
+ import { c as E } from "./cn-B6yFEsav.js";
3
+ import { memo as P, useRef as B, useCallback as R, useLayoutEffect as D } from "react";
4
+ const b = (y) => {
5
+ const e = B(null), { debugMode: p = !1, className: f = "", children: h, shape: k = "rounded", animation: d = "shimmer", onlyContainer: l = !1 } = y;
6
6
  let i = "255, 255, 255", m = "255, 255, 255, 0.1";
7
- const g = B(() => {
8
- if (!l && e.current)
9
- switch (u) {
10
- case "shimmer":
11
- e.current.classList.add("skeleton-shimmer-animation");
12
- const n = m.split(",").map(Number);
13
- n && n.length >= 3 && (e.current.style.setProperty("--shimmer-color-r", n[0].toString()), e.current.style.setProperty("--shimmer-color-g", n[1].toString()), e.current.style.setProperty("--shimmer-color-b", n[2].toString()), e.current.style.setProperty("--shimmer-color-a", n[3].toString()));
14
- break;
15
- case "none":
16
- e.current.style.animation = "none";
17
- break;
18
- case "border":
19
- e.current.classList.add("skeleton-border-animation"), e.current.style.backgroundColor = "transparent";
20
- const c = i.match(/\d+/g);
21
- c && c.length >= 3 && (e.current.style.setProperty("--border-color-r", c[0]), e.current.style.setProperty("--border-color-g", c[1]), e.current.style.setProperty("--border-color-b", c[2]));
22
- break;
23
- }
24
- }, [u, m, i, l]);
25
- E(() => {
7
+ const g = R(() => {
8
+ if (l || !e.current) return;
9
+ const n = m.split(",").map(Number), c = i.match(/\d+/g);
10
+ switch (d) {
11
+ case "shimmer":
12
+ e.current.classList.add("skeleton-shimmer-animation"), n && n.length >= 3 && (e.current.style.setProperty("--shimmer-color-r", n[0].toString()), e.current.style.setProperty("--shimmer-color-g", n[1].toString()), e.current.style.setProperty("--shimmer-color-b", n[2].toString()), e.current.style.setProperty("--shimmer-color-a", n[3].toString()));
13
+ break;
14
+ case "none":
15
+ e.current.style.animation = "none";
16
+ break;
17
+ case "border":
18
+ e.current.classList.add("skeleton-border-animation"), e.current.style.backgroundColor = "transparent", c && c.length >= 3 && (e.current.style.setProperty("--border-color-r", c[0]), e.current.style.setProperty("--border-color-g", c[1]), e.current.style.setProperty("--border-color-b", c[2]));
19
+ break;
20
+ }
21
+ }, [d, m, i, l]);
22
+ D(() => {
26
23
  if (e.current) {
27
24
  const n = (a) => {
28
25
  let r = a;
@@ -42,12 +39,14 @@ const A = (b) => {
42
39
  t.fillStyle = a, t.fillRect(0, 0, 1, 1);
43
40
  const o = t.getImageData(0, 0, 1, 1).data;
44
41
  return [o[0], o[1], o[2]];
45
- }, C = n(e.current.parentElement), s = c(C), S = s.reduce((a, r) => a + r, 0) < 382;
46
- let d;
47
- S ? d = `rgb(${s[0] + 10}, ${s[1] + 10}, ${s[2] + 10})` : (d = `rgb(${s[0] - 30}, ${s[1] - 30}, ${s[2] - 30})`, i = "115,115,115", m = "255,255,255, 0.4"), l && (d = "transparent", e.current.style.animation = "none"), e.current.style.backgroundColor = d, g();
42
+ };
43
+ if (!e.current.parentElement) return;
44
+ const C = n(e.current.parentElement), s = c(C), w = s.reduce((a, r) => a + r, 0) < 382;
45
+ let u;
46
+ w ? u = `rgb(${s[0] + 10}, ${s[1] + 10}, ${s[2] + 10})` : (u = `rgb(${s[0] - 30}, ${s[1] - 30}, ${s[2] - 30})`, i = "115,115,115", m = "255,255,255, 0.4"), l && (u = "transparent", e.current.style.animation = "none"), e.current.style.backgroundColor = u, g();
48
47
  }
49
48
  }, [m, i, l, g]);
50
- const k = {
49
+ const S = {
51
50
  circle: "rounded-full aspect-square",
52
51
  square: "rounded-none",
53
52
  rounded: "rounded"
@@ -56,17 +55,19 @@ const A = (b) => {
56
55
  "div",
57
56
  {
58
57
  ref: e,
59
- className: P(
60
- y && " border-red-600/20 border",
61
- p,
58
+ className: E(
59
+ p && " border-red-600/20 border",
60
+ f,
62
61
  "skeleton-container",
63
- k[h]
62
+ S[k]
64
63
  ),
65
- children: f
64
+ children: h
66
65
  },
67
66
  `skeleton-${Math.random().toFixed(10)}`
68
67
  );
69
68
  };
69
+ b.displayName = "Skeleton";
70
+ const L = P(b);
70
71
  export {
71
- A as Skeleton
72
+ L as Skeleton
72
73
  };
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { ClipLoader as l, SyncLoader as m, HashLoader as p, GridLoader as x, DotLoader as j, BounceLoader as f } from "react-spinners";
3
3
  import { c as L } from "./cn-B6yFEsav.js";
4
4
  const y = ({
package/dist/Steps.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as j } from "./cn-B6yFEsav.js";
3
3
  import { motion as r } from "framer-motion";
4
4
  import N from "react";
@@ -1,4 +1,4 @@
1
- import { j as o } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as o } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as i } from "./cn-B6yFEsav.js";
3
3
  import { useState as d, useRef as D, useEffect as L } from "react";
4
4
  const O = ({
package/dist/Switch.es.js CHANGED
@@ -1,13 +1,14 @@
1
- import { j as n } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as a } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as r } from "./cn-B6yFEsav.js";
3
- import { useRef as p } from "react";
4
- import { motion as l } from "framer-motion";
5
- const x = ({ name: c, value: o, onChange: d, disabled: e = !1 }) => {
6
- const a = p(null), i = () => {
7
- if (!a.current || e) return;
8
- const m = !a.current.checked;
9
- d(c, m);
10
- }, s = {
3
+ import { memo as w, useRef as b } from "react";
4
+ import { motion as c } from "framer-motion";
5
+ const l = ({ name: d, value: o, onChange: f, disabled: t = !1 }) => {
6
+ const n = b(null), h = (u) => {
7
+ if (!n.current || t) return;
8
+ u.preventDefault(), u.stopPropagation();
9
+ const g = !n.current.checked;
10
+ f(d, g);
11
+ }, i = {
11
12
  on: {
12
13
  default: {
13
14
  container: "bg-primary-default-default",
@@ -28,7 +29,7 @@ const x = ({ name: c, value: o, onChange: d, disabled: e = !1 }) => {
28
29
  dot: "bg-neutral-weak-default"
29
30
  }
30
31
  }
31
- }, f = {
32
+ }, m = {
32
33
  on: {
33
34
  left: "unset",
34
35
  right: -4
@@ -37,7 +38,7 @@ const x = ({ name: c, value: o, onChange: d, disabled: e = !1 }) => {
37
38
  left: -4,
38
39
  right: "unset"
39
40
  }
40
- }, h = {
41
+ }, p = {
41
42
  on: {
42
43
  width: 24,
43
44
  height: 24
@@ -45,40 +46,40 @@ const x = ({ name: c, value: o, onChange: d, disabled: e = !1 }) => {
45
46
  off: {
46
47
  width: 16
47
48
  }
48
- }, t = o ? "on" : "off", u = e ? "disabled" : "default";
49
- return /* @__PURE__ */ n.jsxs("div", { children: [
50
- /* @__PURE__ */ n.jsx("input", { type: "checkbox", hidden: !0, ref: a, checked: o, disabled: e, onChange: i }),
51
- /* @__PURE__ */ n.jsx(
49
+ }, e = o ? "on" : "off", s = t ? "disabled" : "default";
50
+ return /* @__PURE__ */ a.jsxs("div", { children: [
51
+ /* @__PURE__ */ a.jsx("input", { type: "checkbox", hidden: !0, ref: n, checked: o, disabled: t }),
52
+ /* @__PURE__ */ a.jsx(
52
53
  "div",
53
54
  {
54
55
  className: r(
55
56
  "w-14 h-8 rounded-full relative px-2",
56
- s[t][u].container
57
+ i[e][s].container
57
58
  ),
58
- children: /* @__PURE__ */ n.jsx(
59
- l.span,
59
+ children: /* @__PURE__ */ a.jsx(
60
+ c.span,
60
61
  {
61
- onClick: i,
62
- animate: f[t],
63
- whileHover: e ? {} : {
64
- background: t === "off" ? "rgba(29, 27, 32, 0.08)" : "rgba(101, 85, 143, 0.12)"
62
+ onClick: h,
63
+ animate: m[e],
64
+ whileHover: t ? {} : {
65
+ background: e === "off" ? "rgba(29, 27, 32, 0.08)" : "rgba(101, 85, 143, 0.12)"
65
66
  },
66
67
  className: r(
67
68
  "absolute top-1/2 -translate-y-1/2 grid place-items-center ",
68
69
  "size-10 aspect-square rounded-full absolute top-1/2 -translate-y-1/2",
69
70
  "cursor-pointer"
70
71
  ),
71
- children: /* @__PURE__ */ n.jsx(
72
- l.span,
72
+ children: /* @__PURE__ */ a.jsx(
73
+ c.span,
73
74
  {
74
- animate: h[t],
75
- whileTap: e ? {} : {
75
+ animate: p[e],
76
+ whileTap: t ? {} : {
76
77
  width: 28,
77
78
  height: 28
78
79
  },
79
80
  className: r(
80
81
  "size-4 aspect-square rounded-full z-10",
81
- s[t][u].dot
82
+ i[e][s].dot
82
83
  )
83
84
  }
84
85
  )
@@ -88,6 +89,8 @@ const x = ({ name: c, value: o, onChange: d, disabled: e = !1 }) => {
88
89
  )
89
90
  ] });
90
91
  };
92
+ l.displayName = "Switch";
93
+ const y = w(l);
91
94
  export {
92
- x as Switch
95
+ y as Switch
93
96
  };
@@ -1,42 +1,42 @@
1
- import { j as a } from "./jsx-runtime-ByW6EXIE.js";
2
- import { motion as x } from "framer-motion";
3
- import { memo as b } from "react";
4
- import { c as r } from "./cn-B6yFEsav.js";
5
- const k = b(function({
6
- items: s,
7
- activeTab: l,
8
- onTabChange: o,
9
- className: n,
10
- tabClassName: u,
11
- activeTabClassName: f,
12
- indicatorClassName: c,
13
- animated: m = !0,
14
- renderTab: i
1
+ import { j as a } from "./jsx-runtime-DKDX3adD.js";
2
+ import { motion as h } from "framer-motion";
3
+ import { memo as d } from "react";
4
+ import { c as i } from "./cn-B6yFEsav.js";
5
+ const l = d(function({
6
+ items: o,
7
+ activeTab: n,
8
+ onTabChange: u,
9
+ className: f,
10
+ tabClassName: c,
11
+ activeTabClassName: m,
12
+ indicatorClassName: b,
13
+ animated: p = !0,
14
+ renderTab: r
15
15
  }) {
16
- const p = (t) => {
17
- t.disabled || o?.(t.id, t);
16
+ const x = (t) => {
17
+ t.disabled || u?.(t.id, t);
18
18
  };
19
19
  return /* @__PURE__ */ a.jsx(
20
20
  "div",
21
21
  {
22
- className: r(
22
+ className: i(
23
23
  "flex flex-row justify-around items-end relative border-b-1 border-neutral-strong-default w-full md:justify-start md:px-10 md:gap-5",
24
- n
24
+ f
25
25
  ),
26
26
  role: "tablist",
27
- children: s?.map((t) => {
28
- const e = l === t.id, d = () => p(t);
29
- return i ? /* @__PURE__ */ a.jsx("div", { children: i(t, e, d) }, t.id) : /* @__PURE__ */ a.jsxs(
27
+ children: o?.map((t) => {
28
+ const e = n === t.id, s = () => x(t);
29
+ return r ? /* @__PURE__ */ a.jsx("div", { children: r(t, e, s) }, t.id) : /* @__PURE__ */ a.jsxs(
30
30
  "button",
31
31
  {
32
- onClick: d,
32
+ onClick: s,
33
33
  disabled: t.disabled,
34
- className: r(
34
+ className: i(
35
35
  "relative flex justify-center items-center h-10 px-4 font-medium focus:outline-none transition-colors",
36
36
  !t.disabled && "hover:text-primary-default-default cursor-pointer",
37
37
  t.disabled && "opacity-50 cursor-not-allowed",
38
- u,
39
- e && f
38
+ c,
39
+ e && m
40
40
  ),
41
41
  tabIndex: t.disabled ? -1 : 0,
42
42
  "aria-label": t.title,
@@ -44,18 +44,18 @@ const k = b(function({
44
44
  "aria-selected": e,
45
45
  title: t.description,
46
46
  children: [
47
- e && m && /* @__PURE__ */ a.jsx(
48
- x.div,
47
+ e && p && /* @__PURE__ */ a.jsx(
48
+ h.div,
49
49
  {
50
50
  layoutId: "tab-indicator",
51
- className: r(
51
+ className: i(
52
52
  "absolute -bottom-[1px] left-0 right-0 h-[5px] rounded-t-xl bg-primary-default-default z-0",
53
- c
53
+ b
54
54
  ),
55
55
  transition: {
56
56
  type: "spring",
57
- stiffness: 300,
58
- damping: 20
57
+ stiffness: 250,
58
+ damping: 17
59
59
  },
60
60
  "aria-hidden": "true"
61
61
  }
@@ -63,7 +63,7 @@ const k = b(function({
63
63
  /* @__PURE__ */ a.jsx(
64
64
  "span",
65
65
  {
66
- className: r(
66
+ className: i(
67
67
  "relative z-10",
68
68
  e ? "text-primary-default-default font-semibold text-md" : "text-neutral-medium-default font-medium text-md"
69
69
  ),
@@ -78,6 +78,8 @@ const k = b(function({
78
78
  }
79
79
  );
80
80
  });
81
+ l.displayName = "TabLinks";
82
+ const N = d(l);
81
83
  export {
82
- k as default
84
+ N as default
83
85
  };
package/dist/Table.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as r } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as r } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as l } from "./cn-B6yFEsav.js";
3
3
  import * as o from "react";
4
4
  const n = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r.jsx("div", { className: "w-full", children: /* @__PURE__ */ r.jsx(
@@ -1,4 +1,4 @@
1
- import { j as y } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as y } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { c as C } from "./cn-B6yFEsav.js";
3
3
  import * as s from "react";
4
4
  function M({
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-ByW6EXIE.js";
1
+ import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { AnimatePresence as f, motion as n } from "framer-motion";
3
3
  import { useState as p, cloneElement as x } from "react";
4
4
  import { Icons as b } from "./Icons.es.js";
@@ -1,13 +1,14 @@
1
- interface DialogProps {
1
+ interface DialogProps<TContext = unknown> {
2
2
  title?: string;
3
- children: React.ReactNode;
4
- onClose?: () => void;
3
+ children: React.ReactNode | ((context: TContext | null) => React.ReactNode);
4
+ onClose?: (context: TContext | null) => void;
5
5
  className?: string;
6
6
  }
7
- export interface DialogHandle {
8
- open: () => void;
7
+ export interface DialogHandle<TContext = unknown> {
8
+ open: (context?: TContext) => void;
9
9
  close: () => void;
10
10
  isOpen: boolean;
11
+ getContext: () => TContext | null;
11
12
  }
12
13
  interface DialogContentProps {
13
14
  children?: React.ReactNode;
@@ -25,7 +26,7 @@ interface DialogFooterProps {
25
26
  children?: React.ReactNode;
26
27
  className?: string;
27
28
  }
28
- declare const DialogModal: import('react').ForwardRefExoticComponent<DialogProps & import('react').RefAttributes<DialogHandle>> & {
29
+ declare const DialogModal: import('react').ForwardRefExoticComponent<DialogProps<any> & import('react').RefAttributes<DialogHandle<any>>> & {
29
30
  Content: ({ children, className }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
30
31
  Header: ({ children, className }: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
31
32
  Footer: ({ children, className }: DialogFooterProps) => import("react/jsx-runtime").JSX.Element;