@laerdal/life-react-components 1.3.1-dev.3 → 1.3.2-dev.1.full
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/AuthPage/AuthPage.js +1 -1
- package/dist/esm/AuthPage/AuthPage.js.map +1 -1
- package/dist/esm/AuthPage/Information.js +1 -1
- package/dist/esm/AuthPage/Information.js.map +1 -1
- package/dist/esm/Banners/Banner.js +16 -16
- package/dist/esm/Banners/Banner.js.map +1 -1
- package/dist/esm/Modals/__tests__/Modal.test.js +154 -0
- package/dist/esm/Modals/__tests__/Modal.test.js.map +1 -0
- package/dist/esm/styles/typography.js +66 -66
- package/dist/esm/styles/typography.js.map +1 -1
- package/dist/js/AuthPage/AuthPage.js +1 -1
- package/dist/js/AuthPage/AuthPage.js.map +1 -1
- package/dist/js/AuthPage/Information.d.ts +1 -1
- package/dist/js/AuthPage/Information.js +1 -1
- package/dist/js/AuthPage/Information.js.map +1 -1
- package/dist/js/Banners/Banner.js +19 -16
- package/dist/js/Banners/Banner.js.map +1 -1
- package/dist/js/Modals/__tests__/Modal.test.js +231 -0
- package/dist/js/Modals/__tests__/Modal.test.js.map +1 -0
- package/dist/js/styles/typography.d.ts +6 -6
- package/dist/js/styles/typography.js +66 -66
- package/dist/js/styles/typography.js.map +1 -1
- package/dist/umd/AuthPage/AuthPage.js +1 -1
- package/dist/umd/AuthPage/AuthPage.js.map +1 -1
- package/dist/umd/AuthPage/Information.js +1 -1
- package/dist/umd/AuthPage/Information.js.map +1 -1
- package/dist/umd/Banners/Banner.js +16 -16
- package/dist/umd/Banners/Banner.js.map +1 -1
- package/dist/umd/Modals/__tests__/Modal.test.js +173 -0
- package/dist/umd/Modals/__tests__/Modal.test.js.map +1 -0
- package/dist/umd/styles/typography.js +66 -66
- package/dist/umd/styles/typography.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/styles/typography.tsx"],"names":["TYPOGRAPHY","fontFamily","TypographyBase","$color","lineHeight","$fontSize","$fontWeight","$fontStyle","textTransform","textDecorationLine","fontSize","fontWeight","fontStyle","color","COLORS","black","HeadlineBaseStyling","css","HeadlineBase","HeadlineXLStyling","HeadlineXL","HeadlineLStyling","HeadlineL","HeadlineMStyling","HeadlineM","HeadlineSStyling","HeadlineS","HeadlineXSStyling","HeadlineXS","HeadlineXXSStyling","HeadlineXXS","ParagraphStyling","ParagraphBase","props","marginBetweenParagraphs","ParagraphTextStyle","paragraphFontWeight","textStyle","Bold","paragraphFontStyle","Italic","paragraphTextDecorationLine","textDecoration","Underline","ParagraphBaseStyling","ParagraphXlStyling","ParagraphXL","children","ParagraphLStyling","ParagraphL","ParagraphMStyling","ParagraphM","ParagraphSStyling","ParagraphS","ParagraphXSStyling","ParagraphXS","ComponentTextStyle","componentFontWeight","UppercaseBold","componentFontStyle","componentTextTransformation","ComponentStyling","ComponentXLStyling","ComponentXL","className","ComponentLStyling","ComponentL","ComponentMStyling","ComponentM","ComponentSStyling","ComponentS","ComponentXSStyling","ComponentXS","ComponentXXSStyling","ComponentXXS","ComponentResponsive","size","width","fontsize","Size","Small","Medium","Large","XXSmall","XSmall"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;;;;;;;AAEA,IAAMA,UAAU,GAAG;AACjBC,EAAAA,UAAU,EAAE;AADK,CAAnB;;AAcA,IAAMC,cAAc,GAAG,+BAAO,KAAP,EAA+B;AAAA,MAAGC,MAAH,QAAGA,MAAH;AAAA,MAAWC,UAAX,QAAWA,UAAX;AAAA,MAAuBC,SAAvB,QAAuBA,SAAvB;AAAA,MAAkCC,WAAlC,QAAkCA,WAAlC;AAAA,MAA+CC,UAA/C,QAA+CA,UAA/C;AAAA,MAA2DC,aAA3D,QAA2DA,aAA3D;AAAA,MAA0EC,kBAA1E,QAA0EA,kBAA1E;AAAA,SAAoG;AACxJR,IAAAA,UAAU,EAAED,UAAU,CAACC,UADiI;AAEx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D;AAAY,QAAA,KAAK,EAAErE,KAAnB;AAA0B,QAAA,SAAS,EAAEwB,SAArC;AAAgD,QAAA,QAAQ,EAAEU;AAA1D,QAAP;AAXJ;AAaD,CAxBD;;;;AAtGElC,EAAAA,K;AACAmD,EAAAA,S;AACA3B,EAAAA,S","sourcesContent":["import React, { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { COLORS } from '.';\nimport { Property } from 'csstype';\nimport { Size } from '../types';\n\nconst TYPOGRAPHY = {\n fontFamily: 'Lato, sans-serif',\n};\n\ninterface ITypographyBase {\n $color?: string;\n lineHeight: number;\n $fontSize: number;\n $fontWeight: number;\n $fontStyle?: string;\n textTransform?: Property.TextTransform;\n textDecorationLine?: Property.TextDecorationLine;\n}\n\nconst TypographyBase = styled('div')<ITypographyBase>(({ $color, lineHeight, $fontSize, $fontWeight, $fontStyle, textTransform, textDecorationLine }) => ({\n fontFamily: TYPOGRAPHY.fontFamily,\n fontSize: $fontSize,\n fontWeight: $fontWeight,\n lineHeight: lineHeight + 'px',\n textTransform: textTransform ? textTransform : 'none',\n textDecorationLine: textDecorationLine ? textDecorationLine : 'none',\n fontStyle: $fontStyle ? $fontStyle : 'normal',\n color: $color ? $color : COLORS.black,\n}));\n\ninterface IHeadline {\n $color?: string;\n}\n\ninterface IHeadlineBase {\n $color?: string;\n lineHeight: number;\n fontSize: number;\n}\n\nconst HeadlineBaseStyling = (fontSize: string, lineHeight: string, color: string) => {\n return css`\n font-family: ${TYPOGRAPHY.fontFamily};\n font-size: ${fontSize};\n line-height: ${lineHeight};\n font-weight: 700;\n color: ${color};\n `;\n};\nconst HeadlineBase = styled(TypographyBase)<IHeadlineBase>(({ $color, lineHeight, fontSize }) => ({\n fontSize: fontSize,\n fontWeight: 700,\n lineHeight: lineHeight,\n color: $color,\n}));\n\nconst HeadlineXLStyling = (color: string) => HeadlineBaseStyling('48px', '64px', color);\nconst HeadlineXL = styled(HeadlineBase)<IHeadline>(({ $color }) => ({\n fontSize: '48px',\n lineHeight: '64px',\n color: $color,\n}));\n\nconst HeadlineLStyling = (color: string) => HeadlineBaseStyling('40px', '52px', color);\nconst HeadlineL = styled(HeadlineBase)<IHeadline>(({ $color }) => ({\n fontSize: '40px',\n lineHeight: '52px',\n color: $color,\n}));\n\nconst HeadlineMStyling = (color: string) => HeadlineBaseStyling('32px', '40px', color);\nconst HeadlineM = styled(HeadlineBase)<IHeadline>(({ $color }) => ({\n fontSize: '32px',\n lineHeight: '40px',\n color: $color,\n}));\n\nconst HeadlineSStyling = (color: string) => HeadlineBaseStyling('28px', '36px', color);\nconst HeadlineS = styled(HeadlineBase)<IHeadline>(({ $color }) => ({\n fontSize: '28px',\n lineHeight: '36px',\n color: $color,\n}));\n\nconst HeadlineXSStyling = (color: string) => HeadlineBaseStyling('24px', '32px', color);\nconst HeadlineXS = styled(HeadlineBase)<IHeadline>(({ $color }) => ({\n fontSize: '24px',\n lineHeight: '32px',\n color: $color,\n}));\n\nconst HeadlineXXSStyling = (color: string) => HeadlineBaseStyling('20px', '24px', color);\nconst HeadlineXXS = styled(HeadlineBase)<IHeadline>(({ $color }) => ({\n fontSize: '20px',\n lineHeight: '24px',\n color: $color,\n}));\n\nconst ParagraphStyling = css`\n :lang(ja-jp) > h1,\n h2,\n h3,\n h4,\n p,\n span {\n max-width: 30em;\n }\n :lang(ko-kr) > h1,\n h2,\n h3,\n h4,\n p,\n span {\n max-width: 30em;\n }\n :lang(zh-CN) > h1,\n h2,\n h3,\n h4,\n p,\n span {\n max-width: 30em;\n }\n h1,\n h2,\n h3,\n h4,\n p,\n span {\n max-width: 34em;\n }\n`;\n\ninterface IParagraphBase {\n color?: string;\n lineHeight: number;\n $fontSize: number;\n marginBetweenParagraphs?: string;\n}\n\nconst ParagraphBase = styled(TypographyBase)<IParagraphBase>`\n p {\n margin-block-start: 0;\n margin-block-end: 0;\n }\n p:not(:only-of-type) {\n margin-bottom: ${(props) => props.marginBetweenParagraphs || '0'};\n }\n ${ParagraphStyling}\n`;\n\ninterface IParagraph {\n color?: string;\n}\n\nenum ParagraphTextStyle {\n Regular = 1,\n Bold,\n Italic,\n Underline,\n}\n\ntype ParagraphProps = {\n color?: string;\n textStyle?: ParagraphTextStyle;\n};\n\nconst paragraphFontWeight = (textStyle?: ParagraphTextStyle) => {\n let fontWeight = 400;\n if (textStyle === ParagraphTextStyle.Bold) {\n fontWeight = 700;\n }\n return fontWeight;\n};\n\nconst paragraphFontStyle = (textStyle?: ParagraphTextStyle) => {\n let fontStyle = textStyle && textStyle === ParagraphTextStyle.Italic ? 'italic' : '';\n return fontStyle;\n};\n\nconst paragraphTextDecorationLine = (textStyle?: ParagraphTextStyle): Property.TextDecorationLine => {\n let textDecoration: Property.TextDecorationLine = textStyle && textStyle === ParagraphTextStyle.Underline ? 'underline' : 'none';\n return textDecoration;\n};\n\nconst ParagraphBaseStyling = (fontSize: string, lineHeight: string, textStyle: ParagraphTextStyle, color: string) => {\n return css`\n font-family: ${TYPOGRAPHY.fontFamily};\n font-size: ${fontSize};\n font-weight: ${paragraphFontWeight(textStyle)};\n line-height: ${lineHeight};\n font-style: ${paragraphFontStyle(textStyle)};\n color: ${color};\n `;\n};\n\nconst ParagraphXlStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('24px', '36px', textStyle, color);\nconst ParagraphXL: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase\n $color={color}\n lineHeight={36}\n $fontSize={24}\n $fontWeight={fontWeight}\n $fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n marginBetweenParagraphs=\"18px\">\n {children}\n </ParagraphBase>\n );\n};\n\nconst ParagraphLStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('20px', '32px', textStyle, color);\nconst ParagraphL: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase\n $color={color}\n lineHeight={32}\n $fontSize={20}\n $fontWeight={fontWeight}\n $fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n marginBetweenParagraphs=\"16px\">\n {children}\n </ParagraphBase>\n );\n};\n\nconst ParagraphMStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('18px', '28px', textStyle, color);\nconst ParagraphM: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase\n $color={color}\n lineHeight={28}\n $fontSize={18}\n $fontWeight={fontWeight}\n $fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n marginBetweenParagraphs=\"14px\">\n {children}\n </ParagraphBase>\n );\n};\n\nconst ParagraphSStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('16px', '24px', textStyle, color);\nconst ParagraphS: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase\n $color={color}\n lineHeight={24}\n $fontSize={16}\n $fontWeight={fontWeight}\n $fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n marginBetweenParagraphs=\"12px\">\n {children}\n </ParagraphBase>\n );\n};\n\nconst ParagraphXSStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('14px', '20px', textStyle, color);\nconst ParagraphXS: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase\n $color={color}\n lineHeight={20}\n $fontSize={14}\n $fontWeight={fontWeight}\n $fontStyle={fontStyle}\n textDecorationLine={textDecorationLine}\n marginBetweenParagraphs=\"10px\">\n {children}\n </ParagraphBase>\n );\n};\n\nenum ComponentTextStyle {\n Regular = 1,\n Bold,\n Italic,\n UppercaseBold,\n}\n\ntype ComponentProps = {\n color?: string;\n className?: string;\n textStyle?: ComponentTextStyle;\n};\n\nconst componentFontWeight = (textStyle?: ComponentTextStyle) => {\n let fontWeight = 400;\n if (textStyle === ComponentTextStyle.Bold || textStyle === ComponentTextStyle.UppercaseBold) {\n fontWeight = 700;\n }\n return fontWeight;\n};\n\nconst componentFontStyle = (textStyle?: ComponentTextStyle) => {\n let fontStyle = textStyle && textStyle === ComponentTextStyle.Italic ? 'italic' : '';\n return fontStyle;\n};\n\nconst componentTextTransformation = (textStyle?: ComponentTextStyle): Property.TextTransform => {\n let fontStyle: Property.TextTransform = textStyle && textStyle === ComponentTextStyle.UppercaseBold ? 'uppercase' : 'none';\n return fontStyle;\n};\n\nconst ComponentStyling = (fontSize: string, lineHeight: string, textStyle: ComponentTextStyle, color: string | undefined | null) => {\n return css`\n font-family: ${TYPOGRAPHY.fontFamily};\n font-size: ${fontSize};\n font-weight: ${componentFontWeight(textStyle)};\n line-height: ${lineHeight};\n font-style: ${componentFontStyle(textStyle)};\n ${color === null ? '' : `color: ${color || COLORS.black};`}\n `;\n};\n\nconst ComponentXLStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('24px', '28px', textStyle, color);\nconst ComponentXL: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase className={className} $color={color} lineHeight={28} $fontSize={24} $fontWeight={fontWeight} $fontStyle={fontStyle}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentLStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('20px', '24px', textStyle, color);\nconst ComponentL: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase className={className} $color={color} lineHeight={24} $fontSize={20} $fontWeight={fontWeight} $fontStyle={fontStyle}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentMStyling = (textStyle: ComponentTextStyle, color: string | undefined | null) => ComponentStyling('18px', '24px', textStyle, color);\nconst ComponentM: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase className={className} $color={color} lineHeight={24} $fontSize={18} $fontWeight={fontWeight} $fontStyle={fontStyle}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentSStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('16px', '20px', textStyle, color);\nconst ComponentS: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase className={className} $color={color} lineHeight={20} $fontSize={16} $fontWeight={fontWeight} $fontStyle={fontStyle}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentXSStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('14px', '16px', textStyle, color);\nconst ComponentXS: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n let textTransform = componentTextTransformation(textStyle);\n return (\n <TypographyBase className={className} $color={color} lineHeight={16} $fontSize={14} $fontWeight={fontWeight} $fontStyle={fontStyle} textTransform={textTransform}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentXXSStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('12px', '16px', textStyle, color);\nconst ComponentXXS: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n let textTransform = componentTextTransformation(textStyle);\n return (\n <TypographyBase className={className} $color={color} lineHeight={16} $fontSize={12} $fontWeight={fontWeight} $fontStyle={fontStyle} textTransform={textTransform}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentResponsive: FunctionComponent<ComponentProps & { size?: Size; width: number }> = ({ color, textStyle, children, size, width }) => {\n let fontsize = size;\n if (!size) {\n if (width < 768) {\n fontsize = Size.Small;\n } else if (width < 992) {\n fontsize = Size.Medium;\n } else {\n fontsize = Size.Large;\n }\n }\n switch (fontsize) {\n case Size.XXSmall:\n return <ComponentXXS color={color} textStyle={textStyle} children={children} />;\n case Size.XSmall:\n return <ComponentXS color={color} textStyle={textStyle} children={children} />;\n case Size.Small:\n return <ComponentS color={color} textStyle={textStyle} children={children} />;\n case Size.Medium:\n return <ComponentM color={color} textStyle={textStyle} children={children} />;\n case Size.Large:\n default:\n return <ComponentL color={color} textStyle={textStyle} children={children} />;\n }\n};\n\nexport { TYPOGRAPHY };\nexport { HeadlineXL, HeadlineL, HeadlineM, HeadlineS, HeadlineXS, HeadlineXXS };\nexport { ParagraphTextStyle, ParagraphXL, ParagraphL, ParagraphM, ParagraphS, ParagraphXS };\nexport { ComponentTextStyle, ComponentXL, ComponentL, ComponentM, ComponentS, ComponentXS, ComponentXXS, ComponentResponsive };\nexport { ComponentXLStyling, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXSStyling, ComponentXXSStyling };\nexport { ParagraphXlStyling, ParagraphLStyling, ParagraphMStyling, ParagraphSStyling, ParagraphXSStyling };\nexport { HeadlineXLStyling, HeadlineLStyling, HeadlineMStyling, HeadlineSStyling, HeadlineXSStyling, HeadlineXXSStyling };\n"],"file":"typography.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/styles/typography.tsx"],"names":["TYPOGRAPHY","fontFamily","TypographyBase","color","lineHeight","fontSize","fontWeight","fontStyle","textTransform","textDecorationLine","COLORS","black","HeadlineBaseStyling","css","HeadlineBase","HeadlineXLStyling","HeadlineXL","HeadlineLStyling","HeadlineL","HeadlineMStyling","HeadlineM","HeadlineSStyling","HeadlineS","HeadlineXSStyling","HeadlineXS","HeadlineXXSStyling","HeadlineXXS","ParagraphStyling","ParagraphBase","props","marginBetweenParagraphs","ParagraphTextStyle","paragraphFontWeight","textStyle","Bold","paragraphFontStyle","Italic","paragraphTextDecorationLine","textDecoration","Underline","ParagraphBaseStyling","ParagraphXlStyling","ParagraphXL","children","ParagraphLStyling","ParagraphL","ParagraphMStyling","ParagraphM","ParagraphSStyling","ParagraphS","ParagraphXSStyling","ParagraphXS","ComponentTextStyle","componentFontWeight","UppercaseBold","componentFontStyle","componentTextTransformation","ComponentStyling","ComponentXLStyling","ComponentXL","className","ComponentLStyling","ComponentL","ComponentMStyling","ComponentM","ComponentSStyling","ComponentS","ComponentXSStyling","ComponentXS","ComponentXXSStyling","ComponentXXS","ComponentResponsive","size","width","fontsize","Size","Small","Medium","Large","XXSmall","XSmall"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;;;;;;;AAEA,IAAMA,UAAU,GAAG;AACjBC,EAAAA,UAAU,EAAE;AADK,CAAnB;;AAcA,IAAMC,cAAc,GAAG,+BAAO,KAAP,EAA+B;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,MAAUC,UAAV,QAAUA,UAAV;AAAA,MAAsBC,QAAtB,QAAsBA,QAAtB;AAAA,MAAgCC,UAAhC,QAAgCA,UAAhC;AAAA,MAA4CC,SAA5C,QAA4CA,SAA5C;AAAA,MAAuDC,aAAvD,QAAuDA,aAAvD;AAAA,MAAsEC,kBAAtE,QAAsEA,kBAAtE;AAAA,SAAgG;AACpJR,IAAAA,UAAU,EAAED,UAAU,CAACC,UAD6H;AAEpJI,IAAAA,QAAQ,EAAEA,QAF0I;AAGpJC,IAAAA,UAAU,EAAEA,UAHwI;AAIpJF,IAAAA,UAAU,E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AAA0B,QAAA,SAAS,EAAE8B,SAArC;AAAgD,QAAA,QAAQ,EAAEU;AAA1D,QAAP;AAXJ;AAaD,CA9BD;;;;AAtGExC,EAAAA,K;AACAyD,EAAAA,S;AACA3B,EAAAA,S","sourcesContent":["import React, { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { COLORS } from '.';\nimport { Property } from 'csstype';\nimport { Size } from '../types';\n\nconst TYPOGRAPHY = {\n fontFamily: 'Lato, sans-serif',\n};\n\ninterface ITypographyBase {\n color?: string;\n lineHeight: number;\n fontSize: number;\n fontWeight: number;\n fontStyle?: string;\n textTransform?: Property.TextTransform;\n textDecorationLine?: Property.TextDecorationLine;\n}\n\nconst TypographyBase = styled('div')<ITypographyBase>(({ color, lineHeight, fontSize, fontWeight, fontStyle, textTransform, textDecorationLine }) => ({\n fontFamily: TYPOGRAPHY.fontFamily,\n fontSize: fontSize,\n fontWeight: fontWeight,\n lineHeight: lineHeight + 'px',\n textTransform: textTransform ? textTransform : 'none',\n textDecorationLine: textDecorationLine ? textDecorationLine : 'none',\n fontStyle: fontStyle ? fontStyle : 'normal',\n color: color ? color : COLORS.black,\n}));\n\ninterface IHeadline {\n color?: string;\n}\n\ninterface IHeadlineBase {\n color?: string;\n lineHeight: number;\n fontSize: number;\n}\n\nconst HeadlineBaseStyling = (fontSize: string, lineHeight: string, color: string) => {\n return css`\n font-family: ${TYPOGRAPHY.fontFamily};\n font-size: ${fontSize};\n line-height: ${lineHeight};\n font-weight: 700;\n color: ${color};\n `;\n}\nconst HeadlineBase = styled(TypographyBase)<IHeadlineBase>(({ color, lineHeight, fontSize }) => ({\n fontSize: fontSize,\n fontWeight: 700,\n lineHeight: lineHeight,\n color: color,\n}));\n\nconst HeadlineXLStyling = (color: string) => HeadlineBaseStyling('48px', '64px', color);\nconst HeadlineXL = styled(HeadlineBase)<IHeadline>(({ color }) => ({\n fontSize: '48px',\n lineHeight: '64px',\n color: color,\n}));\n\nconst HeadlineLStyling = (color: string) => HeadlineBaseStyling('40px', '52px', color);\nconst HeadlineL = styled(HeadlineBase)<IHeadline>(({ color }) => ({\n fontSize: '40px',\n lineHeight: '52px',\n color: color,\n}));\n\nconst HeadlineMStyling = (color: string) => HeadlineBaseStyling('32px', '40px', color);\nconst HeadlineM = styled(HeadlineBase)<IHeadline>(({ color }) => ({\n fontSize: '32px',\n lineHeight: '40px',\n color: color,\n}));\n\nconst HeadlineSStyling = (color: string) => HeadlineBaseStyling('28px', '36px', color);\nconst HeadlineS = styled(HeadlineBase)<IHeadline>(({ color }) => ({\n fontSize: '28px',\n lineHeight: '36px',\n color: color,\n}));\n\nconst HeadlineXSStyling = (color: string) => HeadlineBaseStyling('24px', '32px', color);\nconst HeadlineXS = styled(HeadlineBase)<IHeadline>(({ color }) => ({\n fontSize: '24px',\n lineHeight: '32px',\n color: color,\n}));\n\nconst HeadlineXXSStyling = (color: string) => HeadlineBaseStyling('20px', '24px', color);\nconst HeadlineXXS = styled(HeadlineBase)<IHeadline>(({ color }) => ({\n fontSize: '20px',\n lineHeight: '24px',\n color: color,\n}));\n\nconst ParagraphStyling = css`\n :lang(ja-jp) > h1,\n h2,\n h3,\n h4,\n p,\n span {\n max-width: 30em;\n }\n :lang(ko-kr) > h1,\n h2,\n h3,\n h4,\n p,\n span {\n max-width: 30em;\n }\n :lang(zh-CN) > h1,\n h2,\n h3,\n h4,\n p,\n span {\n max-width: 30em;\n }\n h1,\n h2,\n h3,\n h4,\n p,\n span {\n max-width: 34em;\n }\n`;\n\ninterface IParagraphBase {\n color?: string;\n lineHeight: number;\n fontSize: number;\n marginBetweenParagraphs?: string;\n}\n\nconst ParagraphBase = styled(TypographyBase)<IParagraphBase>`\n p {\n margin-block-start: 0;\n margin-block-end: 0;\n }\n p:not(:only-of-type) {\n margin-bottom: ${(props) => props.marginBetweenParagraphs || '0'};\n }\n ${ParagraphStyling}\n`;\n\ninterface IParagraph {\n color?: string;\n}\n\nenum ParagraphTextStyle {\n Regular = 1,\n Bold,\n Italic,\n Underline,\n}\n\ntype ParagraphProps = {\n color?: string;\n textStyle?: ParagraphTextStyle;\n};\n\nconst paragraphFontWeight = (textStyle?: ParagraphTextStyle) => {\n let fontWeight = 400;\n if (textStyle === ParagraphTextStyle.Bold) {\n fontWeight = 700;\n }\n return fontWeight;\n};\n\nconst paragraphFontStyle = (textStyle?: ParagraphTextStyle) => {\n let fontStyle = textStyle && textStyle === ParagraphTextStyle.Italic ? 'italic' : '';\n return fontStyle;\n};\n\nconst paragraphTextDecorationLine = (textStyle?: ParagraphTextStyle): Property.TextDecorationLine => {\n let textDecoration: Property.TextDecorationLine = textStyle && textStyle === ParagraphTextStyle.Underline ? 'underline' : 'none';\n return textDecoration;\n};\n\nconst ParagraphBaseStyling = (fontSize: string, lineHeight: string, textStyle: ParagraphTextStyle, color: string) => {\n return css`\n font-family: ${TYPOGRAPHY.fontFamily};\n font-size: ${fontSize};\n font-weight: ${paragraphFontWeight(textStyle)};\n line-height: ${lineHeight};\n font-style: ${paragraphFontStyle(textStyle)};\n color: ${color};\n `;\n}\n\nconst ParagraphXlStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('24px', '36px', textStyle, color);\nconst ParagraphXL: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase color={color} lineHeight={36} fontSize={24} fontWeight={fontWeight} fontStyle={fontStyle} textDecorationLine={textDecorationLine} marginBetweenParagraphs=\"18px\">\n {children}\n </ParagraphBase>\n );\n};\n\nconst ParagraphLStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('20px', '32px', textStyle, color);\nconst ParagraphL: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase color={color} lineHeight={32} fontSize={20} fontWeight={fontWeight} fontStyle={fontStyle} textDecorationLine={textDecorationLine} marginBetweenParagraphs=\"16px\">\n {children}\n </ParagraphBase>\n );\n};\n\nconst ParagraphMStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('18px', '28px', textStyle, color);\nconst ParagraphM: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase color={color} lineHeight={28} fontSize={18} fontWeight={fontWeight} fontStyle={fontStyle} textDecorationLine={textDecorationLine} marginBetweenParagraphs=\"14px\">\n {children}\n </ParagraphBase>\n );\n};\n\nconst ParagraphSStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('16px', '24px', textStyle, color);\nconst ParagraphS: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase color={color} lineHeight={24} fontSize={16} fontWeight={fontWeight} fontStyle={fontStyle} textDecorationLine={textDecorationLine} marginBetweenParagraphs=\"12px\">\n {children}\n </ParagraphBase>\n );\n};\n\nconst ParagraphXSStyling = (textStyle: ParagraphTextStyle, color: string) => ParagraphBaseStyling('14px', '20px', textStyle, color);\nconst ParagraphXS: FunctionComponent<ParagraphProps> = ({ color, textStyle, children }) => {\n let fontWeight = paragraphFontWeight(textStyle);\n let fontStyle = paragraphFontStyle(textStyle);\n let textDecorationLine = paragraphTextDecorationLine(textStyle);\n return (\n <ParagraphBase color={color} lineHeight={20} fontSize={14} fontWeight={fontWeight} fontStyle={fontStyle} textDecorationLine={textDecorationLine} marginBetweenParagraphs=\"10px\">\n {children}\n </ParagraphBase>\n );\n};\n\nenum ComponentTextStyle {\n Regular = 1,\n Bold,\n Italic,\n UppercaseBold,\n}\n\ntype ComponentProps = {\n color?: string;\n className?: string;\n textStyle?: ComponentTextStyle;\n};\n\nconst componentFontWeight = (textStyle?: ComponentTextStyle) => {\n let fontWeight = 400;\n if (textStyle === ComponentTextStyle.Bold || textStyle === ComponentTextStyle.UppercaseBold) {\n fontWeight = 700;\n }\n return fontWeight;\n};\n\nconst componentFontStyle = (textStyle?: ComponentTextStyle) => {\n let fontStyle = textStyle && textStyle === ComponentTextStyle.Italic ? 'italic' : '';\n return fontStyle;\n};\n\nconst componentTextTransformation = (textStyle?: ComponentTextStyle): Property.TextTransform => {\n let fontStyle: Property.TextTransform = textStyle && textStyle === ComponentTextStyle.UppercaseBold ? 'uppercase' : 'none';\n return fontStyle;\n};\n\nconst ComponentStyling = (fontSize: string, lineHeight: string, textStyle: ComponentTextStyle, color: string | undefined | null) => {\n return css`\n font-family: ${TYPOGRAPHY.fontFamily};\n font-size: ${fontSize};\n font-weight: ${componentFontWeight(textStyle)};\n line-height: ${lineHeight};\n font-style: ${componentFontStyle(textStyle)};\n ${color === null ? '' : `color: ${(color || COLORS.black)};`}\n `;\n};\n\nconst ComponentXLStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('24px', '28px', textStyle, color);\nconst ComponentXL: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase className={className} color={color} lineHeight={28} fontSize={24} fontWeight={fontWeight} fontStyle={fontStyle}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentLStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('20px', '24px', textStyle, color);\nconst ComponentL: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase className={className} color={color} lineHeight={24} fontSize={20} fontWeight={fontWeight} fontStyle={fontStyle}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentMStyling = (textStyle: ComponentTextStyle, color: string | undefined | null) => ComponentStyling('18px', '24px', textStyle, color);\nconst ComponentM: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase className={className} color={color} lineHeight={24} fontSize={18} fontWeight={fontWeight} fontStyle={fontStyle}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentSStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('16px', '20px', textStyle, color);\nconst ComponentS: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase className={className} color={color} lineHeight={20} fontSize={16} fontWeight={fontWeight} fontStyle={fontStyle}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentXSStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('14px', '16px', textStyle, color);\nconst ComponentXS: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n let textTransform = componentTextTransformation(textStyle);\n return (\n <TypographyBase className={className} color={color} lineHeight={16} fontSize={14} fontWeight={fontWeight} fontStyle={fontStyle} textTransform={textTransform}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentXXSStyling = (textStyle: ComponentTextStyle, color: string | null) => ComponentStyling('12px', '16px', textStyle, color);\nconst ComponentXXS: FunctionComponent<ComponentProps> = ({ color, textStyle, children, className }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n let textTransform = componentTextTransformation(textStyle);\n return (\n <TypographyBase className={className} color={color} lineHeight={16} fontSize={12} fontWeight={fontWeight} fontStyle={fontStyle} textTransform={textTransform}>\n {children}\n </TypographyBase>\n );\n};\n\nconst ComponentResponsive: FunctionComponent<ComponentProps & { size?: Size; width: number }> = ({\n color,\n textStyle,\n children,\n size,\n width,\n}) => {\n let fontsize = size;\n if (!size) {\n if (width < 768) {\n fontsize = Size.Small;\n } else if (width < 992) {\n fontsize = Size.Medium;\n } else {\n fontsize = Size.Large;\n }\n }\n switch (fontsize) {\n case Size.XXSmall:\n return <ComponentXXS color={color} textStyle={textStyle} children={children} />;\n case Size.XSmall:\n return <ComponentXS color={color} textStyle={textStyle} children={children} />;\n case Size.Small:\n return <ComponentS color={color} textStyle={textStyle} children={children} />;\n case Size.Medium:\n return <ComponentM color={color} textStyle={textStyle} children={children} />;\n case Size.Large:\n default:\n return <ComponentL color={color} textStyle={textStyle} children={children} />;\n }\n};\n\nexport { TYPOGRAPHY };\nexport { HeadlineXL, HeadlineL, HeadlineM, HeadlineS, HeadlineXS, HeadlineXXS };\nexport { ParagraphTextStyle, ParagraphXL, ParagraphL, ParagraphM, ParagraphS, ParagraphXS };\nexport { ComponentTextStyle, ComponentXL, ComponentL, ComponentM, ComponentS, ComponentXS, ComponentXXS, ComponentResponsive };\nexport { ComponentXLStyling, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXSStyling, ComponentXXSStyling };\nexport { ParagraphXlStyling, ParagraphLStyling, ParagraphMStyling, ParagraphSStyling, ParagraphXSStyling };\nexport { HeadlineXLStyling, HeadlineLStyling, HeadlineMStyling, HeadlineSStyling, HeadlineXSStyling, HeadlineXXSStyling };\n"],"file":"typography.js"}
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
screenSetsContainerId
|
|
99
99
|
}) => {
|
|
100
100
|
return /*#__PURE__*/React.createElement(React.Fragment, null, showInformationSection && /*#__PURE__*/React.createElement(_Information.InformationContainer, {
|
|
101
|
-
|
|
101
|
+
color: signUp ? _styles.COLORS.accent1_20 : _styles.COLORS.primary_20
|
|
102
102
|
}, /*#__PURE__*/React.createElement(_Information.InformationContent, null, (signUpPlaceholderImage || signInPlaceholderImage) && /*#__PURE__*/React.createElement(_Information.InformationImage, {
|
|
103
103
|
src: signUp ? signUpPlaceholderImage : signInPlaceholderImage,
|
|
104
104
|
alt: signUp ? signUpPlaceholderImageAlt : signInPlaceholderImageAlt
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/AuthPage/AuthPage.tsx"],"names":["showInformationSection","signUp","signUpPlaceholderImage","signInPlaceholderImage","signUpPlaceholderImageAlt","signInPlaceholderImageAlt","signUpInformationHeader","signInInformationHeader","signUpInformationText","signInInformationText","screenSetsContainerId","AuthPage","COLORS","primary_20"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;AACA;AACA;AACA;AACA;AACA,QAAMW,QAAQ,GAAG,CAAC;AAAA,IAAA,sBAAA;AAAA,IAAA,MAAA;AAAA,IAAA,sBAAA;AAAA,IAAA,sBAAA;AAAA,IAAA,yBAAA;AAAA,IAAA,yBAAA;AAAA,IAAA,uBAAA;AAAA,IAAA,uBAAA;AAAA,IAAA,qBAAA;AAAA,IAAA,qBAAA;AAWhBD,IAAAA;AAXgB,GAAD,KAYI;AACnB,WAAA,aACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACGV,sBAAsB,IAAA,aACrB,KAAA,CAAA,aAAA,CAAA,iCAAA,EAAA;AAAsB,MAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/AuthPage/AuthPage.tsx"],"names":["showInformationSection","signUp","signUpPlaceholderImage","signInPlaceholderImage","signUpPlaceholderImageAlt","signInPlaceholderImageAlt","signUpInformationHeader","signInInformationHeader","signUpInformationText","signInInformationText","screenSetsContainerId","AuthPage","COLORS","primary_20"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;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GAC,IAAAA,M;AAEAC,IAAAA,sB;AAEAC,IAAAA,sB;AAEAC,IAAAA,yB;AAEAC,IAAAA,yB;AAEAC,IAAAA,uB;AAEAC,IAAAA,uB;AAEAC,IAAAA,qB;AAEAC,IAAAA,qB;AAEAC,IAAAA,qB;;oBAuCF,Q","sourcesContent":["import * as React from 'react';\nimport { COLORS } from '../styles';\nimport ScreenSetsContainer from './ScreenSetsContainer';\nimport { InformationContainer, InformationContent, InformationHeader, InformationText, InformationImage } from './Information';\n\ntype AuthPageProps = {\n /** set this to 'false' to hide the left side illustration/information section */\n showInformationSection: boolean;\n /** true if 'sign-up' screen-set is showing, otherwise false.\n * The value can be set using 'onBeforeScreenLoad' in 'gigya.accounts.showScreenSet(...)' and checking the loaded screen-set */\n signUp: boolean;\n /** img src string for 'sign-up' placeholder image */\n signUpPlaceholderImage?: string;\n /** img src string for 'sign-in' placeholder image */\n signInPlaceholderImage?: string;\n /** img alt text string for 'sign-up' placeholder image */\n signUpPlaceholderImageAlt?: string;\n /** img alt text string for 'sign-in' placeholder image */\n signInPlaceholderImageAlt?: string;\n /** information header text string below 'sign-up' placeholder image */\n signUpInformationHeader?: string;\n /** information header text string below 'sign-in' placeholder image */\n signInInformationHeader?: string;\n /** information text string below 'sign-up' header text */\n signUpInformationText?: string;\n /** information text string below 'sign-in' header text */\n signInInformationText?: string;\n /** ID that will be given to the SAP CDC screen-sets container (must match 'containerID' in 'gigya.accounts.showScreenSet(...)'!) */\n screenSetsContainerId: string;\n};\n\n/**\n * The 'AuthPage' component consist of two containers: an 'Information' container on the left, and a 'ScreenSetsContainer' on the right.\n * The 'Information' container is optional and its contents depend on the context (sign-up or sign-in).\n * The 'ScreenSetsContainer' will contain the SAP CDC screen-sets.\n */\nconst AuthPage = ({\n showInformationSection,\n signUp,\n signUpPlaceholderImage,\n signInPlaceholderImage,\n signUpPlaceholderImageAlt,\n signInPlaceholderImageAlt,\n signUpInformationHeader,\n signInInformationHeader,\n signUpInformationText,\n signInInformationText,\n screenSetsContainerId,\n}: AuthPageProps) => {\n return (\n <>\n {showInformationSection && (\n <InformationContainer color={signUp ? COLORS.accent1_20 : COLORS.primary_20}>\n <InformationContent>\n {(signUpPlaceholderImage || signInPlaceholderImage) && (\n <InformationImage src={signUp ? signUpPlaceholderImage : signInPlaceholderImage} alt={signUp ? signUpPlaceholderImageAlt : signInPlaceholderImageAlt} />\n )}\n {(signUpInformationHeader || signInInformationHeader) && <InformationHeader>{signUp ? signUpInformationHeader : signInInformationHeader}</InformationHeader>}\n {(signUpInformationText || signInInformationText) && <InformationText>{signUp ? signUpInformationText : signInInformationText}</InformationText>}\n </InformationContent>\n </InformationContainer>\n )}\n <ScreenSetsContainer id={screenSetsContainerId} centerContents={!showInformationSection} />\n </>\n );\n};\n\nexport default AuthPage;\n"],"file":"AuthPage.js"}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
const InformationContainer = exports.InformationContainer = (0, _styledComponents2.default)(_AuthPageSection2.default)`
|
|
32
32
|
display: none;
|
|
33
|
-
background: ${props => props
|
|
33
|
+
background: ${props => props.color};
|
|
34
34
|
|
|
35
35
|
${_styles.BREAKPOINTS.MEDIUM} {
|
|
36
36
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/AuthPage/Information.tsx"],"names":["InformationContainer","styled","props","
|
|
1
|
+
{"version":3,"sources":["../../../src/AuthPage/Information.tsx"],"names":["InformationContainer","styled","props","color","BREAKPOINTS","MEDIUM","InformationContent","div","LARGE","InformationHeader","h2","HeadlineXLStyling","COLORS","InformationText","p","ParagraphLStyling","ParagraphTextStyle","InformationImage","img"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,QAAMA,oBAAoB,WAApBA,oBAAoB,GAAGC,gCAAM,yBAANA,CAA2C;AAC/E;AACA,gBAAgBC,KAAK,IAAIA,KAAK,CAACC,KAAM;AACrC;AACA,IAAIC,oBAAYC,MAAO;AACvB;AACA;AACA;AAPO,CAAA;AAUA,QAAMC,kBAAkB,WAAlBA,kBAAkB,GAAGL,2BAAOM,GAAI;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIH,oBAAYI,KAAM;AACtB;AACA;AACA;AAXO,CAAA;AAcA,QAAMC,iBAAiB,WAAjBA,iBAAiB,GAAGR,2BAAOS,EAAG;AAC3C,IAAIC,mCAAkBC,eAAD,KAAjBD,CAAgC;AACpC;AACA;AAHO,CAAA;AAMA,QAAME,eAAe,WAAfA,eAAe,GAAGZ,2BAAOa,CAAE;AACxC,IAAIC,mCAAkBC,2BAAD,OAAjBD,EAA8CH,eAA7B,WAAjBG,CAAkE;AACtE;AAFO,CAAA;AAKA,QAAME,gBAAgB,WAAhBA,gBAAgB,GAAGhB,2BAAOiB,GAAI;AAC3C;AACA;AAFO,CAAA","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport AuthPageSection from './_AuthPageSection';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle, HeadlineXL, ParagraphTextStyle} from '../styles';\nimport {ComponentLStyling, HeadlineXLStyling, ParagraphLStyling} from '../styles/typography';\n\nexport const InformationContainer = styled(AuthPageSection)<{ color: string }>`\n display: none;\n background: ${props => props.color};\n\n ${BREAKPOINTS.MEDIUM} {\n display: flex;\n padding-top: 56px;\n }\n`;\n\nexport const InformationContent = styled.div`\n display: flex;\n flex-direction: column;\n align-self: center;\n align-items: center;\n text-align: center;\n max-width: 100%;\n\n ${BREAKPOINTS.LARGE} {\n align-self: flex-end;\n margin-right: 48px;\n }\n`;\n\nexport const InformationHeader = styled.h2`\n ${HeadlineXLStyling(COLORS.black)}\n font-weight: 300;\n margin-bottom: 0;\n`;\n\nexport const InformationText = styled.p`\n ${ParagraphLStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}\n margin: 8px 0;\n`;\n\nexport const InformationImage = styled.img`\n height: 275px;\n max-width: 100%;\n`;\n"],"file":"Information.js"}
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
* Styles for <Banner />
|
|
84
84
|
*/
|
|
85
85
|
const BannerContainer = _styledComponents2.default.div`
|
|
86
|
-
background: ${props => props
|
|
86
|
+
background: ${props => props.type ? props.type : _styles.COLORS.correct_100};
|
|
87
87
|
min-height: 48px;
|
|
88
88
|
display: flex;
|
|
89
89
|
color: ${_styles.COLORS.black};
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
}
|
|
115
115
|
`;
|
|
116
116
|
const BannerCenter = _styledComponents2.default.div`
|
|
117
|
-
${props => (0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, props
|
|
118
|
-
|
|
117
|
+
${props => (0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, props.color)}
|
|
118
|
+
|
|
119
119
|
display: flex;
|
|
120
120
|
width: 100%;
|
|
121
121
|
margin: 0 0 0 16px;
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
`;
|
|
146
146
|
const ButtonContainer = _styledComponents2.default.div`
|
|
147
147
|
display: contents;
|
|
148
|
-
${props => props
|
|
148
|
+
${props => props.type ? (0, _styles2.getButtonStyle)(props.type) : null};
|
|
149
149
|
`;
|
|
150
150
|
const BannerContentWrapper = _styledComponents2.default.div`
|
|
151
151
|
display: flex;
|
|
@@ -182,12 +182,12 @@
|
|
|
182
182
|
case 'warning':
|
|
183
183
|
return /*#__PURE__*/React.createElement(BannerContainer, {
|
|
184
184
|
"data-testid": testId,
|
|
185
|
-
|
|
185
|
+
type: _styles.COLORS.warning_100,
|
|
186
186
|
link: _styles.COLORS.warning_700,
|
|
187
187
|
hover: _styles.COLORS.warning_20,
|
|
188
188
|
bottom: bottom
|
|
189
189
|
}, /*#__PURE__*/React.createElement(BannerCenter, {
|
|
190
|
-
|
|
190
|
+
color: _styles.COLORS.warning_700,
|
|
191
191
|
className: size
|
|
192
192
|
}, icon ? icon : noIcon ? null : /*#__PURE__*/React.createElement(_SystemIcons.Help, {
|
|
193
193
|
color: _styles.COLORS.warning_700,
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
href: link,
|
|
202
202
|
variant: "default"
|
|
203
203
|
}, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonContainer, {
|
|
204
|
-
|
|
204
|
+
type: formatTypeToLowerCase
|
|
205
205
|
}, /*#__PURE__*/React.createElement(_Button.IconButton, {
|
|
206
206
|
variant: "secondary",
|
|
207
207
|
shape: "circular",
|
|
@@ -216,13 +216,13 @@
|
|
|
216
216
|
case 'critical':
|
|
217
217
|
return /*#__PURE__*/React.createElement(BannerContainer, {
|
|
218
218
|
"data-testid": testId,
|
|
219
|
-
|
|
219
|
+
type: _styles.COLORS.critical_100,
|
|
220
220
|
link: _styles.COLORS.critical_700,
|
|
221
221
|
hover: _styles.COLORS.critical_20,
|
|
222
222
|
bottom: bottom,
|
|
223
223
|
className: size
|
|
224
224
|
}, /*#__PURE__*/React.createElement(BannerCenter, {
|
|
225
|
-
|
|
225
|
+
color: _styles.COLORS.critical_700,
|
|
226
226
|
className: size
|
|
227
227
|
}, icon ? icon : noIcon ? null : /*#__PURE__*/React.createElement(_SystemIcons.TechnicalWarning, {
|
|
228
228
|
color: _styles.COLORS.critical_700,
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
href: link,
|
|
237
237
|
variant: "default"
|
|
238
238
|
}, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonContainer, {
|
|
239
|
-
|
|
239
|
+
type: formatTypeToLowerCase
|
|
240
240
|
}, /*#__PURE__*/React.createElement(_Button.IconButton, {
|
|
241
241
|
variant: "secondary",
|
|
242
242
|
shape: "circular",
|
|
@@ -251,13 +251,13 @@
|
|
|
251
251
|
case 'positive':
|
|
252
252
|
return /*#__PURE__*/React.createElement(BannerContainer, {
|
|
253
253
|
"data-testid": testId,
|
|
254
|
-
|
|
254
|
+
type: _styles.COLORS.correct_100,
|
|
255
255
|
link: _styles.COLORS.correct_700,
|
|
256
256
|
hover: _styles.COLORS.correct_20,
|
|
257
257
|
bottom: bottom,
|
|
258
258
|
className: size
|
|
259
259
|
}, /*#__PURE__*/React.createElement(BannerCenter, {
|
|
260
|
-
|
|
260
|
+
color: _styles.COLORS.correct_700,
|
|
261
261
|
className: size
|
|
262
262
|
}, icon ? icon : noIcon ? null : /*#__PURE__*/React.createElement(_SystemIcons.ThumbsUp, {
|
|
263
263
|
color: _styles.COLORS.correct_700,
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
href: link,
|
|
272
272
|
variant: "default"
|
|
273
273
|
}, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonContainer, {
|
|
274
|
-
|
|
274
|
+
type: formatTypeToLowerCase
|
|
275
275
|
}, /*#__PURE__*/React.createElement(_Button.IconButton, {
|
|
276
276
|
variant: "secondary",
|
|
277
277
|
shape: "circular",
|
|
@@ -286,13 +286,13 @@
|
|
|
286
286
|
default:
|
|
287
287
|
return /*#__PURE__*/React.createElement(BannerContainer, {
|
|
288
288
|
"data-testid": testId,
|
|
289
|
-
|
|
289
|
+
type: _styles.COLORS.primary_100,
|
|
290
290
|
link: _styles.COLORS.primary_700,
|
|
291
291
|
hover: _styles.COLORS.primary_20,
|
|
292
292
|
bottom: bottom,
|
|
293
293
|
className: size
|
|
294
294
|
}, /*#__PURE__*/React.createElement(BannerCenter, {
|
|
295
|
-
|
|
295
|
+
color: _styles.COLORS.primary_700,
|
|
296
296
|
className: size
|
|
297
297
|
}, icon ? icon : noIcon ? null : /*#__PURE__*/React.createElement(_SystemIcons.Tip, {
|
|
298
298
|
color: _styles.COLORS.primary_700,
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
href: link,
|
|
307
307
|
variant: "default"
|
|
308
308
|
}, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonContainer, {
|
|
309
|
-
|
|
309
|
+
type: "neutral"
|
|
310
310
|
}, /*#__PURE__*/React.createElement(_Button.IconButton, {
|
|
311
311
|
variant: "secondary",
|
|
312
312
|
shape: "circular",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Banners/Banner.tsx"],"names":["BannerContainer","styled","div","props","COLORS","correct_100","black","BREAKPOINTS","MEDIUM","LARGE","link","BannerCenter","ComponentMStyling","ComponentTextStyle","ButtonWrapper","ButtonContainer","getButtonStyle","BannerContentWrapper","type","linkText","hover","bottom","testId","icon","onClose","noIcon","Banner","React","window","setWidth","formatTypeToLowerCase","size","warning_700","Math","critical_700","correct_700","primary_700"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;AACA;AACA;AAGA,QAAMA,eAAe,GAAGC,2BAAOC,GAAsB;AACrD,gBAAiBC,KAAD,IAA8BA,KAAK,CAALA,KAAAA,GAAcA,KAAK,CAAnBA,KAAAA,GAA4BC,eAAOC,WAAa;AAC9F;AACA;AACA,WAAWD,eAAOE,KAAM;AACxB,gBAAiBH,KAAD,IAA8BA,KAAK,CAALA,MAAAA,GAAAA,MAAAA,GAAwB,GAAK;AAC3E;AACA;AACA;AACA;AACA,MAAMI,oBAAYC,MAAO;AACzB;AACA;AACA,MAAMD,oBAAYE,KAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAcN,KAAD,IAAwBA,KAAK,CAACO,IAAK;AAChD;AA7BA,CAAA;AAgCA,QAAMC,YAAY,GAAGV,2BAAOC,GAAwB;AACpD,IAAKC,KAAD,IAAWS,mCAAkBC,2BAAD,OAAjBD,EAA8CT,KAAK,CAAlC,MAAjBS,CAA4D;AAC3E;AACA;AACA;AACA;AACA,IAAIL,oBAAYC,MAAO;AACvB;AACA;AACA,IAAID,oBAAYE,KAAM;AACtB;AACA;AACA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A;AAA0E,UAAA,yBAAyB,EAAEpB,eAArG,KAAA;AAAmH,UAAA,MAAM,EAAE,MAAMoB,OAAO;AAAxI,SAAA,EAAA,aACE,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA;AAAO,UAAA,KAAK,EAAEpB,eAAd,WAAA;AAAkC,UAAA,IAAI,EAAC;AAAvC,SAAA,CADF,CADF,CADF,CAbJ,CADF,CADF;AAnFJ;AAVF,GAAA;;;AAXEc,IAAAA,I;AACAR,IAAAA,I;AACAS,IAAAA,Q;AACAC,IAAAA,K;AACAC,IAAAA,M;AACAC,IAAAA,M;AACAC,IAAAA,I;AACAC,IAAAA,O;AACAC,IAAAA,M;;oBA6HF,M","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\n\nimport { BREAKPOINTS, COLORS, ComponentTextStyle } from '../styles';\nimport { Close, Help, TechnicalWarning, ThumbsUp, Tip } from '../icons/systemicons/SystemIcons';\nimport { IconButton } from '../Button';\nimport { getButtonStyle } from './styles';\nimport { Size } from '../types';\nimport { ComponentMStyling, ComponentResponsive } from '../styles/typography';\nimport { HyperLink } from '../HyperLink';\n\n/**\n * Styles for <Banner />\n */\ntype StyleBannerProps = BannerProps & { $type: string };\n\nconst BannerContainer = styled.div<StyleBannerProps>`\n background: ${(props: StyleBannerProps) => (props.$type ? props.$type : COLORS.correct_100)};\n min-height: 48px;\n display: flex;\n color: ${COLORS.black};\n margin-top: ${(props: StyleBannerProps) => (props.bottom ? 'auto' : '0')};\n\n button:last-child {\n line-height: 0;\n margin: 0 0 0 8px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 0 0 16px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 0 0 32px;\n }\n &.small {\n margin: 0 0 0 8px;\n }\n &.medium {\n margin: 0 0 0 16px;\n }\n &.large {\n margin: 0 0 0 32px;\n }\n }\n\n a {\n color: ${(props: BannerProps) => props.link} !important;\n }\n`;\n\nconst BannerCenter = styled.div<{ $color: string }>`\n ${(props) => ComponentMStyling(ComponentTextStyle.Regular, props.$color)}\n\n display: flex;\n width: 100%;\n margin: 0 0 0 16px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 16px 0 32px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 40px 0 56px;\n }\n &.small {\n margin: 0 0 0 16px;\n }\n &.medium {\n margin: 0 16px 0 32px;\n }\n &.large {\n margin: 0 40px 0 56px;\n }\n\n > svg {\n flex-shrink: 0;\n margin: 12px 0;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n margin: 0 0 0 auto;\n`;\n\nconst ButtonContainer = styled.div<{ $type?: string }>`\n display: contents;\n ${(props) => (props.$type ? getButtonStyle(props.$type) : null)};\n`;\n\nconst BannerContentWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: 12px 0;\n &:not(:first-child) {\n margin-left: 8px;\n }\n`;\n\ntype BannerProps = {\n size?: Size.Small | Size.Medium | Size.Large;\n type?: string;\n link?: string;\n linkText?: string;\n hover?: string;\n bottom?: boolean;\n testId?: string;\n icon?: React.ReactNode;\n onClose?: () => void;\n noIcon?: boolean;\n};\n\nconst Banner: React.FunctionComponent<BannerProps> = ({ size, type, children, bottom, testId, linkText, link, onClose, icon, noIcon }) => {\n const [width, setWidth] = React.useState<number>(window.innerWidth);\n React.useEffect(() => {\n function handleResize() {\n setWidth(window.innerWidth);\n }\n window.addEventListener('resize', handleResize);\n });\n\n const formatTypeToLowerCase = type?.toLowerCase();\n switch (formatTypeToLowerCase) {\n case 'warning':\n return (\n <BannerContainer data-testid={testId} $type={COLORS.warning_100} link={COLORS.warning_700} hover={COLORS.warning_20} bottom={bottom}>\n <BannerCenter $color={COLORS.warning_700} className={size}>\n {icon ? icon : noIcon ? null : <Help color={COLORS.warning_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.warning_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer $type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.warning_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'critical':\n return (\n <BannerContainer data-testid={testId} $type={COLORS.critical_100} link={COLORS.critical_700} hover={COLORS.critical_20} bottom={bottom} className={size}>\n <BannerCenter $color={COLORS.critical_700} className={size}>\n {icon ? icon : noIcon ? null : <TechnicalWarning color={COLORS.critical_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.critical_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer $type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.critical_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'positive':\n return (\n <BannerContainer data-testid={testId} $type={COLORS.correct_100} link={COLORS.correct_700} hover={COLORS.correct_20} bottom={bottom} className={size}>\n <BannerCenter $color={COLORS.correct_700} className={size}>\n {icon ? icon : noIcon ? null : <ThumbsUp color={COLORS.correct_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.correct_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer $type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.correct_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n default:\n return (\n <BannerContainer data-testid={testId} $type={COLORS.primary_100} link={COLORS.primary_700} hover={COLORS.primary_20} bottom={bottom} className={size}>\n <BannerCenter $color={COLORS.primary_700} className={size}>\n {icon ? icon : noIcon ? null : <Tip color={COLORS.primary_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.primary_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer $type=\"neutral\">\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.primary_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n }\n};\n\nexport default Banner;\n"],"file":"Banner.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/Banners/Banner.tsx"],"names":["BannerContainer","styled","div","props","COLORS","correct_100","black","BREAKPOINTS","MEDIUM","LARGE","link","BannerCenter","ComponentMStyling","ComponentTextStyle","ButtonWrapper","ButtonContainer","getButtonStyle","BannerContentWrapper","type","linkText","hover","bottom","testId","icon","onClose","noIcon","Banner","React","window","setWidth","formatTypeToLowerCase","size","warning_700","Math","critical_700","correct_700","primary_700"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;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led from 'styled-components';\n\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../styles';\nimport {Close, Help, TechnicalWarning, ThumbsUp, Tip} from '../icons/systemicons/SystemIcons';\nimport {IconButton} from '../Button';\nimport {getButtonStyle} from './styles';\nimport {Size} from '../types';\nimport {ComponentMStyling, ComponentResponsive} from '../styles/typography';\nimport {HyperLink} from '../HyperLink';\n\n/**\n * Styles for <Banner />\n */\nconst BannerContainer = styled.div<BannerProps>`\n background: ${(props: BannerProps) => (props.type ? props.type : COLORS.correct_100)};\n min-height: 48px;\n display: flex;\n color: ${COLORS.black};\n margin-top: ${(props: BannerProps) => (props.bottom ? 'auto' : '0')};\n\n button:last-child {\n line-height: 0;\n margin: 0 0 0 8px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 0 0 16px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 0 0 32px;\n }\n &.small {\n margin: 0 0 0 8px;\n }\n &.medium {\n margin: 0 0 0 16px;\n }\n &.large {\n margin: 0 0 0 32px;\n }\n }\n\n a {\n color: ${(props: BannerProps) => props.link} !important;\n }\n`;\n\nconst BannerCenter = styled.div`\n ${(props) => ComponentMStyling(ComponentTextStyle.Regular, props.color)}\n \n display: flex;\n width: 100%;\n margin: 0 0 0 16px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 16px 0 32px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 40px 0 56px;\n }\n &.small {\n margin: 0 0 0 16px;\n }\n &.medium {\n margin: 0 16px 0 32px;\n }\n &.large {\n margin: 0 40px 0 56px;\n }\n\n > svg {\n flex-shrink: 0;\n margin: 12px 0;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n margin: 0 0 0 auto;\n`;\n\nconst ButtonContainer = styled.div<{ type?: string }>`\n display: contents;\n ${(props) => (props.type ? getButtonStyle(props.type) : null)};\n`;\n\nconst BannerContentWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: 12px 0;\n &:not(:first-child) {\n margin-left: 8px;\n }\n`;\n\ntype BannerProps = {\n size?: Size.Small | Size.Medium | Size.Large;\n type?: string;\n link?: string;\n linkText?: string;\n hover?: string;\n bottom?: boolean;\n testId?: string;\n icon?: React.ReactNode;\n onClose?: () => void;\n noIcon?: boolean;\n};\n\nconst Banner: React.FunctionComponent<BannerProps> = ({ size, type, children, bottom, testId, linkText, link, onClose, icon, noIcon }) => {\n const [width, setWidth] = React.useState<number>(window.innerWidth);\n React.useEffect(() => {\n function handleResize() {\n setWidth(window.innerWidth);\n }\n window.addEventListener('resize', handleResize);\n });\n\n const formatTypeToLowerCase = type?.toLowerCase();\n switch (formatTypeToLowerCase) {\n case 'warning':\n return (\n <BannerContainer data-testid={testId} type={COLORS.warning_100} link={COLORS.warning_700} hover={COLORS.warning_20} bottom={bottom}>\n <BannerCenter color={COLORS.warning_700} className={size}>\n {icon ? icon : noIcon ? null : <Help color={COLORS.warning_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.warning_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.warning_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'critical':\n return (\n <BannerContainer data-testid={testId} type={COLORS.critical_100} link={COLORS.critical_700} hover={COLORS.critical_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.critical_700} className={size}>\n {icon ? icon : noIcon ? null : <TechnicalWarning color={COLORS.critical_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.critical_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.critical_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'positive':\n return (\n <BannerContainer data-testid={testId} type={COLORS.correct_100} link={COLORS.correct_700} hover={COLORS.correct_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.correct_700} className={size}>\n {icon ? icon : noIcon ? null : <ThumbsUp color={COLORS.correct_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.correct_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.correct_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n default:\n return (\n <BannerContainer data-testid={testId} type={COLORS.primary_100} link={COLORS.primary_700} hover={COLORS.primary_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.primary_700} className={size}>\n {icon ? icon : noIcon ? null : <Tip color={COLORS.primary_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.primary_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer type=\"neutral\">\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.primary_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n }\n};\n\nexport default Banner;\n"],"file":"Banner.js"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
if (typeof define === "function" && define.amd) {
|
|
3
|
+
define(["react", "@testing-library/react", "..", "../..", "jest-styled-components"], factory);
|
|
4
|
+
} else if (typeof exports !== "undefined") {
|
|
5
|
+
factory(require("react"), require("@testing-library/react"), require(".."), require("../.."), require("jest-styled-components"));
|
|
6
|
+
} else {
|
|
7
|
+
var mod = {
|
|
8
|
+
exports: {}
|
|
9
|
+
};
|
|
10
|
+
factory(global.react, global.react, global._, global._, global.jestStyledComponents);
|
|
11
|
+
global.undefined = mod.exports;
|
|
12
|
+
}
|
|
13
|
+
})(this, function (_react, _react3, _, _2) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
var _react2 = _interopRequireDefault(_react);
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) {
|
|
19
|
+
return obj && obj.__esModule ? obj : {
|
|
20
|
+
default: obj
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe('<ModalDialog />', () => {
|
|
25
|
+
let mountingDiv;
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
//being rendered as a React.Portal we need to have the 'root' div defined
|
|
28
|
+
mountingDiv = document.createElement('div');
|
|
29
|
+
mountingDiv.id = 'root';
|
|
30
|
+
document.body.appendChild(mountingDiv);
|
|
31
|
+
});
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
document.body.removeChild(mountingDiv);
|
|
34
|
+
});
|
|
35
|
+
it('Check modal not rendered when isModalOpen is false', async () => {
|
|
36
|
+
const {
|
|
37
|
+
container,
|
|
38
|
+
getByText
|
|
39
|
+
} = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_.ModalDialog, {
|
|
40
|
+
key: "smallModalWithoutImage",
|
|
41
|
+
closeModalAndClearInput: () => {},
|
|
42
|
+
title: 'Header',
|
|
43
|
+
size: _2.Size.Small,
|
|
44
|
+
isModalOpen: false,
|
|
45
|
+
closeAction: () => {},
|
|
46
|
+
submitAction: () => {}
|
|
47
|
+
})); //check modal portal not exists when modal not opened
|
|
48
|
+
|
|
49
|
+
expect(container.querySelector('.ReactModalPortal')).toBeNull();
|
|
50
|
+
});
|
|
51
|
+
it('Check modal visible, title and footer buttons displayed correctly', async () => {
|
|
52
|
+
const {
|
|
53
|
+
container,
|
|
54
|
+
getByText
|
|
55
|
+
} = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_.ModalDialog, {
|
|
56
|
+
key: "smallModalWithoutImage",
|
|
57
|
+
closeModalAndClearInput: () => {},
|
|
58
|
+
title: 'Header',
|
|
59
|
+
size: _2.Size.Small,
|
|
60
|
+
isModalOpen: true,
|
|
61
|
+
closeAction: () => {},
|
|
62
|
+
submitAction: () => {},
|
|
63
|
+
buttons: [{
|
|
64
|
+
action: () => {},
|
|
65
|
+
text: 'Close',
|
|
66
|
+
variant: 'tertiary'
|
|
67
|
+
}, {
|
|
68
|
+
action: () => {},
|
|
69
|
+
text: 'Save'
|
|
70
|
+
}]
|
|
71
|
+
})); //check modal portal defined
|
|
72
|
+
|
|
73
|
+
expect(container.querySelector('.ReactModalPortal')).toBeDefined(); //Check header and footer buttons
|
|
74
|
+
|
|
75
|
+
expect(getByText('Header')).toBeDefined();
|
|
76
|
+
expect(getByText('Close')).toBeDefined();
|
|
77
|
+
expect(getByText('Save')).toBeDefined();
|
|
78
|
+
});
|
|
79
|
+
it('Check tooltip, and link displayed without right footer buttons', async () => {
|
|
80
|
+
const {
|
|
81
|
+
baseElement,
|
|
82
|
+
getByText
|
|
83
|
+
} = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_.ModalDialog, {
|
|
84
|
+
key: "smallModalWithoutImage",
|
|
85
|
+
closeModalAndClearInput: () => {},
|
|
86
|
+
title: 'Header',
|
|
87
|
+
size: _2.Size.Small,
|
|
88
|
+
isModalOpen: true,
|
|
89
|
+
closeAction: () => {},
|
|
90
|
+
submitAction: () => {},
|
|
91
|
+
tooltip: 'some test tooltip',
|
|
92
|
+
leftFooterAction: {
|
|
93
|
+
id: 'test-link',
|
|
94
|
+
actionType: 'hyperlink',
|
|
95
|
+
text: 'Link',
|
|
96
|
+
href: 'http://test.com',
|
|
97
|
+
icon: /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null),
|
|
98
|
+
variant: 'default'
|
|
99
|
+
}
|
|
100
|
+
})); //check tooltip displayed
|
|
101
|
+
|
|
102
|
+
expect(getByText('some test tooltip').textContent).toBeDefined(); //check footer link displayed
|
|
103
|
+
|
|
104
|
+
expect(getByText('Link').children).toBeDefined();
|
|
105
|
+
});
|
|
106
|
+
it('Check note and footer note displayed', async () => {
|
|
107
|
+
const {
|
|
108
|
+
baseElement,
|
|
109
|
+
getByText
|
|
110
|
+
} = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_.ModalDialog, {
|
|
111
|
+
key: "smallModalWithoutImage",
|
|
112
|
+
closeModalAndClearInput: () => {},
|
|
113
|
+
title: 'Header',
|
|
114
|
+
size: _2.Size.Small,
|
|
115
|
+
isModalOpen: true,
|
|
116
|
+
closeAction: () => {},
|
|
117
|
+
submitAction: () => {},
|
|
118
|
+
leftFooterAction: {
|
|
119
|
+
id: 'test-note',
|
|
120
|
+
actionType: 'note',
|
|
121
|
+
text: 'Test note',
|
|
122
|
+
icon: /*#__PURE__*/_react2.default.createElement(_2.SystemIcons.Information, null)
|
|
123
|
+
},
|
|
124
|
+
note: 'Message text',
|
|
125
|
+
state: 'critical'
|
|
126
|
+
})); //check footer note text displayed
|
|
127
|
+
|
|
128
|
+
expect(getByText('Test note').textContent).toBeDefined(); //check note section added
|
|
129
|
+
|
|
130
|
+
expect(baseElement.querySelectorAll('section')?.length).toEqual(4); //check note message displayed
|
|
131
|
+
|
|
132
|
+
expect(getByText('Message text').children).toBeDefined();
|
|
133
|
+
});
|
|
134
|
+
it('Check back button and close icon displayed', async () => {
|
|
135
|
+
const {
|
|
136
|
+
baseElement,
|
|
137
|
+
getByText,
|
|
138
|
+
container
|
|
139
|
+
} = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_.ModalDialog, {
|
|
140
|
+
key: "smallModalWithoutImage",
|
|
141
|
+
closeModalAndClearInput: () => {},
|
|
142
|
+
title: 'Header',
|
|
143
|
+
size: _2.Size.Small,
|
|
144
|
+
backButton: () => {},
|
|
145
|
+
isModalOpen: true,
|
|
146
|
+
closeAction: () => {},
|
|
147
|
+
submitAction: () => {}
|
|
148
|
+
})); //only 2 svg elements should be found in the header of the modal
|
|
149
|
+
|
|
150
|
+
expect(baseElement.querySelectorAll('svg')?.length).toEqual(2);
|
|
151
|
+
});
|
|
152
|
+
it('Check modal body displayed', async () => {
|
|
153
|
+
const {
|
|
154
|
+
baseElement,
|
|
155
|
+
getByText,
|
|
156
|
+
container
|
|
157
|
+
} = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_.ModalDialog, {
|
|
158
|
+
key: "smallModalWithoutImage",
|
|
159
|
+
closeModalAndClearInput: () => {},
|
|
160
|
+
title: 'Header',
|
|
161
|
+
size: _2.Size.Small,
|
|
162
|
+
isModalOpen: true,
|
|
163
|
+
closeAction: () => {},
|
|
164
|
+
submitAction: () => {}
|
|
165
|
+
}, /*#__PURE__*/_react2.default.createElement("span", null, "Inner modal text"))); //Check all dialog sections are displayed
|
|
166
|
+
|
|
167
|
+
expect(baseElement.querySelectorAll('section')?.length).toEqual(3); //Check that the second section (modal body) has the correct text
|
|
168
|
+
|
|
169
|
+
expect(baseElement.querySelectorAll('section')?.[1].textContent).toEqual('Inner modal text');
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
//# sourceMappingURL=Modal.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/Modals/__tests__/Modal.test.tsx"],"names":["describe","beforeEach","mountingDiv","document","afterEach","it","getByText","render","Size","expect","container","action","text","variant","id","actionType","href","icon","baseElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMAA,EAAAA,QAAQ,CAAA,iBAAA,EAAoB,MAAM;AAChC,QAAA,WAAA;AAEAC,IAAAA,UAAU,CAAC,MAAM;AACf;AACAC,MAAAA,WAAW,GAAGC,QAAQ,CAARA,aAAAA,CAAdD,KAAcC,CAAdD;AACAA,MAAAA,WAAW,CAAXA,EAAAA,GAAAA,MAAAA;AACAC,MAAAA,QAAQ,CAARA,IAAAA,CAAAA,WAAAA,CAAAA,WAAAA;AAJFF,KAAU,CAAVA;AAOAG,IAAAA,SAAS,CAAC,MAAM;AACdD,MAAAA,QAAQ,CAARA,IAAAA,CAAAA,WAAAA,CAAAA,WAAAA;AADFC,KAAS,CAATA;AAIAC,IAAAA,EAAE,CAAA,oDAAA,EAAuD,YAAY;AACnE,YAAM;AAAA,QAAA,SAAA;AAAaC,QAAAA;AAAb,UAA2BC,qBAAM,aACrC,gBAAA,aAAA,CAAA,aAAA,EAAA;AACE,QAAA,GAAG,EADL,wBAAA;AAEE,QAAA,uBAAuB,EAAE,MAAM,CAFjC,CAAA;AAGE,QAAA,KAAK,EAHP,QAAA;AAIE,QAAA,IAAI,EAAEC,QAJR,KAAA;AAKE,QAAA,WAAW,EALb,KAAA;AAME,QAAA,WAAW,EAAE,MAAM,CANrB,CAAA;AAOE,QAAA,YAAY,EAAE,MAAM,CAAE;AAPxB,OAAA,CAD+BD,CAAjC,CADmE,CAYnE;;A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,CAACS,WAAW,CAAXA,gBAAAA,CAAAA,KAAAA,GAAPT,MAAM,CAANA,CAAAA,OAAAA,CAAAA,CAAAA;AAdFJ,KAAE,CAAFA;AAiBAA,IAAAA,EAAE,CAAA,4BAAA,EAA+B,YAAY;AAC3C,YAAM;AAAA,QAAA,WAAA;AAAA,QAAA,SAAA;AAA0BK,QAAAA;AAA1B,UAAwCH,qBAAM,aAClD,gBAAA,aAAA,CAAA,aAAA,EAAA;AACE,QAAA,GAAG,EADL,wBAAA;AAEE,QAAA,uBAAuB,EAAE,MAAM,CAFjC,CAAA;AAGE,QAAA,KAAK,EAHP,QAAA;AAIE,QAAA,IAAI,EAAEC,QAJR,KAAA;AAKE,QAAA,WAAW,EALb,IAAA;AAME,QAAA,WAAW,EAAE,MAAM,CANrB,CAAA;AAOE,QAAA,YAAY,EAAE,MAAM,CAAE;AAPxB,OAAA,EAAA,aAQE,gBAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAVuC,kBAUvC,CARF,CAD4CD,CAA9C,CAD2C,CAa3C;;AACAE,MAAAA,MAAM,CAACS,WAAW,CAAXA,gBAAAA,CAAAA,SAAAA,GAAPT,MAAM,CAANA,CAAAA,OAAAA,CAd2C,CAc3CA,EAd2C,CAe3C;;AACAA,MAAAA,MAAM,CAACS,WAAW,CAAXA,gBAAAA,CAAAA,SAAAA,IAAAA,CAAAA,EAAPT,WAAM,CAANA,CAAAA,OAAAA,CAAAA,kBAAAA;AAhBFJ,KAAE,CAAFA;AAzHFL,GAAQ,CAARA","sourcesContent":["import React from 'react';\nimport { render } from '@testing-library/react';\nimport 'jest-styled-components';\nimport { ModalDialog } from '..';\nimport { COLORS, Size, SystemIcons } from '../..';\n\ndescribe('<ModalDialog />', () => {\n let mountingDiv: HTMLElement;\n\n beforeEach(() => {\n //being rendered as a React.Portal we need to have the 'root' div defined\n mountingDiv = document.createElement('div');\n mountingDiv.id = 'root';\n document.body.appendChild(mountingDiv);\n });\n\n afterEach(() => {\n document.body.removeChild(mountingDiv);\n });\n\n it('Check modal not rendered when isModalOpen is false', async () => {\n const { container, getByText } = render(\n <ModalDialog\n key=\"smallModalWithoutImage\"\n closeModalAndClearInput={() => {}}\n title={'Header'}\n size={Size.Small}\n isModalOpen={false}\n closeAction={() => {}}\n submitAction={() => {}}\n />,\n );\n //check modal portal not exists when modal not opened\n expect(container.querySelector('.ReactModalPortal')).toBeNull();\n });\n\n it('Check modal visible, title and footer buttons displayed correctly', async () => {\n const { container, getByText } = render(\n <ModalDialog\n key=\"smallModalWithoutImage\"\n closeModalAndClearInput={() => {}}\n title={'Header'}\n size={Size.Small}\n isModalOpen={true}\n closeAction={() => {}}\n submitAction={() => {}}\n buttons={[\n {\n action: () => {},\n text: 'Close',\n variant: 'tertiary',\n },\n {\n action: () => {},\n text: 'Save',\n },\n ]}\n />,\n );\n //check modal portal defined\n expect(container.querySelector('.ReactModalPortal')).toBeDefined();\n //Check header and footer buttons\n expect(getByText('Header')).toBeDefined();\n expect(getByText('Close')).toBeDefined();\n expect(getByText('Save')).toBeDefined();\n });\n\n it('Check tooltip, and link displayed without right footer buttons', async () => {\n const { baseElement, getByText } = render(\n <ModalDialog\n key=\"smallModalWithoutImage\"\n closeModalAndClearInput={() => {}}\n title={'Header'}\n size={Size.Small}\n isModalOpen={true}\n closeAction={() => {}}\n submitAction={() => {}}\n tooltip={'some test tooltip'}\n leftFooterAction={{ id: 'test-link', actionType: 'hyperlink', text: 'Link', href: 'http://test.com', icon: <></>, variant: 'default' }}\n />,\n );\n //check tooltip displayed\n expect(getByText('some test tooltip').textContent).toBeDefined();\n //check footer link displayed\n expect(getByText('Link').children).toBeDefined();\n });\n\n it('Check note and footer note displayed', async () => {\n const { baseElement, getByText } = render(\n <ModalDialog\n key=\"smallModalWithoutImage\"\n closeModalAndClearInput={() => {}}\n title={'Header'}\n size={Size.Small}\n isModalOpen={true}\n closeAction={() => {}}\n submitAction={() => {}}\n leftFooterAction={{ id: 'test-note', actionType: 'note', text: 'Test note', icon: <SystemIcons.Information /> }}\n note={'Message text'}\n state={'critical'}\n />,\n );\n //check footer note text displayed\n expect(getByText('Test note').textContent).toBeDefined();\n //check note section added\n expect(baseElement.querySelectorAll('section')?.length).toEqual(4);\n //check note message displayed\n expect(getByText('Message text').children).toBeDefined();\n });\n\n it('Check back button and close icon displayed', async () => {\n const { baseElement, getByText, container } = render(\n <ModalDialog\n key=\"smallModalWithoutImage\"\n closeModalAndClearInput={() => {}}\n title={'Header'}\n size={Size.Small}\n backButton={() => {}}\n isModalOpen={true}\n closeAction={() => {}}\n submitAction={() => {}}\n />,\n );\n //only 2 svg elements should be found in the header of the modal\n expect(baseElement.querySelectorAll('svg')?.length).toEqual(2);\n });\n\n it('Check modal body displayed', async () => {\n const { baseElement, getByText, container } = render(\n <ModalDialog\n key=\"smallModalWithoutImage\"\n closeModalAndClearInput={() => {}}\n title={'Header'}\n size={Size.Small}\n isModalOpen={true}\n closeAction={() => {}}\n submitAction={() => {}}>\n <span>Inner modal text</span>\n </ModalDialog>,\n );\n //Check all dialog sections are displayed\n expect(baseElement.querySelectorAll('section')?.length).toEqual(3);\n //Check that the second section (modal body) has the correct text\n expect(baseElement.querySelectorAll('section')?.[1].textContent).toEqual('Inner modal text');\n });\n});\n"],"file":"Modal.test.js"}
|