@cuemath/leap 3.2.20-beta-0.2 → 3.2.21-as1

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 (54) hide show
  1. package/dist/assets/illustrations/illustrations.js +1 -0
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/line-icons/icons/star3.js +32 -0
  4. package/dist/assets/line-icons/icons/star3.js.map +1 -0
  5. package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.js +43 -43
  6. package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-item.js.map +1 -1
  7. package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.js +1 -1
  8. package/dist/features/chapters/lpar-chapter/block-section/sat-sheet-item/sat-sheet-utils.js.map +1 -1
  9. package/dist/features/notification/notification.js +129 -0
  10. package/dist/features/notification/notification.js.map +1 -0
  11. package/dist/features/trial-session/comps/student-profile/student-profile.js +1 -1
  12. package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +7 -50
  13. package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
  14. package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +15 -69
  15. package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
  16. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +49 -0
  17. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +1 -0
  18. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +64 -0
  19. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -0
  20. package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +28 -0
  21. package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +1 -0
  22. package/dist/features/ui/accordion/accordion-items/accordion-items.js +83 -0
  23. package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -0
  24. package/dist/features/ui/accordion/accordion.js +62 -0
  25. package/dist/features/ui/accordion/accordion.js.map +1 -0
  26. package/dist/features/ui/carousal/carousal-styles.js +45 -0
  27. package/dist/features/ui/carousal/carousal-styles.js.map +1 -0
  28. package/dist/features/ui/carousal/carousal.js +76 -0
  29. package/dist/features/ui/carousal/carousal.js.map +1 -0
  30. package/dist/features/ui/inputs/base-input/base-input.js +11 -11
  31. package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
  32. package/dist/features/ui/inputs/text-input/text-input.js +19 -18
  33. package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
  34. package/dist/features/ui/modals/modal-styled.js +42 -8
  35. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  36. package/dist/features/ui/modals/modal.js +37 -27
  37. package/dist/features/ui/modals/modal.js.map +1 -1
  38. package/dist/features/ui/text/text.js +31 -29
  39. package/dist/features/ui/text/text.js.map +1 -1
  40. package/dist/features/ui/theme/clrs.js +2 -0
  41. package/dist/features/ui/theme/clrs.js.map +1 -1
  42. package/dist/features/worksheet/worksheet/constants.js +13 -12
  43. package/dist/features/worksheet/worksheet/constants.js.map +1 -1
  44. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +260 -246
  45. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  46. package/dist/features/worksheet/worksheet/worksheet-styled.js +28 -37
  47. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  48. package/dist/features/worksheet/worksheet/worksheet.js +164 -166
  49. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  50. package/dist/index.d.ts +121 -4
  51. package/dist/index.js +639 -627
  52. package/dist/index.js.map +1 -1
  53. package/dist/static/stripe-blurple.6abf422f.svg +1 -0
  54. package/package.json +1 -1
@@ -1,74 +1,20 @@
1
- import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import { memo as T, useMemo as I } from "react";
3
- import j from "../../../ui/image/image.js";
4
- import h from "../../../ui/layout/flex-view.js";
5
- import s from "../../../ui/separator/separator.js";
6
- import t from "../../../ui/text/text.js";
7
- import { useTrialSessionContext as k } from "../../context/use-trial-session-context.js";
8
- import O from "../communication-slide/index.js";
9
- import F from "../slide-header/index.js";
10
- import { COUNTRY_FLAGS as H } from "./teacher-intro-constants.js";
11
- import { Container as L, ContentWrapper as D, ProfilePicture as E, GridContainer as P, GridItem as i } from "./teacher-intro-styled.js";
12
- const z = T(() => {
13
- const { slideConfig: f } = k(), { renderAVIn: m, teacher_profile: u } = f || {}, {
14
- degree: g,
15
- countries: o,
16
- lower_grade: a,
17
- higher_grade: n,
18
- header_image: $,
19
- years_of_experience: p,
20
- number_of_students_taught: b
21
- } = u || {}, { degree_name: c, field_of_study: d } = g || {}, _ = Object.values(H), l = n && parseInt(n, 10) > 8, x = I(() => l ? "High School" : ` ${a === "K" ? "" : "G"}${a} - G${n}`, [l, n, a]);
22
- return m === "right" ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ r(L, { children: [
23
- /* @__PURE__ */ e(s, { height: 60 }),
24
- /* @__PURE__ */ e(F, {}),
25
- /* @__PURE__ */ r(
26
- D,
27
- {
28
- $flexDirection: "row",
29
- $width: 750,
30
- $borderColor: "BLACK_T_87",
31
- $background: "WHITE_3",
32
- children: [
33
- /* @__PURE__ */ e(E, { withLoader: !0, src: $, width: 350, height: 350 }),
34
- /* @__PURE__ */ r(P, { children: [
35
- /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
36
- /* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: p }),
37
- /* @__PURE__ */ e(t, { $renderAs: "ub3", children: "Yrs of Teaching Experience" })
38
- ] }),
39
- /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
40
- /* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: b }),
41
- /* @__PURE__ */ e(t, { $renderAs: "ub3", children: "Students Taught" })
42
- ] }),
43
- c && d && /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
44
- /* @__PURE__ */ e(t, { $renderAs: "ab1-black", children: c }),
45
- /* @__PURE__ */ r(t, { $renderAs: "ub3", children: [
46
- "In ",
47
- d
48
- ] })
49
- ] }),
50
- /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
51
- /* @__PURE__ */ r(t, { $renderAs: "ab1-black", children: [
52
- "Teaching ",
53
- x,
54
- " kids in"
55
- ] }),
56
- /* @__PURE__ */ e(s, { height: 12 }),
57
- /* @__PURE__ */ e(h, { $flexDirection: "row", $flexGap: 16, $flexWrap: !0, children: o && o.length > 0 && o.map((C) => {
58
- const y = _.find((S) => S.name === C), { flag_icon: A = "", label: w, name: G } = y || {};
59
- return /* @__PURE__ */ r(h, { $flexDirection: "row", $flexGap: 4, children: [
60
- /* @__PURE__ */ e(j, { src: A, width: 30, height: 20, withLoader: !1 }),
61
- /* @__PURE__ */ e(t, { $renderAs: "ab3-black", children: w })
62
- ] }, G);
63
- }) })
64
- ] })
65
- ] })
66
- ]
67
- }
68
- )
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { memo as m } from "react";
3
+ import n from "../../../ui/separator/separator.js";
4
+ import { useTrialSessionContext as f } from "../../context/use-trial-session-context.js";
5
+ import a from "../communication-slide/index.js";
6
+ import p from "../slide-header/index.js";
7
+ import { Container as s, ContentWrapper as c } from "./teacher-intro-styled.js";
8
+ import h from "./teacher-profile/teacher-profile.js";
9
+ const j = m(() => {
10
+ const { slideConfig: e } = f(), { renderAVIn: o, teacher_profile: t } = e || {};
11
+ return o === "right" ? /* @__PURE__ */ r(a, {}) : /* @__PURE__ */ i(s, { children: [
12
+ /* @__PURE__ */ r(n, { height: 60 }),
13
+ /* @__PURE__ */ r(p, {}),
14
+ /* @__PURE__ */ r(c, { $width: 750, children: /* @__PURE__ */ r(h, { teacherProfile: t }) })
69
15
  ] });
70
16
  });
71
17
  export {
72
- z as default
18
+ j as default
73
19
  };
