@dnanpm/styleguide 1.8.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 (161) hide show
  1. package/build/cjs/components/Accordion/Accordion.d.ts +50 -0
  2. package/build/cjs/components/Accordion/Accordion.js +52 -0
  3. package/build/cjs/components/Accordion/AccordionItem.d.ts +30 -0
  4. package/build/cjs/components/Accordion/AccordionItem.js +77 -0
  5. package/build/cjs/components/AmountSelector/AmountSelector.js +11 -7
  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 +59 -60
  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 +4 -10
  34. package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +18 -12
  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/LinkModifier.js +2 -2
  38. package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
  39. package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +1 -4
  40. package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
  41. package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
  42. package/build/cjs/components/MainNavigation/MainNavigation.js +1 -1
  43. package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +148 -120
  44. package/build/cjs/components/Notification/Notification.d.ts +36 -17
  45. package/build/cjs/components/Notification/Notification.js +25 -48
  46. package/build/cjs/components/NotificationBadge/NotificationBadge.d.ts +37 -30
  47. package/build/cjs/components/NotificationBadge/NotificationBadge.js +1 -1
  48. package/build/cjs/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
  49. package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +3 -3
  50. package/build/cjs/components/RadioButton/RadioButton.d.ts +33 -17
  51. package/build/cjs/components/RadioButton/RadioButton.js +12 -57
  52. package/build/cjs/components/ReadMore/ReadMore.js +2 -7
  53. package/build/cjs/components/Ribbon/Ribbon.d.ts +57 -0
  54. package/build/cjs/components/Ribbon/Ribbon.js +80 -0
  55. package/build/cjs/components/Search/Search.js +2 -1
  56. package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
  57. package/build/cjs/components/Selectbox/Selectbox.d.ts +106 -14
  58. package/build/cjs/components/Selectbox/Selectbox.js +44 -53
  59. package/build/cjs/components/Tabs/Tab.d.ts +37 -30
  60. package/build/cjs/components/Tabs/Tab.js +3 -2
  61. package/build/cjs/components/Tabs/Tabs.d.ts +40 -30
  62. package/build/cjs/components/Textarea/Textarea.js +4 -3
  63. package/build/cjs/components/Tooltip/Tooltip.d.ts +37 -30
  64. package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
  65. package/build/cjs/components/index.d.ts +4 -1
  66. package/build/cjs/hooks/useElementDimensions.d.ts +5 -0
  67. package/build/cjs/hooks/useElementDimensions.js +37 -0
  68. package/build/cjs/index.js +6 -0
  69. package/build/cjs/themes/globalStyles.d.ts +174 -60
  70. package/build/cjs/themes/globalStyles.js +132 -142
  71. package/build/cjs/themes/styled.d.ts +259 -210
  72. package/build/cjs/themes/theme.d.ts +37 -30
  73. package/build/cjs/themes/themeComponents/buttons.d.ts +1 -6
  74. package/build/cjs/themes/themeComponents/buttons.js +1 -6
  75. package/build/cjs/themes/themeComponents/fontFamily.d.ts +3 -1
  76. package/build/cjs/themes/themeComponents/fontFamily.js +3 -1
  77. package/build/cjs/themes/themeComponents/fontSize.d.ts +18 -15
  78. package/build/cjs/themes/themeComponents/fontSize.js +20 -14
  79. package/build/cjs/themes/themeComponents/lineHeight.d.ts +19 -12
  80. package/build/cjs/themes/themeComponents/lineHeight.js +21 -11
  81. package/build/es/components/Accordion/Accordion.d.ts +50 -0
  82. package/build/es/components/Accordion/Accordion.js +44 -0
  83. package/build/es/components/Accordion/AccordionItem.d.ts +30 -0
  84. package/build/es/components/Accordion/AccordionItem.js +68 -0
  85. package/build/es/components/AmountSelector/AmountSelector.js +11 -7
  86. package/build/es/components/Buttons/ButtonBasicStyles.d.ts +37 -30
  87. package/build/es/components/Buttons/ButtonBasicStyles.js +10 -14
  88. package/build/es/components/Buttons/ButtonDefault.js +6 -2
  89. package/build/es/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
  90. package/build/es/components/Buttons/ButtonIconStyles.d.ts +37 -30
  91. package/build/es/components/Buttons/ButtonPrimary.js +6 -2
  92. package/build/es/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
  93. package/build/es/components/Buttons/ButtonSecondary.js +7 -3
  94. package/build/es/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
  95. package/build/es/components/Buttons/ButtonTertiary.js +7 -3
  96. package/build/es/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
  97. package/build/es/components/Buttons/CloseButton.d.ts +37 -30
  98. package/build/es/components/Card/Card.js +4 -2
  99. package/build/es/components/Card/CardRow.js +3 -3
  100. package/build/es/components/Checkbox/Checkbox.d.ts +38 -12
  101. package/build/es/components/Checkbox/Checkbox.js +39 -72
  102. package/build/es/components/DnaLogo/DnaLogo.d.ts +37 -40
  103. package/build/es/components/Footer/Components/FooterComponents.js +3 -2
  104. package/build/es/components/Helper/Helper.js +2 -1
  105. package/build/es/components/Icon/Icon.d.ts +39 -30
  106. package/build/es/components/Icon/Icons.d.ts +1 -4
  107. package/build/es/components/Icon/Icons.js +3 -7
  108. package/build/es/components/Input/Input.d.ts +102 -13
  109. package/build/es/components/Input/Input.js +59 -60
  110. package/build/es/components/Label/Label.js +2 -3
  111. package/build/es/components/LabelText/LabelText.d.ts +38 -30
  112. package/build/es/components/LabelText/LabelText.js +1 -1
  113. package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +4 -10
  114. package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +18 -12
  115. package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
  116. package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
  117. package/build/es/components/MainNavigation/ChildComponents/LinkModifier.js +2 -2
  118. package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
  119. package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -5
  120. package/build/es/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
  121. package/build/es/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
  122. package/build/es/components/MainNavigation/MainNavigation.js +1 -1
  123. package/build/es/components/MainNavigation/globalNavStyles.d.ts +148 -120
  124. package/build/es/components/Notification/Notification.d.ts +36 -17
  125. package/build/es/components/Notification/Notification.js +25 -48
  126. package/build/es/components/NotificationBadge/NotificationBadge.d.ts +37 -30
  127. package/build/es/components/NotificationBadge/NotificationBadge.js +1 -1
  128. package/build/es/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
  129. package/build/es/components/ProgressIndicator/ProgressIndicator.js +3 -3
  130. package/build/es/components/RadioButton/RadioButton.d.ts +33 -17
  131. package/build/es/components/RadioButton/RadioButton.js +12 -57
  132. package/build/es/components/ReadMore/ReadMore.js +2 -7
  133. package/build/es/components/Ribbon/Ribbon.d.ts +57 -0
  134. package/build/es/components/Ribbon/Ribbon.js +71 -0
  135. package/build/es/components/Search/Search.js +2 -1
  136. package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
  137. package/build/es/components/Selectbox/Selectbox.d.ts +106 -14
  138. package/build/es/components/Selectbox/Selectbox.js +44 -53
  139. package/build/es/components/Tabs/Tab.d.ts +37 -30
  140. package/build/es/components/Tabs/Tab.js +3 -2
  141. package/build/es/components/Tabs/Tabs.d.ts +40 -30
  142. package/build/es/components/Textarea/Textarea.js +4 -3
  143. package/build/es/components/Tooltip/Tooltip.d.ts +37 -30
  144. package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
  145. package/build/es/components/index.d.ts +4 -1
  146. package/build/es/hooks/useElementDimensions.d.ts +5 -0
  147. package/build/es/hooks/useElementDimensions.js +33 -0
  148. package/build/es/index.js +3 -0
  149. package/build/es/themes/globalStyles.d.ts +174 -60
  150. package/build/es/themes/globalStyles.js +134 -145
  151. package/build/es/themes/styled.d.ts +259 -210
  152. package/build/es/themes/theme.d.ts +37 -30
  153. package/build/es/themes/themeComponents/buttons.d.ts +1 -6
  154. package/build/es/themes/themeComponents/buttons.js +1 -6
  155. package/build/es/themes/themeComponents/fontFamily.d.ts +3 -1
  156. package/build/es/themes/themeComponents/fontFamily.js +3 -1
  157. package/build/es/themes/themeComponents/fontSize.d.ts +18 -15
  158. package/build/es/themes/themeComponents/fontSize.js +20 -14
  159. package/build/es/themes/themeComponents/lineHeight.d.ts +19 -12
  160. package/build/es/themes/themeComponents/lineHeight.js +21 -11
  161. package/package.json +2 -2
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import styled__default from 'styled-components';
3
+ import theme from '../../themes/theme.js';
4
+ import { getMultipliedSize, getDividedSize, media } from '../../utils/styledUtils.js';
5
+ import Icon from '../Icon/Icon.js';
6
+
7
+ const getColorScheme = ({ color, textColor }) => {
8
+ const map = {
9
+ text: ['pinkday', 'white', 'pink2', 'grayBg', 'gray15', 'gray10', 'gray5'],
10
+ black: ['grayWhite'],
11
+ };
12
+ textColor =
13
+ textColor ||
14
+ Object.keys(map).find(key => map[key].includes(color)) ||
15
+ 'white';
16
+ return `
17
+ color: ${theme.color[textColor]};
18
+ background: ${theme.color[color]};
19
+
20
+ a {
21
+ color: ${theme.color[textColor]};
22
+ };
23
+ }`;
24
+ };
25
+ const RibbonWrapper = styled__default.div `
26
+ ${({ color, textColor }) => getColorScheme({ color, textColor })}
27
+ display: flex;
28
+ align-items: center;
29
+ overflow: hidden;
30
+ padding: ${getMultipliedSize(theme.base.baseWidth, 1.2)}
31
+ ${getMultipliedSize(theme.base.baseWidth, 1.5)};
32
+ position: relative;
33
+ opacity: 0.95;
34
+ transition: all 0.3s;
35
+ text-align: ${({ centered }) => (centered ? 'center' : 'left')};
36
+ a {
37
+ text-decoration: underline;
38
+ }
39
+ `;
40
+ const ContentWrapper = styled__default.div `
41
+ flex: 1;
42
+ font-weight: ${theme.fontWeight.book};
43
+ overflow: hidden;
44
+ font-size: ${theme.fontSize.default};
45
+ line-height: ${theme.lineHeight.default};
46
+ position: relative;
47
+ word-wrap: break-word;
48
+ margin-right: ${({ closeButton }) => closeButton ? getMultipliedSize(theme.base.baseWidth, 3) : 0};
49
+ `;
50
+ const CloseButton = styled__default.a `
51
+ position: absolute;
52
+ top: ${getMultipliedSize(theme.base.baseWidth, 0.88)};
53
+ right: ${getMultipliedSize(theme.base.baseWidth, 1.2)};
54
+ margin: ${getDividedSize(theme.base.baseWidth, 2)};
55
+ cursor: pointer;
56
+
57
+ ${() => media.xs `
58
+ top: ${getMultipliedSize(theme.base.baseWidth, 1.2)};
59
+ `}
60
+ `;
61
+ const Ribbon = ({ color = 'info', 'data-testid': dataTestId, ...props }) => {
62
+ if (props.dismissed) {
63
+ return null;
64
+ }
65
+ return (React.createElement(RibbonWrapper, { className: props.className, color: color, textColor: props.textColor, "data-testid": dataTestId, centered: props.centered },
66
+ React.createElement(ContentWrapper, { closeButton: props.closeButton }, props.children),
67
+ props.closeButton ? (React.createElement(CloseButton, { onClick: props.onClick },
68
+ React.createElement(Icon, { name: "x", size: "0.75rem", color: "currentColor" }))) : null));
69
+ };
70
+
71
+ export default Ribbon;
@@ -16,7 +16,8 @@ const Container = styled.div `
16
16
  const Input = styled.input `
