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