@simpli-route/apollo-ds 0.1.23 → 0.1.24

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 (130) hide show
  1. package/dist/components/Accordion/AccordionItem.d.ts +1 -1
  2. package/dist/components/Accordion/index.d.ts +1 -0
  3. package/dist/components/Accordion/types.d.ts +30 -2
  4. package/dist/index.cjs.js +1 -1
  5. package/dist/index.cjs10.js +1 -1
  6. package/dist/index.cjs11.js +1 -1
  7. package/dist/index.cjs117.js +1 -1
  8. package/dist/index.cjs12.js +1 -1
  9. package/dist/index.cjs122.js +1 -1
  10. package/dist/index.cjs123.js +1 -1
  11. package/dist/index.cjs124.js +1 -1
  12. package/dist/index.cjs125.js +1 -1
  13. package/dist/index.cjs126.js +1 -1
  14. package/dist/index.cjs128.js +1 -1
  15. package/dist/index.cjs13.js +1 -1
  16. package/dist/index.cjs130.js +1 -1
  17. package/dist/index.cjs14.js +1 -1
  18. package/dist/index.cjs15.js +1 -1
  19. package/dist/index.cjs16.js +1 -1
  20. package/dist/index.cjs17.js +1 -1
  21. package/dist/index.cjs18.js +1 -1
  22. package/dist/index.cjs19.js +1 -1
  23. package/dist/index.cjs2.js +1 -1
  24. package/dist/index.cjs20.js +1 -1
  25. package/dist/index.cjs21.js +1 -1
  26. package/dist/index.cjs22.js +1 -1
  27. package/dist/index.cjs23.js +1 -1
  28. package/dist/index.cjs24.js +1 -1
  29. package/dist/index.cjs25.js +1 -1
  30. package/dist/index.cjs26.js +1 -1
  31. package/dist/index.cjs27.js +1 -1
  32. package/dist/index.cjs3.js +1 -1
  33. package/dist/index.cjs4.js +1 -1
  34. package/dist/index.cjs42.js +1 -1
  35. package/dist/index.cjs43.js +1 -1
  36. package/dist/index.cjs44.js +1 -1
  37. package/dist/index.cjs46.js +1 -1
  38. package/dist/index.cjs47.js +1 -1
  39. package/dist/index.cjs48.js +1 -1
  40. package/dist/index.cjs49.js +1 -1
  41. package/dist/index.cjs5.js +1 -1
  42. package/dist/index.cjs50.js +1 -1
  43. package/dist/index.cjs51.js +1 -1
  44. package/dist/index.cjs52.js +1 -1
  45. package/dist/index.cjs53.js +1 -1
  46. package/dist/index.cjs54.js +1 -1
  47. package/dist/index.cjs55.js +1 -1
  48. package/dist/index.cjs56.js +1 -1
  49. package/dist/index.cjs57.js +1 -1
  50. package/dist/index.cjs58.js +1 -1
  51. package/dist/index.cjs6.js +1 -1
  52. package/dist/index.cjs7.js +1 -1
  53. package/dist/index.cjs70.js +1 -1
  54. package/dist/index.cjs71.js +1 -1
  55. package/dist/index.cjs72.js +1 -1
  56. package/dist/index.cjs73.js +1 -1
  57. package/dist/index.cjs74.js +1 -1
  58. package/dist/index.cjs75.js +1 -1
  59. package/dist/index.cjs76.js +1 -1
  60. package/dist/index.cjs77.js +1 -1
  61. package/dist/index.cjs8.js +1 -1
  62. package/dist/index.cjs9.js +1 -1
  63. package/dist/index.cjs98.js +1 -1
  64. package/dist/index.cjs99.js +1 -1
  65. package/dist/index.es.js +46 -44
  66. package/dist/index.es10.js +34 -87
  67. package/dist/index.es11.js +81 -89
  68. package/dist/index.es117.js +2 -2
  69. package/dist/index.es12.js +96 -72
  70. package/dist/index.es122.js +8 -22
  71. package/dist/index.es123.js +311 -4
  72. package/dist/index.es124.js +20 -8
  73. package/dist/index.es125.js +4 -311
  74. package/dist/index.es126.js +4 -26
  75. package/dist/index.es128.js +94 -4
  76. package/dist/index.es129.js +2 -2
  77. package/dist/index.es13.js +73 -141
  78. package/dist/index.es130.js +20 -86
  79. package/dist/index.es131.js +2 -2
  80. package/dist/index.es14.js +134 -31
  81. package/dist/index.es15.js +37 -75
  82. package/dist/index.es16.js +78 -48
  83. package/dist/index.es17.js +48 -3
  84. package/dist/index.es18.js +3 -100
  85. package/dist/index.es19.js +99 -77
  86. package/dist/index.es2.js +24 -23
  87. package/dist/index.es20.js +76 -43
  88. package/dist/index.es21.js +41 -20
  89. package/dist/index.es22.js +21 -25
  90. package/dist/index.es23.js +28 -8
  91. package/dist/index.es24.js +7 -7
  92. package/dist/index.es25.js +8 -6
  93. package/dist/index.es26.js +6 -6
  94. package/dist/index.es27.js +6 -22
  95. package/dist/index.es3.js +46 -106
  96. package/dist/index.es4.js +96 -43
  97. package/dist/index.es42.js +2 -2
  98. package/dist/index.es43.js +2 -2
  99. package/dist/index.es44.js +2 -2
  100. package/dist/index.es46.js +13 -10
  101. package/dist/index.es47.js +137 -10
  102. package/dist/index.es48.js +18 -10
  103. package/dist/index.es49.js +7 -13
  104. package/dist/index.es5.js +55 -42
  105. package/dist/index.es50.js +16 -99
  106. package/dist/index.es51.js +147 -11
  107. package/dist/index.es52.js +100 -18
  108. package/dist/index.es53.js +11 -18
  109. package/dist/index.es54.js +10 -137
  110. package/dist/index.es55.js +19 -20
  111. package/dist/index.es56.js +20 -7
  112. package/dist/index.es57.js +10 -18
  113. package/dist/index.es58.js +12 -149
  114. package/dist/index.es6.js +42 -38
  115. package/dist/index.es7.js +38 -31
  116. package/dist/index.es70.js +4 -30
  117. package/dist/index.es71.js +27 -58
  118. package/dist/index.es72.js +2 -4
  119. package/dist/index.es73.js +10 -28
  120. package/dist/index.es74.js +340 -2
  121. package/dist/index.es75.js +166 -8
  122. package/dist/index.es76.js +56 -339
  123. package/dist/index.es77.js +28 -164
  124. package/dist/index.es8.js +31 -49
  125. package/dist/index.es9.js +49 -37
  126. package/dist/index.es98.js +6 -6
  127. package/dist/index.es99.js +2 -2
  128. package/dist/stories/Accordion.stories.d.ts +1 -0
  129. package/dist/style.css +4 -0
  130. package/package.json +1 -1
