@codecademy/brand 1.19.0-alpha.812b1cb81e.0 → 1.19.0-alpha.c43bcf7814.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.
@@ -0,0 +1,18 @@
1
+ import { TextProps } from '@codecademy/gamut';
2
+ export declare enum LearningOutcomeLevels {
3
+ One = 1,
4
+ Two = 2,
5
+ Three = 3
6
+ }
7
+ export declare const learningOutcomeLabels: {
8
+ 1: string;
9
+ 2: string;
10
+ 3: string;
11
+ };
12
+ interface LearningOutcomeLevelBadgeProps extends Pick<TextProps, 'textColor'> {
13
+ level: LearningOutcomeLevels;
14
+ size?: 'sm' | 'base';
15
+ removeBackground?: boolean;
16
+ }
17
+ export declare const LearningOutcomeLevelBadge: React.FC<LearningOutcomeLevelBadgeProps>;
18
+ export {};
@@ -0,0 +1,57 @@
1
+ import _styled from "@emotion/styled/base";
2
+ import { Badge, FlexBox, Text } from '@codecademy/gamut';
3
+ import { css, variant } from '@codecademy/gamut-styles';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export let LearningOutcomeLevels = /*#__PURE__*/function (LearningOutcomeLevels) {
6
+ LearningOutcomeLevels[LearningOutcomeLevels["One"] = 1] = "One";
7
+ LearningOutcomeLevels[LearningOutcomeLevels["Two"] = 2] = "Two";
8
+ LearningOutcomeLevels[LearningOutcomeLevels["Three"] = 3] = "Three";
9
+ return LearningOutcomeLevels;
10
+ }({});
11
+ export const learningOutcomeLabels = {
12
+ [LearningOutcomeLevels.One]: 'Subskill',
13
+ [LearningOutcomeLevels.Two]: 'Skill',
14
+ [LearningOutcomeLevels.Three]: 'Skill set'
15
+ };
16
+ const StyledBadge = /*#__PURE__*/_styled(Badge, {
17
+ target: "e187pstn0",
18
+ label: "StyledBadge"
19
+ })(css({
20
+ borderColor: 'border-tertiary'
21
+ }), variant({
22
+ prop: 'level',
23
+ variants: {
24
+ [LearningOutcomeLevels.One]: {
25
+ bg: 'background-selected'
26
+ },
27
+ [LearningOutcomeLevels.Two]: {
28
+ bg: 'green-100'
29
+ },
30
+ [LearningOutcomeLevels.Three]: {
31
+ bg: 'blue-100'
32
+ }
33
+ }
34
+ }), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9MZWFybmluZ091dGNvbWVCYWRnZXMvTGVhcm5pbmdPdXRjb21lTGV2ZWxCYWRnZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0JvQiIsImZpbGUiOiIuLi8uLi9zcmMvTGVhcm5pbmdPdXRjb21lQmFkZ2VzL0xlYXJuaW5nT3V0Y29tZUxldmVsQmFkZ2UudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQmFkZ2UsIEZsZXhCb3gsIFRleHQsIFRleHRQcm9wcyB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0JztcbmltcG9ydCB7IGNzcywgdmFyaWFudCB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0LXN0eWxlcyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmV4cG9ydCBlbnVtIExlYXJuaW5nT3V0Y29tZUxldmVscyB7XG4gIE9uZSA9IDEsXG4gIFR3byA9IDIsXG4gIFRocmVlID0gMyxcbn1cblxuZXhwb3J0IGNvbnN0IGxlYXJuaW5nT3V0Y29tZUxhYmVscyA9IHtcbiAgW0xlYXJuaW5nT3V0Y29tZUxldmVscy5PbmVdOiAnU3Vic2tpbGwnLFxuICBbTGVhcm5pbmdPdXRjb21lTGV2ZWxzLlR3b106ICdTa2lsbCcsXG4gIFtMZWFybmluZ091dGNvbWVMZXZlbHMuVGhyZWVdOiAnU2tpbGwgc2V0Jyxcbn07XG5cbmNvbnN0IFN0eWxlZEJhZGdlID0gc3R5bGVkKEJhZGdlKTx7IGxldmVsOi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oPVwibWluLWNvbnRlbnRcIlxuICAgICAgYm9yZGVyUmFkaXVzPVwieGxcIlxuICAgID5cbiAgICAgIDxTdHlsZWRCYWRnZVxuICAgICAgICBkYXRhLXRlc3RpZD1cImxlYXJuaW5nLW91dGNvbWUtYmFkZ2VcIlxuICAgICAgICBzaXplPXtzaXplfVxuICAgICAgICB2YXJpYW50PVwidGVydGlhcnlcIlxuICAgICAgICBsZXZlbD17bGV2ZWx9XG4gICAgICA+XG4gICAgICAgIDxUZXh0IGNvbG9yPXt0ZXh0Q29sb3IgfHwgJ3RleHQnfT57bGVhcm5pbmdPdXRjb21lTGFiZWxzW2xldmVsXX08L1RleHQ+XG4gICAgICA8L1N0eWxlZEJhZGdlPlxuICAgIDwvRmxleEJveD5cbiAgKTtcbn07XG4iXX0= */");
35
+ export const LearningOutcomeLevelBadge = ({
36
+ level,
37
+ size = 'sm',
38
+ textColor,
39
+ removeBackground
40
+ }) => {
41
+ return /*#__PURE__*/_jsx(FlexBox, {
42
+ bg: removeBackground ? 'transparent' : 'white',
43
+ height: "min-content",
44
+ width: "min-content",
45
+ borderRadius: "xl",
46
+ children: /*#__PURE__*/_jsx(StyledBadge, {
47
+ "data-testid": "learning-outcome-badge",
48
+ size: size,
49
+ variant: "tertiary",
50
+ level: level,
51
+ children: /*#__PURE__*/_jsx(Text, {
52
+ color: textColor || 'text',
53
+ children: learningOutcomeLabels[level]
54
+ })
55
+ })
56
+ });
57
+ };
@@ -0,0 +1,10 @@
1
+ export declare const LearningOutcomeLowAssessmentDot: import("@emotion/styled").StyledComponent<{
2
+ theme?: import("@emotion/react").Theme | undefined;
3
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
4
+ } & import("@codecademy/gamut").BoxProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "onClick" | "slot" | "style" | "title" | "children" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | keyof import("react").ClassAttributes<HTMLDivElement>> & {
5
+ theme?: import("@emotion/react").Theme;
6
+ } & {
7
+ hasBorder?: boolean;
8
+ small?: boolean;
9
+ }, {}, {}>;
10
+ export declare const LearningOutcomeLowAssessmentBadge: React.FC;
@@ -0,0 +1,35 @@
1
+ import _styled from "@emotion/styled/base";
2
+ import { Badge, Box, Text } from '@codecademy/gamut';
3
+ import { css, states } from '@codecademy/gamut-styles';
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export const LearningOutcomeLowAssessmentDot = /*#__PURE__*/_styled(Box, {
6
+ target: "ege7mnh0",
7
+ label: "LearningOutcomeLowAssessmentDot"
8
+ })(css({
9
+ bg: 'orange-500',
10
+ borderRadius: 'full',
11
+ height: 16,
12
+ width: 16
13
+ }), states({
14
+ hasBorder: {
15
+ border: 2,
16
+ borderColor: 'background-contrast'
17
+ },
18
+ small: {
19
+ height: 8,
20
+ width: 8
21
+ }
22
+ }), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9MZWFybmluZ091dGNvbWVCYWRnZXMvTGVhcm5pbmdPdXRjb21lTG93QXNzZXNzbWVudEJhZGdlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJK0MiLC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ZW50RG90IHNtYWxsIC8+XG4gICAgICA8VGV4dCBtbD17NH0+TmVlZHMgcmV2aWV3PC9UZXh0PlxuICAgIDwvQmFkZ2U+XG4gICk7XG59O1xuIl19 */");
23
+ export const LearningOutcomeLowAssessmentBadge = () => {
24
+ return /*#__PURE__*/_jsxs(Badge, {
25
+ variant: "custom",
26
+ size: "sm",
27
+ bg: "orange-100",
28
+ children: [/*#__PURE__*/_jsx(LearningOutcomeLowAssessmentDot, {
29
+ small: true
30
+ }), /*#__PURE__*/_jsx(Text, {
31
+ ml: 4,
32
+ children: "Needs review"
33
+ })]
34
+ });
35
+ };
@@ -0,0 +1,2 @@
1
+ export * from './LearningOutcomeLevelBadge';
2
+ export * from './LearningOutcomeLowAssessmentBadge';
@@ -0,0 +1,2 @@
1
+ export * from './LearningOutcomeLevelBadge';
2
+ export * from './LearningOutcomeLowAssessmentBadge';
@@ -0,0 +1,11 @@
1
+ import { LearningOutcomePopoverDetailsProps } from '../LearningOutcomeTile/types';
2
+ interface LearningOutcomePopoverProps {
3
+ activeElRef: React.RefObject<HTMLDivElement>;
4
+ id: string;
5
+ isOpen: boolean;
6
+ learningOutcomeDetails: LearningOutcomePopoverDetailsProps;
7
+ setIsOpen: (isOpen: boolean) => void;
8
+ horizontalOffset?: number;
9
+ }
10
+ export declare const LearningOutcomePopover: React.FC<LearningOutcomePopoverProps>;
11
+ export {};
@@ -0,0 +1,139 @@
1
+ import { Box, FlexBox, Popover, Text } from '@codecademy/gamut';
2
+ import { SmallCheckIcon } from '@codecademy/gamut-icons';
3
+ import { LearningOutcomeLevelBadge, LearningOutcomeLowAssessmentBadge } from '../LearningOutcomeBadges';
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ const Assessment = ({
6
+ score,
7
+ type
8
+ }) => /*#__PURE__*/_jsxs(FlexBox, {
9
+ mx: 8,
10
+ my: 4,
11
+ gap: 4,
12
+ alignItems: "center",
13
+ column: true,
14
+ children: [/*#__PURE__*/_jsx(Text, {
15
+ variant: "p-small",
16
+ color: "text-secondary",
17
+ children: type === 'highest' ? 'High' : 'Recent'
18
+ }), /*#__PURE__*/_jsx(Text, {
19
+ variant: "p-small",
20
+ color: score && score >= 70 ? 'green-700' : 'text',
21
+ fontWeight: 700,
22
+ children: score != null ? `${score}%` : '-'
23
+ })]
24
+ });
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
+ export const LearningOutcomePopover = ({
93
+ activeElRef,
94
+ isOpen,
95
+ setIsOpen,
96
+ learningOutcomeDetails,
97
+ ...rest
98
+ }) => {
99
+ const {
100
+ level,
101
+ outcome,
102
+ latestScore,
103
+ highestScore,
104
+ percentComplete
105
+ } = learningOutcomeDetails || {};
106
+ const lowLatestAssessment = Boolean(latestScore != null && latestScore < 70);
107
+ return /*#__PURE__*/_jsx(Popover, {
108
+ ...rest,
109
+ isOpen: isOpen,
110
+ targetRef: activeElRef,
111
+ onRequestClose: () => setIsOpen(false),
112
+ position: "above",
113
+ beak: "center",
114
+ outline: true,
115
+ children: /*#__PURE__*/_jsxs(FlexBox, {
116
+ pt: 24,
117
+ px: 16,
118
+ gap: 16,
119
+ column: true,
120
+ children: [/*#__PURE__*/_jsxs(FlexBox, {
121
+ justifyContent: "space-between",
122
+ children: [!!level && /*#__PURE__*/_jsx(LearningOutcomeLevelBadge, {
123
+ level: level
124
+ }), lowLatestAssessment && /*#__PURE__*/_jsx(LearningOutcomeLowAssessmentBadge, {})]
125
+ }), /*#__PURE__*/_jsx(Text, {
126
+ color: "text",
127
+ fontWeight: 400,
128
+ textAlign: "left",
129
+ variant: "title-xs",
130
+ whiteSpace: "break-spaces",
131
+ children: outcome
132
+ }), /*#__PURE__*/_jsx(ProgressAndAssessment, {
133
+ highestScore: highestScore,
134
+ latestScore: latestScore,
135
+ percentComplete: percentComplete
136
+ })]
137
+ })
138
+ });
139
+ };
@@ -0,0 +1,7 @@
1
+ import { TileProps } from './types';
2
+ export declare const Tile: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ } & import("@codecademy/gamut").FlexBoxProps & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "onClick" | "slot" | "style" | "title" | "children" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | keyof import("react").ClassAttributes<HTMLDivElement>> & {
6
+ theme?: import("@emotion/react").Theme;
7
+ } & TileProps, {}, {}>;
@@ -0,0 +1,76 @@
1
+ import _styled from "@emotion/styled/base";
2
+ import { FlexBox } from '@codecademy/gamut';
3
+ import { variant } from '@codecademy/gamut-styles';
4
+ import { Progress } from './types';
5
+ const tileStyles = {
6
+ alignItems: 'center',
7
+ justifyContent: 'center',
8
+ borderRadius: 'md',
9
+ borderColor: 'border-tertiary',
10
+ cursor: 'default',
11
+ position: 'relative'
12
+ };
13
+ const hoverVariants = hover => variant({
14
+ prop: 'progress',
15
+ variants: {
16
+ [Progress.notStarted]: {
17
+ '&:hover': {
18
+ bg: hover ? 'background-hover' : undefined
19
+ }
20
+ },
21
+ [Progress.inProgress]: {
22
+ '&:hover': {
23
+ bg: hover ? 'background-hover' : undefined
24
+ }
25
+ },
26
+ [Progress.completed]: {
27
+ '&:hover': {
28
+ bg: hover ? 'primary-hover' : undefined
29
+ }
30
+ }
31
+ }
32
+ });
33
+ const sizeVariants = size => variant({
34
+ prop: 'progress',
35
+ base: {
36
+ border: size === 'small' ? 'none' : 2
37
+ },
38
+ variants: {
39
+ [Progress.notStarted]: {
40
+ width: size === 'small' ? 32 : 40,
41
+ height: size === 'small' ? 24 : 40
42
+ },
43
+ [Progress.inProgress]: {
44
+ width: size === 'small' ? 32 : 40,
45
+ height: size === 'small' ? 24 : 40
46
+ },
47
+ [Progress.completed]: {
48
+ width: size === 'small' ? 20 : 40,
49
+ height: size === 'small' ? 20 : 40
50
+ }
51
+ }
52
+ });
53
+ export const Tile = /*#__PURE__*/_styled(FlexBox, {
54
+ target: "e4znlwe0",
55
+ label: "Tile"
56
+ })(props => ({
57
+ ...hoverVariants(props.hover)(props),
58
+ ...sizeVariants(props.size)(props),
59
+ ...variant({
60
+ prop: 'progress',
61
+ base: {
62
+ ...tileStyles
63
+ },
64
+ variants: {
65
+ [Progress.notStarted]: {
66
+ bg: 'background-selected'
67
+ },
68
+ [Progress.inProgress]: {
69
+ bg: 'background-selected'
70
+ },
71
+ [Progress.completed]: {
72
+ bg: 'primary'
73
+ }
74
+ }
75
+ })(props)
76
+ }), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9MZWFybmluZ091dGNvbWVUaWxlL1RpbGUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFEb0IiLCJmaWxlIjoiLi4vLi4vc3JjL0xlYXJuaW5nT3V0Y29tZVRpbGUvVGlsZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBGbGV4Qm94IH0gZnJvbSAnQGNvZGVjYWRlbXkvZ2FtdXQnO1xuaW1wb3J0IHsgdmFyaWFudCB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0LXN0eWxlcyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmltcG9ydCB7IFByb2dyZXNzLCBTaXplVHlwZSwgVGlsZVByb3BzIH0gZnJvbSAnLi90eXBlcyc7XG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ogJ3ByaW1hcnknLFxuICAgICAgfSxcbiAgICB9LFxuICB9KShwcm9wcyksXG59KSk7XG4iXX0= */");
@@ -0,0 +1,2 @@
1
+ import { LearningOutcomeTileProps } from './types';
2
+ export declare const LearningOutcomeTile: React.FC<LearningOutcomeTileProps>;
@@ -0,0 +1,73 @@
1
+ import { Text } from '@codecademy/gamut';
2
+ import { SmallCheckIcon } from '@codecademy/gamut-icons';
3
+ import { useRef, useState } from 'react';
4
+ import { LearningOutcomeLowAssessmentDot } from '../LearningOutcomeBadges';
5
+ import { LearningOutcomePopover } from '../LearningOutcomePopover';
6
+ import { Tile } from './Tile';
7
+ import { Progress } from './types';
8
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
9
+ const progressState = percentComplete => {
10
+ if (!percentComplete || percentComplete === 0) {
11
+ return Progress.notStarted;
12
+ }
13
+ if (percentComplete > 0 && percentComplete < 100) {
14
+ return Progress.inProgress;
15
+ }
16
+ return Progress.completed;
17
+ };
18
+ export const LearningOutcomeTile = ({
19
+ learningOutcomeDetails,
20
+ popover = false,
21
+ hover = false,
22
+ size = 'normal'
23
+ }) => {
24
+ const {
25
+ id,
26
+ latestScore,
27
+ percentComplete
28
+ } = learningOutcomeDetails || {};
29
+ const [isOpen, setIsOpen] = useState(false);
30
+ const activeElRef = useRef(null);
31
+ const hoverProps = popover && hover ? {
32
+ ref: activeElRef,
33
+ tabIndex: 0,
34
+ onMouseEnter: () => setIsOpen(true),
35
+ onMouseLeave: () => setIsOpen(false),
36
+ onFocus: () => setIsOpen(true),
37
+ // For keyboard users
38
+ onBlur: () => setIsOpen(false),
39
+ // Close on blur
40
+ 'aria-describedby': `${id}-popover`
41
+ } : {};
42
+ const lowLatestAssessment = Boolean(latestScore != null && latestScore < 70);
43
+ const progress = progressState(percentComplete);
44
+ const progressText = progress === Progress.inProgress ? `${percentComplete}%` : '';
45
+ return /*#__PURE__*/_jsxs(_Fragment, {
46
+ children: [/*#__PURE__*/_jsxs(Tile, {
47
+ hover: hover,
48
+ progress: progress,
49
+ size: size,
50
+ ...hoverProps,
51
+ children: [progress === Progress.completed ? /*#__PURE__*/_jsx(SmallCheckIcon, {
52
+ size: size === 'small' ? 12 : 16,
53
+ textColor: "background-contrast"
54
+ }) : /*#__PURE__*/_jsx(Text, {
55
+ fontSize: 14,
56
+ fontWeight: 700,
57
+ children: progressText
58
+ }), size !== 'small' && lowLatestAssessment && /*#__PURE__*/_jsx(LearningOutcomeLowAssessmentDot, {
59
+ position: "absolute",
60
+ top: "-20%",
61
+ right: "-20%",
62
+ hasBorder: true
63
+ })]
64
+ }), isOpen && /*#__PURE__*/_jsx(LearningOutcomePopover, {
65
+ id: `${id}-popover`,
66
+ activeElRef: activeElRef,
67
+ isOpen: isOpen,
68
+ setIsOpen: setIsOpen,
69
+ horizontalOffset: size === 'small' ? 150 : 175,
70
+ learningOutcomeDetails: learningOutcomeDetails
71
+ })]
72
+ });
73
+ };
@@ -0,0 +1,38 @@
1
+ export declare enum Progress {
2
+ notStarted = "notStarted",
3
+ inProgress = "inProgress",
4
+ completed = "completed"
5
+ }
6
+ export type SizeType = 'small' | 'normal';
7
+ export interface TileProps {
8
+ hover: boolean;
9
+ progress: Progress;
10
+ size: SizeType;
11
+ }
12
+ interface LearningOutcomeTileDetailsProps {
13
+ id: string;
14
+ percentComplete: number | undefined;
15
+ latestScore?: number;
16
+ }
17
+ export interface LearningOutcomePopoverDetailsProps {
18
+ id: string;
19
+ percentComplete: number | undefined;
20
+ level: number;
21
+ outcome: string;
22
+ latestScore?: number;
23
+ highestScore?: number;
24
+ }
25
+ interface LearningOutcomeTileWithPopover {
26
+ learningOutcomeDetails: LearningOutcomePopoverDetailsProps;
27
+ hover?: boolean;
28
+ popover: true;
29
+ size?: SizeType;
30
+ }
31
+ interface LearningOutcomeTileWithoutPopover {
32
+ learningOutcomeDetails: LearningOutcomeTileDetailsProps;
33
+ hover?: boolean;
34
+ popover?: boolean;
35
+ size?: SizeType;
36
+ }
37
+ export type LearningOutcomeTileProps = LearningOutcomeTileWithPopover | LearningOutcomeTileWithoutPopover;
38
+ export {};
@@ -0,0 +1,6 @@
1
+ export let Progress = /*#__PURE__*/function (Progress) {
2
+ Progress["notStarted"] = "notStarted";
3
+ Progress["inProgress"] = "inProgress";
4
+ Progress["completed"] = "completed";
5
+ return Progress;
6
+ }({});
package/dist/index.d.ts CHANGED
@@ -45,8 +45,9 @@ export * from './InfoCard';
45
45
  export * from './Konamimojisplosion';
46
46
  export * from './LandingPage';
47
47
  export * from './LayoutMenu';
48
+ export * from './LearningOutcomeBadges';
48
49
  export * from './LearningOutcomeCard';
49
- export * from './LearningOutcomeSkillTile';
50
+ export * from './LearningOutcomeTile';
50
51
  export * from './lib/breakpointHooks';
51
52
  export * from './ListSection';
52
53
  export * from './Loading';
package/dist/index.js CHANGED
@@ -45,8 +45,9 @@ export * from './InfoCard';
45
45
  export * from './Konamimojisplosion';
46
46
  export * from './LandingPage';
47
47
  export * from './LayoutMenu';
48
+ export * from './LearningOutcomeBadges';
48
49
  export * from './LearningOutcomeCard';
49
- export * from './LearningOutcomeSkillTile';
50
+ export * from './LearningOutcomeTile';
50
51
  export * from './lib/breakpointHooks';
51
52
  export * from './ListSection';
52
53
  export * from './Loading';
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { LearningOutcomeLevelBadge } from '../../LearningOutcomeBadges';
3
+ declare const meta: Meta<typeof LearningOutcomeLevelBadge>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof LearningOutcomeLevelBadge>;
6
+ export declare const AllLevels: Story;
@@ -0,0 +1,20 @@
1
+ import { FlexBox } from '@codecademy/gamut';
2
+ import { LearningOutcomeLevelBadge } from '../../LearningOutcomeBadges';
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ const meta = {
5
+ component: LearningOutcomeLevelBadge
6
+ };
7
+ export default meta;
8
+ export const AllLevels = {
9
+ render: () => /*#__PURE__*/_jsxs(FlexBox, {
10
+ gap: 16,
11
+ children: [/*#__PURE__*/_jsx(LearningOutcomeLevelBadge, {
12
+ level: 1
13
+ }), /*#__PURE__*/_jsx(LearningOutcomeLevelBadge, {
14
+ level: 2
15
+ }), /*#__PURE__*/_jsx(LearningOutcomeLevelBadge, {
16
+ level: 3
17
+ })]
18
+ }),
19
+ name: 'Learning Outcome Level Badge - All Levels'
20
+ };
@@ -1,9 +1,10 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
- import { LearningOutcomeSkillTile } from '../../LearningOutcomeSkillTile';
3
- declare const meta: Meta<typeof LearningOutcomeSkillTile>;
2
+ import { LearningOutcomeTile } from '../../LearningOutcomeTile';
3
+ declare const meta: Meta<typeof LearningOutcomeTile>;
4
4
  export default meta;
5
- type Story = StoryObj<typeof LearningOutcomeSkillTile>;
5
+ type Story = StoryObj<typeof LearningOutcomeTile>;
6
6
  export declare const Default: Story;
7
7
  export declare const WithLowAssessments: Story;
8
+ export declare const WithPopover: Story;
8
9
  export declare const Small: Story;
9
10
  export declare const DarkMode: Story;
@@ -0,0 +1,199 @@
1
+ import { FlexBox } from '@codecademy/gamut';
2
+ import { Background } from '@codecademy/gamut-styles';
3
+ import { LearningOutcomeTile } from '../../LearningOutcomeTile';
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ const meta = {
6
+ component: LearningOutcomeTile,
7
+ args: {
8
+ learningOutcomeDetails: {
9
+ id: '1',
10
+ percentComplete: 0
11
+ },
12
+ size: 'normal'
13
+ }
14
+ };
15
+ export default meta;
16
+ export const Default = {
17
+ render: args => /*#__PURE__*/_jsxs(FlexBox, {
18
+ gap: 16,
19
+ children: [/*#__PURE__*/_jsx(LearningOutcomeTile, {
20
+ ...args,
21
+ hover: true
22
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
23
+ ...args,
24
+ learningOutcomeDetails: {
25
+ id: '2',
26
+ percentComplete: 50
27
+ },
28
+ hover: true
29
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
30
+ ...args,
31
+ learningOutcomeDetails: {
32
+ id: '3',
33
+ percentComplete: 100
34
+ },
35
+ hover: true
36
+ })]
37
+ }),
38
+ name: 'Learning Outcome Tile - Default'
39
+ };
40
+ export const WithLowAssessments = {
41
+ render: args => /*#__PURE__*/_jsxs(FlexBox, {
42
+ gap: 16,
43
+ children: [/*#__PURE__*/_jsx(LearningOutcomeTile, {
44
+ ...args,
45
+ learningOutcomeDetails: {
46
+ id: '1',
47
+ percentComplete: 0,
48
+ latestScore: 50
49
+ },
50
+ hover: true
51
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
52
+ ...args,
53
+ learningOutcomeDetails: {
54
+ id: '2',
55
+ percentComplete: 50,
56
+ latestScore: 50
57
+ },
58
+ hover: true
59
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
60
+ ...args,
61
+ learningOutcomeDetails: {
62
+ id: '3',
63
+ percentComplete: 100,
64
+ latestScore: 50
65
+ },
66
+ hover: true
67
+ })]
68
+ }),
69
+ name: 'Learning Outcome Tile - with Low Assessment Indicator'
70
+ };
71
+ export const WithPopover = {
72
+ render: args => /*#__PURE__*/_jsxs(FlexBox, {
73
+ gap: 16,
74
+ children: [/*#__PURE__*/_jsx(LearningOutcomeTile, {
75
+ ...args,
76
+ learningOutcomeDetails: {
77
+ id: '1',
78
+ level: 1,
79
+ outcome: 'Understand the basics of programming',
80
+ percentComplete: 0
81
+ },
82
+ hover: true,
83
+ popover: true
84
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
85
+ ...args,
86
+ learningOutcomeDetails: {
87
+ id: '2',
88
+ level: 2,
89
+ outcome: 'Apply programming fundamentals',
90
+ percentComplete: 50,
91
+ highestScore: 65,
92
+ latestScore: 50
93
+ },
94
+ hover: true,
95
+ popover: true
96
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
97
+ ...args,
98
+ learningOutcomeDetails: {
99
+ id: '3',
100
+ level: 3,
101
+ outcome: 'Master advanced programming concepts',
102
+ percentComplete: 100,
103
+ highestScore: 70,
104
+ latestScore: 70
105
+ },
106
+ hover: true,
107
+ popover: true
108
+ })]
109
+ }),
110
+ name: 'Learning Outcome Tile - with Popover'
111
+ };
112
+ export const Small = {
113
+ render: args => /*#__PURE__*/_jsxs(FlexBox, {
114
+ gap: 16,
115
+ children: [/*#__PURE__*/_jsx(LearningOutcomeTile, {
116
+ ...args,
117
+ hover: true,
118
+ size: "small"
119
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
120
+ ...args,
121
+ learningOutcomeDetails: {
122
+ id: '2',
123
+ percentComplete: 50
124
+ },
125
+ hover: true,
126
+ size: "small"
127
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
128
+ ...args,
129
+ learningOutcomeDetails: {
130
+ id: '3',
131
+ percentComplete: 100
132
+ },
133
+ size: "small"
134
+ })]
135
+ }),
136
+ name: 'Learning Outcome Tile - Small'
137
+ };
138
+ export const DarkMode = {
139
+ render: args => /*#__PURE__*/_jsx(Background, {
140
+ bg: "navy",
141
+ p: 24,
142
+ children: /*#__PURE__*/_jsxs(FlexBox, {
143
+ gap: 16,
144
+ children: [/*#__PURE__*/_jsx(LearningOutcomeTile, {
145
+ ...args,
146
+ learningOutcomeDetails: {
147
+ id: '1',
148
+ percentComplete: 0,
149
+ latestScore: 50
150
+ },
151
+ hover: true
152
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
153
+ ...args,
154
+ learningOutcomeDetails: {
155
+ id: '2',
156
+ percentComplete: 50,
157
+ latestScore: 50
158
+ },
159
+ hover: true
160
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
161
+ ...args,
162
+ learningOutcomeDetails: {
163
+ id: '3',
164
+ percentComplete: 100,
165
+ latestScore: 50
166
+ },
167
+ hover: true
168
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
169
+ ...args,
170
+ learningOutcomeDetails: {
171
+ id: '4',
172
+ percentComplete: 0,
173
+ latestScore: 50
174
+ },
175
+ size: "small",
176
+ hover: true
177
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
178
+ ...args,
179
+ learningOutcomeDetails: {
180
+ id: '5',
181
+ percentComplete: 50,
182
+ latestScore: 50
183
+ },
184
+ size: "small",
185
+ hover: true
186
+ }), /*#__PURE__*/_jsx(LearningOutcomeTile, {
187
+ ...args,
188
+ learningOutcomeDetails: {
189
+ id: '6',
190
+ percentComplete: 100,
191
+ latestScore: 50
192
+ },
193
+ size: "small",
194
+ hover: true
195
+ })]
196
+ })
197
+ }),
198
+ name: 'Learning Outcome Tile - Dark Mode'
199
+ };
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.812b1cb81e.0",
4
+ "version": "1.19.0-alpha.c43bcf7814.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "dependencies": {
7
7
  "@emotion/is-prop-valid": "^1.2.1",
@@ -1,9 +0,0 @@
1
- type SizeType = 'small' | 'normal';
2
- interface LearningOutcomeSkillTileProps {
3
- progressPercentage: number | undefined;
4
- assessmentPercentage?: number;
5
- hover?: boolean;
6
- size?: SizeType;
7
- }
8
- export declare const LearningOutcomeSkillTile: React.FC<LearningOutcomeSkillTileProps>;
9
- export {};
@@ -1,127 +0,0 @@
1
- import _styled from "@emotion/styled/base";
2
- import { Box, FlexBox, Text } from '@codecademy/gamut';
3
- import { SmallCheckIcon } from '@codecademy/gamut-icons';
4
- import { variant } from '@codecademy/gamut-styles';
5
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
6
- var Progress = /*#__PURE__*/function (Progress) {
7
- Progress["notStarted"] = "notStarted";
8
- Progress["inProgress"] = "inProgress";
9
- Progress["completed"] = "completed";
10
- return Progress;
11
- }(Progress || {});
12
- const tileStyles = {
13
- alignItems: 'center',
14
- justifyContent: 'center',
15
- borderRadius: 'md',
16
- borderColor: 'border-tertiary',
17
- cursor: 'default',
18
- position: 'relative'
19
- };
20
- const hoverVariants = hover => variant({
21
- prop: 'progress',
22
- variants: {
23
- [Progress.notStarted]: {
24
- '&:hover': {
25
- bg: hover ? 'background-hover' : undefined
26
- }
27
- },
28
- [Progress.inProgress]: {
29
- '&:hover': {
30
- bg: hover ? 'background-hover' : undefined
31
- }
32
- },
33
- [Progress.completed]: {
34
- '&:hover': {
35
- bg: hover ? 'primary-hover' : undefined
36
- }
37
- }
38
- }
39
- });
40
- const sizeVariants = size => variant({
41
- prop: 'progress',
42
- base: {
43
- border: size === 'small' ? 'none' : 2
44
- },
45
- variants: {
46
- [Progress.notStarted]: {
47
- width: size === 'small' ? 32 : 40,
48
- height: size === 'small' ? 24 : 40
49
- },
50
- [Progress.inProgress]: {
51
- width: size === 'small' ? 32 : 40,
52
- height: size === 'small' ? 24 : 40
53
- },
54
- [Progress.completed]: {
55
- width: size === 'small' ? 20 : 40,
56
- height: size === 'small' ? 20 : 40
57
- }
58
- }
59
- });
60
- const Tile = /*#__PURE__*/_styled(FlexBox, {
61
- target: "e1io6ul10",
62
- label: "Tile"
63
- })(props => ({
64
- ...hoverVariants(props.hover)(props),
65
- ...sizeVariants(props.size)(props),
66
- ...variant({
67
- prop: 'progress',
68
- base: {
69
- ...tileStyles
70
- },
71
- variants: {
72
- [Progress.notStarted]: {
73
- bg: 'background-selected'
74
- },
75
- [Progress.inProgress]: {
76
- bg: 'background-selected'
77
- },
78
- [Progress.completed]: {
79
- bg: 'primary'
80
- }
81
- }
82
- })(props)
83
- }), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9MZWFybmluZ091dGNvbWVTa2lsbFRpbGUvaW5kZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlFYSIsImZpbGUiOiIuLi8uLi9zcmMv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2l6ZT17c2l6ZSA9PT0gJ3NtYWxsJyA/IDEyIDogMTZ9XG4gICAgICAgICAgICB0ZXh0Q29sb3I9XCJiYWNrZ3JvdW5kLWNvbnRyYXN0XCJcbiAgICAgICAgICAvPlxuICAgICAgICApIDogKFxuICAgICAgICAgIDxUZXh0IGZvbnRTaXplPXsxNH0gZm9udFdlaWdodD17NzAwfT5cbiAgICAgICAgICAgIHtwcm9ncmVzc1RleHR9XG4gICAgICAgICAgPC9UZXh0PlxuICAgICAgICApfVxuICAgICAgICB7c2l6ZSAhPT0gJ3NtYWxsJyAmJiBsb3dBc3Nlc3NtZW50ICYmIChcbiAgICAgICAgICA8Qm94XG4gICAgICAgICAgICBiZz1cIm9yYW5nZS01MDBcIlxuICAgICAgICAgICAgYm9yZGVyPXsyfVxuICAgICAgICAgICAgYm9yZGVyQ29sb3I9XCJiYWNrZ3JvdW5kLWNvbnRyYXN0XCJcbiAgICAgICAgICAgIGJvcmRlclJhZGl1cz1cImZ1bGxcIlxuICAgICAgICAgICAgaGVpZ2h0PXsxNn1cbiAgICAgICAgICAgIHdpZHRoPXsxNn1cbiAgICAgICAgICAgIHBvc2l0aW9uPVwiYWJzb2x1dGVcIlxuICAgICAgICAgICAgdG9wPVwiLTIwJVwiXG4gICAgICAgICAgICByaWdodD1cIi0yMCVcIlxuICAgICAgICAgIC8+XG4gICAgICAgICl9XG4gICAgICA8L1RpbGU+XG4gICAgPC8+XG4gICk7XG59O1xuIl19 */");
84
- const progressState = progressPercentage => {
85
- if (!progressPercentage || progressPercentage === 0) {
86
- return Progress.notStarted;
87
- }
88
- if (progressPercentage > 0 && progressPercentage < 100) {
89
- return Progress.inProgress;
90
- }
91
- return Progress.completed;
92
- };
93
- export const LearningOutcomeSkillTile = ({
94
- assessmentPercentage,
95
- progressPercentage,
96
- hover = false,
97
- size = 'normal'
98
- }) => {
99
- const lowAssessment = assessmentPercentage && assessmentPercentage < 70;
100
- const progress = progressState(progressPercentage);
101
- const progressText = progress === Progress.inProgress ? `${progressPercentage}%` : '';
102
- return /*#__PURE__*/_jsx(_Fragment, {
103
- children: /*#__PURE__*/_jsxs(Tile, {
104
- hover: hover,
105
- progress: progress,
106
- size: size,
107
- children: [progress === Progress.completed ? /*#__PURE__*/_jsx(SmallCheckIcon, {
108
- size: size === 'small' ? 12 : 16,
109
- textColor: "background-contrast"
110
- }) : /*#__PURE__*/_jsx(Text, {
111
- fontSize: 14,
112
- fontWeight: 700,
113
- children: progressText
114
- }), size !== 'small' && lowAssessment && /*#__PURE__*/_jsx(Box, {
115
- bg: "orange-500",
116
- border: 2,
117
- borderColor: "background-contrast",
118
- borderRadius: "full",
119
- height: 16,
120
- width: 16,
121
- position: "absolute",
122
- top: "-20%",
123
- right: "-20%"
124
- })]
125
- })
126
- });
127
- };
@@ -1,109 +0,0 @@
1
- import { FlexBox } from '@codecademy/gamut';
2
- import { Background } from '@codecademy/gamut-styles';
3
- import { LearningOutcomeSkillTile } from '../../LearningOutcomeSkillTile';
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- const meta = {
6
- component: LearningOutcomeSkillTile,
7
- args: {
8
- progressPercentage: 50,
9
- assessmentPercentage: 100,
10
- size: 'normal'
11
- }
12
- };
13
- export default meta;
14
- export const Default = {
15
- render: args => /*#__PURE__*/_jsxs(FlexBox, {
16
- gap: 16,
17
- children: [/*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
18
- ...args,
19
- progressPercentage: 0,
20
- hover: true
21
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
22
- ...args,
23
- hover: true
24
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
25
- ...args,
26
- progressPercentage: 100,
27
- hover: true
28
- })]
29
- }),
30
- name: 'Learning Outcome Skill Tile - Default'
31
- };
32
- export const WithLowAssessments = {
33
- render: args => /*#__PURE__*/_jsxs(FlexBox, {
34
- gap: 16,
35
- children: [/*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
36
- ...args,
37
- progressPercentage: 0,
38
- assessmentPercentage: 68,
39
- hover: true
40
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
41
- ...args,
42
- assessmentPercentage: 68,
43
- hover: true
44
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
45
- ...args,
46
- progressPercentage: 100,
47
- assessmentPercentage: 68,
48
- hover: true
49
- })]
50
- }),
51
- name: 'Learning Outcome Skill Tile - Small'
52
- };
53
- export const Small = {
54
- render: args => /*#__PURE__*/_jsxs(FlexBox, {
55
- gap: 16,
56
- children: [/*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
57
- ...args,
58
- progressPercentage: 0,
59
- size: "small"
60
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
61
- ...args,
62
- size: "small"
63
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
64
- ...args,
65
- progressPercentage: 100,
66
- size: "small"
67
- })]
68
- }),
69
- name: 'Learning Outcome Skill Tile - Small'
70
- };
71
- export const DarkMode = {
72
- render: args => /*#__PURE__*/_jsx(Background, {
73
- bg: "navy",
74
- p: 24,
75
- children: /*#__PURE__*/_jsxs(FlexBox, {
76
- gap: 16,
77
- children: [/*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
78
- ...args,
79
- progressPercentage: 0,
80
- assessmentPercentage: 68,
81
- hover: true
82
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
83
- ...args,
84
- assessmentPercentage: 68,
85
- hover: true
86
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
87
- ...args,
88
- progressPercentage: 100,
89
- assessmentPercentage: 68,
90
- hover: true
91
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
92
- ...args,
93
- progressPercentage: 0,
94
- size: "small",
95
- hover: true
96
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
97
- ...args,
98
- size: "small",
99
- hover: true
100
- }), /*#__PURE__*/_jsx(LearningOutcomeSkillTile, {
101
- ...args,
102
- progressPercentage: 100,
103
- size: "small",
104
- hover: true
105
- })]
106
- })
107
- }),
108
- name: 'Learning Outcome Skill Tile - Dark Mode'
109
- };