@cruk/cruk-react-components 5.0.4 → 5.0.6

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.
Files changed (64) hide show
  1. package/lib/components/Carousel/Dots.d.ts +1 -3
  2. package/lib/components/Modal/index.d.ts +3 -1
  3. package/lib/components/Modal/styles.d.ts +5 -3
  4. package/lib/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
  5. package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
  6. package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
  7. package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
  8. package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
  9. package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js.map +1 -1
  10. package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +1 -1
  11. package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +1 -1
  12. package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +1 -1
  13. package/lib/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
  14. package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
  15. package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +1 -1
  16. package/lib/node_modules/focus-lock/dist/es2015/utils/array.js.map +1 -1
  17. package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +1 -1
  18. package/lib/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +1 -1
  19. package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
  20. package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
  21. package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
  22. package/lib/node_modules/focus-lock/dist/es2015/utils/safe.js.map +1 -1
  23. package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +1 -1
  24. package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
  25. package/lib/node_modules/react-clientside-effect/lib/index.es.js.map +1 -1
  26. package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
  27. package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
  28. package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
  29. package/lib/node_modules/react-intersection-observer/dist/index.js.map +1 -1
  30. package/lib/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
  31. package/lib/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
  32. package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  33. package/lib/src/components/AddressLookup/index.js.map +1 -1
  34. package/lib/src/components/Avatar/index.js.map +1 -1
  35. package/lib/src/components/Box/styles.js.map +1 -1
  36. package/lib/src/components/Button/index.js.map +1 -1
  37. package/lib/src/components/Carousel/Dots.js +1 -1
  38. package/lib/src/components/Carousel/Dots.js.map +1 -1
  39. package/lib/src/components/Carousel/index.js.map +1 -1
  40. package/lib/src/components/Collapse/index.js.map +1 -1
  41. package/lib/src/components/Flex.js.map +1 -1
  42. package/lib/src/components/Fontface.js.map +1 -1
  43. package/lib/src/components/Footer/index.js.map +1 -1
  44. package/lib/src/components/GlobalStyle.js.map +1 -1
  45. package/lib/src/components/Heading/styles.js.map +1 -1
  46. package/lib/src/components/LabelWrapper/index.js.map +1 -1
  47. package/lib/src/components/LegendWrapper/index.js.map +1 -1
  48. package/lib/src/components/Modal/index.js +1 -1
  49. package/lib/src/components/Modal/index.js.map +1 -1
  50. package/lib/src/components/Modal/styles.js +1 -1
  51. package/lib/src/components/Modal/styles.js.map +1 -1
  52. package/lib/src/components/Pagination/index.js.map +1 -1
  53. package/lib/src/components/Pagination/styles.js.map +1 -1
  54. package/lib/src/components/PopOver/index.js.map +1 -1
  55. package/lib/src/components/ProgressBar/styles.js.map +1 -1
  56. package/lib/src/components/RadioConsent/index.js.map +1 -1
  57. package/lib/src/components/Text/styles.js.map +1 -1
  58. package/lib/src/hooks/useKey.js.map +1 -1
  59. package/lib/src/hooks/useScrollPosition.js.map +1 -1
  60. package/lib/src/themes/rfl.js.map +1 -1
  61. package/lib/src/themes/su2c.js.map +1 -1
  62. package/lib/src/utils/Helper.js.map +1 -1
  63. package/lib/src/utils/debounce.js.map +1 -1
  64. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/Heading/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\n\nimport {\n type ThemeType,\n type FontSizeType,\n type ColorKeyType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\n\ntype StyledHeadingProps = SpacingPropsInternal & {\n theme: ThemeType;\n $textSize?: FontSizeType;\n $textAlign?: \"left\" | \"right\" | \"center\";\n $textColor?: string;\n $wordBreak?: WordBreakType;\n $overflowWrap?: OverflowWrapType;\n};\n\nconst StyledHeading = (props: StyledHeadingProps) => css`\n font-family: ${props.theme.typography.fontFamilyHeadings};\n font-weight: ${props.theme.typography.fontWeightHeadings};\n word-break: ${props.$wordBreak || \"normal\"};\n overflow-wrap: ${props.$overflowWrap || \"break-word\"};\n color: ${props.$textColor &&\n typeof props.theme.colors[props.$textColor as ColorKeyType] !== \"undefined\"\n ? props.theme.colors[props.$textColor as ColorKeyType]\n : props.$textColor || props.theme.colors.textHeaderDefault};\n line-height: ${props.theme.typography.headerLineHeight};\n text-transform: ${props.theme.typography.headerTextTransform};\n margin-top: ${props.theme.spacing.m};\n margin-bottom: ${props.theme.spacing.s};\n max-width: 100%;\n text-align: ${props.$textAlign || \"left\"};\n\n &:first-child {\n margin-top: 0;\n }\n\n ${() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { theme, ...propsWithoutTheme } = props;\n\n return spacing(propsWithoutTheme, props.theme);\n }}\n`;\n\nconst desktopFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.xl;\n case \"xxl\":\n return theme.fontSizes.xxl;\n case \"xxxl\":\n return theme.fontSizes.xxxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down a size on the typography scale\nconst tabletFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.xl;\n case \"xxxl\":\n return theme.fontSizes.xxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down two sizes on the typography scale\nconst mobileFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.l;\n case \"xxxl\":\n return theme.fontSizes.xl;\n case \"xxxxl\":\n return theme.fontSizes.xxl;\n\n default:\n return defaultFontSize;\n }\n};\n\nexport const H1 = styled.h1<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxxl, theme)};\n }\n`;\n\nexport const H2 = styled.h2<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n`;\n\nexport const H3 = styled.h3<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n`;\n\nexport const H4 = styled.h4<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n`;\n\nexport const H5 = styled.h5<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n`;\n\nexport const H6 = styled.h6<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.m, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n`;\n"],"names":["StyledHeading","props","css","templateObject_1","__makeTemplateObject","theme","typography","fontFamilyHeadings","fontWeightHeadings","$wordBreak","$overflowWrap","$textColor","colors","textHeaderDefault","headerLineHeight","headerTextTransform","spacing","m","s","$textAlign","propsWithoutTheme","__rest","desktopFontSize","$textSize","defaultFontSize","fontSizes","l","xl","xxl","xxxl","xxxxl","tabletFontSize","mobileFontSize","H1","styled","h1","templateObject_2","_a","breakpoint","tablet","desktop","H2","h2","templateObject_3","H3","h3","templateObject_4","H4","h4","templateObject_5","H5","h5","templateObject_6","H6","h6","templateObject_7"],"mappings":"qLAqBA,kBAAMA,EAAgB,SAACC,GAA8B,OAAAC,EAAGC,IAAAA,EAAAC,EAAA,CAAA,oBAAA,qBAAA,oBAAA,uBAAA,eAAA,qBAAA,wBAAA,oBAAA,uBAAA,wCAAA,wDAAA,MAAA,CAAA,oBACE,qBACA,oBACd,uBACU,eAIQ,qBACN,wBACM,oBACzB,uBACG,wCAEE,wDAWvC,QAxBcH,EAAMI,MAAMC,WAAWC,mBACvBN,EAAMI,MAAMC,WAAWE,mBACxBP,EAAMQ,YAAc,SACjBR,EAAMS,eAAiB,aAC/BT,EAAMU,iBACiD,IAAzDV,EAAMI,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gC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAS,EAAeT,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAArD,IACmB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWC,MAAjB,IACrB,SAACF,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAQ,EAAeR,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAArD,IAEiB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWE,OAAjB,IACrB,SAACH,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAD,EAAgBC,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAAtD"}