@@ -1,80 +1,42 @@
1
- import { j as m } from "./index.es25.js";
2
- import { useState as q, useEffect as x } from "react";
3
- import { Slider as z, SliderTrack as B } from "react-aria-components";
4
- import { cn as F } from "./index.es26.js";
5
- import { SliderContainerTrack as G } from "./index.es50.js";
6
- import { validateMinDistance as H } from "./index.es51.js";
7
- const U = ({
8
- type: r = "single",
9
- showTypeValue: A = "default",
10
- positionTooltip: S = "top",
11
- modeTooltip: j = "dark",
12
- isHiddenValue: w = !1,
13
- maxValue: T = 100,
14
- minValue: k = 0,
15
- value: f = r === "range" ? [0, 5] : 0,
16
- onChangeValue: i,
17
- className: p,
18
- classNameFilled: v,
19
- classNameUnfilled: N,
20
- classNameThumb: E,
21
- suffix: M = "%",
22
- suffixRangeCustom: P = {
23
- left: "",
24
- right: ""
25
- },
26
- step: R = 1,
27
- minDistance: d = 2,
28
- ...$
29
- }) => {
30
- const [l, b] = q(r);
31
- return x(() => {
32
- if (r === "range" && Array.isArray(f)) {
33
- const [s, t] = f;
34
- if (t - s < d) {
35
- const c = [s, s + d];
36
- (c[0] !== f[0] || c[1] !== f[1]) && (i == null || i(c));
37
- }
38
- }
39
- }, [r, f, i, d]), x(() => {
40
- l !== r && (b(r), i == null || i(r === "range" ? [0, 5] : 0));
41
- }, [r, i, l]), /* @__PURE__ */ m.jsx("div", { className: "flex w-full flex-col py-4", children: /* @__PURE__ */ m.jsx(
42
- z,
1
+ import { j as e } from "./index.es26.js";
2
+ import { ListBoxItem as m } from "react-aria-components";
3
+ import { cn as i } from "./index.es27.js";
4
+ const c = (t) => {
5
+ const { isSelected: r } = t;
6
+ return /* @__PURE__ */ e.jsx(
7
+ m,
43
8
  {
44
- value: f,
45
- step: R,
46
- maxValue: T,
47
- minValue: k,
48
- className: F("w-full", p),
49
- onChange: (s) => {
50
- const t = s;
51
- if (t !== void 0) {
52
- const c = Array.isArray(t), o = r === "range" && c ? H(t, r, d) : t;
53
- i == null || i(
54
- r === "range" ? o : Array.isArray(o) ? o[0] || 0 : o
55
- );
56
- }
57
- },
58
- ...$,
59
- children: /* @__PURE__ */ m.jsx(B, { className: "relative h-3 w-full cursor-pointer", children: ({ state: s }) => /* @__PURE__ */ m.jsx(
60
- G,
61
- {
62
- state: s,
63
- type: r,
64
- showTypeValue: A,
65
- isHiddenValue: w,
66
- suffix: M,
67
- suffixRangeCustom: P,
68
- classNameFilled: v,
69
- classNameUnfilled: N,
70
- modeTooltip: j,
71
- positionTooltip: S,
72
- classNameThumb: E
73
- }
74
- ) })
9
+ ...t,
10
+ className: ({ isHovered: n, isFocusVisible: l }) => i(
11
+ "group flex cursor-pointer select-none items-center gap-2 rounded-sm px-4 py-2 text-primary-500 outline-none",
12
+ r && "bg-primary-100",
13
+ (n || l) && !r && "bg-primary-50",
14
+ (n || l) && r && "bg-primary-200"
15
+ ),
16
+ children: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
17
+ /* @__PURE__ */ e.jsx(
18
+ "span",
19
+ {
20
+ className: i(
21
+ "flex flex-1 items-center gap-2 text-sm font-normal text-primary-900",
22
+ r && "text-primary-500"
23
+ ),
24
+ children: t == null ? void 0 : t.children
25
+ }
26
+ ),
27
+ /* @__PURE__ */ e.jsx("span", { className: "flex w-5 items-center", children: r && /* @__PURE__ */ e.jsx("svg", { width: "14", height: "13", viewBox: "0 0 14 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx(
28
+ "path",
29
+ {
30
+ fillRule: "evenodd",
31
+ clipRule: "evenodd",
32
+ d: "M13.2241 0.601824C13.4808 0.780773 13.5439 1.13398 13.365 1.39073L5.69829 12.3907C5.59653 12.5367 5.43209 12.6264 5.25425 12.633C5.07641 12.6395 4.90582 12.5622 4.79359 12.4241L0.460261 7.09072C0.26291 6.84783 0.299829 6.49094 0.542723 6.29358C0.785617 6.09623 1.14251 6.13315 1.33986 6.37605L5.19872 11.1254L12.4352 0.7427C12.6141 0.485948 12.9673 0.422875 13.2241 0.601824Z",
33
+ fill: "#4C3BEF"
34
+ }
35
+ ) }) })
36
+ ] })
75
37
  }
76
- ) });
38
+ );
77
39
  };
