@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
package/dist/index.cjs.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
*/
|
|
8
7
|
'use strict';
|
|
9
8
|
|
|
10
9
|
var React = require('react');
|
|
@@ -40,89 +39,270 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
40
39
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
41
40
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
42
41
|
|
|
43
|
-
function _extends$6() {
|
|
44
|
-
_extends$6 = Object.assign ? Object.assign.bind() : function (target) {
|
|
45
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
46
|
-
var source = arguments[i];
|
|
47
|
-
for (var key in source) {
|
|
48
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
49
|
-
target[key] = source[key];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return target;
|
|
54
|
-
};
|
|
55
|
-
return _extends$6.apply(this, arguments);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
42
|
const TYPE = ['success', 'warning', 'error', 'info'];
|
|
59
43
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
var _g$2, _circle$2;
|
|
45
|
+
function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
|
|
46
|
+
var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
|
|
47
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
width: 16,
|
|
50
|
+
height: 16,
|
|
51
|
+
focusable: "false",
|
|
52
|
+
viewBox: "0 0 16 16",
|
|
53
|
+
"aria-hidden": "true"
|
|
54
|
+
}, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
55
|
+
fill: "none",
|
|
56
|
+
stroke: "currentColor"
|
|
57
|
+
}, /*#__PURE__*/React__namespace.createElement("circle", {
|
|
58
|
+
cx: 7.5,
|
|
59
|
+
cy: 8.5,
|
|
60
|
+
r: 7
|
|
61
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
62
|
+
strokeLinecap: "round",
|
|
63
|
+
d: "M7.5 4.5V9"
|
|
64
|
+
}))), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
65
|
+
cx: 7.5,
|
|
66
|
+
cy: 12,
|
|
67
|
+
r: 1,
|
|
68
|
+
fill: "currentColor"
|
|
69
|
+
})));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
var _g$1;
|
|
73
|
+
function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
|
|
74
|
+
var SvgCheckCircleStroke = function SvgCheckCircleStroke(props) {
|
|
75
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
|
|
76
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
77
|
+
width: 16,
|
|
78
|
+
height: 16,
|
|
79
|
+
focusable: "false",
|
|
80
|
+
viewBox: "0 0 16 16",
|
|
81
|
+
"aria-hidden": "true"
|
|
82
|
+
}, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
83
|
+
fill: "none",
|
|
84
|
+
stroke: "currentColor"
|
|
85
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
86
|
+
strokeLinecap: "round",
|
|
87
|
+
strokeLinejoin: "round",
|
|
88
|
+
d: "M4 9l2.5 2.5 5-5"
|
|
89
|
+
}), /*#__PURE__*/React__namespace.createElement("circle", {
|
|
90
|
+
cx: 7.5,
|
|
91
|
+
cy: 8.5,
|
|
92
|
+
r: 7
|
|
93
|
+
}))));
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
var _path$1, _circle$1;
|
|
97
|
+
function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
|
|
98
|
+
var SvgAlertWarningStroke = function SvgAlertWarningStroke(props) {
|
|
99
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
100
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
101
|
+
width: 16,
|
|
102
|
+
height: 16,
|
|
103
|
+
focusable: "false",
|
|
104
|
+
viewBox: "0 0 16 16",
|
|
105
|
+
"aria-hidden": "true"
|
|
106
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
107
|
+
fill: "none",
|
|
108
|
+
stroke: "currentColor",
|
|
109
|
+
strokeLinecap: "round",
|
|
110
|
+
d: "M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"
|
|
111
|
+
})), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
112
|
+
cx: 7.5,
|
|
113
|
+
cy: 12,
|
|
114
|
+
r: 1,
|
|
115
|
+
fill: "currentColor"
|
|
116
|
+
})));
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
var _g, _circle;
|
|
120
|
+
function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
|
|
121
|
+
var SvgInfoStroke = function SvgInfoStroke(props) {
|
|
122
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
123
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
124
|
+
width: 16,
|
|
125
|
+
height: 16,
|
|
126
|
+
focusable: "false",
|
|
127
|
+
viewBox: "0 0 16 16",
|
|
128
|
+
"aria-hidden": "true"
|
|
129
|
+
}, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
|
|
130
|
+
stroke: "currentColor"
|
|
131
|
+
}, /*#__PURE__*/React__namespace.createElement("circle", {
|
|
132
|
+
cx: 7.5,
|
|
133
|
+
cy: 8.5,
|
|
134
|
+
r: 7,
|
|
135
|
+
fill: "none"
|
|
136
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
137
|
+
strokeLinecap: "round",
|
|
138
|
+
d: "M7.5 12.5V8"
|
|
139
|
+
}))), _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
140
|
+
cx: 7.5,
|
|
141
|
+
cy: 5,
|
|
142
|
+
r: 1,
|
|
143
|
+
fill: "currentColor"
|
|
144
|
+
})));
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const validationIcons = {
|
|
148
|
+
success: SvgCheckCircleStroke,
|
|
149
|
+
error: SvgAlertErrorStroke,
|
|
150
|
+
warning: SvgAlertWarningStroke,
|
|
151
|
+
info: SvgInfoStroke
|
|
152
|
+
};
|
|
153
|
+
const validationTypes = {
|
|
154
|
+
success: 'success',
|
|
155
|
+
error: 'error',
|
|
156
|
+
warning: 'warning',
|
|
157
|
+
info: 'info'
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const COMPONENT_ID$d = 'notifications.close';
|
|
161
|
+
const colorStyles$a = _ref => {
|
|
162
|
+
let {
|
|
163
|
+
theme,
|
|
164
|
+
$type
|
|
165
|
+
} = _ref;
|
|
166
|
+
let variable;
|
|
167
|
+
switch ($type) {
|
|
168
|
+
case validationTypes.warning:
|
|
169
|
+
variable = 'foreground.warning';
|
|
170
|
+
break;
|
|
171
|
+
case validationTypes.error:
|
|
172
|
+
variable = 'foreground.danger';
|
|
173
|
+
break;
|
|
174
|
+
case validationTypes.success:
|
|
175
|
+
variable = 'foreground.success';
|
|
176
|
+
break;
|
|
177
|
+
default:
|
|
178
|
+
variable = 'foreground.subtle';
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
const color = reactTheming.getColor({
|
|
182
|
+
variable,
|
|
183
|
+
theme
|
|
184
|
+
});
|
|
185
|
+
const hoverColor = reactTheming.getColor({
|
|
186
|
+
variable,
|
|
187
|
+
light: {
|
|
188
|
+
offset: 100
|
|
189
|
+
},
|
|
190
|
+
dark: {
|
|
191
|
+
offset: -100
|
|
192
|
+
},
|
|
193
|
+
theme
|
|
194
|
+
});
|
|
195
|
+
const activeColor = reactTheming.getColor({
|
|
196
|
+
variable,
|
|
197
|
+
light: {
|
|
198
|
+
offset: 200
|
|
199
|
+
},
|
|
200
|
+
dark: {
|
|
201
|
+
offset: -200
|
|
202
|
+
},
|
|
203
|
+
theme
|
|
204
|
+
});
|
|
205
|
+
return styled.css(["color:", ";&:hover{background-color:transparent;color:", ";}&:active{background-color:transparent;color:", ";}"], color, hoverColor, activeColor);
|
|
206
|
+
};
|
|
207
|
+
const StyledClose = styled__default.default(reactButtons.IconButton).attrs({
|
|
208
|
+
'data-garden-id': COMPONENT_ID$d,
|
|
209
|
+
'data-garden-version': '9.0.0-next.21'
|
|
64
210
|
}).withConfig({
|
|
65
211
|
displayName: "StyledClose",
|
|
66
212
|
componentId: "sc-1mr9nx1-0"
|
|
67
|
-
})(["
|
|
68
|
-
theme: props.theme,
|
|
69
|
-
inset: true
|
|
70
|
-
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
213
|
+
})(["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$a, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$d, props));
|
|
71
214
|
StyledClose.defaultProps = {
|
|
72
215
|
theme: reactTheming.DEFAULT_THEME
|
|
73
216
|
};
|
|
74
217
|
|
|
75
|
-
const COMPONENT_ID$
|
|
218
|
+
const COMPONENT_ID$c = 'notifications.paragraph';
|
|
76
219
|
const StyledParagraph = styled__default.default.p.attrs({
|
|
77
|
-
'data-garden-id': COMPONENT_ID$
|
|
78
|
-
'data-garden-version': '9.0.0-next.
|
|
220
|
+
'data-garden-id': COMPONENT_ID$c,
|
|
221
|
+
'data-garden-version': '9.0.0-next.21'
|
|
79
222
|
}).withConfig({
|
|
80
223
|
displayName: "StyledParagraph",
|
|
81
224
|
componentId: "sc-12tmd6p-0"
|
|
82
|
-
})(["margin:", "px 0 0;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$
|
|
225
|
+
})(["margin:", "px 0 0;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$c, props));
|
|
83
226
|
StyledParagraph.defaultProps = {
|
|
84
227
|
theme: reactTheming.DEFAULT_THEME
|
|
85
228
|
};
|
|
86
229
|
|
|
87
|
-
const COMPONENT_ID$
|
|
230
|
+
const COMPONENT_ID$b = 'notifications.title';
|
|
88
231
|
const StyledTitle = styled__default.default.div.attrs({
|
|
89
|
-
'data-garden-id': COMPONENT_ID$
|
|
90
|
-
'data-garden-version': '9.0.0-next.
|
|
232
|
+
'data-garden-id': COMPONENT_ID$b,
|
|
233
|
+
'data-garden-version': '9.0.0-next.21'
|
|
91
234
|
}).withConfig({
|
|
92
235
|
displayName: "StyledTitle",
|
|
93
236
|
componentId: "sc-xx4jsv-0"
|
|
94
|
-
})(["margin:0;color:", ";font-weight:", ";", ";"],
|
|
237
|
+
})(["margin:0;color:", ";font-weight:", ";", ";"], p => reactTheming.getColor({
|
|
238
|
+
variable: 'foreground.default',
|
|
239
|
+
theme: p.theme
|
|
240
|
+
}), props => props.$isRegular ? props.theme.fontWeights.regular : props.theme.fontWeights.semibold, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
95
241
|
StyledTitle.defaultProps = {
|
|
96
242
|
theme: reactTheming.DEFAULT_THEME
|
|
97
243
|
};
|
|
98
244
|
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
245
|
+
const COMPONENT_ID$a = 'notifications.base_container';
|
|
246
|
+
const colorStyles$9 = _ref => {
|
|
247
|
+
let {
|
|
248
|
+
theme,
|
|
249
|
+
$type,
|
|
250
|
+
$isFloating
|
|
251
|
+
} = _ref;
|
|
103
252
|
const {
|
|
104
253
|
space,
|
|
105
254
|
shadows
|
|
106
255
|
} = theme;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
256
|
+
let bgVariable;
|
|
257
|
+
let borderVariable;
|
|
258
|
+
let fgVariable;
|
|
259
|
+
if (!$isFloating && $type && !!validationTypes[$type]) {
|
|
260
|
+
switch ($type) {
|
|
261
|
+
case validationTypes.success:
|
|
262
|
+
bgVariable = 'background.success';
|
|
263
|
+
borderVariable = 'border.success';
|
|
264
|
+
fgVariable = 'foreground.success';
|
|
265
|
+
break;
|
|
266
|
+
case validationTypes.error:
|
|
267
|
+
bgVariable = 'background.danger';
|
|
268
|
+
borderVariable = 'border.danger';
|
|
269
|
+
fgVariable = 'foreground.danger';
|
|
270
|
+
break;
|
|
271
|
+
case validationTypes.warning:
|
|
272
|
+
bgVariable = 'background.warning';
|
|
273
|
+
borderVariable = 'border.warning';
|
|
274
|
+
fgVariable = 'foreground.warning';
|
|
275
|
+
break;
|
|
276
|
+
case validationTypes.info:
|
|
277
|
+
bgVariable = 'background.subtle';
|
|
278
|
+
borderVariable = 'border.default';
|
|
279
|
+
fgVariable = 'foreground.subtle';
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
120
282
|
} else {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
283
|
+
bgVariable = 'background.raised';
|
|
284
|
+
borderVariable = 'border.default';
|
|
285
|
+
fgVariable = 'foreground.default';
|
|
124
286
|
}
|
|
125
|
-
|
|
287
|
+
const backgroundColor = reactTheming.getColor({
|
|
288
|
+
variable: bgVariable,
|
|
289
|
+
theme
|
|
290
|
+
});
|
|
291
|
+
const borderColor = reactTheming.getColor({
|
|
292
|
+
variable: borderVariable,
|
|
293
|
+
theme
|
|
294
|
+
});
|
|
295
|
+
const foregroundColor = reactTheming.getColor({
|
|
296
|
+
variable: fgVariable,
|
|
297
|
+
theme
|
|
298
|
+
});
|
|
299
|
+
const offsetY = `${space.base * 5}px`;
|
|
300
|
+
const blurRadius = `${space.base * 7}px`;
|
|
301
|
+
const boxShadow = $isFloating ? shadows.lg(offsetY, blurRadius, reactTheming.getColor({
|
|
302
|
+
variable: 'shadow.large',
|
|
303
|
+
theme
|
|
304
|
+
})) : undefined;
|
|
305
|
+
return styled.css(["border-color:", ";box-shadow:", ";background-color:", ";color:", ";"], borderColor, boxShadow, backgroundColor, foregroundColor);
|
|
126
306
|
};
|
|
127
307
|
const padding = props => {
|
|
128
308
|
const {
|
|
@@ -132,149 +312,306 @@ const padding = props => {
|
|
|
132
312
|
const paddingHorizontal = `${space.base * 10}px`;
|
|
133
313
|
return `${paddingVertical} ${paddingHorizontal}`;
|
|
134
314
|
};
|
|
135
|
-
const StyledBase = styled__default.default.div.
|
|
315
|
+
const StyledBase = styled__default.default.div.attrs({
|
|
316
|
+
'data-garden-id': COMPONENT_ID$a,
|
|
317
|
+
'data-garden-version': '9.0.0-next.21'
|
|
318
|
+
}).withConfig({
|
|
136
319
|
displayName: "StyledBase",
|
|
137
320
|
componentId: "sc-14syaqw-0"
|
|
138
|
-
})(["position:relative;border:", ";border-radius:", ";
|
|
321
|
+
})(["position:relative;border:", ";border-radius:", ";padding:", ";line-height:", ";font-size:", ";direction:", ";", ";", ""], props => props.theme.borders.sm, props => props.theme.borderRadii.md, padding, props => reactTheming.getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', colorStyles$9, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
139
322
|
StyledBase.defaultProps = {
|
|
140
323
|
theme: reactTheming.DEFAULT_THEME
|
|
141
324
|
};
|
|
142
325
|
|
|
143
|
-
const COMPONENT_ID$
|
|
144
|
-
const colorStyles$
|
|
326
|
+
const COMPONENT_ID$9 = 'notifications.alert';
|
|
327
|
+
const colorStyles$8 = props => {
|
|
328
|
+
const {
|
|
329
|
+
$type,
|
|
330
|
+
theme
|
|
331
|
+
} = props;
|
|
332
|
+
let variable;
|
|
333
|
+
switch ($type) {
|
|
334
|
+
case validationTypes.success:
|
|
335
|
+
variable = 'foreground.successEmphasis';
|
|
336
|
+
break;
|
|
337
|
+
case validationTypes.error:
|
|
338
|
+
variable = 'foreground.dangerEmphasis';
|
|
339
|
+
break;
|
|
340
|
+
case validationTypes.warning:
|
|
341
|
+
variable = 'foreground.warningEmphasis';
|
|
342
|
+
break;
|
|
343
|
+
case validationTypes.info:
|
|
344
|
+
variable = 'foreground.default';
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
const color = variable ? reactTheming.getColor({
|
|
348
|
+
variable,
|
|
349
|
+
theme
|
|
350
|
+
}) : undefined;
|
|
351
|
+
return styled.css(["", "{color:", ";}"], StyledTitle, color);
|
|
352
|
+
};
|
|
145
353
|
const StyledAlert = styled__default.default(StyledBase).attrs({
|
|
146
|
-
'data-garden-id': COMPONENT_ID$
|
|
147
|
-
'data-garden-version': '9.0.0-next.
|
|
354
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
355
|
+
'data-garden-version': '9.0.0-next.21'
|
|
148
356
|
}).withConfig({
|
|
149
357
|
displayName: "StyledAlert",
|
|
150
358
|
componentId: "sc-fyn8jp-0"
|
|
151
|
-
})(["", " ", ";"], colorStyles$
|
|
359
|
+
})(["", " ", ";"], colorStyles$8, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
152
360
|
StyledAlert.defaultProps = {
|
|
153
361
|
theme: reactTheming.DEFAULT_THEME
|
|
154
362
|
};
|
|
155
363
|
|
|
156
|
-
const COMPONENT_ID$
|
|
157
|
-
const colorStyles$
|
|
364
|
+
const COMPONENT_ID$8 = 'notifications.notification';
|
|
365
|
+
const colorStyles$7 = props => {
|
|
158
366
|
const {
|
|
159
|
-
type,
|
|
367
|
+
$type,
|
|
160
368
|
theme
|
|
161
369
|
} = props;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
successHue,
|
|
167
|
-
dangerHue,
|
|
168
|
-
warningHue,
|
|
169
|
-
foreground
|
|
170
|
-
} = colors;
|
|
171
|
-
let color;
|
|
172
|
-
switch (type) {
|
|
173
|
-
case 'success':
|
|
174
|
-
color = reactTheming.getColor(successHue, 600, theme);
|
|
175
|
-
break;
|
|
176
|
-
case 'error':
|
|
177
|
-
color = reactTheming.getColor(dangerHue, 600, theme);
|
|
370
|
+
let variable;
|
|
371
|
+
switch ($type) {
|
|
372
|
+
case validationTypes.success:
|
|
373
|
+
variable = 'foreground.success';
|
|
178
374
|
break;
|
|
179
|
-
case
|
|
180
|
-
|
|
375
|
+
case validationTypes.error:
|
|
376
|
+
variable = 'foreground.danger';
|
|
181
377
|
break;
|
|
182
|
-
case
|
|
183
|
-
|
|
378
|
+
case validationTypes.warning:
|
|
379
|
+
variable = 'foreground.warning';
|
|
184
380
|
break;
|
|
185
|
-
|
|
186
|
-
|
|
381
|
+
case validationTypes.info:
|
|
382
|
+
variable = 'foreground.default';
|
|
187
383
|
break;
|
|
188
384
|
}
|
|
385
|
+
const color = variable ? reactTheming.getColor({
|
|
386
|
+
variable,
|
|
387
|
+
theme
|
|
388
|
+
}) : 'inherit';
|
|
189
389
|
return styled.css(["", "{color:", ";}"], StyledTitle, color);
|
|
190
390
|
};
|
|
191
391
|
const StyledNotification = styled__default.default(StyledBase).attrs({
|
|
192
|
-
'data-garden-id': COMPONENT_ID$
|
|
193
|
-
'data-garden-version': '9.0.0-next.
|
|
392
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
393
|
+
'data-garden-version': '9.0.0-next.21'
|
|
194
394
|
}).withConfig({
|
|
195
395
|
displayName: "StyledNotification",
|
|
196
396
|
componentId: "sc-uf6jh-0"
|
|
197
|
-
})(["", " ", ";"], colorStyles$
|
|
397
|
+
})(["", " ", ";"], colorStyles$7, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
198
398
|
StyledNotification.propTypes = {
|
|
199
|
-
type: PropTypes__default.default.oneOf(TYPE)
|
|
399
|
+
$type: PropTypes__default.default.oneOf(TYPE)
|
|
200
400
|
};
|
|
201
401
|
StyledNotification.defaultProps = {
|
|
202
402
|
theme: reactTheming.DEFAULT_THEME
|
|
203
403
|
};
|
|
204
404
|
|
|
205
|
-
const COMPONENT_ID$
|
|
405
|
+
const COMPONENT_ID$7 = 'notifications.well';
|
|
406
|
+
const colorStyles$6 = _ref => {
|
|
407
|
+
let {
|
|
408
|
+
theme,
|
|
409
|
+
$isFloating,
|
|
410
|
+
$isRecessed
|
|
411
|
+
} = _ref;
|
|
412
|
+
let backgroundVariable;
|
|
413
|
+
if ($isRecessed) {
|
|
414
|
+
backgroundVariable = 'background.recessed';
|
|
415
|
+
} else if ($isFloating) {
|
|
416
|
+
backgroundVariable = 'background.raised';
|
|
417
|
+
} else {
|
|
418
|
+
backgroundVariable = 'background.default';
|
|
419
|
+
}
|
|
420
|
+
const foreground = reactTheming.getColor({
|
|
421
|
+
variable: 'foreground.subtle',
|
|
422
|
+
theme
|
|
423
|
+
});
|
|
424
|
+
const background = reactTheming.getColor({
|
|
425
|
+
variable: backgroundVariable,
|
|
426
|
+
theme
|
|
427
|
+
});
|
|
428
|
+
return styled.css(["background-color:", ";color:", ";"], background, foreground);
|
|
429
|
+
};
|
|
206
430
|
const StyledWell = styled__default.default(StyledBase).attrs({
|
|
207
|
-
'data-garden-id': COMPONENT_ID$
|
|
208
|
-
'data-garden-version': '9.0.0-next.
|
|
431
|
+
'data-garden-id': COMPONENT_ID$7,
|
|
432
|
+
'data-garden-version': '9.0.0-next.21'
|
|
209
433
|
}).withConfig({
|
|
210
434
|
displayName: "StyledWell",
|
|
211
435
|
componentId: "sc-a5831c-0"
|
|
212
|
-
})(["
|
|
436
|
+
})(["", " ", ";"], colorStyles$6, p => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, p));
|
|
213
437
|
StyledWell.defaultProps = {
|
|
214
438
|
theme: reactTheming.DEFAULT_THEME
|
|
215
439
|
};
|
|
216
440
|
|
|
217
|
-
const
|
|
441
|
+
const COMPONENT_ID$6 = 'notifications.icon';
|
|
442
|
+
const sizeStyles$4 = _ref => {
|
|
218
443
|
let {
|
|
219
|
-
|
|
220
|
-
|
|
444
|
+
theme: {
|
|
445
|
+
rtl,
|
|
446
|
+
space
|
|
447
|
+
}
|
|
221
448
|
} = _ref;
|
|
222
|
-
return
|
|
449
|
+
return styled.css(["right:", ";left:", ";margin-top:", "px;"], rtl && `${space.base * 4}px`, !rtl && `${space.base * 4}px`, space.base / 2);
|
|
450
|
+
};
|
|
451
|
+
const colorStyles$5 = _ref2 => {
|
|
452
|
+
let {
|
|
453
|
+
theme,
|
|
454
|
+
$type
|
|
455
|
+
} = _ref2;
|
|
456
|
+
let variable;
|
|
457
|
+
switch ($type) {
|
|
458
|
+
case validationTypes.success:
|
|
459
|
+
variable = 'foreground.success';
|
|
460
|
+
break;
|
|
461
|
+
case validationTypes.error:
|
|
462
|
+
variable = 'foreground.danger';
|
|
463
|
+
break;
|
|
464
|
+
case validationTypes.warning:
|
|
465
|
+
variable = 'foreground.warning';
|
|
466
|
+
break;
|
|
467
|
+
case validationTypes.info:
|
|
468
|
+
variable = 'foreground.subtle';
|
|
469
|
+
break;
|
|
470
|
+
default:
|
|
471
|
+
variable = 'foreground.default';
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
const color = reactTheming.getColor({
|
|
475
|
+
variable,
|
|
476
|
+
theme
|
|
477
|
+
});
|
|
478
|
+
return styled.css(["color:", ";"], color);
|
|
479
|
+
};
|
|
480
|
+
const StyledIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
|
|
481
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
482
|
+
'data-garden-version': '9.0.0-next.21'
|
|
223
483
|
}).withConfig({
|
|
224
484
|
displayName: "StyledIcon",
|
|
225
485
|
componentId: "sc-msklws-0"
|
|
226
|
-
})(["position:absolute;
|
|
486
|
+
})(["position:absolute;", " ", " ", ""], sizeStyles$4, colorStyles$5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
227
487
|
StyledIcon.defaultProps = {
|
|
228
488
|
theme: reactTheming.DEFAULT_THEME
|
|
229
489
|
};
|
|
230
490
|
|
|
231
|
-
const COMPONENT_ID$5 = 'notifications.
|
|
232
|
-
const colorStyles$
|
|
491
|
+
const COMPONENT_ID$5 = 'notifications.global_alert';
|
|
492
|
+
const colorStyles$4 = _ref => {
|
|
493
|
+
let {
|
|
494
|
+
theme,
|
|
495
|
+
$alertType
|
|
496
|
+
} = _ref;
|
|
233
497
|
let borderColor;
|
|
234
498
|
let backgroundColor;
|
|
235
499
|
let foregroundColor;
|
|
236
500
|
let anchorHoverColor;
|
|
237
501
|
let anchorActiveColor;
|
|
238
|
-
let
|
|
239
|
-
switch (
|
|
502
|
+
let focusVariable;
|
|
503
|
+
switch ($alertType) {
|
|
240
504
|
case 'success':
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
505
|
+
{
|
|
506
|
+
borderColor = reactTheming.getColor({
|
|
507
|
+
variable: 'border.successEmphasis',
|
|
508
|
+
offset: 100,
|
|
509
|
+
theme
|
|
510
|
+
});
|
|
511
|
+
backgroundColor = reactTheming.getColor({
|
|
512
|
+
variable: 'background.successEmphasis',
|
|
513
|
+
theme
|
|
514
|
+
});
|
|
515
|
+
foregroundColor = reactTheming.getColor({
|
|
516
|
+
variable: 'foreground.success',
|
|
517
|
+
offset: -600,
|
|
518
|
+
theme
|
|
519
|
+
});
|
|
520
|
+
anchorHoverColor = theme.palette.white;
|
|
521
|
+
anchorActiveColor = theme.palette.white;
|
|
522
|
+
focusVariable = 'foreground.successEmphasis';
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
248
525
|
case 'error':
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
526
|
+
{
|
|
527
|
+
borderColor = reactTheming.getColor({
|
|
528
|
+
variable: 'border.dangerEmphasis',
|
|
529
|
+
offset: 100,
|
|
530
|
+
theme
|
|
531
|
+
});
|
|
532
|
+
backgroundColor = reactTheming.getColor({
|
|
533
|
+
variable: 'background.dangerEmphasis',
|
|
534
|
+
theme
|
|
535
|
+
});
|
|
536
|
+
foregroundColor = reactTheming.getColor({
|
|
537
|
+
variable: 'foreground.danger',
|
|
538
|
+
offset: -600,
|
|
539
|
+
theme
|
|
540
|
+
});
|
|
541
|
+
anchorActiveColor = theme.palette.white;
|
|
542
|
+
anchorHoverColor = theme.palette.white;
|
|
543
|
+
focusVariable = 'foreground.dangerEmphasis';
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
256
546
|
case 'warning':
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
547
|
+
{
|
|
548
|
+
borderColor = reactTheming.getColor({
|
|
549
|
+
variable: 'border.warningEmphasis',
|
|
550
|
+
offset: -300,
|
|
551
|
+
theme
|
|
552
|
+
});
|
|
553
|
+
backgroundColor = reactTheming.getColor({
|
|
554
|
+
variable: 'background.warningEmphasis',
|
|
555
|
+
offset: -400,
|
|
556
|
+
theme
|
|
557
|
+
});
|
|
558
|
+
const fgVariable = 'foreground.warning';
|
|
559
|
+
foregroundColor = reactTheming.getColor({
|
|
560
|
+
variable: fgVariable,
|
|
561
|
+
offset: 100,
|
|
562
|
+
theme
|
|
563
|
+
});
|
|
564
|
+
anchorHoverColor = reactTheming.getColor({
|
|
565
|
+
variable: fgVariable,
|
|
566
|
+
offset: 200,
|
|
567
|
+
theme
|
|
568
|
+
});
|
|
569
|
+
anchorActiveColor = reactTheming.getColor({
|
|
570
|
+
variable: fgVariable,
|
|
571
|
+
offset: 300,
|
|
572
|
+
theme
|
|
573
|
+
});
|
|
574
|
+
focusVariable = fgVariable;
|
|
575
|
+
break;
|
|
576
|
+
}
|
|
264
577
|
case 'info':
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
578
|
+
{
|
|
579
|
+
borderColor = reactTheming.getColor({
|
|
580
|
+
variable: 'border.primaryEmphasis',
|
|
581
|
+
offset: -300,
|
|
582
|
+
theme
|
|
583
|
+
});
|
|
584
|
+
backgroundColor = reactTheming.getColor({
|
|
585
|
+
variable: 'background.primaryEmphasis',
|
|
586
|
+
offset: -400,
|
|
587
|
+
theme
|
|
588
|
+
});
|
|
589
|
+
const fgVariable = 'foreground.primary';
|
|
590
|
+
foregroundColor = reactTheming.getColor({
|
|
591
|
+
variable: fgVariable,
|
|
592
|
+
offset: 100,
|
|
593
|
+
theme
|
|
594
|
+
});
|
|
595
|
+
anchorHoverColor = reactTheming.getColor({
|
|
596
|
+
variable: fgVariable,
|
|
597
|
+
offset: 200,
|
|
598
|
+
theme
|
|
599
|
+
});
|
|
600
|
+
anchorActiveColor = reactTheming.getColor({
|
|
601
|
+
variable: fgVariable,
|
|
602
|
+
offset: 300,
|
|
603
|
+
theme
|
|
604
|
+
});
|
|
605
|
+
focusVariable = fgVariable;
|
|
606
|
+
break;
|
|
607
|
+
}
|
|
272
608
|
}
|
|
273
|
-
const boxShadow = `0 ${
|
|
609
|
+
const boxShadow = `0 ${theme.borderWidths.sm} ${theme.borderWidths.sm} ${borderColor}`;
|
|
274
610
|
return styled.css(["box-shadow:", ";background-color:", ";color:", ";& a{color:inherit;", " &:hover{color:", ";}&:active{color:", ";}}"], boxShadow, backgroundColor, foregroundColor, reactTheming.focusStyles({
|
|
275
|
-
theme
|
|
276
|
-
|
|
277
|
-
|
|
611
|
+
theme,
|
|
612
|
+
color: {
|
|
613
|
+
variable: focusVariable
|
|
614
|
+
},
|
|
278
615
|
styles: {
|
|
279
616
|
color: 'inherit'
|
|
280
617
|
}
|
|
@@ -292,56 +629,88 @@ const sizeStyles$3 = props => {
|
|
|
292
629
|
};
|
|
293
630
|
const StyledGlobalAlert = styled__default.default.div.attrs({
|
|
294
631
|
'data-garden-id': COMPONENT_ID$5,
|
|
295
|
-
'data-garden-version': '9.0.0-next.
|
|
632
|
+
'data-garden-version': '9.0.0-next.21'
|
|
296
633
|
}).withConfig({
|
|
297
634
|
displayName: "StyledGlobalAlert",
|
|
298
635
|
componentId: "sc-k6rimt-0"
|
|
299
|
-
})(["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$3, colorStyles$
|
|
636
|
+
})(["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$3, colorStyles$4, props => props.theme.borderRadii.sm, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
300
637
|
StyledGlobalAlert.defaultProps = {
|
|
301
638
|
theme: reactTheming.DEFAULT_THEME
|
|
302
639
|
};
|
|
303
640
|
|
|
304
|
-
const COMPONENT_ID$4 = 'notifications.
|
|
305
|
-
const colorStyles$
|
|
641
|
+
const COMPONENT_ID$4 = 'notifications.global_alert.close';
|
|
642
|
+
const colorStyles$3 = props => {
|
|
643
|
+
const {
|
|
644
|
+
$alertType,
|
|
645
|
+
theme
|
|
646
|
+
} = props;
|
|
306
647
|
let hoverBackgroundColor;
|
|
307
648
|
let hoverForegroundColor;
|
|
308
649
|
let activeBackgroundColor;
|
|
309
650
|
let activeForegroundColor;
|
|
310
|
-
let
|
|
311
|
-
switch (
|
|
651
|
+
let focusVariable;
|
|
652
|
+
switch ($alertType) {
|
|
312
653
|
case 'success':
|
|
313
|
-
hoverBackgroundColor = reactTheming.getColor(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
654
|
+
hoverBackgroundColor = reactTheming.getColor({
|
|
655
|
+
variable: 'background.success',
|
|
656
|
+
theme,
|
|
657
|
+
transparency: theme.opacity[100]
|
|
658
|
+
});
|
|
659
|
+
hoverForegroundColor = theme.palette.white;
|
|
660
|
+
activeBackgroundColor = reactTheming.getColor({
|
|
661
|
+
variable: 'background.success',
|
|
662
|
+
theme,
|
|
663
|
+
transparency: theme.opacity[200]
|
|
664
|
+
});
|
|
665
|
+
activeForegroundColor = theme.palette.white;
|
|
666
|
+
focusVariable = 'foreground.successEmphasis';
|
|
318
667
|
break;
|
|
319
668
|
case 'error':
|
|
320
|
-
hoverBackgroundColor = reactTheming.getColor(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
669
|
+
hoverBackgroundColor = reactTheming.getColor({
|
|
670
|
+
variable: 'background.danger',
|
|
671
|
+
theme,
|
|
672
|
+
transparency: theme.opacity[100]
|
|
673
|
+
});
|
|
674
|
+
hoverForegroundColor = theme.palette.white;
|
|
675
|
+
activeBackgroundColor = reactTheming.getColor({
|
|
676
|
+
variable: 'background.danger',
|
|
677
|
+
theme,
|
|
678
|
+
transparency: theme.opacity[200]
|
|
679
|
+
});
|
|
680
|
+
activeForegroundColor = theme.palette.white;
|
|
681
|
+
focusVariable = 'foreground.dangerEmphasis';
|
|
325
682
|
break;
|
|
326
683
|
case 'warning':
|
|
327
|
-
hoverBackgroundColor = reactTheming.getColor(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
684
|
+
hoverBackgroundColor = reactTheming.getColor({
|
|
685
|
+
variable: 'background.warningEmphasis',
|
|
686
|
+
transparency: theme.opacity[100],
|
|
687
|
+
theme
|
|
688
|
+
});
|
|
689
|
+
hoverForegroundColor = reactTheming.getColor({
|
|
690
|
+
variable: 'foreground.warningEmphasis',
|
|
691
|
+
offset: 200,
|
|
692
|
+
theme
|
|
693
|
+
});
|
|
694
|
+
activeBackgroundColor = reactTheming.getColor({
|
|
695
|
+
variable: 'background.warningEmphasis',
|
|
696
|
+
transparency: theme.opacity[200],
|
|
697
|
+
theme
|
|
698
|
+
});
|
|
699
|
+
activeForegroundColor = reactTheming.getColor({
|
|
700
|
+
variable: 'foreground.warningEmphasis',
|
|
701
|
+
offset: 300,
|
|
702
|
+
theme
|
|
703
|
+
});
|
|
704
|
+
focusVariable = 'foreground.warning';
|
|
339
705
|
break;
|
|
706
|
+
default:
|
|
707
|
+
focusVariable = 'foreground.primary';
|
|
340
708
|
}
|
|
341
709
|
return styled.css(["color:inherit;&:hover{background-color:", ";color:", ";}", " &:active{background-color:", ";color:", ";}"], hoverBackgroundColor, hoverForegroundColor, reactTheming.focusStyles({
|
|
342
|
-
theme
|
|
343
|
-
|
|
344
|
-
|
|
710
|
+
theme,
|
|
711
|
+
color: {
|
|
712
|
+
variable: focusVariable
|
|
713
|
+
}
|
|
345
714
|
}), activeBackgroundColor, activeForegroundColor);
|
|
346
715
|
};
|
|
347
716
|
const sizeStyles$2 = props => {
|
|
@@ -352,52 +721,103 @@ const sizeStyles$2 = props => {
|
|
|
352
721
|
};
|
|
353
722
|
const StyledGlobalAlertClose = styled__default.default(reactButtons.IconButton).attrs({
|
|
354
723
|
'data-garden-id': COMPONENT_ID$4,
|
|
355
|
-
'data-garden-version': '9.0.0-next.
|
|
356
|
-
size: 'small'
|
|
724
|
+
'data-garden-version': '9.0.0-next.21'
|
|
357
725
|
}).withConfig({
|
|
358
726
|
displayName: "StyledGlobalAlertClose",
|
|
359
727
|
componentId: "sc-1g5s93s-0"
|
|
360
|
-
})(["", ";", ";", ";"], sizeStyles$2, colorStyles$
|
|
728
|
+
})(["", ";", ";", ";"], sizeStyles$2, colorStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
361
729
|
StyledGlobalAlertClose.defaultProps = {
|
|
362
730
|
theme: reactTheming.DEFAULT_THEME
|
|
363
731
|
};
|
|
364
732
|
|
|
365
|
-
const COMPONENT_ID$3 = 'notifications.
|
|
366
|
-
function colorStyles$
|
|
367
|
-
|
|
368
|
-
|
|
733
|
+
const COMPONENT_ID$3 = 'notifications.global_alert.button';
|
|
734
|
+
function colorStyles$2(props) {
|
|
735
|
+
const {
|
|
736
|
+
$alertType,
|
|
737
|
+
isBasic,
|
|
738
|
+
theme
|
|
739
|
+
} = props;
|
|
740
|
+
if (isBasic) {
|
|
741
|
+
return colorStyles$3(props);
|
|
369
742
|
}
|
|
370
|
-
let
|
|
371
|
-
let
|
|
372
|
-
let
|
|
373
|
-
let
|
|
374
|
-
|
|
743
|
+
let bgVariable;
|
|
744
|
+
let offsetOptions;
|
|
745
|
+
let offsetHoverOptions;
|
|
746
|
+
let offsetActiveOptions;
|
|
747
|
+
let focusVariable;
|
|
748
|
+
switch ($alertType) {
|
|
375
749
|
case 'success':
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
750
|
+
bgVariable = 'background.successEmphasis';
|
|
751
|
+
offsetOptions = {
|
|
752
|
+
offset: 200
|
|
753
|
+
};
|
|
754
|
+
offsetHoverOptions = {
|
|
755
|
+
offset: 300
|
|
756
|
+
};
|
|
757
|
+
offsetActiveOptions = {
|
|
758
|
+
offset: 400
|
|
759
|
+
};
|
|
760
|
+
focusVariable = 'foreground.successEmphasis';
|
|
380
761
|
break;
|
|
381
762
|
case 'error':
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
763
|
+
bgVariable = 'background.dangerEmphasis';
|
|
764
|
+
offsetOptions = {
|
|
765
|
+
offset: 200
|
|
766
|
+
};
|
|
767
|
+
offsetHoverOptions = {
|
|
768
|
+
offset: 300
|
|
769
|
+
};
|
|
770
|
+
offsetActiveOptions = {
|
|
771
|
+
offset: 400
|
|
772
|
+
};
|
|
773
|
+
focusVariable = 'foreground.dangerEmphasis';
|
|
386
774
|
break;
|
|
387
775
|
case 'warning':
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
776
|
+
bgVariable = 'background.warningEmphasis';
|
|
777
|
+
offsetOptions = {};
|
|
778
|
+
offsetHoverOptions = {
|
|
779
|
+
offset: 100
|
|
780
|
+
};
|
|
781
|
+
offsetActiveOptions = {
|
|
782
|
+
offset: 200
|
|
783
|
+
};
|
|
784
|
+
focusVariable = 'foreground.warning';
|
|
392
785
|
break;
|
|
393
786
|
case 'info':
|
|
394
|
-
|
|
787
|
+
bgVariable = 'background.primaryEmphasis';
|
|
788
|
+
offsetOptions = {};
|
|
789
|
+
offsetHoverOptions = {
|
|
790
|
+
offset: 100
|
|
791
|
+
};
|
|
792
|
+
offsetActiveOptions = {
|
|
793
|
+
offset: 200
|
|
794
|
+
};
|
|
795
|
+
focusVariable = 'foreground.primary';
|
|
395
796
|
break;
|
|
396
797
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
798
|
+
const backgroundColor = reactTheming.getColor({
|
|
799
|
+
variable: bgVariable,
|
|
800
|
+
...offsetOptions,
|
|
801
|
+
theme
|
|
802
|
+
});
|
|
803
|
+
const hoverBackgroundColor = reactTheming.getColor({
|
|
804
|
+
variable: bgVariable,
|
|
805
|
+
...offsetHoverOptions,
|
|
806
|
+
theme
|
|
807
|
+
});
|
|
808
|
+
const activeBackgroundColor = reactTheming.getColor({
|
|
809
|
+
variable: bgVariable,
|
|
810
|
+
...offsetActiveOptions,
|
|
811
|
+
theme
|
|
812
|
+
});
|
|
813
|
+
return styled.css(["background-color:", ";color:", ";&:hover{background-color:", ";}", " &:active{background-color:", ";}"], backgroundColor, reactTheming.getColor({
|
|
814
|
+
hue: 'white',
|
|
815
|
+
theme
|
|
816
|
+
}), hoverBackgroundColor, reactTheming.focusStyles({
|
|
817
|
+
theme,
|
|
818
|
+
color: {
|
|
819
|
+
variable: focusVariable
|
|
820
|
+
}
|
|
401
821
|
}), activeBackgroundColor);
|
|
402
822
|
}
|
|
403
823
|
function sizeStyles$1(props) {
|
|
@@ -407,26 +827,19 @@ function sizeStyles$1(props) {
|
|
|
407
827
|
}
|
|
408
828
|
const StyledGlobalAlertButton = styled__default.default(reactButtons.Button).attrs({
|
|
409
829
|
'data-garden-id': COMPONENT_ID$3,
|
|
410
|
-
'data-garden-version': '9.0.0-next.
|
|
411
|
-
focusInset: false,
|
|
412
|
-
isDanger: false,
|
|
413
|
-
isLink: false,
|
|
414
|
-
isNeutral: false,
|
|
415
|
-
isPill: false,
|
|
416
|
-
isStretched: false,
|
|
417
|
-
size: 'small'
|
|
830
|
+
'data-garden-version': '9.0.0-next.21'
|
|
418
831
|
}).withConfig({
|
|
419
832
|
displayName: "StyledGlobalAlertButton",
|
|
420
833
|
componentId: "sc-1txe91a-0"
|
|
421
|
-
})(["flex-shrink:0;", ";", ";", ";"], sizeStyles$1, colorStyles$
|
|
834
|
+
})(["flex-shrink:0;", ";", ";", ";"], sizeStyles$1, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
422
835
|
StyledGlobalAlertButton.defaultProps = {
|
|
423
836
|
theme: reactTheming.DEFAULT_THEME
|
|
424
837
|
};
|
|
425
838
|
|
|
426
|
-
const COMPONENT_ID$2 = 'notifications.
|
|
839
|
+
const COMPONENT_ID$2 = 'notifications.global_alert.content';
|
|
427
840
|
const StyledGlobalAlertContent = styled__default.default.div.attrs({
|
|
428
841
|
'data-garden-id': COMPONENT_ID$2,
|
|
429
|
-
'data-garden-version': '9.0.0-next.
|
|
842
|
+
'data-garden-version': '9.0.0-next.21'
|
|
430
843
|
}).withConfig({
|
|
431
844
|
displayName: "StyledGlobalAlertContent",
|
|
432
845
|
componentId: "sc-rept0u-0"
|
|
@@ -435,269 +848,254 @@ StyledGlobalAlertContent.defaultProps = {
|
|
|
435
848
|
theme: reactTheming.DEFAULT_THEME
|
|
436
849
|
};
|
|
437
850
|
|
|
438
|
-
const COMPONENT_ID$1 = 'notifications.
|
|
851
|
+
const COMPONENT_ID$1 = 'notifications.global_alert.icon';
|
|
439
852
|
const sizeStyles = props => {
|
|
440
853
|
const size = props.theme.iconSizes.md;
|
|
441
854
|
const marginTop = polished.math(`(${props.theme.space.base * 5} - ${size}) / 2`);
|
|
442
855
|
const marginHorizontal = `${props.theme.space.base * 2}px`;
|
|
443
856
|
return styled.css(["margin-top:", ";margin-", ":", ";width:", ";height:", ";"], marginTop, props.theme.rtl ? 'left' : 'right', marginHorizontal, size, size);
|
|
444
857
|
};
|
|
445
|
-
const
|
|
858
|
+
const colorStyles$1 = _ref => {
|
|
446
859
|
let {
|
|
447
|
-
|
|
448
|
-
|
|
860
|
+
theme,
|
|
861
|
+
$alertType
|
|
449
862
|
} = _ref;
|
|
450
|
-
|
|
451
|
-
|
|
863
|
+
let color;
|
|
864
|
+
switch ($alertType) {
|
|
865
|
+
case 'success':
|
|
866
|
+
color = reactTheming.getColor({
|
|
867
|
+
variable: 'foreground.success',
|
|
868
|
+
offset: -400,
|
|
869
|
+
theme
|
|
870
|
+
});
|
|
871
|
+
break;
|
|
872
|
+
case 'error':
|
|
873
|
+
color = reactTheming.getColor({
|
|
874
|
+
variable: 'foreground.danger',
|
|
875
|
+
offset: -400,
|
|
876
|
+
theme
|
|
877
|
+
});
|
|
878
|
+
break;
|
|
879
|
+
case 'warning':
|
|
880
|
+
color = reactTheming.getColor({
|
|
881
|
+
variable: 'foreground.warning',
|
|
882
|
+
theme
|
|
883
|
+
});
|
|
884
|
+
break;
|
|
885
|
+
case 'info':
|
|
886
|
+
color = reactTheming.getColor({
|
|
887
|
+
variable: 'foreground.primary',
|
|
888
|
+
theme
|
|
889
|
+
});
|
|
890
|
+
break;
|
|
891
|
+
}
|
|
892
|
+
return styled.css(["color:", ";"], color);
|
|
893
|
+
};
|
|
894
|
+
const StyledGlobalAlertIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
|
|
452
895
|
'data-garden-id': COMPONENT_ID$1,
|
|
453
|
-
'data-garden-version': '9.0.0-next.
|
|
896
|
+
'data-garden-version': '9.0.0-next.21'
|
|
454
897
|
}).withConfig({
|
|
455
898
|
displayName: "StyledGlobalAlertIcon",
|
|
456
899
|
componentId: "sc-84ne9k-0"
|
|
457
|
-
})(["flex-shrink:0;", ";", ";"], sizeStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
900
|
+
})(["flex-shrink:0;", ";", ";", ";"], sizeStyles, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
458
901
|
StyledGlobalAlertIcon.defaultProps = {
|
|
459
902
|
theme: reactTheming.DEFAULT_THEME
|
|
460
903
|
};
|
|
461
904
|
|
|
462
|
-
const COMPONENT_ID = 'notifications.
|
|
463
|
-
const colorStyles =
|
|
905
|
+
const COMPONENT_ID = 'notifications.global_alert.title';
|
|
906
|
+
const colorStyles = _ref => {
|
|
907
|
+
let {
|
|
908
|
+
theme,
|
|
909
|
+
$alertType
|
|
910
|
+
} = _ref;
|
|
464
911
|
let color;
|
|
465
|
-
switch (
|
|
912
|
+
switch ($alertType) {
|
|
466
913
|
case 'success':
|
|
467
914
|
case 'error':
|
|
468
|
-
color =
|
|
915
|
+
color = theme.palette.white;
|
|
469
916
|
break;
|
|
470
917
|
case 'warning':
|
|
471
|
-
color = reactTheming.getColor(
|
|
918
|
+
color = reactTheming.getColor({
|
|
919
|
+
variable: 'foreground.warningEmphasis',
|
|
920
|
+
theme
|
|
921
|
+
});
|
|
472
922
|
break;
|
|
473
923
|
case 'info':
|
|
474
|
-
color = reactTheming.getColor(
|
|
924
|
+
color = reactTheming.getColor({
|
|
925
|
+
variable: 'foreground.primary',
|
|
926
|
+
offset: 200,
|
|
927
|
+
theme
|
|
928
|
+
});
|
|
475
929
|
break;
|
|
476
930
|
}
|
|
477
931
|
return styled.css(["color:", ";"], color);
|
|
478
932
|
};
|
|
479
933
|
const StyledGlobalAlertTitle = styled__default.default.div.attrs({
|
|
480
934
|
'data-garden-id': COMPONENT_ID,
|
|
481
|
-
'data-garden-version': '9.0.0-next.
|
|
935
|
+
'data-garden-version': '9.0.0-next.21'
|
|
482
936
|
}).withConfig({
|
|
483
937
|
displayName: "StyledGlobalAlertTitle",
|
|
484
938
|
componentId: "sc-10clqbo-0"
|
|
485
|
-
})(["display:inline;margin-", ":", "px;font-weight:", ";", ";", ";"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.space.base * 2, props => props
|
|
939
|
+
})(["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 => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
486
940
|
StyledGlobalAlertTitle.defaultProps = {
|
|
487
941
|
theme: reactTheming.DEFAULT_THEME
|
|
488
942
|
};
|
|
489
943
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
|
|
494
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
495
|
-
width: 16,
|
|
496
|
-
height: 16,
|
|
497
|
-
focusable: "false",
|
|
498
|
-
viewBox: "0 0 16 16",
|
|
499
|
-
"aria-hidden": "true"
|
|
500
|
-
}, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
|
|
501
|
-
fill: "none",
|
|
502
|
-
stroke: "currentColor"
|
|
503
|
-
}, /*#__PURE__*/React__namespace.createElement("circle", {
|
|
504
|
-
cx: 7.5,
|
|
505
|
-
cy: 8.5,
|
|
506
|
-
r: 7
|
|
507
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
508
|
-
strokeLinecap: "round",
|
|
509
|
-
d: "M7.5 4.5V9"
|
|
510
|
-
}))), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
511
|
-
cx: 7.5,
|
|
512
|
-
cy: 12,
|
|
513
|
-
r: 1,
|
|
514
|
-
fill: "currentColor"
|
|
515
|
-
})));
|
|
944
|
+
const NotificationsContext = React.createContext(undefined);
|
|
945
|
+
const useNotificationsContext = () => {
|
|
946
|
+
return React.useContext(NotificationsContext);
|
|
516
947
|
};
|
|
517
948
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
fill: "none",
|
|
530
|
-
stroke: "currentColor"
|
|
531
|
-
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
532
|
-
strokeLinecap: "round",
|
|
533
|
-
strokeLinejoin: "round",
|
|
534
|
-
d: "M4 9l2.5 2.5 5-5"
|
|
535
|
-
}), /*#__PURE__*/React__namespace.createElement("circle", {
|
|
536
|
-
cx: 7.5,
|
|
537
|
-
cy: 8.5,
|
|
538
|
-
r: 7
|
|
539
|
-
}))));
|
|
540
|
-
};
|
|
949
|
+
const Title$1 = React__namespace.default.forwardRef((_ref, ref) => {
|
|
950
|
+
let {
|
|
951
|
+
isRegular,
|
|
952
|
+
...props
|
|
953
|
+
} = _ref;
|
|
954
|
+
return React__namespace.default.createElement(StyledTitle, Object.assign({
|
|
955
|
+
ref: ref,
|
|
956
|
+
$isRegular: isRegular
|
|
957
|
+
}, props));
|
|
958
|
+
});
|
|
959
|
+
Title$1.displayName = 'Alert.Title';
|
|
541
960
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
547
|
-
width: 16,
|
|
548
|
-
height: 16,
|
|
549
|
-
focusable: "false",
|
|
550
|
-
viewBox: "0 0 16 16",
|
|
551
|
-
"aria-hidden": "true"
|
|
552
|
-
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
553
|
-
fill: "none",
|
|
554
|
-
stroke: "currentColor",
|
|
555
|
-
strokeLinecap: "round",
|
|
556
|
-
d: "M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"
|
|
557
|
-
})), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
558
|
-
cx: 7.5,
|
|
559
|
-
cy: 12,
|
|
560
|
-
r: 1,
|
|
561
|
-
fill: "currentColor"
|
|
562
|
-
})));
|
|
563
|
-
};
|
|
961
|
+
const Paragraph$1 = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledParagraph, Object.assign({
|
|
962
|
+
ref: ref
|
|
963
|
+
}, props)));
|
|
964
|
+
Paragraph$1.displayName = 'Alert.Paragraph';
|
|
564
965
|
|
|
565
|
-
var
|
|
566
|
-
function _extends
|
|
567
|
-
var
|
|
568
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends
|
|
966
|
+
var _path;
|
|
967
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
968
|
+
var SvgXStroke = function SvgXStroke(props) {
|
|
969
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
569
970
|
xmlns: "http://www.w3.org/2000/svg",
|
|
570
971
|
width: 16,
|
|
571
972
|
height: 16,
|
|
572
973
|
focusable: "false",
|
|
573
974
|
viewBox: "0 0 16 16",
|
|
574
975
|
"aria-hidden": "true"
|
|
575
|
-
}, props),
|
|
576
|
-
stroke: "currentColor"
|
|
577
|
-
}, /*#__PURE__*/React__namespace.createElement("circle", {
|
|
578
|
-
cx: 7.5,
|
|
579
|
-
cy: 8.5,
|
|
580
|
-
r: 7,
|
|
581
|
-
fill: "none"
|
|
582
|
-
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
976
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
977
|
+
stroke: "currentColor",
|
|
583
978
|
strokeLinecap: "round",
|
|
584
|
-
d: "
|
|
585
|
-
}))), _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
586
|
-
cx: 7.5,
|
|
587
|
-
cy: 5,
|
|
588
|
-
r: 1,
|
|
589
|
-
fill: "currentColor"
|
|
979
|
+
d: "M3 13L13 3m0 10L3 3"
|
|
590
980
|
})));
|
|
591
981
|
};
|
|
592
982
|
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
const NotificationsContext = React.createContext(undefined);
|
|
607
|
-
const useNotificationsContext = () => {
|
|
608
|
-
return React.useContext(NotificationsContext);
|
|
609
|
-
};
|
|
983
|
+
const Close$1 = React__namespace.default.forwardRef((props, ref) => {
|
|
984
|
+
const ariaLabel = reactTheming.useText(Close$1, props, 'aria-label', 'Close');
|
|
985
|
+
const type = useNotificationsContext();
|
|
986
|
+
return React__namespace.default.createElement(StyledClose, Object.assign({
|
|
987
|
+
ref: ref,
|
|
988
|
+
$type: type,
|
|
989
|
+
"aria-label": ariaLabel
|
|
990
|
+
}, props, {
|
|
991
|
+
focusInset: true,
|
|
992
|
+
size: "small"
|
|
993
|
+
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
994
|
+
});
|
|
995
|
+
Close$1.displayName = 'Alert.Close';
|
|
610
996
|
|
|
611
|
-
const
|
|
997
|
+
const AlertComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
612
998
|
let {
|
|
613
999
|
role,
|
|
1000
|
+
type,
|
|
614
1001
|
...props
|
|
615
1002
|
} = _ref;
|
|
616
|
-
const
|
|
617
|
-
const Icon = validationIcons[props.type];
|
|
1003
|
+
const Icon = validationIcons[type];
|
|
618
1004
|
return React__namespace.default.createElement(NotificationsContext.Provider, {
|
|
619
|
-
value:
|
|
620
|
-
}, React__namespace.default.createElement(StyledAlert,
|
|
1005
|
+
value: type
|
|
1006
|
+
}, React__namespace.default.createElement(StyledAlert, Object.assign({
|
|
621
1007
|
ref: ref,
|
|
622
|
-
|
|
1008
|
+
$type: type,
|
|
623
1009
|
role: role === undefined ? 'alert' : role
|
|
624
1010
|
}, props), React__namespace.default.createElement(StyledIcon, {
|
|
625
|
-
|
|
1011
|
+
$type: type
|
|
626
1012
|
}, React__namespace.default.createElement(Icon, null)), props.children));
|
|
627
1013
|
});
|
|
628
|
-
|
|
629
|
-
|
|
1014
|
+
AlertComponent.displayName = 'Alert';
|
|
1015
|
+
AlertComponent.propTypes = {
|
|
630
1016
|
type: PropTypes__default.default.oneOf(TYPE).isRequired
|
|
631
1017
|
};
|
|
1018
|
+
const Alert = AlertComponent;
|
|
1019
|
+
Alert.Close = Close$1;
|
|
1020
|
+
Alert.Paragraph = Paragraph$1;
|
|
1021
|
+
Alert.Title = Title$1;
|
|
632
1022
|
|
|
633
|
-
const
|
|
1023
|
+
const Title = React__namespace.default.forwardRef((_ref, ref) => {
|
|
634
1024
|
let {
|
|
635
|
-
|
|
1025
|
+
isRegular,
|
|
636
1026
|
...props
|
|
637
1027
|
} = _ref;
|
|
638
|
-
|
|
639
|
-
const hue = props.type && validationHues[props.type];
|
|
640
|
-
return React__namespace.default.createElement(StyledNotification, _extends$6({
|
|
1028
|
+
return React__namespace.default.createElement(StyledTitle, Object.assign({
|
|
641
1029
|
ref: ref,
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}, props, {
|
|
645
|
-
role: role === undefined ? 'status' : role
|
|
646
|
-
}), props.type && React__namespace.default.createElement(StyledIcon, {
|
|
647
|
-
hue: hue
|
|
648
|
-
}, React__namespace.default.createElement(Icon, null)), props.children);
|
|
1030
|
+
$isRegular: isRegular
|
|
1031
|
+
}, props));
|
|
649
1032
|
});
|
|
650
|
-
|
|
651
|
-
Notification.propTypes = {
|
|
652
|
-
type: PropTypes__default.default.oneOf(TYPE)
|
|
653
|
-
};
|
|
1033
|
+
Title.displayName = 'Notification.Title';
|
|
654
1034
|
|
|
655
|
-
const
|
|
1035
|
+
const Paragraph = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledParagraph, Object.assign({
|
|
656
1036
|
ref: ref
|
|
657
1037
|
}, props)));
|
|
658
|
-
|
|
659
|
-
Well.propTypes = {
|
|
660
|
-
isRecessed: PropTypes__default.default.bool,
|
|
661
|
-
isFloating: PropTypes__default.default.bool
|
|
662
|
-
};
|
|
663
|
-
|
|
664
|
-
var _path$1;
|
|
665
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
666
|
-
var SvgXStroke$1 = function SvgXStroke(props) {
|
|
667
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
668
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
669
|
-
width: 12,
|
|
670
|
-
height: 12,
|
|
671
|
-
focusable: "false",
|
|
672
|
-
viewBox: "0 0 12 12",
|
|
673
|
-
"aria-hidden": "true"
|
|
674
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
675
|
-
stroke: "currentColor",
|
|
676
|
-
strokeLinecap: "round",
|
|
677
|
-
d: "M3 9l6-6m0 6L3 3"
|
|
678
|
-
})));
|
|
679
|
-
};
|
|
1038
|
+
Paragraph.displayName = 'Notification.Paragraph';
|
|
680
1039
|
|
|
681
1040
|
const Close = React__namespace.default.forwardRef((props, ref) => {
|
|
682
1041
|
const ariaLabel = reactTheming.useText(Close, props, 'aria-label', 'Close');
|
|
683
|
-
const
|
|
684
|
-
return React__namespace.default.createElement(StyledClose,
|
|
1042
|
+
const type = useNotificationsContext();
|
|
1043
|
+
return React__namespace.default.createElement(StyledClose, Object.assign({
|
|
685
1044
|
ref: ref,
|
|
686
|
-
|
|
1045
|
+
$type: type,
|
|
687
1046
|
"aria-label": ariaLabel
|
|
688
|
-
}, props
|
|
1047
|
+
}, props, {
|
|
1048
|
+
focusInset: true,
|
|
1049
|
+
size: "small"
|
|
1050
|
+
}), React__namespace.default.createElement(SvgXStroke, null));
|
|
689
1051
|
});
|
|
690
|
-
Close.displayName = 'Close';
|
|
1052
|
+
Close.displayName = 'Notification.Close';
|
|
691
1053
|
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
1054
|
+
const NotificationComponent = React.forwardRef((_ref, ref) => {
|
|
1055
|
+
let {
|
|
1056
|
+
children,
|
|
1057
|
+
type,
|
|
1058
|
+
...props
|
|
1059
|
+
} = _ref;
|
|
1060
|
+
const Icon = type ? validationIcons[type] : SvgInfoStroke;
|
|
1061
|
+
return React__namespace.default.createElement(StyledNotification, Object.assign({
|
|
1062
|
+
ref: ref,
|
|
1063
|
+
$type: type,
|
|
1064
|
+
$isFloating: true,
|
|
1065
|
+
role: "alert"
|
|
1066
|
+
}, props), type && React__namespace.default.createElement(StyledIcon, {
|
|
1067
|
+
$type: type
|
|
1068
|
+
}, React__namespace.default.createElement(Icon, null)), children);
|
|
1069
|
+
});
|
|
1070
|
+
NotificationComponent.displayName = 'Notification';
|
|
1071
|
+
NotificationComponent.propTypes = {
|
|
1072
|
+
type: PropTypes__default.default.oneOf(TYPE)
|
|
1073
|
+
};
|
|
1074
|
+
const Notification = NotificationComponent;
|
|
1075
|
+
Notification.Close = Close;
|
|
1076
|
+
Notification.Paragraph = Paragraph;
|
|
1077
|
+
Notification.Title = Title;
|
|
696
1078
|
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
1079
|
+
const WellComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
1080
|
+
let {
|
|
1081
|
+
isFloating,
|
|
1082
|
+
isRecessed,
|
|
1083
|
+
...props
|
|
1084
|
+
} = _ref;
|
|
1085
|
+
return React__namespace.default.createElement(StyledWell, Object.assign({
|
|
1086
|
+
ref: ref,
|
|
1087
|
+
$isFloating: isFloating,
|
|
1088
|
+
$isRecessed: isRecessed
|
|
1089
|
+
}, props));
|
|
1090
|
+
});
|
|
1091
|
+
WellComponent.displayName = 'Well';
|
|
1092
|
+
WellComponent.propTypes = {
|
|
1093
|
+
isRecessed: PropTypes__default.default.bool,
|
|
1094
|
+
isFloating: PropTypes__default.default.bool
|
|
1095
|
+
};
|
|
1096
|
+
const Well = WellComponent;
|
|
1097
|
+
Well.Paragraph = Paragraph;
|
|
1098
|
+
Well.Title = Title;
|
|
701
1099
|
|
|
702
1100
|
const getInitialState = () => {
|
|
703
1101
|
return {
|
|
@@ -971,7 +1369,7 @@ const ToastSlot = _ref => {
|
|
|
971
1369
|
}
|
|
972
1370
|
return index >= limit;
|
|
973
1371
|
}, [limit, placement, toasts.length]);
|
|
974
|
-
return React__namespace.default.createElement(StyledTransitionContainer,
|
|
1372
|
+
return React__namespace.default.createElement(StyledTransitionContainer, Object.assign({
|
|
975
1373
|
key: placement,
|
|
976
1374
|
toastPlacement: placement,
|
|
977
1375
|
toastZIndex: zIndex,
|
|
@@ -1016,7 +1414,7 @@ const ToastProvider = _ref => {
|
|
|
1016
1414
|
if (placement === 'bottom' || placement === 'bottom-start' || placement === 'bottom-end') {
|
|
1017
1415
|
matchingToasts = matchingToasts.reverse();
|
|
1018
1416
|
}
|
|
1019
|
-
return React__namespace.default.createElement(ToastSlot,
|
|
1417
|
+
return React__namespace.default.createElement(ToastSlot, Object.assign({
|
|
1020
1418
|
placement: placement,
|
|
1021
1419
|
toasts: matchingToasts,
|
|
1022
1420
|
zIndex: zIndex,
|
|
@@ -1050,10 +1448,11 @@ const GlobalAlertButton = React.forwardRef((_ref, ref) => {
|
|
|
1050
1448
|
const {
|
|
1051
1449
|
type
|
|
1052
1450
|
} = useGlobalAlertContext();
|
|
1053
|
-
return React__namespace.default.createElement(StyledGlobalAlertButton,
|
|
1451
|
+
return React__namespace.default.createElement(StyledGlobalAlertButton, Object.assign({
|
|
1054
1452
|
ref: ref,
|
|
1055
|
-
alertType: type
|
|
1453
|
+
$alertType: type
|
|
1056
1454
|
}, props, {
|
|
1455
|
+
size: "small",
|
|
1057
1456
|
isPrimary: !isBasic,
|
|
1058
1457
|
isBasic: isBasic
|
|
1059
1458
|
}));
|
|
@@ -1063,32 +1462,17 @@ GlobalAlertButton.propTypes = {
|
|
|
1063
1462
|
isBasic: PropTypes__default.default.bool
|
|
1064
1463
|
};
|
|
1065
1464
|
|
|
1066
|
-
var _path;
|
|
1067
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1068
|
-
var SvgXStroke = function SvgXStroke(props) {
|
|
1069
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1070
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1071
|
-
width: 16,
|
|
1072
|
-
height: 16,
|
|
1073
|
-
focusable: "false",
|
|
1074
|
-
viewBox: "0 0 16 16",
|
|
1075
|
-
"aria-hidden": "true"
|
|
1076
|
-
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1077
|
-
stroke: "currentColor",
|
|
1078
|
-
strokeLinecap: "round",
|
|
1079
|
-
d: "M3 13L13 3m0 10L3 3"
|
|
1080
|
-
})));
|
|
1081
|
-
};
|
|
1082
|
-
|
|
1083
1465
|
const GlobalAlertClose = React.forwardRef((props, ref) => {
|
|
1084
1466
|
const {
|
|
1085
1467
|
type
|
|
1086
1468
|
} = useGlobalAlertContext();
|
|
1087
1469
|
const label = reactTheming.useText(GlobalAlertClose, props, 'aria-label', 'Close');
|
|
1088
|
-
return React__namespace.default.createElement(StyledGlobalAlertClose,
|
|
1470
|
+
return React__namespace.default.createElement(StyledGlobalAlertClose, Object.assign({
|
|
1089
1471
|
ref: ref,
|
|
1090
|
-
alertType: type
|
|
1091
|
-
}, props
|
|
1472
|
+
$alertType: type
|
|
1473
|
+
}, props, {
|
|
1474
|
+
size: "small"
|
|
1475
|
+
}), React__namespace.default.createElement(SvgXStroke, {
|
|
1092
1476
|
role: "img",
|
|
1093
1477
|
"aria-label": label
|
|
1094
1478
|
}));
|
|
@@ -1096,18 +1480,23 @@ const GlobalAlertClose = React.forwardRef((props, ref) => {
|
|
|
1096
1480
|
GlobalAlertClose.displayName = 'GlobalAlert.Close';
|
|
1097
1481
|
|
|
1098
1482
|
const GlobalAlertContent = React.forwardRef((props, ref) => {
|
|
1099
|
-
return React__namespace.default.createElement(StyledGlobalAlertContent,
|
|
1483
|
+
return React__namespace.default.createElement(StyledGlobalAlertContent, Object.assign({
|
|
1100
1484
|
ref: ref
|
|
1101
1485
|
}, props));
|
|
1102
1486
|
});
|
|
1103
1487
|
GlobalAlertContent.displayName = 'GlobalAlert.Content';
|
|
1104
1488
|
|
|
1105
|
-
const GlobalAlertTitle = React.forwardRef((
|
|
1489
|
+
const GlobalAlertTitle = React.forwardRef((_ref, ref) => {
|
|
1490
|
+
let {
|
|
1491
|
+
isRegular,
|
|
1492
|
+
...props
|
|
1493
|
+
} = _ref;
|
|
1106
1494
|
const {
|
|
1107
1495
|
type
|
|
1108
1496
|
} = useGlobalAlertContext();
|
|
1109
|
-
return React__namespace.default.createElement(StyledGlobalAlertTitle,
|
|
1110
|
-
alertType: type,
|
|
1497
|
+
return React__namespace.default.createElement(StyledGlobalAlertTitle, Object.assign({
|
|
1498
|
+
$alertType: type,
|
|
1499
|
+
$isRegular: isRegular,
|
|
1111
1500
|
ref: ref
|
|
1112
1501
|
}, props));
|
|
1113
1502
|
});
|
|
@@ -1121,20 +1510,33 @@ const GlobalAlertComponent = React.forwardRef((_ref, ref) => {
|
|
|
1121
1510
|
type,
|
|
1122
1511
|
...props
|
|
1123
1512
|
} = _ref;
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1513
|
+
const icon = {
|
|
1514
|
+
success: React__namespace.default.createElement(SvgCheckCircleStroke, null),
|
|
1515
|
+
error: React__namespace.default.createElement(SvgAlertErrorStroke, null),
|
|
1516
|
+
warning: React__namespace.default.createElement(SvgAlertWarningStroke, null),
|
|
1517
|
+
info: React__namespace.default.createElement(SvgInfoStroke, null)
|
|
1518
|
+
}[type];
|
|
1519
|
+
return (
|
|
1520
|
+
React__namespace.default.createElement(styled.ThemeProvider, {
|
|
1521
|
+
theme: theme => ({
|
|
1522
|
+
...theme,
|
|
1523
|
+
colors: {
|
|
1524
|
+
...theme.colors,
|
|
1525
|
+
base: 'light'
|
|
1526
|
+
}
|
|
1527
|
+
})
|
|
1528
|
+
}, React__namespace.default.createElement(GlobalAlertContext.Provider, {
|
|
1529
|
+
value: React.useMemo(() => ({
|
|
1530
|
+
type
|
|
1531
|
+
}), [type])
|
|
1532
|
+
}, React__namespace.default.createElement(StyledGlobalAlert, Object.assign({
|
|
1533
|
+
ref: ref,
|
|
1534
|
+
role: "status",
|
|
1535
|
+
$alertType: type
|
|
1536
|
+
}, props), React__namespace.default.createElement(StyledGlobalAlertIcon, {
|
|
1537
|
+
$alertType: type
|
|
1538
|
+
}, icon), props.children)))
|
|
1539
|
+
);
|
|
1138
1540
|
});
|
|
1139
1541
|
GlobalAlertComponent.displayName = 'GlobalAlert';
|
|
1140
1542
|
const GlobalAlert = GlobalAlertComponent;
|