@oaknational/oak-components 2.45.1 → 3.1.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 (281) hide show
  1. package/dist/npm/cjs/index.js +7949 -0
  2. package/dist/{types.d.ts → npm/cjs/types.d.ts} +2 -16
  3. package/dist/npm/es/animation/usePrefersReducedMotion.js +16 -0
  4. package/dist/npm/es/components/OakGlobalStyle/OakGlobalStyle.js +14 -0
  5. package/dist/npm/es/components/OakThemeProvider/OakThemeProvider.js +14 -0
  6. package/dist/npm/es/components/buttons/OakButtonWithDropdown/OakButtonWithDropdown.js +105 -0
  7. package/dist/npm/es/components/buttons/OakCloseButton/OakCloseButton.js +18 -0
  8. package/dist/npm/es/components/buttons/OakLeftAlignedButton/OakLeftAlignedButton.js +57 -0
  9. package/dist/npm/es/components/buttons/OakPrimaryButton/OakPrimaryButton.js +23 -0
  10. package/dist/npm/es/components/buttons/OakPrimaryInvertedButton/OakPrimaryInvertedButton.js +23 -0
  11. package/dist/npm/es/components/buttons/OakSecondaryButton/OakSecondaryButton.js +23 -0
  12. package/dist/npm/es/components/buttons/OakSecondaryButtonWithDropdown/OakSecondaryButtonWithDropdown.js +20 -0
  13. package/dist/npm/es/components/buttons/OakSmallPrimaryButton/OakSmallPrimaryButton.js +23 -0
  14. package/dist/npm/es/components/buttons/OakSmallPrimaryInvertedButton/OakSmallPrimaryInvertedButton.js +23 -0
  15. package/dist/npm/es/components/buttons/OakSmallSecondaryButton/OakSmallSecondaryButton.js +23 -0
  16. package/dist/npm/es/components/buttons/OakSmallSecondaryButtonWithDropdown/OakSmallSecondaryButtonWithDropdown.js +20 -0
  17. package/dist/npm/es/components/buttons/OakSmallSecondaryToggleButton/OakSmallSecondaryToggleButton.js +37 -0
  18. package/dist/npm/es/components/buttons/OakSmallTertiaryInvertedButton/OakSmallTertiaryInvertedButton.js +23 -0
  19. package/dist/npm/es/components/buttons/OakTertiaryButton/OakTertiaryButton.js +14 -0
  20. package/dist/npm/es/components/buttons/OakTertiaryInvertedButton/OakTertiaryInvertedButton.js +14 -0
  21. package/dist/npm/es/components/cookies/OakCookieBanner/OakCookieBanner.js +62 -0
  22. package/dist/npm/es/components/cookies/OakCookieConsent/OakCookieConsent.js +17 -0
  23. package/dist/npm/es/components/cookies/OakCookieConsentProvider/OakCookieConsentProvider.js +103 -0
  24. package/dist/npm/es/components/cookies/OakCookieConsentProvider/cookieConsentReducer.js +32 -0
  25. package/dist/npm/es/components/cookies/OakCookieSettingsModal/OakCookieSettingsModal.js +91 -0
  26. package/dist/npm/es/components/form-elements/OakButtonAsRadioGroup/OakButtonAsRadioGroup.js +44 -0
  27. package/dist/npm/es/components/form-elements/OakCheckBox/OakCheckBox.js +71 -0
  28. package/dist/npm/es/components/form-elements/OakFieldError/OakFieldError.js +25 -0
  29. package/dist/npm/es/components/form-elements/OakFieldset/OakFieldset.js +12 -0
  30. package/dist/npm/es/components/form-elements/OakForm/OakForm.js +16 -0
  31. package/dist/npm/es/components/form-elements/OakFormInput/OakFormInput.js +26 -0
  32. package/dist/npm/es/components/form-elements/OakJauntyAngleLabel/OakJauntyAngleLabel.js +10 -0
  33. package/dist/npm/es/components/form-elements/OakLabel/OakLabel.js +15 -0
  34. package/dist/npm/es/components/form-elements/OakMultilineText/OakMultilineText.js +96 -0
  35. package/dist/npm/es/components/form-elements/OakRadioAsButton/OakRadioAsButton.js +96 -0
  36. package/dist/npm/es/components/form-elements/OakRadioButton/OakRadioButton.js +31 -0
  37. package/dist/npm/es/components/form-elements/OakRadioGroup/OakRadioGroup.js +44 -0
  38. package/dist/npm/es/components/form-elements/OakSearchFilterCheckBox/OakSearchFilterCheckBox.js +64 -0
  39. package/dist/npm/es/components/form-elements/OakSecondaryButtonAsRadio/OakSecondaryButtonAsRadio.js +25 -0
  40. package/dist/npm/es/components/form-elements/OakSelect/NativeLegend.js +9 -0
  41. package/dist/npm/es/components/form-elements/OakSelect/NativeOptGroup.js +7 -0
  42. package/dist/npm/es/components/form-elements/OakSelect/NativeOption.js +22 -0
  43. package/dist/npm/es/components/form-elements/OakSelect/NativeSelect.js +23 -0
  44. package/dist/npm/es/components/form-elements/OakSelect/OakOptGroup.js +12 -0
  45. package/dist/npm/es/components/form-elements/OakSelect/OakOption.js +12 -0
  46. package/dist/npm/es/components/form-elements/OakSelect/OakSelect.js +44 -0
  47. package/dist/npm/es/components/form-elements/OakTextArea/OakTextArea.js +23 -0
  48. package/dist/npm/es/components/form-elements/OakTextInput/OakTextInput.js +59 -0
  49. package/dist/npm/es/components/house-cat/OakCaptionCard/OakCaptionCard.js +81 -0
  50. package/dist/npm/es/components/house-cat/OakCaptionSearch/OakCaptionSearch.js +24 -0
  51. package/dist/npm/es/components/house-cat/utils.js +33 -0
  52. package/dist/npm/es/components/images-and-icons/OakAspectRatio/OakAspectRatio.js +39 -0
  53. package/dist/npm/es/components/images-and-icons/OakIcon/OakIcon.js +38 -0
  54. package/dist/npm/es/components/images-and-icons/OakImage/OakImage.js +51 -0
  55. package/dist/npm/es/components/images-and-icons/OakImage/useShowPlaceholder.js +29 -0
  56. package/dist/npm/es/components/images-and-icons/OakRoundIcon/OakRoundIcon.js +17 -0
  57. package/dist/npm/es/components/images-and-icons/OakSvg/OakSvg.js +47 -0
  58. package/dist/npm/es/components/internal-components/InternalAccordion/InternalAccordion.js +36 -0
  59. package/dist/npm/es/components/internal-components/InternalAccordion/InternalAccordionProvider.js +24 -0
  60. package/dist/npm/es/components/internal-components/InternalAccordion/useAccordionContext.js +12 -0
  61. package/dist/npm/es/components/internal-components/InternalButton/InternalButton.js +48 -0
  62. package/dist/npm/es/components/internal-components/InternalCard/InternalCard.js +19 -0
  63. package/dist/npm/es/components/internal-components/InternalCardWithBackgroundElement/InternalCardWithBackgroundElement.js +22 -0
  64. package/dist/npm/es/components/internal-components/InternalCheckBox/InternalCheckBox.js +82 -0
  65. package/dist/npm/es/components/internal-components/InternalCheckBoxLabel/InternalCheckBoxLabel.js +16 -0
  66. package/dist/npm/es/components/internal-components/InternalCheckBoxWrapper/InternalCheckBoxWrapper.js +24 -0
  67. package/dist/npm/es/components/internal-components/InternalChevronAccordion/InternalChevronAccordion.js +83 -0
  68. package/dist/npm/es/components/internal-components/InternalClientPortal/InternalClientPortal.js +13 -0
  69. package/dist/npm/es/components/internal-components/InternalDndContext/InternalDndContext.js +28 -0
  70. package/dist/npm/es/components/internal-components/InternalLink/InternalLink.js +54 -0
  71. package/dist/npm/es/components/internal-components/InternalModalTransition/InternalModalTransition.js +31 -0
  72. package/dist/npm/es/components/internal-components/InternalRadio/InternalRadio.js +82 -0
  73. package/dist/npm/es/components/internal-components/InternalRadioWrapper/InternalRadioWrapper.js +36 -0
  74. package/dist/npm/es/components/internal-components/InternalReviewAccordion/InternalReviewAccordion.js +38 -0
  75. package/dist/npm/es/components/internal-components/InternalShadowIconButton/InternalShadowIconButton.js +56 -0
  76. package/dist/npm/es/components/internal-components/InternalShadowRectButton/InternalShadowRectButton.js +56 -0
  77. package/dist/npm/es/components/internal-components/InternalShadowRoundButton/InternalShadowRoundButton.js +56 -0
  78. package/dist/npm/es/components/internal-components/InternalSlideInFlex/InternalSlideInFlex.js +30 -0
  79. package/dist/npm/es/components/internal-components/InternalStyledSvg/InternalStyledSvg.js +14 -0
  80. package/dist/npm/es/components/internal-components/InternalTextInput/InternalTextInput.js +50 -0
  81. package/dist/npm/es/components/internal-components/InternalTooltip/InternalTooltip.js +36 -0
  82. package/dist/npm/es/components/layout-and-structure/OakAccordion/OakAccordion.js +39 -0
  83. package/dist/npm/es/components/layout-and-structure/OakBasicAccordion/OakBasicAccordion.js +10 -0
  84. package/dist/npm/es/components/layout-and-structure/OakBox/OakBox.js +41 -0
  85. package/dist/npm/es/components/layout-and-structure/OakCollapsibleContent/OakCollapsibleContent.js +23 -0
  86. package/dist/npm/es/components/layout-and-structure/OakFlex/OakFlex.js +18 -0
  87. package/dist/npm/es/components/layout-and-structure/OakGrid/OakGrid.js +16 -0
  88. package/dist/npm/es/components/layout-and-structure/OakGridArea/OakGridArea.js +51 -0
  89. package/dist/npm/es/components/layout-and-structure/OakMaxWidth/OakMaxWidth.js +23 -0
  90. package/dist/npm/es/components/messaging-and-feedback/OakFocusIndicator/OakFocusIndicator.js +38 -0
  91. package/dist/npm/es/components/messaging-and-feedback/OakHandDrawnFocusUnderline/OakHandDrawnFocusUnderline.js +22 -0
  92. package/dist/npm/es/components/messaging-and-feedback/OakHandDrawnFocusUnderline/SubHandDrawnFocusUnderline.js +17 -0
  93. package/dist/npm/es/components/messaging-and-feedback/OakInformativeModal/OakInformativeModal.js +41 -0
  94. package/dist/npm/es/components/messaging-and-feedback/OakInformativeModal/OakInformativeModalBody.js +14 -0
  95. package/dist/npm/es/components/messaging-and-feedback/OakInformativeModal/OakInformativeModalFooter.js +16 -0
  96. package/dist/npm/es/components/messaging-and-feedback/OakInlineBanner/OakInlineBanner.js +129 -0
  97. package/dist/npm/es/components/messaging-and-feedback/OakKbd/OakKbd.js +12 -0
  98. package/dist/npm/es/components/messaging-and-feedback/OakLoadingSpinner/OakLoadingSpinner.js +34 -0
  99. package/dist/npm/es/components/messaging-and-feedback/OakModalCenter/OakModalCenter.js +106 -0
  100. package/dist/npm/es/components/messaging-and-feedback/OakModalCenter/OakModalCenterBody.js +36 -0
  101. package/dist/npm/es/components/messaging-and-feedback/OakScreenReader/OakScreenReader.js +15 -0
  102. package/dist/npm/es/components/messaging-and-feedback/OakTagFunctional/OakTagFunctional.js +18 -0
  103. package/dist/npm/es/components/messaging-and-feedback/OakToast/OakToast.js +96 -0
  104. package/dist/npm/es/components/messaging-and-feedback/OakTooltip/OakTooltip.js +122 -0
  105. package/dist/npm/es/components/navigation/OakAnchorTarget/OakAnchorTarget.js +20 -0
  106. package/dist/npm/es/components/navigation/OakBreadcrumbs/OakBreadcrumbs.js +46 -0
  107. package/dist/npm/es/components/navigation/OakCard/OakCard.js +64 -0
  108. package/dist/npm/es/components/navigation/OakHoverLink/OakHoverLink.js +23 -0
  109. package/dist/npm/es/components/navigation/OakLink/OakLink.js +17 -0
  110. package/dist/npm/es/components/navigation/OakLink/config.js +18 -0
  111. package/dist/npm/es/components/navigation/OakPagination/OakPagination.js +106 -0
  112. package/dist/npm/es/components/navigation/OakPagination/utils.js +19 -0
  113. package/dist/npm/es/components/navigation/OakPrimaryNav/OakPrimaryNav.js +22 -0
  114. package/dist/npm/es/components/navigation/OakPrimaryNavItem/OakPrimaryNavItem.js +23 -0
  115. package/dist/npm/es/components/navigation/OakSecondaryLink/OakSecondaryLink.js +25 -0
  116. package/dist/npm/es/components/navigation/OakTabs/OakTabs.js +47 -0
  117. package/dist/npm/es/components/owa/OakBackLink/OakBackLink.js +28 -0
  118. package/dist/npm/es/components/owa/OakBulletList/OakBulletList.js +17 -0
  119. package/dist/npm/es/components/owa/OakCardWithHandDrawnBorder/OakCardWithHandDrawnBorder.js +17 -0
  120. package/dist/npm/es/components/owa/OakCloudinaryImage/OakCloudinaryImage.js +35 -0
  121. package/dist/npm/es/components/owa/OakCloudinaryImage/cloudinary.js +17 -0
  122. package/dist/npm/es/components/owa/OakCodeRenderer/OakCodeRenderer.js +135 -0
  123. package/dist/npm/es/components/owa/OakCopyLinkButton/OakCopyLinkButton.js +42 -0
  124. package/dist/npm/es/components/owa/OakDownloadCard/OakDownloadCard.js +72 -0
  125. package/dist/npm/es/components/owa/OakDownloadsJourneyChildSubjectTierSelector/OakDownloadsJourneyChildSubjectTierSelector.js +54 -0
  126. package/dist/npm/es/components/owa/OakDragAndDropInstructions/OakDragAndDropInstructions.js +41 -0
  127. package/dist/npm/es/components/owa/OakDraggable/OakDraggable.js +30 -0
  128. package/dist/npm/es/components/owa/OakDraggableFeedback/OakDraggableFeedback.js +13 -0
  129. package/dist/npm/es/components/owa/OakDroppable/OakDroppable.js +45 -0
  130. package/dist/npm/es/components/owa/OakFilterDrawer/OakFilterDrawer.js +43 -0
  131. package/dist/npm/es/components/owa/OakFormInputWithLabels/OakFormInputWithLabels.js +18 -0
  132. package/dist/npm/es/components/owa/OakHandDrawnCard/OakHandDrawnCard.js +17 -0
  133. package/dist/npm/es/components/owa/OakHandDrawnCardWithIcon/OakHandDrawnCardWithIcon.js +15 -0
  134. package/dist/npm/es/components/owa/OakHandDrawnHR/HandDrawnHRSvg.js +11 -0
  135. package/dist/npm/es/components/owa/OakHandDrawnHR/OakHandDrawnHR.js +22 -0
  136. package/dist/npm/es/components/owa/OakHeaderHero/OakHeaderHero.js +45 -0
  137. package/dist/npm/es/components/owa/OakHomepageTabButton/OakHomepageTabButton.js +35 -0
  138. package/dist/npm/es/components/owa/OakInfo/OakInfo.js +22 -0
  139. package/dist/npm/es/components/owa/OakInfoButton/OakInfoButton.js +20 -0
  140. package/dist/npm/es/components/owa/OakLessonInfoCard/OakLessonInfoCard.js +33 -0
  141. package/dist/npm/es/components/owa/OakLinkCard/OakLinkCard.js +42 -0
  142. package/dist/npm/es/components/owa/OakListItem/OakListItem.js +93 -0
  143. package/dist/npm/es/components/owa/OakMediaClip/OakMediaClip.js +90 -0
  144. package/dist/npm/es/components/owa/OakMediaClipList/OakMediaClipList.js +26 -0
  145. package/dist/npm/es/components/owa/OakMediaClipListAccordion/OakMediaClipListAccordion.js +29 -0
  146. package/dist/npm/es/components/owa/OakMediaClipStackListItem/OakMediaClipStackListItem.js +41 -0
  147. package/dist/npm/es/components/owa/OakOutlineAccordion/OakOutlineAccordion.js +21 -0
  148. package/dist/npm/es/components/owa/OakPromoTag/OakPromoTag.js +22 -0
  149. package/dist/npm/es/components/owa/OakRadioTile/OakRadioTile.js +40 -0
  150. package/dist/npm/es/components/owa/OakSaveCount/OakSaveCount.js +33 -0
  151. package/dist/npm/es/components/owa/OakScaleImageButton/OakScaleImageButton.js +19 -0
  152. package/dist/npm/es/components/owa/OakSideMenuNav/OakSideMenuNav.js +24 -0
  153. package/dist/npm/es/components/owa/OakSideMenuNavLink/OakSideMenuNavLink.js +48 -0
  154. package/dist/npm/es/components/owa/OakSignLanguageButton/OakSignLanguageButton.js +23 -0
  155. package/dist/npm/es/components/owa/OakSubjectIcon/OakSubjectIcon.js +20 -0
  156. package/dist/npm/es/components/owa/OakSubjectIconButton/OakSubjectIconButton.js +44 -0
  157. package/dist/npm/es/components/owa/OakTimer/OakTimer.js +26 -0
  158. package/dist/npm/es/components/owa/OakVideoTranscript/OakVideoTranscript.js +32 -0
  159. package/dist/npm/es/components/owa/pupil/OakUnitListItem/OakUnitListItem.js +63 -0
  160. package/dist/npm/es/components/owa/pupil/OakUnitListOptionalityItem/OakUnitListOptionalityItem.js +57 -0
  161. package/dist/npm/es/components/owa/pupil/OakUnitListOptionalityItemCard/OakUnitListOptionalityItemCard.js +36 -0
  162. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyContentGuidance/OakPupilJourneyContentGuidance.js +44 -0
  163. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyHeader/OakPupilJourneyHeader.js +29 -0
  164. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyLayout/OakPupilJourneyLayout.js +62 -0
  165. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyList/OakPupilJourneyList.js +46 -0
  166. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyListCounter/OakPupilJourneyListCounter.js +12 -0
  167. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyListItem/OakPupilJourneyListItem.js +45 -0
  168. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyListItemSubheading/OakPupilJourneyListItemSubheading.js +20 -0
  169. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyOptionalityButton/OakPupilJourneyOptionalityButton.js +35 -0
  170. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyOptionalityItem/OakPupilJourneyOptionalityItem.js +23 -0
  171. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyProgrammeOptions/OakPupilJourneyProgrammeOptions.js +27 -0
  172. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyUnitsFilter/OakPupilJourneyUnitsFilter.js +42 -0
  173. package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyYearButton/OakPupilJourneyYearButton.js +31 -0
  174. package/dist/npm/es/components/owa/pupil/lesson/OakLessonBottomNav/OakLessonBottomNav.js +34 -0
  175. package/dist/npm/es/components/owa/pupil/lesson/OakLessonLayout/OakLessonLayout.js +153 -0
  176. package/dist/npm/es/components/owa/pupil/lesson/OakLessonNavItem/OakLessonNavItem.js +167 -0
  177. package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewIntroVideo/OakPupilLessonReviewIntroVideo.js +30 -0
  178. package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewItem/OakPupilLessonReviewItem.js +106 -0
  179. package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewQuiz/OakPupilLessonReviewQuiz.js +56 -0
  180. package/dist/npm/es/components/owa/pupil/lesson/OakLessonTopNav/OakLessonTopNav.js +58 -0
  181. package/dist/npm/es/components/owa/pupil/lesson/OakLessonVideoTranscript/OakLessonVideoTranscript.js +27 -0
  182. package/dist/npm/es/components/owa/pupil/quiz/InternalDroppableHoldingPen/InternalDroppableHoldingPen.js +60 -0
  183. package/dist/npm/es/components/owa/pupil/quiz/OakHintButton/OakHintButton.js +27 -0
  184. package/dist/npm/es/components/owa/pupil/quiz/OakQuizCheckBox/OakQuizCheckBox.js +58 -0
  185. package/dist/npm/es/components/owa/pupil/quiz/OakQuizCounter/OakQuizCounter.js +33 -0
  186. package/dist/npm/es/components/owa/pupil/quiz/OakQuizFeedback/OakQuizFeedback.js +31 -0
  187. package/dist/npm/es/components/owa/pupil/quiz/OakQuizHint/OakQuizHint.js +28 -0
  188. package/dist/npm/es/components/owa/pupil/quiz/OakQuizMatch/OakQuizMatch.js +121 -0
  189. package/dist/npm/es/components/owa/pupil/quiz/OakQuizOrder/OakQuizOrder.js +88 -0
  190. package/dist/npm/es/components/owa/pupil/quiz/OakQuizPrintableHeader/OakQuizPrintableHeader.js +29 -0
  191. package/dist/npm/es/components/owa/pupil/quiz/OakQuizPrintableSubHeader/OakQuizPrintableSubHeader.js +28 -0
  192. package/dist/npm/es/components/owa/pupil/quiz/OakQuizRadioButton/OakQuizRadioButton.js +78 -0
  193. package/dist/npm/es/components/owa/pupil/quiz/OakQuizResultItem/OakQuizResultItem.js +70 -0
  194. package/dist/npm/es/components/owa/pupil/quiz/OakQuizTextInput/OakQuizTextInput.js +28 -0
  195. package/dist/npm/es/components/owa/teacher/OakDownloadsAccordion/OakDownloadsAccordion.js +56 -0
  196. package/dist/npm/es/components/owa/teacher/OakInlineRegistrationBanner/OakInlineRegistrationBanner.js +62 -0
  197. package/dist/npm/es/components/owa/teacher/OakInlineRegistrationBanner/SurfingStudentSVG.js +15 -0
  198. package/dist/npm/es/components/owa/teacher/OakTeacherNotesInline/OakTeacherNotesInline.js +16 -0
  199. package/dist/npm/es/components/owa/teacher/OakTeacherNotesModal/OakTeacherNotesModal.js +72 -0
  200. package/dist/npm/es/components/owa/teacher/OakTertiaryOLNav/OakTertiaryOLNav.js +34 -0
  201. package/dist/npm/es/components/presentational/OakCarousel/OakCarousel.js +39 -0
  202. package/dist/npm/es/components/presentational/OakCarousel/SubCarouselPositionControl.js +12 -0
  203. package/dist/npm/es/components/presentational/OakCarousel/SubCarouselPositionIndicator.js +17 -0
  204. package/dist/npm/es/components/presentational/OakQuote/OakQuote.js +34 -0
  205. package/dist/npm/es/components/typography/OakHeading/OakHeading.js +33 -0
  206. package/dist/npm/es/components/typography/OakLI/OakLI.js +23 -0
  207. package/dist/npm/es/components/typography/OakOL/OakOL.js +22 -0
  208. package/dist/npm/es/components/typography/OakP/OakP.js +17 -0
  209. package/dist/npm/es/components/typography/OakSpan/OakSpan.js +18 -0
  210. package/dist/npm/es/components/typography/OakTypography/OakTypography.js +16 -0
  211. package/dist/npm/es/components/typography/OakUL/OakUL.js +19 -0
  212. package/dist/npm/es/components/unstyled/UnstyledChevronAccordion/UnstyledChevronAccordion.js +55 -0
  213. package/dist/npm/es/hooks/useBreakpoint.js +38 -0
  214. package/dist/npm/es/hooks/useIsScrolled.js +30 -0
  215. package/dist/npm/es/hooks/useMediaQuery.js +20 -0
  216. package/dist/npm/es/hooks/useMounted.js +12 -0
  217. package/dist/npm/es/image-map.js +205 -0
  218. package/dist/npm/es/index.js +196 -0
  219. package/dist/npm/es/styles/global/oak.styles.js +17 -0
  220. package/dist/npm/es/styles/global/reset.styles.js +11 -0
  221. package/dist/npm/es/styles/helpers/getFontSize.js +9 -0
  222. package/dist/npm/es/styles/helpers/getInternalPadding.js +15 -0
  223. package/dist/npm/es/styles/helpers/parseBorder.js +13 -0
  224. package/dist/npm/es/styles/helpers/parseBorderRadius.js +13 -0
  225. package/dist/npm/es/styles/helpers/parseBorderWidth.js +15 -0
  226. package/dist/npm/es/styles/helpers/parseColor.js +19 -0
  227. package/dist/npm/es/styles/helpers/parseColorFilter.js +19 -0
  228. package/dist/npm/es/styles/helpers/parseDropShadow.js +15 -0
  229. package/dist/npm/es/styles/helpers/parseOpacity.js +12 -0
  230. package/dist/npm/es/styles/helpers/parseSpacing.js +29 -0
  231. package/dist/npm/es/styles/helpers/parseTransitions.js +12 -0
  232. package/dist/npm/es/styles/helpers/parseTypography.js +36 -0
  233. package/dist/npm/es/styles/helpers/parseZIndex.js +13 -0
  234. package/dist/npm/es/styles/helpers/pxToRem.js +7 -0
  235. package/dist/npm/es/styles/helpers/truthy.js +13 -0
  236. package/dist/npm/es/styles/theme/borders.js +22 -0
  237. package/dist/npm/es/styles/theme/color.js +207 -0
  238. package/dist/npm/es/styles/theme/dark.theme.js +99 -0
  239. package/dist/npm/es/styles/theme/default.theme.js +99 -0
  240. package/dist/npm/es/styles/theme/dropShadow.js +13 -0
  241. package/dist/npm/es/styles/theme/opacity.js +8 -0
  242. package/dist/npm/es/styles/theme/spacing.js +48 -0
  243. package/dist/npm/es/styles/theme/transitions.js +6 -0
  244. package/dist/npm/es/styles/theme/typography.js +73 -0
  245. package/dist/npm/es/styles/theme/zIndex.js +17 -0
  246. package/dist/npm/es/styles/utils/borderStyle.js +27 -0
  247. package/dist/npm/es/styles/utils/colorFilterStyle.js +9 -0
  248. package/dist/npm/es/styles/utils/colorStyle.js +9 -0
  249. package/dist/npm/es/styles/utils/displayStyle.js +8 -0
  250. package/dist/npm/es/styles/utils/dropShadowStyle.js +9 -0
  251. package/dist/npm/es/styles/utils/flexStyle.js +9 -0
  252. package/dist/npm/es/styles/utils/listStyle.js +8 -0
  253. package/dist/npm/es/styles/utils/opacityStyle.js +9 -0
  254. package/dist/npm/es/styles/utils/positionStyle.js +9 -0
  255. package/dist/npm/es/styles/utils/responsiveStyle.js +69 -0
  256. package/dist/npm/es/styles/utils/scrollSnapStyle.js +11 -0
  257. package/dist/npm/es/styles/utils/sizeStyle.js +9 -0
  258. package/dist/npm/es/styles/utils/spacingStyle.js +25 -0
  259. package/dist/npm/es/styles/utils/transformStyle.js +8 -0
  260. package/dist/npm/es/styles/utils/transitionStyle.js +9 -0
  261. package/dist/npm/es/styles/utils/typographyStyle.js +9 -0
  262. package/dist/npm/es/styles/utils/zIndexStyle.js +9 -0
  263. package/dist/npm/es/svgs/button-border-bottom.js +6 -0
  264. package/dist/npm/es/svgs/button-border-left.js +6 -0
  265. package/dist/npm/es/svgs/button-border-right.js +6 -0
  266. package/dist/npm/es/svgs/button-border-top.js +6 -0
  267. package/dist/npm/es/svgs/header-underline.js +6 -0
  268. package/dist/npm/es/svgs/horizontal-rule.js +6 -0
  269. package/dist/npm/es/svgs/icon-background.js +6 -0
  270. package/dist/npm/es/svgs/scribble.js +11 -0
  271. package/dist/npm/es/svgs/underline-3.js +6 -0
  272. package/dist/npm/es/svgs/underline.js +6 -0
  273. package/dist/npm/es/test-helpers/colorConversion.js +14 -0
  274. package/dist/npm/es/test-helpers/mockIntersectionObserver.js +50 -0
  275. package/dist/npm/es/test-helpers/mockResizeObserver.js +25 -0
  276. package/dist/npm/es/types.d.ts +5249 -0
  277. package/package.json +28 -12
  278. package/dist/cjs/index.js +0 -15
  279. package/dist/cjs/index.js.map +0 -1
  280. package/dist/esm/index.js +0 -15
  281. package/dist/esm/index.js.map +0 -1
