@danielcruzcode/ui-core 0.1.3 → 0.1.4
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/commerce/ProductCard/ProductCard.d.ts +1 -1
- package/dist/commerce/ProductCard/ProductCard.d.ts.map +1 -1
- package/dist/commerce/ProductShelf/ProductShelf.d.ts +1 -1
- package/dist/commerce/ProductShelf/ProductShelf.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +2 -2
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs12.js +5 -1
- package/dist/index.cjs13.js +6 -1
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs2.js +19 -1
- package/dist/index.cjs3.js +12 -1
- package/dist/index.cjs4.js +17 -1
- package/dist/index.cjs5.js +17 -1
- package/dist/index.cjs6.js +8 -1
- package/dist/index.cjs7.js +12 -1
- package/dist/index.cjs8.js +8 -1
- package/dist/index.cjs9.js +18 -1
- package/dist/index.esm.js +22 -22
- package/dist/index.esm10.js +65 -61
- package/dist/index.esm11.js +24 -48
- package/dist/index.esm12.js +11 -22
- package/dist/index.esm13.js +12 -25
- package/dist/index.esm14.js +22 -11
- package/dist/index.esm15.js +33 -5
- package/dist/index.esm16.js +1202 -5
- package/dist/index.esm2.js +38 -5
- package/dist/index.esm3.js +27 -46
- package/dist/index.esm4.js +29 -32
- package/dist/index.esm5.js +35 -96
- package/dist/index.esm6.js +26 -58
- package/dist/index.esm7.js +29 -5
- package/dist/index.esm8.js +34 -55
- package/dist/index.esm9.js +69 -162
- package/dist/layout/Container/Container.d.ts +2 -1
- package/dist/layout/Container/Container.d.ts.map +1 -1
- package/dist/layout/Stack/Stack.d.ts +4 -3
- package/dist/layout/Stack/Stack.d.ts.map +1 -1
- package/dist/primitives/Badge/Badge.d.ts.map +1 -1
- package/dist/primitives/Button/Button.d.ts +1 -1
- package/dist/primitives/Button/Button.d.ts.map +1 -1
- package/dist/primitives/Checkbox/Checkbox.d.ts +1 -1
- package/dist/primitives/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/primitives/Input/Input.d.ts +1 -1
- package/dist/primitives/Input/Input.d.ts.map +1 -1
- package/dist/primitives/Select/Select.d.ts +1 -1
- package/dist/primitives/Select/Select.d.ts.map +1 -1
- package/dist/primitives/Tag/Tag.d.ts.map +1 -1
- package/package.json +6 -26
- package/dist/commerce/ProductCard/ProductCard.css.d.ts +0 -23
- package/dist/commerce/ProductCard/ProductCard.css.d.ts.map +0 -1
- package/dist/commerce/ProductShelf/ProductShelf.css.d.ts +0 -3
- package/dist/commerce/ProductShelf/ProductShelf.css.d.ts.map +0 -1
- package/dist/components/Card/Card.css.d.ts +0 -30
- package/dist/components/Card/Card.css.d.ts.map +0 -1
- package/dist/components/Carousel/Carousel.css.d.ts +0 -8
- package/dist/components/Carousel/Carousel.css.d.ts.map +0 -1
- package/dist/index.cjs17.js +0 -1
- package/dist/index.cjs18.js +0 -1
- package/dist/index.cjs19.js +0 -1
- package/dist/index.cjs20.js +0 -1
- package/dist/index.cjs21.js +0 -1
- package/dist/index.cjs22.js +0 -1
- package/dist/index.cjs23.js +0 -1
- package/dist/index.cjs24.js +0 -1
- package/dist/index.cjs25.js +0 -1
- package/dist/index.cjs26.js +0 -1
- package/dist/index.cjs27.js +0 -1
- package/dist/index.cjs28.js +0 -1
- package/dist/index.cjs30.js +0 -1
- package/dist/index.cjs31.js +0 -1
- package/dist/index.cjs35.js +0 -1
- package/dist/index.cjs44.js +0 -1
- package/dist/index.cjs45.js +0 -1
- package/dist/index.cjs46.js +0 -1
- package/dist/index.cjs49.js +0 -1
- package/dist/index.cjs50.js +0 -1
- package/dist/index.cjs51.js +0 -1
- package/dist/index.cjs52.js +0 -1
- package/dist/index.esm17.js +0 -8
- package/dist/index.esm18.js +0 -15
- package/dist/index.esm19.js +0 -12
- package/dist/index.esm20.js +0 -26
- package/dist/index.esm21.js +0 -7
- package/dist/index.esm22.js +0 -7
- package/dist/index.esm23.js +0 -11
- package/dist/index.esm24.js +0 -136
- package/dist/index.esm25.js +0 -226
- package/dist/index.esm26.js +0 -130
- package/dist/index.esm27.js +0 -280
- package/dist/index.esm28.js +0 -11
- package/dist/index.esm30.js +0 -5
- package/dist/index.esm31.js +0 -1
- package/dist/index.esm35.js +0 -88
- package/dist/index.esm44.js +0 -2038
- package/dist/index.esm45.js +0 -60
- package/dist/index.esm46.js +0 -191
- package/dist/index.esm49.js +0 -12
- package/dist/index.esm50.js +0 -182
- package/dist/index.esm51.js +0 -6
- package/dist/index.esm52.js +0 -134
- package/dist/layout/Container/Container.css.d.ts +0 -20
- package/dist/layout/Container/Container.css.d.ts.map +0 -1
- package/dist/layout/Stack/Stack.css.d.ts +0 -2
- package/dist/layout/Stack/Stack.css.d.ts.map +0 -1
- package/dist/primitives/Badge/Badge.css.d.ts +0 -37
- package/dist/primitives/Badge/Badge.css.d.ts.map +0 -1
- package/dist/primitives/Button/Button.css.d.ts +0 -60
- package/dist/primitives/Button/Button.css.d.ts.map +0 -1
- package/dist/primitives/Checkbox/Checkbox.css.d.ts +0 -9
- package/dist/primitives/Checkbox/Checkbox.css.d.ts.map +0 -1
- package/dist/primitives/Input/Input.css.d.ts +0 -11
- package/dist/primitives/Input/Input.css.d.ts.map +0 -1
- package/dist/primitives/Select/Select.css.d.ts +0 -8
- package/dist/primitives/Select/Select.css.d.ts.map +0 -1
- package/dist/primitives/Tag/Tag.css.d.ts +0 -16
- package/dist/primitives/Tag/Tag.css.d.ts.map +0 -1
- package/dist/styles.css +0 -1
- package/dist/styles.d.ts +0 -1
- package/dist/styles.d.ts.map +0 -1
- package/styles.css +0 -1
package/dist/index.esm2.js
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx as n, jsxs as u, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import f from "@emotion/styled";
|
|
3
|
+
import { tokens as o } from "@danielcruzcode/design-tokens";
|
|
4
|
+
const g = {
|
|
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
|
+
secondary: `background-color:transparent;color:${o.color.brand};border:1.5px solid ${o.color.brand};&:hover:not(:disabled){background-color:${o.color.brandSubtle};}`,
|
|
7
|
+
ghost: `background-color:transparent;color:${o.color.text};border:none;&:hover:not(:disabled){background-color:${o.color.surface};}`,
|
|
8
|
+
danger: `background-color:${o.color.danger};color:#fff;border:none;&:hover:not(:disabled){opacity:0.9;}`
|
|
9
|
+
}, $ = {
|
|
10
|
+
sm: `height:32px;padding-inline:${o.space.sm};font-size:13px;`,
|
|
11
|
+
md: `height:40px;padding-inline:${o.space.md};font-size:15px;`,
|
|
12
|
+
lg: `height:48px;padding-inline:${o.space.lg};font-size:17px;`
|
|
13
|
+
}, m = f.button`
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
gap: ${o.space.sm};
|
|
18
|
+
border-radius: ${o.radius.md};
|
|
19
|
+
font-family: ${o.font.body};
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
transition: background-color ${o.transition.fast}, opacity ${o.transition.fast}, box-shadow ${o.transition.fast};
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
position: relative;
|
|
26
|
+
width: ${({ fullWidth: r }) => r ? "100%" : "auto"};
|
|
27
|
+
&:disabled { cursor: not-allowed; opacity: 0.5; }
|
|
28
|
+
&:focus-visible { outline: 2px solid ${o.color.borderFocus}; outline-offset: 2px; }
|
|
29
|
+
${({ variant: r }) => g[r]}
|
|
30
|
+
${({ size: r }) => $[r]}
|
|
31
|
+
`;
|
|
32
|
+
function k({ variant: r = "primary", size: a = "md", fullWidth: d = !1, loading: e = !1, disabled: l = !1, leftIcon: t, rightIcon: i, onClick: s, children: c, type: p = "button", className: b }) {
|
|
33
|
+
return /* @__PURE__ */ n(m, { type: p, variant: r, size: a, fullWidth: d, disabled: l || e, onClick: s, "aria-busy": e, className: b, children: e ? /* @__PURE__ */ n("output", { "aria-label": "Cargando", style: { display: "inline-flex", alignItems: "center" }, children: /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", style: { animation: "spin 0.75s linear infinite" }, "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }) }) : /* @__PURE__ */ u(h, { children: [
|
|
34
|
+
t && /* @__PURE__ */ n("span", { "aria-hidden": "true", children: t }),
|
|
35
|
+
c,
|
|
36
|
+
i && /* @__PURE__ */ n("span", { "aria-hidden": "true", children: i })
|
|
37
|
+
] }) });
|
|
5
38
|
}
|
|
6
39
|
export {
|
|
7
|
-
|
|
40
|
+
k as Button
|
|
8
41
|
};
|
package/dist/index.esm3.js
CHANGED
|
@@ -1,49 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
width: "16",
|
|
29
|
-
height: "16",
|
|
30
|
-
viewBox: "0 0 24 24",
|
|
31
|
-
fill: "none",
|
|
32
|
-
stroke: "currentColor",
|
|
33
|
-
strokeWidth: "2.5",
|
|
34
|
-
strokeLinecap: "round",
|
|
35
|
-
style: { animation: "spin 0.75s linear infinite" },
|
|
36
|
-
"aria-hidden": "true",
|
|
37
|
-
children: /* @__PURE__ */ e("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" })
|
|
38
|
-
}
|
|
39
|
-
) }) : /* @__PURE__ */ p(f, { children: [
|
|
40
|
-
n && /* @__PURE__ */ e("span", { "aria-hidden": "true", children: n }),
|
|
41
|
-
d,
|
|
42
|
-
r && /* @__PURE__ */ e("span", { "aria-hidden": "true", children: r })
|
|
43
|
-
] })
|
|
44
|
-
}
|
|
45
|
-
);
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import l from "@emotion/styled";
|
|
3
|
+
import { tokens as o } from "@danielcruzcode/design-tokens";
|
|
4
|
+
const t = {
|
|
5
|
+
brand: `background-color: ${o.color.brandSubtle}; color: ${o.color.brand};`,
|
|
6
|
+
success: `background-color: ${o.color.successSubtle}; color: ${o.color.success};`,
|
|
7
|
+
warning: `background-color: ${o.color.warningSubtle}; color: ${o.color.warning};`,
|
|
8
|
+
danger: `background-color: ${o.color.dangerSubtle}; color: ${o.color.danger};`,
|
|
9
|
+
neutral: `background-color: ${o.color.surface}; color: ${o.color.textMuted};`
|
|
10
|
+
}, a = {
|
|
11
|
+
sm: "font-size: 11px; padding: 2px 6px;",
|
|
12
|
+
md: `font-size: 13px; padding: 4px ${o.space.sm};`
|
|
13
|
+
}, s = l.span`
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
border-radius: ${o.radius.full};
|
|
18
|
+
font-family: ${o.font.body};
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
line-height: 1;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
${({ variant: r }) => t[r]}
|
|
23
|
+
${({ size: r }) => a[r]}
|
|
24
|
+
`;
|
|
25
|
+
function g({ variant: r = "neutral", size: n = "md", children: e }) {
|
|
26
|
+
return /* @__PURE__ */ c(s, { variant: r, size: n, children: e });
|
|
46
27
|
}
|
|
47
28
|
export {
|
|
48
|
-
|
|
29
|
+
g as Badge
|
|
49
30
|
};
|
package/dist/index.esm4.js
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
);
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import t from "@emotion/styled";
|
|
3
|
+
import { tokens as o } from "@danielcruzcode/design-tokens";
|
|
4
|
+
const d = {
|
|
5
|
+
default: `background-color:${o.color.surface};color:${o.color.text};border:1px solid ${o.color.border};`,
|
|
6
|
+
brand: `background-color:${o.color.brandSubtle};color:${o.color.brand};border:1px solid ${o.color.brand};`
|
|
7
|
+
}, a = t.span`
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 4px;
|
|
11
|
+
border-radius: ${o.radius.full};
|
|
12
|
+
font-family: ${o.font.body};
|
|
13
|
+
font-size: 13px;
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
padding: 4px ${o.space.sm};
|
|
16
|
+
${({ variant: r }) => d[r]}
|
|
17
|
+
`, c = t.button`
|
|
18
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
19
|
+
background: none; border: none; padding: 0; cursor: pointer;
|
|
20
|
+
color: inherit; opacity: 0.7; border-radius: ${o.radius.full};
|
|
21
|
+
&:hover { opacity: 1; }
|
|
22
|
+
&:focus-visible { outline: 2px solid ${o.color.borderFocus}; outline-offset: 1px; }
|
|
23
|
+
`;
|
|
24
|
+
function f({ label: r, onRemove: n, variant: i = "default" }) {
|
|
25
|
+
return /* @__PURE__ */ l(a, { variant: i, children: [
|
|
26
|
+
r,
|
|
27
|
+
n && /* @__PURE__ */ e(c, { type: "button", onClick: n, "aria-label": `Eliminar ${r}`, children: /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "M9 3L3 9M3 3l6 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
|
|
28
|
+
] });
|
|
32
29
|
}
|
|
33
30
|
export {
|
|
34
|
-
|
|
31
|
+
f as Tag
|
|
35
32
|
};
|
package/dist/index.esm5.js
CHANGED
|
@@ -1,101 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return /* @__PURE__ */ c("div", { children: [
|
|
29
|
-
/* @__PURE__ */ e(
|
|
30
|
-
B,
|
|
31
|
-
{
|
|
32
|
-
modules: [
|
|
33
|
-
...i ? [y] : [],
|
|
34
|
-
...o ? [$] : [],
|
|
35
|
-
...s ? [j] : []
|
|
36
|
-
],
|
|
37
|
-
slidesPerView: w,
|
|
38
|
-
breakpoints: k,
|
|
39
|
-
spaceBetween: h,
|
|
40
|
-
slidesPerGroup: v,
|
|
41
|
-
loop: f,
|
|
42
|
-
autoplay: s ? { delay: m, disableOnInteraction: !1 } : !1,
|
|
43
|
-
pagination: o ? {
|
|
44
|
-
el: ".swiper-custom-dots",
|
|
45
|
-
clickable: !0,
|
|
46
|
-
bulletClass: P,
|
|
47
|
-
bulletActiveClass: N,
|
|
48
|
-
renderBullet: (r, l) => `<button class="${l}" />`
|
|
49
|
-
} : !1,
|
|
50
|
-
navigation: i ? { prevEl: ".swiper-custom-prev", nextEl: ".swiper-custom-next" } : !1,
|
|
51
|
-
onSwiper: (r) => {
|
|
52
|
-
b.current = r;
|
|
53
|
-
},
|
|
54
|
-
onSlideChange: (r) => n == null ? void 0 : n(r.realIndex),
|
|
55
|
-
children: u.map((r, l) => /* @__PURE__ */ e(L, { children: r }, l))
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
i && /* @__PURE__ */ c(x, { children: [
|
|
59
|
-
/* @__PURE__ */ e(
|
|
60
|
-
"button",
|
|
61
|
-
{
|
|
62
|
-
type: "button",
|
|
63
|
-
className: `${p} ${S} swiper-custom-prev`,
|
|
64
|
-
"aria-label": "Slide anterior",
|
|
65
|
-
children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
66
|
-
"path",
|
|
67
|
-
{
|
|
68
|
-
d: "M10 12L6 8l4-4",
|
|
69
|
-
stroke: "currentColor",
|
|
70
|
-
strokeWidth: "1.5",
|
|
71
|
-
strokeLinecap: "round",
|
|
72
|
-
strokeLinejoin: "round"
|
|
73
|
-
}
|
|
74
|
-
) })
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ e(
|
|
78
|
-
"button",
|
|
79
|
-
{
|
|
80
|
-
type: "button",
|
|
81
|
-
className: `${p} ${A} swiper-custom-next`,
|
|
82
|
-
"aria-label": "Slide siguiente",
|
|
83
|
-
children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
84
|
-
"path",
|
|
85
|
-
{
|
|
86
|
-
d: "M6 4l4 4-4 4",
|
|
87
|
-
stroke: "currentColor",
|
|
88
|
-
strokeWidth: "1.5",
|
|
89
|
-
strokeLinecap: "round",
|
|
90
|
-
strokeLinejoin: "round"
|
|
91
|
-
}
|
|
92
|
-
) })
|
|
93
|
-
}
|
|
94
|
-
)
|
|
1
|
+
import { jsxs as a, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import e from "@emotion/styled";
|
|
3
|
+
import { tokens as o } from "@danielcruzcode/design-tokens";
|
|
4
|
+
import { useId as I } from "react";
|
|
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
|
+
display:flex;align-items:center;gap:${o.space.sm};
|
|
7
|
+
border-radius:${o.radius.md};
|
|
8
|
+
border:1.5px solid ${({ hasError: r }) => r ? o.color.danger : o.color.border};
|
|
9
|
+
background-color:${({ disabled: r }) => r ? o.color.surface : o.color.background};
|
|
10
|
+
padding-inline:${o.space.sm};opacity:${({ disabled: r }) => r ? 0.6 : 1};
|
|
11
|
+
cursor:${({ disabled: r }) => r ? "not-allowed" : "auto"};
|
|
12
|
+
transition:border-color ${o.transition.fast};
|
|
13
|
+
&:focus-within {
|
|
14
|
+
border-color:${({ hasError: r }) => r ? o.color.danger : o.color.borderFocus};
|
|
15
|
+
box-shadow:0 0 0 3px ${({ hasError: r }) => r ? o.color.dangerSubtle : o.color.brandSubtle};
|
|
16
|
+
}
|
|
17
|
+
`, j = e.input`
|
|
18
|
+
flex:1;border:none;outline:none;background:transparent;
|
|
19
|
+
font-family:${o.font.body};font-size:15px;color:${o.color.text};height:40px;
|
|
20
|
+
&::placeholder{color:${o.color.textMuted};}&:disabled{cursor:not-allowed;}
|
|
21
|
+
`, b = e.span`display:flex;align-items:center;color:${o.color.textMuted};flex-shrink:0;`, B = e.span`font-size:12px;color:${o.color.textMuted};`, E = e.span`font-size:12px;color:${o.color.danger};`;
|
|
22
|
+
function R({ label: r, placeholder: m, value: h, onChange: i, type: g = "text", error: t, hint: d, disabled: s = !1, required: p = !1, leftIcon: u, rightIcon: f, name: y, id: c }) {
|
|
23
|
+
const v = I(), l = c != null ? c : v, x = t ? `${l}-error` : void 0, $ = d ? `${l}-hint` : void 0;
|
|
24
|
+
return /* @__PURE__ */ a(w, { children: [
|
|
25
|
+
r && /* @__PURE__ */ a(z, { htmlFor: l, children: [
|
|
26
|
+
r,
|
|
27
|
+
p && /* @__PURE__ */ n(M, { "aria-hidden": "true", children: " *" })
|
|
95
28
|
] }),
|
|
96
|
-
|
|
29
|
+
/* @__PURE__ */ a(S, { hasError: !!t, disabled: s, children: [
|
|
30
|
+
u && /* @__PURE__ */ n(b, { "aria-hidden": "true", children: u }),
|
|
31
|
+
/* @__PURE__ */ n(j, { id: l, name: y, type: g, placeholder: m, value: h, onChange: (k) => i == null ? void 0 : i(k.target.value), disabled: s, required: p, "aria-invalid": t ? !0 : void 0, "aria-describedby": [x, $].filter(Boolean).join(" ") || void 0 }),
|
|
32
|
+
f && /* @__PURE__ */ n(b, { "aria-hidden": "true", children: f })
|
|
33
|
+
] }),
|
|
34
|
+
t && /* @__PURE__ */ n(E, { id: x, role: "alert", children: t }),
|
|
35
|
+
d && !t && /* @__PURE__ */ n(B, { id: $, children: d })
|
|
97
36
|
] });
|
|
98
37
|
}
|
|
99
38
|
export {
|
|
100
|
-
|
|
39
|
+
R as Input
|
|
101
40
|
};
|
package/dist/index.esm6.js
CHANGED
|
@@ -1,61 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
children: [
|
|
27
|
-
/* @__PURE__ */ r(
|
|
28
|
-
"input",
|
|
29
|
-
{
|
|
30
|
-
ref: i,
|
|
31
|
-
id: a,
|
|
32
|
-
name: c,
|
|
33
|
-
type: "checkbox",
|
|
34
|
-
className: m,
|
|
35
|
-
checked: t,
|
|
36
|
-
disabled: n,
|
|
37
|
-
onChange: (u) => o == null ? void 0 : o(u.target.checked),
|
|
38
|
-
"aria-checked": e ? "mixed" : t
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ h("span", { className: f, "aria-hidden": "true", children: [
|
|
42
|
-
e && /* @__PURE__ */ r("svg", { width: "10", height: "2", viewBox: "0 0 10 2", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { d: "M1 1h8", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }) }),
|
|
43
|
-
t && !e && /* @__PURE__ */ r("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ r(
|
|
44
|
-
"path",
|
|
45
|
-
{
|
|
46
|
-
d: "M1 4l3 3 5-6",
|
|
47
|
-
stroke: "white",
|
|
48
|
-
strokeWidth: "1.8",
|
|
49
|
-
strokeLinecap: "round",
|
|
50
|
-
strokeLinejoin: "round"
|
|
51
|
-
}
|
|
52
|
-
) })
|
|
53
|
-
] }),
|
|
54
|
-
l && /* @__PURE__ */ r("span", { className: w, children: l })
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
);
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import n from "@emotion/styled";
|
|
3
|
+
import { tokens as o } from "@danielcruzcode/design-tokens";
|
|
4
|
+
import { useId as m } from "react";
|
|
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
|
+
width:100%;height:40px;padding-inline-start:${o.space.sm};padding-inline-end:36px;
|
|
7
|
+
border-radius:${o.radius.md};border:1.5px solid ${({ hasError: e }) => e ? o.color.danger : o.color.border};
|
|
8
|
+
background-color:${o.color.background};font-family:${o.font.body};font-size:15px;
|
|
9
|
+
color:${o.color.text};appearance:none;cursor:pointer;transition:border-color ${o.transition.fast};
|
|
10
|
+
&:focus{outline:none;border-color:${({ hasError: e }) => e ? o.color.danger : o.color.borderFocus};box-shadow:0 0 0 3px ${({ hasError: e }) => e ? o.color.dangerSubtle : o.color.brandSubtle};}
|
|
11
|
+
&:disabled{background-color:${o.color.surface};cursor:not-allowed;opacity:0.6;}
|
|
12
|
+
`, k = n.span`position:absolute;right:${o.space.sm};pointer-events:none;color:${o.color.textMuted};display:flex;align-items:center;`, w = n.span`font-size:12px;color:${o.color.danger};`;
|
|
13
|
+
function L({ options: e, value: b, onChange: l, label: s, placeholder: p, error: i, disabled: f = !1, name: x, id: d }) {
|
|
14
|
+
const h = m(), a = d != null ? d : h, u = i ? `${a}-error` : void 0;
|
|
15
|
+
return /* @__PURE__ */ c(g, { children: [
|
|
16
|
+
s && /* @__PURE__ */ r($, { htmlFor: a, children: s }),
|
|
17
|
+
/* @__PURE__ */ c(v, { children: [
|
|
18
|
+
/* @__PURE__ */ c(y, { id: a, name: x, hasError: !!i, value: b, onChange: (t) => l == null ? void 0 : l(t.target.value), disabled: f, "aria-invalid": i ? !0 : void 0, "aria-describedby": u, children: [
|
|
19
|
+
p && /* @__PURE__ */ r("option", { value: "", disabled: !0, children: p }),
|
|
20
|
+
e.map((t) => /* @__PURE__ */ r("option", { value: t.value, disabled: t.disabled, children: t.label }, t.value))
|
|
21
|
+
] }),
|
|
22
|
+
/* @__PURE__ */ r(k, { "aria-hidden": "true", children: /* @__PURE__ */ r("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ r("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
23
|
+
] }),
|
|
24
|
+
i && /* @__PURE__ */ r(w, { id: u, role: "alert", children: i })
|
|
25
|
+
] });
|
|
58
26
|
}
|
|
59
27
|
export {
|
|
60
|
-
|
|
28
|
+
L as Select
|
|
61
29
|
};
|
package/dist/index.esm7.js
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import i from "@emotion/styled";
|
|
3
|
+
import { tokens as t } from "@danielcruzcode/design-tokens";
|
|
4
|
+
import { useId as x, useRef as b, useEffect as k } from "react";
|
|
5
|
+
const g = i.label`
|
|
6
|
+
display: inline-flex; align-items: center; gap: ${t.space.sm};
|
|
7
|
+
cursor: ${({ disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
8
|
+
opacity: ${({ disabled: o }) => o ? 0.5 : 1};
|
|
9
|
+
font-family: ${t.font.body}; user-select: none;
|
|
10
|
+
`, m = i.input`position:absolute;opacity:0;width:0;height:0;margin:0;`, $ = i.span`
|
|
11
|
+
width: 18px; height: 18px; border-radius: ${t.radius.sm};
|
|
12
|
+
border: 1.5px solid ${({ active: o }) => o ? t.color.brand : t.color.border};
|
|
13
|
+
background-color: ${({ active: o }) => o ? t.color.brand : t.color.background};
|
|
14
|
+
display: flex; align-items: center; justify-content: center; flex-shrink: 0;
|
|
15
|
+
transition: background-color ${t.transition.fast}, border-color ${t.transition.fast};
|
|
16
|
+
`, w = i.span`font-size: 15px; color: ${t.color.text};`;
|
|
17
|
+
function B({ checked: o = !1, onChange: n, label: l, disabled: a = !1, indeterminate: r = !1, name: h, id: s }) {
|
|
18
|
+
const p = x(), d = s != null ? s : p, c = b(null);
|
|
19
|
+
return k(() => {
|
|
20
|
+
c.current && (c.current.indeterminate = r);
|
|
21
|
+
}, [r]), /* @__PURE__ */ f(g, { htmlFor: d, disabled: a, children: [
|
|
22
|
+
/* @__PURE__ */ e(m, { ref: c, id: d, name: h, type: "checkbox", checked: o, disabled: a, onChange: (u) => n == null ? void 0 : n(u.target.checked), "aria-checked": r ? "mixed" : o }),
|
|
23
|
+
/* @__PURE__ */ f($, { active: o || r, "aria-hidden": "true", children: [
|
|
24
|
+
r && /* @__PURE__ */ e("svg", { width: "10", height: "2", viewBox: "0 0 10 2", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1h8", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }) }),
|
|
25
|
+
o && !r && /* @__PURE__ */ e("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 4l3 3 5-6", stroke: "white", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
26
|
+
] }),
|
|
27
|
+
l && /* @__PURE__ */ e(w, { children: l })
|
|
28
|
+
] });
|
|
5
29
|
}
|
|
6
30
|
export {
|
|
7
|
-
|
|
31
|
+
B as Checkbox
|
|
8
32
|
};
|
package/dist/index.esm8.js
CHANGED
|
@@ -1,58 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */ e(
|
|
35
|
-
"input",
|
|
36
|
-
{
|
|
37
|
-
id: i,
|
|
38
|
-
name: x,
|
|
39
|
-
type: f,
|
|
40
|
-
className: y,
|
|
41
|
-
placeholder: N,
|
|
42
|
-
value: v,
|
|
43
|
-
onChange: (I) => s == null ? void 0 : s(I.target.value),
|
|
44
|
-
disabled: d,
|
|
45
|
-
required: c,
|
|
46
|
-
"aria-invalid": a ? !0 : void 0,
|
|
47
|
-
"aria-describedby": [m, u].filter(Boolean).join(" ") || void 0
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
o && /* @__PURE__ */ e("span", { className: h, "aria-hidden": "true", children: o })
|
|
51
|
-
] }),
|
|
52
|
-
a && /* @__PURE__ */ e("span", { id: m, className: D, role: "alert", children: a }),
|
|
53
|
-
l && !a && /* @__PURE__ */ e("span", { id: u, className: E, children: l })
|
|
54
|
-
] });
|
|
1
|
+
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import e from "@emotion/styled";
|
|
3
|
+
import { tokens as o } from "@danielcruzcode/design-tokens";
|
|
4
|
+
const v = { none: "0", sm: o.space.sm, md: o.space.md, lg: o.space.lg }, f = e.article`
|
|
5
|
+
display:flex;flex-direction:column;background-color:${o.color.background};
|
|
6
|
+
border-radius:${o.radius.md};border:1px solid ${o.color.border};
|
|
7
|
+
overflow:hidden;position:relative;
|
|
8
|
+
transition:box-shadow ${o.transition.normal},transform ${o.transition.normal};
|
|
9
|
+
max-width:15rem;height:27rem;padding:${({ padding: r }) => v[r]};
|
|
10
|
+
${({ hoverable: r }) => r && `cursor:pointer;&:hover{box-shadow:${o.shadow.sm};transform:translateY(-2px);}`}
|
|
11
|
+
`, x = e.div`width:100%;overflow:hidden;`, $ = e.div`padding:${o.space.sm} ${o.space.md};`, b = e.div`padding:0 ${o.space.md};flex:1;`, g = e.div`padding:${o.space.md};border-top:1px solid ${o.color.border};margin-top:auto;`;
|
|
12
|
+
function j({ media: r, header: i, body: s, footer: l, onClick: d, hoverable: c = !1, className: p, padding: m = "none" }) {
|
|
13
|
+
const n = !!d;
|
|
14
|
+
return /* @__PURE__ */ h(
|
|
15
|
+
f,
|
|
16
|
+
{
|
|
17
|
+
hoverable: c || n,
|
|
18
|
+
padding: m,
|
|
19
|
+
className: p,
|
|
20
|
+
onClick: d,
|
|
21
|
+
role: n ? "button" : void 0,
|
|
22
|
+
tabIndex: n ? 0 : void 0,
|
|
23
|
+
onKeyDown: n ? (t) => {
|
|
24
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), d == null || d());
|
|
25
|
+
} : void 0,
|
|
26
|
+
children: [
|
|
27
|
+
r && /* @__PURE__ */ a(x, { children: r }),
|
|
28
|
+
i && /* @__PURE__ */ a($, { children: i }),
|
|
29
|
+
s && /* @__PURE__ */ a(b, { children: s }),
|
|
30
|
+
l && /* @__PURE__ */ a(g, { children: l })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
55
34
|
}
|
|
56
35
|
export {
|
|
57
|
-
|
|
36
|
+
j as Card
|
|
58
37
|
};
|