@simpli-route/apollo-ds 0.0.16 → 0.0.18

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 (63) hide show
  1. package/dist/components/IconButton/IconButton.d.ts +4 -0
  2. package/dist/components/IconButton/IconButton.test.d.ts +1 -0
  3. package/dist/components/IconButton/index.d.ts +2 -0
  4. package/dist/components/IconButton/types.d.ts +9 -0
  5. package/dist/components/IconButton/variants.d.ts +8 -0
  6. package/dist/components/index.d.ts +1 -0
  7. package/dist/index.cjs.js +1 -1
  8. package/dist/index.cjs10.js +1 -1
  9. package/dist/index.cjs12.js +1 -1
  10. package/dist/index.cjs13.js +1 -1
  11. package/dist/index.cjs15.js +1 -1
  12. package/dist/index.cjs16.js +1 -1
  13. package/dist/index.cjs17.js +1 -1
  14. package/dist/index.cjs18.js +1 -1
  15. package/dist/index.cjs19.js +1 -1
  16. package/dist/index.cjs20.js +1 -1
  17. package/dist/index.cjs21.js +1 -1
  18. package/dist/index.cjs22.js +9 -1
  19. package/dist/index.cjs23.js +13 -3
  20. package/dist/index.cjs24.js +1 -19
  21. package/dist/index.cjs25.js +1 -1
  22. package/dist/index.cjs27.js +1 -1
  23. package/dist/index.cjs28.js +1 -1
  24. package/dist/index.cjs3.js +1 -1
  25. package/dist/index.cjs4.js +1 -1
  26. package/dist/index.cjs5.js +1 -1
  27. package/dist/index.cjs6.js +1 -1
  28. package/dist/index.cjs7.js +1 -1
  29. package/dist/index.cjs8.js +1 -1
  30. package/dist/index.cjs9.js +1 -1
  31. package/dist/index.d.ts +1 -7
  32. package/dist/index.es.js +10 -10
  33. package/dist/index.es10.js +3 -3
  34. package/dist/index.es12.js +1 -1
  35. package/dist/index.es13.js +173 -30
  36. package/dist/index.es15.js +87 -17
  37. package/dist/index.es16.js +22 -15
  38. package/dist/index.es17.js +14 -19
  39. package/dist/index.es18.js +17 -89
  40. package/dist/index.es19.js +29 -9
  41. package/dist/index.es20.js +152 -10
  42. package/dist/index.es21.js +2 -31
  43. package/dist/index.es22.js +30 -2
  44. package/dist/index.es23.js +590 -21
  45. package/dist/index.es24.js +5 -599
  46. package/dist/index.es25.js +2 -5
  47. package/dist/index.es26.js +2 -2
  48. package/dist/index.es27.js +21 -2
  49. package/dist/index.es28.js +21 -173
  50. package/dist/index.es3.js +6 -5
  51. package/dist/index.es4.js +1 -1
  52. package/dist/index.es5.js +37 -49
  53. package/dist/index.es6.js +48 -78
  54. package/dist/index.es7.js +80 -8
  55. package/dist/index.es8.js +6 -6
  56. package/dist/index.es9.js +8 -33
  57. package/dist/stories/IconButton.stories.d.ts +23 -0
  58. package/dist/style.css +47 -0
  59. package/package.json +10 -8
  60. package/dist/index.cjs29.js +0 -1
  61. package/dist/index.cjs30.js +0 -1
  62. package/dist/index.es29.js +0 -23
  63. package/dist/index.es30.js +0 -23
