@dnanpm/styleguide 1.9.0 → 2.0.0

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.
Files changed (155) hide show
  1. package/build/cjs/components/Accordion/Accordion.d.ts +27 -15
  2. package/build/cjs/components/Accordion/Accordion.js +29 -12
  3. package/build/cjs/components/Accordion/AccordionItem.d.ts +14 -29
  4. package/build/cjs/components/Accordion/AccordionItem.js +29 -52
  5. package/build/cjs/components/AmountSelector/AmountSelector.js +3 -4
  6. package/build/cjs/components/Buttons/ButtonBasicStyles.d.ts +37 -30
  7. package/build/cjs/components/Buttons/ButtonBasicStyles.js +10 -14
  8. package/build/cjs/components/Buttons/ButtonDefault.js +6 -2
  9. package/build/cjs/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
  10. package/build/cjs/components/Buttons/ButtonIconStyles.d.ts +37 -30
  11. package/build/cjs/components/Buttons/ButtonPrimary.js +6 -2
  12. package/build/cjs/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
  13. package/build/cjs/components/Buttons/ButtonSecondary.js +7 -3
  14. package/build/cjs/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
  15. package/build/cjs/components/Buttons/ButtonTertiary.js +7 -3
  16. package/build/cjs/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
  17. package/build/cjs/components/Buttons/CloseButton.d.ts +37 -30
  18. package/build/cjs/components/Card/Card.js +4 -2
  19. package/build/cjs/components/Card/CardRow.js +3 -3
  20. package/build/cjs/components/Checkbox/Checkbox.d.ts +38 -12
  21. package/build/cjs/components/Checkbox/Checkbox.js +37 -70
  22. package/build/cjs/components/DnaLogo/DnaLogo.d.ts +37 -40
  23. package/build/cjs/components/Footer/Components/FooterComponents.js +3 -2
  24. package/build/cjs/components/Helper/Helper.js +2 -1
  25. package/build/cjs/components/Icon/Icon.d.ts +39 -30
  26. package/build/cjs/components/Icon/Icons.d.ts +1 -4
  27. package/build/cjs/components/Icon/Icons.js +3 -7
  28. package/build/cjs/components/Input/Input.d.ts +102 -13
  29. package/build/cjs/components/Input/Input.js +57 -58
  30. package/build/cjs/components/Label/Label.js +2 -3
  31. package/build/cjs/components/LabelText/LabelText.d.ts +38 -30
  32. package/build/cjs/components/LabelText/LabelText.js +1 -1
  33. package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +1 -1
  34. package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +10 -4
  35. package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
  36. package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
  37. package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
  38. package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +1 -4
  39. package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
  40. package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
  41. package/build/cjs/components/MainNavigation/MainNavigation.js +1 -1
  42. package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +148 -120
  43. package/build/cjs/components/Notification/Notification.d.ts +1 -5
  44. package/build/cjs/components/Notification/Notification.js +1 -4
  45. package/build/cjs/components/NotificationBadge/NotificationBadge.d.ts +37 -30
  46. package/build/cjs/components/NotificationBadge/NotificationBadge.js +1 -1
  47. package/build/cjs/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
  48. package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +3 -3
  49. package/build/cjs/components/RadioButton/RadioButton.d.ts +33 -17
  50. package/build/cjs/components/RadioButton/RadioButton.js +12 -57
  51. package/build/cjs/components/ReadMore/ReadMore.js +2 -7
  52. package/build/cjs/components/Ribbon/Ribbon.js +2 -2
  53. package/build/cjs/components/Search/Search.js +2 -1
  54. package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
  55. package/build/cjs/components/Selectbox/Selectbox.d.ts +102 -13
  56. package/build/cjs/components/Selectbox/Selectbox.js +40 -49
  57. package/build/cjs/components/Tabs/Tab.d.ts +37 -30
  58. package/build/cjs/components/Tabs/Tab.js +3 -2
  59. package/build/cjs/components/Tabs/Tabs.d.ts +40 -30
  60. package/build/cjs/components/Textarea/Textarea.js +4 -3
  61. package/build/cjs/components/Tooltip/Tooltip.d.ts +37 -30
  62. package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
  63. package/build/cjs/components/index.d.ts +3 -2
  64. package/build/cjs/index.js +2 -2
  65. package/build/cjs/themes/globalStyles.d.ts +174 -60
  66. package/build/cjs/themes/globalStyles.js +132 -142
  67. package/build/cjs/themes/styled.d.ts +259 -210
  68. package/build/cjs/themes/theme.d.ts +37 -30
  69. package/build/cjs/themes/themeComponents/buttons.d.ts +1 -6
  70. package/build/cjs/themes/themeComponents/buttons.js +1 -6
  71. package/build/cjs/themes/themeComponents/fontFamily.d.ts +3 -1
  72. package/build/cjs/themes/themeComponents/fontFamily.js +3 -1
  73. package/build/cjs/themes/themeComponents/fontSize.d.ts +18 -15
  74. package/build/cjs/themes/themeComponents/fontSize.js +20 -14
  75. package/build/cjs/themes/themeComponents/lineHeight.d.ts +19 -12
  76. package/build/cjs/themes/themeComponents/lineHeight.js +21 -11
  77. package/build/es/components/Accordion/Accordion.d.ts +27 -15
  78. package/build/es/components/Accordion/Accordion.js +29 -12
  79. package/build/es/components/Accordion/AccordionItem.d.ts +14 -29
  80. package/build/es/components/Accordion/AccordionItem.js +31 -54
  81. package/build/es/components/AmountSelector/AmountSelector.js +3 -4
  82. package/build/es/components/Buttons/ButtonBasicStyles.d.ts +37 -30
  83. package/build/es/components/Buttons/ButtonBasicStyles.js +10 -14
  84. package/build/es/components/Buttons/ButtonDefault.js +6 -2
  85. package/build/es/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
  86. package/build/es/components/Buttons/ButtonIconStyles.d.ts +37 -30
  87. package/build/es/components/Buttons/ButtonPrimary.js +6 -2
  88. package/build/es/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
  89. package/build/es/components/Buttons/ButtonSecondary.js +7 -3
  90. package/build/es/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
  91. package/build/es/components/Buttons/ButtonTertiary.js +7 -3
  92. package/build/es/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
  93. package/build/es/components/Buttons/CloseButton.d.ts +37 -30
  94. package/build/es/components/Card/Card.js +4 -2
  95. package/build/es/components/Card/CardRow.js +3 -3
  96. package/build/es/components/Checkbox/Checkbox.d.ts +38 -12
  97. package/build/es/components/Checkbox/Checkbox.js +39 -72
  98. package/build/es/components/DnaLogo/DnaLogo.d.ts +37 -40
  99. package/build/es/components/Footer/Components/FooterComponents.js +3 -2
  100. package/build/es/components/Helper/Helper.js +2 -1
  101. package/build/es/components/Icon/Icon.d.ts +39 -30
  102. package/build/es/components/Icon/Icons.d.ts +1 -4
  103. package/build/es/components/Icon/Icons.js +3 -7
  104. package/build/es/components/Input/Input.d.ts +102 -13
  105. package/build/es/components/Input/Input.js +57 -58
  106. package/build/es/components/Label/Label.js +2 -3
  107. package/build/es/components/LabelText/LabelText.d.ts +38 -30
  108. package/build/es/components/LabelText/LabelText.js +1 -1
  109. package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +1 -1
  110. package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +10 -4
  111. package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
  112. package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
  113. package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
  114. package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -5
  115. package/build/es/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
  116. package/build/es/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
  117. package/build/es/components/MainNavigation/MainNavigation.js +1 -1
  118. package/build/es/components/MainNavigation/globalNavStyles.d.ts +148 -120
  119. package/build/es/components/Notification/Notification.d.ts +1 -5
  120. package/build/es/components/Notification/Notification.js +1 -4
  121. package/build/es/components/NotificationBadge/NotificationBadge.d.ts +37 -30
  122. package/build/es/components/NotificationBadge/NotificationBadge.js +1 -1
  123. package/build/es/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
  124. package/build/es/components/ProgressIndicator/ProgressIndicator.js +3 -3
  125. package/build/es/components/RadioButton/RadioButton.d.ts +33 -17
  126. package/build/es/components/RadioButton/RadioButton.js +12 -57
  127. package/build/es/components/ReadMore/ReadMore.js +2 -7
  128. package/build/es/components/Ribbon/Ribbon.js +2 -2
  129. package/build/es/components/Search/Search.js +2 -1
  130. package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
  131. package/build/es/components/Selectbox/Selectbox.d.ts +102 -13
  132. package/build/es/components/Selectbox/Selectbox.js +40 -49
  133. package/build/es/components/Tabs/Tab.d.ts +37 -30
  134. package/build/es/components/Tabs/Tab.js +3 -2
  135. package/build/es/components/Tabs/Tabs.d.ts +40 -30
  136. package/build/es/components/Textarea/Textarea.js +4 -3
  137. package/build/es/components/Tooltip/Tooltip.d.ts +37 -30
  138. package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
  139. package/build/es/components/index.d.ts +3 -2
  140. package/build/es/index.js +1 -1
  141. package/build/es/themes/globalStyles.d.ts +174 -60
  142. package/build/es/themes/globalStyles.js +134 -145
  143. package/build/es/themes/styled.d.ts +259 -210
  144. package/build/es/themes/theme.d.ts +37 -30
  145. package/build/es/themes/themeComponents/buttons.d.ts +1 -6
  146. package/build/es/themes/themeComponents/buttons.js +1 -6
  147. package/build/es/themes/themeComponents/fontFamily.d.ts +3 -1
  148. package/build/es/themes/themeComponents/fontFamily.js +3 -1
  149. package/build/es/themes/themeComponents/fontSize.d.ts +18 -15
  150. package/build/es/themes/themeComponents/fontSize.js +20 -14
  151. package/build/es/themes/themeComponents/lineHeight.d.ts +19 -12
  152. package/build/es/themes/themeComponents/lineHeight.js +21 -11
  153. package/package.json +2 -2
  154. package/build/cjs/components/Accordion/index.d.ts +0 -2
  155. package/build/es/components/Accordion/index.d.ts +0 -2
