@cruk/cruk-react-components 5.0.7 → 6.0.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.
- package/README.md +20 -7
- 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 +2 -2
- 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/src/components/Badge/index.js +1 -1
- package/lib/src/components/Badge/index.js.map +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 +2 -2
- package/lib/{components → src/components}/Box/index.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 +2 -2
- package/lib/{components → src/components}/Button/index.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 +3 -3
- package/lib/{components → src/components}/Checkbox/index.d.ts +3 -3
- 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/{components → src/components}/Collapse/styles.d.ts +11 -3
- 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/{components → src/components}/DateField/styles.d.ts +12 -6
- 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.d.ts +16 -0
- 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/{components → src/components}/Footer/styles.d.ts +3 -9
- package/lib/src/components/Footer/styles.js +69 -1
- package/lib/src/components/Footer/styles.js.map +1 -1
- package/lib/src/components/GlobalStyle.d.ts +2 -0
- package/lib/src/components/GlobalStyle.js +37 -1
- package/lib/src/components/GlobalStyle.js.map +1 -1
- package/lib/src/components/GlobalStyleNoFontFace.d.ts +2 -0
- 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 +2 -2
- package/lib/{components → src/components}/InfoBox/index.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.d.ts +13 -0
- 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 +5 -2
- package/lib/{components → src/components}/Link/index.d.ts +4 -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.d.ts +20 -0
- 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.d.ts +32 -0
- 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 +3 -3
- package/lib/{components → src/components}/Radio/index.d.ts +3 -3
- 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/{components → src/components}/RadioConsent/styles.d.ts +6 -3
- 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 +3 -3
- package/lib/{components → src/components}/Select/index.d.ts +3 -3
- 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 +2 -2
- package/lib/{components → src/components}/Text/index.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 +2 -2
- package/lib/{components → src/components}/TextAreaField/index.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 +2 -2
- package/lib/{components → src/components}/TextField/index.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/{components → src/components}/TextField/styles.d.ts +2 -6
- package/lib/src/components/TextField/styles.js +110 -1
- package/lib/src/components/TextField/styles.js.map +1 -1
- package/lib/src/components/ThemeCheatSheet.d.ts +7 -0
- 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/{hooks → src/hooks}/useScrollPosition.d.ts +2 -2
- 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 +37 -44
- package/lib/components/ErrorText/styles.d.ts +0 -8
- package/lib/components/GlobalStyle.d.ts +0 -2
- package/lib/components/GlobalStyleNoFontFace.d.ts +0 -2
- package/lib/components/InfoBox/styles.d.ts +0 -10
- package/lib/components/Link/styles.d.ts +0 -12
- package/lib/components/Modal/styles.d.ts +0 -21
- package/lib/components/ThemeCheatSheet.d.ts +0 -7
- 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}/Badge/index.d.ts +0 -0
- /package/lib/{components → src/components}/Badge/styles.d.ts +0 -0
- /package/lib/{components → src/components}/Box/Box.test.cypress.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/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/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}/DateField/DateField.test.cypress.d.ts +0 -0
- /package/lib/{components → src/components}/DateField/index.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}/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}/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}/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}/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}/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/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}/Select/Select.test.cypress.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/styles.d.ts +0 -0
- /package/lib/{components → src/components}/TextAreaField/TextAreaField.test.cypress.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}/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/{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,2 +1,97 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"styled-components";const o=e.div`
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
overflow-y: hidden;
|
|
5
|
+
`,t=e.ul`
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow-x: scroll;
|
|
8
|
+
scroll-snap-type: x mandatory;
|
|
9
|
+
scroll-behavior: ${({$smoothScrolling:e})=>e?"smooth":"auto"};
|
|
10
|
+
-webkit-overflow-scrolling: touch;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
padding-left: 0;
|
|
13
|
+
padding-right: 0;
|
|
14
|
+
padding-bottom: 20px;
|
|
15
|
+
margin-bottom: -20px;
|
|
16
|
+
height: 100%;
|
|
17
|
+
`,i=e.li`
|
|
18
|
+
scroll-snap-align: center;
|
|
19
|
+
display: inline-block;
|
|
20
|
+
width: ${({$onlyChild:e,$fullWidthChild:o})=>e||o?"100%":"80%"};
|
|
21
|
+
`,r=e.div`
|
|
22
|
+
transition: transform 0.2s linear;
|
|
23
|
+
transform: ${({$isSelected:e,$shrinkUnselectedPages:o,$onlyChild:t,$fullWidthChild:i})=>t||e&&o||i?"scale(1)":"scale(0.9)"};
|
|
24
|
+
`,n=e.div`
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
`,s=e.span`
|
|
28
|
+
display: block;
|
|
29
|
+
margin: auto;
|
|
30
|
+
height: 2rem;
|
|
31
|
+
line-height: 1.75rem;
|
|
32
|
+
`,l=e.button`
|
|
33
|
+
height: 100%;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
background-color: rgba(255, 255, 255, 0);
|
|
36
|
+
border: none;
|
|
37
|
+
/* TODO if this makes it into the component library carouselButtonColor should be a theme prop */
|
|
38
|
+
color: ${({disabled:e,theme:o})=>e?o.colors.disabled:"su2c"===o.name?o.colors.textDark:o.colors.primary};
|
|
39
|
+
font-size: ${({theme:e})=>e.fontSizes.xxxl};
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
transition:
|
|
42
|
+
color 0.3s ease,
|
|
43
|
+
transform 0.3s ease;
|
|
44
|
+
max-width: 3rem;
|
|
45
|
+
padding: 0;
|
|
46
|
+
vertical-align: middle;
|
|
47
|
+
user-select: none;
|
|
48
|
+
|
|
49
|
+
transform: scale(0.8);
|
|
50
|
+
&:hover {
|
|
51
|
+
transform: ${({disabled:e})=>e?"scale(0.8)":"scale(1)"};
|
|
52
|
+
}
|
|
53
|
+
`,a=e.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
display: ${({$count:e})=>e>6?"none":"flex"};
|
|
58
|
+
|
|
59
|
+
@media (min-width: ${({theme:e})=>e.breakpoint.tablet}) {
|
|
60
|
+
display: ${({$count:e})=>e>10?"none":"flex"};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
|
|
64
|
+
display: ${({$count:e})=>e>20?"none":"flex"};
|
|
65
|
+
}
|
|
66
|
+
`,d=e.button`
|
|
67
|
+
border: none;
|
|
68
|
+
outline-offset: ${({theme:e})=>e.spacing.xxs};
|
|
69
|
+
padding: 0;
|
|
70
|
+
margin: ${({theme:e})=>`auto ${e.spacing.xxs}`};
|
|
71
|
+
width: ${({theme:e})=>e.fontSizes.l};
|
|
72
|
+
height: ${({theme:e})=>e.fontSizes.l};
|
|
73
|
+
border-radius: 50%;
|
|
74
|
+
/* TODO if this makes it into the component library carouselButtonColor should be a theme prop */
|
|
75
|
+
border: ${({theme:e})=>`solid 1px ${"su2c"===e.name?e.colors.textDark:e.colors.primary}`};
|
|
76
|
+
background-color: ${({theme:e,$selected:o})=>o?`${"su2c"===e.name?e.colors.textDark:e.colors.primary}`:e.colors.backgroundLight};
|
|
77
|
+
user-select: none;
|
|
78
|
+
transition:
|
|
79
|
+
background-color 0.3s ease,
|
|
80
|
+
transform 0.3s ease;
|
|
81
|
+
transform: scale(0.8);
|
|
82
|
+
&:hover {
|
|
83
|
+
transform: scale(1);
|
|
84
|
+
}
|
|
85
|
+
`,c=e.span`
|
|
86
|
+
border: 0px;
|
|
87
|
+
clip: rect(0px, 0px, 0px, 0px);
|
|
88
|
+
height: 1px;
|
|
89
|
+
margin-bottom: -1px;
|
|
90
|
+
margin-right: -1px;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
padding: 0px;
|
|
93
|
+
position: absolute;
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
width: 1px;
|
|
96
|
+
`;export{n as ButtonWrapper,l as CarouselButton,i as CarouselCard,r as CarouselCardInner,t as CarouselScrollArea,o as CarouselWrapper,d as Dot,a as DotContainer,c as ScreenReaderOnly,s as VerticalAlign};
|
|
2
97
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Carousel/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { type ThemeType } from \"../../types\";\n\nexport const CarouselWrapper = styled.div`\n position: relative;\n width: 100%;\n overflow-y: hidden;\n`;\n\nexport const CarouselScrollArea = styled.ul<{\n $smoothScrolling: boolean;\n}>`\n position: relative;\n overflow-x: scroll;\n scroll-snap-type: x mandatory;\n scroll-behavior: ${({ $smoothScrolling }) =>\n $smoothScrolling ? \"smooth\" : \"auto\"};\n -webkit-overflow-scrolling: touch;\n white-space: nowrap;\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 20px;\n margin-bottom: -20px;\n height: 100%;\n`;\n\nexport const CarouselCard = styled.li<{\n $onlyChild: boolean;\n $fullWidthChild: boolean;\n}>`\n scroll-snap-align: center;\n display: inline-block;\n width: ${({ $onlyChild, $fullWidthChild }) =>\n $onlyChild || $fullWidthChild ? \"100%\" : \"80%\"};\n`;\n\nexport const CarouselCardInner = styled.div<{\n $isSelected: boolean;\n $shrinkUnselectedPages: boolean;\n $onlyChild: boolean;\n $fullWidthChild: boolean;\n}>`\n transition: transform 0.2s linear;\n transform: ${({\n $isSelected,\n $shrinkUnselectedPages,\n $onlyChild,\n $fullWidthChild,\n }) =>\n $onlyChild || ($isSelected && $shrinkUnselectedPages) || $fullWidthChild\n ? \"scale(1)\"\n : \"scale(0.9)\"};\n`;\n\nexport const ButtonWrapper = styled.div`\n display: flex;\n justify-content: center;\n`;\n\nexport const VerticalAlign = styled.span`\n display: block;\n margin: auto;\n height: 2rem;\n line-height: 1.75rem;\n`;\n\nexport const CarouselButton = styled.button<{\n disabled: boolean;\n theme: ThemeType;\n}>`\n height: 100%;\n cursor: pointer;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n /* TODO if this makes it into the component library carouselButtonColor should be a theme prop */\n color: ${({ disabled, theme }) =>\n disabled\n ? theme.colors.disabled\n : theme.name === \"su2c\"\n ? theme.colors.textDark\n : theme.colors.primary};\n font-size: ${({ theme }) => theme.fontSizes.xxxl};\n font-weight: 600;\n transition:\n color 0.3s ease,\n transform 0.3s ease;\n max-width: 3rem;\n padding: 0;\n vertical-align: middle;\n user-select: none;\n\n transform: scale(0.8);\n &:hover {\n transform: ${({ disabled }) => (disabled ? \"scale(0.8)\" : \"scale(1)\")};\n }\n`;\n\nexport const DotContainer = styled.div<{ $count: number; theme: ThemeType }>`\n display: flex;\n flex-direction: row;\n justify-content: center;\n display: ${({ $count }) => ($count > 6 ? \"none\" : \"flex\")};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n display: ${({ $count }) => ($count > 10 ? \"none\" : \"flex\")};\n }\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: ${({ $count }) => ($count > 20 ? \"none\" : \"flex\")};\n }\n`;\n\nexport const Dot = styled.button<{ $selected: boolean; theme: ThemeType }>`\n border: none;\n outline-offset: ${({ theme }) => theme.spacing.xxs};\n padding: 0;\n margin: ${({ theme }) => `auto ${theme.spacing.xxs}`};\n width: ${({ theme }) => theme.fontSizes.l};\n height: ${({ theme }) => theme.fontSizes.l};\n border-radius: 50%;\n /* TODO if this makes it into the component library carouselButtonColor should be a theme prop */\n border: ${({ theme }) =>\n `solid 1px ${\n theme.name === \"su2c\" ? theme.colors.textDark : theme.colors.primary\n }`};\n background-color: ${({ theme, $selected }) =>\n $selected\n ? `${\n theme.name === \"su2c\" ? theme.colors.textDark : theme.colors.primary\n }`\n : theme.colors.backgroundLight};\n user-select: none;\n transition:\n background-color 0.3s ease,\n transform 0.3s ease;\n transform: scale(0.8);\n &:hover {\n transform: scale(1);\n }\n`;\n\n// TODO move to its own component\nexport const ScreenReaderOnly = styled.span`\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n margin-bottom: -1px;\n margin-right: -1px;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n"],"names":["CarouselWrapper","styled","div","
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Carousel/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { type ThemeType } from \"../../types\";\n\nexport const CarouselWrapper = styled.div`\n position: relative;\n width: 100%;\n overflow-y: hidden;\n`;\n\nexport const CarouselScrollArea = styled.ul<{\n $smoothScrolling: boolean;\n}>`\n position: relative;\n overflow-x: scroll;\n scroll-snap-type: x mandatory;\n scroll-behavior: ${({ $smoothScrolling }) =>\n $smoothScrolling ? \"smooth\" : \"auto\"};\n -webkit-overflow-scrolling: touch;\n white-space: nowrap;\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 20px;\n margin-bottom: -20px;\n height: 100%;\n`;\n\nexport const CarouselCard = styled.li<{\n $onlyChild: boolean;\n $fullWidthChild: boolean;\n}>`\n scroll-snap-align: center;\n display: inline-block;\n width: ${({ $onlyChild, $fullWidthChild }) =>\n $onlyChild || $fullWidthChild ? \"100%\" : \"80%\"};\n`;\n\nexport const CarouselCardInner = styled.div<{\n $isSelected: boolean;\n $shrinkUnselectedPages: boolean;\n $onlyChild: boolean;\n $fullWidthChild: boolean;\n}>`\n transition: transform 0.2s linear;\n transform: ${({\n $isSelected,\n $shrinkUnselectedPages,\n $onlyChild,\n $fullWidthChild,\n }) =>\n $onlyChild || ($isSelected && $shrinkUnselectedPages) || $fullWidthChild\n ? \"scale(1)\"\n : \"scale(0.9)\"};\n`;\n\nexport const ButtonWrapper = styled.div`\n display: flex;\n justify-content: center;\n`;\n\nexport const VerticalAlign = styled.span`\n display: block;\n margin: auto;\n height: 2rem;\n line-height: 1.75rem;\n`;\n\nexport const CarouselButton = styled.button<{\n disabled: boolean;\n theme: ThemeType;\n}>`\n height: 100%;\n cursor: pointer;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n /* TODO if this makes it into the component library carouselButtonColor should be a theme prop */\n color: ${({ disabled, theme }) =>\n disabled\n ? theme.colors.disabled\n : theme.name === \"su2c\"\n ? theme.colors.textDark\n : theme.colors.primary};\n font-size: ${({ theme }) => theme.fontSizes.xxxl};\n font-weight: 600;\n transition:\n color 0.3s ease,\n transform 0.3s ease;\n max-width: 3rem;\n padding: 0;\n vertical-align: middle;\n user-select: none;\n\n transform: scale(0.8);\n &:hover {\n transform: ${({ disabled }) => (disabled ? \"scale(0.8)\" : \"scale(1)\")};\n }\n`;\n\nexport const DotContainer = styled.div<{ $count: number; theme: ThemeType }>`\n display: flex;\n flex-direction: row;\n justify-content: center;\n display: ${({ $count }) => ($count > 6 ? \"none\" : \"flex\")};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n display: ${({ $count }) => ($count > 10 ? \"none\" : \"flex\")};\n }\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: ${({ $count }) => ($count > 20 ? \"none\" : \"flex\")};\n }\n`;\n\nexport const Dot = styled.button<{ $selected: boolean; theme: ThemeType }>`\n border: none;\n outline-offset: ${({ theme }) => theme.spacing.xxs};\n padding: 0;\n margin: ${({ theme }) => `auto ${theme.spacing.xxs}`};\n width: ${({ theme }) => theme.fontSizes.l};\n height: ${({ theme }) => theme.fontSizes.l};\n border-radius: 50%;\n /* TODO if this makes it into the component library carouselButtonColor should be a theme prop */\n border: ${({ theme }) =>\n `solid 1px ${\n theme.name === \"su2c\" ? theme.colors.textDark : theme.colors.primary\n }`};\n background-color: ${({ theme, $selected }) =>\n $selected\n ? `${\n theme.name === \"su2c\" ? theme.colors.textDark : theme.colors.primary\n }`\n : theme.colors.backgroundLight};\n user-select: none;\n transition:\n background-color 0.3s ease,\n transform 0.3s ease;\n transform: scale(0.8);\n &:hover {\n transform: scale(1);\n }\n`;\n\n// TODO move to its own component\nexport const ScreenReaderOnly = styled.span`\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n margin-bottom: -1px;\n margin-right: -1px;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n"],"names":["CarouselWrapper","styled","div","CarouselScrollArea","ul","$smoothScrolling","CarouselCard","li","$onlyChild","$fullWidthChild","CarouselCardInner","$isSelected","$shrinkUnselectedPages","ButtonWrapper","VerticalAlign","span","CarouselButton","button","disabled","theme","colors","name","textDark","primary","fontSizes","xxxl","DotContainer","$count","breakpoint","tablet","desktop","Dot","spacing","xxs","l","$selected","backgroundLight","ScreenReaderOnly"],"mappings":"iCAIa,MAAAA,EAAkBC,EAAOC,GAAG;;;;EAM5BC,EAAqBF,EAAOG,EAEvC;;;;qBAImB,EAAGC,sBACpBA,EAAmB,SAAW;;;;;;;;EAUrBC,EAAeL,EAAOM,EAGjC;;;WAGS,EAAGC,aAAYC,qBACtBD,GAAcC,EAAkB,OAAS;EAGhCC,EAAoBT,EAAOC,GAKtC;;eAEa,EACXS,cACAC,yBACAJ,aACAC,qBAEAD,GAAeG,GAAeC,GAA2BH,EACrD,WACA;EAGKI,EAAgBZ,EAAOC,GAAG;;;EAK1BY,EAAgBb,EAAOc,IAAI;;;;;EAO3BC,EAAiBf,EAAOgB,MAGnC;;;;;;WAMS,EAAGC,WAAUC,WACpBD,EACIC,EAAMC,OAAOF,SACE,SAAfC,EAAME,KACJF,EAAMC,OAAOE,SACbH,EAAMC,OAAOG;eACR,EAAGJ,WAAYA,EAAMK,UAAUC;;;;;;;;;;;;iBAY7B,EAAGP,cAAgBA,EAAW,aAAe;;EAIjDQ,EAAezB,EAAOC,GAAyC;;;;aAI/D,EAAGyB,YAAcA,EAAS,EAAI,OAAS;;uBAE7B,EAAGR,WAAYA,EAAMS,WAAWC;eACxC,EAAGF,YAAcA,EAAS,GAAK,OAAS;;;uBAGhC,EAAGR,WAAYA,EAAMS,WAAWE;eACxC,EAAGH,YAAcA,EAAS,GAAK,OAAS;;EAI1CI,EAAM9B,EAAOgB,MAAgD;;oBAEtD,EAAGE,WAAYA,EAAMa,QAAQC;;YAErC,EAAGd,WAAY,QAAQA,EAAMa,QAAQC;WACtC,EAAGd,WAAYA,EAAMK,UAAUU;YAC9B,EAAGf,WAAYA,EAAMK,UAAUU;;;YAG/B,EAAGf,WACX,aACiB,SAAfA,EAAME,KAAkBF,EAAMC,OAAOE,SAAWH,EAAMC,OAAOG;sBAE7C,EAAGJ,QAAOgB,eAC5BA,EACI,GACiB,SAAfhB,EAAME,KAAkBF,EAAMC,OAAOE,SAAWH,EAAMC,OAAOG,UAE/DJ,EAAMC,OAAOgB;;;;;;;;;EAYRC,EAAmBpC,EAAOc,IAAI;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StoryObj } from "@storybook/react";
|
|
3
|
-
import CheckBox, { CheckBoxProps } from ".";
|
|
2
|
+
import { type StoryObj } from "@storybook/react";
|
|
3
|
+
import CheckBox, { type CheckBoxProps } from ".";
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
component:
|
|
6
|
+
component: (props: CheckBoxProps) => React.JSX.Element;
|
|
7
7
|
args: {
|
|
8
8
|
id: string;
|
|
9
9
|
disabled: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { type InputHTMLAttributes, type Ref, type ReactNode
|
|
1
|
+
import React, { type InputHTMLAttributes, type Ref, type ReactNode } from "react";
|
|
2
2
|
export type CheckBoxProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
3
|
-
ref?: Ref<HTMLInputElement
|
|
3
|
+
ref?: Ref<HTMLInputElement>;
|
|
4
4
|
/** flag for error styling */
|
|
5
5
|
hasError?: boolean;
|
|
6
6
|
/** error message text */
|
|
@@ -12,5 +12,5 @@ export type CheckBoxProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
|
12
12
|
*
|
|
13
13
|
* The value or children becomes the label, if you want an outer label for a checkbox or group of checkboxes please use a LegendWrapper component
|
|
14
14
|
*/
|
|
15
|
-
export declare const Checkbox:
|
|
15
|
+
export declare const Checkbox: (props: CheckBoxProps) => React.JSX.Element;
|
|
16
16
|
export default Checkbox;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{useTheme as r,ThemeProvider as o}from"styled-components";import{faCheck as t}from"../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";import{crukTheme as l}from"../../themes/cruk.js";import{ErrorText as s}from"../ErrorText/index.js";import{IconFa as i}from"../IconFa/index.js";import{StyledLabel as d,StyledInput as m,SelectedBorder as c,CheckWrapper as a,Check as n}from"./styles.js";const f=f=>{const u=r(),p={...l,...u},{children:E,hasError:h,errorMessage:x,ref:b,...k}=f;return e.createElement(o,{theme:p},e.createElement(d,{$hasError:h||!!x||!1,$checked:f.checked||f.defaultChecked||!1,$disabled:f.disabled||!1},e.createElement(m,{...k,disabled:f.disabled||!1,type:"checkbox",ref:b,"aria-describedby":f.id&&x?`${f.id}-error`:void 0}),e.createElement(c,null),E||f.value,p.utilities.useDefaultFromControls?null:e.createElement(a,null,e.createElement(n,null,e.createElement(i,{faIcon:t,color:"check",size:"1.25em"})))),!!x&&e.createElement(s,{marginTop:"xxs",id:f.id?`${f.id}-error`:void 0},x))};export{f as Checkbox,f as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, {\n type InputHTMLAttributes,\n type Ref,\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, {\n type InputHTMLAttributes,\n type Ref,\n type ReactNode,\n} from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\nimport { faCheck } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { ErrorText } from \"../ErrorText\";\nimport { IconFa } from \"../IconFa\";\n\nimport {\n StyledLabel,\n StyledInput,\n CheckWrapper,\n Check,\n SelectedBorder,\n} from \"./styles\";\n\nexport type CheckBoxProps = InputHTMLAttributes<HTMLInputElement> & {\n ref?: Ref<HTMLInputElement>;\n /** flag for error styling */\n hasError?: boolean;\n /** error message text */\n errorMessage?: string;\n children?: ReactNode;\n};\n\n/**\n * Checkboxes allow the user to select one or more items.\n *\n * The value or children becomes the label, if you want an outer label for a checkbox or group of checkboxes please use a LegendWrapper component\n */\nexport const Checkbox = (props: CheckBoxProps) => {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const { children, hasError, errorMessage, ref, ...rest } = props;\n\n return (\n <ThemeProvider theme={theme}>\n <StyledLabel\n $hasError={hasError || !!errorMessage || false}\n $checked={props.checked || props.defaultChecked || false}\n $disabled={props.disabled || false}\n >\n <StyledInput\n {...rest}\n disabled={props.disabled || false}\n type=\"checkbox\"\n ref={ref}\n aria-describedby={\n !!props.id && !!errorMessage ? `${props.id}-error` : undefined\n }\n />\n <SelectedBorder />\n {children || props.value}\n {theme.utilities.useDefaultFromControls ? null : (\n <CheckWrapper>\n <Check>\n <IconFa faIcon={faCheck} color=\"check\" size=\"1.25em\" />\n </Check>\n </CheckWrapper>\n )}\n </StyledLabel>\n {!!errorMessage && (\n <ErrorText\n marginTop=\"xxs\"\n id={props.id ? `${props.id}-error` : undefined}\n >\n {errorMessage}\n </ErrorText>\n )}\n </ThemeProvider>\n );\n};\n\nexport default Checkbox;\n"],"names":["Checkbox","props","foundTheme","useTheme","theme","defaultTheme","children","hasError","errorMessage","ref","rest","React","createElement","ThemeProvider","StyledLabel","$hasError","$checked","checked","defaultChecked","disabled","StyledInput","type","id","undefined","SelectedBorder","value","utilities","useDefaultFromControls","CheckWrapper","Check","IconFa","faIcon","faCheck","color","size","ErrorText","marginTop"],"mappings":"2aAkCa,MAAAA,EAAYC,IACvB,MAAMC,EAAaC,IACbC,EAAQ,IACTC,KACAH,IAGCI,SAAEA,EAAQC,SAAEA,EAAQC,aAAEA,EAAYC,IAAEA,KAAQC,GAAST,EAE3D,OACEU,EAACC,cAAAC,EAAc,CAAAT,MAAOA,GACpBO,EAACC,cAAAE,EACY,CAAAC,UAAAR,KAAcC,IAAgB,EAAKQ,SACpCf,EAAMgB,SAAWhB,EAAMiB,iBAAkB,YACxCjB,EAAMkB,WAAY,GAE7BR,EAAAC,cAACQ,EACK,IAAAV,EACJS,SAAUlB,EAAMkB,WAAY,EAC5BE,KAAK,WACLZ,IAAKA,EAAG,mBAEJR,EAAMqB,IAAQd,EAAe,GAAGP,EAAMqB,gBAAaC,IAGzDZ,EAAAC,cAACY,EAAiB,MACjBlB,GAAYL,EAAMwB,MAClBrB,EAAMsB,UAAUC,uBAAyB,KACxChB,gBAACiB,EAAY,KACXjB,EAAAC,cAACiB,EAAK,KACJlB,EAAAC,cAACkB,EAAO,CAAAC,OAAQC,EAASC,MAAM,QAAQC,KAAK,gBAKjD1B,GACDG,gBAACwB,EAAS,CACRC,UAAU,MACVd,GAAIrB,EAAMqB,GAAK,GAAGrB,EAAMqB,gBAAaC,GAEpCf,GAGS"}
|
|
@@ -1,2 +1,106 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o,{css as e}from"styled-components";const t="1.5rem",i=o.div`
|
|
2
|
+
display: inline-block;
|
|
3
|
+
height: ${t};
|
|
4
|
+
width: ${t};
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: calc(50% - (${t} / 2));
|
|
7
|
+
left: ${({theme:{spacing:{xs:o}}})=>o};
|
|
8
|
+
`,r=o.span`
|
|
9
|
+
display: block;
|
|
10
|
+
position: relative;
|
|
11
|
+
border: 2px solid ${({theme:o})=>o.colors.selectionBorder};
|
|
12
|
+
height: ${t};
|
|
13
|
+
width: ${t};
|
|
14
|
+
top: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
z-index: 5;
|
|
19
|
+
transition: border 0.25s ease;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
|
|
22
|
+
svg {
|
|
23
|
+
path {
|
|
24
|
+
transition: transform 0.25s ease;
|
|
25
|
+
transform: rotateY(90deg);
|
|
26
|
+
transform-origin: center;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`,s=o.label`
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
*,
|
|
32
|
+
*:after,
|
|
33
|
+
*:before {
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
}
|
|
36
|
+
line-height: ${({theme:o})=>o.typography.lineHeight};
|
|
37
|
+
font-size: ${({theme:o})=>o.typography.fontSizeBase};
|
|
38
|
+
font-family: ${({theme:o})=>o.typography.fontFamilyBase};
|
|
39
|
+
|
|
40
|
+
background-color: ${({theme:o})=>o.colors.backgroundLight};
|
|
41
|
+
position: relative;
|
|
42
|
+
|
|
43
|
+
cursor: ${({$disabled:o})=>o?"not-allowed":"pointer"};
|
|
44
|
+
display: block;
|
|
45
|
+
|
|
46
|
+
color: ${({theme:o,$disabled:e})=>e?o.colors.disabled:o.colors.textDark};
|
|
47
|
+
padding: ${({theme:o})=>`calc( (3em - ( ${o.utilities.inputBorderWidth} * 2) - ${o.typography.lineHeight} ) / 2) ${o.spacing.m} calc( (3em - ( ${o.utilities.inputBorderWidth} * 2) - ${o.typography.lineHeight} ) / 2) ${o.spacing.xl}`};
|
|
48
|
+
&:focus ~ ${i} ${r} {
|
|
49
|
+
outline: 2px solid #7aacfe; /* for non-webkit browsers */
|
|
50
|
+
outline: 5px auto -webkit-focus-ring-color;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
svg {
|
|
54
|
+
path {
|
|
55
|
+
fill: ${({theme:o,$disabled:e})=>e&&o.colors.disabled};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
${({theme:o,$disabled:t,$checked:s,$hasError:l})=>o.utilities.useDefaultFromControls?null:e`
|
|
60
|
+
min-height: 2rem;
|
|
61
|
+
|
|
62
|
+
${i} ${r} {
|
|
63
|
+
border: solid ${"2px"}
|
|
64
|
+
${t?o.colors.disabled:l?o.colors.danger:s?o.colors.check:o.colors.inputBorder};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:hover ${i} ${r} {
|
|
68
|
+
border: solid ${"2px"}
|
|
69
|
+
${t?o.colors.disabled:o.colours};
|
|
70
|
+
}
|
|
71
|
+
`}
|
|
72
|
+
`,l=o.div`
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: 0;
|
|
75
|
+
left: 0;
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 100%;
|
|
78
|
+
`,n=o.input`
|
|
79
|
+
margin-right: 5px !important;
|
|
80
|
+
|
|
81
|
+
${({theme:o})=>o.utilities.useDefaultFromControls?e`
|
|
82
|
+
position: absolute;
|
|
83
|
+
display: inline-block;
|
|
84
|
+
transform: translate(-50%, -50%);
|
|
85
|
+
top: 50%;
|
|
86
|
+
margin: 0;
|
|
87
|
+
padding: 0;
|
|
88
|
+
left: ${o.spacing.s};
|
|
89
|
+
`:e`
|
|
90
|
+
/* This hides the original input */
|
|
91
|
+
position: absolute;
|
|
92
|
+
left: ${o.spacing.xxs};
|
|
93
|
+
opacity: 0;
|
|
94
|
+
|
|
95
|
+
&:focus ~ ${l} {
|
|
96
|
+
outline: none !important;
|
|
97
|
+
box-shadow: inset 0 0 0 2px ${o.colors.inputBorder};
|
|
98
|
+
box-shadow: inset 0 0 0 2px -webkit-focus-ring-color;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:checked ~ ${i} svg path {
|
|
102
|
+
transform: rotateY(0deg);
|
|
103
|
+
}
|
|
104
|
+
`}
|
|
105
|
+
`;export{r as Check,i as CheckWrapper,l as SelectedBorder,n as StyledInput,s as StyledLabel};
|
|
2
106
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Checkbox/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\nconst CHECK_BOX_SIZE = \"1.5rem\";\nconst BUTTON_HEIGHT = \"3em\";\nconst BORDER_THICKNESS = \"2px\";\n\nexport const CheckWrapper = styled.div<{\n theme: ThemeType;\n}>`\n display: inline-block;\n height: ${CHECK_BOX_SIZE};\n width: ${CHECK_BOX_SIZE};\n position: absolute;\n top: calc(50% - (${CHECK_BOX_SIZE} / 2));\n left: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n`;\n\nexport const Check = styled.span<{\n theme: ThemeType;\n}>`\n display: block;\n position: relative;\n border: 2px solid ${({ theme }) => theme.colors.selectionBorder};\n height: ${CHECK_BOX_SIZE};\n width: ${CHECK_BOX_SIZE};\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 5;\n transition: border 0.25s ease;\n overflow: hidden;\n\n svg {\n path {\n transition: transform 0.25s ease;\n transform: rotateY(90deg);\n transform-origin: center;\n }\n }\n`;\n\nexport const StyledLabel = styled.label<{\n $checked: boolean;\n $disabled: boolean;\n $hasError: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n *,\n *:after,\n *:before {\n box-sizing: border-box;\n }\n line-height: ${({ theme }) => theme.typography.lineHeight};\n font-size: ${({ theme }) => theme.typography.fontSizeBase};\n font-family: ${({ theme }) => theme.typography.fontFamilyBase};\n\n background-color: ${({ theme }) => theme.colors.backgroundLight};\n position: relative;\n\n cursor: ${({ $disabled }) => ($disabled ? \"not-allowed\" : \"pointer\")};\n display: block;\n\n color: ${({ theme, $disabled }) =>\n $disabled ? theme.colors.disabled : theme.colors.textDark};\n padding: ${({ theme }) =>\n `calc( (${BUTTON_HEIGHT} - ( ${theme.utilities.inputBorderWidth} * 2) - ${theme.typography.lineHeight} ) / 2) ${theme.spacing.m} calc( (${BUTTON_HEIGHT} - ( ${theme.utilities.inputBorderWidth} * 2) - ${theme.typography.lineHeight} ) / 2) ${theme.spacing.xl}`};\n &:focus ~ ${CheckWrapper} ${Check} {\n outline: 2px solid #7aacfe; /* for non-webkit browsers */\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n svg {\n path {\n fill: ${({ theme, $disabled }) => $disabled && theme.colors.disabled};\n }\n }\n\n ${({ theme, $disabled, $checked, $hasError }) =>\n theme.utilities.useDefaultFromControls\n ? null\n : css`\n min-height: 2rem;\n\n ${CheckWrapper} ${Check} {\n border: solid ${BORDER_THICKNESS}\n ${$disabled\n ? theme.colors.disabled\n : $hasError\n ? theme.colors.danger\n : $checked\n ? theme.colors.check\n : theme.colors.inputBorder};\n }\n\n &:hover ${CheckWrapper} ${Check} {\n border: solid ${BORDER_THICKNESS}\n ${$disabled ? theme.colors.disabled : theme.colours};\n }\n `}\n`;\n\nexport const SelectedBorder = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n`;\n\n// TODO when we get rid of bootstrap remove !important.\nexport const StyledInput = styled.input<{\n theme: ThemeType;\n}>`\n margin-right: 5px !important;\n\n ${({ theme }) =>\n theme.utilities.useDefaultFromControls\n ? css`\n position: absolute;\n display: inline-block;\n transform: translate(-50%, -50%);\n top: 50%;\n margin: 0;\n padding: 0;\n left: ${theme.spacing.s};\n `\n : css`\n /* This hides the original input */\n position: absolute;\n left: ${theme.spacing.xxs};\n opacity: 0;\n\n &:focus ~ ${SelectedBorder} {\n outline: none !important;\n box-shadow: inset 0 0 0 2px ${theme.colors.inputBorder};\n box-shadow: inset 0 0 0 2px -webkit-focus-ring-color;\n }\n\n &:checked ~ ${CheckWrapper} svg path {\n transform: rotateY(0deg);\n }\n `}\n`;\n"],"names":["CHECK_BOX_SIZE","CheckWrapper","styled","div","
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Checkbox/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\nconst CHECK_BOX_SIZE = \"1.5rem\";\nconst BUTTON_HEIGHT = \"3em\";\nconst BORDER_THICKNESS = \"2px\";\n\nexport const CheckWrapper = styled.div<{\n theme: ThemeType;\n}>`\n display: inline-block;\n height: ${CHECK_BOX_SIZE};\n width: ${CHECK_BOX_SIZE};\n position: absolute;\n top: calc(50% - (${CHECK_BOX_SIZE} / 2));\n left: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n`;\n\nexport const Check = styled.span<{\n theme: ThemeType;\n}>`\n display: block;\n position: relative;\n border: 2px solid ${({ theme }) => theme.colors.selectionBorder};\n height: ${CHECK_BOX_SIZE};\n width: ${CHECK_BOX_SIZE};\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 5;\n transition: border 0.25s ease;\n overflow: hidden;\n\n svg {\n path {\n transition: transform 0.25s ease;\n transform: rotateY(90deg);\n transform-origin: center;\n }\n }\n`;\n\nexport const StyledLabel = styled.label<{\n $checked: boolean;\n $disabled: boolean;\n $hasError: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n *,\n *:after,\n *:before {\n box-sizing: border-box;\n }\n line-height: ${({ theme }) => theme.typography.lineHeight};\n font-size: ${({ theme }) => theme.typography.fontSizeBase};\n font-family: ${({ theme }) => theme.typography.fontFamilyBase};\n\n background-color: ${({ theme }) => theme.colors.backgroundLight};\n position: relative;\n\n cursor: ${({ $disabled }) => ($disabled ? \"not-allowed\" : \"pointer\")};\n display: block;\n\n color: ${({ theme, $disabled }) =>\n $disabled ? theme.colors.disabled : theme.colors.textDark};\n padding: ${({ theme }) =>\n `calc( (${BUTTON_HEIGHT} - ( ${theme.utilities.inputBorderWidth} * 2) - ${theme.typography.lineHeight} ) / 2) ${theme.spacing.m} calc( (${BUTTON_HEIGHT} - ( ${theme.utilities.inputBorderWidth} * 2) - ${theme.typography.lineHeight} ) / 2) ${theme.spacing.xl}`};\n &:focus ~ ${CheckWrapper} ${Check} {\n outline: 2px solid #7aacfe; /* for non-webkit browsers */\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n svg {\n path {\n fill: ${({ theme, $disabled }) => $disabled && theme.colors.disabled};\n }\n }\n\n ${({ theme, $disabled, $checked, $hasError }) =>\n theme.utilities.useDefaultFromControls\n ? null\n : css`\n min-height: 2rem;\n\n ${CheckWrapper} ${Check} {\n border: solid ${BORDER_THICKNESS}\n ${$disabled\n ? theme.colors.disabled\n : $hasError\n ? theme.colors.danger\n : $checked\n ? theme.colors.check\n : theme.colors.inputBorder};\n }\n\n &:hover ${CheckWrapper} ${Check} {\n border: solid ${BORDER_THICKNESS}\n ${$disabled ? theme.colors.disabled : theme.colours};\n }\n `}\n`;\n\nexport const SelectedBorder = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n`;\n\n// TODO when we get rid of bootstrap remove !important.\nexport const StyledInput = styled.input<{\n theme: ThemeType;\n}>`\n margin-right: 5px !important;\n\n ${({ theme }) =>\n theme.utilities.useDefaultFromControls\n ? css`\n position: absolute;\n display: inline-block;\n transform: translate(-50%, -50%);\n top: 50%;\n margin: 0;\n padding: 0;\n left: ${theme.spacing.s};\n `\n : css`\n /* This hides the original input */\n position: absolute;\n left: ${theme.spacing.xxs};\n opacity: 0;\n\n &:focus ~ ${SelectedBorder} {\n outline: none !important;\n box-shadow: inset 0 0 0 2px ${theme.colors.inputBorder};\n box-shadow: inset 0 0 0 2px -webkit-focus-ring-color;\n }\n\n &:checked ~ ${CheckWrapper} svg path {\n transform: rotateY(0deg);\n }\n `}\n`;\n"],"names":["CHECK_BOX_SIZE","CheckWrapper","styled","div","theme","spacing","xs","Check","span","colors","selectionBorder","StyledLabel","label","typography","lineHeight","fontSizeBase","fontFamilyBase","backgroundLight","$disabled","disabled","textDark","utilities","inputBorderWidth","m","xl","$checked","$hasError","useDefaultFromControls","css","danger","check","inputBorder","colours","SelectedBorder","StyledInput","input","s","xxs"],"mappings":"2CAGA,MAAMA,EAAiB,SAIVC,EAAeC,EAAOC,GAEjC;;YAEUH;WACDA;;qBAEUA;UACX,EACNI,OACEC,SAAWC,UAETA;EAGKC,EAAQL,EAAOM,IAE1B;;;sBAGoB,EAAGJ,WAAYA,EAAMK,OAAOC;YACtCV;WACDA;;;;;;;;;;;;;;;;EAkBEW,EAAcT,EAAOU,KAKhC;;;;;;;iBAOe,EAAGR,WAAYA,EAAMS,WAAWC;eAClC,EAAGV,WAAYA,EAAMS,WAAWE;iBAC9B,EAAGX,WAAYA,EAAMS,WAAWG;;sBAE3B,EAAGZ,WAAYA,EAAMK,OAAOQ;;;YAGtC,EAAGC,eAAiBA,EAAY,cAAgB;;;WAGjD,EAAGd,QAAOc,eACjBA,EAAYd,EAAMK,OAAOU,SAAWf,EAAMK,OAAOW;aACxC,EAAGhB,WACZ,kBAA+BA,EAAMiB,UAAUC,2BAA2BlB,EAAMS,WAAWC,qBAAqBV,EAAMC,QAAQkB,oBAAiCnB,EAAMiB,UAAUC,2BAA2BlB,EAAMS,WAAWC,qBAAqBV,EAAMC,QAAQmB;cACpPvB,KAAgBM;;;;;;;cAOhB,EAAGH,QAAOc,eAAgBA,GAAad,EAAMK,OAAOU;;;;IAI9D,EAAGf,QAAOc,YAAWO,WAAUC,eAC/BtB,EAAMiB,UAAUM,uBACZ,KACAC,CAAG;;;YAGC3B,KAAgBM;4BArFH;gBAuFTW,EACEd,EAAMK,OAAOU,SACbO,EACEtB,EAAMK,OAAOoB,OACbJ,EACErB,EAAMK,OAAOqB,MACb1B,EAAMK,OAAOsB;;;oBAGf9B,KAAgBM;4BAhGX;gBAkGTW,EAAYd,EAAMK,OAAOU,SAAWf,EAAM4B;;;EAK7CC,EAAiB/B,EAAOC,GAAG;;;;;;EAS3B+B,EAAchC,EAAOiC,KAEhC;;;IAGE,EAAG/B,WACHA,EAAMiB,UAAUM,uBACZC,CAAG;;;;;;;kBAOOxB,EAAMC,QAAQ+B;UAExBR,CAAG;;;kBAGOxB,EAAMC,QAAQgC;;;sBAGVJ;;0CAEoB7B,EAAMK,OAAOsB;;;;wBAI/B9B;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{useState as t,useRef as r,useEffect as n}from"react";import{useTheme as a}from"styled-components";import{faChevronDown as o}from"../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";import{crukTheme as i}from"../../themes/cruk.js";import{IconFa as l}from"../IconFa/index.js";import{CustomHeader as d,DefaultHeader as c,FlippingIcon as m,CollapseContent as s,transitionDurationSeconds as p}from"./styles.js";function h({id:h,headerTitleText:u,headerTitleTextColor:x,headerTitleTextSize:f,headerTitleTextFontFamily:$,headerComponent:y,startOpen:T,onOpenChange:b,children:E}){const[k,C]=t(T||!1),[g,F]=t(T?"initial":"0"),j=r(null),v=r(null),S=a(),I={...i,...S},w=()=>{const{current:e}=j;v?.current&&clearTimeout(v?.current);const t=!k;C(t),null!==e&&F(`${e.scrollHeight}px`),!1===t?setTimeout((()=>F("0")),10):v.current=setTimeout((()=>F("initial")),1e3*p),void 0!==b&&b(t)};return n((()=>{C(T||!1),F(T?"initial":"0")}),[T]),e.createElement("div",{id:h},y?e.createElement(d,{theme:I,"aria-controls":`${h}-header`,"aria-expanded":k,id:`${h}-header`,onClick:w,"aria-disabled":!1,"aria-label":u,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),w())},role:"button",tabIndex:0},y):e.createElement(c,{"aria-controls":`${h}-header`,"aria-expanded":k,id:`${h}-header`,onClick:w,theme:I,type:"button",appearance:"tertiary",$textColor:x,$textSize:f,$textFontFamily:$},u,e.createElement(m,{$open:k},e.createElement(l,{faIcon:o}))),e.createElement(s,{theme:I,id:`${h}-content`,ref:j,role:"region","aria-hidden":!k,"aria-labelledby":`${h}-header`,$contentHeight:g,$openStatus:k},E))}export{h as Collapse,h as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Collapse/index.tsx"],"sourcesContent":["import React, {\n useState,\n useRef,\n type KeyboardEvent,\n type ReactNode,\n useEffect,\n type HTMLAttributes,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { faChevronDown } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { IconFa } from \"../IconFa\";\n\nimport { type FontSizeType, type ThemeType } from \"../../types\";\nimport {\n CustomHeader,\n DefaultHeader,\n FlippingIcon,\n CollapseContent,\n transitionDurationSeconds,\n} from \"./styles\";\n\nexport type CollapseProps = HTMLAttributes<HTMLElement> & {\n /** id is required for a11y reasons as we use aria attributes which depends on an id */\n id: string;\n /** text of collapse header, even if there is a custom header component this prop is still used for aria attributes */\n headerTitleText: string;\n /** collapse header text colour */\n headerTitleTextColor?: string;\n /** collapse header text size */\n headerTitleTextSize?: FontSizeType;\n /** collapse header font family */\n headerTitleTextFontFamily?: string;\n /** custom collapse header component */\n headerComponent?: ReactNode;\n /** flag to indicate */\n startOpen?: boolean;\n /** callback function that is passed isOpen flag */\n onOpenChange?: (isOpen: boolean) => void;\n /** children */\n children?: ReactNode;\n};\n\n/**\n *\n * Use a collapse component to show and hide content. It has a default view; however, it can be overwritten by passing a custom component as a prop.\n *\n */\nexport function Collapse({\n id,\n headerTitleText,\n headerTitleTextColor,\n headerTitleTextSize,\n headerTitleTextFontFamily,\n headerComponent,\n startOpen,\n onOpenChange,\n children,\n}: CollapseProps) {\n const [openStatus, setOpenStatus] = useState(startOpen || false);\n const [contentHeight, setContentHeight] = useState(\n startOpen ? \"initial\" : \"0\",\n );\n const content = useRef<HTMLDivElement>(null);\n const transitionTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const foundTheme = useTheme();\n const theme: ThemeType = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const toggleCollapse = () => {\n const { current } = content;\n if (transitionTimer?.current) clearTimeout(transitionTimer?.current);\n const newOpenState = !openStatus;\n setOpenStatus(newOpenState);\n\n if (current !== null) {\n setContentHeight(`${current.scrollHeight}px`);\n }\n\n if (newOpenState === false) {\n // Allow height to be rendered before setting to 0 for animation.\n setTimeout(() => setContentHeight(\"0\"), 10);\n } else {\n transitionTimer.current = setTimeout(\n () => setContentHeight(\"initial\"),\n transitionDurationSeconds * 1000,\n );\n }\n if (onOpenChange !== undefined) {\n onOpenChange(newOpenState);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === \"Enter\" ||\n event.key === \" \" ||\n event.key === \"Spacebar\"\n ) {\n event.preventDefault();\n toggleCollapse();\n }\n };\n\n useEffect(() => {\n setOpenStatus(startOpen || false);\n // if start open changes then we want to set the height without animation\n startOpen
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Collapse/index.tsx"],"sourcesContent":["import React, {\n useState,\n useRef,\n type KeyboardEvent,\n type ReactNode,\n useEffect,\n type HTMLAttributes,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { faChevronDown } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { IconFa } from \"../IconFa\";\n\nimport { type FontSizeType, type ThemeType } from \"../../types\";\nimport {\n CustomHeader,\n DefaultHeader,\n FlippingIcon,\n CollapseContent,\n transitionDurationSeconds,\n} from \"./styles\";\n\nexport type CollapseProps = HTMLAttributes<HTMLElement> & {\n /** id is required for a11y reasons as we use aria attributes which depends on an id */\n id: string;\n /** text of collapse header, even if there is a custom header component this prop is still used for aria attributes */\n headerTitleText: string;\n /** collapse header text colour */\n headerTitleTextColor?: string;\n /** collapse header text size */\n headerTitleTextSize?: FontSizeType;\n /** collapse header font family */\n headerTitleTextFontFamily?: string;\n /** custom collapse header component */\n headerComponent?: ReactNode;\n /** flag to indicate */\n startOpen?: boolean;\n /** callback function that is passed isOpen flag */\n onOpenChange?: (isOpen: boolean) => void;\n /** children */\n children?: ReactNode;\n};\n\n/**\n *\n * Use a collapse component to show and hide content. It has a default view; however, it can be overwritten by passing a custom component as a prop.\n *\n */\nexport function Collapse({\n id,\n headerTitleText,\n headerTitleTextColor,\n headerTitleTextSize,\n headerTitleTextFontFamily,\n headerComponent,\n startOpen,\n onOpenChange,\n children,\n}: CollapseProps) {\n const [openStatus, setOpenStatus] = useState(startOpen || false);\n const [contentHeight, setContentHeight] = useState(\n startOpen ? \"initial\" : \"0\",\n );\n const content = useRef<HTMLDivElement>(null);\n const transitionTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const foundTheme = useTheme();\n const theme: ThemeType = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const toggleCollapse = () => {\n const { current } = content;\n if (transitionTimer?.current) clearTimeout(transitionTimer?.current);\n const newOpenState = !openStatus;\n setOpenStatus(newOpenState);\n\n if (current !== null) {\n setContentHeight(`${current.scrollHeight}px`);\n }\n\n if (newOpenState === false) {\n // Allow height to be rendered before setting to 0 for animation.\n setTimeout(() => setContentHeight(\"0\"), 10);\n } else {\n transitionTimer.current = setTimeout(\n () => setContentHeight(\"initial\"),\n transitionDurationSeconds * 1000,\n );\n }\n if (onOpenChange !== undefined) {\n onOpenChange(newOpenState);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === \"Enter\" ||\n event.key === \" \" ||\n event.key === \"Spacebar\"\n ) {\n event.preventDefault();\n toggleCollapse();\n }\n };\n\n useEffect(() => {\n setOpenStatus(startOpen || false);\n // if start open changes then we want to set the height without animation\n if (startOpen) {\n setContentHeight(\"initial\");\n } else {\n setContentHeight(\"0\");\n }\n }, [startOpen]);\n\n return (\n <div id={id}>\n {headerComponent ? (\n <CustomHeader\n theme={theme}\n aria-controls={`${id}-header`}\n aria-expanded={openStatus}\n id={`${id}-header`}\n onClick={toggleCollapse}\n aria-disabled={false}\n aria-label={headerTitleText}\n onKeyDown={handleKeyDown}\n role=\"button\"\n tabIndex={0}\n >\n {headerComponent}\n </CustomHeader>\n ) : (\n <DefaultHeader\n aria-controls={`${id}-header`}\n aria-expanded={openStatus}\n id={`${id}-header`}\n onClick={toggleCollapse}\n theme={theme}\n type=\"button\"\n appearance=\"tertiary\"\n $textColor={headerTitleTextColor}\n $textSize={headerTitleTextSize}\n $textFontFamily={headerTitleTextFontFamily}\n >\n {headerTitleText}\n <FlippingIcon $open={openStatus}>\n <IconFa faIcon={faChevronDown} />\n </FlippingIcon>\n </DefaultHeader>\n )}\n <CollapseContent\n theme={theme}\n id={`${id}-content`}\n ref={content}\n role=\"region\"\n aria-hidden={!openStatus}\n aria-labelledby={`${id}-header`}\n $contentHeight={contentHeight}\n $openStatus={openStatus}\n >\n {children}\n </CollapseContent>\n </div>\n );\n}\n\nexport default Collapse;\n"],"names":["Collapse","id","headerTitleText","headerTitleTextColor","headerTitleTextSize","headerTitleTextFontFamily","headerComponent","startOpen","onOpenChange","children","openStatus","setOpenStatus","useState","contentHeight","setContentHeight","content","useRef","transitionTimer","foundTheme","useTheme","theme","defaultTheme","toggleCollapse","current","clearTimeout","newOpenState","scrollHeight","setTimeout","transitionDurationSeconds","undefined","useEffect","React","createElement","CustomHeader","onClick","onKeyDown","event","key","preventDefault","role","tabIndex","DefaultHeader","type","appearance","$textColor","$textSize","FlippingIcon","IconFa","faIcon","faChevronDown","CollapseContent","ref","$contentHeight","$openStatus"],"mappings":"8aAiDM,SAAUA,GAASC,GACvBA,EAAEC,gBACFA,EAAeC,qBACfA,EAAoBC,oBACpBA,EAAmBC,0BACnBA,EAAyBC,gBACzBA,EAAeC,UACfA,EAASC,aACTA,EAAYC,SACZA,IAEA,MAAOC,EAAYC,GAAiBC,EAASL,IAAa,IACnDM,EAAeC,GAAoBF,EACxCL,EAAY,UAAY,KAEpBQ,EAAUC,EAAuB,MACjCC,EAAkBD,EAA6C,MAC/DE,EAAaC,IACbC,EAAmB,IACpBC,KACAH,GAGCI,EAAiB,KACrB,MAAMC,QAAEA,GAAYR,EAChBE,GAAiBM,SAASC,aAAaP,GAAiBM,SAC5D,MAAME,GAAgBf,EACtBC,EAAcc,GAEE,OAAZF,GACFT,EAAiB,GAAGS,EAAQG,mBAGT,IAAjBD,EAEFE,YAAW,IAAMb,EAAiB,MAAM,IAExCG,EAAgBM,QAAUI,YACxB,IAAMb,EAAiB,YACK,IAA5Bc,QAGiBC,IAAjBrB,GACFA,EAAaiB,IAyBjB,OAVAK,GAAU,KACRnB,EAAcJ,IAAa,GAGzBO,EADEP,EACe,UAEA,OAElB,CAACA,IAGFwB,EAAAC,cAAA,MAAA,CAAK/B,GAAIA,GACNK,EACCyB,EAACC,cAAAC,GACCb,MAAOA,EAAK,gBACG,GAAGnB,2BACHS,EACfT,GAAI,GAAGA,WACPiC,QAASZ,EACM,iBAAA,eACHpB,EACZiC,UAhCeC,IAEL,UAAdA,EAAMC,KACQ,MAAdD,EAAMC,KACQ,aAAdD,EAAMC,MAEND,EAAME,iBACNhB,MA0BIiB,KAAK,SACLC,SAAU,GAETlC,GAGHyB,gBAACU,EAAa,CAAA,gBACG,GAAGxC,WACH,gBAAAS,EACfT,GAAI,GAAGA,WACPiC,QAASZ,EACTF,MAAOA,EACPsB,KAAK,SACLC,WAAW,WAAUC,WACTzC,EACD0C,UAAAzC,kBACMC,GAEhBH,EACD6B,EAACC,cAAAc,SAAoBpC,GACnBqB,EAACC,cAAAe,GAAOC,OAAQC,MAItBlB,EAAAC,cAACkB,EAAe,CACd9B,MAAOA,EACPnB,GAAI,GAAGA,YACPkD,IAAKpC,EACLwB,KAAK,wBACS7B,EACG,kBAAA,GAAGT,WAAWmD,eACfvC,EAAawC,YAChB3C,GAEZD,GAIT"}
|
|
@@ -3,14 +3,22 @@ export declare const transitionDurationSeconds = 0.5;
|
|
|
3
3
|
export declare const FlippingIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
4
4
|
$open: boolean;
|
|
5
5
|
}>> & string;
|
|
6
|
-
export declare const DefaultHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<
|
|
7
|
-
|
|
6
|
+
export declare const DefaultHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").ButtonHTMLAttributes<HTMLElement> & {
|
|
7
|
+
appearance?: import("../../types").ButtonAppearanceType;
|
|
8
|
+
full?: boolean;
|
|
9
|
+
href?: string;
|
|
10
|
+
size?: "m" | "l";
|
|
11
|
+
css?: unknown;
|
|
12
|
+
as?: import("react").ElementType;
|
|
13
|
+
isIconButton?: boolean;
|
|
14
|
+
ref?: import("react").Ref<HTMLElement>;
|
|
15
|
+
children?: import("react").ReactNode;
|
|
8
16
|
}, {
|
|
9
17
|
theme: ThemeType;
|
|
10
18
|
$textColor?: string;
|
|
11
19
|
$textSize?: FontSizeType;
|
|
12
20
|
$textFontFamily?: string;
|
|
13
|
-
}>> & string & Omit<
|
|
21
|
+
}>> & string & Omit<(props: import("../Button").ButtonProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
14
22
|
export declare const CollapseContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
15
23
|
$contentHeight: string;
|
|
16
24
|
$openStatus: boolean;
|
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"styled-components";import{Button as t}from"../Button/index.js";const e=.5,i=o.span`
|
|
2
|
+
display: inline-block;
|
|
3
|
+
transform: ${({$open:o})=>o?"translateY(0.1em) scaleY(-1)":"initial"};
|
|
4
|
+
transition-duration: ${.5}s;
|
|
5
|
+
`,n=o(t)`
|
|
6
|
+
display: flex;
|
|
7
|
+
color: ${({theme:o,$textColor:t})=>t&&void 0!==o.colors[t]?o.colors[t]:t||o.colors.collapseHeaderColor};
|
|
8
|
+
font-size: ${({theme:{fontSizes:o,fontSizes:{m:t}},$textSize:e})=>e?o[e]:t};
|
|
9
|
+
font-family: ${({theme:o,$textFontFamily:t})=>t||o.typography.fontFamilyBase};
|
|
10
|
+
font-weight: normal;
|
|
11
|
+
margin-bottom: 0;
|
|
12
|
+
height: initial;
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
text-align: left;
|
|
15
|
+
border-radius: 0;
|
|
16
|
+
&:hover,
|
|
17
|
+
&:focus {
|
|
18
|
+
color: ${({theme:{colors:o},$textColor:t})=>t&&void 0!==o[t]?o[t]:t||o.collapseHeaderColor};
|
|
19
|
+
}
|
|
20
|
+
`,r=o.div`
|
|
21
|
+
margin: 0;
|
|
22
|
+
transition: ${.5}s ease;
|
|
23
|
+
height: ${({$contentHeight:o})=>o};
|
|
24
|
+
visibility: ${({$openStatus:o})=>o?"visible":"hidden"};
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
& > p {
|
|
27
|
+
margin-top: 0;
|
|
28
|
+
}
|
|
29
|
+
`,l=o.div`
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
`;export{r as CollapseContent,l as CustomHeader,n as DefaultHeader,i as FlippingIcon,e as transitionDurationSeconds};
|
|
2
32
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Collapse/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport {\n type FontSizeType,\n type ThemeType,\n type ColorKeyType,\n} from \"../../types\";\nimport Button from \"../Button\";\n\nexport const transitionDurationSeconds = 0.5;\n\nexport const FlippingIcon = styled.span<{ $open: boolean }>`\n display: inline-block;\n transform: ${({ $open }) =>\n $open ? \"translateY(0.1em) scaleY(-1)\" : \"initial\"};\n transition-duration: ${transitionDurationSeconds}s;\n`;\n\nexport const DefaultHeader = styled(Button)<{\n theme: ThemeType;\n $textColor?: string;\n $textSize?: FontSizeType;\n $textFontFamily?: string;\n}>`\n display: flex;\n color: ${({ theme, $textColor }) =>\n !!$textColor &&\n typeof theme.colors[$textColor as ColorKeyType] !== \"undefined\"\n ? theme.colors[$textColor as ColorKeyType]\n : $textColor || theme.colors.collapseHeaderColor};\n font-size: ${({\n theme: {\n fontSizes,\n fontSizes: { m },\n },\n $textSize,\n }) => ($textSize ? fontSizes[$textSize] : m)};\n font-family: ${({ theme, $textFontFamily }) =>\n $textFontFamily || theme.typography.fontFamilyBase};\n font-weight: normal;\n margin-bottom: 0;\n height: initial;\n text-decoration: none;\n text-align: left;\n border-radius: 0;\n &:hover,\n &:focus {\n color: ${({ theme: { colors }, $textColor }) =>\n $textColor && typeof colors[$textColor as ColorKeyType] !== \"undefined\"\n ? colors[$textColor as ColorKeyType]\n : $textColor || colors.collapseHeaderColor};\n }\n`;\n\nexport const CollapseContent = styled.div<{\n $contentHeight: string;\n $openStatus: boolean;\n}>`\n margin: 0;\n transition: ${transitionDurationSeconds}s ease;\n height: ${({ $contentHeight }: { $contentHeight: string }) => $contentHeight};\n visibility: ${({ $openStatus }: { $openStatus: boolean }) =>\n $openStatus ? \"visible\" : \"hidden\"};\n overflow: hidden;\n & > p {\n margin-top: 0;\n }\n`;\n\nexport const CustomHeader = styled.div`\n cursor: pointer;\n`;\n"],"names":["transitionDurationSeconds","FlippingIcon","styled","span","
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Collapse/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport {\n type FontSizeType,\n type ThemeType,\n type ColorKeyType,\n} from \"../../types\";\nimport Button from \"../Button\";\n\nexport const transitionDurationSeconds = 0.5;\n\nexport const FlippingIcon = styled.span<{ $open: boolean }>`\n display: inline-block;\n transform: ${({ $open }) =>\n $open ? \"translateY(0.1em) scaleY(-1)\" : \"initial\"};\n transition-duration: ${transitionDurationSeconds}s;\n`;\n\nexport const DefaultHeader = styled(Button)<{\n theme: ThemeType;\n $textColor?: string;\n $textSize?: FontSizeType;\n $textFontFamily?: string;\n}>`\n display: flex;\n color: ${({ theme, $textColor }) =>\n !!$textColor &&\n typeof theme.colors[$textColor as ColorKeyType] !== \"undefined\"\n ? theme.colors[$textColor as ColorKeyType]\n : $textColor || theme.colors.collapseHeaderColor};\n font-size: ${({\n theme: {\n fontSizes,\n fontSizes: { m },\n },\n $textSize,\n }) => ($textSize ? fontSizes[$textSize] : m)};\n font-family: ${({ theme, $textFontFamily }) =>\n $textFontFamily || theme.typography.fontFamilyBase};\n font-weight: normal;\n margin-bottom: 0;\n height: initial;\n text-decoration: none;\n text-align: left;\n border-radius: 0;\n &:hover,\n &:focus {\n color: ${({ theme: { colors }, $textColor }) =>\n $textColor && typeof colors[$textColor as ColorKeyType] !== \"undefined\"\n ? colors[$textColor as ColorKeyType]\n : $textColor || colors.collapseHeaderColor};\n }\n`;\n\nexport const CollapseContent = styled.div<{\n $contentHeight: string;\n $openStatus: boolean;\n}>`\n margin: 0;\n transition: ${transitionDurationSeconds}s ease;\n height: ${({ $contentHeight }: { $contentHeight: string }) => $contentHeight};\n visibility: ${({ $openStatus }: { $openStatus: boolean }) =>\n $openStatus ? \"visible\" : \"hidden\"};\n overflow: hidden;\n & > p {\n margin-top: 0;\n }\n`;\n\nexport const CustomHeader = styled.div`\n cursor: pointer;\n`;\n"],"names":["transitionDurationSeconds","FlippingIcon","styled","span","$open","DefaultHeader","Button","theme","$textColor","colors","collapseHeaderColor","fontSizes","m","$textSize","$textFontFamily","typography","fontFamilyBase","CollapseContent","div","$contentHeight","$openStatus","CustomHeader"],"mappings":"6EASO,MAAMA,EAA4B,GAE5BC,EAAeC,EAAOC,IAAwB;;eAE5C,EAAGC,WACdA,EAAQ,+BAAiC;yBALJ;EAS5BC,EAAgBH,EAAOI,EAKlC;;WAES,EAAGC,QAAOC,gBACfA,QACkD,IAA7CD,EAAME,OAAOD,GAChBD,EAAME,OAAOD,GACbA,GAAcD,EAAME,OAAOC;eACpB,EACXH,OACEI,YACAA,WAAaC,MAEfC,eACKA,EAAYF,EAAUE,GAAaD;iBAC3B,EAAGL,QAAOO,qBACvBA,GAAmBP,EAAMQ,WAAWC;;;;;;;;;aAS3B,EAAGT,OAASE,UAAUD,gBAC7BA,QAA4D,IAAvCC,EAAOD,GACxBC,EAAOD,GACPA,GAAcC,EAAOC;;EAIlBO,EAAkBf,EAAOgB,GAGpC;;gBAhDuC;YAmD7B,EAAGC,oBAAiDA;gBAChD,EAAGC,iBACfA,EAAc,UAAY;;;;;EAOjBC,EAAenB,EAAOgB,GAAG;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{useTheme as t}from"styled-components";import{ErrorText as r}from"../ErrorText/index.js";import{Text as a}from"../Text/index.js";import{TextField as n}from"../TextField/index.js";import{Fieldset as o,DateTextFieldWrapper as l,LargeDateTextFieldWrapper as
|
|
1
|
+
import e from"react";import{useTheme as t}from"styled-components";import{ErrorText as r}from"../ErrorText/index.js";import{Text as a}from"../Text/index.js";import{TextField as n}from"../TextField/index.js";import{Fieldset as o,DateTextFieldWrapper as l,LargeDateTextFieldWrapper as m,ErrorTextWrapper as i}from"./styles.js";function d({label:d,hintText:u,day:s,month:p,year:y,dayName:h="day",monthName:c="month",yearName:x="year",dayHasError:E,monthHasError:g,yearHasError:b,errorMessage:f,onChange:q=()=>{},onBlur:F=()=>{},onFocus:L=()=>{},disabled:C,required:B}){const M=t();return e.createElement(o,null,e.createElement(a,{as:"legend",textWeight:M.typography.fontWeightLabels||700,marginBottom:"xxs",textFontFamily:M.typography.fontFamilyLabel},d,!!B&&e.createElement("span",{style:{fontWeight:M.typography.fontWeightBase}}," (required)")),u&&e.createElement(a,null,u),e.createElement(l,null,e.createElement(n,{label:"Day",type:"text",name:h,required:!!B,hideRequiredInLabel:!0,maxLength:2,autoComplete:"bday-day",pattern:"[0-9]*",inputMode:"numeric",value:s,onChange:q,onBlur:F,onFocus:L,hasError:E,disabled:C})),e.createElement(l,null,e.createElement(n,{label:"Month",type:"text",name:c,required:!!B,hideRequiredInLabel:!0,maxLength:2,autoComplete:"bday-month",pattern:"[0-9]*",inputMode:"numeric",value:p,onChange:q,onBlur:F,onFocus:L,hasError:g,disabled:C})),e.createElement(m,null,e.createElement(n,{label:"Year",type:"text",name:x,required:!!B,hideRequiredInLabel:!0,maxLength:4,autoComplete:"bday-year",pattern:"[0-9]*",inputMode:"numeric",value:y,onChange:q,onBlur:F,onFocus:L,hasError:b,disabled:C})),f&&e.createElement(i,null,e.createElement(r,{marginTop:"xxs"},f)))}export{d as DateField,d as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|