@@ -1,32 +1,175 @@
1
- import { j as e } from "./index.es10.js";
2
- import { cn as l } from "./index.es11.js";
3
- const m = (r) => {
4
- const { isIndeterminate: t, isSelected: s, className: n, isHovered: a } = r, o = a && !s && !t ? "text-neutral-500" : "", i = !!(o || s);
5
- return /* @__PURE__ */ e.jsx("svg", { className: l("stroke-current", o, n), viewBox: "-1 1 17 17", children: t ? /* @__PURE__ */ e.jsx(
6
- "line",
7
- {
8
- x1: 1,
9
- y1: 10,
10
- x2: 14,
11
- y2: 10,
12
- fill: "none",
13
- strokeWidth: 2,
14
- strokeDasharray: 14,
15
- strokeDashoffset: s ? 28 : 42,
16
- style: { transition: "all 400ms" }
17
- }
18
- ) : /* @__PURE__ */ e.jsx(
19
- "polyline",
20
- {
21
- points: "1 9 7 14 15 4",
22
- fill: "none",
23
- strokeWidth: 2,
24
- strokeDasharray: 22,
25
- strokeDashoffset: i ? 44 : 66,
26
- style: { transition: "all 400ms" }
27
- }
28
- ) });
29
- };
1
+ import { cva as r } from "class-variance-authority";
2
+ const t = r(
3
+ "inline-flex select-none items-center justify-center text-center text-base font-semibold leading-6 transition duration-150 ease-in-out focus:outline-none",
4
+ {
5
+ variants: {
6
+ intent: {
7
+ primary: "bg-primary-500 text-primary-50",
8
+ secondary: "border border-primary-500 bg-primary-50 text-primary-500",
9
+ tertiary: "text-primary-500",
10
+ outline: "border border-primary-500 text-primary-500",
11
+ success: "border bg-success-500 text-success-50",
12
+ error: "border bg-error-500 text-error-50",
13
+ orangeWarning: "border bg-orange-warning-500 text-orange-warning-50",
14
+ yellowWarning: "border bg-yellow-warning-500 text-[#6F5711]",
15
+ //TODO: Este color yellow-warning-900 esta mal en @simpli-route/tailwind-preset, debe borrarse la 'h' al final del color
16
+ info: "border bg-blue-500 text-blue-50"
17
+ },
18
+ size: {
19
+ xs: "rounded px-3 py-1",
20
+ sm: "rounded px-3 py-2",
21
+ md: "rounded-lg px-4 py-3",
22
+ lg: "rounded-lg px-6 py-4"
23
+ },
24
+ isDisabled: {
25
+ true: "pointer-events-none cursor-not-allowed border-none bg-neutral-400 text-neutral-600"
26
+ },
27
+ isHovered: {
28
+ true: ""
29
+ },
30
+ isActive: {
31
+ true: ""
32
+ },
33
+ fullWidth: {
34
+ true: "w-full",
35
+ false: "w-fit"
36
+ },
37
+ isLoading: {
38
+ true: "pointer-events-none cursor-not-allowed opacity-70"
39
+ },
40
+ isFocused: {
41
+ true: "focus:outline-none focus:ring-2 focus:ring-sky-400 focus:ring-offset-[0.4px] border-none",
42
+ false: ""
43
+ }
44
+ },
45
+ defaultVariants: {
46
+ intent: "primary",
47
+ size: "md"
48
+ },
49
+ compoundVariants: [
50
+ /* Hover State */
51
+ {
52
+ intent: "primary",
53
+ isHovered: !0,
54
+ class: "bg-primary-700"
55
+ },
56
+ {
57
+ intent: "secondary",
58
+ isHovered: !0,
59
+ class: "bg-primary-200"
60
+ },
61
+ {
62
+ intent: "tertiary",
63
+ isHovered: !0,
64
+ class: "bg-primary-300 text-primary-800"
65
+ },
66
+ {
67
+ intent: "outline",
68
+ isHovered: !0,
69
+ class: "bg-primary-500 text-primary-50"
70
+ },
71
+ {
72
+ intent: "success",
73
+ isHovered: !0,
74
+ class: "bg-success-700 text-neutral-50"
75
+ },
76
+ {
77
+ intent: "error",
78
+ isHovered: !0,
79
+ class: "bg-error-700 text-error-50"
80
+ },
81
+ {
82
+ intent: "orangeWarning",
83
+ isHovered: !0,
84
+ class: "bg-orange-warning-700 text-orange-warning-50"
85
+ },
86
+ {
87
+ intent: "yellowWarning",
88
+ isHovered: !0,
89
+ class: "bg-yellow-warning-700 text-neutral-50"
90
+ },
91
+ {
92
+ intent: "info",
93
+ isHovered: !0,
94
+ class: "bg-blue-700 text-blue-50"
95
+ },
96
+ /* /Focus State */
97
+ {
98
+ intent: "success",
99
+ isFocused: !0,
100
+ class: "border-[1.5px] focus:ring-success-500"
101
+ },
102
+ {
103
+ intent: "error",
104
+ isFocused: !0,
105
+ class: "border-[1.5px] focus:ring-error-500"
106
+ },
107
+ {
108
+ intent: "orangeWarning",
109
+ isFocused: !0,
110
+ class: "border-[1.5px] focus:ring-orange-500"
111
+ },
112
+ {
113
+ intent: "yellowWarning",
114
+ isFocused: !0,
115
+ class: "border-[1.5px] focus:ring-yellow-500"
116
+ },
117
+ {
118
+ intent: "info",
119
+ isFocused: !0,
120
+ class: "border-[1.5px] focus:ring-blue-500"
121
+ },
122
+ /* Active State */
123
+ {
124
+ intent: "primary",
125
+ isActive: !0,
126
+ class: "bg-primary-900"
127
+ },
128
+ {
129
+ intent: "secondary",
130
+ isActive: !0,
131
+ class: "bg-primary-300"
132
+ },
133
+ {
134
+ intent: "tertiary",
135
+ isActive: !0,
136
+ class: "bg-primary-500 text-white"
137
+ },
138
+ {
139
+ intent: "outline",
140
+ isActive: !0,
141
+ class: "border border-primary-500 bg-primary-300 text-primary-500"
142
+ },
143
+ {
144
+ intent: "success",
145
+ isActive: !0,
146
+ class: "border border-transparent bg-success-300 text-success-900"
147
+ },
148
+ {
149
+ intent: "error",
150
+ isActive: !0,
151
+ class: "border border-transparent bg-error-300 text-error-900"
152
+ },
153
+ {
154
+ intent: "orangeWarning",
155
+ isActive: !0,
156
+ class: "border border-transparent bg-orange-warning-300 text-orange-warning-900"
157
+ },
158
+ {
159
+ intent: "yellowWarning",
160
+ isActive: !0,
161
+ class: "border border-transparent bg-yellow-warning-300 text-[#6F5711]"
162
+ //TODO: Este color yellow-warning-900 esta mal en @simpli-route/tailwind-preset, debe borrarse la 'h' al final del color
163
+ },
164
+ {
165
+ intent: "info",
166
+ isActive: !0,
167
+ class: "border border-transparent bg-blue-200 text-blue-900"
168
+ }
169
+ /* /Active State */
170
+ ]
171
+ }
172
+ );
30
173
  export {
31
- m as MarkIcon
174
+ t as buttonVariants
32
175
  };