@@ -0,0 +1,153 @@
1
+ import { __makeTemplateObject, __read } from 'tslib';
2
+ import React from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { OakFlex } from '../../../../layout-and-structure/OakFlex/OakFlex.js';
5
+ import { OakBox } from '../../../../layout-and-structure/OakBox/OakBox.js';
6
+ import { parseSpacing } from '../../../../../styles/helpers/parseSpacing.js';
7
+ import { getBreakpoint } from '../../../../../styles/utils/responsiveStyle.js';
8
+ import '../../../../../styles/theme/color.js';
9
+ import '../../../../../styles/theme/typography.js';
10
+ import { oakDefaultTheme } from '../../../../../styles/theme/default.theme.js';
11
+ import { parseColor } from '../../../../../styles/helpers/parseColor.js';
12
+ import { backgrounds } from '../../../../../image-map.js';
13
+
14
+ var lessonSectionNames = [
15
+ "overview",
16
+ "intro",
17
+ "starter-quiz",
18
+ "video",
19
+ "exit-quiz",
20
+ "review",
21
+ ];
22
+ /**
23
+ * `OakBox` does not support space-between tokens on `padding` only `margin`, so we need to
24
+ * set it here to apply appropriate padding to the top of the content.
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.sectionName, props.phase, props.celebrate)); });
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
+ /**
29
+ * Provides overall page layout and colours for the sections of a lesson.
30
+ */
31
+ var OakLessonLayout = function (_a) {
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
+ 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 },
35
+ React.createElement(OakFlex, { "$flexDirection": "column", "$flexGrow": 1, "$background": [mobileContentBackgroundColor, "transparent"], "$maxWidth": "spacing-1280", "$minHeight": "100%", "$mh": "auto", "$position": "relative" },
36
+ React.createElement(OakBox, { "$display": ["none", "block"] },
37
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%", viewBox: "0 0 1308 943", fill: "none", style: {
38
+ position: "absolute",
39
+ top: 0,
40
+ left: 0,
41
+ right: 0,
42
+ bottom: 0,
43
+ zIndex: 0,
44
+ }, preserveAspectRatio: "none" },
45
+ React.createElement("mask", { id: "wobbly_mask", fill: "white" },
46
+ React.createElement("path", { d: "M1307.54 535.104C1307.23 636.219 1306.18 739.057 1306.6 839.224C1306.7 898.723 1307.88 947.11 1307 1006C871.2 1012.67 437.787 1006 2 1006C1 939 1.31004 845.783 2.6275 777.934C3.15031 725.636 2.9621 673.135 2.1047 621.04C1.77011 559.918 1.68647 498.83 0.933629 437.946C0.264441 384.059 1.60282 330.442 0.180796 275.304C-0.634779 244.608 1.51916 210.464 2.46021 178.01C3.06666 156.814 3.92405 136.091 4.44685 115.165C5.76432 63.2723 9.36114 33.861 17.2868 27.0998C19.9009 24.8686 22.4521 22.0965 25.087 18.8849C44.7654 12.9688 64.9662 10.1291 85.1882 10.4672C116.807 13.0364 148.782 8.37119 180.61 7.15417L213.714 6.2076C231.196 5.46386 248.595 4.78774 265.785 4.88916C504.33 5.83573 742.85 7.93171 981.395 7.93171C1023.49 7.93171 1065.67 5.93715 1107.85 3.87498C1136.42 2.45512 1164.98 1.03526 1193.53 0.0886897C1210.34 -0.486014 1227.15 1.88041 1243.88 2.9284C1250.8 2.9284 1257.71 4.24684 1264.56 4.07781C1275.4 3.4355 1286.23 5.43006 1296.48 10.0277C1297.86 18.9863 1302.6 31.427 1303.65 48.8371C1305.07 72.7042 1306.18 101.338 1306.91 133.014C1307.62 164.691 1307.94 198.801 1307.83 233.25C1307.71 273.58 1308.02 313.742 1308 354.073C1307.92 414.856 1307.75 475.639 1307.52 535.104H1307.54Z" })),
47
+ React.createElement("path", { d: "M1307.54 535.104C1307.23 636.219 1306.18 739.057 1306.6 839.224C1306.7 898.723 1307.88 947.11 1307 1006C871.2 1012.67 437.787 1006 2 1006C1 939 1.31004 845.783 2.6275 777.934C3.15031 725.636 2.9621 673.135 2.1047 621.04C1.77011 559.918 1.68647 498.83 0.933629 437.946C0.264441 384.059 1.60282 330.442 0.180796 275.304C-0.634779 244.608 1.51916 210.464 2.46021 178.01C3.06666 156.814 3.92405 136.091 4.44685 115.165C5.76432 63.2723 9.36114 33.861 17.2868 27.0998C19.9009 24.8686 22.4521 22.0965 25.087 18.8849C44.7654 12.9688 64.9662 10.1291 85.1882 10.4672C116.807 13.0364 148.782 8.37119 180.61 7.15417L213.714 6.2076C231.196 5.46386 248.595 4.78774 265.785 4.88916C504.33 5.83573 742.85 7.93171 981.395 7.93171C1023.49 7.93171 1065.67 5.93715 1107.85 3.87498C1136.42 2.45512 1164.98 1.03526 1193.53 0.0886897C1210.34 -0.486014 1227.15 1.88041 1243.88 2.9284C1250.8 2.9284 1257.71 4.24684 1264.56 4.07781C1275.4 3.4355 1286.23 5.43006 1296.48 10.0277C1297.86 18.9863 1302.6 31.427 1303.65 48.8371C1305.07 72.7042 1306.18 101.338 1306.91 133.014C1307.62 164.691 1307.94 198.801 1307.83 233.25C1307.71 273.58 1308.02 313.742 1308 354.073C1307.92 414.856 1307.75 475.639 1307.52 535.104H1307.54Z", fill: parseColor(contentBackgroundColor)({
48
+ theme: oakDefaultTheme,
49
+ }), stroke: parseColor(contentBorderColor)({
50
+ theme: oakDefaultTheme,
51
+ }), strokeWidth: "8", mask: "url(#wobbly_mask)" }))),
52
+ React.createElement(OakFlex, { "$flexDirection": "column", "$flexGrow": 1, "$minHeight": "100%", "$zIndex": 1, "$pt": ["spacing-0", "spacing-16"], "$gap": ["spacing-48", "spacing-56"] },
53
+ topNavSlot && (React.createElement(OakBox, { "$pv": "spacing-20", "$pl": ["spacing-16", "spacing-8"], "$pr": ["spacing-16", "spacing-0"], "$mr": ["spacing-0", "spacing-48"], "$background": ["bg-primary", "transparent"] }, topNavSlot)),
54
+ React.createElement(OakFlex, { "$flexGrow": 1, "$flexDirection": "column" }, children),
55
+ bottomNavSlot && (React.createElement(StickyFooter, { "$mh": ["spacing-0", "spacing-0", "spacing-4"], "$borderColor": contentBorderColor, "$bt": "border-solid-xl", "$background": ["bg-primary", contentBackgroundColor] }, bottomNavSlot))))));
56
+ };
57
+ function pickSectionColours(sectionName, phase) {
58
+ switch (sectionName) {
59
+ case "overview":
60
+ return phase === "secondary"
61
+ ? [
62
+ "bg-decorative3-subdued",
63
+ "bg-primary",
64
+ "border-decorative3",
65
+ "bg-primary",
66
+ ]
67
+ : [
68
+ "bg-decorative4-subdued",
69
+ "bg-primary",
70
+ "border-decorative4",
71
+ "bg-primary",
72
+ ];
73
+ case "intro":
74
+ return [
75
+ "bg-decorative2-subdued",
76
+ "bg-decorative2-very-subdued",
77
+ "border-inverted",
78
+ "bg-decorative2-subdued",
79
+ ];
80
+ case "starter-quiz":
81
+ return [
82
+ "bg-decorative1-main",
83
+ "bg-decorative1-very-subdued",
84
+ "border-inverted",
85
+ "bg-decorative1-subdued",
86
+ ];
87
+ case "video":
88
+ return [
89
+ "bg-decorative4-subdued",
90
+ "bg-primary",
91
+ "border-decorative4",
92
+ "bg-primary",
93
+ ];
94
+ case "exit-quiz":
95
+ return [
96
+ "bg-decorative5-main",
97
+ "bg-decorative5-very-subdued",
98
+ "border-inverted",
99
+ "bg-decorative5-subdued",
100
+ ];
101
+ case "review":
102
+ return phase === "secondary"
103
+ ? [
104
+ "bg-decorative3-subdued",
105
+ "bg-primary",
106
+ "border-decorative3",
107
+ "bg-primary",
108
+ ]
109
+ : [
110
+ "bg-decorative4-subdued",
111
+ "bg-primary",
112
+ "border-decorative4",
113
+ "bg-primary",
114
+ ];
115
+ default:
116
+ return [
117
+ "bg-decorative3-subdued",
118
+ "bg-primary",
119
+ "border-decorative3",
120
+ "bg-primary",
121
+ ];
122
+ }
123
+ }
124
+ function getBackgroundUrlForLesson(sectionName, phase, celebrate) {
125
+ var prefix = "https://".concat(process.env.NEXT_PUBLIC_OAK_ASSETS_HOST, "/").concat(process.env.NEXT_PUBLIC_OAK_ASSETS_PATH, "/");
126
+ switch (sectionName) {
127
+ case "overview":
128
+ return phase === "secondary"
129
+ ? "background-image: url(".concat(prefix).concat(backgrounds["lesson-confetti-lavender"], ");")
130
+ : "background-image: url(".concat(prefix).concat(backgrounds["lesson-confetti-pink"], ");");
131
+ case "intro":
132
+ return "background-image: url(".concat(prefix).concat(backgrounds["lesson-confetti-mint"], ");");
133
+ case "starter-quiz":
134
+ return celebrate
135
+ ? "background-image: url(".concat(prefix).concat(backgrounds["lesson-confetti-green"], ");")
136
+ : "";
137
+ case "video":
138
+ return "background-image: url(".concat(prefix).concat(backgrounds["lesson-confetti-pink"], ");");
139
+ case "exit-quiz":
140
+ return celebrate
141
+ ? "background-image: url(".concat(prefix).concat(backgrounds["lesson-confetti-green-lemon"], ");")
142
+ : "";
143
+ case "review":
144
+ return phase === "secondary"
145
+ ? "background-image: url(".concat(prefix).concat(backgrounds["lesson-confetti-lavender"], ");")
146
+ : "background-image: url(".concat(prefix).concat(backgrounds["lesson-confetti-pink"], ");");
147
+ default:
148
+ return "";
149
+ }
150
+ }
151
+ var templateObject_1, templateObject_2, templateObject_3;
152
+
153
+ export { OakLessonLayout, lessonSectionNames };
@@ -0,0 +1,167 @@
1
+ import { __makeTemplateObject, __rest, __read, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { OakBox } from '../../../../layout-and-structure/OakBox/OakBox.js';
5
+ import { OakFlex } from '../../../../layout-and-structure/OakFlex/OakFlex.js';
6
+ import { OakIcon } from '../../../../images-and-icons/OakIcon/OakIcon.js';
7
+ import { OakSpan } from '../../../../typography/OakSpan/OakSpan.js';
8
+ import { parseColor } from '../../../../../styles/helpers/parseColor.js';
9
+ import { OakRoundIcon } from '../../../../images-and-icons/OakRoundIcon/OakRoundIcon.js';
10
+ import { parseColorFilter } from '../../../../../styles/helpers/parseColorFilter.js';
11
+ import { parseSpacing } from '../../../../../styles/helpers/parseSpacing.js';
12
+ import { parseDropShadow } from '../../../../../styles/helpers/parseDropShadow.js';
13
+ import { OakLoadingSpinner } from '../../../../messaging-and-feedback/OakLoadingSpinner/OakLoadingSpinner.js';
14
+
15
+ var StyledLabel = styled(OakBox)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
16
+ var StyledIconWrapper = styled(OakFlex)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n filter: ", ";\n"], ["\n filter: ", ";\n"])), function (props) {
17
+ return parseColorFilter(props.$disabled ? "icon-disabled" : "icon-primary");
18
+ });
19
+ var StyledRoundIcon = styled(OakRoundIcon)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n padding: 0;\n\n background: transparent;\n\n img {\n filter: ", ";\n }\n"], ["\n width: ", ";\n height: ", ";\n padding: 0;\n\n background: transparent;\n\n img {\n filter: ", ";\n }\n"])), parseSpacing("spacing-40"), parseSpacing("spacing-40"), function (props) {
20
+ return parseColorFilter(props.$disabled ? "icon-disabled" : "icon-primary");
21
+ });
22
+ var activeIconStyles = css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", " {\n background: ", ";\n\n img {\n filter: ", ";\n }\n }\n"], ["\n ", " {\n background: ", ";\n\n img {\n filter: ", ";\n }\n }\n"])), StyledRoundIcon, parseColor("bg-btn-primary"), parseColorFilter("icon-inverted"));
23
+ var StyledLessonNavItem = styled(OakFlex)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n outline: none;\n text-align: initial;\n\n &:focus-visible {\n box-shadow:\n ", ",\n ", ";\n }\n\n ", "\n\n ", "\n"], ["\n outline: none;\n text-align: initial;\n\n &:focus-visible {\n box-shadow:\n ", ",\n ", ";\n }\n\n ", "\n\n ", "\n"])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), function (props) { return props.$disabled && "cursor: default"; }, function (props) {
24
+ return !props.$disabled && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: pointer;\n\n /* Don't apply hover styles on touch devices */\n @media (hover: hover) {\n &:hover {\n ", " {\n text-decoration: underline;\n }\n\n ", "\n }\n }\n\n &:active {\n box-shadow:\n ", ",\n ", ";\n ", "\n }\n "], ["\n cursor: pointer;\n\n /* Don't apply hover styles on touch devices */\n @media (hover: hover) {\n &:hover {\n ", " {\n text-decoration: underline;\n }\n\n ", "\n }\n }\n\n &:active {\n box-shadow:\n ", ",\n ", ";\n ", "\n }\n "])), StyledLabel, activeIconStyles, parseDropShadow("drop-shadow-lemon"), parseDropShadow("drop-shadow-grey"), activeIconStyles);
25
+ });
26
+ var FlexedOakBox = styled(OakBox)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
27
+ /**
28
+ * Enables navigation to the given section of a lesson as well as displaying current progress
29
+ */
30
+ var OakLessonNavItem = function (props) {
31
+ var as = props.as, lessonSectionName = props.lessonSectionName, progress = props.progress, disabled = props.disabled, isLoading = props.isLoading, href = props.href, onClick = props.onClick; props.numQuestions; props.grade; var rest = __rest(props, ["as", "lessonSectionName", "progress", "disabled", "isLoading", "href", "onClick", "numQuestions", "grade"]);
32
+ var isDisabled = Boolean(disabled || isLoading);
33
+ var _a = __read(pickColorsForSection(lessonSectionName), 4), notStartedBackgroundColor = _a[0], backgroundColor = _a[1], borderColor = _a[2], disabledBackgroundColor = _a[3];
34
+ var resolvedBackgroundColor = isDisabled && disabledBackgroundColor
35
+ ? disabledBackgroundColor
36
+ : progress === "not-started"
37
+ ? notStartedBackgroundColor
38
+ : backgroundColor;
39
+ return (React.createElement(StyledLessonNavItem, __assign({ as: isDisabled ? "div" : (as !== null && as !== void 0 ? as : "a"), "$gap": "spacing-24", "$alignItems": "center", "$background": resolvedBackgroundColor, "$ph": ["spacing-16", "spacing-24"], "$pv": "spacing-20", "$borderRadius": "border-radius-l", "$borderColor": isDisabled ? "border-neutral-lighter" : borderColor, "$ba": "border-solid-l", "$disabled": isDisabled, "$color": "text-primary", href: isDisabled ? undefined : href, onClick: isDisabled ? undefined : onClick }, rest),
40
+ React.createElement(StyledIconWrapper, { "$width": "spacing-80", "$justifyContent": "center", "$disabled": isDisabled },
41
+ React.createElement(OakIcon, { iconName: pickIconForSection(lessonSectionName), "$width": "spacing-56", "$height": "spacing-56" })),
42
+ React.createElement(FlexedOakBox, null,
43
+ React.createElement(StyledLabel, { as: "strong", "$font": ["heading-6", "heading-5"], "$color": isDisabled ? "text-disabled" : "text-primary" }, pickLabelForSection(lessonSectionName)),
44
+ React.createElement(OakBox, { "$font": ["body-2", "body-1"], "$color": isDisabled ? "text-subdued" : "text-primary" }, pickSummaryForProgress(props, isDisabled))),
45
+ renderQuestionCounter(props, isDisabled),
46
+ isLoading ? (React.createElement(OakFlex, { "$width": "spacing-40", "$height": "spacing-40", "$alignItems": "center", "$justifyContent": "center" },
47
+ React.createElement(OakLoadingSpinner, { "$width": "spacing-24" }))) : (React.createElement(StyledRoundIcon, { iconName: "chevron-right", "$disabled": isDisabled }))));
48
+ };
49
+ function renderQuestionCounter(props, isDisabled) {
50
+ if (props.progress !== "complete") {
51
+ return null;
52
+ }
53
+ /**
54
+ * The large answer counter is only rendered when on a non-mobile screen
55
+ */
56
+ switch (props.lessonSectionName) {
57
+ case "exit-quiz":
58
+ case "starter-quiz":
59
+ return (React.createElement(OakBox, { "$display": ["none", "block"], "$mr": "spacing-24" },
60
+ React.createElement(OakSpan, { "$font": "heading-4", "$color": isDisabled ? "text-subdued" : "text-primary" }, props.grade),
61
+ React.createElement(OakSpan, { "$font": "heading-6", "$color": isDisabled ? "text-subdued" : "text-primary" },
62
+ "\u00A0/\u00A0",
63
+ props.numQuestions)));
64
+ default:
65
+ return null;
66
+ }
67
+ }
68
+ function pickIconForSection(sectionName) {
69
+ switch (sectionName) {
70
+ case "intro":
71
+ return "intro";
72
+ case "starter-quiz":
73
+ case "exit-quiz":
74
+ return "quiz";
75
+ case "video":
76
+ return "video";
77
+ }
78
+ }
79
+ function pickColorsForSection(sectionName) {
80
+ switch (sectionName) {
81
+ case "intro":
82
+ return [
83
+ "bg-decorative2-very-subdued",
84
+ "bg-decorative2-main",
85
+ "border-decorative2-stronger",
86
+ null,
87
+ ];
88
+ case "starter-quiz":
89
+ return [
90
+ "bg-decorative1-very-subdued",
91
+ "bg-decorative1-main",
92
+ "border-decorative1-stronger",
93
+ "bg-decorative1-subdued",
94
+ ];
95
+ case "video":
96
+ return [
97
+ "bg-decorative4-very-subdued",
98
+ "bg-decorative4-main",
99
+ "border-decorative4-stronger",
100
+ null,
101
+ ];
102
+ case "exit-quiz":
103
+ return [
104
+ "bg-decorative5-very-subdued",
105
+ "bg-decorative5-main",
106
+ "border-decorative5-stronger",
107
+ "bg-decorative5-subdued",
108
+ ];
109
+ }
110
+ }
111
+ function pickLabelForSection(sectionName) {
112
+ switch (sectionName) {
113
+ case "intro":
114
+ return "Introduction";
115
+ case "starter-quiz":
116
+ return "Starter quiz";
117
+ case "video":
118
+ return "Lesson video";
119
+ case "exit-quiz":
120
+ return "Exit quiz";
121
+ }
122
+ }
123
+ function pickSummaryForProgress(props, isDisabled) {
124
+ switch (props.progress) {
125
+ case "not-started":
126
+ return pickSummaryForNotStarted(props);
127
+ case "in-progress":
128
+ return "In progress...";
129
+ case "complete":
130
+ return (React.createElement(StyledIconWrapper, { "$gap": "spacing-4", "$alignItems": "center", "$disabled": isDisabled },
131
+ React.createElement(OakIcon, { iconName: "tick", "$width": "spacing-24", "$height": "spacing-24" }),
132
+ pickSummaryForComplete(props)));
133
+ }
134
+ }
135
+ function pickSummaryForNotStarted(props) {
136
+ switch (props.lessonSectionName) {
137
+ case "intro":
138
+ return "Prepare";
139
+ case "starter-quiz":
140
+ return "Activate - ".concat(props.numQuestions, " Questions");
141
+ case "exit-quiz":
142
+ return "Check - ".concat(props.numQuestions, " questions");
143
+ case "video":
144
+ return "Learn";
145
+ }
146
+ }
147
+ function pickSummaryForComplete(props) {
148
+ switch (props.lessonSectionName) {
149
+ case "intro":
150
+ case "video":
151
+ return "Completed";
152
+ case "starter-quiz":
153
+ case "exit-quiz":
154
+ // The counter is rendered as the summary next
155
+ // when on a mobile device, so it is hidden on larger screens
156
+ return (React.createElement(React.Fragment, null,
157
+ React.createElement(OakBox, { "$display": ["none", "block"] }, "Completed"),
158
+ React.createElement(OakBox, { "$display": ["block", "none"] },
159
+ props.grade,
160
+ "/",
161
+ props.numQuestions,
162
+ " correct")));
163
+ }
164
+ }
165
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
166
+
167
+ export { OakLessonNavItem };
@@ -0,0 +1,30 @@
1
+ import { __rest, __read, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { ReviewItemContainer, ReviewItemTitleSection } from '../OakLessonReviewQuiz/OakPupilLessonReviewQuiz.js';
4
+ import { OakFlex } from '../../../../layout-and-structure/OakFlex/OakFlex.js';
5
+ import { OakRoundIcon } from '../../../../images-and-icons/OakRoundIcon/OakRoundIcon.js';
6
+
7
+ var OakLessonReviewIntroVideo = function (props) {
8
+ var completed = props.completed, lessonSectionName = props.lessonSectionName, rest = __rest(props, ["completed", "lessonSectionName"]);
9
+ var _a = __read(lessonSectionName === "intro"
10
+ ? [
11
+ "bg-decorative2-very-subdued",
12
+ "border-decorative2",
13
+ "bg-decorative2-main",
14
+ ]
15
+ : [
16
+ "bg-decorative4-very-subdued",
17
+ "border-decorative4",
18
+ "bg-decorative4-main",
19
+ ], 3), completedBackgroundColor = _a[0], borderColor = _a[1], iconBackgroundColor = _a[2];
20
+ var summaryForIncomplete = lessonSectionName === "intro" ? "Prepare" : "Learn";
21
+ var lessonSectionNameToIconMap = new Map();
22
+ lessonSectionNameToIconMap.set("intro", "intro");
23
+ lessonSectionNameToIconMap.set("video", "video");
24
+ return (React.createElement(ReviewItemContainer, __assign({ "$background": completed ? completedBackgroundColor : "bg-primary", "$borderColor": completed ? completedBackgroundColor : borderColor }, rest),
25
+ React.createElement(OakFlex, { "$gap": "spacing-24", "$alignItems": "center" },
26
+ React.createElement(OakRoundIcon, { iconName: lessonSectionNameToIconMap.get(lessonSectionName), "$width": "spacing-56", "$height": "spacing-56", "$background": iconBackgroundColor }),
27
+ React.createElement(ReviewItemTitleSection, { sectionHeader: lessonSectionName === "intro" ? "Introduction" : "Lesson video", completed: completed, summaryForIncomplete: summaryForIncomplete }))));
28
+ };
29
+
30
+ export { OakLessonReviewIntroVideo };
@@ -0,0 +1,106 @@
1
+ import { __makeTemplateObject, __rest, __read, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+ import { OakBox } from '../../../../layout-and-structure/OakBox/OakBox.js';
5
+ import { OakFlex } from '../../../../layout-and-structure/OakFlex/OakFlex.js';
6
+ import { OakIcon } from '../../../../images-and-icons/OakIcon/OakIcon.js';
7
+ import { OakSpan } from '../../../../typography/OakSpan/OakSpan.js';
8
+ import { OakRoundIcon } from '../../../../images-and-icons/OakRoundIcon/OakRoundIcon.js';
9
+
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
+ var OakLessonReviewItem = function (props) {
12
+ var completed = props.completed, lessonSectionName = props.lessonSectionName, rest = __rest(props, ["completed", "lessonSectionName"]);
13
+ var _a = __read(pickColorsForSection(lessonSectionName), 3), completedBackgroundColor = _a[0], borderColor = _a[1], iconBackgroundColor = _a[2];
14
+ var lessonSectionNameToIconMap = new Map();
15
+ lessonSectionNameToIconMap.set("intro", "intro");
16
+ lessonSectionNameToIconMap.set("starter-quiz", "quiz");
17
+ lessonSectionNameToIconMap.set("exit-quiz", "quiz");
18
+ lessonSectionNameToIconMap.set("video", "video");
19
+ return (React.createElement(StyledLessonReviewItem, __assign({ 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" }, rest),
20
+ React.createElement(OakRoundIcon, { iconName: lessonSectionNameToIconMap.get(lessonSectionName), "$width": "spacing-56", "$height": "spacing-56", "$background": iconBackgroundColor }),
21
+ React.createElement(OakFlex, { "$flexGrow": 1, "$flexShrink": 1, "$flexDirection": "column" },
22
+ React.createElement(OakBox, { "$font": ["heading-6", "heading-5"], "$color": "text-primary" }, pickLabelForSection(lessonSectionName)),
23
+ React.createElement(OakBox, { "$font": ["body-2", "body-1"] }, pickSummaryForProgress(props))),
24
+ renderQuestionCounter(props)));
25
+ };
26
+ var pickSummaryForProgress = function (props) {
27
+ if (props.completed === false) {
28
+ return pickSummaryForIncomplete(props);
29
+ }
30
+ else {
31
+ return (React.createElement(OakFlex, { "$gap": "spacing-4", "$alignItems": "center" },
32
+ React.createElement(OakIcon, { iconName: "tick", "$width": "spacing-24", "$height": "spacing-24" }),
33
+ "Completed"));
34
+ }
35
+ };
36
+ var pickSummaryForIncomplete = function (props) {
37
+ switch (props.lessonSectionName) {
38
+ case "intro":
39
+ return "Prepare";
40
+ case "starter-quiz":
41
+ return "Activate - ".concat(props.numQuestions, " questions");
42
+ case "exit-quiz":
43
+ return "Check - ".concat(props.numQuestions, " questions");
44
+ case "video":
45
+ return "Learn";
46
+ }
47
+ };
48
+ var pickLabelForSection = function (sectionName) {
49
+ switch (sectionName) {
50
+ case "intro":
51
+ return "Introduction";
52
+ case "starter-quiz":
53
+ return "Starter quiz";
54
+ case "video":
55
+ return "Lesson video";
56
+ case "exit-quiz":
57
+ return "Exit quiz";
58
+ }
59
+ };
60
+ var pickColorsForSection = function (sectionName) {
61
+ switch (sectionName) {
62
+ case "intro":
63
+ return [
64
+ "bg-decorative2-very-subdued",
65
+ "border-decorative2",
66
+ "bg-decorative2-main",
67
+ ];
68
+ case "starter-quiz":
69
+ return [
70
+ "bg-decorative1-very-subdued",
71
+ "border-decorative1",
72
+ "bg-decorative1-main",
73
+ ];
74
+ case "video":
75
+ return [
76
+ "bg-decorative4-very-subdued",
77
+ "border-decorative4",
78
+ "bg-decorative4-main",
79
+ ];
80
+ case "exit-quiz":
81
+ return [
82
+ "bg-decorative5-very-subdued",
83
+ "border-decorative5",
84
+ "bg-decorative5-main",
85
+ ];
86
+ }
87
+ };
88
+ var renderQuestionCounter = function (props) {
89
+ if (props.completed === false) {
90
+ return null;
91
+ }
92
+ switch (props.lessonSectionName) {
93
+ case "exit-quiz":
94
+ case "starter-quiz":
95
+ return (React.createElement(OakBox, null,
96
+ React.createElement(OakSpan, { "$font": "heading-4" }, props.grade),
97
+ React.createElement(OakSpan, { "$font": "heading-6" },
98
+ "\u00A0/\u00A0",
99
+ props.numQuestions)));
100
+ default:
101
+ return null;
102
+ }
103
+ };
104
+ var templateObject_1;
105
+
106
+ export { OakLessonReviewItem };
@@ -0,0 +1,56 @@
1
+ import { __makeTemplateObject, __rest, __read, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+ import { InternalReviewAccordion } from '../../../../internal-components/InternalReviewAccordion/InternalReviewAccordion.js';
5
+ import { OakBox } from '../../../../layout-and-structure/OakBox/OakBox.js';
6
+ import { OakFlex } from '../../../../layout-and-structure/OakFlex/OakFlex.js';
7
+ import { OakIcon } from '../../../../images-and-icons/OakIcon/OakIcon.js';
8
+ import { OakSpan } from '../../../../typography/OakSpan/OakSpan.js';
9
+ import { OakRoundIcon } from '../../../../images-and-icons/OakRoundIcon/OakRoundIcon.js';
10
+
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
+ 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));
15
+ };
16
+ var ReviewItemTitleSection = function (props) {
17
+ var sectionHeader = props.sectionHeader, completed = props.completed, summaryForIncomplete = props.summaryForIncomplete;
18
+ return (React.createElement(OakFlex, { "$flexGrow": 1, "$flexShrink": 1, "$flexDirection": "column" },
19
+ React.createElement(OakBox, { "$font": ["heading-6", "heading-5"], "$color": "text-primary" }, sectionHeader),
20
+ React.createElement(OakBox, { "$font": ["body-2", "body-1"] }, completed === false ? (summaryForIncomplete) : (React.createElement(OakFlex, { "$gap": "spacing-4", "$alignItems": "center" },
21
+ React.createElement(OakIcon, { iconName: "tick", "$width": "spacing-24", "$height": "spacing-24" }),
22
+ "Completed")))));
23
+ };
24
+ var OakLessonReviewQuiz = function (props) {
25
+ var completed = props.completed, lessonSectionName = props.lessonSectionName, resultsSlot = props.resultsSlot, rest = __rest(props, ["completed", "lessonSectionName", "resultsSlot"]);
26
+ var _a = __read(lessonSectionName === "starter-quiz"
27
+ ? [
28
+ "bg-decorative1-very-subdued",
29
+ "border-decorative1",
30
+ "bg-decorative1-main",
31
+ ]
32
+ : [
33
+ "bg-decorative5-very-subdued",
34
+ "border-decorative5",
35
+ "bg-decorative5-main",
36
+ ], 3), completedBackgroundColor = _a[0], borderColor = _a[1], iconBackgroundColor = _a[2];
37
+ var summaryForIncomplete = lessonSectionName === "starter-quiz"
38
+ ? "Activate - ".concat(props.numQuestions, " questions")
39
+ : "Check - ".concat(props.numQuestions, " questions");
40
+ var resultsToggleAriaLabel = lessonSectionName === "starter-quiz"
41
+ ? "Starter quiz results"
42
+ : "Exit quiz results";
43
+ return (React.createElement(ReviewItemContainer, __assign({ "$background": completed ? completedBackgroundColor : "bg-primary", "$borderColor": completed ? completedBackgroundColor : borderColor }, rest),
44
+ React.createElement(OakFlex, { "$gap": "spacing-24", "$alignItems": "center" },
45
+ React.createElement(OakRoundIcon, { iconName: "quiz", "$width": "spacing-56", "$height": "spacing-56", "$background": iconBackgroundColor }),
46
+ React.createElement(ReviewItemTitleSection, { sectionHeader: lessonSectionName === "exit-quiz" ? "Exit quiz" : "Starter quiz", completed: completed, summaryForIncomplete: summaryForIncomplete }),
47
+ completed && (React.createElement(OakBox, null,
48
+ React.createElement(OakSpan, { "$font": "heading-4" }, props.grade),
49
+ React.createElement(OakSpan, { "$font": "heading-6" },
50
+ "\u00A0/\u00A0",
51
+ props.numQuestions)))),
52
+ completed && (React.createElement(InternalReviewAccordion, { initialOpen: false, id: "quiz-review-accordion-".concat(lessonSectionName), toggleButtonAriaLabel: resultsToggleAriaLabel }, resultsSlot))));
53
+ };
54
+ var templateObject_1;
55
+
56
+ export { OakLessonReviewQuiz, ReviewItemContainer, ReviewItemTitleSection };
@@ -0,0 +1,58 @@
1
+ import { __makeTemplateObject, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+ import { OakBox } from '../../../../layout-and-structure/OakBox/OakBox.js';
5
+ import { OakFlex } from '../../../../layout-and-structure/OakFlex/OakFlex.js';
6
+ import { OakHeading } from '../../../../typography/OakHeading/OakHeading.js';
7
+ import { OakSpan } from '../../../../typography/OakSpan/OakSpan.js';
8
+ import { OakRoundIcon } from '../../../../images-and-icons/OakRoundIcon/OakRoundIcon.js';
9
+ import { getBreakpoint } from '../../../../../styles/utils/responsiveStyle.js';
10
+
11
+ var StyledMobileSummary = styled(OakSpan)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @media (min-width: ", "px) {\n display: none;\n }\n"], ["\n @media (min-width: ", "px) {\n display: none;\n }\n"])), getBreakpoint("small"));
12
+ /**
13
+ * Controls for navigating back and displaying progress in a lesson
14
+ */
15
+ var OakLessonTopNav = function (_a) {
16
+ var lessonSectionName = _a.lessonSectionName, backLinkSlot = _a.backLinkSlot, counterSlot = _a.counterSlot, heading = _a.heading, mobileSummary = _a.mobileSummary;
17
+ return (React.createElement(OakFlex, { "$gap": "spacing-24", "$alignItems": "center" },
18
+ React.createElement(OakBox, { "$pl": ["spacing-0", "spacing-12"] }, backLinkSlot),
19
+ React.createElement(OakFlex, { "$flexGrow": "none" },
20
+ React.createElement(OakRoundIcon, __assign({}, pickSectionIcon(lessonSectionName), { "$width": "spacing-40", "$height": "spacing-40" }))),
21
+ React.createElement(OakBox, null,
22
+ React.createElement(OakHeading, { tag: "h1", "$font": ["heading-7", "heading-5"] }, heading),
23
+ React.createElement(StyledMobileSummary, { "$font": "body-3" }, mobileSummary)),
24
+ React.createElement(OakFlex, { "$flexGrow": 1, "$justifyContent": "flex-end" },
25
+ React.createElement(OakBox, { "$display": ["none", "block"] }, counterSlot))));
26
+ };
27
+ function pickSectionIcon(sectionName) {
28
+ switch (sectionName) {
29
+ case "intro":
30
+ return {
31
+ iconName: "intro",
32
+ $background: "icon-decorative2",
33
+ };
34
+ case "starter-quiz":
35
+ return {
36
+ iconName: "quiz",
37
+ $background: "icon-decorative1",
38
+ };
39
+ case "video":
40
+ return {
41
+ iconName: "video",
42
+ $background: "icon-decorative4",
43
+ };
44
+ case "exit-quiz":
45
+ return {
46
+ iconName: "quiz",
47
+ $background: "icon-decorative5",
48
+ };
49
+ default:
50
+ return {
51
+ iconName: "intro",
52
+ $background: "icon-decorative2",
53
+ };
54
+ }
55
+ }
56
+ var templateObject_1;
57
+
58
+ export { OakLessonTopNav };
@@ -0,0 +1,27 @@
1
+ import { __read } from 'tslib';
2
+ import React, { useState } from 'react';
3
+ import { OakFlex } from '../../../../layout-and-structure/OakFlex/OakFlex.js';
4
+ import { OakBox } from '../../../../layout-and-structure/OakBox/OakBox.js';
5
+ import { OakCollapsibleContent } from '../../../../layout-and-structure/OakCollapsibleContent/OakCollapsibleContent.js';
6
+ import { OakTertiaryButton } from '../../../../buttons/OakTertiaryButton/OakTertiaryButton.js';
7
+
8
+ /**
9
+ * Display a togglable video transcript with a slot to display a sign language control
10
+ */
11
+ var OakLessonVideoTranscript = function (_a) {
12
+ var children = _a.children, id = _a.id, _b = _a.signLanguageControl, signLanguageControl = _b === void 0 ? null : _b, transcriptToggled = _a.transcriptToggled;
13
+ var _c = __read(useState(false), 2), showTranscript = _c[0], setShowTranscript = _c[1];
14
+ var handleClick = function () {
15
+ setShowTranscript(!showTranscript);
16
+ if (transcriptToggled) {
17
+ transcriptToggled({ isOpen: !showTranscript });
18
+ }
19
+ };
20
+ return (React.createElement(React.Fragment, null,
21
+ React.createElement(OakFlex, { "$flexDirection": ["column-reverse", "row"], "$justifyContent": "space-between" },
22
+ React.createElement(OakBox, null, children && (React.createElement(OakTertiaryButton, { onClick: handleClick, iconName: showTranscript ? "chevron-up" : "chevron-down", isTrailingIcon: true, "aria-controls": id, "aria-expanded": showTranscript, "$mb": "spacing-24" }, showTranscript ? "Hide transcript" : "Show transcript"))),
23
+ signLanguageControl && (React.createElement(OakBox, { "$mb": "spacing-24" }, signLanguageControl))),
24
+ children && (React.createElement(OakCollapsibleContent, { id: id, "$maxHeight": "spacing-960", isOpen: showTranscript, "$font": "body-1", "$color": "text-primary", "aria-live": "polite" }, children))));
25
+ };
26
+
27
+ export { OakLessonVideoTranscript };