@laerdal/life-react-components 1.3.1 → 1.3.2-dev.12
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/Accordion/ContentAccordion.js +238 -0
- package/dist/esm/Accordion/ContentAccordion.js.map +1 -0
- package/dist/esm/Accordion/__tests__/ContetnAccordion.test.js +137 -0
- package/dist/esm/Accordion/__tests__/ContetnAccordion.test.js.map +1 -0
- package/dist/esm/Accordion/index.js +1 -0
- package/dist/esm/Accordion/index.js.map +1 -1
- 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/Button/Button.js +8 -53
- package/dist/esm/Button/Button.js.map +1 -1
- package/dist/esm/Button/DualFunctionButton.js +4 -0
- package/dist/esm/Button/DualFunctionButton.js.map +1 -1
- package/dist/esm/Button/Iconbutton.js +0 -1
- package/dist/esm/Button/Iconbutton.js.map +1 -1
- package/dist/esm/Dropdown/CommonStyling.js +4 -0
- package/dist/esm/Dropdown/CommonStyling.js.map +1 -1
- package/dist/esm/Dropdown/DropdownButton.js +5 -2
- package/dist/esm/Dropdown/DropdownButton.js.map +1 -1
- package/dist/esm/Dropdown/DropdownContent.js +6 -6
- package/dist/esm/Dropdown/DropdownContent.js.map +1 -1
- package/dist/esm/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/esm/HyperLink/HyperLink.js +2 -1
- package/dist/esm/HyperLink/HyperLink.js.map +1 -1
- package/dist/esm/InputFields/Checkbox.js +23 -13
- package/dist/esm/InputFields/Checkbox.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/Table/Table.js +113 -181
- package/dist/esm/Table/Table.js.map +1 -1
- package/dist/esm/Table/TableBody.js +135 -0
- package/dist/esm/Table/TableBody.js.map +1 -0
- package/dist/esm/Table/TableFooter.js +60 -0
- package/dist/esm/Table/TableFooter.js.map +1 -0
- package/dist/esm/Table/TableHeaders.js +55 -0
- package/dist/esm/Table/TableHeaders.js.map +1 -0
- package/dist/esm/Table/TableStyles.js +130 -117
- package/dist/esm/Table/TableStyles.js.map +1 -1
- package/dist/esm/Table/__tests__/Table.test.js +0 -21
- package/dist/esm/Table/__tests__/Table.test.js.map +1 -1
- package/dist/esm/Tabs/TabLink.js +1 -0
- package/dist/esm/Tabs/TabLink.js.map +1 -1
- package/dist/esm/styles/typography.js +66 -66
- package/dist/esm/styles/typography.js.map +1 -1
- package/dist/js/Accordion/ContentAccordion.d.ts +18 -0
- package/dist/js/Accordion/ContentAccordion.js +151 -0
- package/dist/js/Accordion/ContentAccordion.js.map +1 -0
- package/dist/js/Accordion/__tests__/ContetnAccordion.test.js +151 -0
- package/dist/js/Accordion/__tests__/ContetnAccordion.test.js.map +1 -0
- package/dist/js/Accordion/index.d.ts +1 -0
- package/dist/js/Accordion/index.js +8 -0
- package/dist/js/Accordion/index.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 +16 -19
- package/dist/js/Banners/Banner.js.map +1 -1
- package/dist/js/Button/Button.js +6 -12
- package/dist/js/Button/Button.js.map +1 -1
- package/dist/js/Button/DualFunctionButton.js +4 -0
- package/dist/js/Button/DualFunctionButton.js.map +1 -1
- package/dist/js/Button/Iconbutton.d.ts +2 -2
- package/dist/js/Button/Iconbutton.js +0 -1
- package/dist/js/Button/Iconbutton.js.map +1 -1
- package/dist/js/Dropdown/CommonStyling.js +1 -1
- package/dist/js/Dropdown/CommonStyling.js.map +1 -1
- package/dist/js/Dropdown/DropdownButton.d.ts +1 -1
- package/dist/js/Dropdown/DropdownButton.js +5 -2
- package/dist/js/Dropdown/DropdownButton.js.map +1 -1
- package/dist/js/Dropdown/DropdownButtonTypes.d.ts +1 -0
- package/dist/js/Dropdown/DropdownContent.js +8 -8
- package/dist/js/Dropdown/DropdownContent.js.map +1 -1
- package/dist/js/Dropdown/DropdownFilter.d.ts +1 -1
- package/dist/js/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/js/HyperLink/HyperLink.d.ts +1 -1
- package/dist/js/HyperLink/HyperLink.js +2 -2
- package/dist/js/HyperLink/HyperLink.js.map +1 -1
- package/dist/js/InputFields/Checkbox.d.ts +3 -2
- package/dist/js/InputFields/Checkbox.js +13 -11
- package/dist/js/InputFields/Checkbox.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/Table/Table.js +143 -209
- package/dist/js/Table/Table.js.map +1 -1
- package/dist/js/Table/TableBody.d.ts +9 -0
- package/dist/js/Table/TableBody.js +167 -0
- package/dist/js/Table/TableBody.js.map +1 -0
- package/dist/js/Table/TableFooter.d.ts +13 -0
- package/dist/js/Table/TableFooter.js +82 -0
- package/dist/js/Table/TableFooter.js.map +1 -0
- package/dist/js/Table/TableHeaders.d.ts +9 -0
- package/dist/js/Table/TableHeaders.js +77 -0
- package/dist/js/Table/TableHeaders.js.map +1 -0
- package/dist/js/Table/TableStyles.d.ts +17 -7
- package/dist/js/Table/TableStyles.js +58 -16
- package/dist/js/Table/TableStyles.js.map +1 -1
- package/dist/js/Table/TableTypes.d.ts +23 -16
- package/dist/js/Table/__tests__/Table.test.js +8 -30
- package/dist/js/Table/__tests__/Table.test.js.map +1 -1
- package/dist/js/Tabs/TabLink.js +1 -1
- package/dist/js/Tabs/TabLink.js.map +1 -1
- 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/Accordion/ContentAccordion.js +266 -0
- package/dist/umd/Accordion/ContentAccordion.js.map +1 -0
- package/dist/umd/Accordion/__tests__/ContetnAccordion.test.js +165 -0
- package/dist/umd/Accordion/__tests__/ContetnAccordion.test.js.map +1 -0
- package/dist/umd/Accordion/index.js +10 -4
- package/dist/umd/Accordion/index.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/Button/Button.js +8 -53
- package/dist/umd/Button/Button.js.map +1 -1
- package/dist/umd/Button/DualFunctionButton.js +4 -0
- package/dist/umd/Button/DualFunctionButton.js.map +1 -1
- package/dist/umd/Button/Iconbutton.js +0 -1
- package/dist/umd/Button/Iconbutton.js.map +1 -1
- package/dist/umd/Dropdown/CommonStyling.js +4 -0
- package/dist/umd/Dropdown/CommonStyling.js.map +1 -1
- package/dist/umd/Dropdown/DropdownButton.js +5 -2
- package/dist/umd/Dropdown/DropdownButton.js.map +1 -1
- package/dist/umd/Dropdown/DropdownContent.js +6 -6
- package/dist/umd/Dropdown/DropdownContent.js.map +1 -1
- package/dist/umd/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/umd/HyperLink/HyperLink.js +2 -1
- package/dist/umd/HyperLink/HyperLink.js.map +1 -1
- package/dist/umd/InputFields/Checkbox.js +23 -13
- package/dist/umd/InputFields/Checkbox.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/Table/Table.js +139 -188
- package/dist/umd/Table/Table.js.map +1 -1
- package/dist/umd/Table/TableBody.js +270 -0
- package/dist/umd/Table/TableBody.js.map +1 -0
- package/dist/umd/Table/TableFooter.js +82 -0
- package/dist/umd/Table/TableFooter.js.map +1 -0
- package/dist/umd/Table/TableHeaders.js +91 -0
- package/dist/umd/Table/TableHeaders.js.map +1 -0
- package/dist/umd/Table/TableStyles.js +134 -122
- package/dist/umd/Table/TableStyles.js.map +1 -1
- package/dist/umd/Table/__tests__/Table.test.js +0 -21
- package/dist/umd/Table/__tests__/Table.test.js.map +1 -1
- package/dist/umd/Tabs/TabLink.js +1 -0
- package/dist/umd/Tabs/TabLink.js.map +1 -1
- 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","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,IAAM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AAK,EAAE7E,KAApB;AAA2B,QAAA,SAAS,EAAE8B,SAAtC;AAAiD,QAAA,QAAQ,EAAEU;AAA3D,QAAP;;AACF,SAAKgC,YAAKC,KAAV;AACE,0BAAO,6BAAC,UAAD;AAAY,QAAA,KAAK,EAAEzE,KAAnB;AAA0B,QAAA,SAAS,EAAE8B,SAArC;AAAgD,QAAA,QAAQ,EAAEU;AAA1D,QAAP;;AACF,SAAKgC,YAAKE,MAAV;AACE,0BAAO,6BAAC,UAAD;AAAY,QAAA,KAAK,EAAE1E,KAAnB;AAA0B,QAAA,SAAS,EAAE8B,SAArC;AAAgD,QAAA,QAAQ,EAAEU;AAA1D,QAAP;;AACF,SAAKgC,YAAKG,KAAV;AACA;AACE,0BAAO,6BAAC,UAAD;AAAY,QAAA,KAAK,EAAE3E,KAAnB;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"}
|
|
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;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QAAA,QAAQ,EAAEU;AAA1D,QAAP;;AACF,SAAKgC,YAAKE,MAAV;AACE,0BAAO,6BAAC,UAAD;AAAY,QAAA,KAAK,EAAEpE,KAAnB;AAA0B,QAAA,SAAS,EAAEwB,SAArC;AAAgD,QAAA,QAAQ,EAAEU;AAA1D,QAAP;;AACF,SAAKgC,YAAKG,KAAV;AACA;AACE,0BAAO,6BAAC,UAAD;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"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
if (typeof define === "function" && define.amd) {
|
|
3
|
+
define(["exports", "prop-types", "react", "styled-components", "../types", "../icons", "../styles/typography", "../styles", "../styles/z-indexes"], factory);
|
|
4
|
+
} else if (typeof exports !== "undefined") {
|
|
5
|
+
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../types"), require("../icons"), require("../styles/typography"), require("../styles"), require("../styles/z-indexes"));
|
|
6
|
+
} else {
|
|
7
|
+
var mod = {
|
|
8
|
+
exports: {}
|
|
9
|
+
};
|
|
10
|
+
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.types, global.icons, global.typography, global.styles, global.zIndexes);
|
|
11
|
+
global.undefined = mod.exports;
|
|
12
|
+
}
|
|
13
|
+
})(this, function (exports, _propTypes, _react, _styledComponents, _types, _icons, _typography, _styles, _zIndexes) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
exports.ContentAccordion = undefined;
|
|
20
|
+
|
|
21
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
22
|
+
|
|
23
|
+
var _react2 = _interopRequireDefault(_react);
|
|
24
|
+
|
|
25
|
+
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
26
|
+
|
|
27
|
+
function _interopRequireDefault(obj) {
|
|
28
|
+
return obj && obj.__esModule ? obj : {
|
|
29
|
+
default: obj
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const ContentAccordionWrapper = _styledComponents2.default.div`
|
|
34
|
+
width: 100%;
|
|
35
|
+
position: relative;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
.content-accordion-item {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
border-top: 1px solid ${_styles.COLORS.neutral_100};
|
|
42
|
+
|
|
43
|
+
.item-header {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
min-height: 48px;
|
|
48
|
+
color: ${_styles.COLORS.neutral_600};
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
color: ${_styles.COLORS.primary_700};
|
|
53
|
+
background-color: ${_styles.COLORS.primary_20};
|
|
54
|
+
z-index: ${_zIndexes.Z_INDEXES.hover};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:focus {
|
|
58
|
+
box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;
|
|
59
|
+
background-color: ${_styles.COLORS.white};
|
|
60
|
+
z-index: ${_zIndexes.Z_INDEXES.focus};
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:active {
|
|
65
|
+
color: ${_styles.COLORS.primary_800};
|
|
66
|
+
background-color: ${_styles.COLORS.primary_100};
|
|
67
|
+
box-shadow: none;
|
|
68
|
+
z-index: ${_zIndexes.Z_INDEXES.active};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.item-header-icon,
|
|
72
|
+
.item-header-icon svg {
|
|
73
|
+
width: 24px;
|
|
74
|
+
height: 24px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.item-header-text {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.item-content {
|
|
82
|
+
display: none;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
|
|
85
|
+
.item-content-header {
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.item-content-body {
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.item-content-footer {
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.active {
|
|
98
|
+
.item-content {
|
|
99
|
+
display: flex;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&.disabled {
|
|
104
|
+
.item-header {
|
|
105
|
+
color: ${_styles.COLORS.neutral_300};
|
|
106
|
+
cursor: not-allowed;
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.content-accordion-item:last-child {
|
|
113
|
+
border-bottom: 1px solid ${_styles.COLORS.neutral_100};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&.small {
|
|
117
|
+
min-width: 320px;
|
|
118
|
+
max-width: 528px;
|
|
119
|
+
|
|
120
|
+
.item-header {
|
|
121
|
+
gap: 8px;
|
|
122
|
+
padding: 0 8px;
|
|
123
|
+
${(0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, null)}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.item-content {
|
|
127
|
+
padding: 0 8px 16px 40px;
|
|
128
|
+
gap: 8px;
|
|
129
|
+
|
|
130
|
+
.item-content-header {
|
|
131
|
+
${(0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, null)}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.item-content-body {
|
|
135
|
+
${(0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, null)}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
&.medium {
|
|
142
|
+
min-width: 344px;
|
|
143
|
+
max-width: 584px;
|
|
144
|
+
|
|
145
|
+
.item-header {
|
|
146
|
+
gap: 12px;
|
|
147
|
+
padding: 0 12px;
|
|
148
|
+
${(0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Regular, null)}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.item-content {
|
|
152
|
+
padding: 8px 12px 24px 48px;
|
|
153
|
+
gap: 12px;
|
|
154
|
+
|
|
155
|
+
.item-content-header {
|
|
156
|
+
${(0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, null)}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.item-content-body {
|
|
160
|
+
${(0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Regular, null)}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&.large {
|
|
167
|
+
min-width: 384px;
|
|
168
|
+
max-width: 656px;
|
|
169
|
+
|
|
170
|
+
.item-header {
|
|
171
|
+
gap: 16px;
|
|
172
|
+
padding: 0 16px;
|
|
173
|
+
${(0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Regular, null)}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.item-content {
|
|
177
|
+
padding: 16px 16px 32px 56px;
|
|
178
|
+
gap: 16px;
|
|
179
|
+
|
|
180
|
+
.item-content-header {
|
|
181
|
+
${(0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Bold, null)}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.item-content-body {
|
|
185
|
+
${(0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Regular, null)}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
|
|
191
|
+
const ContentAccordion = exports.ContentAccordion = props => {
|
|
192
|
+
const [opened, setOpened] = _react2.default.useState([]);
|
|
193
|
+
|
|
194
|
+
_react2.default.useEffect(() => {
|
|
195
|
+
if (props.multi) {
|
|
196
|
+
setOpened(props.items.filter(item => item.active).map(item => item.key));
|
|
197
|
+
} else {
|
|
198
|
+
let active = props.items.find(item => !!item.active)?.key;
|
|
199
|
+
|
|
200
|
+
if (active) {
|
|
201
|
+
setOpened([active]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}, [props.items, props.multi]);
|
|
205
|
+
|
|
206
|
+
const onItemClick = item => {
|
|
207
|
+
if (item.disabled) return;
|
|
208
|
+
|
|
209
|
+
if (opened.includes(item.key)) {
|
|
210
|
+
setOpened(opened.filter(key => key !== item.key));
|
|
211
|
+
} else {
|
|
212
|
+
if (props.multi) {
|
|
213
|
+
setOpened([...opened, item.key]);
|
|
214
|
+
} else {
|
|
215
|
+
setOpened([item.key]);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const renderItem = item => {
|
|
221
|
+
const isActive = opened.includes(item.key);
|
|
222
|
+
return /*#__PURE__*/_react2.default.createElement("div", {
|
|
223
|
+
key: item.key,
|
|
224
|
+
id: `item_${item.key}`,
|
|
225
|
+
className: 'content-accordion-item'.concat(isActive ? ' active' : '').concat(item.disabled ? ' disabled' : '')
|
|
226
|
+
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
227
|
+
className: 'item-header',
|
|
228
|
+
tabIndex: !item.disabled ? 0 : undefined,
|
|
229
|
+
onMouseDown: e => e.preventDefault(),
|
|
230
|
+
onClick: () => !item.disabled && onItemClick(item),
|
|
231
|
+
onKeyPress: event => event.key === 'Enter' && onItemClick(item)
|
|
232
|
+
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
233
|
+
className: 'item-header-icon'
|
|
234
|
+
}, props.multi ? isActive ? /*#__PURE__*/_react2.default.createElement(_icons.SystemIcons.Minus, null) : /*#__PURE__*/_react2.default.createElement(_icons.SystemIcons.Plus, null) : isActive ? /*#__PURE__*/_react2.default.createElement(_icons.SystemIcons.ChevronDown, null) : /*#__PURE__*/_react2.default.createElement(_icons.SystemIcons.ChevronRight, null)), /*#__PURE__*/_react2.default.createElement("div", {
|
|
235
|
+
className: 'item-header-text'
|
|
236
|
+
}, item.title)), /*#__PURE__*/_react2.default.createElement("div", {
|
|
237
|
+
className: 'item-content'
|
|
238
|
+
}, item.header && /*#__PURE__*/_react2.default.createElement("div", {
|
|
239
|
+
className: 'item-content-header'
|
|
240
|
+
}, item.header), /*#__PURE__*/_react2.default.createElement("div", {
|
|
241
|
+
className: 'item-content-body'
|
|
242
|
+
}, item.body), item.footer && /*#__PURE__*/_react2.default.createElement("div", {
|
|
243
|
+
className: 'item-content-footer'
|
|
244
|
+
}, item.footer)));
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
return /*#__PURE__*/_react2.default.createElement(ContentAccordionWrapper, {
|
|
248
|
+
className: 'content-accordion'.concat(` ${props.size ?? _types.Size.Medium}`)
|
|
249
|
+
}, props.items.map(item => renderItem(item)));
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
ContentAccordion.propTypes = {
|
|
253
|
+
items: _propTypes2.default.arrayOf(_propTypes2.default.shape({
|
|
254
|
+
key: _propTypes2.default.string.isRequired,
|
|
255
|
+
title: _propTypes2.default.string.isRequired,
|
|
256
|
+
header: _propTypes2.default.string,
|
|
257
|
+
body: _propTypes2.default.any.isRequired,
|
|
258
|
+
footer: _propTypes2.default.any,
|
|
259
|
+
disabled: _propTypes2.default.bool,
|
|
260
|
+
active: _propTypes2.default.bool
|
|
261
|
+
})).isRequired,
|
|
262
|
+
multi: _propTypes2.default.bool
|
|
263
|
+
};
|
|
264
|
+
exports.default = ContentAccordion;
|
|
265
|
+
});
|
|
266
|
+
//# sourceMappingURL=ContentAccordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/Accordion/ContentAccordion.tsx"],"names":["ContentAccordionWrapper","styled","div","COLORS","neutral_100","neutral_600","primary_700","primary_20","Z_INDEXES","hover","white","focus","primary_800","primary_100","active","neutral_300","ComponentSStyling","ComponentTextStyle","ComponentMStyling","ComponentLStyling","key","title","header","body","footer","disabled","items","multi","ContentAccordion","props","React","setOpened","item","onItemClick","opened","renderItem","isActive","e","event","Size","Medium"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,QAAMA,uBAAuB,GAAGC,2BAAOC,GAAI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4BC,eAAOC,WAAY;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,eAAeD,eAAOE,WAAY;AAClC;AACA;AACA;AACA,iBAAiBF,eAAOG,WAAY;AACpC,4BAA4BH,eAAOI,UAAW;AAC9C,mBAAmBC,oBAAUC,KAAM;AACnC;AACA;AACA;AACA;AACA,4BAA4BN,eAAOO,KAAM;AACzC,mBAAmBF,oBAAUG,KAAM;AACnC;AACA;AACA;AACA;AACA,iBAAiBR,eAAOS,WAAY;AACpC,4BAA4BT,eAAOU,WAAY;AAC/C;AACA,mBAAmBL,oBAAUM,MAAO;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiBX,eAAOY,WAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+BZ,eAAOC,WAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQY,mCAAkBC,+BAAD,OAAjBD,EAAiB,IAAjBA,CAAoD;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUA,mCAAkBC,+BAAD,IAAjBD,EAAiB,IAAjBA,CAAiD;AAC3D;AACA;AACA;AACA,UAAUA,mCAAkBC,+BAAD,OAAjBD,EAAiB,IAAjBA,CAAoD;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQE,mCAAkBD,+BAAD,OAAjBC,EAAiB,IAAjBA,CAAoD;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUA,mCAAkBD,+BAAD,IAAjBC,EAAiB,IAAjBA,CAAiD;AAC3D;AACA;AAC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;AA5EK,GAAA;;;AALLH,IAAAA,K;AAVAN,MAAAA,G;AACAC,MAAAA,K;AACAC,MAAAA,M;AACAC,MAAAA,I;AACAC,MAAAA,M;AACAC,MAAAA,Q;AACAX,MAAAA,M;;AAKAa,IAAAA,K;;oBAuFF,gB","sourcesContent":["import React from 'react'\nimport styled from 'styled-components';\nimport {Size} from '../types';\nimport {SystemIcons} from '../icons';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle} from '../styles/typography';\nimport {COLORS} from '../styles';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\n\nconst ContentAccordionWrapper = styled.div`\n width: 100%;\n position: relative;\n\n\n .content-accordion-item {\n display: flex;\n flex-direction: column;\n border-top: 1px solid ${COLORS.neutral_100};\n\n .item-header {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n min-height: 48px;\n color: ${COLORS.neutral_600};\n cursor: pointer;\n\n &:hover {\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_20};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n background-color: ${COLORS.white};\n z-index: ${Z_INDEXES.focus};\n outline: none;\n }\n\n &:active {\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_100};\n box-shadow: none;\n z-index: ${Z_INDEXES.active};\n }\n\n .item-header-icon,\n .item-header-icon svg {\n width: 24px;\n height: 24px;\n }\n\n .item-header-text {\n }\n }\n\n .item-content {\n display: none;\n flex-direction: column;\n\n .item-content-header {\n\n }\n\n .item-content-body {\n\n }\n\n .item-content-footer {\n }\n }\n\n &.active {\n .item-content {\n display: flex;\n }\n }\n\n &.disabled {\n .item-header {\n color: ${COLORS.neutral_300};\n cursor: not-allowed;\n pointer-events: none;\n }\n }\n }\n\n .content-accordion-item:last-child {\n border-bottom: 1px solid ${COLORS.neutral_100};\n }\n\n &.small {\n min-width: 320px;\n max-width: 528px;\n\n .item-header {\n gap: 8px;\n padding: 0 8px;\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n }\n\n .item-content {\n padding: 0 8px 16px 40px;\n gap: 8px;\n\n .item-content-header {\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n }\n\n .item-content-body {\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n }\n }\n }\n\n\n &.medium {\n min-width: 344px;\n max-width: 584px;\n\n .item-header {\n gap: 12px;\n padding: 0 12px;\n ${ComponentMStyling(ComponentTextStyle.Regular, null)}\n }\n\n .item-content {\n padding: 8px 12px 24px 48px;\n gap: 12px;\n\n .item-content-header {\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\n }\n\n .item-content-body {\n ${ComponentMStyling(ComponentTextStyle.Regular, null)}\n }\n\n }\n }\n\n &.large {\n min-width: 384px;\n max-width: 656px;\n\n .item-header {\n gap: 16px;\n padding: 0 16px;\n ${ComponentLStyling(ComponentTextStyle.Regular, null)}\n }\n\n .item-content {\n padding: 16px 16px 32px 56px;\n gap: 16px;\n\n .item-content-header {\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n\n .item-content-body {\n ${ComponentLStyling(ComponentTextStyle.Regular, null)}\n }\n }\n }\n`;\n\nexport interface ContentAccordionItem {\n key: string;\n title: string;\n header?: string;\n body: any;\n footer?: any;\n disabled?: boolean;\n active?: boolean;\n}\n\nexport interface ContentAccordionProps {\n items: ContentAccordionItem[];\n multi?: boolean;\n size?: Size;\n}\n\nexport const ContentAccordion: React.FunctionComponent<ContentAccordionProps> = (props) => {\n\n const [opened, setOpened] = React.useState<string[]>([]);\n\n React.useEffect(() => {\n if (props.multi) {\n setOpened(props.items.filter(item => item.active).map(item => item.key));\n } else {\n let active = props.items.find(item => !!item.active)?.key;\n if (active) {\n setOpened([active]);\n }\n }\n }, [props.items, props.multi]);\n\n const onItemClick = (item: ContentAccordionItem) => {\n if (item.disabled) return;\n if (opened.includes(item.key)) {\n setOpened(opened.filter(key => key !== item.key));\n } else {\n if (props.multi) {\n setOpened([...opened, item.key]);\n } else {\n setOpened([item.key]);\n }\n }\n }\n\n const renderItem = (item: ContentAccordionItem) => {\n const isActive = opened.includes(item.key);\n\n return (\n <div key={item.key}\n id={`item_${item.key}`}\n className={'content-accordion-item'.concat(isActive ? ' active' : '').concat(item.disabled ? ' disabled' : '')}>\n <div className={'item-header'}\n tabIndex={!item.disabled ? 0 : undefined}\n onMouseDown={e => e.preventDefault()}\n onClick={() => !item.disabled && onItemClick(item)}\n onKeyPress={event => event.key === 'Enter' && onItemClick(item)}>\n <div className={'item-header-icon'}>\n {\n props.multi\n ? isActive\n ? <SystemIcons.Minus/>\n : <SystemIcons.Plus/>\n : isActive\n ? <SystemIcons.ChevronDown/>\n : <SystemIcons.ChevronRight/>\n }\n </div>\n <div className={'item-header-text'}>\n {item.title}\n </div>\n </div>\n <div className={'item-content'}>\n {\n item.header &&\n <div className={'item-content-header'}>\n {item.header}\n </div>\n }\n <div className={'item-content-body'}>\n {item.body}\n </div>\n {\n item.footer &&\n <div className={'item-content-footer'}>\n {item.footer}\n </div>\n }\n </div>\n </div>\n );\n }\n\n return (\n <ContentAccordionWrapper className={'content-accordion'.concat(` ${props.size ?? Size.Medium}`)}>\n {props.items.map(item => renderItem(item))}\n </ContentAccordionWrapper>\n );\n};\n\nexport default ContentAccordion;\n"],"file":"ContentAccordion.js"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
if (typeof define === "function" && define.amd) {
|
|
3
|
+
define(["react", "../ContentAccordion", "@testing-library/react", "../../types"], factory);
|
|
4
|
+
} else if (typeof exports !== "undefined") {
|
|
5
|
+
factory(require("react"), require("../ContentAccordion"), require("@testing-library/react"), require("../../types"));
|
|
6
|
+
} else {
|
|
7
|
+
var mod = {
|
|
8
|
+
exports: {}
|
|
9
|
+
};
|
|
10
|
+
factory(global.react, global.ContentAccordion, global.react, global.types);
|
|
11
|
+
global.undefined = mod.exports;
|
|
12
|
+
}
|
|
13
|
+
})(this, function (_react, _ContentAccordion, _react3, _types) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
var _react2 = _interopRequireDefault(_react);
|
|
17
|
+
|
|
18
|
+
var _ContentAccordion2 = _interopRequireDefault(_ContentAccordion);
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) {
|
|
21
|
+
return obj && obj.__esModule ? obj : {
|
|
22
|
+
default: obj
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe('ContentAccordion', () => {
|
|
27
|
+
const contentAccordionItemsWithBody = [{
|
|
28
|
+
key: '1',
|
|
29
|
+
title: 'Item 1',
|
|
30
|
+
body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
|
|
31
|
+
}, {
|
|
32
|
+
key: '2',
|
|
33
|
+
title: 'Item 2',
|
|
34
|
+
body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
35
|
+
active: true
|
|
36
|
+
}, {
|
|
37
|
+
key: '3',
|
|
38
|
+
title: 'Item 3',
|
|
39
|
+
body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
40
|
+
disabled: true
|
|
41
|
+
}, {
|
|
42
|
+
key: '4',
|
|
43
|
+
title: 'Item 4',
|
|
44
|
+
body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
|
|
45
|
+
}];
|
|
46
|
+
const contentAccordionItemsWithBodyAndHeaderAndFooter = [{
|
|
47
|
+
key: '1',
|
|
48
|
+
title: 'Item 1',
|
|
49
|
+
body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
50
|
+
header: 'Header 1',
|
|
51
|
+
footer: /*#__PURE__*/_react2.default.createElement("span", null)
|
|
52
|
+
}, {
|
|
53
|
+
key: '2',
|
|
54
|
+
title: 'Item 2',
|
|
55
|
+
body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
56
|
+
header: 'Header 2',
|
|
57
|
+
footer: /*#__PURE__*/_react2.default.createElement("span", null)
|
|
58
|
+
}, {
|
|
59
|
+
key: '3',
|
|
60
|
+
title: 'Item 3',
|
|
61
|
+
body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
62
|
+
header: 'Header 3',
|
|
63
|
+
footer: /*#__PURE__*/_react2.default.createElement("span", null),
|
|
64
|
+
disabled: true
|
|
65
|
+
}, {
|
|
66
|
+
key: '4',
|
|
67
|
+
title: 'Item 4',
|
|
68
|
+
body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
69
|
+
header: 'Header 4',
|
|
70
|
+
footer: /*#__PURE__*/_react2.default.createElement("span", null)
|
|
71
|
+
}];
|
|
72
|
+
it('should render items in correct state', () => {
|
|
73
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
74
|
+
items: contentAccordionItemsWithBody
|
|
75
|
+
}));
|
|
76
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item').length).toBe(4);
|
|
77
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item disabled').length).toBe(1);
|
|
78
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item disabled')[0].id).toBe('item_3');
|
|
79
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active').length).toBe(1);
|
|
80
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[0].id).toBe('item_2');
|
|
81
|
+
});
|
|
82
|
+
it('should not render header if not provided', () => {
|
|
83
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
84
|
+
items: contentAccordionItemsWithBody
|
|
85
|
+
}));
|
|
86
|
+
expect(wrapper.baseElement.getElementsByClassName('item-content-body').length).toBe(4);
|
|
87
|
+
expect(wrapper.baseElement.getElementsByClassName('item-content-header').length).toBe(0);
|
|
88
|
+
});
|
|
89
|
+
it('should not render footer if not provided', () => {
|
|
90
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
91
|
+
items: contentAccordionItemsWithBody
|
|
92
|
+
}));
|
|
93
|
+
expect(wrapper.baseElement.getElementsByClassName('item-content-body').length).toBe(4);
|
|
94
|
+
expect(wrapper.baseElement.getElementsByClassName('item-content-footer').length).toBe(0);
|
|
95
|
+
});
|
|
96
|
+
it('should render body, header, and footer if all are provided', () => {
|
|
97
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
98
|
+
items: contentAccordionItemsWithBodyAndHeaderAndFooter
|
|
99
|
+
}));
|
|
100
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item').length).toBe(4);
|
|
101
|
+
expect(wrapper.baseElement.getElementsByClassName('item-content-body').length).toBe(4);
|
|
102
|
+
expect(wrapper.baseElement.getElementsByClassName('item-content-header').length).toBe(4);
|
|
103
|
+
expect(wrapper.baseElement.getElementsByClassName('item-content-footer').length).toBe(4);
|
|
104
|
+
});
|
|
105
|
+
it('should set correct size class name for small accordion', () => {
|
|
106
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
107
|
+
items: contentAccordionItemsWithBodyAndHeaderAndFooter,
|
|
108
|
+
size: _types.Size.Small
|
|
109
|
+
}));
|
|
110
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion small').length).toBe(1);
|
|
111
|
+
});
|
|
112
|
+
it('should set correct size class name for medium accordion', () => {
|
|
113
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
114
|
+
items: contentAccordionItemsWithBodyAndHeaderAndFooter,
|
|
115
|
+
size: _types.Size.Medium
|
|
116
|
+
}));
|
|
117
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion medium').length).toBe(1);
|
|
118
|
+
});
|
|
119
|
+
it('should set correct size class name for large accordion', () => {
|
|
120
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
121
|
+
items: contentAccordionItemsWithBodyAndHeaderAndFooter,
|
|
122
|
+
size: _types.Size.Large
|
|
123
|
+
}));
|
|
124
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion large').length).toBe(1);
|
|
125
|
+
});
|
|
126
|
+
it('should change active state when item header is clicked', () => {
|
|
127
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
128
|
+
items: contentAccordionItemsWithBody,
|
|
129
|
+
multi: false
|
|
130
|
+
}));
|
|
131
|
+
const itemHeader = wrapper.baseElement.getElementsByClassName('item-header')[3];
|
|
132
|
+
|
|
133
|
+
_react3.fireEvent.click(itemHeader);
|
|
134
|
+
|
|
135
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active').length).toBe(1);
|
|
136
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[0].id).toBe('item_4');
|
|
137
|
+
});
|
|
138
|
+
it('should not change active state when disabled item header is clicked', () => {
|
|
139
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
140
|
+
items: contentAccordionItemsWithBody,
|
|
141
|
+
multi: false
|
|
142
|
+
}));
|
|
143
|
+
const itemHeader = wrapper.baseElement.getElementsByClassName('item-header')[2];
|
|
144
|
+
|
|
145
|
+
_react3.fireEvent.click(itemHeader);
|
|
146
|
+
|
|
147
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active').length).toBe(1);
|
|
148
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[0].id).toBe('item_2');
|
|
149
|
+
});
|
|
150
|
+
it('should append active items if multi property is true', () => {
|
|
151
|
+
const wrapper = (0, _react3.render)( /*#__PURE__*/_react2.default.createElement(_ContentAccordion2.default, {
|
|
152
|
+
items: contentAccordionItemsWithBody,
|
|
153
|
+
multi: true
|
|
154
|
+
}));
|
|
155
|
+
const itemHeader = wrapper.baseElement.getElementsByClassName('item-header')[3];
|
|
156
|
+
|
|
157
|
+
_react3.fireEvent.click(itemHeader);
|
|
158
|
+
|
|
159
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active').length).toBe(2);
|
|
160
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[0].id).toBe('item_2');
|
|
161
|
+
expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[1].id).toBe('item_4');
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=ContetnAccordion.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/Accordion/__tests__/ContetnAccordion.test.tsx"],"names":["describe","contentAccordionItemsWithBody","key","title","body","active","disabled","contentAccordionItemsWithBodyAndHeaderAndFooter","header","footer","it","wrapper","render","expect","Size","Small","Medium","Large","itemHeader","fireEvent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKAA,EAAAA,QAAQ,CAAA,kBAAA,EAAqB,MAAM;AACjC,UAAMC,6BAA6B,GAAG,CACpC;AACEC,MAAAA,GAAG,EADL,GAAA;AAEEC,MAAAA,KAAK,EAFP,QAAA;AAGEC,MAAAA,IAAI,EAAE;AAHR,KADoC,EAMpC;AACEF,MAAAA,GAAG,EADL,GAAA;AAEEC,MAAAA,KAAK,EAFP,QAAA;AAGEC,MAAAA,IAAI,EAHN,6HAAA;AAIEC,MAA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BAAA;AAAwD,QAAA,KAAK,EAAE;AAA/D,OAAA,CAAPA,CAAhB;AACA,YAAMM,UAAU,GAAGP,OAAO,CAAPA,WAAAA,CAAAA,sBAAAA,CAAAA,aAAAA,EAAnB,CAAmBA,CAAnB;;AAEAQ,wBAAAA,KAAAA,CAAAA,UAAAA;;AAEAN,MAAAA,MAAM,CAACF,OAAO,CAAPA,WAAAA,CAAAA,sBAAAA,CAAAA,+BAAAA,EAAPE,MAAM,CAANA,CAAAA,IAAAA,CAAAA,CAAAA;AACAA,MAAAA,MAAM,CAACF,OAAO,CAAPA,WAAAA,CAAAA,sBAAAA,CAAAA,+BAAAA,EAAAA,CAAAA,EAAPE,EAAM,CAANA,CAAAA,IAAAA,CAAAA,QAAAA;AACAA,MAAAA,MAAM,CAACF,OAAO,CAAPA,WAAAA,CAAAA,sBAAAA,CAAAA,+BAAAA,EAAAA,CAAAA,EAAPE,EAAM,CAANA,CAAAA,IAAAA,CAAAA,QAAAA;AARFH,KAAE,CAAFA;AAjIFV,GAAQ,CAARA","sourcesContent":["import React from 'react';\nimport ContentAccordion from '../ContentAccordion';\nimport {fireEvent, render} from '@testing-library/react';\nimport {Size} from '../../types';\n\ndescribe('ContentAccordion', () => {\n const contentAccordionItemsWithBody = [\n {\n key: '1',\n title: 'Item 1',\n body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'\n },\n {\n key: '2',\n title: 'Item 2',\n body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',\n active: true\n },\n {\n key: '3',\n title: 'Item 3',\n body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',\n disabled: true\n },\n {\n key: '4',\n title: 'Item 4',\n body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'\n }\n ];\n\n const contentAccordionItemsWithBodyAndHeaderAndFooter = [\n {\n key: '1',\n title: 'Item 1',\n body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',\n header: 'Header 1',\n footer: <span/>,\n },\n {\n key: '2',\n title: 'Item 2',\n body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',\n header: 'Header 2',\n footer: <span/>,\n },\n {\n key: '3',\n title: 'Item 3',\n body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',\n header: 'Header 3',\n footer: <span/>,\n disabled: true\n },\n {\n key: '4',\n title: 'Item 4',\n body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',\n header: 'Header 4',\n footer: <span/>,\n }\n ];\n\n it('should render items in correct state', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBody}/>);\n\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item').length).toBe(4);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item disabled').length).toBe(1);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item disabled')[0].id).toBe('item_3');\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active').length).toBe(1);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[0].id).toBe('item_2');\n });\n\n it('should not render header if not provided', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBody}/>);\n\n expect(wrapper.baseElement.getElementsByClassName('item-content-body').length).toBe(4);\n expect(wrapper.baseElement.getElementsByClassName('item-content-header').length).toBe(0);\n });\n\n it('should not render footer if not provided', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBody}/>);\n\n expect(wrapper.baseElement.getElementsByClassName('item-content-body').length).toBe(4);\n expect(wrapper.baseElement.getElementsByClassName('item-content-footer').length).toBe(0);\n });\n\n it('should render body, header, and footer if all are provided', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBodyAndHeaderAndFooter}/>);\n\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item').length).toBe(4);\n expect(wrapper.baseElement.getElementsByClassName('item-content-body').length).toBe(4);\n expect(wrapper.baseElement.getElementsByClassName('item-content-header').length).toBe(4);\n expect(wrapper.baseElement.getElementsByClassName('item-content-footer').length).toBe(4);\n });\n\n it('should set correct size class name for small accordion', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBodyAndHeaderAndFooter}\n size={Size.Small}/>);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion small').length).toBe(1);\n });\n\n it('should set correct size class name for medium accordion', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBodyAndHeaderAndFooter}\n size={Size.Medium}/>);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion medium').length).toBe(1);\n });\n\n it('should set correct size class name for large accordion', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBodyAndHeaderAndFooter}\n size={Size.Large}/>);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion large').length).toBe(1);\n });\n\n it('should change active state when item header is clicked', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBody} multi={false}/>);\n const itemHeader = wrapper.baseElement.getElementsByClassName('item-header')[3];\n\n fireEvent.click(itemHeader);\n\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active').length).toBe(1);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[0].id).toBe('item_4');\n });\n\n it('should not change active state when disabled item header is clicked', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBody} multi={false}/>);\n const itemHeader = wrapper.baseElement.getElementsByClassName('item-header')[2];\n\n fireEvent.click(itemHeader);\n\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active').length).toBe(1);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[0].id).toBe('item_2');\n });\n\n it('should append active items if multi property is true', () => {\n const wrapper = render(<ContentAccordion items={contentAccordionItemsWithBody} multi={true}/>);\n const itemHeader = wrapper.baseElement.getElementsByClassName('item-header')[3];\n\n fireEvent.click(itemHeader);\n\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active').length).toBe(2);\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[0].id).toBe('item_2');\n expect(wrapper.baseElement.getElementsByClassName('content-accordion-item active')[1].id).toBe('item_4');\n });\n\n});\n"],"file":"ContetnAccordion.test.js"}
|