@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.
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 +5 -6
  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 +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 -17
  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 +102 -13
  58. package/build/cjs/components/Selectbox/Selectbox.js +40 -49
  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 +5 -6
  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 +57 -58
  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 +2 -17
  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 +102 -13
  138. package/build/es/components/Selectbox/Selectbox.js +40 -49
  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 +3 -4
@@ -11,12 +11,7 @@ export declare const MenuItem: import("styled-components").StyledComponent<"li",
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 @@ export declare const MenuItem: import("styled-components").StyledComponent<"li",
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 @@ export declare const MenuItem: import("styled-components").StyledComponent<"li",
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
  }, {
@@ -106,12 +113,7 @@ export declare const MenuLink: import("styled-components").StyledComponent<"a",
106
113
  };
107
114
  breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
108
115
  button: {
109
- buttonBorderWidth: string;
110
- buttonPadding: string;
111
- smallButtonPadding: string;
112
- buttonLineHeight: string;
113
- buttonWidth: string;
114
- buttonSmallWidth: string;
116
+ border: string;
115
117
  };
116
118
  color: {
117
119
  black: string;
@@ -142,22 +144,27 @@ export declare const MenuLink: import("styled-components").StyledComponent<"a",
142
144
  gray5: string;
143
145
  };
144
146
  fontFamily: {
145
- baseFontFamily: string;
147
+ default: string;
148
+ heading: string;
149
+ numerals: string;
146
150
  };
147
151
  fontSize: {
148
- defaultFontSize: string;
149
- smallFontSize: string;
150
- extraSmallFontSize: string;
151
- xsFontSize: string;
152
- xxsFontSize: string;
153
- h1FontSize: string;
154
- h2FontSize: string;
155
- h2MobileFontSize: string;
156
- h3FontSize: string;
157
- h4FontSize: string;
158
- h5FontSize: string;
159
- heroBannerTitleFontSize: string;
160
- heroBannerTitleMobileFontSize: string;
152
+ default: string;
153
+ xl: string;
154
+ l: string;
155
+ s: string;
156
+ xs: string;
157
+ h1XL: string;
158
+ h1L: string;
159
+ h1M: string;
160
+ h1S: string;
161
+ h2M: string;
162
+ h2S: string;
163
+ h3: string;
164
+ h4: string;
165
+ h5: string;
166
+ h1: string;
167
+ h2: string;
161
168
  };
162
169
  fontWeight: {
163
170
  book: number;
@@ -173,16 +180,23 @@ export declare const MenuLink: import("styled-components").StyledComponent<"a",
173
180
  gutter: string;
174
181
  };
175
182
  lineHeight: {
176
- defaultLineHeight: string;
177
- paragraphLineHeight: string;
178
- heroBannerLineHeight: string;
179
- heroBannerMobileLineHeight: string;
180
- h1LineHeight: string;
181
- h2LineHeight: string;
182
- h2MobileLineHeight: string;
183
- h3LineHeight: string;
184
- h4LineHeight: string;
185
- h5LineHeight: string;
183
+ default: string;
184
+ xl: string;
185
+ s: string;
186
+ xs: string;
187
+ xxs: string;
188
+ auto: string;
189
+ h1XL: string;
190
+ h1L: string;
191
+ h1M: string;
192
+ h1S: string;
193
+ h2M: string;
194
+ h2S: string;
195
+ h3: string;
196
+ h4: string;
197
+ h5: string;
198
+ h1: string;
199
+ h2: string;
186
200
  };
187
201
  media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
188
202
  }, {
@@ -201,12 +215,7 @@ export declare const MenuLinkWithChildren: import("styled-components").StyledCom
201
215
  };
202
216
  breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
203
217
  button: {
204
- buttonBorderWidth: string;
205
- buttonPadding: string;
206
- smallButtonPadding: string;
207
- buttonLineHeight: string;
208
- buttonWidth: string;
209
- buttonSmallWidth: string;
218
+ border: string;
210
219
  };
