@laerdal/life-react-components 1.2.2-dev.23.full → 1.2.2-dev.24
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/AccordionItem.js +28 -3
- package/dist/esm/Accordion/AccordionItem.js.map +1 -1
- package/dist/esm/Accordion/AccordionMenu.js +32 -6
- package/dist/esm/Accordion/AccordionMenu.js.map +1 -1
- package/dist/esm/Accordion/__tests__/AccordionMenu.test.js +1 -1
- package/dist/esm/Accordion/__tests__/AccordionMenu.test.js.map +1 -1
- package/dist/esm/Accordion/styles.js +21 -5
- package/dist/esm/Accordion/styles.js.map +1 -1
- package/dist/esm/Modals/ModalDialog.js +3 -4
- package/dist/esm/Modals/ModalDialog.js.map +1 -1
- package/dist/esm/Modals/ModalStyles.js +0 -5
- package/dist/esm/Modals/ModalStyles.js.map +1 -1
- package/dist/esm/Tooltips/TooltipStyles.js +3 -3
- package/dist/esm/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/esm/Tooltips/TooltipTypes.js.map +1 -1
- package/dist/esm/Tooltips/TooltipWrapper.js +1 -4
- package/dist/esm/Tooltips/TooltipWrapper.js.map +1 -1
- package/dist/esm/icons/index.js +1 -1
- package/dist/esm/icons/index.js.map +1 -1
- package/dist/esm/styles/typography.js +25 -6
- package/dist/esm/styles/typography.js.map +1 -1
- package/dist/js/Accordion/AccordionItem.js +47 -3
- package/dist/js/Accordion/AccordionItem.js.map +1 -1
- package/dist/js/Accordion/AccordionMenu.d.ts +4 -2
- package/dist/js/Accordion/AccordionMenu.js +62 -6
- package/dist/js/Accordion/AccordionMenu.js.map +1 -1
- package/dist/js/Accordion/__tests__/AccordionMenu.test.js +1 -1
- package/dist/js/Accordion/__tests__/AccordionMenu.test.js.map +1 -1
- package/dist/js/Accordion/styles.d.ts +2 -0
- package/dist/js/Accordion/styles.js +7 -5
- package/dist/js/Accordion/styles.js.map +1 -1
- package/dist/js/Modals/ModalDialog.js +2 -3
- package/dist/js/Modals/ModalDialog.js.map +1 -1
- package/dist/js/Modals/ModalStyles.d.ts +0 -1
- package/dist/js/Modals/ModalStyles.js +9 -13
- package/dist/js/Modals/ModalStyles.js.map +1 -1
- package/dist/js/Tooltips/TooltipStyles.d.ts +2 -4
- package/dist/js/Tooltips/TooltipStyles.js +2 -8
- package/dist/js/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/js/Tooltips/TooltipTypes.d.ts +0 -1
- package/dist/js/Tooltips/TooltipTypes.js.map +1 -1
- package/dist/js/Tooltips/TooltipWrapper.d.ts +1 -1
- package/dist/js/Tooltips/TooltipWrapper.js +1 -5
- package/dist/js/Tooltips/TooltipWrapper.js.map +1 -1
- package/dist/js/icons/index.js +1 -1
- package/dist/js/icons/index.js.map +1 -1
- package/dist/js/styles/typography.d.ts +1 -0
- package/dist/js/styles/typography.js +25 -6
- package/dist/js/styles/typography.js.map +1 -1
- package/dist/umd/Accordion/AccordionItem.js +32 -3
- package/dist/umd/Accordion/AccordionItem.js.map +1 -1
- package/dist/umd/Accordion/AccordionMenu.js +32 -6
- package/dist/umd/Accordion/AccordionMenu.js.map +1 -1
- package/dist/umd/Accordion/__tests__/AccordionMenu.test.js +1 -1
- package/dist/umd/Accordion/__tests__/AccordionMenu.test.js.map +1 -1
- package/dist/umd/Accordion/styles.js +21 -5
- package/dist/umd/Accordion/styles.js.map +1 -1
- package/dist/umd/Modals/ModalDialog.js +2 -3
- package/dist/umd/Modals/ModalDialog.js.map +1 -1
- package/dist/umd/Modals/ModalStyles.js +1 -6
- package/dist/umd/Modals/ModalStyles.js.map +1 -1
- package/dist/umd/Tooltips/TooltipStyles.js +3 -5
- package/dist/umd/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/umd/Tooltips/TooltipTypes.js.map +1 -1
- package/dist/umd/Tooltips/TooltipWrapper.js +1 -4
- package/dist/umd/Tooltips/TooltipWrapper.js.map +1 -1
- package/dist/umd/icons/index.js +1 -1
- package/dist/umd/icons/index.js.map +1 -1
- package/dist/umd/styles/typography.js +25 -6
- package/dist/umd/styles/typography.js.map +1 -1
- package/package.json +1 -1
|
@@ -363,11 +363,13 @@ const ComponentXLStyling = (textStyle, color) => ComponentStyling('24px', '28px'
|
|
|
363
363
|
const ComponentXL = ({
|
|
364
364
|
color,
|
|
365
365
|
textStyle,
|
|
366
|
-
children
|
|
366
|
+
children,
|
|
367
|
+
className
|
|
367
368
|
}) => {
|
|
368
369
|
let fontWeight = componentFontWeight(textStyle);
|
|
369
370
|
let fontStyle = componentFontStyle(textStyle);
|
|
370
371
|
return /*#__PURE__*/React.createElement(TypographyBase, {
|
|
372
|
+
className: className,
|
|
371
373
|
color: color,
|
|
372
374
|
lineHeight: 28,
|
|
373
375
|
fontSize: 24,
|
|
@@ -378,6 +380,7 @@ const ComponentXL = ({
|
|
|
378
380
|
|
|
379
381
|
ComponentXL.propTypes = {
|
|
380
382
|
color: _pt.string,
|
|
383
|
+
className: _pt.string,
|
|
381
384
|
textStyle: _pt.oneOf([1, 2, 3, 4])
|
|
382
385
|
};
|
|
383
386
|
|
|
@@ -386,11 +389,13 @@ const ComponentLStyling = (textStyle, color) => ComponentStyling('20px', '24px',
|
|
|
386
389
|
const ComponentL = ({
|
|
387
390
|
color,
|
|
388
391
|
textStyle,
|
|
389
|
-
children
|
|
392
|
+
children,
|
|
393
|
+
className
|
|
390
394
|
}) => {
|
|
391
395
|
let fontWeight = componentFontWeight(textStyle);
|
|
392
396
|
let fontStyle = componentFontStyle(textStyle);
|
|
393
397
|
return /*#__PURE__*/React.createElement(TypographyBase, {
|
|
398
|
+
className: className,
|
|
394
399
|
color: color,
|
|
395
400
|
lineHeight: 24,
|
|
396
401
|
fontSize: 20,
|
|
@@ -401,6 +406,7 @@ const ComponentL = ({
|
|
|
401
406
|
|
|
402
407
|
ComponentL.propTypes = {
|
|
403
408
|
color: _pt.string,
|
|
409
|
+
className: _pt.string,
|
|
404
410
|
textStyle: _pt.oneOf([1, 2, 3, 4])
|
|
405
411
|
};
|
|
406
412
|
|
|
@@ -409,11 +415,13 @@ const ComponentMStyling = (textStyle, color) => ComponentStyling('18px', '24px',
|
|
|
409
415
|
const ComponentM = ({
|
|
410
416
|
color,
|
|
411
417
|
textStyle,
|
|
412
|
-
children
|
|
418
|
+
children,
|
|
419
|
+
className
|
|
413
420
|
}) => {
|
|
414
421
|
let fontWeight = componentFontWeight(textStyle);
|
|
415
422
|
let fontStyle = componentFontStyle(textStyle);
|
|
416
423
|
return /*#__PURE__*/React.createElement(TypographyBase, {
|
|
424
|
+
className: className,
|
|
417
425
|
color: color,
|
|
418
426
|
lineHeight: 24,
|
|
419
427
|
fontSize: 18,
|
|
@@ -424,6 +432,7 @@ const ComponentM = ({
|
|
|
424
432
|
|
|
425
433
|
ComponentM.propTypes = {
|
|
426
434
|
color: _pt.string,
|
|
435
|
+
className: _pt.string,
|
|
427
436
|
textStyle: _pt.oneOf([1, 2, 3, 4])
|
|
428
437
|
};
|
|
429
438
|
|
|
@@ -432,11 +441,13 @@ const ComponentSStyling = (textStyle, color) => ComponentStyling('16px', '20px',
|
|
|
432
441
|
const ComponentS = ({
|
|
433
442
|
color,
|
|
434
443
|
textStyle,
|
|
435
|
-
children
|
|
444
|
+
children,
|
|
445
|
+
className
|
|
436
446
|
}) => {
|
|
437
447
|
let fontWeight = componentFontWeight(textStyle);
|
|
438
448
|
let fontStyle = componentFontStyle(textStyle);
|
|
439
449
|
return /*#__PURE__*/React.createElement(TypographyBase, {
|
|
450
|
+
className: className,
|
|
440
451
|
color: color,
|
|
441
452
|
lineHeight: 20,
|
|
442
453
|
fontSize: 16,
|
|
@@ -447,6 +458,7 @@ const ComponentS = ({
|
|
|
447
458
|
|
|
448
459
|
ComponentS.propTypes = {
|
|
449
460
|
color: _pt.string,
|
|
461
|
+
className: _pt.string,
|
|
450
462
|
textStyle: _pt.oneOf([1, 2, 3, 4])
|
|
451
463
|
};
|
|
452
464
|
|
|
@@ -455,12 +467,14 @@ const ComponentXSStyling = (textStyle, color) => ComponentStyling('14px', '16px'
|
|
|
455
467
|
const ComponentXS = ({
|
|
456
468
|
color,
|
|
457
469
|
textStyle,
|
|
458
|
-
children
|
|
470
|
+
children,
|
|
471
|
+
className
|
|
459
472
|
}) => {
|
|
460
473
|
let fontWeight = componentFontWeight(textStyle);
|
|
461
474
|
let fontStyle = componentFontStyle(textStyle);
|
|
462
475
|
let textTransform = componentTextTransformation(textStyle);
|
|
463
476
|
return /*#__PURE__*/React.createElement(TypographyBase, {
|
|
477
|
+
className: className,
|
|
464
478
|
color: color,
|
|
465
479
|
lineHeight: 16,
|
|
466
480
|
fontSize: 14,
|
|
@@ -472,6 +486,7 @@ const ComponentXS = ({
|
|
|
472
486
|
|
|
473
487
|
ComponentXS.propTypes = {
|
|
474
488
|
color: _pt.string,
|
|
489
|
+
className: _pt.string,
|
|
475
490
|
textStyle: _pt.oneOf([1, 2, 3, 4])
|
|
476
491
|
};
|
|
477
492
|
|
|
@@ -480,12 +495,14 @@ const ComponentXXSStyling = (textStyle, color) => ComponentStyling('12px', '16px
|
|
|
480
495
|
const ComponentXXS = ({
|
|
481
496
|
color,
|
|
482
497
|
textStyle,
|
|
483
|
-
children
|
|
498
|
+
children,
|
|
499
|
+
className
|
|
484
500
|
}) => {
|
|
485
501
|
let fontWeight = componentFontWeight(textStyle);
|
|
486
502
|
let fontStyle = componentFontStyle(textStyle);
|
|
487
503
|
let textTransform = componentTextTransformation(textStyle);
|
|
488
504
|
return /*#__PURE__*/React.createElement(TypographyBase, {
|
|
505
|
+
className: className,
|
|
489
506
|
color: color,
|
|
490
507
|
lineHeight: 16,
|
|
491
508
|
fontSize: 12,
|
|
@@ -497,6 +514,7 @@ const ComponentXXS = ({
|
|
|
497
514
|
|
|
498
515
|
ComponentXXS.propTypes = {
|
|
499
516
|
color: _pt.string,
|
|
517
|
+
className: _pt.string,
|
|
500
518
|
textStyle: _pt.oneOf([1, 2, 3, 4])
|
|
501
519
|
};
|
|
502
520
|
|
|
@@ -560,6 +578,7 @@ const ComponentResponsive = ({
|
|
|
560
578
|
|
|
561
579
|
ComponentResponsive.propTypes = {
|
|
562
580
|
color: _pt.string,
|
|
581
|
+
className: _pt.string,
|
|
563
582
|
textStyle: _pt.oneOf([1, 2, 3, 4])
|
|
564
583
|
};
|
|
565
584
|
export { TYPOGRAPHY };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/styles/typography.tsx"],"names":["React","styled","css","COLORS","Size","TYPOGRAPHY","fontFamily","TypographyBase","color","lineHeight","fontSize","fontWeight","fontStyle","textTransform","textDecorationLine","black","HeadlineBaseStyling","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","ComponentLStyling","ComponentL","ComponentMStyling","ComponentM","ComponentSStyling","ComponentS","ComponentXSStyling","ComponentXS","ComponentXXSStyling","ComponentXXS","ComponentResponsive","size","width","fontsize","Small","Medium","Large","XXSmall","XSmall"],"mappings":";AAAA,OAAOA,KAAP,MAAyC,OAAzC;AACA,OAAOC,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,MAAT,QAAuB,GAAvB;AAEA,SAASC,IAAT,QAAqB,UAArB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,UAAU,EAAE;AADK,CAAnB;AAcA,MAAMC,cAAc,GAAGN,MA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AA,QAAQ,EAAEU;AAA1D,QAAP;AAXJ;AAaD,CA9BD;;;AArGEtC,EAAAA,K;AACA4B,EAAAA,S;;AAoIF,SAAS/B,UAAT;AACA,SAASc,UAAT,EAAqBE,SAArB,EAAgCE,SAAhC,EAA2CE,SAA3C,EAAsDE,UAAtD,EAAkEE,WAAlE;AACA,SAASK,kBAAT,EAA6BW,WAA7B,EAA0CG,UAA1C,EAAsDE,UAAtD,EAAkEE,UAAlE,EAA8EE,WAA9E;AACA,SAASC,kBAAT,EAA6BO,WAA7B,EAA0CE,UAA1C,EAAsDE,UAAtD,EAAkEE,UAAlE,EAA8EE,WAA9E,EAA2FE,YAA3F,EAAyGC,mBAAzG;AACA,SAASZ,kBAAT,EAA6BE,iBAA7B,EAAgDE,iBAAhD,EAAmEE,iBAAnE,EAAsFE,kBAAtF,EAA0GE,mBAA1G;AACA,SAAS3B,kBAAT,EAA6BG,iBAA7B,EAAgDE,iBAAhD,EAAmEE,iBAAnE,EAAsFE,kBAAtF;AACA,SAASnC,iBAAT,EAA4BE,gBAA5B,EAA8CE,gBAA9C,EAAgEE,gBAAhE,EAAkFE,iBAAlF,EAAqGE,kBAArG","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 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 }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase 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 }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase 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 }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase 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 }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n return (\n <TypographyBase 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 }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n let textTransform = componentTextTransformation(textStyle);\n return (\n <TypographyBase 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 }) => {\n let fontWeight = componentFontWeight(textStyle);\n let fontStyle = componentFontStyle(textStyle);\n let textTransform = componentTextTransformation(textStyle);\n return (\n <TypographyBase 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":["React","styled","css","COLORS","Size","TYPOGRAPHY","fontFamily","TypographyBase","color","lineHeight","fontSize","fontWeight","fontStyle","textTransform","textDecorationLine","black","HeadlineBaseStyling","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","Small","Medium","Large","XXSmall","XSmall"],"mappings":";AAAA,OAAOA,KAAP,MAAyC,OAAzC;AACA,OAAOC,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,MAAT,QAAuB,GAAvB;AAEA,SAASC,IAAT,QAAqB,UAArB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,UAAU,EAAE;AADK,CAAnB;AAcA,MAAMC,cAAc,GAAGN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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"}
|
|
@@ -17,6 +17,18 @@ var _styles = require("./styles");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
+
|
|
22
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
+
|
|
24
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
+
|
|
26
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
27
|
+
|
|
28
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
29
|
+
|
|
30
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
+
|
|
20
32
|
var AccordionItem = function AccordionItem(props) {
|
|
21
33
|
var id = props.id,
|
|
22
34
|
onSelect = props.onSelect,
|
|
@@ -25,6 +37,18 @@ var AccordionItem = function AccordionItem(props) {
|
|
|
25
37
|
icon = props.icon,
|
|
26
38
|
disabled = props.disabled,
|
|
27
39
|
isLast = props.isLast;
|
|
40
|
+
|
|
41
|
+
var supressFocusRef = _react.default.useRef(null);
|
|
42
|
+
|
|
43
|
+
var _React$useState = _react.default.useState(false),
|
|
44
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
|
+
tabbedHere = _React$useState2[0],
|
|
46
|
+
setTabbedHere = _React$useState2[1];
|
|
47
|
+
|
|
48
|
+
_react.default.useEffect(function () {
|
|
49
|
+
!!disabled && setTabbedHere(false);
|
|
50
|
+
}, [disabled]);
|
|
51
|
+
|
|
28
52
|
return /*#__PURE__*/_react.default.createElement(_styles.AccordionItemContainer, {
|
|
29
53
|
id: id,
|
|
30
54
|
displaySeparator: !isActive && !isLast,
|
|
@@ -36,15 +60,35 @@ var AccordionItem = function AccordionItem(props) {
|
|
|
36
60
|
onSelect(id);
|
|
37
61
|
}
|
|
38
62
|
},
|
|
63
|
+
onKeyDown: function onKeyDown(e) {
|
|
64
|
+
if (e.key == 'Enter') onSelect(id);
|
|
65
|
+
},
|
|
66
|
+
onBlur: function onBlur() {
|
|
67
|
+
setTabbedHere(false);
|
|
68
|
+
supressFocusRef.current = false;
|
|
69
|
+
},
|
|
70
|
+
onFocus: function onFocus() {
|
|
71
|
+
if (!disabled) {
|
|
72
|
+
if (!supressFocusRef.current) setTabbedHere(true);else supressFocusRef.current = false;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
onMouseDown: function onMouseDown() {
|
|
76
|
+
if (!disabled && !tabbedHere) supressFocusRef.current = true;
|
|
77
|
+
},
|
|
78
|
+
tabbedHere: tabbedHere,
|
|
79
|
+
isActive: isActive,
|
|
39
80
|
isDisabled: disabled !== null && disabled !== void 0 ? disabled : false
|
|
40
81
|
}, icon && /*#__PURE__*/_react.default.cloneElement(icon, {
|
|
41
82
|
size: '24px'
|
|
42
83
|
}), /*#__PURE__*/_react.default.createElement(_.ComponentM, {
|
|
43
|
-
|
|
84
|
+
className: "headerLabel",
|
|
85
|
+
color: isActive ? _.COLORS.neutral_800 : disabled ? _.COLORS.neutral_300 : undefined
|
|
44
86
|
}, title), isActive ? /*#__PURE__*/_react.default.createElement(_icons.SystemIcons.ChevronUp, {
|
|
45
|
-
|
|
87
|
+
color: _.COLORS.neutral_800,
|
|
88
|
+
size: "20px"
|
|
46
89
|
}) : /*#__PURE__*/_react.default.createElement(_icons.SystemIcons.ChevronDown, {
|
|
47
|
-
|
|
90
|
+
color: _.COLORS.neutral_600,
|
|
91
|
+
size: "20px"
|
|
48
92
|
})), isActive && /*#__PURE__*/_react.default.createElement(_styles.ItemBodyContainer, null, /*#__PURE__*/_react.default.createElement(_.ComponentS, null, props.children)));
|
|
49
93
|
};
|
|
50
94
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Accordion/AccordionItem.tsx"],"names":["AccordionItem","props","id","onSelect","isActive","title","icon","disabled","isLast","React","cloneElement","size","COLORS","neutral_300","undefined","children"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA
|
|
1
|
+
{"version":3,"sources":["../../../src/Accordion/AccordionItem.tsx"],"names":["AccordionItem","props","id","onSelect","isActive","title","icon","disabled","isLast","supressFocusRef","React","useRef","useState","tabbedHere","setTabbedHere","useEffect","e","key","current","cloneElement","size","COLORS","neutral_800","neutral_300","undefined","neutral_600","children"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;;;;;;;;;;;AAQA,IAAMA,aAA+D,GAAG,SAAlEA,aAAkE,CAACC,KAAD,EAAoC;AAC1G,MAAQC,EAAR,GAAkED,KAAlE,CAAQC,EAAR;AAAA,MAAYC,QAAZ,GAAkEF,KAAlE,CAAYE,QAAZ;AAAA,MAAsBC,QAAtB,GAAkEH,KAAlE,CAAsBG,QAAtB;AAAA,MAAgCC,KAAhC,GAAkEJ,KAAlE,CAAgCI,KAAhC;AAAA,MAAuCC,IAAvC,GAAkEL,KAAlE,CAAuCK,IAAvC;AAAA,MAA6CC,QAA7C,GAAkEN,KAAlE,CAA6CM,QAA7C;AAAA,MAAuDC,MAAvD,GAAkEP,KAAlE,CAAuDO,MAAvD;;AAEA,MAAMC,eAAe,GAAGC,eAAMC,MAAN,CAAkB,IAAlB,CAAxB;;AACA,wBAAoCD,eAAME,QAAN,CAAwB,KAAxB,CAApC;AAAA;AAAA,MAAOC,UAAP;AAAA,MAAmBC,aAAnB;;AAEAJ,iBAAMK,SAAN,CAAgB,YAAM;AACpB,KAAC,CAACR,QAAF,IAAcO,aAAa,CAAC,KAAD,CAA3B;AACD,GAFD,EAEG,CAACP,QAAD,CAFH;;AAIA,sBACE,6BAAC,8BAAD;AAAwB,IAAA,EAAE,E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AoC,IAAA,KAAK,EAAEhB,QAAQ,GAAGiB,SAAOC,WAAV,GAAwBf,QAAQ,GAAGc,SAAOE,WAAV,GAAwBC;AAA3G,KAAuHnB,KAAvH,CA5BF,EA6BGD,QAAQ,gBAAG,6BAAC,kBAAD,CAAa,SAAb;AAAuB,IAAA,KAAK,EAAEiB,SAAOC,WAArC;AAAkD,IAAA,IAAI,EAAC;AAAvD,IAAH,gBAAsE,6BAAC,kBAAD,CAAa,WAAb;AAAyB,IAAA,KAAK,EAAED,SAAOI,WAAvC;AAAoD,IAAA,IAAI,EAAC;AAAzD,IA7BjF,CADF,EAgCGrB,QAAQ,iBACP,6BAAC,yBAAD,qBACE,6BAAC,YAAD,QAAaH,KAAK,CAACyB,QAAnB,CADF,CAjCJ,CADF;AAwCD,CAlDD;;;AALEvB,EAAAA,Q;AACAC,EAAAA,Q;AACAI,EAAAA,M;;eAuDaR,a","sourcesContent":["import React from 'react';\nimport { COLORS, ComponentM, ComponentS } from '..';\nimport { SystemIcons } from '../icons';\nimport { AccordionItemProps } from './AccordionMenu';\nimport { AccordionItemContainer, HeaderIconContainer, ItemBodyContainer, ItemHeaderContainer } from './styles';\n\ninterface AccordionItemPropsInner extends AccordionItemProps {\n onSelect: (id: string) => void;\n isActive: boolean;\n isLast: boolean;\n}\n\nconst AccordionItem: React.FunctionComponent<AccordionItemPropsInner> = (props: AccordionItemPropsInner) => {\n const { id, onSelect, isActive, title, icon, disabled, isLast } = props;\n\n const supressFocusRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n React.useEffect(() => {\n !!disabled && setTabbedHere(false);\n }, [disabled]);\n\n return (\n <AccordionItemContainer id={id} displaySeparator={!isActive && !isLast} isDisabled={disabled ?? false}>\n <ItemHeaderContainer\n tabIndex={!disabled ? 0 : -1}\n onClick={() => {\n if (!disabled) {\n onSelect(id);\n }\n }}\n onKeyDown={(e: any) => {\n if(e.key == 'Enter')\n onSelect(id);\n }}\n onBlur={() => {\n setTabbedHere(false);\n supressFocusRef.current = false;\n }}\n onFocus={() => {\n if(!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onMouseDown={() => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n tabbedHere={tabbedHere}\n isActive={isActive}\n isDisabled={disabled ?? false}>\n {icon && React.cloneElement(icon as React.ReactElement, { size: '24px' })}\n <ComponentM className=\"headerLabel\" color={isActive ? COLORS.neutral_800 : disabled ? COLORS.neutral_300 : undefined}>{title}</ComponentM>\n {isActive ? <SystemIcons.ChevronUp color={COLORS.neutral_800} size=\"20px\" /> : <SystemIcons.ChevronDown color={COLORS.neutral_600} size=\"20px\" />}\n </ItemHeaderContainer>\n {isActive && (\n <ItemBodyContainer>\n <ComponentS>{props.children}</ComponentS>\n </ItemBodyContainer>\n )}\n </AccordionItemContainer>\n );\n};\n\nexport default AccordionItem;\n"],"file":"AccordionItem.js"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface AccordionProps {
|
|
3
3
|
items: AccordionItemProps[];
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
selectedItems?: string[];
|
|
5
|
+
setSelectedItems?: (a: string[]) => void;
|
|
6
|
+
onSelect?: (id: string) => void;
|
|
7
|
+
multipleActive?: boolean;
|
|
6
8
|
}
|
|
7
9
|
export interface AccordionItemProps {
|
|
8
10
|
id: string;
|
|
@@ -21,10 +21,62 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
|
+
|
|
26
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
+
|
|
28
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
29
|
+
|
|
30
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
31
|
+
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
+
|
|
34
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
35
|
+
|
|
36
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
37
|
+
|
|
38
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
39
|
+
|
|
40
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
41
|
+
|
|
42
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
+
|
|
24
44
|
var AccordionMenu = function AccordionMenu(_ref) {
|
|
25
45
|
var items = _ref.items,
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
selectedItems = _ref.selectedItems,
|
|
47
|
+
setSelectedItems = _ref.setSelectedItems,
|
|
48
|
+
onSelect = _ref.onSelect,
|
|
49
|
+
multipleActive = _ref.multipleActive;
|
|
50
|
+
|
|
51
|
+
var _React$useState = React.useState([]),
|
|
52
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
53
|
+
builtinSelectedItems = _React$useState2[0],
|
|
54
|
+
builtinSetSelectedItems = _React$useState2[1];
|
|
55
|
+
|
|
56
|
+
var getCollection = function getCollection() {
|
|
57
|
+
return selectedItems ? selectedItems : builtinSelectedItems;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var getUpdateFunction = function getUpdateFunction() {
|
|
61
|
+
return setSelectedItems ? setSelectedItems : builtinSetSelectedItems;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var onSelected = function onSelected(id) {
|
|
65
|
+
var collection = getCollection();
|
|
66
|
+
var updateFunc = getUpdateFunction();
|
|
67
|
+
var isActive = !!collection.find(function (x) {
|
|
68
|
+
return x == id;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (multipleActive) {
|
|
72
|
+
if (isActive) updateFunc(collection.filter(function (x) {
|
|
73
|
+
return x != id;
|
|
74
|
+
}));else updateFunc([].concat(_toConsumableArray(collection), [id]));
|
|
75
|
+
} else updateFunc(isActive ? [] : [id]);
|
|
76
|
+
|
|
77
|
+
onSelect && onSelect(id);
|
|
78
|
+
};
|
|
79
|
+
|
|
28
80
|
return /*#__PURE__*/React.createElement(_styles.AccordionMenuWrapper, null, items.map(function (item) {
|
|
29
81
|
return /*#__PURE__*/React.createElement(_AccordionItem.default, {
|
|
30
82
|
key: item.id,
|
|
@@ -32,9 +84,11 @@ var AccordionMenu = function AccordionMenu(_ref) {
|
|
|
32
84
|
id: item.id,
|
|
33
85
|
title: item.title,
|
|
34
86
|
icon: item.icon,
|
|
35
|
-
isActive:
|
|
87
|
+
isActive: !!getCollection().find(function (x) {
|
|
88
|
+
return x == item.id;
|
|
89
|
+
}),
|
|
36
90
|
isLast: items.indexOf(item) === items.length - 1,
|
|
37
|
-
onSelect:
|
|
91
|
+
onSelect: onSelected
|
|
38
92
|
}, item.children);
|
|
39
93
|
}));
|
|
40
94
|
};
|
|
@@ -47,8 +101,10 @@ AccordionMenu.propTypes = {
|
|
|
47
101
|
icon: _propTypes.default.node,
|
|
48
102
|
children: _propTypes.default.node.isRequired
|
|
49
103
|
})).isRequired,
|
|
50
|
-
|
|
51
|
-
|
|
104
|
+
selectedItems: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
105
|
+
setSelectedItems: _propTypes.default.func,
|
|
106
|
+
onSelect: _propTypes.default.func,
|
|
107
|
+
multipleActive: _propTypes.default.bool
|
|
52
108
|
};
|
|
53
109
|
var _default = AccordionMenu;
|
|
54
110
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Accordion/AccordionMenu.tsx"],"names":["AccordionMenu","items","
|
|
1
|
+
{"version":3,"sources":["../../../src/Accordion/AccordionMenu.tsx"],"names":["AccordionMenu","items","selectedItems","setSelectedItems","onSelect","multipleActive","React","useState","builtinSelectedItems","builtinSetSelectedItems","getCollection","getUpdateFunction","onSelected","id","collection","updateFunc","isActive","find","x","filter","map","item","disabled","title","icon","indexOf","length","children"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAMA,aAAsD,GAAG,SAAzDA,aAAyD,OAA0F;AAAA,MAAvFC,KAAuF,QAAvFA,KAAuF;AAAA,MAAhFC,aAAgF,QAAhFA,aAAgF;AAAA,MAAjEC,gBAAiE,QAAjEA,gBAAiE;AAAA,MAA/CC,QAA+C,QAA/CA,QAA+C;AAAA,MAArCC,cAAqC,QAArCA,cAAqC;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E,KAJd;AAKE,MAAA,IAAI,EAAEF,IAAI,CAACG,IALb;AAME,MAAA,QAAQ,EAAE,CAAC,CAACd,aAAa,GAAGO,IAAhB,CAAqB,UAAAC,CAAC;AAAA,eAAIA,CAAC,IAAIG,IAAI,CAACR,EAAd;AAAA,OAAtB,CANd;AAOE,MAAA,MAAM,EAAEZ,KAAK,CAACwB,OAAN,CAAcJ,IAAd,MAAwBpB,KAAK,CAACyB,MAAN,GAAe,CAPjD;AAQE,MAAA,QAAQ,EAAEd;AARZ,OASGS,IAAI,CAACM,QATR,CADS;AAAA,GAAV,CADH,CADF;AAiBD,CA/CD;;;AAfE1B,EAAAA,K;AAQAY,IAAAA,E;AACAS,IAAAA,Q;AACAC,IAAAA,K;AACAC,IAAAA,I;AACAG,IAAAA,Q;;AAXAzB,EAAAA,a;AACAC,EAAAA,gB;AACAC,EAAAA,Q;AACAC,EAAAA,c;;eA4DaL,a","sourcesContent":["import * as React from 'react';\nimport AccordionItem from './AccordionItem';\nimport { AccordionMenuWrapper } from './styles';\n\nexport interface AccordionProps {\n items: AccordionItemProps[];\n selectedItems?: string[];\n setSelectedItems?: (a: string[]) => void;\n onSelect?: (id: string) => void;\n multipleActive?: boolean;\n}\n\nexport interface AccordionItemProps {\n id: string;\n disabled?: boolean;\n title: string;\n icon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nconst AccordionMenu: React.FunctionComponent<AccordionProps> = ({ items, selectedItems, setSelectedItems, onSelect, multipleActive }: AccordionProps) => {\n\n const [builtinSelectedItems, builtinSetSelectedItems] = React.useState<string[]>([]);\n\n const getCollection = () => {\n return selectedItems ? selectedItems : builtinSelectedItems;\n };\n\n const getUpdateFunction = () => {\n return setSelectedItems ? setSelectedItems : builtinSetSelectedItems;\n }\n\n const onSelected = (id: string) => {\n const collection = getCollection();\n const updateFunc = getUpdateFunction();\n\n const isActive = !!collection.find(x => x == id);\n if(multipleActive) {\n if(isActive)\n updateFunc(collection.filter(x => x != id));\n \n else \n updateFunc([...collection, id]);\n }\n else\n updateFunc(isActive ? [] : [id]);\n\n onSelect && onSelect(id);\n };\n\n return (\n <AccordionMenuWrapper>\n {items.map((item) => (\n <AccordionItem\n key={item.id}\n disabled={item.disabled}\n id={item.id}\n title={item.title}\n icon={item.icon}\n isActive={!!getCollection().find(x => x == item.id)}\n isLast={items.indexOf(item) === items.length - 1}\n onSelect={onSelected}>\n {item.children}\n </AccordionItem>\n ))}\n </AccordionMenuWrapper>\n );\n};\n\nexport default AccordionMenu;\n"],"file":"AccordionMenu.js"}
|
|
@@ -83,7 +83,7 @@ describe('<AccordionMenu />', function () {
|
|
|
83
83
|
_render3 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_AccordionMenu.default, {
|
|
84
84
|
items: accordionItems,
|
|
85
85
|
onSelect: function onSelect() {},
|
|
86
|
-
|
|
86
|
+
selectedItems: ['test1_id']
|
|
87
87
|
})), container = _render3.container;
|
|
88
88
|
headerItem = container.querySelector('#test1_id'); //check item expanded
|
|
89
89
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/Accordion/__tests__/AccordionMenu.test.tsx"],"names":["accordionItems","id","title","children","describe","it","queryByText","expect","toBeDefined","toBeNull","container","headerItem","querySelector","toHaveStyleRule","COLORS","neutral_20","textContent","toContain"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,cAAc,GAAG,CACrB;AACEC,EAAAA,EAAE,EAAE,UADN;AAEEC,EAAAA,KAAK,EAAE,wBAFT;AAGEC,EAAAA,QAAQ,eAAE;AAHZ,CADqB,EAMrB;AACEF,EAAAA,EAAE,EAAE,UADN;AAEEC,EAAAA,KAAK,EAAE,wBAFT;AAGEC,EAAAA,QAAQ,eAAE;AAHZ,CANqB,CAAvB;AAaAC,QAAQ,CAAC,mBAAD,EAAsB,YAAM;AAClCC,EAAAA,EAAE,CAAC,qCAAD,uEAAwC;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,sBA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;AAAsC,cAAA,QAAQ,EAAE,oBAAM,CAAE,CAAxD;AAA0D,cAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/Accordion/__tests__/AccordionMenu.test.tsx"],"names":["accordionItems","id","title","children","describe","it","queryByText","expect","toBeDefined","toBeNull","container","headerItem","querySelector","toHaveStyleRule","COLORS","neutral_20","textContent","toContain"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,cAAc,GAAG,CACrB;AACEC,EAAAA,EAAE,EAAE,UADN;AAEEC,EAAAA,KAAK,EAAE,wBAFT;AAGEC,EAAAA,QAAQ,eAAE;AAHZ,CADqB,EAMrB;AACEF,EAAAA,EAAE,EAAE,UADN;AAEEC,EAAAA,KAAK,EAAE,wBAFT;AAGEC,EAAAA,QAAQ,eAAE;AAHZ,CANqB,CAAvB;AAaAC,QAAQ,CAAC,mBAAD,EAAsB,YAAM;AAClCC,EAAAA,EAAE,CAAC,qCAAD,uEAAwC;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,sBAChB,kCAAO,6BAAC,sBAAD;AAAe,cAAA,KAAK,EAAEL,cAAtB;AAAsC,cAAA,QAAQ,EAAE,oBAAM,CAAE;AAAxD,cAAP,CADgB,EAChCM,WADgC,WAChCA,WADgC;AAExCC,YAAAA,MAAM,CAACD,WAAW,CAAC,wBAAD,CAAZ,CAAN,CAA8CE,WAA9C;AACAD,YAAAA,MAAM,CAACD,WAAW,CAAC,wBAAD,CAAZ,CAAN,CAA8CE,WAA9C;AACAD,YAAAA,MAAM,CAACD,WAAW,CAAC,eAAD,CAAZ,CAAN,CAAqCG,QAArC;;AAJwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAxC,GAAF;AAOAJ,EAAAA,EAAE,CAAC,0CAAD,uEAA6C;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,uBACvB,kCAAO,6BAAC,sBAAD;AAAe,cAAA,KAAK,EAAEL,cAAtB;AAAsC,cAAA,QAAQ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react';\nimport 'jest-styled-components';\nimport { COLORS } from '../../styles';\nimport AccordionMenu from '../AccordionMenu';\n\nconst accordionItems = [\n {\n id: 'test1_id',\n title: 'Item label with text 1',\n children: <div>content test1</div>,\n },\n {\n id: 'test2_id',\n title: 'Item label with text 2',\n children: <div>content test2</div>,\n },\n];\n\ndescribe('<AccordionMenu />', () => {\n it('Check correct text placed on labels', async () => {\n const { queryByText } = render(<AccordionMenu items={accordionItems} onSelect={() => {}}></AccordionMenu>);\n expect(queryByText('Item label with text 1')).toBeDefined();\n expect(queryByText('Item label with text 2')).toBeDefined();\n expect(queryByText('content test1')).toBeNull();\n });\n\n it('Check item label element color and label', async () => {\n const { container } = render(<AccordionMenu items={accordionItems} onSelect={() => {}}></AccordionMenu>);\n const headerItem = container.querySelector('#test2_id');\n expect(headerItem).toBeDefined();\n expect(headerItem?.children[0]).toHaveStyleRule('background', COLORS.neutral_20);\n expect(headerItem?.textContent).toContain('Item label with text 2');\n });\n\n it('Check expanded item text', async () => {\n const { container } = render(<AccordionMenu items={accordionItems} onSelect={() => {}} selectedItems={['test1_id']}></AccordionMenu>);\n const headerItem = container.querySelector('#test1_id');\n //check item expanded\n expect(headerItem?.children[1]).toBeDefined();\n expect(headerItem?.children[1]?.textContent).toContain('content test1');\n });\n});\n"],"file":"AccordionMenu.test.js"}
|
|
@@ -5,6 +5,8 @@ export declare const AccordionItemContainer: import("styled-components").StyledC
|
|
|
5
5
|
}, never>;
|
|
6
6
|
export declare const ItemHeaderContainer: import("styled-components").StyledComponent<"div", any, {
|
|
7
7
|
isDisabled: boolean;
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
tabbedHere: boolean;
|
|
8
10
|
}, never>;
|
|
9
11
|
export declare const HeaderIconContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
12
|
export declare const ItemBodyContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -13,7 +13,7 @@ var _styles = require("../styles");
|
|
|
13
13
|
|
|
14
14
|
var _zIndexes = require("../styles/z-indexes");
|
|
15
15
|
|
|
16
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
17
17
|
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
|
|
@@ -34,17 +34,19 @@ var AccordionItemContainer = _styledComponents.default.div(_templateObject2 || (
|
|
|
34
34
|
exports.AccordionItemContainer = AccordionItemContainer;
|
|
35
35
|
var disabledState = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", "!important;\n color: ", ";\n pointer-events: none;\n svg {\n color: ", "!important;\n }\n"])), _styles.COLORS.white, _styles.COLORS.neutral_300, _styles.COLORS.neutral_300);
|
|
36
36
|
|
|
37
|
-
var ItemHeaderContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px 11px 16px;\n cursor: pointer;\n background: ", ";\n svg:last-child {\n margin-left: auto;\n }\n :
|
|
37
|
+
var ItemHeaderContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px 11px 16px;\n cursor: pointer;\n background: ", ";\n svg:last-child {\n margin-left: auto;\n }\n outline: none;\n ", "\n\n ", "\n :hover {\n background: ", ";\n }\n\n :hover .headerLabel {\n color: ", ";\n }\n\n :active .headerLabel {\n color: ", ";\n }\n\n :hover svg {\n color: ", ";\n }\n\n :active svg {\n color: ", ";\n }\n\n :active {\n background: ", ";\n }\n"])), _styles.COLORS.neutral_20, function (props) {
|
|
38
|
+
return props.tabbedHere ? (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n z-index: ", ";\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", ";"])), _zIndexes.Z_INDEXES.focus, _styles.COLORS.primary_500, _styles.COLORS.primary_500) : '';
|
|
39
|
+
}, function (props) {
|
|
38
40
|
return props.isDisabled ? disabledState : '';
|
|
39
|
-
}, _styles.COLORS.primary_20, _styles.COLORS.primary_100);
|
|
41
|
+
}, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_800, _styles.COLORS.primary_700, _styles.COLORS.primary_800, _styles.COLORS.primary_100);
|
|
40
42
|
|
|
41
43
|
exports.ItemHeaderContainer = ItemHeaderContainer;
|
|
42
44
|
|
|
43
|
-
var HeaderIconContainer = _styledComponents.default.div(
|
|
45
|
+
var HeaderIconContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: auto;\n"])));
|
|
44
46
|
|
|
45
47
|
exports.HeaderIconContainer = HeaderIconContainer;
|
|
46
48
|
|
|
47
|
-
var ItemBodyContainer = _styledComponents.default.div(
|
|
49
|
+
var ItemBodyContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: 0px 16px;\n margin: 12px 0;\n background: ", ";\n"])), _styles.COLORS.white);
|
|
48
50
|
|
|
49
51
|
exports.ItemBodyContainer = ItemBodyContainer;
|
|
50
52
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Accordion/styles.ts"],"names":["AccordionMenuWrapper","styled","div","AccordionItemContainer","props","displaySeparator","COLORS","neutral_100","isDisabled","disabledState","css","white","neutral_300","ItemHeaderContainer","neutral_20","Z_INDEXES","focus","primary_500","primary_20","primary_100","HeaderIconContainer","ItemBodyContainer"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEO,IAAMA,oBAAoB,GAAGC,0BAAOC,GAAV,oKAA1B;;;;AAOA,IAAMC,sBAAsB,GAAGF,0BAAOC,GAAV,2MAKhB,UAACE,KAAD;AAAA,SAAYA,KAAK,CAACC,gBAAN,uBAAsCC,eAAOC,WAA7C,IAA6D,EAAzE;AAAA,CALgB,EAMvB,UAACH,KAAD;AAAA,SAAYA,KAAK,CAACI,UAAN,GAAmB,aAAnB,GAAmC,SAA/C;AAAA,CANuB,CAA5B;;;AASP,IAAMC,aAAa,OAAGC,qBAAH,6LACHJ,eAAOK,KADJ,EAERL,eAAOM,WAFC,EAKNN,eAAOM,WALD,CAAnB;;AASO,IAAMC,mBAAmB,GAAGZ,0BAAOC,GAAV,
|
|
1
|
+
{"version":3,"sources":["../../../src/Accordion/styles.ts"],"names":["AccordionMenuWrapper","styled","div","AccordionItemContainer","props","displaySeparator","COLORS","neutral_100","isDisabled","disabledState","css","white","neutral_300","ItemHeaderContainer","neutral_20","tabbedHere","Z_INDEXES","focus","primary_500","primary_20","primary_700","primary_800","primary_100","HeaderIconContainer","ItemBodyContainer"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEO,IAAMA,oBAAoB,GAAGC,0BAAOC,GAAV,oKAA1B;;;;AAOA,IAAMC,sBAAsB,GAAGF,0BAAOC,GAAV,2MAKhB,UAACE,KAAD;AAAA,SAAYA,KAAK,CAACC,gBAAN,uBAAsCC,eAAOC,WAA7C,IAA6D,EAAzE;AAAA,CALgB,EAMvB,UAACH,KAAD;AAAA,SAAYA,KAAK,CAACI,UAAN,GAAmB,aAAnB,GAAmC,SAA/C;AAAA,CANuB,CAA5B;;;AASP,IAAMC,aAAa,OAAGC,qBAAH,6LACHJ,eAAOK,KADJ,EAERL,eAAOM,WAFC,EAKNN,eAAOM,WALD,CAAnB;;AASO,IAAMC,mBAAmB,GAAGZ,0BAAOC,GAAV,kkBAOhBI,eAAOQ,UAPS,EAY5B,UAAAV,KAAK;AAAA,SAAIA,KAAK,CAACW,UAAN,OAAmBL,qBAAnB,mJACEM,oBAAUC,KADZ,EAEkBX,eAAOY,WAFzB,EAEqDZ,eAAOY,WAF5D,IAE6E,EAFjF;AAAA,CAZuB,EAgB5B,UAACd,KAAD;AAAA,SAAYA,KAAK,CAACI,UAAN,GAAmBC,aAAnB,GAAmC,EAA/C;AAAA,CAhB4B,EAkBdH,eAAOa,UAlBO,EAsBnBb,eAAOc,WAtBY,EA0BnBd,eAAOe,WA1BY,EA8BnBf,eAAOc,WA9BY,EAkCnBd,eAAOe,WAlCY,EAsCdf,eAAOgB,WAtCO,CAAzB;;;;AA0CA,IAAMC,mBAAmB,GAAGtB,0BAAOC,GAAV,+FAAzB;;;;AAIA,IAAMsB,iBAAiB,GAAGvB,0BAAOC,GAAV,wIAGdI,eAAOK,KAHO,CAAvB","sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '../styles';\nimport { Z_INDEXES } from '../styles/z-indexes';\n\nexport const AccordionMenuWrapper = styled.div`\n min-width: 320px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n`;\n\nexport const AccordionItemContainer = styled.div<{ displaySeparator: boolean; isDisabled: boolean }>`\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n border-bottom: ${(props) => (props.displaySeparator ? `1px solid ${COLORS.neutral_100}` : '')};\n cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};\n`;\n\nconst disabledState = css`\n background: ${COLORS.white}!important;\n color: ${COLORS.neutral_300};\n pointer-events: none;\n svg {\n color: ${COLORS.neutral_300}!important;\n }\n`;\n\nexport const ItemHeaderContainer = styled.div<{ isDisabled: boolean, isActive: boolean, tabbedHere: boolean }>`\n position: relative;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px 11px 16px;\n cursor: pointer;\n background: ${COLORS.neutral_20};\n svg:last-child {\n margin-left: auto;\n }\n outline: none;\n ${props => props.tabbedHere ? css`\n z-index: ${Z_INDEXES.focus};\n box-shadow: 0px 4px 12px ${COLORS.primary_500}, 0px 0px 8px ${COLORS.primary_500};` : ''}\n\n ${(props) => (props.isDisabled ? disabledState : '')}\n :hover {\n background: ${COLORS.primary_20};\n }\n\n :hover .headerLabel {\n color: ${COLORS.primary_700};\n }\n\n :active .headerLabel {\n color: ${COLORS.primary_800};\n }\n\n :hover svg {\n color: ${COLORS.primary_700};\n }\n\n :active svg {\n color: ${COLORS.primary_800};\n }\n\n :active {\n background: ${COLORS.primary_100};\n }\n`;\n\nexport const HeaderIconContainer = styled.div`\n margin-left: auto;\n`;\n\nexport const ItemBodyContainer = styled.div`\n padding: 0px 16px;\n margin: 12px 0;\n background: ${COLORS.white};\n`;\n"],"file":"styles.js"}
|