78
40
  export {
79
- U as Slider
41
+ c as SelectItem
80
42
  };
@@ -1,50 +1,80 @@
1
- import { j as p } from "./index.es25.js";
2
- import { Children as P, cloneElement as R } from "react";
3
- import { StepperCompleted as h } from "./index.es17.js";
4
- import { StepperStep as w } from "./index.es18.js";
5
- function C(g) {
6
- var f, a, d;
7
- const {
8
- children: y,
9
- activeStep: n,
10
- size: j = "md",
11
- onStepClick: l,
12
- allowNextStepsSelect: x = !1,
13
- baseIcon: I,
14
- completedIcon: v
15
- } = g, c = P.toArray(y), r = c.filter(
16
- (t) => t.type === w
17
- ), s = c.find(
18
- (t) => t.type === h
19
- ), i = (t, e) => t.props.error ? "error" : n === e ? "inProgress" : n > e ? "completed" : "pending", A = r.reduce(
20
- (t, e, o) => {
21
- const m = i(e, o), u = r[o + 1], E = u ? i(u, o + 1) : "pending", S = typeof l != "function" ? !1 : typeof e.props.allowStepClick == "boolean" ? e.props.allowStepClick : m === "completed" || x;
22
- return t.push(
23
- R(e, {
24
- icon: e.props.icon || I || o + 1,
25
- key: o,
26
- step: o,
27
- size: j,
28
- state: m,
29
- onPress: () => {
30
- S && (l == null || l(o));
31
- },
32
- allowStepClick: S,
33
- completedIcon: e.props.completedIcon || v,
34
- nextState: E,
35
- isLastStep: o === r.length - 1
36
- })
37
- ), t;
38
- },
39
- []
40
- ), N = (a = (f = r[n]) == null ? void 0 : f.props) == null ? void 0 : a.children, b = (d = s == null ? void 0 : s.props) == null ? void 0 : d.children, k = n > r.length - 1 ? b : N;
41
- return /* @__PURE__ */ p.jsxs("div", { className: "flex w-full flex-col gap-2", children: [
42
- /* @__PURE__ */ p.jsx("div", { className: "flex w-full items-center", children: A }),
43
- /* @__PURE__ */ p.jsx("div", { className: "flex", children: k })
44
- ] });
45
- }
46
- C.Completed = h;
47
- C.Step = w;
1
+ import { j as m } from "./index.es26.js";
2
+ import { useState as q, useEffect as x } from "react";
3
+ import { Slider as z, SliderTrack as B } from "react-aria-components";
4
+ import { cn as F } from "./index.es27.js";
5
+ import { SliderContainerTrack as G } from "./index.es52.js";
6
+ import { validateMinDistance as H } from "./index.es53.js";
7
+ const U = ({
8
+ type: r = "single",
9
+ showTypeValue: A = "default",
10
+ positionTooltip: S = "top",
11
+ modeTooltip: j = "dark",
12
+ isHiddenValue: w = !1,
13
+ maxValue: T = 100,
14
+ minValue: k = 0,
15
+ value: f = r === "range" ? [0, 5] : 0,
16
+ onChangeValue: i,
17
+ className: p,
18
+ classNameFilled: v,
19
+ classNameUnfilled: N,
20
+ classNameThumb: E,
21
+ suffix: M = "%",
22
+ suffixRangeCustom: P = {
23
+ left: "",
24
+ right: ""
25
+ },
26
+ step: R = 1,
27
+ minDistance: d = 2,
28
+ ...$
29
+ }) => {
30
+ const [l, b] = q(r);
31
+ return x(() => {
32
+ if (r === "range" && Array.isArray(f)) {
33
+ const [s, t] = f;
34
+ if (t - s < d) {
35
+ const c = [s, s + d];
36
+ (c[0] !== f[0] || c[1] !== f[1]) && (i == null || i(c));
37
+ }
38
+ }
39
+ }, [r, f, i, d]), x(() => {
40
+ l !== r && (b(r), i == null || i(r === "range" ? [0, 5] : 0));
41
+ }, [r, i, l]), /* @__PURE__ */ m.jsx("div", { className: "flex w-full flex-col py-4", children: /* @__PURE__ */ m.jsx(
42
+ z,
43
+ {
44
+ value: f,
45
+ step: R,
46
+ maxValue: T,
47
+ minValue: k,
48
+ className: F("w-full", p),
49
+ onChange: (s) => {
50
+ const t = s;
51
+ if (t !== void 0) {
52
+ const c = Array.isArray(t), o = r === "range" && c ? H(t, r, d) : t;
53
+ i == null || i(
54
+ r === "range" ? o : Array.isArray(o) ? o[0] || 0 : o
55
+ );
56
+ }
57
+ },
58
+ ...$,
59
+ children: /* @__PURE__ */ m.jsx(B, { className: "relative h-3 w-full cursor-pointer", children: ({ state: s }) => /* @__PURE__ */ m.jsx(
60
+ G,
61
+ {
62
+ state: s,
63
+ type: r,
64
+ showTypeValue: A,
65
+ isHiddenValue: w,
66
+ suffix: M,
67
+ suffixRangeCustom: P,
68
+ classNameFilled: v,
69
+ classNameUnfilled: N,
70
+ modeTooltip: j,
71
+ positionTooltip: S,
72
+ classNameThumb: E
73
+ }
74
+ ) })
75
+ }
76
+ ) });
77
+ };
48
78
  export {
49
- C as Stepper
79
+ U as Slider
50
80
  };
