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