@zendeskgarden/react-notifications 9.0.0-next.8 → 9.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.
- package/dist/esm/elements/Close.js +40 -0
- package/dist/esm/elements/Notification.js +13 -14
- package/dist/esm/elements/{Well.js → Paragraph.js} +5 -15
- package/dist/esm/elements/Title.js +35 -0
- package/dist/esm/elements/alert/Alert.js +56 -0
- package/dist/esm/elements/{content → alert}/Close.js +8 -5
- package/dist/esm/elements/{content → alert}/Paragraph.js +1 -1
- package/dist/esm/elements/{content → alert}/Title.js +11 -4
- package/dist/esm/elements/global-alert/GlobalAlert.js +29 -15
- package/dist/esm/elements/global-alert/GlobalAlertButton.js +3 -2
- package/dist/esm/elements/global-alert/GlobalAlertClose.js +5 -3
- package/dist/esm/elements/global-alert/GlobalAlertTitle.js +8 -3
- package/dist/esm/elements/toaster/styled.js +0 -7
- package/dist/esm/elements/well/Well.js +47 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/info-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +1 -1
- package/dist/esm/styled/StyledAlert.js +29 -6
- package/dist/esm/styled/StyledBase.js +62 -27
- package/dist/esm/styled/StyledIcon.js +44 -11
- package/dist/esm/styled/StyledNotification.js +19 -28
- package/dist/esm/styled/StyledWell.js +28 -7
- package/dist/esm/styled/content/StyledClose.js +53 -11
- package/dist/esm/styled/content/StyledParagraph.js +2 -5
- package/dist/esm/styled/content/StyledTitle.js +6 -6
- package/dist/esm/styled/global-alert/StyledGlobalAlert.js +113 -41
- package/dist/esm/styled/global-alert/StyledGlobalAlertButton.js +76 -36
- package/dist/esm/styled/global-alert/StyledGlobalAlertClose.js +60 -34
- package/dist/esm/styled/global-alert/StyledGlobalAlertContent.js +3 -6
- package/dist/esm/styled/global-alert/StyledGlobalAlertIcon.js +39 -13
- package/dist/esm/styled/global-alert/StyledGlobalAlertTitle.js +20 -12
- package/dist/esm/utils/icons.js +6 -6
- package/dist/index.cjs.js +800 -446
- package/dist/typings/elements/Notification.d.ts +4 -4
- package/dist/typings/elements/{content/Title.d.ts → Title.d.ts} +1 -1
- package/dist/typings/elements/{Alert.d.ts → alert/Alert.d.ts} +5 -5
- package/dist/typings/elements/alert/Close.d.ts +11 -0
- package/dist/typings/elements/alert/Paragraph.d.ts +11 -0
- package/dist/typings/elements/alert/Title.d.ts +12 -0
- package/dist/typings/elements/global-alert/GlobalAlert.d.ts +8 -1
- package/dist/typings/elements/toaster/Toast.d.ts +0 -1
- package/dist/typings/elements/well/Paragraph.d.ts +11 -0
- package/dist/typings/elements/well/Title.d.ts +12 -0
- package/dist/typings/elements/{Well.d.ts → well/Well.d.ts} +4 -4
- package/dist/typings/index.d.ts +5 -5
- package/dist/typings/styled/StyledAlert.d.ts +8 -3
- package/dist/typings/styled/StyledBase.d.ts +8 -6
- package/dist/typings/styled/StyledIcon.d.ts +10 -2
- package/dist/typings/styled/StyledNotification.d.ts +11 -3
- package/dist/typings/styled/StyledWell.d.ts +7 -2
- package/dist/typings/styled/content/StyledClose.d.ts +4 -3
- package/dist/typings/styled/content/StyledTitle.d.ts +1 -1
- package/dist/typings/styled/global-alert/StyledGlobalAlert.d.ts +1 -1
- package/dist/typings/styled/global-alert/StyledGlobalAlertButton.d.ts +4 -18
- package/dist/typings/styled/global-alert/StyledGlobalAlertClose.d.ts +2 -4
- package/dist/typings/styled/global-alert/StyledGlobalAlertIcon.d.ts +1 -2
- package/dist/typings/styled/global-alert/StyledGlobalAlertTitle.d.ts +2 -2
- package/dist/typings/utils/icons.d.ts +1 -1
- package/dist/typings/{elements/global-alert/utility.d.ts → utils/useGlobalAlertContext.d.ts} +1 -2
- package/dist/typings/utils/useNotificationsContext.d.ts +2 -4
- package/package.json +9 -10
- package/LICENSE.md +0 -176
- package/dist/esm/elements/Alert.js +0 -56
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/x-stroke.svg.js +0 -26
- /package/dist/esm/{elements/global-alert/utility.js → utils/useGlobalAlertContext.js} +0 -0
- /package/dist/typings/elements/{content/Close.d.ts → Close.d.ts} +0 -0
- /package/dist/typings/elements/{content/Paragraph.d.ts → Paragraph.d.ts} +0 -0
|
@@ -5,47 +5,97 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getColor, focusStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { Button } from '@zendeskgarden/react-buttons';
|
|
10
10
|
import { colorStyles as colorStyles$1 } from './StyledGlobalAlertClose.js';
|
|
11
11
|
|
|
12
|
-
const COMPONENT_ID = 'notifications.
|
|
12
|
+
const COMPONENT_ID = 'notifications.global_alert.button';
|
|
13
13
|
function colorStyles(props) {
|
|
14
|
-
|
|
14
|
+
const {
|
|
15
|
+
$alertType,
|
|
16
|
+
isBasic,
|
|
17
|
+
theme
|
|
18
|
+
} = props;
|
|
19
|
+
if (isBasic) {
|
|
15
20
|
return colorStyles$1(props);
|
|
16
21
|
}
|
|
17
|
-
let
|
|
18
|
-
let
|
|
19
|
-
let
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
+
let bgVariable;
|
|
23
|
+
let offsetOptions;
|
|
24
|
+
let offsetHoverOptions;
|
|
25
|
+
let offsetActiveOptions;
|
|
26
|
+
let focusVariable;
|
|
27
|
+
switch ($alertType) {
|
|
22
28
|
case 'success':
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
bgVariable = 'background.successEmphasis';
|
|
30
|
+
offsetOptions = {
|
|
31
|
+
offset: 200
|
|
32
|
+
};
|
|
33
|
+
offsetHoverOptions = {
|
|
34
|
+
offset: 300
|
|
35
|
+
};
|
|
36
|
+
offsetActiveOptions = {
|
|
37
|
+
offset: 400
|
|
38
|
+
};
|
|
39
|
+
focusVariable = 'foreground.successEmphasis';
|
|
27
40
|
break;
|
|
28
41
|
case 'error':
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
bgVariable = 'background.dangerEmphasis';
|
|
43
|
+
offsetOptions = {
|
|
44
|
+
offset: 200
|
|
45
|
+
};
|
|
46
|
+
offsetHoverOptions = {
|
|
47
|
+
offset: 300
|
|
48
|
+
};
|
|
49
|
+
offsetActiveOptions = {
|
|
50
|
+
offset: 400
|
|
51
|
+
};
|
|
52
|
+
focusVariable = 'foreground.dangerEmphasis';
|
|
33
53
|
break;
|
|
34
54
|
case 'warning':
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
bgVariable = 'background.warningEmphasis';
|
|
56
|
+
offsetOptions = {};
|
|
57
|
+
offsetHoverOptions = {
|
|
58
|
+
offset: 100
|
|
59
|
+
};
|
|
60
|
+
offsetActiveOptions = {
|
|
61
|
+
offset: 200
|
|
62
|
+
};
|
|
63
|
+
focusVariable = 'foreground.warning';
|
|
39
64
|
break;
|
|
40
65
|
case 'info':
|
|
41
|
-
|
|
66
|
+
bgVariable = 'background.primaryEmphasis';
|
|
67
|
+
offsetOptions = {};
|
|
68
|
+
offsetHoverOptions = {
|
|
69
|
+
offset: 100
|
|
70
|
+
};
|
|
71
|
+
offsetActiveOptions = {
|
|
72
|
+
offset: 200
|
|
73
|
+
};
|
|
74
|
+
focusVariable = 'foreground.primary';
|
|
42
75
|
break;
|
|
43
76
|
}
|
|
44
|
-
|
|
45
|
-
|
|
77
|
+
const backgroundColor = getColor({
|
|
78
|
+
variable: bgVariable,
|
|
79
|
+
...offsetOptions,
|
|
80
|
+
theme
|
|
81
|
+
});
|
|
82
|
+
const hoverBackgroundColor = getColor({
|
|
83
|
+
variable: bgVariable,
|
|
84
|
+
...offsetHoverOptions,
|
|
85
|
+
theme
|
|
86
|
+
});
|
|
87
|
+
const activeBackgroundColor = getColor({
|
|
88
|
+
variable: bgVariable,
|
|
89
|
+
...offsetActiveOptions,
|
|
90
|
+
theme
|
|
91
|
+
});
|
|
92
|
+
return css(["background-color:", ";color:", ";&:hover{background-color:", ";}", " &:active{background-color:", ";}"], backgroundColor, getColor({
|
|
93
|
+
hue: 'white',
|
|
94
|
+
theme
|
|
95
|
+
}), hoverBackgroundColor, focusStyles({
|
|
96
|
+
theme,
|
|
46
97
|
color: {
|
|
47
|
-
|
|
48
|
-
shade: props.alertType === 'info' ? 600 : 800
|
|
98
|
+
variable: focusVariable
|
|
49
99
|
}
|
|
50
100
|
}), activeBackgroundColor);
|
|
51
101
|
}
|
|
@@ -56,20 +106,10 @@ function sizeStyles(props) {
|
|
|
56
106
|
}
|
|
57
107
|
const StyledGlobalAlertButton = styled(Button).attrs({
|
|
58
108
|
'data-garden-id': COMPONENT_ID,
|
|
59
|
-
'data-garden-version': '9.0.0
|
|
60
|
-
focusInset: false,
|
|
61
|
-
isDanger: false,
|
|
62
|
-
isLink: false,
|
|
63
|
-
isNeutral: false,
|
|
64
|
-
isPill: false,
|
|
65
|
-
isStretched: false,
|
|
66
|
-
size: 'small'
|
|
109
|
+
'data-garden-version': '9.0.0'
|
|
67
110
|
}).withConfig({
|
|
68
111
|
displayName: "StyledGlobalAlertButton",
|
|
69
112
|
componentId: "sc-1txe91a-0"
|
|
70
113
|
})(["flex-shrink:0;", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
71
|
-
StyledGlobalAlertButton.defaultProps = {
|
|
72
|
-
theme: DEFAULT_THEME
|
|
73
|
-
};
|
|
74
114
|
|
|
75
115
|
export { StyledGlobalAlertButton };
|
|
@@ -5,51 +5,81 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getColor, focusStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { IconButton } from '@zendeskgarden/react-buttons';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'notifications.
|
|
11
|
+
const COMPONENT_ID = 'notifications.global_alert.close';
|
|
12
12
|
const colorStyles = props => {
|
|
13
|
+
const {
|
|
14
|
+
$alertType,
|
|
15
|
+
theme
|
|
16
|
+
} = props;
|
|
13
17
|
let hoverBackgroundColor;
|
|
14
18
|
let hoverForegroundColor;
|
|
15
19
|
let activeBackgroundColor;
|
|
16
20
|
let activeForegroundColor;
|
|
17
|
-
let
|
|
18
|
-
switch (
|
|
21
|
+
let focusVariable;
|
|
22
|
+
switch ($alertType) {
|
|
19
23
|
case 'success':
|
|
20
|
-
hoverBackgroundColor =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
hoverBackgroundColor = getColor({
|
|
25
|
+
variable: 'background.success',
|
|
26
|
+
theme,
|
|
27
|
+
transparency: theme.opacity[100]
|
|
28
|
+
});
|
|
29
|
+
hoverForegroundColor = theme.palette.white;
|
|
30
|
+
activeBackgroundColor = getColor({
|
|
31
|
+
variable: 'background.success',
|
|
32
|
+
theme,
|
|
33
|
+
transparency: theme.opacity[200]
|
|
34
|
+
});
|
|
35
|
+
activeForegroundColor = theme.palette.white;
|
|
36
|
+
focusVariable = 'foreground.successEmphasis';
|
|
25
37
|
break;
|
|
26
38
|
case 'error':
|
|
27
|
-
hoverBackgroundColor =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
hoverBackgroundColor = getColor({
|
|
40
|
+
variable: 'background.danger',
|
|
41
|
+
theme,
|
|
42
|
+
transparency: theme.opacity[100]
|
|
43
|
+
});
|
|
44
|
+
hoverForegroundColor = theme.palette.white;
|
|
45
|
+
activeBackgroundColor = getColor({
|
|
46
|
+
variable: 'background.danger',
|
|
47
|
+
theme,
|
|
48
|
+
transparency: theme.opacity[200]
|
|
49
|
+
});
|
|
50
|
+
activeForegroundColor = theme.palette.white;
|
|
51
|
+
focusVariable = 'foreground.dangerEmphasis';
|
|
32
52
|
break;
|
|
33
53
|
case 'warning':
|
|
34
|
-
hoverBackgroundColor =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
hoverBackgroundColor = getColor({
|
|
55
|
+
variable: 'background.warningEmphasis',
|
|
56
|
+
transparency: theme.opacity[100],
|
|
57
|
+
theme
|
|
58
|
+
});
|
|
59
|
+
hoverForegroundColor = getColor({
|
|
60
|
+
variable: 'foreground.warningEmphasis',
|
|
61
|
+
offset: 200,
|
|
62
|
+
theme
|
|
63
|
+
});
|
|
64
|
+
activeBackgroundColor = getColor({
|
|
65
|
+
variable: 'background.warningEmphasis',
|
|
66
|
+
transparency: theme.opacity[200],
|
|
67
|
+
theme
|
|
68
|
+
});
|
|
69
|
+
activeForegroundColor = getColor({
|
|
70
|
+
variable: 'foreground.warningEmphasis',
|
|
71
|
+
offset: 300,
|
|
72
|
+
theme
|
|
73
|
+
});
|
|
74
|
+
focusVariable = 'foreground.warning';
|
|
46
75
|
break;
|
|
76
|
+
default:
|
|
77
|
+
focusVariable = 'foreground.primary';
|
|
47
78
|
}
|
|
48
79
|
return css(["color:inherit;&:hover{background-color:", ";color:", ";}", " &:active{background-color:", ";color:", ";}"], hoverBackgroundColor, hoverForegroundColor, focusStyles({
|
|
49
|
-
theme
|
|
80
|
+
theme,
|
|
50
81
|
color: {
|
|
51
|
-
|
|
52
|
-
shade: props.alertType === 'info' ? 600 : 800
|
|
82
|
+
variable: focusVariable
|
|
53
83
|
}
|
|
54
84
|
}), activeBackgroundColor, activeForegroundColor);
|
|
55
85
|
};
|
|
@@ -61,14 +91,10 @@ const sizeStyles = props => {
|
|
|
61
91
|
};
|
|
62
92
|
const StyledGlobalAlertClose = styled(IconButton).attrs({
|
|
63
93
|
'data-garden-id': COMPONENT_ID,
|
|
64
|
-
'data-garden-version': '9.0.0
|
|
65
|
-
size: 'small'
|
|
94
|
+
'data-garden-version': '9.0.0'
|
|
66
95
|
}).withConfig({
|
|
67
96
|
displayName: "StyledGlobalAlertClose",
|
|
68
97
|
componentId: "sc-1g5s93s-0"
|
|
69
98
|
})(["", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
70
|
-
StyledGlobalAlertClose.defaultProps = {
|
|
71
|
-
theme: DEFAULT_THEME
|
|
72
|
-
};
|
|
73
99
|
|
|
74
100
|
export { StyledGlobalAlertClose, colorStyles };
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'notifications.
|
|
10
|
+
const COMPONENT_ID = 'notifications.global_alert.content';
|
|
11
11
|
const StyledGlobalAlertContent = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0
|
|
13
|
+
'data-garden-version': '9.0.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledGlobalAlertContent",
|
|
16
16
|
componentId: "sc-rept0u-0"
|
|
17
17
|
})(["flex-grow:1;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledGlobalAlertContent.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledGlobalAlertContent };
|
|
@@ -4,33 +4,59 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React__default, { Children } from 'react';
|
|
8
7
|
import styled, { css } from 'styled-components';
|
|
9
8
|
import { math } from 'polished';
|
|
10
|
-
import { retrieveComponentStyles,
|
|
9
|
+
import { StyledBaseIcon, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
11
10
|
|
|
12
|
-
const COMPONENT_ID = 'notifications.
|
|
11
|
+
const COMPONENT_ID = 'notifications.global_alert.icon';
|
|
13
12
|
const sizeStyles = props => {
|
|
14
13
|
const size = props.theme.iconSizes.md;
|
|
15
14
|
const marginTop = math(`(${props.theme.space.base * 5} - ${size}) / 2`);
|
|
16
15
|
const marginHorizontal = `${props.theme.space.base * 2}px`;
|
|
17
16
|
return css(["margin-top:", ";margin-", ":", ";width:", ";height:", ";"], marginTop, props.theme.rtl ? 'left' : 'right', marginHorizontal, size, size);
|
|
18
17
|
};
|
|
19
|
-
const
|
|
18
|
+
const colorStyles = _ref => {
|
|
20
19
|
let {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
theme,
|
|
21
|
+
$alertType
|
|
23
22
|
} = _ref;
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
let color;
|
|
24
|
+
switch ($alertType) {
|
|
25
|
+
case 'success':
|
|
26
|
+
color = getColor({
|
|
27
|
+
variable: 'foreground.success',
|
|
28
|
+
offset: -400,
|
|
29
|
+
theme
|
|
30
|
+
});
|
|
31
|
+
break;
|
|
32
|
+
case 'error':
|
|
33
|
+
color = getColor({
|
|
34
|
+
variable: 'foreground.danger',
|
|
35
|
+
offset: -400,
|
|
36
|
+
theme
|
|
37
|
+
});
|
|
38
|
+
break;
|
|
39
|
+
case 'warning':
|
|
40
|
+
color = getColor({
|
|
41
|
+
variable: 'foreground.warning',
|
|
42
|
+
theme
|
|
43
|
+
});
|
|
44
|
+
break;
|
|
45
|
+
case 'info':
|
|
46
|
+
color = getColor({
|
|
47
|
+
variable: 'foreground.primary',
|
|
48
|
+
theme
|
|
49
|
+
});
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return css(["color:", ";"], color);
|
|
53
|
+
};
|
|
54
|
+
const StyledGlobalAlertIcon = styled(StyledBaseIcon).attrs({
|
|
26
55
|
'data-garden-id': COMPONENT_ID,
|
|
27
|
-
'data-garden-version': '9.0.0
|
|
56
|
+
'data-garden-version': '9.0.0'
|
|
28
57
|
}).withConfig({
|
|
29
58
|
displayName: "StyledGlobalAlertIcon",
|
|
30
59
|
componentId: "sc-84ne9k-0"
|
|
31
|
-
})(["flex-shrink:0;", ";", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
32
|
-
StyledGlobalAlertIcon.defaultProps = {
|
|
33
|
-
theme: DEFAULT_THEME
|
|
34
|
-
};
|
|
60
|
+
})(["flex-shrink:0;", ";", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
35
61
|
|
|
36
62
|
export { StyledGlobalAlertIcon };
|
|
@@ -5,34 +5,42 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'notifications.
|
|
11
|
-
const colorStyles =
|
|
10
|
+
const COMPONENT_ID = 'notifications.global_alert.title';
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
theme,
|
|
14
|
+
$alertType
|
|
15
|
+
} = _ref;
|
|
12
16
|
let color;
|
|
13
|
-
switch (
|
|
17
|
+
switch ($alertType) {
|
|
14
18
|
case 'success':
|
|
15
19
|
case 'error':
|
|
16
|
-
color =
|
|
20
|
+
color = theme.palette.white;
|
|
17
21
|
break;
|
|
18
22
|
case 'warning':
|
|
19
|
-
color =
|
|
23
|
+
color = getColor({
|
|
24
|
+
variable: 'foreground.warningEmphasis',
|
|
25
|
+
theme
|
|
26
|
+
});
|
|
20
27
|
break;
|
|
21
28
|
case 'info':
|
|
22
|
-
color =
|
|
29
|
+
color = getColor({
|
|
30
|
+
variable: 'foreground.primary',
|
|
31
|
+
offset: 200,
|
|
32
|
+
theme
|
|
33
|
+
});
|
|
23
34
|
break;
|
|
24
35
|
}
|
|
25
36
|
return css(["color:", ";"], color);
|
|
26
37
|
};
|
|
27
38
|
const StyledGlobalAlertTitle = styled.div.attrs({
|
|
28
39
|
'data-garden-id': COMPONENT_ID,
|
|
29
|
-
'data-garden-version': '9.0.0
|
|
40
|
+
'data-garden-version': '9.0.0'
|
|
30
41
|
}).withConfig({
|
|
31
42
|
displayName: "StyledGlobalAlertTitle",
|
|
32
43
|
componentId: "sc-10clqbo-0"
|
|
33
|
-
})(["display:inline;margin-", ":", "px;font-weight:", ";", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.space.base * 2, props => props
|
|
34
|
-
StyledGlobalAlertTitle.defaultProps = {
|
|
35
|
-
theme: DEFAULT_THEME
|
|
36
|
-
};
|
|
44
|
+
})(["display:inline;margin-", ":", "px;font-weight:", ";", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.space.base * 2, props => props.$isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
37
45
|
|
|
38
46
|
export { StyledGlobalAlertTitle };
|
package/dist/esm/utils/icons.js
CHANGED
|
@@ -15,11 +15,11 @@ const validationIcons = {
|
|
|
15
15
|
warning: SvgAlertWarningStroke,
|
|
16
16
|
info: SvgInfoStroke
|
|
17
17
|
};
|
|
18
|
-
const
|
|
19
|
-
success: '
|
|
20
|
-
error: '
|
|
21
|
-
warning: '
|
|
22
|
-
info: '
|
|
18
|
+
const validationTypes = {
|
|
19
|
+
success: 'success',
|
|
20
|
+
error: 'error',
|
|
21
|
+
warning: 'warning',
|
|
22
|
+
info: 'info'
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export {
|
|
25
|
+
export { validationIcons, validationTypes };
|