@@ -1,5 +1,50 @@
1
- const e = () => null;
2
- e.displayName = "StepperCompleted";
1
+ import { j as p } from "./index.es26.js";
2
+ import { Children as P, cloneElement as R } from "react";
3
+ import { StepperCompleted as h } from "./index.es18.js";
4
+ import { StepperStep as w } from "./index.es19.js";
5
+ function C(g) {
6
+ var f, a, d;
7
+ const {
8
+ children: y,
9
+ activeStep: n,
10
+ size: j = "md",
11
+ onStepClick: l,
12
+ allowNextStepsSelect: x = !1,
13
+ baseIcon: I,
14
+ completedIcon: v
15
+ } = g, c = P.toArray(y), r = c.filter(
16
+ (t) => t.type === w
17
+ ), s = c.find(
18
+ (t) => t.type === h
19
+ ), i = (t, e) => t.props.error ? "error" : n === e ? "inProgress" : n > e ? "completed" : "pending", A = r.reduce(
20
+ (t, e, o) => {
21
+ const m = i(e, o), u = r[o + 1], E = u ? i(u, o + 1) : "pending", S = typeof l != "function" ? !1 : typeof e.props.allowStepClick == "boolean" ? e.props.allowStepClick : m === "completed" || x;
22
+ return t.push(
23
+ R(e, {
24
+ icon: e.props.icon || I || o + 1,
25
+ key: o,
26
+ step: o,
27
+ size: j,
28
+ state: m,
29
+ onPress: () => {
30
+ S && (l == null || l(o));
31
+ },
32
+ allowStepClick: S,
33
+ completedIcon: e.props.completedIcon || v,
34
+ nextState: E,
35
+ isLastStep: o === r.length - 1
36
+ })
37
+ ), t;
38
+ },
39
+ []
40
+ ), N = (a = (f = r[n]) == null ? void 0 : f.props) == null ? void 0 : a.children, b = (d = s == null ? void 0 : s.props) == null ? void 0 : d.children, k = n > r.length - 1 ? b : N;
41
+ return /* @__PURE__ */ p.jsxs("div", { className: "flex w-full flex-col gap-2", children: [
42
+ /* @__PURE__ */ p.jsx("div", { className: "flex w-full items-center", children: A }),
43
+ /* @__PURE__ */ p.jsx("div", { className: "flex", children: k })
44
+ ] });
45
+ }
46
+ C.Completed = h;
47
+ C.Step = w;
3
48
  export {
4
- e as StepperCompleted
49
+ C as Stepper
5
50
  };