@@ -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
- buttonBorderWidth: string;
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
- baseFontFamily: string;
45
+ default: string;
46
+ heading: string;
47
+ numerals: string;
51
48
  };
52
49
  fontSize: {
53
- defaultFontSize: string;
54
- smallFontSize: string;
55
- extraSmallFontSize: string;
56
- xsFontSize: string;
57
- xxsFontSize: string;
58
- h1FontSize: string;
59
- h2FontSize: string;
60
- h2MobileFontSize: string;
61
- h3FontSize: string;
62
- h4FontSize: string;
63
- h5FontSize: string;
64
- heroBannerTitleFontSize: string;
65
- heroBannerTitleMobileFontSize: string;
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
- defaultLineHeight: string;
82
- paragraphLineHeight: string;
83
- heroBannerLineHeight: string;
84
- heroBannerMobileLineHeight: string;
85
- h1LineHeight: string;
86
- h2LineHeight: string;
87
- h2MobileLineHeight: string;
88
- h3LineHeight: string;
89
- h4LineHeight: string;
90
- h5LineHeight: string;
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
- buttonBorderWidth: string;
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
- baseFontFamily: string;
45
+ default: string;
46
+ heading: string;
47
+ numerals: string;
51
48
  };
52
49
  fontSize: {
53
- defaultFontSize: string;
54
- smallFontSize: string;
55
- extraSmallFontSize: string;
56
- xsFontSize: string;
57
- xxsFontSize: string;
58
- h1FontSize: string;
59
- h2FontSize: string;
60
- h2MobileFontSize: string;
61
- h3FontSize: string;
62
- h4FontSize: string;
63
- h5FontSize: string;
64
- heroBannerTitleFontSize: string;
65
- heroBannerTitleMobileFontSize: string;
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
- defaultLineHeight: string;
82
- paragraphLineHeight: string;
83
- heroBannerLineHeight: string;
84
- heroBannerMobileLineHeight: string;
85
- h1LineHeight: string;
86
- h2LineHeight: string;
87
- h2MobileLineHeight: string;
88
- h3LineHeight: string;
89
- h4LineHeight: string;
90
- h5LineHeight: string;
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>;
@@ -28,7 +28,8 @@ const CardContainer = styled.div `
28
28
  const CardTitle = styled.h3 `
29
29
  margin: 0;
30
30
  color: ${theme.color.gray55};
31
- font-size: ${theme.fontSize.extraSmallFontSize};
31
+ font-size: ${theme.fontSize.s};
32
+ line-height: ${theme.lineHeight.s};
32
33
  font-weight: ${theme.fontWeight.book};
33
34
  background: ${theme.color.gray5};
34
35
  padding: 0.75rem 0 0.25rem 0;
@@ -38,7 +39,8 @@ const CardTitle = styled.h3 `
38
39
  ${media.md `
39
40
  background: ${theme.color.white};
40
41
  padding: 1rem 1.875rem;
41
- font-size: ${theme.fontSize.h4FontSize};
42
+ font-size: ${theme.fontSize.l};
43
+ line-height: ${theme.lineHeight.default};
42
44
  text-transform: none;
43
45
  text-align: center;
44
46
  font-weight: ${theme.fontWeight.bold};
@@ -19,7 +19,7 @@ const CardElement = styled.div `
19
19
  }
20
20
  `;
21
21
  const CardContent = styled.div `
22
- font-size: ${theme.fontSize.defaultFontSize};
22
+ font-size: ${theme.fontSize.default};
23
23
  font-weight: ${theme.fontWeight.medium};
24
24
  margin: 0;
25
25
  flex-grow: 1;
@@ -27,11 +27,11 @@ const CardContent = styled.div `
27
27
  h5 {
28
28
  word-break: break-word;
29
29
  margin: 0;
30
- line-height: 1.25rem;
30
+ line-height: ${theme.lineHeight.s};
31
31
  padding-right: 1.5rem;
32
32
  }
33
33
  h5 {
34
- font-size: ${theme.fontSize.smallFontSize};
34
+ font-size: ${theme.fontSize.s};
35
35
  font-weight: ${theme.fontWeight.book};
36
36
  }
37
37
  `;
@@ -1,28 +1,54 @@
1
- import React from 'react';
2
- export interface CheckboxProps {
3
- /** Unique id for the input and label */
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ /**
4
+ * Unique ID for the input element
5
+ */
4
6
  id: string;
5
- /** Allows to pass a custom className */
6
- className?: string;
7
- /** The current value of the checkbox */
7
+ /**
8
+ * Default value of input element
9
+ *
10
+ * @default undefined
11
+ */
8
12
  value?: boolean;
9
- /** Callback called when the checkbox changes */
10
- onChange?: (value: boolean) => void;
11
- /** The label of the checkbox */
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: React.FunctionComponent<CheckboxProps>;
52
+ declare const Checkbox: ({ "data-testid": dataTestId, ...props }: Props) => JSX.Element;
27
53
  /** @component */
28
54
  export default Checkbox;
@@ -1,89 +1,56 @@
1
1
  import React from 'react';
2
- import styled, { keyframes } from '../../themes/styled.js';
3
- import { getMultipliedSize } from '../../utils/styledUtils.js';
2
+ import { CheckboxInput_RadioInput } from '../../themes/globalStyles.js';
3
+ import styled from '../../themes/styled.js';
4
+ import { getMultipliedSize, getDividedSize } from '../../utils/styledUtils.js';
4
5
 
5
- const toggleCheckboxAnimation = keyframes `
6
- 0% {
7
- opacity: 0;
8
- transform: scale(0.6);
9
- }
10
- 70% {
11
- opacity: 1;
12
- transform: scale(1.1);
13
- }
14
-
15
- 100% {
16
- transform: scale(1);
17
- }
18
- `;
19
- const Input = styled('input') `
20
- position: absolute;
21
- left: -9999rem;
22
- :checked + label::after {
23
- content: '✓';
24
- display: block;
25
- position: absolute;
26
- left: 2px;
27
- top: 0;
28
- font-weight: ${props => props.theme.fontWeight.bold};
29
- color: ${props => props.theme.color.white};
30
- animation: ${toggleCheckboxAnimation} 0.2s ease forwards;
31
- }
32
- :checked + label::before {
33
- border-color: ${props => props && props.disabled ? props.theme.color.pink2 : props.theme.color.hotPink};
34
- background-color: ${props => props && props.disabled ? props.theme.color.pink2 : props.theme.color.hotPink};
35
- }
36
- :disabled {
37
- pointer-events: none;
38
- }
39
-
40
- :disabled + label {
41
- cursor: not-allowed;
42
- color: ${props => props.theme.color.gray15};
43
- }
6
+ // TODO: Implement proper svg icon after https://jira.dna.fi/browse/STYLE-238 is done
7
+ const SVGIconData = () => {
8
+ const svg = `
9
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="1em" height="1em">
10
+ <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" />
11
+ </svg>
12
+ `;
13
+ return `data:image/svg+xml,${svg}`;
14
+ };
15
+ const Container = styled.div `
16
+ font-size: ${props => props.theme.fontSize.default};
17
+ line-height: ${props => props.theme.lineHeight.default};
18
+ margin-bottom: ${props => getMultipliedSize(props.theme.base.baseHeight, 0.5)};
44
19
  `;
45
- const Label = styled('label') `
20
+ const Input = styled(CheckboxInput_RadioInput) `
46
21
  position: relative;
47
- cursor: pointer;
48
- display: inline-block;
49
- margin-bottom: ${props => getMultipliedSize(props.theme.base.baseHeight, 0.5)};
50
- padding-left: ${props => getMultipliedSize(props.theme.base.baseWidth, 3)};
51
- line-height: ${props => getMultipliedSize(props.theme.base.baseHeight, 2)};
52
- color: ${props => props.theme.color.text};
22
+ top: ${props => getDividedSize(props.theme.base.baseWidth, 5)};
53
23
 
54
- ::before {
55
- content: '';
56
- position: absolute;
57
- display: block;
58
- box-sizing: border-box;
59
- top: 0;
60
- left: 0;
61
- width: ${props => getMultipliedSize(props.theme.base.baseWidth, 2)};
62
- height: ${props => getMultipliedSize(props.theme.base.baseHeight, 2)};
63
- border: solid 2px ${props => props.theme.color.gray25};
24
+ &:checked {
25
+ &::before {
26
+ width: 1em;
27
+ height: 1em;
28
+ background-image: url('${SVGIconData}');
29
+ }
64
30
  }
65
31
  `;
32
+ const Mandatory = styled.span `
33
+ color: ${props => props.theme.color.hotPink};
34
+ margin-left: ${props => getMultipliedSize(props.theme.base.baseHeight, 0.5)};
35
+ `;
66
36
  const ErrorMessage = styled.div `
67
- line-height: 1.125rem;
68
- font-size: ${props => props.theme.fontSize.smallFontSize};
37
+ font-size: ${props => props.theme.fontSize.s};
38
+ line-height: ${props => props.theme.lineHeight.s};
69
39
  color: ${props => props.theme.color.error};
70
40
  margin-top: ${props => getMultipliedSize(props.theme.base.baseHeight, 1)};
71
41
  `;
72
- const Mandatory = styled.span `
73
- color: ${props => props.theme.color.hotPink};
74
- `;
75
- const Checkbox = ({ id, value, onChange, label, disabled, error, errorMessage, className, required, 'data-testid': dataTestId, }) => {
42
+ const Checkbox = ({ 'data-testid': dataTestId, ...props }) => {
76
43
  const handleChange = () => {
77
- if (onChange && !disabled) {
78
- onChange(!value);
44
+ if (props.onChange && !props.disabled) {
45
+ props.onChange(!props.value);
79
46
  }
80
47
  };
81
- return (React.createElement(React.Fragment, null,
82
- React.createElement(Input, { id: id, className: className, type: "checkbox", checked: Boolean(value), onChange: handleChange, disabled: disabled, "data-testid": dataTestId }),
83
- React.createElement(Label, { htmlFor: id, "data-testid": dataTestId && `${dataTestId}-label` },
84
- label,
85
- required && React.createElement(Mandatory, null, " *")),
86
- error && errorMessage && (React.createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, errorMessage))));
48
+ return (React.createElement(Container, null,
49
+ React.createElement(Input, { id: props.id, className: props.className, type: "checkbox", checked: Boolean(props.value), onChange: handleChange, disabled: props.disabled, "data-testid": dataTestId }),
50
+ React.createElement("label", { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label` },
51
+ props.label,
52
+ props.required && React.createElement(Mandatory, null, "*")),
53
+ props.error && props.errorMessage && (React.createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
87
54
  };
