@cruk/cruk-react-components 6.2.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/lib/index.css +2 -0
- package/lib/index.css.map +1 -0
- package/lib/src/components/AddressLookup/index.js +1 -1
- package/lib/src/components/AddressLookup/index.js.map +1 -1
- package/lib/src/components/AddressLookup/styles.d.ts +4 -9
- package/lib/src/components/AddressLookup/styles.js +1 -1
- package/lib/src/components/AddressLookup/styles.js.map +1 -1
- package/lib/src/components/AllThemesWrapper.d.ts +3 -3
- package/lib/src/components/Avatar/index.d.ts +8 -7
- package/lib/src/components/Avatar/index.js +1 -1
- package/lib/src/components/Avatar/index.js.map +1 -1
- package/lib/src/components/Avatar/styles.d.ts +1 -3
- package/lib/src/components/Avatar/styles.js +1 -1
- package/lib/src/components/Avatar/styles.js.map +1 -1
- package/lib/src/components/Badge/index.d.ts +14 -15
- package/lib/src/components/Badge/index.js +1 -1
- package/lib/src/components/Badge/index.js.map +1 -1
- package/lib/src/components/Badge/styles.d.ts +1 -2
- package/lib/src/components/Badge/styles.js +1 -1
- package/lib/src/components/Badge/styles.js.map +1 -1
- package/lib/src/components/Box/index.d.ts +2 -1
- package/lib/src/components/Box/index.js +1 -1
- package/lib/src/components/Box/index.js.map +1 -1
- package/lib/src/components/Box/styles.d.ts +2 -3
- package/lib/src/components/Box/styles.js +1 -1
- package/lib/src/components/Box/styles.js.map +1 -1
- package/lib/src/components/Button/index.js +1 -1
- package/lib/src/components/Button/index.js.map +1 -1
- package/lib/src/components/Button/styles.d.ts +2 -5
- package/lib/src/components/Button/styles.js +1 -1
- package/lib/src/components/Button/styles.js.map +1 -1
- package/lib/src/components/Carousel/styles.d.ts +1 -7
- package/lib/src/components/Carousel/styles.js +1 -1
- package/lib/src/components/Carousel/styles.js.map +1 -1
- package/lib/src/components/Checkbox/index.js +1 -1
- package/lib/src/components/Checkbox/index.js.map +1 -1
- package/lib/src/components/Checkbox/styles.d.ts +3 -11
- package/lib/src/components/Checkbox/styles.js +1 -1
- package/lib/src/components/Checkbox/styles.js.map +1 -1
- package/lib/src/components/Collapse/index.js +1 -1
- package/lib/src/components/Collapse/index.js.map +1 -1
- package/lib/src/components/Collapse/styles.d.ts +1 -3
- package/lib/src/components/Collapse/styles.js +1 -1
- package/lib/src/components/Collapse/styles.js.map +1 -1
- package/lib/src/components/DateField/index.js +1 -1
- package/lib/src/components/DateField/index.js.map +1 -1
- package/lib/src/components/DateField/styles.d.ts +6 -15
- package/lib/src/components/DateField/styles.js +1 -1
- package/lib/src/components/DateField/styles.js.map +1 -1
- package/lib/src/components/ErrorText/index.js +1 -1
- package/lib/src/components/ErrorText/index.js.map +1 -1
- package/lib/src/components/ErrorText/styles.d.ts +3 -7
- package/lib/src/components/ErrorText/styles.js +1 -1
- package/lib/src/components/ErrorText/styles.js.map +1 -1
- package/lib/src/components/Footer/index.d.ts +8 -6
- package/lib/src/components/Footer/index.js +1 -1
- package/lib/src/components/Footer/index.js.map +1 -1
- package/lib/src/components/Footer/styles.d.ts +6 -13
- package/lib/src/components/Footer/styles.js +1 -1
- package/lib/src/components/Footer/styles.js.map +1 -1
- package/lib/src/components/Header/index.d.ts +19 -18
- package/lib/src/components/Header/index.js +1 -1
- package/lib/src/components/Header/index.js.map +1 -1
- package/lib/src/components/Header/styles.d.ts +3 -14
- package/lib/src/components/Header/styles.js +1 -1
- package/lib/src/components/Header/styles.js.map +1 -1
- package/lib/src/components/Heading/index.js +1 -1
- package/lib/src/components/Heading/index.js.map +1 -1
- package/lib/src/components/Heading/styles.d.ts +1 -2
- package/lib/src/components/Heading/styles.js +1 -1
- package/lib/src/components/Heading/styles.js.map +1 -1
- package/lib/src/components/IconFa/index.js +1 -1
- package/lib/src/components/IconFa/index.js.map +1 -1
- package/lib/src/components/IconFa/styles.d.ts +0 -2
- package/lib/src/components/IconFa/styles.js.map +1 -1
- package/lib/src/components/InfoBox/index.d.ts +5 -4
- package/lib/src/components/InfoBox/index.js +1 -1
- package/lib/src/components/InfoBox/index.js.map +1 -1
- package/lib/src/components/InfoBox/styles.d.ts +4 -6
- package/lib/src/components/InfoBox/styles.js.map +1 -1
- package/lib/src/components/LabelWrapper/index.js +1 -1
- package/lib/src/components/LabelWrapper/index.js.map +1 -1
- package/lib/src/components/LabelWrapper/styles.d.ts +4 -14
- package/lib/src/components/LabelWrapper/styles.js +1 -1
- package/lib/src/components/LabelWrapper/styles.js.map +1 -1
- package/lib/src/components/LegendWrapper/index.js +1 -1
- package/lib/src/components/LegendWrapper/index.js.map +1 -1
- package/lib/src/components/LegendWrapper/styles.d.ts +1 -6
- package/lib/src/components/LegendWrapper/styles.js +1 -1
- package/lib/src/components/LegendWrapper/styles.js.map +1 -1
- package/lib/src/components/Link/index.js +1 -1
- package/lib/src/components/Link/index.js.map +1 -1
- package/lib/src/components/Link/styles.d.ts +1 -3
- package/lib/src/components/Link/styles.js +1 -1
- package/lib/src/components/Link/styles.js.map +1 -1
- package/lib/src/components/Loader/index.js +1 -1
- package/lib/src/components/Loader/index.js.map +1 -1
- package/lib/src/components/Loader/styles.module.css.js +2 -0
- package/lib/src/components/Loader/styles.module.css.js.map +1 -0
- package/lib/src/components/Modal/TestModalWithContent.d.ts +3 -1
- package/lib/src/components/Modal/TestModalWithState.d.ts +3 -1
- package/lib/src/components/Modal/index.d.ts +2 -1
- package/lib/src/components/Modal/index.js +1 -1
- package/lib/src/components/Modal/index.js.map +1 -1
- package/lib/src/components/Modal/styles.d.ts +3 -8
- package/lib/src/components/Modal/styles.js +1 -1
- package/lib/src/components/Modal/styles.js.map +1 -1
- package/lib/src/components/Pagination/index.js +1 -1
- package/lib/src/components/Pagination/index.js.map +1 -1
- package/lib/src/components/Pagination/styles.d.ts +1 -5
- package/lib/src/components/Pagination/styles.js +1 -1
- package/lib/src/components/Pagination/styles.js.map +1 -1
- package/lib/src/components/PopOver/index.js +1 -1
- package/lib/src/components/PopOver/index.js.map +1 -1
- package/lib/src/components/PopOver/styles.d.ts +1 -2
- package/lib/src/components/PopOver/styles.js +1 -1
- package/lib/src/components/PopOver/styles.js.map +1 -1
- package/lib/src/components/ProgressBar/index.js +1 -1
- package/lib/src/components/ProgressBar/index.js.map +1 -1
- package/lib/src/components/ProgressBar/styles.d.ts +2 -11
- package/lib/src/components/ProgressBar/styles.js +1 -1
- package/lib/src/components/ProgressBar/styles.js.map +1 -1
- package/lib/src/components/Radio/index.js +1 -1
- package/lib/src/components/Radio/index.js.map +1 -1
- package/lib/src/components/Radio/styles.d.ts +3 -12
- package/lib/src/components/Radio/styles.js +1 -1
- package/lib/src/components/Radio/styles.js.map +1 -1
- package/lib/src/components/RadioConsent/index.js +1 -1
- package/lib/src/components/RadioConsent/index.js.map +1 -1
- package/lib/src/components/RadioConsent/styles.d.ts +3 -10
- package/lib/src/components/RadioConsent/styles.js +1 -1
- package/lib/src/components/RadioConsent/styles.js.map +1 -1
- package/lib/src/components/Select/index.js +1 -1
- package/lib/src/components/Select/index.js.map +1 -1
- package/lib/src/components/Select/styles.d.ts +2 -7
- package/lib/src/components/Select/styles.js +1 -1
- package/lib/src/components/Select/styles.js.map +1 -1
- package/lib/src/components/Spacing/index.d.ts +2 -2
- package/lib/src/components/Spacing/index.js +1 -1
- package/lib/src/components/Spacing/index.js.map +1 -1
- package/lib/src/components/Step/index.js +1 -1
- package/lib/src/components/Step/index.js.map +1 -1
- package/lib/src/components/Step/styles.d.ts +2 -8
- package/lib/src/components/Step/styles.js +1 -1
- package/lib/src/components/Step/styles.js.map +1 -1
- package/lib/src/components/Text/index.d.ts +2 -2
- package/lib/src/components/Text/index.js +1 -1
- package/lib/src/components/Text/index.js.map +1 -1
- package/lib/src/components/Text/styles.d.ts +1 -2
- package/lib/src/components/Text/styles.js +1 -1
- package/lib/src/components/Text/styles.js.map +1 -1
- package/lib/src/components/TextAreaField/index.js +1 -1
- package/lib/src/components/TextAreaField/index.js.map +1 -1
- package/lib/src/components/TextAreaField/styles.d.ts +2 -5
- package/lib/src/components/TextAreaField/styles.js +1 -1
- package/lib/src/components/TextAreaField/styles.js.map +1 -1
- package/lib/src/components/TextField/index.js +1 -1
- package/lib/src/components/TextField/index.js.map +1 -1
- package/lib/src/components/TextField/styles.d.ts +3 -8
- package/lib/src/components/TextField/styles.js +1 -1
- package/lib/src/components/TextField/styles.js.map +1 -1
- package/lib/src/components/Totaliser/index.d.ts +5 -6
- package/lib/src/components/Totaliser/index.js +1 -1
- package/lib/src/components/Totaliser/index.js.map +1 -1
- package/lib/src/components/Totaliser/styles.d.ts +5 -18
- package/lib/src/components/Totaliser/styles.js +1 -1
- package/lib/src/components/Totaliser/styles.js.map +1 -1
- package/lib/src/components/UserBlock/index.d.ts +3 -1
- package/lib/src/components/UserBlock/index.js +1 -1
- package/lib/src/components/UserBlock/index.js.map +1 -1
- package/lib/src/components/UserBlock/styles.d.ts +3 -8
- package/lib/src/components/UserBlock/styles.js +1 -1
- package/lib/src/components/UserBlock/styles.js.map +1 -1
- package/lib/src/components/index.d.ts +1 -8
- package/lib/src/components/index.js +1 -1
- package/lib/src/types.d.ts +8 -172
- package/lib/src/types.js +2 -0
- package/lib/src/types.js.map +1 -0
- package/lib/src/utils/themeUtils.d.ts +4 -3
- package/lib/src/utils/themeUtils.js +1 -1
- package/lib/src/utils/themeUtils.js.map +1 -1
- package/package.json +10 -5
- package/lib/src/components/Flex.d.ts +0 -8
- package/lib/src/components/Flex.js +0 -2
- package/lib/src/components/Flex.js.map +0 -1
- package/lib/src/components/Fontface.d.ts +0 -4
- package/lib/src/components/Fontface.js +0 -2
- package/lib/src/components/Fontface.js.map +0 -1
- package/lib/src/components/GlobalStyle.d.ts +0 -2
- package/lib/src/components/GlobalStyle.js +0 -2
- package/lib/src/components/GlobalStyle.js.map +0 -1
- package/lib/src/components/GlobalStyleNoFontFace.d.ts +0 -2
- package/lib/src/components/GlobalStyleNoFontFace.js +0 -2
- package/lib/src/components/GlobalStyleNoFontFace.js.map +0 -1
- package/lib/src/components/Loader/styles.d.ts +0 -7
- package/lib/src/components/Loader/styles.js +0 -2
- package/lib/src/components/Loader/styles.js.map +0 -1
- package/lib/src/components/ThemeCheatSheet.d.ts +0 -7
- package/lib/src/themes/bowelbabe.d.ts +0 -14
- package/lib/src/themes/bowelbabe.js +0 -2
- package/lib/src/themes/bowelbabe.js.map +0 -1
- package/lib/src/themes/cruk.d.ts +0 -14
- package/lib/src/themes/cruk.js +0 -2
- package/lib/src/themes/cruk.js.map +0 -1
- package/lib/src/themes/rfl.d.ts +0 -14
- package/lib/src/themes/rfl.js +0 -2
- package/lib/src/themes/rfl.js.map +0 -1
- package/lib/src/themes/su2c.d.ts +0 -14
- package/lib/src/themes/su2c.js +0 -2
- package/lib/src/themes/su2c.js.map +0 -1
- package/lib/vite.config.d.ts +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";import{Button as i}from"../Button/index.js";var o,r,e,a,s=.5,l=t.span(o||(o=n(["\n display: inline-block;\n transform: ",";\n transition-duration: ","s;\n"],["\n display: inline-block;\n transform: ",";\n transition-duration: ","s;\n"])),function(n){return n.$open?"translateY(0.1em) scaleY(-1)":"initial"},.5),f=t(i)(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){return n.$textColor},function(n){return n.$textSize},function(n){return n.$textFontFamily||'var(--typ-font-family-base, "Poppins", Arial, sans-serif)'},function(n){return n.$textColor}),m=t.div(e||(e=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"}),u=t.div(a||(a=n(["\n cursor: pointer;\n"],["\n cursor: pointer;\n"])));export{m as CollapseContent,u as CustomHeader,f as DefaultHeader,l as FlippingIcon,s 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
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Collapse/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport Button from \"../Button\";\n\nexport const transitionDurationSeconds = 0.5;\n\nexport const FlippingIcon = styled.span<{ $open: boolean }>`\n display: inline-block;\n transform: ${({ $open }) =>\n $open ? \"translateY(0.1em) scaleY(-1)\" : \"initial\"};\n transition-duration: ${transitionDurationSeconds}s;\n`;\n\nexport const DefaultHeader = styled(Button)<{\n $textColor?: string;\n $textSize?: string;\n $textFontFamily?: string;\n}>`\n display: flex;\n color: ${({ $textColor }) => $textColor};\n font-size: ${({ $textSize }) => $textSize};\n font-family: ${({ $textFontFamily }) =>\n $textFontFamily ||\n `var(--typ-font-family-base, \"Poppins\", Arial, sans-serif)`};\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: ${({ $textColor }) => $textColor};\n }\n`;\n\nexport const CollapseContent = styled.div<{\n $contentHeight: string;\n $openStatus: boolean;\n}>`\n margin: 0;\n transition: ${transitionDurationSeconds}s ease;\n height: ${({ $contentHeight }: { $contentHeight: string }) => $contentHeight};\n visibility: ${({ $openStatus }: { $openStatus: boolean }) =>\n $openStatus ? \"visible\" : \"hidden\"};\n overflow: hidden;\n & > p {\n margin-top: 0;\n }\n`;\n\nexport const CustomHeader = styled.div`\n cursor: pointer;\n`;\n"],"names":["transitionDurationSeconds","FlippingIcon","styled","span","templateObject_1","__makeTemplateObject","_a","$open","DefaultHeader","Button","templateObject_2","$textColor","$textSize","$textFontFamily","CollapseContent","div","templateObject_3","$contentHeight","$openStatus","CustomHeader","templateObject_4"],"mappings":"6JAIO,YAAMA,EAA4B,GAE5BC,EAAeC,EAAOC,KAAIC,IAAAA,EAAAC,EAAA,CAAA,4CAAA,6BAAA,QAAA,CAAoB,4CAGL,6BACJ,UAFnC,SAACC,GACZ,OADmBA,EAAAC,MACX,+BAAiC,SAAzC,EALqC,IAS5BC,EAAgBN,EAAOO,EAAPP,CAAcQ,IAAAA,EAAAL,EAAA,CAAA,gCAAA,mBAAA,qBAAA,+KAAA,YAAA,CAIzC,gCAEuC,mBACE,qBAGoB,+KASpB,cAbhC,SAACC,GAAmB,OAAPA,EAAAK,UAAO,EAChB,SAACL,GAAkB,OAAPA,EAAAM,SAAO,EACjB,SAACN,GACd,OAD+BA,EAAAO,iBAE/B,2DADA,EAUS,SAACP,GAAmB,OAAPA,EAAAK,UAAO,GAIpBG,EAAkBZ,EAAOa,IAAGC,IAAAA,EAAAX,EAAA,CAAA,iCAAA,sBAAA,oBAAA,gEAAA,CAGvC,iCAEuC,sBACqC,oBAExC,kEAxCG,GAsC7B,SAACC,GAAmD,OAAnCA,EAAAW,cAAmC,EAChD,SAACX,GACb,OAD0BA,EAAAY,YACZ,UAAY,QAA1B,GAOSC,EAAejB,EAAOa,IAAGK,IAAAA,EAAAf,EAAA,CAAA,0BAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{
|
|
1
|
+
import e from"react";import{ErrorText as t}from"../ErrorText/index.js";import{Text as n}from"../Text/index.js";import{TextField as r}from"../TextField/index.js";import{Fieldset as a,LegendText as o,DateTextFieldWrapper as l,LargeDateTextFieldWrapper as i,ErrorTextWrapper as d}from"./styles.js";function m(m){var u=m.label,c=m.hintText,s=m.day,h=m.month,p=m.year,y=m.dayName,E=void 0===y?"day":y,x=m.monthName,b=void 0===x?"month":x,f=m.yearName,g=void 0===f?"year":f,v=m.dayHasError,C=m.monthHasError,q=m.yearHasError,I=m.errorMessage,L=m.onChange,F=void 0===L?function(){}:L,M=m.onBlur,T=void 0===M?function(){}:M,j=m.onFocus,B=void 0===j?function(){}:j,H=m.disabled,N=m.required;return e.createElement(a,null,e.createElement(o,null,u,!N&&e.createElement("span",{style:{fontWeight:"var(--typ-font-weight-base, 300)"}}," (optional)")),c&&e.createElement(n,{textColor:"text-mid"},c),e.createElement(l,null,e.createElement(r,{label:"Day",type:"text",name:E,required:!!N,hideRequiredIndicationInLabel:!0,maxLength:2,autoComplete:"bday-day",pattern:"[0-9]*",inputMode:"numeric",value:s,onChange:F,onBlur:T,onFocus:B,hasError:v,disabled:H})),e.createElement(l,null,e.createElement(r,{label:"Month",type:"text",name:b,required:!!N,hideRequiredIndicationInLabel:!0,maxLength:2,autoComplete:"bday-month",pattern:"[0-9]*",inputMode:"numeric",value:h,onChange:F,onBlur:T,onFocus:B,hasError:C,disabled:H})),e.createElement(i,null,e.createElement(r,{label:"Year",type:"text",name:g,required:!!N,hideRequiredIndicationInLabel:!0,maxLength:4,autoComplete:"bday-year",pattern:"[0-9]*",inputMode:"numeric",value:p,onChange:F,onBlur:T,onFocus:B,hasError:q,disabled:H})),I&&e.createElement(d,null,e.createElement(t,{marginTop:"xxs"},I)))}export{m as DateField,m as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/DateField/index.tsx"],"sourcesContent":["import React, { type InputHTMLAttributes } from \"react\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/DateField/index.tsx"],"sourcesContent":["import React, { type InputHTMLAttributes } from \"react\";\n\nimport { ErrorText } from \"../ErrorText\";\nimport { Text } from \"../Text\";\nimport { TextField } from \"../TextField\";\n\nimport {\n Fieldset,\n DateTextFieldWrapper,\n LargeDateTextFieldWrapper,\n ErrorTextWrapper,\n LegendText,\n} from \"./styles\";\n\nexport type DateFieldProps = InputHTMLAttributes<HTMLInputElement> & {\n /** label text */\n label: string;\n /** hind text */\n hintText?: string;\n /** day field text value */\n day: string;\n /** month field text value */\n month: string;\n /** year field text value */\n year: string;\n /** name passed to day field input element */\n dayName?: string;\n /** name passed to month field input element */\n monthName?: string;\n /** name passed to year field input element */\n yearName?: string;\n /** flag of error styling on day field */\n dayHasError?: boolean;\n /** flag of error styling on month field */\n monthHasError?: boolean;\n /** flag of error styling on year field */\n yearHasError?: boolean;\n /** error message text */\n errorMessage?: string;\n};\n\n/**\n * To be used in forms entering dates like date of birth which are known dates and would take too long to get to with a date picker\n * */\nexport function DateField({\n label,\n hintText,\n day,\n month,\n year,\n dayName = \"day\",\n monthName = \"month\",\n yearName = \"year\",\n dayHasError,\n monthHasError,\n yearHasError,\n errorMessage,\n onChange = () => {\n // no op\n },\n onBlur = () => {\n // no op\n },\n onFocus = () => {\n // no op\n },\n disabled,\n required,\n}: DateFieldProps) {\n return (\n <Fieldset>\n <LegendText>\n {label}\n {!required && (\n <span\n style={{\n fontWeight: \"var(--typ-font-weight-base, 300)\",\n }}\n >\n {` (optional)`}\n </span>\n )}\n </LegendText>\n {hintText && <Text textColor=\"text-mid\">{hintText}</Text>}\n <DateTextFieldWrapper>\n <TextField\n label=\"Day\"\n type=\"text\"\n name={dayName}\n required={!!required}\n hideRequiredIndicationInLabel\n maxLength={2}\n autoComplete=\"bday-day\"\n pattern=\"[0-9]*\"\n inputMode=\"numeric\"\n value={day}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n hasError={dayHasError}\n disabled={disabled}\n />\n </DateTextFieldWrapper>\n <DateTextFieldWrapper>\n <TextField\n label=\"Month\"\n type=\"text\"\n name={monthName}\n required={!!required}\n hideRequiredIndicationInLabel\n maxLength={2}\n autoComplete=\"bday-month\"\n pattern=\"[0-9]*\"\n inputMode=\"numeric\"\n value={month}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n hasError={monthHasError}\n disabled={disabled}\n />\n </DateTextFieldWrapper>\n <LargeDateTextFieldWrapper>\n <TextField\n label=\"Year\"\n type=\"text\"\n name={yearName}\n required={!!required}\n hideRequiredIndicationInLabel\n maxLength={4}\n autoComplete=\"bday-year\"\n pattern=\"[0-9]*\"\n inputMode=\"numeric\"\n value={year}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n hasError={yearHasError}\n disabled={disabled}\n />\n </LargeDateTextFieldWrapper>\n {errorMessage && (\n <ErrorTextWrapper>\n <ErrorText marginTop=\"xxs\">{errorMessage}</ErrorText>\n </ErrorTextWrapper>\n )}\n </Fieldset>\n );\n}\n\nexport default DateField;\n"],"names":["DateField","_a","label","hintText","day","month","year","_b","dayName","_c","monthName","_d","yearName","dayHasError","monthHasError","yearHasError","errorMessage","_e","onChange","_f","onBlur","_g","onFocus","disabled","required","React","Fieldset","createElement","LegendText","style","fontWeight","Text","textColor","DateTextFieldWrapper","TextField","type","name","hideRequiredIndicationInLabel","maxLength","autoComplete","pattern","inputMode","value","hasError","LargeDateTextFieldWrapper","ErrorTextWrapper","ErrorText","marginTop"],"mappings":"uSA4CM,SAAUA,EAAUC,OACxBC,EAAKD,EAAAC,MACLC,EAAQF,EAAAE,SACRC,EAAGH,EAAAG,IACHC,EAAKJ,EAAAI,MACLC,EAAIL,EAAAK,KACJC,EAAAN,EAAAO,QAAAA,OAAO,IAAAD,EAAG,MAAKA,EACfE,EAAAR,EAAAS,UAAAA,OAAS,IAAAD,EAAG,QAAOA,EACnBE,aAAAC,aAAW,OAAMD,EACjBE,EAAWZ,EAAAY,YACXC,EAAab,EAAAa,cACbC,EAAYd,EAAAc,aACZC,iBACAC,EAAAhB,EAAAiB,SAAAA,OAAQ,IAAAD,EAAG,WAEX,EAACA,EACDE,EAAAlB,EAAAmB,OAAAA,OAAM,IAAAD,EAAG,WAET,EAACA,EACDE,EAAApB,EAAAqB,QAAAA,OAAO,IAAAD,EAAG,WAEV,IACAE,EAAQtB,EAAAsB,SACRC,EAAQvB,EAAAuB,SAER,OACEC,gBAACC,EAAQ,KACPD,EAAAE,cAACC,EAAU,KACR1B,GACCsB,GACAC,EAAAE,cAAA,OAAA,CACEE,MAAO,CACLC,WAAY,qCAGb,gBAIN3B,GAAYsB,gBAACM,EAAI,CAACC,UAAU,YAAY7B,GACzCsB,EAAAE,cAACM,EAAoB,KACnBR,EAAAE,cAACO,EAAS,CACRhC,MAAM,MACNiC,KAAK,OACLC,KAAM5B,EACNgB,WAAYA,EACZa,+BAA6B,EAC7BC,UAAW,EACXC,aAAa,WACbC,QAAQ,SACRC,UAAU,UACVC,MAAOtC,EACPc,SAAUA,EACVE,OAAQA,EACRE,QAASA,EACTqB,SAAU9B,EACVU,SAAUA,KAGdE,EAAAE,cAACM,EAAoB,KACnBR,EAAAE,cAACO,EAAS,CACRhC,MAAM,QACNiC,KAAK,OACLC,KAAM1B,EACNc,WAAYA,EACZa,+BAA6B,EAC7BC,UAAW,EACXC,aAAa,aACbC,QAAQ,SACRC,UAAU,UACVC,MAAOrC,EACPa,SAAUA,EACVE,OAAQA,EACRE,QAASA,EACTqB,SAAU7B,EACVS,SAAUA,KAGdE,EAAAE,cAACiB,EAAyB,KACxBnB,EAAAE,cAACO,EAAS,CACRhC,MAAM,OACNiC,KAAK,OACLC,KAAMxB,EACNY,WAAYA,EACZa,+BAA6B,EAC7BC,UAAW,EACXC,aAAa,YACbC,QAAQ,SACRC,UAAU,UACVC,MAAOpC,EACPY,SAAUA,EACVE,OAAQA,EACRE,QAASA,EACTqB,SAAU5B,EACVQ,SAAUA,KAGbP,GACCS,EAAAE,cAACkB,EAAgB,KACfpB,EAAAE,cAACmB,EAAS,CAACC,UAAU,OAAO/B,IAKtC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { type ThemeType } from "../../types";
|
|
2
1
|
export declare const Fieldset: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, never>> & string;
|
|
3
|
-
export declare const LegendText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const TextAsLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../Spacing").SpacingProps & import("react").HTMLAttributes<HTMLElement> & {
|
|
7
|
-
textColor?: string;
|
|
2
|
+
export declare const LegendText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, never>> & string;
|
|
3
|
+
export declare const TextAsLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../Spacing").SpacingProps & import("react").HTMLAttributes<HTMLElement> & {
|
|
4
|
+
textColor?: typeof import("..").colours[number] | string;
|
|
8
5
|
textAlign?: "left" | "right" | "center" | "justify";
|
|
9
6
|
textSize?: import("..").FontSizeType;
|
|
10
7
|
textWeight?: number | string;
|
|
@@ -13,13 +10,7 @@ export declare const TextAsLabel: import("styled-components/dist/types").IStyled
|
|
|
13
10
|
wordBreak?: import("..").WordBreakType;
|
|
14
11
|
overflowWrap?: import("..").OverflowWrapType;
|
|
15
12
|
ref?: import("react").Ref<HTMLElement>;
|
|
16
|
-
}, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export declare const DateTextFieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
20
|
-
theme: ThemeType;
|
|
21
|
-
}>> & string;
|
|
22
|
-
export declare const LargeDateTextFieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme"> & {
|
|
23
|
-
theme: ThemeType;
|
|
24
|
-
}, never>> & string;
|
|
13
|
+
}, never>> & string & Omit<(props: import("../Text").TextProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
14
|
+
export declare const DateTextFieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
+
export declare const LargeDateTextFieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
25
16
|
export declare const ErrorTextWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import i from"styled-components";import{Text as t}from"../Text/index.js";var a=i.fieldset(r||(r=n(["\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 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"]))),e=i.legend(o||(o=n(['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n margin-bottom: var(--spacing-xxs, 1rem);\n\n // do not increase font size of check icon at this breakpoint\n @media (min-width: 1200px) {\n font-size: var(--font-size-ml, 1.125rem);\n }\n'],['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n margin-bottom: var(--spacing-xxs, 1rem);\n\n // do not increase font size of check icon at this breakpoint\n @media (min-width: 1200px) {\n font-size: var(--font-size-ml, 1.125rem);\n }\n'])));i(t)(s||(s=n(['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n'],['\n font-family: var(--typ-font-family-label, "Poppins", Arial, sans-serif);\n'])));var r,o,s,m,l,p,f=i.div(m||(m=n(["\n display: inline-block;\n width: 60px;\n margin-right: var(--spacing-xs, 1rem);\n span {\n margin-bottom: 0.25rem; // this is smaller than xxs spacing\n font-weight: var(--typ-font-weight-base, 300);\n }\n"],["\n display: inline-block;\n width: 60px;\n margin-right: var(--spacing-xs, 1rem);\n span {\n margin-bottom: 0.25rem; // this is smaller than xxs spacing\n font-weight: var(--typ-font-weight-base, 300);\n }\n"]))),b=i.div(l||(l=n(["\n display: inline-block;\n width: 80px;\n margin-right: var(--spacing-xs, 1rem);\n span {\n margin-bottom: 0.25rem; // this is smaller than xxs spacing\n font-weight: var(--typ-font-weight-base, 300);\n }\n"],["\n display: inline-block;\n width: 80px;\n margin-right: var(--spacing-xs, 1rem);\n span {\n margin-bottom: 0.25rem; // this is smaller than xxs spacing\n font-weight: var(--typ-font-weight-base, 300);\n }\n"]))),g=i.div(p||(p=n(["\n clear: left;\n"],["\n clear: left;\n"])));export{f as DateTextFieldWrapper,g as ErrorTextWrapper,a as Fieldset,b as LargeDateTextFieldWrapper,e as LegendText};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/DateField/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/DateField/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\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 LegendText = styled.legend`\n font-family: var(--typ-font-family-label, \"Poppins\", Arial, sans-serif);\n font-weight: var(--typ-font-weight-labels, 500);\n margin-bottom: var(--spacing-xxs, 1rem);\n\n // do not increase font size of check icon at this breakpoint\n @media (min-width: 1200px) {\n font-size: var(--font-size-ml, 1.125rem);\n }\n`;\n\nexport const TextAsLabel = styled(Text)`\n font-family: var(--typ-font-family-label, \"Poppins\", Arial, sans-serif);\n`;\n\nexport const DateTextFieldWrapper = styled.div`\n display: inline-block;\n width: 60px;\n margin-right: var(--spacing-xs, 1rem);\n span {\n margin-bottom: 0.25rem; // this is smaller than xxs spacing\n font-weight: var(--typ-font-weight-base, 300);\n }\n`;\n\nexport const LargeDateTextFieldWrapper = styled.div`\n display: inline-block;\n width: 80px;\n margin-right: var(--spacing-xs, 1rem);\n span {\n margin-bottom: 0.25rem; // this is smaller than xxs spacing\n font-weight: var(--typ-font-weight-base, 300);\n }\n`;\n\nexport const ErrorTextWrapper = styled.div`\n clear: left;\n`;\n"],"names":["Fieldset","styled","fieldset","templateObject_1","__makeTemplateObject","LegendText","legend","templateObject_2","Text","templateObject_3","DateTextFieldWrapper","div","templateObject_4","LargeDateTextFieldWrapper","templateObject_5","ErrorTextWrapper","templateObject_6"],"mappings":"yJAGO,IAAMA,EAAWC,EAAOC,SAAQC,IAAAA,EAAAC,EAAA,CAAA,0LAAA,CAAA,6LAa1BC,EAAaJ,EAAOK,OAAMC,IAAAA,EAAAH,EAAA,CAAA,yUAAA,CAAA,4UAWZH,EAAOO,EAAPP,CAAYQ,IAAAA,EAAAL,EAAA,CAAA,kFAAA,CAAA,qFAIhC,gBAAMM,EAAuBT,EAAOU,IAAGC,IAAAA,EAAAR,EAAA,CAAA,8NAAA,CAAA,iOAUjCS,EAA4BZ,EAAOU,IAAGG,IAAAA,EAAAV,EAAA,CAAA,8NAAA,CAAA,iOAUtCW,EAAmBd,EAAOU,IAAGK,IAAAA,EAAAZ,EAAA,CAAA,sBAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as
|
|
1
|
+
import{__rest as e,__assign as r}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{faTriangleExclamation as o}from"../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";import{StyledErrorText as s}from"./styles.js";import{IconFa as i}from"../IconFa/index.js";import{Box as n}from"../Box/index.js";function a(a){var m=a.children,l=a.as,d=void 0===l?"span":l,f=e(a,["children","as"]),c="string"==typeof m&&m.length;return t.createElement(s,r({forwardedAs:d},f,{role:"alert",textColor:"var(--clr-text-error, #d93025)",textWeight:"var(--typ-font-weight-heavy, 700)"}),c?t.createElement(n,{as:"span",marginRight:"xxs"},t.createElement(i,{faIcon:o,size:"1em"})):null,m)}export{a as ErrorText,a as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/ErrorText/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/ErrorText/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes } from \"react\";\nimport { faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { type SpacingProps } from \"../Spacing\";\nimport { StyledErrorText } from \"./styles\";\nimport { IconFa } from \"../IconFa\";\nimport { Box } from \"../Box\";\n\nexport type ErrorTextProps = SpacingProps &\n HTMLAttributes<HTMLElement> & {\n as?: React.ElementType;\n };\n\n/**\n *\n * To be used in forms for inline validation. Applies styling and accessibility attribute so that it will be read by screen readers.\n *\n * Please be aware that some input components already have this component built in and can be passed an \"errorMessage\" prop\n */\nexport function ErrorText({ children, as = \"span\", ...props }: ErrorTextProps) {\n const shouldShowIcon = typeof children === \"string\" && children.length;\n return (\n <StyledErrorText\n forwardedAs={as}\n {...props}\n role=\"alert\"\n textColor=\"var(--clr-text-error, #d93025)\"\n textWeight=\"var(--typ-font-weight-heavy, 700)\"\n >\n {shouldShowIcon ? (\n <Box as=\"span\" marginRight=\"xxs\">\n <IconFa faIcon={faTriangleExclamation} size=\"1em\" />\n </Box>\n ) : null}\n {children}\n </StyledErrorText>\n );\n}\n\nexport default ErrorText;\n"],"names":["ErrorText","_a","children","_b","as","props","__rest","shouldShowIcon","length","React","StyledErrorText","__assign","forwardedAs","role","textColor","textWeight","createElement","Box","marginRight","IconFa","faIcon","faTriangleExclamation","size"],"mappings":"8UAmBM,SAAUA,EAAUC,GAAE,IAAAC,EAAQD,EAAAC,SAAEC,EAAAF,EAAAG,GAAAA,OAAE,IAAAD,EAAG,OAAMA,EAAKE,EAAKC,EAAAL,EAAjC,mBAClBM,EAAqC,iBAAbL,GAAyBA,EAASM,OAChE,OACEC,gBAACC,EAAeC,EAAA,CACdC,YAAaR,GACTC,EAAK,CACTQ,KAAK,QACLC,UAAU,iCACVC,WAAW,sCAEVR,EACCE,EAAAO,cAACC,EAAG,CAACb,GAAG,OAAOc,YAAY,OACzBT,EAAAO,cAACG,EAAM,CAACC,OAAQC,EAAuBC,KAAK,SAE5C,KACHpB,EAGP"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
theme: ThemeType;
|
|
4
|
-
};
|
|
5
|
-
export declare const StyledErrorText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../Spacing").SpacingProps & import("react").HTMLAttributes<HTMLElement> & {
|
|
6
|
-
textColor?: string;
|
|
1
|
+
export declare const StyledErrorText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../Spacing").SpacingProps & import("react").HTMLAttributes<HTMLElement> & {
|
|
2
|
+
textColor?: typeof import("..").colours[number] | string;
|
|
7
3
|
textAlign?: "left" | "right" | "center" | "justify";
|
|
8
4
|
textSize?: import("..").FontSizeType;
|
|
9
5
|
textWeight?: number | string;
|
|
@@ -12,5 +8,5 @@ export declare const StyledErrorText: import("styled-components/dist/types").ISt
|
|
|
12
8
|
wordBreak?: import("..").WordBreakType;
|
|
13
9
|
overflowWrap?: import("..").OverflowWrapType;
|
|
14
10
|
ref?: import("react").Ref<HTMLElement>;
|
|
15
|
-
},
|
|
11
|
+
}, never>> & string & Omit<(props: import("../Text").TextProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
16
12
|
export default StyledErrorText;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as o}from"../../../node_modules/tslib/tslib.es6.js";import
|
|
1
|
+
import{__makeTemplateObject as o}from"../../../node_modules/tslib/tslib.es6.js";import i from"styled-components";import{Text as n}from"../Text/index.js";var e,l=i(n)(e||(e=o(["\n display: inline-block;\n"],["\n display: inline-block;\n"])));export{l as StyledErrorText,l as default};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/ErrorText/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport Text from \"../Text\";\
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/ErrorText/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport Text from \"../Text\";\n\nexport const StyledErrorText = styled(Text)`\n display: inline-block;\n`;\n\nexport default StyledErrorText;\n"],"names":["StyledErrorText","styled","Text","templateObject_1","__makeTemplateObject"],"mappings":"yJAGO,MAAMA,EAAkBC,EAAOC,EAAPD,CAAYE,IAAAA,EAAAC,EAAA,CAAA,gCAAA,CAAA"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { type ReactNode, type HTMLAttributes } from "react";
|
|
2
|
-
|
|
3
|
-
/** used to customise text in middle section, it could also be react element, this is not to be confused with the component children which is primarily for the links in the footer */
|
|
4
|
-
middleSection?: ReactNode;
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
};
|
|
2
|
+
import { type ThemeNameType } from "../../types";
|
|
7
3
|
/**
|
|
8
4
|
* There should be only one footer component at the bottom of the body of each page. Links can be passed as children
|
|
9
5
|
* */
|
|
10
|
-
export declare function Footer({ children,
|
|
6
|
+
export declare function Footer({ children, themeName, footerText, }: HTMLAttributes<HTMLElement> & {
|
|
7
|
+
/** used to customise text in middle section, it could also be react element, this is not to be confused with the component children which is primarily for the links in the footer */
|
|
8
|
+
middleSection?: ReactNode;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
themeName?: ThemeNameType;
|
|
11
|
+
footerText?: string;
|
|
12
|
+
}): React.JSX.Element;
|
|
11
13
|
export default Footer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{Text as a}from"../Text/index.js";import{StyledFooter as n,Bar as t,FooterContentWrapper as r,FooterSection as l,StyledNav as s,StyledUL as c,StyledLI as i,StyledRegulatorLogo as d,StyledAddress as o}from"./styles.js";function m(m){var u=m.children,h=m.themeName,g=void 0===h?"cruk":h,f=m.footerText,E=e.Children.toArray(u);return e.createElement(n,null,e.createElement(t,null),e.createElement(r,null,e.createElement(l,null,e.createElement(s,{"aria-label":"footer links"},e.createElement(c,null,E.length?E.map(function(a,n){var t="footerLink".concat(n);return e.createElement(i,{key:t},a)}):null))),e.createElement(l,null,e.createElement(d,{width:130,height:40,alt:"Registered with Fundraising Regulator",src:"https://rcl.assets.cancerresearchuk.org/images/logos/fundreg.png"})),e.createElement(l,null,f?e.createElement(a,{textSize:"m"},f):e.createElement(e.Fragment,null,e.createElement(a,{textSize:"m",as:"span"},function(e){switch(e){case"su2c":return"Stand Up To Cancer and Stand Up To Cancer Brand Marks are registered trademarks of the Entertainment Industry Foundation. Cancer Research UK is a registered charity in England and Wales (1089464), Scotland(SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales (4325234) and the Isle of Man (5713F). Registered address: 2 Redman Place, London, E20 1JQ. Donations will be made to Cancer Research UK in support of the Stand Up To Cancer campaign.";case"bowelbabe":return"The Bowelbabe Fund for Cancer Research UK, raises money to fund clinical trials, research and cancer information and awareness, as well as other initiatives to combat cancer and support those affected by cancer. The Bowelbabe Fund is a restricted fund within Cancer Research UK. Cancer Research UK is a registered charity in England and Wales (1089464), Scotland (SC041666), the Isle of Man (1103) and Jersey (247) and is registered with the Fundraising Regulator.";default:return"Cancer Research UK is a registered charity in England and Wales (1089464), Scotland (SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales(4325234) and the Isle of Man (5713F)."}}(g)," Registered address:"),e.createElement(o,null,e.createElement(a,{textSize:"m",as:"span"}," ","2 Redman Place, London, E20 1JQ"))))))}export{m as Footer,m as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Footer/index.tsx"],"sourcesContent":["import React, { type ReactNode, type HTMLAttributes } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Footer/index.tsx"],"sourcesContent":["import React, { type ReactNode, type HTMLAttributes } from \"react\";\nimport { Text } from \"../Text\";\n\nimport {\n StyledFooter,\n FooterContentWrapper,\n FooterSection,\n StyledAddress,\n StyledRegulatorLogo,\n StyledNav,\n StyledUL,\n StyledLI,\n Bar,\n} from \"./styles\";\nimport { type ThemeNameType } from \"../../types\";\n\nconst footerTextCruk =\n \"Cancer Research UK is a registered charity in England and Wales (1089464), Scotland (SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales(4325234) and the Isle of Man (5713F).\";\nconst footerTextSu2c =\n \"Stand Up To Cancer and Stand Up To Cancer Brand Marks are registered trademarks of the Entertainment Industry Foundation. Cancer Research UK is a registered charity in England and Wales (1089464), Scotland(SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales (4325234) and the Isle of Man (5713F). Registered address: 2 Redman Place, London, E20 1JQ. Donations will be made to Cancer Research UK in support of the Stand Up To Cancer campaign.\";\nconst footerTextBowelBabe =\n \"The Bowelbabe Fund for Cancer Research UK, raises money to fund clinical trials, research and cancer information and awareness, as well as other initiatives to combat cancer and support those affected by cancer. The Bowelbabe Fund is a restricted fund within Cancer Research UK. Cancer Research UK is a registered charity in England and Wales (1089464), Scotland (SC041666), the Isle of Man (1103) and Jersey (247) and is registered with the Fundraising Regulator.\";\n\nfunction footerTextForTheme(themeName: string): string {\n switch (themeName) {\n case \"su2c\":\n return footerTextSu2c;\n case \"bowelbabe\":\n return footerTextBowelBabe;\n default:\n return footerTextCruk;\n }\n}\n\n/**\n * There should be only one footer component at the bottom of the body of each page. Links can be passed as children\n * */\nexport function Footer({\n children,\n themeName = \"cruk\",\n footerText,\n}: HTMLAttributes<HTMLElement> & {\n /** used to customise text in middle section, it could also be react element, this is not to be confused with the component children which is primarily for the links in the footer */\n middleSection?: ReactNode;\n children?: ReactNode;\n themeName?: ThemeNameType;\n footerText?: string;\n}) {\n const childArray = React.Children.toArray(children);\n\n return (\n <StyledFooter>\n <Bar />\n <FooterContentWrapper>\n <FooterSection>\n <StyledNav aria-label=\"footer links\">\n <StyledUL>\n {childArray.length\n ? childArray.map((child, index) => {\n const footerLinkKey = `footerLink${index}`;\n return <StyledLI key={footerLinkKey}>{child}</StyledLI>;\n })\n : null}\n </StyledUL>\n </StyledNav>\n </FooterSection>\n <FooterSection>\n <StyledRegulatorLogo\n width={130}\n height={40}\n alt=\"Registered with Fundraising Regulator\"\n src=\"https://rcl.assets.cancerresearchuk.org/images/logos/fundreg.png\"\n />\n </FooterSection>\n\n <FooterSection>\n {footerText ? (\n <Text textSize=\"m\">{footerText}</Text>\n ) : (\n <>\n <Text textSize=\"m\" as=\"span\">\n {footerTextForTheme(themeName)} Registered address:\n </Text>\n <StyledAddress>\n <Text textSize=\"m\" as=\"span\">\n {\" \"}\n 2 Redman Place, London, E20 1JQ\n </Text>\n </StyledAddress>\n </>\n )}\n </FooterSection>\n </FooterContentWrapper>\n </StyledFooter>\n );\n}\n\nexport default Footer;\n"],"names":["Footer","_a","children","_b","themeName","footerText","childArray","React","Children","toArray","StyledFooter","createElement","Bar","FooterContentWrapper","FooterSection","StyledNav","StyledUL","length","map","child","index","footerLinkKey","concat","StyledLI","key","StyledRegulatorLogo","width","height","alt","src","Text","textSize","Fragment","as","footerTextForTheme","StyledAddress"],"mappings":"qPAqCM,SAAUA,EAAOC,OACrBC,EAAQD,EAAAC,SACRC,EAAAF,EAAAG,UAAAA,aAAY,OAAMD,EAClBE,EAAUJ,EAAAI,WAQJC,EAAaC,EAAMC,SAASC,QAAQP,GAE1C,OACEK,gBAACG,EAAY,KACXH,EAAAI,cAACC,EAAG,MACJL,EAAAI,cAACE,EAAoB,KACnBN,EAAAI,cAACG,EAAa,KACZP,EAAAI,cAACI,gBAAqB,gBACpBR,EAAAI,cAACK,EAAQ,KACNV,EAAWW,OACRX,EAAWY,IAAI,SAACC,EAAOC,GACrB,IAAMC,EAAgB,aAAAC,OAAaF,GACnC,OAAOb,EAAAI,cAACY,EAAQ,CAACC,IAAKH,GAAgBF,EACxC,GACA,QAIVZ,EAAAI,cAACG,EAAa,KACZP,EAAAI,cAACc,EAAmB,CAClBC,MAAO,IACPC,OAAQ,GACRC,IAAI,wCACJC,IAAI,sEAIRtB,EAAAI,cAACG,OACET,EACCE,gBAACuB,EAAI,CAACC,SAAS,KAAK1B,GAEpBE,EAAAI,cAAAJ,EAAAyB,SAAA,KACEzB,EAAAI,cAACmB,GAAKC,SAAS,IAAIE,GAAG,QAzDpC,SAA4B7B,GAC1B,OAAQA,GACN,IAAK,OACH,MAPJ,ogBAQE,IAAK,YACH,MAPJ,mdAQE,QACE,MAbJ,yPAeF,CAiDiB8B,CAAmB9B,GACf,wBACPG,EAAAI,cAACwB,EAAa,KACZ5B,EAAAI,cAACmB,GAAKC,SAAS,IAAIE,GAAG,QACnB,IAEI,uCAQvB"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare const StyledFooter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, ThemeProps>> & string;
|
|
6
|
-
export declare const FooterContentWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ThemeProps>> & string;
|
|
7
|
-
export declare const FooterSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ThemeProps>> & string;
|
|
8
|
-
export declare const FooterSectionLogo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme"> & ThemeProps, never>> & string;
|
|
9
|
-
export declare const FooterSectionLinks: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme"> & ThemeProps, never>> & string;
|
|
10
|
-
export declare const StyledNav: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, ThemeProps>> & string;
|
|
1
|
+
export declare const StyledFooter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
2
|
+
export declare const FooterContentWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const FooterSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const StyledNav: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
11
5
|
export declare const StyledUL: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
|
|
12
|
-
export declare const StyledLI: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
13
|
-
export declare const FooterSectionAddress: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "theme"> & ThemeProps, never>> & string;
|
|
6
|
+
export declare const StyledLI: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
|
|
14
7
|
export declare const StyledRegulatorLogo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
15
8
|
export declare const StyledAddress: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
16
|
-
export
|
|
9
|
+
export declare const Bar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHRElement>, HTMLHRElement>, never>> & string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import i from"styled-components";var
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import i from"styled-components";var o,e,a,t,r,d,l,s,p,m=i.footer(o||(o=n(["\n box-sizing: border-box;\n display: block;\n position: relative;\n width: 100%;\n background-color: var(--clr-footer-background, #fff);\n padding-bottom: var(--spacing-m, 2rem);\n"],["\n box-sizing: border-box;\n display: block;\n position: relative;\n width: 100%;\n background-color: var(--clr-footer-background, #fff);\n padding-bottom: var(--spacing-m, 2rem);\n"]))),c=i.div(e||(e=n(["\n max-width: var(--content-max-width, 1020px);\n display: block;\n margin: 0 auto;\n\n @media (min-width: 1200px) {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n"],["\n max-width: var(--content-max-width, 1020px);\n display: block;\n margin: 0 auto;\n\n @media (min-width: 1200px) {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n"]))),g=i.div(a||(a=n(["\n box-sizing: border-box;\n display: inline-block;\n padding: var(--spacing-s, 1.5rem) var(--spacing-s, 1.5rem) 0;\n position: relative;\n width: 100%;\n flex: 0 1 auto;\n"],["\n box-sizing: border-box;\n display: inline-block;\n padding: var(--spacing-s, 1.5rem) var(--spacing-s, 1.5rem) 0;\n position: relative;\n width: 100%;\n flex: 0 1 auto;\n"]))),b=i.nav(t||(t=n(["\n display: flex;\n flex-direction: column;\n a {\n font-size: var(--font-size-m, 1rem);\n font-weight: var(--typ-font-weight-links, 700);\n }\n"],["\n display: flex;\n flex-direction: column;\n a {\n font-size: var(--font-size-m, 1rem);\n font-weight: var(--typ-font-weight-links, 700);\n }\n"]))),h=i.ul(r||(r=n(["\n padding: 0;\n margin: 0;\n"],["\n padding: 0;\n margin: 0;\n"]))),x=i.li(d||(d=n(["\n list-style-type: none;\n display: block;\n padding: 0;\n margin: 0;\n line-height: 1;\n padding-bottom: var(--spacing-xxs, 0.5rem);\n"],["\n list-style-type: none;\n display: block;\n padding: 0;\n margin: 0;\n line-height: 1;\n padding-bottom: var(--spacing-xxs, 0.5rem);\n"]))),f=i.img(l||(l=n(["\n height: 40px;\n width: auto;\n"],["\n height: 40px;\n width: auto;\n"]))),v=i.address(s||(s=n(["\n display: inline;\n font-style: normal;\n"],["\n display: inline;\n font-style: normal;\n"]))),y=i.hr(p||(p=n(["\n opacity: 1;\n margin-top: 0;\n margin-bottom: 0;\n margin-right: calc(50% - 50vw);\n margin-left: calc(\n 100% - 100vw\n ); // to be removed when every page has a white background\n border-width: 0px 0px 0.25rem;\n border-image: initial;\n border-color: var(--clr-cruk-black, #000);\n border-style: solid;\n width: auto;\n"],["\n opacity: 1;\n margin-top: 0;\n margin-bottom: 0;\n margin-right: calc(50% - 50vw);\n margin-left: calc(\n 100% - 100vw\n ); // to be removed when every page has a white background\n border-width: 0px 0px 0.25rem;\n border-image: initial;\n border-color: var(--clr-cruk-black, #000);\n border-style: solid;\n width: auto;\n"])));export{y as Bar,c as FooterContentWrapper,g as FooterSection,v as StyledAddress,m as StyledFooter,x as StyledLI,b as StyledNav,f as StyledRegulatorLogo,h as StyledUL};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Footer/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Footer/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const StyledFooter = styled.footer`\n box-sizing: border-box;\n display: block;\n position: relative;\n width: 100%;\n background-color: var(--clr-footer-background, #fff);\n padding-bottom: var(--spacing-m, 2rem);\n`;\n\nexport const FooterContentWrapper = styled.div`\n max-width: var(--content-max-width, 1020px);\n display: block;\n margin: 0 auto;\n\n @media (min-width: 1200px) {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n`;\n\nexport const FooterSection = styled.div`\n box-sizing: border-box;\n display: inline-block;\n padding: var(--spacing-s, 1.5rem) var(--spacing-s, 1.5rem) 0;\n position: relative;\n width: 100%;\n flex: 0 1 auto;\n`;\n\nexport const StyledNav = styled.nav`\n display: flex;\n flex-direction: column;\n a {\n font-size: var(--font-size-m, 1rem);\n font-weight: var(--typ-font-weight-links, 700);\n }\n`;\n\nexport const StyledUL = styled.ul`\n padding: 0;\n margin: 0;\n`;\n\nexport const StyledLI = styled.li`\n list-style-type: none;\n display: block;\n padding: 0;\n margin: 0;\n line-height: 1;\n padding-bottom: var(--spacing-xxs, 0.5rem);\n`;\n\nexport const StyledRegulatorLogo = styled.img`\n height: 40px;\n width: auto;\n`;\n\nexport const StyledAddress = styled.address`\n display: inline;\n font-style: normal;\n`;\n\nexport const Bar = styled.hr`\n opacity: 1;\n margin-top: 0;\n margin-bottom: 0;\n margin-right: calc(50% - 50vw);\n margin-left: calc(\n 100% - 100vw\n ); // to be removed when every page has a white background\n border-width: 0px 0px 0.25rem;\n border-image: initial;\n border-color: var(--clr-cruk-black, #000);\n border-style: solid;\n width: auto;\n`;\n"],"names":["StyledFooter","styled","footer","templateObject_1","__makeTemplateObject","FooterContentWrapper","div","templateObject_2","FooterSection","templateObject_3","StyledNav","nav","templateObject_4","StyledUL","ul","templateObject_5","StyledLI","li","templateObject_6","StyledRegulatorLogo","img","templateObject_7","StyledAddress","address","templateObject_8","Bar","hr","templateObject_9"],"mappings":"iHAEO,sBAAMA,EAAeC,EAAOC,OAAMC,IAAAA,EAAAC,EAAA,CAAA,+LAAA,CAAA,kMAS5BC,EAAuBJ,EAAOK,IAAGC,IAAAA,EAAAH,EAAA,CAAA,yNAAA,CAAA,4NAYjCI,EAAgBP,EAAOK,IAAGG,IAAAA,EAAAL,EAAA,CAAA,sLAAA,CAAA,yLAS1BM,EAAYT,EAAOU,IAAGC,IAAAA,EAAAR,EAAA,CAAA,8JAAA,CAAA,iKAStBS,EAAWZ,EAAOa,GAAEC,IAAAA,EAAAX,EAAA,CAAA,mCAAA,CAAA,sCAKpBY,EAAWf,EAAOgB,GAAEC,IAAAA,EAAAd,EAAA,CAAA,kJAAA,CAAA,qJASpBe,EAAsBlB,EAAOmB,IAAGC,IAAAA,EAAAjB,EAAA,CAAA,uCAAA,CAAA,0CAKhCkB,EAAgBrB,EAAOsB,QAAOC,IAAAA,EAAApB,EAAA,CAAA,iDAAA,CAAA,oDAK9BqB,EAAMxB,EAAOyB,GAAEC,IAAAA,EAAAvB,EAAA,CAAA,uVAAA,CAAA"}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import React, { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
/** flag which make header fixed to the top even when scrolling */
|
|
4
|
-
isSticky?: boolean;
|
|
5
|
-
/** text in the middle of the header */
|
|
6
|
-
siteSlogan?: string;
|
|
7
|
-
/** text to explain the content of the icon for a11y usually a description of where the link will take you */
|
|
8
|
-
logoAltText?: string;
|
|
9
|
-
/** header logo image url */
|
|
10
|
-
logoImageSrc?: string;
|
|
11
|
-
/** title of the header image component, this is mainly for the tooltip text on hover */
|
|
12
|
-
logoLinkTitle?: string;
|
|
13
|
-
/** the url of the logo link */
|
|
14
|
-
logoLinkUrl?: string;
|
|
15
|
-
/** instead of the contents of the header being centered to max width as defined in theme it is 100% width fo viewport */
|
|
16
|
-
fullWidth?: boolean;
|
|
17
|
-
children?: ReactNode;
|
|
18
|
-
};
|
|
2
|
+
import { type ThemeNameType } from "../../types";
|
|
19
3
|
/**
|
|
20
4
|
* There should be only one header component near or at the top of the body of each page.
|
|
21
5
|
*
|
|
@@ -33,5 +17,22 @@ export type HeaderProps = HTMLAttributes<HTMLElement> & {
|
|
|
33
17
|
* 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.
|
|
34
18
|
*
|
|
35
19
|
*/
|
|
36
|
-
export declare function Header({ isSticky, siteSlogan, logoAltText, logoImageSrc, logoLinkTitle, logoLinkUrl, fullWidth, children, }:
|
|
20
|
+
export declare function Header({ themeName, isSticky, siteSlogan, logoAltText, logoImageSrc, logoLinkTitle, logoLinkUrl, fullWidth, children, }: HTMLAttributes<HTMLElement> & {
|
|
21
|
+
themeName: ThemeNameType;
|
|
22
|
+
/** flag which make header fixed to the top even when scrolling */
|
|
23
|
+
isSticky?: boolean;
|
|
24
|
+
/** text in the middle of the header */
|
|
25
|
+
siteSlogan?: string;
|
|
26
|
+
/** text to explain the content of the icon for a11y usually a description of where the link will take you */
|
|
27
|
+
logoAltText?: string;
|
|
28
|
+
/** header logo image url */
|
|
29
|
+
logoImageSrc?: string;
|
|
30
|
+
/** title of the header image component, this is mainly for the tooltip text on hover */
|
|
31
|
+
logoLinkTitle?: string;
|
|
32
|
+
/** the url of the logo link */
|
|
33
|
+
logoLinkUrl?: string;
|
|
34
|
+
/** instead of the contents of the header being centered to max width as defined in theme it is 100% width fo viewport */
|
|
35
|
+
fullWidth?: boolean;
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}): React.JSX.Element;
|
|
37
38
|
export default Header;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{useState as t}from"react";import l from"../../hooks/useScrollPosition.js";import{StyledHeader as r,HeaderStickyPlaceHolder as s,HeaderStickyContainer as a,SkipToMain as n,HeaderMainContent as c,StyledLink as o,LogoWrapper as i,Logo as u,Tagline as m,ChildWrapper as g,ChildInner as h}from"./styles.js";function f(f){var k=f.themeName,p=f.isSticky,d=f.siteSlogan,E=f.logoAltText,S=f.logoImageSrc,y=f.logoLinkTitle,$=f.logoLinkUrl,b=f.fullWidth,v=f.children,w=t(!1),P=w[0],j=w[1],x="undefined"!=typeof window;l(function(e){var t=e.currPos,l=!!x&&t.y>240;l!==P&&j(l)},[P],null,!0,50);var L=function(e){switch(e){case"su2c":return"https://rcl.assets.cancerresearchuk.org/images/logos/su2c-160.png";case"bowelbabe":return"https://rcl.assets.cancerresearchuk.org/images/logos/bowelbabe-logo-160.png";case"rfl":return"https://rcl.assets.cancerresearchuk.org/images/logos/rfl.svg";default:return"https://rcl.assets.cancerresearchuk.org/images/logos/cruk.svg"}}(k);return e.createElement(r,null,e.createElement(s,null,e.createElement(a,{"data-testid":"header-sticky-container",$isSmall:P,$isSticky:p},e.createElement(n,{href:"#main"},"Skip to main content"),e.createElement(c,{$fullWidth:b},e.createElement(o,{href:null!=$?$:"/",title:null!=y?y:"Home"},e.createElement(i,{$isSmall:P,$isSticky:p},e.createElement(u,{height:80,src:null!=S?S:L,alt:null!=E?E:"Cancer Research UK Giving Pages"}))),d?e.createElement(m,{$isSmall:P,$isSticky:p},d):null,e.createElement(g,null,e.createElement(h,null,v))))))}export{f as Header,f 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\";\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Header/index.tsx"],"sourcesContent":["import React, { useState, type HTMLAttributes, type ReactNode } from \"react\";\n\nimport { useScrollPosition } from \"../../hooks/useScrollPosition\";\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\nimport { type ThemeNameType } from \"../../types\";\n\nconst HEADER_SCROLL_THRESHOLD = 240;\n\nconst crukLogoUrl =\n \"https://rcl.assets.cancerresearchuk.org/images/logos/cruk.svg\";\nconst rflLogoUrl =\n \"https://rcl.assets.cancerresearchuk.org/images/logos/rfl.svg\";\nconst su2cLogoUrl =\n \"https://rcl.assets.cancerresearchuk.org/images/logos/su2c-160.png\";\nconst bowelbabeLogoUrl =\n \"https://rcl.assets.cancerresearchuk.org/images/logos/bowelbabe-logo-160.png\";\n\nfunction getLogoFromThemeName(themeName: ThemeNameType) {\n switch (themeName) {\n case \"su2c\":\n return su2cLogoUrl;\n case \"bowelbabe\":\n return bowelbabeLogoUrl;\n case \"rfl\":\n return rflLogoUrl;\n default:\n return crukLogoUrl;\n }\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 themeName,\n isSticky,\n siteSlogan,\n logoAltText,\n logoImageSrc,\n logoLinkTitle,\n logoLinkUrl,\n fullWidth,\n children,\n}: HTMLAttributes<HTMLElement> & {\n themeName: ThemeNameType;\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 const [isSmall, setIsSmall] = useState(false);\n const isBrowser = typeof window !== `undefined`;\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 const logoUrl = getLogoFromThemeName(themeName);\n\n return (\n <StyledHeader>\n <HeaderStickyPlaceHolder>\n <HeaderStickyContainer\n data-testid=\"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 ?? \"/\"}\n title={logoLinkTitle ?? \"Home\"}\n >\n <LogoWrapper $isSmall={isSmall} $isSticky={isSticky}>\n <Logo\n height={80}\n src={logoImageSrc ?? logoUrl}\n alt={logoAltText ?? \"Cancer Research UK Giving Pages\"}\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 );\n}\n\nexport default Header;\n"],"names":["Header","_a","themeName","isSticky","siteSlogan","logoAltText","logoImageSrc","logoLinkTitle","logoLinkUrl","fullWidth","children","_b","useState","isSmall","setIsSmall","isBrowser","window","useScrollPosition","currPos","shouldShrink","y","logoUrl","getLogoFromThemeName","React","StyledHeader","createElement","HeaderStickyPlaceHolder","HeaderStickyContainer","$isSmall","SkipToMain","href","HeaderMainContent","StyledLink","title","LogoWrapper","$isSticky","Logo","height","src","alt","Tagline","ChildWrapper","ChildInner"],"mappings":"wTA6DM,SAAUA,EAAOC,OACrBC,EAASD,EAAAC,UACTC,EAAQF,EAAAE,SACRC,EAAUH,EAAAG,WACVC,EAAWJ,EAAAI,YACXC,iBACAC,EAAaN,EAAAM,cACbC,EAAWP,EAAAO,YACXC,EAASR,EAAAQ,UACTC,EAAQT,EAAAS,SAoBFC,EAAwBC,GAAS,GAAhCC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAA8B,oBAAXC,OAEzBC,EACE,SAAChB,GACC,IAAAiB,EAAOjB,EAAAiB,QAKDC,IAAeJ,GACjBG,EAAQE,EAjFc,IAmFtBD,IAAiBN,GACnBC,EAAWK,EAEf,EACA,CAACN,GACD,MACA,EACA,IAGF,IAAMQ,EAlFR,SAA8BnB,GAC5B,OAAQA,GACN,IAAK,OACH,MAPJ,oEAQE,IAAK,YACH,MAPJ,8EAQE,IAAK,MACH,MAbJ,+DAcE,QACE,MAjBJ,gEAmBF,CAuEkBoB,CAAqBpB,GAErC,OACEqB,gBAACC,EAAY,KACXD,EAAAE,cAACC,EAAuB,KACtBH,EAAAE,cAACE,EAAqB,CAAA,cACR,0BAAyBC,SAC3Bf,YACCV,GAEXoB,EAAAE,cAACI,EAAU,CAACC,KAAK,SAAO,wBACxBP,EAAAE,cAACM,cAA8BtB,GAC7Bc,EAAAE,cAACO,GACCF,KAAMtB,QAAAA,EAAe,IACrByB,MAAO1B,QAAAA,EAAiB,QAExBgB,EAAAE,cAACS,EAAW,CAAAN,SAAWf,EAAOsB,UAAahC,GACzCoB,EAAAE,cAACW,EAAI,CACHC,OAAQ,GACRC,IAAKhC,QAAAA,EAAgBe,EACrBkB,IAAKlC,QAAAA,EAAe,sCAIzBD,EACCmB,EAAAE,cAACe,EAAO,CAAAZ,SAAWf,EAAOsB,UAAahC,GACpCC,GAED,KACJmB,EAAAE,cAACgB,EAAY,KACXlB,EAAAE,cAACiB,EAAU,KAAEhC,OAO3B"}
|
|
@@ -1,33 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
theme: ThemeType;
|
|
4
|
-
}>> & string;
|
|
5
|
-
export declare const HeaderStickyPlaceHolder: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
6
|
-
theme: ThemeType;
|
|
7
|
-
}>> & string;
|
|
1
|
+
export declare const StyledHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
2
|
+
export declare const HeaderStickyPlaceHolder: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
3
|
export declare const HeaderStickyContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
9
4
|
$isSmall?: boolean;
|
|
10
5
|
$isSticky?: boolean;
|
|
11
|
-
theme: ThemeType;
|
|
12
6
|
}>> & string;
|
|
13
7
|
export declare const HeaderMainContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
14
8
|
$fullWidth?: boolean;
|
|
15
|
-
theme: ThemeType;
|
|
16
9
|
}>> & string;
|
|
17
10
|
export declare const Logo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
18
11
|
export declare const LogoWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
19
12
|
$isSmall?: boolean;
|
|
20
13
|
$isSticky?: boolean;
|
|
21
|
-
theme: ThemeType;
|
|
22
14
|
}>> & string;
|
|
23
15
|
export declare const StyledLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
|
|
24
|
-
export declare const SkipToMain: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
25
|
-
theme: ThemeType;
|
|
26
|
-
}>> & string;
|
|
16
|
+
export declare const SkipToMain: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
|
|
27
17
|
export declare const Tagline: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {
|
|
28
18
|
$isSmall?: boolean;
|
|
29
19
|
$isSticky?: boolean;
|
|
30
|
-
theme: ThemeType;
|
|
31
20
|
}>> & string;
|
|
32
21
|
export declare const ChildWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
33
22
|
export declare const ChildInner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|