prometeo-design-system 2.6.8 → 2.7.0
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.
- package/dist/{Button-DsbEyjth.js → Button-CvBWH1HX.js} +8 -8
- package/dist/Button.es.js +1 -1
- package/dist/ButtonV2.es.js +12 -12
- package/dist/CheckboxFormik.es.js +10 -10
- package/dist/DatePicker.es.js +2 -2
- package/dist/DrawerDesktop.es.js +1 -1
- package/dist/DropZone.es.js +5 -5
- package/dist/FAButton.es.js +1 -1
- package/dist/{ImageGallery-DnoRTpCr.js → ImageGallery-DKzJg3un.js} +1 -1
- package/dist/ImageGallery.es.js +1 -1
- package/dist/Input-BTsR-vNF.js +281 -0
- package/dist/Input.es.js +1 -1
- package/dist/InputFormikV2.es.js +1 -1
- package/dist/Pagination.es.js +8 -8
- package/dist/ProfilePictureUpload.es.js +3 -3
- package/dist/Select-BQMdfu1n.js +1003 -0
- package/dist/Select.es.js +1 -1
- package/dist/SelectFormik.es.js +1 -1
- package/dist/SelectFormikLegacy.es.js +14 -14
- package/dist/SelectSearch.es.js +66 -63
- package/dist/TabLinks.es.js +8 -8
- package/dist/TextArea.es.js +28 -26
- package/dist/Toast.es.js +1 -1
- package/dist/components/RecurrentDatePicker/CustomFrequencySettings.d.ts +29 -3
- package/dist/components/RecurrentDatePicker/FrequencySettings.d.ts +2 -1
- package/dist/components/RecurrentDatePicker/MonthlyFrequencySettings.d.ts +9 -3
- package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +28 -1
- package/dist/components/RecurrentDatePicker/WeekdaysSelector.d.ts +1 -0
- package/dist/components/RecurrentDatePicker/WeeklyFrequencySetting.d.ts +2 -1
- package/dist/components/RecurrentDatePicker/YearlyFrequencySettings.d.ts +13 -2
- package/dist/components/RecurrentDatePicker/recurrentDatePicker.validations.d.ts +69 -0
- package/dist/components/Select/Select.d.ts +18 -0
- package/dist/components/TextArea/TextArea.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/preview/SelectPreview/SelectGroupedOptionsPreview.d.ts +2 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +4 -4
- package/package.json +1 -1
- package/dist/Input-R52CsX56.js +0 -280
- package/dist/Select-CMjYSSZB.js +0 -812
|
@@ -2,14 +2,14 @@ import { j as f } from "./jsx-runtime-DKDX3adD.js";
|
|
|
2
2
|
import { c as g } from "./cn-B6yFEsav.js";
|
|
3
3
|
import { clsx as B } from "clsx";
|
|
4
4
|
import { useAnimationControls as E, motion as j } from "framer-motion";
|
|
5
|
-
import { memo as P, useCallback as
|
|
6
|
-
const
|
|
5
|
+
import { memo as P, useCallback as C, useMemo as h } from "react";
|
|
6
|
+
const V = (l) => typeof l == "boolean" ? `${l}` : l === 0 ? "0" : l, w = B, _ = (l, d) => (e) => {
|
|
7
7
|
var m;
|
|
8
|
-
if (d?.variants == null) return
|
|
8
|
+
if (d?.variants == null) return w(l, e?.class, e?.className);
|
|
9
9
|
const { variants: v, defaultVariants: t } = d, n = Object.keys(v).map((s) => {
|
|
10
10
|
const u = e?.[s], i = t?.[s];
|
|
11
11
|
if (u === null) return null;
|
|
12
|
-
const o =
|
|
12
|
+
const o = V(u) || V(i);
|
|
13
13
|
return v[s][o];
|
|
14
14
|
}), r = e && Object.entries(e).reduce((s, u) => {
|
|
15
15
|
let [i, o] = u;
|
|
@@ -31,7 +31,7 @@ const C = (l) => typeof l == "boolean" ? `${l}` : l === 0 ? "0" : l, V = B, _ =
|
|
|
31
31
|
o
|
|
32
32
|
] : s;
|
|
33
33
|
}, []);
|
|
34
|
-
return
|
|
34
|
+
return w(l, n, a, e?.class, e?.className);
|
|
35
35
|
}, $ = _(
|
|
36
36
|
"flex items-center justify-center cursor-pointer focus:outline-none font-semibold rounded-md transition-colors",
|
|
37
37
|
{
|
|
@@ -51,7 +51,7 @@ const C = (l) => typeof l == "boolean" ? `${l}` : l === 0 ? "0" : l, V = B, _ =
|
|
|
51
51
|
large: "h-[56px] w-[145px] w-fit px-4 py-3 text-base"
|
|
52
52
|
},
|
|
53
53
|
disabled: {
|
|
54
|
-
true: "opacity-50 cursor-
|
|
54
|
+
true: "opacity-50 cursor-default",
|
|
55
55
|
false: ""
|
|
56
56
|
},
|
|
57
57
|
loading: {
|
|
@@ -125,9 +125,9 @@ function z({
|
|
|
125
125
|
form: x,
|
|
126
126
|
...N
|
|
127
127
|
}) {
|
|
128
|
-
const c = E(), H =
|
|
128
|
+
const c = E(), H = C(() => {
|
|
129
129
|
!t || a || r || !n || c.start({ rotate: 90 });
|
|
130
|
-
}, [t, a, r, n, c]), S =
|
|
130
|
+
}, [t, a, r, n, c]), S = C(() => {
|
|
131
131
|
!t || a || r || !n || c.start({ rotate: 0 });
|
|
132
132
|
}, [t, a, r, n, c]), k = h(() => g(
|
|
133
133
|
$({
|
package/dist/Button.es.js
CHANGED
package/dist/ButtonV2.es.js
CHANGED
|
@@ -17,7 +17,7 @@ const M = {
|
|
|
17
17
|
label: "",
|
|
18
18
|
icon: ""
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, n = {
|
|
21
21
|
filled: {
|
|
22
22
|
primary: {
|
|
23
23
|
container: ` bg-primary-default-default border-primary-default-default
|
|
@@ -50,7 +50,7 @@ const M = {
|
|
|
50
50
|
icon: "text-neutral-weak-default group-hover:text-neutral-weak-hover group-active:text-neutral-weak-pressed"
|
|
51
51
|
},
|
|
52
52
|
disabled: {
|
|
53
|
-
container: "bg-primary-medium-disabled border-transparent cursor-
|
|
53
|
+
container: "bg-primary-medium-disabled border-transparent cursor-default!",
|
|
54
54
|
label: "text-neutral-strong-disabled group-hover:text-neutral-strong-disabled group-active:text-neutral-strong-disabled",
|
|
55
55
|
icon: "text-neutral-strong-disabled group-hover:text-neutral-strong-disabled group-active:text-neutral-strong-disabled"
|
|
56
56
|
}
|
|
@@ -85,7 +85,7 @@ const M = {
|
|
|
85
85
|
icon: "text-warning-medium-default group-hover:text-warning-medium-hover group-active:text-warning-medium-pressed"
|
|
86
86
|
},
|
|
87
87
|
disabled: {
|
|
88
|
-
container: "bg-neutral-default-disabled border-neutral-default-disabled border cursor-
|
|
88
|
+
container: "bg-neutral-default-disabled border-neutral-default-disabled border cursor-default!",
|
|
89
89
|
label: "text-neutral-default-disabled group-hover:text-neutral-default-disabled group-active:text-neutral-default-disabled",
|
|
90
90
|
icon: "text-neutral-default-disabled group-hover:text-neutral-default-disabled group-active:text-neutral-default-disabled"
|
|
91
91
|
}
|
|
@@ -117,12 +117,12 @@ const M = {
|
|
|
117
117
|
icon: "text-warning-medium-default group-hover:text-warning-medium-hover group-active:text-warning-medium-pressed"
|
|
118
118
|
},
|
|
119
119
|
disabled: {
|
|
120
|
-
container: "bg-transparent border-neutral-default-disabled border-none cursor-
|
|
120
|
+
container: "bg-transparent border-neutral-default-disabled border-none cursor-default! hover:bg-transparent",
|
|
121
121
|
label: "text-neutral-medium-focused group-hover:text-neutral-medium-focused group-active:text-neutral-medium-focused",
|
|
122
122
|
icon: "text-neutral-medium-focused group-hover:text-neutral-medium-focused group-active:text-neutral-medium-focused"
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
},
|
|
125
|
+
}, l = {
|
|
126
126
|
small: {
|
|
127
127
|
container: "",
|
|
128
128
|
label: "prometeo-fonts-label-large",
|
|
@@ -178,18 +178,18 @@ const M = {
|
|
|
178
178
|
}) => {
|
|
179
179
|
const k = f && !o && !t ? "true" : "false", j = b && !o && !t ? "true" : "false", u = o || t ? "disabled" : p, S = V(() => i || (t ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
180
180
|
!h && x,
|
|
181
|
-
/* @__PURE__ */ e.jsx("span", { className: ` ${
|
|
181
|
+
/* @__PURE__ */ e.jsx("span", { className: ` ${l[r].label} ${n[a][u].label} ${r === "small" ? "prometeo-fonts-label-xsmall" : ""}`, children: v })
|
|
182
182
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: `flex items-center gap-1 ${s}`, children: [
|
|
183
183
|
d && /* @__PURE__ */ e.jsx("span", { className: `
|
|
184
184
|
${c.icon}
|
|
185
|
-
${
|
|
186
|
-
${
|
|
185
|
+
${n[a][u].icon}
|
|
186
|
+
${l[r].icon}
|
|
187
187
|
${C[k].icon}
|
|
188
188
|
`, children: d }),
|
|
189
189
|
/* @__PURE__ */ e.jsx("span", { className: `
|
|
190
190
|
${c.label}
|
|
191
|
-
${
|
|
192
|
-
${
|
|
191
|
+
${n[a][u].label}
|
|
192
|
+
${l[r].label}
|
|
193
193
|
`, children: m })
|
|
194
194
|
] })), [i, s, d, m, a, p, r]);
|
|
195
195
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -199,9 +199,9 @@ const M = {
|
|
|
199
199
|
className: `
|
|
200
200
|
group
|
|
201
201
|
${c.container}
|
|
202
|
-
${
|
|
202
|
+
${l[r].container}
|
|
203
203
|
${M[r].container}
|
|
204
|
-
${
|
|
204
|
+
${n[a][u].container}
|
|
205
205
|
${A[j].container}
|
|
206
206
|
${y}
|
|
207
207
|
`,
|
|
@@ -3,8 +3,8 @@ import { Icons as x } from "./Icons.es.js";
|
|
|
3
3
|
import { c as r } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { useField as h, ErrorMessage as p } from "formik";
|
|
5
5
|
import { useState as b } from "react";
|
|
6
|
-
const k = ({ label: c, className: d, containerClassName: m, id: o, disabled:
|
|
7
|
-
const [a, l] = h({ ...t, type: "checkbox" }), [u, i] = b(!1),
|
|
6
|
+
const k = ({ label: c, className: d, containerClassName: m, id: o, disabled: s = !1, ...t }) => {
|
|
7
|
+
const [a, l] = h({ ...t, type: "checkbox" }), [u, i] = b(!1), n = l.touched && l.error;
|
|
8
8
|
return /* @__PURE__ */ e.jsxs("div", { className: r("relative w-full", m), children: [
|
|
9
9
|
/* @__PURE__ */ e.jsxs(
|
|
10
10
|
"label",
|
|
@@ -12,7 +12,7 @@ const k = ({ label: c, className: d, containerClassName: m, id: o, disabled: n =
|
|
|
12
12
|
htmlFor: o || t.name,
|
|
13
13
|
className: r(
|
|
14
14
|
"flex items-center gap-3 cursor-pointer transition-all duration-200 ease-in-out",
|
|
15
|
-
|
|
15
|
+
s ? "cursor-default opacity-60" : "hover:opacity-80",
|
|
16
16
|
d
|
|
17
17
|
),
|
|
18
18
|
children: [
|
|
@@ -31,7 +31,7 @@ const k = ({ label: c, className: d, containerClassName: m, id: o, disabled: n =
|
|
|
31
31
|
onBlur: (f) => {
|
|
32
32
|
i(!1), t.onBlur?.(), a.onBlur(f);
|
|
33
33
|
},
|
|
34
|
-
disabled:
|
|
34
|
+
disabled: s,
|
|
35
35
|
className: r(
|
|
36
36
|
"sr-only"
|
|
37
37
|
)
|
|
@@ -42,8 +42,8 @@ const k = ({ label: c, className: d, containerClassName: m, id: o, disabled: n =
|
|
|
42
42
|
{
|
|
43
43
|
className: r(
|
|
44
44
|
"w-5 h-5 rounded border-2 transition-all duration-200 ease-in-out flex items-center justify-center",
|
|
45
|
-
a.value ? "bg-primary-default-default border-primary-default-default" : u ? "border-primary-default-default bg-transparent" :
|
|
46
|
-
|
|
45
|
+
a.value ? "bg-primary-default-default border-primary-default-default" : u ? "border-primary-default-default bg-transparent" : n ? "border-error-default-default bg-transparent" : "border-neutral-default-default bg-transparent hover:border-neutral-strong-default",
|
|
46
|
+
s && "bg-neutral-medium-default border-neutral-medium-default"
|
|
47
47
|
),
|
|
48
48
|
children: a.value && /* @__PURE__ */ e.jsx(
|
|
49
49
|
x.Check,
|
|
@@ -51,7 +51,7 @@ const k = ({ label: c, className: d, containerClassName: m, id: o, disabled: n =
|
|
|
51
51
|
size: 14,
|
|
52
52
|
className: r(
|
|
53
53
|
"text-white transition-all duration-200 ease-in-out",
|
|
54
|
-
|
|
54
|
+
s && "text-neutral-strong-default"
|
|
55
55
|
)
|
|
56
56
|
}
|
|
57
57
|
)
|
|
@@ -64,8 +64,8 @@ const k = ({ label: c, className: d, containerClassName: m, id: o, disabled: n =
|
|
|
64
64
|
{
|
|
65
65
|
className: r(
|
|
66
66
|
"text-sm transition-colors duration-200 ease-in-out select-none",
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
n && "text-error-default-default",
|
|
68
|
+
s && "text-neutral-medium-default"
|
|
69
69
|
),
|
|
70
70
|
children: c
|
|
71
71
|
}
|
|
@@ -73,7 +73,7 @@ const k = ({ label: c, className: d, containerClassName: m, id: o, disabled: n =
|
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
|
-
|
|
76
|
+
n && /* @__PURE__ */ e.jsx(
|
|
77
77
|
p,
|
|
78
78
|
{
|
|
79
79
|
name: t.name,
|
package/dist/DatePicker.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as q } from "./jsx-runtime-DKDX3adD.js";
|
|
2
2
|
import m, { createContext as mn, useContext as hn, useCallback as R, useRef as Se, useLayoutEffect as yn, useState as he, useEffect as _e, useMemo as fe, memo as pn } from "react";
|
|
3
3
|
import { InputMultiple as gn } from "./InputMultiple.es.js";
|
|
4
|
-
import { I as wn } from "./Input-
|
|
4
|
+
import { I as wn } from "./Input-BTsR-vNF.js";
|
|
5
5
|
import { createPortal as bn } from "react-dom";
|
|
6
6
|
import { Icons as Mt } from "./Icons.es.js";
|
|
7
7
|
import { c as Be } from "./cn-B6yFEsav.js";
|
|
8
|
-
import { B as vt } from "./Button-
|
|
8
|
+
import { B as vt } from "./Button-CvBWH1HX.js";
|
|
9
9
|
function Mn(e, t, n = "long") {
|
|
10
10
|
return new Intl.DateTimeFormat("en-US", {
|
|
11
11
|
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
package/dist/DrawerDesktop.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as l } from "./jsx-runtime-DKDX3adD.js";
|
|
2
2
|
import { c as h } from "./cn-B6yFEsav.js";
|
|
3
|
-
import { c as k, B as E } from "./Button-
|
|
3
|
+
import { c as k, B as E } from "./Button-CvBWH1HX.js";
|
|
4
4
|
import { createPortal as I } from "react-dom";
|
|
5
5
|
import { Icons as V } from "./Icons.es.js";
|
|
6
6
|
import { forwardRef as B, useRef as u, useState as N, useEffect as d, useCallback as f, useImperativeHandle as P } from "react";
|
package/dist/DropZone.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-DKDX3adD.js";
|
|
2
2
|
import { c as i } from "./cn-B6yFEsav.js";
|
|
3
|
-
import R, { useCallback as
|
|
4
|
-
import { useDropzone as
|
|
3
|
+
import R, { useCallback as z } from "react";
|
|
4
|
+
import { useDropzone as w } from "react-dropzone";
|
|
5
5
|
import { Icons as u } from "./Icons.es.js";
|
|
6
6
|
const E = R.forwardRef(
|
|
7
7
|
({
|
|
@@ -17,7 +17,7 @@ const E = R.forwardRef(
|
|
|
17
17
|
maxFiles: j = 1,
|
|
18
18
|
...N
|
|
19
19
|
}, b) => {
|
|
20
|
-
const y =
|
|
20
|
+
const y = z((s, o) => {
|
|
21
21
|
s.length > 0 && d?.(s), o.length > 0 && m?.(o);
|
|
22
22
|
}, [d, m]), {
|
|
23
23
|
getRootProps: D,
|
|
@@ -25,7 +25,7 @@ const E = R.forwardRef(
|
|
|
25
25
|
isDragActive: a,
|
|
26
26
|
isDragReject: t,
|
|
27
27
|
fileRejections: n
|
|
28
|
-
} =
|
|
28
|
+
} = w({
|
|
29
29
|
onDrop: y,
|
|
30
30
|
accept: g,
|
|
31
31
|
maxFiles: j,
|
|
@@ -54,7 +54,7 @@ const E = R.forwardRef(
|
|
|
54
54
|
"ring-2 ring-destructive/20"
|
|
55
55
|
],
|
|
56
56
|
l && [
|
|
57
|
-
"cursor-
|
|
57
|
+
"cursor-default opacity-60",
|
|
58
58
|
"border-muted-foreground/20 bg-muted/30"
|
|
59
59
|
]
|
|
60
60
|
),
|
package/dist/FAButton.es.js
CHANGED
|
@@ -30,7 +30,7 @@ const v = {
|
|
|
30
30
|
error: "text-error-default-default hover:text-error-default-hover active:text-error-default-pressed",
|
|
31
31
|
warning: "text-warning-default-default hover:text-warning-default-hover active:text-warning-default-pressed"
|
|
32
32
|
}
|
|
33
|
-
}, h = "bg-primary-default-disabled text-neutral-default-disabled hover:bg-primary-default-disabled active:bg-primary-default-disabled cursor-
|
|
33
|
+
}, h = "bg-primary-default-disabled text-neutral-default-disabled hover:bg-primary-default-disabled active:bg-primary-default-disabled cursor-default", g = (e) => {
|
|
34
34
|
const t = e.position || v, r = e.attachToParent || !1, o = e.color || "primary", l = e.icon || f.Add, a = e.disabled || !1, u = e.variant || "filled", d = /* @__PURE__ */ i.jsx(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-DKDX3adD.js";
|
|
|
2
2
|
import ee, { memo as D, forwardRef as L, useRef as v, useEffect as te, useCallback as i, useState as R, useImperativeHandle as ne } from "react";
|
|
3
3
|
import { c as X } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { u as re } from "./useDragScroll-CHN9OMwn.js";
|
|
5
|
-
import { B as S } from "./Button-
|
|
5
|
+
import { B as S } from "./Button-CvBWH1HX.js";
|
|
6
6
|
import { Icons as M } from "./Icons.es.js";
|
|
7
7
|
const O = D(L(({ images: n, className: c }, r) => {
|
|
8
8
|
const { ref: d, bind: a } = re({
|
package/dist/ImageGallery.es.js
CHANGED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
+
import { Icons as H } from "./Icons.es.js";
|
|
3
|
+
import { c as r } from "./cn-B6yFEsav.js";
|
|
4
|
+
import { useRef as T, useLayoutEffect as ge, memo as xe, forwardRef as be, useState as V, useCallback as he, useEffect as v } from "react";
|
|
5
|
+
import { useDebounce as we } from "use-debounce";
|
|
6
|
+
import ye from "./Spinner.es.js";
|
|
7
|
+
import { H as je } from "./HelperComponent-U6mPwuDH.js";
|
|
8
|
+
import Ce from "./ButtonV2.es.js";
|
|
9
|
+
const ze = (o) => {
|
|
10
|
+
let t = o;
|
|
11
|
+
for (; t && t !== document.body; ) {
|
|
12
|
+
const l = window.getComputedStyle(t).backgroundColor;
|
|
13
|
+
if (l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)")
|
|
14
|
+
return l;
|
|
15
|
+
t = t.parentElement;
|
|
16
|
+
}
|
|
17
|
+
const s = window.getComputedStyle(document.body).backgroundColor;
|
|
18
|
+
return s && s !== "transparent" && s !== "rgba(0, 0, 0, 0)" ? s : "rgb(255, 255, 255)";
|
|
19
|
+
};
|
|
20
|
+
function Ne() {
|
|
21
|
+
const o = T(null);
|
|
22
|
+
return ge(() => {
|
|
23
|
+
if (!o.current || !o.current.parentElement) return;
|
|
24
|
+
const t = ze(o.current.parentElement);
|
|
25
|
+
o.current.style.backgroundColor = t;
|
|
26
|
+
}, []), {
|
|
27
|
+
ref: o
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const b = {
|
|
31
|
+
default: {
|
|
32
|
+
container: "",
|
|
33
|
+
input: r(
|
|
34
|
+
"border-neutral-default-default text-neutral-default-default!",
|
|
35
|
+
"focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
|
|
36
|
+
"hover:border-neutral-strong-default"
|
|
37
|
+
),
|
|
38
|
+
label: r(
|
|
39
|
+
"text-neutral-medium-default"
|
|
40
|
+
),
|
|
41
|
+
icon: r(
|
|
42
|
+
"text-neutral-medium-default",
|
|
43
|
+
"peer-focus:text-primary-default-default"
|
|
44
|
+
)
|
|
45
|
+
},
|
|
46
|
+
error: {
|
|
47
|
+
container: "",
|
|
48
|
+
input: r(
|
|
49
|
+
"border-error-default-default text-neutral-default-default",
|
|
50
|
+
"focus:border-error-default focus:border-2",
|
|
51
|
+
"focus:ring-0 focus:ring-error-default/20"
|
|
52
|
+
),
|
|
53
|
+
label: r(
|
|
54
|
+
"text-lime-500",
|
|
55
|
+
"peer-focus:text-error-light"
|
|
56
|
+
),
|
|
57
|
+
icon: r(
|
|
58
|
+
"text-error-light",
|
|
59
|
+
"peer-focus:text-error-light"
|
|
60
|
+
)
|
|
61
|
+
},
|
|
62
|
+
success: {
|
|
63
|
+
container: "",
|
|
64
|
+
input: r(
|
|
65
|
+
"border-success-default-default text-neutral-default-default",
|
|
66
|
+
"focus:border-success-default focus:border-2",
|
|
67
|
+
"focus:ring-0 focus:ring-success-default/20"
|
|
68
|
+
),
|
|
69
|
+
label: r(
|
|
70
|
+
"text-success",
|
|
71
|
+
"peer-focus:text-success-light"
|
|
72
|
+
),
|
|
73
|
+
icon: r(
|
|
74
|
+
"text-success-light",
|
|
75
|
+
"peer-focus:text-success-light"
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
}, F = be(({
|
|
79
|
+
label: o,
|
|
80
|
+
icon: t,
|
|
81
|
+
iconPosition: s = "left",
|
|
82
|
+
onChange: h,
|
|
83
|
+
value: l = "",
|
|
84
|
+
debounceMs: p = 0,
|
|
85
|
+
name: w,
|
|
86
|
+
width: g = "100%",
|
|
87
|
+
height: c,
|
|
88
|
+
variant: f = "default",
|
|
89
|
+
labelVariant: a = "default",
|
|
90
|
+
size: G = "medium",
|
|
91
|
+
disabled: x = !1,
|
|
92
|
+
type: n = "text",
|
|
93
|
+
isFetching: d,
|
|
94
|
+
errorComponent: y,
|
|
95
|
+
helperComponent: j,
|
|
96
|
+
placeholder: J,
|
|
97
|
+
required: B = !1,
|
|
98
|
+
onFocus: K,
|
|
99
|
+
onBlur: Q,
|
|
100
|
+
onEmptied: $,
|
|
101
|
+
onKeyDown: U,
|
|
102
|
+
onKeyUp: W,
|
|
103
|
+
className: X,
|
|
104
|
+
isActive: C,
|
|
105
|
+
style: Y,
|
|
106
|
+
readOnly: Z = !1,
|
|
107
|
+
onClear: L,
|
|
108
|
+
..._
|
|
109
|
+
}, q) => {
|
|
110
|
+
const [z, P] = V(l), [N] = we(z, p), [I, A] = V(!1), { ref: M } = Ne(), ee = T(null), E = q || null || ee;
|
|
111
|
+
let i = G;
|
|
112
|
+
c && (i = "customHeight");
|
|
113
|
+
const m = {
|
|
114
|
+
small: {
|
|
115
|
+
container: "text-sm",
|
|
116
|
+
input: "h-10 px-3 text-[1rem] prometeo-fonts-body-large",
|
|
117
|
+
label: ` prometeo-fonts-label-large
|
|
118
|
+
peer-focus:prometeo-fonts-label-large
|
|
119
|
+
peer-placeholder-shown:${a === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default peer-focus:text-neutral-medium-default `,
|
|
120
|
+
icon: "w-4 h-4 right-3"
|
|
121
|
+
},
|
|
122
|
+
medium: {
|
|
123
|
+
container: "text-base",
|
|
124
|
+
input: "h-12 px-3 prometeo-fonts-body-large",
|
|
125
|
+
label: ` prometeo-fonts-label-large
|
|
126
|
+
peer-focus:prometeo-fonts-label-large
|
|
127
|
+
peer-placeholder-shown:${a === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default text-neutral-medium-default peer-focus:text-neutral-medium-default `,
|
|
128
|
+
icon: "w-5 h-5 right-3"
|
|
129
|
+
},
|
|
130
|
+
large: {
|
|
131
|
+
container: "text-lg",
|
|
132
|
+
input: "h-14 px-3 text-lg border-b border-t-0 border-x-0 rounded-none focus:ring-0 prometeo-fonts-body-xlarge ",
|
|
133
|
+
label: "peer-placeholder-shown:prometeo-fonts-body-xlarge peer-focus:prometeo-fonts-label-large peer-focus:text-neutral-medium-default prometeo-fonts-label-large ",
|
|
134
|
+
icon: "w-6 h-6 right-3"
|
|
135
|
+
},
|
|
136
|
+
customHeight: {
|
|
137
|
+
container: "text-base",
|
|
138
|
+
input: "text-base",
|
|
139
|
+
label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-xs ",
|
|
140
|
+
icon: "w-6 h-6 right-3"
|
|
141
|
+
}
|
|
142
|
+
}, D = he(h, []);
|
|
143
|
+
v(() => {
|
|
144
|
+
p > 0 && N !== l && D(N);
|
|
145
|
+
}, [N, p, D, l]), v(() => {
|
|
146
|
+
P(l);
|
|
147
|
+
}, [l]), v(() => {
|
|
148
|
+
C && E.current?.focus();
|
|
149
|
+
}, [C, E.current?.focus]);
|
|
150
|
+
const te = (u) => {
|
|
151
|
+
K?.(u);
|
|
152
|
+
}, re = (u) => {
|
|
153
|
+
C === void 0 && Q?.(u);
|
|
154
|
+
}, oe = (u) => {
|
|
155
|
+
const k = u.target.value, ie = u.target.name, me = z;
|
|
156
|
+
P(k), me.length > 0 && k.length === 0 && $?.(), (!p || p === 0) && h(k, ie);
|
|
157
|
+
}, le = () => {
|
|
158
|
+
A(!I);
|
|
159
|
+
}, R = {};
|
|
160
|
+
g && g !== "100%" && (R.width = g), c && (R.height = c);
|
|
161
|
+
const O = f === "error" && y, se = !O && j, ne = n === "password", ae = () => a === "static" ? "-top-1 -translate-y-full left-0 pl-3" : t ? `peer-placeholder-shown:top-1/2 -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1 peer-focus:ml-0 peer-focus:mr-0 ${s === "left" ? "peer-placeholder-shown:ml-6" : "peer-placeholder-shown:mr-6"}` : "peer-placeholder-shown:top-1/2 -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1", ue = () => c ? m.customHeight.label : m[i].label, ce = () => c ? { height: c } : {}, fe = () => a === "default" ? o : J || o || "", pe = () => ne ? t ? s === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : t ? s === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", de = a === "default" && "transition-all duration-200 ease-in-out", S = y || j;
|
|
162
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
className: r(
|
|
166
|
+
"relative",
|
|
167
|
+
m[i].container,
|
|
168
|
+
!g && "w-full",
|
|
169
|
+
"bg-inherit",
|
|
170
|
+
a === "static" && "mt-2",
|
|
171
|
+
X
|
|
172
|
+
),
|
|
173
|
+
style: { ...Y, ...R },
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ e.jsx(
|
|
176
|
+
"input",
|
|
177
|
+
{
|
|
178
|
+
id: w,
|
|
179
|
+
name: w,
|
|
180
|
+
ref: E,
|
|
181
|
+
value: z,
|
|
182
|
+
placeholder: fe(),
|
|
183
|
+
type: n === "password" && I ? "text" : n,
|
|
184
|
+
className: r(
|
|
185
|
+
"peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
|
|
186
|
+
"focus:outline-none px-3",
|
|
187
|
+
a === "default" && "placeholder:text-transparent",
|
|
188
|
+
a === "static" && "placeholder:text-neutral-medium-default ",
|
|
189
|
+
b[f].input,
|
|
190
|
+
m[i].input,
|
|
191
|
+
t && "pr-10",
|
|
192
|
+
x && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
|
|
193
|
+
b[f].container,
|
|
194
|
+
pe()
|
|
195
|
+
),
|
|
196
|
+
style: ce(),
|
|
197
|
+
onChange: oe,
|
|
198
|
+
onFocus: te,
|
|
199
|
+
onBlur: re,
|
|
200
|
+
disabled: x,
|
|
201
|
+
required: B,
|
|
202
|
+
onEmptied: $,
|
|
203
|
+
onKeyDown: U,
|
|
204
|
+
onKeyUp: W,
|
|
205
|
+
readOnly: Z,
|
|
206
|
+
..._
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
/* @__PURE__ */ e.jsx(
|
|
210
|
+
"label",
|
|
211
|
+
{
|
|
212
|
+
ref: M,
|
|
213
|
+
htmlFor: w,
|
|
214
|
+
className: r(
|
|
215
|
+
"absolute left-3 pointer-events-none px-1 z-10",
|
|
216
|
+
de,
|
|
217
|
+
ue(),
|
|
218
|
+
b[f].label,
|
|
219
|
+
ae(),
|
|
220
|
+
B && "after:content-['*'] after:text-error-default after:ml-1",
|
|
221
|
+
x && "text-neutral-medium-disabled prometeo-fonts-label-large"
|
|
222
|
+
),
|
|
223
|
+
children: o
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
(t || n === "password" || d) && /* @__PURE__ */ e.jsx(
|
|
227
|
+
"button",
|
|
228
|
+
{
|
|
229
|
+
tabIndex: -1,
|
|
230
|
+
type: "button",
|
|
231
|
+
className: r(
|
|
232
|
+
`absolute ${S ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10`,
|
|
233
|
+
m[i].icon,
|
|
234
|
+
b[f].icon,
|
|
235
|
+
n === "password" && !d ? "cursor-pointer" : "pointer-events-none",
|
|
236
|
+
s === "right" ? "right-3" : "left-3"
|
|
237
|
+
),
|
|
238
|
+
onClick: n === "password" && !d ? le : void 0,
|
|
239
|
+
onMouseDown: (u) => n === "password" && !d && u.preventDefault(),
|
|
240
|
+
children: /* @__PURE__ */ e.jsx("div", { children: d && n !== "password" ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(ye, { size: 24, color: "#7c86ff", loading: !0, variant: "clip" }) }) : n === "password" ? I ? /* @__PURE__ */ e.jsx(H.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ e.jsx(H.EyeVisibilityOff, { size: 24, className: "" }) : t })
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
L && /* @__PURE__ */ e.jsx(
|
|
244
|
+
Ce,
|
|
245
|
+
{
|
|
246
|
+
type: "button",
|
|
247
|
+
color: "secondary",
|
|
248
|
+
size: "small",
|
|
249
|
+
animate: !1,
|
|
250
|
+
className: r(
|
|
251
|
+
`absolute ${S ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10 right-1`,
|
|
252
|
+
"size-6 p-4 ",
|
|
253
|
+
"bg-inherit",
|
|
254
|
+
"hover:bg-transparent! p-4 rounded-full"
|
|
255
|
+
),
|
|
256
|
+
label: "",
|
|
257
|
+
disabled: x,
|
|
258
|
+
onClick: L,
|
|
259
|
+
variant: "text",
|
|
260
|
+
animateIcon: !1,
|
|
261
|
+
icon: /* @__PURE__ */ e.jsx(H.Close, { size: 20, className: "" })
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
S && /* @__PURE__ */ e.jsx("div", { className: "min-h-6", children: (O || se) && /* @__PURE__ */ e.jsx(
|
|
265
|
+
je,
|
|
266
|
+
{
|
|
267
|
+
className: "absolute ",
|
|
268
|
+
variant: f,
|
|
269
|
+
children: y || j
|
|
270
|
+
}
|
|
271
|
+
) })
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
) });
|
|
275
|
+
});
|
|
276
|
+
F.displayName = "Input";
|
|
277
|
+
const Le = xe(F);
|
|
278
|
+
export {
|
|
279
|
+
Le as I,
|
|
280
|
+
Ne as u
|
|
281
|
+
};
|
package/dist/Input.es.js
CHANGED
package/dist/InputFormikV2.es.js
CHANGED
package/dist/Pagination.es.js
CHANGED
|
@@ -5,7 +5,7 @@ function h({
|
|
|
5
5
|
totalPages: l = 0,
|
|
6
6
|
onPageChange: p
|
|
7
7
|
}) {
|
|
8
|
-
const
|
|
8
|
+
const n = (e) => {
|
|
9
9
|
e >= 1 && e <= l && e !== i && p?.(e);
|
|
10
10
|
}, d = (() => {
|
|
11
11
|
const e = [];
|
|
@@ -35,13 +35,13 @@ function h({
|
|
|
35
35
|
{
|
|
36
36
|
whileHover: { scale: 1.05 },
|
|
37
37
|
whileTap: { scale: 0.95 },
|
|
38
|
-
onClick: () =>
|
|
38
|
+
onClick: () => n(i - 1),
|
|
39
39
|
disabled: i === 1,
|
|
40
|
-
className: "px-4 py-2 text-primary-medium-default hover:text-primary-default-default disabled:text-gray-600 disabled:cursor-
|
|
40
|
+
className: "px-4 py-2 text-primary-medium-default hover:text-primary-default-default disabled:text-gray-600 disabled:cursor-default transition-colors cursor-pointer",
|
|
41
41
|
children: "Anterior"
|
|
42
42
|
}
|
|
43
43
|
),
|
|
44
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-1 select-none", children: d.map((e,
|
|
44
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-1 select-none", children: d.map((e, o) => {
|
|
45
45
|
if (e === "ellipsis")
|
|
46
46
|
return /* @__PURE__ */ t.jsx(
|
|
47
47
|
"span",
|
|
@@ -49,7 +49,7 @@ function h({
|
|
|
49
49
|
className: "px-3 py-2 text-neutral-default-default",
|
|
50
50
|
children: "..."
|
|
51
51
|
},
|
|
52
|
-
`ellipsis-${
|
|
52
|
+
`ellipsis-${o}`
|
|
53
53
|
);
|
|
54
54
|
const s = e, r = s === i;
|
|
55
55
|
return /* @__PURE__ */ t.jsxs(
|
|
@@ -57,7 +57,7 @@ function h({
|
|
|
57
57
|
{
|
|
58
58
|
whileHover: r ? {} : { scale: 1.1 },
|
|
59
59
|
whileTap: r ? {} : { scale: 0.9 },
|
|
60
|
-
onClick: () =>
|
|
60
|
+
onClick: () => n(s),
|
|
61
61
|
className: `relative px-3 py-2 min-w-[40px] text-center transition-colors ${r ? "text-primary-default-default" : "text-neutral-default-default hover:text-white cursor-pointer "}`,
|
|
62
62
|
children: [
|
|
63
63
|
r && /* @__PURE__ */ t.jsx(
|
|
@@ -84,9 +84,9 @@ function h({
|
|
|
84
84
|
{
|
|
85
85
|
whileHover: { scale: 1.05 },
|
|
86
86
|
whileTap: { scale: 0.95 },
|
|
87
|
-
onClick: () =>
|
|
87
|
+
onClick: () => n(i + 1),
|
|
88
88
|
disabled: i === l,
|
|
89
|
-
className: "px-4 py-2 text-primary-medium-default hover:text-primary-default-default disabled:text-gray-600 disabled:cursor-
|
|
89
|
+
className: "px-4 py-2 text-primary-medium-default hover:text-primary-default-default disabled:text-gray-600 disabled:cursor-default transition-colors cursor-pointer",
|
|
90
90
|
children: "Siguiente"
|
|
91
91
|
}
|
|
92
92
|
)
|