17
17
  flex: 1 0 auto;
18
18
  border: 0;
19
- font-size: ${props => props.theme.fontSize.defaultFontSize};
19
+ font-size: ${props => props.theme.fontSize.default};
20
+ line-height: ${props => props.theme.lineHeight.default};
20
21
  color: ${props => props.theme.color.text};
21
22
  -webkit-appearance: none;
22
23
  &:placeholder {
@@ -8,7 +8,7 @@ import Icon from '../Icon/Icon.js';
8
8
  const SecondaryNavigationWrapper = styled.nav `
9
9
  line-height: 1.2rem;
10
10
  padding: 0;
11
- font-size: ${theme.fontSize.smallFontSize};
11
+ font-size: ${theme.fontSize.s};
12
12
  background: ${theme.color.white};
13
13
  position: relative;
14
14
  z-index: 1000;
@@ -99,7 +99,7 @@ const SecondaryNavigationListElement = styled.li `
99
99
  border-bottom: ${p => p.isActive ? `2px solid ${theme.color.hotPink}` : `0px solid ${theme.color.white}`};
100
100
  }
101
101
  ${p => media.xl `
102
- font-size: ${p.theme.fontSize.defaultFontSize};
102
+ font-size: ${p.theme.fontSize.default};
103
103
  margin: 0 1rem;
104
104
  &:first-of-type {
105
105
  margin-left: 0;
@@ -4,28 +4,120 @@ export interface SelectboxItem {
4
4
  label: string;
5
5
  value: any;
6
6
  }
7
- interface DropDownIndicator {
8
- color?: string;
9
- iconSize?: string;
10
- }
11
7
  interface Props {
12
- /** Allows to pass a custom className */
13
- className?: string;
14
- label?: string;
15
- inputId?: ReactSelectProps['inputId'];
16
- placeholder?: ReactSelectProps['placeholder'];
17
- onChange: (selectedItem: SelectboxItem) => void;
8
+ /**
9
+ * Unique ID for the select element
10
+ */
11
+ inputId: ReactSelectProps['inputId'];
12
+ /**
13
+ * Array of options that populate the select menu
14
+ */
18
15
  options: ReactSelectProps['options'];
16
+ /**
17
+ * Default value of select menu
18
+ *
19
+ * @default undefined
20
+ */
19
21
  value?: ReactSelectProps['value'];
20
- 'data-testid'?: string;
21
- dropDownIndicator?: DropDownIndicator;
22
+ /**
23
+ * Text of the select element label
24
+ */
25
+ label?: string;
26
+ /**
27
+ * Text of placeholder for the select value
28
+ */
29
+ placeholder?: ReactSelectProps['placeholder'];
30
+ /**
31
+ * Text to display when there are no options
32
+ */
22
33
  noOptionsText?: string;
23
- isSearchable?: boolean;
34
+ /**
35
+ * On select change callback
36
+ */
37
+ onChange: (selectedItem: SelectboxItem) => void;
38
+ /**
39
+ * On input change callback
40
+ */
41
+ onInputChange?: ReactSelectProps['onInputChange'];
42
+ /**
43
+ * Allows to attach selectbox options menu to specific HTML element
44
+ * Useful when used in modals
45
+ *
46
+ * @default selectbox-container
47
+ */
48
+ menuPortalTarget?: ReactSelectProps['menuPortalTarget'];
49
+ /**
50
+ * Allows to place selectbox options menu above or below the selectbox control
51
+ *
52
+ * @default 'auto'
53
+ * @param {MenuPlacement} top Opens options menu above the control
54
+ * @param {MenuPlacement} bottom Opens options menu below the control
55
+ */
56
+ menuPlacement?: ReactSelectProps['menuPlacement'];
57
+ /**
58
+ * Allows to define icon color and icon size of dropdown indicator
59
+ *
60
+ * @default color '#000000'
61
+ * @default iconSize '1rem'
62
+ */
63
+ dropDownIndicator?: {
64
+ color?: string;
65
+ iconSize?: string;
66
+ };
67
+ /**
68
+ * Displayes loading indicator (PixelLoader) instead of selectbox
69
+ *
70
+ * @default false
71
+ */
24
72
  isLoading?: boolean;
73
+ /**
74
+ * Allows to enable search functionality
75
+ *
76
+ * @default false
77
+ */
78
+ isSearchable?: boolean;
79
+ /**
80
+ * Allows to clear selected value
81
+ *
82
+ * @default false
83
+ */
84
+ isClearable?: boolean;
85
+ /**
86
+ * Allows to select multiple options
87
+ *
88
+ * @default false
89
+ */
90
+ isMulti?: boolean;
91
+ /**
92
+ * Allows to disable the component functionality
93
+ *
94
+ * @default false
95
+ */
25
96
  isDisabled?: boolean;
97
+ /**
98
+ * Allows to set selectbox as mandatory
99
+ *
100
+ * @default false
101
+ */
26
102
  isRequired?: boolean;
103
+ /**
104
+ * Allows to set selectbox to error state
105
+ *
106
+ * @default false
107
+ */
27
108
  error?: boolean;
109
+ /**
110
+ * Text of the error message when selectbox is in error state
111
+ */
28
112
  errorMessage?: string;
113
+ /**
114
+ * Allows to pass a custom className
115
+ */
116
+ className?: string;
117
+ /**
118
+ * Allows to pass testid string for testing purposes
119
+ */
120
+ 'data-testid'?: string;
29
121
  }
30
- declare const SelectBox: ({ className, label, onChange, options, value, inputId, dropDownIndicator, placeholder, "data-testid": dataTestId, isSearchable, noOptionsText, isLoading, isDisabled, isRequired, error, errorMessage, }: Props) => JSX.Element;
122
+ declare const SelectBox: ({ dropDownIndicator, "data-testid": dataTestId, isSearchable, isClearable, isMulti, noOptionsText, isLoading, isDisabled, isRequired, error, ...props }: Props) => JSX.Element;
31
123
  export default SelectBox;
@@ -13,8 +13,8 @@ const borderStyles = {
13
13
  boxShadow: 'none',
14
14
  };
15
15
  const FieldContainer = styled.div `
16
- color: ${props => props && props.disabled ? props.theme.color.gray40 : props.theme.color.text};
17
- margin-bottom: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
16
+ color: ${props => (props.isDisabled ? props.theme.color.gray40 : props.theme.color.text)};
17
+ margin-bottom: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
18
18
 
19
19
  ${LabelText} {
20
20
  color: ${props => {
@@ -24,8 +24,8 @@ const FieldContainer = styled.div `
24
24
  }}
25
25
  `;
26
26
  const ErrorMessage = styled.div `
27
- line-height: 1.125rem;
28
- font-size: ${props => props.theme.fontSize.smallFontSize};
27
+ font-size: ${props => props.theme.fontSize.s};
28
+ line-height: ${props => props.theme.lineHeight.s};
29
29
  color: ${props => props.theme.color.error};
30
30
  margin-top: ${props => getMultipliedSize(props.theme.base.baseHeight, 0.5)};
31
31
  `;
@@ -33,54 +33,45 @@ const Mandatory = styled.span `
33
33
  color: ${props => props.theme.color.hotPink};
34
34
  `;
35
35
  const selectBoxStyles = {
36
- control: (styles, state) => {
37
- const customControlStyles = {
38
- ...borderStyles,
39
- height: '2.625rem',
40
- borderBottomColor: state.menuIsOpen ? theme.color.white : 'inherit',
41
- '&:hover': {
42
- borderColor: theme.color.gray25,
43
- },
44
- };
45
- return {
46
- ...styles,
47
- ...customControlStyles,
48
- };
49
- },
50
- menu: styles => {
51
- const customMenuStyles = {
52
- ...borderStyles,
53
- marginTop: '-2px',
54
- borderTop: 'none',
55
- };
56
- return {
57
- ...styles,
58
- ...customMenuStyles,
59
- };
60
- },
36
+ control: (styles, state) => ({
37
+ ...styles,
38
+ ...borderStyles,
39
+ height: getMultipliedSize(theme.base.baseHeight, 4),
40
+ borderBottomColor: state.menuIsOpen ? theme.color.white : theme.color.gray25,
41
+ ':hover': {
42
+ borderColor: theme.color.gray25,
43
+ },
44
+ }),
45
+ menu: styles => ({
46
+ ...styles,
47
+ ...borderStyles,
48
+ marginTop: '-2px',
49
+ borderTop: 'none',
50
+ }),
61
51
  indicatorSeparator: () => ({
62
52
  border: 'none',
63
53
  }),
64
- option: styles => {
65
- const customOptionStyles = {
66
- display: 'flex',
67
- justifyContent: 'space-between',
68
- color: theme.color.text,
69
- fontWeight: theme.fontWeight.book,
70
- fontSize: theme.fontSize.defaultFontSize,
71
- backgroundColor: theme.color.white,
72
- textOverflow: 'ellipsis',
73
- whiteSpace: 'pre-wrap',
74
- overflow: 'hidden',
75
- '&:hover': {
76
- backgroundColor: theme.color.hotPink,
77
- color: theme.color.white,
78
- },
79
- };
80
- return { ...styles, ...customOptionStyles };
81
- },
54
+ option: (styles, { isDisabled, isSelected }) => ({
55
+ ...styles,
56
+ display: 'flex',
57
+ justifyContent: 'space-between',
58
+ color: isDisabled ? theme.color.gray40 : theme.color.text,
59
+ backgroundColor: isDisabled || isSelected ? theme.color.gray5 : theme.color.white,
60
+ fontWeight: theme.fontWeight.book,
61
+ fontSize: theme.fontSize.default,
62
+ textOverflow: 'ellipsis',
63
+ whiteSpace: 'pre-wrap',
64
+ overflow: 'hidden',
65
+ cursor: isDisabled ? 'not-allowed' : 'default',
66
+ ':active': {
67
+ backgroundColor: theme.color.gray10,
68
+ },
69
+ ':hover': {
70
+ backgroundColor: isDisabled ? theme.color.gray5 : theme.color.grayBg,
71
+ },
72
+ }),
82
73
  };
83
- const SelectBox = ({ className, label, onChange, options, value, inputId, dropDownIndicator, placeholder, 'data-testid': dataTestId, isSearchable = false, noOptionsText = '', isLoading = false, isDisabled = false, isRequired = false, error = false, errorMessage, }) => {
74
+ const SelectBox = ({ dropDownIndicator, 'data-testid': dataTestId, isSearchable = false, isClearable = false, isMulti = false, noOptionsText = '', isLoading = false, isDisabled = false, isRequired = false, error = false, ...props }) => {
84
75
  const getNoOptionsText = () => noOptionsText;
85
76
  const DropdownIndicator = (dropdownIndicatorProps) => {
86
77
  const { color = isDisabled ? theme.color.gray40 : theme.color.black, iconSize = '1rem' } = {
@@ -97,13 +88,13 @@ const SelectBox = ({ className, label, onChange, options, value, inputId, dropDo
97
88
  return (components.DropdownIndicator && (React.createElement(components.DropdownIndicator, Object.assign({}, dropdownIndicatorProps),
98
89
  React.createElement(Icon, { color: color, name: getIconName(), size: iconSize }))));
99
90
  };
100
- return (React.createElement("div", { className: className, "data-testid": dataTestId }, !isLoading ? (React.createElement(FieldContainer, { disabled: isDisabled, error: error },
101
- label && (React.createElement(LabelText, { htmlFor: inputId },
102
- label,
91
+ return (React.createElement("div", { className: props.className, "data-testid": dataTestId }, !isLoading ? (React.createElement(FieldContainer, { isDisabled: isDisabled, error: error },
92
+ props.label && (React.createElement(LabelText, { htmlFor: props.inputId },
93
+ props.label,
103
94
  " ",
104
95
  isRequired && React.createElement(Mandatory, null, "*"))),
105
- React.createElement(Select, { inputId: inputId, styles: selectBoxStyles, components: { DropdownIndicator }, options: options, classNamePrefix: "react_select", onChange: onChange, value: value, placeholder: placeholder, noOptionsMessage: getNoOptionsText, isSearchable: isSearchable, isDisabled: isDisabled }),
106
- error && errorMessage && React.createElement(ErrorMessage, null, errorMessage))) : (React.createElement(PixelLoader, null))));
96
+ React.createElement(Select, { inputId: props.inputId, styles: selectBoxStyles, components: { DropdownIndicator }, options: props.options, classNamePrefix: "react_select", onChange: props.onChange, onInputChange: props.onInputChange, value: props.value, placeholder: props.placeholder, noOptionsMessage: getNoOptionsText, menuPortalTarget: props.menuPortalTarget, menuPlacement: props.menuPlacement, isSearchable: isSearchable, isClearable: isClearable, isMulti: isMulti, isDisabled: isDisabled }),
97
+ error && props.errorMessage && (React.createElement(ErrorMessage, null, props.errorMessage)))) : (React.createElement(PixelLoader, null))));
107
98
  };
108
99
 
109
100
  export default SelectBox;
@@ -23,12 +23,7 @@ export declare const TabStyle: import("styled-components").StyledComponent<"li",
23
23
  };
24
24
  breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
25
25
  button: {
26
- buttonBorderWidth: string;
27
- buttonPadding: string;
28
- smallButtonPadding: string;
29
- buttonLineHeight: string;
30
- buttonWidth: string;
31
- buttonSmallWidth: string;
26
+ border: string;
32
27
  };
33
28
  color: {
34
29
  black: string;
@@ -59,22 +54,27 @@ export declare const TabStyle: import("styled-components").StyledComponent<"li",
59
54
  gray5: string;
60
55
  };
61
56
  fontFamily: {
62
- baseFontFamily: string;
57
+ default: string;
58
+ heading: string;
59
+ numerals: string;
63
60
  };
64
61
  fontSize: {
65
- defaultFontSize: string;
66
- smallFontSize: string;
67
- extraSmallFontSize: string;
68
- xsFontSize: string;
69
- xxsFontSize: string;
70
- h1FontSize: string;
71
- h2FontSize: string;
72
- h2MobileFontSize: string;
73
- h3FontSize: string;
74
- h4FontSize: string;
75
- h5FontSize: string;
76
- heroBannerTitleFontSize: string;
77
- heroBannerTitleMobileFontSize: string;
62
+ default: string;
63
+ xl: string;
64
+ l: string;
65
+ s: string;
66
+ xs: string;
67
+ h1XL: string;
68
+ h1L: string;
69
+ h1M: string;
70
+ h1S: string;
71
+ h2M: string;
72
+ h2S: string;
73
+ h3: string;
74
+ h4: string;
75
+ h5: string;
76
+ h1: string;
77
+ h2: string;
78
78
  };
79
79
  fontWeight: {
80
80
  book: number;
@@ -90,16 +90,23 @@ export declare const TabStyle: import("styled-components").StyledComponent<"li",
90
90
  gutter: string;
91
91
  };
92
92
  lineHeight: {
93
- defaultLineHeight: string;
94
- paragraphLineHeight: string;
95
- heroBannerLineHeight: string;
96
- heroBannerMobileLineHeight: string;
97
- h1LineHeight: string;
98
- h2LineHeight: string;
99
- h2MobileLineHeight: string;
100
- h3LineHeight: string;
101
- h4LineHeight: string;
102
- h5LineHeight: string;
93
+ default: string;
94
+ xl: string;
95
+ s: string;
96
+ xs: string;
97
+ xxs: string;
98
+ auto: string;
99
+ h1XL: string;
100
+ h1L: string;
101
+ h1M: string;
102
+ h1S: string;
103
+ h2M: string;
104
+ h2S: string;
105
+ h3: string;
106
+ h4: string;
107
+ h5: string;
108
+ h1: string;
109
+ h2: string;
103
110
  };
104
111
  media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
105
112
  }, TabStyleProps, never>;
@@ -7,7 +7,8 @@ const TabStyle = styled.li `
7
7
  list-style: none;
8
8
  cursor: pointer;
9
9
  padding: ${props => `${getMultipliedSize(props.theme.base.baseHeight, 0.8)} ${getMultipliedSize(props.theme.base.baseHeight, 1.6)}`};
10
- font-size: ${props => props.theme.fontSize.defaultFontSize};
10
+ font-size: ${props => props.theme.fontSize.default};
11
+ line-height: ${props => props.theme.lineHeight.default};
11
12
  font-weight: ${props => props.theme.fontWeight.book};
12
13
  margin-right: ${props => getMultipliedSize(props.theme.base.baseHeight, 2)};
13
14
 
@@ -26,7 +27,7 @@ const TabStyle = styled.li `
26
27
  css `
27
28
  padding: ${getMultipliedSize(props.theme.base.baseHeight, 1)} 0;
28
29
  margin-right: ${getMultipliedSize(props.theme.base.baseHeight, 5)};
29
- font-size: ${props.theme.fontSize.h4FontSize};
30
+ font-size: ${props.theme.fontSize.l};
30
31
  font-weight: ${props.theme.fontWeight.bold};
31
32
  `}
32
33
 
@@ -42,12 +42,7 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
42
42
  };
43
43
  breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
44
44
  button: {
45
- buttonBorderWidth: string;
46
- buttonPadding: string;
47
- smallButtonPadding: string;
48
- buttonLineHeight: string;
49
- buttonWidth: string;
50
- buttonSmallWidth: string;
45
+ border: string;
51
46
  };
52
47
  color: {
53
48
  black: string;
@@ -78,22 +73,29 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
78
73
  gray5: string;
79
74
  };
80
75
  fontFamily: {
81
- baseFontFamily: string;
76
+ default: string;
77
+ heading: string;
78
+ numerals: string;
82
79
  };
83
80
  fontSize: {
84
- defaultFontSize: string;
85
- smallFontSize: string;
86
- extraSmallFontSize: string;
87
- xsFontSize: string;
88
- xxsFontSize: string;
89
- h1FontSize: string;
90
- h2FontSize: string;
91
- h2MobileFontSize: string;
92
- h3FontSize: string;
93
- h4FontSize: string;
94
- h5FontSize: string;
95
- heroBannerTitleFontSize: string;
96
- heroBannerTitleMobileFontSize: string;
81
+ default: string;
82
+ xl: string;
83
+ l: string;
84
+ s: string;
85
+ xs: string;
86
+ h1XL: string; /**
87
+ * Allows to pass a custom className
88
+ */
89
+ h1L: string;
90
+ h1M: string;
91
+ h1S: string;
92
+ h2M: string;
93
+ h2S: string;
94
+ h3: string;
95
+ h4: string;
96
+ h5: string;
97
+ h1: string;
98
+ h2: string;
97
99
  };
98
100
  fontWeight: {
99
101
  book: number;
@@ -109,12 +111,16 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
109
111
  gutter: string;
110
112
  };
111
113
  lineHeight: {
112
- defaultLineHeight: string;
113
- paragraphLineHeight: string;
114
- heroBannerLineHeight: string;
115
- heroBannerMobileLineHeight: string;
116
- h1LineHeight: string;
117
- h2LineHeight: string; /**
114
+ default: string;
115
+ xl: string;
116
+ s: string;
117
+ xs: string;
118
+ xxs: string;
119
+ auto: string;
120
+ h1XL: string;
121
+ h1L: string;
122
+ h1M: string;
123
+ /**
118
124
  * Style of the tabs
119
125
  *
120
126
  * @deprecated Underlined is provided only as legacy style
@@ -122,10 +128,14 @@ export declare const Tablist: import("styled-components").StyledComponent<"ul",
122
128
  * @param {Type} gray Default
123
129
  * @param {Type} underlined Legacy style (should not be used in new projects)
124
130
  */
125
- h2MobileLineHeight: string;
126
- h3LineHeight: string;
127
- h4LineHeight: string;
128
- h5LineHeight: string;
131
+ h1S: string;
132
+ h2M: string;
133
+ h2S: string;
134
+ h3: string;
135
+ h4: string;
136
+ h5: string;
137
+ h1: string;
138
+ h2: string;
129
139
  };
130
140
  media: Record<React.ReactText, (l: TemplateStringsArray, ...p: any[]) => string>;
131
141
  }, {
@@ -6,8 +6,9 @@ import { LabelText } from '../LabelText/LabelText.js';
6
6
  const Tag = styled.textarea `
7
7
  display: block;
8
8
  padding: ${props => getMultipliedSize(props.theme.base.baseWidth, 1)};
9
- font-family: ${props => props.theme.fontFamily.baseFontFamily};
10
- font-size: ${props => props.theme.fontSize.defaultFontSize};
9
+ font-family: ${props => props.theme.fontFamily.default};
10
+ font-size: ${props => props.theme.fontSize.default};
11
+ line-height: ${props => props.theme.lineHeight.default};
11
12
  width: 100%;
12
13
  border: 1px solid ${props => props.theme.color.gray15};
13
14
  &::-ms-clear,
@@ -39,7 +40,7 @@ const FieldContainer = styled.div `
39
40
  `;
40
41
  const CommentMessage = styled.div `
41
42
  line-height: 1.125rem;
42
- font-size: ${props => props.theme.fontSize.smallFontSize};
43
+ font-size: ${props => props.theme.fontSize.s};
43
44
  color: ${props => props.theme.color.gray40};
44
45
  margin-top: ${props => getMultipliedSize(props.theme.base.baseHeight, 0.5)};
45
46
  `;