@cruk/cruk-react-components 5.0.5 → 5.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Badge/index.d.ts +3 -1
- package/lib/components/Badge/styles.d.ts +1 -1
- package/lib/components/Modal/index.d.ts +3 -1
- package/lib/components/Modal/styles.d.ts +5 -3
- package/lib/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/array.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/safe.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +1 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
- package/lib/node_modules/react-clientside-effect/lib/index.es.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
- package/lib/node_modules/react-intersection-observer/dist/index.js.map +1 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
- package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/lib/src/components/AddressLookup/index.js.map +1 -1
- package/lib/src/components/Avatar/index.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/styles.js.map +1 -1
- package/lib/src/components/Button/index.js.map +1 -1
- package/lib/src/components/Carousel/Dots.js.map +1 -1
- package/lib/src/components/Carousel/index.js.map +1 -1
- package/lib/src/components/Collapse/index.js.map +1 -1
- package/lib/src/components/Flex.js.map +1 -1
- package/lib/src/components/Fontface.js.map +1 -1
- package/lib/src/components/Footer/index.js.map +1 -1
- package/lib/src/components/GlobalStyle.js.map +1 -1
- package/lib/src/components/Heading/styles.js.map +1 -1
- package/lib/src/components/LabelWrapper/index.js.map +1 -1
- package/lib/src/components/LegendWrapper/index.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.map +1 -1
- package/lib/src/components/Pagination/styles.js.map +1 -1
- package/lib/src/components/PopOver/index.js.map +1 -1
- package/lib/src/components/ProgressBar/styles.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.map +1 -1
- package/lib/src/components/Text/styles.js.map +1 -1
- package/lib/src/hooks/useKey.js.map +1 -1
- package/lib/src/hooks/useScrollPosition.js.map +1 -1
- package/lib/src/themes/rfl.js.map +1 -1
- package/lib/src/themes/su2c.js.map +1 -1
- package/lib/src/utils/Helper.js.map +1 -1
- package/lib/src/utils/debounce.js.map +1 -1
- package/package.json +17 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/RadioConsent/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledFieldSet, StyledLegend, StyledRadio } from \"./styles\";\n\ntype Attribute = {\n value: string;\n option: string;\n};\n\nexport type RadioConsentProps = {\n /** because each radio has its own label this is the consent group label text */\n legend: string;\n /** array of option for radio constent group where option is the option name and value is the option value */\n attributes: Attribute[];\n /** on change handler callback passed change event */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** set the value of selected option */\n selectedValue?: string;\n /** name of field this is what groups all the options together */\n name: string;\n};\n\n/**\n *\n * RadioConsent is a component for showing a bunch of yes/no radios predominantly used for notification selections where a unselected state is usefull for analytics.\n *\n * This is always a controlled component that will only change state with the selectedValue prop\n */\nexport function RadioConsent(props: RadioConsentProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const { legend, attributes, onChange, selectedValue = \"\", name } = props;\n\n return (\n <ThemeProvider theme={theme}>\n <StyledFieldSet>\n <StyledLegend>{legend}</StyledLegend>\n {attributes.map((item: Attribute) => (\n <StyledRadio\n $numberOfAttributes={attributes.length || 0}\n key={item.value}\n checked={selectedValue === item.value}\n onChange={onChange}\n name={name}\n value={item.value}\n >\n {item.option}\n </StyledRadio>\n ))}\n </StyledFieldSet>\n </ThemeProvider>\n );\n}\n\nexport default RadioConsent;\n"],"names":["RadioConsent","props","foundTheme","useTheme","theme","__assign","defaultTheme","legend","attributes","onChange","_a","selectedValue","name","React","createElement","ThemeProvider","StyledFieldSet","StyledLegend","map","item","StyledRadio","$numberOfAttributes","length","key","value","checked","option"],"mappings":"0RA+BM,SAAUA,EAAaC,GAC3B,IAAMC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAEGK,EAA2DN,EAAKM,OAAxDC,EAAmDP,EAAzCO,WAAEC,EAAuCR,EAAKQ,SAAlCC,EAA6BT,EAAKU,cAAlCA,OAAgB,IAAAD,EAAA,GAAEA,EAAEE,EAASX,EAAKW,KAExE,OACEC,EAACC,cAAAC,EAAc,CAAAX,MAAOA,GACpBS,EAAAC,cAACE,EAAc,KACbH,EAACC,cAAAG,EAAc,KAAAV,GACdC,EAAWU,KAAI,SAACC,GAAoB,OACnCN,EAAAC,cAACM,EAAW,CAAAC,oBACWb,EAAWc,QAAU,EAC1CC,IAAKJ,EAAKK,MACVC,QAASd,IAAkBQ,EAAKK,MAChCf,SAAUA,EACVG,KAAMA,EACNY,MAAOL,EAAKK,OAEXL,EAAKO,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/RadioConsent/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledFieldSet, StyledLegend, StyledRadio } from \"./styles\";\n\ntype Attribute = {\n value: string;\n option: string;\n};\n\nexport type RadioConsentProps = {\n /** because each radio has its own label this is the consent group label text */\n legend: string;\n /** array of option for radio constent group where option is the option name and value is the option value */\n attributes: Attribute[];\n /** on change handler callback passed change event */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** set the value of selected option */\n selectedValue?: string;\n /** name of field this is what groups all the options together */\n name: string;\n};\n\n/**\n *\n * RadioConsent is a component for showing a bunch of yes/no radios predominantly used for notification selections where a unselected state is usefull for analytics.\n *\n * This is always a controlled component that will only change state with the selectedValue prop\n */\nexport function RadioConsent(props: RadioConsentProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const { legend, attributes, onChange, selectedValue = \"\", name } = props;\n\n return (\n <ThemeProvider theme={theme}>\n <StyledFieldSet>\n <StyledLegend>{legend}</StyledLegend>\n {attributes.map((item: Attribute) => (\n <StyledRadio\n $numberOfAttributes={attributes.length || 0}\n key={item.value}\n checked={selectedValue === item.value}\n onChange={onChange}\n name={name}\n value={item.value}\n >\n {item.option}\n </StyledRadio>\n ))}\n </StyledFieldSet>\n </ThemeProvider>\n );\n}\n\nexport default RadioConsent;\n"],"names":["RadioConsent","props","foundTheme","useTheme","theme","__assign","defaultTheme","legend","attributes","onChange","_a","selectedValue","name","React","createElement","ThemeProvider","StyledFieldSet","StyledLegend","map","item","StyledRadio","$numberOfAttributes","length","key","value","checked","option"],"mappings":"0RA+BM,SAAUA,EAAaC,GAC3B,IAAMC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAEGK,EAA2DN,EAAKM,OAAxDC,EAAmDP,EAAzCO,WAAEC,EAAuCR,EAAKQ,SAAlCC,EAA6BT,EAAKU,cAAlCA,OAAgB,IAAAD,EAAA,GAAEA,EAAEE,EAASX,EAAKW,KAExE,OACEC,EAACC,cAAAC,EAAc,CAAAX,MAAOA,GACpBS,EAAAC,cAACE,EAAc,KACbH,EAACC,cAAAG,EAAc,KAAAV,GACdC,EAAWU,KAAI,SAACC,GAAoB,OACnCN,EAAAC,cAACM,EAAW,CAAAC,oBACWb,EAAWc,QAAU,EAC1CC,IAAKJ,EAAKK,MACVC,QAASd,IAAkBQ,EAAKK,MAChCf,SAAUA,EACVG,KAAMA,EACNY,MAAOL,EAAKK,OAEXL,EAAKO,OAET,KAIT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Text/styles.ts"],"sourcesContent":["import { type ElementType } from \"react\";\nimport styled from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\nimport {\n type WordBreakType,\n type FontSizeType,\n type ThemeType,\n type ColorKeyType,\n type OverflowWrapType,\n} from \"../../types\";\n\nexport type TextStyledProps = SpacingPropsInternal & {\n $textColor?: string;\n $textAlign?: \"left\" | \"right\" | \"center\" | \"justify\";\n $textSize?: FontSizeType;\n $textWeight?: number | string;\n as?: ElementType;\n $wordBreak?: WordBreakType;\n $overflowWrap?: OverflowWrapType;\n $textFontFamily?: string;\n theme: ThemeType;\n};\n\nexport const TextStyled = styled.p<TextStyledProps>`\n font-family: ${({ $textFontFamily, theme }) =>\n $textFontFamily || theme.typography.fontFamilyBase};\n word-break: ${({ $wordBreak }) => $wordBreak || \"normal\"};\n overflow-wrap: ${({ $overflowWrap }) => $overflowWrap || \"break-word\"};\n color: ${({ theme: { colors }, $textColor }) =>\n $textColor && typeof colors[$textColor as ColorKeyType] !== \"undefined\"\n ? colors[$textColor as ColorKeyType]\n : $textColor || colors.textDark};\n text-align: ${({ $textAlign }) => $textAlign || \"left\"};\n font-size: ${({\n theme: {\n fontSizes,\n fontSizes: { m },\n },\n $textSize,\n }) => ($textSize ? fontSizes[$textSize] : m)};\n line-height: ${({ theme }) => theme.typography.lineHeight};\n font-weight: ${({ $textWeight, theme }) =>\n $textWeight || theme.typography.fontWeightBase};\n padding: 0;\n margin: 0;\n margin-bottom: ${({\n as,\n theme: {\n spacing: { xs },\n },\n }) => (typeof as === \"undefined\" || as === \"p\" ? `${xs}` : 0)};\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ${(props) => spacing(props, props.theme as ThemeType)}\n`;\n"],"names":["TextStyled","styled","p","templateObject_1","__makeTemplateObject","_a","$textFontFamily","theme","typography","fontFamilyBase","$wordBreak","$overflowWrap","colors","$textColor","textDark","$textAlign","_b","fontSizes","m","$textSize","lineHeight","$textWeight","fontWeightBase","as","xs","spacing","props"],"mappings":"+JAwBO,MAAMA,EAAaC,EAAOC,EAACC,IAAAA,EAAAC,EAAA,CAAA,oBAAA,oBAAA,uBAAA,eAAA,oBAAA,mBAAA,qBAAA,qBAAA,oDAAA,0DAAA,MAAA,CAAiB,oBAEG,oBACI,uBACa,eAIlC,oBACmB,mBAOV,qBACa,qBAET,oDAQa,0DAMR,SAhCtC,SAACC,OAAEC,EAAeD,EAAAC,gBAAEC,EAAKF,EAAAE,MACtC,OAAAD,GAAmBC,EAAMC,WAAWC,cAApC,IACY,SAACJ,GAAmB,OAAPA,EAAAK,YAAqB,QAAd,IACjB,SAACL,GAAsB,OAAPA,EAAAM,eAAwB,YAAjB,IAC/B,SAACN,OAAWO,EAAMP,EAAAE,MAAAK,OAAIC,EAAUR,EAAAQ,WACvC,OAAAA,QAA4D,IAAvCD,EAAOC,GACxBD,EAAOC,GACPA,GAAcD,EAAOE,QAFzB,IAGY,SAACT,GAAmB,OAAPA,EAAAU,YAAqB,MAAd,IACrB,SAACV,OACZW,EAGCX,EAAAE,MAFCU,EAASD,EAAAC,UACIC,EAACF,EAAAC,UAAAC,EAEhBC,EAASd,EAAAc,UACL,OAACA,EAAYF,EAAUE,GAAaD,CAApC,IACS,SAACb,GAAc,OAAPA,EAAAE,MAAaC,WAAWY,UAAjB,IACf,SAACf,OAAEgB,EAAWhB,EAAAgB,YAAEd,EAAKF,EAAAE,MAClC,OAAAc,GAAed,EAAMC,WAAWc,cAAhC,IAGe,SAACjB,OAChBkB,EAAElB,EAAAkB,GAEWC,EAAEnB,EAAAE,MAAAkB,QAAAD,GAEX,YAAe,IAAPD,GAA6B,MAAPA,EAAa,UAAGC,GAAO,CAArD,IAMJ,SAACE,GAAU,OAAAD,EAAQC,EAAOA,EAAMnB"}
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Text/styles.ts"],"sourcesContent":["import { type ElementType } from \"react\";\nimport styled from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\nimport {\n type WordBreakType,\n type FontSizeType,\n type ThemeType,\n type ColorKeyType,\n type OverflowWrapType,\n} from \"../../types\";\n\nexport type TextStyledProps = SpacingPropsInternal & {\n $textColor?: string;\n $textAlign?: \"left\" | \"right\" | \"center\" | \"justify\";\n $textSize?: FontSizeType;\n $textWeight?: number | string;\n as?: ElementType;\n $wordBreak?: WordBreakType;\n $overflowWrap?: OverflowWrapType;\n $textFontFamily?: string;\n theme: ThemeType;\n};\n\nexport const TextStyled = styled.p<TextStyledProps>`\n font-family: ${({ $textFontFamily, theme }) =>\n $textFontFamily || theme.typography.fontFamilyBase};\n word-break: ${({ $wordBreak }) => $wordBreak || \"normal\"};\n overflow-wrap: ${({ $overflowWrap }) => $overflowWrap || \"break-word\"};\n color: ${({ theme: { colors }, $textColor }) =>\n $textColor && typeof colors[$textColor as ColorKeyType] !== \"undefined\"\n ? colors[$textColor as ColorKeyType]\n : $textColor || colors.textDark};\n text-align: ${({ $textAlign }) => $textAlign || \"left\"};\n font-size: ${({\n theme: {\n fontSizes,\n fontSizes: { m },\n },\n $textSize,\n }) => ($textSize ? fontSizes[$textSize] : m)};\n line-height: ${({ theme }) => theme.typography.lineHeight};\n font-weight: ${({ $textWeight, theme }) =>\n $textWeight || theme.typography.fontWeightBase};\n padding: 0;\n margin: 0;\n margin-bottom: ${({\n as,\n theme: {\n spacing: { xs },\n },\n }) => (typeof as === \"undefined\" || as === \"p\" ? `${xs}` : 0)};\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ${(props) => spacing(props, props.theme as ThemeType)}\n`;\n"],"names":["TextStyled","styled","p","templateObject_1","__makeTemplateObject","_a","$textFontFamily","theme","typography","fontFamilyBase","$wordBreak","$overflowWrap","colors","$textColor","textDark","$textAlign","_b","fontSizes","m","$textSize","lineHeight","$textWeight","fontWeightBase","as","xs","spacing","props"],"mappings":"+JAwBO,MAAMA,EAAaC,EAAOC,EAACC,IAAAA,EAAAC,EAAA,CAAA,oBAAA,oBAAA,uBAAA,eAAA,oBAAA,mBAAA,qBAAA,qBAAA,oDAAA,0DAAA,MAAA,CAAiB,oBAEG,oBACI,uBACa,eAIlC,oBACmB,mBAOV,qBACa,qBAET,oDAQa,0DAMR,SAhCtC,SAACC,OAAEC,EAAeD,EAAAC,gBAAEC,EAAKF,EAAAE,MACtC,OAAAD,GAAmBC,EAAMC,WAAWC,cAApC,IACY,SAACJ,GAAmB,OAAPA,EAAAK,YAAqB,QAAd,IACjB,SAACL,GAAsB,OAAPA,EAAAM,eAAwB,YAAjB,IAC/B,SAACN,OAAWO,EAAMP,EAAAE,MAAAK,OAAIC,EAAUR,EAAAQ,WACvC,OAAAA,QAA4D,IAAvCD,EAAOC,GACxBD,EAAOC,GACPA,GAAcD,EAAOE,QAFzB,IAGY,SAACT,GAAmB,OAAPA,EAAAU,YAAqB,MAAd,IACrB,SAACV,OACZW,EAGCX,EAAAE,MAFCU,EAASD,EAAAC,UACIC,EAACF,EAAAC,UAAAC,EAEhBC,EAASd,EAAAc,UACL,OAACA,EAAYF,EAAUE,GAAaD,CAApC,IACS,SAACb,GAAc,OAAPA,EAAAE,MAAaC,WAAWY,UAAjB,IACf,SAACf,OAAEgB,EAAWhB,EAAAgB,YAAEd,EAAKF,EAAAE,MAClC,OAAAc,GAAed,EAAMC,WAAWc,cAAhC,IAGe,SAACjB,OAChBkB,EAAElB,EAAAkB,GAEWC,EAAEnB,EAAAE,MAAAkB,QAAAD,GAEX,YAAe,IAAPD,GAA6B,MAAPA,EAAa,UAAGC,GAAO,CAArD,IAMJ,SAACE,GAAU,OAAAD,EAAQC,EAAOA,EAAMnB,MAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKey.js","sources":["../../../src/hooks/useKey.ts"],"sourcesContent":["import { useEffect, type DependencyList } from \"react\";\nimport { isBrowser } from \"../utils/Helper\";\n\n// useKey((pressedKey, event) => {\n// console.log('Detected Key press', pressedKey);\n// console.log('Get event, if you want more details and preventDefault', event)\n// }, {\n// detectKeys: ['Enter']\n// });\n\nexport const useKey = (\n callback: (event: KeyboardEvent) => void,\n options: {\n detectKeys?: string[];\n keyevent?: \"keydown\" | \"keyup\" | \"keypress\";\n },\n dependencies?: DependencyList,\n): void => {\n const { detectKeys = [], keyevent } = options;\n\n const handleEvent = (event: KeyboardEvent) => {\n if (detectKeys.includes(event.key) || detectKeys.length === 0) {\n callback(event);\n }\n };\n\n useEffect(() => {\n if (!isBrowser) {\n return undefined;\n }\n\n window.document.addEventListener(keyevent || \"keydown\", handleEvent);\n return () => {\n window.document.removeEventListener(keyevent || \"keydown\", handleEvent);\n };\n }, dependencies || []);\n};\n\nexport default useKey;\n"],"names":["useKey","callback","options","dependencies","_a","detectKeys","keyevent","handleEvent","event","includes","key","length","useEffect","isBrowser","window","document","addEventListener","removeEventListener"],"mappings":"qFAUaA,EAAS,SACpBC,EACAC,EAIAC,GAEQ,IAAAC,EAA8BF,EAAfG,WAAfA,OAAU,IAAAD,EAAG,GAAEA,EAAEE,EAAaJ,WAEhCK,EAAc,SAACC,IACfH,EAAWI,SAASD,EAAME,MAA8B,IAAtBL,EAAWM,SAC/CV,EAASO,
|
|
1
|
+
{"version":3,"file":"useKey.js","sources":["../../../src/hooks/useKey.ts"],"sourcesContent":["import { useEffect, type DependencyList } from \"react\";\nimport { isBrowser } from \"../utils/Helper\";\n\n// useKey((pressedKey, event) => {\n// console.log('Detected Key press', pressedKey);\n// console.log('Get event, if you want more details and preventDefault', event)\n// }, {\n// detectKeys: ['Enter']\n// });\n\nexport const useKey = (\n callback: (event: KeyboardEvent) => void,\n options: {\n detectKeys?: string[];\n keyevent?: \"keydown\" | \"keyup\" | \"keypress\";\n },\n dependencies?: DependencyList,\n): void => {\n const { detectKeys = [], keyevent } = options;\n\n const handleEvent = (event: KeyboardEvent) => {\n if (detectKeys.includes(event.key) || detectKeys.length === 0) {\n callback(event);\n }\n };\n\n useEffect(() => {\n if (!isBrowser) {\n return undefined;\n }\n\n window.document.addEventListener(keyevent || \"keydown\", handleEvent);\n return () => {\n window.document.removeEventListener(keyevent || \"keydown\", handleEvent);\n };\n }, dependencies || []);\n};\n\nexport default useKey;\n"],"names":["useKey","callback","options","dependencies","_a","detectKeys","keyevent","handleEvent","event","includes","key","length","useEffect","isBrowser","window","document","addEventListener","removeEventListener"],"mappings":"qFAUaA,EAAS,SACpBC,EACAC,EAIAC,GAEQ,IAAAC,EAA8BF,EAAfG,WAAfA,OAAU,IAAAD,EAAG,GAAEA,EAAEE,EAAaJ,WAEhCK,EAAc,SAACC,IACfH,EAAWI,SAASD,EAAME,MAA8B,IAAtBL,EAAWM,SAC/CV,EAASO,EAEZ,EAEDI,GAAU,WACR,GAAKC,EAKL,OADAC,OAAOC,SAASC,iBAAiBV,GAAY,UAAWC,GACjD,WACLO,OAAOC,SAASE,oBAAoBX,GAAY,UAAWC,EAC5D,CACH,GAAGJ,GAAgB,GACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollPosition.js","sources":["../../../src/hooks/useScrollPosition.ts"],"sourcesContent":["import {\n useRef,\n type DependencyList,\n type RefObject,\n type MutableRefObject,\n} from \"react\";\n\nimport { useLayoutEffectBrowser } from \"./useLayoutEffectBrowser\";\n\nconst isBrowser = typeof window !== `undefined`;\n\nfunction getScrollPosition({\n element,\n useWindow,\n}: {\n element?: RefObject<HTMLElement> | MutableRefObject<undefined> | null;\n useWindow: boolean;\n}) {\n if (!isBrowser) return { x: 0, y: 0 };\n\n const target = element ? element.current : document.body;\n const position = target\n ? target.getBoundingClientRect()\n : { top: 0, left: 0 };\n\n return useWindow\n ? { x: window.scrollX, y: window.scrollY }\n : { x: position.left, y: position.top };\n}\n\nconst useScrollPosition = (\n effect: ({\n currPos,\n }: {\n prevPos: { x: number; y: number };\n currPos: { x: number; y: number };\n }) => void,\n deps: DependencyList,\n element: RefObject<HTMLElement> | MutableRefObject<undefined> | null,\n useWindow: boolean,\n wait: number,\n): void => {\n const position = useRef(getScrollPosition({ useWindow, element }));\n\n let throttleTimeout: ReturnType<typeof setTimeout> | null = null;\n\n const callBack = () => {\n const currPos = getScrollPosition({ element, useWindow });\n effect({ prevPos: position.current, currPos });\n position.current = currPos;\n throttleTimeout = null;\n };\n\n useLayoutEffectBrowser(() => {\n const handleScroll = () => {\n if (wait) {\n if (throttleTimeout === null) {\n throttleTimeout = setTimeout(callBack, wait);\n }\n } else {\n callBack();\n }\n };\n if (isBrowser) {\n window.addEventListener(\"scroll\", handleScroll);\n }\n\n return () => {\n if (isBrowser) {\n window.removeEventListener(\"scroll\", handleScroll);\n }\n };\n }, deps);\n};\n\nexport default useScrollPosition;\nexport { useScrollPosition };\n"],"names":["isBrowser","window","getScrollPosition","_a","element","useWindow","x","y","target","current","document","body","position","getBoundingClientRect","top","left","scrollX","scrollY","useScrollPosition","effect","deps","wait","useRef","throttleTimeout","callBack","currPos","prevPos","useLayoutEffectBrowser","handleScroll","setTimeout","addEventListener","removeEventListener"],"mappings":"0EASA,IAAMA,EAA8B,oBAAXC,OAEzB,SAASC,EAAkBC,OACzBC,EAAOD,EAAAC,QACPC,EAASF,EAAAE,UAKT,IAAKL,EAAW,MAAO,CAAEM,EAAG,EAAGC,EAAG,GAElC,IAAMC,EAASJ,EAAUA,EAAQK,QAAUC,SAASC,KAC9CC,EAAWJ,EACbA,EAAOK,wBACP,CAAEC,IAAK,EAAGC,KAAM,GAEpB,OAAOV,EACH,CAAEC,EAAGL,OAAOe,QAAST,EAAGN,OAAOgB,SAC/B,CAAEX,EAAGM,EAASG,KAAMR,EAAGK,EAASE,IACtC,CAEM,IAAAI,EAAoB,SACxBC,EAMAC,EACAhB,EACAC,EACAgB,GAEA,IAAMT,EAAWU,EAAOpB,EAAkB,CAAEG,UAASA,EAAED,QAAOA,KAE1DmB,EAAwD,KAEtDC,EAAW,WACf,IAAMC,EAAUvB,EAAkB,CAAEE,QAAOA,EAAEC,UAASA,IACtDc,EAAO,CAAEO,QAASd,EAASH,QAASgB,QAAOA,IAC3Cb,EAASH,QAAUgB,EACnBF,EAAkB,
|
|
1
|
+
{"version":3,"file":"useScrollPosition.js","sources":["../../../src/hooks/useScrollPosition.ts"],"sourcesContent":["import {\n useRef,\n type DependencyList,\n type RefObject,\n type MutableRefObject,\n} from \"react\";\n\nimport { useLayoutEffectBrowser } from \"./useLayoutEffectBrowser\";\n\nconst isBrowser = typeof window !== `undefined`;\n\nfunction getScrollPosition({\n element,\n useWindow,\n}: {\n element?: RefObject<HTMLElement> | MutableRefObject<undefined> | null;\n useWindow: boolean;\n}) {\n if (!isBrowser) return { x: 0, y: 0 };\n\n const target = element ? element.current : document.body;\n const position = target\n ? target.getBoundingClientRect()\n : { top: 0, left: 0 };\n\n return useWindow\n ? { x: window.scrollX, y: window.scrollY }\n : { x: position.left, y: position.top };\n}\n\nconst useScrollPosition = (\n effect: ({\n currPos,\n }: {\n prevPos: { x: number; y: number };\n currPos: { x: number; y: number };\n }) => void,\n deps: DependencyList,\n element: RefObject<HTMLElement> | MutableRefObject<undefined> | null,\n useWindow: boolean,\n wait: number,\n): void => {\n const position = useRef(getScrollPosition({ useWindow, element }));\n\n let throttleTimeout: ReturnType<typeof setTimeout> | null = null;\n\n const callBack = () => {\n const currPos = getScrollPosition({ element, useWindow });\n effect({ prevPos: position.current, currPos });\n position.current = currPos;\n throttleTimeout = null;\n };\n\n useLayoutEffectBrowser(() => {\n const handleScroll = () => {\n if (wait) {\n if (throttleTimeout === null) {\n throttleTimeout = setTimeout(callBack, wait);\n }\n } else {\n callBack();\n }\n };\n if (isBrowser) {\n window.addEventListener(\"scroll\", handleScroll);\n }\n\n return () => {\n if (isBrowser) {\n window.removeEventListener(\"scroll\", handleScroll);\n }\n };\n }, deps);\n};\n\nexport default useScrollPosition;\nexport { useScrollPosition };\n"],"names":["isBrowser","window","getScrollPosition","_a","element","useWindow","x","y","target","current","document","body","position","getBoundingClientRect","top","left","scrollX","scrollY","useScrollPosition","effect","deps","wait","useRef","throttleTimeout","callBack","currPos","prevPos","useLayoutEffectBrowser","handleScroll","setTimeout","addEventListener","removeEventListener"],"mappings":"0EASA,IAAMA,EAA8B,oBAAXC,OAEzB,SAASC,EAAkBC,OACzBC,EAAOD,EAAAC,QACPC,EAASF,EAAAE,UAKT,IAAKL,EAAW,MAAO,CAAEM,EAAG,EAAGC,EAAG,GAElC,IAAMC,EAASJ,EAAUA,EAAQK,QAAUC,SAASC,KAC9CC,EAAWJ,EACbA,EAAOK,wBACP,CAAEC,IAAK,EAAGC,KAAM,GAEpB,OAAOV,EACH,CAAEC,EAAGL,OAAOe,QAAST,EAAGN,OAAOgB,SAC/B,CAAEX,EAAGM,EAASG,KAAMR,EAAGK,EAASE,IACtC,CAEM,IAAAI,EAAoB,SACxBC,EAMAC,EACAhB,EACAC,EACAgB,GAEA,IAAMT,EAAWU,EAAOpB,EAAkB,CAAEG,UAASA,EAAED,QAAOA,KAE1DmB,EAAwD,KAEtDC,EAAW,WACf,IAAMC,EAAUvB,EAAkB,CAAEE,QAAOA,EAAEC,UAASA,IACtDc,EAAO,CAAEO,QAASd,EAASH,QAASgB,QAAOA,IAC3Cb,EAASH,QAAUgB,EACnBF,EAAkB,IACnB,EAEDI,GAAuB,WACrB,IAAMC,EAAe,WAEO,OAApBL,IACFA,EAAkBM,WAAWL,EAAUH,GAK5C,EAKD,OAJIrB,GACFC,OAAO6B,iBAAiB,SAAUF,GAG7B,WACD5B,GACFC,OAAO8B,oBAAoB,SAAUH,EAExC,CACF,GAAER,EACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rfl.js","sources":["../../../src/themes/rfl.ts"],"sourcesContent":["import {\n type UtilitiesType,\n type SiteConfigType,\n type AvatarType,\n type ButtonType,\n type BreakPointType,\n type TokenColorsType,\n type ColorsType,\n type SpacingType,\n type FontSizesType,\n type TypographyType,\n type ThemeType,\n type ShadowsType,\n} from \"../types\";\n\nimport { crukTheme as defaultTheme } from \"./cruk\";\n\nexport const UTILITIES: UtilitiesType = {\n ...defaultTheme.utilities,\n};\n\nexport const SITE_CONFIG: SiteConfigType = {\n ...defaultTheme.siteConfig,\n logoSrc: \"https://rcl.assets.cancerresearchuk.org/images/logos/rfl-sl.svg\",\n};\n\nexport const AVATAR: AvatarType = {\n ...defaultTheme.avatar,\n path: `${SITE_CONFIG.assetPath}images/avatar/rfl/`,\n};\n\nexport const BUTTON: ButtonType = {\n ...defaultTheme.button,\n};\n\nexport const BREAKPOINT: BreakPointType = {\n ...defaultTheme.breakpoint,\n};\n\nexport const TOKEN_COLORS: TokenColorsType = {\n ...defaultTheme.tokenColors,\n};\n\nexport const COLORS: ColorsType = {\n ...defaultTheme.colors,\n textHeaderDefault: TOKEN_COLORS.navy_600,\n headerTaglineText: TOKEN_COLORS.navy_600,\n progressBar: TOKEN_COLORS.magenta_700,\n progressBarSecondary: TOKEN_COLORS.navy_600,\n};\n\nexport const SPACING: SpacingType = {\n ...defaultTheme.spacing,\n};\n\nexport const SHADOWS: ShadowsType = {\n ...defaultTheme.shadows,\n};\n\nexport const FONT_SIZES: FontSizesType = {\n ...defaultTheme.fontSizes,\n};\n\nexport const TYPOGRAPHY: TypographyType = {\n ...defaultTheme.typography,\n fontWeightHeadings: 600,\n};\n\nexport const rflTheme: ThemeType = {\n name: \"rfl\",\n avatar: AVATAR,\n breakpoint: BREAKPOINT,\n button: BUTTON,\n tokenColors: TOKEN_COLORS,\n colors: COLORS,\n spacing: SPACING,\n fontSizes: FONT_SIZES,\n siteConfig: SITE_CONFIG,\n typography: TYPOGRAPHY,\n shadows: SHADOWS,\n utilities: UTILITIES,\n};\n\nexport default rflTheme;\n"],"names":["UTILITIES","__assign","defaultTheme","utilities","SITE_CONFIG","siteConfig","logoSrc","AVATAR","avatar","path","assetPath","BUTTON","button","BREAKPOINT","breakpoint","TOKEN_COLORS","tokenColors","COLORS","colors","textHeaderDefault","navy_600","headerTaglineText","progressBar","magenta_700","progressBarSecondary","SPACING","spacing","SHADOWS","shadows","FONT_SIZES","fontSizes","TYPOGRAPHY","typography","fontWeightHeadings","rflTheme","name"],"mappings":"2GAiBaA,EAASC,EAAA,GACjBC,EAAaC,WAGLC,EAAWH,EAAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"rfl.js","sources":["../../../src/themes/rfl.ts"],"sourcesContent":["import {\n type UtilitiesType,\n type SiteConfigType,\n type AvatarType,\n type ButtonType,\n type BreakPointType,\n type TokenColorsType,\n type ColorsType,\n type SpacingType,\n type FontSizesType,\n type TypographyType,\n type ThemeType,\n type ShadowsType,\n} from \"../types\";\n\nimport { crukTheme as defaultTheme } from \"./cruk\";\n\nexport const UTILITIES: UtilitiesType = {\n ...defaultTheme.utilities,\n};\n\nexport const SITE_CONFIG: SiteConfigType = {\n ...defaultTheme.siteConfig,\n logoSrc: \"https://rcl.assets.cancerresearchuk.org/images/logos/rfl-sl.svg\",\n};\n\nexport const AVATAR: AvatarType = {\n ...defaultTheme.avatar,\n path: `${SITE_CONFIG.assetPath}images/avatar/rfl/`,\n};\n\nexport const BUTTON: ButtonType = {\n ...defaultTheme.button,\n};\n\nexport const BREAKPOINT: BreakPointType = {\n ...defaultTheme.breakpoint,\n};\n\nexport const TOKEN_COLORS: TokenColorsType = {\n ...defaultTheme.tokenColors,\n};\n\nexport const COLORS: ColorsType = {\n ...defaultTheme.colors,\n textHeaderDefault: TOKEN_COLORS.navy_600,\n headerTaglineText: TOKEN_COLORS.navy_600,\n progressBar: TOKEN_COLORS.magenta_700,\n progressBarSecondary: TOKEN_COLORS.navy_600,\n};\n\nexport const SPACING: SpacingType = {\n ...defaultTheme.spacing,\n};\n\nexport const SHADOWS: ShadowsType = {\n ...defaultTheme.shadows,\n};\n\nexport const FONT_SIZES: FontSizesType = {\n ...defaultTheme.fontSizes,\n};\n\nexport const TYPOGRAPHY: TypographyType = {\n ...defaultTheme.typography,\n fontWeightHeadings: 600,\n};\n\nexport const rflTheme: ThemeType = {\n name: \"rfl\",\n avatar: AVATAR,\n breakpoint: BREAKPOINT,\n button: BUTTON,\n tokenColors: TOKEN_COLORS,\n colors: COLORS,\n spacing: SPACING,\n fontSizes: FONT_SIZES,\n siteConfig: SITE_CONFIG,\n typography: TYPOGRAPHY,\n shadows: SHADOWS,\n utilities: UTILITIES,\n};\n\nexport default rflTheme;\n"],"names":["UTILITIES","__assign","defaultTheme","utilities","SITE_CONFIG","siteConfig","logoSrc","AVATAR","avatar","path","assetPath","BUTTON","button","BREAKPOINT","breakpoint","TOKEN_COLORS","tokenColors","COLORS","colors","textHeaderDefault","navy_600","headerTaglineText","progressBar","magenta_700","progressBarSecondary","SPACING","spacing","SHADOWS","shadows","FONT_SIZES","fontSizes","TYPOGRAPHY","typography","fontWeightHeadings","rflTheme","name"],"mappings":"2GAiBaA,EAASC,EAAA,GACjBC,EAAaC,WAGLC,EAAWH,EAAAA,EAAA,CAAA,EACnBC,EAAaG,YAAU,CAC1BC,QAAS,oEAGEC,EACRN,EAAAA,EAAA,CAAA,EAAAC,EAAaM,QAAM,CACtBC,KAAM,UAAGL,EAAYM,UAAS,wBAGnBC,EAAMV,EAAA,GACdC,EAAaU,QAGLC,EAAUZ,EAAA,GAClBC,EAAaY,YAGLC,EAAYd,EAAA,GACpBC,EAAac,aAGLC,EAAMhB,EAAAA,EAAA,CAAA,EACdC,EAAagB,QAChB,CAAAC,kBAAmBJ,EAAaK,SAChCC,kBAAmBN,EAAaK,SAChCE,YAAaP,EAAaQ,YAC1BC,qBAAsBT,EAAaK,WAGxBK,EAAOxB,EAAA,GACfC,EAAawB,SAGLC,EAAO1B,EAAA,GACfC,EAAa0B,SAGLC,EAAU5B,EAAA,GAClBC,EAAa4B,WAGLC,EAAU9B,EAAAA,EAAA,CAAA,EAClBC,EAAa8B,YAAU,CAC1BC,mBAAoB,MAGTC,EAAsB,CACjCC,KAAM,MACN3B,OAAQD,EACRO,WAAYD,EACZD,OAAQD,EACRK,YAAaD,EACbG,OAAQD,EACRS,QAASD,EACTK,UAAWD,EACXxB,WAAYD,EACZ4B,WAAYD,EACZH,QAASD,EACTxB,UAAWH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"su2c.js","sources":["../../../src/themes/su2c.ts"],"sourcesContent":["import {\n type UtilitiesType,\n type SiteConfigType,\n type AvatarType,\n type ButtonType,\n type BreakPointType,\n type TokenColorsType,\n type ColorsType,\n type SpacingType,\n type FontSizesType,\n type TypographyType,\n type ThemeType,\n type ShadowsType,\n} from \"../types\";\n\nimport { crukTheme as defaultTheme } from \"./cruk\";\n\nexport const UTILITIES: UtilitiesType = {\n ...defaultTheme.utilities,\n useBackgroundStyleLinks: true,\n};\n\nexport const SITE_CONFIG: SiteConfigType = {\n ...defaultTheme.siteConfig,\n logoSrc: \"https://rcl.assets.cancerresearchuk.org/images/logos/su2c-160.png\",\n footerCopyText:\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.\",\n};\n\nexport const AVATAR: AvatarType = {\n ...defaultTheme.avatar,\n path: `${SITE_CONFIG.assetPath}images/avatar/su2c/`,\n};\n\nexport const BUTTON: ButtonType = {\n ...defaultTheme.button,\n borderRadius: \"1.5rem\",\n borderRadiusLarge: \"2rem\",\n textTransform: \"uppercase\",\n};\n\nexport const BREAKPOINT: BreakPointType = {\n ...defaultTheme.breakpoint,\n};\n\nexport const TOKEN_COLORS: TokenColorsType = {\n ...defaultTheme.tokenColors,\n su2cOrange5: \"#FF8E00\",\n su2cOrange3: \"#FFB04D\",\n su2cOrange2: \"#FFDAAD\",\n su2cOrange1: \"#FFF6EB\",\n su2cBlack: \"#231F20\",\n su2cGrey1: \"#555759\",\n su2cGrey2: \"#A5A5A9\",\n su2cRed: \"#EF4135\",\n su2cYellow: \"#FFC325\",\n};\n\nexport const COLORS: ColorsType = {\n ...defaultTheme.colors,\n primary: TOKEN_COLORS.su2cOrange5,\n secondary: TOKEN_COLORS.su2cOrange5,\n tertiary: TOKEN_COLORS.su2cBlack,\n textHeaderDefault: TOKEN_COLORS.su2cBlack,\n\n textOnPrimary: TOKEN_COLORS.su2cBlack,\n\n avatarBorder: TOKEN_COLORS.su2cBlack,\n progressBar: TOKEN_COLORS.su2cOrange5,\n progressBarSecondary: TOKEN_COLORS.su2cRed,\n circularProgress: TOKEN_COLORS.su2cOrange3,\n circularProgressSecondary: TOKEN_COLORS.su2cRed,\n linkColor: TOKEN_COLORS.su2cOrange5,\n linkColorHover: TOKEN_COLORS.su2cRed,\n linkColorSecondary: TOKEN_COLORS.su2cOrange5,\n linkColorSecondaryHover: TOKEN_COLORS.su2cRed,\n\n backgroundLightColor: TOKEN_COLORS.su2cOrange2,\n\n loaderColor1: TOKEN_COLORS.su2cOrange5,\n loaderColor2: TOKEN_COLORS.su2cRed,\n loaderColor3: TOKEN_COLORS.su2cBlack,\n\n paginationText: TOKEN_COLORS.su2cBlack,\n paginationBackground: TOKEN_COLORS.su2cBlack,\n\n totaliserBubbleColor: TOKEN_COLORS.su2cBlack,\n totaliserBubbleTextColor: TOKEN_COLORS.white,\n totaliserBubbleTotalColor: TOKEN_COLORS.white,\n\n collapseHeaderColor: TOKEN_COLORS.su2cOrange5,\n check: TOKEN_COLORS.su2cBlack,\n\n headerTaglineText: TOKEN_COLORS.su2cOrange5,\n\n buttonPrimaryBackground: TOKEN_COLORS.su2cOrange5,\n buttonPrimaryText: TOKEN_COLORS.su2cBlack,\n buttonPrimaryBorder: TOKEN_COLORS.su2cOrange5,\n buttonPrimaryBackgroundHover: TOKEN_COLORS.su2cOrange3,\n buttonPrimaryTextHover: TOKEN_COLORS.su2cBlack,\n buttonPrimaryBorderHover: TOKEN_COLORS.su2cOrange3,\n buttonPrimaryDisabledBackground: TOKEN_COLORS.grey_200,\n buttonPrimaryDisabledText: TOKEN_COLORS.grey_600,\n buttonPrimaryDisabledBorder: TOKEN_COLORS.grey_200,\n\n buttonSecondaryBackground: TOKEN_COLORS.white,\n buttonSecondaryText: TOKEN_COLORS.su2cOrange5,\n buttonSecondaryBorder: TOKEN_COLORS.su2cOrange5,\n buttonSecondaryBackgroundHover: TOKEN_COLORS.su2cOrange1,\n buttonSecondaryTextHover: TOKEN_COLORS.su2cOrange5,\n buttonSecondaryBorderHover: TOKEN_COLORS.su2cOrange5,\n buttonSecondaryDisabledBackground: TOKEN_COLORS.white,\n buttonSecondaryDisabledText: TOKEN_COLORS.grey_200,\n buttonSecondaryDisabledBorder: TOKEN_COLORS.grey_200,\n\n buttonTertiaryText: TOKEN_COLORS.su2cOrange5,\n buttonTertiaryTextHover: TOKEN_COLORS.su2cOrange5,\n buttonTertiaryDisabledText: TOKEN_COLORS.grey_200,\n};\n\nexport const SPACING: SpacingType = {\n ...defaultTheme.spacing,\n};\n\nexport const SHADOWS: ShadowsType = {\n ...defaultTheme.shadows,\n};\n\nexport const FONT_SIZES: FontSizesType = {\n ...defaultTheme.fontSizes,\n};\n\nexport const TYPOGRAPHY: TypographyType = {\n ...defaultTheme.typography,\n customFonts: [\n {\n family: \"itc_avant_garde_pro\",\n urlWoff: `${SITE_CONFIG.assetPath}fonts/itc_-_itcavantgardepro-bold-webfont.woff`,\n fontWeight: 700,\n },\n ],\n fontFamilyHeadings: \"itc_avant_garde_pro,Arial,sans-serif\",\n fontFamilyLinks: \"itc_avant_garde_pro,Arial,sans-serif\",\n fontFamilyButtons: \"itc_avant_garde_pro,Arial,sans-serif\",\n fontFamilyBase:\n \"Arial, Calibri, nimbussansl, liberationsans, freesans, clean, sans-serif\",\n fontFamilyLabel:\n \"Arial, Calibri, nimbussansl, liberationsans, freesans, clean, sans-serif\",\n linkTextDecoration: \"none\",\n headerLineHeight: \"1.5em\",\n headerTextTransform: \"uppercase\",\n fontWeightBase: 400,\n fontWeightLinks: 700,\n fontWeightButtons: 700,\n fontWeightLabels: 600,\n LinkPrimaryTextDecoration: \"none\",\n LinkLetterSpacing: \"0px\",\n};\n\nexport const su2cTheme: ThemeType = {\n name: \"su2c\",\n avatar: AVATAR,\n breakpoint: BREAKPOINT,\n button: BUTTON,\n tokenColors: TOKEN_COLORS,\n colors: COLORS,\n spacing: SPACING,\n fontSizes: FONT_SIZES,\n siteConfig: SITE_CONFIG,\n typography: TYPOGRAPHY,\n shadows: SHADOWS,\n utilities: UTILITIES,\n};\n\nexport default su2cTheme;\n"],"names":["UTILITIES","__assign","defaultTheme","utilities","useBackgroundStyleLinks","SITE_CONFIG","siteConfig","logoSrc","footerCopyText","AVATAR","avatar","path","assetPath","BUTTON","button","borderRadius","borderRadiusLarge","textTransform","BREAKPOINT","breakpoint","TOKEN_COLORS","tokenColors","su2cOrange5","su2cOrange3","su2cOrange2","su2cOrange1","su2cBlack","su2cGrey1","su2cGrey2","su2cRed","su2cYellow","COLORS","colors","primary","secondary","tertiary","textHeaderDefault","textOnPrimary","avatarBorder","progressBar","progressBarSecondary","circularProgress","circularProgressSecondary","linkColor","linkColorHover","linkColorSecondary","linkColorSecondaryHover","backgroundLightColor","loaderColor1","loaderColor2","loaderColor3","paginationText","paginationBackground","totaliserBubbleColor","totaliserBubbleTextColor","white","totaliserBubbleTotalColor","collapseHeaderColor","check","headerTaglineText","buttonPrimaryBackground","buttonPrimaryText","buttonPrimaryBorder","buttonPrimaryBackgroundHover","buttonPrimaryTextHover","buttonPrimaryBorderHover","buttonPrimaryDisabledBackground","grey_200","buttonPrimaryDisabledText","grey_600","buttonPrimaryDisabledBorder","buttonSecondaryBackground","buttonSecondaryText","buttonSecondaryBorder","buttonSecondaryBackgroundHover","buttonSecondaryTextHover","buttonSecondaryBorderHover","buttonSecondaryDisabledBackground","buttonSecondaryDisabledText","buttonSecondaryDisabledBorder","buttonTertiaryText","buttonTertiaryTextHover","buttonTertiaryDisabledText","SPACING","spacing","SHADOWS","shadows","FONT_SIZES","fontSizes","TYPOGRAPHY","typography","customFonts","family","urlWoff","concat","fontWeight","fontFamilyHeadings","fontFamilyLinks","fontFamilyButtons","fontFamilyBase","fontFamilyLabel","linkTextDecoration","headerLineHeight","headerTextTransform","fontWeightBase","fontWeightLinks","fontWeightButtons","fontWeightLabels","LinkPrimaryTextDecoration","LinkLetterSpacing","su2cTheme","name"],"mappings":"uGAiBO,IAAMA,EAASC,EAAAA,EAAA,GACjBC,EAAaC,WAAS,CACzBC,yBAAyB,IAGdC,EACRJ,EAAAA,EAAA,CAAA,EAAAC,EAAaI,YAAU,CAC1BC,QAAS,oEACTC,eACE,sgBAGSC,EACRR,EAAAA,EAAA,CAAA,EAAAC,EAAaQ,QAAM,CACtBC,KAAM,UAAGN,EAAYO,UAAS,yBAGnBC,EAAMZ,EAAAA,EAAA,CAAA,EACdC,EAAaY,SAChBC,aAAc,SACdC,kBAAmB,OACnBC,cAAe,cAGJC,EAAUjB,EAAA,GAClBC,EAAaiB,YAGLC,EAAYnB,EAAAA,EAAA,CAAA,EACpBC,EAAamB,cAChBC,YAAa,UACbC,YAAa,UACbC,YAAa,UACbC,YAAa,UACbC,UAAW,UACXC,UAAW,UACXC,UAAW,UACXC,QAAS,UACTC,WAAY,YAGDC,EAAM9B,EAAAA,EAAA,CAAA,EACdC,EAAa8B,QAChB,CAAAC,QAASb,EAAaE,YACtBY,UAAWd,EAAaE,YACxBa,SAAUf,EAAaM,UACvBU,kBAAmBhB,EAAaM,UAEhCW,cAAejB,EAAaM,UAE5BY,aAAclB,EAAaM,UAC3Ba,YAAanB,EAAaE,YAC1BkB,qBAAsBpB,EAAaS,QACnCY,iBAAkBrB,EAAaG,YAC/BmB,0BAA2BtB,EAAaS,QACxCc,UAAWvB,EAAaE,YACxBsB,eAAgBxB,EAAaS,QAC7BgB,mBAAoBzB,EAAaE,YACjCwB,wBAAyB1B,EAAaS,QAEtCkB,qBAAsB3B,EAAaI,YAEnCwB,aAAc5B,EAAaE,YAC3B2B,aAAc7B,EAAaS,QAC3BqB,aAAc9B,EAAaM,UAE3ByB,eAAgB/B,EAAaM,UAC7B0B,qBAAsBhC,EAAaM,UAEnC2B,qBAAsBjC,EAAaM,UACnC4B,yBAA0BlC,EAAamC,MACvCC,0BAA2BpC,EAAamC,MAExCE,oBAAqBrC,EAAaE,YAClCoC,MAAOtC,EAAaM,UAEpBiC,kBAAmBvC,EAAaE,YAEhCsC,wBAAyBxC,EAAaE,YACtCuC,kBAAmBzC,EAAaM,UAChCoC,oBAAqB1C,EAAaE,YAClCyC,6BAA8B3C,EAAaG,YAC3CyC,uBAAwB5C,EAAaM,UACrCuC,yBAA0B7C,EAAaG,YACvC2C,gCAAiC9C,EAAa+C,SAC9CC,0BAA2BhD,EAAaiD,SACxCC,4BAA6BlD,EAAa+C,SAE1CI,0BAA2BnD,EAAamC,MACxCiB,oBAAqBpD,EAAaE,YAClCmD,sBAAuBrD,EAAaE,YACpCoD,+BAAgCtD,EAAaK,YAC7CkD,yBAA0BvD,EAAaE,YACvCsD,2BAA4BxD,EAAaE,YACzCuD,kCAAmCzD,EAAamC,MAChDuB,4BAA6B1D,EAAa+C,SAC1CY,8BAA+B3D,EAAa+C,SAE5Ca,mBAAoB5D,EAAaE,YACjC2D,wBAAyB7D,EAAaE,YACtC4D,2BAA4B9D,EAAa+C,WAG9BgB,EAAOlF,EAAA,GACfC,EAAakF,SAGLC,EAAOpF,EAAA,GACfC,EAAaoF,SAGLC,EAAUtF,EAAA,GAClBC,EAAasF,WAGLC,EAAUxF,EAAAA,EAAA,CAAA,EAClBC,EAAawF,YAChB,CAAAC,YAAa,CACX,CACEC,OAAQ,sBACRC,QAAS,GAAAC,OAAGzF,EAAYO,UAAyD,kDACjFmF,WAAY,MAGhBC,mBAAoB,uCACpBC,gBAAiB,uCACjBC,kBAAmB,uCACnBC,eACE,2EACFC,gBACE,2EACFC,mBAAoB,OACpBC,iBAAkB,QAClBC,oBAAqB,YACrBC,eAAgB,IAChBC,gBAAiB,IACjBC,kBAAmB,IACnBC,iBAAkB,IAClBC,0BAA2B,OAC3BC,kBAAmB,QAGRC,EAAuB,CAClCC,KAAM,OACNrG,OAAQD,EACRU,WAAYD,EACZJ,OAAQD,EACRQ,YAAaD,EACbY,OAAQD,EACRqD,QAASD,EACTK,UAAWD,EACXjF,WAAYD,EACZqF,WAAYD,EACZH,QAASD,EACTlF,UAAWH"}
|
|
1
|
+
{"version":3,"file":"su2c.js","sources":["../../../src/themes/su2c.ts"],"sourcesContent":["import {\n type UtilitiesType,\n type SiteConfigType,\n type AvatarType,\n type ButtonType,\n type BreakPointType,\n type TokenColorsType,\n type ColorsType,\n type SpacingType,\n type FontSizesType,\n type TypographyType,\n type ThemeType,\n type ShadowsType,\n} from \"../types\";\n\nimport { crukTheme as defaultTheme } from \"./cruk\";\n\nexport const UTILITIES: UtilitiesType = {\n ...defaultTheme.utilities,\n useBackgroundStyleLinks: true,\n};\n\nexport const SITE_CONFIG: SiteConfigType = {\n ...defaultTheme.siteConfig,\n logoSrc: \"https://rcl.assets.cancerresearchuk.org/images/logos/su2c-160.png\",\n footerCopyText:\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.\",\n};\n\nexport const AVATAR: AvatarType = {\n ...defaultTheme.avatar,\n path: `${SITE_CONFIG.assetPath}images/avatar/su2c/`,\n};\n\nexport const BUTTON: ButtonType = {\n ...defaultTheme.button,\n borderRadius: \"1.5rem\",\n borderRadiusLarge: \"2rem\",\n textTransform: \"uppercase\",\n};\n\nexport const BREAKPOINT: BreakPointType = {\n ...defaultTheme.breakpoint,\n};\n\nexport const TOKEN_COLORS: TokenColorsType = {\n ...defaultTheme.tokenColors,\n su2cOrange5: \"#FF8E00\",\n su2cOrange3: \"#FFB04D\",\n su2cOrange2: \"#FFDAAD\",\n su2cOrange1: \"#FFF6EB\",\n su2cBlack: \"#231F20\",\n su2cGrey1: \"#555759\",\n su2cGrey2: \"#A5A5A9\",\n su2cRed: \"#EF4135\",\n su2cYellow: \"#FFC325\",\n};\n\nexport const COLORS: ColorsType = {\n ...defaultTheme.colors,\n primary: TOKEN_COLORS.su2cOrange5,\n secondary: TOKEN_COLORS.su2cOrange5,\n tertiary: TOKEN_COLORS.su2cBlack,\n textHeaderDefault: TOKEN_COLORS.su2cBlack,\n\n textOnPrimary: TOKEN_COLORS.su2cBlack,\n\n avatarBorder: TOKEN_COLORS.su2cBlack,\n progressBar: TOKEN_COLORS.su2cOrange5,\n progressBarSecondary: TOKEN_COLORS.su2cRed,\n circularProgress: TOKEN_COLORS.su2cOrange3,\n circularProgressSecondary: TOKEN_COLORS.su2cRed,\n linkColor: TOKEN_COLORS.su2cOrange5,\n linkColorHover: TOKEN_COLORS.su2cRed,\n linkColorSecondary: TOKEN_COLORS.su2cOrange5,\n linkColorSecondaryHover: TOKEN_COLORS.su2cRed,\n\n backgroundLightColor: TOKEN_COLORS.su2cOrange2,\n\n loaderColor1: TOKEN_COLORS.su2cOrange5,\n loaderColor2: TOKEN_COLORS.su2cRed,\n loaderColor3: TOKEN_COLORS.su2cBlack,\n\n paginationText: TOKEN_COLORS.su2cBlack,\n paginationBackground: TOKEN_COLORS.su2cBlack,\n\n totaliserBubbleColor: TOKEN_COLORS.su2cBlack,\n totaliserBubbleTextColor: TOKEN_COLORS.white,\n totaliserBubbleTotalColor: TOKEN_COLORS.white,\n\n collapseHeaderColor: TOKEN_COLORS.su2cOrange5,\n check: TOKEN_COLORS.su2cBlack,\n\n headerTaglineText: TOKEN_COLORS.su2cOrange5,\n\n buttonPrimaryBackground: TOKEN_COLORS.su2cOrange5,\n buttonPrimaryText: TOKEN_COLORS.su2cBlack,\n buttonPrimaryBorder: TOKEN_COLORS.su2cOrange5,\n buttonPrimaryBackgroundHover: TOKEN_COLORS.su2cOrange3,\n buttonPrimaryTextHover: TOKEN_COLORS.su2cBlack,\n buttonPrimaryBorderHover: TOKEN_COLORS.su2cOrange3,\n buttonPrimaryDisabledBackground: TOKEN_COLORS.grey_200,\n buttonPrimaryDisabledText: TOKEN_COLORS.grey_600,\n buttonPrimaryDisabledBorder: TOKEN_COLORS.grey_200,\n\n buttonSecondaryBackground: TOKEN_COLORS.white,\n buttonSecondaryText: TOKEN_COLORS.su2cOrange5,\n buttonSecondaryBorder: TOKEN_COLORS.su2cOrange5,\n buttonSecondaryBackgroundHover: TOKEN_COLORS.su2cOrange1,\n buttonSecondaryTextHover: TOKEN_COLORS.su2cOrange5,\n buttonSecondaryBorderHover: TOKEN_COLORS.su2cOrange5,\n buttonSecondaryDisabledBackground: TOKEN_COLORS.white,\n buttonSecondaryDisabledText: TOKEN_COLORS.grey_200,\n buttonSecondaryDisabledBorder: TOKEN_COLORS.grey_200,\n\n buttonTertiaryText: TOKEN_COLORS.su2cOrange5,\n buttonTertiaryTextHover: TOKEN_COLORS.su2cOrange5,\n buttonTertiaryDisabledText: TOKEN_COLORS.grey_200,\n};\n\nexport const SPACING: SpacingType = {\n ...defaultTheme.spacing,\n};\n\nexport const SHADOWS: ShadowsType = {\n ...defaultTheme.shadows,\n};\n\nexport const FONT_SIZES: FontSizesType = {\n ...defaultTheme.fontSizes,\n};\n\nexport const TYPOGRAPHY: TypographyType = {\n ...defaultTheme.typography,\n customFonts: [\n {\n family: \"itc_avant_garde_pro\",\n urlWoff: `${SITE_CONFIG.assetPath}fonts/itc_-_itcavantgardepro-bold-webfont.woff`,\n fontWeight: 700,\n },\n ],\n fontFamilyHeadings: \"itc_avant_garde_pro,Arial,sans-serif\",\n fontFamilyLinks: \"itc_avant_garde_pro,Arial,sans-serif\",\n fontFamilyButtons: \"itc_avant_garde_pro,Arial,sans-serif\",\n fontFamilyBase:\n \"Arial, Calibri, nimbussansl, liberationsans, freesans, clean, sans-serif\",\n fontFamilyLabel:\n \"Arial, Calibri, nimbussansl, liberationsans, freesans, clean, sans-serif\",\n linkTextDecoration: \"none\",\n headerLineHeight: \"1.5em\",\n headerTextTransform: \"uppercase\",\n fontWeightBase: 400,\n fontWeightLinks: 700,\n fontWeightButtons: 700,\n fontWeightLabels: 600,\n LinkPrimaryTextDecoration: \"none\",\n LinkLetterSpacing: \"0px\",\n};\n\nexport const su2cTheme: ThemeType = {\n name: \"su2c\",\n avatar: AVATAR,\n breakpoint: BREAKPOINT,\n button: BUTTON,\n tokenColors: TOKEN_COLORS,\n colors: COLORS,\n spacing: SPACING,\n fontSizes: FONT_SIZES,\n siteConfig: SITE_CONFIG,\n typography: TYPOGRAPHY,\n shadows: SHADOWS,\n utilities: UTILITIES,\n};\n\nexport default su2cTheme;\n"],"names":["UTILITIES","__assign","defaultTheme","utilities","useBackgroundStyleLinks","SITE_CONFIG","siteConfig","logoSrc","footerCopyText","AVATAR","avatar","path","assetPath","BUTTON","button","borderRadius","borderRadiusLarge","textTransform","BREAKPOINT","breakpoint","TOKEN_COLORS","tokenColors","su2cOrange5","su2cOrange3","su2cOrange2","su2cOrange1","su2cBlack","su2cGrey1","su2cGrey2","su2cRed","su2cYellow","COLORS","colors","primary","secondary","tertiary","textHeaderDefault","textOnPrimary","avatarBorder","progressBar","progressBarSecondary","circularProgress","circularProgressSecondary","linkColor","linkColorHover","linkColorSecondary","linkColorSecondaryHover","backgroundLightColor","loaderColor1","loaderColor2","loaderColor3","paginationText","paginationBackground","totaliserBubbleColor","totaliserBubbleTextColor","white","totaliserBubbleTotalColor","collapseHeaderColor","check","headerTaglineText","buttonPrimaryBackground","buttonPrimaryText","buttonPrimaryBorder","buttonPrimaryBackgroundHover","buttonPrimaryTextHover","buttonPrimaryBorderHover","buttonPrimaryDisabledBackground","grey_200","buttonPrimaryDisabledText","grey_600","buttonPrimaryDisabledBorder","buttonSecondaryBackground","buttonSecondaryText","buttonSecondaryBorder","buttonSecondaryBackgroundHover","buttonSecondaryTextHover","buttonSecondaryBorderHover","buttonSecondaryDisabledBackground","buttonSecondaryDisabledText","buttonSecondaryDisabledBorder","buttonTertiaryText","buttonTertiaryTextHover","buttonTertiaryDisabledText","SPACING","spacing","SHADOWS","shadows","FONT_SIZES","fontSizes","TYPOGRAPHY","typography","customFonts","family","urlWoff","concat","fontWeight","fontFamilyHeadings","fontFamilyLinks","fontFamilyButtons","fontFamilyBase","fontFamilyLabel","linkTextDecoration","headerLineHeight","headerTextTransform","fontWeightBase","fontWeightLinks","fontWeightButtons","fontWeightLabels","LinkPrimaryTextDecoration","LinkLetterSpacing","su2cTheme","name"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Helper.js","sources":["../../../src/utils/Helper.ts"],"sourcesContent":["export const isBrowser = typeof window !== \"undefined\";\n\nexport const calculatePercentRounded = (\n value: number,\n target: number,\n): number => {\n const percent = (value / target) * 100;\n if (percent === Number.POSITIVE_INFINITY || Number.isNaN(percent)) {\n return 0;\n }\n return Math.floor(percent < 1 ? Math.ceil(percent) : Math.floor(percent));\n};\n\nexport const formatMoney = (value: number): string => {\n const parsed = Number.parseFloat(\n (Math.round(value * 100) / 100).toString(),\n ).toFixed(2);\n if (Number.isNaN(parseFloat(parsed)) || Number.isNaN(value)) {\n return \"0\";\n }\n return parsed;\n};\n\nexport const numberWithCommas = (n?: number | string): string => {\n if (!n) {\n return \"\";\n }\n const parts = n.toString().split(\".\");\n\n return `${parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")}${\n parts[1] ? `.${parts[1]}` : \"\"\n }`;\n};\n\nexport const formatMoneyWithCommas = (value: number): string => {\n const parsed = Number.parseFloat(\n (Math.round(value * 100) / 100).toString(),\n ).toFixed(2);\n if (Number.isNaN(parseFloat(parsed)) || Number.isNaN(value)) {\n return \"0\";\n }\n return numberWithCommas(parsed);\n};\n\nexport const camelize = (str: string): string =>\n str\n .toString()\n .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (word: string, index: number) =>\n index === 0 ? word.toLowerCase() : word.toUpperCase(),\n )\n .replace(/\\s+/g, \"\");\n\nexport const removeCommasFromObjectStringValues = <T>(object: T) =>\n Object.entries(object as Record<string, unknown>).reduce((acc, [k, v]) => {\n const value = typeof v === \"string\" ? v.replace(/,/g, \"\") : v;\n return {\n ...acc,\n [k as keyof T]: value,\n };\n }, {} as T);\n"],"names":["isBrowser","window","calculatePercentRounded","value","target","percent","Number","POSITIVE_INFINITY","isNaN","Math","floor","ceil","numberWithCommas","n","parts","toString","split","concat","replace","formatMoneyWithCommas","parsed","parseFloat","round","toFixed","removeCommasFromObjectStringValues","object","Object","entries","reduce","acc","_a","k","v","__assign","_b"],"mappings":"qEAAaA,EAA8B,oBAAXC,OAEnBC,EAA0B,SACrCC,EACAC,GAEA,IAAMC,EAAWF,EAAQC,EAAU,IACnC,OAAIC,IAAYC,OAAOC,mBAAqBD,OAAOE,MAAMH,GAChD,EAEFI,KAAKC,MAAML,EAAU,EAAII,KAAKE,KAAKN,GAAWI,KAAKC,MAAML,GAClE,EAYaO,EAAmB,SAACC,GAC/B,IAAKA,EACH,MAAO,GAET,IAAMC,EAAQD,EAAEE,WAAWC,MAAM,KAEjC,MAAO,GAAGC,OAAAH,EAAM,GAAGI,QAAQ,wBAAyB,aAClDJ,EAAM,GAAK,IAAAG,OAAIH,EAAM,IAAO,GAEhC,EAEaK,EAAwB,SAAChB,GACpC,IAAMiB,EAASd,OAAOe,YACnBZ,KAAKa,MAAc,IAARnB,GAAe,KAAKY,YAChCQ,QAAQ,GACV,OAAIjB,OAAOE,MAAMa,WAAWD,KAAYd,OAAOE,MAAML,GAC5C,IAEFS,EAAiBQ,EAC1B,EAUaI,EAAqC,SAAIC,GACpD,OAAAC,OAAOC,QAAQF,GAAmCG,QAAO,SAACC,EAAKC,SAACC,EAACD,EAAA,GAAEE,EAACF,EAAA,GAC5D3B,EAAqB,iBAAN6B,EAAiBA,EAAEd,QAAQ,KAAM,IAAMc,EAC5D,OAAAC,EAAAA,EAAA,CAAA,EACKJ,KAAGK,EAAA,CAAA,GACLH,GAAe5B,EAChB+B,GACH,GAAE,
|
|
1
|
+
{"version":3,"file":"Helper.js","sources":["../../../src/utils/Helper.ts"],"sourcesContent":["export const isBrowser = typeof window !== \"undefined\";\n\nexport const calculatePercentRounded = (\n value: number,\n target: number,\n): number => {\n const percent = (value / target) * 100;\n if (percent === Number.POSITIVE_INFINITY || Number.isNaN(percent)) {\n return 0;\n }\n return Math.floor(percent < 1 ? Math.ceil(percent) : Math.floor(percent));\n};\n\nexport const formatMoney = (value: number): string => {\n const parsed = Number.parseFloat(\n (Math.round(value * 100) / 100).toString(),\n ).toFixed(2);\n if (Number.isNaN(parseFloat(parsed)) || Number.isNaN(value)) {\n return \"0\";\n }\n return parsed;\n};\n\nexport const numberWithCommas = (n?: number | string): string => {\n if (!n) {\n return \"\";\n }\n const parts = n.toString().split(\".\");\n\n return `${parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")}${\n parts[1] ? `.${parts[1]}` : \"\"\n }`;\n};\n\nexport const formatMoneyWithCommas = (value: number): string => {\n const parsed = Number.parseFloat(\n (Math.round(value * 100) / 100).toString(),\n ).toFixed(2);\n if (Number.isNaN(parseFloat(parsed)) || Number.isNaN(value)) {\n return \"0\";\n }\n return numberWithCommas(parsed);\n};\n\nexport const camelize = (str: string): string =>\n str\n .toString()\n .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (word: string, index: number) =>\n index === 0 ? word.toLowerCase() : word.toUpperCase(),\n )\n .replace(/\\s+/g, \"\");\n\nexport const removeCommasFromObjectStringValues = <T>(object: T) =>\n Object.entries(object as Record<string, unknown>).reduce((acc, [k, v]) => {\n const value = typeof v === \"string\" ? v.replace(/,/g, \"\") : v;\n return {\n ...acc,\n [k as keyof T]: value,\n };\n }, {} as T);\n"],"names":["isBrowser","window","calculatePercentRounded","value","target","percent","Number","POSITIVE_INFINITY","isNaN","Math","floor","ceil","numberWithCommas","n","parts","toString","split","concat","replace","formatMoneyWithCommas","parsed","parseFloat","round","toFixed","removeCommasFromObjectStringValues","object","Object","entries","reduce","acc","_a","k","v","__assign","_b"],"mappings":"qEAAaA,EAA8B,oBAAXC,OAEnBC,EAA0B,SACrCC,EACAC,GAEA,IAAMC,EAAWF,EAAQC,EAAU,IACnC,OAAIC,IAAYC,OAAOC,mBAAqBD,OAAOE,MAAMH,GAChD,EAEFI,KAAKC,MAAML,EAAU,EAAII,KAAKE,KAAKN,GAAWI,KAAKC,MAAML,GAClE,EAYaO,EAAmB,SAACC,GAC/B,IAAKA,EACH,MAAO,GAET,IAAMC,EAAQD,EAAEE,WAAWC,MAAM,KAEjC,MAAO,GAAGC,OAAAH,EAAM,GAAGI,QAAQ,wBAAyB,aAClDJ,EAAM,GAAK,IAAAG,OAAIH,EAAM,IAAO,GAEhC,EAEaK,EAAwB,SAAChB,GACpC,IAAMiB,EAASd,OAAOe,YACnBZ,KAAKa,MAAc,IAARnB,GAAe,KAAKY,YAChCQ,QAAQ,GACV,OAAIjB,OAAOE,MAAMa,WAAWD,KAAYd,OAAOE,MAAML,GAC5C,IAEFS,EAAiBQ,EAC1B,EAUaI,EAAqC,SAAIC,GACpD,OAAAC,OAAOC,QAAQF,GAAmCG,QAAO,SAACC,EAAKC,SAACC,EAACD,EAAA,GAAEE,EAACF,EAAA,GAC5D3B,EAAqB,iBAAN6B,EAAiBA,EAAEd,QAAQ,KAAM,IAAMc,EAC5D,OAAAC,EAAAA,EAAA,CAAA,EACKJ,KAAGK,EAAA,CAAA,GACLH,GAAe5B,EAChB+B,GACH,GAAE,GANH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.js","sources":["../../../src/utils/debounce.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-types\nexport const debounce = (delay: number, callback: Function) => {\n let timerId: ReturnType<typeof setTimeout> | null;\n return (...args: unknown[]) => {\n if (timerId) {\n clearTimeout(timerId);\n }\n timerId = setTimeout(() => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n callback(...args);\n timerId = null;\n }, delay);\n };\n};\n\nexport default debounce;\n"],"names":["debounce","delay","callback","timerId","args","_i","arguments","length","clearTimeout","setTimeout","apply"],"mappings":"AACa,IAAAA,EAAW,SAACC,EAAeC,GACtC,IAAIC,EACJ,OAAO,eAAC,IAAkBC,EAAA,GAAAC,EAAA,EAAlBA,EAAkBC,UAAAC,OAAlBF,IAAAD,EAAkBC,GAAAC,UAAAD,GACpBF,GACFK,aAAaL,GAEfA,EAAUM,YAAW,WAEnBP,EAAQQ,WAAA,EAAIN,GACZD,EAAU,IACX,GAAEF,
|
|
1
|
+
{"version":3,"file":"debounce.js","sources":["../../../src/utils/debounce.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-types\nexport const debounce = (delay: number, callback: Function) => {\n let timerId: ReturnType<typeof setTimeout> | null;\n return (...args: unknown[]) => {\n if (timerId) {\n clearTimeout(timerId);\n }\n timerId = setTimeout(() => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n callback(...args);\n timerId = null;\n }, delay);\n };\n};\n\nexport default debounce;\n"],"names":["debounce","delay","callback","timerId","args","_i","arguments","length","clearTimeout","setTimeout","apply"],"mappings":"AACa,IAAAA,EAAW,SAACC,EAAeC,GACtC,IAAIC,EACJ,OAAO,eAAC,IAAkBC,EAAA,GAAAC,EAAA,EAAlBA,EAAkBC,UAAAC,OAAlBF,IAAAD,EAAkBC,GAAAC,UAAAD,GACpBF,GACFK,aAAaL,GAEfA,EAAUM,YAAW,WAEnBP,EAAQQ,WAAA,EAAIN,GACZD,EAAU,IACX,GAAEF,EACJ,CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cruk/cruk-react-components",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.7",
|
|
4
4
|
"description": "React components implementing CRUK, RFL, SU2C & Bowelbabe designs",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"node-test-watch": "node --import tsx --test-reporter=spec --watch --test 'src/utils/__tests__/testHelpers.test.ts'",
|
|
26
26
|
"test": "npm run node-test && npm run cypress-headless",
|
|
27
27
|
"clean": "rm -rf node_modules/",
|
|
28
|
-
"release": "
|
|
28
|
+
"release": "release-it",
|
|
29
29
|
"rollup:build-lib": "npm run clean-lib && rollup --config",
|
|
30
30
|
"prettier": "prettier --write '**/*.{ts,tsx}'",
|
|
31
31
|
"prettier:test": "prettier --check src/**/*.{ts,tsx}",
|
|
@@ -62,17 +62,17 @@
|
|
|
62
62
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
63
63
|
"@rollup/plugin-terser": "^0.4.4",
|
|
64
64
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
65
|
-
"@storybook/addon-a11y": "^8.
|
|
66
|
-
"@storybook/addon-actions": "^8.
|
|
67
|
-
"@storybook/addon-docs": "^8.
|
|
68
|
-
"@storybook/addon-essentials": "^8.
|
|
69
|
-
"@storybook/addon-interactions": "^8.
|
|
70
|
-
"@storybook/addon-links": "^8.
|
|
65
|
+
"@storybook/addon-a11y": "^8.3.6",
|
|
66
|
+
"@storybook/addon-actions": "^8.3.6",
|
|
67
|
+
"@storybook/addon-docs": "^8.3.6",
|
|
68
|
+
"@storybook/addon-essentials": "^8.3.6",
|
|
69
|
+
"@storybook/addon-interactions": "^8.3.6",
|
|
70
|
+
"@storybook/addon-links": "^8.3.6",
|
|
71
|
+
"@storybook/blocks": "^8.3.6",
|
|
72
|
+
"@storybook/react": "^8.3.6",
|
|
73
|
+
"@storybook/react-webpack5": "^8.3.6",
|
|
71
74
|
"@storybook/addon-webpack5-compiler-swc": "^1.0.4",
|
|
72
|
-
"@storybook/
|
|
73
|
-
"@storybook/react": "^8.2.2",
|
|
74
|
-
"@storybook/react-webpack5": "^8.2.2",
|
|
75
|
-
"@storybook/test": "^8.2.2",
|
|
75
|
+
"@storybook/test": "^8.3.6",
|
|
76
76
|
"@types/assert": "^1.5.1",
|
|
77
77
|
"@types/mdx": "^2.0.2",
|
|
78
78
|
"@types/mdx-js__react": "^1.5.1",
|
|
@@ -93,16 +93,16 @@
|
|
|
93
93
|
"eslint-plugin-import": "^2.27.5",
|
|
94
94
|
"eslint-plugin-prettier": "^5.0.1",
|
|
95
95
|
"eslint-plugin-promise": "^6.0.0",
|
|
96
|
-
"eslint-plugin-react": "
|
|
96
|
+
"eslint-plugin-react": "7.37.2",
|
|
97
97
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
98
98
|
"eslint-plugin-storybook": "^0.8.0",
|
|
99
|
-
"html-loader": "^
|
|
99
|
+
"html-loader": "^5.1.0",
|
|
100
100
|
"html-webpack-plugin": "^5.3.2",
|
|
101
101
|
"prettier": "^3",
|
|
102
102
|
"prop-types": "^15.8.1",
|
|
103
103
|
"react": "^18.0.1",
|
|
104
104
|
"react-dom": "^18.0.1",
|
|
105
|
-
"rollup": "^4.
|
|
105
|
+
"rollup": "^4.22.4",
|
|
106
106
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
107
107
|
"source-map-explorer": "^2.2.2",
|
|
108
108
|
"storybook": "^8.2.2",
|
|
@@ -125,6 +125,7 @@
|
|
|
125
125
|
"react-focus-lock": "^2.5.2",
|
|
126
126
|
"react-intersection-observer": "^9.1.0",
|
|
127
127
|
"react-is": "^18.2.0",
|
|
128
|
-
"styled-components": "^6.1.11"
|
|
128
|
+
"styled-components": "^6.1.11",
|
|
129
|
+
"release-it": "^17.10.0"
|
|
129
130
|
}
|
|
130
131
|
}
|