1
+ {"version":3,"file":"styles.js","sources":["../../../../src/components/Heading/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\n\nimport {\n type ThemeType,\n type FontSizeType,\n type ColorKeyType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\n\ntype StyledHeadingProps = SpacingPropsInternal & {\n theme: ThemeType;\n $textSize?: FontSizeType;\n $textAlign?: \"left\" | \"right\" | \"center\";\n $textColor?: string;\n $wordBreak?: WordBreakType;\n $overflowWrap?: OverflowWrapType;\n};\n\nconst StyledHeading = (props: StyledHeadingProps) => css`\n font-family: ${props.theme.typography.fontFamilyHeadings};\n font-weight: ${props.theme.typography.fontWeightHeadings};\n word-break: ${props.$wordBreak || \"normal\"};\n overflow-wrap: ${props.$overflowWrap || \"break-word\"};\n color: ${props.$textColor &&\n typeof props.theme.colors[props.$textColor as ColorKeyType] !== \"undefined\"\n ? props.theme.colors[props.$textColor as ColorKeyType]\n : props.$textColor || props.theme.colors.textHeaderDefault};\n line-height: ${props.theme.typography.headerLineHeight};\n text-transform: ${props.theme.typography.headerTextTransform};\n margin-top: ${props.theme.spacing.m};\n margin-bottom: ${props.theme.spacing.s};\n max-width: 100%;\n text-align: ${props.$textAlign || \"left\"};\n\n &:first-child {\n margin-top: 0;\n }\n\n ${() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { theme, ...propsWithoutTheme } = props;\n\n return spacing(propsWithoutTheme, props.theme);\n }}\n`;\n\nconst desktopFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.xl;\n case \"xxl\":\n return theme.fontSizes.xxl;\n case \"xxxl\":\n return theme.fontSizes.xxxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down a size on the typography scale\nconst tabletFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.xl;\n case \"xxxl\":\n return theme.fontSizes.xxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down two sizes on the typography scale\nconst mobileFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.l;\n case \"xxxl\":\n return theme.fontSizes.xl;\n case \"xxxxl\":\n return theme.fontSizes.xxl;\n\n default:\n return defaultFontSize;\n }\n};\n\nexport const H1 = styled.h1<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxxl, theme)};\n }\n`;\n\nexport const H2 = styled.h2<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n`;\n\nexport const H3 = styled.h3<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n`;\n\nexport const H4 = styled.h4<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n`;\n\nexport const H5 = styled.h5<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n`;\n\nexport const H6 = styled.h6<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.m, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n`;\n"],"names":["StyledHeading","props","css","templateObject_1","__makeTemplateObject","theme","typography","fontFamilyHeadings","fontWeightHeadings","$wordBreak","$overflowWrap","$textColor","colors","textHeaderDefault","headerLineHeight","headerTextTransform","spacing","m","s","$textAlign","propsWithoutTheme","__rest","desktopFontSize","$textSize","defaultFontSize","fontSizes","l","xl","xxl","xxxl","xxxxl","tabletFontSize","mobileFontSize","H1","styled","h1","templateObject_2","_a","breakpoint","tablet","desktop","H2","h2","templateObject_3","H3","h3","templateObject_4","H4","h4","templateObject_5","H5","h5","templateObject_6","H6","h6","templateObject_7"],"mappings":"qLAqBA,kBAAMA,EAAgB,SAACC,GAA8B,OAAAC,EAAGC,IAAAA,EAAAC,EAAA,CAAA,oBAAA,qBAAA,oBAAA,uBAAA,eAAA,qBAAA,wBAAA,oBAAA,uBAAA,wCAAA,wDAAA,MAAA,CAAA,oBACE,qBACA,oBACd,uBACU,eAIQ,q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AA,EAAAnD,EAAA,CAAA,OAAA,oBAAA,2BAAA,uBAAA,gCAAA,uBAAA,YAAA,CAAA,OACZ,oBAG4B,2BACF,uBAEI,gCAEH,uBAEI,eAV9D,SAACH,GAAU,OAAAD,EAAcC,EAAM,IAEpB,SAACoC,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAS,EAAeT,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAArD,IACmB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWC,MAAjB,IACrB,SAACF,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAQ,EAAeR,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAArD,IAEiB,SAACgC,GAAc,OAAPA,EAAAhC,MAAaiC,WAAWE,OAAjB,IACrB,SAACH,OAAEhC,EAAKgC,EAAAhC,MAAEkB,EAASc,EAAAd,UAC9B,OAAAD,EAAgBC,GAAa,KAAMlB,EAAMoB,UAAUR,EAAGZ,EAAtD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/LabelWrapper/index.tsx"],"sourcesContent":["import React, { type LabelHTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { Text } from \"../Text\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { LabelText, Label, RequiredText } from \"./styles\";\n\ntype LabelWrapperProps = LabelHTMLAttributes<HTMLLabelElement> & {\n /** label text */\n label: string;\n /** hint text or react element in it's place */\n hintText?: ReactNode;\n /** when required (required) appears in label */\n required?: boolean;\n /** flag to stop (required) appearing in label, useful for compound form components like DateInput */\n hideRequiredInLabel?: boolean;\n children?: ReactNode;\n};\n\nexport function LabelWrapper({\n label,\n hintText,\n required = false,\n hideRequiredInLabel = false,\n children,\n ...otherHTMLLabelProps\n}: LabelWrapperProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const hintTextElement =\n !!hintText &&\n ((typeof hintText === \"string\" && hintText.length) ||\n typeof hintText === \"number\") ? (\n <Text>{hintText}</Text>\n ) : (\n hintText\n );\n\n return (\n <ThemeProvider theme={theme}>\n {label ? (\n <Label {...otherHTMLLabelProps}>\n <LabelText $hasHintText={!!hintText}>\n {label}\n {required && !hideRequiredInLabel && (\n <RequiredText>{` (required)`}</RequiredText>\n )}\n </LabelText>\n {hintTextElement}\n {children}\n </Label>\n ) : (\n <>{children}</>\n )}\n </ThemeProvider>\n );\n}\n\nexport default LabelWrapper;\n"],"names":["LabelWrapper","_a","label","hintText","_b","required","_c","hideRequiredInLabel","children","otherHTMLLabelProps","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","hintTextElement","length","React","createElement","Text","ThemeProvider","Label","LabelText","$hasHintText","RequiredText","Fragment"],"mappings":"mUAoBM,SAAUA,EAAaC,GAC3B,IAAAC,EAAKD,EAAAC,MACLC,EAAQF,EAAAE,SACRC,EAAAH,EAAAI,SAAAA,OAAW,IAAAD,GAAKA,EAChBE,wBAAAC,OAAsB,IAAAD,GAAKA,EAC3BE,EAAQP,EAAAO,SACLC,EANwBC,EAAAT,EAAA,CAAA,QAAA,WAAA,WAAA,sBAAA,aAQrBU,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EACFb,IACoB,iBAAbA,GAAyBA,EAASc,QACrB,iBAAbd,GACPe,EAACC,cAAAC,OAAMjB,GAEP,EAGJ,OACEe,EAACC,cAAAE,EAAc,CAAAR,MAAOA,GACnBX,EACCgB,EAACC,cAAAG,OAAUb,GACTS,EAAAC,cAACI,EAAS,CAAAC,eAAiBrB,GACxBD,EACAG,IAAaE,GACZW,EAACC,cAAAM,EAAc,KAAA,gBAGlBT,EACAR,GAGHU,EAAGC,cAAAD,EAAAQ,SAAA,KAAAlB,GAIX"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/LabelWrapper/index.tsx"],"sourcesContent":["import React, { type LabelHTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { Text } from \"../Text\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { LabelText, Label, RequiredText } from \"./styles\";\n\ntype LabelWrapperProps = LabelHTMLAttributes<HTMLLabelElement> & {\n /** label text */\n label: string;\n /** hint text or react element in it's place */\n hintText?: ReactNode;\n /** when required (required) appears in label */\n required?: boolean;\n /** flag to stop (required) appearing in label, useful for compound form components like DateInput */\n hideRequiredInLabel?: boolean;\n children?: ReactNode;\n};\n\nexport function LabelWrapper({\n label,\n hintText,\n required = false,\n hideRequiredInLabel = false,\n children,\n ...otherHTMLLabelProps\n}: LabelWrapperProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const hintTextElement =\n !!hintText &&\n ((typeof hintText === \"string\" && hintText.length) ||\n typeof hintText === \"number\") ? (\n <Text>{hintText}</Text>\n ) : (\n hintText\n );\n\n return (\n <ThemeProvider theme={theme}>\n {label ? (\n <Label {...otherHTMLLabelProps}>\n <LabelText $hasHintText={!!hintText}>\n {label}\n {required && !hideRequiredInLabel && (\n <RequiredText>{` (required)`}</RequiredText>\n )}\n </LabelText>\n {hintTextElement}\n {children}\n </Label>\n ) : (\n <>{children}</>\n )}\n </ThemeProvider>\n );\n}\n\nexport default LabelWrapper;\n"],"names":["LabelWrapper","_a","label","hintText","_b","required","_c","hideRequiredInLabel","children","otherHTMLLabelProps","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","hintTextElement","length","React","createElement","Text","ThemeProvider","Label","LabelText","$hasHintText","RequiredText","Fragment"],"mappings":"mUAoBM,SAAUA,EAAaC,GAC3B,IAAAC,EAAKD,EAAAC,MACLC,EAAQF,EAAAE,SACRC,EAAAH,EAAAI,SAAAA,OAAW,IAAAD,GAAKA,EAChBE,wBAAAC,OAAsB,IAAAD,GAAKA,EAC3BE,EAAQP,EAAAO,SACLC,EANwBC,EAAAT,EAAA,CAAA,QAAA,WAAA,WAAA,sBAAA,aAQrBU,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EACFb,IACoB,iBAAbA,GAAyBA,EAASc,QACrB,iBAAbd,GACPe,EAACC,cAAAC,OAAMjB,GAAgB,EAK3B,OACEe,EAACC,cAAAE,EAAc,CAAAR,MAAOA,GACnBX,EACCgB,EAACC,cAAAG,OAAUb,GACTS,EAAAC,cAACI,EAAS,CAAAC,eAAiBrB,GACxBD,EACAG,IAAaE,GACZW,EAACC,cAAAM,EAAc,KAAA,gBAGlBT,EACAR,GAGHU,EAAGC,cAAAD,EAAAQ,SAAA,KAAAlB,GAIX"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/LegendWrapper/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { ErrorText } from \"../ErrorText\";\nimport { Text } from \"../Text\";\n\nimport { StyledFieldset, LegendSpan } from \"./styles\";\n\nexport type LegendWrapperProps = HTMLAttributes<HTMLLegendElement> & {\n children?: ReactNode;\n /** legend text */\n legendText: string;\n /** error message text */\n errorMessage?: string;\n /** flag for error styling */\n hasError?: boolean;\n /** when required (required) appears in legend */\n required?: boolean;\n /** hint text */\n hintText?: ReactNode;\n};\n/**\n * LegendWrapper allows the user to add an outer label for a checkbox / group of checkboxes / radio buttons or a group of radio buttons.\n *\n * hasError and errorMessage props are just props that can be passed into the component.\n * There is no functionality checking if the children are valid/required etc this functionality will be needed to ne added outside of this component.\n */\nexport function LegendWrapper({\n children,\n legendText,\n required,\n errorMessage,\n hasError,\n hintText,\n ...restOfHTMLAttributes\n}: LegendWrapperProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const hintTextElement =\n !!hintText &&\n (typeof hintText === \"string\" || typeof hintText === \"number\") ? (\n <Text as=\"span\">{hintText}</Text>\n ) : (\n hintText\n );\n return (\n <ThemeProvider theme={theme}>\n <StyledFieldset\n $hasError={hasError || !!errorMessage || false}\n $hasHintText={!!hintText}\n >\n {legendText && (\n <legend {...restOfHTMLAttributes}>\n <LegendSpan $hasHintText={!!hintText}>\n {legendText} {required && <span>(required)</span>}\n </LegendSpan>\n {hintTextElement}\n </legend>\n )}\n {children}\n {!!errorMessage && (\n <ErrorText marginTop=\"xxs\">{errorMessage}</ErrorText>\n )}\n </StyledFieldset>\n </ThemeProvider>\n );\n}\n\nexport default LegendWrapper;\n"],"names":["LegendWrapper","_a","children","legendText","required","errorMessage","hasError","hintText","restOfHTMLAttributes","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","hintTextElement","React","createElement","Text","as","ThemeProvider","StyledFieldset","$hasError","$hasHintText","LegendSpan","ErrorText","marginTop"],"mappings":"6WA4BM,SAAUA,EAAcC,GAC5B,IAAAC,aACAC,eACAC,aACAC,iBACAC,aACAC,aACGC,EAPyBC,EAAAR,EAAA,CAAA,WAAA,aAAA,WAAA,eAAA,WAAA,aAStBS,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,GACFR,GACmB,iBAAbA,GAA6C,iBAAbA,EACL,EAAjCS,EAAAC,cAACC,EAAI,CAACC,GAAG,QAAQZ,GAIrB,OACES,EAACC,cAAAG,EAAc,CAAAR,MAAOA,GACpBI,EAAAC,cAACI,EAAc,CAAAC,UACFhB,KAAcD,IAAgB,EAAKkB,eAC9BhB,GAEfJ,GACCa,EAAAC,cAAA,SAAAJ,EAAA,CAAA,EAAYL,GACVQ,EAAAC,cAACO,EAAU,CAAAD,eAAiBhB,GACzBJ,MAAaC,GAAYY,2CAE3BD,GAGJb,IACEG,GACDW,EAAAC,cAACQ,EAAU,CAAAC,UAAU,OAAOrB,IAKtC"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/LegendWrapper/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { ErrorText } from \"../ErrorText\";\nimport { Text } from \"../Text\";\n\nimport { StyledFieldset, LegendSpan } from \"./styles\";\n\nexport type LegendWrapperProps = HTMLAttributes<HTMLLegendElement> & {\n children?: ReactNode;\n /** legend text */\n legendText: string;\n /** error message text */\n errorMessage?: string;\n /** flag for error styling */\n hasError?: boolean;\n /** when required (required) appears in legend */\n required?: boolean;\n /** hint text */\n hintText?: ReactNode;\n};\n/**\n * LegendWrapper allows the user to add an outer label for a checkbox / group of checkboxes / radio buttons or a group of radio buttons.\n *\n * hasError and errorMessage props are just props that can be passed into the component.\n * There is no functionality checking if the children are valid/required etc this functionality will be needed to ne added outside of this component.\n */\nexport function LegendWrapper({\n children,\n legendText,\n required,\n errorMessage,\n hasError,\n hintText,\n ...restOfHTMLAttributes\n}: LegendWrapperProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const hintTextElement =\n !!hintText &&\n (typeof hintText === \"string\" || typeof hintText === \"number\") ? (\n <Text as=\"span\">{hintText}</Text>\n ) : (\n hintText\n );\n return (\n <ThemeProvider theme={theme}>\n <StyledFieldset\n $hasError={hasError || !!errorMessage || false}\n $hasHintText={!!hintText}\n >\n {legendText && (\n <legend {...restOfHTMLAttributes}>\n <LegendSpan $hasHintText={!!hintText}>\n {legendText} {required && <span>(required)</span>}\n </LegendSpan>\n {hintTextElement}\n </legend>\n )}\n {children}\n {!!errorMessage && (\n <ErrorText marginTop=\"xxs\">{errorMessage}</ErrorText>\n )}\n </StyledFieldset>\n </ThemeProvider>\n );\n}\n\nexport default LegendWrapper;\n"],"names":["LegendWrapper","_a","children","legendText","required","errorMessage","hasError","hintText","restOfHTMLAttributes","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","hintTextElement","React","createElement","Text","as","ThemeProvider","StyledFieldset","$hasError","$hasHintText","LegendSpan","ErrorText","marginTop"],"mappings":"6WA4BM,SAAUA,EAAcC,GAC5B,IAAAC,aACAC,eACAC,aACAC,iBACAC,aACAC,aACGC,EAPyBC,EAAAR,EAAA,CAAA,WAAA,aAAA,WAAA,eAAA,WAAA,aAStBS,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,GACFR,GACmB,iBAAbA,GAA6C,iBAAbA,EAGtC,EAFAS,EAAAC,cAACC,EAAI,CAACC,GAAG,QAAQZ,GAIrB,OACES,EAACC,cAAAG,EAAc,CAAAR,MAAOA,GACpBI,EAAAC,cAACI,EAAc,CAAAC,UACFhB,KAAcD,IAAgB,EAAKkB,eAC9BhB,GAEfJ,GACCa,EAAAC,cAAA,SAAAJ,EAAA,CAAA,EAAYL,GACVQ,EAAAC,cAACO,EAAU,CAAAD,eAAiBhB,GACzBJ,MAAaC,GAAYY,2CAE3BD,GAGJb,IACEG,GACDW,EAAAC,cAACQ,EAAU,CAAAC,UAAU,OAAOrB,IAKtC"}
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import o,{useEffect as n}from"react";import{createPortal as t}from"react-dom";import{useTheme as i,ThemeProvider as r}from"styled-components";import d from"../../../node_modules/react-focus-lock/dist/es2015/Combination.js";import{faClose as a}from"../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";import{IconFa as m}from"../IconFa/index.js";import{crukTheme as l}from"../../themes/cruk.js";import{Wrapper as c,Content as g,CloseButton as p,Background as s}from"./styles.js";function u(u){var f=u.modalName,h=u.closeFunction,w=u.showCloseButton,y=u.maxWidth,v=void 0===y?"500px":y,E=u.top,b=void 0===E?"1rem":E,k=u.backgroundColor,x=void 0===k?"backgroundLight":k,L=u.children,j=u.width,B=void 0===j?"90%":j,C=u.margin,z=u.marginHorizontal,F=u.marginVertical,H=u.marginTop,R=u.marginRight,T=u.marginBottom,V=void 0===T?"xxl":T,$=u.marginLeft,_=u.padding,I=void 0===_?"xs":_,W=u.paddingHorizontal,N=u.paddingVertical,q=u.paddingTop,A=u.paddingRight,D=u.paddingBottom,G=u.paddingLeft,J=i(),K=e(e({},l),J),M=function(e){"Escape"===e.key&&h&&h()};return n((function(){if("undefined"!=typeof window)return document.body.style.overflow="hidden",document.addEventListener("keydown",M),function(){"undefined"!=typeof window&&(document.body.style.overflow="unset",document.removeEventListener("keydown",M))}}),[]),o.createElement(o.Fragment,null,"undefined"!=typeof window?t(o.createElement("section",null,o.createElement(d,{returnFocus:!0},o.createElement(r,{theme:K},o.createElement(c,{role:"dialog","aria-modal":"true","aria-label":f},o.createElement(g,{backgroundColor:x,$maxWidth:v,$width:B,$top:b,margin:C,marginHorizontal:z,marginVertical:F,marginTop:H,marginRight:R,marginBottom:V,marginLeft:$,padding:I,paddingHorizontal:W,paddingVertical:N,paddingTop:q,paddingRight:A,paddingBottom:D,paddingLeft:G},w&&h?o.createElement(p,{"aria-label":"close",appearance:"tertiary",onClick:function(){h()}},o.createElement(m,{faIcon:a})):null,L),o.createElement(s,null))))),document.body):null)}export{u as Modal,u as default};
1
+ import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import o,{useEffect as t}from"react";import{createPortal as n}from"react-dom";import{useTheme as i,ThemeProvider as d}from"styled-components";import r from"../../../node_modules/react-focus-lock/dist/es2015/Combination.js";import{faClose as a}from"../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";import{IconFa as m}from"../IconFa/index.js";import{crukTheme as l}from"../../themes/cruk.js";import{Wrapper as c,Content as s,CloseButton as g,Background as p}from"./styles.js";function u(u){var f=u.modalName,h=u.closeFunction,v=u.showCloseButton,w=u.maxWidth,y=void 0===w?"500px":w,E=u.top,b=void 0===E?"1rem":E,k=u.backgroundColor,x=void 0===k?"backgroundLight":k,L=u.children,j=u.width,B=void 0===j?"90%":j,C=u.margin,$=u.marginHorizontal,z=u.marginVertical,F=u.marginTop,H=u.marginRight,R=u.marginBottom,T=void 0===R?"xxl":R,V=u.marginLeft,A=u.padding,_=void 0===A?"xs":A,I=u.paddingHorizontal,W=u.paddingVertical,N=u.paddingTop,q=u.paddingRight,D=u.paddingBottom,G=u.paddingLeft,J=u.isAnimated,K=void 0===J||J,M=i(),O=e(e({},l),M),P=function(e){"Escape"===e.key&&h&&h()};return t((function(){if("undefined"!=typeof window)return document.body.style.overflow="hidden",document.addEventListener("keydown",P),function(){"undefined"!=typeof window&&(document.body.style.overflow="unset",document.removeEventListener("keydown",P))}}),[]),o.createElement(o.Fragment,null,"undefined"!=typeof window?n(o.createElement("section",null,o.createElement(r,{returnFocus:!0},o.createElement(d,{theme:O},o.createElement(c,{role:"dialog","aria-modal":"true","aria-label":f},o.createElement(s,{backgroundColor:x,$maxWidth:y,$width:B,$top:b,margin:C,marginHorizontal:$,marginVertical:z,marginTop:F,marginRight:H,marginBottom:T,marginLeft:V,padding:_,paddingHorizontal:I,paddingVertical:W,paddingTop:N,paddingRight:q,paddingBottom:D,paddingLeft:G,$isAnimated:K},v&&h?o.createElement(g,{"aria-label":"close",appearance:"tertiary",onClick:function(){h()}},o.createElement(m,{faIcon:a})):null,L),o.createElement(p,{$isAnimated:K}))))),document.body):null)}export{u as Modal,u as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Modal/index.tsx"],"sourcesContent":["import React, { type ReactNode, useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ThemeProvider, useTheme } from \"styled-components\";\nimport FocusLock from \"react-focus-lock\";\nimport { faClose } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { IconFa } from \"../IconFa\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { CloseButton, Wrapper, Content, Background } from \"./styles\";\n\nimport { type SpacingProps } from \"../Spacing\";\n\nexport type ModalProps = SpacingProps & {\n /** modal name used for aria-label */\n modalName: string;\n /** callback function called on modal close */\n closeFunction: () => void;\n /** flag to reveal close button with cross in the top right of modal */\n showCloseButton?: boolean;\n /** set max width of modal */\n maxWidth?: string;\n /** set space from top of view port that modal appears */\n top?: string;\n /** background color of dialogue */\n backgroundColor?: string;\n /** children components */\n children?: ReactNode;\n /** width of modal */\n width?: string;\n};\n\n/**\n *\n * Use a modal to display content over top of the rest of the site which must be interacted with before the user can continue.\n * ## How modals work\n * - Modals are positioned over everything else in the document and remove scroll from the \"body\" tag so that modal content scrolls instead.\n * - Modals are unmounted when closed.\n * - Modal's \"trap\" focus in them, ensuring the keyboard navigation cycles through the modal, and not the rest of the page.\n * ## Accessibility\n * - Once the Modal is appeared on the screen, the focus must be within the Modal container which will enable the screen readers to be able to navigate within the Modal. You may wish to hide the close button so that a user must click on another button to confirm a choice before the modal is closed. However closing with the 'ESC' key must always work, so the props which contains the function that allows the modal to close itself 'closeFunction' is always required.\n */\nexport function Modal({\n modalName,\n closeFunction,\n showCloseButton,\n maxWidth = \"500px\",\n top = \"1rem\",\n backgroundColor = \"backgroundLight\",\n children,\n width = \"90%\",\n margin,\n marginHorizontal,\n marginVertical,\n marginTop,\n marginRight,\n marginBottom = \"xxl\",\n marginLeft,\n padding = \"xs\",\n paddingHorizontal,\n paddingVertical,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n}: ModalProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const closeByEsc = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\" && !!closeFunction) {\n closeFunction();\n }\n };\n\n useEffect(() => {\n if (typeof window === `undefined`) {\n return undefined;\n }\n document.body.style.overflow = \"hidden\";\n document.addEventListener(\"keydown\", closeByEsc);\n\n return () => {\n if (typeof window === `undefined`) {\n return;\n }\n document.body.style.overflow = \"unset\";\n document.removeEventListener(\"keydown\", closeByEsc);\n };\n }, []);\n\n return (\n <>\n {typeof window !== `undefined`\n ? createPortal(\n <section>\n <FocusLock returnFocus>\n <ThemeProvider theme={theme}>\n <Wrapper\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={modalName}\n >\n <Content\n backgroundColor={backgroundColor}\n $maxWidth={maxWidth}\n $width={width}\n $top={top}\n margin={margin}\n marginHorizontal={marginHorizontal}\n marginVertical={marginVertical}\n marginTop={marginTop}\n marginRight={marginRight}\n marginBottom={marginBottom}\n marginLeft={marginLeft}\n padding={padding}\n paddingHorizontal={paddingHorizontal}\n paddingVertical={paddingVertical}\n paddingTop={paddingTop}\n paddingRight={paddingRight}\n paddingBottom={paddingBottom}\n paddingLeft={paddingLeft}\n >\n {showCloseButton && closeFunction ? (\n <CloseButton\n aria-label=\"close\"\n appearance=\"tertiary\"\n onClick={() => {\n closeFunction();\n }}\n >\n <IconFa faIcon={faClose} />\n </CloseButton>\n ) : null}\n {children}\n </Content>\n <Background />\n </Wrapper>\n </ThemeProvider>\n </FocusLock>\n </section>,\n document.body,\n )\n : null}\n </>\n );\n}\n\nexport default Modal;\n"],"names":["Modal","_a","modalName","closeFunction","showCloseButton","_b","maxWidth","_c","top","_d","backgroundColor","children","_e","width","margin","marginHorizontal","marginVertical","marginTop","marginRight","_f","marginBottom","marginLeft","_g","padding","paddingHorizontal","paddingVertical","paddingTop","paddingRight","paddingBottom","paddingLeft","foundTheme","useTheme","theme","__assign","defaultTheme","closeByEsc","event","key","useEffect","window","document","body","style","overflow","addEventListener","removeEventListener","React","createElement","Fragment","createPortal","FocusLock","returnFocus","ThemeProvider","Wrapper","role","Content","$maxWidth","$width","$top","CloseButton","appearance","onClick","IconFa","faIcon","faClose","Background"],"mappings":"+iBA0CM,SAAUA,EAAMC,GACpB,IAAAC,cACAC,kBACAC,oBACAC,EAAAJ,EAAAK,SAAAA,aAAW,QAAOD,EAClBE,EAAYN,EAAAO,IAAZA,OAAM,IAAAD,EAAA,OAAMA,EACZE,oBAAAC,aAAkB,kBAAiBD,EACnCE,EAAQV,EAAAU,SACRC,EAAaX,EAAAY,MAAbA,OAAQ,IAAAD,EAAA,QACRE,W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,WAAW,WACXC,QAAS,WACP1D,MAGF2C,EAACC,cAAAe,EAAO,CAAAC,OAAQC,KAEhB,KACHrD,GAEHmC,EAACC,cAAAkB,EAAa,UAKtBzB,SAASC,MAEX,KAGV"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Modal/index.tsx"],"sourcesContent":["import React, { type ReactNode, useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ThemeProvider, useTheme } from \"styled-components\";\nimport FocusLock from \"react-focus-lock\";\nimport { faClose } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { IconFa } from \"../IconFa\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { CloseButton, Wrapper, Content, Background } from \"./styles\";\n\nimport { type SpacingProps } from \"../Spacing\";\n\nexport type ModalProps = SpacingProps & {\n /** modal name used for aria-label */\n modalName: string;\n /** callback function called on modal close */\n closeFunction: () => void;\n /** flag to reveal close button with cross in the top right of modal */\n showCloseButton?: boolean;\n /** set max width of modal */\n maxWidth?: string;\n /** set space from top of view port that modal appears */\n top?: string;\n /** background color of dialogue */\n backgroundColor?: string;\n /** children components */\n children?: ReactNode;\n /** width of modal */\n width?: string;\n /** turn on animate in modal */\n isAnimated?: boolean;\n};\n\n/**\n *\n * Use a modal to display content over top of the rest of the site which must be interacted with before the user can continue.\n * ## How modals work\n * - Modals are positioned over everything else in the document and remove scroll from the \"body\" tag so that modal content scrolls instead.\n * - Modals are unmounted when closed.\n * - Modal's \"trap\" focus in them, ensuring the keyboard navigation cycles through the modal, and not the rest of the page.\n * ## Accessibility\n * - Once the Modal is appeared on the screen, the focus must be within the Modal container which will enable the screen readers to be able to navigate within the Modal. You may wish to hide the close button so that a user must click on another button to confirm a choice before the modal is closed. However closing with the 'ESC' key must always work, so the props which contains the function that allows the modal to close itself 'closeFunction' is always required.\n */\nexport function Modal({\n modalName,\n closeFunction,\n showCloseButton,\n maxWidth = \"500px\",\n top = \"1rem\",\n backgroundColor = \"backgroundLight\",\n children,\n width = \"90%\",\n margin,\n marginHorizontal,\n marginVertical,\n marginTop,\n marginRight,\n marginBottom = \"xxl\",\n marginLeft,\n padding = \"xs\",\n paddingHorizontal,\n paddingVertical,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n isAnimated = true,\n}: ModalProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const closeByEsc = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\" && !!closeFunction) {\n closeFunction();\n }\n };\n\n useEffect(() => {\n if (typeof window === `undefined`) {\n return undefined;\n }\n document.body.style.overflow = \"hidden\";\n document.addEventListener(\"keydown\", closeByEsc);\n\n return () => {\n if (typeof window === `undefined`) {\n return;\n }\n document.body.style.overflow = \"unset\";\n document.removeEventListener(\"keydown\", closeByEsc);\n };\n }, []);\n\n return (\n <>\n {typeof window !== `undefined`\n ? createPortal(\n <section>\n <FocusLock returnFocus>\n <ThemeProvider theme={theme}>\n <Wrapper\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={modalName}\n >\n <Content\n backgroundColor={backgroundColor}\n $maxWidth={maxWidth}\n $width={width}\n $top={top}\n margin={margin}\n marginHorizontal={marginHorizontal}\n marginVertical={marginVertical}\n marginTop={marginTop}\n marginRight={marginRight}\n marginBottom={marginBottom}\n marginLeft={marginLeft}\n padding={padding}\n paddingHorizontal={paddingHorizontal}\n paddingVertical={paddingVertical}\n paddingTop={paddingTop}\n paddingRight={paddingRight}\n paddingBottom={paddingBottom}\n paddingLeft={paddingLeft}\n $isAnimated={isAnimated}\n >\n {showCloseButton && closeFunction ? (\n <CloseButton\n aria-label=\"close\"\n appearance=\"tertiary\"\n onClick={() => {\n closeFunction();\n }}\n >\n <IconFa faIcon={faClose} />\n </CloseButton>\n ) : null}\n {children}\n </Content>\n <Background $isAnimated={isAnimated} />\n </Wrapper>\n </ThemeProvider>\n </FocusLock>\n </section>,\n document.body,\n )\n : null}\n </>\n );\n}\n\nexport default Modal;\n"],"names":["Modal","_a","modalName","closeFunction","showCloseButton","_b","maxWidth","_c","top","_d","backgroundColor","children","_e","width","margin","marginHorizontal","marginVertical","marginTop","marginRight","_f","marginBottom","marginLeft","_g","padding","paddingHorizontal","paddingVertical","paddingTop","paddingRight","paddingBottom","paddingLeft","_h","isAnimated","foundTheme","useTheme","theme","__assign","defaultTheme","closeByEsc","event","key","useEffect","window","document","body","style","overflow","addEventListener","removeEventListener","React","createElement","Fragment","createPortal","FocusLock","returnFocus","ThemeProvider","Wrapper","role","Content","$maxWidth","$width","$top","CloseButton","appearance","onClick","IconFa","faIcon","faClose","Background","$isAnimated"],"mappings":"+iBA4CM,SAAUA,EAAMC,OACpBC,EAASD,EAAAC,UACTC,EAAaF,EAAAE,cACbC,EAAeH,EAAAG,gBACfC,EAAkBJ,EAAAK,SAAlBA,OAAW,IAAAD,EAAA,UACXE,EAAAN,EAAAO,IAAAA,OAAG,IAAAD,EAAG,OAAMA,EACZE,oBAAAC,aAAkB,kBAAiBD,EACnCE,EAAQV,EAAAU,SACRC,EAAaX,EAAAY,MAAbA,OAAQ,IAAAD,EAAA,QACRE,WACAC,EAAgBd,EAAAc,iBAChBC,EAAcf,EAAAe,eACdC,EAAShB,EAAAgB,UACTC,EAAWjB,EAAAiB,YACXC,EAAoBlB,EAAAmB,aAApBA,OAAe,IAAAD,EAAA,QACfE,eACAC,EAAArB,EAAAsB,QAAAA,OAAO,IAAAD,EAAG,KAAIA,EACdE,EAAiBvB,EAAAuB,kBACjBC,EAAexB,EAAAwB,gBACfC,EAAUzB,EAAAyB,WACVC,EAAY1B,EAAA0B,aACZC,EAAa3B,EAAA2B,cACbC,EAAW5B,EAAA4B,YACXC,eAAAC,OAAa,IAAAD,GAAIA,EAEXE,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAECK,EAAa,SAACC,GACA,WAAdA,EAAMC,KAAsBpC,GAC9BA,GAEH,EAkBD,OAhBAqC,GAAU,WACR,GAAsB,oBAAXC,OAMX,OAHAC,SAASC,KAAKC,MAAMC,SAAW,SAC/BH,SAASI,iBAAiB,UAAWT,GAE9B,WACiB,oBAAXI,SAGXC,SAASC,KAAKC,MAAMC,SAAW,QAC/BH,SAASK,oBAAoB,UAAWV,GACzC,CACF,GAAE,IAGDW,EAAAC,cAAAD,EAAAE,SAAA,KACqB,oBAAXT,OACJU,EACEH,EAAAC,cAAA,UAAA,KACED,EAACC,cAAAG,GAAUC,aAAW,GACpBL,EAAAC,cAACK,EAAa,CAACpB,MAAOA,GACpBc,EAACC,cAAAM,GACCC,KAAK,SACM,aAAA,oBACCtD,GAEZ8C,EAAAC,cAACQ,EAAO,CACN/C,gBAAiBA,EACNgD,UAAApD,EACHqD,OAAA9C,EACF+C,KAAApD,EACNM,OAAQA,EACRC,iBAAkBA,EAClBC,eAAgBA,EAChBC,UAAWA,EACXC,YAAaA,EACbE,aAAcA,EACdC,WAAYA,EACZE,QAASA,EACTC,kBAAmBA,EACnBC,gBAAiBA,EACjBC,WAAYA,EACZC,aAAcA,EACdC,cAAeA,EACfC,YAAaA,cACAE,GAEZ3B,GAAmBD,EAClB6C,EAACC,cAAAY,EACY,CAAA,aAAA,QACXC,WAAW,WACXC,QAAS,WACP5D,MAGF6C,EAACC,cAAAe,EAAO,CAAAC,OAAQC,KAEhB,KACHvD,GAEHqC,EAAAC,cAACkB,EAAU,CAAAC,YAAcrC,QAKjCW,SAASC,MAEX,KAGV"}
@@ -1,2 +1,2 @@
1
- import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o from"styled-components";import{Box as t}from"../Box/index.js";import{Button as i}from"../Button/index.js";var r,e,d,a,m=o.div(r||(r=n(["\n background: ",";\n bottom: 0;\n left: 0;\n opacity: 0.5;\n position: fixed;\n right: 0;\n top: 0;\n transition:\n opacity 0.3s,\n bottom 0s 0.3s;\n z-index: 100;\n"],["\n background: ",";\n bottom: 0;\n left: 0;\n opacity: 0.5;\n position: fixed;\n right: 0;\n top: 0;\n transition:\n opacity 0.3s,\n bottom 0s 0.3s;\n z-index: 100;\n"])),(function(n){return n.theme.colors.modalBackdrop})),s=o.div(e||(e=n(["\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 9999;\n"],["\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 9999;\n"]))),p=o(t)(d||(d=n(["\n background-color: ",";\n position: relative;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);\n margin: ",";\n width: ",";\n min-height: 10rem;\n max-width: ",";\n z-index: 9999;\n"],["\n background-color: ",";\n position: relative;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);\n margin: ",";\n width: ",";\n min-height: 10rem;\n max-width: ",";\n z-index: 9999;\n"])),(function(n){var o=n.theme.colors,t=n.backgroundColor;return void 0!==t&&void 0!==typeof t?void 0!==o[t]?o[t]:t:o.backgroundLight}),(function(n){var o=n.$top;return"".concat(o," auto auto auto")}),(function(n){return n.$width}),(function(n){return n.$maxWidth})),h=o(i)(a||(a=n(["\n float: right;\n margin-left: ",";\n font-size: 1.2rem;\n padding: 0;\n"],["\n float: right;\n margin-left: ",";\n font-size: 1.2rem;\n padding: 0;\n"])),(function(n){return n.theme.spacing.xs}));export{m as Background,h as CloseButton,p as Content,s as Wrapper};
1
+ import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o,{keyframes as i}from"styled-components";import{Box as t}from"../Box/index.js";import{Button as a}from"../Button/index.js";var r,e,m,d,s,c,f=o.div(r||(r=n(["\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 9999;\n"],["\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 9999;\n"]))),u=i(e||(e=n(["\n from {\n opacity: 0;\n transform: scale(0);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n"],["\n from {\n opacity: 0;\n transform: scale(0);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n"]))),p=i(m||(m=n(["\n from {\n opacity: 0;\n }\n to {\n opacity: 0.5;\n }\n"],["\n from {\n opacity: 0;\n }\n to {\n opacity: 0.5;\n }\n"]))),l=o(t)(d||(d=n(["\n background-color: ",";\n position: relative;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);\n margin: ",";\n width: ",";\n min-height: 10rem;\n max-width: ",";\n z-index: 9999;\n animation-direction: normal;\n animation-timing-function: ease-in-out;\n animation-duration: 0.2s;\n animation-name: ",";\n"],["\n background-color: ",";\n position: relative;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);\n margin: ",";\n width: ",";\n min-height: 10rem;\n max-width: ",";\n z-index: 9999;\n animation-direction: normal;\n animation-timing-function: ease-in-out;\n animation-duration: 0.2s;\n animation-name: ",";\n"])),(function(n){var o=n.theme.colors,i=n.backgroundColor;return void 0!==i&&void 0!==typeof i?void 0!==o[i]?o[i]:i:o.backgroundLight}),(function(n){var o=n.$top;return"".concat(o," auto auto auto")}),(function(n){return n.$width}),(function(n){return n.$maxWidth}),(function(n){return n.$isAnimated?u:"none"})),g=o(a)(s||(s=n(["\n float: right;\n margin-left: ",";\n font-size: 1.2rem;\n padding: 0;\n"],["\n float: right;\n margin-left: ",";\n font-size: 1.2rem;\n padding: 0;\n"])),(function(n){return n.theme.spacing.xs})),h=o.div(c||(c=n(["\n background: ",";\n bottom: 0;\n left: 0;\n opacity: 0.5;\n position: fixed;\n right: 0;\n top: 0;\n transition:\n opacity 0.3s,\n bottom 0s 0.3s;\n z-index: 100;\n animation-direction: normal;\n animation-timing-function: ease-in-out;\n animation-duration: 0.3s;\n animation-name: ",";\n"],["\n background: ",";\n bottom: 0;\n left: 0;\n opacity: 0.5;\n position: fixed;\n right: 0;\n top: 0;\n transition:\n opacity 0.3s,\n bottom 0s 0.3s;\n z-index: 100;\n animation-direction: normal;\n animation-timing-function: ease-in-out;\n animation-duration: 0.3s;\n animation-name: ",";\n"])),(function(n){return n.theme.colors.modalBackdrop}),(function(n){return n.$isAnimated?p:"none"}));export{h as Background,g as CloseButton,l as Content,f as Wrapper};
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/Modal/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ColorKeyType, type ThemeType } from \"../../types\";\nimport Box from \"../Box\";\nimport { Button } from \"../Button\";\n\nexport const Background = styled.div<{\n theme: ThemeType;\n}>`\n background: ${({ theme }) => theme.colors.modalBackdrop};\n bottom: 0;\n left: 0;\n opacity: 0.5;\n position: fixed;\n right: 0;\n top: 0;\n transition:\n opacity 0.3s,\n bottom 0s 0.3s;\n z-index: 100;\n`;\n\nexport const Wrapper = styled.div`\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 9999;\n`;\n\nexport const Content = styled(Box)<{\n $backgroundColor?: string;\n $top: string;\n $width: string;\n $maxWidth: string;\n theme: ThemeType;\n}>`\n background-color: ${({ theme: { colors }, backgroundColor }) =>\n backgroundColor !== undefined && typeof backgroundColor !== undefined\n ? colors[backgroundColor as ColorKeyType] !== undefined\n ? colors[backgroundColor as ColorKeyType]\n : backgroundColor\n : colors.backgroundLight};\n position: relative;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);\n margin: ${({ $top }) => `${$top} auto auto auto`};\n width: ${({ $width }) => $width};\n min-height: 10rem;\n max-width: ${({ $maxWidth }) => $maxWidth};\n z-index: 9999;\n`;\n\nexport const CloseButton = styled(Button)<{\n theme: ThemeType;\n}>`\n float: right;\n margin-left: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n font-size: 1.2rem;\n padding: 0;\n`;\n"],"names":["Background","styled","div","templateObject_1","__makeTemplateObject","_a","theme","colors","modalBackdrop","Wrapper","templateObject_2","Content","Box","templateObject_3","backgroundColor","undefined","backgroundLight","$top","concat","$width","$maxWidth","CloseButton","Button","templateObject_4","spacing","xs"],"mappings":"mMAKO,YAAMA,EAAaC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,mBAAA,sKAAA,CAElC,mBACuD,yKAAzC,SAACC,GAAc,OAAPA,EAAAC,MAAaC,OAAOC,aAAb,IAalBC,EAAUR,EAAOC,IAAGQ,IAAAA,EAAAN,EAAA,CAAA,oIAAA,CAAA,uIAUpBO,EAAUV,EAAOW,EAAPX,CAMrBY,IAAAA,EAAAT,EAAA,CAAA,yBAAA,qFAAA,eAAA,yCAAA,yBAAA,CAAA,yBAM4B,qFAGoB,eACjB,yCAEU,4BAXrB,SAACC,OAAWE,EAAMF,EAAAC,MAAAC,OAAIO,EAAeT,EAAAS,gBACvD,YAAoBC,IAApBD,QAA4DC,WAApBD,OACQC,IAA5CR,EAAOO,GACLP,EAAOO,GACPA,EACFP,EAAOS,eAJX,IAOQ,SAACX,GAAE,IAAAY,EAAIZ,EAAAY,KAAO,MAAA,GAAAC,OAAGD,EAAqB,kBAAxB,IACf,SAACZ,GAAe,OAAPA,EAAAc,MAAO,IAEZ,SAACd,GAAkB,OAAPA,EAAAe,SAAO,IAIrBC,EAAcpB,EAAOqB,EAAPrB,CAAcsB,IAAAA,EAAAnB,EAAA,CAAA,qCAAA,4CAAA,CAEvC,qCAMQ,+CAJO,SAACC,GAIV,OAFWA,EAAAC,MAAAkB,QAAAC,EAEX"}
1
+ {"version":3,"file":"styles.js","sources":["../../../../src/components/Modal/styles.ts"],"sourcesContent":["import styled, { keyframes } from \"styled-components\";\nimport { type ColorKeyType, type ThemeType } from \"../../types\";\nimport Box from \"../Box\";\nimport { Button } from \"../Button\";\n\nexport const Wrapper = styled.div`\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 9999;\n`;\n\nconst grow = keyframes`\n from {\n opacity: 0;\n transform: scale(0);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n`;\n\nconst fade = keyframes`\n from {\n opacity: 0;\n }\n to {\n opacity: 0.5;\n }\n`;\n\nexport const Content = styled(Box)<{\n $backgroundColor?: string;\n $top: string;\n $width: string;\n $maxWidth: string;\n $isAnimated?: boolean;\n theme: ThemeType;\n}>`\n background-color: ${({ theme: { colors }, backgroundColor }) =>\n backgroundColor !== undefined && typeof backgroundColor !== undefined\n ? colors[backgroundColor as ColorKeyType] !== undefined\n ? colors[backgroundColor as ColorKeyType]\n : backgroundColor\n : colors.backgroundLight};\n position: relative;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);\n margin: ${({ $top }) => `${$top} auto auto auto`};\n width: ${({ $width }) => $width};\n min-height: 10rem;\n max-width: ${({ $maxWidth }) => $maxWidth};\n z-index: 9999;\n animation-direction: normal;\n animation-timing-function: ease-in-out;\n animation-duration: 0.2s;\n animation-name: ${({ $isAnimated }) => ($isAnimated ? grow : \"none\")};\n`;\n\nexport const CloseButton = styled(Button)<{\n theme: ThemeType;\n}>`\n float: right;\n margin-left: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n font-size: 1.2rem;\n padding: 0;\n`;\n\nexport const Background = styled.div<{\n theme: ThemeType;\n $isAnimated?: boolean;\n}>`\n background: ${({ theme }) => theme.colors.modalBackdrop};\n bottom: 0;\n left: 0;\n opacity: 0.5;\n position: fixed;\n right: 0;\n top: 0;\n transition:\n opacity 0.3s,\n bottom 0s 0.3s;\n z-index: 100;\n animation-direction: normal;\n animation-timing-function: ease-in-out;\n animation-duration: 0.3s;\n animation-name: ${({ $isAnimated }) => ($isAnimated ? fade : \"none\")};\n`;\n"],"names":["Wrapper","styled","div","templateObject_1","__makeTemplateObject","grow","keyframes","templateObject_2","fade","templateObject_3","Content","Box","templateObject_4","_a","colors","theme","backgroundColor","undefined","backgroundLight","$top","concat","$width","$maxWidth","$isAnimated","CloseButton","Button","templateObject_5","spacing","xs","Background","templateObject_6","modalBackdrop"],"mappings":"mNAKa,gBAAAA,EAAUC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,oIAAA,CAAA,uIAU3BC,EAAOC,EAASC,IAAAA,EAAAH,EAAA,CAAA,wHAAA,CAAA,2HAWhBI,EAAOF,EAASG,IAAAA,EAAAL,EAAA,CAAA,sEAAA,CAAA,yEASTM,EAAUT,EAAOU,EAAPV,CAAWW,IAAAA,EAAAR,EAAA,CAAA,yBAAA,qFAAA,eAAA,yCAAA,kJAAA,OAAA,CAOhC,yBAM4B,qFAGoB,eACjB,yCAEU,kJAK2B,UAhBhD,SAACS,OAAWC,EAAMD,EAAAE,MAAAD,OAAIE,EAAeH,EAAAG,gBACvD,YAAoBC,IAApBD,QAA4DC,WAApBD,OACQC,IAA5CH,EAAOE,GACLF,EAAOE,GACPA,EACFF,EAAOI,eAJX,IAOQ,SAACL,GAAE,IAAAM,EAAIN,EAAAM,KAAO,MAAA,GAAAC,OAAGD,EAAqB,kBAAxB,IACf,SAACN,GAAe,OAAPA,EAAAQ,MAAO,IAEZ,SAACR,GAAkB,OAAPA,EAAAS,SAAO,IAKd,SAACT,GAAoB,OAAPA,EAAAU,YAAsBlB,EAAO,MAAtB,IAG5BmB,EAAcvB,EAAOwB,EAAPxB,CAAcyB,IAAAA,EAAAtB,EAAA,CAAA,qCAAA,4CAAA,CAEvC,qCAMQ,+CAJO,SAACS,GAIV,OAFWA,EAAAE,MAAAY,QAAAC,EAEX,IAKKC,EAAa5B,EAAOC,IAG/B4B,IAAAA,EAAA1B,EAAA,CAAA,mBAAA,+RAAA,OAAA,CAAA,mBACuD,+RAca,UAdtD,SAACS,GAAc,OAAPA,EAAAE,MAAaD,OAAOiB,aAAb,IAcX,SAAClB,GAAoB,OAAPA,EAAAU,YAAsBf,EAAO,MAAtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Pagination/index.tsx"],"sourcesContent":["import React, {\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n type TouchEvent,\n} from \"react\";\nimport { ThemeProvider, useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { PagerItem, PagerLink, PagerList, PagerWrapper } from \"./styles\";\n\nexport type PaginationProps = {\n /** set current page number */\n current: number;\n /** total number of pages */\n items: number;\n /** don't show an ellipsise and then the last page link, usefull for search results where the last page isn't important */\n hideLast?: boolean;\n /** callback function which is passed the selected page number on click */\n pagerCallback: (n: number) => void;\n /** number of items per page */\n perPage: number;\n /** the name of the search param in the url that is modified on page click, defaults to 'page' */\n searchParam?: string;\n children?: ReactNode;\n} & HTMLAttributes<HTMLElement>;\n\n/**\n * \n * Pagination is used when we are viewing large amounts of data.\nData is split into multiple pages and pagination is used to\neasily navigate through these pages.\n */\nexport function Pagination({\n current,\n items,\n hideLast,\n pagerCallback,\n perPage,\n searchParam = \"page\",\n children,\n id,\n}: PaginationProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const perPageValue = perPage > 0 ? perPage : 1;\n const totalPages = Math.ceil(items / perPageValue) || 1;\n\n const linkProps = (number: number) => ({\n href: `${typeof window !== \"undefined\" ? window.location.pathname : \"\"}?${\n searchParam ? `${searchParam}=${number}` : \"\"\n }`,\n onClick: (e: TouchEvent | MouseEvent) => {\n e.preventDefault();\n pagerCallback(number);\n },\n });\n\n const renderPager = (active: number, total: number) => {\n const list = [];\n let pager = [];\n // get the list of items\n for (let number = 1; number <= total; number += 1) {\n list.push(\n <PagerItem key={number}>\n <PagerLink\n data-cta={id ? `${id}-${number}` : null}\n $active={number === active}\n {...linkProps(number)}\n aria-label={`page ${number} of ${total}`}\n >\n {number}\n </PagerLink>\n </PagerItem>,\n );\n }\n const first = list.slice(0, 1).concat(\n <PagerItem key=\"first\">\n <span>...</span>\n </PagerItem>,\n );\n const last = list\n .slice(list.length - 1)\n .concat(\n <PagerItem key=\"last\">\n <span>...</span>\n </PagerItem>,\n )\n .reverse();\n pager = list.slice(0, total);\n if (total > 7) {\n if (active <= 4) {\n pager = hideLast ? list.slice(0, 7) : list.slice(0, 5).concat(last);\n } else {\n pager =\n active > total - 4\n ? first.concat(list.slice(-5))\n : hideLast\n ? first.concat(list.slice(active - 3, active + 2))\n : first.concat(list.slice(active - 2, active + 1)).concat(last);\n }\n }\n return pager;\n };\n\n return (\n <ThemeProvider theme={theme}>\n {items > perPage && (\n <PagerWrapper>\n <PagerList>\n <PagerItem key=\"Prev\">\n <PagerLink\n data-cta={id ? `${id}-prev` : null}\n name=\"Prev\"\n aria-disabled={current === 1}\n {...(current === 1 && { tabIndex: -1 })}\n {...(current !== 1 && linkProps(current - 1))}\n $disabled={current === 1}\n >\n Prev\n </PagerLink>\n </PagerItem>\n {renderPager(current, totalPages)}\n <PagerItem key=\"Next\">\n <PagerLink\n data-cta={id ? `${id}-next` : null}\n name=\"Next\"\n aria-disabled={current === totalPages}\n {...(current === totalPages && { tabIndex: -1 })}\n {...(current !== totalPages && linkProps(current + 1))}\n $disabled={current === totalPages}\n >\n Next\n </PagerLink>\n </PagerItem>\n </PagerList>\n {children}\n </PagerWrapper>\n )}\n </ThemeProvider>\n );\n}\n\nexport default Pagination;\n"],"names":["Pagination","_a","current","items","hideLast","pagerCallback","perPage","_b","searchParam","children","id","foundTheme","useTheme","theme","__assign","defaultTheme","perPageValue","totalPages","Math","ceil","linkProps","number","href","concat","window","location","pathname","onClick","e","preventDefault","React","createElement","ThemeProvider","PagerWrapper","PagerList","PagerItem","key","PagerLink","name","tabIndex","active","total","list","pager","push","$active","first","slice","last","length","reverse","renderPager","$disabled"],"mappings":"kSAkCM,SAAUA,EAAWC,OACzBC,EAAOD,EAAAC,QACPC,EAAKF,EAAAE,MACLC,EAAQH,EAAAG,SACRC,EAAaJ,EAAAI,cACbC,YACAC,EAAAN,EAAAO,YAAAA,OAAc,IAAAD,EAAA,OAAMA,EACpBE,EAAQR,EAAAQ,SACRC,EAAET,EAAAS,GAEIC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,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AAC,cAAA,OAAA,KAAA,SAGHmB,UAcH,OAbAP,EAAQD,EAAKK,MAAM,EAAGN,GAClBA,EAAQ,IAERE,EADEH,GAAU,EACJpC,EAAWsC,EAAKK,MAAM,EAAG,GAAKL,EAAKK,MAAM,EAAG,GAAGxB,OAAOyB,GAG5DR,EAASC,EAAQ,EACbK,EAAMvB,OAAOmB,EAAKK,OAAO,IACzB3C,EACE0C,EAAMvB,OAAOmB,EAAKK,MAAMP,EAAS,EAAGA,EAAS,IAC7CM,EAAMvB,OAAOmB,EAAKK,MAAMP,EAAS,EAAGA,EAAS,IAAIjB,OAAOyB,IAG7DL,CACT,CAmBWQ,CAAYjD,EAASe,GACtBa,EAAAC,cAACI,EAAS,CAACC,IAAI,QACbN,EAACC,cAAAM,EACWvB,EAAA,CAAA,WAAAJ,EAAK,GAAGa,OAAAb,EAAS,SAAG,KAC9B4B,KAAK,OACU,gBAAApC,IAAYe,GACtBf,IAAYe,GAAc,CAAEsB,UAAW,GACvCrC,IAAYe,GAAcG,EAAUlB,EAAU,GACxC,CAAAkD,UAAAlD,IAAYe,IAGb,UAGfR,GAKX"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Pagination/index.tsx"],"sourcesContent":["import React, {\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n type TouchEvent,\n} from \"react\";\nimport { ThemeProvider, useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { PagerItem, PagerLink, PagerList, PagerWrapper } from \"./styles\";\n\nexport type PaginationProps = {\n /** set current page number */\n current: number;\n /** total number of pages */\n items: number;\n /** don't show an ellipsise and then the last page link, usefull for search results where the last page isn't important */\n hideLast?: boolean;\n /** callback function which is passed the selected page number on click */\n pagerCallback: (n: number) => void;\n /** number of items per page */\n perPage: number;\n /** the name of the search param in the url that is modified on page click, defaults to 'page' */\n searchParam?: string;\n children?: ReactNode;\n} & HTMLAttributes<HTMLElement>;\n\n/**\n * \n * Pagination is used when we are viewing large amounts of data.\nData is split into multiple pages and pagination is used to\neasily navigate through these pages.\n */\nexport function Pagination({\n current,\n items,\n hideLast,\n pagerCallback,\n perPage,\n searchParam = \"page\",\n children,\n id,\n}: PaginationProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const perPageValue = perPage > 0 ? perPage : 1;\n const totalPages = Math.ceil(items / perPageValue) || 1;\n\n const linkProps = (number: number) => ({\n href: `${typeof window !== \"undefined\" ? window.location.pathname : \"\"}?${\n searchParam ? `${searchParam}=${number}` : \"\"\n }`,\n onClick: (e: TouchEvent | MouseEvent) => {\n e.preventDefault();\n pagerCallback(number);\n },\n });\n\n const renderPager = (active: number, total: number) => {\n const list = [];\n let pager = [];\n // get the list of items\n for (let number = 1; number <= total; number += 1) {\n list.push(\n <PagerItem key={number}>\n <PagerLink\n data-cta={id ? `${id}-${number}` : null}\n $active={number === active}\n {...linkProps(number)}\n aria-label={`page ${number} of ${total}`}\n >\n {number}\n </PagerLink>\n </PagerItem>,\n );\n }\n const first = list.slice(0, 1).concat(\n <PagerItem key=\"first\">\n <span>...</span>\n </PagerItem>,\n );\n const last = list\n .slice(list.length - 1)\n .concat(\n <PagerItem key=\"last\">\n <span>...</span>\n </PagerItem>,\n )\n .reverse();\n pager = list.slice(0, total);\n if (total > 7) {\n if (active <= 4) {\n pager = hideLast ? list.slice(0, 7) : list.slice(0, 5).concat(last);\n } else {\n pager =\n active > total - 4\n ? first.concat(list.slice(-5))\n : hideLast\n ? first.concat(list.slice(active - 3, active + 2))\n : first.concat(list.slice(active - 2, active + 1)).concat(last);\n }\n }\n return pager;\n };\n\n return (\n <ThemeProvider theme={theme}>\n {items > perPage && (\n <PagerWrapper>\n <PagerList>\n <PagerItem key=\"Prev\">\n <PagerLink\n data-cta={id ? `${id}-prev` : null}\n name=\"Prev\"\n aria-disabled={current === 1}\n {...(current === 1 && { tabIndex: -1 })}\n {...(current !== 1 && linkProps(current - 1))}\n $disabled={current === 1}\n >\n Prev\n </PagerLink>\n </PagerItem>\n {renderPager(current, totalPages)}\n <PagerItem key=\"Next\">\n <PagerLink\n data-cta={id ? `${id}-next` : null}\n name=\"Next\"\n aria-disabled={current === totalPages}\n {...(current === totalPages && { tabIndex: -1 })}\n {...(current !== totalPages && linkProps(current + 1))}\n $disabled={current === totalPages}\n >\n Next\n </PagerLink>\n </PagerItem>\n </PagerList>\n {children}\n </PagerWrapper>\n )}\n </ThemeProvider>\n );\n}\n\nexport default Pagination;\n"],"names":["Pagination","_a","current","items","hideLast","pagerCallback","perPage","_b","searchParam","children","id","foundTheme","useTheme","theme","__assign","defaultTheme","perPageValue","totalPages","Math","ceil","linkProps","number","href","concat","window","location","pathname","onClick","e","preventDefault","React","createElement","ThemeProvider","PagerWrapper","PagerList","PagerItem","key","PagerLink","name","tabIndex","active","total","list","pager","push","$active","first","slice","last","length","reverse","renderPager","$disabled"],"mappings":"kSAkCM,SAAUA,EAAWC,OACzBC,EAAOD,EAAAC,QACPC,EAAKF,EAAAE,MACLC,EAAQH,EAAAG,SACRC,EAAaJ,EAAAI,cACbC,YACAC,EAAAN,EAAAO,YAAAA,OAAc,IAAAD,EAAA,OAAMA,EACpBE,EAAQR,EAAAQ,SACRC,EAAET,EAAAS,GAEIC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAECK,EAAeV,EAAU,EAAIA,EAAU,EACvCW,EAAaC,KAAKC,KAAKhB,EAAQa,IAAiB,EAEhDI,EAAY,SAACC,GAAmB,MAAC,CACrCC,KAAM,GAAAC,OAAqB,oBAAXC,OAAyBA,OAAOC,SAASC,SAAW,GAClE,KAAAH,OAAAf,EAAc,GAAGe,OAAAf,EAAe,KAAAe,OAAAF,GAAW,IAE7CM,QAAS,SAACC,GACRA,EAAEC,iBACFxB,EAAcgB,EACf,EACD,EAiDF,OACES,EAAAC,cAACC,EAAa,CAACnB,MAAOA,GACnBV,EAAQG,GACPwB,gBAACG,EAAY,KACXH,EAAAC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,CAAYjD,EAASe,GACtBa,EAAAC,cAACI,EAAS,CAACC,IAAI,QACbN,EAACC,cAAAM,EACWvB,EAAA,CAAA,WAAAJ,EAAK,GAAGa,OAAAb,EAAS,SAAG,KAC9B4B,KAAK,OACU,gBAAApC,IAAYe,GACtBf,IAAYe,GAAc,CAAEsB,UAAW,GACvCrC,IAAYe,GAAcG,EAAUlB,EAAU,GACxC,CAAAkD,UAAAlD,IAAYe,IAGb,UAGfR,GAKX"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/Pagination/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\nexport const PagerWrapper = styled.div`\n display: table;\n width: 100%;\n clear: both;\n text-align: center;\n`;\n\nexport const PagerList = styled.ul`\n display: inline-block;\n padding-left: 0;\n margin: 20px 0;\n`;\n\nexport const PagerLink = styled.a<{\n name?: string;\n theme: ThemeType;\n $active?: boolean;\n $disabled?: boolean;\n}>`\n font-weight: normal;\n font-family: ${({\n theme: {\n typography: { fontFamilyBase },\n },\n }) => fontFamilyBase};\n font-size: ${({\n theme: {\n fontSizes: { s },\n },\n }) => s};\n color: ${({ theme }) => theme.colors.textLight};\n background-color: ${({ theme }) => theme.colors.paginationBackground};\n cursor: pointer;\n border-radius: 0;\n margin: ${({ theme }) => theme.spacing.xxs};\n padding: 7px 11px;\n text-decoration: none;\n &:active,\n &:focus,\n &:hover {\n opacity: 0.88;\n text-decoration: underline;\n }\n &:visited {\n text-decoration: none;\n }\n\n &:focus-visible {\n outline: auto;\n }\n\n ${({ $active, theme }) =>\n $active &&\n css`\n color: ${theme.colors.textDark};\n background-color: ${theme.colors.paginationActive};\n cursor: default;\n &:hover {\n background-color: ${theme.colors.paginationActive};\n text-decoration: none;\n }\n `}\n\n ${({ name, theme, $disabled }) =>\n (name === \"Prev\" || name === \"Next\") &&\n css`\n color: ${$disabled ? theme.colors.disabled : theme.colors.paginationText};\n background-color: transparent;\n font-weight: bold;\n padding: 8px 6px;\n background-color: transparent;\n &:focus,\n &:hover {\n background-color: transparent;\n text-decoration: underline;\n }\n &:active,\n &:visited {\n text-decoration: none;\n }\n `}\n\n ${({ theme, $disabled }) =>\n $disabled &&\n css`\n color: $ ${theme.colors.disabled};\n cursor: not-allowed;\n pointer-events:none\n text-decoration: none;\n &:hover,\n &:focus,\n &:active,\n &:visited {\n color: ${theme.colors.disabled};\n text-decoration: none;\n }\n `}\n`;\n\nexport const PagerItem = styled.li<{ theme: ThemeType }>`\n display: none;\n &:first-child,\n &:last-child {\n display: inline;\n }\n @media (min-width: ${(props) => props.theme.breakpoint.mobile}) {\n display: inline;\n }\n span {\n border: none;\n min-width: 30px;\n padding: 5px;\n margin: 1px;\n border-radius: 0;\n border-width: ${(props) => props.theme.breakpoint.mobile};\n }\n`;\n"],"names":["PagerWrapper","styled","div","templateObject_1","__makeTemplateObject","PagerList","ul","templateObject_2","PagerLink","a","templateObject_6","_a","theme","typography","fontFamilyBase","fontSizes","s","colors","textLight","paginationBackground","spacing","xxs","$active","css","templateObject_3","textDark","paginationActive","name","$disabled","templateObject_4","disabled","paginationText","templateObject_5","PagerItem","li","templateObject_7","props","breakpoint","mobile"],"mappings":"2HAGa,kBAAAA,EAAeC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,gFAAA,CAAA,mFAOzBC,EAAYJ,EAAOK,GAAEC,IAAAA,EAAAH,EAAA,CAAA,uEAAA,CAAA,0EAMrBI,EAAYP,EAAOQ,EAK9BC,IAAAA,EAAAN,EAAA,CAAA,4CAAA,mBAAA,eAAA,0BAAA,yDAAA,0PAAA,SAAA,SAAA,MAAA,CAAA,4CAMoB,mBAKb,eACuC,0BACsB,yDAG1B,0PA2BvC,SAmBA,SAgBA,SA5EY,SAACO,GAIV,OAF0BA,EAAAC,MAAAC,WAAAC,cAE1B,IACO,SAACH,GAIR,OAFYA,EAAAC,MAAAG,UAAAC,CAEZ,IACG,SAACL,GAAc,OAAPA,EAAAC,MAAaK,OAAOC,SAAb,IACJ,SAACP,GAAc,OAAPA,EAAAC,MAAaK,OAAOE,oBAAb,IAGzB,SAACR,GAAc,OAAPA,EAAAC,MAAaQ,QAAQC,GAAd,IAiBvB,SAACV,OAAEW,EAAOX,EAAAW,QAAEV,EAAKD,EAAAC,MACjB,OAAAU,GACAC,EAAGC,IAAAA,EAAApB,EAAA,CAAA,kBAAA,8BAAA,yEAAA,oDAAA,CAAA,kBAC6B,8BACmB,yEAGE,sDAJ1CQ,EAAMK,OAAOQ,SACFb,EAAMK,OAAOS,iBAGXd,EAAMK,OAAOS,iBANrC,IAWA,SAACf,GAAE,IAAAgB,SAAMf,EAAKD,EAAAC,MAAEgB,EAASjB,EAAAiB,UACzB,OAAU,SAATD,GAA4B,SAATA,IACpBJ,EAAGM,IAAAA,EAAAzB,EAAA,CAAA,kBAAA,8UAAA,CAAA,kBACuE,gVAA/DwB,EAAYhB,EAAMK,OAAOa,SAAWlB,EAAMK,OAAOc,eAF5D,IAkBA,SAACpB,OAAEC,EAAKD,EAAAC,MACR,OADmBD,EAAAiB,WAEnBL,EAAGS,IAAAA,EAAA5B,EAAA,CAAA,oBAAA,8KAAA,oDAAA,CAAA,oBAC+B,8KAQA,sDARrBQ,EAAMK,OAAOa,SAQblB,EAAMK,OAAOa,SAV1B,IAgBSG,EAAYhC,EAAOiC,GAAwBC,IAAAA,EAAA/B,EAAA,CAAA,2GAAA,oKAAA,YAAA,CAAA,2GAMO,oKASH,eATrC,SAACgC,GAAU,OAAAA,EAAMxB,MAAMyB,WAAWC,MAAM,IAS3C,SAACF,GAAU,OAAAA,EAAMxB,MAAMyB,WAAWC,MAAvB"}
1
+ {"version":3,"file":"styles.js","sources":["../../../../src/components/Pagination/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\nexport const PagerWrapper = styled.div`\n display: table;\n width: 100%;\n clear: both;\n text-align: center;\n`;\n\nexport const PagerList = styled.ul`\n display: inline-block;\n padding-left: 0;\n margin: 20px 0;\n`;\n\nexport const PagerLink = styled.a<{\n name?: string;\n theme: ThemeType;\n $active?: boolean;\n $disabled?: boolean;\n}>`\n font-weight: normal;\n font-family: ${({\n theme: {\n typography: { fontFamilyBase },\n },\n }) => fontFamilyBase};\n font-size: ${({\n theme: {\n fontSizes: { s },\n },\n }) => s};\n color: ${({ theme }) => theme.colors.textLight};\n background-color: ${({ theme }) => theme.colors.paginationBackground};\n cursor: pointer;\n border-radius: 0;\n margin: ${({ theme }) => theme.spacing.xxs};\n padding: 7px 11px;\n text-decoration: none;\n &:active,\n &:focus,\n &:hover {\n opacity: 0.88;\n text-decoration: underline;\n }\n &:visited {\n text-decoration: none;\n }\n\n &:focus-visible {\n outline: auto;\n }\n\n ${({ $active, theme }) =>\n $active &&\n css`\n color: ${theme.colors.textDark};\n background-color: ${theme.colors.paginationActive};\n cursor: default;\n &:hover {\n background-color: ${theme.colors.paginationActive};\n text-decoration: none;\n }\n `}\n\n ${({ name, theme, $disabled }) =>\n (name === \"Prev\" || name === \"Next\") &&\n css`\n color: ${$disabled ? theme.colors.disabled : theme.colors.paginationText};\n background-color: transparent;\n font-weight: bold;\n padding: 8px 6px;\n background-color: transparent;\n &:focus,\n &:hover {\n background-color: transparent;\n text-decoration: underline;\n }\n &:active,\n &:visited {\n text-decoration: none;\n }\n `}\n\n ${({ theme, $disabled }) =>\n $disabled &&\n css`\n color: $ ${theme.colors.disabled};\n cursor: not-allowed;\n pointer-events:none\n text-decoration: none;\n &:hover,\n &:focus,\n &:active,\n &:visited {\n color: ${theme.colors.disabled};\n text-decoration: none;\n }\n `}\n`;\n\nexport const PagerItem = styled.li<{ theme: ThemeType }>`\n display: none;\n &:first-child,\n &:last-child {\n display: inline;\n }\n @media (min-width: ${(props) => props.theme.breakpoint.mobile}) {\n display: inline;\n }\n span {\n border: none;\n min-width: 30px;\n padding: 5px;\n margin: 1px;\n border-radius: 0;\n border-width: ${(props) => props.theme.breakpoint.mobile};\n }\n`;\n"],"names":["PagerWrapper","styled","div","templateObject_1","__makeTemplateObject","PagerList","ul","templateObject_2","PagerLink","a","templateObject_6","_a","theme","typography","fontFamilyBase","fontSizes","s","colors","textLight","paginationBackground","spacing","xxs","$active","css","templateObject_3","textDark","paginationActive","name","$disabled","templateObject_4","disabled","paginationText","templateObject_5","PagerItem","li","templateObject_7","props","breakpoint","mobile"],"mappings":"2HAGa,kBAAAA,EAAeC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,gFAAA,CAAA,mFAOzBC,EAAYJ,EAAOK,GAAEC,IAAAA,EAAAH,EAAA,CAAA,uEAAA,CAAA,0EAMrBI,EAAYP,EAAOQ,EAK9BC,IAAAA,EAAAN,EAAA,CAAA,4CAAA,mBAAA,eAAA,0BAAA,yDAAA,0PAAA,SAAA,SAAA,MAAA,CAAA,4CAMoB,mBAKb,eACuC,0BACsB,yDAG1B,0PA2BvC,SAmBA,SAgBA,SA5EY,SAACO,GAIV,OAF0BA,EAAAC,MAAAC,WAAAC,cAE1B,IACO,SAACH,GAIR,OAFYA,EAAAC,MAAAG,UAAAC,CAEZ,IACG,SAACL,GAAc,OAAPA,EAAAC,MAAaK,OAAOC,SAAb,IACJ,SAACP,GAAc,OAAPA,EAAAC,MAAaK,OAAOE,oBAAb,IAGzB,SAACR,GAAc,OAAPA,EAAAC,MAAaQ,QAAQC,GAAd,IAiBvB,SAACV,OAAEW,EAAOX,EAAAW,QAAEV,EAAKD,EAAAC,MACjB,OAAAU,GACAC,EAAGC,IAAAA,EAAApB,EAAA,CAAA,kBAAA,8BAAA,yEAAA,oDAAA,CAAA,kBAC6B,8BACmB,yEAGE,sDAJ1CQ,EAAMK,OAAOQ,SACFb,EAAMK,OAAOS,iBAGXd,EAAMK,OAAOS,iBANrC,IAWA,SAACf,GAAE,IAAAgB,SAAMf,EAAKD,EAAAC,MAAEgB,EAASjB,EAAAiB,UACzB,OAAU,SAATD,GAA4B,SAATA,IACpBJ,EAAGM,IAAAA,EAAAzB,EAAA,CAAA,kBAAA,8UAAA,CAAA,kBACuE,gVAA/DwB,EAAYhB,EAAMK,OAAOa,SAAWlB,EAAMK,OAAOc,eAF5D,IAkBA,SAACpB,OAAEC,EAAKD,EAAAC,MACR,OADmBD,EAAAiB,WAEnBL,EAAGS,IAAAA,EAAA5B,EAAA,CAAA,oBAAA,8KAAA,oDAAA,CAAA,oBAC+B,8KAQA,sDARrBQ,EAAMK,OAAOa,SAQblB,EAAMK,OAAOa,SAV1B,IAgBSG,EAAYhC,EAAOiC,GAAwBC,IAAAA,EAAA/B,EAAA,CAAA,2GAAA,oKAAA,YAAA,CAAA,2GAMO,oKASH,eATrC,SAACgC,GAAU,OAAAA,EAAMxB,MAAMyB,WAAWC,MAAM,IAS3C,SAACF,GAAU,OAAAA,EAAMxB,MAAMyB,WAAWC,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/PopOver/index.tsx"],"sourcesContent":["import React, {\n useState,\n useEffect,\n useRef,\n useCallback,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { ThemeProvider, useTheme } from \"styled-components\";\n\nimport { useKey } from \"../../hooks/useKey\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { useEffectBrowser } from \"../../hooks/useEffectBrowser\";\n\nimport { type PopOverPositionType } from \"../../types\";\nimport { PopOverWrapper, PopOverModal } from \"./styles\";\n\nexport type PopOverProps = {\n /** modalLabel: used for aria-label of modal */\n modalLabel: string;\n /** modalContent: contents in side the popover modal */\n modalContent: ReactNode;\n /** position: position that the popover opens relative to the triggering element, the trigger element is the child of the component */\n position?: PopOverPositionType;\n /** full: enable child button extend full width */\n full?: boolean;\n /** maxWidth: popover modal max width */\n maxWidth?: string;\n /** minWidth: popover modal min width */\n minWidth?: string;\n /** onPopOverIsOpenChange: popover isOpen changed handler */\n onPopOverIsOpenChange?: (isOpen: boolean) => void;\n children?: ReactNode;\n css?: string;\n};\n\n/**\n * Popover is a non-modal dialog that floats around its disclosure. It's\ncommonly used for displaying additional rich content on top of something.\n*/\nexport function PopOver({\n onPopOverIsOpenChange,\n children,\n minWidth,\n maxWidth,\n position,\n modalLabel,\n modalContent,\n css,\n full = false,\n}: PopOverProps) {\n const popRef = useRef<HTMLDivElement>(null);\n const [showPopOver, setShowPopOver] = useState(false);\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const toggle = () => setShowPopOver(!showPopOver);\n const closePopOver = () => setShowPopOver(false);\n\n // outside click closes popover\n const handleDocumentClick = useCallback(\n (e: MouseEvent) => {\n if (!!popRef.current && !popRef.current.contains(e.target as Node)) {\n closePopOver();\n }\n },\n [popRef.current],\n );\n\n useKey(\n () => {\n closePopOver();\n },\n {\n detectKeys: [\"Escape\"],\n },\n [],\n );\n\n useEffect(() => {\n if (onPopOverIsOpenChange) {\n onPopOverIsOpenChange(showPopOver);\n }\n }, [showPopOver]);\n\n useEffectBrowser(() => {\n document.addEventListener(\"click\", handleDocumentClick, true);\n return () => {\n document.removeEventListener(\"click\", handleDocumentClick, true);\n };\n }, []);\n\n return (\n <ThemeProvider theme={theme}>\n <PopOverWrapper $full={full} $css={css} ref={popRef}>\n {React.Children.map(\n children as ReactElement,\n (child: React.ReactElement) =>\n React.cloneElement(child, {\n onClick: toggle,\n \"aria-expanded\": showPopOver,\n \"aria-haspopup\": \"dialog\",\n }),\n )}\n {showPopOver ? (\n <PopOverModal\n $maxWidth={maxWidth || \"none\"}\n $minWidth={minWidth || \"auto\"}\n $position={position || \"top\"}\n theme={theme}\n role=\"dialog\"\n aria-label={modalLabel}\n aria-modal={showPopOver}\n >\n {modalContent}\n </PopOverModal>\n ) : null}\n </PopOverWrapper>\n </ThemeProvider>\n );\n}\n\nexport default PopOver;\n"],"names":["PopOver","_a","onPopOverIsOpenChange","children","minWidth","maxWidth","position","modalLabel","modalContent","css","_b","full","popRef","useRef","_c","useState","showPopOver","setShowPopOver","foundTheme","useTheme","theme","__assign","defaultTheme","toggle","closePopOver","handleDocumentClick","useCallback","e","current","contains","target","useKey","detectKeys","useEffect","useEffectBrowser","document","addEventListener","removeEventListener","React","createElement","ThemeProvider","PopOverWrapper","$css","ref","Children","map","child","cloneElement","onClick","PopOverModal","$minWidth","role"],"mappings":"sbAwCM,SAAUA,EAAQC,GACtB,IAAAC,EAAqBD,EAAAC,sBACrBC,EAAQF,EAAAE,SACRC,EAAQH,EAAAG,SACRC,EAAQJ,EAAAI,SACRC,EAAQL,EAAAK,SACRC,EAAUN,EAAAM,WACVC,EAAYP,EAAAO,aACZC,EAAGR,EAAAQ,IACHC,EAAAT,EAAAU,KAAAA,OAAO,IAAAD,GAAKA,EAENE,EAASC,EAAuB,MAChCC,EAAgCC,GAAS,GAAxCC,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAC5BI,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EAAS,WAAM,OAAAN,GAAgBD,IAC/BQ,EAAe,WAAM,OAAAP,GAAe,EAAf,EAGrBQ,EAAsBC,GAC1B,SAACC,GACOf,EAAOgB,UAAYhB,EAAOgB,QAAQC,SAASF,EAAEG,SACjDN,GAEJ,GACA,CAACZ,EAAOgB,UA0BV,OAvBAG,GACE,WACEP,GACF,GACA,CACEQ,WAAY,CAAC,WAEf,IAGFC,GAAU,WACJ/B,GACFA,EAAsBc,EAE1B,GAAG,CAACA,IAEJkB,GAAiB,WAEf,OADAC,SAASC,iBAAiB,QAASX,GAAqB,GACjD,WACLU,SAASE,oBAAoB,QAASZ,GAAqB,EAC7D,CACD,GAAE,IAGDa,EAACC,cAAAC,EAAc,CAAApB,MAAOA,GACpBkB,EAACC,cAAAE,SAAsB9B,EAAI+B,KAAQjC,EAAKkC,IAAK/B,GAC1C0B,EAAMM,SAASC,IACd1C,GACA,SAAC2C,GACC,OAAAR,EAAMS,aAAaD,EAAO,CACxBE,QAASzB,EACT,gBAAiBP,EACjB,gBAAiB,UAHnB,IAMHA,EACCsB,EAACC,cAAAU,aACY5C,GAAY,OAAM6C,UAClB9C,GAAY,iBACZE,GAAY,MACvBc,MAAOA,EACP+B,KAAK,SACO,aAAA5C,eACAS,GAEXR,GAED,MAIZ"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/PopOver/index.tsx"],"sourcesContent":["import React, {\n useState,\n useEffect,\n useRef,\n useCallback,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { ThemeProvider, useTheme } from \"styled-components\";\n\nimport { useKey } from \"../../hooks/useKey\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { useEffectBrowser } from \"../../hooks/useEffectBrowser\";\n\nimport { type PopOverPositionType } from \"../../types\";\nimport { PopOverWrapper, PopOverModal } from \"./styles\";\n\nexport type PopOverProps = {\n /** modalLabel: used for aria-label of modal */\n modalLabel: string;\n /** modalContent: contents in side the popover modal */\n modalContent: ReactNode;\n /** position: position that the popover opens relative to the triggering element, the trigger element is the child of the component */\n position?: PopOverPositionType;\n /** full: enable child button extend full width */\n full?: boolean;\n /** maxWidth: popover modal max width */\n maxWidth?: string;\n /** minWidth: popover modal min width */\n minWidth?: string;\n /** onPopOverIsOpenChange: popover isOpen changed handler */\n onPopOverIsOpenChange?: (isOpen: boolean) => void;\n children?: ReactNode;\n css?: string;\n};\n\n/**\n * Popover is a non-modal dialog that floats around its disclosure. It's\ncommonly used for displaying additional rich content on top of something.\n*/\nexport function PopOver({\n onPopOverIsOpenChange,\n children,\n minWidth,\n maxWidth,\n position,\n modalLabel,\n modalContent,\n css,\n full = false,\n}: PopOverProps) {\n const popRef = useRef<HTMLDivElement>(null);\n const [showPopOver, setShowPopOver] = useState(false);\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const toggle = () => setShowPopOver(!showPopOver);\n const closePopOver = () => setShowPopOver(false);\n\n // outside click closes popover\n const handleDocumentClick = useCallback(\n (e: MouseEvent) => {\n if (!!popRef.current && !popRef.current.contains(e.target as Node)) {\n closePopOver();\n }\n },\n [popRef.current],\n );\n\n useKey(\n () => {\n closePopOver();\n },\n {\n detectKeys: [\"Escape\"],\n },\n [],\n );\n\n useEffect(() => {\n if (onPopOverIsOpenChange) {\n onPopOverIsOpenChange(showPopOver);\n }\n }, [showPopOver]);\n\n useEffectBrowser(() => {\n document.addEventListener(\"click\", handleDocumentClick, true);\n return () => {\n document.removeEventListener(\"click\", handleDocumentClick, true);\n };\n }, []);\n\n return (\n <ThemeProvider theme={theme}>\n <PopOverWrapper $full={full} $css={css} ref={popRef}>\n {React.Children.map(\n children as ReactElement,\n (child: React.ReactElement) =>\n React.cloneElement(child, {\n onClick: toggle,\n \"aria-expanded\": showPopOver,\n \"aria-haspopup\": \"dialog\",\n }),\n )}\n {showPopOver ? (\n <PopOverModal\n $maxWidth={maxWidth || \"none\"}\n $minWidth={minWidth || \"auto\"}\n $position={position || \"top\"}\n theme={theme}\n role=\"dialog\"\n aria-label={modalLabel}\n aria-modal={showPopOver}\n >\n {modalContent}\n </PopOverModal>\n ) : null}\n </PopOverWrapper>\n </ThemeProvider>\n );\n}\n\nexport default PopOver;\n"],"names":["PopOver","_a","onPopOverIsOpenChange","children","minWidth","maxWidth","position","modalLabel","modalContent","css","_b","full","popRef","useRef","_c","useState","showPopOver","setShowPopOver","foundTheme","useTheme","theme","__assign","defaultTheme","toggle","closePopOver","handleDocumentClick","useCallback","e","current","contains","target","useKey","detectKeys","useEffect","useEffectBrowser","document","addEventListener","removeEventListener","React","createElement","ThemeProvider","PopOverWrapper","$css","ref","Children","map","child","cloneElement","onClick","PopOverModal","$minWidth","role"],"mappings":"sbAwCM,SAAUA,EAAQC,GACtB,IAAAC,EAAqBD,EAAAC,sBACrBC,EAAQF,EAAAE,SACRC,EAAQH,EAAAG,SACRC,EAAQJ,EAAAI,SACRC,EAAQL,EAAAK,SACRC,EAAUN,EAAAM,WACVC,EAAYP,EAAAO,aACZC,EAAGR,EAAAQ,IACHC,EAAAT,EAAAU,KAAAA,OAAO,IAAAD,GAAKA,EAENE,EAASC,EAAuB,MAChCC,EAAgCC,GAAS,GAAxCC,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAC5BI,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EAAS,WAAM,OAAAN,GAAgBD,EAAY,EAC3CQ,EAAe,WAAM,OAAAP,GAAe,EAAM,EAG1CQ,EAAsBC,GAC1B,SAACC,GACOf,EAAOgB,UAAYhB,EAAOgB,QAAQC,SAASF,EAAEG,SACjDN,GAEJ,GACA,CAACZ,EAAOgB,UA0BV,OAvBAG,GACE,WACEP,GACF,GACA,CACEQ,WAAY,CAAC,WAEf,IAGFC,GAAU,WACJ/B,GACFA,EAAsBc,EAE1B,GAAG,CAACA,IAEJkB,GAAiB,WAEf,OADAC,SAASC,iBAAiB,QAASX,GAAqB,GACjD,WACLU,SAASE,oBAAoB,QAASZ,GAAqB,EAC5D,CACF,GAAE,IAGDa,EAACC,cAAAC,EAAc,CAAApB,MAAOA,GACpBkB,EAACC,cAAAE,SAAsB9B,EAAI+B,KAAQjC,EAAKkC,IAAK/B,GAC1C0B,EAAMM,SAASC,IACd1C,GACA,SAAC2C,GACC,OAAAR,EAAMS,aAAaD,EAAO,CACxBE,QAASzB,EACT,gBAAiBP,EACjB,gBAAiB,UAHnB,IAMHA,EACCsB,EAACC,cAAAU,aACY5C,GAAY,OAAM6C,UAClB9C,GAAY,iBACZE,GAAY,MACvBc,MAAOA,EACP+B,KAAK,SACO,aAAA5C,eACAS,GAEXR,GAED,MAIZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/ProgressBar/styles.ts"],"sourcesContent":["import styled, { css, keyframes } from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\nconst BAR_HEIGHT = \"16px\";\n\ntype CircleKeyCircleFillKeyFramesProps = {\n $strokeDashoffsetInit: number;\n strokeDashoffset: number;\n};\n\nconst CircleFillKeyFrames = ({\n $strokeDashoffsetInit,\n strokeDashoffset,\n}: CircleKeyCircleFillKeyFramesProps) => keyframes`\n 0% {\n stroke-dashoffset: ${$strokeDashoffsetInit} ;\n }\n 50% {\n stroke-dashoffset: ${strokeDashoffset} ;\n }\n 100% {\n stroke-dashoffset: ${strokeDashoffset} ;\n }\n`;\n\nconst SecondaryCircleFillKeyFrames = ({\n $strokeDashoffsetInit,\n strokeDashoffset,\n}: CircleKeyCircleFillKeyFramesProps) => keyframes`\n 0% {\n stroke-dashoffset: ${$strokeDashoffsetInit} ;\n }\n 100% {\n stroke-dashoffset: ${strokeDashoffset} ;\n }\n`;\n\nconst TargetBarPulseKeyFrames = () => keyframes`\n 0% {\n width: 0px;\n height: 0px;\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n width: 64px;\n height: 64px;\n right: -32px;\n }\n`;\n\nconst LineBarPulseKeyFrames = () => keyframes`\n 0% {\n transform: scale(1);\n border-radius: 0px;\n\n }\n 50% {\n transform:scale(1.025);\n }\n 100% {\n transform: scale(1);\n border-radius: 0px;\n }\n`;\n\nexport const ProgressBarWrapper = styled.div`\n margin-top: ${BAR_HEIGHT};\n`;\n\nexport const LineProgressBarWrapper = styled.div<{\n $percentage: number;\n $secondaryPercentage: number;\n theme: ThemeType;\n}>`\n position: relative;\n height: ${BAR_HEIGHT};\n margin-bottom: 0;\n background-color: ${({\n theme: {\n colors: { progressBarBackground },\n },\n }) => progressBarBackground};\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n\n ${({ $percentage, $secondaryPercentage }) =>\n ($percentage === 100 || $secondaryPercentage === 100) &&\n css`\n animation: ${LineBarPulseKeyFrames} 0.3s 0.5s 1 ease-out;\n `}\n`;\n\nexport const LineProgressBar = styled.div<{\n $percentage: number;\n $barColor?: string;\n $isSecondary?: boolean;\n theme: ThemeType;\n}>`\n position: absolute;\n left: 0;\n height: ${BAR_HEIGHT};\n background-color: ${({ $barColor, $isSecondary, theme }) =>\n !!$barColor || !!$isSecondary\n ? theme.colors.progressBarSecondary\n : theme.colors.progressBar};\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n transition: width 0.6s ease;\n width: ${({ $percentage }) => $percentage}%;\n\n &::before {\n content: \"\";\n display: inline-block;\n position: absolute;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 0px;\n height: 0px;\n border-radius: 50%;\n opacity: 0;\n filter: blur(2px);\n background-color: ${({\n $barColor,\n $isSecondary,\n theme: {\n colors: { progressBar, progressBarSecondary },\n },\n }) => ($barColor || $isSecondary ? progressBarSecondary : progressBar)};\n\n ${({ $percentage }) =>\n $percentage === 100 &&\n css`\n animation: ${TargetBarPulseKeyFrames} 0.33s 0.75s 3 ease-in;\n `}\n }\n`;\n\nexport const ScreenReaderOnly = styled.span`\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n`;\n\nexport const CircularWrapper = styled.div<{\n $circleSize: string;\n theme: ThemeType;\n}>`\n position: relative;\n width: ${({ $circleSize }) => $circleSize};\n height: ${({ $circleSize }) => $circleSize};\n background: none;\n margin: 0 auto;\n box-shadow: none;\n`;\n\nexport const CircleSvg = styled.svg`\n position: absolute;\n transform: rotate(-90deg);\n fill: none;\n stroke-linecap: round;\n width: 100%;\n height: 100%;\n`;\n\nexport const EmptyCircle = styled.circle<{\n theme: ThemeType;\n}>`\n stroke: ${({ theme }) => theme.tokenColors.grey_200};\n`;\n\nexport const FullCircle = styled.circle<{\n strokeDashoffset: number;\n theme: ThemeType;\n $strokeDashoffsetInit: number;\n $barColor?: string;\n $isSecondary?: boolean;\n}>`\n stroke: ${({\n $isSecondary,\n $barColor,\n theme: {\n colors: { circularProgress, circularProgressSecondary },\n },\n }) =>\n $barColor || $isSecondary ? circularProgressSecondary : circularProgress};\n animation: ${({ $isSecondary, strokeDashoffset, $strokeDashoffsetInit }) =>\n $isSecondary\n ? SecondaryCircleFillKeyFrames({\n strokeDashoffset,\n $strokeDashoffsetInit,\n })\n : CircleFillKeyFrames({ strokeDashoffset, $strokeDashoffsetInit })}\n 1s linear;\n`;\n\nexport const CircularValue = styled.div<{\n theme: ThemeType;\n}>`\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n z-index: 2;\n font-size: ${({\n theme: {\n fontSizes: { l },\n },\n }) => l};\n line-height: ${({\n theme: {\n fontSizes: { l },\n },\n }) => l};\n text-align: center;\n height: 100%;\n color: ${({\n theme: {\n colors: { textDark },\n },\n }) => textDark};\n`;\n"],"names":["BAR_HEIGHT","TargetBarPulseKeyFrames","keyframes","templateObject_3","__makeTemplateObject","LineBarPulseKeyFrames","templateObject_4","ProgressBarWrapper","styled","div","templateObject_5","LineProgressBarWrapper","templateObject_7","_a","theme","colors","progressBarBackground","$percentage","$secondaryPercentage","css","templateObject_6","LineProgressBar","templateObject_9","$barColor","$isSecondary","progressBarSecondary","progressBar","_b","templateObject_8","ScreenReaderOnly","span","templateObject_10","CircularWrapper","templateObject_11","$circleSize","CircleSvg","svg","templateObject_12","EmptyCircle","circle","templateObject_13","tokenColors","grey_200","FullCircle","templateObject_14","circularProgress","circularProgressSecondary","strokeDashoffset","$strokeDashoffsetInit","templateObject_2","SecondaryCircleFillKeyFrames","templateObject_1","CircleFillKeyFrames","CircularValue","templateObject_15","fontSizes","l","textDark"],"mappings":"0IAGA,kCAAMA,EAAa,OAkCbC,EAA0B,WAAM,OAAAC,EAASC,IAAAA,EAAAC,EAAA,CAAA,gMAAA,CAAA,kMAAT,EAiBhCC,EAAwB,WAAM,OAAAH,EAASI,IAAAA,EAAAF,EAAA,CAAA,sLAAA,CAAA,wLAAT,EAevBG,EAAqBC,EAAOC,IAAGC,IAAAA,EAAAN,EAAA,CAAA,mBAAA,OAAA,CAAA,mBAClB,SAAVJ,GAGHW,EAAyBH,EAAOC,IAI3CG,IAAAA,EAAAR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,IACS,SAAC3C,GAIV,OAFYA,EAAAC,MAAAyC,UAAAC,CAEZ,IAGG,SAAC3C,GAIJ,OAFgBA,EAAAC,MAAAC,OAAA0C,QAEhB"}
1
+ {"version":3,"file":"styles.js","sources":["../../../../src/components/ProgressBar/styles.ts"],"sourcesContent":["import styled, { css, keyframes } from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\nconst BAR_HEIGHT = \"16px\";\n\ntype CircleKeyCircleFillKeyFramesProps = {\n $strokeDashoffsetInit: number;\n strokeDashoffset: number;\n};\n\nconst CircleFillKeyFrames = ({\n $strokeDashoffsetInit,\n strokeDashoffset,\n}: CircleKeyCircleFillKeyFramesProps) => keyframes`\n 0% {\n stroke-dashoffset: ${$strokeDashoffsetInit} ;\n }\n 50% {\n stroke-dashoffset: ${strokeDashoffset} ;\n }\n 100% {\n stroke-dashoffset: ${strokeDashoffset} ;\n }\n`;\n\nconst SecondaryCircleFillKeyFrames = ({\n $strokeDashoffsetInit,\n strokeDashoffset,\n}: CircleKeyCircleFillKeyFramesProps) => keyframes`\n 0% {\n stroke-dashoffset: ${$strokeDashoffsetInit} ;\n }\n 100% {\n stroke-dashoffset: ${strokeDashoffset} ;\n }\n`;\n\nconst TargetBarPulseKeyFrames = () => keyframes`\n 0% {\n width: 0px;\n height: 0px;\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n width: 64px;\n height: 64px;\n right: -32px;\n }\n`;\n\nconst LineBarPulseKeyFrames = () => keyframes`\n 0% {\n transform: scale(1);\n border-radius: 0px;\n\n }\n 50% {\n transform:scale(1.025);\n }\n 100% {\n transform: scale(1);\n border-radius: 0px;\n }\n`;\n\nexport const ProgressBarWrapper = styled.div`\n margin-top: ${BAR_HEIGHT};\n`;\n\nexport const LineProgressBarWrapper = styled.div<{\n $percentage: number;\n $secondaryPercentage: number;\n theme: ThemeType;\n}>`\n position: relative;\n height: ${BAR_HEIGHT};\n margin-bottom: 0;\n background-color: ${({\n theme: {\n colors: { progressBarBackground },\n },\n }) => progressBarBackground};\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n\n ${({ $percentage, $secondaryPercentage }) =>\n ($percentage === 100 || $secondaryPercentage === 100) &&\n css`\n animation: ${LineBarPulseKeyFrames} 0.3s 0.5s 1 ease-out;\n `}\n`;\n\nexport const LineProgressBar = styled.div<{\n $percentage: number;\n $barColor?: string;\n $isSecondary?: boolean;\n theme: ThemeType;\n}>`\n position: absolute;\n left: 0;\n height: ${BAR_HEIGHT};\n background-color: ${({ $barColor, $isSecondary, theme }) =>\n !!$barColor || !!$isSecondary\n ? theme.colors.progressBarSecondary\n : theme.colors.progressBar};\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n transition: width 0.6s ease;\n width: ${({ $percentage }) => $percentage}%;\n\n &::before {\n content: \"\";\n display: inline-block;\n position: absolute;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 0px;\n height: 0px;\n border-radius: 50%;\n opacity: 0;\n filter: blur(2px);\n background-color: ${({\n $barColor,\n $isSecondary,\n theme: {\n colors: { progressBar, progressBarSecondary },\n },\n }) => ($barColor || $isSecondary ? progressBarSecondary : progressBar)};\n\n ${({ $percentage }) =>\n $percentage === 100 &&\n css`\n animation: ${TargetBarPulseKeyFrames} 0.33s 0.75s 3 ease-in;\n `}\n }\n`;\n\nexport const ScreenReaderOnly = styled.span`\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n`;\n\nexport const CircularWrapper = styled.div<{\n $circleSize: string;\n theme: ThemeType;\n}>`\n position: relative;\n width: ${({ $circleSize }) => $circleSize};\n height: ${({ $circleSize }) => $circleSize};\n background: none;\n margin: 0 auto;\n box-shadow: none;\n`;\n\nexport const CircleSvg = styled.svg`\n position: absolute;\n transform: rotate(-90deg);\n fill: none;\n stroke-linecap: round;\n width: 100%;\n height: 100%;\n`;\n\nexport const EmptyCircle = styled.circle<{\n theme: ThemeType;\n}>`\n stroke: ${({ theme }) => theme.tokenColors.grey_200};\n`;\n\nexport const FullCircle = styled.circle<{\n strokeDashoffset: number;\n theme: ThemeType;\n $strokeDashoffsetInit: number;\n $barColor?: string;\n $isSecondary?: boolean;\n}>`\n stroke: ${({\n $isSecondary,\n $barColor,\n theme: {\n colors: { circularProgress, circularProgressSecondary },\n },\n }) =>\n $barColor || $isSecondary ? circularProgressSecondary : circularProgress};\n animation: ${({ $isSecondary, strokeDashoffset, $strokeDashoffsetInit }) =>\n $isSecondary\n ? SecondaryCircleFillKeyFrames({\n strokeDashoffset,\n $strokeDashoffsetInit,\n })\n : CircleFillKeyFrames({ strokeDashoffset, $strokeDashoffsetInit })}\n 1s linear;\n`;\n\nexport const CircularValue = styled.div<{\n theme: ThemeType;\n}>`\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n z-index: 2;\n font-size: ${({\n theme: {\n fontSizes: { l },\n },\n }) => l};\n line-height: ${({\n theme: {\n fontSizes: { l },\n },\n }) => l};\n text-align: center;\n height: 100%;\n color: ${({\n theme: {\n colors: { textDark },\n },\n }) => textDark};\n`;\n"],"names":["BAR_HEIGHT","TargetBarPulseKeyFrames","keyframes","templateObject_3","__makeTemplateObject","LineBarPulseKeyFrames","templateObject_4","ProgressBarWrapper","styled","div","templateObject_5","LineProgressBarWrapper","templateObject_7","_a","theme","colors","progressBarBackground","$percentage","$secondaryPercentage","css","templateObject_6","LineProgressBar","templateObject_9","$barColor","$isSecondary","progressBarSecondary","progressBar","_b","templateObject_8","ScreenReaderOnly","span","templateObject_10","CircularWrapper","templateObject_11","$circleSize","CircleSvg","svg","templateObject_12","EmptyCircle","circle","templateObject_13","tokenColors","grey_200","FullCircle","templateObject_14","circularProgress","circularProgressSecondary","strokeDashoffset","$strokeDashoffsetInit","templateObject_2","SecondaryCircleFillKeyFrames","templateOb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C,sBACrBD,EAAgBlC,EAAAkC,iBACuB,OAAA7C,EAASiD,IAAAA,EAAA/C,EAAA,CAAA,qCAAA,6CAAA,8CAAA,aAAA,CAAA,qCAEH,6CAGL,8CAGA,eANhB4C,EAGAD,EAGAA,EARe,CA4L/BK,CAAoB,CAAEL,mBAAkBC,sBAAqBA,GALjE,IASOK,EAAgB7C,EAAOC,IAAG6C,IAAAA,EAAAlD,EAAA,CAAA,6MAAA,qBAAA,uDAAA,OAAA,CAErC,6MAeO,qBAKA,uDAOO,UAhBD,SAACS,GAIR,OAFYA,EAAAC,MAAAyC,UAAAC,CAEZ,IACS,SAAC3C,GAIV,OAFYA,EAAAC,MAAAyC,UAAAC,CAEZ,IAGG,SAAC3C,GAIJ,OAFgBA,EAAAC,MAAAC,OAAA0C,QAEhB"}
@@ -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,OAT2B,KAe7C"}
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,EAEb,EAEAI,GAAU,WACR,GAAKC,EAKL,OADAC,OAAOC,SAASC,iBAAiBV,GAAY,UAAWC,GACjD,WACLO,OAAOC,SAASE,oBAAoBX,GAAY,UAAWC,EAC7D,CACF,GAAGJ,GAAgB,GACrB"}
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,IACpB,EAEAI,GAAuB,WACrB,IAAMC,EAAe,WAEO,OAApBL,IACFA,EAAkBM,WAAWL,EAAUH,GAK7C,EAKA,OAJIrB,GACFC,OAAO6B,iBAAiB,SAAUF,GAG7B,WACD5B,GACFC,OAAO8B,oBAAoB,SAAUH,EAEzC,CACD,GAAER,EACL"}
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,GACnBC,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,GAClBC,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
+ {"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,qBAA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AYD,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":"uGAiBO,IAAMA,EAASC,EAAAA,EAAA,CAAA,EACjBC,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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kB,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 +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,CAAO,EANV"}
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,EACL,CACF"}
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"}