@zendeskgarden/react-notifications 9.0.0-next.14 → 9.0.0-next.16
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/Alert.js +6 -6
- package/dist/esm/elements/Notification.js +4 -5
- package/dist/esm/elements/Well.js +12 -3
- package/dist/esm/elements/content/Close.js +7 -4
- package/dist/esm/elements/content/Title.js +10 -3
- package/dist/esm/elements/global-alert/GlobalAlert.js +23 -10
- 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/styled/StyledAlert.js +29 -3
- package/dist/esm/styled/StyledBase.js +72 -25
- package/dist/esm/styled/StyledIcon.js +47 -4
- package/dist/esm/styled/StyledNotification.js +19 -25
- package/dist/esm/styled/StyledWell.js +28 -4
- package/dist/esm/styled/content/StyledClose.js +53 -8
- package/dist/esm/styled/content/StyledParagraph.js +1 -1
- package/dist/esm/styled/content/StyledTitle.js +6 -3
- package/dist/esm/styled/global-alert/StyledGlobalAlert.js +113 -38
- package/dist/esm/styled/global-alert/StyledGlobalAlertButton.js +78 -33
- package/dist/esm/styled/global-alert/StyledGlobalAlertClose.js +62 -31
- package/dist/esm/styled/global-alert/StyledGlobalAlertContent.js +2 -2
- package/dist/esm/styled/global-alert/StyledGlobalAlertIcon.js +40 -4
- package/dist/esm/styled/global-alert/StyledGlobalAlertTitle.js +20 -9
- package/dist/esm/utils/icons.js +6 -6
- package/dist/index.cjs.js +765 -370
- 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 -1
- 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 +5 -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 +3 -9
- package/dist/typings/styled/global-alert/StyledGlobalAlertClose.d.ts +3 -3
- 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 -1
- package/dist/typings/utils/useNotificationsContext.d.ts +2 -3
- package/package.json +4 -4
- 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
|
@@ -5,32 +5,43 @@
|
|
|
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, DEFAULT_THEME,
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, 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-next.
|
|
40
|
+
'data-garden-version': '9.0.0-next.16'
|
|
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
|
|
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));
|
|
34
45
|
StyledGlobalAlertTitle.defaultProps = {
|
|
35
46
|
theme: DEFAULT_THEME
|
|
36
47
|
};
|
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 };
|