@laerdal/life-react-components 6.0.0-dev.27.full → 6.0.0-dev.30
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/README.md +42 -0
- package/dist/Button/Button.cjs +469 -0
- package/dist/Button/Button.cjs.map +1 -0
- package/dist/Button/Button.d.ts +70 -0
- package/dist/Button/Button.js +461 -0
- package/dist/Button/Button.js.map +1 -0
- package/dist/Card/HorizontalCard/__tests__/VerticalCard.test.tsx +124 -0
- package/dist/Card/VerticalCard/Card.cjs +187 -0
- package/dist/Card/VerticalCard/Card.cjs.map +1 -0
- package/dist/Card/VerticalCard/Card.d.ts +25 -0
- package/dist/Card/VerticalCard/Card.js +178 -0
- package/dist/Card/VerticalCard/Card.js.map +1 -0
- package/dist/Card/VerticalCard/CardBottomSection.cjs +261 -0
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/CardBottomSection.d.ts +53 -0
- package/dist/Card/VerticalCard/CardBottomSection.js +252 -0
- package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -0
- package/dist/Card/VerticalCard/CardMiddleSection.cjs +145 -0
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/CardMiddleSection.d.ts +42 -0
- package/dist/Card/VerticalCard/CardMiddleSection.js +136 -0
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -0
- package/dist/Card/VerticalCard/CardTopSection.cjs +165 -0
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/CardTopSection.d.ts +45 -0
- package/dist/Card/VerticalCard/CardTopSection.js +156 -0
- package/dist/Card/VerticalCard/CardTopSection.js.map +1 -0
- package/dist/Card/__tests__/Card.test.tsx +146 -0
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +0 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +0 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/Footer/Components/FooterTop.cjs.map +1 -1
- package/dist/Footer/Components/FooterTop.js.map +1 -1
- package/dist/InputFields/RichTextField.cjs +3 -2
- package/dist/InputFields/RichTextField.cjs.map +1 -1
- package/dist/InputFields/RichTextField.d.ts +4 -5
- package/dist/InputFields/RichTextField.js +2 -1
- package/dist/InputFields/RichTextField.js.map +1 -1
- package/dist/InputFields/TextField.cjs +2 -5
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +0 -8
- package/dist/InputFields/TextField.js +2 -5
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/styling.cjs +1 -4
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +0 -1
- package/dist/InputFields/styling.js +1 -4
- package/dist/InputFields/styling.js.map +1 -1
- package/package.json +148 -152
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import _pt from "prop-types";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import { ComponentS, ComponentTextStyle } from '../../styles/typography';
|
|
5
|
+
import Checkbox from '../../InputFields/Checkbox';
|
|
6
|
+
import { Tag } from '../../Tag';
|
|
7
|
+
import { COLORS } from '../../index';
|
|
8
|
+
import { ImageWithFallbacks } from "../../Image";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const CardTopSectionImageContainer = styled.div`
|
|
11
|
+
border-top-right-radius: 8px;
|
|
12
|
+
border-top-left-radius: 8px;
|
|
13
|
+
height: 100%;
|
|
14
|
+
width: 100%;
|
|
15
|
+
img{
|
|
16
|
+
object-fit: cover;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
border-top-right-radius: 8px;
|
|
20
|
+
border-top-left-radius: 8px;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export const CardTopSectionTagContainer = styled.div`
|
|
24
|
+
position: absolute;
|
|
25
|
+
|
|
26
|
+
top: 16px;
|
|
27
|
+
left: 16px;
|
|
28
|
+
width: calc(100% - 32px);
|
|
29
|
+
`;
|
|
30
|
+
export const CardTopSectionContainer = styled.div`
|
|
31
|
+
position: relative;
|
|
32
|
+
width: 100%;
|
|
33
|
+
overflow: visible;
|
|
34
|
+
|
|
35
|
+
${props => props.disabled ? `
|
|
36
|
+
img, svg {
|
|
37
|
+
filter: grayscale(100%);
|
|
38
|
+
}` : ''}
|
|
39
|
+
`;
|
|
40
|
+
export const CardTopSectionRibbonContainer = styled.div`
|
|
41
|
+
min-height: calc(40px - 16px);
|
|
42
|
+
background-color: ${props => props.$backgroundColor};
|
|
43
|
+
width: calc(100% - 32px);
|
|
44
|
+
position: absolute;
|
|
45
|
+
bottom: 0px;
|
|
46
|
+
left: 0px;
|
|
47
|
+
padding: 8px 16px 8px 16px;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
|
|
53
|
+
svg {
|
|
54
|
+
color: ${props => props.$color};
|
|
55
|
+
width: 24px;
|
|
56
|
+
height: 24px;
|
|
57
|
+
flex-grow: 0;
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
export const CardTopSectionCheckboxContainer = styled.div`
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 0;
|
|
64
|
+
right: 0;
|
|
65
|
+
z-index: 1;
|
|
66
|
+
|
|
67
|
+
.checkbox-icon {
|
|
68
|
+
background-color: ${props => COLORS.getColor('white', props.theme)};
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
const CardTopSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
72
|
+
let {
|
|
73
|
+
selected,
|
|
74
|
+
setSelected,
|
|
75
|
+
image,
|
|
76
|
+
tagLabel,
|
|
77
|
+
tagIcon,
|
|
78
|
+
tagVariant = 'positive',
|
|
79
|
+
highlightRibbonIcon,
|
|
80
|
+
highlightRibbonText,
|
|
81
|
+
highlightRibbonContentColor,
|
|
82
|
+
highlightRibbonBgColor,
|
|
83
|
+
disabled
|
|
84
|
+
} = _ref;
|
|
85
|
+
const theme = useTheme();
|
|
86
|
+
return /*#__PURE__*/_jsxs(CardTopSectionContainer, {
|
|
87
|
+
disabled: disabled,
|
|
88
|
+
"data-testid": 'card-topSection',
|
|
89
|
+
style: {
|
|
90
|
+
height: image?.height ?? 200
|
|
91
|
+
},
|
|
92
|
+
children: [image && /*#__PURE__*/_jsx(CardTopSectionImageContainer, {
|
|
93
|
+
role: "none",
|
|
94
|
+
"aria-hidden": "true",
|
|
95
|
+
children: /*#__PURE__*/_jsx(ImageWithFallbacks, {
|
|
96
|
+
fallbacks: image.fallbackSrc ?? '',
|
|
97
|
+
src: image.src,
|
|
98
|
+
alt: "",
|
|
99
|
+
loader: image.loader ?? false,
|
|
100
|
+
width: image.width,
|
|
101
|
+
height: image.height
|
|
102
|
+
})
|
|
103
|
+
}), (!!selected || !!setSelected) && /*#__PURE__*/_jsx(CardTopSectionCheckboxContainer, {
|
|
104
|
+
"data-testid": 'card-topSection-checkbox',
|
|
105
|
+
children: /*#__PURE__*/_jsx(Checkbox, {
|
|
106
|
+
ref: ref,
|
|
107
|
+
disabled: disabled,
|
|
108
|
+
select: selected => setSelected && setSelected(selected),
|
|
109
|
+
selected: selected || false
|
|
110
|
+
})
|
|
111
|
+
}), (tagLabel || tagIcon) && /*#__PURE__*/_jsx(CardTopSectionTagContainer, {
|
|
112
|
+
children: /*#__PURE__*/_jsx(Tag, {
|
|
113
|
+
label: tagLabel,
|
|
114
|
+
variant: tagVariant,
|
|
115
|
+
icon: tagIcon
|
|
116
|
+
})
|
|
117
|
+
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/_jsxs(CardTopSectionRibbonContainer, {
|
|
118
|
+
"data-testid": 'card-topSection-ribbon',
|
|
119
|
+
$color: highlightRibbonContentColor ?? '',
|
|
120
|
+
$backgroundColor: disabled ? COLORS.generateToken({
|
|
121
|
+
componentType: 'bg-fill',
|
|
122
|
+
state: 'disabled'
|
|
123
|
+
}, theme) : highlightRibbonBgColor ?? '',
|
|
124
|
+
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/_jsx(ComponentS, {
|
|
125
|
+
color: disabled ? COLORS.generateToken({
|
|
126
|
+
componentType: 'text',
|
|
127
|
+
isOnFill: true,
|
|
128
|
+
state: 'disabled'
|
|
129
|
+
}, theme) : highlightRibbonContentColor ?? '',
|
|
130
|
+
textStyle: ComponentTextStyle.Regular,
|
|
131
|
+
children: highlightRibbonText
|
|
132
|
+
})]
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
CardTopSection.propTypes = {
|
|
137
|
+
selected: _pt.bool,
|
|
138
|
+
setSelected: _pt.func,
|
|
139
|
+
tagLabel: _pt.string,
|
|
140
|
+
tagIcon: _pt.node,
|
|
141
|
+
highlightRibbonText: _pt.string,
|
|
142
|
+
highlightRibbonIcon: _pt.node,
|
|
143
|
+
highlightRibbonContentColor: _pt.string,
|
|
144
|
+
highlightRibbonBgColor: _pt.string,
|
|
145
|
+
image: _pt.shape({
|
|
146
|
+
src: _pt.string.isRequired,
|
|
147
|
+
fallbackSrc: _pt.string,
|
|
148
|
+
alt: _pt.string.isRequired,
|
|
149
|
+
height: _pt.string,
|
|
150
|
+
width: _pt.string,
|
|
151
|
+
loader: _pt.bool
|
|
152
|
+
}),
|
|
153
|
+
disabled: _pt.bool
|
|
154
|
+
};
|
|
155
|
+
export default CardTopSection;
|
|
156
|
+
//# sourceMappingURL=CardTopSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardTopSection.js","names":["React","styled","useTheme","ComponentS","ComponentTextStyle","Checkbox","Tag","COLORS","ImageWithFallbacks","jsx","_jsx","jsxs","_jsxs","CardTopSectionImageContainer","div","CardTopSectionTagContainer","CardTopSectionContainer","props","disabled","CardTopSectionRibbonContainer","$backgroundColor","$color","CardTopSectionCheckboxContainer","getColor","theme","CardTopSection","forwardRef","_ref","ref","selected","setSelected","image","tagLabel","tagIcon","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","style","height","children","role","fallbacks","fallbackSrc","src","alt","loader","width","select","label","variant","icon","generateToken","componentType","state","color","isOnFill","textStyle","Regular","propTypes","_pt","bool","func","string","node","shape","isRequired"],"sources":["../../../src/Card/VerticalCard/CardTopSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {ComponentS, ComponentTextStyle} from '../../styles/typography';\r\nimport Checkbox from '../../InputFields/Checkbox';\r\nimport {Tag, TagVariants} from '../../Tag';\r\n\r\nimport {COLORS} from '../../index';\r\nimport {ImageWithFallbacks} from \"../../Image\";\r\n\r\nexport interface CardTopSectionProps {\r\n /** Sets initial state of select Checkbox. */\r\n selected?: boolean;\r\n /** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */\r\n setSelected?: (arg0: boolean) => void;\r\n /** Label shown in the tag in the top-left corner of the Card. */\r\n tagLabel?: string;\r\n /** Icon shown in the tag in the top-left corner of the Card. */\r\n tagIcon?: React.ReactNode;\r\n /** Tag variant shown in the tag in the top-left corner of the Card. */\r\n tagVariant?: TagVariants;\r\n /** Text shown in the Ribbon, under the Image. */\r\n highlightRibbonText?: string;\r\n /** Icon shown in the Ribbon, under the Image. */\r\n highlightRibbonIcon?: React.ReactNode;\r\n /** Content color (text and image) of the Ribbon, under the Image. */\r\n highlightRibbonContentColor?: string;\r\n /** Background color of the Ribbon, shown under the Image. */\r\n highlightRibbonBgColor?: string;\r\n /** Details of the Image shown in the section. */\r\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\r\n /** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardTopSectionImageContainer = styled.div`\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n height: 100%;\r\n width: 100%;\r\n img{\r\n object-fit: cover;\r\n width: 100%;\r\n height: 100%;\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionTagContainer = styled.div`\r\n position: absolute;\r\n\r\n top: 16px;\r\n left: 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nexport const CardTopSectionContainer = styled.div<{ disabled?: boolean }>`\r\n position: relative;\r\n width: 100%;\r\n overflow: visible;\r\n\r\n ${props => props.disabled ? `\r\n img, svg {\r\n filter: grayscale(100%);\r\n }` : ''}\r\n`;\r\n\r\nexport const CardTopSectionRibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\r\n min-height: calc(40px - 16px);\r\n background-color: ${props => props.$backgroundColor};\r\n width: calc(100% - 32px);\r\n position: absolute;\r\n bottom: 0px;\r\n left: 0px;\r\n padding: 8px 16px 8px 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n gap: 8px;\r\n\r\n svg {\r\n color: ${props => props.$color};\r\n width: 24px;\r\n height: 24px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionCheckboxContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n z-index: 1;\r\n\r\n .checkbox-icon {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n`;\r\n\r\nconst CardTopSection = React.forwardRef(({\r\n selected,\r\n setSelected,\r\n image,\r\n tagLabel,\r\n tagIcon,\r\n tagVariant = 'positive',\r\n highlightRibbonIcon,\r\n highlightRibbonText,\r\n highlightRibbonContentColor,\r\n highlightRibbonBgColor,\r\n disabled\r\n }: CardTopSectionProps, ref: React.Ref<HTMLDivElement>) => {\r\n\r\n const theme = useTheme();\r\n return (\r\n <CardTopSectionContainer disabled={disabled} data-testid={'card-topSection'} style={{height: image?.height ?? 200}}>\r\n {\r\n image &&\r\n <CardTopSectionImageContainer role=\"none\" aria-hidden=\"true\">\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} alt=\"\" loader={image.loader ?? false} width={image.width} height={image.height}/>\r\n </CardTopSectionImageContainer>\r\n }\r\n {(!!selected || !!setSelected) && (\r\n <CardTopSectionCheckboxContainer data-testid={'card-topSection-checkbox'}>\r\n <Checkbox ref={ref}\r\n disabled={disabled}\r\n select={(selected: boolean) => setSelected && setSelected(selected)}\r\n selected={selected || false}/>\r\n </CardTopSectionCheckboxContainer>\r\n )}\r\n {(tagLabel || tagIcon) && (\r\n <CardTopSectionTagContainer>\r\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon}/>\r\n </CardTopSectionTagContainer>\r\n )}\r\n {(highlightRibbonIcon || highlightRibbonText) && (\r\n <CardTopSectionRibbonContainer data-testid={'card-topSection-ribbon'} $color={highlightRibbonContentColor ?? ''}\r\n $backgroundColor={disabled ? COLORS.generateToken({componentType:'bg-fill', state:'disabled'}, theme) : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={disabled ? COLORS.generateToken({componentType:'text', isOnFill: true, state:'disabled'}, theme) : highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\r\n {highlightRibbonText}\r\n </ComponentS>\r\n )}\r\n </CardTopSectionRibbonContainer>\r\n )}\r\n </CardTopSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardTopSection;\r\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SAAQC,UAAU,EAAEC,kBAAkB,QAAO,yBAAyB;AACtE,OAAOC,QAAQ,MAAM,4BAA4B;AACjD,SAAQC,GAAG,QAAoB,WAAW;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AAAG,MAAA;IAAWhB,KAAK,EAAAa,GAAA,CAAAG,MAAA;IAAWjB,MAAM,EAAAc,GAAA,CAAAC;EAAA;EAEjG5C,QAAQ,EAAA2C,GAAA,CAAAC;AAAA;AAwHV,eAAerC,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { fireEvent, getByRole, render } from '../../test-utils';
|
|
3
|
+
import 'jest-styled-components';
|
|
4
|
+
import { Card } from '../..';
|
|
5
|
+
import { COLORS } from '../../styles';
|
|
6
|
+
import { SystemIcons } from '../../icons';
|
|
7
|
+
|
|
8
|
+
describe('<Card />',()=>{
|
|
9
|
+
it('renders top section', async () => {
|
|
10
|
+
const{getByTestId} = render(
|
|
11
|
+
<Card topSectionProps={{disabled: false}} disabled/>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
expect(getByTestId('card-topSection')).toBeDefined();
|
|
15
|
+
//expect(getByTestId('card-middleSection')).toBeDefined();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders middle section', async () => {
|
|
19
|
+
const{getByTestId} = render(
|
|
20
|
+
<Card middleSectionProps={{title:'title',disabled:false}} disabled/>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(getByTestId('card-middleSection')).toBeDefined();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('renders bottom section', async () => {
|
|
27
|
+
const{getByTestId} = render(
|
|
28
|
+
<Card bottomSectionProps={{disabled:false}} disabled/>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
expect(getByTestId('card-bottomSection')).toBeDefined();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('fires card clicked event on click', async () => {
|
|
35
|
+
const cardClicked = jest.fn();
|
|
36
|
+
const{getByTestId} = render(
|
|
37
|
+
<Card bottomSectionProps={{disabled:false}} disabled={false} onCardClicked={cardClicked}/>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
fireEvent.click(getByTestId('card-link'));
|
|
41
|
+
expect(cardClicked).toHaveBeenCalled();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('fires card clicked event on keyDown', async () => {
|
|
45
|
+
const cardClicked = jest.fn();
|
|
46
|
+
const{getByTestId} = render(
|
|
47
|
+
<Card bottomSectionProps={{disabled:false}} disabled={false} onCardClicked={cardClicked}/>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
fireEvent.keyDown(getByTestId('card-wrapper'), {key: 'Enter', code: 'Enter', charCode: 13});
|
|
51
|
+
expect(cardClicked).toHaveBeenCalled();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('renders tag in top section', async () => {
|
|
55
|
+
const{getByText} = render(
|
|
56
|
+
<Card topSectionProps={{disabled: false, tagLabel:'test_label'}} disabled/>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
expect(getByText('test_label')).toBeDefined();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('renders checkbox in top section', async () => {
|
|
63
|
+
const{getByTestId} = render(
|
|
64
|
+
<Card topSectionProps={{disabled: false, selected: true}} disabled/>
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
expect(getByTestId('card-topSection-checkbox')).toBeDefined();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('renders highlight ribbon in top section', async () => {
|
|
71
|
+
const{getByTestId, getByText} = render(
|
|
72
|
+
<Card topSectionProps={{disabled: false, highlightRibbonText:'testRibbon', highlightRibbonBgColor:'red'}} disabled={false}/>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
expect(getByText('testRibbon')).toBeDefined();
|
|
76
|
+
expect(getByTestId('card-topSection-ribbon')).toHaveStyleRule('background-color','red');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('renders title ,description and category label in middle section', async () => {
|
|
80
|
+
const{getByText} = render(
|
|
81
|
+
<Card middleSectionProps={{title:'testTitle', disabled: false, description:'testDescription', categoryLabel:'testCatLabel'}} disabled={false}/>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
expect(getByText('testTitle')).toBeDefined();
|
|
85
|
+
expect(getByText('testDescription')).toBeDefined();
|
|
86
|
+
expect(getByText('testCatLabel')).toBeDefined();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('renders tags in middle section', async () => {
|
|
90
|
+
const{getByText} = render(
|
|
91
|
+
<Card middleSectionProps={{title:'testTitle', disabled: false, tags:[{label:'testTag'}], row2Tags:[{label:'testTag2'}]}} disabled={false}/>
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
expect(getByText('testTitle')).toBeDefined();
|
|
95
|
+
expect(getByText('testTag2')).toBeDefined();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('renders note text in bottom section', async () => {
|
|
99
|
+
const{getByText} = render(
|
|
100
|
+
<Card bottomSectionProps={{disabled: false, noteLeft:'leftNote', noteRight:'rightNote'}} disabled={false}/>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
expect(getByText('leftNote')).toBeDefined();
|
|
104
|
+
expect(getByText('rightNote')).toBeDefined();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('renders author in bottom section', async () => {
|
|
108
|
+
const{getByText,getByTestId} = render(
|
|
109
|
+
<Card bottomSectionProps={{disabled: true, authorName:'testAuthor'}} disabled={true}/>
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
expect(getByText('testAuthor')).toBeDefined();
|
|
113
|
+
expect(getByTestId('card-bottomSection-author')).toBeDefined();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('renders actions in bottom section', async () => {
|
|
117
|
+
const{getByText,getByTestId} = render(
|
|
118
|
+
<Card bottomSectionProps={{disabled: true, authorName:'testAuthor', actions:[{icon:<SystemIcons.Add/>,onClick:()=>{}}]}} disabled={true}/>
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
expect(getByText('testAuthor')).toBeDefined();
|
|
122
|
+
expect(getByTestId('card-bottomSection-author')).toBeDefined();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('fires leftButton click event on click', async () => {
|
|
126
|
+
const leftButtonClicked = jest.fn();
|
|
127
|
+
const{getByRole} = render(
|
|
128
|
+
<Card bottomSectionProps={{disabled: true,
|
|
129
|
+
authorName:'testAuthor',
|
|
130
|
+
actions:[],
|
|
131
|
+
leftButton: {
|
|
132
|
+
variant: 'tertiary',
|
|
133
|
+
buttonText: 'button',
|
|
134
|
+
onClick: (e) => {
|
|
135
|
+
e.stopPropagation();
|
|
136
|
+
leftButtonClicked();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}}
|
|
140
|
+
disabled={true}/>
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
fireEvent.click(getByRole('button'));
|
|
144
|
+
expect(leftButtonClicked).toBeCalledTimes(1);
|
|
145
|
+
});
|
|
146
|
+
})
|
|
@@ -167,7 +167,6 @@ const FooterNewsletterAndSocialSection = _ref => {
|
|
|
167
167
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(NewsletterEmail, {
|
|
168
168
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_InputFields.TextField, {
|
|
169
169
|
id: "NewsletterEmail",
|
|
170
|
-
withoutBorder: true,
|
|
171
170
|
placeholder: placeholderEmail,
|
|
172
171
|
value: emailInput,
|
|
173
172
|
onChange: value => setEmailInput(value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterNewsletterAndSocialSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_styles","_InputFields","_icons","_Button","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","NewsletterAndSocial","styled","section","BREAKPOINTS","MEDIUM","NewsletterEmailSection","div","props","ComponentXXSStyling","ComponentTextStyle","Regular","COLORS","getColor","theme","NewsletterEmail","InputFieldStyling","invertedFocusStyles","NewsletterButton","button","ComponentLStyling","Bold","SocialMedia","ComponentXSStyling","SocialMediaButtons","generateToken","componentType","defaultVariant","FooterNewsletterAndSocialSection","_ref","actionOnNewsletterSignup","newsletterLabel","placeholderEmail","emailInput","setEmailInput","useState","jsxs","children","jsx","TextField","id","withoutBorder","placeholder","value","onChange","onClick","target","href","rel","IconButton","variant","action","tabIndex","SystemIcons","Facebook","Twitter","Youtube","propTypes","_propTypes","func","string","isRequired","_default","exports"],"sources":["../../../src/Footer/Components/FooterNewsletterAndSocialSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nimport {BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles} from '../../styles';\r\nimport {TextField} from '../../InputFields';\r\nimport {SystemIcons} from '../../icons';\r\nimport {IconButton} from '../../Button';\r\nimport {\r\n ComponentLStyling,\r\n ComponentTextStyle,\r\n ComponentXSStyling,\r\n ComponentXXSStyling\r\n} from '../../styles';\r\nimport {InputFieldStyling} from '../../InputFields';\r\n\r\nconst NewsletterAndSocial = styled.section`\r\n display: flex;\r\n flex-direction: column;\r\n margin-bottom: 16px;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n flex-direction: row;\r\n }\r\n`;\r\n\r\nconst NewsletterEmailSection = styled.div`\r\n width: 100%;\r\n margin: 16px auto 0 auto;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: 60%;\r\n margin: 16px 0 0 0;\r\n }\r\n\r\n label {\r\n ${props => ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('white', props.theme))}\r\n margin-bottom: 2px;\r\n }\r\n div div {\r\n width: 100%;\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: calc(100% - 82px);\r\n width: 288px;\r\n }\r\n }\r\n input {\r\n height: 48px;\r\n }\r\n`;\r\n\r\nconst NewsletterEmail = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n margin: 2px auto 0;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n margin: 2px 0 0 0;\r\n flex-direction: row;\r\n }\r\n\r\n ${InputFieldStyling} {\r\n &.focus-visible {\r\n ${invertedFocusStyles}\r\n }\r\n }\r\n`;\r\n\r\nconst NewsletterButton = styled.button`\r\n background: transparent;\r\n width: 100%;\r\n height: 40px;\r\n border: 2px solid ${props => COLORS.getColor('white', props.theme)};\r\n box-sizing: border-box;\r\n border-radius: 8px;\r\n margin: 8px 0 4px 0;\r\n\r\n ${props => ComponentLStyling(ComponentTextStyle.Bold, COLORS.getColor('white', props.theme))}\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: 94px;\r\n margin: auto 0 4px 8px;\r\n }\r\n\r\n &:hover {\r\n cursor: pointer;\r\n }\r\n \r\n &:focus {\r\n ${invertedFocusStyles}\r\n }\r\n`;\r\n\r\nconst SocialMedia = styled.div`\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n margin: 0 auto;\r\n\r\n button div {\r\n box-sizing: border-box;\r\n border-radius: 4px;\r\n }\r\n\r\n h4 {\r\n margin-top: 16px;\r\n margin-bottom: 8px;\r\n \r\n ${ComponentXSStyling(ComponentTextStyle.Regular, 'inherit')}\r\n }\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n margin: 0 0 0 auto;\r\n button {\r\n margin: 0 0 0 12px;\r\n }\r\n }\r\n`;\r\n\r\nconst SocialMediaButtons = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n\r\n button div {\r\n display: flex;\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n margin: 0 0 0 20px;\r\n\r\n svg {\r\n fill: ${props => COLORS.getColor('white', props.theme)};\r\n path {\r\n fill: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n }\r\n\r\n &:first-child {\r\n margin: 0;\r\n }\r\n &:hover {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n color: ${props => COLORS.generateToken({componentType:'icon',defaultVariant:'subtle'}, props.theme)};\r\n }\r\n &:active {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n }\r\n }\r\n a {\r\n &:focus {\r\n ${invertedFocusStyles}\r\n }\r\n }\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n justify-content: flex-end;\r\n }\r\n`;\r\n\r\ninterface FooterNewsletterAndSocialSection {\r\n actionOnNewsletterSignup?: (email: string) => void;\r\n newsletterLabel: string;\r\n placeholderEmail?: string;\r\n}\r\n\r\nconst FooterNewsletterAndSocialSection = ({ actionOnNewsletterSignup, newsletterLabel, placeholderEmail }: FooterNewsletterAndSocialSection) => {\r\n const [emailInput, setEmailInput] = React.useState<string>('');\r\n return (\r\n <NewsletterAndSocial>\r\n <NewsletterEmailSection>\r\n <label>{newsletterLabel}</label>\r\n <NewsletterEmail>\r\n <TextField id=\"NewsletterEmail\" withoutBorder={true} placeholder={placeholderEmail} value={emailInput} onChange={(value: string) => setEmailInput(value)} />\r\n <NewsletterButton data-testid={'newsBtn'} onClick={(e: any) => actionOnNewsletterSignup && actionOnNewsletterSignup(e.target.value)}>Sign up</NewsletterButton>\r\n </NewsletterEmail>\r\n </NewsletterEmailSection>\r\n <SocialMedia>\r\n <h4>Follow us on social media</h4>\r\n <SocialMediaButtons>\r\n <a href=\"https://www.facebook.com/LaerdalMedical/\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Facebook />\r\n </IconButton>\r\n </a>\r\n <a href=\"https://twitter.com/laerdalmedical\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Twitter />\r\n </IconButton>\r\n </a>\r\n <a href=\"https://www.youtube.com/user/LaerdalMedical\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Youtube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IAAAzD,WAAA,CAAA0D,GAAA,EAAC5D,MAAA,CAAA2E,WAAW,CAACG,OAAO,IAAE;UAAC,CACb;QAAC,CACZ,CAAC;MAAA,CACc,CAAC;IAAA,CACV,CAAC;EAAA,CACK,CAAC;AAE1B,CAAC;AAAC5B,gCAAA,CAAA6B,SAAA;EAtCA3B,wBAAwB,EAAA4B,UAAA,CAAAvE,OAAA,CAAAwE,IAAA;EACxB5B,eAAe,EAAA2B,UAAA,CAAAvE,OAAA,CAAAyE,MAAA,CAAAC,UAAA;EACf7B,gBAAgB,EAAA0B,UAAA,CAAAvE,OAAA,CAAAyE;AAAA;AAAA,IAAAE,QAAA,GAAAC,OAAA,CAAA5E,OAAA,GAsCHyC,gCAAgC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FooterNewsletterAndSocialSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_styles","_InputFields","_icons","_Button","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","NewsletterAndSocial","styled","section","BREAKPOINTS","MEDIUM","NewsletterEmailSection","div","props","ComponentXXSStyling","ComponentTextStyle","Regular","COLORS","getColor","theme","NewsletterEmail","InputFieldStyling","invertedFocusStyles","NewsletterButton","button","ComponentLStyling","Bold","SocialMedia","ComponentXSStyling","SocialMediaButtons","generateToken","componentType","defaultVariant","FooterNewsletterAndSocialSection","_ref","actionOnNewsletterSignup","newsletterLabel","placeholderEmail","emailInput","setEmailInput","useState","jsxs","children","jsx","TextField","id","placeholder","value","onChange","onClick","target","href","rel","IconButton","variant","action","tabIndex","SystemIcons","Facebook","Twitter","Youtube","propTypes","_propTypes","func","string","isRequired","_default","exports"],"sources":["../../../src/Footer/Components/FooterNewsletterAndSocialSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nimport {BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles} from '../../styles';\r\nimport {TextField} from '../../InputFields';\r\nimport {SystemIcons} from '../../icons';\r\nimport {IconButton} from '../../Button';\r\nimport {\r\n ComponentLStyling,\r\n ComponentTextStyle,\r\n ComponentXSStyling,\r\n ComponentXXSStyling\r\n} from '../../styles';\r\nimport {InputFieldStyling} from '../../InputFields';\r\n\r\nconst NewsletterAndSocial = styled.section`\r\n display: flex;\r\n flex-direction: column;\r\n margin-bottom: 16px;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n flex-direction: row;\r\n }\r\n`;\r\n\r\nconst NewsletterEmailSection = styled.div`\r\n width: 100%;\r\n margin: 16px auto 0 auto;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: 60%;\r\n margin: 16px 0 0 0;\r\n }\r\n\r\n label {\r\n ${props => ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('white', props.theme))}\r\n margin-bottom: 2px;\r\n }\r\n div div {\r\n width: 100%;\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: calc(100% - 82px);\r\n width: 288px;\r\n }\r\n }\r\n input {\r\n height: 48px;\r\n }\r\n`;\r\n\r\nconst NewsletterEmail = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n margin: 2px auto 0;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n margin: 2px 0 0 0;\r\n flex-direction: row;\r\n }\r\n\r\n ${InputFieldStyling} {\r\n &.focus-visible {\r\n ${invertedFocusStyles}\r\n }\r\n }\r\n`;\r\n\r\nconst NewsletterButton = styled.button`\r\n background: transparent;\r\n width: 100%;\r\n height: 40px;\r\n border: 2px solid ${props => COLORS.getColor('white', props.theme)};\r\n box-sizing: border-box;\r\n border-radius: 8px;\r\n margin: 8px 0 4px 0;\r\n\r\n ${props => ComponentLStyling(ComponentTextStyle.Bold, COLORS.getColor('white', props.theme))}\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: 94px;\r\n margin: auto 0 4px 8px;\r\n }\r\n\r\n &:hover {\r\n cursor: pointer;\r\n }\r\n \r\n &:focus {\r\n ${invertedFocusStyles}\r\n }\r\n`;\r\n\r\nconst SocialMedia = styled.div`\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n margin: 0 auto;\r\n\r\n button div {\r\n box-sizing: border-box;\r\n border-radius: 4px;\r\n }\r\n\r\n h4 {\r\n margin-top: 16px;\r\n margin-bottom: 8px;\r\n \r\n ${ComponentXSStyling(ComponentTextStyle.Regular, 'inherit')}\r\n }\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n margin: 0 0 0 auto;\r\n button {\r\n margin: 0 0 0 12px;\r\n }\r\n }\r\n`;\r\n\r\nconst SocialMediaButtons = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n\r\n button div {\r\n display: flex;\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n margin: 0 0 0 20px;\r\n\r\n svg {\r\n fill: ${props => COLORS.getColor('white', props.theme)};\r\n path {\r\n fill: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n }\r\n\r\n &:first-child {\r\n margin: 0;\r\n }\r\n &:hover {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n color: ${props => COLORS.generateToken({componentType:'icon',defaultVariant:'subtle'}, props.theme)};\r\n }\r\n &:active {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n }\r\n }\r\n a {\r\n &:focus {\r\n ${invertedFocusStyles}\r\n }\r\n }\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n justify-content: flex-end;\r\n }\r\n`;\r\n\r\ninterface FooterNewsletterAndSocialSection {\r\n actionOnNewsletterSignup?: (email: string) => void;\r\n newsletterLabel: string;\r\n placeholderEmail?: string;\r\n}\r\n\r\nconst FooterNewsletterAndSocialSection = ({ actionOnNewsletterSignup, newsletterLabel, placeholderEmail }: FooterNewsletterAndSocialSection) => {\r\n const [emailInput, setEmailInput] = React.useState<string>('');\r\n return (\r\n <NewsletterAndSocial>\r\n <NewsletterEmailSection>\r\n <label>{newsletterLabel}</label>\r\n <NewsletterEmail>\r\n <TextField id=\"NewsletterEmail\" placeholder={placeholderEmail} value={emailInput} onChange={(value: string) => setEmailInput(value)} />\r\n <NewsletterButton data-testid={'newsBtn'} onClick={(e: any) => actionOnNewsletterSignup && actionOnNewsletterSignup(e.target.value)}>Sign up</NewsletterButton>\r\n </NewsletterEmail>\r\n </NewsletterEmailSection>\r\n <SocialMedia>\r\n <h4>Follow us on social media</h4>\r\n <SocialMediaButtons>\r\n <a href=\"https://www.facebook.com/LaerdalMedical/\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Facebook />\r\n </IconButton>\r\n </a>\r\n <a href=\"https://twitter.com/laerdalmedical\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Twitter />\r\n </IconButton>\r\n </a>\r\n <a href=\"https://www.youtube.com/user/LaerdalMedical\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Youtube />\r\n </IconButton>\r\n </a>\r\n </SocialMediaButtons>\r\n </SocialMedia>\r\n </NewsletterAndSocial>\r\n );\r\n};\r\n\r\nexport default FooterNewsletterAndSocialSection;\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAAwC,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CA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@@ -160,7 +160,6 @@ const FooterNewsletterAndSocialSection = _ref => {
|
|
|
160
160
|
}), /*#__PURE__*/_jsxs(NewsletterEmail, {
|
|
161
161
|
children: [/*#__PURE__*/_jsx(TextField, {
|
|
162
162
|
id: "NewsletterEmail",
|
|
163
|
-
withoutBorder: true,
|
|
164
163
|
placeholder: placeholderEmail,
|
|
165
164
|
value: emailInput,
|
|
166
165
|
onChange: value => setEmailInput(value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterNewsletterAndSocialSection.js","names":["React","styled","BREAKPOINTS","COLORS","invertedFocusStyles","TextField","SystemIcons","IconButton","ComponentLStyling","ComponentTextStyle","ComponentXSStyling","ComponentXXSStyling","InputFieldStyling","jsx","_jsx","jsxs","_jsxs","NewsletterAndSocial","section","MEDIUM","NewsletterEmailSection","div","props","Regular","getColor","theme","NewsletterEmail","NewsletterButton","button","Bold","SocialMedia","SocialMediaButtons","generateToken","componentType","defaultVariant","FooterNewsletterAndSocialSection","_ref","actionOnNewsletterSignup","newsletterLabel","placeholderEmail","emailInput","setEmailInput","useState","children","id","withoutBorder","placeholder","value","onChange","onClick","e","target","href","rel","variant","action","tabIndex","Facebook","Twitter","Youtube","propTypes","_pt","func","string","isRequired"],"sources":["../../../src/Footer/Components/FooterNewsletterAndSocialSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nimport {BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles} from '../../styles';\r\nimport {TextField} from '../../InputFields';\r\nimport {SystemIcons} from '../../icons';\r\nimport {IconButton} from '../../Button';\r\nimport {\r\n ComponentLStyling,\r\n ComponentTextStyle,\r\n ComponentXSStyling,\r\n ComponentXXSStyling\r\n} from '../../styles';\r\nimport {InputFieldStyling} from '../../InputFields';\r\n\r\nconst NewsletterAndSocial = styled.section`\r\n display: flex;\r\n flex-direction: column;\r\n margin-bottom: 16px;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n flex-direction: row;\r\n }\r\n`;\r\n\r\nconst NewsletterEmailSection = styled.div`\r\n width: 100%;\r\n margin: 16px auto 0 auto;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: 60%;\r\n margin: 16px 0 0 0;\r\n }\r\n\r\n label {\r\n ${props => ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('white', props.theme))}\r\n margin-bottom: 2px;\r\n }\r\n div div {\r\n width: 100%;\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: calc(100% - 82px);\r\n width: 288px;\r\n }\r\n }\r\n input {\r\n height: 48px;\r\n }\r\n`;\r\n\r\nconst NewsletterEmail = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n margin: 2px auto 0;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n margin: 2px 0 0 0;\r\n flex-direction: row;\r\n }\r\n\r\n ${InputFieldStyling} {\r\n &.focus-visible {\r\n ${invertedFocusStyles}\r\n }\r\n }\r\n`;\r\n\r\nconst NewsletterButton = styled.button`\r\n background: transparent;\r\n width: 100%;\r\n height: 40px;\r\n border: 2px solid ${props => COLORS.getColor('white', props.theme)};\r\n box-sizing: border-box;\r\n border-radius: 8px;\r\n margin: 8px 0 4px 0;\r\n\r\n ${props => ComponentLStyling(ComponentTextStyle.Bold, COLORS.getColor('white', props.theme))}\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: 94px;\r\n margin: auto 0 4px 8px;\r\n }\r\n\r\n &:hover {\r\n cursor: pointer;\r\n }\r\n \r\n &:focus {\r\n ${invertedFocusStyles}\r\n }\r\n`;\r\n\r\nconst SocialMedia = styled.div`\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n margin: 0 auto;\r\n\r\n button div {\r\n box-sizing: border-box;\r\n border-radius: 4px;\r\n }\r\n\r\n h4 {\r\n margin-top: 16px;\r\n margin-bottom: 8px;\r\n \r\n ${ComponentXSStyling(ComponentTextStyle.Regular, 'inherit')}\r\n }\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n margin: 0 0 0 auto;\r\n button {\r\n margin: 0 0 0 12px;\r\n }\r\n }\r\n`;\r\n\r\nconst SocialMediaButtons = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n\r\n button div {\r\n display: flex;\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n margin: 0 0 0 20px;\r\n\r\n svg {\r\n fill: ${props => COLORS.getColor('white', props.theme)};\r\n path {\r\n fill: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n }\r\n\r\n &:first-child {\r\n margin: 0;\r\n }\r\n &:hover {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n color: ${props => COLORS.generateToken({componentType:'icon',defaultVariant:'subtle'}, props.theme)};\r\n }\r\n &:active {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n }\r\n }\r\n a {\r\n &:focus {\r\n ${invertedFocusStyles}\r\n }\r\n }\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n justify-content: flex-end;\r\n }\r\n`;\r\n\r\ninterface FooterNewsletterAndSocialSection {\r\n actionOnNewsletterSignup?: (email: string) => void;\r\n newsletterLabel: string;\r\n placeholderEmail?: string;\r\n}\r\n\r\nconst FooterNewsletterAndSocialSection = ({ actionOnNewsletterSignup, newsletterLabel, placeholderEmail }: FooterNewsletterAndSocialSection) => {\r\n const [emailInput, setEmailInput] = React.useState<string>('');\r\n return (\r\n <NewsletterAndSocial>\r\n <NewsletterEmailSection>\r\n <label>{newsletterLabel}</label>\r\n <NewsletterEmail>\r\n <TextField id=\"NewsletterEmail\" withoutBorder={true} placeholder={placeholderEmail} value={emailInput} onChange={(value: string) => setEmailInput(value)} />\r\n <NewsletterButton data-testid={'newsBtn'} onClick={(e: any) => actionOnNewsletterSignup && actionOnNewsletterSignup(e.target.value)}>Sign up</NewsletterButton>\r\n </NewsletterEmail>\r\n </NewsletterEmailSection>\r\n <SocialMedia>\r\n <h4>Follow us on social media</h4>\r\n <SocialMediaButtons>\r\n <a href=\"https://www.facebook.com/LaerdalMedical/\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Facebook />\r\n </IconButton>\r\n </a>\r\n <a href=\"https://twitter.com/laerdalmedical\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Twitter />\r\n </IconButton>\r\n </a>\r\n <a href=\"https://www.youtube.com/user/LaerdalMedical\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Youtube />\r\n </IconButton>\r\n </a>\r\n </SocialMediaButtons>\r\n </SocialMedia>\r\n </NewsletterAndSocial>\r\n );\r\n};\r\n\r\nexport default FooterNewsletterAndSocialSection;\r\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAAQC,WAAW,EAAEC,MAAM,EAAeC,mBAAmB,QAAO,cAAc;AAClF,SAAQC,SAAS,QAAO,mBAAmB;AAC3C,SAAQC,WAAW,QAAO,aAAa;AACvC,SAAQC,UAAU,QAAO,cAAc;AACvC,SACEC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAkB,EAClBC,mBAAmB,QACd,cAAc;AACrB,SAAQC,iBAAiB,QAAO,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpD,MAAMC,mBAAmB,GAAGhB,MAAM,CAACiB,OAAO;AAC1C;AACA;AACA;AACA;AACA,IAAIhB,WAAW,CAACiB,MAAM;AACtB;AACA;AACA,CAAC;AAED,MAAMC,sBAAsB,GAAGnB,MAAM,CAACoB,GAAG;AACzC;AACA;AACA;AACA,IAAInB,WAAW,CAACiB,MAAM;AACtB;AACA;AAC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,QAAA,eAC7D7B,IAAA,CAACR,WAAW,CAACoD,OAAO,IAAE;UAAC,CACb;QAAC,CACZ,CAAC,eACJ5C,IAAA;UAAGsC,IAAI,EAAC,6CAA6C;UAACD,MAAM,EAAC,QAAQ;UAACE,GAAG,EAAC,qBAAqB;UAAAV,QAAA,eAC7F7B,IAAA,CAACP,UAAU;YAAC+C,OAAO,EAAC,WAAW;YAACC,MAAM,EAAEA,CAAA,KAAM,CAAC,CAAE;YAACC,QAAQ,EAAE,CAAC,CAAE;YAAAb,QAAA,eAC7D7B,IAAA,CAACR,WAAW,CAACqD,OAAO,IAAE;UAAC,CACb;QAAC,CACZ,CAAC;MAAA,CACc,CAAC;IAAA,CACV,CAAC;EAAA,CACK,CAAC;AAE1B,CAAC;AAACxB,gCAAA,CAAAyB,SAAA;EAtCAvB,wBAAwB,EAAAwB,GAAA,CAAAC,IAAA;EACxBxB,eAAe,EAAAuB,GAAA,CAAAE,MAAA,CAAAC,UAAA;EACfzB,gBAAgB,EAAAsB,GAAA,CAAAE;AAAA;AAsClB,eAAe5B,gCAAgC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FooterNewsletterAndSocialSection.js","names":["React","styled","BREAKPOINTS","COLORS","invertedFocusStyles","TextField","SystemIcons","IconButton","ComponentLStyling","ComponentTextStyle","ComponentXSStyling","ComponentXXSStyling","InputFieldStyling","jsx","_jsx","jsxs","_jsxs","NewsletterAndSocial","section","MEDIUM","NewsletterEmailSection","div","props","Regular","getColor","theme","NewsletterEmail","NewsletterButton","button","Bold","SocialMedia","SocialMediaButtons","generateToken","componentType","defaultVariant","FooterNewsletterAndSocialSection","_ref","actionOnNewsletterSignup","newsletterLabel","placeholderEmail","emailInput","setEmailInput","useState","children","id","placeholder","value","onChange","onClick","e","target","href","rel","variant","action","tabIndex","Facebook","Twitter","Youtube","propTypes","_pt","func","string","isRequired"],"sources":["../../../src/Footer/Components/FooterNewsletterAndSocialSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\n\r\nimport {BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles} from '../../styles';\r\nimport {TextField} from '../../InputFields';\r\nimport {SystemIcons} from '../../icons';\r\nimport {IconButton} from '../../Button';\r\nimport {\r\n ComponentLStyling,\r\n ComponentTextStyle,\r\n ComponentXSStyling,\r\n ComponentXXSStyling\r\n} from '../../styles';\r\nimport {InputFieldStyling} from '../../InputFields';\r\n\r\nconst NewsletterAndSocial = styled.section`\r\n display: flex;\r\n flex-direction: column;\r\n margin-bottom: 16px;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n flex-direction: row;\r\n }\r\n`;\r\n\r\nconst NewsletterEmailSection = styled.div`\r\n width: 100%;\r\n margin: 16px auto 0 auto;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: 60%;\r\n margin: 16px 0 0 0;\r\n }\r\n\r\n label {\r\n ${props => ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('white', props.theme))}\r\n margin-bottom: 2px;\r\n }\r\n div div {\r\n width: 100%;\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: calc(100% - 82px);\r\n width: 288px;\r\n }\r\n }\r\n input {\r\n height: 48px;\r\n }\r\n`;\r\n\r\nconst NewsletterEmail = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n margin: 2px auto 0;\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n margin: 2px 0 0 0;\r\n flex-direction: row;\r\n }\r\n\r\n ${InputFieldStyling} {\r\n &.focus-visible {\r\n ${invertedFocusStyles}\r\n }\r\n }\r\n`;\r\n\r\nconst NewsletterButton = styled.button`\r\n background: transparent;\r\n width: 100%;\r\n height: 40px;\r\n border: 2px solid ${props => COLORS.getColor('white', props.theme)};\r\n box-sizing: border-box;\r\n border-radius: 8px;\r\n margin: 8px 0 4px 0;\r\n\r\n ${props => ComponentLStyling(ComponentTextStyle.Bold, COLORS.getColor('white', props.theme))}\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n width: 94px;\r\n margin: auto 0 4px 8px;\r\n }\r\n\r\n &:hover {\r\n cursor: pointer;\r\n }\r\n \r\n &:focus {\r\n ${invertedFocusStyles}\r\n }\r\n`;\r\n\r\nconst SocialMedia = styled.div`\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n margin: 0 auto;\r\n\r\n button div {\r\n box-sizing: border-box;\r\n border-radius: 4px;\r\n }\r\n\r\n h4 {\r\n margin-top: 16px;\r\n margin-bottom: 8px;\r\n \r\n ${ComponentXSStyling(ComponentTextStyle.Regular, 'inherit')}\r\n }\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n margin: 0 0 0 auto;\r\n button {\r\n margin: 0 0 0 12px;\r\n }\r\n }\r\n`;\r\n\r\nconst SocialMediaButtons = styled.div`\r\n display: flex;\r\n justify-content: center;\r\n\r\n button div {\r\n display: flex;\r\n background-color: transparent;\r\n color: ${props => COLORS.getColor('white', props.theme)};\r\n margin: 0 0 0 20px;\r\n\r\n svg {\r\n fill: ${props => COLORS.getColor('white', props.theme)};\r\n path {\r\n fill: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n }\r\n\r\n &:first-child {\r\n margin: 0;\r\n }\r\n &:hover {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n color: ${props => COLORS.generateToken({componentType:'icon',defaultVariant:'subtle'}, props.theme)};\r\n }\r\n &:active {\r\n background-color: ${props => COLORS.getColor('primary_800', props.theme)};\r\n color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n }\r\n }\r\n a {\r\n &:focus {\r\n ${invertedFocusStyles}\r\n }\r\n }\r\n\r\n ${BREAKPOINTS.MEDIUM} {\r\n justify-content: flex-end;\r\n }\r\n`;\r\n\r\ninterface FooterNewsletterAndSocialSection {\r\n actionOnNewsletterSignup?: (email: string) => void;\r\n newsletterLabel: string;\r\n placeholderEmail?: string;\r\n}\r\n\r\nconst FooterNewsletterAndSocialSection = ({ actionOnNewsletterSignup, newsletterLabel, placeholderEmail }: FooterNewsletterAndSocialSection) => {\r\n const [emailInput, setEmailInput] = React.useState<string>('');\r\n return (\r\n <NewsletterAndSocial>\r\n <NewsletterEmailSection>\r\n <label>{newsletterLabel}</label>\r\n <NewsletterEmail>\r\n <TextField id=\"NewsletterEmail\" placeholder={placeholderEmail} value={emailInput} onChange={(value: string) => setEmailInput(value)} />\r\n <NewsletterButton data-testid={'newsBtn'} onClick={(e: any) => actionOnNewsletterSignup && actionOnNewsletterSignup(e.target.value)}>Sign up</NewsletterButton>\r\n </NewsletterEmail>\r\n </NewsletterEmailSection>\r\n <SocialMedia>\r\n <h4>Follow us on social media</h4>\r\n <SocialMediaButtons>\r\n <a href=\"https://www.facebook.com/LaerdalMedical/\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Facebook />\r\n </IconButton>\r\n </a>\r\n <a href=\"https://twitter.com/laerdalmedical\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Twitter />\r\n </IconButton>\r\n </a>\r\n <a href=\"https://www.youtube.com/user/LaerdalMedical\" target=\"_blank\" rel=\"noreferrer noopener\">\r\n <IconButton variant=\"secondary\" action={() => {}} tabIndex={-1}>\r\n <SystemIcons.Youtube />\r\n </IconButton>\r\n </a>\r\n </SocialMediaButtons>\r\n </SocialMedia>\r\n </NewsletterAndSocial>\r\n );\r\n};\r\n\r\nexport default FooterNewsletterAndSocialSection;\r\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAAQC,WAAW,EAAEC,MAAM,EAAeC,mBAAmB,QAAO,cAAc;AAClF,SAAQC,SAAS,QAAO,mBAAmB;AAC3C,SAAQC,WAAW,QAAO,aAAa;AACvC,SAAQC,UAAU,QAAO,cAAc;AACvC,SACEC,iBAAiB,EACjBC,kBAAkB,E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AAC,CAAE;YAAAZ,QAAA,eAC7D7B,IAAA,CAACR,WAAW,CAACkD,QAAQ,IAAE;UAAC,CACd;QAAC,CACZ,CAAC,eACJ1C,IAAA;UAAGqC,IAAI,EAAC,oCAAoC;UAACD,MAAM,EAAC,QAAQ;UAACE,GAAG,EAAC,qBAAqB;UAAAT,QAAA,eACpF7B,IAAA,CAACP,UAAU;YAAC8C,OAAO,EAAC,WAAW;YAACC,MAAM,EAAEA,CAAA,KAAM,CAAC,CAAE;YAACC,QAAQ,EAAE,CAAC,CAAE;YAAAZ,QAAA,eAC7D7B,IAAA,CAACR,WAAW,CAACmD,OAAO,IAAE;UAAC,CACb;QAAC,CACZ,CAAC,eACJ3C,IAAA;UAAGqC,IAAI,EAAC,6CAA6C;UAACD,MAAM,EAAC,QAAQ;UAACE,GAAG,EAAC,qBAAqB;UAAAT,QAAA,eAC7F7B,IAAA,CAACP,UAAU;YAAC8C,OAAO,EAAC,WAAW;YAACC,MAAM,EAAEA,CAAA,KAAM,CAAC,CAAE;YAACC,QAAQ,EAAE,CAAC,CAAE;YAAAZ,QAAA,eAC7D7B,IAAA,CAACR,WAAW,CAACoD,OAAO,IAAE;UAAC,CACb;QAAC,CACZ,CAAC;MAAA,CACc,CAAC;IAAA,CACV,CAAC;EAAA,CACK,CAAC;AAE1B,CAAC;AAACvB,gCAAA,CAAAwB,SAAA;EAtCAtB,wBAAwB,EAAAuB,GAAA,CAAAC,IAAA;EACxBvB,eAAe,EAAAsB,GAAA,CAAAE,MAAA,CAAAC,UAAA;EACfxB,gBAAgB,EAAAqB,GAAA,CAAAE;AAAA;AAsClB,eAAe3B,gCAAgC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterTop.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_animatedScrollTo","_interopRequireDefault","_styles","_Logo","_icons","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FooterTopSection","styled","section","ToTop","div","ComponentXSStyling","ComponentTextStyle","UppercaseBold","props","COLORS","getColor","theme","invertedFocusStyles","FooterTop","_ref","sitename","showBetaTag","toTopText","useTheme","isPressingEnter","key","preventDefault","stopPropagation","action","animateScrollTo","jsxs","children","jsx","name","color","inverted","betaTagBackgroundColor","betaTagColor","role","tabIndex","onKeyDown","onClick","SystemIcons","ArrowLineUp","size","propTypes","_propTypes","string","bool","isRequired","_default","exports"],"sources":["../../../src/Footer/Components/FooterTop.tsx"],"sourcesContent":["import * as React from 'react';\
|
|
1
|
+
{"version":3,"file":"FooterTop.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_animatedScrollTo","_interopRequireDefault","_styles","_Logo","_icons","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FooterTopSection","styled","section","ToTop","div","ComponentXSStyling","ComponentTextStyle","UppercaseBold","props","COLORS","getColor","theme","invertedFocusStyles","FooterTop","_ref","sitename","showBetaTag","toTopText","useTheme","isPressingEnter","key","preventDefault","stopPropagation","action","animateScrollTo","jsxs","children","jsx","name","color","inverted","betaTagBackgroundColor","betaTagColor","role","tabIndex","onKeyDown","onClick","SystemIcons","ArrowLineUp","size","propTypes","_propTypes","string","bool","isRequired","_default","exports"],"sources":["../../../src/Footer/Components/FooterTop.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { useTheme } from 'styled-components';\nimport animateScrollTo from 'animated-scroll-to';\n\nimport {COLORS, invertedFocusStyles} from '../../styles';\nimport Logo from '../../GlobalNavigationBar/Logo';\nimport {SystemIcons} from '../../icons';\nimport {ComponentTextStyle, ComponentXSStyling} from '../../styles';\n\nconst FooterTopSection = styled.section`\n min-height: 8px;\n color: white;\n display: flex;\n flex-direction: row;\n margin-bottom: 16px;\n`;\n\nconst ToTop = styled.div`\n display: flex;\n flex-direction: column;\n margin: auto 0 auto auto;\n border-radius: 4px;\n height: 48px;\n width: 48px;\n padding: 8px;\n tabindex: 0;\n\n svg {\n margin: 0 auto;\n }\n\n &:hover {\n cursor: pointer;\n }\n span {\n margin: 14px auto 0 auto;\n ${ComponentXSStyling(ComponentTextStyle.UppercaseBold, 'inherit')}\n }\n\n &:hover:not(:disabled) {\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\n svg path,\n svg {\n fill: ${props => COLORS.getColor('primary_700', props.theme)};\n }\n span {\n color: ${props => COLORS.getColor('primary_700', props.theme)};\n }\n }\n\n &:focus:not(:disabled) {\n ${invertedFocusStyles}\n }\n\n &:active:not(:disabled) {\n background: ${props => COLORS.getColor('primary_100', props.theme)};\n svg path,\n svg {\n fill: ${props => COLORS.getColor('primary_800', props.theme)};\n }\n span {\n color: ${props => COLORS.getColor('primary_800', props.theme)};\n }\n }\n`;\n\ninterface FooterTopProps {\n sitename?: string;\n showBetaTag?: boolean;\n toTopText: string;\n}\n\nconst FooterTop = ({ sitename, showBetaTag, toTopText }: FooterTopProps) => {\n const theme = useTheme();\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 const action = () => {\n animateScrollTo(0);\n };\n return (\n <FooterTopSection>\n <Logo \n name={sitename || ''}\n showBetaTag={showBetaTag}\n color={COLORS.getColor('white', theme)}\n inverted={true}\n betaTagBackgroundColor={COLORS.getColor('white', theme)}\n betaTagColor={COLORS.getColor('neutral_800', theme)}\n />\n <ToTop role=\"button\" data-testid={'toTopNavigation'} tabIndex={0} onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)} onClick={action}>\n <SystemIcons.ArrowLineUp aria-hidden=\"true\" size=\"24px\" color={COLORS.getColor('white', theme)} />\n <span>{toTopText}</span>\n </ToTop>\n </FooterTopSection>\n );\n};\n\nexport default FooterTop;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uB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AAA,CAAAgD,GAAA;QAAAD,QAAA,EAAOT;MAAS,CAAO,CAAC;IAAA,CACnB,CAAC;EAAA,CACQ,CAAC;AAEvB,CAAC;AAACJ,SAAA,CAAA2B,SAAA;EAlCAzB,QAAQ,EAAA0B,UAAA,CAAAvD,OAAA,CAAAwD,MAAA;EACR1B,WAAW,EAAAyB,UAAA,CAAAvD,OAAA,CAAAyD,IAAA;EACX1B,SAAS,EAAAwB,UAAA,CAAAvD,OAAA,CAAAwD,MAAA,CAAAE;AAAA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAA5D,OAAA,GAkCI2B,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterTop.js","names":["React","styled","useTheme","animateScrollTo","COLORS","invertedFocusStyles","Logo","SystemIcons","ComponentTextStyle","ComponentXSStyling","jsx","_jsx","jsxs","_jsxs","FooterTopSection","section","ToTop","div","UppercaseBold","props","getColor","theme","FooterTop","_ref","sitename","showBetaTag","toTopText","isPressingEnter","e","key","preventDefault","stopPropagation","action","children","name","color","inverted","betaTagBackgroundColor","betaTagColor","role","tabIndex","onKeyDown","onClick","ArrowLineUp","size","propTypes","_pt","string","bool","isRequired"],"sources":["../../../src/Footer/Components/FooterTop.tsx"],"sourcesContent":["import * as React from 'react';\
|
|
1
|
+
{"version":3,"file":"FooterTop.js","names":["React","styled","useTheme","animateScrollTo","COLORS","invertedFocusStyles","Logo","SystemIcons","ComponentTextStyle","ComponentXSStyling","jsx","_jsx","jsxs","_jsxs","FooterTopSection","section","ToTop","div","UppercaseBold","props","getColor","theme","FooterTop","_ref","sitename","showBetaTag","toTopText","isPressingEnter","e","key","preventDefault","stopPropagation","action","children","name","color","inverted","betaTagBackgroundColor","betaTagColor","role","tabIndex","onKeyDown","onClick","ArrowLineUp","size","propTypes","_pt","string","bool","isRequired"],"sources":["../../../src/Footer/Components/FooterTop.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled, { useTheme } from 'styled-components';\nimport animateScrollTo from 'animated-scroll-to';\n\nimport {COLORS, invertedFocusStyles} from '../../styles';\nimport Logo from '../../GlobalNavigationBar/Logo';\nimport {SystemIcons} from '../../icons';\nimport {ComponentTextStyle, ComponentXSStyling} from '../../styles';\n\nconst FooterTopSection = styled.section`\n min-height: 8px;\n color: white;\n display: flex;\n flex-direction: row;\n margin-bottom: 16px;\n`;\n\nconst ToTop = styled.div`\n display: flex;\n flex-direction: column;\n margin: auto 0 auto auto;\n border-radius: 4px;\n height: 48px;\n width: 48px;\n padding: 8px;\n tabindex: 0;\n\n svg {\n margin: 0 auto;\n }\n\n &:hover {\n cursor: pointer;\n }\n span {\n margin: 14px auto 0 auto;\n ${ComponentXSStyling(ComponentTextStyle.UppercaseBold, 'inherit')}\n }\n\n &:hover:not(:disabled) {\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\n svg path,\n svg {\n fill: ${props => COLORS.getColor('primary_700', props.theme)};\n }\n span {\n color: ${props => COLORS.getColor('primary_700', props.theme)};\n }\n }\n\n &:focus:not(:disabled) {\n ${invertedFocusStyles}\n }\n\n &:active:not(:disabled) {\n background: ${props => COLORS.getColor('primary_100', props.theme)};\n svg path,\n svg {\n fill: ${props => COLORS.getColor('primary_800', props.theme)};\n }\n span {\n color: ${props => COLORS.getColor('primary_800', props.theme)};\n }\n }\n`;\n\ninterface FooterTopProps {\n sitename?: string;\n showBetaTag?: boolean;\n toTopText: string;\n}\n\nconst FooterTop = ({ sitename, showBetaTag, toTopText }: FooterTopProps) => {\n const theme = useTheme();\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 const action = () => {\n animateScrollTo(0);\n };\n return (\n <FooterTopSection>\n <Logo \n name={sitename || ''}\n showBetaTag={showBetaTag}\n color={COLORS.getColor('white', theme)}\n inverted={true}\n betaTagBackgroundColor={COLORS.getColor('white', theme)}\n betaTagColor={COLORS.getColor('neutral_800', theme)}\n />\n <ToTop role=\"button\" data-testid={'toTopNavigation'} tabIndex={0} onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)} onClick={action}>\n <SystemIcons.ArrowLineUp aria-hidden=\"true\" size=\"24px\" color={COLORS.getColor('white', theme)} />\n <span>{toTopText}</span>\n </ToTop>\n </FooterTopSection>\n );\n};\n\nexport default FooterTop;\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,OAAOC,eAAe,MAAM,oBAAoB;AAEhD,SAAQC,MAAM,EAAEC,mBAAmB,QAAO,cAAc;AACxD,OAAOC,IAAI,MAAM,gCAAgC;AACjD,SAAQC,WAAW,QAAO,aAAa;AACvC,SAAQC,kBAAkB,EAAEC,kBAAkB,QAAO,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpE,MAAMC,gBAAgB,GAAGb,MAAM,CAACc,OAAO;AACvC;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMC,KAAK,GAAGf,MAAM,CAACgB,GAAG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMR,kBAAkB,CAACD,kBAAkB,CAACU,aAAa,EAAE,SAAS,CAAC;AACrE;AACA;AACA;AACA,wBAAwBC,KAAK,IAAIf,MAAM,CAACgB,QAAQ,CAAC,YAAY,EAAED,KAAK,CAACE,KAAK,CAAC;AAC3E;AACA;AACA,cAAcF,KAAK,IAAIf,MAAM,CAACgB,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AAClE;AACA;AACA,eAAeF,KAAK,IAAIf,MAAM,CAACgB,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AACnE;AACA;AACA;AACA;AACA,MAAMhB,mBAAmB;AACzB;AACA;AACA;AACA,kBAAkBc,KAA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AAE,CAAE;MAACC,SAAS,EAAGb,CAAM,IAAMD,eAAe,CAACC,CAAC,CAAC,GAAGI,MAAM,CAAC,CAAC,GAAG,IAAM;MAACU,OAAO,EAAEV,MAAO;MAAAC,QAAA,gBAC/ItB,IAAA,CAACJ,WAAW,CAACoC,WAAW;QAAC,eAAY,MAAM;QAACC,IAAI,EAAC,MAAM;QAACT,KAAK,EAAE/B,MAAM,CAACgB,QAAQ,CAAC,OAAO,EAAEC,KAAK;MAAE,CAAE,CAAC,eAClGV,IAAA;QAAAsB,QAAA,EAAOP;MAAS,CAAO,CAAC;IAAA,CACnB,CAAC;EAAA,CACQ,CAAC;AAEvB,CAAC;AAACJ,SAAA,CAAAuB,SAAA;EAlCArB,QAAQ,EAAAsB,GAAA,CAAAC,MAAA;EACRtB,WAAW,EAAAqB,GAAA,CAAAE,IAAA;EACXtB,SAAS,EAAAoB,GAAA,CAAAC,MAAA,CAAAE;AAAA;AAkCX,eAAe3B,SAAS","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var _reactQuillNew = _interopRequireDefault(require("react-quill-new"));
|
|
13
13
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
14
14
|
var _styling = require("./styling");
|
|
15
15
|
var _types = require("../types");
|
|
@@ -228,7 +228,7 @@ const RichTextField = exports.RichTextField = /*#__PURE__*/_react.default.forwar
|
|
|
228
228
|
let f = formats ?? Object.values(RichTextFieldFormats).filter(a => a !== RichTextFieldFormats.Image && a !== RichTextFieldFormats.Video && a !== RichTextFieldFormats.Formula);
|
|
229
229
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RichTextFieldContainer, {
|
|
230
230
|
className: `${resizable ? 'resizable' : ''} ${size} ${state || ''} ${readOnly ? 'readonly' : ''} ${disabled ? 'disabled' : ''}`,
|
|
231
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
231
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactQuillNew.default, _objectSpread({
|
|
232
232
|
ref: ref,
|
|
233
233
|
readOnly: readOnly || disabled,
|
|
234
234
|
modules: m,
|
|
@@ -265,6 +265,7 @@ RichTextField.propTypes = {
|
|
|
265
265
|
readOnly: _propTypes.default.bool,
|
|
266
266
|
disabled: _propTypes.default.bool,
|
|
267
267
|
resizable: _propTypes.default.bool,
|
|
268
|
+
modules: _propTypes.default.objectOf(_propTypes.default.any),
|
|
268
269
|
formats: _propTypes.default.arrayOf(_propTypes.default.oneOf(["background", "bold", "color", "font", "code", "italic", "link", "size", "strike", "script", "underline", "blockquote", "header", "indent", "list", "align", "direction", "code-block", "formula", "image", "video"])),
|
|
269
270
|
onKeyDown: _propTypes.default.func,
|
|
270
271
|
onKeyPress: _propTypes.default.func,
|