@dnanpm/styleguide 1.8.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/components/Accordion/Accordion.d.ts +50 -0
- package/build/cjs/components/Accordion/Accordion.js +52 -0
- package/build/cjs/components/Accordion/AccordionItem.d.ts +30 -0
- package/build/cjs/components/Accordion/AccordionItem.js +77 -0
- package/build/cjs/components/AmountSelector/AmountSelector.js +5 -6
- package/build/cjs/components/Buttons/ButtonBasicStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonBasicStyles.js +10 -14
- package/build/cjs/components/Buttons/ButtonDefault.js +6 -2
- package/build/cjs/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonIconStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonPrimary.js +6 -2
- package/build/cjs/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonSecondary.js +7 -3
- package/build/cjs/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/ButtonTertiary.js +7 -3
- package/build/cjs/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
- package/build/cjs/components/Buttons/CloseButton.d.ts +37 -30
- package/build/cjs/components/Card/Card.js +4 -2
- package/build/cjs/components/Card/CardRow.js +3 -3
- package/build/cjs/components/Checkbox/Checkbox.d.ts +38 -12
- package/build/cjs/components/Checkbox/Checkbox.js +37 -70
- package/build/cjs/components/DnaLogo/DnaLogo.d.ts +37 -40
- package/build/cjs/components/Footer/Components/FooterComponents.js +3 -2
- package/build/cjs/components/Helper/Helper.js +2 -1
- package/build/cjs/components/Icon/Icon.d.ts +39 -30
- package/build/cjs/components/Icon/Icons.d.ts +1 -4
- package/build/cjs/components/Icon/Icons.js +3 -7
- package/build/cjs/components/Input/Input.d.ts +102 -13
- package/build/cjs/components/Input/Input.js +57 -58
- package/build/cjs/components/Label/Label.js +2 -3
- package/build/cjs/components/LabelText/LabelText.d.ts +38 -30
- package/build/cjs/components/LabelText/LabelText.js +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +4 -10
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +18 -12
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.js +2 -2
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +1 -4
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
- package/build/cjs/components/MainNavigation/MainNavigation.js +1 -17
- package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +148 -120
- package/build/cjs/components/Notification/Notification.d.ts +36 -17
- package/build/cjs/components/Notification/Notification.js +25 -48
- package/build/cjs/components/NotificationBadge/NotificationBadge.d.ts +37 -30
- package/build/cjs/components/NotificationBadge/NotificationBadge.js +1 -1
- package/build/cjs/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +3 -3
- package/build/cjs/components/RadioButton/RadioButton.d.ts +33 -17
- package/build/cjs/components/RadioButton/RadioButton.js +12 -57
- package/build/cjs/components/ReadMore/ReadMore.js +2 -7
- package/build/cjs/components/Ribbon/Ribbon.d.ts +57 -0
- package/build/cjs/components/Ribbon/Ribbon.js +80 -0
- package/build/cjs/components/Search/Search.js +2 -1
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
- package/build/cjs/components/Selectbox/Selectbox.d.ts +102 -13
- package/build/cjs/components/Selectbox/Selectbox.js +40 -49
- package/build/cjs/components/Tabs/Tab.d.ts +37 -30
- package/build/cjs/components/Tabs/Tab.js +3 -2
- package/build/cjs/components/Tabs/Tabs.d.ts +40 -30
- package/build/cjs/components/Textarea/Textarea.js +4 -3
- package/build/cjs/components/Tooltip/Tooltip.d.ts +37 -30
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
- package/build/cjs/components/index.d.ts +4 -1
- package/build/cjs/hooks/useElementDimensions.d.ts +5 -0
- package/build/cjs/hooks/useElementDimensions.js +37 -0
- package/build/cjs/index.js +6 -0
- package/build/cjs/themes/globalStyles.d.ts +174 -60
- package/build/cjs/themes/globalStyles.js +132 -142
- package/build/cjs/themes/styled.d.ts +259 -210
- package/build/cjs/themes/theme.d.ts +37 -30
- package/build/cjs/themes/themeComponents/buttons.d.ts +1 -6
- package/build/cjs/themes/themeComponents/buttons.js +1 -6
- package/build/cjs/themes/themeComponents/fontFamily.d.ts +3 -1
- package/build/cjs/themes/themeComponents/fontFamily.js +3 -1
- package/build/cjs/themes/themeComponents/fontSize.d.ts +18 -15
- package/build/cjs/themes/themeComponents/fontSize.js +20 -14
- package/build/cjs/themes/themeComponents/lineHeight.d.ts +19 -12
- package/build/cjs/themes/themeComponents/lineHeight.js +21 -11
- package/build/es/components/Accordion/Accordion.d.ts +50 -0
- package/build/es/components/Accordion/Accordion.js +44 -0
- package/build/es/components/Accordion/AccordionItem.d.ts +30 -0
- package/build/es/components/Accordion/AccordionItem.js +68 -0
- package/build/es/components/AmountSelector/AmountSelector.js +5 -6
- package/build/es/components/Buttons/ButtonBasicStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonBasicStyles.js +10 -14
- package/build/es/components/Buttons/ButtonDefault.js +6 -2
- package/build/es/components/Buttons/ButtonIconPrimaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonIconStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonPrimary.js +6 -2
- package/build/es/components/Buttons/ButtonPrimaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonSecondary.js +7 -3
- package/build/es/components/Buttons/ButtonSecondaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/ButtonTertiary.js +7 -3
- package/build/es/components/Buttons/ButtonTertiaryStyles.d.ts +37 -30
- package/build/es/components/Buttons/CloseButton.d.ts +37 -30
- package/build/es/components/Card/Card.js +4 -2
- package/build/es/components/Card/CardRow.js +3 -3
- package/build/es/components/Checkbox/Checkbox.d.ts +38 -12
- package/build/es/components/Checkbox/Checkbox.js +39 -72
- package/build/es/components/DnaLogo/DnaLogo.d.ts +37 -40
- package/build/es/components/Footer/Components/FooterComponents.js +3 -2
- package/build/es/components/Helper/Helper.js +2 -1
- package/build/es/components/Icon/Icon.d.ts +39 -30
- package/build/es/components/Icon/Icons.d.ts +1 -4
- package/build/es/components/Icon/Icons.js +3 -7
- package/build/es/components/Input/Input.d.ts +102 -13
- package/build/es/components/Input/Input.js +57 -58
- package/build/es/components/Label/Label.js +2 -3
- package/build/es/components/LabelText/LabelText.d.ts +38 -30
- package/build/es/components/LabelText/LabelText.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +4 -10
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +18 -12
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +37 -30
- package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +2 -2
- package/build/es/components/MainNavigation/ChildComponents/LinkModifier.js +2 -2
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +37 -30
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +2 -5
- package/build/es/components/MainNavigation/ChildComponents/MobileMenu.js +1 -1
- package/build/es/components/MainNavigation/ChildComponents/Ribbon.js +1 -1
- package/build/es/components/MainNavigation/MainNavigation.js +2 -17
- package/build/es/components/MainNavigation/globalNavStyles.d.ts +148 -120
- package/build/es/components/Notification/Notification.d.ts +36 -17
- package/build/es/components/Notification/Notification.js +25 -48
- package/build/es/components/NotificationBadge/NotificationBadge.d.ts +37 -30
- package/build/es/components/NotificationBadge/NotificationBadge.js +1 -1
- package/build/es/components/PixelLoader/PixelLoaderStyles.d.ts +74 -60
- package/build/es/components/ProgressIndicator/ProgressIndicator.js +3 -3
- package/build/es/components/RadioButton/RadioButton.d.ts +33 -17
- package/build/es/components/RadioButton/RadioButton.js +12 -57
- package/build/es/components/ReadMore/ReadMore.js +2 -7
- package/build/es/components/Ribbon/Ribbon.d.ts +57 -0
- package/build/es/components/Ribbon/Ribbon.js +71 -0
- package/build/es/components/Search/Search.js +2 -1
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +2 -2
- package/build/es/components/Selectbox/Selectbox.d.ts +102 -13
- package/build/es/components/Selectbox/Selectbox.js +40 -49
- package/build/es/components/Tabs/Tab.d.ts +37 -30
- package/build/es/components/Tabs/Tab.js +3 -2
- package/build/es/components/Tabs/Tabs.d.ts +40 -30
- package/build/es/components/Textarea/Textarea.js +4 -3
- package/build/es/components/Tooltip/Tooltip.d.ts +37 -30
- package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +74 -60
- package/build/es/components/index.d.ts +4 -1
- package/build/es/hooks/useElementDimensions.d.ts +5 -0
- package/build/es/hooks/useElementDimensions.js +33 -0
- package/build/es/index.js +3 -0
- package/build/es/themes/globalStyles.d.ts +174 -60
- package/build/es/themes/globalStyles.js +134 -145
- package/build/es/themes/styled.d.ts +259 -210
- package/build/es/themes/theme.d.ts +37 -30
- package/build/es/themes/themeComponents/buttons.d.ts +1 -6
- package/build/es/themes/themeComponents/buttons.js +1 -6
- package/build/es/themes/themeComponents/fontFamily.d.ts +3 -1
- package/build/es/themes/themeComponents/fontFamily.js +3 -1
- package/build/es/themes/themeComponents/fontSize.d.ts +18 -15
- package/build/es/themes/themeComponents/fontSize.js +20 -14
- package/build/es/themes/themeComponents/lineHeight.d.ts +19 -12
- package/build/es/themes/themeComponents/lineHeight.js +21 -11
- package/package.json +3 -4
|
@@ -11,12 +11,7 @@ export declare const MenuItem: import("styled-components").StyledComponent<"li",
|
|
|
11
11
|
};
|
|
12
12
|
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
13
13
|
button: {
|
|
14
|
-
|
|
15
|
-
buttonPadding: string;
|
|
16
|
-
smallButtonPadding: string;
|
|
17
|
-
buttonLineHeight: string;
|
|
18
|
-
buttonWidth: string;
|
|
19
|
-
buttonSmallWidth: string;
|
|
14
|
+
border: string;
|
|
20
15
|
};
|
|
21
16
|
color: {
|
|
22
17
|
black: string;
|
|
@@ -47,22 +42,27 @@ export declare const MenuItem: import("styled-components").StyledComponent<"li",
|
|
|
47
42
|
gray5: string;
|
|
48
43
|
};
|
|
49
44
|
fontFamily: {
|
|
50
|
-
|
|
45
|
+
default: string;
|
|
46
|
+
heading: string;
|
|
47
|
+
numerals: string;
|
|
51
48
|
};
|
|
52
49
|
fontSize: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
default: string;
|
|
51
|
+
xl: string;
|
|
52
|
+
l: string;
|
|
53
|
+
s: string;
|
|
54
|
+
xs: string;
|
|
55
|
+
h1XL: string;
|
|
56
|
+
h1L: string;
|
|
57
|
+
h1M: string;
|
|
58
|
+
h1S: string;
|
|
59
|
+
h2M: string;
|
|
60
|
+
h2S: string;
|
|
61
|
+
h3: string;
|
|
62
|
+
h4: string;
|
|
63
|
+
h5: string;
|
|
64
|
+
h1: string;
|
|
65
|
+
h2: string;
|
|
66
66
|
};
|
|
67
67
|
fontWeight: {
|
|
68
68
|
book: number;
|
|
@@ -78,16 +78,23 @@ export declare const MenuItem: import("styled-components").StyledComponent<"li",
|
|
|
78
78
|
gutter: string;
|
|
79
79
|
};
|
|
80
80
|
lineHeight: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
default: string;
|
|
82
|
+
xl: string;
|
|
83
|
+
s: string;
|
|
84
|
+
xs: string;
|
|
85
|
+
xxs: string;
|
|
86
|
+
auto: string;
|
|
87
|
+
h1XL: string;
|
|
88
|
+
h1L: string;
|
|
89
|
+
h1M: string;
|
|
90
|
+
h1S: string;
|
|
91
|
+
h2M: string;
|
|
92
|
+
h2S: string;
|
|
93
|
+
h3: string;
|
|
94
|
+
h4: string;
|
|
95
|
+
h5: string;
|
|
96
|
+
h1: string;
|
|
97
|
+
h2: string;
|
|
91
98
|
};
|
|
92
99
|
media: Record<string | number, (l: TemplateStringsArray, ...p: any[]) => string>;
|
|
93
100
|
}, {
|
|
@@ -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
|
-
|
|
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
|
-
|
|
147
|
+
default: string;
|
|
148
|
+
heading: string;
|
|
149
|
+
numerals: string;
|
|
146
150
|
};
|
|
147
151
|
fontSize: {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
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
|
-
|
|
249
|
+
default: string;
|
|
250
|
+
heading: string;
|
|
251
|
+
numerals: string;
|
|
241
252
|
};
|
|
242
253
|
fontSize: {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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
|
-
|
|
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
|
-
|
|
352
|
+
default: string;
|
|
353
|
+
heading: string;
|
|
354
|
+
numerals: string;
|
|
337
355
|
};
|
|
338
356
|
fontSize: {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
11
|
-
showIcon: boolean;
|
|
23
|
+
showIcon?: boolean;
|
|
12
24
|
/**
|
|
25
|
+
* Allows to show and hide close button
|
|
26
|
+
*
|
|
13
27
|
* @default false
|
|
14
28
|
*/
|
|
15
|
-
|
|
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
|
-
*
|
|
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:
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
30
|
+
const IconWrapper = styled__default['default'].div `
|
|
35
31
|
display: none;
|
|
36
32
|
align-items: center;
|
|
37
|
-
width: ${
|
|
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
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
React__default['default'].createElement(
|
|
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
|
-
|
|
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
|
-
|
|
46
|
+
default: string;
|
|
47
|
+
heading: string;
|
|
48
|
+
numerals: string;
|
|
52
49
|
};
|
|
53
50
|
fontSize: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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.
|
|
21
|
+
font-size: ${p => p.theme.fontSize.xs};
|
|
22
22
|
line-height: 1;
|
|
23
23
|
`;
|
|
24
24
|
|