@danielcruzcode/ui-core 0.1.4 → 0.1.6
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/components/Carousel/Carousel.d.ts +2 -1
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +87 -0
- package/dist/components/Carousel/Carousel.js.map +1 -0
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs12.js +2 -2
- package/dist/index.cjs13.js +2 -2
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs17.js +1 -0
- package/dist/index.cjs18.js +1 -0
- package/dist/index.cjs2.js +1 -1
- package/dist/index.cjs3.js +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs5.js +2 -2
- package/dist/index.cjs6.js +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs8.js +2 -2
- package/dist/index.cjs9.js +3 -3
- package/dist/index.esm10.js +1 -1
- package/dist/index.esm11.js +1 -1
- package/dist/index.esm12.js +1 -1
- package/dist/index.esm13.js +1 -1
- package/dist/index.esm14.js +45 -22
- package/dist/index.esm15.js +21 -32
- package/dist/index.esm16.js +32 -1201
- package/dist/index.esm17.js +1204 -0
- package/dist/index.esm18.js +52 -0
- package/dist/index.esm2.js +1 -1
- package/dist/index.esm3.js +1 -1
- package/dist/index.esm4.js +1 -1
- package/dist/index.esm5.js +1 -1
- package/dist/index.esm6.js +1 -1
- package/dist/index.esm7.js +1 -1
- package/dist/index.esm8.js +1 -1
- package/dist/index.esm9.js +76 -60
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const s = {
|
|
2
|
+
color: {
|
|
3
|
+
red: {
|
|
4
|
+
100: "#FDECEA",
|
|
5
|
+
500: "#E31837"
|
|
6
|
+
},
|
|
7
|
+
neutral: {
|
|
8
|
+
0: "#FFFFFF",
|
|
9
|
+
100: "#F5F5F5",
|
|
10
|
+
300: "#D1D1D1",
|
|
11
|
+
700: "#4A4A4A",
|
|
12
|
+
900: "#1A1A1A"
|
|
13
|
+
},
|
|
14
|
+
green: {
|
|
15
|
+
100: "#E8F5EA",
|
|
16
|
+
500: "#0A8920",
|
|
17
|
+
600: "#077319"
|
|
18
|
+
},
|
|
19
|
+
yellow: {
|
|
20
|
+
100: "#FEF7E0",
|
|
21
|
+
500: "#F9AB00"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
space: {
|
|
25
|
+
2: "8px",
|
|
26
|
+
4: "16px",
|
|
27
|
+
6: "24px",
|
|
28
|
+
8: "32px"
|
|
29
|
+
},
|
|
30
|
+
radius: {
|
|
31
|
+
sm: "4px",
|
|
32
|
+
md: "8px",
|
|
33
|
+
full: "9999px"
|
|
34
|
+
},
|
|
35
|
+
font: {
|
|
36
|
+
family: {
|
|
37
|
+
body: "'DM Sans', sans-serif",
|
|
38
|
+
display: "'Bebas Neue', sans-serif"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
shadow: {
|
|
42
|
+
sm: "0 1px 2px 0 rgba(0,0,0,0.08)",
|
|
43
|
+
md: "0 4px 8px 0 rgba(0,0,0,0.12)"
|
|
44
|
+
},
|
|
45
|
+
transition: {
|
|
46
|
+
fast: "100ms ease",
|
|
47
|
+
normal: "200ms ease"
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
s as primitives
|
|
52
|
+
};
|
package/dist/index.esm2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n, jsxs as u, Fragment as h } from "react/jsx-runtime";
|
|
2
2
|
import f from "@emotion/styled";
|
|
3
|
-
import { tokens as o } from "
|
|
3
|
+
import { tokens as o } from "./index.esm14.js";
|
|
4
4
|
const g = {
|
|
5
5
|
primary: `background-color:${o.color.brand};color:#fff;border:none;&:hover:not(:disabled){background-color:${o.color.brandHover};}&:active:not(:disabled){background-color:${o.color.brandHover};box-shadow:${o.shadow.sm};}`,
|
|
6
6
|
secondary: `background-color:transparent;color:${o.color.brand};border:1.5px solid ${o.color.brand};&:hover:not(:disabled){background-color:${o.color.brandSubtle};}`,
|
package/dist/index.esm3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import l from "@emotion/styled";
|
|
3
|
-
import { tokens as o } from "
|
|
3
|
+
import { tokens as o } from "./index.esm14.js";
|
|
4
4
|
const t = {
|
|
5
5
|
brand: `background-color: ${o.color.brandSubtle}; color: ${o.color.brand};`,
|
|
6
6
|
success: `background-color: ${o.color.successSubtle}; color: ${o.color.success};`,
|
package/dist/index.esm4.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import t from "@emotion/styled";
|
|
3
|
-
import { tokens as o } from "
|
|
3
|
+
import { tokens as o } from "./index.esm14.js";
|
|
4
4
|
const d = {
|
|
5
5
|
default: `background-color:${o.color.surface};color:${o.color.text};border:1px solid ${o.color.border};`,
|
|
6
6
|
brand: `background-color:${o.color.brandSubtle};color:${o.color.brand};border:1px solid ${o.color.brand};`
|
package/dist/index.esm5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import e from "@emotion/styled";
|
|
3
|
-
import { tokens as o } from "
|
|
3
|
+
import { tokens as o } from "./index.esm14.js";
|
|
4
4
|
import { useId as I } from "react";
|
|
5
5
|
const w = e.div`display:flex;flex-direction:column;gap:4px;font-family:${o.font.body};`, z = e.label`font-size:13px;font-weight:500;color:${o.color.text};`, M = e.span`color:${o.color.danger};margin-left:2px;`, S = e.div`
|
|
6
6
|
display:flex;align-items:center;gap:${o.space.sm};
|
package/dist/index.esm6.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import n from "@emotion/styled";
|
|
3
|
-
import { tokens as o } from "
|
|
3
|
+
import { tokens as o } from "./index.esm14.js";
|
|
4
4
|
import { useId as m } from "react";
|
|
5
5
|
const g = n.div`display:flex;flex-direction:column;gap:4px;font-family:${o.font.body};`, $ = n.label`font-size:13px;font-weight:500;color:${o.color.text};`, v = n.div`position:relative;display:flex;align-items:center;`, y = n.select`
|
|
6
6
|
width:100%;height:40px;padding-inline-start:${o.space.sm};padding-inline-end:36px;
|
package/dist/index.esm7.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import i from "@emotion/styled";
|
|
3
|
-
import { tokens as t } from "
|
|
3
|
+
import { tokens as t } from "./index.esm14.js";
|
|
4
4
|
import { useId as x, useRef as b, useEffect as k } from "react";
|
|
5
5
|
const g = i.label`
|
|
6
6
|
display: inline-flex; align-items: center; gap: ${t.space.sm};
|
package/dist/index.esm8.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import e from "@emotion/styled";
|
|
3
|
-
import { tokens as o } from "
|
|
3
|
+
import { tokens as o } from "./index.esm14.js";
|
|
4
4
|
const v = { none: "0", sm: o.space.sm, md: o.space.md, lg: o.space.lg }, f = e.article`
|
|
5
5
|
display:flex;flex-direction:column;background-color:${o.color.background};
|
|
6
6
|
border-radius:${o.radius.md};border:1px solid ${o.color.border};
|
package/dist/index.esm9.js
CHANGED
|
@@ -1,76 +1,92 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { tokens as
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
return typeof r == "number" ? r :
|
|
1
|
+
import { jsxs as y, jsx as o, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import c from "@emotion/styled";
|
|
3
|
+
import { tokens as e } from "./index.esm14.js";
|
|
4
|
+
import G from "./index.esm15.js";
|
|
5
|
+
import { useState as a, useRef as S, useEffect as u, useCallback as P } from "react";
|
|
6
|
+
const X = { sm: 8, md: 16, lg: 24, xl: 32 };
|
|
7
|
+
function Y(r, i) {
|
|
8
|
+
return typeof r == "number" ? r : i >= 1024 ? r.desktop : i >= 640 ? r.tablet : r.mobile;
|
|
9
9
|
}
|
|
10
|
-
const
|
|
10
|
+
const I = c.button`
|
|
11
11
|
position:absolute;top:50%;transform:translateY(-50%);z-index:10;
|
|
12
12
|
display:flex;align-items:center;justify-content:center;
|
|
13
|
-
width:36px;height:36px;border-radius:${
|
|
14
|
-
border:1px solid ${
|
|
15
|
-
color:${
|
|
16
|
-
transition:box-shadow ${
|
|
17
|
-
&:hover{box-shadow:${
|
|
18
|
-
&:focus-visible{outline:2px solid ${
|
|
13
|
+
width:36px;height:36px;border-radius:${e.radius.full};
|
|
14
|
+
border:1px solid ${e.color.border};background-color:${e.color.background};
|
|
15
|
+
color:${e.color.text};cursor:pointer;box-shadow:${e.shadow.sm};
|
|
16
|
+
transition:box-shadow ${e.transition.fast};
|
|
17
|
+
&:hover{box-shadow:${e.shadow.md};}
|
|
18
|
+
&:focus-visible{outline:2px solid ${e.color.borderFocus};outline-offset:2px;}
|
|
19
19
|
&:disabled{opacity:0.4;cursor:not-allowed;}
|
|
20
|
-
`,
|
|
20
|
+
`, q = c(I)`left:${e.space.sm};`, H = c(I)`right:${e.space.sm};`, J = c.button`
|
|
21
21
|
width:${({ active: r }) => r ? "20px" : "8px"};height:8px;
|
|
22
|
-
border-radius:${
|
|
23
|
-
background-color:${({ active: r }) => r ?
|
|
22
|
+
border-radius:${e.radius.full};
|
|
23
|
+
background-color:${({ active: r }) => r ? e.color.brand : e.color.border};
|
|
24
24
|
border:none;cursor:pointer;padding:0;
|
|
25
|
-
transition:background-color ${
|
|
26
|
-
&:focus-visible{outline:2px solid ${
|
|
27
|
-
`,
|
|
28
|
-
function
|
|
25
|
+
transition:background-color ${e.transition.fast},width ${e.transition.fast};
|
|
26
|
+
&:focus-visible{outline:2px solid ${e.color.borderFocus};outline-offset:2px;}
|
|
27
|
+
`, K = c.div`display:flex;justify-content:center;gap:${e.space.sm};margin-top:${e.space.sm};`;
|
|
28
|
+
function V({
|
|
29
29
|
children: r,
|
|
30
|
-
autoplay:
|
|
31
|
-
autoplayMs:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
autoplay: i = !1,
|
|
31
|
+
autoplayMs: p = 4e3,
|
|
32
|
+
pauseOnHover: h = !0,
|
|
33
|
+
showArrows: L = !0,
|
|
34
|
+
showDots: j = !0,
|
|
35
|
+
loop: R = !1,
|
|
36
|
+
slidesPerView: x = 1,
|
|
37
|
+
slidesPerGroup: W = 1,
|
|
38
|
+
gap: b,
|
|
39
|
+
onSlideChange: d
|
|
39
40
|
}) {
|
|
40
|
-
var
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
var w;
|
|
42
|
+
const v = b && (w = X[b]) != null ? w : 0, [B, t] = G({ loop: R, slidesToScroll: W, align: "start" }), [C, E] = a(0), [F, M] = a([]), [m, $] = a(!1), k = S(x);
|
|
43
|
+
k.current = x;
|
|
44
|
+
const g = S(null), [f, N] = a(1);
|
|
45
|
+
u(() => {
|
|
46
|
+
const n = g.current;
|
|
47
|
+
if (!n) return;
|
|
48
|
+
const s = new ResizeObserver(([D]) => {
|
|
49
|
+
const T = D.contentRect.width;
|
|
50
|
+
N(Y(k.current, T));
|
|
51
|
+
});
|
|
52
|
+
return s.observe(n), () => s.disconnect();
|
|
53
|
+
}, []);
|
|
54
|
+
const l = P(() => {
|
|
48
55
|
if (!t) return;
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
}, [t,
|
|
52
|
-
|
|
56
|
+
const n = t.selectedScrollSnap();
|
|
57
|
+
E(n), d == null || d(n);
|
|
58
|
+
}, [t, d]);
|
|
59
|
+
u(() => {
|
|
53
60
|
if (t)
|
|
54
|
-
return
|
|
61
|
+
return M(t.scrollSnapList()), t.on("select", l), t.on("reInit", l), () => {
|
|
55
62
|
t.off("select", l), t.off("reInit", l);
|
|
56
63
|
};
|
|
57
|
-
}, [t, l]),
|
|
64
|
+
}, [t, l]), u(() => {
|
|
58
65
|
t == null || t.reInit();
|
|
59
|
-
}, [t, f]),
|
|
60
|
-
if (!
|
|
61
|
-
const
|
|
62
|
-
return () => clearInterval(
|
|
63
|
-
}, [
|
|
64
|
-
const
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
}, [t, f]), u(() => {
|
|
67
|
+
if (!i || !t || h && m) return;
|
|
68
|
+
const n = setInterval(() => t.scrollNext(), p);
|
|
69
|
+
return () => clearInterval(n);
|
|
70
|
+
}, [i, p, t, h, m]);
|
|
71
|
+
const z = `calc((100% - ${v * (f - 1)}px) / ${f})`;
|
|
72
|
+
return /* @__PURE__ */ y(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
ref: g,
|
|
76
|
+
style: { position: "relative", width: "100%" },
|
|
77
|
+
onMouseEnter: () => $(!0),
|
|
78
|
+
onMouseLeave: () => $(!1),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ o("div", { ref: B, style: { overflow: "hidden" }, children: /* @__PURE__ */ o("div", { style: { display: "flex", gap: v }, children: r.map((n, s) => /* @__PURE__ */ o("div", { style: { flex: `0 0 ${z}`, minWidth: 0 }, children: n }, s)) }) }),
|
|
81
|
+
L && /* @__PURE__ */ y(_, { children: [
|
|
82
|
+
/* @__PURE__ */ o(q, { type: "button", "aria-label": "Slide anterior", onClick: () => t == null ? void 0 : t.scrollPrev(), children: /* @__PURE__ */ o("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M10 12L6 8l4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
83
|
+
/* @__PURE__ */ o(H, { type: "button", "aria-label": "Slide siguiente", onClick: () => t == null ? void 0 : t.scrollNext(), children: /* @__PURE__ */ o("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M6 4l4 4-4 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
84
|
+
] }),
|
|
85
|
+
j && /* @__PURE__ */ o(K, { children: F.map((n, s) => /* @__PURE__ */ o(J, { active: s === C, type: "button", onClick: () => t == null ? void 0 : t.scrollTo(s), "aria-label": `Ir al slide ${s + 1}` }, s)) })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
73
89
|
}
|
|
74
90
|
export {
|
|
75
|
-
|
|
91
|
+
V as Carousel
|
|
76
92
|
};
|