211
220
  color: {
212
221
  black: string;
@@ -237,22 +246,27 @@ export declare const MenuLinkWithChildren: import("styled-components").StyledCom
237
246
  gray5: string;
238
247
  };
239
248
  fontFamily: {
240
- baseFontFamily: string;
249
+ default: string;
250
+ heading: string;
251
+ numerals: string;
241
252
  };
242
253
  fontSize: {
243
- defaultFontSize: string;
244
- smallFontSize: string;
245
- extraSmallFontSize: string;
246
- xsFontSize: string;
247
- xxsFontSize: string;
248
- h1FontSize: string;
249
- h2FontSize: string;
250
- h2MobileFontSize: string;
251
- h3FontSize: string;
252
- h4FontSize: string;
253
- h5FontSize: string;
254
- heroBannerTitleFontSize: string;
255
- heroBannerTitleMobileFontSize: string;
254
+ default: string;
255
+ xl: string;
256
+ l: string;
257
+ s: string;
258
+ xs: string;
259
+ h1XL: string;
260
+ h1L: string;
261
+ h1M: string;
262
+ h1S: string;
263
+ h2M: string;
264
+ h2S: string;
265
+ h3: string;
266
+ h4: string;
267
+ h5: string;
268
+ h1: string;
269
+ h2: string;
256
270
  };
257
271
  fontWeight: {
258
272
  book: number;
@@ -268,16 +282,23 @@ export declare const MenuLinkWithChildren: import("styled-components").StyledCom
268
282
  gutter: string;
269
283
  };
270
284
  lineHeight: {
271
- defaultLineHeight: string;
272
- paragraphLineHeight: string;
273
- heroBannerLineHeight: string;
274
- heroBannerMobileLineHeight: string;
275
- h1LineHeight: string;
276
- h2LineHeight: string;
277
- h2MobileLineHeight: string;
278
- h3LineHeight: string;
279
- h4LineHeight: string;
280
- h5LineHeight: string;
285
+ default: string;
286
+ xl: string;
287
+ s: string;
288
+ xs: string;
289
+ xxs: string;
290
+ auto: string;
291
+ h1XL: string;
292
+ h1L: string;
293
+ h1M: string;
294
+ h1S: string;
295
+ h2M: string;
296
+ h2S: string;
297
+ h3: string;
298
+ h4: string;
299
+ h5: string;
300
+ h1: string;
301
+ h2: string;
281
302
  };
282
303
  media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
283
304
  }, {
@@ -297,12 +318,7 @@ export declare const MenuList: import("styled-components").StyledComponent<"ul",
297
318
  };
298
319
  breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
299
320
  button: {
300
- buttonBorderWidth: string;
301
- buttonPadding: string;
302
- smallButtonPadding: string;
303
- buttonLineHeight: string;
304
- buttonWidth: string;
305
- buttonSmallWidth: string;
321
+ border: string;
306
322
  };
307
323
  color: {
308
324
  black: string;
@@ -333,22 +349,27 @@ export declare const MenuList: import("styled-components").StyledComponent<"ul",
333
349
  gray5: string;
334
350
  };
335
351
  fontFamily: {
336
- baseFontFamily: string;
352
+ default: string;
353
+ heading: string;
354
+ numerals: string;
337
355
  };
338
356
  fontSize: {
339
- defaultFontSize: string;
340
- smallFontSize: string;
341
- extraSmallFontSize: string;
342
- xsFontSize: string;
343
- xxsFontSize: string;
344
- h1FontSize: string;
345
- h2FontSize: string;
346
- h2MobileFontSize: string;
347
- h3FontSize: string;
348
- h4FontSize: string;
349
- h5FontSize: string;
350
- heroBannerTitleFontSize: string;
351
- heroBannerTitleMobileFontSize: string;
357
+ default: string;
358
+ xl: string;
359
+ l: string;
360
+ s: string;
361
+ xs: string;
362
+ h1XL: string;
363
+ h1L: string;
364
+ h1M: string;
365
+ h1S: string;
366
+ h2M: string;
367
+ h2S: string;
368
+ h3: string;
369
+ h4: string;
370
+ h5: string;
371
+ h1: string;
372
+ h2: string;
352
373
  };