74
20
  //# sourceMappingURL=teacher-intro.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"teacher-intro.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro.tsx"],"sourcesContent":["import { memo, useMemo } from 'react';\n\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport CommunicationSlide from '../communication-slide';\nimport SlideHeader from '../slide-header';\nimport { COUNTRY_FLAGS } from './teacher-intro-constants';\nimport * as Styled from './teacher-intro-styled';\n\nconst TeacherIntro = memo(() => {\n const { slideConfig } = useTrialSessionContext();\n const { renderAVIn, teacher_profile: teacherProfile } = slideConfig || {};\n\n const {\n degree,\n countries,\n lower_grade: lowerGrade,\n higher_grade: higherGrade,\n header_image: headerImage,\n years_of_experience: yearsOfExperience,\n number_of_students_taught: numberOfStudentsTaught,\n } = teacherProfile || {};\n const { degree_name: degreeName, field_of_study: fieldOfStudy } = degree || {};\n\n const countryFlagArray = Object.values(COUNTRY_FLAGS);\n const isHighSchool = higherGrade && parseInt(higherGrade, 10) > 8;\n\n const displayGrade = useMemo(() => {\n return isHighSchool\n ? 'High School'\n : ` ${lowerGrade === 'K' ? '' : 'G'}${lowerGrade} - G${higherGrade}`;\n }, [isHighSchool, higherGrade, lowerGrade]);\n\n if (renderAVIn === 'right') return <CommunicationSlide />;\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper\n $flexDirection=\"row\"\n $width={750}\n $borderColor=\"BLACK_T_87\"\n $background=\"WHITE_3\"\n >\n <Styled.ProfilePicture withLoader src={headerImage} width={350} height={350} />\n <Styled.GridContainer>\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ah3-black\">{yearsOfExperience}</Text>\n <Text $renderAs=\"ub3\">Yrs of Teaching Experience</Text>\n </Styled.GridItem>\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ah3-black\">{numberOfStudentsTaught}</Text>\n <Text $renderAs=\"ub3\">Students Taught</Text>\n </Styled.GridItem>\n {degreeName && fieldOfStudy && (\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ab1-black\">{degreeName}</Text>\n <Text $renderAs=\"ub3\">In {fieldOfStudy}</Text>\n </Styled.GridItem>\n )}\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ab1-black\">Teaching {displayGrade} kids in</Text>\n <Separator height={12} />\n <FlexView $flexDirection=\"row\" $flexGap={16} $flexWrap>\n {countries &&\n countries.length > 0 &&\n countries.map(country => {\n const countryFlag = countryFlagArray.find(item => item.name === country);\n const { flag_icon: flagIcon = '', label, name } = countryFlag || {};\n\n return (\n <FlexView key={name} $flexDirection=\"row\" $flexGap={4}>\n <Image src={flagIcon} width={30} height={20} withLoader={false} />\n <Text $renderAs=\"ab3-black\">{label}</Text>\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.GridItem>\n </Styled.GridContainer>\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nexport default TeacherIntro;\n"],"names":["TeacherIntro","memo","slideConfig","useTrialSessionContext","renderAVIn","teacherProfile","degree","countries","lowerGrade","higherGrade","headerImage","yearsOfExperience","numberOfStudentsTaught","degreeName","fieldOfStudy","countryFlagArray","COUNTRY_FLAGS","isHighSchool","displayGrade","useMemo","jsx","CommunicationSlide","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","Styled.ProfilePicture","Styled.GridContainer","Styled.GridItem","Text","FlexView","country","countryFlag","item","flagIcon","label","name","Image"],"mappings":";;;;;;;;;;;AAYM,MAAAA,IAAeC,EAAK,MAAM;AACxB,QAAA,EAAE,aAAAC,MAAgBC,KAClB,EAAE,YAAAC,GAAY,iBAAiBC,EAAe,IAAIH,KAAe,CAAA,GAEjE;AAAA,IACJ,QAAAI;AAAA,IACA,WAAAC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AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"teacher-intro.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport CommunicationSlide from '../communication-slide';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './teacher-intro-styled';\nimport TeacherProfile from './teacher-profile/teacher-profile';\n\nconst TeacherIntro = memo(() => {\n const { slideConfig } = useTrialSessionContext();\n const { renderAVIn, teacher_profile: teacherProfile } = slideConfig || {};\n\n if (renderAVIn === 'right') return <CommunicationSlide />;\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $width={750}>\n <TeacherProfile teacherProfile={teacherProfile} />\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nexport default TeacherIntro;\n"],"names":["TeacherIntro","memo","slideConfig","useTrialSessionContext","renderAVIn","teacherProfile","jsx","CommunicationSlide","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","TeacherProfile"],"mappings":";;;;;;;;AASM,MAAAA,IAAeC,EAAK,MAAM;AACxB,QAAA,EAAE,aAAAC,MAAgBC,KAClB,EAAE,YAAAC,GAAY,iBAAiBC,EAAe,IAAIH,KAAe,CAAA;AAEvE,SAAIE,MAAe,UAAgB,gBAAAE,EAACC,GAAmB,CAAA,CAAA,IAGrD,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAH,EAAAI,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,sBACtBC,GAAY,EAAA;AAAA,IACb,gBAAAL,EAACM,GAAA,EAAsB,QAAQ,KAC7B,UAAA,gBAAAN,EAACO,GAAe,EAAA,gBAAAR,EAAgC,CAAA,GAClD;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -0,0 +1,49 @@
