@cruk/cruk-react-components 5.0.6 → 5.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/.storybook/main.d.ts +3 -0
- package/lib/.storybook/preview.d.ts +3 -0
- package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
- package/lib/node_modules/@fortawesome/free-solid-svg-icons/index.js +6 -1
- package/lib/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/sibling.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/solver.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/FocusGuard.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
- package/lib/node_modules/react-intersection-observer/dist/index.js.map +1 -1
- package/lib/node_modules/tslib/tslib.es6.js +1 -1
- package/lib/node_modules/tslib/tslib.es6.js.map +1 -1
- package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/lib/{components → src/components}/AddressLookup/AddressLookup.stories.d.ts +4 -4
- package/lib/{components → src/components}/AddressLookup/index.d.ts +1 -1
- package/lib/src/components/AddressLookup/index.js +1 -1
- package/lib/src/components/AddressLookup/index.js.map +1 -1
- package/lib/src/components/AddressLookup/styles.js +38 -1
- package/lib/src/components/AddressLookup/styles.js.map +1 -1
- package/lib/{components → src/components}/Avatar/Avatar.stories.d.ts +1 -1
- package/lib/src/components/Avatar/index.js +1 -1
- package/lib/src/components/Avatar/index.js.map +1 -1
- package/lib/src/components/Avatar/styles.js +10 -1
- package/lib/src/components/Avatar/styles.js.map +1 -1
- package/lib/{components → src/components}/Badge/Badge.stories.d.ts +1 -1
- package/lib/{components → src/components}/Badge/index.d.ts +3 -1
- package/lib/src/components/Badge/index.js +1 -1
- package/lib/src/components/Badge/index.js.map +1 -1
- package/lib/{components → src/components}/Badge/styles.d.ts +1 -1
- package/lib/src/components/Badge/styles.js +17 -1
- package/lib/src/components/Badge/styles.js.map +1 -1
- package/lib/{components → src/components}/Box/Box.stories.d.ts +1 -1
- package/lib/src/components/Box/index.js +1 -1
- package/lib/src/components/Box/index.js.map +1 -1
- package/lib/src/components/Box/styles.js +13 -1
- package/lib/src/components/Box/styles.js.map +1 -1
- package/lib/{components → src/components}/Button/Button.stories.d.ts +1 -1
- package/lib/src/components/Button/index.js +1 -1
- package/lib/src/components/Button/index.js.map +1 -1
- package/lib/src/components/Button/styles.js +108 -1
- package/lib/src/components/Button/styles.js.map +1 -1
- package/lib/{components → src/components}/Carousel/Carousel.stories.d.ts +2 -2
- package/lib/src/components/Carousel/Dots.js +1 -1
- package/lib/src/components/Carousel/Dots.js.map +1 -1
- package/lib/src/components/Carousel/index.js +1 -1
- package/lib/src/components/Carousel/index.js.map +1 -1
- package/lib/src/components/Carousel/styles.js +96 -1
- package/lib/src/components/Carousel/styles.js.map +1 -1
- package/lib/{components → src/components}/Checkbox/Checkbox.stories.d.ts +2 -2
- package/lib/src/components/Checkbox/index.js +1 -1
- package/lib/src/components/Checkbox/index.js.map +1 -1
- package/lib/src/components/Checkbox/styles.js +105 -1
- package/lib/src/components/Checkbox/styles.js.map +1 -1
- package/lib/{components → src/components}/Collapse/Collapse.stories.d.ts +1 -1
- package/lib/src/components/Collapse/index.js +1 -1
- package/lib/src/components/Collapse/index.js.map +1 -1
- package/lib/src/components/Collapse/styles.js +31 -1
- package/lib/src/components/Collapse/styles.js.map +1 -1
- package/lib/{components → src/components}/DateField/DateField.stories.d.ts +1 -1
- package/lib/src/components/DateField/index.js +1 -1
- package/lib/src/components/DateField/index.js.map +1 -1
- package/lib/src/components/DateField/styles.js +26 -1
- package/lib/src/components/DateField/styles.js.map +1 -1
- package/lib/src/components/Divider.js +17 -1
- package/lib/src/components/Divider.js.map +1 -1
- package/lib/{components → src/components}/ErrorText/ErrorText.stories.d.ts +1 -1
- package/lib/src/components/ErrorText/index.js +1 -1
- package/lib/src/components/ErrorText/index.js.map +1 -1
- package/lib/src/components/ErrorText/styles.js +5 -1
- package/lib/src/components/ErrorText/styles.js.map +1 -1
- package/lib/src/components/Flex.js +7 -1
- package/lib/src/components/Flex.js.map +1 -1
- package/lib/src/components/Fontface.js +1 -1
- package/lib/src/components/Fontface.js.map +1 -1
- package/lib/{components → src/components}/Footer/Footer.stories.d.ts +2 -2
- package/lib/src/components/Footer/index.js +1 -1
- package/lib/src/components/Footer/index.js.map +1 -1
- package/lib/src/components/Footer/styles.js +69 -1
- package/lib/src/components/Footer/styles.js.map +1 -1
- package/lib/src/components/GlobalStyle.js +37 -1
- package/lib/src/components/GlobalStyle.js.map +1 -1
- package/lib/src/components/GlobalStyleNoFontFace.js +37 -1
- package/lib/src/components/GlobalStyleNoFontFace.js.map +1 -1
- package/lib/{components → src/components}/Header/Header.stories.d.ts +1 -1
- package/lib/src/components/Header/index.js +1 -1
- package/lib/src/components/Header/index.js.map +1 -1
- package/lib/src/components/Header/styles.js +109 -1
- package/lib/src/components/Header/styles.js.map +1 -1
- package/lib/{components → src/components}/Heading/Heading.stories.d.ts +1 -1
- package/lib/src/components/Heading/index.js +1 -1
- package/lib/src/components/Heading/index.js.map +1 -1
- package/lib/src/components/Heading/styles.js +75 -1
- package/lib/src/components/Heading/styles.js.map +1 -1
- package/lib/{components → src/components}/IconFa/IconFa.stories.d.ts +1 -1
- package/lib/src/components/IconFa/index.js +1 -1
- package/lib/src/components/IconFa/index.js.map +1 -1
- package/lib/src/components/IconFa/styles.js +10 -1
- package/lib/src/components/IconFa/styles.js.map +1 -1
- package/lib/{components → src/components}/InfoBox/InfoBox.stories.d.ts +1 -1
- package/lib/src/components/InfoBox/index.js +1 -1
- package/lib/src/components/InfoBox/index.js.map +1 -1
- package/lib/src/components/InfoBox/styles.js +12 -1
- package/lib/src/components/InfoBox/styles.js.map +1 -1
- package/lib/src/components/LabelWrapper/index.js +1 -1
- package/lib/src/components/LabelWrapper/index.js.map +1 -1
- package/lib/src/components/LabelWrapper/styles.js +15 -1
- package/lib/src/components/LabelWrapper/styles.js.map +1 -1
- package/lib/{components → src/components}/LegendWrapper/LegendWrapper.stories.d.ts +1 -1
- package/lib/src/components/LegendWrapper/index.js +1 -1
- package/lib/src/components/LegendWrapper/index.js.map +1 -1
- package/lib/src/components/LegendWrapper/styles.js +34 -1
- package/lib/src/components/LegendWrapper/styles.js.map +1 -1
- package/lib/{components → src/components}/Link/Link.stories.d.ts +1 -1
- package/lib/src/components/Link/index.js +1 -1
- package/lib/src/components/Link/index.js.map +1 -1
- package/lib/src/components/Link/styles.js +29 -1
- package/lib/src/components/Link/styles.js.map +1 -1
- package/lib/{components → src/components}/Loader/Loader.stories.d.ts +1 -1
- package/lib/src/components/Loader/index.js +1 -1
- package/lib/src/components/Loader/index.js.map +1 -1
- package/lib/src/components/Loader/styles.js +45 -1
- package/lib/src/components/Loader/styles.js.map +1 -1
- package/lib/{components → src/components}/Modal/Modal.stories.d.ts +1 -1
- package/lib/src/components/Modal/index.js +1 -1
- package/lib/src/components/Modal/index.js.map +1 -1
- package/lib/src/components/Modal/styles.js +59 -1
- package/lib/src/components/Modal/styles.js.map +1 -1
- package/lib/{components → src/components}/Pagination/Pagination.stories.d.ts +1 -1
- package/lib/src/components/Pagination/index.js +1 -1
- package/lib/src/components/Pagination/index.js.map +1 -1
- package/lib/src/components/Pagination/styles.js +92 -1
- package/lib/src/components/Pagination/styles.js.map +1 -1
- package/lib/{components → src/components}/PopOver/Popover.stories.d.ts +1 -1
- package/lib/src/components/PopOver/index.js +1 -1
- package/lib/src/components/PopOver/index.js.map +1 -1
- package/lib/src/components/PopOver/styles.js +81 -1
- package/lib/src/components/PopOver/styles.js.map +1 -1
- package/lib/{components → src/components}/ProgressBar/ProgressBar.stories.d.ts +1 -1
- package/lib/src/components/ProgressBar/index.js +1 -1
- package/lib/src/components/ProgressBar/index.js.map +1 -1
- package/lib/src/components/ProgressBar/styles.js +132 -1
- package/lib/src/components/ProgressBar/styles.js.map +1 -1
- package/lib/{components → src/components}/Radio/Radio.stories.d.ts +2 -2
- package/lib/src/components/Radio/index.js +1 -1
- package/lib/src/components/Radio/index.js.map +1 -1
- package/lib/src/components/Radio/styles.js +125 -1
- package/lib/src/components/Radio/styles.js.map +1 -1
- package/lib/{components → src/components}/RadioConsent/Radio.stories.d.ts +1 -1
- package/lib/src/components/RadioConsent/index.js +1 -1
- package/lib/src/components/RadioConsent/index.js.map +1 -1
- package/lib/src/components/RadioConsent/styles.js +26 -1
- package/lib/src/components/RadioConsent/styles.js.map +1 -1
- package/lib/{components → src/components}/Select/Selelct.stories.d.ts +2 -2
- package/lib/src/components/Select/index.js +1 -1
- package/lib/src/components/Select/index.js.map +1 -1
- package/lib/src/components/Select/styles.js +41 -1
- package/lib/src/components/Select/styles.js.map +1 -1
- package/lib/src/components/Spacing/index.js +1 -1
- package/lib/src/components/Spacing/index.js.map +1 -1
- package/lib/{components → src/components}/Step/Step.stories.d.ts +1 -1
- package/lib/src/components/Step/index.js +1 -1
- package/lib/src/components/Step/index.js.map +1 -1
- package/lib/src/components/Step/styles.js +79 -1
- package/lib/src/components/Step/styles.js.map +1 -1
- package/lib/{components → src/components}/Text/Text.stories.d.ts +1 -1
- package/lib/src/components/Text/index.js +1 -1
- package/lib/src/components/Text/index.js.map +1 -1
- package/lib/src/components/Text/styles.js +19 -1
- package/lib/src/components/Text/styles.js.map +1 -1
- package/lib/{components → src/components}/TextAreaField/TextAreaField.stories.d.ts +1 -1
- package/lib/src/components/TextAreaField/index.js +1 -1
- package/lib/src/components/TextAreaField/index.js.map +1 -1
- package/lib/src/components/TextAreaField/styles.js +29 -1
- package/lib/src/components/TextAreaField/styles.js.map +1 -1
- package/lib/{components → src/components}/TextField/TextField.stories.d.ts +1 -1
- package/lib/src/components/TextField/index.js +1 -1
- package/lib/src/components/TextField/index.js.map +1 -1
- package/lib/src/components/TextField/styles.js +110 -1
- package/lib/src/components/TextField/styles.js.map +1 -1
- package/lib/{components → src/components}/Totaliser/Totaliser.stories.d.ts +1 -1
- package/lib/src/components/Totaliser/index.js +1 -1
- package/lib/src/components/Totaliser/index.js.map +1 -1
- package/lib/src/components/Totaliser/styles.js +59 -1
- package/lib/src/components/Totaliser/styles.js.map +1 -1
- package/lib/{components → src/components}/UserBlock/UserBlock.stories.d.ts +1 -1
- package/lib/src/components/UserBlock/index.js +1 -1
- package/lib/src/components/UserBlock/index.js.map +1 -1
- package/lib/src/components/UserBlock/styles.js +21 -1
- package/lib/src/components/UserBlock/styles.js.map +1 -1
- package/lib/{hooks → src/hooks}/useEffectBrowser.d.ts +1 -1
- package/lib/src/hooks/useEffectBrowser.js +1 -1
- package/lib/src/hooks/useEffectBrowser.js.map +1 -1
- package/lib/src/hooks/useKey.js +1 -1
- package/lib/src/hooks/useKey.js.map +1 -1
- package/lib/{hooks → src/hooks}/useLayoutEffectBrowser.d.ts +1 -1
- package/lib/src/hooks/useLayoutEffectBrowser.js +1 -1
- package/lib/src/hooks/useLayoutEffectBrowser.js.map +1 -1
- package/lib/src/hooks/useScrollPosition.js +1 -1
- package/lib/src/hooks/useScrollPosition.js.map +1 -1
- package/lib/src/themes/bowelbabe.js +1 -1
- package/lib/src/themes/bowelbabe.js.map +1 -1
- package/lib/src/themes/cruk.js +1 -1
- package/lib/src/themes/cruk.js.map +1 -1
- package/lib/src/themes/rfl.js +1 -1
- package/lib/src/themes/rfl.js.map +1 -1
- package/lib/src/themes/su2c.js +1 -1
- package/lib/src/themes/su2c.js.map +1 -1
- package/lib/{types.d.ts → src/types.d.ts} +1 -3
- package/lib/src/utils/Helper.js +1 -1
- package/lib/src/utils/Helper.js.map +1 -1
- package/lib/src/utils/debounce.d.ts +2 -0
- package/lib/src/utils/debounce.js +1 -1
- package/lib/src/utils/debounce.js.map +1 -1
- package/lib/src/utils/themeUtils.js +1 -1
- package/lib/src/utils/themeUtils.js.map +1 -1
- package/package.json +23 -29
- package/lib/utils/debounce.d.ts +0 -2
- /package/lib/{components → src/components}/AddressLookup/AddressLookUp.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/AddressLookup/styles.d.ts +0 -0
- /package/lib/{components → src/components}/AllThemesWrapper.d.ts +0 -0
- /package/lib/{components → src/components}/Avatar/Avatar.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Avatar/index.d.ts +0 -0
- /package/lib/{components → src/components}/Avatar/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Badge/Badge.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Box/Box.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Box/index.d.ts +0 -0
- /package/lib/{components → src/components}/Box/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Button/Button.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Button/index.d.ts +0 -0
- /package/lib/{components → src/components}/Button/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Carousel/Carousel.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Carousel/Dots.d.ts +0 -0
- /package/lib/{components → src/components}/Carousel/index.d.ts +0 -0
- /package/lib/{components → src/components}/Carousel/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Checkbox/CheckBox.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Checkbox/index.d.ts +0 -0
- /package/lib/{components → src/components}/Checkbox/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Collapse/Collapse.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Collapse/index.d.ts +0 -0
- /package/lib/{components → src/components}/Collapse/styles.d.ts +0 -0
- /package/lib/{components → src/components}/DateField/DateField.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/DateField/index.d.ts +0 -0
- /package/lib/{components → src/components}/DateField/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Divider.d.ts +0 -0
- /package/lib/{components → src/components}/ErrorText/ErrorText.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/ErrorText/index.d.ts +0 -0
- /package/lib/{components → src/components}/ErrorText/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Flex.d.ts +0 -0
- /package/lib/{components → src/components}/Fontface.d.ts +0 -0
- /package/lib/{components → src/components}/Footer/Footer.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Footer/index.d.ts +0 -0
- /package/lib/{components → src/components}/Footer/styles.d.ts +0 -0
- /package/lib/{components → src/components}/GlobalStyle.d.ts +0 -0
- /package/lib/{components → src/components}/GlobalStyleNoFontFace.d.ts +0 -0
- /package/lib/{components → src/components}/Header/Header.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Header/index.d.ts +0 -0
- /package/lib/{components → src/components}/Header/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Heading/Heading.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Heading/index.d.ts +0 -0
- /package/lib/{components → src/components}/Heading/styles.d.ts +0 -0
- /package/lib/{components → src/components}/IconFa/IconFa.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/IconFa/index.d.ts +0 -0
- /package/lib/{components → src/components}/IconFa/styles.d.ts +0 -0
- /package/lib/{components → src/components}/InfoBox/InfoBox.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/InfoBox/index.d.ts +0 -0
- /package/lib/{components → src/components}/InfoBox/styles.d.ts +0 -0
- /package/lib/{components → src/components}/LabelWrapper/index.d.ts +0 -0
- /package/lib/{components → src/components}/LabelWrapper/styles.d.ts +0 -0
- /package/lib/{components → src/components}/LegendWrapper/LegendWrapper.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/LegendWrapper/index.d.ts +0 -0
- /package/lib/{components → src/components}/LegendWrapper/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Link/Link.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Link/index.d.ts +0 -0
- /package/lib/{components → src/components}/Link/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Loader/Loader.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Loader/index.d.ts +0 -0
- /package/lib/{components → src/components}/Loader/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Modal/Modal.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Modal/index.d.ts +0 -0
- /package/lib/{components → src/components}/Modal/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Pagination/Pagination.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Pagination/index.d.ts +0 -0
- /package/lib/{components → src/components}/Pagination/styles.d.ts +0 -0
- /package/lib/{components → src/components}/PopOver/PopOver.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/PopOver/index.d.ts +0 -0
- /package/lib/{components → src/components}/PopOver/styles.d.ts +0 -0
- /package/lib/{components → src/components}/ProgressBar/ProgressBar.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/ProgressBar/index.d.ts +0 -0
- /package/lib/{components → src/components}/ProgressBar/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Radio/Radio.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Radio/index.d.ts +0 -0
- /package/lib/{components → src/components}/Radio/styles.d.ts +0 -0
- /package/lib/{components → src/components}/RadioConsent/RadioConsent.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/RadioConsent/index.d.ts +0 -0
- /package/lib/{components → src/components}/RadioConsent/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Select/Select.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Select/index.d.ts +0 -0
- /package/lib/{components → src/components}/Select/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Spacing/index.d.ts +0 -0
- /package/lib/{components → src/components}/Step/Step.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Step/index.d.ts +0 -0
- /package/lib/{components → src/components}/Step/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Text/Text.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Text/index.d.ts +0 -0
- /package/lib/{components → src/components}/Text/styles.d.ts +0 -0
- /package/lib/{components → src/components}/TextAreaField/TextAreaField.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/TextAreaField/index.d.ts +0 -0
- /package/lib/{components → src/components}/TextAreaField/styles.d.ts +0 -0
- /package/lib/{components → src/components}/TextField/TextField.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/TextField/index.d.ts +0 -0
- /package/lib/{components → src/components}/TextField/styles.d.ts +0 -0
- /package/lib/{components → src/components}/ThemeCheatSheet.d.ts +0 -0
- /package/lib/{components → src/components}/Totaliser/Totaliser.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/Totaliser/index.d.ts +0 -0
- /package/lib/{components → src/components}/Totaliser/styles.d.ts +0 -0
- /package/lib/{components → src/components}/UserBlock/UserBlock.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/UserBlock/index.d.ts +0 -0
- /package/lib/{components → src/components}/UserBlock/styles.d.ts +0 -0
- /package/lib/{components → src/components}/index.d.ts +0 -0
- /package/lib/{hooks → src/hooks}/useKey.d.ts +0 -0
- /package/lib/{hooks → src/hooks}/useScrollPosition.d.ts +0 -0
- /package/lib/{themes → src/themes}/bowelbabe.d.ts +0 -0
- /package/lib/{themes → src/themes}/cruk.d.ts +0 -0
- /package/lib/{themes → src/themes}/rfl.d.ts +0 -0
- /package/lib/{themes → src/themes}/su2c.d.ts +0 -0
- /package/lib/{utils → src/utils}/Helper.d.ts +0 -0
- /package/lib/{utils → src/utils}/__tests__/testHelpers.test.d.ts +0 -0
- /package/lib/{utils → src/utils}/themeUtils.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.js","sources":["../../../src/components/Flex.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"styled-components\";\nimport {\n spacing,\n type SpacingPropsInternal,\n spacingPropsToSpacingPropsInternal,\n type SpacingProps,\n} from \"./Spacing\";\nimport { type ThemeType } from \"../types\";\n\ntype StyledProps = SpacingPropsInternal & {\n theme: ThemeType;\n};\n\nconst FlexStyled = styled.div<StyledProps>`\n display: block;\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n display: flex;\n }\n ${(props) => spacing(props, props.theme as ThemeType)}\n`;\n\ntype Props = SpacingProps & {\n theme: ThemeType;\n};\nexport function Flex(props: Props) {\n const spacingProps = spacingPropsToSpacingPropsInternal(props);\n\n return <FlexStyled theme={props.theme} {...spacingProps} />;\n}\n\nexport default Flex;\n"],"names":["FlexStyled","styled","div","
|
|
1
|
+
{"version":3,"file":"Flex.js","sources":["../../../src/components/Flex.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"styled-components\";\nimport {\n spacing,\n type SpacingPropsInternal,\n spacingPropsToSpacingPropsInternal,\n type SpacingProps,\n} from \"./Spacing\";\nimport { type ThemeType } from \"../types\";\n\ntype StyledProps = SpacingPropsInternal & {\n theme: ThemeType;\n};\n\nconst FlexStyled = styled.div<StyledProps>`\n display: block;\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n display: flex;\n }\n ${(props) => spacing(props, props.theme as ThemeType)}\n`;\n\ntype Props = SpacingProps & {\n theme: ThemeType;\n};\nexport function Flex(props: Props) {\n const spacingProps = spacingPropsToSpacingPropsInternal(props);\n\n return <FlexStyled theme={props.theme} {...spacingProps} />;\n}\n\nexport default Flex;\n"],"names":["FlexStyled","styled","div","theme","breakpoint","tablet","props","spacing","Flex","spacingProps","spacingPropsToSpacingPropsInternal","React","createElement"],"mappings":"2IAcA,MAAMA,EAAaC,EAAOC,GAAgB;;uBAEnB,EAAGC,WAAYA,EAAMC,WAAWC;;;IAGlDC,GAAUC,EAAQD,EAAOA,EAAMH;EAM9B,SAAUK,EAAKF,GACnB,MAAMG,EAAeC,EAAmCJ,GAExD,OAAOK,EAAAC,cAACZ,EAAU,CAACG,MAAOG,EAAMH,SAAWM,GAC7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{crukTheme as o}from"../themes/cruk.js";import{rflTheme as
|
|
1
|
+
import{crukTheme as o}from"../themes/cruk.js";import{rflTheme as f}from"../themes/rfl.js";import{su2cTheme as t}from"../themes/su2c.js";import{bowelbabeTheme as n}from"../themes/bowelbabe.js";const r=o=>o.map((o=>`\n @font-face {\n font-family: ${o.family};\n src: ${o?.urlWoff2?`url("${o.urlWoff2}") format('woff2')`:""}${o.urlWoff&&o?.urlWoff2?", ":""}\n ${o?.urlWoff?`url("${o.urlWoff}") format('woff')`:""};\n font-weight: ${o.fontWeight||"normal"};\n font-style: normal;\n font-display: fallback;\n }\n `)).join(""),m=`\n${r(o.typography.customFonts)}\n${r(f.typography.customFonts)}\n${r(t.typography.customFonts)}\n${r(n.typography.customFonts)}\n`;export{m as Fontface,r as buildCustomFonts,m as default};
|
|
2
2
|
//# sourceMappingURL=Fontface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fontface.js","sources":["../../../src/components/Fontface.ts"],"sourcesContent":["import { type CustomFontType } from \"../types\";\nimport { crukTheme } from \"../themes/cruk\";\nimport { rflTheme } from \"../themes/rfl\";\nimport { su2cTheme } from \"../themes/su2c\";\nimport { bowelbabeTheme } from \"../themes/bowelbabe\";\n\n// font-display fall back to stop font's flickering on SSR rehydration\nexport const buildCustomFonts = (customFonts: CustomFontType[]) =>\n customFonts\n .map(\n (font) => `\n @font-face {\n font-family: ${font.family};\n src: ${\n font?.urlWoff2 ? `url(\"${font.urlWoff2}\") format('woff2')` : \"\"\n }${!!font.urlWoff && !!font?.urlWoff2 ? \", \" : \"\"}\n ${font?.urlWoff ? `url(\"${font.urlWoff}\") format('woff')` : \"\"};\n font-weight: ${font.fontWeight || \"normal\"};\n font-style: normal;\n font-display: fallback;\n }\n `,\n )\n .join(\"\");\n\nexport const Fontface = `\n${buildCustomFonts(crukTheme.typography.customFonts)}\n${buildCustomFonts(rflTheme.typography.customFonts)}\n${buildCustomFonts(su2cTheme.typography.customFonts)}\n${buildCustomFonts(bowelbabeTheme.typography.customFonts)}\n`;\n\nexport default Fontface;\n"],"names":["buildCustomFonts","customFonts","map","font","
|
|
1
|
+
{"version":3,"file":"Fontface.js","sources":["../../../src/components/Fontface.ts"],"sourcesContent":["import { type CustomFontType } from \"../types\";\nimport { crukTheme } from \"../themes/cruk\";\nimport { rflTheme } from \"../themes/rfl\";\nimport { su2cTheme } from \"../themes/su2c\";\nimport { bowelbabeTheme } from \"../themes/bowelbabe\";\n\n// font-display fall back to stop font's flickering on SSR rehydration\nexport const buildCustomFonts = (customFonts: CustomFontType[]) =>\n customFonts\n .map(\n (font) => `\n @font-face {\n font-family: ${font.family};\n src: ${\n font?.urlWoff2 ? `url(\"${font.urlWoff2}\") format('woff2')` : \"\"\n }${!!font.urlWoff && !!font?.urlWoff2 ? \", \" : \"\"}\n ${font?.urlWoff ? `url(\"${font.urlWoff}\") format('woff')` : \"\"};\n font-weight: ${font.fontWeight || \"normal\"};\n font-style: normal;\n font-display: fallback;\n }\n `,\n )\n .join(\"\");\n\nexport const Fontface = `\n${buildCustomFonts(crukTheme.typography.customFonts)}\n${buildCustomFonts(rflTheme.typography.customFonts)}\n${buildCustomFonts(su2cTheme.typography.customFonts)}\n${buildCustomFonts(bowelbabeTheme.typography.customFonts)}\n`;\n\nexport default Fontface;\n"],"names":["buildCustomFonts","customFonts","map","font","family","urlWoff2","urlWoff","fontWeight","join","Fontface","crukTheme","typography","rflTheme","su2cTheme","bowelbabeTheme"],"mappings":"sMAOaA,EAAoBC,GAC/BA,EACGC,KACEC,GAAS,kDAESA,EAAKC,2BAElBD,GAAME,SAAW,QAAQF,EAAKE,6BAA+B,KAC1DF,EAAKG,SAAaH,GAAME,SAAW,KAAO,iBAC7CF,GAAMG,QAAU,QAAQH,EAAKG,2BAA6B,+BAC7CH,EAAKI,YAAc,mGAMvCC,KAAK,IAEGC,EAAW,KACtBT,EAAiBU,EAAUC,WAAWV,iBACtCD,EAAiBY,EAASD,WAAWV,iBACrCD,EAAiBa,EAAUF,WAAWV,iBACtCD,EAAiBc,EAAeH,WAAWV"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StoryObj } from "@storybook/react";
|
|
3
|
-
import Footer, { FooterProps } from ".";
|
|
2
|
+
import { type StoryObj } from "@storybook/react";
|
|
3
|
+
import Footer, { type FooterProps } from ".";
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
6
|
component: typeof Footer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{useTheme as t,ThemeProvider as n}from"styled-components";import{crukTheme as l}from"../../themes/cruk.js";import{Text as r}from"../Text/index.js";import{StyledFooter as o,FooterContentWrapper as a,FooterSectionLogo as m,StyledRegulatorLogo as c,FooterSectionLinks as i,StyledNav as s,StyledUL as E,StyledLI as f,FooterSection as u,FooterSectionAddress as p,StyledAddress as d}from"./styles.js";function g({children:g,middleSection:x}){const h=e.Children.toArray(g),S=t(),y={...l,...S};return e.createElement(n,{theme:y},e.createElement(o,null,e.createElement(a,null,e.createElement(m,null,e.createElement(c,{width:130,height:40,alt:y.siteConfig.footerLogoAlt||"",src:y.siteConfig.footerLogoSrc||""})),e.createElement(i,null,e.createElement(s,{"aria-label":"footer links"},e.createElement(E,null,h.length?h.map(((t,n)=>{const l=`footerLink${n}`;return e.createElement(f,{key:l},t)})):null))),e.createElement(u,null,x?"string"==typeof x?e.createElement(r,{textSize:"s"},x):e.createElement(e.Fragment,null,x):e.createElement(r,{textSize:"s"},y.siteConfig.footerCopyText)),e.createElement(p,null,e.createElement(d,null,e.createElement(r,{as:"span",textSize:"s"},"2 Redman Place"),e.createElement(r,{as:"span",textSize:"s"},"London"),e.createElement(r,{as:"span",textSize:"s"},"E20 1JQ"))))))}export{g as Footer,g as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Footer/index.tsx"],"sourcesContent":["import React, { type ReactNode, type HTMLAttributes } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { Text } from \"../Text\";\n\nimport {\n StyledFooter,\n FooterContentWrapper,\n FooterSectionLogo,\n FooterSection,\n FooterSectionAddress,\n StyledAddress,\n StyledRegulatorLogo,\n FooterSectionLinks,\n StyledNav,\n StyledUL,\n StyledLI,\n} from \"./styles\";\n\nexport type FooterProps = HTMLAttributes<HTMLElement> & {\n /** used to customise text in middle section, it could also be react element, this is not to be confused with the component children which is primarily for the links in the footer */\n middleSection?: ReactNode;\n children?: ReactNode;\n};\n\n/**\n * There should be only one footer component at the bottom of the body of each page. Links can be passed as children\n * */\nexport function Footer({ children, middleSection }: FooterProps) {\n const childArray = React.Children.toArray(children);\n\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n return (\n <ThemeProvider theme={theme}>\n <StyledFooter>\n <FooterContentWrapper>\n <FooterSectionLogo>\n <StyledRegulatorLogo\n width={130}\n height={40}\n alt={theme.siteConfig.footerLogoAlt || \"\"}\n src={theme.siteConfig.footerLogoSrc || \"\"}\n />\n </FooterSectionLogo>\n <FooterSectionLinks>\n <StyledNav aria-label=\"footer links\">\n <StyledUL>\n {childArray.length\n ? childArray.map((child, index) => {\n const footerLinkKey = `footerLink${index}`;\n return <StyledLI key={footerLinkKey}>{child}</StyledLI>;\n })\n : null}\n </StyledUL>\n </StyledNav>\n </FooterSectionLinks>\n\n <FooterSection>\n {middleSection ? (\n typeof middleSection === \"string\" ? (\n <Text textSize=\"s\">{middleSection}</Text>\n ) : (\n <>{middleSection}</>\n )\n ) : (\n <Text textSize=\"s\">{theme.siteConfig.footerCopyText}</Text>\n )}\n </FooterSection>\n\n <FooterSectionAddress>\n <StyledAddress>\n <Text as=\"span\" textSize=\"s\">\n 2 Redman Place\n </Text>\n <Text as=\"span\" textSize=\"s\">\n London\n </Text>\n <Text as=\"span\" textSize=\"s\">\n E20 1JQ\n </Text>\n </StyledAddress>\n </FooterSectionAddress>\n </FooterContentWrapper>\n </StyledFooter>\n </ThemeProvider>\n );\n}\n\nexport default Footer;\n"],"names":["Footer","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Footer/index.tsx"],"sourcesContent":["import React, { type ReactNode, type HTMLAttributes } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { Text } from \"../Text\";\n\nimport {\n StyledFooter,\n FooterContentWrapper,\n FooterSectionLogo,\n FooterSection,\n FooterSectionAddress,\n StyledAddress,\n StyledRegulatorLogo,\n FooterSectionLinks,\n StyledNav,\n StyledUL,\n StyledLI,\n} from \"./styles\";\n\nexport type FooterProps = HTMLAttributes<HTMLElement> & {\n /** used to customise text in middle section, it could also be react element, this is not to be confused with the component children which is primarily for the links in the footer */\n middleSection?: ReactNode;\n children?: ReactNode;\n};\n\n/**\n * There should be only one footer component at the bottom of the body of each page. Links can be passed as children\n * */\nexport function Footer({ children, middleSection }: FooterProps) {\n const childArray = React.Children.toArray(children);\n\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n return (\n <ThemeProvider theme={theme}>\n <StyledFooter>\n <FooterContentWrapper>\n <FooterSectionLogo>\n <StyledRegulatorLogo\n width={130}\n height={40}\n alt={theme.siteConfig.footerLogoAlt || \"\"}\n src={theme.siteConfig.footerLogoSrc || \"\"}\n />\n </FooterSectionLogo>\n <FooterSectionLinks>\n <StyledNav aria-label=\"footer links\">\n <StyledUL>\n {childArray.length\n ? childArray.map((child, index) => {\n const footerLinkKey = `footerLink${index}`;\n return <StyledLI key={footerLinkKey}>{child}</StyledLI>;\n })\n : null}\n </StyledUL>\n </StyledNav>\n </FooterSectionLinks>\n\n <FooterSection>\n {middleSection ? (\n typeof middleSection === \"string\" ? (\n <Text textSize=\"s\">{middleSection}</Text>\n ) : (\n <>{middleSection}</>\n )\n ) : (\n <Text textSize=\"s\">{theme.siteConfig.footerCopyText}</Text>\n )}\n </FooterSection>\n\n <FooterSectionAddress>\n <StyledAddress>\n <Text as=\"span\" textSize=\"s\">\n 2 Redman Place\n </Text>\n <Text as=\"span\" textSize=\"s\">\n London\n </Text>\n <Text as=\"span\" textSize=\"s\">\n E20 1JQ\n </Text>\n </StyledAddress>\n </FooterSectionAddress>\n </FooterContentWrapper>\n </StyledFooter>\n </ThemeProvider>\n );\n}\n\nexport default Footer;\n"],"names":["Footer","children","middleSection","childArray","React","Children","toArray","foundTheme","useTheme","theme","defaultTheme","createElement","ThemeProvider","StyledFooter","FooterContentWrapper","FooterSectionLogo","StyledRegulatorLogo","width","height","alt","siteConfig","footerLogoAlt","src","footerLogoSrc","FooterSectionLinks","StyledNav","StyledUL","length","map","child","index","footerLinkKey","StyledLI","key","FooterSection","Text","textSize","Fragment","footerCopyText","FooterSectionAddress","StyledAddress","as"],"mappings":"+aA6BgBA,GAAOC,SAAEA,EAAQC,cAAEA,IACjC,MAAMC,EAAaC,EAAMC,SAASC,QAAQL,GAEpCM,EAAaC,IACbC,EAAQ,IACTC,KACAH,GAGL,OACEH,EAACO,cAAAC,EAAc,CAAAH,MAAOA,GACpBL,EAAAO,cAACE,EAAY,KACXT,EAAAO,cAACG,EAAoB,KACnBV,EAAAO,cAACI,EAAiB,KAChBX,EAAAO,cAACK,EAAmB,CAClBC,MAAO,IACPC,OAAQ,GACRC,IAAKV,EAAMW,WAAWC,eAAiB,GACvCC,IAAKb,EAAMW,WAAWG,eAAiB,MAG3CnB,EAAAO,cAACa,EAAkB,KACjBpB,EAACO,cAAAc,gBAAqB,gBACpBrB,EAAAO,cAACe,EAAQ,KACNvB,EAAWwB,OACRxB,EAAWyB,KAAI,CAACC,EAAOC,KACrB,MAAMC,EAAgB,aAAaD,IACnC,OAAO1B,EAAAO,cAACqB,EAAS,CAAAC,IAAKF,GAAgBF,EAAiB,IAEzD,QAKVzB,EAACO,cAAAuB,EACE,KAAAhC,EAC0B,iBAAlBA,EACLE,EAACO,cAAAwB,EAAK,CAAAC,SAAS,KAAKlC,GAEpBE,EAAGO,cAAAP,EAAAiC,SAAA,KAAAnC,GAGLE,EAACO,cAAAwB,GAAKC,SAAS,KAAK3B,EAAMW,WAAWkB,iBAIzClC,EAAAO,cAAC4B,EAAoB,KACnBnC,EAAAO,cAAC6B,EAAa,KACZpC,EAACO,cAAAwB,GAAKM,GAAG,OAAOL,SAAS,KAElB,kBACPhC,EAACO,cAAAwB,GAAKM,GAAG,OAAOL,SAAS,KAElB,UACPhC,EAAAO,cAACwB,EAAK,CAAAM,GAAG,OAAOL,SAAS,KAAG,eAS1C"}
|
|
@@ -1,2 +1,70 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"styled-components";const i=e.footer`
|
|
2
|
+
${({theme:e})=>e.colors.inputBorder};
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: block;
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 100%;
|
|
7
|
+
background-color: ${({theme:e})=>e.colors.footerBackground};
|
|
8
|
+
`,t=e.div`
|
|
9
|
+
max-width: ${({theme:e})=>e.utilities.contentMaxWidth};
|
|
10
|
+
display: block;
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
|
|
13
|
+
@media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
}
|
|
18
|
+
`,o=e.div`
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
padding: ${({theme:e})=>e.spacing.xs};
|
|
22
|
+
position: relative;
|
|
23
|
+
width: 100%;
|
|
24
|
+
flex: 0 1 auto;
|
|
25
|
+
`,d=e(o)`
|
|
26
|
+
width: 50%;
|
|
27
|
+
display: block;
|
|
28
|
+
float: left;
|
|
29
|
+
|
|
30
|
+
@media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
|
|
31
|
+
flex: 0 0 140px;
|
|
32
|
+
width: auto;
|
|
33
|
+
}
|
|
34
|
+
`,n=e(o)`
|
|
35
|
+
width: 50%;
|
|
36
|
+
display: block;
|
|
37
|
+
float: left;
|
|
38
|
+
|
|
39
|
+
@media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
|
|
40
|
+
flex: 0 0 170px;
|
|
41
|
+
width: auto;
|
|
42
|
+
}
|
|
43
|
+
`,l=e.nav`
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
a {
|
|
47
|
+
font-size: ${({theme:e})=>e.fontSizes.s};
|
|
48
|
+
font-weight: ${({theme:{typography:{fontWeightLinks:e}}})=>e};
|
|
49
|
+
}
|
|
50
|
+
`,a=e.ul`
|
|
51
|
+
padding: 0;
|
|
52
|
+
margin: 0;
|
|
53
|
+
`,s=e.li`
|
|
54
|
+
list-style-type: none;
|
|
55
|
+
display: block;
|
|
56
|
+
padding: 0;
|
|
57
|
+
margin: 0;
|
|
58
|
+
line-height: 1;
|
|
59
|
+
padding-bottom: ${({theme:{spacing:{xxs:e}}})=>e};
|
|
60
|
+
`,p=e(o)`
|
|
61
|
+
flex: 0 0 150px;
|
|
62
|
+
`,r=e.img`
|
|
63
|
+
height: 40px;
|
|
64
|
+
width: auto;
|
|
65
|
+
`,h=e.address`
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
font-style: normal;
|
|
69
|
+
`;export{t as FooterContentWrapper,o as FooterSection,p as FooterSectionAddress,n as FooterSectionLinks,d as FooterSectionLogo,h as StyledAddress,i as StyledFooter,s as StyledLI,l as StyledNav,r as StyledRegulatorLogo,a as StyledUL};
|
|
2
70
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Footer/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\ntype ThemeProps = {\n theme: ThemeType;\n};\nexport const StyledFooter = styled.footer<ThemeProps>`\n ${({ theme }) => theme.colors.inputBorder};\n box-sizing: border-box;\n display: block;\n position: relative;\n width: 100%;\n background-color: ${({ theme }) => theme.colors.footerBackground};\n`;\n\nexport const FooterContentWrapper = styled.div<ThemeProps>`\n max-width: ${({ theme }) => theme.utilities.contentMaxWidth};\n display: block;\n margin: 0 auto;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n }\n`;\n\nexport const FooterSection = styled.div<ThemeProps>`\n box-sizing: border-box;\n display: inline-block;\n padding: ${({ theme }) => theme.spacing.xs};\n position: relative;\n width: 100%;\n flex: 0 1 auto;\n`;\n\nexport const FooterSectionLogo = styled(FooterSection)`\n width: 50%;\n display: block;\n float: left;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n flex: 0 0 140px;\n width: auto;\n }\n`;\n\n// TODO: I'm assuming here that the links have fixed width here with a flex basis\n// and the company info expands to fill the gap but it could be the other way round\nexport const FooterSectionLinks = styled(FooterSection)`\n width: 50%;\n display: block;\n float: left;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n flex: 0 0 170px;\n width: auto;\n }\n`;\n\nexport const StyledNav = styled.nav<ThemeProps>`\n display: flex;\n flex-direction: column;\n a {\n font-size: ${({ theme }) => theme.fontSizes.s};\n font-weight: ${({\n theme: {\n typography: { fontWeightLinks },\n },\n }: ThemeProps) => fontWeightLinks};\n }\n`;\n\nexport const StyledUL = styled.ul`\n padding: 0;\n margin: 0;\n`;\n\nexport const StyledLI = styled.li<ThemeProps>`\n list-style-type: none;\n display: block;\n padding: 0;\n margin: 0;\n line-height: 1;\n padding-bottom: ${({\n theme: {\n spacing: { xxs },\n },\n }) => xxs};\n`;\n\nexport const FooterSectionAddress = styled(FooterSection)`\n flex: 0 0 150px;\n`;\n\nexport const StyledRegulatorLogo = styled.img`\n height: 40px;\n width: auto;\n`;\n\nexport const StyledAddress = styled.address`\n display: flex;\n flex-direction: column;\n font-style: normal;\n`;\n"],"names":["StyledFooter","styled","footer","
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Footer/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\ntype ThemeProps = {\n theme: ThemeType;\n};\nexport const StyledFooter = styled.footer<ThemeProps>`\n ${({ theme }) => theme.colors.inputBorder};\n box-sizing: border-box;\n display: block;\n position: relative;\n width: 100%;\n background-color: ${({ theme }) => theme.colors.footerBackground};\n`;\n\nexport const FooterContentWrapper = styled.div<ThemeProps>`\n max-width: ${({ theme }) => theme.utilities.contentMaxWidth};\n display: block;\n margin: 0 auto;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n }\n`;\n\nexport const FooterSection = styled.div<ThemeProps>`\n box-sizing: border-box;\n display: inline-block;\n padding: ${({ theme }) => theme.spacing.xs};\n position: relative;\n width: 100%;\n flex: 0 1 auto;\n`;\n\nexport const FooterSectionLogo = styled(FooterSection)`\n width: 50%;\n display: block;\n float: left;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n flex: 0 0 140px;\n width: auto;\n }\n`;\n\n// TODO: I'm assuming here that the links have fixed width here with a flex basis\n// and the company info expands to fill the gap but it could be the other way round\nexport const FooterSectionLinks = styled(FooterSection)`\n width: 50%;\n display: block;\n float: left;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n flex: 0 0 170px;\n width: auto;\n }\n`;\n\nexport const StyledNav = styled.nav<ThemeProps>`\n display: flex;\n flex-direction: column;\n a {\n font-size: ${({ theme }) => theme.fontSizes.s};\n font-weight: ${({\n theme: {\n typography: { fontWeightLinks },\n },\n }: ThemeProps) => fontWeightLinks};\n }\n`;\n\nexport const StyledUL = styled.ul`\n padding: 0;\n margin: 0;\n`;\n\nexport const StyledLI = styled.li<ThemeProps>`\n list-style-type: none;\n display: block;\n padding: 0;\n margin: 0;\n line-height: 1;\n padding-bottom: ${({\n theme: {\n spacing: { xxs },\n },\n }) => xxs};\n`;\n\nexport const FooterSectionAddress = styled(FooterSection)`\n flex: 0 0 150px;\n`;\n\nexport const StyledRegulatorLogo = styled.img`\n height: 40px;\n width: auto;\n`;\n\nexport const StyledAddress = styled.address`\n display: flex;\n flex-direction: column;\n font-style: normal;\n`;\n"],"names":["StyledFooter","styled","footer","theme","colors","inputBorder","footerBackground","FooterContentWrapper","div","utilities","contentMaxWidth","breakpoint","desktop","FooterSection","spacing","xs","FooterSectionLogo","FooterSectionLinks","StyledNav","nav","fontSizes","s","typography","fontWeightLinks","StyledUL","ul","StyledLI","li","xxs","FooterSectionAddress","StyledRegulatorLogo","img","StyledAddress","address"],"mappings":"iCAMa,MAAAA,EAAeC,EAAOC,MAAkB;IACjD,EAAGC,WAAYA,EAAMC,OAAOC;;;;;sBAKV,EAAGF,WAAYA,EAAMC,OAAOE;EAGrCC,EAAuBN,EAAOO,GAAe;eAC3C,EAAGL,WAAYA,EAAMM,UAAUC;;;;uBAIvB,EAAGP,WAAYA,EAAMQ,WAAWC;;;;;EAO1CC,EAAgBZ,EAAOO,GAAe;;;aAGtC,EAAGL,WAAYA,EAAMW,QAAQC;;;;EAM7BC,EAAoBf,EAAOY,EAAc;;;;;uBAK/B,EAAGV,WAAYA,EAAMQ,WAAWC;;;;EAQ1CK,EAAqBhB,EAAOY,EAAc;;;;;uBAKhC,EAAGV,WAAYA,EAAMQ,WAAWC;;;;EAM1CM,EAAYjB,EAAOkB,GAAe;;;;iBAI9B,EAAGhB,WAAYA,EAAMiB,UAAUC;mBAC7B,EACblB,OACEmB,YAAcC,uBAEAA;;EAITC,EAAWvB,EAAOwB,EAAE;;;EAKpBC,EAAWzB,EAAO0B,EAAc;;;;;;oBAMzB,EAChBxB,OACEW,SAAWc,WAETA;EAGKC,EAAuB5B,EAAOY,EAAc;;EAI5CiB,EAAsB7B,EAAO8B,GAAG;;;EAKhCC,EAAgB/B,EAAOgC,OAAO;;;;"}
|
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{withTheme as o,createGlobalStyle as t}from"styled-components";import{crukTheme as n}from"../themes/cruk.js";const e=o(t`
|
|
2
|
+
${o=>{const t={...n,...o.theme};return`\n ${e=t.typography.customFonts,e.map((o=>`\n @font-face {\n font-family: ${o.family};\n src: ${o?.urlWoff2?`url("${o.urlWoff2}") format('woff2')`:""}${o.urlWoff&&o?.urlWoff2?", ":""}\n ${o?.urlWoff?`url("${o.urlWoff}") format('woff')`:""};\n font-weight: ${o?.fontWeight};\n font-style: normal;\n font-display: fallback;\n }\n `)).join("")}\n html {\n font-size: ${t.typography.fontSizeBase};\n font-family: ${t.typography.fontFamilyBase};\n line-height: ${t.typography.lineHeight};\n }\n body {\n background-color: ${t.colors.backgroundMidLight};\n color: ${t.colors.textDark};\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n `;var e}}
|
|
3
|
+
*, *:after, *:before {
|
|
4
|
+
-webkit-box-sizing: border-box;
|
|
5
|
+
-moz-box-sizing: border-box;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@media (prefers-reduced-motion: reduce) {
|
|
10
|
+
*, *:after, *:before {
|
|
11
|
+
animation-play-state: paused !important;
|
|
12
|
+
animation-direction: reverse !important;
|
|
13
|
+
transition: none !important;
|
|
14
|
+
scroll-behavior: auto !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
table, td, th {
|
|
19
|
+
border-spacing: 0;
|
|
20
|
+
border: 1px solid #ccc;
|
|
21
|
+
padding: 10px;
|
|
22
|
+
}
|
|
23
|
+
.no-focus-outline a:focus,
|
|
24
|
+
.no-focus-outline button:focus {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
img {
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: auto;
|
|
30
|
+
}
|
|
31
|
+
section {
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
34
|
+
button {
|
|
35
|
+
font-size: 1em;
|
|
36
|
+
}
|
|
37
|
+
`);export{e as GlobalStyle,e as default};
|
|
2
38
|
//# sourceMappingURL=GlobalStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStyle.js","sources":["../../../src/components/GlobalStyle.tsx"],"sourcesContent":["import { createGlobalStyle, withTheme } from \"styled-components\";\nimport { type CustomFontType } from \"../types\";\nimport { crukTheme as defaultTheme } from \"../themes/cruk\";\n\n// font-display fall back to stop font's flickering on SSR rehydration\nconst buildCustomFonts = (customFonts: CustomFontType[]) =>\n customFonts\n .map(\n (font) => `\n @font-face {\n font-family: ${font.family};\n src: ${\n font?.urlWoff2 ? `url(\"${font.urlWoff2}\") format('woff2')` : \"\"\n }${!!font.urlWoff && !!font?.urlWoff2 ? \", \" : \"\"}\n ${font?.urlWoff ? `url(\"${font.urlWoff}\") format('woff')` : \"\"};\n font-weight: ${font?.fontWeight};\n font-style: normal;\n font-display: fallback;\n }\n `,\n )\n .join(\"\");\n\nexport const GlobalStyle = withTheme(createGlobalStyle`\n ${(props) => {\n const theme = {\n ...defaultTheme,\n ...props.theme,\n };\n return `\n ${buildCustomFonts(theme.typography.customFonts)}\n html {\n font-size: ${theme.typography.fontSizeBase};\n font-family: ${theme.typography.fontFamilyBase};\n line-height: ${theme.typography.lineHeight};\n }\n body {\n background-color: ${theme.colors.backgroundMidLight};\n color: ${theme.colors.textDark};\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n `;\n }}\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n`);\n\
|
|
1
|
+
{"version":3,"file":"GlobalStyle.js","sources":["../../../src/components/GlobalStyle.tsx"],"sourcesContent":["import { createGlobalStyle, withTheme } from \"styled-components\";\nimport { type CustomFontType } from \"../types\";\nimport { crukTheme as defaultTheme } from \"../themes/cruk\";\n\n// font-display fall back to stop font's flickering on SSR rehydration\nconst buildCustomFonts = (customFonts: CustomFontType[]) =>\n customFonts\n .map(\n (font) => `\n @font-face {\n font-family: ${font.family};\n src: ${\n font?.urlWoff2 ? `url(\"${font.urlWoff2}\") format('woff2')` : \"\"\n }${!!font.urlWoff && !!font?.urlWoff2 ? \", \" : \"\"}\n ${font?.urlWoff ? `url(\"${font.urlWoff}\") format('woff')` : \"\"};\n font-weight: ${font?.fontWeight};\n font-style: normal;\n font-display: fallback;\n }\n `,\n )\n .join(\"\");\n\nexport const GlobalStyle = withTheme(createGlobalStyle`\n ${(props) => {\n const theme = {\n ...defaultTheme,\n ...props.theme,\n };\n return `\n ${buildCustomFonts(theme.typography.customFonts)}\n html {\n font-size: ${theme.typography.fontSizeBase};\n font-family: ${theme.typography.fontFamilyBase};\n line-height: ${theme.typography.lineHeight};\n }\n body {\n background-color: ${theme.colors.backgroundMidLight};\n color: ${theme.colors.textDark};\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n `;\n }}\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n`);\n\nexport default GlobalStyle;\n"],"names":["GlobalStyle","withTheme","createGlobalStyle","props","theme","defaultTheme","customFonts","typography","map","font","family","urlWoff2","urlWoff","fontWeight","join","fontSizeBase","fontFamilyBase","lineHeight","colors","backgroundMidLight","textDark"],"mappings":"mHAKA,MAkBaA,EAAcC,EAAUC,CAAiB;IACjDC,IACD,MAAMC,EAAQ,IACTC,KACAF,EAAMC,OAEX,MAAO,WAxBeE,EAyBDF,EAAMG,WAAWD,YAxBxCA,EACGE,KACEC,GAAS,kDAESA,EAAKC,2BAElBD,GAAME,SAAW,QAAQF,EAAKE,6BAA+B,KAC1DF,EAAKG,SAAaH,GAAME,SAAW,KAAO,iBAC7CF,GAAMG,QAAU,QAAQH,EAAKG,2BAA6B,+BAC7CH,GAAMI,qGAM1BC,KAAK,yCAWWV,EAAMG,WAAWQ,uCACfX,EAAMG,WAAWS,yCACjBZ,EAAMG,WAAWU,iEAGZb,EAAMc,OAAOC,uCACxBf,EAAMc,OAAOE,qNAjCL,IAACd,CAyCrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{withTheme as o,createGlobalStyle as t}from"styled-components";import{crukTheme as e}from"../themes/cruk.js";const n=o(t`
|
|
2
|
+
${o=>{const t={...e,...o.theme};return`\n html {\n font-size: ${t.typography.fontSizeBase};\n font-family: ${t.typography.fontFamilyBase};\n line-height: ${t.typography.lineHeight};\n }\n body {\n background-color: ${t.colors.backgroundMidLight};\n color: ${t.colors.textDark};\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n `}}
|
|
3
|
+
*, *:after, *:before {
|
|
4
|
+
-webkit-box-sizing: border-box;
|
|
5
|
+
-moz-box-sizing: border-box;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@media (prefers-reduced-motion: reduce) {
|
|
10
|
+
*, *:after, *:before {
|
|
11
|
+
animation-play-state: paused !important;
|
|
12
|
+
animation-direction: reverse !important;
|
|
13
|
+
transition: none !important;
|
|
14
|
+
scroll-behavior: auto !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
table, td, th {
|
|
19
|
+
border-spacing: 0;
|
|
20
|
+
border: 1px solid #ccc;
|
|
21
|
+
padding: 10px;
|
|
22
|
+
}
|
|
23
|
+
.no-focus-outline a:focus,
|
|
24
|
+
.no-focus-outline button:focus {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
img {
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: auto;
|
|
30
|
+
}
|
|
31
|
+
section {
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
34
|
+
button {
|
|
35
|
+
font-size: 1em;
|
|
36
|
+
}
|
|
37
|
+
`);export{n as GlobalStyleNoFontFace,n as default};
|
|
2
38
|
//# sourceMappingURL=GlobalStyleNoFontFace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStyleNoFontFace.js","sources":["../../../src/components/GlobalStyleNoFontFace.tsx"],"sourcesContent":["import { createGlobalStyle, withTheme } from \"styled-components\";\nimport { crukTheme as defaultTheme } from \"../themes/cruk\";\n\nexport const GlobalStyleNoFontFace = withTheme(createGlobalStyle`\n ${(props) => {\n const theme = {\n ...defaultTheme,\n ...props.theme,\n };\n return `\n html {\n font-size: ${theme.typography.fontSizeBase};\n font-family: ${theme.typography.fontFamilyBase};\n line-height: ${theme.typography.lineHeight};\n }\n body {\n background-color: ${theme.colors.backgroundMidLight};\n color: ${theme.colors.textDark};\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n `;\n }}\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n`);\n\
|
|
1
|
+
{"version":3,"file":"GlobalStyleNoFontFace.js","sources":["../../../src/components/GlobalStyleNoFontFace.tsx"],"sourcesContent":["import { createGlobalStyle, withTheme } from \"styled-components\";\nimport { crukTheme as defaultTheme } from \"../themes/cruk\";\n\nexport const GlobalStyleNoFontFace = withTheme(createGlobalStyle`\n ${(props) => {\n const theme = {\n ...defaultTheme,\n ...props.theme,\n };\n return `\n html {\n font-size: ${theme.typography.fontSizeBase};\n font-family: ${theme.typography.fontFamilyBase};\n line-height: ${theme.typography.lineHeight};\n }\n body {\n background-color: ${theme.colors.backgroundMidLight};\n color: ${theme.colors.textDark};\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n `;\n }}\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n`);\n\nexport default GlobalStyleNoFontFace;\n"],"names":["GlobalStyleNoFontFace","withTheme","createGlobalStyle","props","theme","defaultTheme","typography","fontSizeBase","fontFamilyBase","lineHeight","colors","backgroundMidLight","textDark"],"mappings":"mHAGa,MAAAA,EAAwBC,EAAUC,CAAiB;IAC3DC,IACD,MAAMC,EAAQ,IACTC,KACAF,EAAMC,OAEX,MAAO,sCAEUA,EAAME,WAAWC,uCACfH,EAAME,WAAWE,yCACjBJ,EAAME,WAAWG,iEAGZL,EAAMM,OAAOC,uCACxBP,EAAMM,OAAOE,oNAQzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{useState as t}from"react";import{useTheme as l,ThemeProvider as o}from"styled-components";import n from"../../hooks/useScrollPosition.js";import{crukTheme as i}from"../../themes/cruk.js";import{StyledHeader as r,HeaderStickyPlaceHolder as c,HeaderStickyContainer as m,SkipToMain as s,HeaderMainContent as a,StyledLink as f,LogoWrapper as u,Logo as g,Tagline as E,ChildWrapper as S,ChildInner as h}from"./styles.js";function d({isSticky:d,siteSlogan:k,logoAltText:y,logoImageSrc:p,logoLinkTitle:$,logoLinkUrl:j,fullWidth:C,children:w}){const[x,A]=t(!1),L="undefined"!=typeof window,P=l(),T={...i,...P};return n((({currPos:e})=>{const t=!!L&&e.y>240;t!==x&&A(t)}),[x],null,!0,50),e.createElement(o,{theme:T},e.createElement(r,null,e.createElement(c,null,e.createElement(m,{"data-cy":"header-sticky-container",$isSmall:x,$isSticky:d},e.createElement(s,{href:"#main"},"Skip to main content"),e.createElement(a,{$fullWidth:C},e.createElement(f,{href:j??T.siteConfig.logoUrl,title:$??"Home"},e.createElement(u,{$isSmall:x,$isSticky:d},e.createElement(g,{height:80,src:p??T.siteConfig.logoSrc,alt:y??T.siteConfig.logoAlt}))),k?e.createElement(E,{$isSmall:x,$isSticky:d},k):null,e.createElement(S,null,e.createElement(h,null,w)))))))}export{d as Header,d as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Header/index.tsx"],"sourcesContent":["import React, { useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { useScrollPosition } from \"../../hooks/useScrollPosition\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport {\n StyledHeader,\n HeaderStickyContainer,\n HeaderStickyPlaceHolder,\n HeaderMainContent,\n SkipToMain,\n StyledLink,\n Logo,\n LogoWrapper,\n Tagline,\n ChildWrapper,\n ChildInner,\n} from \"./styles\";\n\nconst HEADER_SCROLL_THRESHOLD = 240;\n\nexport type HeaderProps = HTMLAttributes<HTMLElement> & {\n /** flag which make header fixed to the top even when scrolling */\n isSticky?: boolean;\n /** text in the middle of the header */\n siteSlogan?: string;\n /** text to explain the content of the icon for a11y usually a description of where the link will take you */\n logoAltText?: string;\n /** header logo image url */\n logoImageSrc?: string;\n /** title of the header image component, this is mainly for the tooltip text on hover */\n logoLinkTitle?: string;\n /** the url of the logo link */\n logoLinkUrl?: string;\n /** instead of the contents of the header being centered to max width as defined in theme it is 100% width fo viewport */\n fullWidth?: boolean;\n\n children?: ReactNode;\n};\n\n/**\n * There should be only one header component near or at the top of the body of each page.\n *\n * ### Logos\n * It is recommended that logo images are at least 80px high if they are not SVGs and that the logo is still clearly legible when reduced to 40px high for mobile.\n * It is also recommended that the logo width doesn't exceed 350px. If you need a wide logo that is shorter than 80px to keep the aspect ratio please make sure that the logo is centered with transparent space at the top and bottom and still 80px high.\n *\n * ### Site Slogan Text (optional)\n * This is a single line of text and the character limit depends on the theme, logo and children width. This is only visible on desktop at the top of the page\n *\n * ### Right section (optional)\n * This has been kept quite open you can place any child elements in here but ideally it is narrow and its height is 50px or smaller.\n *\n * ### Accessability\n * There is a hidden skip link in the header which will only reveals itself on the first tab and to screen readers. This link helps users skip to the main page content, however this will only work with there is an element with an id of 'main' which the developer should create for every page.\n *\n */\nexport function Header({\n isSticky,\n siteSlogan,\n logoAltText,\n logoImageSrc,\n logoLinkTitle,\n logoLinkUrl,\n fullWidth,\n children,\n}: HeaderProps) {\n const [isSmall, setIsSmall] = useState(false);\n const isBrowser = typeof window !== `undefined`;\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n useScrollPosition(\n ({\n currPos,\n }: {\n prevPos: { x: number; y: number };\n currPos: { x: number; y: number };\n }) => {\n const shouldShrink = isBrowser\n ? currPos.y > HEADER_SCROLL_THRESHOLD\n : false;\n if (shouldShrink !== isSmall) {\n setIsSmall(shouldShrink);\n }\n },\n [isSmall],\n null,\n true,\n 50,\n );\n\n return (\n <ThemeProvider theme={theme}>\n <StyledHeader>\n <HeaderStickyPlaceHolder>\n <HeaderStickyContainer\n data-cy=\"header-sticky-container\"\n $isSmall={isSmall}\n $isSticky={isSticky}\n >\n <SkipToMain href=\"#main\">Skip to main content</SkipToMain>\n <HeaderMainContent $fullWidth={fullWidth}>\n <StyledLink\n href={logoLinkUrl ?? theme.siteConfig.logoUrl}\n title={logoLinkTitle ?? \"Home\"}\n >\n <LogoWrapper $isSmall={isSmall} $isSticky={isSticky}>\n <Logo\n height={80}\n src={logoImageSrc ?? theme.siteConfig.logoSrc}\n alt={logoAltText ?? theme.siteConfig.logoAlt}\n />\n </LogoWrapper>\n </StyledLink>\n {siteSlogan ? (\n <Tagline $isSmall={isSmall} $isSticky={isSticky}>\n {siteSlogan}\n </Tagline>\n ) : null}\n <ChildWrapper>\n <ChildInner>{children}</ChildInner>\n </ChildWrapper>\n </HeaderMainContent>\n </HeaderStickyContainer>\n </HeaderStickyPlaceHolder>\n </StyledHeader>\n </ThemeProvider>\n );\n}\n\nexport default Header;\n"],"names":["Header","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Header/index.tsx"],"sourcesContent":["import React, { useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { useScrollPosition } from \"../../hooks/useScrollPosition\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport {\n StyledHeader,\n HeaderStickyContainer,\n HeaderStickyPlaceHolder,\n HeaderMainContent,\n SkipToMain,\n StyledLink,\n Logo,\n LogoWrapper,\n Tagline,\n ChildWrapper,\n ChildInner,\n} from \"./styles\";\n\nconst HEADER_SCROLL_THRESHOLD = 240;\n\nexport type HeaderProps = HTMLAttributes<HTMLElement> & {\n /** flag which make header fixed to the top even when scrolling */\n isSticky?: boolean;\n /** text in the middle of the header */\n siteSlogan?: string;\n /** text to explain the content of the icon for a11y usually a description of where the link will take you */\n logoAltText?: string;\n /** header logo image url */\n logoImageSrc?: string;\n /** title of the header image component, this is mainly for the tooltip text on hover */\n logoLinkTitle?: string;\n /** the url of the logo link */\n logoLinkUrl?: string;\n /** instead of the contents of the header being centered to max width as defined in theme it is 100% width fo viewport */\n fullWidth?: boolean;\n\n children?: ReactNode;\n};\n\n/**\n * There should be only one header component near or at the top of the body of each page.\n *\n * ### Logos\n * It is recommended that logo images are at least 80px high if they are not SVGs and that the logo is still clearly legible when reduced to 40px high for mobile.\n * It is also recommended that the logo width doesn't exceed 350px. If you need a wide logo that is shorter than 80px to keep the aspect ratio please make sure that the logo is centered with transparent space at the top and bottom and still 80px high.\n *\n * ### Site Slogan Text (optional)\n * This is a single line of text and the character limit depends on the theme, logo and children width. This is only visible on desktop at the top of the page\n *\n * ### Right section (optional)\n * This has been kept quite open you can place any child elements in here but ideally it is narrow and its height is 50px or smaller.\n *\n * ### Accessability\n * There is a hidden skip link in the header which will only reveals itself on the first tab and to screen readers. This link helps users skip to the main page content, however this will only work with there is an element with an id of 'main' which the developer should create for every page.\n *\n */\nexport function Header({\n isSticky,\n siteSlogan,\n logoAltText,\n logoImageSrc,\n logoLinkTitle,\n logoLinkUrl,\n fullWidth,\n children,\n}: HeaderProps) {\n const [isSmall, setIsSmall] = useState(false);\n const isBrowser = typeof window !== `undefined`;\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n useScrollPosition(\n ({\n currPos,\n }: {\n prevPos: { x: number; y: number };\n currPos: { x: number; y: number };\n }) => {\n const shouldShrink = isBrowser\n ? currPos.y > HEADER_SCROLL_THRESHOLD\n : false;\n if (shouldShrink !== isSmall) {\n setIsSmall(shouldShrink);\n }\n },\n [isSmall],\n null,\n true,\n 50,\n );\n\n return (\n <ThemeProvider theme={theme}>\n <StyledHeader>\n <HeaderStickyPlaceHolder>\n <HeaderStickyContainer\n data-cy=\"header-sticky-container\"\n $isSmall={isSmall}\n $isSticky={isSticky}\n >\n <SkipToMain href=\"#main\">Skip to main content</SkipToMain>\n <HeaderMainContent $fullWidth={fullWidth}>\n <StyledLink\n href={logoLinkUrl ?? theme.siteConfig.logoUrl}\n title={logoLinkTitle ?? \"Home\"}\n >\n <LogoWrapper $isSmall={isSmall} $isSticky={isSticky}>\n <Logo\n height={80}\n src={logoImageSrc ?? theme.siteConfig.logoSrc}\n alt={logoAltText ?? theme.siteConfig.logoAlt}\n />\n </LogoWrapper>\n </StyledLink>\n {siteSlogan ? (\n <Tagline $isSmall={isSmall} $isSticky={isSticky}>\n {siteSlogan}\n </Tagline>\n ) : null}\n <ChildWrapper>\n <ChildInner>{children}</ChildInner>\n </ChildWrapper>\n </HeaderMainContent>\n </HeaderStickyContainer>\n </HeaderStickyPlaceHolder>\n </StyledHeader>\n </ThemeProvider>\n );\n}\n\nexport default Header;\n"],"names":["Header","isSticky","siteSlogan","logoAltText","logoImageSrc","logoLinkTitle","logoLinkUrl","fullWidth","children","isSmall","setIsSmall","useState","isBrowser","window","foundTheme","useTheme","theme","defaultTheme","useScrollPosition","currPos","shouldShrink","y","React","createElement","ThemeProvider","StyledHeader","HeaderStickyPlaceHolder","HeaderStickyContainer","$isSmall","SkipToMain","href","HeaderMainContent","StyledLink","siteConfig","logoUrl","title","LogoWrapper","$isSticky","Logo","height","src","logoSrc","alt","logoAlt","Tagline","ChildWrapper","ChildInner"],"mappings":"kbA0DgBA,GAAOC,SACrBA,EAAQC,WACRA,EAAUC,YACVA,EAAWC,aACXA,EAAYC,cACZA,EAAaC,YACbA,EAAWC,UACXA,EAASC,SACTA,IAEA,MAAOC,EAASC,GAAcC,GAAS,GACjCC,EAA8B,oBAAXC,OACnBC,EAAaC,IACbC,EAAQ,IACTC,KACAH,GAuBL,OApBAI,GACE,EACEC,cAKA,MAAMC,IAAeR,GACjBO,EAAQE,EAhEc,IAkEtBD,IAAiBX,GACnBC,EAAWU,KAGf,CAACX,GACD,MACA,EACA,IAIAa,EAACC,cAAAC,EAAc,CAAAR,MAAOA,GACpBM,EAAAC,cAACE,EAAY,KACXH,EAAAC,cAACG,EAAuB,KACtBJ,EAAAC,cAACI,EACS,CAAA,UAAA,0BACEC,SAAAnB,YACCR,GAEXqB,EAAAC,cAACM,EAAU,CAACC,KAAK,SAAyC,wBAC1DR,EAACC,cAAAQ,cAA8BxB,GAC7Be,EAAAC,cAACS,EACC,CAAAF,KAAMxB,GAAeU,EAAMiB,WAAWC,QACtCC,MAAO9B,GAAiB,QAExBiB,EAAAC,cAACa,EAAW,CAAAR,SAAWnB,EAAO4B,UAAapC,GACzCqB,EAACC,cAAAe,EACC,CAAAC,OAAQ,GACRC,IAAKpC,GAAgBY,EAAMiB,WAAWQ,QACtCC,IAAKvC,GAAea,EAAMiB,WAAWU,YAI1CzC,EACCoB,EAAAC,cAACqB,EAAkB,CAAAhB,SAAAnB,EAAoB4B,UAAApC,GACpCC,GAED,KACJoB,EAAAC,cAACsB,EAAY,KACXvB,EAACC,cAAAuB,EAAY,KAAAtC,QAQ7B"}
|
|
@@ -1,2 +1,110 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from"styled-components";import{crukTheme as e}from"../../themes/cruk.js";const t="120px",o="72px",a=e.spacing.xs,n="40px",d="0.2s",h=i.header`
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
background-color: ${({theme:{colors:{headerBackground:i}}})=>i};
|
|
6
|
+
z-index: 9998;
|
|
7
|
+
`,s=i.div`
|
|
8
|
+
position: relative;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: ${o};
|
|
12
|
+
|
|
13
|
+
@media (min-width: ${({theme:i})=>i.breakpoint.desktop}) {
|
|
14
|
+
height: ${t};
|
|
15
|
+
}
|
|
16
|
+
`,r=i.div`
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
padding: 0 ${a};
|
|
21
|
+
background-color: ${({theme:{colors:{headerBackground:i}}})=>i};
|
|
22
|
+
position: relative;
|
|
23
|
+
border-bottom: ${({theme:{colors:{headerBorder:i}}})=>`solid 1px ${i}`};
|
|
24
|
+
height: ${o};
|
|
25
|
+
box-shadow: ${({theme:i,$isSticky:e})=>e?i.shadows.l:"none"};
|
|
26
|
+
top: ${({$isSticky:i})=>i?0:"auto"};
|
|
27
|
+
position: ${({$isSticky:i})=>i?"fixed":"relative"};
|
|
28
|
+
transition: height ${d} ease;
|
|
29
|
+
|
|
30
|
+
@media (min-width: ${({theme:i})=>i.breakpoint.desktop}) {
|
|
31
|
+
position: ${({$isSticky:i})=>i?"fixed":"relative"};
|
|
32
|
+
height: ${({$isSmall:i,$isSticky:e})=>i&&e?o:t};
|
|
33
|
+
}
|
|
34
|
+
`,l=i.div`
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
margin: 0 auto;
|
|
42
|
+
max-width: ${({$fullWidth:i,theme:{utilities:{contentMaxWidth:e}}})=>i?"100%":e};
|
|
43
|
+
`,p=i.img`
|
|
44
|
+
height: 100%;
|
|
45
|
+
width: auto;
|
|
46
|
+
max-width: 100%;
|
|
47
|
+
max-height: 100%;
|
|
48
|
+
`,c=i.div`
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
justify-content: space-around;
|
|
52
|
+
width: auto;
|
|
53
|
+
transition: height ${d} ease;
|
|
54
|
+
|
|
55
|
+
height: ${n};
|
|
56
|
+
|
|
57
|
+
@media (min-width: ${({theme:i})=>i.breakpoint.desktop}) {
|
|
58
|
+
height: ${({$isSmall:i,$isSticky:e})=>i&&e?n:"80px"};
|
|
59
|
+
}
|
|
60
|
+
`,m=i.a`
|
|
61
|
+
display: inline-block;
|
|
62
|
+
`,g=i.a`
|
|
63
|
+
left: -999px;
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: auto;
|
|
66
|
+
width: 1px;
|
|
67
|
+
height: 1px;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
z-index: -999;
|
|
70
|
+
&:focus,
|
|
71
|
+
&:active,
|
|
72
|
+
&:focus-within {
|
|
73
|
+
left: auto;
|
|
74
|
+
top: auto;
|
|
75
|
+
width: 30%;
|
|
76
|
+
height: auto;
|
|
77
|
+
overflow: auto;
|
|
78
|
+
margin: 10px 35%;
|
|
79
|
+
padding: ${({theme:{spacing:{xs:i}}})=>i};
|
|
80
|
+
border-radius: 15px;
|
|
81
|
+
border: 4px solid yellow;
|
|
82
|
+
text-align: center;
|
|
83
|
+
font-size: 1.2em;
|
|
84
|
+
z-index: 999;
|
|
85
|
+
}
|
|
86
|
+
`,x=i.p`
|
|
87
|
+
flex: 1 1 auto;
|
|
88
|
+
font-family: ${({theme:i})=>i.typography.fontFamilyHeadings};
|
|
89
|
+
font-weight: ${({theme:i})=>i.typography.fontWeightHeadings};
|
|
90
|
+
font-size: ${({theme:{fontSizes:{xl:i}}})=>i};
|
|
91
|
+
color: ${({theme:i})=>i.colors.headerTaglineText};
|
|
92
|
+
text-align: center;
|
|
93
|
+
opacity: 0;
|
|
94
|
+
transition: opacity ${d} ease;
|
|
95
|
+
display: none;
|
|
96
|
+
|
|
97
|
+
@media (min-width: ${({theme:i})=>i.breakpoint.desktop}) {
|
|
98
|
+
display: block;
|
|
99
|
+
opacity: ${({$isSmall:i,$isSticky:e})=>i&&e?0:1};
|
|
100
|
+
}
|
|
101
|
+
`,$=i.div`
|
|
102
|
+
height: 100%;
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
justify-content: space-around;
|
|
106
|
+
`,u=i.div`
|
|
107
|
+
height: auto;
|
|
108
|
+
margin: auto 0;
|
|
109
|
+
`;export{u as ChildInner,$ as ChildWrapper,l as HeaderMainContent,r as HeaderStickyContainer,s as HeaderStickyPlaceHolder,p as Logo,c as LogoWrapper,g as SkipToMain,h as StyledHeader,m as StyledLink,x as Tagline};
|
|
2
110
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Header/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { type ThemeType } from \"../../types\";\n\nconst HEADER_HEIGHT_LARGE = \"120px\";\nconst HEADER_HEIGHT_SMALL = \"72px\";\nconst HEADER_PADDING = defaultTheme.spacing.xs;\nconst HEADER_LOGO_HEIGHT_LARGE = \"80px\";\nconst HEADER_LOGO_HEIGHT_SMALL = \"40px\";\nconst ANIMATION_SPEED = \"0.2s\";\n\nexport const StyledHeader = styled.header<{ theme: ThemeType }>`\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n z-index: 9998;\n`;\n\nexport const HeaderStickyPlaceHolder = styled.div<{ theme: ThemeType }>`\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ${HEADER_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderStickyContainer = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ${HEADER_PADDING};\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n position: relative;\n border-bottom: ${({\n theme: {\n colors: { headerBorder },\n },\n }) => `solid 1px ${headerBorder}`};\n height: ${HEADER_HEIGHT_SMALL};\n box-shadow: ${({ theme, $isSticky }) =>\n $isSticky ? theme.shadows.l : \"none\"};\n top: ${({ $isSticky }) => ($isSticky ? 0 : \"auto\")};\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n transition: height ${ANIMATION_SPEED} ease;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky ? HEADER_HEIGHT_SMALL : HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderMainContent = styled.div<{\n $fullWidth?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ${({\n $fullWidth,\n theme: {\n utilities: { contentMaxWidth },\n },\n }) => ($fullWidth ? `100%` : contentMaxWidth)};\n`;\n\nexport const Logo = styled.img`\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n`;\n\nexport const LogoWrapper = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height ${ANIMATION_SPEED} ease;\n\n height: ${HEADER_LOGO_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky\n ? HEADER_LOGO_HEIGHT_SMALL\n : HEADER_LOGO_HEIGHT_LARGE};\n }\n`;\n\nexport const StyledLink = styled.a`\n display: inline-block;\n`;\n\nexport const SkipToMain = styled.a<{ theme: ThemeType }>`\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n`;\n\nexport const Tagline = styled.p<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n flex: 1 1 auto;\n font-family: ${({ theme }) => theme.typography.fontFamilyHeadings};\n font-weight: ${({ theme }) => theme.typography.fontWeightHeadings};\n font-size: ${({\n theme: {\n fontSizes: { xl },\n },\n }) => xl};\n color: ${({ theme }) => theme.colors.headerTaglineText};\n text-align: center;\n opacity: 0;\n transition: opacity ${ANIMATION_SPEED} ease;\n display: none;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: block;\n opacity: ${({ $isSmall, $isSticky }) => ($isSmall && $isSticky ? 0 : 1)};\n }\n`;\n\nexport const ChildWrapper = styled.div`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n`;\n\nexport const ChildInner = styled.div`\n height: auto;\n margin: auto 0;\n`;\n"],"names":["HEADER_HEIGHT_LARGE","HEADER_HEIGHT_SMALL","HEADER_PADDING","defaultTheme","spacing","xs","HEADER_LOGO_HEIGHT_SMALL","ANIMATION_SPEED","StyledHeader","styled","header","
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Header/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { type ThemeType } from \"../../types\";\n\nconst HEADER_HEIGHT_LARGE = \"120px\";\nconst HEADER_HEIGHT_SMALL = \"72px\";\nconst HEADER_PADDING = defaultTheme.spacing.xs;\nconst HEADER_LOGO_HEIGHT_LARGE = \"80px\";\nconst HEADER_LOGO_HEIGHT_SMALL = \"40px\";\nconst ANIMATION_SPEED = \"0.2s\";\n\nexport const StyledHeader = styled.header<{ theme: ThemeType }>`\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n z-index: 9998;\n`;\n\nexport const HeaderStickyPlaceHolder = styled.div<{ theme: ThemeType }>`\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ${HEADER_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderStickyContainer = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ${HEADER_PADDING};\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n position: relative;\n border-bottom: ${({\n theme: {\n colors: { headerBorder },\n },\n }) => `solid 1px ${headerBorder}`};\n height: ${HEADER_HEIGHT_SMALL};\n box-shadow: ${({ theme, $isSticky }) =>\n $isSticky ? theme.shadows.l : \"none\"};\n top: ${({ $isSticky }) => ($isSticky ? 0 : \"auto\")};\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n transition: height ${ANIMATION_SPEED} ease;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky ? HEADER_HEIGHT_SMALL : HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderMainContent = styled.div<{\n $fullWidth?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ${({\n $fullWidth,\n theme: {\n utilities: { contentMaxWidth },\n },\n }) => ($fullWidth ? `100%` : contentMaxWidth)};\n`;\n\nexport const Logo = styled.img`\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n`;\n\nexport const LogoWrapper = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height ${ANIMATION_SPEED} ease;\n\n height: ${HEADER_LOGO_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky\n ? HEADER_LOGO_HEIGHT_SMALL\n : HEADER_LOGO_HEIGHT_LARGE};\n }\n`;\n\nexport const StyledLink = styled.a`\n display: inline-block;\n`;\n\nexport const SkipToMain = styled.a<{ theme: ThemeType }>`\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n`;\n\nexport const Tagline = styled.p<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n flex: 1 1 auto;\n font-family: ${({ theme }) => theme.typography.fontFamilyHeadings};\n font-weight: ${({ theme }) => theme.typography.fontWeightHeadings};\n font-size: ${({\n theme: {\n fontSizes: { xl },\n },\n }) => xl};\n color: ${({ theme }) => theme.colors.headerTaglineText};\n text-align: center;\n opacity: 0;\n transition: opacity ${ANIMATION_SPEED} ease;\n display: none;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: block;\n opacity: ${({ $isSmall, $isSticky }) => ($isSmall && $isSticky ? 0 : 1)};\n }\n`;\n\nexport const ChildWrapper = styled.div`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n`;\n\nexport const ChildInner = styled.div`\n height: auto;\n margin: auto 0;\n`;\n"],"names":["HEADER_HEIGHT_LARGE","HEADER_HEIGHT_SMALL","HEADER_PADDING","defaultTheme","spacing","xs","HEADER_LOGO_HEIGHT_SMALL","ANIMATION_SPEED","StyledHeader","styled","header","theme","colors","headerBackground","HeaderStickyPlaceHolder","div","breakpoint","desktop","HeaderStickyContainer","headerBorder","$isSticky","shadows","l","$isSmall","HeaderMainContent","$fullWidth","utilities","contentMaxWidth","Logo","img","LogoWrapper","StyledLink","a","SkipToMain","Tagline","p","typography","fontFamilyHeadings","fontWeightHeadings","fontSizes","xl","headerTaglineText","ChildWrapper","ChildInner"],"mappings":"kFAKA,MAAMA,EAAsB,QACtBC,EAAsB,OACtBC,EAAiBC,EAAaC,QAAQC,GAEtCC,EAA2B,OAC3BC,EAAkB,OAEXC,EAAeC,EAAOC,MAA4B;;;;sBAIzC,EAClBC,OACEC,QAAUC,wBAERA;;EAIKC,EAA0BL,EAAOM,GAAyB;;;;YAI3Dd;;uBAEW,EAAGU,WAAYA,EAAMK,WAAWC;cACzCjB;;EAIDkB,EAAwBT,EAAOM,GAI1C;;;;eAIab;sBACO,EAClBS,OACEC,QAAUC,wBAERA;;mBAEW,EACfF,OACEC,QAAUO,oBAER,aAAaA;YACTlB;gBACI,EAAGU,QAAOS,eACtBA,EAAYT,EAAMU,QAAQC,EAAI;SACzB,EAAGF,eAAiBA,EAAY,EAAI;cAC/B,EAAGA,eAAiBA,EAAY,QAAU;uBACjCb;;uBAEA,EAAGI,WAAYA,EAAMK,WAAWC;gBACvC,EAAGG,eAAiBA,EAAY,QAAU;cAC5C,EAAGG,WAAUH,eACrBG,GAAYH,EAAYnB,EAAsBD;;EAIvCwB,EAAoBf,EAAOM,GAGtC;;;;;;;;eAQa,EACXU,aACAd,OACEe,WAAaC,uBAEVF,EAAa,OAASE;EAGlBC,EAAOnB,EAAOoB,GAAG;;;;;EAOjBC,EAAcrB,EAAOM,GAIhC;;;;;uBAKqBR;;YAEXD;;uBAEW,EAAGK,WAAYA,EAAMK,WAAWC;cACzC,EAAGM,WAAUH,eACrBG,GAAYH,EACRd,EAvGuB;;EA4GpByB,EAAatB,EAAOuB,CAAC;;EAIrBC,EAAaxB,EAAOuB,CAAuB;;;;;;;;;;;;;;;;;eAiBzC,EACTrB,OACEP,SAAWC,UAETA;;;;;;;EASG6B,EAAUzB,EAAO0B,CAI5B;;iBAEe,EAAGxB,WAAYA,EAAMyB,WAAWC;iBAChC,EAAG1B,WAAYA,EAAMyB,WAAWE;eAClC,EACX3B,OACE4B,WAAaC,UAEXA;WACG,EAAG7B,WAAYA,EAAMC,OAAO6B;;;wBAGflC;;;uBAGD,EAAGI,WAAYA,EAAMK,WAAWC;;eAExC,EAAGM,WAAUH,eAAiBG,GAAYH,EAAY,EAAI;;EAI5DsB,EAAejC,EAAOM,GAAG;;;;;EAOzB4B,EAAalC,EAAOM,GAAG;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{useTheme as t}from"styled-components";import{crukTheme as r}from"../../themes/cruk.js";import{spacingPropsToSpacingPropsInternal as o}from"../Spacing/index.js";import{H1 as $,H2 as l,H3 as a,H4 as m,H5 as x,H6 as i}from"./styles.js";function n({textSize:n,textAlign:p,textColor:w,wordBreak:f,overflowWrap:h,h1:c,h2:d,h3:s,h4:g,h5:k,h6:S,...v}){const z=t(),A={...r,...z},B=o(v);return c?e.createElement($,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):d?e.createElement(l,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):s?e.createElement(a,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):g?e.createElement(m,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):k?e.createElement(x,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):S?e.createElement(i,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):e.createElement(l,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h})}export{n as Heading,n as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|