@@ -1,102 +1,5 @@
1
- import { j as n } from "./index.es25.js";
2
- import { CheckIcon as I } from "./index.es28.js";
3
- import { motion as f } from "framer-motion";
4
- import { useRef as k } from "react";
5
- import { useButton as D, useHover as V } from "react-aria";
6
- import z from "./index.es56.js";
7
- import B from "./index.es57.js";
8
- import { cn as H } from "./index.es26.js";
9
- import { stepVariants as R, iconVariants as $, labelVariants as E } from "./index.es58.js";
10
- const c = z(B), x = (s, e) => typeof s == "function" ? /* @__PURE__ */ n.jsx(s, { step: e || 0 }) : s, C = (s) => {
11
- var t, r, o, a, i;
12
- const e = (t = c == null ? void 0 : c.theme) == null ? void 0 : t.colors;
13
- switch (s) {
14
- case "pending":
15
- return ((r = e == null ? void 0 : e.neutral) == null ? void 0 : r["500"]) || "#C7C9D1";
16
- case "inProgress":
17
- return ((o = e == null ? void 0 : e.blue) == null ? void 0 : o["500"]) || "#2644D9";
18
- case "completed":
19
- return ((a = e == null ? void 0 : e.success) == null ? void 0 : a["500"]) || "#1FB576";
20
- case "error":
21
- return ((i = e == null ? void 0 : e.error) == null ? void 0 : i["500"]) || "#CC4033";
22
- default:
23
- return "#C7C9D1";
24
- }
25
- }, G = (s, e) => {
26
- const t = C(s), r = C(e);
27
- return {
28
- background: `linear-gradient(to right, ${t} 50%, ${r} 50%)`
29
- };
30
- };
31
- function W(s) {
32
- const {
33
- step: e,
34
- state: t,
35
- size: r,
36
- icon: o,
37
- completedIcon: a,
38
- onPress: i,
39
- nextState: h,
40
- isLastStep: d,
41
- allowStepClick: b = !1,
42
- isDisabled: l = !1,
43
- label: m
44
- } = s, j = k(null), { buttonProps: g, isPressed: p } = D(
45
- {
46
- ...s,
47
- onPress: b ? i : void 0,
48
- isDisabled: l
49
- },
50
- j
51
- ), { hoverProps: v, isHovered: u } = V({}), w = R({ size: r, state: t, isHovered: u, isPressed: p, isDisabled: l }), N = $({ size: r, state: t, isHovered: u }), P = E({ size: r }), S = x(t === "completed" ? a || /* @__PURE__ */ n.jsx(I, {}) : o, e), y = x(m, e);
52
- return /* @__PURE__ */ n.jsxs("div", { className: H("flex h-full items-center", d ? "w-fit" : "w-full"), children: [
53
- /* @__PURE__ */ n.jsx("div", { className: "flex h-24 w-fit items-center justify-center py-2", children: /* @__PURE__ */ n.jsxs(
54
- "button",
55
- {
56
- className: "z-10 flex flex-col items-center whitespace-nowrap",
57
- ...v,
58
- ...g,
59
- "data-testid": "step-button",
60
- "data-state": t,
61
- "aria-disabled": l,
62
- children: [
63
- /* @__PURE__ */ n.jsx(
64
- f.div,
65
- {
66
- className: w,
67
- "data-testid": "step-icon-container",
68
- initial: !1,
69
- animate: { scale: p ? 0.95 : 1 },
70
- transition: { duration: 0.2 },
71
- children: /* @__PURE__ */ n.jsx(
72
- f.span,
73
- {
74
- className: N,
75
- initial: !1,
76
- animate: {
77
- scale: t === "completed" ? [1, 1.1, 1] : 1,
78
- rotate: t === "completed" ? [0, 10, 0] : 0
79
- },
80
- transition: { duration: 0.3 },
81
- children: S
82
- }
83
- )
84
- }
85
- ),
86
- /* @__PURE__ */ n.jsx("div", { className: "mt-2 flex select-none flex-col items-center justify-between", children: m ? /* @__PURE__ */ n.jsx("span", { className: P, children: y }) : null })
87
- ]
88
- }
89
- ) }),
90
- d ? null : /* @__PURE__ */ n.jsx(
91
- "div",
92
- {
93
- className: "mx-4 hidden h-1 w-full sm:block",
94
- "data-testid": "progress-bar",
95
- style: G(t, h)
96
- }
97
- )
98
- ] });
99
- }
1
+ const e = () => null;
2
+ e.displayName = "StepperCompleted";
100
3
  export {
101
- W as StepperStep
4
+ e as StepperCompleted
102
5
  };