1
+ import r from "styled-components";
2
+ import e from "../../../../ui/image/image.js";
3
+ import t from "../../../../ui/layout/flex-view.js";
4
+ const l = r(e)`
5
+ object-fit: cover;
6
+ `, c = r.div(
7
+ ({ theme: o }) => `
8
+ flex: 1;
9
+ display: grid;
10
+ border-left: 1px solid ${o.colors.BLACK_T_87};
11
+ grid-template-columns: repeat(2, 1fr);
12
+ grid-template-rows: auto auto auto;
13
+ `
14
+ ), h = r(t)(
15
+ ({ theme: o }) => `
16
+ border: 0.5px solid ${o.colors.WHITE_5};
17
+ &:first-child,
18
+ &:nth-child(2) {
19
+ grid-column: span 1;
20
+ }
21
+ &:nth-child(3),
22
+ &:nth-child(4) {
23
+ grid-column: span 2;
24
+ }
25
+ &:first-child {
26
+ border-left: none;
27
+ border-top: none;
28
+ }
29
+ &:nth-child(2) {
30
+ border-right: none;
31
+ border-top: none;
32
+ }
33
+ &:nth-child(3) {
34
+ border-left: none;
35
+ border-right: none;
36
+ }
37
+ &:nth-child(4) {
38
+ border-left: none;
39
+ border-right: none;
40
+ border-bottom: none;
41
+ }
42
+ `
43
+ );
44
+ export {
45
+ c as GridContainer,
46
+ h as GridItem,
47
+ l as ProfilePicture
48
+ };
49
+ //# sourceMappingURL=teacher-profile-styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teacher-profile-styled.js","sources":["../../../../../../src/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\n\nconst ProfilePicture = styled(Image)`\n object-fit: cover;\n`;\n\nconst GridContainer = styled.div(\n ({ theme }) => `\n flex: 1;\n display: grid;\n border-left: 1px solid ${theme.colors.BLACK_T_87};\n grid-template-columns: repeat(2, 1fr);\n grid-template-rows: auto auto auto;\n`,\n);\n\nconst GridItem = styled(FlexView)(\n ({ theme }) => `\n border: 0.5px solid ${theme.colors.WHITE_5};\n &:first-child,\n &:nth-child(2) {\n grid-column: span 1;\n }\n &:nth-child(3),\n &:nth-child(4) {\n grid-column: span 2;\n }\n &:first-child {\n border-left: none;\n border-top: none;\n }\n &:nth-child(2) {\n border-right: none;\n border-top: none;\n }\n &:nth-child(3) {\n border-left: none;\n border-right: none;\n }\n &:nth-child(4) {\n border-left: none;\n border-right: none;\n border-bottom: none;\n }\n`,\n);\n\nexport { ProfilePicture, GridContainer, GridItem };\n"],"names":["ProfilePicture","styled","Image","GridContainer","theme","GridItem","FlexView"],"mappings":";;;AAKM,MAAAA,IAAiBC,EAAOC,CAAK;AAAA;AAAA,GAI7BC,IAAgBF,EAAO;AAAA,EAC3B,CAAC,EAAE,OAAAG,EAAA,MAAY;AAAA;AAAA;AAAA,2BAGUA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAIlD,GAEMC,IAAWJ,EAAOK,CAAQ;AAAA,EAC9B,CAAC,EAAE,OAAAF,EAAA,MAAY;AAAA,wBACOA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2B5C;"}
@@ -0,0 +1,64 @@
1
+ import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
+ import { memo as G, useMemo as T } from "react";
3
+ import C from "../../../../ui/image/image.js";
4
+ import a from "../../../../ui/layout/flex-view.js";
5
+ import j from "../../../../ui/separator/separator.js";
6
+ import t from "../../../../ui/text/text.js";
7
+ import { COUNTRY_FLAGS as k } from "../teacher-intro-constants.js";
8
+ import { ProfilePicture as I, GridContainer as S, GridItem as i } from "./teacher-profile-styled.js";
9
+ const O = G(({ teacherProfile: s }) => {
10
+ const {
11
+ degree: f,
12
+ countries: o,
13
+ lower_grade: c,
14
+ higher_grade: n,
15
+ header_image: u,
16
+ years_of_experience: g,
17
+ number_of_students_taught: m
18
+ } = s || {}, { degree_name: d, field_of_study: l } = f || {}, $ = Object.values(k), h = n && parseInt(n, 10) > 8, p = T(() => h ? "High School" : ` ${c === "K" ? "" : "G"}${c} - G${n}`, [h, n, c]);
19
+ return /* @__PURE__ */ e(a, { $flexDirection: "row", $borderColor: "BLACK_T_87", $background: "WHITE_3", children: [
20
+ /* @__PURE__ */ r(I, { withLoader: !0, src: u, width: 350, height: 350 }),
21
+ /* @__PURE__ */ e(S, { children: [
22
+ /* @__PURE__ */ e(i, { $justifyContent: "center", $gutter: 24, children: [
23
+ /* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: [
24
+ g,
25
+ "+"
26
+ ] }),
27
+ /* @__PURE__ */ r(t, { $renderAs: "ub3", children: "Yrs of Teaching Experience" })
28
+ ] }),
29
+ /* @__PURE__ */ e(i, { $justifyContent: "center", $gutter: 24, children: [
30
+ /* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: [
31
+ m,
32
+ "+"
33
+ ] }),
34
+ /* @__PURE__ */ r(t, { $renderAs: "ub3", children: "Students Taught" })
35
+ ] }),
36
+ d && l && /* @__PURE__ */ e(i, { $justifyContent: "center", $gutter: 24, children: [
37
+ /* @__PURE__ */ r(t, { $renderAs: "ab1-black", children: d }),
38
+ /* @__PURE__ */ e(t, { $renderAs: "ub3", children: [
39
+ "In ",
40
+ l
41
+ ] })
42
+ ] }),
43
+ /* @__PURE__ */ e(i, { $justifyContent: "center", $gutter: 24, children: [
44
+ /* @__PURE__ */ e(t, { $renderAs: "ab1-black", children: [
45
+ "Teaching ",
46
+ p,
47
+ " kids in"
48
+ ] }),
49
+ /* @__PURE__ */ r(j, { height: 12 }),
50
+ /* @__PURE__ */ r(a, { $flexDirection: "row", $flexGap: 16, $flexWrap: !0, children: o && o.length > 0 && o.map((b) => {
51
+ const _ = $.find((w) => w.name === b), { flag_icon: x = "", label: y, name: A } = _ || {};
52
+ return /* @__PURE__ */ e(a, { $flexDirection: "row", $flexGap: 4, children: [
53
+ /* @__PURE__ */ r(C, { src: x, width: 30, height: 20, withLoader: !1 }),
54
+ /* @__PURE__ */ r(t, { $renderAs: "ab3-black", children: y })
55
+ ] }, A);
56
+ }) })
57
+ ] })
58
+ ] })
59
+ ] });
60
+ }), W = O;
61
+ export {
62
+ W as default
63
+ };
64
+ //# sourceMappingURL=teacher-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teacher-profile.js","sources":["../../../../../../src/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.tsx"],"sourcesContent":["import type { ITeacherProfileDetails } from '../../../trial-session-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { COUNTRY_FLAGS } from '../teacher-intro-constants';\nimport * as Styled from './teacher-profile-styled';\n\ninterface ITeacherProfileProps {\n teacherProfile?: ITeacherProfileDetails;\n}\n\nconst TeacherProfile: FC<ITeacherProfileProps> = memo(({ teacherProfile }) => {\n const {\n degree,\n countries,\n lower_grade: lowerGrade,\n higher_grade: higherGrade,\n header_image: headerImage,\n years_of_experience: yearsOfExperience,\n number_of_students_taught: numberOfStudentsTaught,\n } = teacherProfile || {};\n const { degree_name: degreeName, field_of_study: fieldOfStudy } = degree || {};\n\n const countryFlagArray = Object.values(COUNTRY_FLAGS);\n const isHighSchool = higherGrade && parseInt(higherGrade, 10) > 8;\n\n const displayGrade = useMemo(() => {\n return isHighSchool\n ? 'High School'\n : ` ${lowerGrade === 'K' ? '' : 'G'}${lowerGrade} - G${higherGrade}`;\n }, [isHighSchool, higherGrade, lowerGrade]);\n\n return (\n <FlexView $flexDirection=\"row\" $borderColor=\"BLACK_T_87\" $background=\"WHITE_3\">\n <Styled.ProfilePicture withLoader src={headerImage} width={350} height={350} />\n <Styled.GridContainer>\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ah3-black\">{yearsOfExperience}+</Text>\n <Text $renderAs=\"ub3\">Yrs of Teaching Experience</Text>\n </Styled.GridItem>\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ah3-black\">{numberOfStudentsTaught}+</Text>\n <Text $renderAs=\"ub3\">Students Taught</Text>\n </Styled.GridItem>\n {degreeName && fieldOfStudy && (\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ab1-black\">{degreeName}</Text>\n <Text $renderAs=\"ub3\">In {fieldOfStudy}</Text>\n </Styled.GridItem>\n )}\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ab1-black\">Teaching {displayGrade} kids in</Text>\n <Separator height={12} />\n <FlexView $flexDirection=\"row\" $flexGap={16} $flexWrap>\n {countries &&\n countries.length > 0 &&\n countries.map(country => {\n const countryFlag = countryFlagArray.find(item => item.name === country);\n const { flag_icon: flagIcon = '', label, name } = countryFlag || {};\n\n return (\n <FlexView key={name} $flexDirection=\"row\" $flexGap={4}>\n <Image src={flagIcon} width={30} height={20} withLoader={false} />\n <Text $renderAs=\"ab3-black\">{label}</Text>\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.GridItem>\n </Styled.GridContainer>\n </FlexView>\n );\n});\n\nexport default TeacherProfile;\n"],"names":["TeacherProfile","memo","teacherProfile","degree","countries","lowerGrade","higherGrade","headerImage","yearsOfExperience","numberOfStudentsTaught","degreeName","fieldOfStudy","countryFlagArray","COUNTRY_FLAGS","isHighSchool","displayGrade","useMemo","FlexView","jsx","Styled.ProfilePicture","jsxs","Styled.GridContainer","Styled.GridItem","Text","Separator","country","countryFlag","item","flagIcon","label","name","Image","TeacherProfile$1"],"mappings":";;;;;;;;AAgBA,MAAMA,IAA2CC,EAAK,CAAC,EAAE,gBAAAC,QAAqB;AACtE,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAaC;AAAA,IACb,cAAcC;AAAA,IACd,cAAcC;AAAA,IACd,qBAAqBC;AA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,WAAU,OAAM,UAAA;AAAA,UAAA;AAAA,UAAIZ;AAAA,QAAA,GAAa;AAAA,MAAA,GACzC;AAAA,wBAEDW,GAAA,EAAgB,iBAAgB,UAAS,SAAS,IACjD,UAAA;AAAA,QAAC,gBAAAF,EAAAG,GAAA,EAAK,WAAU,aAAY,UAAA;AAAA,UAAA;AAAA,UAAUR;AAAA,UAAa;AAAA,QAAA,GAAQ;AAAA,QAC3D,gBAAAG,EAACM,GAAU,EAAA,QAAQ,GAAI,CAAA;AAAA,QACtB,gBAAAN,EAAAD,GAAA,EAAS,gBAAe,OAAM,UAAU,IAAI,WAAS,IACnD,UAAAb,KACCA,EAAU,SAAS,KACnBA,EAAU,IAAI,CAAWqB,MAAA;AACvB,gBAAMC,IAAcd,EAAiB,KAAK,CAAQe,MAAAA,EAAK,SAASF,CAAO,GACjE,EAAE,WAAWG,IAAW,IAAI,OAAAC,GAAO,MAAAC,EAAK,IAAIJ,KAAe;AAEjE,iBACG,gBAAAN,EAAAH,GAAA,EAAoB,gBAAe,OAAM,UAAU,GAClD,UAAA;AAAA,YAAC,gBAAAC,EAAAa,GAAA,EAAM,KAAKH,GAAU,OAAO,IAAI,QAAQ,IAAI,YAAY,GAAO,CAAA;AAAA,YAC/D,gBAAAV,EAAAK,GAAA,EAAK,WAAU,aAAa,UAAMM,GAAA;AAAA,UAAA,EAAA,GAFtBC,CAGf;AAAA,QAEH,CAAA,GACL;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDE,IAAehC;"}
@@ -0,0 +1,28 @@
1
+ import o from "styled-components";
2
+ import r from "../../../../assets/line-icons/icons/plus.js";
3
+ import t from "../../layout/flex-view.js";
4
+ const a = o(t)(
5
+ ({ $index: e, $visible: i, $accordionBorderColor: n }) => `
6
+ border-bottom: 1px solid ${n};
7
+ ${e === 0 ? `border-top: 1px solid ${n};` : ""}
8
+ display: ${i ? "flex" : "none"};
9
+ `
10
+ ), c = o(t)`
11
+ cursor: pointer;
12
+ `, m = o.div`
13
+ max-height: 0;
14
+ overflow: hidden;
15
+ transition: all 0.3s ease-in-out;
16
+ `, p = o(t)`
17
+ width: 100%;
18
+ `, x = o(r)`
19
+ transition: all 0.3s ease-in-out;
20
+ `;
21
+ export {
22
+ m as AccordionAnswer,
23
+ c as AccordionItemContainer,
24
+ a as Container,
25
+ p as ContentContainer,
26
+ x as StyledPlusIcon
27
+ };
28
+ //# sourceMappingURL=accordion-items-styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion-items-styled.js","sources":["../../../../../src/features/ui/accordion/accordion-items/accordion-items-styled.ts"],"sourcesContent":["import type { ContainerProps } from '../accordion-types';\n\nimport styled from 'styled-components';\n\nimport PlusIcon from '../../../../assets/line-icons/icons/plus';\nimport FlexView from '../../layout/flex-view';\n\nconst Container = styled(FlexView)<ContainerProps>(\n ({ $index, $visible, $accordionBorderColor }) => `\n border-bottom: 1px solid ${$accordionBorderColor};\n ${$index === 0 ? `border-top: 1px solid ${$accordionBorderColor};` : ''}\n display: ${$visible ? 'flex' : 'none'};\n`,\n);\n\nconst AccordionItemContainer = styled(FlexView)`\n cursor: pointer;\n`;\n\nconst AccordionAnswer = styled.div`\n max-height: 0;\n overflow: hidden;\n transition: all 0.3s ease-in-out;\n`;\n\nconst ContentContainer = styled(FlexView)`\n width: 100%;\n`;\n\nconst StyledPlusIcon = styled(PlusIcon)`\n transition: all 0.3s ease-in-out;\n`;\n\nexport { Container, AccordionItemContainer, AccordionAnswer, ContentContainer, StyledPlusIcon };\n"],"names":["Container","styled","FlexView","$index","$visible","$accordionBorderColor","AccordionItemContainer","AccordionAnswer","ContentContainer","StyledPlusIcon","PlusIcon"],"mappings":";;;AAOM,MAAAA,IAAYC,EAAOC,CAAQ;AAAA,EAC/B,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,uBAAAC,EAA4B,MAAA;AAAA,6BACtBA,CAAqB;AAAA,IAC9CF,MAAW,IAAI,yBAAyBE,CAAqB,MAAM,EAAE;AAAA,aAC5DD,IAAW,SAAS,MAAM;AAAA;AAEvC,GAEME,IAAyBL,EAAOC,CAAQ;AAAA;AAAA,GAIxCK,IAAkBN,EAAO;AAAA;AAAA;AAAA;AAAA,GAMzBO,IAAmBP,EAAOC,CAAQ;AAAA;AAAA,GAIlCO,IAAiBR,EAAOS,CAAQ;AAAA;AAAA;"}
@@ -0,0 +1,83 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { memo as C, useCallback as p } from "react";
3
+ import { useTheme as u } from "styled-components";
4
+ import b from "../../layout/flex-view.js";
5
+ import x from "../../separator/separator.js";
6
+ import s from "../../text/text.js";
7
+ import { EDeviceType as I } from "../../theme/constants.js";
8
+ import { Container as g, ContentContainer as w, AccordionItemContainer as T, StyledPlusIcon as y, AccordionAnswer as B } from "./accordion-items-styled.js";
9
+ const M = C((d) => {
10
+ const { item: o, index: r, theme: m, refList: a, iconRef: f, visible: $, handleToggle: c } = d, { device: h } = u(), l = h === I.MOBILE, n = m === "dark", A = p(() => {
11
+ c(r);
12
+ }, [c, r]);
13
+ return /* @__PURE__ */ e(
14
+ g,
15
+ {
16
+ $flexDirection: "column",
17
+ $justifyContent: "center",
18
+ $alignItems: "flex-start",
19
+ $index: r,
20
+ $visible: $,
21
+ onClick: A,
22
+ $accordionBorderColor: n ? "WHITE" : "BLACK",
23
+ children: /* @__PURE__ */ t(
24
+ w,
25
+ {
26
+ $flexDirection: "column",
27
+ $justifyContent: "center",
28
+ $alignItems: "flex-start",
29
+ $gap: 24,
30
+ children: [
31
+ /* @__PURE__ */ t(
32
+ T,
33
+ {
34
+ $width: "100%",
35
+ $flexDirection: "row",
36
+ $justifyContent: "space-between",
37
+ $alignItems: "center",
38
+ children: [
39
+ /* @__PURE__ */ e(s, { $renderAs: "ab1", $renderOnMobileAs: "ab2", $color: n ? "WHITE" : "BLACK", children: o.accordionQuestion + o.accordionQuestion }),
40
+ /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(
41
+ y,
42
+ {
43
+ color: n ? "WHITE" : "BLACK",
44
+ width: l ? 24 : 40,
45
+ height: l ? 24 : 40,
46
+ ref: (i) => {
47
+ f[r] = i;
48
+ }
49
+ }
50
+ ) })
51
+ ]
52
+ }
53
+ ),
54
+ /* @__PURE__ */ t(
55
+ B,
56
+ {
57
+ ref: (i) => {
58
+ a[r] = i;
59
+ },
60
+ children: [
61
+ /* @__PURE__ */ e(x, { height: 12 }),
62
+ typeof o.accordionAnswer == "string" ? /* @__PURE__ */ e(
63
+ s,
64
+ {
65
+ $renderAs: "ub2-bold",
66
+ $renderOnMobileAs: "ub3-bold",
67
+ $color: n ? "WHITE" : "BLACK",
68
+ children: o.accordionAnswer
69
+ }
70
+ ) : o.accordionAnswer
71
+ ]
72
+ }
73
+ )
74
+ ]
75
+ }
76
+ )
77
+ }
78
+ );
79
+ });
80
+ export {
81
+ M as default
82
+ };
83
+ //# sourceMappingURL=accordion-items.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion-items.js","sources":["../../../../../src/features/ui/accordion/accordion-items/accordion-items.tsx"],"sourcesContent":["import type { AccordionItemProps } from '../accordion-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../layout/flex-view';\nimport Separator from '../../separator/separator';\nimport Text from '../../text/text';\nimport { EDeviceType } from '../../theme/constants';\nimport * as Styled from './accordion-items-styled';\n\nconst AccordionItem: FC<AccordionItemProps> = memo(props => {\n const { item, index, theme, refList, iconRef, visible, handleToggle } = props;\n const { device } = useTheme();\n const isMobile = device === EDeviceType.MOBILE;\n const isDarkTheme = theme === 'dark';\n\n const handleClick = useCallback(() => {\n handleToggle(index);\n }, [handleToggle, index]);\n\n return (\n <Styled.Container\n $flexDirection=\"column\"\n $justifyContent=\"center\"\n $alignItems=\"flex-start\"\n $index={index}\n $visible={visible}\n onClick={handleClick}\n $accordionBorderColor={isDarkTheme ? 'WHITE' : 'BLACK'}\n >\n <Styled.ContentContainer\n $flexDirection=\"column\"\n $justifyContent=\"center\"\n $alignItems=\"flex-start\"\n $gap={24}\n >\n <Styled.AccordionItemContainer\n $width=\"100%\"\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <Text $renderAs=\"ab1\" $renderOnMobileAs=\"ab2\" $color={isDarkTheme ? 'WHITE' : 'BLACK'}>\n {item.accordionQuestion + item.accordionQuestion}\n </Text>\n <FlexView>\n <Styled.StyledPlusIcon\n color={isDarkTheme ? 'WHITE' : 'BLACK'}\n width={isMobile ? 24 : 40}\n height={isMobile ? 24 : 40}\n ref={node => {\n iconRef[index] = node;\n }}\n />\n </FlexView>\n </Styled.AccordionItemContainer>\n\n <Styled.AccordionAnswer\n ref={node => {\n refList[index] = node;\n }}\n >\n <Separator height={12} />\n {typeof item.accordionAnswer === 'string' ? (\n <Text\n $renderAs=\"ub2-bold\"\n $renderOnMobileAs=\"ub3-bold\"\n $color={isDarkTheme ? 'WHITE' : 'BLACK'}\n >\n {item.accordionAnswer}\n </Text>\n ) : (\n item.accordionAnswer\n )}\n </Styled.AccordionAnswer>\n </Styled.ContentContainer>\n </Styled.Container>\n );\n});\n\nexport default AccordionItem;\n"],"names":["AccordionItem","memo","props","item","index","theme","refList","iconRef","visible","handleToggle","device","useTheme","isMobile","EDeviceType","isDarkTheme","handleClick","useCallback","jsx","Styled.Container","jsxs","Styled.ContentContainer","Styled.AccordionItemContainer","Text","FlexView","Styled.StyledPlusIcon","node","Styled.AccordionAnswer","Separator"],"mappings":";;;;;;;;AAYM,MAAAA,IAAwCC,EAAK,CAASC,MAAA;AACpD,QAAA,EAAE,MAAAC,GAAM,OAAAC,GAAO,OAAAC,GAAO,SAAAC,GAAS,SAAAC,GAAS,SAAAC,GAAS,cAAAC,EAAiB,IAAAP,GAClE,EAAE,QAAAQ,MAAWC,KACbC,IAAWF,MAAWG,EAAY,QAClCC,IAAcT,MAAU,QAExBU,I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AOxB,EAAK,mBAAoB,WAC/B,gBAAAc;AAAA,oBAACK;AAAA,oBAAA;AAAA,sBACC,WAAU;AAAA,sBACV,mBAAkB;AAAA,sBAClB,QAAQR,IAAc,UAAU;AAAA,sBAE/B,UAAKX,EAAA;AAAA,oBAAA;AAAA,sBAGRA,EAAK;AAAA,gBAAA;AAAA,cAAA;AAAA,YAET;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -0,0 +1,62 @@
1
+ import { jsxs as k, jsx as f } from "react/jsx-runtime";
2
+ import { memo as C, useState as $, useMemo as b, useCallback as m, useEffect as x } from "react";
3
+ import H from "../layout/flex-view.js";
4
+ import R from "../separator/separator.js";
5
+ import V from "../text/text.js";
6
+ import w from "./accordion-items/accordion-items.js";
7
+ const y = C((S) => {
8
+ const { theme: p = "light", visibleBuffer: i, accordionData: c, defaultOpenElement: v = -1 } = S, [l, g] = $(i), [o, E] = $(v), r = b(() => [], []), s = b(() => [], []), T = p === "dark", A = m(() => {
9
+ g((e) => e < c.length ? c.length : i);
10
+ }, [c.length, i]), n = m((e, t) => {
11
+ e instanceof HTMLDivElement ? e.style.maxHeight = t ? `${e.scrollHeight}px` : "0px" : e instanceof SVGSVGElement && (e.style.transform = t ? "rotateZ(45deg)" : "rotateZ(0deg)");
12
+ }, []), D = m(
13
+ (e) => {
14
+ const t = r[e], h = s[e];
15
+ if (!t || !h) return;
16
+ const a = o === e, L = a ? -1 : e;
17
+ if (o !== -1 && o !== e) {
18
+ const u = r[o], d = s[o];
19
+ u && d && (n(u, !1), n(d, !1));
20
+ }
21
+ n(t, !a), n(h, !a), E(L);
22
+ },
23
+ [r, s, o, n]
24
+ );
25
+ return x(() => {
26
+ g(i);
27
+ }, [i]), x(() => {
28
+ o !== -1 && r[o] && s[o] && (n(r[o], !0), n(s[o], !0));
29
+ }, [l, o, r, s, n]), /* @__PURE__ */ k(H, { $flexDirection: "column", children: [
30
+ c.map((e, t) => /* @__PURE__ */ f(
31
+ w,
32
+ {
33
+ item: e,
34
+ index: t,
35
+ handleToggle: D,
36
+ refList: r,
37
+ iconRef: s,
38
+ visible: t < l,
39
+ theme: p
40
+ },
41
+ `${e.accordionQuestion}-${t}`
42
+ )),
43
+ /* @__PURE__ */ f(R, { height: 24 }),
44
+ /* @__PURE__ */ f(
45
+ V,
46
+ {
47
+ $renderAs: "ub3-bold",
48
+ $align: "center",
49
+ $textDecoration: "underline",
50
+ $marginBottom: 24,
51
+ onClick: A,
52
+ $color: T ? "WHITE" : "BLACK",
53
+ $cursor: "pointer",
54
+ children: l < c.length ? "See More" : "See Less"
55
+ }
56
+ )
57
+ ] });
58
+ }), Z = y;
59
+ export {
60
+ Z as default
61
+ };
62
+ //# sourceMappingURL=accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.js","sources":["../../../../src/features/ui/accordion/accordion.tsx"],"sourcesContent":["import type { AccordionProps } from './accordion-types';\n\nimport { useCallback, useEffect, useMemo, useState, memo } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport Separator from '../separator/separator';\nimport Text from '../text/text';\nimport AccordionItem from './accordion-items/accordion-items';\n\nconst Accordion = memo<AccordionProps>(props => {\n const { theme = 'light', visibleBuffer, accordionData, defaultOpenElement = -1 } = props;\n const [visible, setVisible] = useState(visibleBuffer);\n const [openIndex, setOpenIndex] = useState<number>(defaultOpenElement);\n const refList = useMemo<(HTMLDivElement | null)[]>(() => [], []);\n const iconRef = useMemo<(SVGSVGElement | null)[]>(() => [], []);\n const isDarkTheme = theme === 'dark';\n\n const handleShowToggle = useCallback(() => {\n setVisible(prev => (prev < accordionData.length ? accordionData.length : visibleBuffer));\n }, [accordionData.length, visibleBuffer]);\n\n const animateElement = useCallback((element: HTMLElement | SVGElement, isOpen: boolean) => {\n if (element instanceof HTMLDivElement) {\n element.style.maxHeight = isOpen ? `${element.scrollHeight}px` : '0px';\n } else if (element instanceof SVGSVGElement) {\n element.style.transform = isOpen ? 'rotateZ(45deg)' : 'rotateZ(0deg)';\n }\n }, []);\n\n const handleToggle = useCallback(\n (currentIndex: number) => {\n const currentRefList = refList[currentIndex];\n const currentIconRef = iconRef[currentIndex];\n\n if (!currentRefList || !currentIconRef) return;\n\n const isCurrentlyOpen = openIndex === currentIndex;\n const newOpenIndex = isCurrentlyOpen ? -1 : currentIndex;\n\n // Close previously open item\n if (openIndex !== -1 && openIndex !== currentIndex) {\n const prevRef = refList[openIndex];\n const prevIcon = iconRef[openIndex];\n\n if (prevRef && prevIcon) {\n animateElement(prevRef, false);\n animateElement(prevIcon, false);\n }\n }\n\n // Toggle current item\n animateElement(currentRefList, !isCurrentlyOpen);\n animateElement(currentIconRef, !isCurrentlyOpen);\n\n setOpenIndex(newOpenIndex);\n },\n [refList, iconRef, openIndex, animateElement],\n );\n\n useEffect(() => {\n setVisible(visibleBuffer);\n }, [visibleBuffer]);\n\n useEffect(() => {\n if (openIndex !== -1 && refList[openIndex] && iconRef[openIndex]) {\n animateElement(refList[openIndex]!, true);\n animateElement(iconRef[openIndex]!, true);\n }\n }, [visible, openIndex, refList, iconRef, animateElement]);\n\n return (\n <FlexView $flexDirection=\"column\">\n {accordionData.map((item, index) => (\n <AccordionItem\n key={`${item.accordionQuestion}-${index}`}\n item={item}\n index={index}\n handleToggle={handleToggle}\n refList={refList}\n iconRef={iconRef}\n visible={index < visible}\n theme={theme}\n />\n ))}\n <Separator height={24} />\n <Text\n $renderAs=\"ub3-bold\"\n $align=\"center\"\n $textDecoration=\"underline\"\n $marginBottom={24}\n onClick={handleShowToggle}\n $color={isDarkTheme ? 'WHITE' : 'BLACK'}\n $cursor=\"pointer\"\n >\n {visible < accordionData.length ? 'See More' : 'See Less'}\n </Text>\n </FlexView>\n );\n});\n\nexport default Accordion;\n"],"names":["Accordion","memo","props","theme","visibleBuffer","accordionData","defaultOpenElement","visible","setVisible","useState","openIndex","setOpenIndex","refList","useMemo","iconRef","isDarkTheme","handleShowToggle","useCallback","prev","animateElement","element","isOpen","handleToggle","currentIndex","currentRefList","currentIconRef","isCurrentlyOpen","newOpenIndex","prevRef","prevIcon","useEffect","jsxs","FlexView","item","index","jsx","AccordionItem","Separator","Text","Accordion$1"],"mappings":";;;;;;AASA,MAAMA,IAAYC,EAAqB,CAASC,MAAA;AAC9C,QAAM,EAAE,OAAAC,IAAQ,SAAS,eAAAC,GAAe,eAAAC,GAAe,oBAAAC,IAAqB,GAAO,IAAAJ,GAC7E,CAACK,GAASC,CAAU,IAAIC,EAASL,CAAa,GAC9C,CAACM,GAAWC,CAAY,IAAIF,EAAiBH,CAAkB,GAC/DM,IAAUC,EAAmC,MAAM,CAAC,GAAG,CAAE,CAAA,GACzDC,IAAUD,EAAkC,MAAM,CAAC,GAAG,CAAE,CAAA,GACxDE,IAAcZ,MAAU,QAExBa,IAAmBC,EAAY,MAAM;AACzC,IAAAT,EAAW,OAASU,IAAOb,EAAc,SAASA,EAAc,SAASD,CAAc;AAAA,EACtF,GAAA,CAACC,EAAc,QAAQD,CAAa,CAAC,GAElCe,IAAiBF,EAAY,CAACG,GAAmCC,MAAoB;AACzF,IAAID,aAAmB,iBACrBA,EAAQ,MAAM,YAAYC,IAAS,GAAGD,EAAQ,YAAY,OAAO,QACxDA,aAAmB,kBACpBA,EAAA,MAAM,YAAYC,IAAS,mBAAmB;AAAA,EAE1D,GAAG,CAAE,CAAA,GAECC,IAAeL;AAAA,IACnB,CAACM,MAAyB;AAClB,YAAAC,IAAiBZ,EAAQW,CAAY,GACrCE,IAAiBX,EAAQS,CAAY;AAEvC,UAAA,CAACC,KAAkB,CAACC,EAAgB;AAExC,YAAMC,IAAkBhB,MAAca,GAChCI,IAAeD,IAAkB,KAAKH;AAGxC,UAAAb,MAAc,MAAMA,MAAca,GAAc;AAC5C,cAAAK,IAAUhB,EAAQF,CAAS,GAC3BmB,IAAWf,EAAQJ,CAAS;AAElC,QAAIkB,KAAWC,MACbV,EAAeS,GAAS,EAAK,GAC7BT,EAAeU,GAAU,EAAK;AA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from "styled-components";
2
+ const a = n.div`
3
+ margin-left: ${({ theme: t }) => t.layout.gutter}px;
4
+ overflow: hidden;
5
+ margin: ${({ $wrapperMargin: t }) => t};
6
+ `, o = n.div`
7
+ display: flex;
8
+ transition: transform 1s ease;
9
+ transform: ${({ $position: t }) => `translateX(calc(${t} * (-100%)))`};
10
+ `, s = n.div`
11
+ padding-right: ${({ theme: t }) => t.layout.gutter}px;
12
+ display: flex;
13
+ flex: 1 0 100%;
14
+ transition: opacity 1s ease;
15
+ padding: ${({ $carouselSlotPadding: t }) => t};
16
+ ${({ $slideAlign: t }) => t === "center" && `
17
+ display:flex;
18
+ justify-content: center;
19
+ `}
20
+ `, l = n.div`
21
+ margin-top: 12px;
22
+ text-align: center;
23
+ ${({ $flexCenterIndicators: t }) => t && `
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ `}
28
+ `, d = n.span`
29
+ background: ${({ $isCurrent: t, $dotColor: e, $inactiveDotColor: i }) => t ? e : i};
30
+ width: ${({ $isCurrent: t, $activeIndicatorSize: e }) => t ? e : "8px"};
31
+ height: ${({ $isCurrent: t, $activeIndicatorSize: e }) => t ? e : "8px"};
32
+ border-radius: 50%;
33
+ margin-right: 5px;
34
+ display: inline-block;
35
+ transition: background 0.5s ease;
36
+ cursor: pointer;
37
+ `;
38
+ export {
39
+ o as CarouselContainer,
40
+ s as CarouselSlot,
41
+ l as Container,
42
+ d as Dot,
43
+ a as Wrapper
44
+ };
45
+ //# sourceMappingURL=carousal-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousal-styles.js","sources":["../../../../src/features/ui/carousal/carousal-styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\ninterface WrapperProps {\n $wrapperMargin?: string;\n}\n\nexport const Wrapper = styled.div<WrapperProps>`\n margin-left: ${({ theme }) => theme.layout.gutter}px;\n overflow: hidden;\n margin: ${({ $wrapperMargin }) => $wrapperMargin};\n`;\n\ninterface CarouselContainerProps {\n $position: number;\n}\nexport const CarouselContainer = styled.div<CarouselContainerProps>`\n display: flex;\n transition: transform 1s ease;\n transform: ${({ $position }) => `translateX(calc(${$position} * (-100%)))`};\n`;\n\ninterface CarouselSlotProps {\n $carouselSlotPadding?: string;\n $slideAlign?: string | null;\n}\nexport const CarouselSlot = styled.div<CarouselSlotProps>`\n padding-right: ${({ theme }) => theme.layout.gutter}px;\n display: flex;\n flex: 1 0 100%;\n transition: opacity 1s ease;\n padding: ${({ $carouselSlotPadding }) => $carouselSlotPadding};\n ${({ $slideAlign }) =>\n $slideAlign === 'center' &&\n `\n display:flex;\n justify-content: center;\n `}\n`;\n\ninterface ContainerProps {\n $flexCenterIndicators?: boolean;\n}\nexport const Container = styled.div<ContainerProps>`\n margin-top: 12px;\n text-align: center;\n ${({ $flexCenterIndicators }) =>\n $flexCenterIndicators &&\n `\n display: flex;\n justify-content: center;\n align-items: center;\n `}\n`;\n\ninterface DotProps {\n $isCurrent: boolean;\n $dotColor: string;\n $inactiveDotColor: string;\n $activeIndicatorSize: string;\n}\nexport const Dot = styled.span<DotProps>`\n background: ${({ $isCurrent, $dotColor, $inactiveDotColor }) =>\n $isCurrent ? $dotColor : $inactiveDotColor};\n width: ${({ $isCurrent, $activeIndicatorSize }) => ($isCurrent ? $activeIndicatorSize : '8px')};\n height: ${({ $isCurrent, $activeIndicatorSize }) => ($isCurrent ? $activeIndicatorSize : '8px')};\n border-radius: 50%;\n margin-right: 5px;\n display: inline-block;\n transition: background 0.5s ease;\n cursor: pointer;\n`;\n"],"names":["Wrapper","styled","theme","$wrapperMargin","CarouselContainer","$position","CarouselSlot","$carouselSlotPadding","$slideAlign","Container","$flexCenterIndicators","Dot","$isCurrent","$dotColor","$inactiveDotColor","$activeIndicatorSize"],"mappings":";AAMO,MAAMA,IAAUC,EAAO;AAAA,iBACb,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,MAAM;AAAA;AAAA,YAEvC,CAAC,EAAE,gBAAAC,EAAe,MAAMA,CAAc;AAAA,GAMrCC,IAAoBH,EAAO;AAAA;AAAA;AAAA,eAGzB,CAAC,EAAE,WAAAI,EAAgB,MAAA,mBAAmBA,CAAS,cAAc;AAAA,GAO/DC,IAAeL,EAAO;AAAA,mBAChB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA,aAIxC,CAAC,EAAE,sBAAAK,EAAqB,MAAMA,CAAoB;AAAA,IAC3D,CAAC,EAAE,aAAAC,EAAY,MACfA,MAAgB,YAChB;AAAA;AAAA;AAAA,GAGD;AAAA,GAMUC,IAAYR,EAAO;AAAA;AAAA;AAAA,IAG5B,CAAC,EAAE,uBAAAS,QACHA,KACA;AAAA;AAAA;AAAA;AAAA,GAID;AAAA,GASUC,IAAMV,EAAO;AAAA,gBACV,CAAC,EAAE,YAAAW,GAAY,WAAAC,GAAW,mBAAAC,QACtCF,IAAaC,IAAYC,CAAiB;AAAA,WACnC,CAAC,EAAE,YAAAF,GAAY,sBAAAG,EAA4B,MAAAH,IAAaG,IAAuB,KAAM;AAAA,YACpF,CAAC,EAAE,YAAAH,GAAY,sBAAAG,EAA4B,MAAAH,IAAaG,IAAuB,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -0,0 +1,76 @@
1
+ import { jsxs as q, Fragment as G, jsx as u } from "react/jsx-runtime";
2
+ import { useState as H, useRef as J, useCallback as o, useEffect as L } from "react";
3
+ import { getTheme as N } from "../theme/get-theme.js";
4
+ import { Wrapper as Q, CarouselContainer as U, CarouselSlot as _, Container as V, Dot as X } from "./carousal-styles.js";
5
+ const { colors: j } = N(), Y = ({
6
+ children: l,
7
+ initialPosition: B = 0,
8
+ infinite: p = !1,
9
+ slideDuration: $ = 8e3,
10
+ dotColor: K = j.BLACK,
11
+ changeColor: m = () => null,
12
+ slideAlign: y = null,
13
+ inactiveDotColor: b = j.BLACK_T_15,
14
+ activeIndicatorSize: z = "8px",
15
+ flexCenterIndicators: D = !1,
16
+ isTestimonial: i = !1,
17
+ setColor: n = () => null,
18
+ setPosition: g = () => null,
19
+ carouselSlotPadding: x = "",
20
+ wrapperMargin: E = "",
21
+ hideIndicators: F = !1,
22
+ autoScroll: C = !0,
23
+ nodeRef: e = null,
24
+ onChange: S = () => null
25
+ }) => {
26
+ const [r, M] = H(B), A = J(null), f = o(
27
+ (t) => {
28
+ M(t), g(t), e && e.current && (e.current.position = t), S();
29
+ },
30
+ [g, e, S]
31
+ ), s = o(
32
+ (t, c = !1) => {
33
+ const k = (Array.isArray(l) ? l : [l]).length;
34
+ let a = r;
35
+ i && n && n(a), t === "next" ? (a = r + 1, a > k - 1 && (a = c ? 0 : r)) : (a = r - 1, a < 0 && (a = c ? k - 1 : r)), a !== r && f(a);
36
+ },
37
+ [r, l, i, n, f]
38
+ ), v = o(() => s("next", p), [s, p]), I = o(() => s("prev", p), [s, p]), W = o(
39
+ (t) => {
40
+ i && n && n(r), t !== r && f(t);
41
+ },
42
+ [r, i, n, f]
43
+ );
44
+ L(() => (e && e.current && (e.current.next = v, e.current.prev = I, e.current.position = r), C && (A.current = setInterval(() => s("next", !0), $)), () => {
45
+ A.current && clearInterval(A.current);
46
+ }), [$, C, e, r, v, I, s]), L(() => {
47
+ m(r);
48
+ }, [r, m]);
49
+ const h = Array.isArray(l) ? l.length : 1;
50
+ return /* @__PURE__ */ q(G, { children: [
51
+ /* @__PURE__ */ u(Q, { $wrapperMargin: E, children: /* @__PURE__ */ u(U, { $position: r, children: Array.isArray(l) ? l.map((t, c) => /* @__PURE__ */ u(
52
+ _,
53
+ {
54
+ $carouselSlotPadding: x,
55
+ $slideAlign: y,
56
+ children: t
57
+ },
58
+ c
59
+ )) : /* @__PURE__ */ u(_, { $carouselSlotPadding: x, $slideAlign: y, children: l }) }) }),
60
+ h > 1 && !F && /* @__PURE__ */ u(V, { $flexCenterIndicators: D, children: Array.from({ length: h }, (t, c) => /* @__PURE__ */ u(
61
+ X,
62
+ {
63
+ onClick: () => W(c),
64
+ $isCurrent: c === r,
65
+ $dotColor: K,
66
+ $inactiveDotColor: b,
67
+ $activeIndicatorSize: z
68
+ },
69
+ c
70
+ )) })
71
+ ] });
72
+ }, T = Y;
73
+ export {
74
+ T as default
75
+ };
76
+ //# sourceMappingURL=carousal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousal.js","sources":["../../../../src/features/ui/carousal/carousal.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, useCallback } from 'react';\n\nimport { getTheme } from '../theme/get-theme';\nimport { CarouselContainer, CarouselSlot, Container, Dot, Wrapper } from './carousal-styles';\n\nconst { colors } = getTheme();\n\ninterface CarouselProps {\n children: React.ReactNode[] | React.ReactNode;\n initialPosition?: number;\n infinite?: boolean;\n slideDuration?: number;\n dotColor?: string;\n changeColor?: (position: number) => void;\n slideAlign?: string | null;\n inactiveDotColor?: string;\n activeIndicatorSize?: string;\n flexCenterIndicators?: boolean;\n isTestimonial?: boolean;\n setColor?: (position: number) => void;\n setPosition?: (position: number) => void;\n carouselSlotPadding?: string;\n wrapperMargin?: string;\n hideIndicators?: boolean;\n autoScroll?: boolean;\n nodeRef?: { current?: { next?: () => void; prev?: () => void; position?: number } } | null;\n onChange?: () => void;\n}\n\nconst Carousel: React.FC<CarouselProps> = ({\n children,\n initialPosition = 0,\n infinite = false,\n slideDuration = 8000,\n dotColor = colors.BLACK,\n changeColor = () => null,\n slideAlign = null,\n inactiveDotColor = colors.BLACK_T_15,\n activeIndicatorSize = '8px',\n flexCenterIndicators = false,\n isTestimonial = false,\n setColor = () => null,\n setPosition = () => null,\n carouselSlotPadding = '',\n wrapperMargin = '',\n hideIndicators = false,\n autoScroll = true,\n nodeRef = null,\n onChange = () => null,\n}) => {\n const [position, setPositionState] = useState(initialPosition);\n const autoSlideRef = useRef<NodeJS.Timeout | null>(null);\n\n const slide = useCallback(\n (newPosition: number) => {\n setPositionState(newPosition);\n setPosition(newPosition);\n if (nodeRef && nodeRef.current) {\n nodeRef.current.position = newPosition;\n }\n onChange();\n },\n [setPosition, nodeRef, onChange],\n );\n\n const changeSlide = useCallback(\n (action: 'next' | 'prev', infiniteOverride = false) => {\n const childrenArray = Array.isArray(children) ? children : [children];\n const numItems = childrenArray.length;\n let newPosition = position;\n\n if (isTestimonial && setColor) {\n setColor(newPosition);\n }\n\n if (action === 'next') {\n newPosition = position + 1;\n if (newPosition > numItems - 1) {\n newPosition = infiniteOverride ? 0 : position;\n }\n } else {\n newPosition = position - 1;\n if (newPosition < 0) {\n newPosition = infiniteOverride ? numItems - 1 : position;\n }\n }\n\n if (newPosition !== position) slide(newPosition);\n },\n [position, children, isTestimonial, setColor, slide],\n );\n\n const nextSlide = useCallback(() => changeSlide('next', infinite), [changeSlide, infinite]);\n const prevSlide = useCallback(() => changeSlide('prev', infinite), [changeSlide, infinite]);\n\n const onIndicatorClick = useCallback(\n (newPosition: number) => {\n if (isTestimonial && setColor) {\n setColor(position);\n }\n\n if (newPosition !== position) {\n slide(newPosition);\n }\n },\n [position, isTestimonial, setColor, slide],\n );\n\n useEffect(() => {\n if (nodeRef && nodeRef.current) {\n nodeRef.current.next = nextSlide;\n nodeRef.current.prev = prevSlide;\n nodeRef.current.position = position;\n }\n\n if (autoScroll) {\n autoSlideRef.current = setInterval(() => changeSlide('next', true), slideDuration);\n }\n\n return () => {\n if (autoSlideRef.current) {\n clearInterval(autoSlideRef.current);\n }\n };\n }, [slideDuration, autoScroll, nodeRef, position, nextSlide, prevSlide, changeSlide]);\n\n useEffect(() => {\n changeColor(position);\n }, [position, changeColor]);\n\n const carouselLength = Array.isArray(children) ? children.length : 1;\n\n return (\n <>\n <Wrapper $wrapperMargin={wrapperMargin}>\n <CarouselContainer $position={position}>\n {Array.isArray(children) ? (\n children.map((child, index) => (\n <CarouselSlot\n key={index}\n $carouselSlotPadding={carouselSlotPadding}\n $slideAlign={slideAlign}\n >\n {child}\n </CarouselSlot>\n ))\n ) : (\n <CarouselSlot $carouselSlotPadding={carouselSlotPadding} $slideAlign={slideAlign}>\n {children}\n </CarouselSlot>\n )}\n </CarouselContainer>\n </Wrapper>\n {carouselLength > 1 && !hideIndicators && (\n <Container $flexCenterIndicators={flexCenterIndicators}>\n {Array.from({ length: carouselLength }, (_, index) => (\n <Dot\n key={index}\n onClick={() => onIndicatorClick(index)}\n $isCurrent={index === position}\n $dotColor={dotColor}\n $inactiveDotColor={inactiveDotColor}\n $activeIndicatorSize={activeIndicatorSize}\n />\n ))}\n </Container>\n )}\n </>\n );\n};\n\nexport default Carousel;\n"],"names":["colors","getTheme","Carousel","children","initialPosition","infinite","slideDuration","dotColor","changeColor","slideAlign","inactiveDotColor","activeIndicatorSize","flexCenterIndicators","isTestimonial","setColor","setPosition","carouselSlotPadding","wrapperMargin","hideIndicators","autoScroll","nodeRef","onChange","position","setPositionState","useState","autoSlideRef","useRef","slide","useCallback","newPosition","changeSlide","action","infiniteOverride","numItems","nextSlide","prevSlide","onIndicatorClick","useEffect","carouselLength","jsxs","Fragment","jsx","Wrapper","CarouselContainer","child","index","CarouselSlot","Container","_","Dot","Carousel$1"],"mappings":";;;;AAKA,MAAM,EAAE,QAAAA,EAAO,IAAIC,KAwBbC,IAAoC,CAAC;AAAA,EACzC,UAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,UAAAC,IAAW;AAAA,EACX,eAAAC,IAAgB;AAAA,EAChB,UAAAC,IAAWP,EAAO;AAAA,EAClB,aAAAQ,IAAc,MAAM;AAAA,EACpB,YAAAC,IAAa;AAAA,EACb,kBAAAC,IAAmBV,EAAO;AAAA,EAC1B,qBAAAW,IAAsB;AAAA,EACtB,sBAAAC,IAAuB;AAAA,EACvB,eAAAC,IAAgB;AAAA,EAChB,UAAAC,IAAW,MAAM;AAAA,EACjB,aAAAC,IAAc,MAAM;AAAA,EACpB,qBAAAC,IAAsB;AAAA,EACtB,eAAAC,IAAgB;AAAA,EAChB,gBAAAC,IAAiB;AAAA,EACjB,YAAAC,IAAa;AAAA,EACb,SAAAC,IAAU;AAAA,EACV,UA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