@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,56 @@
1
+ import { __makeTemplateObject, __rest, __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 { OakSpan } from '../../typography/OakSpan/OakSpan.js';
7
+ import { OakSvg } from '../../images-and-icons/OakSvg/OakSvg.js';
8
+ import { InternalButton } from '../InternalButton/InternalButton.js';
9
+ import { OakIcon } from '../../images-and-icons/OakIcon/OakIcon.js';
10
+ import { OakLoadingSpinner } from '../../messaging-and-feedback/OakLoadingSpinner/OakLoadingSpinner.js';
11
+ import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
12
+ import { positionStyle } from '../../../styles/utils/positionStyle.js';
13
+ import { parseColor } from '../../../styles/helpers/parseColor.js';
14
+ import { sizeStyle } from '../../../styles/utils/sizeStyle.js';
15
+
16
+ var StyledInternalButton = styled(InternalButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n"])), positionStyle, sizeStyle, function (props) { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover {\n text-decoration: ", ";\n color: ", ";\n background: ", ";\n border-color: ", ";\n [data-state=\"selected\"] {\n display: none;\n }\n }\n &:active {\n background: ", ";\n border-color: ", ";\n color: ", ";\n [data-state=\"selected\"] {\n display: none;\n }\n }\n &:disabled {\n background: ", ";\n border-color: ", ";\n color: ", ";\n [data-state=\"selected\"] {\n display: none;\n }\n }\n "], ["\n &:hover {\n text-decoration: ", ";\n color: ", ";\n background: ", ";\n border-color: ", ";\n [data-state=\"selected\"] {\n display: none;\n }\n }\n &:active {\n background: ", ";\n border-color: ", ";\n color: ", ";\n [data-state=\"selected\"] {\n display: none;\n }\n }\n &:disabled {\n background: ", ";\n border-color: ", ";\n color: ", ";\n [data-state=\"selected\"] {\n display: none;\n }\n }\n "])), props.$hoverUnderline ? "underline" : "none", parseColor(props.$hoverTextColor), parseColor(props.$hoverBackground), parseColor(props.$hoverBorderColor), parseColor(props.$defaultBackground), parseColor(props.$defaultBorderColor), parseColor(props.$defaultTextColor), parseColor(props.$disabledBackground), parseColor(props.$disabledBorderColor), parseColor(props.$disabledTextColor)); });
17
+ var StyledOakSvg = styled(OakSvg)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n bottom: -3px;\n left: 0px;\n position: absolute;\n height: 5px;\n color: ", ";\n"], ["\n bottom: -3px;\n left: 0px;\n position: absolute;\n height: 5px;\n color: ", ";\n"])), parseColor("border-decorative1"));
18
+ var StyledButtonWrapper = styled(OakBox)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n .grey-shadow:has(+ * + .internal-button:focus-visible) {\n box-shadow: ", ";\n }\n .yellow-shadow:has(+ .internal-button:focus-visible) {\n box-shadow: ", ";\n }\n .yellow-shadow:has(+ .internal-button:hover),\n .yellow-shadow:has(+ .internal-button:hover:not(:focus-visible, :active)) {\n box-shadow: ", ";\n }\n .grey-shadow:has(+ * + .internal-button:hover) {\n box-shadow: none;\n }\n .grey-shadow:has(+ * + .internal-button:active) {\n box-shadow: ", ";\n }\n .yellow-shadow:has(+ .internal-button:active) {\n box-shadow: ", ";\n }\n"], ["\n .grey-shadow:has(+ * + .internal-button:focus-visible) {\n box-shadow: ", ";\n }\n .yellow-shadow:has(+ .internal-button:focus-visible) {\n box-shadow: ", ";\n }\n .yellow-shadow:has(+ .internal-button:hover),\n .yellow-shadow:has(+ .internal-button:hover:not(:focus-visible, :active)) {\n box-shadow: ", ";\n }\n .grey-shadow:has(+ * + .internal-button:hover) {\n box-shadow: none;\n }\n .grey-shadow:has(+ * + .internal-button:active) {\n box-shadow: ", ";\n }\n .yellow-shadow:has(+ .internal-button:active) {\n box-shadow: ", ";\n }\n"])), parseDropShadow("drop-shadow-centered-grey"), parseDropShadow("drop-shadow-centered-lemon"), function (props) { return parseDropShadow(props.$hoverShadow); }, parseDropShadow("drop-shadow-grey"), parseDropShadow("drop-shadow-lemon"));
19
+ /**
20
+ *
21
+ * A styled rectangular button, not intended to be used directly.
22
+ * Instead used by OakPrimaryButton and OakSecondaryButton.
23
+ *
24
+ * The following callbacks are available for tracking focus events:
25
+ *
26
+ * ### onClick
27
+ * `onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;`
28
+
29
+ * ### onHovered
30
+ * `onHovered?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, duration: number) => void;`<br>
31
+ * called after a mouseEnter and mouseLeave event has happened
32
+ */
33
+ var InternalShadowRectButton = function (props) {
34
+ var _a = props.element, element = _a === void 0 ? "button" : _a, children = props.children, iconName = props.iconName, iconAriaHidden = props.iconAriaHidden, isTrailingIcon = props.isTrailingIcon, isLoading = props.isLoading, disabled = props.disabled, _b = props.width, width = _b === void 0 ? "max-content" : _b, _c = props.height, height = _c === void 0 ? "auto" : _c, maxWidth = props.maxWidth, innerWidth = props.innerWidth, defaultBackground = props.defaultBackground, defaultBorderColor = props.defaultBorderColor, defaultTextColor = props.defaultTextColor, disabledTextColor = props.disabledTextColor, hoverTextColor = props.hoverTextColor, hoverBackground = props.hoverBackground, hoverBorderColor = props.hoverBorderColor, hoverUnderline = props.hoverUnderline, disabledBackground = props.disabledBackground, disabledBorderColor = props.disabledBorderColor, className = props.className, _d = props.hoverShadow, hoverShadow = _d === void 0 ? "drop-shadow-lemon" : _d, _e = props.pv, pv = _e === void 0 ? "spacing-12" : _e, _f = props.ph, ph = _f === void 0 ? "spacing-16" : _f, pt = props.pt, pb = props.pb, pl = props.pl, pr = props.pr, _g = props.iconLayout, iconLayout = _g === void 0 ? "row" : _g, _h = props.iconGap, iconGap = _h === void 0 ? "spacing-8" : _h, iconOverride = props.iconOverride, _j = props.font, font = _j === void 0 ? "heading-7" : _j, _k = props.textAlign, textAlign = _k === void 0 ? "left" : _k, _l = props.loadingSpinnerSize, loadingSpinnerSize = _l === void 0 ? "spacing-24" : _l, _m = props.display, display = _m === void 0 ? "inline-block" : _m, selected = props.selected, rest = __rest(props, ["element", "children", "iconName", "iconAriaHidden", "isTrailingIcon", "isLoading", "disabled", "width", "height", "maxWidth", "innerWidth", "defaultBackground", "defaultBorderColor", "defaultTextColor", "disabledTextColor", "hoverTextColor", "hoverBackground", "hoverBorderColor", "hoverUnderline", "disabledBackground", "disabledBorderColor", "className", "hoverShadow", "pv", "ph", "pt", "pb", "pl", "pr", "iconLayout", "iconGap", "iconOverride", "font", "textAlign", "loadingSpinnerSize", "display", "selected"]);
35
+ var icon = iconOverride !== null && iconOverride !== void 0 ? iconOverride : (React.createElement(React.Fragment, null, iconName && (React.createElement(OakIcon, { iconName: iconName, "$width": "spacing-24", "$height": "spacing-24", "$colorFilter": props.disabled ? disabledTextColor : defaultTextColor, "aria-hidden": iconAriaHidden }))));
36
+ var loader = (React.createElement(OakBox, { "$width": loadingSpinnerSize, "$height": loadingSpinnerSize },
37
+ React.createElement(OakLoadingSpinner, { "$width": loadingSpinnerSize })));
38
+ var iconLogic = React.createElement(React.Fragment, null, isLoading && !disabled ? loader : icon);
39
+ return (React.createElement(StyledButtonWrapper, { className: className, "$position": "relative", "$width": width, "$height": height, "$maxWidth": maxWidth, "$hoverShadow": hoverShadow },
40
+ React.createElement(OakBox, { className: "grey-shadow", "$position": "absolute", "$borderRadius": "border-radius-s", "$width": "100%", "$height": "100%", "$top": "spacing-0" }),
41
+ React.createElement(OakBox, { className: "yellow-shadow", "$position": "absolute", "$borderRadius": "border-radius-s", "$width": "100%", "$height": "100%", "$top": "spacing-0" }),
42
+ React.createElement(StyledInternalButton, __assign({ element: element, className: "internal-button", "$ba": "border-solid-m", "$background": defaultBackground, "$borderColor": defaultBorderColor, "$color": defaultTextColor, "$pv": pv, "$ph": ph, "$pt": pt, "$pb": pb, "$pl": pl, "$pr": pr, "$borderRadius": "border-radius-s", "$position": "relative", disabled: disabled || isLoading, "$width": "100%", "$height": "100%", "$hoverTextColor": hoverTextColor, "$hoverBackground": hoverBackground, "$hoverBorderColor": hoverBorderColor, "$hoverUnderline": hoverUnderline, "$defaultTextColor": defaultTextColor, "$defaultBackground": defaultBackground, "$defaultBorderColor": defaultBorderColor, "$disabledTextColor": disabledTextColor, "$disabledBackground": disabledBackground, "$disabledBorderColor": disabledBorderColor, "$display": display }, rest),
43
+ React.createElement(OakFlex, { "$flexDirection": iconLayout, "$alignItems": "center", "$gap": iconGap, "$justifyContent": "center", "$width": innerWidth },
44
+ !isTrailingIcon && iconLogic,
45
+ selected ? (React.createElement(TextWithUnderline, { font: font }, children)) : (React.createElement(OakSpan, { "$font": font, "$textAlign": textAlign }, children)),
46
+ isTrailingIcon && iconLogic))));
47
+ };
48
+ var TextWithUnderline = function (_a) {
49
+ var textAlign = _a.textAlign, font = _a.font, children = _a.children;
50
+ return (React.createElement(OakBox, { "$position": "relative", "$textAlign": textAlign },
51
+ React.createElement(OakSpan, { "$font": font }, children),
52
+ React.createElement(StyledOakSvg, { name: "underline", "data-state": "selected", "data-testid": "selected-underline" })));
53
+ };
54
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
55
+
56
+ export { InternalShadowRectButton, StyledButtonWrapper };
@@ -0,0 +1,56 @@
1
+ import { __makeTemplateObject, __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { parseColorFilter } from '../../../styles/helpers/parseColorFilter.js';
5
+ import { OakBox } from '../../layout-and-structure/OakBox/OakBox.js';
6
+ import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
7
+ import { OakSpan } from '../../typography/OakSpan/OakSpan.js';
8
+ import { InternalButton } from '../InternalButton/InternalButton.js';
9
+ import { OakIcon } from '../../images-and-icons/OakIcon/OakIcon.js';
10
+ import { OakLoadingSpinner } from '../../messaging-and-feedback/OakLoadingSpinner/OakLoadingSpinner.js';
11
+ import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
12
+ import { positionStyle } from '../../../styles/utils/positionStyle.js';
13
+ import { parseColor } from '../../../styles/helpers/parseColor.js';
14
+ import { sizeStyle } from '../../../styles/utils/sizeStyle.js';
15
+
16
+ var StyledInternalButton = styled(InternalButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-block;\n ", "\n ", "\n ", "\n"], ["\n display: inline-block;\n ", "\n ", "\n ", "\n"])), positionStyle, sizeStyle, function (props) { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover {\n text-decoration: underline;\n color: ", ";\n\n &:not(:active) [data-icon-for=\"button\"] img {\n filter: ", ";\n }\n }\n &:active {\n color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n "], ["\n &:hover {\n text-decoration: underline;\n color: ", ";\n\n &:not(:active) [data-icon-for=\"button\"] img {\n filter: ", ";\n }\n }\n &:active {\n color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n "])), parseColor(props.$hoverTextColor), props.$hoverIconColor
17
+ ? parseColorFilter(props.$hoverIconColor)
18
+ : undefined, parseColor(props.$defaultTextColor), parseColor(props.$disabledTextColor)); });
19
+ var StyledButtonWrapper = styled(OakFlex)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (props) { return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n > :first-child:focus-visible .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n > :first-child:hover .shadow {\n box-shadow: ", ";\n }\n > :first-child:active .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n "], ["\n > :first-child:focus-visible .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n > :first-child:hover .shadow {\n box-shadow: ", ";\n }\n > :first-child:active .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n "])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), parseDropShadow(props.$hoverDropShadow /*"drop-shadow-lemon"*/), parseDropShadow("drop-shadow-lemon"), parseDropShadow("drop-shadow-grey")); }, function (props) { return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n > :first-child:disabled .icon-container {\n background: ", ";\n }\n > :first-child:hover .icon-container {\n background: ", ";\n }\n > :first-child:active .icon-container {\n background: ", ";\n }\n "], ["\n > :first-child:disabled .icon-container {\n background: ", ";\n }\n > :first-child:hover .icon-container {\n background: ", ";\n }\n > :first-child:active .icon-container {\n background: ", ";\n }\n "])), parseColor(props.$disabledIconBackground), parseColor(props.$hoverIconBackground), parseColor(props.$defaultIconBackground)); });
20
+ /**
21
+ *
22
+ * A styled button with round icons, not intended to be used directly.
23
+ * Instead used by OakTertiaryButton and OakHintButton.
24
+ *
25
+ * The following callbacks are available for tracking focus events:
26
+ *
27
+ * ### onClick
28
+ * `onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;`
29
+
30
+ * ### onHovered
31
+ * `onHovered?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, duration: number) => void;`<br>
32
+ * called after a mouseEnter and mouseLeave event has happened
33
+ */
34
+ var InternalShadowRoundButton = function (props) {
35
+ var _a = props.element, element = _a === void 0 ? "button" : _a, children = props.children, iconName = props.iconName, isTrailingIcon = props.isTrailingIcon, isLoading = props.isLoading, disabled = props.disabled, _b = props.width, width = _b === void 0 ? "max-content" : _b, maxWidth = props.maxWidth, iconBackgroundSize = props.iconBackgroundSize, iconSize = props.iconSize, disabledIconBackground = props.disabledIconBackground, hoverIconColor = props.hoverIconColor, disabledTextColor = props.disabledTextColor, defaultIconColor = props.defaultIconColor, hoverIconBackground = props.hoverIconBackground, defaultIconBackground = props.defaultIconBackground, defaultIconBorderColor = props.defaultIconBorderColor, disabledIconBorderColor = props.disabledIconBorderColor, disabledIconColor = props.disabledIconColor, defaultTextColor = props.defaultTextColor, hoverTextColor = props.hoverTextColor, _c = props.hoverDropShadow, hoverDropShadow = _c === void 0 ? "drop-shadow-lemon" : _c, className = props.className, rest = __rest(props, ["element", "children", "iconName", "isTrailingIcon", "isLoading", "disabled", "width", "maxWidth", "iconBackgroundSize", "iconSize", "disabledIconBackground", "hoverIconColor", "disabledTextColor", "defaultIconColor", "hoverIconBackground", "defaultIconBackground", "defaultIconBorderColor", "disabledIconBorderColor", "disabledIconColor", "defaultTextColor", "hoverTextColor", "hoverDropShadow", "className"]);
36
+ var icon = iconName && (React.createElement(OakIcon, { iconName: iconName, "$width": iconSize, "$height": iconSize, "$colorFilter": props.disabled
37
+ ? disabledIconColor
38
+ : defaultIconColor
39
+ ? defaultIconColor
40
+ : null, "data-icon-for": "button" }));
41
+ var loader = (React.createElement(OakBox, { "$width": iconSize, "$height": iconSize },
42
+ React.createElement(OakLoadingSpinner, { "$width": iconSize, loaderColor: "bg-primary" })));
43
+ var iconBorderColor = disabled || isLoading ? disabledIconBorderColor : defaultIconBorderColor;
44
+ var iconLogic = (isLoading || icon) && (React.createElement(OakFlex, { className: "icon-container", "$background": props.defaultIconBackground, "$color": props.defaultTextColor, "$borderRadius": "border-radius-circle", "$position": "relative", "$width": iconBackgroundSize, "$height": iconBackgroundSize, "$alignItems": "center", "$justifyContent": "center", "$minWidth": iconBackgroundSize },
45
+ React.createElement(OakBox, { className: "shadow", "$position": "absolute", "$borderRadius": "border-radius-circle", "$borderColor": iconBorderColor, "$ba": iconBorderColor ? "border-solid-m" : undefined, "$width": "100%", "$height": "100%", "$top": "spacing-0" }),
46
+ isLoading && !disabled ? loader : icon));
47
+ return (React.createElement(StyledButtonWrapper, { className: className, "$position": "relative", "$width": width, "$maxWidth": maxWidth, "$disabledIconBackground": disabledIconBackground, "$hoverIconBackground": hoverIconBackground, "$defaultIconBackground": defaultIconBackground, "$hoverDropShadow": hoverDropShadow },
48
+ React.createElement(StyledInternalButton, __assign({ element: element !== null && element !== void 0 ? element : "button" }, rest, { "$hoverTextColor": hoverTextColor, "$hoverIconColor": hoverIconColor, "$defaultTextColor": defaultTextColor, "$disabledTextColor": disabledTextColor, "$color": defaultTextColor, "$position": "relative", disabled: disabled || isLoading }),
49
+ React.createElement(OakFlex, { "$flexDirection": "row", "$alignItems": "center", "$gap": children ? "spacing-12" : "spacing-0", "$justifyContent": "center" },
50
+ !isTrailingIcon && iconLogic,
51
+ React.createElement(OakSpan, { "$font": "heading-7" }, children),
52
+ isTrailingIcon && iconLogic))));
53
+ };
54
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
55
+
56
+ export { InternalShadowRoundButton };
@@ -0,0 +1,30 @@
1
+ import { __makeTemplateObject, __rest, __assign } from 'tslib';
2
+ import React, { forwardRef } from 'react';
3
+ import styled from 'styled-components';
4
+ import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
5
+ import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
6
+
7
+ var SlideInFlex = styled(OakFlex)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: ", ";\n transform: ", ";\n ", "\n"], ["\n max-width: ", ";\n transform: ", ";\n ", "\n"])), function (_a) {
8
+ var isLeftHandSide = _a.isLeftHandSide;
9
+ return isLeftHandSide ? "calc(100vw - ".concat(parseSpacing("spacing-20"), ")") : "100vw";
10
+ }, function (_a) {
11
+ var $state = _a.$state, isLeftHandSide = _a.isLeftHandSide;
12
+ switch ($state) {
13
+ case "entered":
14
+ case "entering":
15
+ return "translateX(0)";
16
+ default:
17
+ return isLeftHandSide ? "translateX(-100%)" : "translateX(100%)";
18
+ }
19
+ }, function (_a) {
20
+ var isLeftHandSide = _a.isLeftHandSide, largeScreenMaxWidth = _a.largeScreenMaxWidth;
21
+ return !isLeftHandSide &&
22
+ "\n @media (min-width: 768px) {\n max-width: ".concat(largeScreenMaxWidth, "px;\n }\n ");
23
+ });
24
+ var InternalSlideInFlex = forwardRef(function (props, ref) {
25
+ var finalZIndex = props.finalZIndex, state = props.state, isLeftHandSide = props.isLeftHandSide, children = props.children, _a = props.largeScreenMaxWidth, largeScreenMaxWidth = _a === void 0 ? 600 : _a, rest = __rest(props, ["finalZIndex", "state", "isLeftHandSide", "children", "largeScreenMaxWidth"]);
26
+ return (React.createElement(SlideInFlex, __assign({ ref: ref, "$background": "bg-primary", "$right": !isLeftHandSide ? "spacing-0" : null, "$left": isLeftHandSide ? "spacing-0" : null, "$position": "fixed", "$bottom": "spacing-0", "$width": ["spacing-640"], "$top": "spacing-0", "$transition": "standard-ease", "$zIndex": finalZIndex, "$flexDirection": "column", "$state": state, "$color": "text-primary", role: "dialog", isLeftHandSide: isLeftHandSide, largeScreenMaxWidth: largeScreenMaxWidth }, rest), children));
27
+ });
28
+ var templateObject_1;
29
+
30
+ export { InternalSlideInFlex as default };
@@ -0,0 +1,14 @@
1
+ import { __makeTemplateObject } from 'tslib';
2
+ import styled, { css } from 'styled-components';
3
+ import { responsiveStyle } from '../../../styles/utils/responsiveStyle.js';
4
+ import { parseColor } from '../../../styles/helpers/parseColor.js';
5
+ import { parseBorderWidth } from '../../../styles/helpers/parseBorderWidth.js';
6
+
7
+ var colorFillStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), responsiveStyle("fill", function (props) { return props.$fill; }, parseColor));
8
+ /**
9
+ * A styled SVG element with props to apply design tokens to the fill and stroke.
10
+ */
11
+ var InternalStyledSvg = styled.svg(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n"])), colorFillStyle, responsiveStyle("stroke", function (props) { return props.$stroke; }, parseColor), responsiveStyle("stroke-width", function (props) { return props.$strokeWidth; }, parseBorderWidth));
12
+ var templateObject_1, templateObject_2;
13
+
14
+ export { InternalStyledSvg, colorFillStyle };
@@ -0,0 +1,50 @@
1
+ import { __makeTemplateObject, __rest, __assign } from 'tslib';
2
+ import React, { useRef } from 'react';
3
+ import styled from 'styled-components';
4
+ import { parseColor } from '../../../styles/helpers/parseColor.js';
5
+ import { getBreakpoint } from '../../../styles/utils/responsiveStyle.js';
6
+ import { spacingStyle } from '../../../styles/utils/spacingStyle.js';
7
+ import { sizeStyle } from '../../../styles/utils/sizeStyle.js';
8
+
9
+ /**
10
+ * Using `appearance none !important;` here because many style resets will set this
11
+ * value to textfield, causing some browsers to implement undesirable styles.
12
+ * E.g. ios and rounded borders (which border-radius doesn't fix without
13
+ * appearance: none)
14
+ */
15
+ var StyledInput = styled.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n appearance: none !important;\n border: 0;\n border-radius: 0;\n border-color: transparent;\n box-shadow: none;\n font-family: inherit;\n background: transparent;\n outline: none;\n color: inherit;\n\n @media (max-width: ", "px) {\n /* iOS zooms in on inputs with font sizes <16px on mobile */\n font-size: 16px;\n }\n\n ::placeholder {\n color: ", ";\n }\n\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n appearance: none;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n ", "\n ", "\n"], ["\n appearance: none !important;\n border: 0;\n border-radius: 0;\n border-color: transparent;\n box-shadow: none;\n font-family: inherit;\n background: transparent;\n outline: none;\n color: inherit;\n\n @media (max-width: ", "px) {\n /* iOS zooms in on inputs with font sizes <16px on mobile */\n font-size: 16px;\n }\n\n ::placeholder {\n color: ", ";\n }\n\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n appearance: none;\n }\n\n :disabled {\n cursor: not-allowed;\n }\n\n ", "\n ", "\n"])), getBreakpoint("small"), parseColor("text-subdued"), spacingStyle, sizeStyle);
16
+ /**
17
+ *
18
+ * An unstyled input to be used as a basis for UI input components.
19
+ * Supports all the props of a regular `HTMLInputElement`
20
+ *
21
+ * 🚨 The CSS `outline` is disabled so a focus ring must be applied by the consuming component.
22
+ *
23
+ * The following callbacks are available for tracking focus events:
24
+ *
25
+ * ### onFocus
26
+ * `(e: FocusEvent<HTMLInputElement>) => void;`
27
+ * ### onBlur
28
+ * `(e: FocusEvent<HTMLInputElement>) => void;`
29
+ * ### onInitialFocus
30
+ * `(e: FocusEvent<HTMLInputElement>) => void;`<br>
31
+ * occurs only when the input is focused for the first time
32
+ *
33
+ */
34
+ var InternalTextInput = function (props) {
35
+ props.onInitialFocus; props.onFocus; var rest = __rest(props, ["onInitialFocus", "onFocus"]);
36
+ var hadInitialFocused = useRef(false);
37
+ var handleOnFocus = function (e) {
38
+ if (!hadInitialFocused.current && props.onInitialFocus) {
39
+ props.onInitialFocus(e);
40
+ hadInitialFocused.current = true;
41
+ }
42
+ if (props.onFocus) {
43
+ props.onFocus(e);
44
+ }
45
+ };
46
+ return React.createElement(StyledInput, __assign({}, rest, { onFocus: handleOnFocus }));
47
+ };
48
+ var templateObject_1;
49
+
50
+ export { InternalTextInput };
@@ -0,0 +1,36 @@
1
+ import { __makeTemplateObject, __rest, __assign } 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 { parseColor } from '../../../styles/helpers/parseColor.js';
6
+ import { responsiveStyle } from '../../../styles/utils/responsiveStyle.js';
7
+ import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
8
+
9
+ var StyledFlex = styled(OakFlex)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: max-content;\n pointer-events: none;\n"], ["\n width: max-content;\n pointer-events: none;\n"])));
10
+ var ARROW_SIZE = parseSpacing("spacing-16");
11
+ var StyledSvg = styled.svg(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n ", "\n ", "\n"], ["\n position: absolute;\n ", "\n ", "\n"])), function (_a) {
12
+ var $tooltipPosition = _a.$tooltipPosition;
13
+ switch ($tooltipPosition) {
14
+ case "bottom-right":
15
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n top: -", ";\n right: ", ";\n transform: scale(-1, -1);\n "], ["\n top: -", ";\n right: ", ";\n transform: scale(-1, -1);\n "])), ARROW_SIZE, parseSpacing("spacing-0"));
16
+ case "top-right":
17
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n bottom: -", ";\n right: ", ";\n transform: scaleX(-1);\n "], ["\n bottom: -", ";\n right: ", ";\n transform: scaleX(-1);\n "])), ARROW_SIZE, parseSpacing("spacing-0"));
18
+ case "top-left":
19
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n bottom: -", ";\n left: ", ";\n "], ["\n bottom: -", ";\n left: ", ";\n "])), ARROW_SIZE, parseSpacing("spacing-0"));
20
+ default:
21
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n top: -", ";\n left: ", ";\n transform: scaleY(-1);\n "], ["\n top: -", ";\n left: ", ";\n transform: scaleY(-1);\n "])), ARROW_SIZE, parseSpacing("spacing-0"));
22
+ }
23
+ }, responsiveStyle("fill", function (props) { return props.$fill; }, parseColor));
24
+ /**
25
+ * A primitive tooltip to be used as a basis for more opinionated UI components.
26
+ */
27
+ var InternalTooltip = function (_a) {
28
+ var children = _a.children, _b = _a.$background, $background = _b === void 0 ? "bg-inverted" : _b, _c = _a.$color, $color = _c === void 0 ? "text-inverted" : _c, _d = _a.tooltipPosition, tooltipPosition = _d === void 0 ? "bottom-left" : _d, props = __rest(_a, ["children", "$background", "$color", "tooltipPosition"]);
29
+ return (React.createElement(StyledFlex, __assign({ role: "tooltip", "data-rac": true, "$position": "relative", "$background": $background, "$color": $color, "$maxWidth": ["spacing-360", "spacing-640"] }, props),
30
+ children,
31
+ React.createElement(StyledSvg, { width: ARROW_SIZE, height: ARROW_SIZE, "$fill": $background, "$tooltipPosition": tooltipPosition, "data-testid": "tooltip-arrow" },
32
+ React.createElement("path", { d: "M0 0H16L8 8L0 16V0Z" }))));
33
+ };
34
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
35
+
36
+ export { InternalTooltip };
@@ -0,0 +1,39 @@
1
+ import { __makeTemplateObject, __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+ import { OakBox } from '../OakBox/OakBox.js';
5
+ import { OakFlex } from '../OakFlex/OakFlex.js';
6
+ import { OakIcon } from '../../images-and-icons/OakIcon/OakIcon.js';
7
+ import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
8
+ import { InternalAccordionButton, InternalAccordionContent } from '../../internal-components/InternalAccordion/InternalAccordion.js';
9
+ import useAccordionContext from '../../internal-components/InternalAccordion/useAccordionContext.js';
10
+ import { InternalAccordionProvider } from '../../internal-components/InternalAccordion/InternalAccordionProvider.js';
11
+
12
+ var StyledOakFlex = styled(InternalAccordionButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font: inherit;\n color: inherit;\n border: none;\n background: none;\n appearance: none;\n\n outline: none;\n\n &:focus-visible {\n box-shadow:\n ", ",\n ", ";\n }\n"], ["\n font: inherit;\n color: inherit;\n border: none;\n background: none;\n appearance: none;\n\n outline: none;\n\n &:focus-visible {\n box-shadow:\n ", ",\n ", ";\n }\n"])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"));
13
+ var Accordion = function (_a) {
14
+ var header = _a.header, headerTag = _a.headerTag, headerAfterSlot = _a.headerAfterSlot, children = _a.children, id = _a.id, _b = _a.chevronPosition, chevronPosition = _b === void 0 ? "left" : _b, _c = _a.openBackground, openBackground = _c === void 0 ? "bg-neutral" : _c, $color = _a.$color, styleProps = __rest(_a, ["header", "headerTag", "headerAfterSlot", "children", "id", "chevronPosition", "openBackground", "$color"]);
15
+ var isOpen = useAccordionContext().isOpen;
16
+ var HeaderTag = headerTag || "h3";
17
+ var chevron = (React.createElement(OakIcon, __assign({ iconName: "chevron-down", "$width": "spacing-24", "$height": "spacing-24", alt: "", "$colorFilter": $color, style: { transform: isOpen ? "rotate(180deg)" : "none" } }, (chevronPosition === "left"
18
+ ? { $mr: "spacing-16" }
19
+ : { $ml: "auto" }))));
20
+ return (React.createElement(OakBox, __assign({ id: id, "$borderColor": "border-neutral-lighter", "$ba": "border-solid-s", "$pa": "spacing-16", "$background": isOpen ? openBackground : "bg-primary" }, styleProps),
21
+ React.createElement(OakFlex, { as: HeaderTag, "$font": "heading-light-7", "$color": $color, "$textDecoration": isOpen ? "underline" : "none" },
22
+ React.createElement(StyledOakFlex, { "$alignItems": "center", "$pa": "spacing-16", "$width": chevronPosition === "right" ? "100%" : undefined, id: id },
23
+ chevronPosition === "left" && chevron,
24
+ header,
25
+ chevronPosition === "right" && chevron),
26
+ headerAfterSlot && (React.createElement(OakFlex, { "$ml": "spacing-24" }, headerAfterSlot))),
27
+ React.createElement(InternalAccordionContent, { "aria-labelledby": id, "$ml": chevronPosition === "right" ? "spacing-0" : "spacing-24", "$pl": chevronPosition === "right" ? "spacing-0" : "spacing-16", "$mt": "spacing-4", "$font": "body-3" }, children)));
28
+ };
29
+ /**
30
+ * An accordion component that can be used to show/hide content
31
+ */
32
+ var OakAccordion = function (props) {
33
+ var _a = props.initialOpen, initialOpen = _a === void 0 ? false : _a, rest = __rest(props, ["initialOpen"]);
34
+ return (React.createElement(InternalAccordionProvider, { isInitialOpen: initialOpen },
35
+ React.createElement(Accordion, __assign({}, rest))));
36
+ };
37
+ var templateObject_1;
38
+
39
+ export { OakAccordion };
@@ -0,0 +1,10 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { InternalChevronAccordion } from '../../internal-components/InternalChevronAccordion/InternalChevronAccordion.js';
4
+
5
+ var OakBasicAccordion = function (_a) {
6
+ var header = _a.header, children = _a.children, id = _a.id, initialOpen = _a.initialOpen, subheading = _a.subheading, styleProps = __rest(_a, ["header", "children", "id", "initialOpen", "subheading"]);
7
+ return (React.createElement(InternalChevronAccordion, __assign({ header: header, id: id, initialOpen: initialOpen, subheading: subheading }, styleProps), children));
8
+ };
9
+
10
+ export { OakBasicAccordion };
@@ -0,0 +1,41 @@
1
+ import { __makeTemplateObject } from 'tslib';
2
+ import styled, { css } from 'styled-components';
3
+ import { colorStyle } from '../../../styles/utils/colorStyle.js';
4
+ import { positionStyle } from '../../../styles/utils/positionStyle.js';
5
+ import { sizeStyle } from '../../../styles/utils/sizeStyle.js';
6
+ import { spacingStyle } from '../../../styles/utils/spacingStyle.js';
7
+ import { borderStyle } from '../../../styles/utils/borderStyle.js';
8
+ import { displayStyle } from '../../../styles/utils/displayStyle.js';
9
+ import { dropShadowStyle } from '../../../styles/utils/dropShadowStyle.js';
10
+ import { opacityStyle } from '../../../styles/utils/opacityStyle.js';
11
+ import { transformStyle } from '../../../styles/utils/transformStyle.js';
12
+ import { transitionStyle } from '../../../styles/utils/transitionStyle.js';
13
+ import { typographyStyle } from '../../../styles/utils/typographyStyle.js';
14
+ import { zIndexStyle } from '../../../styles/utils/zIndexStyle.js';
15
+ import { scrollSnapStyle } from '../../../styles/utils/scrollSnapStyle.js';
16
+
17
+ var oakBoxCss = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"])), positionStyle, sizeStyle, spacingStyle, colorStyle, borderStyle, displayStyle, dropShadowStyle, opacityStyle, transformStyle, transitionStyle, typographyStyle, zIndexStyle, scrollSnapStyle, function (props) {
18
+ /* onClick might be passed in the useClickableCard pattern */
19
+ return props.onClick && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n :hover {\n cursor: pointer;\n }\n "], ["\n :hover {\n cursor: pointer;\n }\n "])));
20
+ });
21
+ /**
22
+ * OakBox exposes all the styles that are available styles on a div tag. These include:
23
+ * - color
24
+ * - size
25
+ * - display
26
+ * - spacing
27
+ * - position
28
+ * - border
29
+ * - opacity
30
+ * - z-index
31
+ * - typography
32
+ * - transition
33
+ * - transform
34
+ * - drop-shadow
35
+ * - scroll-margin-top/left
36
+ *
37
+ */
38
+ var OakBox = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), oakBoxCss);
39
+ var templateObject_1, templateObject_2, templateObject_3;
40
+
41
+ export { OakBox, oakBoxCss };
@@ -0,0 +1,23 @@
1
+ import { __makeTemplateObject, __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+ import { OakBox } from '../OakBox/OakBox.js';
5
+ import { OakFlex } from '../OakFlex/OakFlex.js';
6
+ import { parseColor } from '../../../styles/helpers/parseColor.js';
7
+ import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
8
+ import { parseBorderRadius } from '../../../styles/helpers/parseBorderRadius.js';
9
+
10
+ var StyledScrollBox = styled(OakBox)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &::-webkit-scrollbar-thumb {\n border-radius: ", ";\n background-color: ", ";\n }\n &::-webkit-scrollbar-track {\n border-radius: ", ";\n background-color: ", ";\n }\n &::-webkit-scrollbar {\n width: ", ";\n height: ", ";\n border-radius: ", ";\n }\n"], ["\n &::-webkit-scrollbar-thumb {\n border-radius: ", ";\n background-color: ", ";\n }\n &::-webkit-scrollbar-track {\n border-radius: ", ";\n background-color: ", ";\n }\n &::-webkit-scrollbar {\n width: ", ";\n height: ", ";\n border-radius: ", ";\n }\n"])), parseBorderRadius("border-radius-m"), parseColor("bg-interactive-element1"), parseBorderRadius("border-radius-m"), parseColor("bg-primary"), parseSpacing("spacing-12"), parseSpacing("spacing-12"), parseBorderRadius("border-radius-m"));
11
+ /**
12
+ * A filled scrollable box that can be hidden with the `isOpen` prop.
13
+ * Useful for hiding content that is not immediately relevant
14
+ */
15
+ var OakCollapsibleContent = function (_a) {
16
+ var isOpen = _a.isOpen, children = _a.children, id = _a.id, rest = __rest(_a, ["isOpen", "children", "id"]);
17
+ return (React.createElement(OakBox, { "$display": isOpen ? "block" : "none", id: id },
18
+ React.createElement(OakFlex, __assign({ "$background": "bg-neutral-stronger", "$ph": "spacing-16", "$pv": "spacing-24", "$borderRadius": "border-radius-m" }, rest),
19
+ React.createElement(StyledScrollBox, { "$overflow": "auto", "$maxHeight": "100%", "$width": "100%", "$pr": "spacing-16" }, children))));
20
+ };
21
+ var templateObject_1;
22
+
23
+ export { OakCollapsibleContent };
@@ -0,0 +1,18 @@
1
+ import { __makeTemplateObject } from 'tslib';
2
+ import styled from 'styled-components';
3
+ import { OakBox } from '../OakBox/OakBox.js';
4
+ import { flexStyle } from '../../../styles/utils/flexStyle.js';
5
+
6
+ var oakFlexCss = flexStyle;
7
+ /**
8
+ * Flex sets `display: flex;` and exposes various flex props, along with Box
9
+ * props.
10
+ *
11
+ * ## Usage
12
+ * Before adding props to this component, think about whether it makes sense
13
+ * to add it to Box instead, as this component extends that.
14
+ */
15
+ var OakFlex = styled(OakBox)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), flexStyle);
16
+ var templateObject_1;
17
+
18
+ export { OakFlex, oakFlexCss };
@@ -0,0 +1,16 @@
1
+ import { __makeTemplateObject } from 'tslib';
2
+ import styled, { css } from 'styled-components';
3
+ import { responsiveStyle } from '../../../styles/utils/responsiveStyle.js';
4
+ import { OakBox } from '../OakBox/OakBox.js';
5
+ import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
6
+
7
+ var gridStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"])), responsiveStyle("row-gap", function (props) { return props.$rg; }, parseSpacing), responsiveStyle("column-gap", function (props) { return props.$cg; }, parseSpacing), responsiveStyle("grid-auto-rows", function (props) { return props.$gridAutoRows; }), responsiveStyle("grid-template-areas", function (props) { return props.$gridTemplateAreas; }), responsiveStyle("grid-template-columns", function (props) { return props.$gridTemplateColumns; }), responsiveStyle("grid-template-rows", function (props) { return props.$gridTemplateRows; }));
8
+ /**
9
+ * Creates a grid layout
10
+ *
11
+ * Defaults to a 12 column grid
12
+ */
13
+ var OakGrid = styled(OakBox)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n width: 100%;\n\n ", ";\n"], ["\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n width: 100%;\n\n ", ";\n"])), gridStyle);
14
+ var templateObject_1, templateObject_2;
15
+
16
+ export { OakGrid };
@@ -0,0 +1,51 @@
1
+ import { __makeTemplateObject, __read } from 'tslib';
2
+ import styled, { css } from 'styled-components';
3
+ import { responsiveStyle } from '../../../styles/utils/responsiveStyle.js';
4
+ import { OakFlex } from '../OakFlex/OakFlex.js';
5
+
6
+ var combineSpanStart = function (start, span) {
7
+ return start ? "".concat(start, "/").concat(span) : "".concat(span);
8
+ };
9
+ var parseSpanStart = function (value) {
10
+ if (value === null || value === void 0 ? void 0 : value.includes("/")) {
11
+ var _a = __read(value.split("/"), 2), start = _a[0], span_1 = _a[1];
12
+ return "".concat(start, " / span ").concat(span_1);
13
+ }
14
+ var span = value;
15
+ return "span ".concat(span);
16
+ };
17
+ var gridArea = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n ", "\n ", "\n"], ["\n flex-direction: column;\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n ", "\n ", "\n"])), responsiveStyle("grid-column", function (props) {
18
+ return Array.isArray(props.$colSpan)
19
+ ? props.$colSpan.map(function (span, index) {
20
+ return combineSpanStart(Array.isArray(props.$colStart)
21
+ ? props.$colStart[index]
22
+ : props.$colStart, span);
23
+ })
24
+ : combineSpanStart(Array.isArray(props.$colStart)
25
+ ? props.$colStart[0]
26
+ : props.$colStart, props.$colSpan);
27
+ }, function (value) { return parseSpanStart(value); }), responsiveStyle("grid-row", function (props) {
28
+ return Array.isArray(props.$rowSpan)
29
+ ? props.$rowSpan.map(function (span, index) {
30
+ return combineSpanStart(Array.isArray(props.$rowStart)
31
+ ? props.$rowStart[index]
32
+ : props.$rowStart, span);
33
+ })
34
+ : combineSpanStart(Array.isArray(props.$rowStart)
35
+ ? props.$rowStart[0]
36
+ : props.$rowStart, props.$rowSpan);
37
+ }, function (value) { return parseSpanStart(value); }), responsiveStyle("order", function (props) { return props.$order; }, function (value) { return value && "".concat(value); }), responsiveStyle("grid-row", function (props) {
38
+ return props.$rowSpan ? "span ".concat(props.$rowSpan) : "span 1";
39
+ }), responsiveStyle("grid-column-start", function (props) { return props.$colStart; }), responsiveStyle("grid-column-end", function (props) { return props.$colEnd; }), responsiveStyle("grid-row-start", function (props) { return props.$rowStart; }));
40
+ /**
41
+ *
42
+ * OakGridArea is a flex container that should be used inside OakGrid.
43
+ *
44
+ * - There is no nesting of OakGridAreas
45
+ * - Column and row arrangements are achieved through $colSpan, $rowSpan, $colStart, $colEnd, $rowStart, $rowEnd
46
+ *
47
+ */
48
+ var OakGridArea = styled(OakFlex)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), gridArea);
49
+ var templateObject_1, templateObject_2;
50
+
51
+ export { OakGridArea };
@@ -0,0 +1,23 @@
1
+ import { __assign, __makeTemplateObject } from 'tslib';
2
+ import styled from 'styled-components';
3
+ import { OakFlex } from '../OakFlex/OakFlex.js';
4
+
5
+ var oakMaxWidthDefaults = {
6
+ $maxWidth: ["spacing-480", "spacing-1280"],
7
+ $ph: ["spacing-0", "spacing-12"],
8
+ $flexDirection: "column",
9
+ $flexGrow: 1,
10
+ $width: "100%",
11
+ $mh: "auto",
12
+ };
13
+ /**
14
+ * This component will provide a default maxWidth and ph value, it take Flex props.
15
+ * ## Usage
16
+ * Use this component on pages to limit the max-width to a specific container.
17
+ * This will make it easier to create full browser width or custom width containers on the same page
18
+ * with different background colors / image url.
19
+ */
20
+ var OakMaxWidth = styled(OakFlex).attrs(function (props) { return (__assign(__assign({}, oakMaxWidthDefaults), props)); })(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
21
+ var templateObject_1;
22
+
23
+ export { OakMaxWidth, oakMaxWidthDefaults };
@@ -0,0 +1,38 @@
1
+ import { __makeTemplateObject } from 'tslib';
2
+ import styled from 'styled-components';
3
+ import { OakBox } from '../../layout-and-structure/OakBox/OakBox.js';
4
+ import '../../../styles/theme/color.js';
5
+ import '../../../styles/theme/typography.js';
6
+ import { parseColor } from '../../../styles/helpers/parseColor.js';
7
+ import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
8
+ import { parseBorderRadius } from '../../../styles/helpers/parseBorderRadius.js';
9
+ import { responsiveStyle } from '../../../styles/utils/responsiveStyle.js';
10
+
11
+ function isJSDOM() {
12
+ var _a, _b;
13
+ return (_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes("jsdom/");
14
+ }
15
+ var activeChildren = "a:active, button:active";
16
+ var hoverChildren = "a:hover, button:hover";
17
+ var focusVisibleChildren = "\n a".concat(isJSDOM() ? "" : ":focus-visible", ",\n button").concat(isJSDOM() ? "" : ":focus-visible", "\n");
18
+ var focusShadow = "".concat(parseDropShadow("drop-shadow-centered-lemon"), ", ").concat(parseDropShadow("drop-shadow-centered-grey"));
19
+ var fallbackActiveShadow = "".concat(parseDropShadow("drop-shadow-lemon"), ", ").concat(parseDropShadow("drop-shadow-grey"));
20
+ /**
21
+ * Wrap focusable components `<a/>`/`<button/>` and this will add focus styles then the inner element is focused
22
+ */
23
+ var OakFocusIndicator = styled(OakBox)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n box-shadow: ", ";\n\n &:has(", ") {\n ", "\n box-shadow: ", ";\n }\n\n &:has(", ") {\n ", "\n box-shadow: ", ";\n\n & ", " {\n outline: none;\n }\n }\n\n &:has(", ") {\n box-shadow: ", ";\n }\n"], ["\n ", "\n box-shadow: ", ";\n\n &:has(", ") {\n ", "\n box-shadow: ", ";\n }\n\n &:has(", ") {\n ", "\n box-shadow: ", ";\n\n & ", " {\n outline: none;\n }\n }\n\n &:has(", ") {\n box-shadow: ", ";\n }\n"])), function (props) {
24
+ if (props.as === "li") {
25
+ return "\n list-style: none;\n margin: 0;\n padding: 0;\n ";
26
+ }
27
+ }, function (props) {
28
+ return props.dropShadow ? parseDropShadow(props.dropShadow) : "none";
29
+ }, hoverChildren, responsiveStyle("background-color", function (props) { return props.hoverBackground; }, parseColor), function (props) {
30
+ return props.hoverDropShadow ? parseDropShadow(props.hoverDropShadow) : "none";
31
+ }, focusVisibleChildren, responsiveStyle("border-radius", function (props) { return props.$borderRadius; }, parseBorderRadius), focusShadow, focusVisibleChildren, activeChildren, function (props) {
32
+ return props.activeDropShadow
33
+ ? parseDropShadow(props.activeDropShadow)
34
+ : fallbackActiveShadow;
35
+ });
36
+ var templateObject_1;
37
+
38
+ export { OakFocusIndicator };
@@ -0,0 +1,22 @@
1
+ import { __makeTemplateObject, __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+ import { HandDrawnFocusUnderlineSvg } from './SubHandDrawnFocusUnderline.js';
5
+ import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
6
+
7
+ var StyledOakFlex = styled(OakFlex)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
8
+ /**
9
+ * A Drawn FocusUnderline svg inside a flex container
10
+ *
11
+ * use prop FocusUnderlineColor to change the color of the FocusUnderline
12
+ *
13
+ * change the sizeProps of the flex container to change the size and dimentions of the FocusUnderline
14
+ */
15
+ var OakHandDrawnFocusUnderline = function (props) {
16
+ var FocusUnderlineColor = props.FocusUnderlineColor, flexProps = __rest(props, ["FocusUnderlineColor"]);
17
+ return (React.createElement(StyledOakFlex, __assign({}, flexProps),
18
+ React.createElement(HandDrawnFocusUnderlineSvg, { "$fill": FocusUnderlineColor })));
19
+ };
20
+ var templateObject_1;
21
+
22
+ export { OakHandDrawnFocusUnderline };
@@ -0,0 +1,17 @@
1
+ import { __assign } from 'tslib';
2
+ import React from 'react';
3
+ import { InternalStyledSvg } from '../../internal-components/InternalStyledSvg/InternalStyledSvg.js';
4
+
5
+ var HandDrawnFocusUnderlineSvg = function (props) {
6
+ return (React.createElement(InternalStyledSvg, __assign({ xmlns: "http://www.w3.org/2000/svg",
7
+ // viewBox="0 0 866 8"
8
+ preserveAspectRatio: "none",
9
+ // height="100%"
10
+ width: "100%",
11
+ // width="195"
12
+ height: "7", viewBox: "0 0 195 7" }, props),
13
+ React.createElement("path", { d: "M193.989 5.27816C191.224 5.83961 188.29 5.95094 185.233 5.95436C164.998 5.97909 144.806 6.04167 124.593 6.02065C103.549 6.00315 82.5133 5.8886 61.4695 5.85778C45.3904 5.83449 29.2961 5.89496 13.2098 5.8717C10.2284 5.84036 7.27134 5.73181 4.38119 5.54762C1.78065 5.40454 0.188712 4.70174 0.482863 4.00998C0.590325 3.75687 0.613986 3.50218 0.553519 3.24879C0.431797 3.00904 0.257402 2.77161 0.0312099 2.53766C1.56714 2.43619 3.12843 2.36598 4.70115 2.32768C16.4883 2.26831 28.2976 2.13275 40.0693 2.2123C52.4335 2.29696 64.7916 2.21996 77.1492 2.22285C105.42 2.23007 133.688 2.24999 161.954 2.2826C168.927 2.29305 175.886 2.42911 182.844 2.53093C184.644 2.56126 186.424 2.63781 188.161 2.75952C191.997 3.02103 193.82 3.68671 193.928 4.7401C193.905 4.90949 193.955 5.06526 193.989 5.27816ZM7.54114 5.28886L7.54209 5.15951L5.46075 5.16831C5.46037 5.21968 5.46 5.27104 5.4596 5.3243L7.54114 5.28886ZM7.31844 3.14218C6.36666 3.83292 6.36668 3.83291 7.94956 3.79958C7.77774 3.57965 7.56255 3.35991 7.35458 3.14203L7.31844 3.14218ZM58.0677 2.64406L58.2202 2.55021L54.6067 2.56549L54.606 2.6587L58.0677 2.64406ZM59.2655 3.87356L59.3735 3.93587L61.2886 3.92776L61.2891 3.865L59.2655 3.87356ZM4.15738 2.56776L4.03376 2.6729L6.74385 2.66144L6.74462 2.55681L4.15738 2.56776Z", fill: "#222222" }),
14
+ React.createElement("path", { d: "M194.048 3.7872C191.283 4.34864 188.349 4.45997 185.292 4.46339C165.059 4.48811 144.869 4.55069 124.658 4.52966C103.616 4.51215 82.5815 4.39759 61.5395 4.36676C45.4617 4.34347 29.3688 4.40393 13.2838 4.38067C10.3027 4.34933 7.34591 4.24078 4.45601 4.05658C1.85568 3.9135 0.263876 3.2107 0.558012 2.51894C0.665459 2.26584 0.68912 2.01114 0.628653 1.75775C0.506946 1.51801 0.332582 1.28057 0.10639 1.04662C1.6422 0.945149 3.20335 0.874948 4.77593 0.836643C16.562 0.777274 28.3704 0.641721 40.141 0.721281C52.5042 0.805943 64.8613 0.728942 77.2178 0.731837C105.486 0.739072 133.752 0.759003 162.015 0.791623C168.988 0.802073 175.946 0.938139 182.904 1.03996C184.703 1.07029 186.484 1.14684 188.22 1.26856C192.055 1.53006 193.879 2.19575 193.987 3.24913C193.964 3.41853 194.013 3.57429 194.048 3.7872ZM7.6157 3.79783L7.61665 3.66848L5.53547 3.67728C5.5351 3.72864 5.53472 3.78001 5.53433 3.83327L7.6157 3.79783ZM7.39301 1.65115C6.44131 2.34188 6.44133 2.34188 8.02407 2.30855C7.85227 2.08862 7.63709 1.86887 7.42914 1.651L7.39301 1.65115ZM58.1379 1.15304L58.2904 1.05919L54.6772 1.07448L54.6765 1.16769L58.1379 1.15304ZM59.3357 2.38254L59.4436 2.44485L61.3585 2.43675L61.359 2.37398L59.3357 2.38254ZM4.23221 1.07672L4.10861 1.18187L6.81847 1.1704L6.81924 1.06578L4.23221 1.07672Z", fill: "#FBD60E" })));
15
+ };
16
+
17
+ export { HandDrawnFocusUnderlineSvg };