88
55
 
89
56
  export default Checkbox;
@@ -58,12 +58,7 @@ declare const _default: import("styled-components").StyledComponent<({ type, siz
58
58
  };
59
59
  breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
60
60
  button: {
61
- buttonBorderWidth: string;
62
- buttonPadding: string;
63
- smallButtonPadding: string;
64
- buttonLineHeight: string;
65
- buttonWidth: string;
66
- buttonSmallWidth: string;
61
+ border: string;
67
62
  };
68
63
  color: {
69
64
  black: string;
@@ -94,22 +89,27 @@ declare const _default: import("styled-components").StyledComponent<({ type, siz
94
89
  gray5: string;
95
90
  };
96
91
  fontFamily: {
97
- baseFontFamily: string;
92
+ default: string;
93
+ heading: string;
94
+ numerals: string;
98
95
  };
99
96
  fontSize: {
100
- defaultFontSize: string;
101
- smallFontSize: string;
102
- extraSmallFontSize: string;
103
- xsFontSize: string;
104
- xxsFontSize: string;
105
- h1FontSize: string;
106
- h2FontSize: string;
107
- h2MobileFontSize: string;
108
- h3FontSize: string;
109
- h4FontSize: string;
110
- h5FontSize: string;
111
- heroBannerTitleFontSize: string;
112
- heroBannerTitleMobileFontSize: string;
97
+ default: string;
98
+ xl: string;
99
+ l: string;
100
+ s: string;
101
+ xs: string;
102
+ h1XL: string;
103
+ h1L: string;
104
+ h1M: string;
105
+ h1S: string;
106
+ h2M: string;
107
+ h2S: string;
108
+ h3: string;
109
+ h4: string;
110
+ h5: string;
111
+ h1: string;
112
+ h2: string;
113
113
  };
114
114
  fontWeight: {
115
115
  book: number;
@@ -125,26 +125,23 @@ declare const _default: import("styled-components").StyledComponent<({ type, siz
125
125
  gutter: string;
126
126
  };
127
127
  lineHeight: {
128
- defaultLineHeight: string;
129
- paragraphLineHeight: string;
130
- heroBannerLineHeight: string;
131
- heroBannerMobileLineHeight: string;
132
- h1LineHeight: string;
133
- h2LineHeight: string;
134
- h2MobileLineHeight: string;
135
- h3LineHeight: string;
136
- h4LineHeight: string; /**
137
- * There are different types and color options for the DNA Logo, depending on the color of
138
- * the background and place where it is used.
139
- *
140
- * @default 'default'
141
- * @param {Type} default Default
142
- * @param {Type} white For use on hot pink background
143
- * @param {Type} logotype-pink For use in smaller spaces
144
- * @param {Type} logotype-white For use in smaller spaces and on pink background
145
- * @param {Type} logotype-black For specific uses only (see Brand Styleguide)
146
- */
147
- h5LineHeight: string;
128
+ default: string;
129
+ xl: string;
130
+ s: string;
131
+ xs: string;
132
+ xxs: string;
133
+ auto: string;
134
+ h1XL: string;
135
+ h1L: string;
136
+ h1M: string;
137
+ h1S: string;
138
+ h2M: string;
139
+ h2S: string;
140
+ h3: string;
141
+ h4: string;
142
+ h5: string;
143
+ h1: string;
144
+ h2: string;
148
145
  };
149
146
  media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
150
147
  }, Props, never>;
@@ -69,7 +69,8 @@ const CategoryHeader = styled.h4 `
69
69
  border-top: 1px solid #cfcfcf;
70
70
  transition: border-bottom 0s linear ${props => (props.active ? '0s' : '0.3s')};
71
71
  border-bottom: 1px solid ${props => (props.active ? '#cfcfcf' : '#e7e7e7')};
72
- font-size: ${props => props.theme.fontSize.defaultFontSize};
72
+ font-size: ${props => props.theme.fontSize.default};
73
+ line-height: ${props => props.theme.lineHeight.default};
73
74
  color: ${props => props.theme.color.slateGray};
74
75
  align-content: center;
75
76
  &:hover,
@@ -131,7 +132,7 @@ const SmallText = styled.p `
131
132
  margin-top: ${props => getMultipliedSize(props.theme.base.baseWidth, 0.2)};
132
133
  line-height: ${props => getMultipliedSize(props.theme.base.baseHeight, 2)};
133
134
  color: ${props => props.theme.color.slateGray};
134
- font-size: ${props => props.theme.fontSize.xsFontSize};
135
+ font-size: ${props => props.theme.fontSize.xs};
135
136
  `;
136
137
  const LanguageLinksContainer = styled.div `
137
138
  text-align: center;
@@ -23,7 +23,8 @@ const HelperIcon = styled.span `
23
23
  height: 1rem;
24
24
  min-width: 1rem;
25
25
  padding: 0 4px;
26
- font-size: ${p => p.theme.fontSize.extraSmallFontSize};
26
+ font-size: ${p => p.theme.fontSize.s};
27
+ line-height: ${p => p.theme.lineHeight.xs};
27
28
  `;
28
29
  const Helper = props => (createElement(Container, Object.assign({}, props),
29
30
  createElement(HelperIcon, null, "?")));
@@ -44,12 +44,7 @@ declare const _default: import("styled-components").StyledComponent<React.Functi
44
44
  };
45
45
  breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
46
46
  button: {
47
- buttonBorderWidth: string;
48
- buttonPadding: string;
49
- smallButtonPadding: string;
50
- buttonLineHeight: string;
51
- buttonWidth: string;
52
- buttonSmallWidth: string;
47
+ border: string;
53
48
  };
54
49
  color: {
55
50
  black: string;
@@ -88,22 +83,29 @@ declare const _default: import("styled-components").StyledComponent<React.Functi
88
83
  gray5: string;
89
84
  };
90
85
  fontFamily: {
91
- baseFontFamily: string;
86
+ default: string;
87
+ heading: string;
88
+ numerals: string;
92
89
  };
93
90
  fontSize: {
94
- defaultFontSize: string;
95
- smallFontSize: string;
96
- extraSmallFontSize: string;
97
- xsFontSize: string;
98
- xxsFontSize: string;
99
- h1FontSize: string;
100
- h2FontSize: string;
101
- h2MobileFontSize: string;
102
- h3FontSize: string;
103
- h4FontSize: string;
104
- h5FontSize: string;
105
- heroBannerTitleFontSize: string;
106
- heroBannerTitleMobileFontSize: string;
91
+ default: string;
92
+ xl: string;
93
+ l: string;
94
+ s: string;
95
+ xs: string;
96
+ h1XL: string;
97
+ h1L: string;
98
+ h1M: string;
99
+ h1S: string;
100
+ h2M: string;
101
+ h2S: string; /**
102
+ * Icon color, specified as a hex, or a color name (hotPink, waterBlue)
103
+ */
104
+ h3: string;
105
+ h4: string;
106
+ h5: string;
107
+ h1: string;
108
+ h2: string;
107
109
  };
108
110
  fontWeight: {
109
111
  book: number;
@@ -121,16 +123,23 @@ declare const _default: import("styled-components").StyledComponent<React.Functi
121
123
  * Indicates that this component is on right side of other contents and adds an appropriate left margin.
122
124
  */
123
125
  lineHeight: {
124
- defaultLineHeight: string;
125
- paragraphLineHeight: string;
126
- heroBannerLineHeight: string;
127
- heroBannerMobileLineHeight: string;
128
- h1LineHeight: string;
129
- h2LineHeight: string;
130
- h2MobileLineHeight: string;
131
- h3LineHeight: string;
132
- h4LineHeight: string;
133
- h5LineHeight: string;
126
+ default: string;
127
+ xl: string;
128
+ s: string;
129
+ xs: string;
130
+ xxs: string;
131
+ auto: string;
132
+ h1XL: string;
133
+ h1L: string;
134
+ h1M: string;
135
+ h1S: string;
136
+ h2M: string;
137
+ h2S: string;
138
+ h3: string;
139
+ h4: string;
140
+ h5: string;
141
+ h1: string;
142
+ h2: string;
134
143
  };
135
144
  media: Record<React.ReactText, (l: TemplateStringsArray, ...p: any[]) => string>;
136
145
  }, IconProps, never>;
@@ -55,10 +55,6 @@ export declare const devices: ({ size, color, ...props }: IconProps) => JSX.Elem
55
55
  export declare const diamond: ({ size, color, ...props }: IconProps) => JSX.Element;
56
56
  export declare const digibox: ({ size, color, ...props }: IconProps) => JSX.Element;
57
57
  export declare const digiboxRec: ({ size, color, ...props }: IconProps) => JSX.Element;
58
- /**
59
- * @deprecated
60
- */
61
- export declare const dna: ({ size, color, ...props }: IconProps) => JSX.Element;
62
58
  export declare const dnaTurvapaketti: ({ size, color, ...props }: IconProps) => JSX.Element;
63
59
  export declare const dnaTv: ({ size, color, ...props }: IconProps) => JSX.Element;
64
60
  export declare const document1: ({ size, color, ...props }: IconProps) => JSX.Element;
@@ -191,6 +187,7 @@ export declare const thriller: ({ size, color, ...props }: IconProps) => JSX.Ele
191
187
  export declare const thumbDown: ({ size, color, ...props }: IconProps) => JSX.Element;
192
188
  export declare const thumbUp: ({ size, color, ...props }: IconProps) => JSX.Element;
193
189
  export declare const tickets: ({ size, color, ...props }: IconProps) => JSX.Element;
190
+ export declare const tiktok: ({ size, color, ...props }: IconProps) => JSX.Element;
194
191
  export declare const top10: ({ size, color, ...props }: IconProps) => JSX.Element;
195
192
  export declare const top50: ({ size, color, ...props }: IconProps) => JSX.Element;
196
193
  export declare const trademark: ({ size, color, ...props }: IconProps) => JSX.Element;