@zendeskgarden/react-notifications 9.0.0-next.2 → 9.0.0-next.21
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/README.md +6 -4
- package/dist/esm/elements/Close.js +40 -0
- package/dist/esm/elements/Notification.js +55 -0
- package/dist/esm/elements/Paragraph.js +28 -0
- package/dist/esm/elements/Title.js +35 -0
- package/dist/esm/elements/alert/Alert.js +56 -0
- package/dist/esm/elements/alert/Close.js +40 -0
- package/dist/esm/elements/alert/Paragraph.js +28 -0
- package/dist/esm/elements/alert/Title.js +35 -0
- package/dist/esm/elements/global-alert/GlobalAlert.js +78 -0
- package/dist/esm/elements/global-alert/GlobalAlertButton.js +47 -0
- package/dist/esm/elements/global-alert/GlobalAlertClose.js +43 -0
- package/dist/esm/elements/global-alert/GlobalAlertContent.js +30 -0
- package/dist/esm/elements/global-alert/GlobalAlertTitle.js +44 -0
- package/dist/esm/elements/toaster/Toast.js +62 -0
- package/dist/esm/elements/toaster/ToastContext.js +11 -0
- package/dist/esm/elements/toaster/ToastProvider.js +51 -0
- package/dist/esm/elements/toaster/ToastSlot.js +82 -0
- package/dist/esm/elements/toaster/reducer.js +66 -0
- package/dist/esm/elements/toaster/styled.js +71 -0
- package/dist/esm/elements/toaster/useToast.js +70 -0
- package/dist/esm/elements/well/Well.js +47 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +37 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-warning-stroke.svg.js +32 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/check-circle-stroke.svg.js +33 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/info-stroke.svg.js +37 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/x-stroke.svg.js +26 -0
- package/dist/esm/styled/StyledAlert.js +51 -0
- package/dist/esm/styled/StyledBase.js +92 -0
- package/dist/esm/styled/StyledIcon.js +61 -0
- package/dist/esm/styled/StyledNotification.js +56 -0
- package/dist/esm/styled/StyledWell.js +47 -0
- package/dist/esm/styled/content/StyledClose.js +70 -0
- package/dist/esm/styled/content/StyledParagraph.js +22 -0
- package/dist/esm/styled/content/StyledTitle.js +25 -0
- package/dist/esm/styled/global-alert/StyledGlobalAlert.js +160 -0
- package/dist/esm/styled/global-alert/StyledGlobalAlertButton.js +118 -0
- package/dist/esm/styled/global-alert/StyledGlobalAlertClose.js +103 -0
- package/dist/esm/styled/global-alert/StyledGlobalAlertContent.js +22 -0
- package/dist/esm/styled/global-alert/StyledGlobalAlertIcon.js +65 -0
- package/dist/esm/styled/global-alert/StyledGlobalAlertTitle.js +49 -0
- package/dist/esm/types/index.js +9 -0
- package/dist/esm/utils/icons.js +25 -0
- package/dist/esm/utils/useGlobalAlertContext.js +14 -0
- package/dist/esm/utils/useNotificationsContext.js +14 -0
- package/dist/index.cjs.js +837 -435
- package/dist/typings/elements/Close.d.ts +13 -0
- package/dist/typings/elements/Notification.d.ts +9 -1
- package/dist/typings/elements/Paragraph.d.ts +13 -0
- package/dist/typings/elements/{Well.d.ts → Title.d.ts} +4 -2
- package/dist/typings/elements/alert/Alert.d.ts +20 -0
- package/dist/typings/elements/well/Paragraph.d.ts +11 -0
- package/dist/typings/elements/{Alert.d.ts → well/Title.d.ts} +2 -2
- package/dist/typings/elements/well/Well.d.ts +18 -0
- package/dist/typings/index.d.ts +7 -11
- 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 +11 -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 +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 +4 -11
- package/dist/typings/styled/global-alert/StyledGlobalAlertClose.d.ts +2 -3
- package/dist/typings/styled/global-alert/StyledGlobalAlertIcon.d.ts +2 -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 -1
- package/dist/typings/utils/useNotificationsContext.d.ts +2 -3
- package/package.json +9 -9
- package/dist/index.esm.js +0 -1124
- /package/dist/typings/elements/{content → alert}/Close.d.ts +0 -0
- /package/dist/typings/elements/{content → alert}/Paragraph.d.ts +0 -0
- /package/dist/typings/elements/{content → alert}/Title.d.ts +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledTitle } from './content/StyledTitle.js';
|
|
10
|
+
import { StyledBase } from './StyledBase.js';
|
|
11
|
+
import { validationTypes } from '../utils/icons.js';
|
|
12
|
+
|
|
13
|
+
const COMPONENT_ID = 'notifications.alert';
|
|
14
|
+
const colorStyles = props => {
|
|
15
|
+
const {
|
|
16
|
+
$type,
|
|
17
|
+
theme
|
|
18
|
+
} = props;
|
|
19
|
+
let variable;
|
|
20
|
+
switch ($type) {
|
|
21
|
+
case validationTypes.success:
|
|
22
|
+
variable = 'foreground.successEmphasis';
|
|
23
|
+
break;
|
|
24
|
+
case validationTypes.error:
|
|
25
|
+
variable = 'foreground.dangerEmphasis';
|
|
26
|
+
break;
|
|
27
|
+
case validationTypes.warning:
|
|
28
|
+
variable = 'foreground.warningEmphasis';
|
|
29
|
+
break;
|
|
30
|
+
case validationTypes.info:
|
|
31
|
+
variable = 'foreground.default';
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
const color = variable ? getColor({
|
|
35
|
+
variable,
|
|
36
|
+
theme
|
|
37
|
+
}) : undefined;
|
|
38
|
+
return css(["", "{color:", ";}"], StyledTitle, color);
|
|
39
|
+
};
|
|
40
|
+
const StyledAlert = styled(StyledBase).attrs({
|
|
41
|
+
'data-garden-id': COMPONENT_ID,
|
|
42
|
+
'data-garden-version': '9.0.0-next.21'
|
|
43
|
+
}).withConfig({
|
|
44
|
+
displayName: "StyledAlert",
|
|
45
|
+
componentId: "sc-fyn8jp-0"
|
|
46
|
+
})(["", " ", ";"], colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
47
|
+
StyledAlert.defaultProps = {
|
|
48
|
+
theme: DEFAULT_THEME
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { StyledAlert };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { getLineHeight, retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { validationTypes } from '../utils/icons.js';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'notifications.base_container';
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
$type,
|
|
16
|
+
$isFloating
|
|
17
|
+
} = _ref;
|
|
18
|
+
const {
|
|
19
|
+
space,
|
|
20
|
+
shadows
|
|
21
|
+
} = theme;
|
|
22
|
+
let bgVariable;
|
|
23
|
+
let borderVariable;
|
|
24
|
+
let fgVariable;
|
|
25
|
+
if (!$isFloating && $type && !!validationTypes[$type]) {
|
|
26
|
+
switch ($type) {
|
|
27
|
+
case validationTypes.success:
|
|
28
|
+
bgVariable = 'background.success';
|
|
29
|
+
borderVariable = 'border.success';
|
|
30
|
+
fgVariable = 'foreground.success';
|
|
31
|
+
break;
|
|
32
|
+
case validationTypes.error:
|
|
33
|
+
bgVariable = 'background.danger';
|
|
34
|
+
borderVariable = 'border.danger';
|
|
35
|
+
fgVariable = 'foreground.danger';
|
|
36
|
+
break;
|
|
37
|
+
case validationTypes.warning:
|
|
38
|
+
bgVariable = 'background.warning';
|
|
39
|
+
borderVariable = 'border.warning';
|
|
40
|
+
fgVariable = 'foreground.warning';
|
|
41
|
+
break;
|
|
42
|
+
case validationTypes.info:
|
|
43
|
+
bgVariable = 'background.subtle';
|
|
44
|
+
borderVariable = 'border.default';
|
|
45
|
+
fgVariable = 'foreground.subtle';
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
bgVariable = 'background.raised';
|
|
50
|
+
borderVariable = 'border.default';
|
|
51
|
+
fgVariable = 'foreground.default';
|
|
52
|
+
}
|
|
53
|
+
const backgroundColor = getColor({
|
|
54
|
+
variable: bgVariable,
|
|
55
|
+
theme
|
|
56
|
+
});
|
|
57
|
+
const borderColor = getColor({
|
|
58
|
+
variable: borderVariable,
|
|
59
|
+
theme
|
|
60
|
+
});
|
|
61
|
+
const foregroundColor = getColor({
|
|
62
|
+
variable: fgVariable,
|
|
63
|
+
theme
|
|
64
|
+
});
|
|
65
|
+
const offsetY = `${space.base * 5}px`;
|
|
66
|
+
const blurRadius = `${space.base * 7}px`;
|
|
67
|
+
const boxShadow = $isFloating ? shadows.lg(offsetY, blurRadius, getColor({
|
|
68
|
+
variable: 'shadow.large',
|
|
69
|
+
theme
|
|
70
|
+
})) : undefined;
|
|
71
|
+
return css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";"], borderColor, boxShadow, backgroundColor, foregroundColor);
|
|
72
|
+
};
|
|
73
|
+
const padding = props => {
|
|
74
|
+
const {
|
|
75
|
+
space
|
|
76
|
+
} = props.theme;
|
|
77
|
+
const paddingVertical = `${space.base * 5}px`;
|
|
78
|
+
const paddingHorizontal = `${space.base * 10}px`;
|
|
79
|
+
return `${paddingVertical} ${paddingHorizontal}`;
|
|
80
|
+
};
|
|
81
|
+
const StyledBase = styled.div.attrs({
|
|
82
|
+
'data-garden-id': COMPONENT_ID,
|
|
83
|
+
'data-garden-version': '9.0.0-next.21'
|
|
84
|
+
}).withConfig({
|
|
85
|
+
displayName: "StyledBase",
|
|
86
|
+
componentId: "sc-14syaqw-0"
|
|
87
|
+
})(["position:relative;border:", ";border-radius:", ";padding:", ";line-height:", ";font-size:", ";direction:", ";", ";", ""], props => props.theme.borders.sm, props => props.theme.borderRadii.md, padding, props => getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
88
|
+
StyledBase.defaultProps = {
|
|
89
|
+
theme: DEFAULT_THEME
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { StyledBase };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { validationTypes } from '../utils/icons.js';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'notifications.icon';
|
|
12
|
+
const sizeStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme: {
|
|
15
|
+
rtl,
|
|
16
|
+
space
|
|
17
|
+
}
|
|
18
|
+
} = _ref;
|
|
19
|
+
return css(["right:", ";left:", ";margin-top:", "px;"], rtl && `${space.base * 4}px`, !rtl && `${space.base * 4}px`, space.base / 2);
|
|
20
|
+
};
|
|
21
|
+
const colorStyles = _ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
theme,
|
|
24
|
+
$type
|
|
25
|
+
} = _ref2;
|
|
26
|
+
let variable;
|
|
27
|
+
switch ($type) {
|
|
28
|
+
case validationTypes.success:
|
|
29
|
+
variable = 'foreground.success';
|
|
30
|
+
break;
|
|
31
|
+
case validationTypes.error:
|
|
32
|
+
variable = 'foreground.danger';
|
|
33
|
+
break;
|
|
34
|
+
case validationTypes.warning:
|
|
35
|
+
variable = 'foreground.warning';
|
|
36
|
+
break;
|
|
37
|
+
case validationTypes.info:
|
|
38
|
+
variable = 'foreground.subtle';
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
variable = 'foreground.default';
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
const color = getColor({
|
|
45
|
+
variable,
|
|
46
|
+
theme
|
|
47
|
+
});
|
|
48
|
+
return css(["color:", ";"], color);
|
|
49
|
+
};
|
|
50
|
+
const StyledIcon = styled(StyledBaseIcon).attrs({
|
|
51
|
+
'data-garden-id': COMPONENT_ID,
|
|
52
|
+
'data-garden-version': '9.0.0-next.21'
|
|
53
|
+
}).withConfig({
|
|
54
|
+
displayName: "StyledIcon",
|
|
55
|
+
componentId: "sc-msklws-0"
|
|
56
|
+
})(["position:absolute;", " ", " ", ""], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
57
|
+
StyledIcon.defaultProps = {
|
|
58
|
+
theme: DEFAULT_THEME
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { StyledIcon };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import styled, { css } from 'styled-components';
|
|
9
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
10
|
+
import { TYPE } from '../types/index.js';
|
|
11
|
+
import { StyledTitle } from './content/StyledTitle.js';
|
|
12
|
+
import { StyledBase } from './StyledBase.js';
|
|
13
|
+
import { validationTypes } from '../utils/icons.js';
|
|
14
|
+
|
|
15
|
+
const COMPONENT_ID = 'notifications.notification';
|
|
16
|
+
const colorStyles = props => {
|
|
17
|
+
const {
|
|
18
|
+
$type,
|
|
19
|
+
theme
|
|
20
|
+
} = props;
|
|
21
|
+
let variable;
|
|
22
|
+
switch ($type) {
|
|
23
|
+
case validationTypes.success:
|
|
24
|
+
variable = 'foreground.success';
|
|
25
|
+
break;
|
|
26
|
+
case validationTypes.error:
|
|
27
|
+
variable = 'foreground.danger';
|
|
28
|
+
break;
|
|
29
|
+
case validationTypes.warning:
|
|
30
|
+
variable = 'foreground.warning';
|
|
31
|
+
break;
|
|
32
|
+
case validationTypes.info:
|
|
33
|
+
variable = 'foreground.default';
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
const color = variable ? getColor({
|
|
37
|
+
variable,
|
|
38
|
+
theme
|
|
39
|
+
}) : 'inherit';
|
|
40
|
+
return css(["", "{color:", ";}"], StyledTitle, color);
|
|
41
|
+
};
|
|
42
|
+
const StyledNotification = styled(StyledBase).attrs({
|
|
43
|
+
'data-garden-id': COMPONENT_ID,
|
|
44
|
+
'data-garden-version': '9.0.0-next.21'
|
|
45
|
+
}).withConfig({
|
|
46
|
+
displayName: "StyledNotification",
|
|
47
|
+
componentId: "sc-uf6jh-0"
|
|
48
|
+
})(["", " ", ";"], colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
49
|
+
StyledNotification.propTypes = {
|
|
50
|
+
$type: PropTypes.oneOf(TYPE)
|
|
51
|
+
};
|
|
52
|
+
StyledNotification.defaultProps = {
|
|
53
|
+
theme: DEFAULT_THEME
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { StyledNotification };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { StyledBase } from './StyledBase.js';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_ID = 'notifications.well';
|
|
12
|
+
const colorStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme,
|
|
15
|
+
$isFloating,
|
|
16
|
+
$isRecessed
|
|
17
|
+
} = _ref;
|
|
18
|
+
let backgroundVariable;
|
|
19
|
+
if ($isRecessed) {
|
|
20
|
+
backgroundVariable = 'background.recessed';
|
|
21
|
+
} else if ($isFloating) {
|
|
22
|
+
backgroundVariable = 'background.raised';
|
|
23
|
+
} else {
|
|
24
|
+
backgroundVariable = 'background.default';
|
|
25
|
+
}
|
|
26
|
+
const foreground = getColor({
|
|
27
|
+
variable: 'foreground.subtle',
|
|
28
|
+
theme
|
|
29
|
+
});
|
|
30
|
+
const background = getColor({
|
|
31
|
+
variable: backgroundVariable,
|
|
32
|
+
theme
|
|
33
|
+
});
|
|
34
|
+
return css(["background-color:", ";color:", ";"], background, foreground);
|
|
35
|
+
};
|
|
36
|
+
const StyledWell = styled(StyledBase).attrs({
|
|
37
|
+
'data-garden-id': COMPONENT_ID,
|
|
38
|
+
'data-garden-version': '9.0.0-next.21'
|
|
39
|
+
}).withConfig({
|
|
40
|
+
displayName: "StyledWell",
|
|
41
|
+
componentId: "sc-a5831c-0"
|
|
42
|
+
})(["", " ", ";"], colorStyles, p => retrieveComponentStyles(COMPONENT_ID, p));
|
|
43
|
+
StyledWell.defaultProps = {
|
|
44
|
+
theme: DEFAULT_THEME
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { StyledWell };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
9
|
+
import { validationTypes } from '../../utils/icons.js';
|
|
10
|
+
import { IconButton } from '@zendeskgarden/react-buttons';
|
|
11
|
+
|
|
12
|
+
const COMPONENT_ID = 'notifications.close';
|
|
13
|
+
const colorStyles = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
theme,
|
|
16
|
+
$type
|
|
17
|
+
} = _ref;
|
|
18
|
+
let variable;
|
|
19
|
+
switch ($type) {
|
|
20
|
+
case validationTypes.warning:
|
|
21
|
+
variable = 'foreground.warning';
|
|
22
|
+
break;
|
|
23
|
+
case validationTypes.error:
|
|
24
|
+
variable = 'foreground.danger';
|
|
25
|
+
break;
|
|
26
|
+
case validationTypes.success:
|
|
27
|
+
variable = 'foreground.success';
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
variable = 'foreground.subtle';
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
const color = getColor({
|
|
34
|
+
variable,
|
|
35
|
+
theme
|
|
36
|
+
});
|
|
37
|
+
const hoverColor = getColor({
|
|
38
|
+
variable,
|
|
39
|
+
light: {
|
|
40
|
+
offset: 100
|
|
41
|
+
},
|
|
42
|
+
dark: {
|
|
43
|
+
offset: -100
|
|
44
|
+
},
|
|
45
|
+
theme
|
|
46
|
+
});
|
|
47
|
+
const activeColor = getColor({
|
|
48
|
+
variable,
|
|
49
|
+
light: {
|
|
50
|
+
offset: 200
|
|
51
|
+
},
|
|
52
|
+
dark: {
|
|
53
|
+
offset: -200
|
|
54
|
+
},
|
|
55
|
+
theme
|
|
56
|
+
});
|
|
57
|
+
return css(["color:", ";&:hover{background-color:transparent;color:", ";}&:active{background-color:transparent;color:", ";}"], color, hoverColor, activeColor);
|
|
58
|
+
};
|
|
59
|
+
const StyledClose = styled(IconButton).attrs({
|
|
60
|
+
'data-garden-id': COMPONENT_ID,
|
|
61
|
+
'data-garden-version': '9.0.0-next.21'
|
|
62
|
+
}).withConfig({
|
|
63
|
+
displayName: "StyledClose",
|
|
64
|
+
componentId: "sc-1mr9nx1-0"
|
|
65
|
+
})(["position:absolute;top:", "px;right:", ";left:", ";", " ", ";"], props => props.theme.space.base, p => !p.theme.rtl && `${p.theme.space.base}px`, p => p.theme.rtl && `${p.theme.space.base}px`, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
66
|
+
StyledClose.defaultProps = {
|
|
67
|
+
theme: DEFAULT_THEME
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { StyledClose };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'notifications.paragraph';
|
|
11
|
+
const StyledParagraph = styled.p.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.21'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledParagraph",
|
|
16
|
+
componentId: "sc-12tmd6p-0"
|
|
17
|
+
})(["margin:", "px 0 0;", ";"], props => props.theme.space.base * 2, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
+
StyledParagraph.defaultProps = {
|
|
19
|
+
theme: DEFAULT_THEME
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { StyledParagraph };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { getColor, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'notifications.title';
|
|
11
|
+
const StyledTitle = styled.div.attrs({
|
|
12
|
+
'data-garden-id': COMPONENT_ID,
|
|
13
|
+
'data-garden-version': '9.0.0-next.21'
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "StyledTitle",
|
|
16
|
+
componentId: "sc-xx4jsv-0"
|
|
17
|
+
})(["margin:0;color:", ";font-weight:", ";", ";"], p => getColor({
|
|
18
|
+
variable: 'foreground.default',
|
|
19
|
+
theme: p.theme
|
|
20
|
+
}), props => props.$isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
21
|
+
StyledTitle.defaultProps = {
|
|
22
|
+
theme: DEFAULT_THEME
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { StyledTitle };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
|
+
|
|
10
|
+
const COMPONENT_ID = 'notifications.global_alert';
|
|
11
|
+
const colorStyles = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
theme,
|
|
14
|
+
$alertType
|
|
15
|
+
} = _ref;
|
|
16
|
+
let borderColor;
|
|
17
|
+
let backgroundColor;
|
|
18
|
+
let foregroundColor;
|
|
19
|
+
let anchorHoverColor;
|
|
20
|
+
let anchorActiveColor;
|
|
21
|
+
let focusVariable;
|
|
22
|
+
switch ($alertType) {
|
|
23
|
+
case 'success':
|
|
24
|
+
{
|
|
25
|
+
borderColor = getColor({
|
|
26
|
+
variable: 'border.successEmphasis',
|
|
27
|
+
offset: 100,
|
|
28
|
+
theme
|
|
29
|
+
});
|
|
30
|
+
backgroundColor = getColor({
|
|
31
|
+
variable: 'background.successEmphasis',
|
|
32
|
+
theme
|
|
33
|
+
});
|
|
34
|
+
foregroundColor = getColor({
|
|
35
|
+
variable: 'foreground.success',
|
|
36
|
+
offset: -600,
|
|
37
|
+
theme
|
|
38
|
+
});
|
|
39
|
+
anchorHoverColor = theme.palette.white;
|
|
40
|
+
anchorActiveColor = theme.palette.white;
|
|
41
|
+
focusVariable = 'foreground.successEmphasis';
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case 'error':
|
|
45
|
+
{
|
|
46
|
+
borderColor = getColor({
|
|
47
|
+
variable: 'border.dangerEmphasis',
|
|
48
|
+
offset: 100,
|
|
49
|
+
theme
|
|
50
|
+
});
|
|
51
|
+
backgroundColor = getColor({
|
|
52
|
+
variable: 'background.dangerEmphasis',
|
|
53
|
+
theme
|
|
54
|
+
});
|
|
55
|
+
foregroundColor = getColor({
|
|
56
|
+
variable: 'foreground.danger',
|
|
57
|
+
offset: -600,
|
|
58
|
+
theme
|
|
59
|
+
});
|
|
60
|
+
anchorActiveColor = theme.palette.white;
|
|
61
|
+
anchorHoverColor = theme.palette.white;
|
|
62
|
+
focusVariable = 'foreground.dangerEmphasis';
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case 'warning':
|
|
66
|
+
{
|
|
67
|
+
borderColor = getColor({
|
|
68
|
+
variable: 'border.warningEmphasis',
|
|
69
|
+
offset: -300,
|
|
70
|
+
theme
|
|
71
|
+
});
|
|
72
|
+
backgroundColor = getColor({
|
|
73
|
+
variable: 'background.warningEmphasis',
|
|
74
|
+
offset: -400,
|
|
75
|
+
theme
|
|
76
|
+
});
|
|
77
|
+
const fgVariable = 'foreground.warning';
|
|
78
|
+
foregroundColor = getColor({
|
|
79
|
+
variable: fgVariable,
|
|
80
|
+
offset: 100,
|
|
81
|
+
theme
|
|
82
|
+
});
|
|
83
|
+
anchorHoverColor = getColor({
|
|
84
|
+
variable: fgVariable,
|
|
85
|
+
offset: 200,
|
|
86
|
+
theme
|
|
87
|
+
});
|
|
88
|
+
anchorActiveColor = getColor({
|
|
89
|
+
variable: fgVariable,
|
|
90
|
+
offset: 300,
|
|
91
|
+
theme
|
|
92
|
+
});
|
|
93
|
+
focusVariable = fgVariable;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case 'info':
|
|
97
|
+
{
|
|
98
|
+
borderColor = getColor({
|
|
99
|
+
variable: 'border.primaryEmphasis',
|
|
100
|
+
offset: -300,
|
|
101
|
+
theme
|
|
102
|
+
});
|
|
103
|
+
backgroundColor = getColor({
|
|
104
|
+
variable: 'background.primaryEmphasis',
|
|
105
|
+
offset: -400,
|
|
106
|
+
theme
|
|
107
|
+
});
|
|
108
|
+
const fgVariable = 'foreground.primary';
|
|
109
|
+
foregroundColor = getColor({
|
|
110
|
+
variable: fgVariable,
|
|
111
|
+
offset: 100,
|
|
112
|
+
theme
|
|
113
|
+
});
|
|
114
|
+
anchorHoverColor = getColor({
|
|
115
|
+
variable: fgVariable,
|
|
116
|
+
offset: 200,
|
|
117
|
+
theme
|
|
118
|
+
});
|
|
119
|
+
anchorActiveColor = getColor({
|
|
120
|
+
variable: fgVariable,
|
|
121
|
+
offset: 300,
|
|
122
|
+
theme
|
|
123
|
+
});
|
|
124
|
+
focusVariable = fgVariable;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const boxShadow = `0 ${theme.borderWidths.sm} ${theme.borderWidths.sm} ${borderColor}`;
|
|
129
|
+
return css(["box-shadow:", ";background-color:", ";color:", ";& a{color:inherit;", " &:hover{color:", ";}&:active{color:", ";}}"], boxShadow, backgroundColor, foregroundColor, focusStyles({
|
|
130
|
+
theme,
|
|
131
|
+
color: {
|
|
132
|
+
variable: focusVariable
|
|
133
|
+
},
|
|
134
|
+
styles: {
|
|
135
|
+
color: 'inherit'
|
|
136
|
+
}
|
|
137
|
+
}), anchorHoverColor, anchorActiveColor);
|
|
138
|
+
};
|
|
139
|
+
const sizeStyles = props => {
|
|
140
|
+
const {
|
|
141
|
+
fontSizes,
|
|
142
|
+
space
|
|
143
|
+
} = props.theme;
|
|
144
|
+
const minHeight = space.base * 13;
|
|
145
|
+
const padding = space.base * 4;
|
|
146
|
+
const lineHeight = getLineHeight(space.base * 5, fontSizes.md);
|
|
147
|
+
return css(["padding:", "px;min-height:", "px;line-height:", ";font-size:", ";"], padding, minHeight, lineHeight, fontSizes.md);
|
|
148
|
+
};
|
|
149
|
+
const StyledGlobalAlert = styled.div.attrs({
|
|
150
|
+
'data-garden-id': COMPONENT_ID,
|
|
151
|
+
'data-garden-version': '9.0.0-next.21'
|
|
152
|
+
}).withConfig({
|
|
153
|
+
displayName: "StyledGlobalAlert",
|
|
154
|
+
componentId: "sc-k6rimt-0"
|
|
155
|
+
})(["display:flex;flex-wrap:nowrap;overflow:auto;overflow-x:hidden;box-sizing:border-box;direction:", ";", " ", " && a{border-radius:", ";text-decoration:underline;}", ";"], props => props.theme.rtl ? 'rtl' : 'ltr', sizeStyles, colorStyles, props => props.theme.borderRadii.sm, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
156
|
+
StyledGlobalAlert.defaultProps = {
|
|
157
|
+
theme: DEFAULT_THEME
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export { StyledGlobalAlert };
|