@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.
Files changed (127) hide show
  1. package/dist/commerce/ProductCard/ProductCard.d.ts +1 -1
  2. package/dist/commerce/ProductCard/ProductCard.d.ts.map +1 -1
  3. package/dist/commerce/ProductShelf/ProductShelf.d.ts +1 -1
  4. package/dist/commerce/ProductShelf/ProductShelf.d.ts.map +1 -1
  5. package/dist/components/Card/Card.d.ts +1 -1
  6. package/dist/components/Card/Card.d.ts.map +1 -1
  7. package/dist/components/Carousel/Carousel.d.ts +2 -2
  8. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  9. package/dist/index.cjs.js +1 -1
  10. package/dist/index.cjs10.js +1 -1
  11. package/dist/index.cjs11.js +1 -1
  12. package/dist/index.cjs12.js +5 -1
  13. package/dist/index.cjs13.js +6 -1
  14. package/dist/index.cjs14.js +1 -1
  15. package/dist/index.cjs15.js +1 -1
  16. package/dist/index.cjs16.js +1 -1
  17. package/dist/index.cjs2.js +19 -1
  18. package/dist/index.cjs3.js +12 -1
  19. package/dist/index.cjs4.js +17 -1
  20. package/dist/index.cjs5.js +17 -1
  21. package/dist/index.cjs6.js +8 -1
  22. package/dist/index.cjs7.js +12 -1
  23. package/dist/index.cjs8.js +8 -1
  24. package/dist/index.cjs9.js +18 -1
  25. package/dist/index.esm.js +22 -22
  26. package/dist/index.esm10.js +65 -61
  27. package/dist/index.esm11.js +24 -48
  28. package/dist/index.esm12.js +11 -22
  29. package/dist/index.esm13.js +12 -25
  30. package/dist/index.esm14.js +22 -11
  31. package/dist/index.esm15.js +33 -5
  32. package/dist/index.esm16.js +1202 -5
  33. package/dist/index.esm2.js +38 -5
  34. package/dist/index.esm3.js +27 -46
  35. package/dist/index.esm4.js +29 -32
  36. package/dist/index.esm5.js +35 -96
  37. package/dist/index.esm6.js +26 -58
  38. package/dist/index.esm7.js +29 -5
  39. package/dist/index.esm8.js +34 -55
  40. package/dist/index.esm9.js +69 -162
  41. package/dist/layout/Container/Container.d.ts +2 -1
  42. package/dist/layout/Container/Container.d.ts.map +1 -1
  43. package/dist/layout/Stack/Stack.d.ts +4 -3
  44. package/dist/layout/Stack/Stack.d.ts.map +1 -1
  45. package/dist/primitives/Badge/Badge.d.ts.map +1 -1
  46. package/dist/primitives/Button/Button.d.ts +1 -1
  47. package/dist/primitives/Button/Button.d.ts.map +1 -1
  48. package/dist/primitives/Checkbox/Checkbox.d.ts +1 -1
  49. package/dist/primitives/Checkbox/Checkbox.d.ts.map +1 -1
  50. package/dist/primitives/Input/Input.d.ts +1 -1
  51. package/dist/primitives/Input/Input.d.ts.map +1 -1
  52. package/dist/primitives/Select/Select.d.ts +1 -1
  53. package/dist/primitives/Select/Select.d.ts.map +1 -1
  54. package/dist/primitives/Tag/Tag.d.ts.map +1 -1
  55. package/package.json +6 -26
  56. package/dist/commerce/ProductCard/ProductCard.css.d.ts +0 -23
  57. package/dist/commerce/ProductCard/ProductCard.css.d.ts.map +0 -1
  58. package/dist/commerce/ProductShelf/ProductShelf.css.d.ts +0 -3
  59. package/dist/commerce/ProductShelf/ProductShelf.css.d.ts.map +0 -1
  60. package/dist/components/Card/Card.css.d.ts +0 -30
  61. package/dist/components/Card/Card.css.d.ts.map +0 -1
  62. package/dist/components/Carousel/Carousel.css.d.ts +0 -8
  63. package/dist/components/Carousel/Carousel.css.d.ts.map +0 -1
  64. package/dist/index.cjs17.js +0 -1
  65. package/dist/index.cjs18.js +0 -1
  66. package/dist/index.cjs19.js +0 -1
  67. package/dist/index.cjs20.js +0 -1
  68. package/dist/index.cjs21.js +0 -1
  69. package/dist/index.cjs22.js +0 -1
  70. package/dist/index.cjs23.js +0 -1
  71. package/dist/index.cjs24.js +0 -1
  72. package/dist/index.cjs25.js +0 -1
  73. package/dist/index.cjs26.js +0 -1
  74. package/dist/index.cjs27.js +0 -1
  75. package/dist/index.cjs28.js +0 -1
  76. package/dist/index.cjs30.js +0 -1
  77. package/dist/index.cjs31.js +0 -1
  78. package/dist/index.cjs35.js +0 -1
  79. package/dist/index.cjs44.js +0 -1
  80. package/dist/index.cjs45.js +0 -1
  81. package/dist/index.cjs46.js +0 -1
  82. package/dist/index.cjs49.js +0 -1
  83. package/dist/index.cjs50.js +0 -1
  84. package/dist/index.cjs51.js +0 -1
  85. package/dist/index.cjs52.js +0 -1
  86. package/dist/index.esm17.js +0 -8
  87. package/dist/index.esm18.js +0 -15
  88. package/dist/index.esm19.js +0 -12
  89. package/dist/index.esm20.js +0 -26
  90. package/dist/index.esm21.js +0 -7
  91. package/dist/index.esm22.js +0 -7
  92. package/dist/index.esm23.js +0 -11
  93. package/dist/index.esm24.js +0 -136
  94. package/dist/index.esm25.js +0 -226
  95. package/dist/index.esm26.js +0 -130
  96. package/dist/index.esm27.js +0 -280
  97. package/dist/index.esm28.js +0 -11
  98. package/dist/index.esm30.js +0 -5
  99. package/dist/index.esm31.js +0 -1
  100. package/dist/index.esm35.js +0 -88
  101. package/dist/index.esm44.js +0 -2038
  102. package/dist/index.esm45.js +0 -60
  103. package/dist/index.esm46.js +0 -191
  104. package/dist/index.esm49.js +0 -12
  105. package/dist/index.esm50.js +0 -182
  106. package/dist/index.esm51.js +0 -6
  107. package/dist/index.esm52.js +0 -134
  108. package/dist/layout/Container/Container.css.d.ts +0 -20
  109. package/dist/layout/Container/Container.css.d.ts.map +0 -1
  110. package/dist/layout/Stack/Stack.css.d.ts +0 -2
  111. package/dist/layout/Stack/Stack.css.d.ts.map +0 -1
  112. package/dist/primitives/Badge/Badge.css.d.ts +0 -37
  113. package/dist/primitives/Badge/Badge.css.d.ts.map +0 -1
  114. package/dist/primitives/Button/Button.css.d.ts +0 -60
  115. package/dist/primitives/Button/Button.css.d.ts.map +0 -1
  116. package/dist/primitives/Checkbox/Checkbox.css.d.ts +0 -9
  117. package/dist/primitives/Checkbox/Checkbox.css.d.ts.map +0 -1
  118. package/dist/primitives/Input/Input.css.d.ts +0 -11
  119. package/dist/primitives/Input/Input.css.d.ts.map +0 -1
  120. package/dist/primitives/Select/Select.css.d.ts +0 -8
  121. package/dist/primitives/Select/Select.css.d.ts.map +0 -1
  122. package/dist/primitives/Tag/Tag.css.d.ts +0 -16
  123. package/dist/primitives/Tag/Tag.css.d.ts.map +0 -1
  124. package/dist/styles.css +0 -1
  125. package/dist/styles.d.ts +0 -1
  126. package/dist/styles.d.ts.map +0 -1
  127. package/styles.css +0 -1
