@laerdal/life-react-components 1.0.1-dev.19.full → 1.0.1-dev.22.full
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/AuthPage/Information.js +4 -7
- package/dist/esm/AuthPage/Information.js.map +1 -1
- package/dist/esm/Banners/Banner.js +5 -5
- package/dist/esm/Banners/Banner.js.map +1 -1
- package/dist/esm/Banners/OverviewBanner.js +2 -2
- package/dist/esm/Banners/OverviewBanner.js.map +1 -1
- package/dist/esm/Breadcrumb/Breadcrumb.js +46 -20
- package/dist/esm/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/Button/Iconbutton.js +4 -1
- package/dist/esm/Button/Iconbutton.js.map +1 -1
- package/dist/esm/Dropdown/CommonStyling.js +28 -28
- package/dist/esm/Dropdown/CommonStyling.js.map +1 -1
- package/dist/esm/Footer/Components/FooterDropdownLinks.js +9 -9
- package/dist/esm/Footer/Components/FooterDropdownLinks.js.map +1 -1
- package/dist/esm/Footer/Components/FooterNavSection.js +4 -8
- package/dist/esm/Footer/Components/FooterNavSection.js.map +1 -1
- package/dist/esm/Footer/Components/FooterNewsletterAndSocialSection.js +4 -4
- package/dist/esm/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/esm/Footer/Components/FooterTop.js +2 -2
- package/dist/esm/Footer/Components/FooterTop.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/Logo.js +8 -11
- package/dist/esm/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/RightSideNav.js +4 -3
- package/dist/esm/GlobalNavigationBar/RightSideNav.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/UserMenu/MenuLink.js +3 -6
- package/dist/esm/GlobalNavigationBar/UserMenu/MenuLink.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/UserMenu/MobileUserMenu.js +10 -7
- package/dist/esm/GlobalNavigationBar/UserMenu/MobileUserMenu.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/UserMenu/UserMenu.js +5 -13
- package/dist/esm/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/mobile/CommonStyles.js +4 -1
- package/dist/esm/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/mobile/MobileMenu.js +6 -9
- package/dist/esm/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/esm/InputFields/DatepickerField.js +13 -14
- package/dist/esm/InputFields/DatepickerField.js.map +1 -1
- package/dist/esm/InputFields/components/SearchBarInput.js +11 -11
- package/dist/esm/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/esm/InputFields/components/SearchField.js +13 -11
- package/dist/esm/InputFields/components/SearchField.js.map +1 -1
- package/dist/esm/List/ListRow.js +5 -2
- package/dist/esm/List/ListRow.js.map +1 -1
- package/dist/esm/List/ListRowDropdown.js +4 -5
- package/dist/esm/List/ListRowDropdown.js.map +1 -1
- package/dist/esm/LoadingPage/GlobalLoadingPage.js +4 -3
- package/dist/esm/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/esm/MiniProductCard/MiniProductCard.js +4 -5
- package/dist/esm/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/esm/Modals/ModalDialog.js +22 -10
- package/dist/esm/Modals/ModalDialog.js.map +1 -1
- package/dist/esm/Paginator/Paginator.js +5 -6
- package/dist/esm/Paginator/Paginator.js.map +1 -1
- package/dist/esm/SkipToContent/SkipToContent.js +4 -5
- package/dist/esm/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/esm/Switcher/MobileSwitcherMenu.js +4 -4
- package/dist/esm/Switcher/MobileSwitcherMenu.js.map +1 -1
- package/dist/esm/Switcher/SwitcherMenuItem.js +8 -9
- package/dist/esm/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/esm/Tabs/HorizontalTabs.js +7 -10
- package/dist/esm/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/esm/Toasters/Toast.js +1 -2
- package/dist/esm/Toasters/Toast.js.map +1 -1
- package/dist/esm/styles/typography.js +52 -1
- package/dist/esm/styles/typography.js.map +1 -1
- package/dist/js/AuthPage/Information.js +4 -2
- package/dist/js/AuthPage/Information.js.map +1 -1
- package/dist/js/Banners/Banner.js +2 -2
- package/dist/js/Banners/Banner.js.map +1 -1
- package/dist/js/Banners/OverviewBanner.js +3 -1
- package/dist/js/Banners/OverviewBanner.js.map +1 -1
- package/dist/js/Breadcrumb/Breadcrumb.d.ts +2 -0
- package/dist/js/Breadcrumb/Breadcrumb.js +46 -14
- package/dist/js/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/js/Button/Iconbutton.d.ts +1 -0
- package/dist/js/Button/Iconbutton.js +4 -1
- package/dist/js/Button/Iconbutton.js.map +1 -1
- package/dist/js/Dropdown/CommonStyling.js +4 -4
- package/dist/js/Dropdown/CommonStyling.js.map +1 -1
- package/dist/js/Footer/Components/FooterDropdownLinks.js +3 -3
- package/dist/js/Footer/Components/FooterDropdownLinks.js.map +1 -1
- package/dist/js/Footer/Components/FooterNavSection.js +4 -2
- package/dist/js/Footer/Components/FooterNavSection.js.map +1 -1
- package/dist/js/Footer/Components/FooterNewsletterAndSocialSection.js +2 -2
- package/dist/js/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/js/Footer/Components/FooterTop.js +3 -1
- package/dist/js/Footer/Components/FooterTop.js.map +1 -1
- package/dist/js/GlobalNavigationBar/Logo.js +9 -7
- package/dist/js/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/js/GlobalNavigationBar/RightSideNav.js +3 -1
- package/dist/js/GlobalNavigationBar/RightSideNav.js.map +1 -1
- package/dist/js/GlobalNavigationBar/UserMenu/MenuLink.js +3 -1
- package/dist/js/GlobalNavigationBar/UserMenu/MenuLink.js.map +1 -1
- package/dist/js/GlobalNavigationBar/UserMenu/MobileUserMenu.js +4 -2
- package/dist/js/GlobalNavigationBar/UserMenu/MobileUserMenu.js.map +1 -1
- package/dist/js/GlobalNavigationBar/UserMenu/UserMenu.js +4 -2
- package/dist/js/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
- package/dist/js/GlobalNavigationBar/mobile/CommonStyles.js +1 -1
- package/dist/js/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/js/GlobalNavigationBar/mobile/MobileMenu.d.ts +1 -1
- package/dist/js/GlobalNavigationBar/mobile/MobileMenu.js +4 -2
- package/dist/js/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/js/InputFields/DatepickerField.js +4 -2
- package/dist/js/InputFields/DatepickerField.js.map +1 -1
- package/dist/js/InputFields/components/SearchBarInput.js +4 -2
- package/dist/js/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/js/InputFields/components/SearchField.js +3 -1
- package/dist/js/InputFields/components/SearchField.js.map +1 -1
- package/dist/js/List/ListRow.js +3 -1
- package/dist/js/List/ListRow.js.map +1 -1
- package/dist/js/List/ListRowDropdown.js +3 -1
- package/dist/js/List/ListRowDropdown.js.map +1 -1
- package/dist/js/LoadingPage/GlobalLoadingPage.js +3 -1
- package/dist/js/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/js/MiniProductCard/MiniProductCard.js +4 -2
- package/dist/js/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/js/Modals/ModalDialog.d.ts +1 -1
- package/dist/js/Modals/ModalDialog.js +24 -10
- package/dist/js/Modals/ModalDialog.js.map +1 -1
- package/dist/js/Paginator/Paginator.js +3 -1
- package/dist/js/Paginator/Paginator.js.map +1 -1
- package/dist/js/SkipToContent/SkipToContent.js +3 -1
- package/dist/js/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/js/Switcher/MobileSwitcherMenu.js +3 -1
- package/dist/js/Switcher/MobileSwitcherMenu.js.map +1 -1
- package/dist/js/Switcher/SwitcherMenuItem.js +3 -1
- package/dist/js/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/js/Tabs/HorizontalTabs.js +3 -1
- package/dist/js/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/js/Toasters/Toast.js +3 -3
- package/dist/js/Toasters/Toast.js.map +1 -1
- package/dist/js/styles/typography.d.ts +19 -6
- package/dist/js/styles/typography.js +80 -5
- package/dist/js/styles/typography.js.map +1 -1
- package/dist/umd/AuthPage/Information.js +6 -10
- package/dist/umd/AuthPage/Information.js.map +1 -1
- package/dist/umd/Banners/Banner.js +2 -2
- package/dist/umd/Banners/Banner.js.map +1 -1
- package/dist/umd/Banners/OverviewBanner.js +5 -6
- package/dist/umd/Banners/OverviewBanner.js.map +1 -1
- package/dist/umd/Breadcrumb/Breadcrumb.js +48 -22
- package/dist/umd/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/umd/Button/Iconbutton.js +4 -1
- package/dist/umd/Button/Iconbutton.js.map +1 -1
- package/dist/umd/Dropdown/CommonStyling.js +28 -28
- package/dist/umd/Dropdown/CommonStyling.js.map +1 -1
- package/dist/umd/Footer/Components/FooterDropdownLinks.js +8 -8
- package/dist/umd/Footer/Components/FooterDropdownLinks.js.map +1 -1
- package/dist/umd/Footer/Components/FooterNavSection.js +6 -11
- package/dist/umd/Footer/Components/FooterNavSection.js.map +1 -1
- package/dist/umd/Footer/Components/FooterNewsletterAndSocialSection.js +3 -3
- package/dist/umd/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/umd/Footer/Components/FooterTop.js +5 -6
- package/dist/umd/Footer/Components/FooterTop.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/Logo.js +10 -14
- package/dist/umd/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/RightSideNav.js +6 -6
- package/dist/umd/GlobalNavigationBar/RightSideNav.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/UserMenu/MenuLink.js +5 -9
- package/dist/umd/GlobalNavigationBar/UserMenu/MenuLink.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/UserMenu/MobileUserMenu.js +12 -10
- package/dist/umd/GlobalNavigationBar/UserMenu/MobileUserMenu.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/UserMenu/UserMenu.js +7 -16
- package/dist/umd/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/mobile/CommonStyles.js +4 -1
- package/dist/umd/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/mobile/MobileMenu.js +7 -11
- package/dist/umd/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/umd/InputFields/DatepickerField.js +15 -16
- package/dist/umd/InputFields/DatepickerField.js.map +1 -1
- package/dist/umd/InputFields/components/SearchBarInput.js +13 -14
- package/dist/umd/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/umd/InputFields/components/SearchField.js +15 -14
- package/dist/umd/InputFields/components/SearchField.js.map +1 -1
- package/dist/umd/List/ListRow.js +7 -5
- package/dist/umd/List/ListRow.js.map +1 -1
- package/dist/umd/List/ListRowDropdown.js +6 -8
- package/dist/umd/List/ListRowDropdown.js.map +1 -1
- package/dist/umd/LoadingPage/GlobalLoadingPage.js +6 -6
- package/dist/umd/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/umd/MiniProductCard/MiniProductCard.js +6 -8
- package/dist/umd/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/umd/Modals/ModalDialog.js +22 -10
- package/dist/umd/Modals/ModalDialog.js.map +1 -1
- package/dist/umd/Paginator/Paginator.js +7 -9
- package/dist/umd/Paginator/Paginator.js.map +1 -1
- package/dist/umd/SkipToContent/SkipToContent.js +6 -8
- package/dist/umd/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/umd/Switcher/MobileSwitcherMenu.js +6 -7
- package/dist/umd/Switcher/MobileSwitcherMenu.js.map +1 -1
- package/dist/umd/Switcher/SwitcherMenuItem.js +10 -12
- package/dist/umd/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/umd/Tabs/HorizontalTabs.js +8 -12
- package/dist/umd/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/umd/Toasters/Toast.js +1 -2
- package/dist/umd/Toasters/Toast.js.map +1 -1
- package/dist/umd/styles/typography.js +62 -2
- package/dist/umd/styles/typography.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import AuthPageSection from './_AuthPageSection';
|
|
3
|
-
import { COLORS,
|
|
3
|
+
import { BREAKPOINTS, COLORS, ParagraphTextStyle } from '../styles';
|
|
4
|
+
import { HeadlineXLStyling, ParagraphLStyling } from '../styles/typography';
|
|
4
5
|
export const InformationContainer = styled(AuthPageSection)`
|
|
5
6
|
display: none;
|
|
6
7
|
background: ${props => props.color};
|
|
@@ -24,16 +25,12 @@ export const InformationContent = styled.div`
|
|
|
24
25
|
}
|
|
25
26
|
`;
|
|
26
27
|
export const InformationHeader = styled.h2`
|
|
27
|
-
|
|
28
|
+
${HeadlineXLStyling(COLORS.black)}
|
|
28
29
|
font-weight: 300;
|
|
29
|
-
font-size: 48px;
|
|
30
|
-
line-height: 140%;
|
|
31
30
|
margin-bottom: 0;
|
|
32
31
|
`;
|
|
33
32
|
export const InformationText = styled.p`
|
|
34
|
-
|
|
35
|
-
line-height: 140%;
|
|
36
|
-
color: ${COLORS.neutral_600};
|
|
33
|
+
${ParagraphLStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}
|
|
37
34
|
margin: 8px 0;
|
|
38
35
|
`;
|
|
39
36
|
export const InformationImage = styled.img`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/AuthPage/Information.tsx"],"names":["styled","AuthPageSection","COLORS","
|
|
1
|
+
{"version":3,"sources":["../../../src/AuthPage/Information.tsx"],"names":["styled","AuthPageSection","BREAKPOINTS","COLORS","ParagraphTextStyle","HeadlineXLStyling","ParagraphLStyling","InformationContainer","props","color","MEDIUM","InformationContent","div","LARGE","InformationHeader","h2","black","InformationText","p","Regular","neutral_600","InformationImage","img"],"mappings":"AACA,OAAOA,MAAP,MAAmB,mBAAnB;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,SAAQC,WAAR,EAAqBC,MAArB,EAA6DC,kBAA7D,QAAsF,WAAtF;AACA,SAA2BC,iBAA3B,EAA8CC,iBAA9C,QAAsE,sBAAtE;AAEA,OAAO,MAAMC,oBAAoB,GAAGP,MAAM,CAACC,eAAD,CAAqC;AAC/E;AACA,gBAAgBO,KAAK,IAAIA,KAAK,CAACC,KAAM;AACrC;AACA,IAAIP,WAAW,CAACQ,MAAO;AACvB;AACA;AACA;AACA,CARO;AAUP,OAAO,MAAMC,kBAAkB,GAAGX,MAAM,CAACY,GAAI;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIV,WAAW,CAACW,KAAM;AACtB;AACA;AACA;AACA,CAZO;AAcP,OAAO,MAAMC,iBAAiB,GAAGd,MAAM,CAACe,EAAG;AAC3C,IAAIV,iBAAiB,CAACF,MAAM,CAACa,KAAR,CAAe;AACpC;AACA;AACA,CAJO;AAMP,OAAO,MAAMC,eAAe,GAAGjB,MAAM,CAACkB,CAAE;AACxC,IAAIZ,iBAAiB,CAACF,kBAAkB,CAACe,OAApB,EAA6BhB,MAAM,CAACiB,WAApC,CAAiD;AACtE;AACA,CAHO;AAKP,OAAO,MAAMC,gBAAgB,GAAGrB,MAAM,CAACsB,GAAI;AAC3C;AACA;AACA,CAHO","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport AuthPageSection from './_AuthPageSection';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle, HeadlineXL, ParagraphTextStyle} from '../styles';\nimport {ComponentLStyling, HeadlineXLStyling, ParagraphLStyling} from '../styles/typography';\n\nexport const InformationContainer = styled(AuthPageSection)<{ color: string }>`\n display: none;\n background: ${props => props.color};\n\n ${BREAKPOINTS.MEDIUM} {\n display: flex;\n padding-top: 56px;\n }\n`;\n\nexport const InformationContent = styled.div`\n display: flex;\n flex-direction: column;\n align-self: center;\n align-items: center;\n text-align: center;\n max-width: 100%;\n\n ${BREAKPOINTS.LARGE} {\n align-self: flex-end;\n margin-right: 48px;\n }\n`;\n\nexport const InformationHeader = styled.h2`\n ${HeadlineXLStyling(COLORS.black)}\n font-weight: 300;\n margin-bottom: 0;\n`;\n\nexport const InformationText = styled.p`\n ${ParagraphLStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}\n margin: 8px 0;\n`;\n\nexport const InformationImage = styled.img`\n height: 275px;\n max-width: 100%;\n`;\n"],"file":"Information.js"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _pt from "prop-types";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { BREAKPOINTS, COLORS } from '../styles';
|
|
5
|
-
import {
|
|
4
|
+
import { BREAKPOINTS, COLORS, ComponentTextStyle } from '../styles';
|
|
5
|
+
import { Close, Help, TechnicalWarning, ThumbsUp, Tip } from '../icons/systemicons/SystemIcons';
|
|
6
6
|
import { IconButton } from '../Button';
|
|
7
7
|
import { getButtonStyle } from './styles';
|
|
8
|
-
import { ComponentResponsive } from '../styles/typography';
|
|
8
|
+
import { ComponentMStyling, ComponentResponsive } from '../styles/typography';
|
|
9
9
|
import { HyperLink } from '../HyperLink';
|
|
10
10
|
/**
|
|
11
11
|
* Styles for <Banner />
|
|
@@ -43,8 +43,8 @@ const BannerContainer = styled.div`
|
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
45
45
|
const BannerCenter = styled.div`
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
${props => ComponentMStyling(ComponentTextStyle.Regular, props.color)}
|
|
47
|
+
|
|
48
48
|
display: flex;
|
|
49
49
|
width: 100%;
|
|
50
50
|
margin: 0 0 0 16px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Banners/Banner.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","Tip","ThumbsUp","Help","Close","TechnicalWarning","IconButton","getButtonStyle","ComponentResponsive","HyperLink","BannerContainer","div","props","type","correct_100","black","bottom","MEDIUM","LARGE","link","BannerCenter","color","ButtonWrapper","BannerContentWrapper","Banner","size","children","testId","linkText","onClose","icon","noIcon","width","setWidth","useState","window","innerWidth","useEffect","handleResize","addEventListener","formatTypeToLowerCase","toLowerCase","warning_100","warning_700","warning_20","Math","floor","random","white","warning_500","critical_100","critical_700","critical_20","critical_500","correct_700","correct_20","correct_500","primary_100","primary_700","primary_20","primary_500","hover"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AAEA,SAASC,WAAT,EAAsBC,MAAtB,QAAoC,WAApC;AACA,SAASC,GAAT,EAAcC,QAAd,EAAwBC,IAAxB,EAA8BC,KAA9B,EAAqCC,gBAArC,QAA6D,kCAA7D;AACA,SAASC,UAAT,QAA2B,WAA3B;AACA,SAASC,cAAT,QAA+B,UAA/B;AACA,SAASC,mBAAT,QAAoC,sBAApC;AACA,SAASC,SAAT,QAA0B,cAA1B;AAEA;AACA;AACA;;AACA,MAAMC,eAAe,GAAGZ,MAAM,CAACa,GAAiB;AAChD,gBAAiBC,KAAD,IAAyBA,KAAK,CAACC,IAAN,GAAaD,KAAK,CAACC,IAAnB,GAA0Bb,MAAM,CAACc,WAAa;AACvF;AACA;AACA,WAAWd,MAAM,CAACe,KAAM;AACxB,gBAAiBH,KAAD,IAAyBA,KAAK,CAACI,MAAN,GAAe,MAAf,GAAwB,GAAK;AACtE;AACA;AACA;AACA;AACA,MAAMjB,WAAW,CAACkB,MAAO;AACzB;AACA;AACA,MAAMlB,WAAW,CAACmB,KAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAcN,KAAD,IAAwBA,KAAK,CAACO,IAAK;AAChD;AACA,CA9BA;AAgCA,MAAMC,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AAA,IAAI,EAAC;AAApB,sBACE,oBAAC,UAAD;AAAY,QAAA,OAAO,EAAC,WAApB;AAAgC,QAAA,KAAK,EAAC,UAAtC;AAAiD,QAAA,wBAAwB,MAAzE;AAA0E,QAAA,yBAAyB,EAAE7B,MAAM,CAACgD,KAA5G;AAAmH,QAAA,MAAM,EAAE,MAAMnB,OAAO;AAAxI,sBACE,oBAAC,KAAD;AAAO,QAAA,KAAK,EAAE7B,MAAM,CAAC4D,WAArB;AAAkC,QAAA,IAAI,EAAC;AAAvC,QADF,CADF,CAbJ,CADF,CADF;AA7EJ;AAsGD,CAhHD;;;AAZEnC,EAAAA,I,aAAO,O,EAAU,Q,EAAW,O;AAC5BZ,EAAAA,I;AACAM,EAAAA,I;AACAS,EAAAA,Q;AACAiC,EAAAA,K;AACA7C,EAAAA,M;AACAW,EAAAA,M;AACAG,EAAAA,I;AACAD,EAAAA,O;AACAE,EAAAA,M;;AAqHF,eAAeP,MAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Tip, ThumbsUp, Help, Close, TechnicalWarning } from '../icons/systemicons/SystemIcons';\nimport { IconButton } from '../Button';\nimport { getButtonStyle } from './styles';\nimport { ComponentResponsive } from '../styles/typography';\nimport { HyperLink } from '../HyperLink';\n\n/**\n * Styles for <Banner />\n */\nconst BannerContainer = styled.div<BannerProps>`\n background: ${(props: BannerProps) => (props.type ? props.type : COLORS.correct_100)};\n min-height: 48px;\n display: flex;\n color: ${COLORS.black};\n margin-top: ${(props: BannerProps) => (props.bottom ? 'auto' : '0')};\n\n button:last-child {\n line-height: 0;\n margin: 0 0 0 8px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 0 0 16px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 0 0 32px;\n }\n &.small {\n margin: 0 0 0 8px;\n }\n &.medium {\n margin: 0 0 0 16px;\n }\n &.large {\n margin: 0 0 0 32px;\n }\n }\n\n a {\n color: ${(props: BannerProps) => props.link} !important;\n }\n`;\n\nconst BannerCenter = styled.div`\n color: ${(props) => props.color};\n font-size: 18px;\n display: flex;\n width: 100%;\n margin: 0 0 0 16px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 16px 0 32px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 40px 0 56px;\n }\n &.small {\n margin: 0 0 0 16px;\n }\n &.medium {\n margin: 0 16px 0 32px;\n }\n &.large {\n margin: 0 40px 0 56px;\n }\n\n > svg {\n flex-shrink: 0;\n margin: 12px 0;\n }\n`;\n\nconst ButtonWrapper = styled.div<{ type?: string }>`\n margin: 0 0 0 auto;\n ${(props) => (props.type ? getButtonStyle(props.type) : null)};\n`;\n\nconst BannerContentWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: 12px 0;\n &:not(:first-child) {\n margin-left: 8px;\n }\n`;\n\ntype BannerProps = {\n size?: 'small' | 'medium' | 'large';\n type?: string;\n link?: string;\n linkText?: string;\n hover?: string;\n bottom?: boolean;\n testId?: string;\n icon?: React.ReactNode;\n onClose?: () => void;\n noIcon?: boolean;\n};\n\nconst Banner: React.FunctionComponent<BannerProps> = ({ size, type, children, bottom, testId, linkText, link, onClose, icon, noIcon }) => {\n const [width, setWidth] = React.useState<number>(window.innerWidth);\n React.useEffect(() => {\n function handleResize() {\n setWidth(window.innerWidth);\n }\n window.addEventListener('resize', handleResize);\n });\n\n const formatTypeToLowerCase = type?.toLowerCase();\n switch (formatTypeToLowerCase) {\n case 'warning':\n return (\n <BannerContainer data-testid={testId} type={COLORS.warning_100} link={COLORS.warning_700} hover={COLORS.warning_20} bottom={bottom}>\n <BannerCenter color={COLORS.warning_700} className={size}>\n {icon ? icon : noIcon ? null : <Help color={COLORS.warning_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.warning_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.warning_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'critical':\n return (\n <BannerContainer data-testid={testId} type={COLORS.critical_100} link={COLORS.critical_700} hover={COLORS.critical_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.critical_700} className={size}>\n {icon ? icon : noIcon ? null : <TechnicalWarning color={COLORS.critical_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.critical_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.critical_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'positive':\n return (\n <BannerContainer data-testid={testId} type={COLORS.correct_100} link={COLORS.correct_700} hover={COLORS.correct_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.correct_700} className={size}>\n {icon ? icon : noIcon ? null : <ThumbsUp color={COLORS.correct_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.correct_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.correct_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n default:\n return (\n <BannerContainer data-testid={testId} type={COLORS.primary_100} link={COLORS.primary_700} hover={COLORS.primary_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.primary_700} className={size}>\n {icon ? icon : noIcon ? null : <Tip color={COLORS.primary_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.primary_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type=\"neutral\">\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.primary_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n }\n};\n\nexport default Banner;\n"],"file":"Banner.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/Banners/Banner.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","ComponentTextStyle","Close","Help","TechnicalWarning","ThumbsUp","Tip","IconButton","getButtonStyle","ComponentMStyling","ComponentResponsive","HyperLink","BannerContainer","div","props","type","correct_100","black","bottom","MEDIUM","LARGE","link","BannerCenter","Regular","color","ButtonWrapper","BannerContentWrapper","Banner","size","children","testId","linkText","onClose","icon","noIcon","width","setWidth","useState","window","innerWidth","useEffect","handleResize","addEventListener","formatTypeToLowerCase","toLowerCase","warning_100","warning_700","warning_20","Math","floor","random","white","warning_500","critical_100","critical_700","critical_20","critical_500","correct_700","correct_20","correct_500","primary_100","primary_700","primary_20","prim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;AAAO,QAAA,KAAK,EAAEhC,MAAM,CAAC+D,WAArB;AAAkC,QAAA,IAAI,EAAC;AAAvC,QADF,CADF,CAbJ,CADF,CADF;AA7EJ;AAsGD,CAhHD;;;AAZEnC,EAAAA,I,aAAO,O,EAAU,Q,EAAW,O;AAC5Bb,EAAAA,I;AACAM,EAAAA,I;AACAU,EAAAA,Q;AACAiC,EAAAA,K;AACA9C,EAAAA,M;AACAY,EAAAA,M;AACAG,EAAAA,I;AACAD,EAAAA,O;AACAE,EAAAA,M;;AAqHF,eAAeP,MAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\n\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../styles';\nimport {Close, Help, TechnicalWarning, ThumbsUp, Tip} from '../icons/systemicons/SystemIcons';\nimport {IconButton} from '../Button';\nimport {getButtonStyle} from './styles';\nimport {ComponentMStyling, ComponentResponsive} from '../styles/typography';\nimport {HyperLink} from '../HyperLink';\n\n/**\n * Styles for <Banner />\n */\nconst BannerContainer = styled.div<BannerProps>`\n background: ${(props: BannerProps) => (props.type ? props.type : COLORS.correct_100)};\n min-height: 48px;\n display: flex;\n color: ${COLORS.black};\n margin-top: ${(props: BannerProps) => (props.bottom ? 'auto' : '0')};\n\n button:last-child {\n line-height: 0;\n margin: 0 0 0 8px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 0 0 16px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 0 0 32px;\n }\n &.small {\n margin: 0 0 0 8px;\n }\n &.medium {\n margin: 0 0 0 16px;\n }\n &.large {\n margin: 0 0 0 32px;\n }\n }\n\n a {\n color: ${(props: BannerProps) => props.link} !important;\n }\n`;\n\nconst BannerCenter = styled.div`\n ${(props) => ComponentMStyling(ComponentTextStyle.Regular, props.color)}\n \n display: flex;\n width: 100%;\n margin: 0 0 0 16px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 16px 0 32px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 40px 0 56px;\n }\n &.small {\n margin: 0 0 0 16px;\n }\n &.medium {\n margin: 0 16px 0 32px;\n }\n &.large {\n margin: 0 40px 0 56px;\n }\n\n > svg {\n flex-shrink: 0;\n margin: 12px 0;\n }\n`;\n\nconst ButtonWrapper = styled.div<{ type?: string }>`\n margin: 0 0 0 auto;\n ${(props) => (props.type ? getButtonStyle(props.type) : null)};\n`;\n\nconst BannerContentWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: 12px 0;\n &:not(:first-child) {\n margin-left: 8px;\n }\n`;\n\ntype BannerProps = {\n size?: 'small' | 'medium' | 'large';\n type?: string;\n link?: string;\n linkText?: string;\n hover?: string;\n bottom?: boolean;\n testId?: string;\n icon?: React.ReactNode;\n onClose?: () => void;\n noIcon?: boolean;\n};\n\nconst Banner: React.FunctionComponent<BannerProps> = ({ size, type, children, bottom, testId, linkText, link, onClose, icon, noIcon }) => {\n const [width, setWidth] = React.useState<number>(window.innerWidth);\n React.useEffect(() => {\n function handleResize() {\n setWidth(window.innerWidth);\n }\n window.addEventListener('resize', handleResize);\n });\n\n const formatTypeToLowerCase = type?.toLowerCase();\n switch (formatTypeToLowerCase) {\n case 'warning':\n return (\n <BannerContainer data-testid={testId} type={COLORS.warning_100} link={COLORS.warning_700} hover={COLORS.warning_20} bottom={bottom}>\n <BannerCenter color={COLORS.warning_700} className={size}>\n {icon ? icon : noIcon ? null : <Help color={COLORS.warning_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.warning_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.warning_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'critical':\n return (\n <BannerContainer data-testid={testId} type={COLORS.critical_100} link={COLORS.critical_700} hover={COLORS.critical_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.critical_700} className={size}>\n {icon ? icon : noIcon ? null : <TechnicalWarning color={COLORS.critical_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.critical_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.critical_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'positive':\n return (\n <BannerContainer data-testid={testId} type={COLORS.correct_100} link={COLORS.correct_700} hover={COLORS.correct_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.correct_700} className={size}>\n {icon ? icon : noIcon ? null : <ThumbsUp color={COLORS.correct_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.correct_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.correct_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n default:\n return (\n <BannerContainer data-testid={testId} type={COLORS.primary_100} link={COLORS.primary_700} hover={COLORS.primary_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.primary_700} className={size}>\n {icon ? icon : noIcon ? null : <Tip color={COLORS.primary_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.primary_700}>\n {children} \n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type=\"neutral\">\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.primary_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n }\n};\n\nexport default Banner;\n"],"file":"Banner.js"}
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { BREAKPOINTS, COLORS } from '../styles';
|
|
5
5
|
import { PageWidth } from '../Layouts';
|
|
6
|
+
import { HeadlineXSStyling } from '../styles/typography';
|
|
6
7
|
const BannersWrapper = styled.div`
|
|
7
8
|
background-color: ${COLORS.primary_20};
|
|
8
9
|
`;
|
|
@@ -30,8 +31,7 @@ const BannerContent = styled(PageWidth)`
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
& h2 {
|
|
33
|
-
|
|
34
|
-
font-size: 24px;
|
|
34
|
+
${HeadlineXSStyling(COLORS.black)}
|
|
35
35
|
margin: 16px 0 24px 0;
|
|
36
36
|
}
|
|
37
37
|
& p {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Banners/OverviewBanner.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","PageWidth","BannersWrapper","div","primary_20","BannerContent","MEDIUM","OverviewBanner","children","testId"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,
|
|
1
|
+
{"version":3,"sources":["../../../src/Banners/OverviewBanner.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","PageWidth","HeadlineXSStyling","BannersWrapper","div","primary_20","BannerContent","MEDIUM","black","OverviewBanner","children","testId"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAAQC,WAAR,EAAqBC,MAArB,QAAkC,WAAlC;AACA,SAAQC,SAAR,QAAwB,YAAxB;AACA,SAAQC,iBAAR,QAAgC,sBAAhC;AAEA,MAAMC,cAAc,GAAGL,MAAM,CAACM,GAAI;AAClC,sBAAsBJ,MAAM,CAACK,UAAW;AACxC,CAFA;AAIA,MAAMC,aAAa,GAAGR,MAAM,CAACG,SAAD,CAAY;AACxC,sBAAsBD,MAAM,CAACK,UAAW;AACxC;AACA;AACA;AACA;AACA;AACA,IAAIN,WAAW,CAACQ,MAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMR,WAAW,CAACQ,MAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAML,iBAAiB,CAACF,MAAM,CAACQ,KAAR,CAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMT,WAAW,CAACQ,MAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,CA7CA;;AAiDA,MAAME,cAAc,GAAG,CAAC;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAD,KAAiC;AACtD,sBACE,oBAAC,cAAD,qBACE,oBAAC,aAAD;AAAe,mBAAaA;AAA5B,KAAqCD,QAArC,CADF,CADF;AAKD,CAND;;;AAFeA,EAAAA,Q;AAAeC,EAAAA,M;;AAU9B,eAAeF,cAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {BREAKPOINTS, COLORS} from '../styles';\nimport {PageWidth} from '../Layouts';\nimport {HeadlineXSStyling} from '../styles/typography';\n\nconst BannersWrapper = styled.div`\n background-color: ${COLORS.primary_20};\n`;\n\nconst BannerContent = styled(PageWidth)`\n background-color: ${COLORS.primary_20};\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n\n ${BREAKPOINTS.MEDIUM} {\n flex-direction: row;\n padding: 48px 12px;\n }\n\n & > *:first-child {\n padding-top: 12px;\n width: 320px;\n height: 180px;\n ${BREAKPOINTS.MEDIUM} {\n padding-top: 0;\n margin-right: 20px;\n width: 384px;\n height: 216px;\n }\n }\n & h2 {\n ${HeadlineXSStyling(COLORS.black)}\n margin: 16px 0 24px 0;\n }\n & p {\n margin: 0;\n padding: 0 0 28px 0;\n max-width: 310px;\n }\n & div {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-bottom: 18px;\n ${BREAKPOINTS.MEDIUM} {\n margin-left: 20px;\n align-items: start;\n justify-content: start;\n width: 384px;\n }\n }\n`;\n\ntype Props = { children: any; testId?: string };\n\nconst OverviewBanner = ({ children, testId }: Props) => {\n return (\n <BannersWrapper>\n <BannerContent data-testid={testId}>{children}</BannerContent>\n </BannersWrapper>\n );\n};\n\nexport default OverviewBanner;\n"],"file":"OverviewBanner.js"}
|
|
@@ -2,29 +2,39 @@ import _pt from "prop-types";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { COLORS } from '../styles';
|
|
5
|
-
import { SystemIcons } from '..';
|
|
6
|
-
import { useHistory } from 'react-router';
|
|
5
|
+
import { ComponentTextStyle, SystemIcons } from '..';
|
|
7
6
|
import { Link } from 'react-router-dom';
|
|
8
|
-
|
|
7
|
+
import { ComponentMStyling, ComponentSStyling, ComponentXXSStyling } from '../styles/typography';
|
|
9
8
|
const BreadcrumbContainer = styled.div`
|
|
10
9
|
display:flex;
|
|
11
10
|
align-items: center;
|
|
12
|
-
font-size: ${fontSize};
|
|
13
11
|
`;
|
|
12
|
+
|
|
13
|
+
const FontStyles = (size, textStyle, color) => {
|
|
14
|
+
switch (size) {
|
|
15
|
+
case 'xsmall':
|
|
16
|
+
return ComponentXXSStyling(textStyle, color);
|
|
17
|
+
|
|
18
|
+
case 'medium':
|
|
19
|
+
return ComponentMStyling(textStyle, color);
|
|
20
|
+
|
|
21
|
+
case 'small':
|
|
22
|
+
default:
|
|
23
|
+
return ComponentSStyling(textStyle, color);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
14
27
|
const LastBreadcrumbItem = styled.label`
|
|
15
|
-
|
|
16
|
-
font-weight: bold;
|
|
28
|
+
${props => FontStyles(props.size, ComponentTextStyle.Bold, COLORS.neutral_800)}
|
|
17
29
|
margin: 0 7px;
|
|
18
30
|
`;
|
|
19
31
|
const LinkWrapper = styled.div`
|
|
20
32
|
align-items: center;
|
|
21
|
-
|
|
22
|
-
color: ${COLORS.neutral_600};
|
|
33
|
+
${props => FontStyles(props.size, ComponentTextStyle.Regular, COLORS.neutral_600)}
|
|
23
34
|
|
|
24
35
|
a {
|
|
25
36
|
text-decoration: none;
|
|
26
|
-
|
|
27
|
-
font-size: ${fontSize};
|
|
37
|
+
${props => FontStyles(props.size, ComponentTextStyle.Regular, COLORS.neutral_600)}
|
|
28
38
|
margin: 0 7px;
|
|
29
39
|
|
|
30
40
|
svg{
|
|
@@ -32,30 +42,46 @@ const LinkWrapper = styled.div`
|
|
|
32
42
|
}
|
|
33
43
|
}
|
|
34
44
|
a:hover {
|
|
35
|
-
color: ${COLORS.
|
|
36
|
-
|
|
45
|
+
color: ${COLORS.primary_700};
|
|
46
|
+
}
|
|
47
|
+
a:active {
|
|
48
|
+
color: ${COLORS.primary_800};
|
|
37
49
|
}
|
|
38
50
|
`;
|
|
39
51
|
|
|
40
52
|
const Breadcrumb = ({
|
|
41
|
-
items
|
|
53
|
+
items,
|
|
54
|
+
size
|
|
42
55
|
}) => {
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
size = size || 'small';
|
|
57
|
+
const iconSize = size === 'xsmall' ? '16' : size === 'small' ? '20' : '24';
|
|
58
|
+
return /*#__PURE__*/React.createElement(BreadcrumbContainer, null, /*#__PURE__*/React.createElement(LinkWrapper, {
|
|
59
|
+
size: size
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
45
61
|
to: '/'
|
|
46
62
|
}, /*#__PURE__*/React.createElement(SystemIcons.Home, {
|
|
47
|
-
size:
|
|
63
|
+
size: iconSize
|
|
48
64
|
}))), !!items && items.length > 2 && items.slice(0, items.length - 2).map((item, i) => {
|
|
49
|
-
return /*#__PURE__*/React.createElement(LinkWrapper,
|
|
65
|
+
return /*#__PURE__*/React.createElement(LinkWrapper, {
|
|
66
|
+
size: size,
|
|
67
|
+
key: i
|
|
68
|
+
}, "/", /*#__PURE__*/React.createElement(Link, {
|
|
50
69
|
to: item.url
|
|
51
70
|
}, "..."));
|
|
52
|
-
}), !!items && items.length > 1 && /*#__PURE__*/React.createElement(LinkWrapper,
|
|
71
|
+
}), !!items && items.length > 1 && /*#__PURE__*/React.createElement(LinkWrapper, {
|
|
72
|
+
size: size
|
|
73
|
+
}, "/", /*#__PURE__*/React.createElement(Link, {
|
|
53
74
|
to: items[items.length - 2].url
|
|
54
|
-
}, items[items.length - 2].label)), !!items && items.length > 0 && /*#__PURE__*/React.createElement(LinkWrapper,
|
|
75
|
+
}, items[items.length - 2].label)), !!items && items.length > 0 && /*#__PURE__*/React.createElement(LinkWrapper, {
|
|
76
|
+
size: size
|
|
77
|
+
}, "/", /*#__PURE__*/React.createElement(LastBreadcrumbItem, {
|
|
78
|
+
size: size
|
|
79
|
+
}, items[items.length - 1].label)));
|
|
55
80
|
};
|
|
56
81
|
|
|
57
82
|
Breadcrumb.propTypes = {
|
|
58
|
-
items: _pt.array
|
|
83
|
+
items: _pt.array,
|
|
84
|
+
size: _pt.oneOf(['xsmall', 'small', 'medium'])
|
|
59
85
|
};
|
|
60
86
|
export default Breadcrumb;
|
|
61
87
|
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Breadcrumb/Breadcrumb.tsx"],"names":["React","styled","COLORS","
|
|
1
|
+
{"version":3,"sources":["../../../src/Breadcrumb/Breadcrumb.tsx"],"names":["React","styled","COLORS","ComponentTextStyle","SystemIcons","Link","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","BreadcrumbContainer","div","FontStyles","size","textStyle","color","LastBreadcrumbItem","label","props","Bold","neutral_800","LinkWrapper","Regular","neutral_600","primary_700","primary_800","Breadcrumb","items","iconSize","length","slice","map","item","i","url"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AAEA,SAAQC,MAAR,QAAqB,WAArB;AACA,SAAQC,kBAAR,EAA4BC,WAA5B,QAA8C,IAA9C;AAGA,SAAQC,IAAR,QAAmB,kBAAnB;AACA,SAAQC,iBAAR,EAA2BC,iBAA3B,EAA8CC,mBAA9C,QAAwE,sBAAxE;AAUA,MAAMC,mBAAmB,GAAGR,MAAM,CAACS,GAAI;AACvC;AACA;AACA,CAHA;;AAKA,MAAMC,UAAU,GAAG,CAACC,IAAD,EAAmCC,SAAnC,EAAkEC,KAAlE,KAAoF;AACrG,UAAQF,IAAR;AACE,SAAK,QAAL;AACE,aAAOJ,mBAAmB,CAACK,SAAD,EAAYC,KAAZ,CAA1B;;AACF,SAAK,QAAL;AACE,aAAOR,iBAAiB,CAACO,SAAD,EAAYC,KAAZ,CAAxB;;AACF,SAAK,OAAL;AACA;AACE,aAAOP,iBAAiB,CAACM,SAAD,EAAYC,KAAZ,CAAxB;AAPJ;AASD,CAVD;;AAYA,MAAMC,kBAAkB,GAAGd,MAAM,CAACe,KAA8B;AAChE,IAAKC,KAAD,IAAWN,UAAU,CAACM,KAAK,CAACL,IAAP,EAAaT,k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AA,GAAG,EAAEoB;AAA9B,yBAEE,oBAAC,IAAD;AAAM,MAAA,EAAE,EAAED,IAAI,CAACE;AAAf,aAFF,CADA;AAOF,GARA,CARJ,EAkBI,CAAC,CAACP,KAAF,IAAWA,KAAK,CAACE,MAAN,GAAe,CAA1B,iBACA,oBAAC,WAAD;AAAa,IAAA,IAAI,EAAEhB;AAAnB,uBAEE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAEc,KAAK,CAACA,KAAK,CAACE,MAAN,GAAe,CAAhB,CAAL,CAAwBK;AAAlC,KACGP,KAAK,CAACA,KAAK,CAACE,MAAN,GAAe,CAAhB,CAAL,CAAwBZ,KAD3B,CAFF,CAnBJ,EA2BI,CAAC,CAACU,KAAF,IAAWA,KAAK,CAACE,MAAN,GAAe,CAA1B,iBACA,oBAAC,WAAD;AAAa,IAAA,IAAI,EAAEhB;AAAnB,uBAEE,oBAAC,kBAAD;AAAoB,IAAA,IAAI,EAAEA;AAA1B,KACGc,KAAK,CAACA,KAAK,CAACE,MAAN,GAAe,CAAhB,CAAL,CAAwBZ,KAD3B,CAFF,CA5BJ,CADF;AAsCD,CA5CD;;;AAhDEU,EAAAA,K;AACAd,EAAAA,I,aAJoB,Q,EAAW,O,EAAU,Q;;AAiG3C,eAAea,UAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\n\nimport {COLORS} from '../styles';\nimport {ComponentTextStyle, SystemIcons} from '..';\nimport {useHistory} from 'react-router';\nimport {BreadcrumbItem} from '@laerdal/life-react-components/src/Breadcrumb/BreadcrumbItem';\nimport {Link} from 'react-router-dom';\nimport {ComponentMStyling, ComponentSStyling, ComponentXXSStyling} from '../styles/typography';\n\n\ntype availableSizes = 'xsmall' | 'small' | 'medium';\n\ntype BreadcrumbProps = {\n items?: BreadcrumbItem[];\n size?: availableSizes;\n};\n\nconst BreadcrumbContainer = styled.div`\n display:flex;\n align-items: center;\n`;\n\nconst FontStyles = (size: availableSizes | undefined, textStyle: ComponentTextStyle, color: string) => {\n switch (size) {\n case 'xsmall':\n return ComponentXXSStyling(textStyle, color);\n case 'medium':\n return ComponentMStyling(textStyle, color);\n case 'small':\n default:\n return ComponentSStyling(textStyle, color);\n }\n}\n\nconst LastBreadcrumbItem = styled.label<{size: availableSizes}>`\n ${(props) => FontStyles(props.size, ComponentTextStyle.Bold, COLORS.neutral_800)}\n margin: 0 7px;\n`;\n\nconst LinkWrapper = styled.div<{size: availableSizes | undefined}>`\n align-items: center;\n ${(props) => FontStyles(props.size, ComponentTextStyle.Regular, COLORS.neutral_600)}\n \n a {\n text-decoration: none;\n ${(props) => FontStyles(props.size, ComponentTextStyle.Regular, COLORS.neutral_600)}\n margin: 0 7px;\n\n svg{\n padding:4px 0 0 0;\n }\n }\n a:hover {\n color: ${COLORS.primary_700};\n }\n a:active {\n color: ${COLORS.primary_800};\n }\n`;\n\n\nconst Breadcrumb: React.FunctionComponent<BreadcrumbProps> = ({ items, size }) => {\n\n size = size || 'small';\n\n const iconSize = size === 'xsmall' ? '16' : size === 'small' ? '20' : '24';\n\n return (\n <BreadcrumbContainer>\n <LinkWrapper size={size}>\n <Link to={'/'}>\n <SystemIcons.Home size={iconSize} />\n </Link>\n </LinkWrapper>\n\n { !!items && items.length > 2 && \n items.slice(0, items.length - 2).map((item, i)=> {\n return (\n <LinkWrapper size={size} key={i}>\n /\n <Link to={item.url}>\n ...\n </Link>\n </LinkWrapper>\n )})}\n\n { !!items && items.length > 1 && \n <LinkWrapper size={size}>\n /\n <Link to={items[items.length - 2].url}>\n {items[items.length - 2].label}\n </Link>\n </LinkWrapper>\n }\n\n { !!items && items.length > 0 && \n <LinkWrapper size={size}>\n /\n <LastBreadcrumbItem size={size}>\n {items[items.length - 1].label}\n </LastBreadcrumbItem>\n </LinkWrapper>\n }\n\n </BreadcrumbContainer>);\n};\n\nexport default Breadcrumb;\n"],"file":"Breadcrumb.js"}
|
|
@@ -178,7 +178,8 @@ const IconButton = ({
|
|
|
178
178
|
tabIndex,
|
|
179
179
|
borderRadius,
|
|
180
180
|
onKeyPress,
|
|
181
|
-
tabbedHereBackgroundColor
|
|
181
|
+
tabbedHereBackgroundColor,
|
|
182
|
+
type
|
|
182
183
|
}) => {
|
|
183
184
|
const supressFocusRef = React.useRef(null);
|
|
184
185
|
const [tabbedHere, setTabbedHere] = React.useState(false);
|
|
@@ -198,6 +199,7 @@ const IconButton = ({
|
|
|
198
199
|
case 'secondary':
|
|
199
200
|
return /*#__PURE__*/React.createElement(StyledSecondaryIconButton, {
|
|
200
201
|
id: id,
|
|
202
|
+
type: type ?? 'button',
|
|
201
203
|
"data-testid": id,
|
|
202
204
|
onClick: event => action(event),
|
|
203
205
|
onKeyDown: e => isPressingEnter(e) ? action() : null,
|
|
@@ -227,6 +229,7 @@ const IconButton = ({
|
|
|
227
229
|
default:
|
|
228
230
|
return /*#__PURE__*/React.createElement(StyledPrimaryIconButton, {
|
|
229
231
|
id: id,
|
|
232
|
+
type: type ?? 'button',
|
|
230
233
|
"data-testid": id,
|
|
231
234
|
onClick: event => action(event),
|
|
232
235
|
onKeyDown: e => isPressingEnter(e) ? action() : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Button/Iconbutton.tsx"],"names":["React","styled","css","BREAKPOINTS","COLORS","tabbedHereStyle","variant","tabbedHereBackgroundColor","primary_500","neutral_600","primary_700","white","StyledIconButton","button","props","hideOnLowWidth","MEDIUM","borderRadius","unsetIconSize","StyledPrimaryIconButton","useTransparentBackground","iconColor","primary_800","neutral_200","tabbedHere","StyledSecondaryIconButton","primary_20","primary_100","neutral_300","IconButton","id","shape","action","isInMobileMenu","children","disabled","tabIndex","onKeyPress","supressFocusRef","useRef","setTabbedHere","useState","isPressingEnter","e","key","preventDefault","stopPropagation","event","current"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AAEA,SAAQC,WAAR,EAAqBC,MAArB,QAAkC,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AACAnB,EAAAA,Y;AACAoB,EAAAA,U;AACA9B,EAAAA,yB;;AAoGF,eAAesB,UAAf","sourcesContent":["import * as React from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {BREAKPOINTS, COLORS} from '../styles';\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n tabbedHere?: boolean;\n tabbedHereBackgroundColor?: string;\n}\n\nconst tabbedHereStyle = (variant: string, tabbedHereBackgroundColor?: string) => {\n switch (variant) {\n case 'secondary':\n return css`\n div {\n background-color: ${tabbedHereBackgroundColor || 'transparent'} !important;\n box-shadow: 0px 0px 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n }\n div svg path,\n div svg {\n fill: ${COLORS.neutral_600};\n }\n `;\n case 'primary':\n default:\n return css`\n div {\n background-color: ${tabbedHereBackgroundColor || COLORS.primary_700} !important;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n `;\n }\n};\n\nconst StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n div {\n height: 36px;\n width: 36px;\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:focus:not(:disabled) {\n outline: none;\n div {\n outline: none;\n }\n }\n &:active:not(:disabled) {\n div {\n box-shadow: none;\n }\n }\n`;\n\nconst StyledPrimaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_700};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_800};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n div {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('primary', props.tabbedHereBackgroundColor) : '')};\n`;\n\nconst StyledSecondaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_20};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_100};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n\n ${(props) => (props.tabbedHere ? tabbedHereStyle('secondary', props.tabbedHereBackgroundColor) : '')};\n`;\n\ntype Props = {\n id?: string;\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n isInMobileMenu?: boolean;\n disabled?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n tabIndex?: number;\n borderRadius?: number;\n onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;\n tabbedHereBackgroundColor?: string;\n};\n\nconst IconButton: React.FunctionComponent<Props> = ({\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n borderRadius,\n onKeyPress,\n tabbedHereBackgroundColor,\n}): React.ReactElement<Props> => {\n const supressFocusRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n data-testid={id}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => action(event)}\n onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}\n onKeyPress={onKeyPress}\n tabbedHereBackgroundColor={tabbedHereBackgroundColor}>\n <div>{children}</div>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n data-testid={id}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => action(event)}\n onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}\n onKeyPress={onKeyPress}\n tabbedHereBackgroundColor={tabbedHereBackgroundColor}>\n <div>{children}</div>\n </StyledPrimaryIconButton>\n );\n }\n};\n\nexport default IconButton;\n"],"file":"Iconbutton.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/Button/Iconbutton.tsx"],"names":["React","styled","css","BREAKPOINTS","COLORS","tabbedHereStyle","variant","tabbedHereBackgroundColor","primary_500","neutral_600","primary_700","white","StyledIconButton","button","props","hideOnLowWidth","MEDIUM","borderRadius","unsetIconSize","StyledPrimaryIconButton","useTransparentBackground","iconColor","primary_800","neutral_200","tabbedHere","StyledSecondaryIconButton","primary_20","primary_100","neutral_300","IconButton","id","shape","action","isInMobileMenu","children","disabled","tabIndex","onKeyPress","type","supressFocusRef","useRef","setTabbedHere","useState","isPressingEnter","e","key","preventDefault","stopPropagation","event","current"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AAEA,SAASC,WAAT,EAAsBC,MAAtB,QAAoC,WAApC;;AAcA,MAAMC,eAAe,GAAG,CAACC,OAAD,EAAkBC,yBAAlB,KAAyD;AAC/E,UAAQD,OAAR;AACE,SAAK,WAA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AA,a;AACAkB,EAAAA,Q;AACAnB,EAAAA,Y;AACAoB,EAAAA,U;AACA9B,EAAAA,yB;;AAwGF,eAAesB,UAAf","sourcesContent":["import * as React from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../styles';\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n tabbedHere?: boolean;\n tabbedHereBackgroundColor?: string;\n}\n\nconst tabbedHereStyle = (variant: string, tabbedHereBackgroundColor?: string) => {\n switch (variant) {\n case 'secondary':\n return css`\n div {\n background-color: ${tabbedHereBackgroundColor || 'transparent'} !important;\n box-shadow: 0px 0px 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n }\n div svg path,\n div svg {\n fill: ${COLORS.neutral_600};\n }\n `;\n case 'primary':\n default:\n return css`\n div {\n background-color: ${tabbedHereBackgroundColor || COLORS.primary_700} !important;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n `;\n }\n};\n\nconst StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n div {\n height: 36px;\n width: 36px;\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:focus:not(:disabled) {\n outline: none;\n div {\n outline: none;\n }\n }\n &:active:not(:disabled) {\n div {\n box-shadow: none;\n }\n }\n`;\n\nconst StyledPrimaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_700};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_800};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n div {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('primary', props.tabbedHereBackgroundColor) : '')};\n`;\n\nconst StyledSecondaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_20};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_100};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n\n ${(props) => (props.tabbedHere ? tabbedHereStyle('secondary', props.tabbedHereBackgroundColor) : '')};\n`;\n\ntype Props = {\n id?: string;\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n isInMobileMenu?: boolean;\n disabled?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n tabIndex?: number;\n borderRadius?: number;\n onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;\n tabbedHereBackgroundColor?: string;\n type?: 'submit' | 'reset' | 'button' | undefined;\n};\n\nconst IconButton: React.FunctionComponent<Props> = ({\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n borderRadius,\n onKeyPress,\n tabbedHereBackgroundColor,\n type,\n}): React.ReactElement<Props> => {\n const supressFocusRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => action(event)}\n onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}\n onKeyPress={onKeyPress}\n tabbedHereBackgroundColor={tabbedHereBackgroundColor}>\n <div>{children}</div>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => action(event)}\n onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}\n onKeyPress={onKeyPress}\n tabbedHereBackgroundColor={tabbedHereBackgroundColor}>\n <div>{children}</div>\n </StyledPrimaryIconButton>\n );\n }\n};\n\nexport default IconButton;\n"],"file":"Iconbutton.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { CommonInteractionStyling } from '../common';
|
|
3
|
-
import { BREAKPOINTS, COLORS } from '../styles';
|
|
4
|
-
import { ComponentMStyling,
|
|
3
|
+
import { BREAKPOINTS, COLORS, ComponentTextStyle } from '../styles';
|
|
4
|
+
import { ComponentMStyling, ComponentSStyling, ComponentXSStyling, ComponentXXSStyling } from '../styles/typography';
|
|
5
5
|
export const Dropdown = styled.div`
|
|
6
6
|
position: relative;
|
|
7
7
|
display: inline-block;
|
|
@@ -68,8 +68,7 @@ const placeholderStyling = css`
|
|
|
68
68
|
${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}
|
|
69
69
|
`;
|
|
70
70
|
export const StyledField = styled.div`
|
|
71
|
-
|
|
72
|
-
font-size: 16px;
|
|
71
|
+
${ComponentSStyling(ComponentTextStyle.Regular, 'inherit')}
|
|
73
72
|
|
|
74
73
|
padding: 12px 16px;
|
|
75
74
|
height: 48px;
|
|
@@ -81,42 +80,44 @@ export const StyledField = styled.div`
|
|
|
81
80
|
box-sizing: border-box;
|
|
82
81
|
border-radius: 4px;
|
|
83
82
|
cursor: pointer;
|
|
84
|
-
line-height: 16px;
|
|
85
83
|
|
|
86
84
|
display: flex;
|
|
87
85
|
align-items: center;
|
|
88
86
|
gap: 4px;
|
|
87
|
+
|
|
88
|
+
input{
|
|
89
|
+
font-size: inherit;
|
|
90
|
+
line-height: inherit;
|
|
91
|
+
color: inherit;
|
|
92
|
+
}
|
|
89
93
|
|
|
90
94
|
&::placeholder {
|
|
91
95
|
${ComponentXXSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
${BREAKPOINTS.MEDIUM} {
|
|
95
|
-
|
|
96
|
-
line-height: 16px;
|
|
99
|
+
${ComponentMStyling(ComponentTextStyle.Regular, 'inherit')}
|
|
97
100
|
padding: 16px;
|
|
98
101
|
height: 56px;
|
|
99
102
|
&::placeholder {
|
|
100
|
-
|
|
103
|
+
${ComponentXSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
&.small {
|
|
105
|
-
|
|
106
|
-
line-height: 16px;
|
|
108
|
+
${ComponentXSStyling(ComponentTextStyle.Regular, 'inherit')}
|
|
107
109
|
padding: 12px 16px;
|
|
108
110
|
height: 48px;
|
|
109
111
|
&::placeholder {
|
|
110
|
-
|
|
112
|
+
${ComponentXXSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
&.medium {
|
|
114
|
-
|
|
115
|
-
line-height: 18px;
|
|
116
|
+
${ComponentMStyling(ComponentTextStyle.Regular, 'inherit')}
|
|
116
117
|
height: 56px;
|
|
117
118
|
padding: 16px;
|
|
118
119
|
&::placeholder {
|
|
119
|
-
|
|
120
|
+
${ComponentXSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
|
|
@@ -147,8 +148,8 @@ export const StyledField = styled.div`
|
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
&.button {
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
${props => ComponentSStyling(ComponentTextStyle.Bold, props.disabled ? COLORS.neutral_300 : COLORS.neutral_600)}
|
|
152
|
+
|
|
152
153
|
box-sizing: border-box;
|
|
153
154
|
height: 32px;
|
|
154
155
|
padding: 0 8px;
|
|
@@ -156,9 +157,7 @@ export const StyledField = styled.div`
|
|
|
156
157
|
min-width: initial;
|
|
157
158
|
border: none !important;
|
|
158
159
|
box-shadow: none;
|
|
159
|
-
font-weight: bold;
|
|
160
160
|
border-radius: 4px;
|
|
161
|
-
color: ${props => props.disabled ? COLORS.neutral_300 : COLORS.neutral_600};
|
|
162
161
|
|
|
163
162
|
&.expanded {
|
|
164
163
|
color: ${COLORS.neutral_800};
|
|
@@ -228,16 +227,11 @@ export const DropdownContent = styled.div`
|
|
|
228
227
|
}
|
|
229
228
|
`;
|
|
230
229
|
export const DropdownButton = styled.button`
|
|
231
|
-
|
|
230
|
+
${ComponentSStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}
|
|
232
231
|
|
|
233
232
|
position: relative;
|
|
234
233
|
text-decoration: none;
|
|
235
234
|
display: block;
|
|
236
|
-
font-family: Lato;
|
|
237
|
-
font-style: normal;
|
|
238
|
-
font-weight: normal;
|
|
239
|
-
font-size: 16px;
|
|
240
|
-
line-height: 120%;
|
|
241
235
|
height: 48px;
|
|
242
236
|
background-color: ${COLORS.white};
|
|
243
237
|
border: none;
|
|
@@ -252,18 +246,22 @@ export const DropdownButton = styled.button`
|
|
|
252
246
|
width: calc(100% - 32px);
|
|
253
247
|
border-top: 1px solid #e5e5e5;
|
|
254
248
|
}
|
|
249
|
+
|
|
255
250
|
span {
|
|
256
251
|
margin: auto 0 auto 16px;
|
|
257
252
|
line-height: 48px;
|
|
258
253
|
}
|
|
254
|
+
|
|
259
255
|
div.item-content {
|
|
260
256
|
margin: auto 0 auto 16px;
|
|
261
257
|
line-height: 48px;
|
|
262
258
|
display: flex;
|
|
263
259
|
align-items: center;
|
|
260
|
+
|
|
264
261
|
div.item-label {
|
|
265
262
|
flex: 1 0 calc(100% - 40px);
|
|
266
263
|
}
|
|
264
|
+
|
|
267
265
|
div.item-icon {
|
|
268
266
|
flex: 1 0 40px;
|
|
269
267
|
display: flex;
|
|
@@ -275,6 +273,7 @@ export const DropdownButton = styled.button`
|
|
|
275
273
|
|
|
276
274
|
&.active {
|
|
277
275
|
background: ${COLORS.neutral_20};
|
|
276
|
+
|
|
278
277
|
&::after {
|
|
279
278
|
position: absolute;
|
|
280
279
|
content: ' ';
|
|
@@ -284,24 +283,25 @@ export const DropdownButton = styled.button`
|
|
|
284
283
|
left: 2px;
|
|
285
284
|
background-color: ${COLORS.primary_500};
|
|
286
285
|
|
|
287
|
-
border-
|
|
288
|
-
border-top-right-radius: 2px;
|
|
289
|
-
border-bottom-left-radius: 2px;
|
|
290
|
-
border-bottom-right-radius: 2px;
|
|
286
|
+
border-radius: 2px;
|
|
291
287
|
}
|
|
292
288
|
}
|
|
293
289
|
|
|
294
290
|
&.active:hover {
|
|
295
291
|
background-color: ${COLORS.primary_20};
|
|
292
|
+
|
|
296
293
|
svg {
|
|
297
294
|
color: ${COLORS.primary_600};
|
|
298
295
|
}
|
|
296
|
+
|
|
299
297
|
&::after {
|
|
300
298
|
background-color: ${COLORS.primary_500};
|
|
301
299
|
}
|
|
302
300
|
}
|
|
301
|
+
|
|
303
302
|
&.active:active {
|
|
304
303
|
background-color: ${COLORS.primary_100};
|
|
304
|
+
|
|
305
305
|
svg {
|
|
306
306
|
color: ${COLORS.primary_800};
|
|
307
307
|
}
|