@@ -1,24 +1,94 @@
1
- import { cva as t } from "class-variance-authority";
2
- const o = t("scroll-m-12 text-neutral-900", {
1
+ import { cva as e } from "class-variance-authority";
2
+ const s = e("relative rounded-full transition-colors duration-300", {
3
3
  variants: {
4
+ isSelected: {
5
+ true: "bg-primary-500",
6
+ false: "bg-neutral-50 border border-primary-200"
7
+ },
8
+ isDisabled: {
9
+ true: "cursor-not-allowed bg-neutral-400 border-none",
10
+ false: "cursor-pointer"
11
+ },
12
+ isHoveredWhenOff: {
13
+ true: "bg-neutral-200 border-primary-700",
14
+ false: ""
15
+ },
16
+ isFocusVisible: {
17
+ true: "ring-2 ring-sky-400 ring-offset-2",
18
+ false: ""
19
+ },
4
20
  size: {
5
- h1: "text-[2rem] font-bold leading-10",
6
- h2: "text-[1.75rem] font-bold leading-9",
7
- h3: "text-2xl font-semibold",
8
- h4: "text-[1.375rem] font-semibold leading-7",
9
- h5: "text-xl font-semibold",
10
- h6: "text-lg font-semibold"
21
+ sm: "w-[42px] h-[24px]",
22
+ md: "w-[56px] h-[32px]"
11
23
  }
12
- }
13
- }), n = t("", {
14
- variants: {
15
- type: {
16
- body: "text-base text-neutral-900",
17
- caption: "text-xs text-neutral-700"
24
+ },
25
+ defaultVariants: {
26
+ size: "md",
27
+ isSelected: !1,
28
+ isDisabled: !1,
29
+ isFocusVisible: !1,
30
+ isHoveredWhenOff: !1
31
+ },
32
+ compoundVariants: [
33
+ // Hover cuando el switch está apagado y no deshabilitado
34
+ {
35
+ isSelected: !1,
36
+ isDisabled: !1,
37
+ class: "hover:bg-neutral-200 hover:border-primary-700"
38
+ },
39
+ {
40
+ isSelected: !0,
41
+ isDisabled: !1,
42
+ class: "hover:bg-primary-700"
43
+ },
44
+ {
45
+ isSelected: !1,
46
+ isDisabled: !0,
47
+ class: "bg-neutral-400 border-none"
48
+ },
49
+ {
50
+ isSelected: !0,
51
+ isDisabled: !0,
52
+ class: "bg-neutral-500"
18
53
  }
54
+ ]
55
+ }), a = e(
56
+ "absolute top-1/2 transform -translate-y-1/2 transition-all duration-300 rounded-full",
57
+ {
58
+ variants: {
59
+ isSelected: {
60
+ true: "bg-primary-50",
61
+ false: "bg-primary-200 border border-primary-200"
62
+ },
63
+ isDisabled: {
64
+ true: "bg-neutral-600 border-none",
65
+ false: ""
66
+ },
67
+ isHoveredWhenOff: {
68
+ true: "bg-primary-700 border-primary-700",
69
+ false: ""
70
+ },
71
+ size: {
72
+ sm: "w-[20px] h-[20px]",
73
+ md: "w-[24px] h-[24px]"
74
+ }
75
+ },
76
+ defaultVariants: {
77
+ size: "md",
78
+ isSelected: !1,
79
+ isDisabled: !1,
80
+ isHoveredWhenOff: !1
81
+ },
82
+ compoundVariants: [
83
+ {
84
+ isSelected: !0,
85
+ isDisabled: !0,
86
+ class: "bg-neutral-400"
87
+ }
88
+ ]
19
89
  }
20
- });
90
+ );
21
91
  export {
22
- n as textVariants,
23
- o as titleVariants
92
+ a as indicatorVariants,
93
+ s as switchVariants
24
94
  };
@@ -1,17 +1,24 @@
1
- import { j as t } from "./index.es10.js";
2
- import { cn as m } from "./index.es11.js";
3
- const u = ({
4
- label: x,
5
- description: e,
6
- errorMessage: n,
7
- isDisabled: s,
8
- isInvalid: r,
9
- children: l
10
- }) => !x && !e && !l ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
11
- x ? /* @__PURE__ */ t.jsx("p", { className: m("text-sm font-semibold", s ? "text-neutral-600" : "text-neutral-900"), children: x }) : l,
12
- e && !n && /* @__PURE__ */ t.jsx("p", { className: m("text-xs", s ? "text-neutral-600" : "text-neutral-800"), children: e }),
13
- r && n && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-red-500", children: n })
14
- ] });
1
+ import { cva as t } from "class-variance-authority";
2
+ const o = t("scroll-m-12 text-neutral-900", {
3
+ variants: {
4
+ size: {
5
+ h1: "text-[2rem] font-bold leading-10",
6
+ h2: "text-[1.75rem] font-bold leading-9",
7
+ h3: "text-2xl font-semibold",
8
+ h4: "text-[1.375rem] font-semibold leading-7",
9
+ h5: "text-xl font-semibold",
10
+ h6: "text-lg font-semibold"
11
+ }
12
+ }
13
+ }), n = t("", {
14
+ variants: {
15
+ type: {
16
+ body: "text-base text-neutral-900",
17
+ caption: "text-xs text-neutral-700"
18
+ }
19
+ }
20
+ });
15
21
  export {
16
- u as ContentSwitch
22
+ n as textVariants,
23
+ o as titleVariants
17
24
  };
