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AAEuD,KAAM,CAAEmB,GAAI,SAAUJ,MAAO,oBAAqBnE,QAAU0F,IAC1EA,EAAEhB,iBAS9BiB,uBACU3B,UAAU4B,UAAUC,UAAU9B,OAAO+B,SAASd,MACpDlB,GAAc,EAClB,CAX4BiC,EAAoB,GAExBnG,EAAAA,cAAoBC,EAAE0D,KAAM,MAAM4B,EAAAA,EAAAA,GAAiBC,EAAAA,EAAWhC,OAC9DS,GAAcjE,EAAAA,cAAoBC,EAAE4D,QAAS,KAAM,0BACnE,QACI,MAAM,IAAIuC,MAAO,wBASjC,IAAwBvB,CAPpB,KAIA,EAMJ,SAASa,EAAeb,GACpB,MAAQ,+CAA8CA,EAAKN,aAAaM,EAAKJ,KACjF,CACA,SAASmB,EAAcf,GACnB,MAAQ,yCAAwCA,EAAKN,aAAaM,EAAKJ,KAC3E,C","sources":["webpack://royal-college-radiologists/./src/helpers/global.ts","webpack://royal-college-radiologists/./src/stories/Components/General/SkipLink/SkipLink.styles.ts","webpack://royal-college-radiologists/./src/stories/Components/General/SkipLink/SkipLink.tsx","webpack://royal-college-radiologists/./src/stories/Components/Global/SectionWrapper/SectionWrapper.styles.ts","webpack://royal-college-radiologists/./src/hoc/withBaseProps.tsx","webpack://royal-college-radiologists/./src/stories/Components/Global/SectionWrapper/SectionWrapper.tsx","webpack://royal-college-radiologists/./src/stories/Widgets/SocialShareBanner/SocialShareBanner.styles.ts","webpack://royal-college-radiologists/./src/stories/Widgets/SocialShareBanner/SocialShareBanner.tsx"],"sourcesContent":["import { css } from 'styled-components';\r\nexport default {\r\n navHeight: 107,\r\n navHeightTablet: 80,\r\n navHeightMobile: 59,\r\n};\r\nexport const ButtonReset = css `\r\n border: none;\r\n outline: none;\r\n padding: 0px;\r\n background: none;\r\n border-radius: 0px;\r\n`;\r\n","import { transition } from '@helpers/animate';\r\nimport brand from '@helpers/brand';\r\nimport { ButtonReset } from '@helpers/global';\r\nimport { siteWide } from '@helpers/grid';\r\nimport { Layers } from '@helpers/layers';\r\nimport { paragraphRegular } from '@helpers/typography';\r\nimport styled from 'styled-components';\r\nconst Container = styled.div `\r\n ${siteWide};\r\n\r\n position: relative;\r\n z-index: ${Layers.NavigationTray + 1};\r\n height: 0;\r\n`;\r\nconst Button = styled.button `\r\n ${ButtonReset};\r\n ${transition('opacity, transform')};\r\n ${paragraphRegular};\r\n\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n margin: 0;\r\n opacity: 0;\r\n transform: translate(3px, -100%);\r\n background-color: var(--fgColour, ${brand.primary.offWhite});\r\n color: var(--bgColour, ${brand.primary.purple});\r\n padding: 8px 12px;\r\n\r\n &.focus-ring {\r\n outline: auto;\r\n outline-offset: 3px;\r\n outline-style: solid;\r\n outline-width: 2px;\r\n outline-color: var(--fgColour, ${brand.primary.offWhite});\r\n opacity: 1;\r\n transform: translate(3px, 3px);\r\n }\r\n`;\r\nconst SkipLinkStyles = {\r\n Container,\r\n Button,\r\n};\r\nexport default SkipLinkStyles;\r\n","import { scrollIntoView } from '@helpers/animate';\r\nimport * as React from 'react';\r\nimport { FocusRing } from 'react-aria';\r\nimport S from './SkipLink.styles';\r\nconst SkipLink = ({ type = 'inline' }) => {\r\n const ref = React.useRef(null);\r\n return (React.createElement(S.Container, null,\r\n React.createElement(FocusRing, { focusRingClass: \"focus-ring\" },\r\n React.createElement(S.Button, { ref: ref, onClick: () => {\r\n if (type === 'header') {\r\n skipToMain();\r\n }\r\n else {\r\n skipSection();\r\n }\r\n } }, type === 'header' ? React.createElement(React.Fragment, null, \"Skip to Main Content\") : React.createElement(React.Fragment, null, \"Skip to Next Section\")))));\r\n function skipToMain() {\r\n const targetEl = document.getElementById('main');\r\n if (!targetEl) {\r\n return;\r\n }\r\n scrollIntoView(targetEl);\r\n focusNext(targetEl);\r\n }\r\n function skipSection() {\r\n let wrapperEl = ref.current?.closest('div[class^=react_Components_]');\r\n // Should only ever occur in storybook\r\n if (!wrapperEl) {\r\n wrapperEl = ref.current?.closest('section');\r\n }\r\n let targetEl = wrapperEl?.nextElementSibling;\r\n // Last element in main wrapper, next element is footer\r\n if (!targetEl) {\r\n targetEl = wrapperEl?.parentElement?.nextElementSibling;\r\n }\r\n if (!targetEl) {\r\n return;\r\n }\r\n scrollIntoView(targetEl);\r\n focusNext(targetEl);\r\n }\r\n function focusNext(el) {\r\n const focusable = el.querySelectorAll('button');\r\n focusable[0]?.focus();\r\n }\r\n};\r\nexport default SkipLink;\r\n","import brand from '@helpers/brand';\r\nimport { fluid } from '@helpers/fluid';\r\nimport { ButtonReset } from '@helpers/global';\r\nimport { siteWide } from '@helpers/grid';\r\nimport { Device, from } from '@helpers/media';\r\nimport styled from 'styled-components';\r\nconst Container = styled.section `\r\n --sectionSpacingTop: ${fluid(32, 80)};\r\n --sectionSpacingBottom: ${fluid(32, 80)};\r\n --bgColour: transparent;\r\n --bgColourTint: ${brand.tint.offWhite};\r\n --fgColour: ${brand.primary.purple};\r\n --fgColourTint: ${brand.tint.purple};\r\n\r\n position: relative;\r\n scroll-margin: var(--stickyHeaderHeight) 0 0;\r\n background-color: var(--bgColour);\r\n color: var(--fgColour);\r\n\r\n &[data-variant='light'] {\r\n --bgColour: ${brand.primary.offWhite};\r\n --bgColourTint: ${brand.tint.offWhite};\r\n --fgColour: ${brand.primary.purple};\r\n --fgColourTint: ${brand.tint.purple};\r\n }\r\n\r\n &[data-variant='dark'] {\r\n --bgColour: ${brand.primary.purple};\r\n --bgColourTint: ${brand.tint.purple};\r\n --fgColour: ${brand.primary.offWhite};\r\n --fgColourTint: ${brand.tint.offWhite};\r\n }\r\n\r\n &[data-allow-scroll-margin='true'],\r\n &[data-has-skip='true'] {\r\n overflow: clip;\r\n overflow: hidden;\r\n }\r\n\r\n &[data-flush='top'] {\r\n --sectionSpacingTop: 0;\r\n\r\n @media ${from(Device.Tablet)} {\r\n --sectionSpacingTop: 0;\r\n }\r\n }\r\n\r\n &[data-flush='bottom'] {\r\n --sectionSpacingBottom: 0;\r\n\r\n @media ${from(Device.Tablet)} {\r\n --sectionSpacingBottom: 0;\r\n }\r\n }\r\n\r\n &[data-flush='both'] {\r\n --sectionSpacingTop: 0;\r\n --sectionSpacingBottom: 0;\r\n\r\n @media ${from(Device.Tablet)} {\r\n --sectionSpacingTop: 0;\r\n --sectionSpacingBottom: 0;\r\n }\r\n }\r\n\r\n /* Negative margin bottom to force overlap */\r\n &[data-overlap-bottom='true'] {\r\n margin-bottom: calc(var(--sectionSpacingBottom) * -1);\r\n }\r\n\r\n .equally-ai___high-saturation & {\r\n filter: saturate(200%);\r\n }\r\n\r\n .equally-ai___reverse-contrast & {\r\n filter: invert(100%);\r\n }\r\n\r\n .equally-ai___monochrome-contrast & {\r\n filter: grayscale(100%);\r\n }\r\n\r\n .equally-ai___reverse-contrast.equally-ai___monochrome-contrast & {\r\n filter: grayscale(100%) invert(100%);\r\n }\r\n`;\r\nconst Inner = styled.div `\r\n color: var(--fgColor);\r\n padding-top: var(--sectionSpacingTop);\r\n padding-bottom: var(--sectionSpacingBottom);\r\n\r\n /* Don't apply background color for white backgrounds */\r\n ${Container} & {\r\n background: var(--bgColor);\r\n }\r\n`;\r\nconst SiteWide = styled.div `\r\n ${siteWide}\r\n`;\r\nconst FocusAnchor = styled.button `\r\n ${ButtonReset};\r\n\r\n height: 0;\r\n width: 0;\r\n`;\r\nconst SectionWrapperStyles = {\r\n Container,\r\n Inner,\r\n SiteWide,\r\n FocusAnchor,\r\n};\r\nexport default SectionWrapperStyles;\r\n","import * as React from 'react';\r\nconst BasePropsContext = React.createContext({});\r\nexport function withBaseProps(WrappedComponent) {\r\n const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\r\n const ComponentWithBaseProps = (props) => {\r\n return (React.createElement(BasePropsContext.Provider, { value: props },\r\n React.createElement(WrappedComponent, { ...props })));\r\n };\r\n ComponentWithBaseProps.displayName = `withBaseProps(${displayName})`;\r\n return ComponentWithBaseProps;\r\n}\r\nexport const useBaseProps = () => React.useContext(BasePropsContext);\r\n","import { useBaseProps } from '@hoc/withBaseProps';\r\nimport SkipLink from '@stories/Components/General/SkipLink/SkipLink';\r\nimport * as React from 'react';\r\nimport S from './SectionWrapper.styles';\r\nconst SectionWrapper = React.forwardRef((props, ref) => {\r\n const { children, layout = 'default', flush = 'none', variant = 'none', removeSkipLink, ...otherProps } = props;\r\n const baseProps = useBaseProps();\r\n return (React.createElement(S.Container, { ref: ref, id: baseProps.id, \"data-allow-scroll-margin\": !!baseProps.id, \"data-flush\": flush, \"data-variant\": variant, \"data-has-skip\": !removeSkipLink, ...otherProps },\r\n React.createElement(S.Inner, null,\r\n !removeSkipLink ? React.createElement(SkipLink, null) : React.createElement(S.FocusAnchor, { \"aria-label\": \"Skip to content anchor\" }),\r\n renderLayout())));\r\n function renderLayout() {\r\n if (layout === 'fullWidth') {\r\n return children;\r\n }\r\n return React.createElement(S.SiteWide, null, children);\r\n }\r\n});\r\nSectionWrapper.displayName = 'SectionWrapper';\r\nexport default SectionWrapper;\r\n","import { shouldAnimate, transition } from '@helpers/animate';\r\nimport { fluid } from '@helpers/fluid';\r\nimport { ButtonReset } from '@helpers/global';\r\nimport { baseGrid } from '@helpers/grid';\r\nimport { Device, from } from '@helpers/media';\r\nimport { label } from '@helpers/typography';\r\nimport SectionWrapper from '@stories/Components/Global/SectionWrapper/SectionWrapper';\r\nimport SectionWrapperStyles from '@stories/Components/Global/SectionWrapper/SectionWrapper.styles';\r\nimport styled, { css } from 'styled-components';\r\nconst Container = styled(SectionWrapper) `\r\n --itemGap: ${fluid(8, 12)};\r\n --itemSize: 26px;\r\n\r\n color: var(--fgColour);\r\n\r\n ${SectionWrapperStyles.SiteWide} {\r\n ${baseGrid};\r\n }\r\n`;\r\nconst List = styled.ul `\r\n grid-column: 1 / span 12;\r\n display: flex;\r\n align-items: center;\r\n gap: calc(var(--itemGap) * 0.5) var(--itemGap);\r\n flex-wrap: wrap;\r\n padding: ${fluid(12, 42)} 0 ${fluid(12, 24)};\r\n\r\n @media ${from(Device.Tablet)} {\r\n grid-column: 2 / span 5;\r\n }\r\n\r\n @media ${from(Device.TabletLarge)} {\r\n grid-column: 3 / span 4;\r\n }\r\n\r\n @media ${from(Device.Desktop)} {\r\n grid-column: 4 / span 3;\r\n }\r\n`;\r\nconst Item = styled.li `\r\n &:nth-child(2) {\r\n width: 100%;\r\n\r\n @media ${from(Device.MobileLarge)} {\r\n display: none;\r\n }\r\n }\r\n`;\r\nconst Link = styled.a `\r\n ${ButtonReset};\r\n ${label};\r\n\r\n display: block;\r\n position: relative;\r\n color: currentColor;\r\n border: 0;\r\n margin: 0;\r\n text-decoration: none;\r\n\r\n &[data-icon='true'] {\r\n border-radius: 50%;\r\n }\r\n\r\n &.focus-ring {\r\n outline: auto;\r\n outline-offset: 3px;\r\n outline-style: solid;\r\n outline-width: 2px;\r\n }\r\n`;\r\nconst Icon = styled.span `\r\n ${transition('transform, opacity')};\r\n\r\n display: block;\r\n height: var(--itemSize);\r\n color: currentColor;\r\n width: var(--itemSize);\r\n\r\n > svg {\r\n display: block;\r\n width: 100%;\r\n }\r\n\r\n ${Link}.focus-ring &,\r\n ${Link}:hover & {\r\n transform: scale(1.15);\r\n opacity: 0.8;\r\n }\r\n`;\r\nconst Tooltip = styled.div `\r\n ${label};\r\n\r\n margin: 0;\r\n border-radius: 4px;\r\n background-color: var(--fgColour);\r\n color: var(--bgColour);\r\n padding: 3px 6px;\r\n position: absolute;\r\n top: 50%;\r\n left: 4px;\r\n transform: translate(var(--itemSize), -50%);\r\n white-space: nowrap;\r\n\r\n ${shouldAnimate(css `\r\n animation: 1.5s ease alternate 2 both fadeIn;\r\n `)}\r\n\r\n @keyframes fadeIn {\r\n 0% {\r\n opacity: 0;\r\n transform: translate(calc(var(--itemSize) * 0.33), -50%);\r\n }\r\n\r\n 33% {\r\n transform: translate(var(--itemSize), -50%);\r\n }\r\n\r\n 66% {\r\n opacity: 1;\r\n }\r\n }\r\n`;\r\nconst SocialShareBannerStyles = {\r\n Container,\r\n Icon,\r\n Item,\r\n Link,\r\n List,\r\n Tooltip,\r\n};\r\nexport default SocialShareBannerStyles;\r\n","import { getSvgFromSystem, SystemIcon } from '@helpers/systemIcons';\r\nimport * as React from 'react';\r\nimport { FocusRing } from 'react-aria';\r\nimport S from './SocialShareBanner.styles';\r\nconst SocialShareBanner = (props) => {\r\n /*\r\n Disable browser share button initially. Do check on first render,\r\n then enable to prevent CLS issues.\r\n */\r\n const [canShare, setCanShare] = React.useState(false);\r\n const [showCopied, setShowCopied] = React.useState(false);\r\n React.useEffect(() => {\r\n setCanShare(typeof window != 'undefined' && window.navigator && 'share' in window.navigator);\r\n }, []);\r\n /* Remove tooltip once it has faded out */\r\n React.useEffect(() => {\r\n if (showCopied) {\r\n setTimeout(() => setShowCopied(false), 3001);\r\n }\r\n }, [showCopied]);\r\n const shareData = {\r\n title: props.shareTitle,\r\n url: props.shareUrl,\r\n };\r\n return (React.createElement(S.Container, { variant: props.variant, flush: \"both\" },\r\n React.createElement(S.List, null,\r\n React.createElement(S.Item, null,\r\n React.createElement(FocusRing, { focusRingClass: \"focus-ring\" },\r\n React.createElement(S.Link, { as: \"button\", title: \"Share\", type: \"button\", onClick: (event) => {\r\n event.preventDefault();\r\n share(shareData);\r\n }, disabled: !canShare }, \"Share\"))),\r\n React.createElement(S.Item, null),\r\n props.options.map(renderButton))));\r\n function renderButton(option) {\r\n switch (option) {\r\n case 'facebook':\r\n return (React.createElement(S.Item, null,\r\n React.createElement(FocusRing, { focusRingClass: \"focus-ring\" },\r\n React.createElement(S.Link, { href: getFacebookUrl(shareData), rel: \"noreferrer noopener\", target: \"_blank\", title: \"Share via Facebook\" },\r\n React.createElement(S.Icon, null, getSvgFromSystem(SystemIcon.Facebook))))));\r\n case 'linkedin':\r\n return (React.createElement(S.Item, null,\r\n React.createElement(FocusRing, { focusRingClass: \"focus-ring\" },\r\n React.createElement(S.Link, { href: getLinkedInUrl(shareData), rel: \"noreferrer noopener\", target: \"_blank\", title: \"Share via LinkedIn\" },\r\n React.createElement(S.Icon, null, getSvgFromSystem(SystemIcon.Linkedin))))));\r\n case 'twitter':\r\n return (React.createElement(S.Item, null,\r\n React.createElement(FocusRing, { focusRingClass: \"focus-ring\" },\r\n React.createElement(S.Link, { href: getTwitterUrl(shareData), rel: \"noreferrer noopener\", target: \"_blank\", title: \"Share via Twitter\" },\r\n React.createElement(S.Icon, null, getSvgFromSystem(SystemIcon.Twitter))))));\r\n case 'clipboard':\r\n return (React.createElement(S.Item, null,\r\n React.createElement(FocusRing, { focusRingClass: \"focus-ring\" },\r\n React.createElement(S.Link, { as: \"button\", title: \"Copy to Clipboard\", onClick: (e) => {\r\n e.preventDefault();\r\n copyUrlToClipboard();\r\n } },\r\n React.createElement(S.Icon, null, getSvgFromSystem(SystemIcon.Link)),\r\n showCopied && React.createElement(S.Tooltip, null, \"Copied to Clipboard\")))));\r\n default:\r\n throw new Error(`Unknown share option`);\r\n }\r\n }\r\n async function copyUrlToClipboard() {\r\n await navigator.clipboard.writeText(window.location.href);\r\n setShowCopied(true);\r\n }\r\n};\r\nexport default SocialShareBanner;\r\nfunction getFacebookUrl(data) {\r\n return `https://www.facebook.com/sharer/sharer.php?u=${data.url}`;\r\n}\r\nfunction getLinkedInUrl(data) {\r\n return `https://www.linkedin.com/shareArticle?title=${data.title}&url=${data.url}`;\r\n}\r\nfunction getTwitterUrl(data) {\r\n return `https://twitter.com/intent/tweet?text=${data.title}&url=${data.url}`;\r\n}\r\n/**\r\n * Attempt to share using the Web Share API.\r\n * @param data The share data\r\n */\r\nfunction share(data) {\r\n return navigator.share(data);\r\n}\r\n"],"names":["ButtonReset","css","Container","styled","div","withConfig","displayName","componentId","siteWide","Layers","NavigationTray","Button","button","transition","paragraphRegular","brand","primary","offWhite","purple","_ref","type","ref","React","S","FocusRing","focusRingClass","onClick","targetEl","document","getElementById","scrollIntoView","focusNext","skipToMain","_ref$current","_wrapperEl","wrapperEl","current","closest","_ref$current2","nextElementSibling","_wrapperEl2","_wrapperEl2$parentEle","parentElement","skipSection","el","_focusable$","querySelectorAll","focus","section","fluid","tint","from","Device","Tablet","Inner","SiteWide","FocusAnchor","BasePropsContext","SectionWrapper","props","children","layout","flush","variant","removeSkipLink","otherProps","baseProps","id","SkipLink","SectionWrapperStyles","baseGrid","List","ul","TabletLarge","Desktop","Item","li","MobileLarge","Link","a","label","Icon","span","Tooltip","shouldAnimate","canShare","setCanShare","showCopied","setShowCopied","window","navigator","setTimeout","shareData","title","shareTitle","url","shareUrl","as","event","data","preventDefault","share","disabled","options","map","option","href","rel","target","getSvgFromSystem","SystemIcon","Facebook","getLinkedInUrl","Linkedin","getTwitterUrl","Twitter","e","async","clipboard","writeText","location","copyUrlToClipboard","Error"],"sourceRoot":""}