prometeo-design-system 2.6.1 → 2.6.2
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/CheckBox.es.js +27 -24
- package/dist/DatePicker.es.js +276 -272
- package/dist/FAButton.d.ts +4 -0
- package/dist/FAButton.es.js +60 -0
- package/dist/HelperComponent-8ErmQ_n9.js +24 -0
- package/dist/Input-r2N9xkjM.js +280 -0
- package/dist/Input.es.js +1 -1
- package/dist/InputFormikV2.d.ts +6 -0
- package/dist/InputFormikV2.es.js +29 -0
- package/dist/RadioButton.d.ts +2 -0
- package/dist/RadioButton.es.js +77 -0
- package/dist/RadioButtonFormik.d.ts +2 -0
- package/dist/RadioButtonFormik.es.js +30 -0
- package/dist/{Select-B5hkJ8Oy.js → Select-IAQKEfnq.js} +9 -8
- package/dist/Select.es.js +1 -1
- package/dist/SelectFormik.es.js +1 -1
- package/dist/SelectSearch.es.js +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +34 -0
- package/dist/components/RadioButton/RadioButton.d.ts +12 -0
- package/dist/components/RadioButtonFormik/RadioButtonFormik.d.ts +8 -0
- package/dist/components/RecurrentDatePicker/FrequencySettings.d.ts +6 -0
- package/dist/components/RecurrentDatePicker/PreviewCalendar.d.ts +2 -0
- package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +7 -0
- package/dist/components/RecurrentDatePicker/WeekdaysSelector.d.ts +11 -0
- package/dist/exports/RadioButton.d.ts +1 -0
- package/dist/exports/RadioButtonFormik.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/pages/RecurrentDatePicker.page.d.ts +2 -0
- package/dist/preview/RadioButtonPreview.d.ts +2 -0
- package/dist/preview/RecurrentDatePickerPreview.d.ts +2 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +286 -355
- package/package.json +9 -1
- package/src/styles/intellisense.css +1 -0
- package/dist/Input-DHdy-pWf.js +0 -295
- package/dist/components/Select copy/Select.d.ts +0 -71
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { j as i } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
+
import s, { memo as c } from "react";
|
|
3
|
+
import { c as n } from "./cn-B6yFEsav.js";
|
|
4
|
+
import { Icons as f } from "./Icons.es.js";
|
|
5
|
+
import { createPortal as m } from "react-dom";
|
|
6
|
+
const v = {
|
|
7
|
+
right: 24,
|
|
8
|
+
bottom: 64,
|
|
9
|
+
left: "auto",
|
|
10
|
+
top: "auto"
|
|
11
|
+
}, b = {
|
|
12
|
+
filled: {
|
|
13
|
+
primary: "bg-primary-default-default hover:bg-primary-default-hover active:bg-primary-default-pressed",
|
|
14
|
+
secondary: "bg-neutral-medium-default hover:bg-neutral-medium-hover active:bg-neutral-medium-pressed",
|
|
15
|
+
success: "bg-success-default-default hover:bg-success-default-hover active:bg-success-default-pressed",
|
|
16
|
+
error: "bg-error-default-default hover:bg-error-default-hover active:bg-error-default-pressed",
|
|
17
|
+
warning: "bg-warning-default-default hover:bg-warning-default-hover active:bg-warning-default-pressed"
|
|
18
|
+
},
|
|
19
|
+
outlined: {
|
|
20
|
+
primary: "border border-primary-default-default hover:border-primary-default-hover active:border-primary-default-pressed text-primary-default-default hover:text-primary-default-hover active:text-primary-default-pressed",
|
|
21
|
+
secondary: "border border-neutral-medium-default hover:border-neutral-medium-hover active:border-neutral-medium-pressed text-neutral-medium-default hover:text-neutral-medium-hover active:text-neutral-medium-pressed",
|
|
22
|
+
success: "border border-success-default-default hover:border-success-default-hover active:border-success-default-pressed text-success-default-default hover:text-success-default-hover active:text-success-default-pressed",
|
|
23
|
+
error: "border border-error-default-default hover:border-error-default-hover active:border-error-default-pressed text-error-default-default hover:text-error-default-hover active:text-error-default-pressed",
|
|
24
|
+
warning: "border border-warning-default-default hover:border-warning-default-hover active:border-warning-default-pressed text-warning-default-default hover:text-warning-default-hover active:text-warning-default-pressed"
|
|
25
|
+
},
|
|
26
|
+
text: {
|
|
27
|
+
primary: "text-primary-default-default hover:text-primary-default-hover active:text-primary-default-pressed",
|
|
28
|
+
secondary: "text-neutral-medium-default hover:text-neutral-medium-hover active:text-neutral-medium-pressed",
|
|
29
|
+
success: "text-success-default-default hover:text-success-default-hover active:text-success-default-pressed",
|
|
30
|
+
error: "text-error-default-default hover:text-error-default-hover active:text-error-default-pressed",
|
|
31
|
+
warning: "text-warning-default-default hover:text-warning-default-hover active:text-warning-default-pressed"
|
|
32
|
+
}
|
|
33
|
+
}, h = "bg-primary-default-disabled text-neutral-default-disabled hover:bg-primary-default-disabled active:bg-primary-default-disabled cursor-not-allowed", g = (e) => {
|
|
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
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
style: {
|
|
38
|
+
width: "56px",
|
|
39
|
+
height: "56px",
|
|
40
|
+
borderRadius: "8px",
|
|
41
|
+
position: r ? "absolute" : "fixed",
|
|
42
|
+
right: t.right,
|
|
43
|
+
bottom: t.bottom,
|
|
44
|
+
left: t.left,
|
|
45
|
+
top: t.top,
|
|
46
|
+
display: "grid",
|
|
47
|
+
placeItems: "center",
|
|
48
|
+
padding: 16
|
|
49
|
+
},
|
|
50
|
+
className: n("transition-all duration-300 cursor-pointer text-neutral-default-default", b[u][o], a && h, e.className),
|
|
51
|
+
onClick: a ? void 0 : e.onClick,
|
|
52
|
+
children: s.createElement(l, { size: 24 })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
return r ? d : m(d, document.body);
|
|
56
|
+
}, x = c(g, (e, t) => e.attachToParent === t.attachToParent && e.position === t.position && e.color === t.color && e.icon === t.icon && e.disabled === t.disabled && e.variant === t.variant && e.className === t.className && e.onClick === t.onClick);
|
|
57
|
+
x.displayName = "FAButton";
|
|
58
|
+
export {
|
|
59
|
+
x as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
+
import { memo as i } from "react";
|
|
3
|
+
import { c as a } from "./cn-B6yFEsav.js";
|
|
4
|
+
import { Icons as t } from "./Icons.es.js";
|
|
5
|
+
const m = (s) => {
|
|
6
|
+
const { variant: r, className: l } = s, c = {
|
|
7
|
+
default: "text-neutral-medium-default pt-[1px]",
|
|
8
|
+
error: "text-error-medium-default pt-[1px]",
|
|
9
|
+
success: "text-success-medium-default"
|
|
10
|
+
}, o = {
|
|
11
|
+
default: /* @__PURE__ */ e.jsx(t.Info, { size: 16, className: "text-neutral-medium-default " }),
|
|
12
|
+
error: /* @__PURE__ */ e.jsx(t.Error, { size: 16, className: "text-error-medium-default" }),
|
|
13
|
+
success: /* @__PURE__ */ e.jsx(t.Check, { size: 16, className: "text-success-medium-default" })
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ e.jsx("div", { ref: s.ref, className: a("pl-3 mt-1", l), children: typeof s.children == "string" ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-0.5 items-start", children: [
|
|
16
|
+
o[r],
|
|
17
|
+
/* @__PURE__ */ e.jsx("p", { className: a(" prometeo-fonts-body-small", c[r]), children: s.children })
|
|
18
|
+
] }) : s.children });
|
|
19
|
+
};
|
|
20
|
+
m.displayName = "HelperText";
|
|
21
|
+
const f = i(m);
|
|
22
|
+
export {
|
|
23
|
+
f as H
|
|
24
|
+
};
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
+
import { Icons as R } from "./Icons.es.js";
|
|
3
|
+
import { c as r } from "./cn-B6yFEsav.js";
|
|
4
|
+
import { useRef as T, useLayoutEffect as me, memo as ge, forwardRef as xe, useState as O, useCallback as be, useEffect as S } from "react";
|
|
5
|
+
import { useDebounce as he } from "use-debounce";
|
|
6
|
+
import we from "./Spinner.es.js";
|
|
7
|
+
import { H as ye } from "./HelperComponent-8ErmQ_n9.js";
|
|
8
|
+
import { B as je } from "./Button-Bc0LYLfg.js";
|
|
9
|
+
const Ce = (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 ze() {
|
|
21
|
+
const o = T(null);
|
|
22
|
+
return me(() => {
|
|
23
|
+
if (!o.current || !o.current.parentElement) return;
|
|
24
|
+
const t = Ce(o.current.parentElement);
|
|
25
|
+
o.current.style.backgroundColor = t;
|
|
26
|
+
}, []), {
|
|
27
|
+
ref: o
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const x = {
|
|
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-error-light",
|
|
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
|
+
}, V = xe(({
|
|
79
|
+
label: o,
|
|
80
|
+
icon: t,
|
|
81
|
+
iconPosition: s = "left",
|
|
82
|
+
onChange: b,
|
|
83
|
+
value: l = "",
|
|
84
|
+
debounceMs: d = 0,
|
|
85
|
+
name: h,
|
|
86
|
+
width: g = "100%",
|
|
87
|
+
height: c,
|
|
88
|
+
variant: f = "default",
|
|
89
|
+
labelVariant: a = "default",
|
|
90
|
+
size: F = "medium",
|
|
91
|
+
disabled: w = !1,
|
|
92
|
+
type: n = "text",
|
|
93
|
+
isFetching: p,
|
|
94
|
+
errorComponent: k,
|
|
95
|
+
helperComponent: B,
|
|
96
|
+
placeholder: G,
|
|
97
|
+
required: v = !1,
|
|
98
|
+
onFocus: J,
|
|
99
|
+
onBlur: K,
|
|
100
|
+
onEmptied: H,
|
|
101
|
+
onKeyDown: Q,
|
|
102
|
+
onKeyUp: U,
|
|
103
|
+
className: W,
|
|
104
|
+
isActive: y,
|
|
105
|
+
style: X,
|
|
106
|
+
readOnly: Y = !1,
|
|
107
|
+
onClear: L,
|
|
108
|
+
...Z
|
|
109
|
+
}, _) => {
|
|
110
|
+
const [j, P] = O(l), [C] = he(j, d), [z, q] = O(!1), { ref: A } = ze(), M = T(null), N = _ || null || M;
|
|
111
|
+
let i = F;
|
|
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
|
+
}, $ = be(b, []);
|
|
143
|
+
S(() => {
|
|
144
|
+
d > 0 && C !== l && $(C);
|
|
145
|
+
}, [C, d, $, l]), S(() => {
|
|
146
|
+
P(l);
|
|
147
|
+
}, [l]), S(() => {
|
|
148
|
+
y && N.current?.focus();
|
|
149
|
+
}, [y, N.current?.focus]);
|
|
150
|
+
const ee = (u) => {
|
|
151
|
+
J?.(u);
|
|
152
|
+
}, te = (u) => {
|
|
153
|
+
y === void 0 && K?.(u);
|
|
154
|
+
}, re = (u) => {
|
|
155
|
+
const I = u.target.value, pe = u.target.name, ie = j;
|
|
156
|
+
P(I), ie.length > 0 && I.length === 0 && H?.(), (!d || d === 0) && b(I, pe);
|
|
157
|
+
}, oe = () => {
|
|
158
|
+
q(!z);
|
|
159
|
+
}, E = {};
|
|
160
|
+
g && g !== "100%" && (E.width = g), c && (E.height = c);
|
|
161
|
+
const D = f === "error" && k, le = !D && B, se = n === "password", ne = () => 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", ae = () => c ? m.customHeight.label : m[i].label, ue = () => c ? { height: c } : {}, ce = () => a === "default" ? o : G || o || "", fe = () => se ? 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";
|
|
162
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
163
|
+
/* @__PURE__ */ e.jsxs(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: r(
|
|
167
|
+
"relative",
|
|
168
|
+
m[i].container,
|
|
169
|
+
!g && "w-full",
|
|
170
|
+
"bg-inherit",
|
|
171
|
+
a === "static" && "mt-2",
|
|
172
|
+
W
|
|
173
|
+
),
|
|
174
|
+
style: { ...X, ...E },
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ e.jsx(
|
|
177
|
+
"input",
|
|
178
|
+
{
|
|
179
|
+
id: h,
|
|
180
|
+
name: h,
|
|
181
|
+
ref: N,
|
|
182
|
+
value: j,
|
|
183
|
+
placeholder: ce(),
|
|
184
|
+
type: n === "password" && z ? "text" : n,
|
|
185
|
+
className: r(
|
|
186
|
+
"peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
|
|
187
|
+
"focus:outline-none px-3",
|
|
188
|
+
a === "default" && "placeholder:text-transparent",
|
|
189
|
+
a === "static" && "placeholder:text-neutral-medium-default ",
|
|
190
|
+
x[f].input,
|
|
191
|
+
m[i].input,
|
|
192
|
+
t && "pr-10",
|
|
193
|
+
w && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
|
|
194
|
+
x[f].container,
|
|
195
|
+
fe()
|
|
196
|
+
),
|
|
197
|
+
style: ue(),
|
|
198
|
+
onChange: re,
|
|
199
|
+
onFocus: ee,
|
|
200
|
+
onBlur: te,
|
|
201
|
+
disabled: w,
|
|
202
|
+
required: v,
|
|
203
|
+
onEmptied: H,
|
|
204
|
+
onKeyDown: Q,
|
|
205
|
+
onKeyUp: U,
|
|
206
|
+
readOnly: Y,
|
|
207
|
+
...Z
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ e.jsx(
|
|
211
|
+
"label",
|
|
212
|
+
{
|
|
213
|
+
ref: A,
|
|
214
|
+
htmlFor: h,
|
|
215
|
+
className: r(
|
|
216
|
+
"absolute left-3 pointer-events-none px-1 z-10",
|
|
217
|
+
de,
|
|
218
|
+
ae(),
|
|
219
|
+
x[f].label,
|
|
220
|
+
ne(),
|
|
221
|
+
v && "after:content-['*'] after:text-error-default after:ml-1",
|
|
222
|
+
w && "text-neutral-medium-disabled prometeo-fonts-label-large"
|
|
223
|
+
),
|
|
224
|
+
children: o
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
(t || n === "password" || p) && /* @__PURE__ */ e.jsx(
|
|
228
|
+
"button",
|
|
229
|
+
{
|
|
230
|
+
tabIndex: -1,
|
|
231
|
+
type: "button",
|
|
232
|
+
className: r(
|
|
233
|
+
"absolute top-1/2 -translate-y-1/2 flex items-center justify-center z-10",
|
|
234
|
+
m[i].icon,
|
|
235
|
+
x[f].icon,
|
|
236
|
+
n === "password" && !p ? "cursor-pointer" : "pointer-events-none",
|
|
237
|
+
s === "right" ? "right-3" : "left-3"
|
|
238
|
+
),
|
|
239
|
+
onClick: n === "password" && !p ? oe : void 0,
|
|
240
|
+
onMouseDown: (u) => n === "password" && !p && u.preventDefault(),
|
|
241
|
+
children: /* @__PURE__ */ e.jsx("div", { children: p && n !== "password" ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(we, { size: 24, color: "#7c86ff", loading: !0, variant: "clip" }) }) : n === "password" ? z ? /* @__PURE__ */ e.jsx(R.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ e.jsx(R.EyeVisibilityOff, { size: 24, className: "" }) : t })
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
L && /* @__PURE__ */ e.jsx(
|
|
245
|
+
je,
|
|
246
|
+
{
|
|
247
|
+
type: "button",
|
|
248
|
+
color: "secondary",
|
|
249
|
+
size: "small",
|
|
250
|
+
animate: !1,
|
|
251
|
+
className: r(
|
|
252
|
+
"absolute top-1/2 -translate-y-1/2 flex items-center justify-center z-10 right-1",
|
|
253
|
+
"size-6 p-4 ",
|
|
254
|
+
"bg-inherit",
|
|
255
|
+
"hover:bg-neutral-default-hover p-4 rounded-full"
|
|
256
|
+
),
|
|
257
|
+
label: "",
|
|
258
|
+
onClick: L,
|
|
259
|
+
icon: /* @__PURE__ */ e.jsx(R.Close, { size: 20, className: "" })
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
),
|
|
265
|
+
/* @__PURE__ */ e.jsx("div", { className: "min-h-6", children: (D || le) && /* @__PURE__ */ e.jsx(
|
|
266
|
+
ye,
|
|
267
|
+
{
|
|
268
|
+
className: " absolute",
|
|
269
|
+
variant: f,
|
|
270
|
+
children: k || B
|
|
271
|
+
}
|
|
272
|
+
) })
|
|
273
|
+
] });
|
|
274
|
+
});
|
|
275
|
+
V.displayName = "Input";
|
|
276
|
+
const Le = ge(V);
|
|
277
|
+
export {
|
|
278
|
+
Le as I,
|
|
279
|
+
ze as u
|
|
280
|
+
};
|
package/dist/Input.es.js
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
+
import { FastField as u } from "formik";
|
|
3
|
+
import { memo as s } from "react";
|
|
4
|
+
import { I as i } from "./Input-r2N9xkjM.js";
|
|
5
|
+
const c = ({
|
|
6
|
+
field: r,
|
|
7
|
+
form: t,
|
|
8
|
+
...e
|
|
9
|
+
}) => {
|
|
10
|
+
const n = t.getFieldMeta(r.name), a = n.touched && n.error;
|
|
11
|
+
return /* @__PURE__ */ o.jsx(
|
|
12
|
+
i,
|
|
13
|
+
{
|
|
14
|
+
...e,
|
|
15
|
+
...r,
|
|
16
|
+
value: r.value,
|
|
17
|
+
onChange: (m) => {
|
|
18
|
+
r.onChange({ target: { value: m, name: r.name } });
|
|
19
|
+
},
|
|
20
|
+
variant: a ? "error" : "default",
|
|
21
|
+
errorComponent: n.error,
|
|
22
|
+
type: e.type,
|
|
23
|
+
ref: e.innerRef
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}, p = s(c), j = (r) => /* @__PURE__ */ o.jsx(u, { name: r.name, children: ({ field: t, form: e }) => /* @__PURE__ */ o.jsx(p, { ...r, field: t, form: e }) });
|
|
27
|
+
export {
|
|
28
|
+
j as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
+
import { c } from "./cn-B6yFEsav.js";
|
|
3
|
+
import { memo as v, forwardRef as x, useRef as k, useEffect as g } from "react";
|
|
4
|
+
import { H as y } from "./HelperComponent-8ErmQ_n9.js";
|
|
5
|
+
const n = x((u, a) => {
|
|
6
|
+
const r = k(null);
|
|
7
|
+
g(() => {
|
|
8
|
+
a && (typeof a == "function" ? a(r.current) : a.current = r.current);
|
|
9
|
+
}, [a]);
|
|
10
|
+
const f = (m) => {
|
|
11
|
+
r.current && (m.stopPropagation(), r.current.click());
|
|
12
|
+
}, { disabled: t = !1, label: o, required: p = !1, errorComponent: l, helperComponent: d, variant: i = "default", ...b } = u, s = i === "error" && l, h = !s && d;
|
|
13
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 w-fit h-max", children: [
|
|
14
|
+
/* @__PURE__ */ e.jsxs("label", { className: "flex items-center justify-start gap-3 w-fit", children: [
|
|
15
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative z-10 h-10 flex items-center", children: [
|
|
16
|
+
/* @__PURE__ */ e.jsx(
|
|
17
|
+
"input",
|
|
18
|
+
{
|
|
19
|
+
hidden: !0,
|
|
20
|
+
type: "radio",
|
|
21
|
+
ref: r,
|
|
22
|
+
className: "peer",
|
|
23
|
+
disabled: t,
|
|
24
|
+
...b
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ e.jsx(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
role: "radio",
|
|
31
|
+
"aria-checked": r.current?.checked,
|
|
32
|
+
"aria-disabled": t,
|
|
33
|
+
onClick: t ? () => {
|
|
34
|
+
} : f,
|
|
35
|
+
className: c(
|
|
36
|
+
"size-5 rounded-full border-neutral-default-hover hover:border-neutral-default-default border-[2px] p-[3px]",
|
|
37
|
+
"transition-all duration-300 cursor-pointer relative ",
|
|
38
|
+
"grid place-items-center",
|
|
39
|
+
" before:bg-neutral-default-pressed before:size-10 before:absolute before:rounded-full before:-z-10! before:opacity-0 active:before:opacity-100 before:transition-all before:duration-300 ",
|
|
40
|
+
"hover:before:opacity-0 hover:before:bg-neutral-default-hover",
|
|
41
|
+
"peer-checked:border-primary-default-default peer-checked:hover:before:opacity-100 peer-checked:hover:before:bg-neutral-default-pressed peer-checked:active:before:bg-neutral-default-hover peer-checked:hover:border-primary-default-focused peer-checked:hover:*:bg-primary-default-hover active:before:bg-neutral-default-hover peer-checked:active:border-primary-strong-pressed peer-checked:active:*:bg-primary-default-pressed",
|
|
42
|
+
"peer-checked:*:bg-primary-light",
|
|
43
|
+
//disabled
|
|
44
|
+
"peer-disabled:pointer-events-none",
|
|
45
|
+
"peer-disabled:border-neutral-default-disabled peer-disabled:peer-checked:border-neutral-default-default",
|
|
46
|
+
"peer-disabled:peer-checked:*:bg-neutral-weak-hover"
|
|
47
|
+
),
|
|
48
|
+
children: /* @__PURE__ */ e.jsx(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: c(
|
|
52
|
+
"size-full rounded-full transition-all duration-300"
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] }),
|
|
59
|
+
o && /* @__PURE__ */ e.jsxs("span", { className: "prometeo-fonts-label-large", children: [
|
|
60
|
+
o,
|
|
61
|
+
p && " *"
|
|
62
|
+
] })
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ e.jsx("div", { className: "min-h-5", children: (s || h) && /* @__PURE__ */ e.jsx(
|
|
65
|
+
y,
|
|
66
|
+
{
|
|
67
|
+
variant: i,
|
|
68
|
+
children: l || d
|
|
69
|
+
}
|
|
70
|
+
) })
|
|
71
|
+
] });
|
|
72
|
+
});
|
|
73
|
+
n.displayName = "RadioButton";
|
|
74
|
+
const z = v(n);
|
|
75
|
+
export {
|
|
76
|
+
z as RadioButton
|
|
77
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
+
import { FastField as i } from "formik";
|
|
3
|
+
import { memo as s } from "react";
|
|
4
|
+
import { RadioButton as u } from "./RadioButton.es.js";
|
|
5
|
+
const c = ({
|
|
6
|
+
field: o,
|
|
7
|
+
form: t,
|
|
8
|
+
value: r,
|
|
9
|
+
// Este es el valor que representa ESTE radio button específico
|
|
10
|
+
...m
|
|
11
|
+
}) => {
|
|
12
|
+
const n = t.getFieldMeta(o.name), a = n.touched && n.error;
|
|
13
|
+
return /* @__PURE__ */ e.jsx(
|
|
14
|
+
u,
|
|
15
|
+
{
|
|
16
|
+
...m,
|
|
17
|
+
name: o.name,
|
|
18
|
+
value: r,
|
|
19
|
+
checked: o.value === r,
|
|
20
|
+
onChange: o.onChange,
|
|
21
|
+
onBlur: o.onBlur,
|
|
22
|
+
errorComponent: n.error,
|
|
23
|
+
variant: a ? "error" : "default"
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}, d = s(c), B = (o) => /* @__PURE__ */ e.jsx(i, { name: o.name, children: ({ field: t, form: r }) => /* @__PURE__ */ e.jsx(d, { ...o, field: t, form: r }) });
|
|
27
|
+
B.displayName = "RadioButtonFormik";
|
|
28
|
+
export {
|
|
29
|
+
B as RadioButtonFormik
|
|
30
|
+
};
|
|
@@ -5,7 +5,8 @@ import we, { memo as F, useState as ue, useRef as V, useMemo as Y, useCallback a
|
|
|
5
5
|
import _e from "./Spinner.es.js";
|
|
6
6
|
import { createPortal as Re } from "react-dom";
|
|
7
7
|
import { u as We } from "./useDragScroll-CHN9OMwn.js";
|
|
8
|
-
import { u as Be,
|
|
8
|
+
import { u as Be, I as Ke } from "./Input-r2N9xkjM.js";
|
|
9
|
+
import { H as Ue } from "./HelperComponent-8ErmQ_n9.js";
|
|
9
10
|
import Fe from "./CheckBox.es.js";
|
|
10
11
|
import { Skeleton as Se } from "./Skeleton.es.js";
|
|
11
12
|
const qe = {
|
|
@@ -475,20 +476,20 @@ function Ve(e) {
|
|
|
475
476
|
inputSearchPlaceholder: z?.inputSearchPlaceholder
|
|
476
477
|
}
|
|
477
478
|
),
|
|
478
|
-
(fe || ae) && /* @__PURE__ */ l.jsx(
|
|
479
|
-
|
|
479
|
+
/* @__PURE__ */ l.jsx("div", { className: "min-h-6", children: (fe || ae) && /* @__PURE__ */ l.jsx(
|
|
480
|
+
Ue,
|
|
480
481
|
{
|
|
481
482
|
ref: S,
|
|
482
483
|
variant: Q,
|
|
483
|
-
className: "
|
|
484
|
+
className: "absolute bottom-0 ",
|
|
484
485
|
children: fe || ae
|
|
485
486
|
}
|
|
486
|
-
)
|
|
487
|
+
) })
|
|
487
488
|
]
|
|
488
489
|
}
|
|
489
490
|
);
|
|
490
491
|
}
|
|
491
|
-
const Je = F(Ve, (e, t) => e.value === t.value && e.options === t.options && e.isLoading === t.isLoading && e.disabled === t.disabled && e.errorComponent === t.errorComponent && e.helperComponent === t.helperComponent && e.variant === t.variant && e.label === t.label && e.id === t.id && e.name === t.name && e.placeholder === t.placeholder && e.dropdownOptions?.controledSearchValue === t.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === t.dropdownOptions?.isLoading),
|
|
492
|
+
const Je = F(Ve, (e, t) => e.value === t.value && e.options === t.options && e.isLoading === t.isLoading && e.disabled === t.disabled && e.errorComponent === t.errorComponent && e.helperComponent === t.helperComponent && e.variant === t.variant && e.label === t.label && e.id === t.id && e.name === t.name && e.placeholder === t.placeholder && e.dropdownOptions?.controledSearchValue === t.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === t.dropdownOptions?.isLoading), ut = Je;
|
|
492
493
|
function Qe({
|
|
493
494
|
isOpen: e,
|
|
494
495
|
options: t,
|
|
@@ -665,7 +666,7 @@ function Qe({
|
|
|
665
666
|
},
|
|
666
667
|
children: [
|
|
667
668
|
!le && /* @__PURE__ */ l.jsx(
|
|
668
|
-
|
|
669
|
+
Ke,
|
|
669
670
|
{
|
|
670
671
|
name: "",
|
|
671
672
|
label: "",
|
|
@@ -792,6 +793,6 @@ const Oe = F(({ selectedOptions: e, placeholder: t, onRemoveOption: i, displayMo
|
|
|
792
793
|
] }), (e, t) => e.selectedOptions === t.selectedOptions);
|
|
793
794
|
Oe.displayName = "DefaultSelectionDisplay";
|
|
794
795
|
export {
|
|
795
|
-
|
|
796
|
+
ut as S,
|
|
796
797
|
E as g
|
|
797
798
|
};
|
package/dist/Select.es.js
CHANGED
package/dist/SelectFormik.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as d } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
2
|
import { useField as y } from "formik";
|
|
3
|
-
import { S as m } from "./Select-
|
|
3
|
+
import { S as m } from "./Select-IAQKEfnq.js";
|
|
4
4
|
import { useRef as p, useEffect as g } from "react";
|
|
5
5
|
function f(e) {
|
|
6
6
|
return Array.isArray(e) && e.every(
|
package/dist/SelectSearch.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as G } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
-
import { g as i, S as H } from "./Select-
|
|
2
|
+
import { g as i, S as H } from "./Select-IAQKEfnq.js";
|
|
3
3
|
import { useState as w, useRef as T, useEffect as m, useMemo as Q, useCallback as X } from "react";
|
|
4
4
|
function te(e) {
|
|
5
5
|
const {
|
|
@@ -46,3 +46,37 @@ interface DatePickerMultipleProps extends DatePickerBaseProps {
|
|
|
46
46
|
export type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps | DatePickerMultipleProps;
|
|
47
47
|
declare const DatePicker: (props: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
48
|
export default DatePicker;
|
|
49
|
+
interface CalendarProps {
|
|
50
|
+
min?: number;
|
|
51
|
+
max?: number;
|
|
52
|
+
excludeDisabled?: boolean;
|
|
53
|
+
endMonth?: Date;
|
|
54
|
+
startMonth?: Date;
|
|
55
|
+
readonly?: boolean;
|
|
56
|
+
className?: string;
|
|
57
|
+
required?: boolean;
|
|
58
|
+
hideFooter?: boolean;
|
|
59
|
+
applyLabel?: string;
|
|
60
|
+
cancelLabel?: string;
|
|
61
|
+
onApply?: () => void;
|
|
62
|
+
onCancel?: () => void;
|
|
63
|
+
numberOfMonths?: number;
|
|
64
|
+
hideOutsideDays?: boolean;
|
|
65
|
+
style?: React.CSSProperties;
|
|
66
|
+
showActionButtons?: boolean;
|
|
67
|
+
header?: string | React.ReactNode;
|
|
68
|
+
footer?: string | React.ReactNode;
|
|
69
|
+
mode: "single" | "range" | "multiple";
|
|
70
|
+
ref?: React.RefObject<HTMLDivElement | null>;
|
|
71
|
+
selected: Date | DateRange | Date[] | undefined;
|
|
72
|
+
displayValue: Date | DateRange | Date[] | undefined;
|
|
73
|
+
onSelect?: (value: Date | DateRange | Date[]) => void;
|
|
74
|
+
calendarPosition?: {
|
|
75
|
+
top: number;
|
|
76
|
+
bottom: number;
|
|
77
|
+
left: number;
|
|
78
|
+
right: number;
|
|
79
|
+
};
|
|
80
|
+
disabledDates?: boolean | Matcher[] | Date | Date[] | DateRange | DateBefore | DateAfter | DateInterval | DayOfWeek | ((date: Date) => boolean);
|
|
81
|
+
}
|
|
82
|
+
export declare const Calendar: import('react').MemoExoticComponent<(props: CalendarProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ComponentVariant } from '../Shared/types';
|
|
3
|
+
export interface RadioButtonProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
errorComponent?: React.ReactNode | string;
|
|
7
|
+
helperComponent?: React.ReactNode | string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
variant?: ComponentVariant;
|
|
10
|
+
}
|
|
11
|
+
declare const RadioButton: React.NamedExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
export default RadioButton;
|