@@ -1,22 +1,17 @@
1
- import { j as i } from "./index.es10.js";
1
+ import { j as t } from "./index.es10.js";
2
2
  import { cn as m } from "./index.es11.js";
3
- import { indicatorVariants as n } from "./index.es18.js";
4
- const c = ({ isSelected: r, isDisabled: o, isHovered: f, size: a, dimensions: t }) => /* @__PURE__ */ i.jsx(
5
- "div",
6
- {
7
- className: m(
8
- n({
9
- isSelected: r,
10
- isDisabled: o,
11
- size: a,
12
- isHoveredWhenOff: f && !r
13
- })
14
- ),
15
- style: {
16
- left: r ? `${t.onLeft}px` : `${t.offLeft}px`
17
- }
18
- }
19
- );
3
+ const u = ({
4
+ label: x,
5
+ description: e,
6
+ errorMessage: n,
7
+ isDisabled: s,
8
+ isInvalid: r,
9
+ children: l
10
+ }) => !x && !e && !l ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
11
+ x ? /* @__PURE__ */ t.jsx("p", { className: m("text-sm font-semibold", s ? "text-neutral-600" : "text-neutral-900"), children: x }) : l,
12
+ e && !n && /* @__PURE__ */ t.jsx("p", { className: m("text-xs", s ? "text-neutral-600" : "text-neutral-800"), children: e }),
13
+ r && n && /* @__PURE__ */ t.jsx("p", { className: "text-sm text-red-500", children: n })
14
+ ] });
20
15
  export {
21
- c as SwitchIndicator
16
+ u as ContentSwitch
22
17
  };
