@codecademy/brand 1.19.0-alpha.c43bcf7814.0 → 1.19.0-alpha.c7c595cbc4.0
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.
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +0 -0
- package/dist/LearningOutcomePopover/index.js +80 -94
- package/dist/LearningOutcomeTile/Tile.js +10 -7
- package/dist/LearningOutcomeTile/index.js +6 -6
- package/dist/stories/Molecules/LearningOutcomeLowAssessmentBadge.stories.d.ts +6 -0
- package/dist/stories/Molecules/LearningOutcomeLowAssessmentBadge.stories.js +10 -0
- package/dist/stories/Molecules/LearningOutcomePopover.stories.d.ts +5 -0
- package/dist/stories/Molecules/LearningOutcomePopover.stories.js +40 -0
- package/package.json +1 -1
|
File without changes
|
|
@@ -1,94 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlexBox, Popover, Text } from '@codecademy/gamut';
|
|
2
2
|
import { SmallCheckIcon } from '@codecademy/gamut-icons';
|
|
3
3
|
import { LearningOutcomeLevelBadge, LearningOutcomeLowAssessmentBadge } from '../LearningOutcomeBadges';
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
const POPOVER_WIDTH = 332;
|
|
6
|
+
const POPOVER_HORIZONTAL_PADDING = 16;
|
|
7
|
+
const ASSESSMENT_WIDTH = (POPOVER_WIDTH - POPOVER_HORIZONTAL_PADDING * 2) / 2;
|
|
5
8
|
const Assessment = ({
|
|
6
9
|
score,
|
|
7
|
-
type
|
|
10
|
+
type,
|
|
11
|
+
noBorderLeft
|
|
8
12
|
}) => /*#__PURE__*/_jsxs(FlexBox, {
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
borderTop: 1,
|
|
14
|
+
borderBottom: 1,
|
|
15
|
+
borderRight: 1,
|
|
16
|
+
borderLeft: !noBorderLeft ? 1 : undefined,
|
|
17
|
+
borderColor: "background-hover",
|
|
18
|
+
p: 8,
|
|
11
19
|
gap: 4,
|
|
12
|
-
|
|
13
|
-
column: true,
|
|
20
|
+
width: ASSESSMENT_WIDTH,
|
|
14
21
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
15
22
|
variant: "p-small",
|
|
16
23
|
color: "text-secondary",
|
|
17
|
-
children: type === 'highest' ? '
|
|
18
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
24
|
+
children: type === 'highest' ? 'Highest score:' : 'Most recent:'
|
|
25
|
+
}), score != null ? /*#__PURE__*/_jsx(Text, {
|
|
19
26
|
variant: "p-small",
|
|
20
27
|
color: score && score >= 70 ? 'green-700' : 'text',
|
|
21
28
|
fontWeight: 700,
|
|
22
|
-
children:
|
|
29
|
+
children: `${score}%`
|
|
30
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
31
|
+
variant: "p-small",
|
|
32
|
+
color: "text-disabled",
|
|
33
|
+
children: "-"
|
|
23
34
|
})]
|
|
24
35
|
});
|
|
25
|
-
const ProgressAndAssessment = ({
|
|
26
|
-
highestScore,
|
|
27
|
-
latestScore,
|
|
28
|
-
percentComplete
|
|
29
|
-
}) => {
|
|
30
|
-
const renderProgress = () => {
|
|
31
|
-
if (!percentComplete) {
|
|
32
|
-
return /*#__PURE__*/_jsx(Text, {
|
|
33
|
-
color: "text-secondary",
|
|
34
|
-
variant: "p-small",
|
|
35
|
-
children: "Not started yet"
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
if (percentComplete < 100) {
|
|
39
|
-
return /*#__PURE__*/_jsx(Text, {
|
|
40
|
-
color: "text",
|
|
41
|
-
variant: "p-small",
|
|
42
|
-
children: `${percentComplete}% complete`
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return /*#__PURE__*/_jsxs(FlexBox, {
|
|
46
|
-
children: [/*#__PURE__*/_jsx(FlexBox, {
|
|
47
|
-
width: 16,
|
|
48
|
-
height: 16,
|
|
49
|
-
borderRadius: "md",
|
|
50
|
-
bg: "primary",
|
|
51
|
-
mr: 4,
|
|
52
|
-
alignItems: "center",
|
|
53
|
-
justifyContent: "center",
|
|
54
|
-
children: /*#__PURE__*/_jsx(SmallCheckIcon, {
|
|
55
|
-
size: 11,
|
|
56
|
-
color: "white"
|
|
57
|
-
})
|
|
58
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
59
|
-
color: "text",
|
|
60
|
-
variant: "p-small",
|
|
61
|
-
children: "Completed"
|
|
62
|
-
})]
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
const renderAssessment = () => /*#__PURE__*/_jsxs(FlexBox, {
|
|
66
|
-
alignItems: "center",
|
|
67
|
-
children: [/*#__PURE__*/_jsx(Assessment, {
|
|
68
|
-
score: highestScore,
|
|
69
|
-
type: "highest"
|
|
70
|
-
}), /*#__PURE__*/_jsx(Box, {
|
|
71
|
-
width: 1,
|
|
72
|
-
height: 24,
|
|
73
|
-
borderRight: 1,
|
|
74
|
-
borderColor: "background-hover",
|
|
75
|
-
mx: 4
|
|
76
|
-
}), /*#__PURE__*/_jsx(Assessment, {
|
|
77
|
-
score: latestScore,
|
|
78
|
-
type: "latest"
|
|
79
|
-
})]
|
|
80
|
-
});
|
|
81
|
-
return /*#__PURE__*/_jsxs(FlexBox, {
|
|
82
|
-
borderTop: 1,
|
|
83
|
-
borderColor: "background-hover",
|
|
84
|
-
alignItems: "center",
|
|
85
|
-
justifyContent: "space-between",
|
|
86
|
-
gap: 8,
|
|
87
|
-
py: 4,
|
|
88
|
-
pl: 4,
|
|
89
|
-
children: [renderProgress(), renderAssessment()]
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
36
|
export const LearningOutcomePopover = ({
|
|
93
37
|
activeElRef,
|
|
94
38
|
isOpen,
|
|
@@ -101,9 +45,28 @@ export const LearningOutcomePopover = ({
|
|
|
101
45
|
outcome,
|
|
102
46
|
latestScore,
|
|
103
47
|
highestScore,
|
|
104
|
-
percentComplete
|
|
48
|
+
percentComplete = 0
|
|
105
49
|
} = learningOutcomeDetails || {};
|
|
106
50
|
const lowLatestAssessment = Boolean(latestScore != null && latestScore < 70);
|
|
51
|
+
const renderProgress = () => /*#__PURE__*/_jsxs(FlexBox, {
|
|
52
|
+
children: [Boolean(percentComplete === 100) && /*#__PURE__*/_jsx(FlexBox, {
|
|
53
|
+
width: 16,
|
|
54
|
+
height: 16,
|
|
55
|
+
borderRadius: "md",
|
|
56
|
+
bg: "primary",
|
|
57
|
+
mr: 4,
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
justifyContent: "center",
|
|
60
|
+
children: /*#__PURE__*/_jsx(SmallCheckIcon, {
|
|
61
|
+
size: 11,
|
|
62
|
+
color: "white"
|
|
63
|
+
})
|
|
64
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
65
|
+
color: "text",
|
|
66
|
+
variant: "p-small",
|
|
67
|
+
children: `${percentComplete}% progress`
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
107
70
|
return /*#__PURE__*/_jsx(Popover, {
|
|
108
71
|
...rest,
|
|
109
72
|
isOpen: isOpen,
|
|
@@ -113,26 +76,49 @@ export const LearningOutcomePopover = ({
|
|
|
113
76
|
beak: "center",
|
|
114
77
|
outline: true,
|
|
115
78
|
children: /*#__PURE__*/_jsxs(FlexBox, {
|
|
79
|
+
width: POPOVER_WIDTH,
|
|
116
80
|
pt: 24,
|
|
117
|
-
|
|
118
|
-
|
|
81
|
+
pb: 4,
|
|
82
|
+
px: POPOVER_HORIZONTAL_PADDING,
|
|
83
|
+
gap: 24,
|
|
119
84
|
column: true,
|
|
120
85
|
children: [/*#__PURE__*/_jsxs(FlexBox, {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
86
|
+
gap: 16,
|
|
87
|
+
column: true,
|
|
88
|
+
children: [/*#__PURE__*/_jsxs(FlexBox, {
|
|
89
|
+
justifyContent: "space-between",
|
|
90
|
+
children: [!!level && /*#__PURE__*/_jsx(LearningOutcomeLevelBadge, {
|
|
91
|
+
level: level
|
|
92
|
+
}), lowLatestAssessment && /*#__PURE__*/_jsx(LearningOutcomeLowAssessmentBadge, {})]
|
|
93
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
94
|
+
color: "text",
|
|
95
|
+
textAlign: "left",
|
|
96
|
+
variant: "title-xs",
|
|
97
|
+
whiteSpace: "break-spaces",
|
|
98
|
+
children: outcome
|
|
99
|
+
}), renderProgress()]
|
|
100
|
+
}), /*#__PURE__*/_jsxs(FlexBox, {
|
|
101
|
+
alignItems: "flex-start",
|
|
102
|
+
gap: 4,
|
|
103
|
+
pt: 16,
|
|
104
|
+
pb: 12,
|
|
105
|
+
borderTop: 1,
|
|
106
|
+
borderColor: "background-hover",
|
|
107
|
+
column: true,
|
|
108
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
109
|
+
variant: "p-small",
|
|
110
|
+
fontWeight: 700,
|
|
111
|
+
children: "Evaluation results"
|
|
112
|
+
}), /*#__PURE__*/_jsxs(FlexBox, {
|
|
113
|
+
children: [/*#__PURE__*/_jsx(Assessment, {
|
|
114
|
+
score: highestScore,
|
|
115
|
+
type: "highest"
|
|
116
|
+
}), /*#__PURE__*/_jsx(Assessment, {
|
|
117
|
+
score: latestScore,
|
|
118
|
+
type: "latest",
|
|
119
|
+
noBorderLeft: true
|
|
120
|
+
})]
|
|
121
|
+
})]
|
|
136
122
|
})]
|
|
137
123
|
})
|
|
138
124
|
});
|
|
@@ -6,7 +6,6 @@ const tileStyles = {
|
|
|
6
6
|
alignItems: 'center',
|
|
7
7
|
justifyContent: 'center',
|
|
8
8
|
borderRadius: 'md',
|
|
9
|
-
borderColor: 'border-tertiary',
|
|
10
9
|
cursor: 'default',
|
|
11
10
|
position: 'relative'
|
|
12
11
|
};
|
|
@@ -20,8 +19,8 @@ const hoverVariants = hover => variant({
|
|
|
20
19
|
},
|
|
21
20
|
[Progress.inProgress]: {
|
|
22
21
|
'&:hover': {
|
|
23
|
-
bg: hover ? '
|
|
24
|
-
}
|
|
22
|
+
bg: hover ? 'rgba(85, 51, 255, 0.12)' : undefined
|
|
23
|
+
} // this is primary-hover color with 12% opacity
|
|
25
24
|
},
|
|
26
25
|
[Progress.completed]: {
|
|
27
26
|
'&:hover': {
|
|
@@ -63,14 +62,18 @@ export const Tile = /*#__PURE__*/_styled(FlexBox, {
|
|
|
63
62
|
},
|
|
64
63
|
variants: {
|
|
65
64
|
[Progress.notStarted]: {
|
|
66
|
-
bg: 'background-selected'
|
|
65
|
+
bg: 'background-selected',
|
|
66
|
+
borderColor: 'background-hover'
|
|
67
67
|
},
|
|
68
68
|
[Progress.inProgress]: {
|
|
69
|
-
bg: '
|
|
69
|
+
bg: 'rgba(58, 16, 229, 0.12)',
|
|
70
|
+
// this is primary color with 12% opacity
|
|
71
|
+
borderColor: 'primary'
|
|
70
72
|
},
|
|
71
73
|
[Progress.completed]: {
|
|
72
|
-
bg: 'primary'
|
|
74
|
+
bg: 'primary',
|
|
75
|
+
borderColor: 'border-tertiary'
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
})(props)
|
|
76
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
79
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9MZWFybmluZ091dGNvbWVUaWxlL1RpbGUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNEb0IiLCJmaWxlIjoiLi4vLi4vc3JjL0xlYXJuaW5nT3V0Y29tZVRpbGUvVGlsZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBGbGV4Qm94IH0gZnJvbSAnQGNvZGVjY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XMsXG4gICAgfSxcbiAgICB2YXJpYW50czoge1xuICAgICAgW1Byb2dyZXNzLm5vdFN0YXJ0ZWRdOiB7XG4gICAgICAgIGJnOiAnYmFja2dyb3VuZC1zZWxlY3RlZCcsXG4gICAgICAgIGJvcmRlckNvbG9yOiAnYmFja2dyb3VuZC1ob3ZlcicsXG4gICAgICB9LFxuICAgICAgW1Byb2dyZXNzLmluUHJvZ3Jlc3NdOiB7XG4gICAgICAgIGJnOiAncmdiYSg1OCwgMTYsIDIyOSwgMC4xMiknIGFzIG5ldmVyLCAvLyB0aGlzIGlzIHByaW1hcnkgY29sb3Igd2l0aCAxMiUgb3BhY2l0eVxuICAgICAgICBib3JkZXJDb2xvcjogJ3ByaW1hcnknLFxuICAgICAgfSxcbiAgICAgIFtQcm9ncmVzcy5jb21wbGV0ZWRdOiB7XG4gICAgICAgIGJnOiAncHJpbWFyeScsXG4gICAgICAgIGJvcmRlckNvbG9yOiAnYm9yZGVyLXRlcnRpYXJ5JyxcbiAgICAgIH0sXG4gICAgfSxcbiAgfSkocHJvcHMpLFxufSkpO1xuIl19 */");
|
|
@@ -7,7 +7,7 @@ import { Tile } from './Tile';
|
|
|
7
7
|
import { Progress } from './types';
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
9
|
const progressState = percentComplete => {
|
|
10
|
-
if (
|
|
10
|
+
if (percentComplete === 0) {
|
|
11
11
|
return Progress.notStarted;
|
|
12
12
|
}
|
|
13
13
|
if (percentComplete > 0 && percentComplete < 100) {
|
|
@@ -24,7 +24,7 @@ export const LearningOutcomeTile = ({
|
|
|
24
24
|
const {
|
|
25
25
|
id,
|
|
26
26
|
latestScore,
|
|
27
|
-
percentComplete
|
|
27
|
+
percentComplete = 0
|
|
28
28
|
} = learningOutcomeDetails || {};
|
|
29
29
|
const [isOpen, setIsOpen] = useState(false);
|
|
30
30
|
const activeElRef = useRef(null);
|
|
@@ -40,8 +40,8 @@ export const LearningOutcomeTile = ({
|
|
|
40
40
|
'aria-describedby': `${id}-popover`
|
|
41
41
|
} : {};
|
|
42
42
|
const lowLatestAssessment = Boolean(latestScore != null && latestScore < 70);
|
|
43
|
+
const showLowAssessmentDot = lowLatestAssessment && size !== 'small';
|
|
43
44
|
const progress = progressState(percentComplete);
|
|
44
|
-
const progressText = progress === Progress.inProgress ? `${percentComplete}%` : '';
|
|
45
45
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
46
|
children: [/*#__PURE__*/_jsxs(Tile, {
|
|
47
47
|
hover: hover,
|
|
@@ -54,8 +54,8 @@ export const LearningOutcomeTile = ({
|
|
|
54
54
|
}) : /*#__PURE__*/_jsx(Text, {
|
|
55
55
|
fontSize: 14,
|
|
56
56
|
fontWeight: 700,
|
|
57
|
-
children:
|
|
58
|
-
}),
|
|
57
|
+
children: `${percentComplete}%`
|
|
58
|
+
}), showLowAssessmentDot && /*#__PURE__*/_jsx(LearningOutcomeLowAssessmentDot, {
|
|
59
59
|
position: "absolute",
|
|
60
60
|
top: "-20%",
|
|
61
61
|
right: "-20%",
|
|
@@ -66,7 +66,7 @@ export const LearningOutcomeTile = ({
|
|
|
66
66
|
activeElRef: activeElRef,
|
|
67
67
|
isOpen: isOpen,
|
|
68
68
|
setIsOpen: setIsOpen,
|
|
69
|
-
horizontalOffset: size === 'small' ? 150 : 175,
|
|
69
|
+
horizontalOffset: size === 'small' || showLowAssessmentDot ? 150 : 175,
|
|
70
70
|
learningOutcomeDetails: learningOutcomeDetails
|
|
71
71
|
})]
|
|
72
72
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { LearningOutcomeLowAssessmentBadge } from '../../LearningOutcomeBadges';
|
|
3
|
+
declare const meta: Meta<typeof LearningOutcomeLowAssessmentBadge>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof LearningOutcomeLowAssessmentBadge>;
|
|
6
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LearningOutcomeLowAssessmentBadge } from '../../LearningOutcomeBadges';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
const meta = {
|
|
4
|
+
component: LearningOutcomeLowAssessmentBadge
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
export const Default = {
|
|
8
|
+
render: () => /*#__PURE__*/_jsx(LearningOutcomeLowAssessmentBadge, {}),
|
|
9
|
+
name: 'Learning Outcome Low Assessment Badge - Default'
|
|
10
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react';
|
|
2
|
+
import { LearningOutcomePopover } from '../../LearningOutcomePopover';
|
|
3
|
+
declare const meta: Meta<typeof LearningOutcomePopover>;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const Example: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Box, FillButton, FlexBox } from '@codecademy/gamut';
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
import { LearningOutcomePopover } from '../../LearningOutcomePopover';
|
|
4
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
const meta = {
|
|
6
|
+
component: LearningOutcomePopover,
|
|
7
|
+
args: {}
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Example = () => {
|
|
11
|
+
const [open, setOpen] = useState(false);
|
|
12
|
+
const activeElRef = useRef(null);
|
|
13
|
+
const toggleOpen = () => setOpen(!open);
|
|
14
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
15
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
16
|
+
ref: activeElRef,
|
|
17
|
+
children: /*#__PURE__*/_jsx(FillButton, {
|
|
18
|
+
onClick: toggleOpen,
|
|
19
|
+
children: "Open Popover"
|
|
20
|
+
})
|
|
21
|
+
}), /*#__PURE__*/_jsx(FlexBox, {
|
|
22
|
+
width: "100%",
|
|
23
|
+
children: /*#__PURE__*/_jsx(LearningOutcomePopover, {
|
|
24
|
+
id: "learning-outcome-popover",
|
|
25
|
+
activeElRef: activeElRef,
|
|
26
|
+
isOpen: open,
|
|
27
|
+
setIsOpen: setOpen,
|
|
28
|
+
learningOutcomeDetails: {
|
|
29
|
+
id: '1',
|
|
30
|
+
level: 2,
|
|
31
|
+
outcome: 'Understand the basics of React',
|
|
32
|
+
latestScore: 68,
|
|
33
|
+
highestScore: 100,
|
|
34
|
+
percentComplete: 75
|
|
35
|
+
},
|
|
36
|
+
horizontalOffset: 90
|
|
37
|
+
})
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/brand",
|
|
3
3
|
"description": "Brand component library for Codecademy",
|
|
4
|
-
"version": "1.19.0-alpha.
|
|
4
|
+
"version": "1.19.0-alpha.c7c595cbc4.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|