@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.
Files changed (25) hide show
  1. package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +0 -0
  2. package/dist/LearningOutcomeAssessmentScores/AssessmentDetail.d.ts +8 -0
  3. package/dist/LearningOutcomeAssessmentScores/AssessmentDetail.js +55 -0
  4. package/dist/LearningOutcomeAssessmentScores/index.d.ts +8 -0
  5. package/dist/LearningOutcomeAssessmentScores/index.js +24 -0
  6. package/dist/LearningOutcomeCard/index.d.ts +10 -12
  7. package/dist/LearningOutcomeCard/index.js +168 -143
  8. package/dist/LearningOutcomeFlyout/LearningOutcomeCardList.d.ts +7 -0
  9. package/dist/LearningOutcomeFlyout/LearningOutcomeCardList.js +42 -0
  10. package/dist/LearningOutcomeFlyout/index.d.ts +8 -0
  11. package/dist/LearningOutcomeFlyout/index.js +290 -0
  12. package/dist/LearningOutcomeFlyout/types.d.ts +49 -0
  13. package/dist/LearningOutcomeFlyout/types.js +5 -0
  14. package/dist/LearningOutcomeTile/index.d.ts +2 -1
  15. package/dist/LearningOutcomeTile/index.js +2 -4
  16. package/dist/LearningOutcomeTile/types.d.ts +0 -1
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.js +2 -0
  19. package/dist/stories/Molecules/LearningOutcomeAssessmentScores.stories.d.ts +6 -0
  20. package/dist/stories/Molecules/LearningOutcomeAssessmentScores.stories.js +23 -0
  21. package/dist/stories/Molecules/LearningOutcomeCard.stories.d.ts +7 -2
  22. package/dist/stories/Molecules/LearningOutcomeCard.stories.js +168 -54
  23. package/dist/stories/Molecules/LearningOutcomeFlyout.stories.d.ts +5 -0
  24. package/dist/stories/Molecules/LearningOutcomeFlyout.stories.js +57 -0
  25. package/package.json +1 -1
@@ -1,75 +1,189 @@
1
- import { Background } from '@codecademy/gamut-styles';
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
- outcome: 'Implement sorting algorithms in Java.',
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: 'Learning Outcome Simple Card'
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(Background, {
38
- bg: "navy",
39
- p: 24,
40
- children: /*#__PURE__*/_jsx(LearningOutcomeCard, {
41
- emphasized: true,
42
- progress: 60,
43
- ...args
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 displaying progress, for use in the Learning Environment'
131
+ name: 'Emphasized card with progress'
47
132
  };
48
133
  export const EmphasizedCardWithProgress100 = {
49
- render: args => /*#__PURE__*/_jsx(Background, {
50
- bg: "navy",
51
- p: 24,
52
- children: /*#__PURE__*/_jsx(LearningOutcomeCard, {
53
- emphasized: true,
54
- progress: 100,
55
- ...args
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 displaying 100% progress, for use in the Learning Environment'
148
+ name: 'Emphasized card with 100% progress'
59
149
  };
60
- export const EmphasizedCardWithAnimation = {
61
- render: args => /*#__PURE__*/_jsx(Background, {
62
- bg: "navy",
63
- p: 24,
64
- children: /*#__PURE__*/_jsx(LearningOutcomeCard, {
65
- emphasized: true,
66
- progress: 80,
67
- progressUpdateData: {
68
- previousProgress: 50,
69
- progressDuration: 500
70
- },
71
- ...args
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 first displays 50% progress then animates until showing 80%, for use in the Learning Environment'
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": "2.11.0",
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",