@oaknational/oak-components 3.22.1 → 3.22.3
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/npm/cjs/index.js +274 -254
- package/dist/npm/cjs/types.d.ts +1242 -953
- package/dist/npm/es/components/form-elements/OakCheckBox/OakCheckBox.js +2 -2
- package/dist/npm/es/components/form-elements/OakMultilineText/OakMultilineText.js +1 -1
- package/dist/npm/es/components/form-elements/OakSearchFilterCheckBox/OakSearchFilterCheckBox.js +1 -2
- package/dist/npm/es/components/form-elements/OakSelect/NativeSelect.js +1 -1
- package/dist/npm/es/components/images-and-icons/OakImage/OakImage.js +1 -1
- package/dist/npm/es/components/internal-components/InternalCheckBoxLabel/InternalCheckBoxLabel.js +1 -1
- package/dist/npm/es/components/internal-components/InternalChevronAccordion/InternalChevronAccordion.js +3 -3
- package/dist/npm/es/components/internal-components/InternalModalTransition/InternalModalTransition.js +2 -2
- package/dist/npm/es/components/internal-components/InternalShadowIconButton/InternalShadowIconButton.js +1 -1
- package/dist/npm/es/components/internal-components/InternalShadowRoundButton/InternalShadowRoundButton.js +2 -3
- package/dist/npm/es/components/internal-components/InternalSlideInFlex/InternalSlideInFlex.js +8 -8
- package/dist/npm/es/components/internal-components/InternalTextInput/InternalTextInput.js +1 -1
- package/dist/npm/es/components/layout-and-structure/OakBox/OakBox.js +1 -1
- package/dist/npm/es/components/layout-and-structure/OakGrid/OakGrid.js +1 -1
- package/dist/npm/es/components/messaging-and-feedback/OakFocusIndicator/OakFocusIndicator.js +7 -5
- package/dist/npm/es/components/messaging-and-feedback/OakLoadingSpinner/OakLoadingSpinner.js +13 -7
- package/dist/npm/es/components/messaging-and-feedback/OakTagFunctional/OakTagFunctional.js +4 -4
- package/dist/npm/es/components/navigation/OakCard/OakCard.js +1 -1
- package/dist/npm/es/components/navigation/OakLink/OakLink.js +7 -3
- package/dist/npm/es/components/navigation/OakPagination/OakPagination.js +9 -9
- package/dist/npm/es/components/owa/OakHomepageTabButton/OakHomepageTabButton.js +1 -1
- package/dist/npm/es/components/owa/OakLinkCard/OakLinkCard.js +3 -3
- package/dist/npm/es/components/owa/OakMediaClip/OakMediaClip.js +1 -1
- package/dist/npm/es/components/owa/OakSaveCount/OakSaveCount.js +1 -1
- package/dist/npm/es/components/owa/OakSideMenuNavLink/OakSideMenuNavLink.js +6 -6
- package/dist/npm/es/components/owa/pupil/OakUnitListItem/OakUnitListItem.js +7 -3
- package/dist/npm/es/components/owa/pupil/OakUnitListOptionalityItem/OakUnitListOptionalityItem.js +1 -1
- package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyLayout/OakPupilJourneyLayout.js +2 -2
- package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyListItem/OakPupilJourneyListItem.js +1 -1
- package/dist/npm/es/components/owa/pupil/lesson/OakLessonLayout/OakLessonLayout.js +2 -2
- package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewItem/OakPupilLessonReviewItem.js +3 -3
- package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewQuiz/OakPupilLessonReviewQuiz.js +9 -9
- package/dist/npm/es/components/owa/pupil/quiz/OakQuizCheckBox/OakQuizCheckBox.js +1 -1
- package/dist/npm/es/components/owa/teacher/OakInlineRegistrationBanner/OakInlineRegistrationBanner.js +5 -2
- package/dist/npm/es/styles/utils/borderStyle.js +1 -1
- package/dist/npm/es/styles/utils/colorFilterStyle.js +1 -1
- package/dist/npm/es/styles/utils/responsiveStyle.js +9 -4
- package/dist/npm/es/types.d.ts +1242 -953
- package/package.json +2 -2
|
@@ -26,10 +26,12 @@ var StyledOakIndexBox = styled(OakFlex)(templateObject_5 || (templateObject_5 =
|
|
|
26
26
|
* OakUnitsListItem component used as links for unit cards
|
|
27
27
|
*/
|
|
28
28
|
var OakUnitListItem = function (props) {
|
|
29
|
-
var lessonCount = props.lessonCount, href = props.href, unavailable = props.unavailable, onClick = props.onClick, index = props.index, isLegacy = props.isLegacy, firstItemRef = props.firstItemRef, _a = props.as, as = _a === void 0 ? "a" : _a
|
|
29
|
+
var lessonCount = props.lessonCount, href = props.href, unavailable = props.unavailable, onClick = props.onClick, index = props.index, isLegacy = props.isLegacy, firstItemRef = props.firstItemRef, _a = props.as, as = _a === void 0 ? "a" : _a; props.yearTitle; var rest = __rest(props, ["lessonCount", "href", "unavailable", "onClick", "index", "isLegacy", "firstItemRef", "as", "yearTitle"]);
|
|
30
30
|
return (React.createElement(OakLI, { "$listStyle": "none", "$width": "100%" },
|
|
31
31
|
React.createElement(StyledUnitListItem, __assign({ "$alignItems": "center", "$background": unavailable ? "bg-neutral" : "bg-primary", "$borderRadius": "border-radius-m", "$disabled": unavailable, "$pr": "spacing-16", "$width": "100%", "$display": ["none", "flex"] }, rest),
|
|
32
|
-
React.createElement(FlexWithFocus, { "$pr": "spacing-0", "$borderRadius": "border-radius-m", "$gap": "spacing-16", "$alignItems": "center", "$width": "100%", "$height": "100%",
|
|
32
|
+
React.createElement(FlexWithFocus, { "$pr": "spacing-0", "$borderRadius": "border-radius-m", "$gap": "spacing-16", "$alignItems": "center", "$width": "100%", "$height": "100%",
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
as: as, href: unavailable ? undefined : href, ref: firstItemRef, onClick: unavailable ? undefined : onClick },
|
|
33
35
|
React.createElement(StyledOakIndexBox, { "$background": unavailable
|
|
34
36
|
? "bg-neutral-stronger"
|
|
35
37
|
: isLegacy
|
|
@@ -45,7 +47,9 @@ var OakUnitListItem = function (props) {
|
|
|
45
47
|
React.createElement(OakIcon, { iconName: "chevron-right", iconWidth: "spacing-32", "$colorFilter": unavailable ? "text-disabled" : "text-primary" })))),
|
|
46
48
|
React.createElement(StyledUnitListItem, __assign({ "$background": unavailable ? "bg-neutral" : "bg-primary", "$borderRadius": "border-radius-m", "$disabled": unavailable, "$display": ["flex", "none"], "$width": "100%", "$pa": "spacing-16" }, rest),
|
|
47
49
|
React.createElement(OakFlex, { "$flexDirection": "column", "$gap": "spacing-16", "$width": "100%" },
|
|
48
|
-
React.createElement(OakFlex, { "$gap": "spacing-16",
|
|
50
|
+
React.createElement(OakFlex, { "$gap": "spacing-16",
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
+
as: as, href: unavailable ? undefined : href },
|
|
49
53
|
React.createElement(OakFlex, { "$background": unavailable
|
|
50
54
|
? "bg-neutral-stronger"
|
|
51
55
|
: isLegacy
|
package/dist/npm/es/components/owa/pupil/OakUnitListOptionalityItem/OakUnitListOptionalityItem.js
CHANGED
|
@@ -33,7 +33,7 @@ var StyledUnitHeading = function (_a) {
|
|
|
33
33
|
* OakUnitsListOptionalityItem component used as links for unit cards with optionality
|
|
34
34
|
*/
|
|
35
35
|
var OakUnitListOptionalityItem = function (props) {
|
|
36
|
-
var unavailable = props.unavailable, index = props.index, optionalityUnits = props.optionalityUnits, nullTitle = props.nullTitle, firstItemRef = props.firstItemRef; props.onSave; props.getIsSaved; props.getIsSaving; var rest = __rest(props, ["unavailable", "index", "optionalityUnits", "nullTitle", "firstItemRef", "onSave", "getIsSaved", "getIsSaving"]);
|
|
36
|
+
var unavailable = props.unavailable, index = props.index, optionalityUnits = props.optionalityUnits, nullTitle = props.nullTitle, firstItemRef = props.firstItemRef; props.onSave; props.getIsSaved; props.getIsSaving; props.yearTitle; var rest = __rest(props, ["unavailable", "index", "optionalityUnits", "nullTitle", "firstItemRef", "onSave", "getIsSaved", "getIsSaving", "yearTitle"]);
|
|
37
37
|
return (React.createElement(OakFlex, __assign({ "$flexDirection": ["column", "row", "row"], "$width": "100%", as: "li", "$background": "bg-primary", "$borderRadius": "border-radius-m" }, rest),
|
|
38
38
|
React.createElement(OakFlex, { "$display": ["flex", "none"], "$ph": "spacing-16", "$pt": "spacing-16", "$gap": "spacing-16" },
|
|
39
39
|
React.createElement(UnitIndex, { unavailable: unavailable, "$bbrr": "border-radius-s", "$btrr": "border-radius-s" }, index),
|
package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyLayout/OakPupilJourneyLayout.js
CHANGED
|
@@ -5,7 +5,7 @@ import { OakFlex } from '../../../../layout-and-structure/OakFlex/OakFlex.js';
|
|
|
5
5
|
import { getBreakpoint } from '../../../../../styles/utils/responsiveStyle.js';
|
|
6
6
|
import { backgrounds } from '../../../../../image-map.js';
|
|
7
7
|
|
|
8
|
-
var StyledLayoutBox = styled(OakFlex)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (min-width: ", "px) {\n ", "\n"], ["\n @media (min-width: ", "px) {\n ", "\n"])), getBreakpoint("large"), function (props) { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-image: url(", ");\n background-repeat: no-repeat;\n background-position-x: center;\n background-size: 100%;\n "], ["\n background-image: url(", ");\n background-repeat: no-repeat;\n background-position-x: center;\n background-size: 100%;\n "])), getBackgroundUrlForSection(props
|
|
8
|
+
var StyledLayoutBox = styled(OakFlex)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (min-width: ", "px) {\n ", "\n }\n"], ["\n @media (min-width: ", "px) {\n ", "\n }\n"])), getBreakpoint("large"), function (props) { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-image: url(", ");\n background-repeat: no-repeat;\n background-position-x: center;\n background-size: 100%;\n "], ["\n background-image: url(", ");\n background-repeat: no-repeat;\n background-position-x: center;\n background-size: 100%;\n "])), getBackgroundUrlForSection(props.$sectionName, props === null || props === void 0 ? void 0 : props.$phase)); });
|
|
9
9
|
/**
|
|
10
10
|
* Provides overall page layout and colours for the pupil journey
|
|
11
11
|
*
|
|
@@ -34,7 +34,7 @@ var OakPupilJourneyLayout = function (_a) {
|
|
|
34
34
|
return "bg-decorative1-main";
|
|
35
35
|
}
|
|
36
36
|
})();
|
|
37
|
-
return (React.createElement(StyledLayoutBox, { "$background": backgroundColor, "$flexDirection": "column", "$alignItems": "center", "$ph": ["spacing-12", "spacing-24"], sectionName: sectionName, phase: phase },
|
|
37
|
+
return (React.createElement(StyledLayoutBox, { "$background": backgroundColor, "$flexDirection": "column", "$alignItems": "center", "$ph": ["spacing-12", "spacing-24"], "$sectionName": sectionName, "$phase": phase },
|
|
38
38
|
topNavSlot && (React.createElement(OakFlex, { "$height": ["spacing-80", "spacing-92", "spacing-120"], "$alignItems": "center", "$width": ["100%", "100%", "spacing-1280"] }, topNavSlot)),
|
|
39
39
|
children));
|
|
40
40
|
};
|
package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyListItem/OakPupilJourneyListItem.js
CHANGED
|
@@ -23,7 +23,7 @@ var FlexedOakBox = styled(OakBox)(templateObject_7 || (templateObject_7 = __make
|
|
|
23
23
|
* Enables navigation to the given section of a lesson as well as displaying current progress
|
|
24
24
|
*/
|
|
25
25
|
var OakPupilJourneyListItem = function (props) {
|
|
26
|
-
var as = props.as; props.lessonSectionName; props.progress; var disabled = props.disabled, href = props.href, unavailable = props.unavailable, onClick = props.onClick
|
|
26
|
+
var as = props.as; props.lessonSectionName; props.progress; var disabled = props.disabled, href = props.href, unavailable = props.unavailable, onClick = props.onClick; props.numberOfLessons; var rest = __rest(props, ["as", "lessonSectionName", "progress", "disabled", "href", "unavailable", "onClick", "numberOfLessons"]);
|
|
27
27
|
var disabledOrUnavailable = disabled || unavailable;
|
|
28
28
|
return (React.createElement(OakBox, { role: "listitem" },
|
|
29
29
|
React.createElement(StyledPupilJourneyItem, __assign({ className: disabledOrUnavailable ? undefined : "pupil-journey-item", as: disabledOrUnavailable ? "div" : (as !== null && as !== void 0 ? as : "a"), "$gap": ["spacing-16", "spacing-32"], "$alignItems": "center", "$justifyContent": "space-between", "$flexWrap": "wrap", "$background": unavailable ? "bg-neutral" : "bg-primary", "$pa": ["spacing-20", "spacing-24"], "$borderRadius": "border-radius-m", "$ba": unavailable ? "border-solid-m" : "border-solid-none", "$borderColor": unavailable ? "border-neutral-lighter" : "transparent", "$disabled": disabledOrUnavailable, "$color": "text-primary", href: disabledOrUnavailable ? undefined : href, onClick: disabledOrUnavailable ? undefined : onClick }, rest),
|
|
@@ -23,7 +23,7 @@ var lessonSectionNames = [
|
|
|
23
23
|
* `OakBox` does not support space-between tokens on `padding` only `margin`, so we need to
|
|
24
24
|
* set it here to apply appropriate padding to the top of the content.
|
|
25
25
|
*/
|
|
26
|
-
var StyledLayoutBox = styled(OakBox)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (min-width: ", "px) {\n padding-top: ", ";\n }\n @media (min-width: ", "px) {\n ", "\n background-repeat: no-repeat;\n background-position-x: center;\n background-size: 100%;\n }\n"], ["\n @media (min-width: ", "px) {\n padding-top: ", ";\n }\n @media (min-width: ", "px) {\n ", "\n background-repeat: no-repeat;\n background-position-x: center;\n background-size: 100%;\n }\n"])), getBreakpoint("small"), parseSpacing("spacing-56"), getBreakpoint("large"), function (props) { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), getBackgroundUrlForLesson(props
|
|
26
|
+
var StyledLayoutBox = styled(OakBox)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (min-width: ", "px) {\n padding-top: ", ";\n }\n @media (min-width: ", "px) {\n ", "\n background-repeat: no-repeat;\n background-position-x: center;\n background-size: 100%;\n }\n"], ["\n @media (min-width: ", "px) {\n padding-top: ", ";\n }\n @media (min-width: ", "px) {\n ", "\n background-repeat: no-repeat;\n background-position-x: center;\n background-size: 100%;\n }\n"])), getBreakpoint("small"), parseSpacing("spacing-56"), getBreakpoint("large"), function (props) { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), getBackgroundUrlForLesson(props.$sectionName, props.$phase, props.$celebrate)); });
|
|
27
27
|
var StickyFooter = styled(OakBox)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: sticky;\n bottom: 0;\n z-index: 10;\n"], ["\n position: sticky;\n bottom: 0;\n z-index: 10;\n"])));
|
|
28
28
|
/**
|
|
29
29
|
* Provides overall page layout and colours for the sections of a lesson.
|
|
@@ -31,7 +31,7 @@ var StickyFooter = styled(OakBox)(templateObject_3 || (templateObject_3 = __make
|
|
|
31
31
|
var OakLessonLayout = function (_a) {
|
|
32
32
|
var lessonSectionName = _a.lessonSectionName, _b = _a.phase, phase = _b === void 0 ? "primary" : _b, _c = _a.celebrate, celebrate = _c === void 0 ? false : _c, topNavSlot = _a.topNavSlot, bottomNavSlot = _a.bottomNavSlot, children = _a.children;
|
|
33
33
|
var _d = __read(pickSectionColours(lessonSectionName, phase), 4), pageBackgroundColor = _d[0], contentBackgroundColor = _d[1], contentBorderColor = _d[2], mobileContentBackgroundColor = _d[3];
|
|
34
|
-
return (React.createElement(StyledLayoutBox, { "$display": "flex", "$width": "100%", "$minHeight": "100%", "$ph": ["spacing-0", "spacing-24"], "$background": pageBackgroundColor, sectionName: lessonSectionName, celebrate: celebrate, phase: phase },
|
|
34
|
+
return (React.createElement(StyledLayoutBox, { "$display": "flex", "$width": "100%", "$minHeight": "100%", "$ph": ["spacing-0", "spacing-24"], "$background": pageBackgroundColor, "$sectionName": lessonSectionName, "$celebrate": celebrate, "$phase": phase },
|
|
35
35
|
React.createElement(OakFlex, { "$flexDirection": "column", "$flexGrow": 1, "$background": [mobileContentBackgroundColor, "transparent"], "$maxWidth": "spacing-1280", "$minHeight": "100%", "$mh": "auto", "$position": "relative" },
|
|
36
36
|
React.createElement(OakBox, { "$display": ["none", "block"] },
|
|
37
37
|
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%", viewBox: "0 0 1308 943", fill: "none", style: {
|
package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewItem/OakPupilLessonReviewItem.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __makeTemplateObject,
|
|
1
|
+
import { __makeTemplateObject, __read } from 'tslib';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { OakBox } from '../../../../layout-and-structure/OakBox/OakBox.js';
|
|
@@ -9,14 +9,14 @@ import { OakRoundIcon } from '../../../../images-and-icons/OakRoundIcon/OakRound
|
|
|
9
9
|
|
|
10
10
|
var StyledLessonReviewItem = styled(OakFlex)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n outline: none;\n text-align: initial;\n"], ["\n outline: none;\n text-align: initial;\n"])));
|
|
11
11
|
var OakLessonReviewItem = function (props) {
|
|
12
|
-
var completed = props.completed, lessonSectionName = props.lessonSectionName
|
|
12
|
+
var completed = props.completed, lessonSectionName = props.lessonSectionName;
|
|
13
13
|
var _a = __read(pickColorsForSection(lessonSectionName), 3), completedBackgroundColor = _a[0], borderColor = _a[1], iconBackgroundColor = _a[2];
|
|
14
14
|
var lessonSectionNameToIconMap = new Map();
|
|
15
15
|
lessonSectionNameToIconMap.set("intro", "intro");
|
|
16
16
|
lessonSectionNameToIconMap.set("starter-quiz", "quiz");
|
|
17
17
|
lessonSectionNameToIconMap.set("exit-quiz", "quiz");
|
|
18
18
|
lessonSectionNameToIconMap.set("video", "video");
|
|
19
|
-
return (React.createElement(StyledLessonReviewItem,
|
|
19
|
+
return (React.createElement(StyledLessonReviewItem, { "$completed": completed, "$gap": "spacing-24", "$alignItems": "center", "$background": completed ? completedBackgroundColor : "bg-primary", "$ph": ["spacing-16", "spacing-24"], "$pv": "spacing-20", "$borderRadius": "border-radius-l", "$borderColor": completed ? completedBackgroundColor : borderColor, "$ba": "border-solid-l", "data-testid": props["data-testid"] },
|
|
20
20
|
React.createElement(OakRoundIcon, { iconName: lessonSectionNameToIconMap.get(lessonSectionName), "$width": "spacing-56", "$height": "spacing-56", "$background": iconBackgroundColor }),
|
|
21
21
|
React.createElement(OakFlex, { "$flexGrow": 1, "$flexShrink": 1, "$flexDirection": "column" },
|
|
22
22
|
React.createElement(OakBox, { "$font": ["heading-6", "heading-5"], "$color": "text-primary" }, pickLabelForSection(lessonSectionName)),
|
package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewQuiz/OakPupilLessonReviewQuiz.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __makeTemplateObject,
|
|
1
|
+
import { __makeTemplateObject, __read, __rest, __assign } from 'tslib';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { InternalReviewAccordion } from '../../../../internal-components/InternalReviewAccordion/InternalReviewAccordion.js';
|
|
@@ -10,8 +10,8 @@ import { OakRoundIcon } from '../../../../images-and-icons/OakRoundIcon/OakRound
|
|
|
10
10
|
|
|
11
11
|
var StyledLessonReviewItem = styled(OakFlex)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n outline: none;\n text-align: initial;\n"], ["\n outline: none;\n text-align: initial;\n"])));
|
|
12
12
|
var ReviewItemContainer = function (props) {
|
|
13
|
-
var children = props.children, rest = __rest(props, ["children"]);
|
|
14
|
-
return (React.createElement(StyledLessonReviewItem, __assign({ "$flexDirection": ["column", "column", "row"], "$justifyContent": "space-between", "$flexWrap": "wrap", "$ph": ["spacing-16", "spacing-24"], "$pv": "spacing-20", "$borderRadius": "border-radius-l", "$ba": "border-solid-l" }, rest), children));
|
|
13
|
+
var children = props.children, dataTestId = props["data-testid"], rest = __rest(props, ["children", "data-testid"]);
|
|
14
|
+
return (React.createElement(StyledLessonReviewItem, __assign({ "$flexDirection": ["column", "column", "row"], "$justifyContent": "space-between", "$flexWrap": "wrap", "$ph": ["spacing-16", "spacing-24"], "$pv": "spacing-20", "$borderRadius": "border-radius-l", "$ba": "border-solid-l", "data-testid": dataTestId }, rest), children));
|
|
15
15
|
};
|
|
16
16
|
var ReviewItemTitleSection = function (props) {
|
|
17
17
|
var sectionHeader = props.sectionHeader, completed = props.completed, summaryForIncomplete = props.summaryForIncomplete;
|
|
@@ -22,7 +22,7 @@ var ReviewItemTitleSection = function (props) {
|
|
|
22
22
|
"Completed")))));
|
|
23
23
|
};
|
|
24
24
|
var OakLessonReviewQuiz = function (props) {
|
|
25
|
-
var completed = props.completed, lessonSectionName = props.lessonSectionName, resultsSlot = props.resultsSlot,
|
|
25
|
+
var completed = props.completed, lessonSectionName = props.lessonSectionName, resultsSlot = props.resultsSlot, numQuestions = props.numQuestions, grade = props.grade, dataTestId = props["data-testid"];
|
|
26
26
|
var _a = __read(lessonSectionName === "starter-quiz"
|
|
27
27
|
? [
|
|
28
28
|
"bg-decorative1-very-subdued",
|
|
@@ -35,20 +35,20 @@ var OakLessonReviewQuiz = function (props) {
|
|
|
35
35
|
"bg-decorative5-main",
|
|
36
36
|
], 3), completedBackgroundColor = _a[0], borderColor = _a[1], iconBackgroundColor = _a[2];
|
|
37
37
|
var summaryForIncomplete = lessonSectionName === "starter-quiz"
|
|
38
|
-
? "Activate - ".concat(
|
|
39
|
-
: "Check - ".concat(
|
|
38
|
+
? "Activate - ".concat(numQuestions, " questions")
|
|
39
|
+
: "Check - ".concat(numQuestions, " questions");
|
|
40
40
|
var resultsToggleAriaLabel = lessonSectionName === "starter-quiz"
|
|
41
41
|
? "Starter quiz results"
|
|
42
42
|
: "Exit quiz results";
|
|
43
|
-
return (React.createElement(ReviewItemContainer,
|
|
43
|
+
return (React.createElement(ReviewItemContainer, { "$background": completed ? completedBackgroundColor : "bg-primary", "$borderColor": completed ? completedBackgroundColor : borderColor, "data-testid": dataTestId },
|
|
44
44
|
React.createElement(OakFlex, { "$gap": "spacing-24", "$alignItems": "center" },
|
|
45
45
|
React.createElement(OakRoundIcon, { iconName: "quiz", "$width": "spacing-56", "$height": "spacing-56", "$background": iconBackgroundColor }),
|
|
46
46
|
React.createElement(ReviewItemTitleSection, { sectionHeader: lessonSectionName === "exit-quiz" ? "Exit quiz" : "Starter quiz", completed: completed, summaryForIncomplete: summaryForIncomplete }),
|
|
47
47
|
completed && (React.createElement(OakBox, null,
|
|
48
|
-
React.createElement(OakSpan, { "$font": "heading-4" },
|
|
48
|
+
React.createElement(OakSpan, { "$font": "heading-4" }, grade),
|
|
49
49
|
React.createElement(OakSpan, { "$font": "heading-6" },
|
|
50
50
|
"\u00A0/\u00A0",
|
|
51
|
-
|
|
51
|
+
numQuestions)))),
|
|
52
52
|
completed && (React.createElement(InternalReviewAccordion, { initialOpen: false, id: "quiz-review-accordion-".concat(lessonSectionName), toggleButtonAriaLabel: resultsToggleAriaLabel }, resultsSlot))));
|
|
53
53
|
};
|
|
54
54
|
var templateObject_1;
|
|
@@ -44,7 +44,7 @@ var OakQuizCheckBox = function (props) {
|
|
|
44
44
|
var feedbackBgColor = showTick ? "bg-correct" : "bg-incorrect";
|
|
45
45
|
var feedbackBorderColor = showTick ? "border-success" : "border-error";
|
|
46
46
|
var inputCheckbox = (React.createElement(StyledFlexBox, { "$pa": "spacing-20", "$borderRadius": "border-radius-m2", "$borderColor": isHighlighted ? "border-decorative5-stronger" : "border-primary", "$background": disabled && !isFeedback ? "bg-neutral-stronger" : "bg-primary", "$flexGrow": 1, onClick: handleContainerClick, "$overlayBorderColor": isFeedback ? feedbackBorderColor : "text-disabled", "$feedbackBgColor": isFeedback ? feedbackBgColor : undefined, "$outlineColor": isHighlighted ? "border-decorative5-stronger" : "transparent" },
|
|
47
|
-
React.createElement(InternalCheckBoxLabelHoverDecor, { pointerEvents: "none", htmlFor: id, labelGap: "spacing-16", labelAlignItems: "center", "$color": disabled && !isFeedback ? "text-disabled" : "text-primary", "$font": "body-1", disabled: disabled },
|
|
47
|
+
React.createElement(InternalCheckBoxLabelHoverDecor, { pointerEvents: "none", htmlFor: id, "$labelGap": "spacing-16", "$labelAlignItems": "center", "$color": disabled && !isFeedback ? "text-disabled" : "text-primary", "$font": "body-1", disabled: disabled },
|
|
48
48
|
React.createElement(InternalCheckBoxWrapper, { size: "spacing-32", iconPadding: "spacing-4", checkedIcon: React.createElement(OakBox, { "$width": "100%", "$height": "100%", "$background": disabled || isFeedback ? "text-disabled" : "text-primary" },
|
|
49
49
|
React.createElement(OakBox, { "$ba": "border-solid-m", "$borderColor": "icon-inverted", "$width": "100%", "$height": "100%" })), internalCheckbox: React.createElement(StyledInternalCheckBox, __assign({ id: id, value: value, disabled: disabled || isFeedback }, rest, { "$width": "spacing-32", "$height": "spacing-32", "$ba": "border-solid-m", "$borderColor": "border-neutral", "$borderRadius": "border-radius-s", "$background": isHighlighted ? "bg-decorative5-main" : "bg-primary", "$checkedBackground": null, ref: inputRef })) }),
|
|
50
50
|
image ? imageContainer : displayValue),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { __rest, __read, __assign, __awaiter, __generator } from 'tslib';
|
|
1
|
+
import { __makeTemplateObject, __rest, __read, __assign, __awaiter, __generator } from 'tslib';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
3
4
|
import { SurfingStudentSVG } from './SurfingStudentSVG.js';
|
|
4
5
|
import { OakFlex } from '../../../layout-and-structure/OakFlex/OakFlex.js';
|
|
5
6
|
import { OakBox } from '../../../layout-and-structure/OakBox/OakBox.js';
|
|
@@ -9,6 +10,7 @@ import { OakJauntyAngleLabel } from '../../../form-elements/OakJauntyAngleLabel/
|
|
|
9
10
|
import { OakPrimaryButton } from '../../../buttons/OakPrimaryButton/OakPrimaryButton.js';
|
|
10
11
|
import { OakTextInput } from '../../../form-elements/OakTextInput/OakTextInput.js';
|
|
11
12
|
|
|
13
|
+
var NegativeSpacingJauntyAngleLabel = styled(OakJauntyAngleLabel)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n top: -15px;\n"], ["\n top: -15px;\n"])));
|
|
12
14
|
var OakInlineRegistrationBanner = function (props) {
|
|
13
15
|
var onSubmit = props.onSubmit, bodyText = props.bodyText, headerText = props.headerText, style = __rest(props, ["onSubmit", "bodyText", "headerText"]);
|
|
14
16
|
var _a = __read(useState(""), 2), email = _a[0], setEmail = _a[1];
|
|
@@ -52,11 +54,12 @@ var OakInlineRegistrationBanner = function (props) {
|
|
|
52
54
|
React.createElement(OakFieldError, null, formError && "Please enter a valid email address"),
|
|
53
55
|
React.createElement(OakFlex, { "$gap": "spacing-16", "$position": "relative", "$width": "100%", "$mt": "spacing-24" },
|
|
54
56
|
React.createElement(OakBox, { "$position": "relative", "$width": "100%" },
|
|
55
|
-
React.createElement(
|
|
57
|
+
React.createElement(NegativeSpacingJauntyAngleLabel, { label: "Email", "$position": "absolute", "$zIndex": "in-front", "$background": formError ? "bg-error" : "bg-decorative5-main", "$color": formError ? "text-inverted" : "text-primary", "$width": "max-content", "$ph": "spacing-16", "$font": "heading-7", "$left": "spacing-8" }),
|
|
56
58
|
React.createElement(OakTextInput, { type: "email", autoComplete: "email", placeholder: "Enter email address", "$maxHeight": "spacing-56", value: email, onChange: function (event) { return setEmail(event.target.value); }, wrapperWidth: "100%" })),
|
|
57
59
|
React.createElement(OakPrimaryButton, { innerWidth: "max-content" }, "Sign up")),
|
|
58
60
|
success && (React.createElement(OakP, { "$font": "body-1-bold", "$mt": "spacing-16" }, "Thank you for signing up")))),
|
|
59
61
|
React.createElement(SurfingStudentSVG, { "$display": ["none", "block", "block"] }))));
|
|
60
62
|
};
|
|
63
|
+
var templateObject_1;
|
|
61
64
|
|
|
62
65
|
export { OakInlineRegistrationBanner };
|
|
@@ -12,7 +12,7 @@ var borderBottom = css(templateObject_4 || (templateObject_4 = __makeTemplateObj
|
|
|
12
12
|
var borderLeft = css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("border-left", function (props) { return props.$bl; }, parseBorder));
|
|
13
13
|
var borderHorizontal = css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), responsiveStyle("border-left", function (props) { return props.$bh; }, parseBorder), responsiveStyle("border-right", function (props) { return props.$bh; }, parseBorder));
|
|
14
14
|
var borderVertical = css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), responsiveStyle("border-top", function (props) { return props.$bv; }, parseBorder), responsiveStyle("border-bottom", function (props) { return props.$bv; }, parseBorder));
|
|
15
|
-
var borderColor = css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("border-color", function (props) { return props.$borderColor; }, parseColor));
|
|
15
|
+
var borderColor = css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("border-color", function (props) { return props.$borderColor; }, function (value) { return parseColor(value); }));
|
|
16
16
|
var borderRadius = css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("border-radius", function (props) { return props.$borderRadius; }, parseBorderRadius));
|
|
17
17
|
var borderRadiusTopLeft = css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("border-top-left-radius", function (props) { return props.$btlr; }, parseBorderRadius));
|
|
18
18
|
var borderRadiusTopRight = css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("border-top-right-radius", function (props) { return props.$btrr; }, parseBorderRadius));
|
|
@@ -3,7 +3,7 @@ import { css } from 'styled-components';
|
|
|
3
3
|
import { parseColorFilter } from '../helpers/parseColorFilter.js';
|
|
4
4
|
import { responsiveStyle } from './responsiveStyle.js';
|
|
5
5
|
|
|
6
|
-
var colorFilterStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("filter", function (props) { return props.$colorFilter; }, parseColorFilter));
|
|
6
|
+
var colorFilterStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("filter", function (props) { return props.$colorFilter; }, function (value) { return parseColorFilter(value); }));
|
|
7
7
|
var templateObject_1;
|
|
8
8
|
|
|
9
9
|
export { colorFilterStyle };
|
|
@@ -33,12 +33,17 @@ var getMediaQuery = function (device) {
|
|
|
33
33
|
* array.
|
|
34
34
|
*/
|
|
35
35
|
var responsiveStyle = function (attr, getValues, parse) {
|
|
36
|
-
if (parse === void 0) { parse = function (x) {
|
|
36
|
+
if (parse === void 0) { parse = function (x) {
|
|
37
|
+
return x;
|
|
38
|
+
}; }
|
|
37
39
|
return function (props) {
|
|
38
40
|
var attrCss = function (value) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
if (typeof value === "undefined") {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
var parsed = parse(value);
|
|
45
|
+
var cssValue = typeof parsed === "function" ? parsed(props) : parsed;
|
|
46
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ": ", ";\n "], ["\n ", ": ", ";\n "])), attr, cssValue);
|
|
42
47
|
};
|
|
43
48
|
var values = getValues(props);
|
|
44
49
|
if (typeof values === "undefined") {
|