@codecademy/brand 2.11.0 → 3.0.0-alpha.097ecb99a8.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/LearningOutcomeAssessmentScores/AssessmentDetail.d.ts +8 -0
- package/dist/LearningOutcomeAssessmentScores/AssessmentDetail.js +55 -0
- package/dist/LearningOutcomeAssessmentScores/index.d.ts +8 -0
- package/dist/LearningOutcomeAssessmentScores/index.js +24 -0
- package/dist/LearningOutcomeCard/index.d.ts +10 -12
- package/dist/LearningOutcomeCard/index.js +168 -143
- package/dist/LearningOutcomeFlyout/LearningOutcomeCardList.d.ts +7 -0
- package/dist/LearningOutcomeFlyout/LearningOutcomeCardList.js +42 -0
- package/dist/LearningOutcomeFlyout/index.d.ts +8 -0
- package/dist/LearningOutcomeFlyout/index.js +290 -0
- package/dist/LearningOutcomeFlyout/types.d.ts +49 -0
- package/dist/LearningOutcomeFlyout/types.js +5 -0
- package/dist/LearningOutcomeTile/index.d.ts +2 -1
- package/dist/LearningOutcomeTile/index.js +2 -4
- package/dist/LearningOutcomeTile/types.d.ts +0 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/stories/Molecules/LearningOutcomeAssessmentScores.stories.d.ts +6 -0
- package/dist/stories/Molecules/LearningOutcomeAssessmentScores.stories.js +23 -0
- package/dist/stories/Molecules/LearningOutcomeCard.stories.d.ts +7 -2
- package/dist/stories/Molecules/LearningOutcomeCard.stories.js +168 -54
- package/dist/stories/Molecules/LearningOutcomeFlyout.stories.d.ts +5 -0
- package/dist/stories/Molecules/LearningOutcomeFlyout.stories.js +57 -0
- package/package.json +1 -1
|
@@ -1,75 +1,189 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlexBox } from '@codecademy/gamut';
|
|
2
2
|
import { LearningOutcomeCard } from '../../LearningOutcomeCard';
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
const meta = {
|
|
5
5
|
component: LearningOutcomeCard,
|
|
6
6
|
args: {
|
|
7
|
+
outcome: 'Implement sorting algorithms in Java.'
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const Base = {
|
|
12
|
+
render: args => /*#__PURE__*/_jsxs(FlexBox, {
|
|
13
|
+
gap: 16,
|
|
14
|
+
children: [/*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
15
|
+
...args,
|
|
16
|
+
level: 1
|
|
17
|
+
}), /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
18
|
+
...args,
|
|
19
|
+
level: 2
|
|
20
|
+
}), /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
21
|
+
...args,
|
|
22
|
+
level: 3
|
|
23
|
+
})]
|
|
24
|
+
}),
|
|
25
|
+
name: 'Base card'
|
|
26
|
+
};
|
|
27
|
+
export const BaseCardWithHover = {
|
|
28
|
+
render: args => /*#__PURE__*/_jsxs(FlexBox, {
|
|
29
|
+
gap: 16,
|
|
30
|
+
children: [/*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
31
|
+
...args,
|
|
32
|
+
level: 1,
|
|
33
|
+
isInteractive: true
|
|
34
|
+
}), /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
35
|
+
...args,
|
|
36
|
+
level: 2,
|
|
37
|
+
isInteractive: true
|
|
38
|
+
}), /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
39
|
+
...args,
|
|
40
|
+
level: 3,
|
|
41
|
+
isInteractive: true
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
name: 'Base card with hover'
|
|
45
|
+
};
|
|
46
|
+
export const BaseCardWithTopics = {
|
|
47
|
+
render: args => /*#__PURE__*/_jsxs(FlexBox, {
|
|
48
|
+
gap: 16,
|
|
49
|
+
children: [/*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
50
|
+
...args,
|
|
51
|
+
level: 1,
|
|
52
|
+
skills: [{
|
|
53
|
+
title: 'java'
|
|
54
|
+
}, {
|
|
55
|
+
title: 'skill'
|
|
56
|
+
}, {
|
|
57
|
+
title: 'computer science'
|
|
58
|
+
}]
|
|
59
|
+
}), /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
60
|
+
...args,
|
|
61
|
+
level: 2,
|
|
62
|
+
skills: [{
|
|
63
|
+
title: 'java'
|
|
64
|
+
}, {
|
|
65
|
+
title: 'skill'
|
|
66
|
+
}, {
|
|
67
|
+
title: 'computer science'
|
|
68
|
+
}]
|
|
69
|
+
}), /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
70
|
+
...args,
|
|
71
|
+
level: 3,
|
|
72
|
+
skills: [{
|
|
73
|
+
title: 'java'
|
|
74
|
+
}, {
|
|
75
|
+
title: 'skill'
|
|
76
|
+
}, {
|
|
77
|
+
title: 'computer science'
|
|
78
|
+
}]
|
|
79
|
+
})]
|
|
80
|
+
}),
|
|
81
|
+
name: 'Base card with topics'
|
|
82
|
+
};
|
|
83
|
+
export const EmphasizedCard = {
|
|
84
|
+
render: args => /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
85
|
+
...args,
|
|
7
86
|
level: 1,
|
|
8
|
-
|
|
87
|
+
mode: "emphasized"
|
|
88
|
+
}),
|
|
89
|
+
name: 'Emphasized card'
|
|
90
|
+
};
|
|
91
|
+
export const EmphasizedCardWithHover = {
|
|
92
|
+
render: args => /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
93
|
+
...args,
|
|
94
|
+
level: 2,
|
|
95
|
+
mode: "emphasized",
|
|
96
|
+
isInteractive: true
|
|
97
|
+
}),
|
|
98
|
+
name: 'Emphasized card with hover'
|
|
99
|
+
};
|
|
100
|
+
export const EmphasizedCardWithTopics = {
|
|
101
|
+
render: args => /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
102
|
+
...args,
|
|
103
|
+
level: 3,
|
|
9
104
|
skills: [{
|
|
10
105
|
title: 'java'
|
|
11
106
|
}, {
|
|
12
107
|
title: 'skill'
|
|
13
108
|
}, {
|
|
14
109
|
title: 'computer science'
|
|
15
|
-
}]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
export const Default = {
|
|
20
|
-
render: args => /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
21
|
-
...args
|
|
110
|
+
}],
|
|
111
|
+
mode: "emphasized",
|
|
112
|
+
isInteractive: true
|
|
22
113
|
}),
|
|
23
|
-
name: '
|
|
24
|
-
};
|
|
25
|
-
export const EmphasizedCard = {
|
|
26
|
-
render: args => /*#__PURE__*/_jsx(Background, {
|
|
27
|
-
bg: "navy",
|
|
28
|
-
p: 24,
|
|
29
|
-
children: /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
30
|
-
emphasized: true,
|
|
31
|
-
...args
|
|
32
|
-
})
|
|
33
|
-
}),
|
|
34
|
-
name: 'Emphasized Card'
|
|
114
|
+
name: 'Emphasized card with topics'
|
|
35
115
|
};
|
|
36
116
|
export const EmphasizedCardWithProgress = {
|
|
37
|
-
render: args => /*#__PURE__*/_jsx(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
117
|
+
render: args => /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
118
|
+
...args,
|
|
119
|
+
level: 2,
|
|
120
|
+
progress: 60,
|
|
121
|
+
skills: [{
|
|
122
|
+
title: 'java'
|
|
123
|
+
}, {
|
|
124
|
+
title: 'skill'
|
|
125
|
+
}, {
|
|
126
|
+
title: 'computer science'
|
|
127
|
+
}],
|
|
128
|
+
mode: "emphasized",
|
|
129
|
+
isInteractive: true
|
|
45
130
|
}),
|
|
46
|
-
name: 'Emphasized card
|
|
131
|
+
name: 'Emphasized card with progress'
|
|
47
132
|
};
|
|
48
133
|
export const EmphasizedCardWithProgress100 = {
|
|
49
|
-
render: args => /*#__PURE__*/_jsx(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
134
|
+
render: args => /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
135
|
+
...args,
|
|
136
|
+
level: 3,
|
|
137
|
+
progress: 100,
|
|
138
|
+
skills: [{
|
|
139
|
+
title: 'java'
|
|
140
|
+
}, {
|
|
141
|
+
title: 'skill'
|
|
142
|
+
}, {
|
|
143
|
+
title: 'computer science'
|
|
144
|
+
}],
|
|
145
|
+
mode: "emphasized",
|
|
146
|
+
isInteractive: true
|
|
57
147
|
}),
|
|
58
|
-
name: 'Emphasized card
|
|
148
|
+
name: 'Emphasized card with 100% progress'
|
|
59
149
|
};
|
|
60
|
-
export const
|
|
61
|
-
render: args => /*#__PURE__*/_jsx(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
150
|
+
export const EmphasizedCardWithProgressAnimation = {
|
|
151
|
+
render: args => /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
152
|
+
...args,
|
|
153
|
+
level: 2,
|
|
154
|
+
progress: 80,
|
|
155
|
+
progressUpdateData: {
|
|
156
|
+
previousProgress: 50,
|
|
157
|
+
progressDuration: 500
|
|
158
|
+
},
|
|
159
|
+
skills: [{
|
|
160
|
+
title: 'java'
|
|
161
|
+
}, {
|
|
162
|
+
title: 'skill'
|
|
163
|
+
}, {
|
|
164
|
+
title: 'computer science'
|
|
165
|
+
}],
|
|
166
|
+
mode: "emphasized"
|
|
167
|
+
}),
|
|
168
|
+
name: 'Emphasized card with progress with animation'
|
|
169
|
+
};
|
|
170
|
+
export const EmphasizedCardWithProgress100Animation = {
|
|
171
|
+
render: args => /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
172
|
+
...args,
|
|
173
|
+
level: 2,
|
|
174
|
+
progress: 100,
|
|
175
|
+
progressUpdateData: {
|
|
176
|
+
previousProgress: 50,
|
|
177
|
+
completionDelay: 500
|
|
178
|
+
},
|
|
179
|
+
skills: [{
|
|
180
|
+
title: 'java'
|
|
181
|
+
}, {
|
|
182
|
+
title: 'skill'
|
|
183
|
+
}, {
|
|
184
|
+
title: 'computer science'
|
|
185
|
+
}],
|
|
186
|
+
mode: "emphasized"
|
|
73
187
|
}),
|
|
74
|
-
name: 'Emphasized card
|
|
188
|
+
name: 'Emphasized card with 100% progress with animation'
|
|
75
189
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react';
|
|
2
|
+
import { LearningOutcomeFlyout } from '../../LearningOutcomeFlyout';
|
|
3
|
+
declare const meta: Meta<typeof LearningOutcomeFlyout>;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const Example: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FillButton, FlexBox } from '@codecademy/gamut';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { LearningOutcomeFlyout } from '../../LearningOutcomeFlyout';
|
|
4
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
const meta = {
|
|
6
|
+
component: LearningOutcomeFlyout,
|
|
7
|
+
args: {}
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Example = () => {
|
|
11
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
12
|
+
const toggleOpen = () => setIsExpanded(!isExpanded);
|
|
13
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
14
|
+
children: [/*#__PURE__*/_jsx(FillButton, {
|
|
15
|
+
onClick: toggleOpen,
|
|
16
|
+
children: "Open Flyout"
|
|
17
|
+
}), /*#__PURE__*/_jsx(FlexBox, {
|
|
18
|
+
width: "100%",
|
|
19
|
+
children: /*#__PURE__*/_jsx(LearningOutcomeFlyout, {
|
|
20
|
+
expanded: isExpanded,
|
|
21
|
+
learningOutcome: {
|
|
22
|
+
highestScore: 100,
|
|
23
|
+
highestScoreAchievedAt: '10/01',
|
|
24
|
+
latestScore: 68,
|
|
25
|
+
latestScoreAchievedAt: '10/01',
|
|
26
|
+
level: 2,
|
|
27
|
+
outcome: 'Understand the basics of React',
|
|
28
|
+
percentComplete: 75,
|
|
29
|
+
parentLOs: [{
|
|
30
|
+
id: '1',
|
|
31
|
+
outcome: 'Build a React component',
|
|
32
|
+
level: 3
|
|
33
|
+
}, {
|
|
34
|
+
id: '2',
|
|
35
|
+
outcome: 'Manage state in React',
|
|
36
|
+
level: 3
|
|
37
|
+
}],
|
|
38
|
+
childLearningOutcomes: [{
|
|
39
|
+
id: '3',
|
|
40
|
+
outcome: 'Understand JSX components',
|
|
41
|
+
percentComplete: 100
|
|
42
|
+
}, {
|
|
43
|
+
id: '4',
|
|
44
|
+
outcome: 'Create a React form',
|
|
45
|
+
percentComplete: 50
|
|
46
|
+
}, {
|
|
47
|
+
id: '5',
|
|
48
|
+
outcome: 'Pass through props to a component',
|
|
49
|
+
percentComplete: 0
|
|
50
|
+
}]
|
|
51
|
+
},
|
|
52
|
+
learningOutcomeHref: "/learning-outcomes/123",
|
|
53
|
+
onClose: () => setIsExpanded(false)
|
|
54
|
+
})
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
};
|
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": "
|
|
4
|
+
"version": "3.0.0-alpha.097ecb99a8.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|