@@ -1,80 +1,102 @@
1
- import { j as o } from "./index.es25.js";
2
- import { Switch as u } from "react-aria-components";
3
- import { cn as c } from "./index.es26.js";
4
- import { ContentSwitch as L } from "./index.es52.js";
5
- import { SwitchIndicator as v } from "./index.es53.js";
6
- import { switchVariants as b } from "./index.es39.js";
7
- const E = ({
8
- children: f,
9
- label: m,
10
- description: n,
11
- errorMessage: s,
12
- validationState: e,
13
- size: a = "md",
14
- isDisabled: r = !1,
15
- isSelected: t = !1,
16
- onChange: h,
17
- renderLabelIcon: x = null,
18
- "aria-label": p,
19
- "aria-describedby": l
20
- }) => {
21
- const j = e === "invalid" && !r, w = a === "sm" ? { offLeft: 3, onLeft: 19 } : { offLeft: 4, onLeft: 28 };
22
- return /* @__PURE__ */ o.jsxs(
23
- "label",
24
- {
25
- className: c("group flex flex-row gap-2", (m || f) && n ? "items-start" : "items-center"),
26
- children: [
27
- /* @__PURE__ */ o.jsx(
28
- u,
29
- {
30
- isDisabled: r,
31
- isSelected: t,
32
- "aria-checked": t,
33
- "aria-label": p,
34
- "aria-describedby": l,
35
- onChange: h,
36
- children: ({ isFocusVisible: d, isHovered: i }) => /* @__PURE__ */ o.jsx(
37
- "div",
38
- {
39
- className: c(
40
- b({
41
- isSelected: t,
42
- isDisabled: r,
43
- isFocusVisible: d,
44
- size: a,
45
- isHoveredWhenOff: i && !t
46
- })
47
- ),
48
- children: /* @__PURE__ */ o.jsx(
49
- v,
50
- {
51
- isSelected: t,
52
- isDisabled: r,
53
- isHovered: i,
54
- size: a,
55
- dimensions: w
56
- }
57
- )
58
- }
59
- )
60
- }
61
- ),
62
- /* @__PURE__ */ o.jsx(
63
- L,
64
- {
65
- label: m,
66
- description: n,
67
- errorMessage: s,
68
- isDisabled: r,
69
- isInvalid: j,
70
- renderLabelIcon: x,
71
- children: f
72
- }
73
- )
74
- ]
75
- }
76
- );
1
+ import { j as n } from "./index.es26.js";
2
+ import { CheckIcon as I } from "./index.es28.js";
3
+ import { motion as f } from "framer-motion";
4
+ import { useRef as k } from "react";
5
+ import { useButton as D, useHover as V } from "react-aria";
6
+ import z from "./index.es49.js";
7
+ import B from "./index.es50.js";
8
+ import { cn as H } from "./index.es27.js";
9
+ import { stepVariants as R, iconVariants as $, labelVariants as E } from "./index.es51.js";
10
+ const c = z(B), x = (s, e) => typeof s == "function" ? /* @__PURE__ */ n.jsx(s, { step: e || 0 }) : s, C = (s) => {
11
+ var t, r, o, a, i;
12
+ const e = (t = c == null ? void 0 : c.theme) == null ? void 0 : t.colors;
13
+ switch (s) {
14
+ case "pending":
15
+ return ((r = e == null ? void 0 : e.neutral) == null ? void 0 : r["500"]) || "#C7C9D1";
16
+ case "inProgress":
17
+ return ((o = e == null ? void 0 : e.blue) == null ? void 0 : o["500"]) || "#2644D9";
18
+ case "completed":
19
+ return ((a = e == null ? void 0 : e.success) == null ? void 0 : a["500"]) || "#1FB576";
20
+ case "error":
21
+ return ((i = e == null ? void 0 : e.error) == null ? void 0 : i["500"]) || "#CC4033";
22
+ default:
23
+ return "#C7C9D1";
24
+ }
25
+ }, G = (s, e) => {
26
+ const t = C(s), r = C(e);
27
+ return {
28
+ background: `linear-gradient(to right, ${t} 50%, ${r} 50%)`
29
+ };
77
30
  };
31
+ function W(s) {
32
+ const {
33
+ step: e,
34
+ state: t,
35
+ size: r,
36
+ icon: o,
37
+ completedIcon: a,
38
+ onPress: i,
39
+ nextState: h,
40
+ isLastStep: d,
41
+ allowStepClick: b = !1,
42
+ isDisabled: l = !1,
43
+ label: m
44
+ } = s, j = k(null), { buttonProps: g, isPressed: p } = D(
45
+ {
46
+ ...s,
47
+ onPress: b ? i : void 0,
48
+ isDisabled: l
49
+ },
50
+ j
51
+ ), { hoverProps: v, isHovered: u } = V({}), w = R({ size: r, state: t, isHovered: u, isPressed: p, isDisabled: l }), N = $({ size: r, state: t, isHovered: u }), P = E({ size: r }), S = x(t === "completed" ? a || /* @__PURE__ */ n.jsx(I, {}) : o, e), y = x(m, e);
52
+ return /* @__PURE__ */ n.jsxs("div", { className: H("flex h-full items-center", d ? "w-fit" : "w-full"), children: [
53
+ /* @__PURE__ */ n.jsx("div", { className: "flex h-24 w-fit items-center justify-center py-2", children: /* @__PURE__ */ n.jsxs(
54
+ "button",
55
+ {
56
+ className: "z-10 flex flex-col items-center whitespace-nowrap",
57
+ ...v,
58
+ ...g,
59
+ "data-testid": "step-button",
60
+ "data-state": t,
61
+ "aria-disabled": l,
62
+ children: [
63
+ /* @__PURE__ */ n.jsx(
64
+ f.div,
65
+ {
66
+ className: w,
67
+ "data-testid": "step-icon-container",
68
+ initial: !1,
69
+ animate: { scale: p ? 0.95 : 1 },
70
+ transition: { duration: 0.2 },
71
+ children: /* @__PURE__ */ n.jsx(
72
+ f.span,
73
+ {
74
+ className: N,
75
+ initial: !1,
76
+ animate: {
77
+ scale: t === "completed" ? [1, 1.1, 1] : 1,
78
+ rotate: t === "completed" ? [0, 10, 0] : 0
79
+ },
80
+ transition: { duration: 0.3 },
81
+ children: S
82
+ }
83
+ )
84
+ }
85
+ ),
86
+ /* @__PURE__ */ n.jsx("div", { className: "mt-2 flex select-none flex-col items-center justify-between", children: m ? /* @__PURE__ */ n.jsx("span", { className: P, children: y }) : null })
87
+ ]
88
+ }
89
+ ) }),
90
+ d ? null : /* @__PURE__ */ n.jsx(
91
+ "div",
92
+ {
93
+ className: "mx-4 hidden h-1 w-full sm:block",
94
+ "data-testid": "progress-bar",
95
+ style: G(t, h)
96
+ }
97
+ )
98
+ ] });
99
+ }
78
100
  export {
79
- E as Switch
101
+ W as StepperStep
80
102
  };
package/dist/index.es2.js CHANGED
@@ -1,34 +1,35 @@
1
- import { j as m } from "./index.es25.js";
2
- import { useState as g } from "react";
3
- import { cn as j } from "./index.es26.js";
4
- import { AccordionItem as h } from "./index.es27.js";
5
- const C = ({
6
- items: a,
7
- accordionClassName: e,
8
- itemClassName: l,
9
- sectionClassName: c,
10
- hasIcon: i,
11
- allowMultipleOpen: n = !1
1
+ import { j as a } from "./index.es26.js";
2
+ import { useState as j } from "react";
3
+ import { cn as h } from "./index.es27.js";
4
+ import { AccordionItem as A } from "./index.es3.js";
5
+ const E = ({
6
+ items: e,
7
+ accordionClassName: l,
8
+ itemClassName: c,
9
+ sectionClassName: i,
10
+ hasIcon: n,
11
+ allowMultipleOpen: f = !1
12
12
  }) => {
13
- const [f, r] = g([]), p = j("flex flex-col gap-y-4", e), u = (o) => {
14
- r(
15
- n ? (s) => s.includes(o) ? s.filter((t) => t !== o) : [...s, o] : (s) => s.includes(o) ? [] : [o]
13
+ const [p, m] = j([]), u = h("flex flex-col gap-y-4", l), g = (o) => {
14
+ m(
15
+ f ? (s) => s.includes(o) ? s.filter((t) => t !== o) : [...s, o] : (s) => s.includes(o) ? [] : [o]
16
16
  );
17
17
  };
18
- return /* @__PURE__ */ m.jsx("div", { className: p, children: a.map(({ label: o, section: s }, t) => /* @__PURE__ */ m.jsx(
19
- h,
18
+ return /* @__PURE__ */ a.jsx("div", { className: u, children: e.map(({ label: o, section: s, isDisabled: t }, r) => /* @__PURE__ */ a.jsx(
19
+ A,
20
20
  {
21
- hasIcon: i,
21
+ hasIcon: n,
22
+ isDisabled: t,
22
23
  label: o,
23
24
  section: s,
24
- active: f.includes(t),
25
- itemClassName: l,
26
- sectionClassName: c,
27
- onToggle: () => u(t)
25
+ active: p.includes(r),
26
+ itemClassName: c,
27
+ sectionClassName: i,
28
+ onToggle: () => g(r)
28
29
  },
29
- t
30
+ r
30
31
  )) });
31
32
  };
32
33
  export {
33
- C as Accordion
34
+ E as Accordion
34
35
  };