@cruk/cruk-react-components 6.2.2 → 7.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 +49 -0
- package/lib/index.css +2 -0
- package/lib/index.css.map +1 -0
- 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.d.ts +4 -9
- package/lib/src/components/AddressLookup/styles.js +1 -1
- package/lib/src/components/AddressLookup/styles.js.map +1 -1
- package/lib/src/components/AllThemesWrapper.d.ts +3 -3
- package/lib/src/components/Avatar/index.d.ts +8 -7
- 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.d.ts +1 -3
- package/lib/src/components/Avatar/styles.js +1 -1
- package/lib/src/components/Avatar/styles.js.map +1 -1
- package/lib/src/components/Badge/index.d.ts +14 -15
- 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.d.ts +1 -2
- package/lib/src/components/Badge/styles.js +1 -1
- package/lib/src/components/Badge/styles.js.map +1 -1
- package/lib/src/components/Box/index.d.ts +2 -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.d.ts +2 -3
- package/lib/src/components/Box/styles.js +1 -1
- package/lib/src/components/Box/styles.js.map +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.d.ts +2 -5
- package/lib/src/components/Button/styles.js +1 -1
- package/lib/src/components/Button/styles.js.map +1 -1
- package/lib/src/components/Carousel/styles.d.ts +1 -7
- package/lib/src/components/Carousel/styles.js +1 -1
- package/lib/src/components/Carousel/styles.js.map +1 -1
- 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.d.ts +3 -11
- package/lib/src/components/Checkbox/styles.js +1 -1
- package/lib/src/components/Checkbox/styles.js.map +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.d.ts +1 -3
- package/lib/src/components/Collapse/styles.js +1 -1
- package/lib/src/components/Collapse/styles.js.map +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.d.ts +6 -15
- package/lib/src/components/DateField/styles.js +1 -1
- package/lib/src/components/DateField/styles.js.map +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 +3 -7
- package/lib/src/components/ErrorText/styles.js +1 -1
- package/lib/src/components/ErrorText/styles.js.map +1 -1
- package/lib/src/components/Footer/index.d.ts +8 -6
- 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.d.ts +6 -13
- package/lib/src/components/Footer/styles.js +1 -1
- package/lib/src/components/Footer/styles.js.map +1 -1
- package/lib/src/components/Header/index.d.ts +19 -18
- 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.d.ts +3 -14
- package/lib/src/components/Header/styles.js +1 -1
- package/lib/src/components/Header/styles.js.map +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.d.ts +1 -2
- package/lib/src/components/Heading/styles.js +1 -1
- package/lib/src/components/Heading/styles.js.map +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.d.ts +0 -2
- package/lib/src/components/IconFa/styles.js.map +1 -1
- package/lib/src/components/InfoBox/index.d.ts +5 -4
- 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 +4 -6
- 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.d.ts +4 -14
- package/lib/src/components/LabelWrapper/styles.js +1 -1
- package/lib/src/components/LabelWrapper/styles.js.map +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.d.ts +1 -6
- package/lib/src/components/LegendWrapper/styles.js +1 -1
- package/lib/src/components/LegendWrapper/styles.js.map +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.d.ts +1 -3
- package/lib/src/components/Link/styles.js +1 -1
- package/lib/src/components/Link/styles.js.map +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.module.css.js +2 -0
- package/lib/src/components/Loader/styles.module.css.js.map +1 -0
- package/lib/src/components/Modal/TestModalWithContent.d.ts +3 -1
- package/lib/src/components/Modal/TestModalWithState.d.ts +3 -1
- package/lib/src/components/Modal/index.d.ts +2 -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 +3 -8
- package/lib/src/components/Modal/styles.js +1 -1
- package/lib/src/components/Modal/styles.js.map +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.d.ts +1 -5
- package/lib/src/components/Pagination/styles.js +1 -1
- package/lib/src/components/Pagination/styles.js.map +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.d.ts +1 -2
- package/lib/src/components/PopOver/styles.js +1 -1
- package/lib/src/components/PopOver/styles.js.map +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.d.ts +2 -11
- package/lib/src/components/ProgressBar/styles.js +1 -1
- package/lib/src/components/ProgressBar/styles.js.map +1 -1
- 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.d.ts +3 -12
- package/lib/src/components/Radio/styles.js +1 -1
- package/lib/src/components/Radio/styles.js.map +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.d.ts +3 -10
- package/lib/src/components/RadioConsent/styles.js +1 -1
- package/lib/src/components/RadioConsent/styles.js.map +1 -1
- 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.d.ts +2 -7
- package/lib/src/components/Select/styles.js +1 -1
- package/lib/src/components/Select/styles.js.map +1 -1
- package/lib/src/components/Spacing/index.d.ts +2 -2
- package/lib/src/components/Spacing/index.js +1 -1
- package/lib/src/components/Spacing/index.js.map +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.d.ts +2 -8
- package/lib/src/components/Step/styles.js +1 -1
- package/lib/src/components/Step/styles.js.map +1 -1
- package/lib/src/components/Text/index.d.ts +2 -2
- 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.d.ts +1 -2
- package/lib/src/components/Text/styles.js +1 -1
- package/lib/src/components/Text/styles.js.map +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.d.ts +2 -5
- package/lib/src/components/TextAreaField/styles.js +1 -1
- package/lib/src/components/TextAreaField/styles.js.map +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.d.ts +3 -8
- package/lib/src/components/TextField/styles.js +1 -1
- package/lib/src/components/TextField/styles.js.map +1 -1
- package/lib/src/components/Totaliser/index.d.ts +5 -6
- 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.d.ts +5 -18
- package/lib/src/components/Totaliser/styles.js +1 -1
- package/lib/src/components/Totaliser/styles.js.map +1 -1
- package/lib/src/components/UserBlock/index.d.ts +3 -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.d.ts +3 -8
- package/lib/src/components/UserBlock/styles.js +1 -1
- package/lib/src/components/UserBlock/styles.js.map +1 -1
- package/lib/src/components/index.d.ts +1 -8
- package/lib/src/components/index.js +1 -1
- package/lib/src/types.d.ts +8 -172
- package/lib/src/types.js +2 -0
- package/lib/src/types.js.map +1 -0
- package/lib/src/utils/themeUtils.d.ts +4 -3
- package/lib/src/utils/themeUtils.js +1 -1
- package/lib/src/utils/themeUtils.js.map +1 -1
- package/package.json +10 -5
- package/lib/src/components/Flex.d.ts +0 -8
- package/lib/src/components/Flex.js +0 -2
- package/lib/src/components/Flex.js.map +0 -1
- package/lib/src/components/Fontface.d.ts +0 -4
- package/lib/src/components/Fontface.js +0 -2
- package/lib/src/components/Fontface.js.map +0 -1
- package/lib/src/components/GlobalStyle.d.ts +0 -2
- package/lib/src/components/GlobalStyle.js +0 -2
- package/lib/src/components/GlobalStyle.js.map +0 -1
- package/lib/src/components/GlobalStyleNoFontFace.d.ts +0 -2
- package/lib/src/components/GlobalStyleNoFontFace.js +0 -2
- package/lib/src/components/GlobalStyleNoFontFace.js.map +0 -1
- package/lib/src/components/Loader/styles.d.ts +0 -7
- package/lib/src/components/Loader/styles.js +0 -2
- package/lib/src/components/Loader/styles.js.map +0 -1
- package/lib/src/components/ThemeCheatSheet.d.ts +0 -7
- package/lib/src/themes/bowelbabe.d.ts +0 -14
- package/lib/src/themes/bowelbabe.js +0 -2
- package/lib/src/themes/bowelbabe.js.map +0 -1
- package/lib/src/themes/cruk.d.ts +0 -14
- package/lib/src/themes/cruk.js +0 -2
- package/lib/src/themes/cruk.js.map +0 -1
- package/lib/src/themes/rfl.d.ts +0 -14
- package/lib/src/themes/rfl.js +0 -2
- package/lib/src/themes/rfl.js.map +0 -1
- package/lib/src/themes/su2c.d.ts +0 -14
- package/lib/src/themes/su2c.js +0 -2
- package/lib/src/themes/su2c.js.map +0 -1
- package/lib/vite.config.d.ts +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import e from"styled-components";var i,t,a,o,r,h,d,s,l,g,p,x=e.header(i||(i=n(["\n --_header-height-large: 120px;\n --_header-height-small: 72px;\n --_header-logo-height-large: 80px;\n --_header-logo-height-small: 40px;\n --_header-padding: var(--spacing-xs, 1rem);\n --_animation-speed: 0.2s;\n\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: var(--clr-header-background, #ffffff);\n z-index: 9998;\n"],["\n --_header-height-large: 120px;\n --_header-height-small: 72px;\n --_header-logo-height-large: 80px;\n --_header-logo-height-small: 40px;\n --_header-padding: var(--spacing-xs, 1rem);\n --_animation-speed: 0.2s;\n\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: var(--clr-header-background, #ffffff);\n z-index: 9998;\n"]))),f=e.div(t||(t=n(["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: var(--_header-height-small, 72px);\n\n @media (min-width: 992px) {\n height: var(--_header-height-large, 120px);\n }\n"],["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: var(--_header-height-small, 72px);\n\n @media (min-width: 992px) {\n height: var(--_header-height-large, 120px);\n }\n"]))),c=e.div(a||(a=n(["\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 var(--_header-padding, 1rem);\n background-color: var(--clr-header-background, #ffffff);\n position: relative;\n border-bottom: solid 1px var(--clr-header-border, #e6e6e6);\n height: var(--_header-height-small, 72px);\n box-shadow: ",";\n top: ",";\n position: ",";\n transition: height var(--_animation-speed, 0.2s) ease;\n @media (min-width: 992px) {\n position: ",";\n height: ",";\n }\n"],["\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 var(--_header-padding, 1rem);\n background-color: var(--clr-header-background, #ffffff);\n position: relative;\n border-bottom: solid 1px var(--clr-header-border, #e6e6e6);\n height: var(--_header-height-small, 72px);\n box-shadow: ",";\n top: ",";\n position: ",";\n transition: height var(--_animation-speed, 0.2s) ease;\n @media (min-width: 992px) {\n position: ",";\n height: ",";\n }\n"])),function(n){return n.$isSticky?"var(--shadow-l)":"none"},function(n){return n.$isSticky?0:"auto"},function(n){return n.$isSticky?"fixed":"relative"},function(n){return n.$isSticky?"fixed":"relative"},function(n){var e=n.$isSmall,i=n.$isSticky;return e&&i?"var(--_header-height-small, 72px)":"var(--_header-height-large, 120px)"}),m=e.div(o||(o=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"],["\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"])),function(n){return n.$fullWidth?"100%":"var(--content-max-width, 1000px)"}),u=e.img(r||(r=n(["\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n"],["\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n"]))),v=e.div(h||(h=n(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height var(--_animation-speed, 0.2s) ease;\n\n height: var(--_header-logo-height-small, 40px);\n\n @media (min-width: 992px) {\n height: ",";\n }\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height var(--_animation-speed, 0.2s) ease;\n\n height: var(--_header-logo-height-small, 40px);\n\n @media (min-width: 992px) {\n height: ",";\n }\n"])),function(n){var e=n.$isSmall,i=n.$isSticky;return e&&i?"var(--_header-logo-height-small, 40px)":"var(--_header-logo-height-large, 80px)"}),b=e.a(d||(d=n(["\n display: inline-block;\n"],["\n display: inline-block;\n"]))),w=e.a(s||(s=n(["\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: var(--spacing-xs, 1rem);\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 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: var(--spacing-xs, 1rem);\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n"]))),y=e.p(l||(l=n(['\n flex: 1 1 auto;\n font-family: var(--typ-font-family-headings, "Progress", Arial, sans-serif);\n font-weight: var(--typ-font-weight-headings, 400);\n font-size: var(--font-size-xl, 1.5625rem);\n color: var(--clr-header-tagline-text, #000000);\n text-align: center;\n opacity: 0;\n transition: opacity var(--_animation-speed, 0.2s) ease;\n display: none;\n\n @media (min-width: 992px) {\n display: block;\n opacity: ',";\n }\n"],['\n flex: 1 1 auto;\n font-family: var(--typ-font-family-headings, "Progress", Arial, sans-serif);\n font-weight: var(--typ-font-weight-headings, 400);\n font-size: var(--font-size-xl, 1.5625rem);\n color: var(--clr-header-tagline-text, #000000);\n text-align: center;\n opacity: 0;\n transition: opacity var(--_animation-speed, 0.2s) ease;\n display: none;\n\n @media (min-width: 992px) {\n display: block;\n opacity: ',";\n }\n"])),function(n){var e=n.$isSmall,i=n.$isSticky;return e&&i?0:1}),_=e.div(g||(g=n(["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n"],["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n"]))),z=e.div(p||(p=n(["\n height: auto;\n margin: auto 0;\n"],["\n height: auto;\n margin: auto 0;\n"])));export{z as ChildInner,_ as ChildWrapper,m as HeaderMainContent,c as HeaderStickyContainer,f as HeaderStickyPlaceHolder,u as Logo,v as LogoWrapper,w as SkipToMain,x as StyledHeader,b as StyledLink,y as Tagline};
|
|
2
2
|
//# 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\
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Header/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const StyledHeader = styled.header`\n --_header-height-large: 120px;\n --_header-height-small: 72px;\n --_header-logo-height-large: 80px;\n --_header-logo-height-small: 40px;\n --_header-padding: var(--spacing-xs, 1rem);\n --_animation-speed: 0.2s;\n\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: var(--clr-header-background, #ffffff);\n z-index: 9998;\n`;\n\nexport const HeaderStickyPlaceHolder = styled.div`\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: var(--_header-height-small, 72px);\n\n @media (min-width: 992px) {\n height: var(--_header-height-large, 120px);\n }\n`;\n\nexport const HeaderStickyContainer = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n}>`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 var(--_header-padding, 1rem);\n background-color: var(--clr-header-background, #ffffff);\n position: relative;\n border-bottom: solid 1px var(--clr-header-border, #e6e6e6);\n height: var(--_header-height-small, 72px);\n box-shadow: ${({ $isSticky }) => ($isSticky ? \"var(--shadow-l)\" : \"none\")};\n top: ${({ $isSticky }) => ($isSticky ? 0 : \"auto\")};\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n transition: height var(--_animation-speed, 0.2s) ease;\n @media (min-width: 992px) {\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky\n ? \"var(--_header-height-small, 72px)\"\n : \"var(--_header-height-large, 120px)\"};\n }\n`;\n\nexport const HeaderMainContent = styled.div<{\n $fullWidth?: boolean;\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: ${({ $fullWidth }) =>\n $fullWidth ? `100%` : `var(--content-max-width, 1000px)`};\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}>`\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height var(--_animation-speed, 0.2s) ease;\n\n height: var(--_header-logo-height-small, 40px);\n\n @media (min-width: 992px) {\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky\n ? \"var(--_header-logo-height-small, 40px)\"\n : \"var(--_header-logo-height-large, 80px)\"};\n }\n`;\n\nexport const StyledLink = styled.a`\n display: inline-block;\n`;\n\nexport const SkipToMain = styled.a`\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: var(--spacing-xs, 1rem);\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}>`\n flex: 1 1 auto;\n font-family: var(--typ-font-family-headings, \"Progress\", Arial, sans-serif);\n font-weight: var(--typ-font-weight-headings, 400);\n font-size: var(--font-size-xl, 1.5625rem);\n color: var(--clr-header-tagline-text, #000000);\n text-align: center;\n opacity: 0;\n transition: opacity var(--_animation-speed, 0.2s) ease;\n display: none;\n\n @media (min-width: 992px) {\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":["StyledHeader","styled","header","templateObject_1","__makeTemplateObject","HeaderStickyPlaceHolder","div","templateObject_2","HeaderStickyContainer","_a","$isSticky","$isSmall","HeaderMainContent","templateObject_4","$fullWidth","Logo","img","templateObject_5","LogoWrapper","templateObject_6","StyledLink","a","templateObject_7","SkipToMain","templateObject_8","Tagline","p","templateObject_9","ChildWrapper","templateObject_10","ChildInner","templateObject_11"],"mappings":"iHAEO,0BAAMA,EAAeC,EAAOC,OAAMC,IAAAA,EAAAC,EAAA,CAAA,mXAAA,CAAA,sXAe5BC,EAA0BJ,EAAOK,IAAGC,IAAAA,EAAAH,EAAA,CAAA,6MAAA,CAAA,gNAWpCI,EAAwBP,EAAOK,mfAG1C,2TASyE,aACvB,kBACe,6GAGE,kBAIvB,cAT9B,SAACG,GAAkB,OAAPA,EAAAC,UAAoB,kBAAoB,MAAjC,EAC1B,SAACD,GAAkB,OAAPA,EAAAC,UAAoB,EAAI,MAAjB,EACd,SAACD,GAAkB,OAAPA,EAAAC,UAAoB,QAAU,UAAvB,EAGjB,SAACD,GAAkB,OAAPA,EAAAC,UAAoB,QAAU,UAAvB,EACrB,SAACD,OAAEE,EAAQF,EAAAE,SAAED,EAASD,EAAAC,UAC9B,OAAAC,GAAYD,EACR,oCACA,oCAFJ,GAMOE,EAAoBX,EAAOK,IAAGO,IAAAA,EAAAT,EAAA,CAAA,8KAAA,OAAA,CAEzC,8KAS0D,SAD7C,SAACK,GACZ,OADwBA,EAAAK,WACX,OAAS,kCAAtB,GAGSC,EAAOd,EAAOe,IAAGC,IAAAA,EAAAb,EAAA,CAAA,gFAAA,CAAA,mFAOjBc,EAAcjB,EAAOK,IAAGa,IAAAA,EAAAf,EAAA,CAAA,gQAAA,YAAA,CAGnC,gQAagD,cAHpC,SAACK,OAAEE,EAAQF,EAAAE,SAAED,EAASD,EAAAC,UAC9B,OAAAC,GAAYD,EACR,yCACA,wCAFJ,GAMOU,EAAanB,EAAOoB,EAACC,IAAAA,EAAAlB,EAAA,CAAA,gCAAA,CAAA,mCAIrBmB,EAAatB,EAAOoB,EAACG,IAAAA,EAAApB,EAAA,CAAA,wcAAA,CAAA,2cA0BrBqB,EAAUxB,EAAOyB,EAACC,IAAAA,EAAAvB,EAAA,CAAA,qbAAA,YAAA,CAG7B,qbAayE,cAA5D,SAACK,OAAEE,EAAQF,EAAAE,SAAED,EAASD,EAAAC,UAAO,OAACC,GAAYD,EAAY,EAAI,CAA7B,GAI/BkB,EAAe3B,EAAOK,IAAGuB,IAAAA,EAAAzB,EAAA,CAAA,sGAAA,CAAA,yGAOzB0B,EAAa7B,EAAOK,IAAGyB,IAAAA,EAAA3B,EAAA,CAAA,0CAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import r from"react";import{
|
|
1
|
+
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import r from"react";import{spacingPropsToSpacingPropsInternal as o}from"../Spacing/index.js";import{H1 as l,H2 as $,H3 as a,H4 as i,H5 as x,H6 as n}from"./styles.js";import{themeColorOrString as m}from"../../utils/themeUtils.js";function w(w){var f=w.textSize,p=w.textAlign,d=w.textColor,h=w.wordBreak,s=w.overflowWrap,c=w.h1,v=w.h2,g=w.h3,S=w.h4,k=w.h5,z=w.h6,A=e(w,["textSize","textAlign","textColor","wordBreak","overflowWrap","h1","h2","h3","h4","h5","h6"]),B=o(A),C=d?m(d):"var(--clr-text-header-default, #000)";return c?r.createElement(l,t({},B,{$textSize:f,$textAlign:p,$textColor:C,$wordBreak:h,$overflowWrap:s})):v?r.createElement($,t({},B,{$textSize:f,$textAlign:p,$textColor:C,$wordBreak:h,$overflowWrap:s})):g?r.createElement(a,t({},B,{$textSize:f,$textAlign:p,$textColor:C,$wordBreak:h,$overflowWrap:s})):S?r.createElement(i,t({},B,{$textSize:f,$textAlign:p,$textColor:C,$wordBreak:h,$overflowWrap:s})):k?r.createElement(x,t({},B,{$textSize:f,$textAlign:p,$textColor:C,$wordBreak:h,$overflowWrap:s})):z?r.createElement(n,t({},B,{$textSize:f,$textAlign:p,$textColor:C,$wordBreak:h,$overflowWrap:s})):r.createElement($,t({},B,{$textSize:f,$textAlign:p,$textColor:C,$wordBreak:h,$overflowWrap:s}))}export{w as Heading,w as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Heading/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ElementType } from \"react\";\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Heading/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ElementType } from \"react\";\n\nimport {\n spacingPropsToSpacingPropsInternal,\n type SpacingProps,\n} from \"../Spacing\";\n\nimport {\n type FontSizeType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\nimport { H1, H2, H3, H4, H5, H6 } from \"./styles\";\nimport { themeColorOrString } from \"../../utils/themeUtils\";\n\nexport type HeadingProps = SpacingProps &\n HTMLAttributes<HTMLElement> & {\n h1?: boolean;\n h2?: boolean;\n h3?: boolean;\n h4?: boolean;\n h5?: boolean;\n h6?: boolean;\n /** font size FontSizeType t-shirt sizes */\n textSize?: FontSizeType;\n /** horizontal alignment of text */\n textAlign?: \"left\" | \"right\" | \"center\";\n /** color of text */\n textColor?: string;\n /** word-break behavior */\n wordBreak?: WordBreakType;\n /** overflow-wrap behavior */\n overflowWrap?: OverflowWrapType;\n /** styled-component polymorphic feature so you take the styling of a header and cast the component to be a \"span\" for example */\n as?: ElementType;\n };\n\n/**\n * \n * Use headings consistently to create a clear hierarchy throughout your service.\nMarkup headings semantically using the appropriate <h#> level HTML element and\nuse the corresponding heading class (h1, h2, h3, ....). Write all headings in sentence case. Heading differs from the Text component by using a different font-family and it changes the font size according to the screen width breakpoints.\n * \n */\nexport function Heading({\n textSize,\n textAlign,\n textColor,\n wordBreak,\n overflowWrap,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n ...props\n}: HeadingProps) {\n const propsConvertedToInternalSpacingProps =\n spacingPropsToSpacingPropsInternal(props);\n\n const textColorFinal = textColor\n ? themeColorOrString(textColor)\n : \"var(--clr-text-header-default, #000)\";\n\n if (h1)\n return (\n <H1\n {...propsConvertedToInternalSpacingProps}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColorFinal}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h2)\n return (\n <H2\n {...propsConvertedToInternalSpacingProps}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColorFinal}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h3)\n return (\n <H3\n {...propsConvertedToInternalSpacingProps}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColorFinal}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h4)\n return (\n <H4\n {...propsConvertedToInternalSpacingProps}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColorFinal}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h5)\n return (\n <H5\n {...propsConvertedToInternalSpacingProps}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColorFinal}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h6)\n return (\n <H6\n {...propsConvertedToInternalSpacingProps}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColorFinal}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n return (\n <H2\n {...propsConvertedToInternalSpacingProps}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColorFinal}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n}\n\nexport default Heading;\n"],"names":["Heading","_a","textSize","textAlign","textColor","wordBreak","overflowWrap","h1","h2","h3","h4","h5","h6","props","__rest","propsConvertedToInternalSpacingProps","spacingPropsToSpacingPropsInternal","textColorFinal","themeColorOrString","React","createElement","H1","__assign","$textAlign","$textColor","$wordBreak","H2","H3","H4","H5","H6"],"mappings":"sTA4CM,SAAUA,EAAQC,GACtB,IAAAC,EAAQD,EAAAC,SACRC,EAASF,EAAAE,UACTC,EAASH,EAAAG,UACTC,cACAC,EAAYL,EAAAK,aACZC,EAAEN,EAAAM,GACFC,EAAEP,EAAAO,GACFC,EAAER,EAAAQ,GACFC,OACAC,EAAEV,EAAAU,GACFC,EAAEX,EAAAW,GACCC,EAAKC,EAAAb,EAZc,+FAchBc,EACJC,EAAmCH,GAE/BI,EAAiBb,EACnBc,EAAmBd,GACnB,uCAEJ,OAAIG,EAEAY,EAAAC,cAACC,EAAEC,EAAA,GACGP,aACOb,EAAQqB,WACPpB,EAASqB,WACTP,EAAcQ,WACdpB,gBACGC,KAGjBE,EAEAW,EAAAC,cAACM,EAAEJ,EAAA,GACGP,aACOb,EAAQqB,WACPpB,EAASqB,WACTP,EAAcQ,WACdpB,gBACGC,KAGjBG,EAEAU,EAAAC,cAACO,EAAEL,EAAA,GACGP,aACOb,EAAQqB,WACPpB,EAASqB,WACTP,EAAcQ,WACdpB,gBACGC,KAGjBI,EAEAS,EAAAC,cAACQ,EAAEN,EAAA,GACGP,aACOb,EAAQqB,WACPpB,EAASqB,WACTP,EAAcQ,WACdpB,gBACGC,KAGjBK,EAEAQ,EAAAC,cAACS,EAAEP,EAAA,GACGP,aACOb,EAAQqB,WACPpB,EAASqB,WACTP,EAAcQ,WACdpB,gBACGC,KAGjBM,EAEAO,EAAAC,cAACU,EAAER,EAAA,GACGP,aACOb,EAAQqB,WACPpB,EAASqB,WACTP,EAAcQ,WACdpB,gBACGC,KAInBa,EAAAC,cAACM,EAAEJ,EAAA,GACGP,aACOb,EAAQqB,WACPpB,EAASqB,WACTP,EAAcQ,WACdpB,gBACGC,IAGrB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type SpacingPropsInternal } from "../Spacing";
|
|
2
|
-
import { type
|
|
2
|
+
import { type FontSizeType, type WordBreakType, type OverflowWrapType } from "../../types";
|
|
3
3
|
type StyledHeadingProps = SpacingPropsInternal & {
|
|
4
|
-
theme: ThemeType;
|
|
5
4
|
$textSize?: FontSizeType;
|
|
6
5
|
$textAlign?: "left" | "right" | "center";
|
|
7
6
|
$textColor?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__rest as
|
|
1
|
+
import{__makeTemplateObject as n,__rest as e}from"../../../node_modules/tslib/tslib.es6.js";import t,{css as r}from"styled-components";import{spacing as i}from"../Spacing/index.js";var a,o,f,m,s,x,l,u=function(t){return r(a||(a=n(['\n font-family: var(--typ-font-family-headings, "Progress", Arial, sans-serif);\n font-weight: var(--typ-font-weight-headings, 400);\n word-break: ',";\n overflow-wrap: ",";\n color: ",";\n line-height: var(--typ-header-line-height, 1.25em);\n text-transform: var(--typ-header-text-transform, none);\n margin-top: var(--spacing-m, 2rem);\n margin-bottom: var(--spacing-s, 1.5rem);\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"],['\n font-family: var(--typ-font-family-headings, "Progress", Arial, sans-serif);\n font-weight: var(--typ-font-weight-headings, 400);\n word-break: ',";\n overflow-wrap: ",";\n color: ",";\n line-height: var(--typ-header-line-height, 1.25em);\n text-transform: var(--typ-header-text-transform, none);\n margin-top: var(--spacing-m, 2rem);\n margin-bottom: var(--spacing-s, 1.5rem);\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"])),t.$wordBreak||"normal",t.$overflowWrap||"break-word",t.$textColor?t.$textColor:"var(--clr-text-header-default, #000)",t.$textAlign||"left",function(){var n=e(t,[]);return i(n)})},z=function(n,e){switch(n){case"m":return"var(--font-size-m, 1rem)";case"l":return"var(--font-size-l, 1.25rem)";case"xl":return"var(--font-size-xl, 1.5rem)";case"xxl":return"var(--font-size-xxl, 1.75rem)";case"xxxl":return"var(--font-size-xxxl, 2rem)";case"xxxxl":return"var(--font-size-xxxxl, 2.25rem)";default:return e}},d=function(n,e){switch(n){case"m":return"var(--font-size-m, 1rem)";case"l":case"xl":return"var(--font-size-l, 1.25rem)";case"xxl":return"var(--font-size-xl, 1.5rem)";case"xxxl":return"var(--font-size-xxl, 1.75rem)";case"xxxxl":return"var(--font-size-xxxl, 2rem)";default:return e}},v=function(n,e){switch(n){case"m":return"var(--font-size-m, 1rem)";case"l":case"xl":case"xxl":return"var(--font-size-l, 1.25rem)";case"xxxl":return"var(--font-size-xl, 1.5rem)";case"xxxxl":return"var(--font-size-xxl, 1.75rem)";default:return e}},c=t.h1(o||(o=n(["\n ","\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"])),function(n){return u(n)},function(n){var e=n.$textSize;return v(e||null,"var(--font-size-xxl, 1.75rem)")},function(n){var e=n.$textSize;return d(e||null,"var(--font-size-xxxl, 2rem)")},function(n){var e=n.$textSize;return z(e||null,"var(--font-size-xxxxl, 2.25rem)")}),h=t.h2(f||(f=n(["\n ","\n font-size: ",";\n\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"])),function(n){return u(n)},function(n){var e=n.$textSize;return v(e||null,"var(--font-size-xl, 1.5rem)")},function(n){var e=n.$textSize;return d(e||null,"var(--font-size-xxl, 1.75rem)")},function(n){var e=n.$textSize;return z(e||null,"var(--font-size-xxxl, 2rem)")}),p=t.h3(m||(m=n(["\n ","\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"])),function(n){return u(n)},function(n){var e=n.$textSize;return v(e||null,"var(--font-size-l, 1.25rem)")},function(n){var e=n.$textSize;return d(e||null,"var(--font-size-xl, 1.5rem)")},function(n){var e=n.$textSize;return z(e||null,"var(--font-size-xxl, 1.75rem)")}),w=t.h4(s||(s=n(["\n ","\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"])),function(n){return u(n)},function(n){var e=n.$textSize;return v(e||null,"var(--font-size-l, 1.25rem)")},function(n){var e=n.$textSize;return d(e||null,"var(--font-size-l, 1.25rem)")},function(n){var e=n.$textSize;return z(e||null,"var(--font-size-xl, 1.5rem)")}),g=t.h5(x||(x=n(["\n ","\n\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"])),function(n){return u(n)},function(n){var e=n.$textSize;return v(e||null,"var(--font-size-l, 1.25rem)")},function(n){var e=n.$textSize;return d(e||null,"var(--font-size-l, 1.25rem)")},function(n){var e=n.$textSize;return z(e||null,"var(--font-size-l, 1.25rem)")}),$=t.h6(l||(l=n(["\n ","\n\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: 768px) {\n font-size: ",";\n }\n @media (min-width: 992px) {\n font-size: ",";\n }\n"])),function(n){return u(n)},function(n){var e=n.$textSize;return v(e||null,"var(--font-size-m, 1rem)")},function(n){var e=n.$textSize;return d(e||null,"var(--font-size-m, 1rem)")},function(n){var e=n.$textSize;return z(e||null,"var(--font-size-m, 1rem)")});export{c as H1,h as H2,p as H3,w as H4,g as H5,$ as H6};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Heading/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\n\nimport {\n type ThemeType,\n type FontSizeType,\n type ColorKeyType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\n\ntype StyledHeadingProps = SpacingPropsInternal & {\n theme: ThemeType;\n $textSize?: FontSizeType;\n $textAlign?: \"left\" | \"right\" | \"center\";\n $textColor?: string;\n $wordBreak?: WordBreakType;\n $overflowWrap?: OverflowWrapType;\n};\n\nconst StyledHeading = (props: StyledHeadingProps) => css`\n font-family: ${props.theme.typography.fontFamilyHeadings};\n font-weight: ${props.theme.typography.fontWeightHeadings};\n word-break: ${props.$wordBreak || \"normal\"};\n overflow-wrap: ${props.$overflowWrap || \"break-word\"};\n color: ${props.$textColor &&\n typeof props.theme.colors[props.$textColor as ColorKeyType] !== \"undefined\"\n ? props.theme.colors[props.$textColor as ColorKeyType]\n : props.$textColor || props.theme.colors.textHeaderDefault};\n line-height: ${props.theme.typography.headerLineHeight};\n text-transform: ${props.theme.typography.headerTextTransform};\n margin-top: ${props.theme.spacing.m};\n margin-bottom: ${props.theme.spacing.s};\n max-width: 100%;\n text-align: ${props.$textAlign || \"left\"};\n\n &:first-child {\n margin-top: 0;\n }\n\n ${() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { theme, ...propsWithoutTheme } = props;\n\n return spacing(propsWithoutTheme, props.theme);\n }}\n`;\n\nconst desktopFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.xl;\n case \"xxl\":\n return theme.fontSizes.xxl;\n case \"xxxl\":\n return theme.fontSizes.xxxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down a size on the typography scale\nconst tabletFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.xl;\n case \"xxxl\":\n return theme.fontSizes.xxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down two sizes on the typography scale\nconst mobileFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.l;\n case \"xxxl\":\n return theme.fontSizes.xl;\n case \"xxxxl\":\n return theme.fontSizes.xxl;\n\n default:\n return defaultFontSize;\n }\n};\n\nexport const H1 = styled.h1<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxxl, theme)};\n }\n`;\n\nexport const H2 = styled.h2<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n`;\n\nexport const H3 = styled.h3<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n`;\n\nexport const H4 = styled.h4<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n`;\n\nexport const H5 = styled.h5<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n`;\n\nexport const H6 = styled.h6<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.m, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n`;\n"],"names":["StyledHeading","props","css","templateObject_1","__makeTemplateObject","theme","typography","fontFamilyHeadings","fontWeightHeadings","$wordBreak","$overflowWrap","$textColor","colors","textHeaderDefault","headerLineHeight","headerTextTransform","spacing","m","s","$textAlign","propsWithoutTheme","__rest","desktopFontSize","$textSize","defaultFontSize","fontSizes","l","xl","xxl","xxxl","xxxxl","tabletFontSize","mobileFontSize","H1","styled","h1","templateObject_2","_a","breakpoint","tablet","desktop","H2","h2","templateObject_3","H3","h3","templateObject_4","H4","h4","templateObject_5","H5","h5","templ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,EAArD,EAEiB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWE,OAAjB,EACrB,SAACH,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAD,EAAgBC,GAAa,KAAMlB,EAAMoB,UAAUC,EAAGrB,EAAtD,GAIOgD,EAAKnB,EAAOoB,GAAEC,IAAAA,EAAAnD,EAAA,CAAA,OAAA,oBAAA,2BAAA,uBAAA,gCAAA,uBAAA,YAAA,CAAoB,OACZ,oBAG4B,2BACF,uBAEI,gCAEH,uBAEI,cAV9D,SAACH,GAAU,OAAAD,EAAcC,EAAd,EAEA,SAACoC,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAS,EAAeT,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAArD,EACmB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWC,MAAjB,EACrB,SAACF,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAQ,EAAeR,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAArD,EAEiB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWE,OAAjB,EACrB,SAACH,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAD,EAAgBC,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAAtD"}
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Heading/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\n\nimport {\n type FontSizeType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\n\ntype StyledHeadingProps = SpacingPropsInternal & {\n $textSize?: FontSizeType;\n $textAlign?: \"left\" | \"right\" | \"center\";\n $textColor?: string;\n $wordBreak?: WordBreakType;\n $overflowWrap?: OverflowWrapType;\n};\n\nconst StyledHeading = (props: StyledHeadingProps) => css`\n font-family: var(--typ-font-family-headings, \"Progress\", Arial, sans-serif);\n font-weight: var(--typ-font-weight-headings, 400);\n word-break: ${props.$wordBreak || \"normal\"};\n overflow-wrap: ${props.$overflowWrap || \"break-word\"};\n color: ${props.$textColor\n ? props.$textColor\n : `var(--clr-text-header-default, #000)`};\n line-height: var(--typ-header-line-height, 1.25em);\n text-transform: var(--typ-header-text-transform, none);\n margin-top: var(--spacing-m, 2rem);\n margin-bottom: var(--spacing-s, 1.5rem);\n max-width: 100%;\n text-align: ${props.$textAlign || \"left\"};\n\n &:first-child {\n margin-top: 0;\n }\n\n ${() => {\n const { ...propsWithoutTheme } = props;\n\n return spacing(propsWithoutTheme);\n }}\n`;\n\nconst desktopFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n) => {\n switch ($textSize) {\n case \"m\":\n return \"var(--font-size-m, 1rem)\";\n case \"l\":\n return \"var(--font-size-l, 1.25rem)\";\n case \"xl\":\n return \"var(--font-size-xl, 1.5rem)\";\n case \"xxl\":\n return \"var(--font-size-xxl, 1.75rem)\";\n case \"xxxl\":\n return \"var(--font-size-xxxl, 2rem)\";\n case \"xxxxl\":\n return \"var(--font-size-xxxxl, 2.25rem)\";\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down a size on the typography scale\nconst tabletFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n) => {\n switch ($textSize) {\n case \"m\":\n return \"var(--font-size-m, 1rem)\";\n case \"l\":\n return \"var(--font-size-l, 1.25rem)\";\n case \"xl\":\n return \"var(--font-size-l, 1.25rem)\";\n case \"xxl\":\n return \"var(--font-size-xl, 1.5rem)\";\n case \"xxxl\":\n return \"var(--font-size-xxl, 1.75rem)\";\n case \"xxxxl\":\n return \"var(--font-size-xxxl, 2rem)\";\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down two sizes on the typography scale\nconst mobileFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n) => {\n switch ($textSize) {\n case \"m\":\n return \"var(--font-size-m, 1rem)\";\n case \"l\":\n return \"var(--font-size-l, 1.25rem)\";\n case \"xl\":\n return \"var(--font-size-l, 1.25rem)\";\n case \"xxl\":\n return \"var(--font-size-l, 1.25rem)\";\n case \"xxxl\":\n return \"var(--font-size-xl, 1.5rem)\";\n case \"xxxxl\":\n return \"var(--font-size-xxl, 1.75rem)\";\n\n default:\n return defaultFontSize;\n }\n};\n\nexport const H1 = styled.h1<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ $textSize }) =>\n mobileFontSize($textSize || null, \"var(--font-size-xxl, 1.75rem)\")};\n @media (min-width: 768px) {\n font-size: ${({ $textSize }) =>\n tabletFontSize($textSize || null, \"var(--font-size-xxxl, 2rem)\")};\n }\n @media (min-width: 992px) {\n font-size: ${({ $textSize }) =>\n desktopFontSize($textSize || null, \"var(--font-size-xxxxl, 2.25rem)\")};\n }\n`;\n\nexport const H2 = styled.h2<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ $textSize }) =>\n mobileFontSize($textSize || null, \"var(--font-size-xl, 1.5rem)\")};\n\n @media (min-width: 768px) {\n font-size: ${({ $textSize }) =>\n tabletFontSize($textSize || null, \"var(--font-size-xxl, 1.75rem)\")};\n }\n @media (min-width: 992px) {\n font-size: ${({ $textSize }) =>\n desktopFontSize($textSize || null, \"var(--font-size-xxxl, 2rem)\")};\n }\n`;\n\nexport const H3 = styled.h3<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ $textSize }) =>\n mobileFontSize($textSize || null, \"var(--font-size-l, 1.25rem)\")};\n @media (min-width: 768px) {\n font-size: ${({ $textSize }) =>\n tabletFontSize($textSize || null, \"var(--font-size-xl, 1.5rem)\")};\n }\n @media (min-width: 992px) {\n font-size: ${({ $textSize }) =>\n desktopFontSize($textSize || null, \"var(--font-size-xxl, 1.75rem)\")};\n }\n`;\n\nexport const H4 = styled.h4<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ $textSize }) =>\n mobileFontSize($textSize || null, \"var(--font-size-l, 1.25rem)\")};\n @media (min-width: 768px) {\n font-size: ${({ $textSize }) =>\n tabletFontSize($textSize || null, \"var(--font-size-l, 1.25rem)\")};\n }\n @media (min-width: 992px) {\n font-size: ${({ $textSize }) =>\n desktopFontSize($textSize || null, \"var(--font-size-xl, 1.5rem)\")};\n }\n`;\n\nexport const H5 = styled.h5<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ $textSize }) =>\n mobileFontSize($textSize || null, \"var(--font-size-l, 1.25rem)\")};\n @media (min-width: 768px) {\n font-size: ${({ $textSize }) =>\n tabletFontSize($textSize || null, \"var(--font-size-l, 1.25rem)\")};\n }\n @media (min-width: 992px) {\n font-size: ${({ $textSize }) =>\n desktopFontSize($textSize || null, \"var(--font-size-l, 1.25rem)\")};\n }\n`;\n\nexport const H6 = styled.h6<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ $textSize }) =>\n mobileFontSize($textSize || null, \"var(--font-size-m, 1rem)\")};\n @media (min-width: 768px) {\n font-size: ${({ $textSize }) =>\n tabletFontSize($textSize || null, \"var(--font-size-m, 1rem)\")};\n }\n @media (min-width: 992px) {\n font-size: ${({ $textSize }) =>\n desktopFontSize($textSize || null, \"var(--font-size-m, 1rem)\")};\n }\n`;\n"],"names":["StyledHeading","props","css","templateObject_1","__makeTemplateObject","$wordBreak","$overflowWrap","$textColor","$textAlign","propsWithoutTheme","__rest","spacing","desktopFontSize","$textSize","defaultFontSize","tabletFontSize","mobileFontSize","H1","styled","h1","templateObject_2","_a","H2","h2","templateObject_3","H3","h3","templateObject_4","H4","h4","templateObject_5","H5","h5","templateObject_6","H6","h6","templateObject_7"],"mappings":"qLAkBA,kBAAMA,EAAgB,SAACC,GAA8B,OAAAC,EAAGC,IAAAA,EAAAC,EAAA,CAAA,yJAAA,uBAAA,eAAA,6OAAA,wDAAA,MAAA,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AA,EAAA7B,EAAA,CAAA,OAAA,oBAAA,oDAAA,yDAAA,YAAA,CAAoB,OACZ,oBAGiC,oDAGE,yDAIC,cAVnE,SAACH,GAAU,OAAAD,EAAcC,EAAd,EAEA,SAACoB,GAAE,IAAAR,EAASQ,EAAAR,UACvB,OAAAG,EAAeH,GAAa,KAAM,8BAAlC,EAEa,SAACQ,GAAE,IAAAR,EAASQ,EAAAR,UACvB,OAAAE,EAAeF,GAAa,KAAM,8BAAlC,EAGW,SAACQ,GAAE,IAAAR,EAASQ,EAAAR,UACvB,OAAAD,EAAgBC,GAAa,KAAM,8BAAnC,GAIOqB,EAAKhB,EAAOiB,GAAEC,IAAAA,EAAAhC,EAAA,CAAA,OAAA,oBAAA,oDAAA,yDAAA,YAAA,CAAoB,OACZ,oBAG8B,oDAGE,yDAIC,cAVhE,SAACH,GAAU,OAAAD,EAAcC,EAAd,EAEA,SAACoB,GAAE,IAAAR,EAASQ,EAAAR,UACvB,OAAAG,EAAeH,GAAa,KAAM,2BAAlC,EAEa,SAACQ,GAAE,IAAAR,EAASQ,EAAAR,UACvB,OAAAE,EAAeF,GAAa,KAAM,2BAAlC,EAGW,SAACQ,GAAE,IAAAR,EAASQ,EAAAR,UACvB,OAAAD,EAAgBC,GAAa,KAAM,2BAAnC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{StyledIcon as t}from"./styles.js";import{themeColorOrString as o,themeSpacingSizeOrString as r}from"../../utils/themeUtils.js";function c(c){var i=c.faIcon,a=c.color,n=c.size,m=void 0===n?"1rem":n,s=i.icon,l=s[0],f=s[1],p=s[4];return e.createElement(t,{role:"presentation",viewBox:"0 0 ".concat(l," ").concat(f),$size:r(m),$color:o(a)},p&&e.createElement("path",{d:p}))}export{c as IconFa,c as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/IconFa/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/IconFa/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { type IconDefinition } from \"@fortawesome/fontawesome-common-types\";\n\nimport { StyledIcon } from \"./styles\";\nimport {\n themeColorOrString,\n themeSpacingSizeOrString,\n} from \"../../utils/themeUtils\";\n\nexport type IconFaProps = {\n /** imported icon definition from \"@fortawesome/free-solid-svg-icons\" or \"@fortawesome/free-brands-svg-icons\" */\n faIcon: IconDefinition;\n /** color of icon, inherits current text colour by default */\n color?: string;\n /** size of ion 1.1em by default */\n size?: string;\n};\n\n/**\n * The IconFa component (Icon Font Awesome) displays an icon glyph as an `<svg>` element.\n *\n * This is an svg icon wrapper where a font awesome icon definition can be passed in a long with colour and size\n * */\nexport function IconFa({ faIcon, color, size = \"1rem\" }: IconFaProps) {\n const [width, height, , , svgPathData] = faIcon.icon;\n\n return (\n <StyledIcon\n role=\"presentation\"\n viewBox={`0 0 ${width} ${height}`}\n $size={themeSpacingSizeOrString(size)}\n $color={themeColorOrString(color)}\n >\n {svgPathData && <path d={svgPathData as string} />}\n </StyledIcon>\n );\n}\n\nexport default IconFa;\n"],"names":["IconFa","_a","faIcon","color","_b","size","_c","icon","width","height","svgPathData","React","createElement","StyledIcon","role","viewBox","concat","$size","themeSpacingSizeOrString","$color","themeColorOrString","d"],"mappings":"2JAuBM,SAAUA,EAAOC,OAAEC,EAAMD,EAAAC,OAAEC,EAAKF,EAAAE,MAAEC,SAAAC,OAAI,IAAAD,EAAG,OAAMA,EAC7CE,EAAmCJ,EAAOK,KAAzCC,EAAKF,EAAA,GAAEG,EAAMH,EAAA,GAAMI,OAE1B,OACEC,EAAAC,cAACC,EAAU,CACTC,KAAK,eACLC,QAAS,OAAAC,OAAOR,EAAK,KAAAQ,OAAIP,GAAQQ,MAC1BC,EAAyBb,GAAKc,OAC7BC,EAAmBjB,IAE1BO,GAAeC,EAAAC,cAAA,OAAA,CAAMS,EAAGX,IAG/B"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type ThemeType } from "../../types";
|
|
2
1
|
export declare const StyledIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").SVGProps<SVGSVGElement>, {
|
|
3
|
-
theme: ThemeType;
|
|
4
2
|
$color?: string;
|
|
5
3
|
$size: string;
|
|
6
4
|
}>> & string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/IconFa/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/IconFa/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const StyledIcon = styled.svg<{\n $color?: string;\n $size: string;\n}>`\n display: inline-block;\n vertical-align: middle;\n height: ${({ $size }) => $size};\n width: ${({ $size }) => $size};\n path {\n fill: ${({ $color }) => $color};\n }\n`;\n\nexport default StyledIcon;\n"],"names":["StyledIcon","styled","svg","templateObject_1","__makeTemplateObject","_a","$size","$color"],"mappings":"iHAEO,MAAMA,EAAaC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,oEAAA,eAAA,0BAAA,YAAA,CAGlC,oEAG8B,eACD,0BAEG,cAHtB,SAACC,GAAc,OAAPA,EAAAC,KAAO,EAChB,SAACD,GAAc,OAAPA,EAAAC,KAAO,EAEd,SAACD,GAAe,OAAPA,EAAAE,MAAO"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React, { type HTMLAttributes, type Ref, type ReactNode, type ElementType } from "react";
|
|
2
2
|
import { type SpacingProps } from "../Spacing";
|
|
3
|
+
import { type ColourVariableType } from "src/types";
|
|
3
4
|
export type InfoBoxProps = SpacingProps & HTMLAttributes<HTMLElement> & {
|
|
4
5
|
/** background color of wrapping element, this will add default padding */
|
|
5
|
-
backgroundColor?: string;
|
|
6
|
+
backgroundColor?: ColourVariableType | string;
|
|
6
7
|
/** Title text */
|
|
7
8
|
titleText: string;
|
|
8
9
|
/** Title text colour */
|
|
9
|
-
titleTextColor?: string;
|
|
10
|
+
titleTextColor?: ColourVariableType | string;
|
|
10
11
|
/** Description text */
|
|
11
12
|
descriptionText: string;
|
|
12
13
|
/** Description text colour */
|
|
13
|
-
descriptionTextColor?: string;
|
|
14
|
+
descriptionTextColor?: ColourVariableType | string;
|
|
14
15
|
/** Space for extra element underneath description */
|
|
15
16
|
children?: ReactNode;
|
|
16
17
|
/** Icon in left column usually 2em squared */
|
|
@@ -24,5 +25,5 @@ export type InfoBoxProps = SpacingProps & HTMLAttributes<HTMLElement> & {
|
|
|
24
25
|
|
|
25
26
|
The more specific the the target the higher priority the css will have. For example `margin` will be overridden by the `marginVertical` or `marginHorizontal` props. `marginTop`, `marginBottom`, `marginLeft`, `marginRight` will override the the `marginVertical` and `marginHorizontal` props.
|
|
26
27
|
*/
|
|
27
|
-
export declare const InfoBox: ({ children, titleText, titleTextColor, descriptionText, descriptionTextColor, icon, ref, ...spacingAndHTMLElementProps }: InfoBoxProps) => React.JSX.Element;
|
|
28
|
+
export declare const InfoBox: ({ children, titleText, titleTextColor, descriptionText, descriptionTextColor, icon, backgroundColor, ref, ...spacingAndHTMLElementProps }: InfoBoxProps) => React.JSX.Element;
|
|
28
29
|
export default InfoBox;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as
|
|
1
|
+
import{__rest as e,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{Box as o}from"../Box/index.js";import{Text as i}from"../Text/index.js";import{Heading as n}from"../Heading/index.js";import{StyledInfoBox as l}from"./styles.js";import{themeColorOrString as m}from"../../utils/themeUtils.js";var a=function(a){var c=a.children,s=a.titleText,x=a.titleTextColor,d=a.descriptionText,p=a.descriptionTextColor,f=a.icon,g=a.backgroundColor,u=a.ref,C=e(a,["children","titleText","titleTextColor","descriptionText","descriptionTextColor","icon","backgroundColor","ref"]),T=g?m(g):"var(--clr-cruk-grey-200, #e6e6e6)",j=x?m(x):"var(--clr-text-dark, #000)",k=p?m(p):"var(--clr-text-dark, #000)";return t.createElement(l,r({},C,{backgroundColor:T,margin:C.margin||"none",ref:u}),f&&t.createElement(o,{marginRight:"s"},f),t.createElement("div",null,s&&t.createElement(n,{as:"p",margin:"none",h4:!0,marginBottom:"xxs",textColor:j},s),d&&t.createElement(i,{textColor:k,marginBottom:"none"},d),c))};export{a as InfoBox,a as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/InfoBox/index.tsx"],"sourcesContent":["import React, {\n type HTMLAttributes,\n type Ref,\n type ReactNode,\n type ElementType,\n} from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/InfoBox/index.tsx"],"sourcesContent":["import React, {\n type HTMLAttributes,\n type Ref,\n type ReactNode,\n type ElementType,\n} from \"react\";\n\nimport { Box } from \"../Box\";\nimport { Text } from \"../Text\";\nimport { Heading } from \"../Heading\";\n\nimport { type SpacingProps } from \"../Spacing\";\nimport { StyledInfoBox } from \"./styles\";\nimport { themeColorOrString } from \"../../utils/themeUtils\";\nimport { type ColourVariableType } from \"src/types\";\n\nexport type InfoBoxProps = SpacingProps &\n HTMLAttributes<HTMLElement> & {\n /** background color of wrapping element, this will add default padding */\n backgroundColor?: ColourVariableType | string;\n /** Title text */\n titleText: string;\n /** Title text colour */\n titleTextColor?: ColourVariableType | string;\n /** Description text */\n descriptionText: string;\n /** Description text colour */\n descriptionTextColor?: ColourVariableType | string;\n /** Space for extra element underneath description */\n children?: ReactNode;\n /** Icon in left column usually 2em squared */\n icon?: ReactNode;\n ref?: Ref<HTMLElement>;\n /** styled-component polymorphic feature so you take the styling of a box and cast the component to be a \"span\" for example */\n as?: ElementType;\n };\n\n/**\n * Box is used to wrap other components to add margin and padding. The values will be in the t-shirt sizes specified in the theme sizes.\n \n The more specific the the target the higher priority the css will have. For example `margin` will be overridden by the `marginVertical` or `marginHorizontal` props. `marginTop`, `marginBottom`, `marginLeft`, `marginRight` will override the the `marginVertical` and `marginHorizontal` props.\n */\nexport const InfoBox = ({\n children,\n titleText,\n titleTextColor,\n descriptionText,\n descriptionTextColor,\n icon,\n backgroundColor,\n ref,\n ...spacingAndHTMLElementProps\n}: InfoBoxProps) => {\n const backgroundColorOrDefault = backgroundColor\n ? themeColorOrString(backgroundColor)\n : \"var(--clr-cruk-grey-200, #e6e6e6)\";\n\n const textColorOrDefault = titleTextColor\n ? themeColorOrString(titleTextColor)\n : \"var(--clr-text-dark, #000)\";\n\n const descriptionTextColorOrDefault = descriptionTextColor\n ? themeColorOrString(descriptionTextColor)\n : \"var(--clr-text-dark, #000)\";\n\n return (\n <StyledInfoBox\n {...spacingAndHTMLElementProps}\n backgroundColor={backgroundColorOrDefault}\n margin={spacingAndHTMLElementProps.margin || \"none\"}\n ref={ref}\n >\n {icon && <Box marginRight=\"s\">{icon}</Box>}\n <div>\n {titleText && (\n <Heading\n as=\"p\"\n margin=\"none\"\n h4\n marginBottom=\"xxs\"\n textColor={textColorOrDefault}\n >\n {titleText}\n </Heading>\n )}\n {descriptionText && (\n <Text textColor={descriptionTextColorOrDefault} marginBottom=\"none\">\n {descriptionText}\n </Text>\n )}\n {children}\n </div>\n </StyledInfoBox>\n );\n};\n\nexport default InfoBox;\n"],"names":["InfoBox","_a","children","titleText","titleTextColor","descriptionText","descriptionTextColor","icon","backgroundColor","ref","spacingAndHTMLElementProps","__rest","backgroundColorOrDefault","themeColorOrString","textColorOrDefault","descriptionTextColorOrDefault","React","StyledInfoBox","__assign","margin","Box","marginRight","createElement","Heading","as","h4","marginBottom","textColor","Text"],"mappings":"4UA0CO,IAAMA,EAAU,SAACC,GACtB,IAAAC,EAAQD,EAAAC,SACRC,EAASF,EAAAE,UACTC,EAAcH,EAAAG,eACdC,EAAeJ,EAAAI,gBACfC,EAAoBL,EAAAK,qBACpBC,EAAIN,EAAAM,KACJC,EAAeP,EAAAO,gBACfC,EAAGR,EAAAQ,IACAC,EAA0BC,EAAAV,EATP,CAAA,WAAA,YAAA,iBAAA,kBAAA,uBAAA,OAAA,kBAAA,QAWhBW,EAA2BJ,EAC7BK,EAAmBL,GACnB,oCAEEM,EAAqBV,EACvBS,EAAmBT,GACnB,6BAEEW,EAAgCT,EAClCO,EAAmBP,GACnB,6BAEJ,OACEU,gBAACC,EAAaC,EAAA,CAAA,EACRR,EAA0B,CAC9BF,gBAAiBI,EACjBO,OAAQT,EAA2BS,QAAU,OAC7CV,IAAKA,IAEJF,GAAQS,gBAACI,EAAG,CAACC,YAAY,KAAKd,GAC/BS,EAAAM,cAAA,MAAA,KACGnB,GACCa,EAAAM,cAACC,EAAO,CACNC,GAAG,IACHL,OAAO,OACPM,IAAE,EACFC,aAAa,MACbC,UAAWb,GAEVX,GAGJE,GACCW,EAAAM,cAACM,GAAKD,UAAWZ,EAA+BW,aAAa,QAC1DrB,GAGJH,GAIT"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
type InfoBoxProps = BoxProps & {
|
|
1
|
+
import Box from "../Box";
|
|
2
|
+
type InfoBoxProps = React.ComponentProps<typeof Box> & {
|
|
4
3
|
css?: string;
|
|
5
|
-
theme: ThemeType;
|
|
6
4
|
};
|
|
7
5
|
export declare const StyledInfoBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../Spacing").SpacingProps & import("react").HTMLAttributes<HTMLElement> & {
|
|
8
|
-
backgroundColor?: string;
|
|
6
|
+
backgroundColor?: string | import("..").ColourVariableType;
|
|
9
7
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
10
8
|
children?: import("react").ReactNode;
|
|
11
9
|
as?: import("react").ElementType;
|
|
12
|
-
}, InfoBoxProps>> & string & Omit<({ ...props }: BoxProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
10
|
+
}, InfoBoxProps>> & string & Omit<({ ...props }: import("../Box").BoxProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
13
11
|
export default StyledInfoBox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/InfoBox/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/InfoBox/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport Box from \"../Box\";\n\ntype InfoBoxProps = React.ComponentProps<typeof Box> & {\n css?: string;\n};\n\nexport const StyledInfoBox = styled(Box)<InfoBoxProps>`\n display: flex;\n flex-shrink: 0;\n\n svg {\n margin-top: 0;\n }\n\n ${(props) =>\n props.css &&\n css`\n ${props.css}\n `}\n`;\n\nexport default StyledInfoBox;\n"],"names":["StyledInfoBox","styled","Box","templateObject_2","__makeTemplateObject","props","css","templateObject_1"],"mappings":"iKAQO,QAAMA,EAAgBC,EAAOC,EAAPD,CAAWE,IAAAA,EAAAC,EAAA,CAAA,kFAAA,MAAA,CAAc,kFAYjD,QAJD,SAACC,GACD,OAAAA,EAAMC,KACNA,EAAGC,IAAAA,EAAAH,EAAA,CAAA,WAAA,UAAA,CAAA,WACU,YAATC,EAAMC,IAFV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import
|
|
1
|
+
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import n from"react";import{HintText as l,Label as r,LabelText as i,RequiredIndicationText as a}from"./styles.js";function o(o){var m=o.label,d=o.hintText,u=o.required,c=void 0!==u&&u,s=o.hideRequiredIndicationInLabel,h=void 0!==s&&s,b=o.children,f=e(o,["label","hintText","required","hideRequiredIndicationInLabel","children"]),p=d&&("string"==typeof d&&d.length||"number"==typeof d)?n.createElement(l,null,d):d;return n.createElement(n.Fragment,null,m?n.createElement(r,t({},f),n.createElement(i,{$hasHintText:!!d},m,!c&&!h&&n.createElement(a,null," (optional)")),p,b):n.createElement(n.Fragment,null,b))}export{o as LabelWrapper,o as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/LabelWrapper/index.tsx"],"sourcesContent":["import React, { type LabelHTMLAttributes, type ReactNode } from \"react\";\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/LabelWrapper/index.tsx"],"sourcesContent":["import React, { type LabelHTMLAttributes, type ReactNode } from \"react\";\n\nimport { LabelText, Label, RequiredIndicationText, HintText } from \"./styles\";\n\ntype LabelWrapperProps = LabelHTMLAttributes<HTMLLabelElement> & {\n /** label text */\n label: string;\n /** hint text or react element in it's place */\n hintText?: ReactNode;\n /** if field is required, when not required (optional) appears in label */\n required?: boolean;\n /** flag to stop (optional) appearing in label, useful for compound form components like DateInput */\n hideRequiredIndicationInLabel?: boolean;\n children?: ReactNode;\n};\n\nexport function LabelWrapper({\n label,\n hintText,\n required = false,\n hideRequiredIndicationInLabel = false,\n children,\n ...otherHTMLLabelProps\n}: LabelWrapperProps) {\n const hintTextElement =\n !!hintText &&\n ((typeof hintText === \"string\" && hintText.length) ||\n typeof hintText === \"number\") ? (\n <HintText>{hintText}</HintText>\n ) : (\n hintText\n );\n\n return (\n <>\n {label ? (\n <Label {...otherHTMLLabelProps}>\n <LabelText $hasHintText={!!hintText}>\n {label}\n {!required && !hideRequiredIndicationInLabel && (\n <RequiredIndicationText>{` (optional)`}</RequiredIndicationText>\n )}\n </LabelText>\n {hintTextElement}\n {children}\n </Label>\n ) : (\n <>{children}</>\n )}\n </>\n );\n}\n\nexport default LabelWrapper;\n"],"names":["LabelWrapper","_a","label","hintText","_b","required","_c","hideRequiredIndicationInLabel","children","otherHTMLLabelProps","__rest","hintTextElement","length","React","createElement","HintText","Fragment","Label","__assign","LabelText","$hasHintText","RequiredIndicationText"],"mappings":"kMAgBM,SAAUA,EAAaC,GAC3B,IAAAC,EAAKD,EAAAC,MACLC,EAAQF,EAAAE,SACRC,EAAAH,EAAAI,SAAAA,OAAQ,IAAAD,GAAQA,EAChBE,kCAAAC,OAA6B,IAAAD,GAAQA,EACrCE,EAAQP,EAAAO,SACLC,EAAmBC,EAAAT,EANK,CAAA,QAAA,WAAA,WAAA,gCAAA,aAQrBU,EACFR,IACoB,iBAAbA,GAAyBA,EAASS,QACrB,iBAAbT,GACPU,EAAAC,cAACC,OAAUZ,GAAoB,EAKnC,OACEU,EAAAC,cAAAD,EAAAG,SAAA,KACGd,EACCW,EAAAC,cAACG,EAAKC,EAAA,CAAA,EAAKT,GACTI,EAAAC,cAACK,EAAS,CAAAC,eAAiBjB,GACxBD,GACCG,IAAaE,GACbM,EAAAC,cAACO,EAAsB,KAAE,gBAG5BV,EACAH,GAGHK,EAAAC,cAAAD,EAAAG,SAAA,KAAGR,GAIX"}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
2
|
+
export declare const HintText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
3
|
+
export declare const RequiredIndicationText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
4
|
+
export declare const LabelText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
3
5
|
$hasHintText: boolean;
|
|
4
|
-
theme: ThemeType;
|
|
5
|
-
};
|
|
6
|
-
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
|
|
7
|
-
theme: ThemeType;
|
|
8
6
|
}>> & string;
|
|
9
|
-
export declare const HintText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
10
|
-
theme: ThemeType;
|
|
11
|
-
}>> & string;
|
|
12
|
-
export declare const RequiredIndicationText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
13
|
-
theme: ThemeType;
|
|
14
|
-
}>> & string;
|
|
15
|
-
export declare const LabelText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, LabelTextProp>> & string;
|
|
16
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";var
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";var a,i,o,s,e=t.label(a||(a=n(['\n position: relative;\n display: block;\n width: 100%;\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n margin-bottom: var(--spacing-s, 1.5rem);\n'],['\n position: relative;\n display: block;\n width: 100%;\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n margin-bottom: var(--spacing-s, 1.5rem);\n']))),l=t.span(i||(i=n(['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-base, 300);\n display: block;\n color: var(--clr-text-mid, #666);\n margin-bottom: var(--spacing-xs, 1rem);\n'],['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-base, 300);\n display: block;\n color: var(--clr-text-mid, #666);\n margin-bottom: var(--spacing-xs, 1rem);\n']))),r=t.span(o||(o=n(['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-base, 300);\n'],['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-base, 300);\n']))),f=t.span(s||(s=n(['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n display: block;\n margin-bottom: ',";\n\n // increase font size for desktop\n @media (min-width: 1200px) {\n font-size: var(--font-size-ml, 1.125rem);\n }\n"],['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n display: block;\n margin-bottom: ',";\n\n // increase font size for desktop\n @media (min-width: 1200px) {\n font-size: var(--font-size-ml, 1.125rem);\n }\n"])),function(n){return n.$hasHintText?"var(--spacing-xxxs, 0.25rem)":"var(--spacing-xs, 1rem)"});export{l as HintText,e as Label,f as LabelText,r as RequiredIndicationText};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/LabelWrapper/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/LabelWrapper/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const Label = styled.label`\n position: relative;\n display: block;\n width: 100%;\n font-family: var(--typ-font-family-label, \"Poppins\", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n margin-bottom: var(--spacing-s, 1.5rem);\n`;\n\nexport const HintText = styled.span`\n font-family: var(--typ-font-family-label, \"Poppins\", Arial, sans-serif);\n font-weight: var(--typ-font-weight-base, 300);\n display: block;\n color: var(--clr-text-mid, #666);\n margin-bottom: var(--spacing-xs, 1rem);\n`;\n\nexport const RequiredIndicationText = styled.span`\n font-family: var(--typ-font-family-label, \"Poppins\", Arial, sans-serif);\n font-weight: var(--typ-font-weight-base, 300);\n`;\n\nexport const LabelText = styled.span<{\n $hasHintText: boolean;\n}>`\n font-family: var(--typ-font-family-label, \"Poppins\", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n display: block;\n margin-bottom: ${({ $hasHintText }) =>\n $hasHintText ? \"var(--spacing-xxxs, 0.25rem)\" : \"var(--spacing-xs, 1rem)\"};\n\n // increase font size for desktop\n @media (min-width: 1200px) {\n font-size: var(--font-size-ml, 1.125rem);\n }\n`;\n"],"names":["Label","styled","label","templateObject_1","__makeTemplateObject","HintText","span","templateObject_2","RequiredIndicationText","templateObject_3","LabelText","templateObject_4","_a","$hasHintText"],"mappings":"iHAEO,YAAMA,EAAQC,EAAOC,MAAKC,IAAAA,EAAAC,EAAA,CAAA,4OAAA,CAAA,+OASpBC,EAAWJ,EAAOK,KAAIC,IAAAA,EAAAH,EAAA,CAAA,uOAAA,CAAA,0OAQtBI,EAAyBP,EAAOK,KAAIG,IAAAA,EAAAL,EAAA,CAAA,oIAAA,CAAA,uIAKpCM,EAAYT,EAAOK,KAAIK,IAAAA,EAAAP,EAAA,CAAA,yKAAA,kIAAA,CAElC,yKAK2E,oIAD1D,SAACQ,GAChB,OAD8BA,EAAAC,aACf,+BAAiC,yBAAhD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{
|
|
1
|
+
import{__rest as e,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{ErrorText as n}from"../ErrorText/index.js";import{HintText as o,StyledFieldset as s,LegendSpan as l}from"./styles.js";function a(a){var i=a.children,m=a.legendText,d=a.required,x=a.errorMessage,c=a.hasError,p=a.hintText,E=e(a,["children","legendText","required","errorMessage","hasError","hintText"]),h=!p||"string"!=typeof p&&"number"!=typeof p?p:t.createElement(o,null,p);return t.createElement(s,{$hasError:c||!!x||!1,$hasHintText:!!p},m&&t.createElement("legend",r({},E),t.createElement(l,{$hasHintText:!!p},m," ",!d&&t.createElement("span",null,"(optional)")),h),i,!!x&&t.createElement(n,{marginTop:"xxs"},x))}export{a as LegendWrapper,a as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/LegendWrapper/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ReactNode } from \"react\";\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/LegendWrapper/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ReactNode } from \"react\";\n\nimport { ErrorText } from \"../ErrorText\";\n\nimport { StyledFieldset, LegendSpan, HintText } from \"./styles\";\n\nexport type LegendWrapperProps = HTMLAttributes<HTMLLegendElement> & {\n children?: ReactNode;\n /** legend text */\n legendText: string;\n /** error message text */\n errorMessage?: string;\n /** flag for error styling */\n hasError?: boolean;\n /** if field is required, when not required (optional) appears in legend */\n required?: boolean;\n /** hint text */\n hintText?: ReactNode;\n};\n/**\n * LegendWrapper allows the user to add an outer label for a checkbox / group of checkboxes / radio buttons or a group of radio buttons.\n *\n * hasError and errorMessage props are just props that can be passed into the component.\n * There is no functionality checking if the children are valid/required etc this functionality will be needed to ne added outside of this component.\n */\nexport function LegendWrapper({\n children,\n legendText,\n required,\n errorMessage,\n hasError,\n hintText,\n ...restOfHTMLAttributes\n}: LegendWrapperProps) {\n const hintTextElement =\n !!hintText &&\n (typeof hintText === \"string\" || typeof hintText === \"number\") ? (\n <HintText>{hintText}</HintText>\n ) : (\n hintText\n );\n return (\n <StyledFieldset\n $hasError={hasError || !!errorMessage || false}\n $hasHintText={!!hintText}\n >\n {legendText && (\n <legend {...restOfHTMLAttributes}>\n <LegendSpan $hasHintText={!!hintText}>\n {legendText} {!required && <span>(optional)</span>}\n </LegendSpan>\n {hintTextElement}\n </legend>\n )}\n {children}\n {!!errorMessage && <ErrorText marginTop=\"xxs\">{errorMessage}</ErrorText>}\n </StyledFieldset>\n );\n}\n\nexport default LegendWrapper;\n"],"names":["LegendWrapper","_a","children","legendText","required","errorMessage","hasError","hintText","restOfHTMLAttributes","__rest","hintTextElement","React","createElement","HintText","StyledFieldset","$hasError","$hasHintText","__assign","LegendSpan","ErrorText","marginTop"],"mappings":"kOAyBM,SAAUA,EAAcC,GAC5B,IAAAC,aACAC,eACAC,aACAC,iBACAC,aACAC,aACGC,EAAoBC,EAAAR,EAPK,CAAA,WAAA,aAAA,WAAA,eAAA,WAAA,aAStBS,GACFH,GACmB,iBAAbA,GAA6C,iBAAbA,EACP,EAA/BI,EAAAC,cAACC,EAAQ,KAAEN,GAIf,OACEI,EAAAC,cAACE,EAAc,CAAAC,UACFT,KAAcD,IAAgB,EAAKW,eAC9BT,GAEfJ,GACCQ,EAAAC,cAAA,SAAAK,EAAA,CAAA,EAAYT,GACVG,EAAAC,cAACM,EAAU,CAAAF,eAAiBT,GACzBJ,OAAcC,GAAYO,EAAAC,cAAA,OAAA,KAAA,eAE5BF,GAGJR,IACEG,GAAgBM,EAAAC,cAACO,EAAS,CAACC,UAAU,OAAOf,GAGrD"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { type ThemeType } from "../../types";
|
|
2
1
|
type StyledFieldsetProps = {
|
|
3
2
|
$hasError?: boolean;
|
|
4
3
|
$hasHintText?: boolean;
|
|
5
|
-
theme: ThemeType;
|
|
6
4
|
};
|
|
7
5
|
export declare const LegendSpan: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
8
6
|
$hasHintText: boolean;
|
|
9
|
-
theme: ThemeType;
|
|
10
|
-
}>> & string;
|
|
11
|
-
export declare const HintText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
12
|
-
theme: ThemeType;
|
|
13
7
|
}>> & string;
|
|
8
|
+
export declare const HintText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
14
9
|
export declare const StyledFieldset: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, StyledFieldsetProps>> & string;
|
|
15
10
|
export {};
|