prometeo-design-system 2.0.2 → 2.1.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-Bc0LYLfg.js +183 -0
- package/dist/Button.es.js +2 -151
- package/dist/DatePicker.es.js +413 -382
- package/dist/DrawerDesktop.es.js +128 -53
- package/dist/Input.es.js +67 -63
- package/dist/components/DatePicker/DatePicker.d.ts +6 -6
- package/dist/components/Drawer/DrawerDesktop.d.ts +6 -4
- package/dist/components/Drawer/DrawerDesktop_old.d.ts +15 -0
- package/dist/components/Input/Input.d.ts +3 -1
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +13 -13
- package/package.json +1 -1
- package/dist/components/Drawer/DrawerDesktopV2.d.ts +0 -11
- package/dist/index-BOQuZ0gG.js +0 -34
- /package/dist/pages/{Drawer.d.ts → DrawersPage.d.ts} +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { j as f } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
+
import { c as g } from "./cn-B6yFEsav.js";
|
|
3
|
+
import { clsx as B } from "clsx";
|
|
4
|
+
import { useAnimationControls as E, motion as j } from "framer-motion";
|
|
5
|
+
import { memo as P, useCallback as w, useMemo as h } from "react";
|
|
6
|
+
const C = (l) => typeof l == "boolean" ? `${l}` : l === 0 ? "0" : l, V = B, _ = (l, d) => (e) => {
|
|
7
|
+
var m;
|
|
8
|
+
if (d?.variants == null) return V(l, e?.class, e?.className);
|
|
9
|
+
const { variants: v, defaultVariants: t } = d, n = Object.keys(v).map((s) => {
|
|
10
|
+
const u = e?.[s], i = t?.[s];
|
|
11
|
+
if (u === null) return null;
|
|
12
|
+
const o = C(u) || C(i);
|
|
13
|
+
return v[s][o];
|
|
14
|
+
}), r = e && Object.entries(e).reduce((s, u) => {
|
|
15
|
+
let [i, o] = u;
|
|
16
|
+
return o === void 0 || (s[i] = o), s;
|
|
17
|
+
}, {}), a = d == null || (m = d.compoundVariants) === null || m === void 0 ? void 0 : m.reduce((s, u) => {
|
|
18
|
+
let { class: i, className: o, ...p } = u;
|
|
19
|
+
return Object.entries(p).every((y) => {
|
|
20
|
+
let [b, x] = y;
|
|
21
|
+
return Array.isArray(x) ? x.includes({
|
|
22
|
+
...t,
|
|
23
|
+
...r
|
|
24
|
+
}[b]) : {
|
|
25
|
+
...t,
|
|
26
|
+
...r
|
|
27
|
+
}[b] === x;
|
|
28
|
+
}) ? [
|
|
29
|
+
...s,
|
|
30
|
+
i,
|
|
31
|
+
o
|
|
32
|
+
] : s;
|
|
33
|
+
}, []);
|
|
34
|
+
return V(l, n, a, e?.class, e?.className);
|
|
35
|
+
}, $ = _(
|
|
36
|
+
"flex items-center justify-center cursor-pointer focus:outline-none font-semibold rounded-md transition-colors",
|
|
37
|
+
{
|
|
38
|
+
variants: {
|
|
39
|
+
variant: {
|
|
40
|
+
filled: "",
|
|
41
|
+
outline: "bg-transparent border-1",
|
|
42
|
+
text: "bg-transparent border-0"
|
|
43
|
+
},
|
|
44
|
+
color: {
|
|
45
|
+
primary: "",
|
|
46
|
+
secondary: ""
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
small: "h-[40px] w-[123px] w-fit px-2 py-3 text-sm",
|
|
50
|
+
medium: "h-[48px] w-[134px] w-fit px-2 py-3 text-base",
|
|
51
|
+
large: "h-[56px] w-[145px] w-fit px-4 py-3 text-base"
|
|
52
|
+
},
|
|
53
|
+
disabled: {
|
|
54
|
+
true: "opacity-50 cursor-not-allowed",
|
|
55
|
+
false: ""
|
|
56
|
+
},
|
|
57
|
+
loading: {
|
|
58
|
+
true: "cursor-wait",
|
|
59
|
+
false: ""
|
|
60
|
+
},
|
|
61
|
+
customSize: {
|
|
62
|
+
true: "px-4 py-2",
|
|
63
|
+
false: ""
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
compoundVariants: [
|
|
67
|
+
{
|
|
68
|
+
variant: "filled",
|
|
69
|
+
color: "primary",
|
|
70
|
+
class: "bg-primary-default-default text-neutral-strong-default border-0 hover:bg-primary-default-hover hover:text-neutral-strong-hover focus:bg-primary-default-pressed focus:text-neutral-strong-focused active:bg-primary-pressed active:text-neutral-strong-pressed disabled:bg-primary-medium-disabled disabled:text-neutral-strong-disabled"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
variant: "filled",
|
|
74
|
+
color: "secondary",
|
|
75
|
+
class: "bg-neutral-strong-medium-default text-neutral-strong-default hover:bg-neutral-medium-hover hover:text-neutral-strong-hover focus:bg-neutral-medium-pressed focus:text-neutral-strong-pressed active:bg-neutral-medium-pressed disabled:bg-primary-default-disabled disabled:text-neutral-strong-disabled"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
variant: "outline",
|
|
79
|
+
color: "primary",
|
|
80
|
+
class: "text-primary-medium-default border-primary-medium-default hover:bg-neutral-default-hover hover:text-primary-medium-hover hover:border-primary-medium-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed focus:border-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed active:border-primary-medium-pressed disabled:border-primary-disabled disabled:text-primary-disabled"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
variant: "outline",
|
|
84
|
+
color: "secondary",
|
|
85
|
+
class: "text-neutral-strong-default border-neutral-strong-default hover:bg-neutral-default-hover hover:text-neutral-strong-hover hover:border-neutral-strong-hover focus:bg-neutral-default-pressed focus:text-neutral-strong-pressed focus:border-neutral-strong-pressed active:bg-neutral-default-pressed active:text-neutral-strong-pressed active:border-neutral-strong-pressed disabled:border-neutral-disabled disabled:text-neutral-disabled"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
variant: "text",
|
|
89
|
+
color: "primary",
|
|
90
|
+
class: "text-primary-medium-default hover:bg-neutral-default-hover hover:text-primary-medium-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed disabled:text-primary-medium-disabled"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
variant: "text",
|
|
94
|
+
color: "secondary",
|
|
95
|
+
class: "text-neutral-strong-default hover:bg-neutral-default-hover hover:text-primary-default-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed disabled:text-primary-medium-disabled"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
defaultVariants: {
|
|
99
|
+
variant: "filled",
|
|
100
|
+
color: "primary",
|
|
101
|
+
size: "medium",
|
|
102
|
+
disabled: !1,
|
|
103
|
+
loading: !1,
|
|
104
|
+
customSize: !1
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
function z({
|
|
109
|
+
label: l = "Selene",
|
|
110
|
+
onClick: d,
|
|
111
|
+
icon: e,
|
|
112
|
+
contentClassName: m,
|
|
113
|
+
loadingText: v = "Cargando...",
|
|
114
|
+
animate: t = !0,
|
|
115
|
+
animateIcon: n = !0,
|
|
116
|
+
isLoading: r = !1,
|
|
117
|
+
disabled: a = !1,
|
|
118
|
+
type: s = "button",
|
|
119
|
+
variant: u = "filled",
|
|
120
|
+
color: i = "primary",
|
|
121
|
+
size: o = "medium",
|
|
122
|
+
children: p,
|
|
123
|
+
Spinner: y,
|
|
124
|
+
className: b,
|
|
125
|
+
form: x,
|
|
126
|
+
...N
|
|
127
|
+
}) {
|
|
128
|
+
const c = E(), H = w(() => {
|
|
129
|
+
!t || a || r || !n || c.start({ rotate: 90 });
|
|
130
|
+
}, [t, a, r, n, c]), S = w(() => {
|
|
131
|
+
!t || a || r || !n || c.start({ rotate: 0 });
|
|
132
|
+
}, [t, a, r, n, c]), k = h(() => g(
|
|
133
|
+
$({
|
|
134
|
+
variant: u,
|
|
135
|
+
color: i,
|
|
136
|
+
size: o,
|
|
137
|
+
disabled: a || r,
|
|
138
|
+
loading: r
|
|
139
|
+
}),
|
|
140
|
+
b
|
|
141
|
+
), [u, i, o, a, r, b]), O = h(() => ({
|
|
142
|
+
whileHover: t && !a && !r ? { scale: 1.05 } : {},
|
|
143
|
+
whileTap: t && !a && !r ? { scale: 0.98 } : {},
|
|
144
|
+
transition: { type: "spring", stiffness: 400, damping: 17 }
|
|
145
|
+
}), [t, a, r]), A = h(() => r ? /* @__PURE__ */ f.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
146
|
+
y,
|
|
147
|
+
o !== "small" && /* @__PURE__ */ f.jsx("span", { children: v })
|
|
148
|
+
] }) : p || /* @__PURE__ */ f.jsxs("span", { className: g("flex items-center gap-2", m), children: [
|
|
149
|
+
e && /* @__PURE__ */ f.jsx(
|
|
150
|
+
j.div,
|
|
151
|
+
{
|
|
152
|
+
animate: n ? c : void 0,
|
|
153
|
+
transition: {
|
|
154
|
+
type: "spring",
|
|
155
|
+
stiffness: 400,
|
|
156
|
+
damping: 17
|
|
157
|
+
},
|
|
158
|
+
children: e
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
l && /* @__PURE__ */ f.jsx("span", { children: l })
|
|
162
|
+
] }), [r, p, e, l, y, o, v, n, c, m]);
|
|
163
|
+
return /* @__PURE__ */ f.jsx(
|
|
164
|
+
j.button,
|
|
165
|
+
{
|
|
166
|
+
form: x,
|
|
167
|
+
onClick: d,
|
|
168
|
+
className: k,
|
|
169
|
+
...O,
|
|
170
|
+
onHoverStart: H,
|
|
171
|
+
onHoverEnd: S,
|
|
172
|
+
disabled: a || r,
|
|
173
|
+
type: s,
|
|
174
|
+
...N,
|
|
175
|
+
children: A
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
const W = P(z);
|
|
180
|
+
export {
|
|
181
|
+
W as B,
|
|
182
|
+
_ as c
|
|
183
|
+
};
|
package/dist/Button.es.js
CHANGED
|
@@ -1,153 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as x } from "./cn-B6yFEsav.js";
|
|
3
|
-
import { c as N } from "./index-BOQuZ0gG.js";
|
|
4
|
-
import { useAnimationControls as k, motion as y } from "framer-motion";
|
|
5
|
-
import { memo as z, useCallback as g, useMemo as i } from "react";
|
|
6
|
-
const A = N(
|
|
7
|
-
"flex items-center justify-center cursor-pointer focus:outline-none font-semibold rounded-md transition-colors",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
filled: "",
|
|
12
|
-
outline: "bg-transparent border-1",
|
|
13
|
-
text: "bg-transparent border-0"
|
|
14
|
-
},
|
|
15
|
-
color: {
|
|
16
|
-
primary: "",
|
|
17
|
-
secondary: ""
|
|
18
|
-
},
|
|
19
|
-
size: {
|
|
20
|
-
small: "h-[40px] w-[123px] w-fit px-2 py-3 text-sm",
|
|
21
|
-
medium: "h-[48px] w-[134px] w-fit px-2 py-3 text-base",
|
|
22
|
-
large: "h-[56px] w-[145px] w-fit px-4 py-3 text-base"
|
|
23
|
-
},
|
|
24
|
-
disabled: {
|
|
25
|
-
true: "opacity-50 cursor-not-allowed",
|
|
26
|
-
false: ""
|
|
27
|
-
},
|
|
28
|
-
loading: {
|
|
29
|
-
true: "cursor-wait",
|
|
30
|
-
false: ""
|
|
31
|
-
},
|
|
32
|
-
customSize: {
|
|
33
|
-
true: "px-4 py-2",
|
|
34
|
-
false: ""
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
compoundVariants: [
|
|
38
|
-
{
|
|
39
|
-
variant: "filled",
|
|
40
|
-
color: "primary",
|
|
41
|
-
class: "bg-primary-default-default text-neutral-strong-default border-0 hover:bg-primary-default-hover hover:text-neutral-strong-hover focus:bg-primary-default-pressed focus:text-neutral-strong-focused active:bg-primary-pressed active:text-neutral-strong-pressed disabled:bg-primary-medium-disabled disabled:text-neutral-strong-disabled"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
variant: "filled",
|
|
45
|
-
color: "secondary",
|
|
46
|
-
class: "bg-neutral-strong-medium-default text-neutral-strong-default hover:bg-neutral-medium-hover hover:text-neutral-strong-hover focus:bg-neutral-medium-pressed focus:text-neutral-strong-pressed active:bg-neutral-medium-pressed disabled:bg-primary-default-disabled disabled:text-neutral-strong-disabled"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
variant: "outline",
|
|
50
|
-
color: "primary",
|
|
51
|
-
class: "text-primary-medium-default border-primary-medium-default hover:bg-neutral-default-hover hover:text-primary-medium-hover hover:border-primary-medium-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed focus:border-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed active:border-primary-medium-pressed disabled:border-primary-disabled disabled:text-primary-disabled"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
variant: "outline",
|
|
55
|
-
color: "secondary",
|
|
56
|
-
class: "text-neutral-strong-default border-neutral-strong-default hover:bg-neutral-default-hover hover:text-neutral-strong-hover hover:border-neutral-strong-hover focus:bg-neutral-default-pressed focus:text-neutral-strong-pressed focus:border-neutral-strong-pressed active:bg-neutral-default-pressed active:text-neutral-strong-pressed active:border-neutral-strong-pressed disabled:border-neutral-disabled disabled:text-neutral-disabled"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
variant: "text",
|
|
60
|
-
color: "primary",
|
|
61
|
-
class: "text-primary-medium-default hover:bg-neutral-default-hover hover:text-primary-medium-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed disabled:text-primary-medium-disabled"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
variant: "text",
|
|
65
|
-
color: "secondary",
|
|
66
|
-
class: "text-neutral-strong-default hover:bg-neutral-default-hover hover:text-primary-default-hover focus:bg-neutral-default-pressed focus:text-primary-medium-pressed active:bg-neutral-default-pressed active:text-primary-medium-pressed disabled:text-primary-medium-disabled"
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
defaultVariants: {
|
|
70
|
-
variant: "filled",
|
|
71
|
-
color: "primary",
|
|
72
|
-
size: "medium",
|
|
73
|
-
disabled: !1,
|
|
74
|
-
loading: !1,
|
|
75
|
-
customSize: !1
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
function M({
|
|
80
|
-
label: l = "Selene",
|
|
81
|
-
onClick: h,
|
|
82
|
-
icon: u,
|
|
83
|
-
contentClassName: m,
|
|
84
|
-
loadingText: p = "Cargando...",
|
|
85
|
-
animate: t = !0,
|
|
86
|
-
animateIcon: s = !0,
|
|
87
|
-
isLoading: e = !1,
|
|
88
|
-
disabled: r = !1,
|
|
89
|
-
type: w = "button",
|
|
90
|
-
variant: f = "filled",
|
|
91
|
-
color: c = "primary",
|
|
92
|
-
size: d = "medium",
|
|
93
|
-
children: n,
|
|
94
|
-
Spinner: b,
|
|
95
|
-
className: v,
|
|
96
|
-
form: j,
|
|
97
|
-
...C
|
|
98
|
-
}) {
|
|
99
|
-
const a = k(), H = g(() => {
|
|
100
|
-
!t || r || e || !s || a.start({ rotate: 90 });
|
|
101
|
-
}, [t, r, e, s, a]), S = g(() => {
|
|
102
|
-
!t || r || e || !s || a.start({ rotate: 0 });
|
|
103
|
-
}, [t, r, e, s, a]), E = i(() => x(
|
|
104
|
-
A({
|
|
105
|
-
variant: f,
|
|
106
|
-
color: c,
|
|
107
|
-
size: d,
|
|
108
|
-
disabled: r || e,
|
|
109
|
-
loading: e
|
|
110
|
-
}),
|
|
111
|
-
v
|
|
112
|
-
), [f, c, d, r, e, v]), V = i(() => ({
|
|
113
|
-
whileHover: t && !r && !e ? { scale: 1.05 } : {},
|
|
114
|
-
whileTap: t && !r && !e ? { scale: 0.98 } : {},
|
|
115
|
-
transition: { type: "spring", stiffness: 400, damping: 17 }
|
|
116
|
-
}), [t, r, e]), B = i(() => e ? /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
117
|
-
b,
|
|
118
|
-
d !== "small" && /* @__PURE__ */ o.jsx("span", { children: p })
|
|
119
|
-
] }) : n || /* @__PURE__ */ o.jsxs("span", { className: x("flex items-center gap-2", m), children: [
|
|
120
|
-
u && /* @__PURE__ */ o.jsx(
|
|
121
|
-
y.div,
|
|
122
|
-
{
|
|
123
|
-
animate: s ? a : void 0,
|
|
124
|
-
transition: {
|
|
125
|
-
type: "spring",
|
|
126
|
-
stiffness: 400,
|
|
127
|
-
damping: 17
|
|
128
|
-
},
|
|
129
|
-
children: u
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
l && /* @__PURE__ */ o.jsx("span", { children: l })
|
|
133
|
-
] }), [e, n, u, l, b, d, p, s, a, m]);
|
|
134
|
-
return /* @__PURE__ */ o.jsx(
|
|
135
|
-
y.button,
|
|
136
|
-
{
|
|
137
|
-
form: j,
|
|
138
|
-
onClick: h,
|
|
139
|
-
className: E,
|
|
140
|
-
...V,
|
|
141
|
-
onHoverStart: H,
|
|
142
|
-
onHoverEnd: S,
|
|
143
|
-
disabled: r || e,
|
|
144
|
-
type: w,
|
|
145
|
-
...C,
|
|
146
|
-
children: B
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
const F = z(M);
|
|
1
|
+
import { B as f } from "./Button-Bc0LYLfg.js";
|
|
151
2
|
export {
|
|
152
|
-
|
|
3
|
+
f as default
|
|
153
4
|
};
|