@cuemath/leap 3.1.21 → 3.1.22-beta-0.2
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.
@@ -1,28 +1,29 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
2
2
|
import { memo as f, useCallback as h } from "react";
|
3
3
|
import $ from "styled-components";
|
4
|
-
import { ILLUSTRATIONS as
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import {
|
11
|
-
import
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
4
|
+
import { ILLUSTRATIONS as b } from "../../../../../assets/illustrations/illustrations.js";
|
5
|
+
import u from "../../../../hooks/use-lazy-ref.js";
|
6
|
+
import w from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
7
|
+
import A from "../../../../ui/buttons/button/button.js";
|
8
|
+
import g from "../../../../ui/image/image.js";
|
9
|
+
import d from "../../../../ui/layout/flex-view.js";
|
10
|
+
import { getNoMilestoneTitle as x } from "../../../create/utils/index.js";
|
11
|
+
import { StyledText as y } from "./no-active-milestone-styled.js";
|
12
|
+
import T from "../../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
13
|
+
const I = $.span`
|
14
|
+
display: ${({ shouldShow: o }) => o ? "block" : "none"};
|
15
|
+
`, W = f(
|
16
|
+
({ userType: o, studentName: s, isDraftMilestonePresent: r, ...m }) => {
|
17
|
+
const { canCreatePlan: i, onCreatePlan: t, isFiltersAdded: l } = m, n = u(T), p = h(() => {
|
18
|
+
t == null || t(n);
|
19
|
+
}, [t, n]), c = x(
|
19
20
|
l,
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
r,
|
22
|
+
s,
|
23
|
+
o
|
23
24
|
);
|
24
|
-
return /* @__PURE__ */
|
25
|
-
|
25
|
+
return /* @__PURE__ */ a(
|
26
|
+
d,
|
26
27
|
{
|
27
28
|
$flexDirection: "row",
|
28
29
|
$gapX: 1.5,
|
@@ -33,26 +34,35 @@ const T = $.span`
|
|
33
34
|
$justifyContent: "space-between",
|
34
35
|
$alignItems: "center",
|
35
36
|
children: [
|
36
|
-
/* @__PURE__ */
|
37
|
-
/* @__PURE__ */
|
38
|
-
|
39
|
-
|
37
|
+
/* @__PURE__ */ a(d, { $flexGapX: 1, children: [
|
38
|
+
/* @__PURE__ */ e(y, { $renderAs: "ab2", $widthX: 19.5, children: c }),
|
39
|
+
o === "TEACHER" && /* @__PURE__ */ e(I, { shouldShow: !l, children: !r && /* @__PURE__ */ e(
|
40
|
+
w,
|
40
41
|
{
|
41
|
-
renderAs: "
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
renderAs: "primary",
|
43
|
+
tooltipItem: "Goals can only be added for students who have joined the class",
|
44
|
+
hidden: i,
|
45
|
+
position: "bottom",
|
46
|
+
children: /* @__PURE__ */ e(
|
47
|
+
A,
|
48
|
+
{
|
49
|
+
renderAs: "secondary",
|
50
|
+
size: "small",
|
51
|
+
label: "Add a Goal",
|
52
|
+
onClick: p,
|
53
|
+
disabled: !i
|
54
|
+
}
|
55
|
+
)
|
46
56
|
}
|
47
57
|
) })
|
48
58
|
] }),
|
49
|
-
/* @__PURE__ */
|
50
|
-
|
59
|
+
/* @__PURE__ */ e(
|
60
|
+
g,
|
51
61
|
{
|
52
62
|
withLoader: !1,
|
53
63
|
width: 240,
|
54
64
|
height: 100,
|
55
|
-
src:
|
65
|
+
src: b.PUZZLE_STUDENT,
|
56
66
|
alt: "learning-planner"
|
57
67
|
}
|
58
68
|
)
|
@@ -62,6 +72,6 @@ const T = $.span`
|
|
62
72
|
}
|
63
73
|
);
|
64
74
|
export {
|
65
|
-
|
75
|
+
W as default
|
66
76
|
};
|
67
77
|
//# sourceMappingURL=no-active-milestone.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"no-active-milestone.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.tsx"],"sourcesContent":["import type { INoActiveMilestoneProps } from './no-active-milestone-types';\n\nimport { useCallback, type FC, memo } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport useLazyRef from '../../../../hooks/use-lazy-ref';\nimport Button from '../../../../ui/buttons/button/button';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { getNoMilestoneTitle } from '../../../create/utils';\nimport * as Styled from './no-active-milestone-styled';\n\nconst ButtonWrapper = styled.span<{ shouldShow: boolean }>`\n display: ${({ shouldShow }) => (shouldShow ? 'block' : 'none')};\n`;\n\nconst NoActiveMilestone: FC<INoActiveMilestoneProps> = memo(\n ({ userType, studentName, isDraftMilestonePresent, ...restNoActiveMilestoneProps }) => {\n const { canCreatePlan, onCreatePlan, isFiltersAdded } = restNoActiveMilestoneProps;\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const title = getNoMilestoneTitle(\n isFiltersAdded,\n isDraftMilestonePresent,\n studentName,\n userType,\n );\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $gapX={1.5}\n $gutterX={1.5}\n $borderColor=\"WHITE_4\"\n $background=\"YELLOW_1\"\n $flexGapX={1}\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <FlexView $flexGapX={1}>\n <Styled.StyledText $renderAs=\"ab2\" $widthX={19.5}>\n {title}\n </Styled.StyledText>\n\n {userType === 'TEACHER' && (\n <ButtonWrapper shouldShow={!isFiltersAdded}>\n {!isDraftMilestonePresent && (\n <
|
1
|
+
{"version":3,"file":"no-active-milestone.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.tsx"],"sourcesContent":["import type { INoActiveMilestoneProps } from './no-active-milestone-types';\n\nimport { useCallback, type FC, memo } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport useLazyRef from '../../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../../ui/buttons/button/button';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { getNoMilestoneTitle } from '../../../create/utils';\nimport * as Styled from './no-active-milestone-styled';\n\nconst ButtonWrapper = styled.span<{ shouldShow: boolean }>`\n display: ${({ shouldShow }) => (shouldShow ? 'block' : 'none')};\n`;\n\nconst NoActiveMilestone: FC<INoActiveMilestoneProps> = memo(\n ({ userType, studentName, isDraftMilestonePresent, ...restNoActiveMilestoneProps }) => {\n const { canCreatePlan, onCreatePlan, isFiltersAdded } = restNoActiveMilestoneProps;\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const title = getNoMilestoneTitle(\n isFiltersAdded,\n isDraftMilestonePresent,\n studentName,\n userType,\n );\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $gapX={1.5}\n $gutterX={1.5}\n $borderColor=\"WHITE_4\"\n $background=\"YELLOW_1\"\n $flexGapX={1}\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <FlexView $flexGapX={1}>\n <Styled.StyledText $renderAs=\"ab2\" $widthX={19.5}>\n {title}\n </Styled.StyledText>\n\n {userType === 'TEACHER' && (\n <ButtonWrapper shouldShow={!isFiltersAdded}>\n {!isDraftMilestonePresent && (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <Button\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Add a Goal\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n )}\n </ButtonWrapper>\n )}\n </FlexView>\n\n <Image\n withLoader={false}\n width={240}\n height={100}\n src={ILLUSTRATIONS.PUZZLE_STUDENT}\n alt=\"learning-planner\"\n />\n </FlexView>\n );\n },\n);\n\nexport default NoActiveMilestone;\n"],"names":["ButtonWrapper","styled","shouldShow","NoActiveMilestone","memo","userType","studentName","isDraftMilestonePresent","restNoActiveMilestoneProps","canCreatePlan","onCreatePlan","isFiltersAdded","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","title","getNoMilestoneTitle","jsxs","FlexView","jsx","Styled.StyledText","ArrowTooltip","Button","Image","ILLUSTRATIONS"],"mappings":";;;;;;;;;;;;AAeA,MAAMA,IAAgBC,EAAO;AAAA,aAChB,CAAC,EAAE,YAAAC,EAAA,MAAkBA,IAAa,UAAU,MAAO;AAAA,GAG1DC,IAAiDC;AAAA,EACrD,CAAC,EAAE,UAAAC,GAAU,aAAAC,GAAa,yBAAAC,GAAyB,GAAGC,QAAiC;AACrF,UAAM,EAAE,eAAAC,GAAe,cAAAC,GAAc,gBAAAC,EAAA,IAAmBH,GAClDI,IAAuBC,EAAWC,CAAM,GAExCC,IAAmBC,EAAY,MAAM;AACzC,MAAAN,KAAA,QAAAA,EAAeE;AAAA,IAAoB,GAClC,CAACF,GAAcE,CAAoB,CAAC,GAEjCK,IAAQC;AAAA,MACZP;AAAA,MACAJ;AAAA,MACAD;AAAA,MACAD;AAAA,IAAA;AAIA,WAAA,gBAAAc;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,OAAO;AAAA,QACP,UAAU;AAAA,QACV,cAAa;AAAA,QACb,aAAY;AAAA,QACZ,WAAW;AAAA,QACX,iBAAgB;AAAA,QAChB,aAAY;AAAA,QAEZ,UAAA;AAAA,UAAC,gBAAAD,EAAAC,GAAA,EAAS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