@cuemath/leap 2.8.36-tables-hg10 → 2.8.37-rj-1

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 (30) hide show
  1. package/dist/assets/line-icons/icons/carat-left.js +26 -0
  2. package/dist/assets/line-icons/icons/carat-left.js.map +1 -0
  3. package/dist/assets/line-icons/icons/carat-right.js +26 -0
  4. package/dist/assets/line-icons/icons/carat-right.js.map +1 -0
  5. package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +20 -11
  6. package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +1 -1
  7. package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +53 -47
  8. package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
  9. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +233 -213
  10. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  11. package/dist/features/circle-games/game-launcher/game-launcher.js +81 -71
  12. package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
  13. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +8 -0
  14. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +1 -0
  15. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +217 -0
  16. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -0
  17. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +6 -0
  18. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +1 -0
  19. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +13 -0
  20. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +1 -0
  21. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +197 -0
  22. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -0
  23. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  24. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  25. package/dist/index.d.ts +4 -2
  26. package/package.json +1 -1
  27. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js +0 -7
  28. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js.map +0 -1
  29. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js +0 -213
  30. package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -1
@@ -0,0 +1,26 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ const i = (e) => /* @__PURE__ */ l(
3
+ "svg",
4
+ {
5
+ width: "28",
6
+ height: "28",
7
+ viewBox: "0 0 28 28",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ ...e,
11
+ children: /* @__PURE__ */ l(
12
+ "path",
13
+ {
14
+ fillRule: "evenodd",
15
+ clipRule: "evenodd",
16
+ d: "M8.55566 13.3004C12.4646 13.3004 15.6334 10.1316 15.6334 6.22266H17.0334C17.0334 9.7039 14.9352 12.6951 11.9343 14.0004C14.9352 15.3058 17.0334 18.297 17.0334 21.7782H15.6334C15.6334 17.8693 12.4646 14.7004 8.55566 14.7004V13.3004Z",
17
+ fill: "black",
18
+ fillOpacity: "0.87"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ export {
24
+ i as default
25
+ };
26
+ //# sourceMappingURL=carat-left.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carat-left.js","sources":["../../../../src/assets/line-icons/icons/carat-left.tsx"],"sourcesContent":["const CaratLeftIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.55566 13.3004C12.4646 13.3004 15.6334 10.1316 15.6334 6.22266H17.0334C17.0334 9.7039 14.9352 12.6951 11.9343 14.0004C14.9352 15.3058 17.0334 18.297 17.0334 21.7782H15.6334C15.6334 17.8693 12.4646 14.7004 8.55566 14.7004V13.3004Z\"\n fill=\"black\"\n fillOpacity=\"0.87\"\n />\n </svg>\n);\n\nexport default CaratLeftIcon;\n"],"names":["CaratLeftIcon","props","jsx"],"mappings":";AAAA,MAAMA,IAAyD,CAC7DC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF;"}
@@ -0,0 +1,26 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ const t = (e) => /* @__PURE__ */ l(
3
+ "svg",
4
+ {
5
+ width: "28",
6
+ height: "28",
7
+ viewBox: "0 0 28 28",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ ...e,
11
+ children: /* @__PURE__ */ l(
12
+ "path",
13
+ {
14
+ fillRule: "evenodd",
15
+ clipRule: "evenodd",
16
+ d: "M19.4443 14.6996C15.5354 14.6996 12.3666 17.8684 12.3666 21.7773H10.9666C10.9666 18.2961 13.0648 15.3049 16.0657 13.9996C13.0648 12.6942 10.9666 9.70303 10.9666 6.22179L12.3666 6.22179C12.3666 10.1307 15.5354 13.2996 19.4443 13.2996V14.6996Z",
17
+ fill: "black",
18
+ fillOpacity: "0.87"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ export {
24
+ t as default
25
+ };
26
+ //# sourceMappingURL=carat-right.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carat-right.js","sources":["../../../../src/assets/line-icons/icons/carat-right.tsx"],"sourcesContent":["const CaratRightIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.4443 14.6996C15.5354 14.6996 12.3666 17.8684 12.3666 21.7773H10.9666C10.9666 18.2961 13.0648 15.3049 16.0657 13.9996C13.0648 12.6942 10.9666 9.70303 10.9666 6.22179L12.3666 6.22179C12.3666 10.1307 15.5354 13.2996 19.4443 13.2996V14.6996Z\"\n fill=\"black\"\n fillOpacity=\"0.87\"\n />\n </svg>\n);\n\nexport default CaratRightIcon;\n"],"names":["CaratRightIcon","props","jsx"],"mappings":";AAAA,MAAMA,IAA0D,CAC9DC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF;"}
@@ -1,23 +1,32 @@
1
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import { memo as m, forwardRef as C } from "react";
3
- import { CardWrapper as f, ExtendedFlexView as p, AnimatedLabel as $, CardContainer as b } from "./card-container-styled.js";
1
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
+ import { memo as C, forwardRef as f } from "react";
3
+ import { CardWrapper as b, ExtendedFlexView as p, AnimatedLabel as $, CardContainer as h } from "./card-container-styled.js";
4
4
  const x = (e, o) => {
5
- const { children: n, strokeColor: a, label: t, isAnimated: i, labelRef: l, labelColor: d, ...s } = e;
6
- return /* @__PURE__ */ c(f, { ...s, children: [
5
+ const {
6
+ children: n,
7
+ strokeColor: a,
8
+ label: t,
9
+ isAnimated: l,
10
+ labelRef: i,
11
+ showLabel: d = !0,
12
+ labelColor: s,
13
+ ...c
14
+ } = e;
15
+ return /* @__PURE__ */ m(b, { ...c, children: [
7
16
  /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(
8
17
  $,
9
18
  {
10
- ref: l,
19
+ ref: i,
11
20
  $renderAs: "ac4-black",
12
21
  $align: "center",
13
- $color: d,
14
- $isAnimated: i,
15
- children: t
22
+ $color: s,
23
+ $isAnimated: l,
24
+ children: d ? t : ""
16
25
  }
17
26
  ) }),
18
- /* @__PURE__ */ r(b, { ref: o, $strokeColor: a, children: n })
27
+ /* @__PURE__ */ r(h, { ref: o, $strokeColor: a, children: n })
19
28
  ] });
20
- }, j = m(C(x));
29
+ }, j = C(f(x));
21
30
  export {
22
31
  j as CardContainer
23
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"card-container.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/card-container/card-container.tsx"],"sourcesContent":["import type { ICardContainerProps } from './card-container-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport { forwardRef, memo } from 'react';\n\nimport * as Styled from './card-container-styled';\n\nconst Container: ForwardRefRenderFunction<HTMLDivElement, ICardContainerProps> = (props, ref) => {\n const { children, strokeColor, label, isAnimated, labelRef, labelColor, ...rest } = props;\n\n return (\n <Styled.CardWrapper {...rest}>\n <Styled.ExtendedFlexView>\n <Styled.AnimatedLabel\n ref={labelRef}\n $renderAs=\"ac4-black\"\n $align=\"center\"\n $color={labelColor}\n $isAnimated={isAnimated}\n >\n {label}\n </Styled.AnimatedLabel>\n </Styled.ExtendedFlexView>\n <Styled.CardContainer ref={ref} $strokeColor={strokeColor}>\n {children}\n </Styled.CardContainer>\n </Styled.CardWrapper>\n );\n};\n\nexport const CardContainer = memo(forwardRef(Container));\n"],"names":["Container","props","ref","children","strokeColor","label","isAnimated","labelRef","labelColor","rest","jsxs","Styled.CardWrapper","jsx","Styled.ExtendedFlexView","Styled.AnimatedLabel","Styled.CardContainer","CardContainer","memo","forwardRef"],"mappings":";;;AAOA,MAAMA,IAA2E,CAACC,GAAOC,MAAQ;AACzF,QAAA,EAAE,UAAAC,GAAU,aAAAC,GAAa,OAAAC,GAAO,YAAAC,GAAY,UAAAC,GAAU,YAAAC,GAAY,GAAGC,EAAS,IAAAR;AAEpF,SACG,gBAAAS,EAAAC,GAAA,EAAoB,GAAGF,GACtB,UAAA;AAAA,IAAC,gBAAAG,EAAAC,GAAA,EACC,UAAA,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACC,KAAKP;AAAA,QACL,WAAU;AAAA,QACV,QAAO;AAAA,QACP,QAAQC;AAAA,QACR,aAAaF;AAAA,QAEZ,UAAAD;AAAA,MAAA;AAAA,IAAA,GAEL;AAAA,sBACCU,GAAA,EAAqB,KAAAb,GAAU,cAAcE,GAC3C,UAAAD,GACH;AAAA,EACF,EAAA,CAAA;AAEJ,GAEaa,IAAgBC,EAAKC,EAAWlB,CAAS,CAAC;"}
1
+ {"version":3,"file":"card-container.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/card-container/card-container.tsx"],"sourcesContent":["import type { ICardContainerProps } from './card-container-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport { forwardRef, memo } from 'react';\n\nimport * as Styled from './card-container-styled';\n\nconst Container: ForwardRefRenderFunction<HTMLDivElement, ICardContainerProps> = (props, ref) => {\n const {\n children,\n strokeColor,\n label,\n isAnimated,\n labelRef,\n showLabel = true,\n labelColor,\n ...rest\n } = props;\n\n return (\n <Styled.CardWrapper {...rest}>\n <Styled.ExtendedFlexView>\n <Styled.AnimatedLabel\n ref={labelRef}\n $renderAs=\"ac4-black\"\n $align=\"center\"\n $color={labelColor}\n $isAnimated={isAnimated}\n >\n {showLabel ? label : ''}\n </Styled.AnimatedLabel>\n </Styled.ExtendedFlexView>\n <Styled.CardContainer ref={ref} $strokeColor={strokeColor}>\n {children}\n </Styled.CardContainer>\n </Styled.CardWrapper>\n );\n};\n\nexport const CardContainer = memo(forwardRef(Container));\n"],"names":["Container","props","ref","children","strokeColor","label","isAnimated","labelRef","showLabel","labelColor","rest","jsxs","Styled.CardWrapper","jsx","Styled.ExtendedFlexView","Styled.AnimatedLabel","Styled.CardContainer","CardContainer","memo","forwardRef"],"mappings":";;;AAOA,MAAMA,IAA2E,CAACC,GAAOC,MAAQ;AACzF,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,YAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAT;AAEJ,SACG,gBAAAU,EAAAC,GAAA,EAAoB,GAAGF,GACtB,UAAA;AAAA,IAAC,gBAAAG,EAAAC,GAAA,EACC,UAAA,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACC,KAAKR;AAAA,QACL,WAAU;AAAA,QACV,QAAO;AAAA,QACP,QAAQE;AAAA,QACR,aAAaH;AAAA,QAEZ,cAAYD,IAAQ;AAAA,MAAA;AAAA,IAAA,GAEzB;AAAA,sBACCW,GAAA,EAAqB,KAAAd,GAAU,cAAcE,GAC3C,UAAAD,GACH;AAAA,EACF,EAAA,CAAA;AAEJ,GAEac,IAAgBC,EAAKC,EAAWnB,CAAS,CAAC;"}
@@ -1,79 +1,85 @@
1
- import { jsxs as h, jsx as r } from "react/jsx-runtime";
2
- import { memo as j, forwardRef as B, useMemo as y, useRef as I, useState as R, useCallback as u, useImperativeHandle as x, useEffect as b } from "react";
3
- import z from "../../../../../assets/line-icons/icons/back.js";
4
- import D from "../../../../../assets/line-icons/icons/next.js";
5
- import $ from "../../../../ui/buttons/icon-button/icon-button.js";
6
- import k from "../../../../ui/separator/separator.js";
7
- import { Carousel as E, CarouselWrapper as F, CarouselItemContainer as M, ExtendedFlexView as S, Indicator as H } from "./carousel-styled.js";
8
- const V = ({ items: o, defaultIndex: l = 0, onNext: a, onPrev: n, analyticsPrev: m, analyticsNext: d }, w) => {
9
- const p = y(() => m, [m]), C = y(() => d, [d]), f = I(null), i = I(!0), [s, c] = R(l), A = u(() => {
10
- n == null || n(), c((e) => e - 1);
11
- }, [n]), L = u(() => {
12
- a == null || a(), c((e) => e + 1);
13
- }, [a]), g = u((e) => {
14
- c(e);
1
+ import { jsxs as y, jsx as e } from "react/jsx-runtime";
2
+ import { memo as j, forwardRef as x, useMemo as u, useRef as b, useState as z, createRef as B, useCallback as d, useImperativeHandle as D, useEffect as $ } from "react";
3
+ import E from "../../../../../assets/line-icons/icons/carat-left.js";
4
+ import F from "../../../../../assets/line-icons/icons/carat-right.js";
5
+ import R from "../../../../ui/buttons/icon-button/icon-button.js";
6
+ import g from "../../../../ui/separator/separator.js";
7
+ import { Carousel as M, CarouselWrapper as S, CarouselItemContainer as H, ExtendedFlexView as T, Indicator as V } from "./carousel-styled.js";
8
+ const W = ({ items: t, defaultIndex: l = 0, onNext: s, onPrev: c, analyticsPrev: m, analyticsNext: p }, k) => {
9
+ const f = u(() => m, [m]), C = u(() => p, [p]), h = b(null), i = b(!0), [o, n] = z(l), I = u(() => t.map(() => B()), [t]), w = d(() => {
10
+ c == null || c(), n((r) => r - 1);
11
+ }, [c]), A = d(() => {
12
+ s == null || s(), n((r) => r + 1);
13
+ }, [s]), L = d((r) => {
14
+ n(r);
15
15
  }, []);
16
- return x(w, () => ({
17
- nextBtnRef: f
18
- })), b(() => {
16
+ return D(k, () => ({
17
+ nextBtnRef: h,
18
+ indicatorRefs: I,
19
+ currentIndex: o,
20
+ goToIndex: (r) => {
21
+ n(r);
22
+ }
23
+ })), $(() => {
19
24
  i.current && (i.current = !1);
20
- }, []), b(() => {
21
- c(l);
22
- }, [l]), /* @__PURE__ */ h(E, { children: [
23
- /* @__PURE__ */ r(
24
- F,
25
+ }, []), $(() => {
26
+ n(l);
27
+ }, [l]), /* @__PURE__ */ y(M, { children: [
28
+ /* @__PURE__ */ e(
29
+ S,
25
30
  {
26
- $translate: s * 100,
31
+ $translate: o * 100,
27
32
  $translateDuration: i.current ? 0 : 300,
28
- children: o.map((e, t) => /* @__PURE__ */ r(M, { children: e }, t))
33
+ children: t.map((r, a) => /* @__PURE__ */ e(H, { children: r }, a))
29
34
  }
30
35
  ),
31
- o.length > 1 && /* @__PURE__ */ h(
32
- S,
36
+ t.length > 1 && /* @__PURE__ */ y(
37
+ T,
33
38
  {
34
39
  $flexDirection: "row",
35
40
  $alignItems: "center",
36
41
  $justifyContent: "center",
37
42
  $position: "absolute",
38
43
  children: [
39
- /* @__PURE__ */ r(
40
- $,
44
+ /* @__PURE__ */ e(
45
+ R,
41
46
  {
42
47
  renderAs: "secondary",
43
- Icon: z,
44
- onClick: A,
45
- analyticsLabel: p.analyticsLabel,
46
- analyticsProps: p.analyticsProps,
47
- disabled: s === 0
48
+ Icon: E,
49
+ onClick: w,
50
+ analyticsLabel: f.analyticsLabel,
51
+ analyticsProps: f.analyticsProps,
52
+ disabled: o === 0
48
53
  }
49
54
  ),
50
- /* @__PURE__ */ r(k, { width: 48 }),
51
- o.map((e, t) => /* @__PURE__ */ r(
52
- H,
55
+ /* @__PURE__ */ e(g, { width: 48 }),
56
+ t.map((r, a) => /* @__PURE__ */ e(
57
+ V,
53
58
  {
54
- $isActive: t === s,
55
- onClick: () => g(t)
59
+ ref: I[a],
60
+ $isActive: a === o,
61
+ onClick: () => L(a)
56
62
  },
57
- t
63
+ a
58
64
  )),
59
- /* @__PURE__ */ r(k, { width: 48 }),
60
- /* @__PURE__ */ r("div", { ref: f, children: /* @__PURE__ */ r(
61
- $,
65
+ /* @__PURE__ */ e(g, { width: 48 }),
66
+ /* @__PURE__ */ e("div", { ref: h, children: /* @__PURE__ */ e(
67
+ R,
62
68
  {
63
69
  renderAs: "secondary",
64
- Icon: D,
65
- onClick: L,
70
+ Icon: F,
71
+ onClick: A,
66
72
  analyticsLabel: C.analyticsLabel,
67
73
  analyticsProps: C.analyticsProps,
68
- disabled: s === o.length - 1
74
+ disabled: o === t.length - 1
69
75
  }
70
76
  ) })
71
77
  ]
72
78
  }
73
79
  )
74
80
  ] });
75
- }, P = j(B(V));
81
+ }, Q = j(x(W));
76
82
  export {
77
- P as Carousel
83
+ Q as Carousel
78
84
  };
79
85
  //# sourceMappingURL=carousel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import type { ICarouselProps, ICarouselRefs } from './carousel-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n} from 'react';\n\nimport BackIcon from '../../../../../assets/line-icons/icons/back';\nimport NextIcon from '../../../../../assets/line-icons/icons/next';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport Separator from '../../../../ui/separator/separator';\nimport * as Styled from './carousel-styled';\n\nconst CarouselComponent: ForwardRefRenderFunction<ICarouselRefs, ICarouselProps> = (\n { items, defaultIndex = 0, onNext, onPrev, analyticsPrev, analyticsNext },\n ref,\n) => {\n const memoizedAnalyticsPrev = useMemo(() => analyticsPrev, [analyticsPrev]);\n const memoizedAnalyticsNext = useMemo(() => analyticsNext, [analyticsNext]);\n\n const nextBtnRef = useRef<HTMLDivElement>(null);\n const isFirstMount = useRef(true);\n const [currIndex, setCurrIndex] = useState(defaultIndex);\n\n const handleCarouselPrev = useCallback(() => {\n onPrev?.();\n setCurrIndex(prev => prev - 1);\n }, [onPrev]);\n\n const handleCarouselNext = useCallback(() => {\n onNext?.();\n setCurrIndex(prev => prev + 1);\n }, [onNext]);\n\n const handleCarouselIndicatorClick = useCallback((index: number) => {\n setCurrIndex(index);\n }, []);\n\n useImperativeHandle(ref, () => ({\n nextBtnRef,\n }));\n\n useEffect(() => {\n if (isFirstMount.current) {\n isFirstMount.current = false;\n }\n }, []);\n\n // Change index from parent\n useEffect(() => {\n setCurrIndex(defaultIndex);\n }, [defaultIndex]);\n\n return (\n <Styled.Carousel>\n <Styled.CarouselWrapper\n $translate={currIndex * 100}\n $translateDuration={isFirstMount.current ? 0 : 300}\n >\n {items.map((item, index) => (\n <Styled.CarouselItemContainer key={index}>{item}</Styled.CarouselItemContainer>\n ))}\n </Styled.CarouselWrapper>\n\n {items.length > 1 && (\n <Styled.ExtendedFlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $position=\"absolute\"\n >\n <IconButton\n renderAs=\"secondary\"\n Icon={BackIcon}\n onClick={handleCarouselPrev}\n analyticsLabel={memoizedAnalyticsPrev.analyticsLabel}\n analyticsProps={memoizedAnalyticsPrev.analyticsProps}\n disabled={currIndex === 0}\n />\n <Separator width={48} />\n {items.map((_, index) => (\n <Styled.Indicator\n $isActive={index === currIndex}\n key={index}\n onClick={() => handleCarouselIndicatorClick(index)}\n />\n ))}\n <Separator width={48} />\n <div ref={nextBtnRef}>\n <IconButton\n renderAs=\"secondary\"\n Icon={NextIcon}\n onClick={handleCarouselNext}\n analyticsLabel={memoizedAnalyticsNext.analyticsLabel}\n analyticsProps={memoizedAnalyticsNext.analyticsProps}\n disabled={currIndex === items.length - 1}\n />\n </div>\n </Styled.ExtendedFlexView>\n )}\n </Styled.Carousel>\n );\n};\n\nexport const Carousel = memo(forwardRef(CarouselComponent));\n"],"names":["CarouselComponent","items","defaultIndex","onNext","onPrev","analyticsPrev","analyticsNext","ref","memoizedAnalyticsPrev","useMemo","memoizedAnalyticsNext","nextBtnRef","useRef","isFirstMount","currIndex","setCurrIndex","useState","handleCarouselPrev","useCallback","prev","handleCarouselNext","handleCarouselIndicatorClick","index","useImperativeHandle","useEffect","jsxs","Styled.Carousel","jsx","Styled.CarouselWrapper","item","Styled.CarouselItemContainer","Styled.ExtendedFlexView","IconButton","BackIcon","Separator","_","Styled.Indicator","NextIcon","Carousel","memo","forwardRef"],"mappings":";;;;;;;AAoBA,MAAMA,IAA6E,CACjF,EAAE,OAAAC,GAAO,cAAAC,IAAe,GAAG,QAAAC,GAAQ,QAAAC,GAAQ,eAAAC,GAAe,eAAAC,EAAc,GACxEC,MACG;AACH,QAAMC,IAAwBC,EAAQ,MAAMJ,GAAe,CAACA,CAAa,CAAC,GACpEK,IAAwBD,EAAQ,MAAMH,GAAe,CAACA,CAAa,CAAC,GAEpEK,IAAaC,EAAuB,IAAI,GACxCC,IAAeD,EAAO,EAAI,GAC1B,CAACE,GAAWC,CAAY,IAAIC,EAASd,CAAY,GAEjDe,IAAqBC,EAAY,MAAM;AAClC,IAAAd,KAAA,QAAAA,KACIW,EAAA,CAAAI,MAAQA,IAAO,CAAC;AAAA,EAAA,GAC5B,CAACf,CAAM,CAAC,GAELgB,IAAqBF,EAAY,MAAM;AAClC,IAAAf,KAAA,QAAAA,KACIY,EAAA,CAAAI,MAAQA,IAAO,CAAC;AAAA,EAAA,GAC5B,CAAChB,CAAM,CAAC,GAELkB,IAA+BH,EAAY,CAACI,MAAkB;AAClE,IAAAP,EAAaO,CAAK;AAAA,EACpB,GAAG,CAAE,CAAA;AAEL,SAAAC,EAAoBhB,GAAK,OAAO;AAAA,IAC9B,YAAAI;AAAA,EACA,EAAA,GAEFa,EAAU,MAAM;AACd,IAAIX,EAAa,YACfA,EAAa,UAAU;AAAA,EAE3B,GAAG,CAAE,CAAA,GAGLW,EAAU,MAAM;AACd,IAAAT,EAAab,CAAY;AAAA,EAAA,GACxB,CAACA,CAAY,CAAC,GAGf,gBAAAuB,EAACC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,YAAYd,IAAY;AAAA,QACxB,oBAAoBD,EAAa,UAAU,IAAI;AAA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cher/comps/carousel/carousel.tsx"],"sourcesContent":["import type { ICarouselProps, ICarouselRefs } from './carousel-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n createRef,\n} from 'react';\n\nimport CaratLeftIcon from '../../../../../assets/line-icons/icons/carat-left';\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport Separator from '../../../../ui/separator/separator';\nimport * as Styled from './carousel-styled';\n\nconst CarouselComponent: ForwardRefRenderFunction<ICarouselRefs, ICarouselProps> = (\n { items, defaultIndex = 0, onNext, onPrev, analyticsPrev, analyticsNext },\n ref,\n) => {\n const memoizedAnalyticsPrev = useMemo(() => analyticsPrev, [analyticsPrev]);\n const memoizedAnalyticsNext = useMemo(() => analyticsNext, [analyticsNext]);\n\n const nextBtnRef = useRef<HTMLDivElement>(null);\n const isFirstMount = useRef(true);\n const [currIndex, setCurrIndex] = useState(defaultIndex);\n\n // Create a stable array of refs for indicators\n const indicatorRefs = useMemo(() => items.map(() => createRef<HTMLDivElement>()), [items]);\n\n const handleCarouselPrev = useCallback(() => {\n onPrev?.();\n setCurrIndex(prev => prev - 1);\n }, [onPrev]);\n\n const handleCarouselNext = useCallback(() => {\n onNext?.();\n setCurrIndex(prev => prev + 1);\n }, [onNext]);\n\n const handleCarouselIndicatorClick = useCallback((index: number) => {\n setCurrIndex(index);\n }, []);\n\n useImperativeHandle(ref, () => ({\n nextBtnRef,\n indicatorRefs,\n currentIndex: currIndex,\n goToIndex: (index: number) => {\n setCurrIndex(index);\n },\n }));\n\n useEffect(() => {\n if (isFirstMount.current) {\n isFirstMount.current = false;\n }\n }, []);\n\n // Change index from parent\n useEffect(() => {\n setCurrIndex(defaultIndex);\n }, [defaultIndex]);\n\n return (\n <Styled.Carousel>\n <Styled.CarouselWrapper\n $translate={currIndex * 100}\n $translateDuration={isFirstMount.current ? 0 : 300}\n >\n {items.map((item, index) => (\n <Styled.CarouselItemContainer key={index}>{item}</Styled.CarouselItemContainer>\n ))}\n </Styled.CarouselWrapper>\n\n {items.length > 1 && (\n <Styled.ExtendedFlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $position=\"absolute\"\n >\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratLeftIcon}\n onClick={handleCarouselPrev}\n analyticsLabel={memoizedAnalyticsPrev.analyticsLabel}\n analyticsProps={memoizedAnalyticsPrev.analyticsProps}\n disabled={currIndex === 0}\n />\n <Separator width={48} />\n {items.map((_, index) => (\n <Styled.Indicator\n ref={indicatorRefs[index]}\n $isActive={index === currIndex}\n key={index}\n onClick={() => handleCarouselIndicatorClick(index)}\n />\n ))}\n <Separator width={48} />\n <div ref={nextBtnRef}>\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={handleCarouselNext}\n analyticsLabel={memoizedAnalyticsNext.analyticsLabel}\n analyticsProps={memoizedAnalyticsNext.analyticsProps}\n disabled={currIndex === items.length - 1}\n />\n </div>\n </Styled.ExtendedFlexView>\n )}\n </Styled.Carousel>\n );\n};\n\nexport const Carousel = memo(forwardRef(CarouselComponent));\n"],"names":["CarouselComponent","items","defaultIndex","onNext","onPrev","analyticsPrev","analyticsNext","ref","memoizedAnalyticsPrev","useMemo","memoizedAnalyticsNext","nextBtnRef","useRef","isFirstMount","currIndex","setCurrIndex","useState","indicatorRefs","createRef","handleCarouselPrev","useCallback","prev","handleCarouselNext","handleCarouselIndicatorClick","index","useImperativeHandle","useEffect","jsxs","Styled.Carousel","jsx","Styled.CarouselWrapper","item","Styled.CarouselItemContainer","Styled.ExtendedFlexView","IconButton","CaratLeftIcon","Separator","_","Styled.Indicator","CaratRightIcon","Carousel","memo","forwardRef"],"mappings":";;;;;;;AAqBA,MAAMA,IAA6E,CACjF,EAAE,OAAAC,GAAO,cAAAC,IAAe,GAAG,QAAAC,GAA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