353
374
  fontWeight: {
354
375
  book: number;
@@ -364,16 +385,23 @@ export declare const MenuList: import("styled-components").StyledComponent<"ul",
364
385
  gutter: string;
365
386
  };
366
387
  lineHeight: {
367
- defaultLineHeight: string;
368
- paragraphLineHeight: string;
369
- heroBannerLineHeight: string;
370
- heroBannerMobileLineHeight: string;
371
- h1LineHeight: string;
372
- h2LineHeight: string;
373
- h2MobileLineHeight: string;
374
- h3LineHeight: string;
375
- h4LineHeight: string;
376
- h5LineHeight: string;
388
+ default: string;
389
+ xl: string;
390
+ s: string;
391
+ xs: string;
392
+ xxs: string;
393
+ auto: string;
394
+ h1XL: string;
395
+ h1L: string;
396
+ h1M: string;
397
+ h1S: string;
398
+ h2M: string;
399
+ h2S: string;
400
+ h3: string;
401
+ h4: string;
402
+ h5: string;
403
+ h1: string;
404
+ h2: string;
377
405
  };
378
406
  media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
379
407
  }, {
@@ -1,38 +1,57 @@
1
1
  import React from 'react';
2
- export interface NotificationProps {
3
- /** Allows to pass a custom className */
4
- className?: string;
5
- /** Dictates what the norification will say */
2
+ declare type NotificationType = 'info' | 'success' | 'warning' | 'error';
3
+ interface Props {
4
+ /**
5
+ * Depending on the passed type, the background color is determined
6
+ *
7
+ * @default 'info'
8
+ * @param {NotificationType} info Uses #007d91 color code as background color
9
+ * @param {NotificationType} success Uses #e80c0c color code as background color
10
+ * @param {NotificationType} warning Uses #00b201 color code as background color
11
+ * @param {NotificationType} error Uses #ff7800 color code as background color
12
+ */
13
+ type?: NotificationType;
14
+ /**
15
+ * Content of the ribbon
16
+ */
6
17
  children?: React.ReactNode;
7
18
  /**
19
+ * Allows to show or hide appropriate notification icon
20
+ *
8
21
  * @default false
9
22
  */
10
- /** Show icon */
11
- showIcon: boolean;
23
+ showIcon?: boolean;
12
24
  /**
25
+ * Allows to show and hide close button
26
+ *
13
27
  * @default false
14
28
  */
15
- /** Show close button */
16
- closeButton: boolean;
17
- /** onClick handler for close button */
18
- onClickCloseButton?: (event: React.MouseEvent<HTMLElement>) => void;
19
- /** Is the notification dismissed */
29
+ closeButton?: boolean;
20
30
  /**
31
+ * On close button click callback
32
+ */
33
+ onClickCloseButton?: (e: React.MouseEvent<HTMLElement>) => void;
34
+ /**
35
+ * Allows to dismiss the ribbon programmatically
36
+ *
21
37
  * @default false
22
38
  */
23
39
  dismissed?: boolean;
24
- /** Dictates what is the type and color of the notification */
25
40
  /**
26
- * @default 'info'
27
- */
28
- color: 'info' | 'success' | 'warning' | 'error' | 'pinkday';
29
- /** Align text center
41
+ * Allows to center text of the ribbon
30
42
  *
31
43
  * @default false
32
44
  */
33
45
  centered?: boolean;
46
+ /**
47
+ * Allows to pass a custom className
48
+ */
49
+ className?: string;
50
+ /**
51
+ * Allows to pass testid string for testing purposes
52
+ */
34
53
  'data-testid'?: string;
35
54
  }
36
- declare const Notification: (props: NotificationProps) => JSX.Element | null;
55
+ declare const Notification: ({ type, "data-testid": dataTestId, ...props }: Props) => JSX.Element;
37
56
  /** @component */
38
57
  export default Notification;
@@ -3,74 +3,51 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var styledUtils = require('../../utils/styledUtils.js');
7
6
  var styled = require('styled-components');
7
+ var theme = require('../../themes/theme.js');
8
+ var styledUtils = require('../../utils/styledUtils.js');
8
9
  var Icon = require('../Icon/Icon.js');
10
+ var Ribbon = require('../Ribbon/Ribbon.js');
9
11
 
10
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
13
 
12
14
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
15
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
14
16
 
15
- const iconAreaWidth = 4;
16
- const smallPadding = '0.55rem';
17
- const basePadding = '0.75rem';
18
- const NotificationStyle = styled__default['default'].div `
19
- color: ${({ color, theme }) => (color === 'pinkday' ? theme.color.text : theme.color.white)};
20
- background: ${props => props.theme.color[props.color]};
17
+ const StyledRibbon = styled__default['default'](Ribbon['default']) `
18
+ ${({ showIcon, closeButton }) => showIcon &&
19
+ closeButton &&
20
+ `
21
+ a:last-of-type {
22
+ ${styledUtils.getMultipliedSize(theme['default'].base.baseWidth, 1.2)}
23
+ }
24
+ `}
25
+ `;
26
+ const NotificationWrapper = styled__default['default'].div `
21
27
  display: flex;
22
28
  align-items: center;
23
- overflow: hidden;
24
- padding: ${basePadding} 0.9375rem;
25
- position: relative;
26
- opacity: 0.95;
27
- transition: all 0.3s;
28
- ${({ centered }) => (centered ? 'text-align:center;' : '')}
29
- a {
30
- color: ${({ color, theme }) => color === 'pinkday' ? theme.color.text : theme.color.white};
31
- text-decoration: underline;
32
- }
33
29
  `;
34
- const IconArea = styled__default['default'].div `
30
+ const IconWrapper = styled__default['default'].div `
35
31
  display: none;
36
32
  align-items: center;
37
- width: ${iconAreaWidth}rem;
33
+ width: ${styledUtils.getMultipliedSize(theme['default'].base.baseWidth, 6.4)};
38
34
  overflow: hidden;
35
+
39
36
  ${() => styledUtils.media.xs `
40
37
  display: flex;
41
38
  `}
42
39
  `;
43
- const TextArea = styled__default['default'].div `
40
+ const ContentWrapper = styled__default['default'].div `
44
41
  flex: 1;
45
- font-weight: ${props => props.theme.fontWeight.book};
46
- overflow: hidden;
47
- font-size: ${props => props.theme.fontSize.defaultFontSize};
48
- line-height: 1.5;
49
- position: relative;
50
- word-wrap: break-word;
51
- margin-right: ${props => props && props.closeButton ? styledUtils.getMultipliedSize(props.theme.base.baseWidth, 3) : 0};
52
- `;
53
- const CloseButton = styled__default['default'].a `
54
- position: absolute;
55
- top: ${props => (props && props.showIcon ? basePadding : smallPadding)};
56
- ${() => styledUtils.media.xs `
57
- top: ${basePadding};
58
- `}
59
- right: ${basePadding};
60
- margin: ${props => styledUtils.getDividedSize(props.theme.base.baseWidth, 2)};
61
- cursor: pointer;
62
42
  `;
63
- const Notification = (props) => {
64
- const { children, showIcon, color, dismissed, onClickCloseButton, closeButton, centered, className, 'data-testid': dataTestId, } = props;
65
- if (dismissed) {
66
- return null;
67
- }
68
- return (React__default['default'].createElement(NotificationStyle, { className: className, color: color, showIcon: showIcon, onClick: onClickCloseButton, closeButton: closeButton, "data-testid": dataTestId, centered: centered },
69
- showIcon ? (React__default['default'].createElement(IconArea, null,
70
- React__default['default'].createElement(Icon['default'], { name: color === 'success' ? 'hlCheck' : color, size: "2rem", color: "currentColor" }))) : null,
71
- React__default['default'].createElement(TextArea, { closeButton: closeButton }, children),
72
- closeButton ? (React__default['default'].createElement(CloseButton, { showIcon: showIcon, onClick: onClickCloseButton },
73
- React__default['default'].createElement(Icon['default'], { name: "x", size: "0.75rem", color: "currentColor" }))) : null));
43
+ const Notification = ({ type = 'info', 'data-testid': dataTestId, ...props }) => {
44
+ return (React__default['default'].createElement(StyledRibbon, { color: type, closeButton: props.closeButton, onClick: props.onClickCloseButton, dismissed: props.dismissed, centered: props.centered, className: props.className, "data-testid": dataTestId },
45
+ React__default['default'].createElement(NotificationWrapper, null,
46
+ props.showIcon && (React__default['default'].createElement(IconWrapper, null,
47
+ React__default['default'].createElement(Icon['default'], { name: type === 'success'
48
+ ? 'hlCheck'
49
+ : `hl${type.charAt(0).toUpperCase() + type.slice(1)}`, size: "2rem", color: "currentColor" }))),
50
+ React__default['default'].createElement(ContentWrapper, null, props.children))));
74
51
  };
75
52
 
76
53
  exports.default = Notification;
@@ -12,12 +12,7 @@ export declare const NotificationBadge: import("styled-components").StyledCompon
12
12
  };
13
13
  breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
14
14
  button: {
15
- buttonBorderWidth: string;
16
- buttonPadding: string;
17
- smallButtonPadding: string;
18
- buttonLineHeight: string;
19
- buttonWidth: string;
20
- buttonSmallWidth: string;
15
+ border: string;
21
16
  };
22
17
  color: {
23
18
  black: string;
@@ -48,22 +43,27 @@ export declare const NotificationBadge: import("styled-components").StyledCompon
48
43
  gray5: string;
49
44
  };
50
45
  fontFamily: {
51
- baseFontFamily: string;
46
+ default: string;
47
+ heading: string;
48
+ numerals: string;
52
49
  };
53
50
  fontSize: {
54
- defaultFontSize: string;
55
- smallFontSize: string;
56
- extraSmallFontSize: string;
57
- xsFontSize: string;
58
- xxsFontSize: string;
59
- h1FontSize: string;
60
- h2FontSize: string;
61
- h2MobileFontSize: string;
62
- h3FontSize: string;
63
- h4FontSize: string;
64
- h5FontSize: string;
65
- heroBannerTitleFontSize: string;
66
- heroBannerTitleMobileFontSize: string;
51
+ default: string;
52
+ xl: string;
53
+ l: string;
54
+ s: string;
55
+ xs: string;
56
+ h1XL: string;
57
+ h1L: string;
58
+ h1M: string;
59
+ h1S: string;
60
+ h2M: string;
61
+ h2S: string;
62
+ h3: string;
63
+ h4: string;
64
+ h5: string;
65
+ h1: string;
66
+ h2: string;
67
67
  };
68
68
  fontWeight: {
69
69
  book: number;
@@ -79,16 +79,23 @@ export declare const NotificationBadge: import("styled-components").StyledCompon
79
79
  gutter: string; /** @visibleName Notification Badge */
80
80
  };
81
81
  lineHeight: {
82
- defaultLineHeight: string;
83
- paragraphLineHeight: string;
84
- heroBannerLineHeight: string;
85
- heroBannerMobileLineHeight: string;
86
- h1LineHeight: string;
87
- h2LineHeight: string;
88
- h2MobileLineHeight: string;
89
- h3LineHeight: string;
90
- h4LineHeight: string;
91
- h5LineHeight: string;
82
+ default: string;
83
+ xl: string;
84
+ s: string;
85
+ xs: string;
86
+ xxs: string;
87
+ auto: string;
88
+ h1XL: string;
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;
92
99
  };
93
100
  media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
94
101
  }, {}, never>;
@@ -18,7 +18,7 @@ const NotificationBadge = styled['default'].div `
18
18
  align-items: center;
19
19
  justify-content: center;
20
20
  font-weight: ${p => p.theme.fontWeight.bold};
21
- font-size: ${p => p.theme.fontSize.xsFontSize};
21
+ font-size: ${p => p.theme.fontSize.xs};
22
22
  line-height: 1;
23
23
  `;
24
24