@@ -1,8 +1,41 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { badgeRecipe as o } from "./index.esm16.js";
3
- function p({ variant: e = "neutral", size: r = "md", children: a }) {
4
- return /* @__PURE__ */ m("span", { className: o({ variant: e, size: r }), children: a });
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
- p as Badge
40
+ k as Button
8
41
  };
@@ -1,49 +1,30 @@
1
- import { jsx as e, jsxs as p, Fragment as f } from "react/jsx-runtime";
2
- import { buttonRecipe as m } from "./index.esm15.js";
3
- function v({
4
- variant: t = "primary",
5
- size: a = "md",
6
- fullWidth: l = !1,
7
- loading: i = !1,
8
- disabled: s = !1,
9
- leftIcon: n,
10
- rightIcon: r,
11
- onClick: o,
12
- children: d,
13
- type: h = "button",
14
- className: u
15
- }) {
16
- const c = m({ variant: t, size: a, fullWidth: l || void 0 });
17
- return /* @__PURE__ */ e(
18
- "button",
19
- {
20
- type: h,
21
- className: [c, u].filter(Boolean).join(" "),
22
- disabled: s || i,
23
- onClick: o,
24
- "aria-busy": i,
25
- children: i ? /* @__PURE__ */ e("output", { "aria-label": "Cargando", style: { display: "inline-flex", alignItems: "center" }, children: /* @__PURE__ */ e(
26
- "svg",
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
- v as Button
29
+ g as Badge
49
30
  };
@@ -1,35 +1,32 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import { cardRecipe as f, cardMedia as h, cardHeader as p, cardBody as N, cardFooter as u } from "./index.esm23.js";
3
- function y({
4
- media: s,
5
- header: i,
6
- body: o,
7
- footer: t,
8
- onClick: e,
9
- hoverable: c = !1,
10
- className: n,
11
- padding: l = "none"
12
- }) {
13
- const a = !!e, v = f({ hoverable: c || void 0, padding: l });
14
- return /* @__PURE__ */ m(
15
- "article",
16
- {
17
- className: [v, n].filter(Boolean).join(" "),
18
- onClick: e,
19
- role: a ? "button" : void 0,
20
- tabIndex: a ? 0 : void 0,
21
- onKeyDown: a ? (d) => {
22
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), e == null || e());
23
- } : void 0,
24
- children: [
25
- s && /* @__PURE__ */ r("div", { className: h, children: s }),
26
- i && /* @__PURE__ */ r("div", { className: p, children: i }),
27
- o && /* @__PURE__ */ r("div", { className: N, children: o }),
28
- t && /* @__PURE__ */ r("div", { className: u, children: t })
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
- y as Card
31
+ f as Tag
35
32
  };
@@ -1,101 +1,40 @@
1
- import { jsxs as c, jsx as e, Fragment as x } from "react/jsx-runtime";
2
- import { useRef as g } from "react";
3
- import y from "./index.esm24.js";
4
- import $ from "./index.esm25.js";
5
- import j from "./index.esm26.js";
6
- import { Swiper as B, SwiperSlide as L } from "./index.esm27.js";
7
- import { dotActive as N, dot as P, arrowBtn as p, arrowPrev as S, arrowNext as A, dots as C } from "./index.esm28.js";
8
- /* empty css */
9
- const E = { sm: 8, md: 16, lg: 24, xl: 32 };
10
- function X({
11
- children: u,
12
- autoplay: s = !1,
13
- autoplayMs: m = 4e3,
14
- showArrows: i = !0,
15
- showDots: o = !0,
16
- loop: f = !1,
17
- slidesPerView: t = 1,
18
- slidesPerGroup: v,
19
- gap: a,
20
- onSlideChange: n
21
- }) {
22
- var d;
23
- const b = g(null), h = a ? (d = E[a]) != null ? d : 16 : 0, k = typeof t == "object" ? {
24
- 0: { slidesPerView: t.mobile },
25
- 640: { slidesPerView: t.tablet },
26
- 1024: { slidesPerView: t.desktop }
27
- } : void 0, w = typeof t == "number" ? t : void 0;
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
- o && /* @__PURE__ */ e("div", { className: `swiper-custom-dots ${C}` })
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
- X as Carousel
39
+ R as Input
101
40
  };
@@ -1,61 +1,29 @@
1
- import { jsxs as h, jsx as r } from "react/jsx-runtime";
2
- import { useId as p, useRef as x, useEffect as k } from "react";
3
- import { hiddenInput as m, labelText as w, wrapper as b, wrapperDisabled as j, box as v, boxIndeterminate as B, boxChecked as I } from "./index.esm19.js";
4
- function M({
5
- checked: t = !1,
6
- onChange: o,
7
- label: l,
8
- disabled: n = !1,
9
- indeterminate: e = !1,
10
- name: c,
11
- id: s
12
- }) {
13
- const d = p(), a = s != null ? s : d, i = x(null);
14
- k(() => {
15
- i.current && (i.current.indeterminate = e);
16
- }, [e]);
17
- const f = [
18
- v,
19
- t || e ? e ? B : I : ""
20
- ].filter(Boolean).join(" ");
21
- return /* @__PURE__ */ h(
22
- "label",
23
- {
24
- htmlFor: a,
25
- className: [b, n ? j : ""].filter(Boolean).join(" "),
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
- M as Checkbox
28
+ L as Select
61
29
  };
@@ -1,8 +1,32 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { containerRecipe as n } from "./index.esm22.js";
3
- function m({ maxWidth: r = "xl", children: o, as: e = "div" }) {
4
- return /* @__PURE__ */ i(e, { className: n({ maxWidth: r }), children: o });
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
- m as Container
31
+ B as Checkbox
8
32
  };
@@ -1,58 +1,37 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { useId as W } from "react";
3
- import { wrapper as w, label as B, requiredMark as k, iconSlot as h, input as y, errorText as D, hint as E, inputWrapper as F, inputWrapperError as M, inputWrapperDisabled as S } from "./index.esm18.js";
4
- function A({
5
- label: n,
6
- placeholder: N,
7
- value: v,
8
- onChange: s,
9
- type: f = "text",
10
- error: a,
11
- hint: l,
12
- disabled: d = !1,
13
- required: c = !1,
14
- leftIcon: p,
15
- rightIcon: o,
16
- name: x,
17
- id: t
18
- }) {
19
- const b = W(), i = t != null ? t : b, m = a ? `${i}-error` : void 0, u = l ? `${i}-hint` : void 0, j = [
20
- F,
21
- a ? M : "",
22
- d ? S : ""
23
- ].filter(Boolean).join(" ");
24
- return /* @__PURE__ */ r("div", { className: w, children: [
25
- n && /* @__PURE__ */ r("label", { className: B, htmlFor: i, children: [
26
- n,
27
- c && /* @__PURE__ */ r("span", { className: k, "aria-hidden": "true", children: [
28
- " ",
29
- "*"
30
- ] })
31
- ] }),
32
- /* @__PURE__ */ r("div", { className: j, children: [
33
- p && /* @__PURE__ */ e("span", { className: h, "aria-hidden": "true", children: p }),
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
- A as Input
36
+ j as Card
58
37
  };