@@ -1,94 +1,22 @@
1
- import { cva as e } from "class-variance-authority";
2
- const s = e("relative rounded-full transition-colors duration-300", {
3
- variants: {
4
- isSelected: {
5
- true: "bg-primary-500",
6
- false: "bg-neutral-50 border border-primary-200"
7
- },
8
- isDisabled: {
9
- true: "cursor-not-allowed bg-neutral-400 border-none",
10
- false: "cursor-pointer"
11
- },
12
- isHoveredWhenOff: {
13
- true: "bg-neutral-200 border-primary-700",
14
- false: ""
15
- },
16
- isFocusVisible: {
17
- true: "ring-2 ring-sky-400 ring-offset-2",
18
- false: ""
19
- },
20
- size: {
21
- sm: "w-[42px] h-[24px]",
22
- md: "w-[56px] h-[32px]"
23
- }
24
- },
25
- defaultVariants: {
26
- size: "md",
27
- isSelected: !1,
28
- isDisabled: !1,
29
- isFocusVisible: !1,
30
- isHoveredWhenOff: !1
31
- },
32
- compoundVariants: [
33
- // Hover cuando el switch está apagado y no deshabilitado
34
- {
35
- isSelected: !1,
36
- isDisabled: !1,
37
- class: "hover:bg-neutral-200 hover:border-primary-700"
38
- },
39
- {
40
- isSelected: !0,
41
- isDisabled: !1,
42
- class: "hover:bg-primary-700"
43
- },
44
- {
45
- isSelected: !1,
46
- isDisabled: !0,
47
- class: "bg-neutral-400 border-none"
48
- },
49
- {
50
- isSelected: !0,
51
- isDisabled: !0,
52
- class: "bg-neutral-500"
53
- }
54
- ]
55
- }), a = e(
56
- "absolute top-1/2 transform -translate-y-1/2 transition-all duration-300 rounded-full",
1
+ import { j as i } from "./index.es10.js";
2
+ import { cn as m } from "./index.es11.js";
3
+ import { indicatorVariants as n } from "./index.es15.js";
4
+ const c = ({ isSelected: r, isDisabled: o, isHovered: f, size: a, dimensions: t }) => /* @__PURE__ */ i.jsx(
5
+ "div",
57
6
  {
58
- variants: {
59
- isSelected: {
60
- true: "bg-primary-50",
61
- false: "bg-primary-200 border border-primary-200"
62
- },
63
- isDisabled: {
64
- true: "bg-neutral-600 border-none",
65
- false: ""
66
- },
67
- isHoveredWhenOff: {
68
- true: "bg-primary-700 border-primary-700",
69
- false: ""
70
- },
71
- size: {
72
- sm: "w-[20px] h-[20px]",
73
- md: "w-[24px] h-[24px]"
74
- }
75
- },
76
- defaultVariants: {
77
- size: "md",
78
- isSelected: !1,
79
- isDisabled: !1,
80
- isHoveredWhenOff: !1
81
- },
82
- compoundVariants: [
83
- {
84
- isSelected: !0,
85
- isDisabled: !0,
86
- class: "bg-neutral-400"
87
- }
88
- ]
7
+ className: m(
8
+ n({
9
+ isSelected: r,
10
+ isDisabled: o,
11
+ size: a,
12
+ isHoveredWhenOff: f && !r
13
+ })
14
+ ),
15
+ style: {
16
+ left: r ? `${t.onLeft}px` : `${t.offLeft}px`
17
+ }
89
18
  }
90
19
  );
91
20
  export {
92
- a as indicatorVariants,
93
- s as switchVariants
21
+ c as SwitchIndicator
94
22
  };
@@ -1,12 +1,32 @@
1
- import { j as f } from "./index.es10.js";
2
- import { useRef as l } from "react";
3
- import { useTab as u } from "react-aria";
4
- import { cn as b } from "./index.es11.js";
5
- import { tabVariants as x } from "./index.es21.js";
6
- const R = (o) => {
7
- const { className: r, item: i, orientation: n, state: t, id: a = void 0 } = o, { key: s, rendered: c } = i, m = t.selectedKey === s, e = l(null), { tabProps: p } = u({ key: String(s) }, t, e), d = b(x({ isActive: m, orientation: n }), r);
8
- return /* @__PURE__ */ f.jsx("div", { ...p, ref: e, className: d, id: a, children: c });
1
+ import { j as e } from "./index.es10.js";
2
+ import { cn as l } from "./index.es11.js";
3
+ const m = (r) => {
4
+ const { isIndeterminate: t, isSelected: s, className: n, isHovered: a } = r, o = a && !s && !t ? "text-neutral-500" : "", i = !!(o || s);
5
+ return /* @__PURE__ */ e.jsx("svg", { className: l("stroke-current", o, n), viewBox: "-1 1 17 17", children: t ? /* @__PURE__ */ e.jsx(
6
+ "line",
7
+ {
8
+ x1: 1,
9
+ y1: 10,
10
+ x2: 14,
11
+ y2: 10,
12
+ fill: "none",
13
+ strokeWidth: 2,
14
+ strokeDasharray: 14,
15
+ strokeDashoffset: s ? 28 : 42,
16
+ style: { transition: "all 400ms" }
17
+ }
18
+ ) : /* @__PURE__ */ e.jsx(
19
+ "polyline",
20
+ {
21
+ points: "1 9 7 14 15 4",
22
+ fill: "none",
23
+ strokeWidth: 2,
24
+ strokeDasharray: 22,
25
+ strokeDashoffset: i ? 44 : 66,
26
+ style: { transition: "all 400ms" }
27
+ }
28
+ ) });
9
29
  };
10
30
  export {
11
- R as Tab
31
+ m as MarkIcon
12
32
  };