@laerdal/life-react-components 0.0.280-dev.3 → 0.0.280-dev.7
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/Banners/Banner.js +107 -52
- package/dist/esm/Banners/Banner.js.map +1 -1
- package/dist/esm/Banners/styles.js +122 -0
- package/dist/esm/Banners/styles.js.map +1 -0
- package/dist/esm/Footer/Components/FooterNewsletterAndSocialSection.js +36 -15
- package/dist/esm/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/esm/InputFields/styling.js +7 -1
- package/dist/esm/InputFields/styling.js.map +1 -1
- package/dist/esm/styles/typography.js +61 -22
- package/dist/esm/styles/typography.js.map +1 -1
- package/dist/js/Banners/Banner.d.ts +2 -0
- package/dist/js/Banners/Banner.js +74 -41
- package/dist/js/Banners/Banner.js.map +1 -1
- package/dist/js/Banners/styles.d.ts +1 -0
- package/dist/js/Banners/styles.js +33 -0
- package/dist/js/Banners/styles.js.map +1 -0
- package/dist/js/Footer/Components/FooterNewsletterAndSocialSection.js +18 -4
- package/dist/js/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/js/InputFields/styling.js +2 -2
- package/dist/js/InputFields/styling.js.map +1 -1
- package/dist/js/styles/typography.js +75 -67
- package/dist/js/styles/typography.js.map +1 -1
- package/dist/umd/Banners/Banner.js +109 -55
- package/dist/umd/Banners/Banner.js.map +1 -1
- package/dist/umd/Banners/styles.js +141 -0
- package/dist/umd/Banners/styles.js.map +1 -0
- package/dist/umd/Footer/Components/FooterNewsletterAndSocialSection.js +39 -19
- package/dist/umd/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/umd/InputFields/styling.js +7 -1
- package/dist/umd/InputFields/styling.js.map +1 -1
- package/dist/umd/styles/typography.js +64 -25
- package/dist/umd/styles/typography.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { BREAKPOINTS, COLORS } from '../styles';
|
|
5
5
|
import { Tip, Attention, ThumbsUp, Help, Close } from '../icons/systemicons/SystemIcons';
|
|
6
|
-
import {
|
|
6
|
+
import { IconButton } from '../Button';
|
|
7
|
+
import { getButtonStyle } from './styles';
|
|
7
8
|
/**
|
|
8
9
|
* Styles for <Banner />
|
|
9
10
|
*/
|
|
@@ -16,20 +17,30 @@ const BannerContainer = styled.div`
|
|
|
16
17
|
margin-top: ${props => props.bottom ? 'auto' : '0'};
|
|
17
18
|
|
|
18
19
|
button:last-child {
|
|
19
|
-
margin: 0 0 0 auto;
|
|
20
20
|
line-height: 0;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
margin: 0 0 0 8px;
|
|
22
|
+
${BREAKPOINTS.MEDIUM} {
|
|
23
|
+
margin: 0 0 0 16px;
|
|
24
|
+
}
|
|
25
|
+
${BREAKPOINTS.LARGE} {
|
|
26
|
+
margin: 0 0 0 32px;
|
|
27
|
+
}
|
|
28
|
+
&.small {
|
|
29
|
+
margin: 0 0 0 8px;
|
|
30
|
+
}
|
|
31
|
+
&.medium {
|
|
32
|
+
margin: 0 0 0 16px;
|
|
33
|
+
}
|
|
34
|
+
&.large {
|
|
35
|
+
margin: 0 0 0 32px;
|
|
36
|
+
}
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
a {
|
|
29
40
|
color: ${props => props.link};
|
|
30
41
|
font-weight: bold;
|
|
31
42
|
text-decoration: none;
|
|
32
|
-
|
|
43
|
+
|
|
33
44
|
&:hover {
|
|
34
45
|
text-decoration: underline;
|
|
35
46
|
}
|
|
@@ -39,32 +50,50 @@ const BannerContainer = styled.div`
|
|
|
39
50
|
font-style: normal;
|
|
40
51
|
font-weight: normal;
|
|
41
52
|
font-size: 16px;
|
|
42
|
-
line-height:
|
|
53
|
+
line-height: 20px;
|
|
43
54
|
`;
|
|
44
55
|
const BannerCenter = styled.div`
|
|
45
56
|
color: ${props => props.color};
|
|
46
57
|
font-size: 18px;
|
|
47
58
|
display: flex;
|
|
48
|
-
justify-content: flex-start;
|
|
49
|
-
align-items: center;
|
|
50
59
|
width: 100%;
|
|
51
|
-
margin: 0
|
|
60
|
+
margin: 0 6px 0 16px;
|
|
52
61
|
${BREAKPOINTS.MEDIUM} {
|
|
53
|
-
margin: 0 32px;
|
|
62
|
+
margin: 0 22px 0 32px;
|
|
54
63
|
}
|
|
55
64
|
${BREAKPOINTS.LARGE} {
|
|
56
|
-
margin: 0 56px;
|
|
65
|
+
margin: 0 46px 0 56px;
|
|
66
|
+
}
|
|
67
|
+
&.small {
|
|
68
|
+
margin: 0 6px 0 16px;
|
|
57
69
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
margin: 0 auto;
|
|
70
|
+
&.medium {
|
|
71
|
+
margin: 0 22px 0 32px;
|
|
61
72
|
}
|
|
62
|
-
|
|
63
|
-
margin
|
|
73
|
+
&.large {
|
|
74
|
+
margin: 0 46px 0 56px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
> svg {
|
|
78
|
+
flex-shrink: 0;
|
|
79
|
+
margin: 12px 0;
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
const ButtonWrapper = styled.div`
|
|
83
|
+
margin: 0 0 0 auto;
|
|
84
|
+
${props => props.type ? getButtonStyle(props.type) : null};
|
|
85
|
+
`;
|
|
86
|
+
const BannerContentWrapper = styled.div`
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
margin: 12px 0;
|
|
90
|
+
&:not(:first-child) {
|
|
91
|
+
margin-left: 8px;
|
|
64
92
|
}
|
|
65
93
|
`;
|
|
66
94
|
|
|
67
95
|
const Banner = ({
|
|
96
|
+
size,
|
|
68
97
|
type,
|
|
69
98
|
children,
|
|
70
99
|
bottom,
|
|
@@ -72,7 +101,8 @@ const Banner = ({
|
|
|
72
101
|
linkText,
|
|
73
102
|
link,
|
|
74
103
|
onClose,
|
|
75
|
-
icon
|
|
104
|
+
icon,
|
|
105
|
+
noIcon
|
|
76
106
|
}) => {
|
|
77
107
|
const formatTypeToLowerCase = type?.toLowerCase();
|
|
78
108
|
|
|
@@ -85,20 +115,25 @@ const Banner = ({
|
|
|
85
115
|
hover: COLORS.warning_20,
|
|
86
116
|
bottom: bottom
|
|
87
117
|
}, /*#__PURE__*/React.createElement(BannerCenter, {
|
|
88
|
-
color: COLORS.warning_700
|
|
89
|
-
|
|
118
|
+
color: COLORS.warning_700,
|
|
119
|
+
className: size
|
|
120
|
+
}, icon ? icon : noIcon ? null : /*#__PURE__*/React.createElement(Help, {
|
|
90
121
|
color: COLORS.warning_700,
|
|
91
122
|
size: "24px"
|
|
92
|
-
}), children, "\xA0\xA0", link && linkText && /*#__PURE__*/React.createElement("a", {
|
|
123
|
+
}), /*#__PURE__*/React.createElement(BannerContentWrapper, null, children, "\xA0\xA0", link && linkText && /*#__PURE__*/React.createElement("a", {
|
|
93
124
|
href: link,
|
|
94
125
|
target: "_blank"
|
|
95
|
-
}, linkText), onClose && /*#__PURE__*/React.createElement(
|
|
96
|
-
|
|
97
|
-
|
|
126
|
+
}, linkText)), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, {
|
|
127
|
+
type: formatTypeToLowerCase
|
|
128
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
129
|
+
variant: "secondary",
|
|
130
|
+
shape: "circular",
|
|
131
|
+
useTransparentBackground: true,
|
|
132
|
+
action: () => onClose()
|
|
98
133
|
}, /*#__PURE__*/React.createElement(Close, {
|
|
99
134
|
color: COLORS.warning_500,
|
|
100
135
|
size: "24px"
|
|
101
|
-
}))));
|
|
136
|
+
})))));
|
|
102
137
|
|
|
103
138
|
case 'critical':
|
|
104
139
|
return /*#__PURE__*/React.createElement(BannerContainer, {
|
|
@@ -106,22 +141,28 @@ const Banner = ({
|
|
|
106
141
|
type: COLORS.critical_100,
|
|
107
142
|
link: COLORS.critical_700,
|
|
108
143
|
hover: COLORS.critical_20,
|
|
109
|
-
bottom: bottom
|
|
144
|
+
bottom: bottom,
|
|
145
|
+
className: size
|
|
110
146
|
}, /*#__PURE__*/React.createElement(BannerCenter, {
|
|
111
|
-
color: COLORS.critical_700
|
|
112
|
-
|
|
147
|
+
color: COLORS.critical_700,
|
|
148
|
+
className: size
|
|
149
|
+
}, icon ? icon : noIcon ? null : /*#__PURE__*/React.createElement(Attention, {
|
|
113
150
|
color: COLORS.critical_700,
|
|
114
151
|
size: "24px"
|
|
115
|
-
}), children, "\xA0\xA0", link && linkText && /*#__PURE__*/React.createElement("a", {
|
|
152
|
+
}), /*#__PURE__*/React.createElement(BannerContentWrapper, null, children, "\xA0\xA0", link && linkText && /*#__PURE__*/React.createElement("a", {
|
|
116
153
|
href: link,
|
|
117
154
|
target: "_blank"
|
|
118
|
-
}, linkText), onClose && /*#__PURE__*/React.createElement(
|
|
119
|
-
|
|
120
|
-
|
|
155
|
+
}, linkText)), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, {
|
|
156
|
+
type: formatTypeToLowerCase
|
|
157
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
158
|
+
variant: "secondary",
|
|
159
|
+
shape: "circular",
|
|
160
|
+
useTransparentBackground: true,
|
|
161
|
+
action: () => onClose()
|
|
121
162
|
}, /*#__PURE__*/React.createElement(Close, {
|
|
122
163
|
color: COLORS.critical_500,
|
|
123
164
|
size: "24px"
|
|
124
|
-
}))));
|
|
165
|
+
})))));
|
|
125
166
|
|
|
126
167
|
case 'positive':
|
|
127
168
|
return /*#__PURE__*/React.createElement(BannerContainer, {
|
|
@@ -129,22 +170,28 @@ const Banner = ({
|
|
|
129
170
|
type: COLORS.correct_100,
|
|
130
171
|
link: COLORS.correct_700,
|
|
131
172
|
hover: COLORS.correct_20,
|
|
132
|
-
bottom: bottom
|
|
173
|
+
bottom: bottom,
|
|
174
|
+
className: size
|
|
133
175
|
}, /*#__PURE__*/React.createElement(BannerCenter, {
|
|
134
|
-
color: COLORS.correct_700
|
|
135
|
-
|
|
176
|
+
color: COLORS.correct_700,
|
|
177
|
+
className: size
|
|
178
|
+
}, icon ? icon : noIcon ? null : /*#__PURE__*/React.createElement(ThumbsUp, {
|
|
136
179
|
color: COLORS.correct_700,
|
|
137
180
|
size: "24px"
|
|
138
|
-
}), children, "\xA0\xA0", link && linkText && /*#__PURE__*/React.createElement("a", {
|
|
181
|
+
}), /*#__PURE__*/React.createElement(BannerContentWrapper, null, children, "\xA0\xA0", link && linkText && /*#__PURE__*/React.createElement("a", {
|
|
139
182
|
href: link,
|
|
140
183
|
target: "_blank"
|
|
141
|
-
}, linkText), onClose && /*#__PURE__*/React.createElement(
|
|
142
|
-
|
|
143
|
-
|
|
184
|
+
}, linkText)), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, {
|
|
185
|
+
type: formatTypeToLowerCase
|
|
186
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
187
|
+
variant: "secondary",
|
|
188
|
+
shape: "circular",
|
|
189
|
+
useTransparentBackground: true,
|
|
190
|
+
action: () => onClose()
|
|
144
191
|
}, /*#__PURE__*/React.createElement(Close, {
|
|
145
192
|
color: COLORS.correct_500,
|
|
146
193
|
size: "24px"
|
|
147
|
-
}))));
|
|
194
|
+
})))));
|
|
148
195
|
|
|
149
196
|
default:
|
|
150
197
|
return /*#__PURE__*/React.createElement(BannerContainer, {
|
|
@@ -152,26 +199,33 @@ const Banner = ({
|
|
|
152
199
|
type: COLORS.primary_100,
|
|
153
200
|
link: COLORS.primary_700,
|
|
154
201
|
hover: COLORS.primary_20,
|
|
155
|
-
bottom: bottom
|
|
202
|
+
bottom: bottom,
|
|
203
|
+
className: size
|
|
156
204
|
}, /*#__PURE__*/React.createElement(BannerCenter, {
|
|
157
|
-
color: COLORS.primary_700
|
|
158
|
-
|
|
205
|
+
color: COLORS.primary_700,
|
|
206
|
+
className: size
|
|
207
|
+
}, icon ? icon : noIcon ? null : /*#__PURE__*/React.createElement(Tip, {
|
|
159
208
|
color: COLORS.primary_700,
|
|
160
209
|
size: "24px"
|
|
161
|
-
}), children, "\xA0\xA0", link && linkText && /*#__PURE__*/React.createElement("a", {
|
|
210
|
+
}), /*#__PURE__*/React.createElement(BannerContentWrapper, null, children, "\xA0\xA0", link && linkText && /*#__PURE__*/React.createElement("a", {
|
|
162
211
|
href: link,
|
|
163
212
|
target: "_blank"
|
|
164
|
-
}, linkText), onClose && /*#__PURE__*/React.createElement(
|
|
165
|
-
|
|
166
|
-
|
|
213
|
+
}, linkText)), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, {
|
|
214
|
+
type: "neutral"
|
|
215
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
216
|
+
variant: "secondary",
|
|
217
|
+
shape: "circular",
|
|
218
|
+
useTransparentBackground: true,
|
|
219
|
+
action: () => onClose()
|
|
167
220
|
}, /*#__PURE__*/React.createElement(Close, {
|
|
168
221
|
color: COLORS.primary_500,
|
|
169
222
|
size: "24px"
|
|
170
|
-
}))));
|
|
223
|
+
})))));
|
|
171
224
|
}
|
|
172
225
|
};
|
|
173
226
|
|
|
174
227
|
Banner.propTypes = {
|
|
228
|
+
size: _pt.oneOf(['small', 'medium', 'large']),
|
|
175
229
|
type: _pt.string,
|
|
176
230
|
link: _pt.string,
|
|
177
231
|
linkText: _pt.string,
|
|
@@ -179,7 +233,8 @@ Banner.propTypes = {
|
|
|
179
233
|
bottom: _pt.bool,
|
|
180
234
|
testId: _pt.string,
|
|
181
235
|
icon: _pt.node,
|
|
182
|
-
onClose: _pt.func
|
|
236
|
+
onClose: _pt.func,
|
|
237
|
+
noIcon: _pt.bool
|
|
183
238
|
};
|
|
184
239
|
export default Banner;
|
|
185
240
|
//# sourceMappingURL=Banner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Banners/Banner.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","Tip","Attention","ThumbsUp","Help","Close","Button","BannerContainer","div","props","type","correct_100","black","bottom","hover","primary_20","link","BannerCenter","color","MEDIUM","LARGE","XLARGE","Banner","children","testId","linkText","onClose","icon","formatTypeToLowerCase","toLowerCase","warning_100","warning_700","warning_20","warning_500","critical_100","critical_700","critical_20","critical_500","correct_700","correct_20","correct_500","primary_100","primary_700","primary_500"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AAEA,SAASC,WAAT,EAAsBC,MAAtB,QAAoC,WAApC;AACA,SAASC,GAAT,EAAcC,SAAd,EAAyBC,QAAzB,EAAmCC,IAAnC,EAAyCC,KAAzC,QAAsD,kCAAtD;AACA,SAASC,MAAT,QAAuB,WAAvB;AAEA;AACA;AACA;;AACA,MAAMC,eAAe,GAAGT,MAAM,CAACU,GAAiB;AAChD,gBAAiBC,KAAD,IAAyBA,KAAK,CAACC,IAAN,GAAaD,KAAK,CAACC,IAAnB,GAA0BV,MAAM,CAACW,WAAa;AACvF;AACA;AACA,WAAWX,MAAM,CAACY,KAAM;AACxB,gBAAiBH,KAAD,IAAyBA,KAAK,CAACI,MAAN,GAAe,MAAf,GAAwB,GAAK;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAmBJ,KAAD,IAAyBA,KAAK,CAACK,KAAN,GAAcL,KAAK,CAACK,KAApB,GAA4Bd,MAAM,CAACe,UAAY;AAC1F;AACA;AACA;AACA,aAAcN,KAAD,IAAyBA,KAAK,CAACO,IAAM;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAhCA;AAkCA,MAAMC,YAAY,GAAGnB,MAAM,CAACU,GAAI;AAChC,WAAYC,KAAD,IAAWA,KAAK,CAACS,KAAM;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,IAAInB,WAAW,CAACoB,MAAO;AACvB;AACA;AACA,IAAIpB,WAAW,CAACqB,KAAM;AACtB;AACA;AACA,IAAIrB,WAAW,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AD,EAAAA,O;;AAsEF,eAAeJ,MAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Tip, Attention, ThumbsUp, Help, Close } from '../icons/systemicons/SystemIcons';\nimport { Button } from '../Button';\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 margin: 0 0 0 auto;\n line-height: 0;\n cursor: pointer;\n }\n button:last-child:hover {\n margin: 0 0 0 auto;\n background: ${(props: BannerProps) => (props.hover ? props.hover : COLORS.primary_20)};\n }\n\n a {\n color: ${(props: BannerProps) => (props.link)};\n font-weight: bold;\n text-decoration: none;\n \n &:hover {\n text-decoration: underline;\n }\n }\n\n font-family: Lato;\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 140%;\n`;\n\nconst BannerCenter = styled.div`\n color: ${(props) => props.color};\n font-size: 18px;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n margin: 0 8px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 32px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 56px;\n }\n ${BREAKPOINTS.XLARGE} {\n width: 1120px;\n margin: 0 auto;\n }\n >svg {\n margin-right:8px;\n }\n`;\n\ntype BannerProps = {\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};\n\nconst Banner: React.FunctionComponent<BannerProps> = ({ type, children, bottom, testId, linkText, link, onClose, icon }) => {\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}>\n { icon ? icon : <Help color={COLORS.warning_700} size=\"24px\" /> }\n {children} \n {link && linkText && <a href={link} target=\"_blank\">{linkText}</a>}\n { onClose &&\n <Button variant=\"text\" onClick={() => onClose()}>\n <Close color={COLORS.warning_500} size=\"24px\" />\n </Button>\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}>\n <BannerCenter color={COLORS.critical_700}>\n { icon ? icon : <Attention color={COLORS.critical_700} size=\"24px\" /> }\n {children} \n {link && linkText && <a href={link} target=\"_blank\">{linkText}</a>}\n { onClose &&\n <Button variant=\"text\" onClick={() => onClose()}>\n <Close color={COLORS.critical_500} size=\"24px\" />\n </Button>\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}>\n <BannerCenter color={COLORS.correct_700}>\n { icon ? icon : <ThumbsUp color={COLORS.correct_700} size=\"24px\" /> }\n {children} \n {link && linkText && <a href={link} target=\"_blank\">{linkText}</a>}\n { onClose &&\n <Button variant=\"text\" onClick={() => onClose()}>\n <Close color={COLORS.correct_500} size=\"24px\" />\n </Button>\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}>\n <BannerCenter color={COLORS.primary_700}>\n { icon ? icon : <Tip color={COLORS.primary_700} size=\"24px\" /> } \n {children} \n {link && linkText && <a href={link} target=\"_blank\">{linkText}</a>}\n { onClose &&\n <Button variant=\"text\" onClick={() => onClose()}>\n <Close color={COLORS.primary_500} size=\"24px\" />\n </Button>\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","Tip","Attention","ThumbsUp","Help","Close","IconButton","getButtonStyle","BannerContainer","div","props","type","correct_100","black","bottom","MEDIUM","LARGE","link","BannerCenter","color","ButtonWrapper","BannerContentWrapper","Banner","size","children","testId","linkText","onClose","icon","noIcon","formatTypeToLowerCase","toLowerCase","warning_100","warning_700","warning_20","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,SAAd,EAAyBC,QAAzB,EAAmCC,IAAnC,EAAyCC,KAAzC,QAAsD,kCAAtD;AACA,SAASC,UAAT,QAA2B,WAA3B;AACA,SAASC,cAAT,QAA+B,UAA/B;AAEA;AACA;AACA;;AACA,MAAMC,eAAe,GAAGV,MAAM,CAACW,GAAiB;AAChD,gBAAiBC,KAAD,IAAyBA,KAAK,CAACC,IAAN,GAAaD,KAAK,CAACC,IAAnB,GAA0BX,MAAM,CAACY,WAAa;AACvF;AACA;AACA,WAAWZ,MAAM,CAACa,KAAM;AACxB,gBAAiBH,KAAD,IAAyBA,KAAK,CAACI,MAAN,GAAe,MAAf,GAAwB,GAAK;AACtE;AACA;AACA;AACA;AACA,MAAMf,WAAW,CAACgB,MAAO;AACzB;AACA;AACA,MAAMhB,WAAW,CAACiB,KAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAcN,KAAD,IAAwBA,KAAK,CAACO,IAAK;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA1CA;AA4CA,MAAMC,YAAY,GAAGpB,MAAM,CAACW,GAAI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AZEvB,EAAAA,I,aAAO,O,EAAU,Q,EAAW,O;AAC5BZ,EAAAA,I;AACAM,EAAAA,I;AACAS,EAAAA,Q;AACAqB,EAAAA,K;AACAjC,EAAAA,M;AACAW,EAAAA,M;AACAG,EAAAA,I;AACAD,EAAAA,O;AACAE,EAAAA,M;;AAqGF,eAAeP,MAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Tip, Attention, ThumbsUp, Help, Close } from '../icons/systemicons/SystemIcons';\nimport { IconButton } from '../Button';\nimport { getButtonStyle } from './styles';\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};\n font-weight: bold;\n text-decoration: none;\n\n &:hover {\n text-decoration: underline;\n }\n }\n\n font-family: Lato;\n font-style: normal;\n font-weight: normal;\n font-size: 16px;\n line-height: 20px;\n`;\n\nconst BannerCenter = styled.div`\n color: ${(props) => props.color};\n font-size: 18px;\n display: flex;\n width: 100%;\n margin: 0 6px 0 16px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 22px 0 32px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 46px 0 56px;\n }\n &.small {\n margin: 0 6px 0 16px;\n }\n &.medium {\n margin: 0 22px 0 32px;\n }\n &.large {\n margin: 0 46px 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 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 {children} \n {link && linkText && (\n <a href={link} target=\"_blank\">\n {linkText}\n </a>\n )}\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground 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 : <Attention color={COLORS.critical_700} size=\"24px\" />}\n <BannerContentWrapper>\n {children} \n {link && linkText && (\n <a href={link} target=\"_blank\">\n {linkText}\n </a>\n )}\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground 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 {children} \n {link && linkText && (\n <a href={link} target=\"_blank\">\n {linkText}\n </a>\n )}\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground 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 {children} \n {link && linkText && (\n <a href={link} target=\"_blank\">\n {linkText}\n </a>\n )}\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type=\"neutral\">\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground 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"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
import { COLORS } from '../styles';
|
|
3
|
+
export const getButtonStyle = type => {
|
|
4
|
+
switch (type) {
|
|
5
|
+
case 'warning':
|
|
6
|
+
return css`
|
|
7
|
+
div {
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
}
|
|
10
|
+
div svg path,
|
|
11
|
+
div svg {
|
|
12
|
+
fill: ${COLORS.warning_500};
|
|
13
|
+
}
|
|
14
|
+
&:hover:not(:disabled) {
|
|
15
|
+
div {
|
|
16
|
+
background-color: ${COLORS.warning_200};
|
|
17
|
+
}
|
|
18
|
+
div svg path,
|
|
19
|
+
div svg {
|
|
20
|
+
fill: ${COLORS.warning_700};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&:active:not(:disabled) {
|
|
24
|
+
div {
|
|
25
|
+
background: ${COLORS.warning_300};
|
|
26
|
+
}
|
|
27
|
+
div svg path,
|
|
28
|
+
div svg {
|
|
29
|
+
fill: ${COLORS.warning_800};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
case 'critical':
|
|
35
|
+
return css`
|
|
36
|
+
div {
|
|
37
|
+
background-color: transparent;
|
|
38
|
+
}
|
|
39
|
+
div svg path,
|
|
40
|
+
div svg {
|
|
41
|
+
fill: ${COLORS.critical_600};
|
|
42
|
+
}
|
|
43
|
+
&:hover:not(:disabled) {
|
|
44
|
+
div {
|
|
45
|
+
background-color: ${COLORS.critical_200};
|
|
46
|
+
}
|
|
47
|
+
div svg path,
|
|
48
|
+
div svg {
|
|
49
|
+
fill: ${COLORS.critical_700};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
&:active:not(:disabled) {
|
|
53
|
+
div {
|
|
54
|
+
background: ${COLORS.critical_300};
|
|
55
|
+
}
|
|
56
|
+
div svg path,
|
|
57
|
+
div svg {
|
|
58
|
+
fill: ${COLORS.critical_800};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
case 'positive':
|
|
64
|
+
return css`
|
|
65
|
+
div {
|
|
66
|
+
background-color: transparent;
|
|
67
|
+
}
|
|
68
|
+
div svg path,
|
|
69
|
+
div svg {
|
|
70
|
+
fill: ${COLORS.correct_500};
|
|
71
|
+
}
|
|
72
|
+
&:hover:not(:disabled) {
|
|
73
|
+
div {
|
|
74
|
+
background-color: ${COLORS.correct_200};
|
|
75
|
+
}
|
|
76
|
+
div svg path,
|
|
77
|
+
div svg {
|
|
78
|
+
fill: ${COLORS.correct_700};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
&:active:not(:disabled) {
|
|
82
|
+
div {
|
|
83
|
+
background: ${COLORS.correct_300};
|
|
84
|
+
}
|
|
85
|
+
div svg path,
|
|
86
|
+
div svg {
|
|
87
|
+
fill: ${COLORS.correct_800};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
default:
|
|
93
|
+
return css`
|
|
94
|
+
div {
|
|
95
|
+
background-color: transparent;
|
|
96
|
+
}
|
|
97
|
+
div svg path,
|
|
98
|
+
div svg {
|
|
99
|
+
fill: ${COLORS.primary_500};
|
|
100
|
+
}
|
|
101
|
+
&:hover:not(:disabled) {
|
|
102
|
+
div {
|
|
103
|
+
background-color: ${COLORS.primary_200};
|
|
104
|
+
}
|
|
105
|
+
div svg path,
|
|
106
|
+
div svg {
|
|
107
|
+
fill: ${COLORS.primary_700};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
&:active:not(:disabled) {
|
|
111
|
+
div {
|
|
112
|
+
background: ${COLORS.primary_300};
|
|
113
|
+
}
|
|
114
|
+
div svg path,
|
|
115
|
+
div svg {
|
|
116
|
+
fill: ${COLORS.primary_800};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/Banners/styles.tsx"],"names":["css","COLORS","getButtonStyle","type","warning_500","warning_200","warning_700","warning_300","warning_800","critical_600","critical_200","critical_700","critical_300","critical_800","correct_500","correct_200","correct_700","correct_300","correct_800","primary_500","primary_200","primary_700","primary_300","primary_800"],"mappings":"AAAA,SAASA,GAAT,QAAoB,mBAApB;AACA,SAASC,MAAT,QAAuB,WAAvB;AAEA,OAAO,MAAMC,cAAc,GAAIC,IAAD,IAAkB;AAC9C,UAAQA,IAAR;AACE,SAAK,SAAL;AACE,aAAOH,GAAI;AACjB;AACA;AACA;AACA;AACA;AACA,kBAAkBC,MAAM,CAACG,WAAY;AACrC;AACA;AACA;AACA,gCAAgCH,MAAM,CAACI,WAAY;AACnD;AACA;AACA;AACA,oBAAoBJ,MAAM,CAACK,WAAY;AACvC;AACA;AACA;AACA;AACA,0BAA0BL,MAAM,CAACM,WAAY;AAC7C;AACA;AACA;AACA,oBAAoBN,MAAM,CAACO,WAAY;AACvC;AACA;AACA,OA1BM;;AA2BF,SAAK,UAAL;AACE,aAAOR,GAAI;AACjB;AACA;AACA;AACA;AACA;AACA,kBAAkBC,MAAM,CAACQ,YAAa;AACtC;AACA;AACA;AACA,gCAAgCR,MAAM,CAACS,YAAa;AACpD;AACA;AACA;AACA,oBAAoBT,MAAM,CAACU,YAAa;AACxC;AACA;AACA;AACA;AACA,0BAA0BV,MAAM,CAACW,YAAa;AAC9C;AACA;AACA;AACA,oBAAoBX,MAAM,CAACY,YAAa;AACxC;AACA;AACA,OA1BM;;AA2BF,SAAK,UAAL;AACE,aAAOb,GAAI;AACjB;AACA;AACA;AACA;AACA;AACA,kBAAkBC,MAAM,CAACa,WAAY;AACrC;AACA;AACA;AACA,gCAAgCb,MAAM,CAACc,WAAY;AACnD;AACA;AACA;AACA,oBAAoBd,MAAM,CAACe,WAAY;AACvC;AACA;AACA;AACA;AACA,0BAA0Bf,MAAM,CAACgB,WAAY;AAC7C;AACA;AACA;AACA,oBAAoBhB,MAAM,CAACiB,WAAY;AACvC;AACA;AACA,OA1BM;;AA2BF;AACE,aAAOlB,GAAI;AACjB;AACA;AACA;AACA;AACA;AACA,kBAAkBC,MAAM,CAACkB,WAAY;AACrC;AACA;AACA;AACA,gCAAgClB,MAAM,CAACmB,WAAY;AACnD;AACA;AACA;AACA,oBAAoBnB,MAAM,CAACoB,WAAY;AACvC;AACA;AACA;AACA;AACA,0BAA0BpB,MAAM,CAACqB,WAAY;AAC7C;AACA;AACA;AACA,oBAAoBrB,MAAM,CAACsB,WAAY;AACvC;AACA;AACA,OA1BM;AAtFJ;AAkHD,CAnHM","sourcesContent":["import { css } from 'styled-components';\nimport { COLORS } from '../styles';\n\nexport const getButtonStyle = (type: string) => {\n switch (type) {\n case 'warning':\n return css`\n div {\n background-color: transparent;\n }\n div svg path,\n div svg {\n fill: ${COLORS.warning_500};\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.warning_200};\n }\n div svg path,\n div svg {\n fill: ${COLORS.warning_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.warning_300};\n }\n div svg path,\n div svg {\n fill: ${COLORS.warning_800};\n }\n }\n `;\n case 'critical':\n return css`\n div {\n background-color: transparent;\n }\n div svg path,\n div svg {\n fill: ${COLORS.critical_600};\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.critical_200};\n }\n div svg path,\n div svg {\n fill: ${COLORS.critical_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.critical_300};\n }\n div svg path,\n div svg {\n fill: ${COLORS.critical_800};\n }\n }\n `;\n case 'positive':\n return css`\n div {\n background-color: transparent;\n }\n div svg path,\n div svg {\n fill: ${COLORS.correct_500};\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.correct_200};\n }\n div svg path,\n div svg {\n fill: ${COLORS.correct_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.correct_300};\n }\n div svg path,\n div svg {\n fill: ${COLORS.correct_800};\n }\n }\n `;\n default:\n return css`\n div {\n background-color: transparent;\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_500};\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_200};\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_300};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n `;\n }\n};\n"],"file":"styles.js"}
|
|
@@ -4,6 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { BREAKPOINTS, COLORS } from '../../styles';
|
|
5
5
|
import { TextField } from '../../InputFields';
|
|
6
6
|
import { Facebook, Twitter, Youtube } from '../../icons/systemicons/SystemIcons';
|
|
7
|
+
import { IconButton } from '../../Button';
|
|
7
8
|
const NewsletterAndSocial = styled.section`
|
|
8
9
|
display: flex;
|
|
9
10
|
flex-direction: column;
|
|
@@ -104,36 +105,44 @@ const SocialMediaButtons = styled.div`
|
|
|
104
105
|
display: flex;
|
|
105
106
|
justify-content: center;
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
button div {
|
|
108
109
|
display: flex;
|
|
109
|
-
width: 32px;
|
|
110
|
-
height: 32px;
|
|
111
110
|
background-color: transparent;
|
|
112
111
|
color: ${COLORS.white};
|
|
113
112
|
margin: 0 0 0 20px;
|
|
114
|
-
|
|
113
|
+
|
|
114
|
+
svg {
|
|
115
|
+
fill: ${COLORS.white};
|
|
116
|
+
path {
|
|
117
|
+
fill: ${COLORS.white};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
115
120
|
|
|
116
121
|
&:first-child {
|
|
117
122
|
margin: 0;
|
|
118
123
|
}
|
|
119
|
-
svg {
|
|
120
|
-
margin: auto;
|
|
121
|
-
}
|
|
122
124
|
&:hover {
|
|
123
125
|
background-color: ${COLORS.white};
|
|
124
126
|
color: ${COLORS.neutral_600};
|
|
125
|
-
cursor: pointer;
|
|
126
127
|
}
|
|
127
128
|
&:active {
|
|
128
129
|
background-color: ${COLORS.primary_800};
|
|
129
130
|
color: ${COLORS.primary_100};
|
|
130
|
-
cursor: pointer;
|
|
131
131
|
}
|
|
132
|
+
}
|
|
133
|
+
a {
|
|
132
134
|
&:focus {
|
|
133
|
-
background-color: ${COLORS.white};
|
|
134
|
-
color: ${COLORS.neutral_600};
|
|
135
|
-
box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;
|
|
136
135
|
outline: none;
|
|
136
|
+
div {
|
|
137
|
+
background-color: ${COLORS.white};
|
|
138
|
+
color: ${COLORS.neutral_600};
|
|
139
|
+
outline: none;
|
|
140
|
+
box-shadow: 0px 0px 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);
|
|
141
|
+
}
|
|
142
|
+
div svg path,
|
|
143
|
+
div svg {
|
|
144
|
+
fill: ${COLORS.neutral_600};
|
|
145
|
+
}
|
|
137
146
|
}
|
|
138
147
|
}
|
|
139
148
|
|
|
@@ -161,17 +170,29 @@ const FooterNewsletterAndSocialSection = ({
|
|
|
161
170
|
href: "https://www.facebook.com/LaerdalMedical/",
|
|
162
171
|
target: "_blank",
|
|
163
172
|
rel: "noreferrer noopener"
|
|
164
|
-
}, /*#__PURE__*/React.createElement(
|
|
173
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
174
|
+
variant: "secondary",
|
|
175
|
+
action: () => {},
|
|
176
|
+
tabIndex: -1
|
|
177
|
+
}, /*#__PURE__*/React.createElement(Facebook, null))), /*#__PURE__*/React.createElement("a", {
|
|
165
178
|
key: `socialmedia_${Math.floor(Math.random() * 999999999999)}`,
|
|
166
179
|
href: "https://twitter.com/laerdalmedical",
|
|
167
180
|
target: "_blank",
|
|
168
181
|
rel: "noreferrer noopener"
|
|
169
|
-
}, /*#__PURE__*/React.createElement(
|
|
182
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
183
|
+
variant: "secondary",
|
|
184
|
+
action: () => {},
|
|
185
|
+
tabIndex: -1
|
|
186
|
+
}, /*#__PURE__*/React.createElement(Twitter, null))), /*#__PURE__*/React.createElement("a", {
|
|
170
187
|
key: `socialmedia_${Math.floor(Math.random() * 999999999999)}`,
|
|
171
188
|
href: "https://www.youtube.com/user/LaerdalMedical",
|
|
172
189
|
target: "_blank",
|
|
173
190
|
rel: "noreferrer noopener"
|
|
174
|
-
}, /*#__PURE__*/React.createElement(
|
|
191
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
192
|
+
variant: "secondary",
|
|
193
|
+
action: () => {},
|
|
194
|
+
tabIndex: -1
|
|
195
|
+
}, /*#__PURE__*/React.createElement(Youtube, null))))));
|
|
175
196
|
};
|
|
176
197
|
|
|
177
198
|
FooterNewsletterAndSocialSection.propTypes = {
|