@cruk/cruk-react-components 5.0.0 → 5.0.2
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 +24 -0
- package/lib/components/AddressLookup/styles.d.ts +1 -1
- package/lib/components/AllThemesWrapper.d.ts +4 -6
- package/lib/components/Avatar/styles.d.ts +3 -4
- package/lib/components/Badge/index.d.ts +3 -3
- package/lib/components/Badge/styles.d.ts +7 -8
- package/lib/components/Box/styles.d.ts +4 -4
- package/lib/components/Button/styles.d.ts +7 -9
- package/lib/components/Carousel/Dots.d.ts +4 -5
- package/lib/components/Carousel/styles.d.ts +24 -29
- package/lib/components/Checkbox/styles.d.ts +13 -12
- package/lib/components/Collapse/styles.d.ts +6 -6
- package/lib/components/DateField/styles.d.ts +9 -7
- package/lib/components/Divider.d.ts +2 -3
- package/lib/components/Flex.d.ts +2 -1
- package/lib/components/Header/styles.d.ts +19 -22
- package/lib/components/Heading/index.d.ts +3 -3
- package/lib/components/Heading/styles.d.ts +8 -8
- package/lib/components/IconFa/index.d.ts +1 -1
- package/lib/components/LabelWrapper/styles.d.ts +1 -1
- package/lib/components/LegendWrapper/styles.d.ts +3 -3
- package/lib/components/Link/styles.d.ts +2 -2
- package/lib/components/Modal/styles.d.ts +12 -13
- package/lib/components/Pagination/styles.d.ts +10 -12
- package/lib/components/PopOver/styles.d.ts +5 -5
- package/lib/components/ProgressBar/styles.d.ts +25 -29
- package/lib/components/Radio/styles.d.ts +15 -15
- package/lib/components/RadioConsent/styles.d.ts +8 -6
- package/lib/components/Select/styles.d.ts +2 -2
- package/lib/components/Spacing/index.d.ts +51 -2
- package/lib/components/Step/styles.d.ts +12 -14
- package/lib/components/Text/styles.d.ts +10 -10
- package/lib/components/TextAreaField/TextAreaField.stories.d.ts +0 -1
- package/lib/components/TextAreaField/styles.d.ts +3 -3
- package/lib/components/TextField/styles.d.ts +4 -4
- package/lib/components/ThemeCheatSheet.d.ts +2 -3
- package/lib/components/Totaliser/index.d.ts +2 -2
- package/lib/components/Totaliser/styles.d.ts +20 -14
- 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 +1 -1
- package/lib/src/components/AddressLookup/styles.js.map +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 +1 -1
- package/lib/src/components/Avatar/styles.js.map +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 +1 -1
- package/lib/src/components/Badge/styles.js.map +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 +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.js +1 -1
- package/lib/src/components/Button/styles.js.map +1 -1
- 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 +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.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.js +1 -1
- package/lib/src/components/Collapse/styles.js.map +1 -1
- package/lib/src/components/DateField/styles.js.map +1 -1
- package/lib/src/components/Divider.js +1 -1
- package/lib/src/components/Divider.js.map +1 -1
- package/lib/src/components/Flex.js +1 -1
- package/lib/src/components/Flex.js.map +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 +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.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/LabelWrapper/index.js +1 -1
- package/lib/src/components/LabelWrapper/index.js.map +1 -1
- 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.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.js +1 -1
- package/lib/src/components/Link/styles.js.map +1 -1
- package/lib/src/components/Modal/index.js +1 -1
- package/lib/src/components/Modal/index.js.map +1 -1
- package/lib/src/components/Modal/styles.js +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.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.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.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.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.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.js +1 -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/src/components/Step/index.js +1 -1
- package/lib/src/components/Step/index.js.map +1 -1
- 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.js +1 -1
- package/lib/src/components/Text/index.js.map +1 -1
- 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.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.js +1 -1
- package/lib/src/components/TextField/styles.js.map +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 +1 -1
- package/lib/src/components/Totaliser/styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -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\";\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 ? setContentHeight(\"initial\") : setContentHeight(\"0\");\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
|
|
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\";\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 ? setContentHeight(\"initial\") : setContentHeight(\"0\");\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 faIcon={faChevronDown} $open={openStatus} />\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","_a","id","headerTitleText","headerTitleTextColor","headerTitleTextSize","headerTitleTextFontFamily","headerComponent","startOpen","onOpenChange","children","_b","useState","openStatus","setOpenStatus","_c","contentHeight","setContentHeight","content","useRef","transitionTimer","foundTheme","useTheme","theme","__assign","defaultTheme","toggleCollapse","current","clearTimeout","newOpenState","concat","scrollHeight","setTimeout","transitionDurationSeconds","undefined","useEffect","React","createElement","CustomHeader","onClick","onKeyDown","event","key","preventDefault","role","tabIndex","DefaultHeader","type","appearance","$textColor","$textSize","FlippingIcon","faIcon","faChevronDown","$open","CollapseContent","ref","$contentHeight","$openStatus"],"mappings":"scAgDM,SAAUA,EAASC,OACvBC,EAAED,EAAAC,GACFC,EAAeF,EAAAE,gBACfC,EAAoBH,EAAAG,qBACpBC,EAAmBJ,EAAAI,oBACnBC,8BACAC,EAAeN,EAAAM,gBACfC,EAASP,EAAAO,UACTC,EAAYR,EAAAQ,aACZC,EAAQT,EAAAS,SAEFC,EAA8BC,EAASJ,IAAa,GAAnDK,EAAUF,EAAA,GAAEG,OACbC,EAAoCH,EACxCJ,EAAY,UAAY,KADnBQ,OAAeC,OAGhBC,EAAUC,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BAAA,GAAAiB,OAAG5B,EAAW,WAAAuD,eACfzC,EAAa0C,YAChB7C,GAEZH,GAIT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";import{Button as t}from"../Button/index.js";import{IconFa as i}from"../IconFa/index.js";var e,r,a,s,l=.5,f=o(i)(e||(e=n(["\n transform: ",";\n transition-duration: ","s;\n"],["\n transform: ",";\n transition-duration: ","s;\n"])),(function(n){return n
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";import{Button as t}from"../Button/index.js";import{IconFa as i}from"../IconFa/index.js";var e,r,a,s,l=.5,f=o(i)(e||(e=n(["\n transform: ",";\n transition-duration: ","s;\n"],["\n transform: ",";\n transition-duration: ","s;\n"])),(function(n){return n.$open?"translateY(0.1em) scaleY(-1)":"initial"}),.5),m=o(t)(r||(r=n(["\n display: flex;\n color: ",";\n font-size: ",";\n font-family: ",";\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: ",";\n }\n"],["\n display: flex;\n color: ",";\n font-size: ",";\n font-family: ",";\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: ",";\n }\n"])),(function(n){var o=n.theme,t=n.$textColor;return t&&void 0!==o.colors[t]?o.colors[t]:t||o.colors.collapseHeaderColor}),(function(n){var o=n.theme,t=o.fontSizes,i=o.fontSizes.m,e=n.$textSize;return e?t[e]:i}),(function(n){var o=n.theme;return n.$textFontFamily||o.typography.fontFamilyBase}),(function(n){var o=n.theme.colors,t=n.$textColor;return t&&void 0!==o[t]?o[t]:t||o.collapseHeaderColor})),c=o.div(a||(a=n(["\n margin: 0;\n transition: ","s ease;\n height: ",";\n visibility: ",";\n overflow: hidden;\n & > p {\n margin-top: 0;\n }\n"],["\n margin: 0;\n transition: ","s ease;\n height: ",";\n visibility: ",";\n overflow: hidden;\n & > p {\n margin-top: 0;\n }\n"])),.5,(function(n){return n.$contentHeight}),(function(n){return n.$openStatus?"visible":"hidden"})),d=o.div(s||(s=n(["\n cursor: pointer;\n"],["\n cursor: pointer;\n"])));export{c as CollapseContent,d as CustomHeader,m as DefaultHeader,f as FlippingIcon,l as transitionDurationSeconds};
|
|
2
2
|
//# 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\";\nimport IconFa from \"../IconFa\";\n\
|
|
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\";\nimport IconFa from \"../IconFa\";\n\nexport const transitionDurationSeconds = 0.5;\n\nexport const FlippingIcon = styled(IconFa)<{ $open: boolean }>`\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","IconFa","templateObject_1","__makeTemplateObject","_a","$open","DefaultHeader","Button","templateObject_2","theme","$textColor","colors","collapseHeaderColor","_b","fontSizes","m","$textSize","$textFontFamily","typography","fontFamilyBase","CollapseContent","div","templateObject_3","$contentHeight","$openStatus","CustomHeader","templateObject_4"],"mappings":"yMAUO,YAAMA,EAA4B,GAE5BC,EAAeC,EAAOC,EAAPD,CAAkCE,IAAAA,EAAAC,EAAA,CAAA,kBAAA,6BAAA,QAAA,CAAA,kBAER,6BACJ,WAFnC,SAACC,GACZ,OADmBA,EAAAC,MACX,+BAAiC,SAAzC,GAJqC,IAQ5BC,EAAgBN,EAAOO,EAAPP,CAK3BQ,IAAAA,EAAAL,EAAA,CAAA,gCAAA,mBAAA,qBAAA,+KAAA,YAAA,CAAA,gCAMoD,mBAOR,qBAEQ,+KAYJ,eAzBvC,SAACC,OAAEK,EAAKL,EAAAK,MAAEC,EAAUN,EAAAM,WAC3B,OAAEA,QACkD,IAA7CD,EAAME,OAAOD,GAChBD,EAAME,OAAOD,GACbA,GAAcD,EAAME,OAAOC,mBAH/B,IAIW,SAACR,OACZS,EAGCT,EAAAK,MAFCK,EAASD,EAAAC,UACIC,EAACF,EAAAC,UAAAC,EAEhBC,EAASZ,EAAAY,UACL,OAACA,EAAYF,EAAUE,GAAaD,CAApC,IACS,SAACX,OAAEK,EAAKL,EAAAK,MACrB,OADsCL,EAAAa,iBACnBR,EAAMS,WAAWC,cAApC,IASS,SAACf,OAAWO,EAAMP,EAAAK,MAAAE,OAAID,EAAUN,EAAAM,WACvC,OAAAA,QAA4D,IAAvCC,EAAOD,GACxBC,EAAOD,GACPA,GAAcC,EAAOC,mBAFzB,IAMOQ,EAAkBpB,EAAOqB,IAGpCC,IAAAA,EAAAnB,EAAA,CAAA,iCAAA,sBAAA,oBAAA,gEAAA,CAAA,iCAEuC,sBACqC,oBAExC,kEApDG,IAkD7B,SAACC,GAAmD,OAAnCA,EAAAmB,cAAmC,IAChD,SAACnB,GACb,OAD0BA,EAAAoB,YACZ,UAAY,QAA1B,IAOSC,EAAezB,EAAOqB,IAAGK,IAAAA,EAAAvB,EAAA,CAAA,0BAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/DateField/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\nimport Text from \"../Text\";\n\
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/DateField/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\nimport Text from \"../Text\";\n\nexport const Fieldset = styled.fieldset`\n margin: 0;\n padding: 0;\n border: 0;\n *,\n *:after,\n *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n`;\n\nexport const TextAsLabel = styled(Text)<{ theme: ThemeType }>`\n font-family: ${({ theme }) => theme.typography.fontFamilyLabel};\n`;\n\nexport const DateTextFieldWrapper = styled.div<{ theme: ThemeType }>`\n display: inline-block;\n width: 60px;\n margin-right: ${({ theme }) => theme.spacing.xs};\n span {\n margin-bottom: 0.25rem; // this is smaller than xxs spacing\n font-weight: ${({ theme }) => theme.typography.fontWeightBase};\n }\n`;\n\nexport const LargeDateTextFieldWrapper = styled(DateTextFieldWrapper)`\n width: 80px;\n`;\n\nexport const ErrorTextWrapper = styled.div`\n clear: left;\n`;\n"],"names":["Fieldset","styled","fieldset","templateObject_1","__makeTemplateObject","Text","templateObject_2","_a","theme","typography","fontFamilyLabel","DateTextFieldWrapper","div","templateObject_3","spacing","xs","fontWeightBase","LargeDateTextFieldWrapper","templateObject_4","ErrorTextWrapper","templateObject_5"],"mappings":"yJAIa,IAAAA,EAAWC,EAAOC,SAAQC,IAAAA,EAAAC,EAAA,CAAA,0LAAA,CAAA,6LAaZH,EAAOI,EAAPJ,CAAYK,IAAAA,EAAAF,EAAA,CAAA,oBAAA,OAAA,CAAsB,oBACG,UAA/C,SAACG,GAAc,OAAPA,EAAAC,MAAaC,WAAWC,eAAjB,IAGzB,cAAMC,EAAuBV,EAAOW,IAAyBC,IAAAA,EAAAT,EAAA,CAAA,+DAAA,kGAAA,YAAA,CAAA,+DAGnB,kGAGgB,eAH/C,SAACG,GAAc,OAAPA,EAAAC,MAAaM,QAAQC,EAAd,IAGd,SAACR,GAAc,OAAPA,EAAAC,MAAaC,WAAWO,cAAjB,IAIrBC,EAA4BhB,EAAOU,EAAPV,CAA4BiB,IAAAA,EAAAd,EAAA,CAAA,sBAAA,CAAA,yBAIxDe,EAAmBlB,EAAOW,IAAGQ,IAAAA,EAAAhB,EAAA,CAAA,sBAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../node_modules/tslib/tslib.es6.js";import e from"react";import t from"styled-components";var i,o=t.div(i||(i=n(['\n align-items: center;\n display: flex;\n flex-basis: 100%;\n padding-bottom: 10px;\n padding-top: 10px;\n text-align: center;\n width: 100%;\n
|
|
1
|
+
import{__makeTemplateObject as n}from"../../node_modules/tslib/tslib.es6.js";import e from"react";import t from"styled-components";var i,o=t.div(i||(i=n(['\n align-items: center;\n display: flex;\n flex-basis: 100%;\n padding-bottom: 10px;\n padding-top: 10px;\n text-align: center;\n width: 100%;\n &:before,\n &:after {\n background-color: #333;\n content: "";\n display: inline-block;\n flex-grow: 1;\n height: 1px;\n }\n'],['\n align-items: center;\n display: flex;\n flex-basis: 100%;\n padding-bottom: 10px;\n padding-top: 10px;\n text-align: center;\n width: 100%;\n &:before,\n &:after {\n background-color: #333;\n content: "";\n display: inline-block;\n flex-grow: 1;\n height: 1px;\n }\n']))),l=function(n){var t=n.children;return e.createElement(o,null,t)};export{l as Divider,l as default};
|
|
2
2
|
//# sourceMappingURL=Divider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sources":["../../../src/components/Divider.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\";\nimport styled from \"styled-components\";\n\nconst StyledDivider = styled.div`\n align-items: center;\n display: flex;\n flex-basis: 100%;\n padding-bottom: 10px;\n padding-top: 10px;\n text-align: center;\n width: 100%;\n
|
|
1
|
+
{"version":3,"file":"Divider.js","sources":["../../../src/components/Divider.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\";\nimport styled from \"styled-components\";\n\nconst StyledDivider = styled.div`\n align-items: center;\n display: flex;\n flex-basis: 100%;\n padding-bottom: 10px;\n padding-top: 10px;\n text-align: center;\n width: 100%;\n &:before,\n &:after {\n background-color: #333;\n content: \"\";\n display: inline-block;\n flex-grow: 1;\n height: 1px;\n }\n`;\n\nexport const Divider = ({ children }: { children?: ReactNode }) => (\n <StyledDivider>{children}</StyledDivider>\n);\n\nexport default Divider;\n"],"names":["StyledDivider","styled","div","templateObject_1","__makeTemplateObject","Divider","_a","children","React","createElement"],"mappings":"mIAGA,MAAMA,EAAgBC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,0SAAA,CAAA,6SAkBnBC,EAAU,SAACC,GAAE,IAAAC,EAAQD,EAAAC,SAAiC,OACjEC,EAACC,cAAAT,EAAe,KAAAO,EADiD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../node_modules/tslib/tslib.es6.js";import i from"styled-components";import{
|
|
1
|
+
import{__makeTemplateObject as e,__assign as n}from"../../node_modules/tslib/tslib.es6.js";import t from"react";import i from"styled-components";import{spacing as r,spacingPropsToSpacingPropsInternal as m}from"./Spacing/index.js";var o,a=i.div(o||(o=e(["\n display: block;\n @media (min-width: ",") {\n display: flex;\n }\n ","\n"],["\n display: block;\n @media (min-width: ",") {\n display: flex;\n }\n ","\n"])),(function(e){return e.theme.breakpoint.tablet}),(function(e){return r(e,e.theme)}));function l(e){var i=m(e);return t.createElement(a,n({theme:e.theme},i))}export{l as Flex,l as default};
|
|
2
2
|
//# sourceMappingURL=Flex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.js","sources":["../../../src/components/Flex.tsx"],"sourcesContent":["import styled from \"styled-components\";\nimport spacing
|
|
1
|
+
{"version":3,"file":"Flex.js","sources":["../../../src/components/Flex.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"styled-components\";\nimport {\n spacing,\n type SpacingPropsInternal,\n spacingPropsToSpacingPropsInternal,\n type SpacingProps,\n} from \"./Spacing\";\nimport { type ThemeType } from \"../types\";\n\ntype StyledProps = SpacingPropsInternal & {\n theme: ThemeType;\n};\n\nconst FlexStyled = styled.div<StyledProps>`\n display: block;\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n display: flex;\n }\n ${(props) => spacing(props, props.theme as ThemeType)}\n`;\n\ntype Props = SpacingProps & {\n theme: ThemeType;\n};\nexport function Flex(props: Props) {\n const spacingProps = spacingPropsToSpacingPropsInternal(props);\n\n return <FlexStyled theme={props.theme} {...spacingProps} />;\n}\n\nexport default Flex;\n"],"names":["FlexStyled","styled","div","templateObject_1","__makeTemplateObject","_a","theme","breakpoint","tablet","props","spacing","Flex","spacingProps","spacingPropsToSpacingPropsInternal","React","createElement","__assign"],"mappings":"sOAcA,MAAMA,EAAaC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,6CAAA,mCAAA,MAAA,CAAa,6CAEmB,mCAGN,SAHhC,SAACC,GAAc,OAAPA,EAAAC,MAAaC,WAAWC,MAAjB,IAGlC,SAACC,GAAU,OAAAC,EAAQD,EAAOA,EAAMH,MAArB,IAMT,SAAUK,EAAKF,GACnB,IAAMG,EAAeC,EAAmCJ,GAExD,OAAOK,EAAAC,cAACf,EAAUgB,EAAA,CAACV,MAAOG,EAAMH,OAAWM,GAC7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import t,{useState as l}from"react";import{useTheme as o,ThemeProvider as n}from"styled-components";import i from"../../hooks/useScrollPosition.js";import{crukTheme as r}from"../../themes/cruk.js";import{StyledHeader as m,HeaderStickyPlaceHolder as c,HeaderStickyContainer as s,SkipToMain as a,HeaderMainContent as u,StyledLink as f,LogoWrapper as g,Logo as d,Tagline as E,ChildWrapper as S,ChildInner as h}from"./styles.js";function k(k){var p=k.isSticky,y=k.siteSlogan
|
|
1
|
+
import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import t,{useState as l}from"react";import{useTheme as o,ThemeProvider as n}from"styled-components";import i from"../../hooks/useScrollPosition.js";import{crukTheme as r}from"../../themes/cruk.js";import{StyledHeader as m,HeaderStickyPlaceHolder as c,HeaderStickyContainer as s,SkipToMain as a,HeaderMainContent as u,StyledLink as f,LogoWrapper as g,Logo as d,Tagline as E,ChildWrapper as S,ChildInner as h}from"./styles.js";function k(k){var p=k.isSticky,y=k.siteSlogan,$=k.logoAltText,j=k.logoImageSrc,C=k.logoLinkTitle,b=k.logoLinkUrl,v=k.fullWidth,w=k.children,x=l(!1),A=x[0],L=x[1],P="undefined"!=typeof window,T=o(),U=e(e({},r),T);return i((function(e){var t=e.currPos,l=!!P&&t.y>240;l!==A&&L(l)}),[A],null,!0,50),t.createElement(n,{theme:U},t.createElement(m,null,t.createElement(c,null,t.createElement(s,{"data-cy":"header-sticky-container",$isSmall:A,$isSticky:p},t.createElement(a,{href:"#main"},"Skip to main content"),t.createElement(u,{$fullWidth:v},t.createElement(f,{href:null!=b?b:U.siteConfig.logoUrl,title:null!=C?C:"Home"},t.createElement(g,{$isSmall:A,$isSticky:p},t.createElement(d,{height:80,src:null!=j?j:U.siteConfig.logoSrc,alt:null!=$?$:U.siteConfig.logoAlt}))),y?t.createElement(E,{$isSmall:A,$isSticky:p},y):null,t.createElement(S,null,t.createElement(h,null,w)))))))}export{k as Header,k as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Header/index.tsx"],"sourcesContent":["import React, { useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { useScrollPosition } from \"../../hooks/useScrollPosition\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport {\n StyledHeader,\n HeaderStickyContainer,\n HeaderStickyPlaceHolder,\n HeaderMainContent,\n SkipToMain,\n StyledLink,\n Logo,\n LogoWrapper,\n Tagline,\n ChildWrapper,\n ChildInner,\n} from \"./styles\";\n\nconst HEADER_SCROLL_THRESHOLD = 240;\n\nexport type HeaderProps = HTMLAttributes<HTMLElement> & {\n /** flag which make header fixed to the top even when scrolling */\n isSticky?: boolean;\n /** text in the middle of the header */\n siteSlogan?: string;\n /** text to explain the content of the icon for a11y usually a description of where the link will take you */\n logoAltText?: string;\n /** header logo image url */\n logoImageSrc?: string;\n /** title of the header image component, this is mainly for the tooltip text on hover */\n logoLinkTitle?: string;\n /** the url of the logo link */\n logoLinkUrl?: string;\n /** instead of the contents of the header being centered to max width as defined in theme it is 100% width fo viewport */\n fullWidth?: boolean;\n\n children?: ReactNode;\n};\n\n/**\n * There should be only one header component near or at the top of the body of each page.\n *\n * ### Logos\n * It is recommended that logo images are at least 80px high if they are not SVGs and that the logo is still clearly legible when reduced to 40px high for mobile.\n * It is also recommended that the logo width doesn't exceed 350px. If you need a wide logo that is shorter than 80px to keep the aspect ratio please make sure that the logo is centered with transparent space at the top and bottom and still 80px high.\n *\n * ### Site Slogan Text (optional)\n * This is a single line of text and the character limit depends on the theme, logo and children width. This is only visible on desktop at the top of the page\n *\n * ### Right section (optional)\n * This has been kept quite open you can place any child elements in here but ideally it is narrow and its height is 50px or smaller.\n *\n * ### Accessability\n * There is a hidden skip link in the header which will only reveals itself on the first tab and to screen readers. This link helps users skip to the main page content, however this will only work with there is an element with an id of 'main' which the developer should create for every page.\n *\n */\nexport function Header({\n isSticky,\n siteSlogan,\n logoAltText,\n logoImageSrc,\n logoLinkTitle,\n logoLinkUrl,\n fullWidth,\n children,\n}: HeaderProps) {\n const [isSmall, setIsSmall] = useState(false);\n const isBrowser = typeof window !== `undefined`;\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n useScrollPosition(\n ({\n currPos,\n }: {\n prevPos: { x: number; y: number };\n currPos: { x: number; y: number };\n }) => {\n const shouldShrink = isBrowser\n ? currPos.y > HEADER_SCROLL_THRESHOLD\n : false;\n if (shouldShrink !== isSmall) {\n setIsSmall(shouldShrink);\n }\n },\n [isSmall],\n null,\n true,\n 50,\n );\n\n return (\n <ThemeProvider theme={theme}>\n <StyledHeader>\n <HeaderStickyPlaceHolder>\n <HeaderStickyContainer\n data-cy=\"header-sticky-container\"\n isSmall={isSmall}\n isSticky={isSticky}\n >\n <SkipToMain href=\"#main\">Skip to main content</SkipToMain>\n <HeaderMainContent fullWidth={fullWidth}>\n <StyledLink\n href={logoLinkUrl ?? theme.siteConfig.logoUrl}\n title={logoLinkTitle ?? \"Home\"}\n >\n <LogoWrapper isSmall={isSmall} isSticky={isSticky}>\n <Logo\n height={80}\n src={logoImageSrc ?? theme.siteConfig.logoSrc}\n alt={logoAltText ?? theme.siteConfig.logoAlt}\n />\n </LogoWrapper>\n </StyledLink>\n {siteSlogan ? (\n <Tagline isSmall={isSmall} isSticky={isSticky}>\n {siteSlogan}\n </Tagline>\n ) : null}\n <ChildWrapper>\n <ChildInner>{children}</ChildInner>\n </ChildWrapper>\n </HeaderMainContent>\n </HeaderStickyContainer>\n </HeaderStickyPlaceHolder>\n </StyledHeader>\n </ThemeProvider>\n );\n}\n\nexport default Header;\n"],"names":["Header","_a","isSticky","siteSlogan","logoAltText","logoImageSrc","logoLinkTitle","logoLinkUrl","fullWidth","children","_b","useState","isSmall","setIsSmall","isBrowser","window","foundTheme","useTheme","theme","__assign","defaultTheme","useScrollPosition","currPos","shouldShrink","y","React","createElement","ThemeProvider","StyledHeader","HeaderStickyPlaceHolder","HeaderStickyContainer","SkipToMain","href","HeaderMainContent","StyledLink","siteConfig","logoUrl","title","LogoWrapper","Logo","height","src","logoSrc","alt","logoAlt","Tagline","ChildWrapper","ChildInner"],"mappings":"6eA0DM,SAAUA,EAAOC,OACrBC,EAAQD,EAAAC,SACRC,EAAUF,EAAAE,WACVC,EAAWH,EAAAG,YACXC,EAAYJ,EAAAI,aACZC,EAAaL,EAAAK,cACbC,EAAWN,EAAAM,YACXC,EAASP,EAAAO,UACTC,EAAQR,EAAAQ,SAEFC,EAAwBC,GAAS,GAAhCC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAA8B,oBAAXC,OACnBC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAuBL,OApBAK,GACE,SAACpB,GACC,IAAAqB,EAAOrB,EAAAqB,QAKDC,IAAeT,GACjBQ,EAAQE,EAhEc,IAkEtBD,IAAiBX,GACnBC,EAAWU,EAEd,GACD,CAACX,GACD,MACA,EACA,IAIAa,EAACC,cAAAC,EAAc,CAAAT,MAAOA,GACpBO,EAAAC,cAACE,EAAY,KACXH,EAAAC,cAACG,EAAuB,KACtBJ,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Header/index.tsx"],"sourcesContent":["import React, { useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { useScrollPosition } from \"../../hooks/useScrollPosition\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport {\n StyledHeader,\n HeaderStickyContainer,\n HeaderStickyPlaceHolder,\n HeaderMainContent,\n SkipToMain,\n StyledLink,\n Logo,\n LogoWrapper,\n Tagline,\n ChildWrapper,\n ChildInner,\n} from \"./styles\";\n\nconst HEADER_SCROLL_THRESHOLD = 240;\n\nexport type HeaderProps = HTMLAttributes<HTMLElement> & {\n /** flag which make header fixed to the top even when scrolling */\n isSticky?: boolean;\n /** text in the middle of the header */\n siteSlogan?: string;\n /** text to explain the content of the icon for a11y usually a description of where the link will take you */\n logoAltText?: string;\n /** header logo image url */\n logoImageSrc?: string;\n /** title of the header image component, this is mainly for the tooltip text on hover */\n logoLinkTitle?: string;\n /** the url of the logo link */\n logoLinkUrl?: string;\n /** instead of the contents of the header being centered to max width as defined in theme it is 100% width fo viewport */\n fullWidth?: boolean;\n\n children?: ReactNode;\n};\n\n/**\n * There should be only one header component near or at the top of the body of each page.\n *\n * ### Logos\n * It is recommended that logo images are at least 80px high if they are not SVGs and that the logo is still clearly legible when reduced to 40px high for mobile.\n * It is also recommended that the logo width doesn't exceed 350px. If you need a wide logo that is shorter than 80px to keep the aspect ratio please make sure that the logo is centered with transparent space at the top and bottom and still 80px high.\n *\n * ### Site Slogan Text (optional)\n * This is a single line of text and the character limit depends on the theme, logo and children width. This is only visible on desktop at the top of the page\n *\n * ### Right section (optional)\n * This has been kept quite open you can place any child elements in here but ideally it is narrow and its height is 50px or smaller.\n *\n * ### Accessability\n * There is a hidden skip link in the header which will only reveals itself on the first tab and to screen readers. This link helps users skip to the main page content, however this will only work with there is an element with an id of 'main' which the developer should create for every page.\n *\n */\nexport function Header({\n isSticky,\n siteSlogan,\n logoAltText,\n logoImageSrc,\n logoLinkTitle,\n logoLinkUrl,\n fullWidth,\n children,\n}: HeaderProps) {\n const [isSmall, setIsSmall] = useState(false);\n const isBrowser = typeof window !== `undefined`;\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n useScrollPosition(\n ({\n currPos,\n }: {\n prevPos: { x: number; y: number };\n currPos: { x: number; y: number };\n }) => {\n const shouldShrink = isBrowser\n ? currPos.y > HEADER_SCROLL_THRESHOLD\n : false;\n if (shouldShrink !== isSmall) {\n setIsSmall(shouldShrink);\n }\n },\n [isSmall],\n null,\n true,\n 50,\n );\n\n return (\n <ThemeProvider theme={theme}>\n <StyledHeader>\n <HeaderStickyPlaceHolder>\n <HeaderStickyContainer\n data-cy=\"header-sticky-container\"\n $isSmall={isSmall}\n $isSticky={isSticky}\n >\n <SkipToMain href=\"#main\">Skip to main content</SkipToMain>\n <HeaderMainContent $fullWidth={fullWidth}>\n <StyledLink\n href={logoLinkUrl ?? theme.siteConfig.logoUrl}\n title={logoLinkTitle ?? \"Home\"}\n >\n <LogoWrapper $isSmall={isSmall} $isSticky={isSticky}>\n <Logo\n height={80}\n src={logoImageSrc ?? theme.siteConfig.logoSrc}\n alt={logoAltText ?? theme.siteConfig.logoAlt}\n />\n </LogoWrapper>\n </StyledLink>\n {siteSlogan ? (\n <Tagline $isSmall={isSmall} $isSticky={isSticky}>\n {siteSlogan}\n </Tagline>\n ) : null}\n <ChildWrapper>\n <ChildInner>{children}</ChildInner>\n </ChildWrapper>\n </HeaderMainContent>\n </HeaderStickyContainer>\n </HeaderStickyPlaceHolder>\n </StyledHeader>\n </ThemeProvider>\n );\n}\n\nexport default Header;\n"],"names":["Header","_a","isSticky","siteSlogan","logoAltText","logoImageSrc","logoLinkTitle","logoLinkUrl","fullWidth","children","_b","useState","isSmall","setIsSmall","isBrowser","window","foundTheme","useTheme","theme","__assign","defaultTheme","useScrollPosition","currPos","shouldShrink","y","React","createElement","ThemeProvider","StyledHeader","HeaderStickyPlaceHolder","HeaderStickyContainer","$isSmall","SkipToMain","href","HeaderMainContent","StyledLink","siteConfig","logoUrl","title","LogoWrapper","$isSticky","Logo","height","src","logoSrc","alt","logoAlt","Tagline","ChildWrapper","ChildInner"],"mappings":"6eA0DM,SAAUA,EAAOC,OACrBC,EAAQD,EAAAC,SACRC,EAAUF,EAAAE,WACVC,EAAWH,EAAAG,YACXC,EAAYJ,EAAAI,aACZC,EAAaL,EAAAK,cACbC,EAAWN,EAAAM,YACXC,EAASP,EAAAO,UACTC,EAAQR,EAAAQ,SAEFC,EAAwBC,GAAS,GAAhCC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAA8B,oBAAXC,OACnBC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAuBL,OApBAK,GACE,SAACpB,GACC,IAAAqB,EAAOrB,EAAAqB,QAKDC,IAAeT,GACjBQ,EAAQE,EAhEc,IAkEtBD,IAAiBX,GACnBC,EAAWU,EAEd,GACD,CAACX,GACD,MACA,EACA,IAIAa,EAACC,cAAAC,EAAc,CAAAT,MAAOA,GACpBO,EAAAC,cAACE,EAAY,KACXH,EAAAC,cAACG,EAAuB,KACtBJ,EAAAC,cAACI,EACS,CAAA,UAAA,0BACEC,SAAAnB,YACCV,GAEXuB,EAAAC,cAACM,EAAU,CAACC,KAAK,SAAyC,wBAC1DR,EAACC,cAAAQ,cAA8B1B,GAC7BiB,EAACC,cAAAS,EACC,CAAAF,KAAM1B,QAAAA,EAAeW,EAAMkB,WAAWC,QACtCC,MAAOhC,QAAAA,EAAiB,QAExBmB,EAAAC,cAACa,EAAW,CAAAR,SAAWnB,EAAO4B,UAAatC,GACzCuB,EAAAC,cAACe,EAAI,CACHC,OAAQ,GACRC,IAAKtC,QAAAA,EAAgBa,EAAMkB,WAAWQ,QACtCC,IAAKzC,QAAAA,EAAec,EAAMkB,WAAWU,YAI1C3C,EACCsB,EAAAC,cAACqB,EAAkB,CAAAhB,SAAAnB,EAAoB4B,UAAAtC,GACpCC,GAED,KACJsB,EAAAC,cAACsB,EAAY,KACXvB,EAACC,cAAAuB,EAAY,KAAAxC,QAQ7B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import i from"styled-components";import{crukTheme as t}from"../../themes/cruk.js";var e,o,r,a,d,h,s,u,l,c,p,g="120px",x="72px",f=t.spacing.xs,m="40px",b="0.2s",w=i.header(e||(e=n(["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"],["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"])),(function(n){return n.theme.colors.headerBackground})),y=i.div(o||(o=n(["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),x,(function(n){return n.theme.breakpoint.desktop}),g),v=i.div(r||(r=n(["\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n box-shadow: ",";\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"],["\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n box-shadow: ",";\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"])),f,(function(n){return n.theme.colors.headerBackground}),(function(n){var i=n.theme.colors.headerBorder;return"solid 1px ".concat(i)}),x,(function(n){var i=n.theme;return n
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import i from"styled-components";import{crukTheme as t}from"../../themes/cruk.js";var e,o,r,a,d,h,s,u,l,c,p,g="120px",x="72px",f=t.spacing.xs,m="40px",b="0.2s",w=i.header(e||(e=n(["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"],["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"])),(function(n){return n.theme.colors.headerBackground})),y=i.div(o||(o=n(["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),x,(function(n){return n.theme.breakpoint.desktop}),g),v=i.div(r||(r=n(["\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n box-shadow: ",";\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"],["\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n box-shadow: ",";\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"])),f,(function(n){return n.theme.colors.headerBackground}),(function(n){var i=n.theme.colors.headerBorder;return"solid 1px ".concat(i)}),x,(function(n){var i=n.theme;return n.$isSticky?i.shadows.l:"none"}),(function(n){return n.$isSticky?0:"auto"}),(function(n){return n.$isSticky?"fixed":"relative"}),b,(function(n){return n.theme.breakpoint.desktop}),(function(n){return n.$isSticky?"fixed":"relative"}),(function(n){var i=n.$isSmall,t=n.$isSticky;return i&&t?x:g})),k=i.div(a||(a=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){var i=n.$fullWidth,t=n.theme.utilities.contentMaxWidth;return i?"100%":t})),z=i.img(d||(d=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"]))),S=i.div(h||(h=n(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height "," ease;\n\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height "," ease;\n\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),b,m,(function(n){return n.theme.breakpoint.desktop}),(function(n){var i=n.$isSmall,t=n.$isSticky;return i&&t?m:"80px"})),$=i.a(s||(s=n(["\n display: inline-block;\n"],["\n display: inline-block;\n"]))),j=i.a(u||(u=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: ",";\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: ",";\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n"])),(function(n){return n.theme.spacing.xs})),B=i.p(l||(l=n(["\n flex: 1 1 auto;\n font-family: ",";\n font-weight: ",";\n font-size: ",";\n color: ",";\n text-align: center;\n opacity: 0;\n transition: opacity "," ease;\n display: none;\n\n @media (min-width: ",") {\n display: block;\n opacity: ",";\n }\n"],["\n flex: 1 1 auto;\n font-family: ",";\n font-weight: ",";\n font-size: ",";\n color: ",";\n text-align: center;\n opacity: 0;\n transition: opacity "," ease;\n display: none;\n\n @media (min-width: ",") {\n display: block;\n opacity: ",";\n }\n"])),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(n){return n.theme.typography.fontWeightHeadings}),(function(n){return n.theme.fontSizes.xl}),(function(n){return n.theme.colors.headerTaglineText}),b,(function(n){return n.theme.breakpoint.desktop}),(function(n){var i=n.$isSmall,t=n.$isSticky;return i&&t?0:1})),W=i.div(c||(c=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"]))),H=i.div(p||(p=n(["\n height: auto;\n margin: auto 0;\n"],["\n height: auto;\n margin: auto 0;\n"])));export{H as ChildInner,W as ChildWrapper,k as HeaderMainContent,v as HeaderStickyContainer,y as HeaderStickyPlaceHolder,z as Logo,S as LogoWrapper,j as SkipToMain,w as StyledHeader,$ as StyledLink,B 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\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { type ThemeType } from \"../../types\";\n\nconst HEADER_HEIGHT_LARGE = \"120px\";\nconst HEADER_HEIGHT_SMALL = \"72px\";\nconst HEADER_PADDING = defaultTheme.spacing.xs;\nconst HEADER_LOGO_HEIGHT_LARGE = \"80px\";\nconst HEADER_LOGO_HEIGHT_SMALL = \"40px\";\nconst ANIMATION_SPEED = \"0.2s\";\n\
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Header/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { type ThemeType } from \"../../types\";\n\nconst HEADER_HEIGHT_LARGE = \"120px\";\nconst HEADER_HEIGHT_SMALL = \"72px\";\nconst HEADER_PADDING = defaultTheme.spacing.xs;\nconst HEADER_LOGO_HEIGHT_LARGE = \"80px\";\nconst HEADER_LOGO_HEIGHT_SMALL = \"40px\";\nconst ANIMATION_SPEED = \"0.2s\";\n\nexport const StyledHeader = styled.header<{ theme: ThemeType }>`\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n z-index: 9998;\n`;\n\nexport const HeaderStickyPlaceHolder = styled.div<{ theme: ThemeType }>`\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ${HEADER_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderStickyContainer = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ${HEADER_PADDING};\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n position: relative;\n border-bottom: ${({\n theme: {\n colors: { headerBorder },\n },\n }) => `solid 1px ${headerBorder}`};\n height: ${HEADER_HEIGHT_SMALL};\n box-shadow: ${({ theme, $isSticky }) =>\n $isSticky ? theme.shadows.l : \"none\"};\n top: ${({ $isSticky }) => ($isSticky ? 0 : \"auto\")};\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n transition: height ${ANIMATION_SPEED} ease;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky ? HEADER_HEIGHT_SMALL : HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderMainContent = styled.div<{\n $fullWidth?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ${({\n $fullWidth,\n theme: {\n utilities: { contentMaxWidth },\n },\n }) => ($fullWidth ? `100%` : contentMaxWidth)};\n`;\n\nexport const Logo = styled.img`\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n`;\n\nexport const LogoWrapper = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height ${ANIMATION_SPEED} ease;\n\n height: ${HEADER_LOGO_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky\n ? HEADER_LOGO_HEIGHT_SMALL\n : HEADER_LOGO_HEIGHT_LARGE};\n }\n`;\n\nexport const StyledLink = styled.a`\n display: inline-block;\n`;\n\nexport const SkipToMain = styled.a<{ theme: ThemeType }>`\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n`;\n\nexport const Tagline = styled.p<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n flex: 1 1 auto;\n font-family: ${({ theme }) => theme.typography.fontFamilyHeadings};\n font-weight: ${({ theme }) => theme.typography.fontWeightHeadings};\n font-size: ${({\n theme: {\n fontSizes: { xl },\n },\n }) => xl};\n color: ${({ theme }) => theme.colors.headerTaglineText};\n text-align: center;\n opacity: 0;\n transition: opacity ${ANIMATION_SPEED} ease;\n display: none;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: block;\n opacity: ${({ $isSmall, $isSticky }) => ($isSmall && $isSticky ? 0 : 1)};\n }\n`;\n\nexport const ChildWrapper = styled.div`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n`;\n\nexport const ChildInner = styled.div`\n height: auto;\n margin: auto 0;\n`;\n"],"names":["HEADER_HEIGHT_LARGE","HEADER_HEIGHT_SMALL","HEADER_PADDING","defaultTheme","spacing","xs","HEADER_LOGO_HEIGHT_SMALL","ANIMATION_SPEED","StyledHeader","styled","header","templateObject_1","__makeTemplateObject","_a","theme","colors","headerBackground","HeaderStickyPlaceHolder","div","templateObject_2","breakpoint","desktop","HeaderStickyContainer","templateObject_3","headerBorder","concat","$isSticky","shadows","l","$isSmall","HeaderMainContent","templateObject_4","$fullWidth","contentMaxWidth","utilities","Logo","img","templateObject_5","LogoWrapper","templateObject_6","StyledLink","a","templateObject_7","SkipToMain","templateObject_8","Tagline","p","templateObject_9","typography","fontFamilyHeadings","fontWeightHeadings","fontSizes","xl","headerTaglineText","ChildWrapper","templateObject_10","ChildInner","templateObject_11"],"mappings":"kKAKA,0BAAMA,EAAsB,QACtBC,EAAsB,OACtBC,EAAiBC,EAAaC,QAAQC,GAEtCC,EAA2B,OAC3BC,EAAkB,OAEXC,EAAeC,EAAOC,OAAMC,IAAAA,EAAAC,EAAA,CAAA,2FAAA,yBAAA,CAAsB,2FAQvC,4BAJF,SAACC,GAIf,OAFwBA,EAAAC,MAAAC,OAAAC,gBAExB,IAIKC,EAA0BR,EAAOS,IAAyBC,IAAAA,EAAAP,EAAA,CAAA,iFAAA,6BAAA,oBAAA,YAAA,CAAA,iFAIxC,6BAE+B,oBAC7B,cAHrBX,GAEW,SAACY,GAAc,OAAPA,EAAAC,MAAaM,WAAWC,OAAjB,GACxBrB,GAIDsB,EAAwBb,EAAOS,IAI1CK,IAAAA,EAAAX,EAAA,CAAA,8EAAA,0BAAA,8CAAA,gBAAA,oBAAA,aAAA,kBAAA,2BAAA,kCAAA,sBAAA,kBAAA,Y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AsG3B,IAMOkC,EAAa/B,EAAOgC,EAACC,IAAAA,EAAA9B,EAAA,CAAA,gCAAA,CAAA,mCAIrB+B,EAAalC,EAAOgC,EAACG,IAAAA,EAAAhC,EAAA,CAAA,4SAAA,wIAAA,CAAsB,4SAqB5C,2IAJG,SAACC,GAIN,OAFWA,EAAAC,MAAAV,QAAAC,EAEX,IASGwC,EAAUpC,EAAOqC,EAACC,IAAAA,EAAAnC,EAAA,CAAA,uCAAA,qBAAA,mBAAA,eAAA,kEAAA,oDAAA,0CAAA,YAAA,CAI7B,uCAEiE,qBACA,mBAKzD,eAC8C,kEAGjB,oDAGuB,0CAEa,eAf1D,SAACC,GAAc,OAAPA,EAAAC,MAAakC,WAAWC,kBAAjB,IACf,SAACpC,GAAc,OAAPA,EAAAC,MAAakC,WAAWE,kBAAjB,IACjB,SAACrC,GAIR,OAFaA,EAAAC,MAAAqC,UAAAC,EAEb,IACG,SAACvC,GAAc,OAAPA,EAAAC,MAAaC,OAAOsC,iBAAb,GAGF9C,GAGD,SAACM,GAAc,OAAPA,EAAAC,MAAaM,WAAWC,OAAjB,IAEvB,SAACR,OAAEgB,EAAQhB,EAAAgB,SAAEH,EAASb,EAAAa,UAAO,OAACG,GAAYH,EAAY,EAAI,CAA7B,IAI/B4B,EAAe7C,EAAOS,IAAGqC,IAAAA,EAAA3C,EAAA,CAAA,sGAAA,CAAA,yGAOzB4C,EAAa/C,EAAOS,IAAGuC,IAAAA,EAAA7C,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{useTheme as
|
|
1
|
+
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import r from"react";import{useTheme as o}from"styled-components";import{crukTheme as l}from"../../themes/cruk.js";import{spacingPropsToSpacingPropsInternal as $}from"../Spacing/index.js";import{H1 as a,H2 as i,H3 as m,H4 as x,H5 as n,H6 as h}from"./styles.js";function p(p){var w=p.textSize,f=p.textAlign,d=p.textColor,s=p.wordBreak,c=p.overflowWrap,g=p.h1,k=p.h2,v=p.h3,S=p.h4,z=p.h5,A=p.h6,B=e(p,["textSize","textAlign","textColor","wordBreak","overflowWrap","h1","h2","h3","h4","h5","h6"]),C=o(),W=t(t({},l),C),E=$(B);return g?r.createElement(a,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):k?r.createElement(i,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):v?r.createElement(m,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):S?r.createElement(x,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):z?r.createElement(n,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):A?r.createElement(h,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):r.createElement(i,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c}))}export{p as Heading,p 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\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Heading/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ElementType } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\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\";\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 foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const propsConvertedToInternalSpacingProps =\n spacingPropsToSpacingPropsInternal(props);\n\n if (h1)\n return (\n <H1\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h2)\n return (\n <H2\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h3)\n return (\n <H3\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h4)\n return (\n <H4\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h5)\n return (\n <H5\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h6)\n return (\n <H6\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n return (\n <H2\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\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","foundTheme","useTheme","theme","__assign","defaultTheme","propsConvertedToInternalSpacingProps","spacingPropsToSpacingPropsInternal","React","H1","$textSize","$textAlign","$wordBreak","$overflowWrap","H2","H3","H4","H5","H6"],"mappings":"qVA6CM,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,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EACJC,EAAmCR,GAErC,OAAIN,EAEAe,gBAACC,EAAEL,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBE,EAEAc,gBAACM,EAAEV,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBG,EAEAa,gBAACO,EAAEX,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBI,EAEAY,gBAACQ,EAAEZ,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBK,EAEAW,gBAACS,EAAEb,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBM,EAEAU,gBAACU,EAAEd,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAInBgB,gBAACM,EAAEV,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,IAGrB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__rest as t}from"../../../node_modules/tslib/tslib.es6.js";import e,{css as i}from"styled-components";import{
|
|
1
|
+
import{__makeTemplateObject as n,__rest as t}from"../../../node_modules/tslib/tslib.es6.js";import e,{css as i}from"styled-components";import{spacing as r}from"../Spacing/index.js";var o,f,m,a,u,s,l,x=function(e){return i(o||(o=n(["\n font-family: ",";\n font-weight: ",";\n word-break: ",";\n overflow-wrap: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"],["\n font-family: ",";\n font-weight: ",";\n word-break: ",";\n overflow-wrap: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"])),e.theme.typography.fontFamilyHeadings,e.theme.typography.fontWeightHeadings,e.$wordBreak||"normal",e.$overflowWrap||"break-word",e.$textColor&&void 0!==e.theme.colors[e.$textColor]?e.theme.colors[e.$textColor]:e.$textColor||e.theme.colors.textHeaderDefault,e.theme.typography.headerLineHeight,e.theme.typography.headerTextTransform,e.theme.spacing.m,e.theme.spacing.s,e.$textAlign||"left",(function(){e.theme;var n=t(e,["theme"]);return r(n,e.theme)}))},h=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":return e.fontSizes.l;case"xl":return e.fontSizes.xl;case"xxl":return e.fontSizes.xxl;case"xxxl":return e.fontSizes.xxxl;case"xxxxl":return e.fontSizes.xxxxl;default:return t}},z=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":case"xl":return e.fontSizes.l;case"xxl":return e.fontSizes.xl;case"xxxl":return e.fontSizes.xxl;case"xxxxl":return e.fontSizes.xxxl;default:return t}},d=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":case"xl":case"xxl":return e.fontSizes.l;case"xxxl":return e.fontSizes.xl;case"xxxxl":return e.fontSizes.xxl;default:return t}},c=e.h1(f||(f=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.xxl,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.xxxl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.xxxxl,t)})),S=e.h2(m||(m=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.xl,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.xxl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.xxxl,t)})),p=e.h3(a||(a=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.xl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.xxl,t)})),w=e.h4(u||(u=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.xl,t)})),b=e.h5(s||(s=n(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.l,t)})),$=e.h6(l||(l=n(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.m,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.m,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.m,t)}));export{c as H1,S as H2,p as H3,w as H4,b 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 SpacingProps } from \"../Spacing\";\n\nimport {\n type ThemeType,\n type FontSizeType,\n type ColorKeyType,\n type WordBreakType,\n} from \"../../types\";\n\ntype StyledHeadingProps = SpacingProps & {\n theme: ThemeType;\n textSize?: FontSizeType;\n textAlign?: \"left\" | \"right\" | \"center\";\n textColor?: string;\n wordBreak?: WordBreakType;\n overflowWrap?: WordBreakType;\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 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","templateObject_6","H6","h6","templateObject_7"],"mappings":"qLAoBA,kBAAMA,EAAgB,SAACC,GAA8B,OAAAC,EAAGC,IAAAA,EAAAC,EAAA,CAAA,oBAAA,qBAAA,oBAAA,uBAAA,eAAA,qBAAA,wBAAA,oBAAA,uBAAA,wCAAA,wDAAA,MAAA,CAAA,oBACE,qBACA,oBACf,uBACU,eAIQ,qBACL,wBACM,oBACzB,uBACG,wCAEC,wDAUtC,QAvBcH,EAAMI,MAAMC,WAAWC,mBACvBN,EAAMI,MAAMC,WAAWE,mBACxBP,EAAMQ,WAAa,SAChBR,EAAMS,cAAgB,aAC9BT,EAAMU,gBACgD,IAAxDV,EAAMI,MAAMO,OAAOX,EAAMU,WAC5BV,EAAMI,MAAMO,OAAOX,EAAMU,WACzBV,EAAMU,WAAaV,EAAMI,MAAMO,OAAOC,kBAC3BZ,EAAMI,MAAMC,WAAWQ,iBACpBb,EAAMI,MAAMC,WAAWS,oBAC3Bd,EAAMI,MAAMW,QAAQC,EACjBhB,EAAMI,MAAMW,QAAQE,EAEvBjB,EAAMkB,WAAa,QAM/B,WAEwClB,EAA3BI,UAAKe,EAAiBC,EAAKpB,EAAlC,CAA+B,UACrC,OAAOe,EAAQI,EAAmBnB,EAAMI,MAC1C,GAAC,EAGGiB,EAAkB,SACtBC,EACAC,EACAnB,GAEA,OAAQkB,GACN,IAAK,IACH,OAAOlB,EAAMoB,UAAUR,EACzB,IAAK,IACH,OAAOZ,EAAMoB,UAAUC,EACzB,IAAK,KACH,OAAOrB,EAAMoB,UAAUE,GACzB,IAAK,MACH,OAAOtB,EAAMoB,UAAUG,IAC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,SAC7B,OAAAS,EAAeT,GAAY,KAAMlB,EAAMoB,UAAUC,EAAGrB,EAApD,IACmB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWC,MAAjB,IACrB,SAACF,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAAQc,EAAAd,SAC7B,OAAAQ,EAAeR,GAAY,KAAMlB,EAAMoB,UAAUC,EAAGrB,EAApD,IAEiB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWE,OAAjB,IACrB,SAACH,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAAQc,EAAAd,SAC7B,OAAAD,EAAgBC,GAAY,KAAMlB,EAAMoB,UAAUC,EAAGrB,EAArD,IAIOgD,EAAKnB,EAAOoB,GAAsBC,IAAAA,EAAAnD,EAAA,CAAA,OAAA,oBAAA,2BAAA,uBAAA,gCAAA,uBAAA,YAAA,CAAA,OACZ,oBAG2B,2BACD,uBAEG,gCAEF,uBAEG,eAV7D,SAACH,GAAU,OAAAD,EAAcC,EAAM,IAEpB,SAACoC,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAAQc,EAAAd,SAC7B,OAAAS,EAAeT,GAAY,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAApD,IACmB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWC,MAAjB,IACrB,SAACF,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAAQc,EAAAd,SAC7B,OAAAQ,EAAeR,GAAY,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAApD,IAEiB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWE,OAAjB,IACrB,SAACH,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAAQc,EAAAd,SAC7B,OAAAD,EAAgBC,GAAY,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAArD"}
|
|
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","templateObject_6","H6","h6","templateObject_7"],"mappings":"qLAqBA,kBAAMA,EAAgB,SAACC,GAA8B,OAAAC,EAAGC,IAAAA,EAAAC,EAAA,CAAA,oBAAA,qBAAA,oBAAA,uBAAA,eAAA,qBAAA,wBAAA,oBAAA,uBAAA,wCAAA,wDAAA,MAAA,CAAA,oBACE,qBACA,oBACd,uBACU,eAIQ,qBACN,wBACM,oBACzB,uBACG,wCAEE,wDAWvC,QAxBcH,EAAMI,MAAMC,WAAWC,mBACvBN,EAAMI,MAAMC,WAAWE,mBACxBP,EAAMQ,YAAc,SACjBR,EAAMS,eAAiB,aAC/BT,EAAMU,iBACiD,IAAzDV,EAAMI,MAAMO,OAAOX,EAAMU,YAC5BV,EAAMI,MAAMO,OAAOX,EAAMU,YACzBV,EAAMU,YAAcV,EAAMI,MAAMO,OAAOC,kBAC5BZ,EAAMI,MAAMC,WAAWQ,iBACpBb,EAAMI,MAAMC,WAAWS,oBAC3Bd,EAAMI,MAAMW,QAAQC,EACjBhB,EAAMI,MAAMW,QAAQE,EAEvBjB,EAAMkB,YAAc,QAMhC,WAEwClB,EAA3BI,UAAKe,EAAiBC,EAAKpB,EAAlC,CAA+B,UAErC,OAAOe,EAAQI,EAAmBnB,EAAMI,MAC1C,GAAC,EAGGiB,E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AhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAD,EAAgBC,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAAtD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import o from"react";import{useTheme as t}from"styled-components";import{crukTheme as r}from"../../themes/cruk.js";import{StyledIcon as m}from"./styles.js";function s(s){var c=s.faIcon,i=s.color,n=s.size,a=void 0===n?"1.1rem":n,l=t(),p=e(e({},r),l),f=c.icon,d=f[0],u=f[1],h=f[4];return o.createElement(m,{theme:p,role:"presentation",viewBox:"0 0 ".concat(d," ").concat(u),size:a||"1.1rem",color:i},h&&o.createElement("path",{d:h}))}export{s as IconFa,s 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 { useTheme } from \"styled-components\";\nimport { type IconDefinition } from \"@fortawesome/fontawesome-common-types\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledIcon } from \"./styles\";\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({
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/IconFa/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { type IconDefinition } from \"@fortawesome/fontawesome-common-types\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledIcon } from \"./styles\";\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 = \"1.1rem\" }: IconFaProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const [width, height, , , svgPathData] = faIcon.icon;\n\n return (\n <StyledIcon\n theme={theme}\n role=\"presentation\"\n viewBox={`0 0 ${width} ${height}`}\n size={size || \"1.1rem\"}\n color={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","foundTheme","useTheme","theme","__assign","defaultTheme","_c","icon","width","height","svgPathData","React","createElement","StyledIcon","role","viewBox","concat","d"],"mappings":"gOAqBM,SAAUA,EAAOC,OAAEC,EAAMD,EAAAC,OAAEC,EAAKF,EAAAE,MAAEC,SAAAC,OAAO,IAAAD,EAAA,SAAQA,EAC/CE,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EAAmCT,EAAOU,KAAzCC,EAAKF,EAAA,GAAEG,EAAMH,EAAA,GAAMI,OAE1B,OACEC,EAACC,cAAAC,EACC,CAAAV,MAAOA,EACPW,KAAK,eACLC,QAAS,OAAOC,OAAAR,cAASC,GACzBT,KAAMA,GAAQ,SACdF,MAAOA,GAENY,GAAeC,wBAAMM,EAAGP,IAG/B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import r from"react";import{useTheme as l,ThemeProvider as n}from"styled-components";import{Text as i}from"../Text/index.js";import{crukTheme as m}from"../../themes/cruk.js";import{Label as o,LabelText as a,RequiredText as d}from"./styles.js";function s(s){var u=s.label,c=s.hintText,f=s.required,h=void 0!==f&&f,p=s.hideRequiredInLabel,b=void 0!==p&&p,x=s.children,E=e(s,["label","hintText","required","hideRequiredInLabel","children"]),q=l(),j=t(t({},m),q),y=c&&("string"==typeof c&&c.length||"number"==typeof c)?r.createElement(i,null,c):c;return r.createElement(n,{theme:j},u?r.createElement(o,t({},E),r.createElement(a,{hasHintText:!!c},u,h&&!b&&r.createElement(d,null," (required)")),y,x):r.createElement(r.Fragment,null,x))}export{s as LabelWrapper,s as default};
|
|
1
|
+
import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import r from"react";import{useTheme as l,ThemeProvider as n}from"styled-components";import{Text as i}from"../Text/index.js";import{crukTheme as m}from"../../themes/cruk.js";import{Label as o,LabelText as a,RequiredText as d}from"./styles.js";function s(s){var u=s.label,c=s.hintText,f=s.required,h=void 0!==f&&f,p=s.hideRequiredInLabel,b=void 0!==p&&p,x=s.children,E=e(s,["label","hintText","required","hideRequiredInLabel","children"]),q=l(),j=t(t({},m),q),y=c&&("string"==typeof c&&c.length||"number"==typeof c)?r.createElement(i,null,c):c;return r.createElement(n,{theme:j},u?r.createElement(o,t({},E),r.createElement(a,{$hasHintText:!!c},u,h&&!b&&r.createElement(d,null," (required)")),y,x):r.createElement(r.Fragment,null,x))}export{s as LabelWrapper,s 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\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { Text } from \"../Text\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { LabelText, Label, RequiredText } 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 /** when required (required) appears in label */\n required?: boolean;\n /** flag to stop (required) appearing in label, useful for compound form components like DateInput */\n hideRequiredInLabel?: boolean;\n children?: ReactNode;\n};\n\nexport function LabelWrapper({\n label,\n hintText,\n required = false,\n hideRequiredInLabel = false,\n children,\n ...otherHTMLLabelProps\n}: LabelWrapperProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const hintTextElement =\n !!hintText &&\n ((typeof hintText === \"string\" && hintText.length) ||\n typeof hintText === \"number\") ? (\n <Text>{hintText}</Text>\n ) : (\n hintText\n );\n\n return (\n <ThemeProvider theme={theme}>\n {label ? (\n <Label {...otherHTMLLabelProps}>\n <LabelText hasHintText={!!hintText}>\n {label}\n {required && !hideRequiredInLabel && (\n <RequiredText>{` (required)`}</RequiredText>\n )}\n </LabelText>\n {hintTextElement}\n {children}\n </Label>\n ) : (\n <>{children}</>\n )}\n </ThemeProvider>\n );\n}\n\nexport default LabelWrapper;\n"],"names":["LabelWrapper","_a","label","hintText","_b","required","_c","hideRequiredInLabel","children","otherHTMLLabelProps","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","hintTextElement","length","React","createElement","Text","ThemeProvider","Label","LabelText","hasHintText","RequiredText","Fragment"],"mappings":"mUAoBM,SAAUA,EAAaC,GAC3B,IAAAC,EAAKD,EAAAC,MACLC,EAAQF,EAAAE,SACRC,EAAAH,EAAAI,SAAAA,OAAW,IAAAD,GAAKA,EAChBE,wBAAAC,OAAsB,IAAAD,GAAKA,EAC3BE,EAAQP,EAAAO,SACLC,EANwBC,EAAAT,EAAA,CAAA,QAAA,WAAA,WAAA,sBAAA,aAQrBU,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EACFb,IACoB,iBAAbA,GAAyBA,EAASc,QACrB,iBAAbd,GACPe,EAACC,cAAAC,OAAMjB,GAEP,EAGJ,OACEe,EAACC,cAAAE,EAAc,CAAAR,MAAOA,GACnBX,EACCgB,EAACC,cAAAG,OAAUb,GACTS,EAAAC,cAACI,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/LabelWrapper/index.tsx"],"sourcesContent":["import React, { type LabelHTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { Text } from \"../Text\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { LabelText, Label, RequiredText } 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 /** when required (required) appears in label */\n required?: boolean;\n /** flag to stop (required) appearing in label, useful for compound form components like DateInput */\n hideRequiredInLabel?: boolean;\n children?: ReactNode;\n};\n\nexport function LabelWrapper({\n label,\n hintText,\n required = false,\n hideRequiredInLabel = false,\n children,\n ...otherHTMLLabelProps\n}: LabelWrapperProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const hintTextElement =\n !!hintText &&\n ((typeof hintText === \"string\" && hintText.length) ||\n typeof hintText === \"number\") ? (\n <Text>{hintText}</Text>\n ) : (\n hintText\n );\n\n return (\n <ThemeProvider theme={theme}>\n {label ? (\n <Label {...otherHTMLLabelProps}>\n <LabelText $hasHintText={!!hintText}>\n {label}\n {required && !hideRequiredInLabel && (\n <RequiredText>{` (required)`}</RequiredText>\n )}\n </LabelText>\n {hintTextElement}\n {children}\n </Label>\n ) : (\n <>{children}</>\n )}\n </ThemeProvider>\n );\n}\n\nexport default LabelWrapper;\n"],"names":["LabelWrapper","_a","label","hintText","_b","required","_c","hideRequiredInLabel","children","otherHTMLLabelProps","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","hintTextElement","length","React","createElement","Text","ThemeProvider","Label","LabelText","$hasHintText","RequiredText","Fragment"],"mappings":"mUAoBM,SAAUA,EAAaC,GAC3B,IAAAC,EAAKD,EAAAC,MACLC,EAAQF,EAAAE,SACRC,EAAAH,EAAAI,SAAAA,OAAW,IAAAD,GAAKA,EAChBE,wBAAAC,OAAsB,IAAAD,GAAKA,EAC3BE,EAAQP,EAAAO,SACLC,EANwBC,EAAAT,EAAA,CAAA,QAAA,WAAA,WAAA,sBAAA,aAQrBU,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EACFb,IACoB,iBAAbA,GAAyBA,EAASc,QACrB,iBAAbd,GACPe,EAACC,cAAAC,OAAMjB,GAEP,EAGJ,OACEe,EAACC,cAAAE,EAAc,CAAAR,MAAOA,GACnBX,EACCgB,EAACC,cAAAG,OAAUb,GACTS,EAAAC,cAACI,EAAS,CAAAC,eAAiBrB,GACxBD,EACAG,IAAaE,GACZW,EAACC,cAAAM,EAAc,KAAA,gBAGlBT,EACAR,GAGHU,EAAGC,cAAAD,EAAAQ,SAAA,KAAAlB,GAIX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";var o,e,i,a=t.label(o||(o=n(["\n position: relative;\n display: block;\n width: 100%;\n font-family: ",";\n font-weight: ",";\n"],["\n position: relative;\n display: block;\n width: 100%;\n font-family: ",";\n font-weight: ",";\n"])),(function(n){return n.theme.typography.fontFamilyLabel}),(function(n){return n.theme.typography.fontWeightLabels})),f=t.span(e||(e=n(["\n font-family: ",";\n font-weight: ",";\n"],["\n font-family: ",";\n font-weight: ",";\n"])),(function(n){return n.theme.typography.fontFamilyLabel}),(function(n){return n.theme.typography.fontWeightBase})),r=t.span(i||(i=n(["\n font-family: ",";\n font-weight: ",";\n display: block;\n margin-bottom: ",";\n"],["\n font-family: ",";\n font-weight: ",";\n display: block;\n margin-bottom: ",";\n"])),(function(n){return n.theme.typography.fontFamilyLabel}),(function(n){return n.theme.typography.fontWeightLabels}),(function(n){var t=n
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";var o,e,i,a=t.label(o||(o=n(["\n position: relative;\n display: block;\n width: 100%;\n font-family: ",";\n font-weight: ",";\n"],["\n position: relative;\n display: block;\n width: 100%;\n font-family: ",";\n font-weight: ",";\n"])),(function(n){return n.theme.typography.fontFamilyLabel}),(function(n){return n.theme.typography.fontWeightLabels})),f=t.span(e||(e=n(["\n font-family: ",";\n font-weight: ",";\n"],["\n font-family: ",";\n font-weight: ",";\n"])),(function(n){return n.theme.typography.fontFamilyLabel}),(function(n){return n.theme.typography.fontWeightBase})),r=t.span(i||(i=n(["\n font-family: ",";\n font-weight: ",";\n display: block;\n margin-bottom: ",";\n"],["\n font-family: ",";\n font-weight: ",";\n display: block;\n margin-bottom: ",";\n"])),(function(n){return n.theme.typography.fontFamilyLabel}),(function(n){return n.theme.typography.fontWeightLabels}),(function(n){var t=n.$hasHintText,o=n.theme;return t?o.spacing.xxs:o.spacing.xs}));export{a as Label,r as LabelText,f as RequiredText};
|
|
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\";\nimport { type ThemeType } from \"../../types\";\n\ntype LabelTextProp = {\n hasHintText: boolean;\n theme: ThemeType;\n};\n\nexport const Label = styled.label<{ theme: ThemeType }>`\n position: relative;\n display: block;\n width: 100%;\n font-family: ${({ theme }) => theme.typography.fontFamilyLabel};\n font-weight: ${({ theme }) => theme.typography.fontWeightLabels};\n`;\n\nexport const RequiredText = styled.span<{ theme: ThemeType }>`\n font-family: ${({ theme }) => theme.typography.fontFamilyLabel};\n font-weight: ${({ theme }) => theme.typography.fontWeightBase};\n`;\n\nexport const LabelText = styled.span<LabelTextProp>`\n font-family: ${({ theme }) => theme.typography.fontFamilyLabel};\n font-weight: ${({ theme }) => theme.typography.fontWeightLabels};\n display: block;\n margin-bottom: ${({ hasHintText, theme }) =>\n hasHintText ? theme.spacing.xxs : theme.spacing.xs};\n`;\n"],"names":["Label","styled","label","templateObject_1","__makeTemplateObject","_a","theme","typography","fontFamilyLabel","fontWeightLabels","RequiredText","span","templateObject_2","fontWeightBase","LabelText","templateObject_3","hasHintText","spacing","xxs","xs"],"mappings":"iHAQO,UAAMA,EAAQC,EAAOC,MAA2BC,IAAAA,EAAAC,EAAA,CAAA,8EAAA,qBAAA,OAAA,CAAA,8EAIS,qBACC,UADhD,SAACC,GAAc,OAAPA,EAAAC,MAAaC,WAAWC,eAAjB,IACf,SAACH,GAAc,OAAPA,EAAAC,MAAaC,WAAWE,gBAAjB,IAGnBC,EAAeT,EAAOU,KAA0BC,IAAAA,EAAAR,EAAA,CAAA,oBAAA,qBAAA,OAAA,CAAA,oBACG,qBACD,UAD9C,SAACC,GAAc,OAAPA,EAAAC,MAAaC,WAAWC,eAAjB,IACf,SAACH,GAAc,OAAPA,EAAAC,MAAaC,WAAWM,cAAjB,IAGnBC,EAAYb,EAAOU,KAAII,IAAAA,EAAAX,EAAA,CAAA,oBAAA,qBAAA,0CAAA,OAAA,CAAe,oBACa,qBACC,
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/LabelWrapper/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\ntype LabelTextProp = {\n $hasHintText: boolean;\n theme: ThemeType;\n};\n\nexport const Label = styled.label<{ theme: ThemeType }>`\n position: relative;\n display: block;\n width: 100%;\n font-family: ${({ theme }) => theme.typography.fontFamilyLabel};\n font-weight: ${({ theme }) => theme.typography.fontWeightLabels};\n`;\n\nexport const RequiredText = styled.span<{ theme: ThemeType }>`\n font-family: ${({ theme }) => theme.typography.fontFamilyLabel};\n font-weight: ${({ theme }) => theme.typography.fontWeightBase};\n`;\n\nexport const LabelText = styled.span<LabelTextProp>`\n font-family: ${({ theme }) => theme.typography.fontFamilyLabel};\n font-weight: ${({ theme }) => theme.typography.fontWeightLabels};\n display: block;\n margin-bottom: ${({ $hasHintText, theme }) =>\n $hasHintText ? theme.spacing.xxs : theme.spacing.xs};\n`;\n"],"names":["Label","styled","label","templateObject_1","__makeTemplateObject","_a","theme","typography","fontFamilyLabel","fontWeightLabels","RequiredText","span","templateObject_2","fontWeightBase","LabelText","templateObject_3","$hasHintText","spacing","xxs","xs"],"mappings":"iHAQO,UAAMA,EAAQC,EAAOC,MAA2BC,IAAAA,EAAAC,EAAA,CAAA,8EAAA,qBAAA,OAAA,CAAA,8EAIS,qBACC,UADhD,SAACC,GAAc,OAAPA,EAAAC,MAAaC,WAAWC,eAAjB,IACf,SAACH,GAAc,OAAPA,EAAAC,MAAaC,WAAWE,gBAAjB,IAGnBC,EAAeT,EAAOU,KAA0BC,IAAAA,EAAAR,EAAA,CAAA,oBAAA,qBAAA,OAAA,CAAA,oBACG,qBACD,UAD9C,SAACC,GAAc,OAAPA,EAAAC,MAAaC,WAAWC,eAAjB,IACf,SAACH,GAAc,OAAPA,EAAAC,MAAaC,WAAWM,cAAjB,IAGnBC,EAAYb,EAAOU,KAAII,IAAAA,EAAAX,EAAA,CAAA,oBAAA,qBAAA,0CAAA,OAAA,CAAe,oBACa,qBACC,0CAGV,UAJtC,SAACC,GAAc,OAAPA,EAAAC,MAAaC,WAAWC,eAAjB,IACf,SAACH,GAAc,OAAPA,EAAAC,MAAaC,WAAWE,gBAAjB,IAEb,SAACJ,OAAEW,EAAYX,EAAAW,aAAEV,EAAKD,EAAAC,MACrC,OAAAU,EAAeV,EAAMW,QAAQC,IAAMZ,EAAMW,QAAQE,EAAjD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{useTheme as n,ThemeProvider as o}from"styled-components";import{crukTheme as s}from"../../themes/cruk.js";import{ErrorText as m}from"../ErrorText/index.js";import{Text as i}from"../Text/index.js";import{StyledFieldset as a,LegendSpan as l}from"./styles.js";function d(d){var p=d.children,c=d.legendText,x=d.required,f=d.errorMessage,h=d.hasError,E=d.hintText,u=e(d,["children","legendText","required","errorMessage","hasError","hintText"]),T=n(),g=r(r({},s),T),j=!E||"string"!=typeof E&&"number"!=typeof E?E:t.createElement(i,{as:"span"},E);return t.createElement(o,{theme:g},t.createElement(a,{hasError:h||!!f||!1
|
|
1
|
+
import{__rest as e,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{useTheme as n,ThemeProvider as o}from"styled-components";import{crukTheme as s}from"../../themes/cruk.js";import{ErrorText as m}from"../ErrorText/index.js";import{Text as i}from"../Text/index.js";import{StyledFieldset as a,LegendSpan as l}from"./styles.js";function d(d){var p=d.children,c=d.legendText,x=d.required,f=d.errorMessage,h=d.hasError,E=d.hintText,u=e(d,["children","legendText","required","errorMessage","hasError","hintText"]),T=n(),g=r(r({},s),T),j=!E||"string"!=typeof E&&"number"!=typeof E?E:t.createElement(i,{as:"span"},E);return t.createElement(o,{theme:g},t.createElement(a,{$hasError:h||!!f||!1,$hasHintText:!!E},c&&t.createElement("legend",r({},u),t.createElement(l,{$hasHintText:!!E},c," ",x&&t.createElement("span",null,"(required)")),j),p,!!f&&t.createElement(m,{marginTop:"xxs"},f)))}export{d as LegendWrapper,d 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\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { ErrorText } from \"../ErrorText\";\nimport { Text } from \"../Text\";\n\nimport { StyledFieldset, LegendSpan } 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 /** when required (required) 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 foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const hintTextElement =\n !!hintText &&\n (typeof hintText === \"string\" || typeof hintText === \"number\") ? (\n <Text as=\"span\">{hintText}</Text>\n ) : (\n hintText\n );\n return (\n <ThemeProvider theme={theme}>\n <StyledFieldset\n hasError={hasError || !!errorMessage || false}\n hasHintText={!!hintText}\n >\n {legendText && (\n <legend {...restOfHTMLAttributes}>\n <LegendSpan hasHintText={!!hintText}>\n {legendText} {required && <span>(required)</span>}\n </LegendSpan>\n {hintTextElement}\n </legend>\n )}\n {children}\n {!!errorMessage && (\n <ErrorText marginTop=\"xxs\">{errorMessage}</ErrorText>\n )}\n </StyledFieldset>\n </ThemeProvider>\n );\n}\n\nexport default LegendWrapper;\n"],"names":["LegendWrapper","_a","children","legendText","required","errorMessage","hasError","hintText","restOfHTMLAttributes","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","hintTextElement","React","createElement","Text","as","ThemeProvider","StyledFieldset","hasHintText","LegendSpan","ErrorText","marginTop"],"mappings":"6WA4BM,SAAUA,EAAcC,GAC5B,IAAAC,aACAC,eACAC,aACAC,iBACAC,aACAC,aACGC,EAPyBC,EAAAR,EAAA,CAAA,WAAA,aAAA,WAAA,eAAA,WAAA,aAStBS,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/LegendWrapper/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { ErrorText } from \"../ErrorText\";\nimport { Text } from \"../Text\";\n\nimport { StyledFieldset, LegendSpan } 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 /** when required (required) 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 foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const hintTextElement =\n !!hintText &&\n (typeof hintText === \"string\" || typeof hintText === \"number\") ? (\n <Text as=\"span\">{hintText}</Text>\n ) : (\n hintText\n );\n return (\n <ThemeProvider theme={theme}>\n <StyledFieldset\n $hasError={hasError || !!errorMessage || false}\n $hasHintText={!!hintText}\n >\n {legendText && (\n <legend {...restOfHTMLAttributes}>\n <LegendSpan $hasHintText={!!hintText}>\n {legendText} {required && <span>(required)</span>}\n </LegendSpan>\n {hintTextElement}\n </legend>\n )}\n {children}\n {!!errorMessage && (\n <ErrorText marginTop=\"xxs\">{errorMessage}</ErrorText>\n )}\n </StyledFieldset>\n </ThemeProvider>\n );\n}\n\nexport default LegendWrapper;\n"],"names":["LegendWrapper","_a","children","legendText","required","errorMessage","hasError","hintText","restOfHTMLAttributes","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","hintTextElement","React","createElement","Text","as","ThemeProvider","StyledFieldset","$hasError","$hasHintText","LegendSpan","ErrorText","marginTop"],"mappings":"6WA4BM,SAAUA,EAAcC,GAC5B,IAAAC,aACAC,eACAC,aACAC,iBACAC,aACAC,aACGC,EAPyBC,EAAAR,EAAA,CAAA,WAAA,aAAA,WAAA,eAAA,WAAA,aAStBS,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,GACFR,GACmB,iBAAbA,GAA6C,iBAAbA,EACL,EAAjCS,EAAAC,cAACC,EAAI,CAACC,GAAG,QAAQZ,GAIrB,OACES,EAACC,cAAAG,EAAc,CAAAR,MAAOA,GACpBI,EAAAC,cAACI,EAAc,CAAAC,UACFhB,KAAcD,IAAgB,EAAKkB,eAC9BhB,GAEfJ,GACCa,EAAAC,cAAA,SAAAJ,EAAA,CAAA,EAAYL,GACVQ,EAAAC,cAACO,EAAU,CAAAD,eAAiBhB,GACzBJ,MAAaC,GAAYY,2CAE3BD,GAGJb,IACEG,GACDW,EAAAC,cAACQ,EAAU,CAAAC,UAAU,OAAOrB,IAKtC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";var t,e,r=o.span(t||(t=n(["\n display: block;\n color: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n font-family: ",";\n min-width: 3em;\n margin-bottom: ",";\n\n & > * {\n font-weight: ",";\n }\n"],["\n display: block;\n color: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n font-family: ",";\n min-width: 3em;\n margin-bottom: ",";\n\n & > * {\n font-weight: ",";\n }\n"])),(function(n){return n.theme.colors.textDark}),(function(n){return n.theme.fontSizes.m}),(function(n){return n.theme.typography.lineHeight}),(function(n){return n.theme.typography.fontWeightLabels}),(function(n){return n.theme.typography.fontFamilyLabel}),(function(n){var o=n
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";var t,e,r=o.span(t||(t=n(["\n display: block;\n color: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n font-family: ",";\n min-width: 3em;\n margin-bottom: ",";\n\n & > * {\n font-weight: ",";\n }\n"],["\n display: block;\n color: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n font-family: ",";\n min-width: 3em;\n margin-bottom: ",";\n\n & > * {\n font-weight: ",";\n }\n"])),(function(n){return n.theme.colors.textDark}),(function(n){return n.theme.fontSizes.m}),(function(n){return n.theme.typography.lineHeight}),(function(n){return n.theme.typography.fontWeightLabels}),(function(n){return n.theme.typography.fontFamilyLabel}),(function(n){var o=n.$hasHintText,t=n.theme;return o?t.spacing.xxs:0}),(function(n){return n.theme.typography.fontWeightBase})),i=o.fieldset(e||(e=n(["\n *,\n *:after,\n *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n border: none;\n padding: 0;\n legend {\n margin-bottom: ",";\n }\n label {\n border-color: ",";\n margin-bottom: ",";\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n"],["\n *,\n *:after,\n *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n border: none;\n padding: 0;\n legend {\n margin-bottom: ",";\n }\n label {\n border-color: ",";\n margin-bottom: ",";\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n"])),(function(n){return n.theme.spacing.xs}),(function(n){var o=n.$hasError,t=n.theme;return o&&t.colors.textError}),(function(n){return n.theme.spacing.none}));export{r as LegendSpan,i as StyledFieldset};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/LegendWrapper/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { type ThemeType } from \"../../types\";\n\ntype StyledFieldsetProps = {\n hasError?: boolean;\n
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/LegendWrapper/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { type ThemeType } from \"../../types\";\n\ntype StyledFieldsetProps = {\n $hasError?: boolean;\n $hasHintText?: boolean;\n theme: ThemeType;\n};\n\nexport const LegendSpan = styled.span<{\n $hasHintText: boolean;\n theme: ThemeType;\n}>`\n display: block;\n color: ${({ theme }) => theme.colors.textDark};\n font-size: ${({ theme }) => theme.fontSizes.m};\n line-height: ${({ theme }) => theme.typography.lineHeight};\n font-weight: ${({ theme }) => theme.typography.fontWeightLabels};\n font-family: ${({ theme }) => theme.typography.fontFamilyLabel};\n min-width: 3em;\n margin-bottom: ${({ $hasHintText, theme }) =>\n $hasHintText ? theme.spacing.xxs : 0};\n\n & > * {\n font-weight: ${({ theme }) => theme.typography.fontWeightBase};\n }\n`;\n\nexport const StyledFieldset = styled.fieldset<StyledFieldsetProps>`\n *,\n *:after,\n *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n border: none;\n padding: 0;\n legend {\n margin-bottom: ${({ theme }) => theme.spacing.xs};\n }\n label {\n border-color: ${({ $hasError, theme }) =>\n $hasError && theme.colors.textError};\n margin-bottom: ${({ theme }) => theme.spacing.none};\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n`;\n"],"names":["LegendSpan","styled","span","templateObject_1","__makeTemplateObject","_a","theme","colors","textDark","fontSizes","m","typography","lineHeight","fontWeightLabels","fontFamilyLabel","$hasHintText","spacing","xxs","fontWeightBase","StyledFieldset","fieldset","templateObject_2","xs","$hasError","textError","none"],"mappings":"iHAUa,QAAAA,EAAaC,EAAOC,KAAIC,IAAAA,EAAAC,EAAA,CAAA,iCAAA,mBAAA,qBAAA,qBAAA,qBAAA,0CAAA,oCAAA,YAAA,CAGnC,iCAE6C,mBACA,qBACY,qBACM,qBACD,0CAGxB,oCAGyB,eAVtD,SAACC,GAAc,OAAPA,EAAAC,MAAaC,OAAOC,QAAb,IACX,SAACH,GAAc,OAAPA,EAAAC,MAAaG,UAAUC,CAAhB,IACb,SAACL,GAAc,OAAPA,EAAAC,MAAaK,WAAWC,UAAjB,IACf,SAACP,GAAc,OAAPA,EAAAC,MAAaK,WAAWE,gBAAjB,IACf,SAACR,GAAc,OAAPA,EAAAC,MAAaK,WAAWG,eAAjB,IAEb,SAACT,OAAEU,EAAYV,EAAAU,aAAET,EAAKD,EAAAC,MACrC,OAAAS,EAAeT,EAAMU,QAAQC,IAAM,CAAnC,IAGe,SAACZ,GAAc,OAAPA,EAAAC,MAAaK,WAAWO,cAAjB,IAIrBC,EAAiBlB,EAAOmB,SAAQC,IAAAA,EAAAjB,EAAA,CAAA,6MAAA,wCAAA,yBAAA,kEAAA,CAAqB,6MAWd,wCAIX,yBACa,qEALjC,SAACC,GAAc,OAAPA,EAAAC,MAAaU,QAAQM,EAAd,IAGhB,SAACjB,OAAEkB,EAASlB,EAAAkB,UAAEjB,EAAKD,EAAAC,MACjC,OAAAiB,GAAajB,EAAMC,OAAOiB,SAA1B,IACe,SAACnB,GAAc,OAAPA,EAAAC,MAAaU,QAAQS,IAAd"}
|