@dnanpm/styleguide 1.8.1 → 2.0.1
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/build/cjs/components/Accordion/Accordion.d.ts +50 -0
- package/build/cjs/components/Accordion/Accordion.js +52 -0
- package/build/cjs/components/Accordion/AccordionItem.d.ts +30 -0
- package/build/cjs/components/Accordion/AccordionItem.js +77 -0
- package/build/cjs/components/AmountSelector/AmountSelector.js +5 -6
- package/build/cjs/components/Buttons/ButtonBasicStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonBasicStyles.js +10 -14
- package/build/cjs/components/Buttons/ButtonDefault.js +6 -2
- package/build/cjs/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonIconStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonPrimary.js +6 -2
- package/build/cjs/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonSecondary.js +7 -3
- package/build/cjs/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonTertiary.js +7 -3
- package/build/cjs/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/CloseButton.d.ts +37 -30
- package/build/cjs/components/Card/Card.js +4 -2
- package/build/cjs/components/Card/CardRow.js +3 -3
- package/build/cjs/components/Checkbox/Checkbox.d.ts +38 -12
- package/build/cjs/components/Checkbox/Checkbox.js +37 -70
- package/build/cjs/components/DnaLogo/DnaLogo.d.ts +37 -40
- package/build/cjs/components/Footer/Components/FooterComponents.js +3 -2
- package/build/cjs/components/Helper/Helper.js +2 -1
- package/build/cjs/components/Icon/Icon.d.ts +39 -30
- package/build/cjs/components/Icon/Icons.d.ts +1 -4
- package/build/cjs/components/Icon/Icons.js +3 -7
- package/build/cjs/components/Input/Input.d.ts +102 -13
- package/build/cjs/components/Input/Input.js +57 -58
- package/build/cjs/components/Label/Label.js +2 -3
- package/build/cjs/components/LabelText/LabelText.d.ts +38 -30
- package/build/cjs/components/LabelText/LabelText.js +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +4 -10
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +18 -12
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.js +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +1 -4
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
- package/build/cjs/components/MainNavigation/MainNavigation.js +1 -17
- package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +148 -120
- package/build/cjs/components/Notification/Notification.d.ts +36 -17
- package/build/cjs/components/Notification/Notification.js +25 -48
- package/build/cjs/components/NotificationBadge/NotificationBadge.d.ts +37 -30
- package/build/cjs/components/NotificationBadge/NotificationBadge.js +1 -1
- package/build/cjs/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +3 -3
- package/build/cjs/components/RadioButton/RadioButton.d.ts +33 -17
- package/build/cjs/components/RadioButton/RadioButton.js +12 -57
- package/build/cjs/components/ReadMore/ReadMore.js +2 -7
- package/build/cjs/components/Ribbon/Ribbon.d.ts +57 -0
- package/build/cjs/components/Ribbon/Ribbon.js +80 -0
- package/build/cjs/components/Search/Search.js +2 -1
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
- package/build/cjs/components/Selectbox/Selectbox.d.ts +102 -13
- package/build/cjs/components/Selectbox/Selectbox.js +40 -49
- package/build/cjs/components/Tabs/Tab.d.ts +37 -30
- package/build/cjs/components/Tabs/Tab.js +3 -2
- package/build/cjs/components/Tabs/Tabs.d.ts +40 -30
- package/build/cjs/components/Textarea/Textarea.js +4 -3
- package/build/cjs/components/Tooltip/Tooltip.d.ts +37 -30
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
- package/build/cjs/components/index.d.ts +4 -1
- package/build/cjs/hooks/useElementDimensions.d.ts +5 -0
- package/build/cjs/hooks/useElementDimensions.js +37 -0
- package/build/cjs/index.js +6 -0
- package/build/cjs/themes/globalStyles.d.ts +174 -60
- package/build/cjs/themes/globalStyles.js +132 -142
- package/build/cjs/themes/styled.d.ts +259 -210
- package/build/cjs/themes/theme.d.ts +37 -30
- package/build/cjs/themes/themeComponents/buttons.d.ts +1 -6
- package/build/cjs/themes/themeComponents/buttons.js +1 -6
- package/build/cjs/themes/themeComponents/fontFamily.d.ts +3 -1
- package/build/cjs/themes/themeComponents/fontFamily.js +3 -1
- package/build/cjs/themes/themeComponents/fontSize.d.ts +18 -15
- package/build/cjs/themes/themeComponents/fontSize.js +20 -14
- package/build/cjs/themes/themeComponents/lineHeight.d.ts +19 -12
- package/build/cjs/themes/themeComponents/lineHeight.js +21 -11
- package/build/es/components/Accordion/Accordion.d.ts +50 -0
- package/build/es/components/Accordion/Accordion.js +44 -0
- package/build/es/components/Accordion/AccordionItem.d.ts +30 -0
- package/build/es/components/Accordion/AccordionItem.js +68 -0
- package/build/es/components/AmountSelector/AmountSelector.js +5 -6
- package/build/es/components/Buttons/ButtonBasicStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonBasicStyles.js +10 -14
- package/build/es/components/Buttons/ButtonDefault.js +6 -2
- package/build/es/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonIconStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonPrimary.js +6 -2
- package/build/es/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonSecondary.js +7 -3
- package/build/es/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonTertiary.js +7 -3
- package/build/es/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/CloseButton.d.ts +37 -30
- package/build/es/components/Card/Card.js +4 -2
- package/build/es/components/Card/CardRow.js +3 -3
- package/build/es/components/Checkbox/Checkbox.d.ts +38 -12
- package/build/es/components/Checkbox/Checkbox.js +39 -72
- package/build/es/components/DnaLogo/DnaLogo.d.ts +37 -40
- package/build/es/components/Footer/Components/FooterComponents.js +3 -2
- package/build/es/components/Helper/Helper.js +2 -1
- package/build/es/components/Icon/Icon.d.ts +39 -30
- package/build/es/components/Icon/Icons.d.ts +1 -4
- package/build/es/components/Icon/Icons.js +3 -7
- package/build/es/components/Input/Input.d.ts +102 -13
- package/build/es/components/Input/Input.js +57 -58
- package/build/es/components/Label/Label.js +2 -3
- package/build/es/components/LabelText/LabelText.d.ts +38 -30
- package/build/es/components/LabelText/LabelText.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +4 -10
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +18 -12
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
- package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
- package/build/es/components/MainNavigation/ChildComponents/LinkModifier.js +2 -2
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -5
- package/build/es/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
- package/build/es/components/MainNavigation/MainNavigation.js +2 -17
- package/build/es/components/MainNavigation/globalNavStyles.d.ts +148 -120
- package/build/es/components/Notification/Notification.d.ts +36 -17
- package/build/es/components/Notification/Notification.js +25 -48
- package/build/es/components/NotificationBadge/NotificationBadge.d.ts +37 -30
- package/build/es/components/NotificationBadge/NotificationBadge.js +1 -1
- package/build/es/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
- package/build/es/components/ProgressIndicator/ProgressIndicator.js +3 -3
- package/build/es/components/RadioButton/RadioButton.d.ts +33 -17
- package/build/es/components/RadioButton/RadioButton.js +12 -57
- package/build/es/components/ReadMore/ReadMore.js +2 -7
- package/build/es/components/Ribbon/Ribbon.d.ts +57 -0
- package/build/es/components/Ribbon/Ribbon.js +71 -0
- package/build/es/components/Search/Search.js +2 -1
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
- package/build/es/components/Selectbox/Selectbox.d.ts +102 -13
- package/build/es/components/Selectbox/Selectbox.js +40 -49
- package/build/es/components/Tabs/Tab.d.ts +37 -30
- package/build/es/components/Tabs/Tab.js +3 -2
- package/build/es/components/Tabs/Tabs.d.ts +40 -30
- package/build/es/components/Textarea/Textarea.js +4 -3
- package/build/es/components/Tooltip/Tooltip.d.ts +37 -30
- package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
- package/build/es/components/index.d.ts +4 -1
- package/build/es/hooks/useElementDimensions.d.ts +5 -0
- package/build/es/hooks/useElementDimensions.js +33 -0
- package/build/es/index.js +3 -0
- package/build/es/themes/globalStyles.d.ts +174 -60
- package/build/es/themes/globalStyles.js +134 -145
- package/build/es/themes/styled.d.ts +259 -210
- package/build/es/themes/theme.d.ts +37 -30
- package/build/es/themes/themeComponents/buttons.d.ts +1 -6
- package/build/es/themes/themeComponents/buttons.js +1 -6
- package/build/es/themes/themeComponents/fontFamily.d.ts +3 -1
- package/build/es/themes/themeComponents/fontFamily.js +3 -1
- package/build/es/themes/themeComponents/fontSize.d.ts +18 -15
- package/build/es/themes/themeComponents/fontSize.js +20 -14
- package/build/es/themes/themeComponents/lineHeight.d.ts +19 -12
- package/build/es/themes/themeComponents/lineHeight.js +21 -11
- package/package.json +3 -4
|
@@ -11,12 +11,7 @@ declare const ButtonPrimaryStyles: import("styled-components").StyledComponent<"
|
|
|
11
11
|
};
|
|
12
12
|
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
13
13
|
button: {
|
|
14
|
-
|
|
15
|
-
buttonPadding: string;
|
|
16
|
-
smallButtonPadding: string;
|
|
17
|
-
buttonLineHeight: string;
|
|
18
|
-
buttonWidth: string;
|
|
19
|
-
buttonSmallWidth: string;
|
|
14
|
+
border: string;
|
|
20
15
|
};
|
|
21
16
|
color: {
|
|
22
17
|
black: string;
|
|
@@ -47,22 +42,27 @@ declare const ButtonPrimaryStyles: import("styled-components").StyledComponent<"
|
|
|
47
42
|
gray5: string;
|
|
48
43
|
};
|
|
49
44
|
fontFamily: {
|
|
50
|
-
|
|
45
|
+
default: string;
|
|
46
|
+
heading: string;
|
|
47
|
+
numerals: string;
|
|
51
48
|
};
|
|
52
49
|
fontSize: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
default: string;
|
|
51
|
+
xl: string;
|
|
52
|
+
l: string;
|
|
53
|
+
s: string;
|
|
54
|
+
xs: string;
|
|
55
|
+
h1XL: string;
|
|
56
|
+
h1L: string;
|
|
57
|
+
h1M: string;
|
|
58
|
+
h1S: string;
|
|
59
|
+
h2M: string;
|
|
60
|
+
h2S: string;
|
|
61
|
+
h3: string;
|
|
62
|
+
h4: string;
|
|
63
|
+
h5: string;
|
|
64
|
+
h1: string;
|
|
65
|
+
h2: string;
|
|
66
66
|
};
|
|
67
67
|
fontWeight: {
|
|
68
68
|
book: number;
|
|
@@ -78,16 +78,23 @@ declare const ButtonPrimaryStyles: import("styled-components").StyledComponent<"
|
|
|
78
78
|
gutter: string;
|
|
79
79
|
};
|
|
80
80
|
lineHeight: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
default: string;
|
|
82
|
+
xl: string;
|
|
83
|
+
s: string;
|
|
84
|
+
xs: string;
|
|
85
|
+
xxs: string;
|
|
86
|
+
auto: string;
|
|
87
|
+
h1XL: string;
|
|
88
|
+
h1L: string;
|
|
89
|
+
h1M: string;
|
|
90
|
+
h1S: string;
|
|
91
|
+
h2M: string;
|
|
92
|
+
h2S: string;
|
|
93
|
+
h3: string;
|
|
94
|
+
h4: string;
|
|
95
|
+
h5: string;
|
|
96
|
+
h1: string;
|
|
97
|
+
h2: string;
|
|
91
98
|
};
|
|
92
99
|
media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
|
|
93
100
|
}, import("./ButtonBasicStyles").ButtonProps, never>;
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
7
|
-
var PixelLoader = require('../PixelLoader/PixelLoader.js');
|
|
6
|
+
var styled = require('../../themes/styled.js');
|
|
8
7
|
var theme = require('../../themes/theme.js');
|
|
8
|
+
var PixelLoader = require('../PixelLoader/PixelLoader.js');
|
|
9
|
+
var ButtonSecondaryStyles = require('./ButtonSecondaryStyles.js');
|
|
9
10
|
|
|
10
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
12
|
|
|
12
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
14
|
|
|
14
15
|
const noop = () => { }; // tslint:disable-line
|
|
16
|
+
const StyledPixelLoader = styled['default'](PixelLoader.PixelLoader) `
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
`;
|
|
15
19
|
/** @visibleName Button secondary */
|
|
16
20
|
const ButtonSecondary = (props) => {
|
|
17
21
|
const { children, className, fullWidth, small, loading = false, darkBg, onClick, onMouseDown, disabled = false, 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue, type, } = props;
|
|
@@ -21,7 +25,7 @@ const ButtonSecondary = (props) => {
|
|
|
21
25
|
// https://github.com/styled-components/styled-components/pull/2093
|
|
22
26
|
loading: loading ? loading.toString() : undefined, darkBg: darkBg, disabled: disabled, onClick: !disabled || !loading ? onClick : noop, onMouseDown: (!disabled || !loading) && onMouseDown ? onMouseDown : noop, className: className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue, type: type },
|
|
23
27
|
!loading && (React__default['default'].createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, children)),
|
|
24
|
-
loading && React__default['default'].createElement(
|
|
28
|
+
loading && (React__default['default'].createElement(StyledPixelLoader, { color: darkBg ? theme['default'].color.white : theme['default'].color.hotPink }))));
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
exports.default = ButtonSecondary;
|
|
@@ -11,12 +11,7 @@ declare const ButtonSecondaryStyles: import("styled-components").StyledComponent
|
|
|
11
11
|
};
|
|
12
12
|
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
13
13
|
button: {
|
|
14
|
-
|
|
15
|
-
buttonPadding: string;
|
|
16
|
-
smallButtonPadding: string;
|
|
17
|
-
buttonLineHeight: string;
|
|
18
|
-
buttonWidth: string;
|
|
19
|
-
buttonSmallWidth: string;
|
|
14
|
+
border: string;
|
|
20
15
|
};
|
|
21
16
|
color: {
|
|
22
17
|
black: string;
|
|
@@ -47,22 +42,27 @@ declare const ButtonSecondaryStyles: import("styled-components").StyledComponent
|
|
|
47
42
|
gray5: string;
|
|
48
43
|
};
|
|
49
44
|
fontFamily: {
|
|
50
|
-
|
|
45
|
+
default: string;
|
|
46
|
+
heading: string;
|
|
47
|
+
numerals: string;
|
|
51
48
|
};
|
|
52
49
|
fontSize: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
default: string;
|
|
51
|
+
xl: string;
|
|
52
|
+
l: string;
|
|
53
|
+
s: string;
|
|
54
|
+
xs: string;
|
|
55
|
+
h1XL: string;
|
|
56
|
+
h1L: string;
|
|
57
|
+
h1M: string;
|
|
58
|
+
h1S: string;
|
|
59
|
+
h2M: string;
|
|
60
|
+
h2S: string;
|
|
61
|
+
h3: string;
|
|
62
|
+
h4: string;
|
|
63
|
+
h5: string;
|
|
64
|
+
h1: string;
|
|
65
|
+
h2: string;
|
|
66
66
|
};
|
|
67
67
|
fontWeight: {
|
|
68
68
|
book: number;
|
|
@@ -78,16 +78,23 @@ declare const ButtonSecondaryStyles: import("styled-components").StyledComponent
|
|
|
78
78
|
gutter: string;
|
|
79
79
|
};
|
|
80
80
|
lineHeight: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
default: string;
|
|
82
|
+
xl: string;
|
|
83
|
+
s: string;
|
|
84
|
+
xs: string;
|
|
85
|
+
xxs: string;
|
|
86
|
+
auto: string;
|
|
87
|
+
h1XL: string;
|
|
88
|
+
h1L: string;
|
|
89
|
+
h1M: string;
|
|
90
|
+
h1S: string;
|
|
91
|
+
h2M: string;
|
|
92
|
+
h2S: string;
|
|
93
|
+
h3: string;
|
|
94
|
+
h4: string;
|
|
95
|
+
h5: string;
|
|
96
|
+
h1: string;
|
|
97
|
+
h2: string;
|
|
91
98
|
};
|
|
92
99
|
media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
|
|
93
100
|
}, import("./ButtonBasicStyles").ButtonProps, never>;
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
7
|
-
var PixelLoader = require('../PixelLoader/PixelLoader.js');
|
|
6
|
+
var styled = require('../../themes/styled.js');
|
|
8
7
|
var theme = require('../../themes/theme.js');
|
|
8
|
+
var PixelLoader = require('../PixelLoader/PixelLoader.js');
|
|
9
|
+
var ButtonTertiaryStyles = require('./ButtonTertiaryStyles.js');
|
|
9
10
|
|
|
10
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
12
|
|
|
12
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
14
|
|
|
14
15
|
const noop = () => { }; // tslint:disable-line
|
|
16
|
+
const StyledPixelLoader = styled['default'](PixelLoader.PixelLoader) `
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
`;
|
|
15
19
|
/** @visibleName Button tertiary */
|
|
16
20
|
const ButtonTertiary = (props) => {
|
|
17
21
|
const { children, className, fullWidth, small, loading = false, darkBg, onClick, onMouseDown, disabled = false, 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue, type, } = props;
|
|
@@ -21,7 +25,7 @@ const ButtonTertiary = (props) => {
|
|
|
21
25
|
// https://github.com/styled-components/styled-components/pull/2093
|
|
22
26
|
loading: loading ? loading.toString() : undefined, darkBg: darkBg, disabled: disabled, onClick: !disabled || !loading ? onClick : noop, onMouseDown: (!disabled || !loading) && onMouseDown ? onMouseDown : noop, className: className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue, type: type },
|
|
23
27
|
!loading && (React__default['default'].createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, children)),
|
|
24
|
-
loading && React__default['default'].createElement(
|
|
28
|
+
loading && (React__default['default'].createElement(StyledPixelLoader, { color: darkBg ? theme['default'].color.black : theme['default'].color.white }))));
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
exports.default = ButtonTertiary;
|
|
@@ -11,12 +11,7 @@ declare const ButtonTertiaryStyles: import("styled-components").StyledComponent<
|
|
|
11
11
|
};
|
|
12
12
|
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
13
13
|
button: {
|
|
14
|
-
|
|
15
|
-
buttonPadding: string;
|
|
16
|
-
smallButtonPadding: string;
|
|
17
|
-
buttonLineHeight: string;
|
|
18
|
-
buttonWidth: string;
|
|
19
|
-
buttonSmallWidth: string;
|
|
14
|
+
border: string;
|
|
20
15
|
};
|
|
21
16
|
color: {
|
|
22
17
|
black: string;
|
|
@@ -47,22 +42,27 @@ declare const ButtonTertiaryStyles: import("styled-components").StyledComponent<
|
|
|
47
42
|
gray5: string;
|
|
48
43
|
};
|
|
49
44
|
fontFamily: {
|
|
50
|
-
|
|
45
|
+
default: string;
|
|
46
|
+
heading: string;
|
|
47
|
+
numerals: string;
|
|
51
48
|
};
|
|
52
49
|
fontSize: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
default: string;
|
|
51
|
+
xl: string;
|
|
52
|
+
l: string;
|
|
53
|
+
s: string;
|
|
54
|
+
xs: string;
|
|
55
|
+
h1XL: string;
|
|
56
|
+
h1L: string;
|
|
57
|
+
h1M: string;
|
|
58
|
+
h1S: string;
|
|
59
|
+
h2M: string;
|
|
60
|
+
h2S: string;
|
|
61
|
+
h3: string;
|
|
62
|
+
h4: string;
|
|
63
|
+
h5: string;
|
|
64
|
+
h1: string;
|
|
65
|
+
h2: string;
|
|
66
66
|
};
|
|
67
67
|
fontWeight: {
|
|
68
68
|
book: number;
|
|
@@ -78,16 +78,23 @@ declare const ButtonTertiaryStyles: import("styled-components").StyledComponent<
|
|
|
78
78
|
gutter: string;
|
|
79
79
|
};
|
|
80
80
|
lineHeight: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
default: string;
|
|
82
|
+
xl: string;
|
|
83
|
+
s: string;
|
|
84
|
+
xs: string;
|
|
85
|
+
xxs: string;
|
|
86
|
+
auto: string;
|
|
87
|
+
h1XL: string;
|
|
88
|
+
h1L: string;
|
|
89
|
+
h1M: string;
|
|
90
|
+
h1S: string;
|
|
91
|
+
h2M: string;
|
|
92
|
+
h2S: string;
|
|
93
|
+
h3: string;
|
|
94
|
+
h4: string;
|
|
95
|
+
h5: string;
|
|
96
|
+
h1: string;
|
|
97
|
+
h2: string;
|
|
91
98
|
};
|
|
92
99
|
media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
|
|
93
100
|
}, import("./ButtonBasicStyles").ButtonProps, never>;
|
|
@@ -11,12 +11,7 @@ declare const CloseButton: import("styled-components").StyledComponent<"a", {
|
|
|
11
11
|
};
|
|
12
12
|
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
13
13
|
button: {
|
|
14
|
-
|
|
15
|
-
buttonPadding: string;
|
|
16
|
-
smallButtonPadding: string;
|
|
17
|
-
buttonLineHeight: string;
|
|
18
|
-
buttonWidth: string;
|
|
19
|
-
buttonSmallWidth: string;
|
|
14
|
+
border: string;
|
|
20
15
|
};
|
|
21
16
|
color: {
|
|
22
17
|
black: string;
|
|
@@ -47,22 +42,27 @@ declare const CloseButton: import("styled-components").StyledComponent<"a", {
|
|
|
47
42
|
gray5: string;
|
|
48
43
|
};
|
|
49
44
|
fontFamily: {
|
|
50
|
-
|
|
45
|
+
default: string;
|
|
46
|
+
heading: string;
|
|
47
|
+
numerals: string;
|
|
51
48
|
};
|
|
52
49
|
fontSize: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
default: string;
|
|
51
|
+
xl: string;
|
|
52
|
+
l: string;
|
|
53
|
+
s: string;
|
|
54
|
+
xs: string;
|
|
55
|
+
h1XL: string;
|
|
56
|
+
h1L: string;
|
|
57
|
+
h1M: string;
|
|
58
|
+
h1S: string;
|
|
59
|
+
h2M: string;
|
|
60
|
+
h2S: string;
|
|
61
|
+
h3: string;
|
|
62
|
+
h4: string;
|
|
63
|
+
h5: string;
|
|
64
|
+
h1: string;
|
|
65
|
+
h2: string;
|
|
66
66
|
};
|
|
67
67
|
fontWeight: {
|
|
68
68
|
book: number;
|
|
@@ -78,16 +78,23 @@ declare const CloseButton: import("styled-components").StyledComponent<"a", {
|
|
|
78
78
|
gutter: string;
|
|
79
79
|
};
|
|
80
80
|
lineHeight: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
default: string;
|
|
82
|
+
xl: string;
|
|
83
|
+
s: string;
|
|
84
|
+
xs: string;
|
|
85
|
+
xxs: string;
|
|
86
|
+
auto: string;
|
|
87
|
+
h1XL: string;
|
|
88
|
+
h1L: string;
|
|
89
|
+
h1M: string;
|
|
90
|
+
h1S: string;
|
|
91
|
+
h2M: string;
|
|
92
|
+
h2S: string;
|
|
93
|
+
h3: string;
|
|
94
|
+
h4: string;
|
|
95
|
+
h5: string;
|
|
96
|
+
h1: string;
|
|
97
|
+
h2: string;
|
|
91
98
|
};
|
|
92
99
|
media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
|
|
93
100
|
}, {}, never>;
|
|
@@ -36,7 +36,8 @@ const CardContainer = styled['default'].div `
|
|
|
36
36
|
const CardTitle = styled['default'].h3 `
|
|
37
37
|
margin: 0;
|
|
38
38
|
color: ${theme['default'].color.gray55};
|
|
39
|
-
font-size: ${theme['default'].fontSize.
|
|
39
|
+
font-size: ${theme['default'].fontSize.s};
|
|
40
|
+
line-height: ${theme['default'].lineHeight.s};
|
|
40
41
|
font-weight: ${theme['default'].fontWeight.book};
|
|
41
42
|
background: ${theme['default'].color.gray5};
|
|
42
43
|
padding: 0.75rem 0 0.25rem 0;
|
|
@@ -46,7 +47,8 @@ const CardTitle = styled['default'].h3 `
|
|
|
46
47
|
${styledUtils.media.md `
|
|
47
48
|
background: ${theme['default'].color.white};
|
|
48
49
|
padding: 1rem 1.875rem;
|
|
49
|
-
font-size: ${theme['default'].fontSize.
|
|
50
|
+
font-size: ${theme['default'].fontSize.l};
|
|
51
|
+
line-height: ${theme['default'].lineHeight.default};
|
|
50
52
|
text-transform: none;
|
|
51
53
|
text-align: center;
|
|
52
54
|
font-weight: ${theme['default'].fontWeight.bold};
|
|
@@ -27,7 +27,7 @@ const CardElement = styled['default'].div `
|
|
|
27
27
|
}
|
|
28
28
|
`;
|
|
29
29
|
const CardContent = styled['default'].div `
|
|
30
|
-
font-size: ${theme['default'].fontSize.
|
|
30
|
+
font-size: ${theme['default'].fontSize.default};
|
|
31
31
|
font-weight: ${theme['default'].fontWeight.medium};
|
|
32
32
|
margin: 0;
|
|
33
33
|
flex-grow: 1;
|
|
@@ -35,11 +35,11 @@ const CardContent = styled['default'].div `
|
|
|
35
35
|
h5 {
|
|
36
36
|
word-break: break-word;
|
|
37
37
|
margin: 0;
|
|
38
|
-
line-height:
|
|
38
|
+
line-height: ${theme['default'].lineHeight.s};
|
|
39
39
|
padding-right: 1.5rem;
|
|
40
40
|
}
|
|
41
41
|
h5 {
|
|
42
|
-
font-size: ${theme['default'].fontSize.
|
|
42
|
+
font-size: ${theme['default'].fontSize.s};
|
|
43
43
|
font-weight: ${theme['default'].fontWeight.book};
|
|
44
44
|
}
|
|
45
45
|
`;
|
|
@@ -1,28 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Unique ID for the input element
|
|
5
|
+
*/
|
|
4
6
|
id: string;
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Default value of input element
|
|
9
|
+
*
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
8
12
|
value?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Text of the label shown next to checkbox
|
|
15
|
+
*/
|
|
12
16
|
label: string;
|
|
13
|
-
/** Is input disabled */
|
|
14
17
|
/**
|
|
18
|
+
* On checkbox change callback
|
|
19
|
+
*/
|
|
20
|
+
onChange?: (value: boolean) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Allows to disable the checkbox
|
|
23
|
+
*
|
|
15
24
|
* @default false
|
|
16
25
|
*/
|
|
17
26
|
disabled?: boolean;
|
|
18
27
|
/**
|
|
28
|
+
* Allows to set checkbox as mandatory
|
|
29
|
+
*
|
|
19
30
|
* @default false
|
|
20
31
|
*/
|
|
21
|
-
error?: boolean;
|
|
22
32
|
required?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Allows to set checkbox to error state
|
|
35
|
+
*
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
error?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Text of the error message when checkbox is in error state
|
|
41
|
+
*/
|
|
23
42
|
errorMessage?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Allows to pass a custom className
|
|
45
|
+
*/
|
|
46
|
+
className?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Allows to pass testid string for testing purposes
|
|
49
|
+
*/
|
|
24
50
|
'data-testid'?: string;
|
|
25
51
|
}
|
|
26
|
-
declare const Checkbox:
|
|
52
|
+
declare const Checkbox: ({ "data-testid": dataTestId, ...props }: Props) => JSX.Element;
|
|
27
53
|
/** @component */
|
|
28
54
|
export default Checkbox;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var globalStyles = require('../../themes/globalStyles.js');
|
|
6
7
|
var styled = require('../../themes/styled.js');
|
|
7
8
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
8
9
|
|
|
@@ -10,88 +11,54 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
11
|
|
|
11
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
`;
|
|
27
|
-
const Input = styled['default']('input') `
|
|
28
|
-
position: absolute;
|
|
29
|
-
left: -9999rem;
|
|
30
|
-
:checked + label::after {
|
|
31
|
-
content: '✓';
|
|
32
|
-
display: block;
|
|
33
|
-
position: absolute;
|
|
34
|
-
left: 2px;
|
|
35
|
-
top: 0;
|
|
36
|
-
font-weight: ${props => props.theme.fontWeight.bold};
|
|
37
|
-
color: ${props => props.theme.color.white};
|
|
38
|
-
animation: ${toggleCheckboxAnimation} 0.2s ease forwards;
|
|
39
|
-
}
|
|
40
|
-
:checked + label::before {
|
|
41
|
-
border-color: ${props => props && props.disabled ? props.theme.color.pink2 : props.theme.color.hotPink};
|
|
42
|
-
background-color: ${props => props && props.disabled ? props.theme.color.pink2 : props.theme.color.hotPink};
|
|
43
|
-
}
|
|
44
|
-
:disabled {
|
|
45
|
-
pointer-events: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
:disabled + label {
|
|
49
|
-
cursor: not-allowed;
|
|
50
|
-
color: ${props => props.theme.color.gray15};
|
|
51
|
-
}
|
|
14
|
+
// TODO: Implement proper svg icon after https://jira.dna.fi/browse/STYLE-238 is done
|
|
15
|
+
const SVGIconData = () => {
|
|
16
|
+
const svg = `
|
|
17
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="1em" height="1em">
|
|
18
|
+
<path d="M9.57 19.44L3.19 13a.6.6 0 0 1 .81-.84l5.53 5.58 11-10.93a.6.6 0 0 1 .84.85z" />
|
|
19
|
+
</svg>
|
|
20
|
+
`;
|
|
21
|
+
return `data:image/svg+xml,${svg}`;
|
|
22
|
+
};
|
|
23
|
+
const Container = styled['default'].div `
|
|
24
|
+
font-size: ${props => props.theme.fontSize.default};
|
|
25
|
+
line-height: ${props => props.theme.lineHeight.default};
|
|
26
|
+
margin-bottom: ${props => styledUtils.getMultipliedSize(props.theme.base.baseHeight, 0.5)};
|
|
52
27
|
`;
|
|
53
|
-
const
|
|
28
|
+
const Input = styled['default'](globalStyles.CheckboxInput_RadioInput) `
|
|
54
29
|
position: relative;
|
|
55
|
-
|
|
56
|
-
display: inline-block;
|
|
57
|
-
margin-bottom: ${props => styledUtils.getMultipliedSize(props.theme.base.baseHeight, 0.5)};
|
|
58
|
-
padding-left: ${props => styledUtils.getMultipliedSize(props.theme.base.baseWidth, 3)};
|
|
59
|
-
line-height: ${props => styledUtils.getMultipliedSize(props.theme.base.baseHeight, 2)};
|
|
60
|
-
color: ${props => props.theme.color.text};
|
|
30
|
+
top: ${props => styledUtils.getDividedSize(props.theme.base.baseWidth, 5)};
|
|
61
31
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
left: 0;
|
|
69
|
-
width: ${props => styledUtils.getMultipliedSize(props.theme.base.baseWidth, 2)};
|
|
70
|
-
height: ${props => styledUtils.getMultipliedSize(props.theme.base.baseHeight, 2)};
|
|
71
|
-
border: solid 2px ${props => props.theme.color.gray25};
|
|
32
|
+
&:checked {
|
|
33
|
+
&::before {
|
|
34
|
+
width: 1em;
|
|
35
|
+
height: 1em;
|
|
36
|
+
background-image: url('${SVGIconData}');
|
|
37
|
+
}
|
|
72
38
|
}
|
|
73
39
|
`;
|
|
40
|
+
const Mandatory = styled['default'].span `
|
|
41
|
+
color: ${props => props.theme.color.hotPink};
|
|
42
|
+
margin-left: ${props => styledUtils.getMultipliedSize(props.theme.base.baseHeight, 0.5)};
|
|
43
|
+
`;
|
|
74
44
|
const ErrorMessage = styled['default'].div `
|
|
75
|
-
|
|
76
|
-
|
|
45
|
+
font-size: ${props => props.theme.fontSize.s};
|
|
46
|
+
line-height: ${props => props.theme.lineHeight.s};
|
|
77
47
|
color: ${props => props.theme.color.error};
|
|
78
48
|
margin-top: ${props => styledUtils.getMultipliedSize(props.theme.base.baseHeight, 1)};
|
|
79
49
|
`;
|
|
80
|
-
const
|
|
81
|
-
color: ${props => props.theme.color.hotPink};
|
|
82
|
-
`;
|
|
83
|
-
const Checkbox = ({ id, value, onChange, label, disabled, error, errorMessage, className, required, 'data-testid': dataTestId, }) => {
|
|
50
|
+
const Checkbox = ({ 'data-testid': dataTestId, ...props }) => {
|
|
84
51
|
const handleChange = () => {
|
|
85
|
-
if (onChange && !disabled) {
|
|
86
|
-
onChange(!value);
|
|
52
|
+
if (props.onChange && !props.disabled) {
|
|
53
|
+
props.onChange(!props.value);
|
|
87
54
|
}
|
|
88
55
|
};
|
|
89
|
-
return (React__default['default'].createElement(
|
|
90
|
-
React__default['default'].createElement(Input, { id: id, className: className, type: "checkbox", checked: Boolean(value), onChange: handleChange, disabled: disabled, "data-testid": dataTestId }),
|
|
91
|
-
React__default['default'].createElement(
|
|
92
|
-
label,
|
|
93
|
-
required && React__default['default'].createElement(Mandatory, null, "
|
|
94
|
-
error && errorMessage && (React__default['default'].createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, errorMessage))));
|
|
56
|
+
return (React__default['default'].createElement(Container, null,
|
|
57
|
+
React__default['default'].createElement(Input, { id: props.id, className: props.className, type: "checkbox", checked: Boolean(props.value), onChange: handleChange, disabled: props.disabled, "data-testid": dataTestId }),
|
|
58
|
+
React__default['default'].createElement("label", { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label` },
|
|
59
|
+
props.label,
|
|
60
|
+
props.required && React__default['default'].createElement(Mandatory, null, "*")),
|
|
61
|
+
props.error && props.errorMessage && (React__default['default'].createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
95
62
|
};
|
|
96
63
|
|
|
97
64
|
exports.default = Checkbox;
|