@canonical/react-components 2.3.0 → 2.3.1
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/components/Notifications/ToastNotification/Animate.js +1 -0
- package/dist/components/Notifications/ToastNotification/Toast.scss +10 -19
- package/dist/components/Notifications/ToastNotification/ToastNotification.stories.js +1 -0
- package/dist/components/Notifications/ToastNotification/ToastNotificationList.d.ts +1 -1
- package/dist/components/Notifications/ToastNotification/ToastNotificationList.js +2 -2
- package/dist/components/Notifications/ToastNotification/ToastNotificationProvider.js +1 -0
- package/dist/esm/components/Notifications/ToastNotification/Animate.js +1 -0
- package/dist/esm/components/Notifications/ToastNotification/Toast.scss +10 -19
- package/dist/esm/components/Notifications/ToastNotification/ToastNotification.stories.js +1 -0
- package/dist/esm/components/Notifications/ToastNotification/ToastNotificationList.d.ts +1 -1
- package/dist/esm/components/Notifications/ToastNotification/ToastNotificationList.js +2 -2
- package/dist/esm/components/Notifications/ToastNotification/ToastNotificationProvider.js +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
@import "vanilla-framework/scss/settings";
|
|
2
|
-
@import "vanilla-framework/scss/build";
|
|
3
|
-
|
|
4
1
|
.toast-animate {
|
|
5
2
|
position: relative;
|
|
6
3
|
z-index: 101;
|
|
@@ -13,21 +10,21 @@
|
|
|
13
10
|
position: absolute;
|
|
14
11
|
right: 0;
|
|
15
12
|
|
|
16
|
-
@media screen and (min-width:
|
|
13
|
+
@media screen and (min-width: 620px) and (max-width: 1036px) {
|
|
17
14
|
width: 500px;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
@media screen and (min-width:
|
|
17
|
+
@media screen and (min-width: 1036px) {
|
|
21
18
|
width: 600px;
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
.toast-notification {
|
|
26
|
-
box-shadow: 0 0
|
|
23
|
+
box-shadow: 0 0 2rem 0.5rem rgb(0 0 0 / 15%);
|
|
27
24
|
overflow: hidden;
|
|
28
25
|
z-index: 101;
|
|
29
26
|
|
|
30
|
-
@media screen and (max-width:
|
|
27
|
+
@media screen and (max-width: 620px) {
|
|
31
28
|
left: 0;
|
|
32
29
|
margin: 1.5rem auto;
|
|
33
30
|
max-width: 400px;
|
|
@@ -37,7 +34,7 @@
|
|
|
37
34
|
|
|
38
35
|
.toast-notification-list {
|
|
39
36
|
background-color: white;
|
|
40
|
-
box-shadow: 0 0
|
|
37
|
+
box-shadow: 0 0 2rem 0.5rem rgb(0 0 0 / 22%);
|
|
41
38
|
max-height: calc(100vh - 4.5rem);
|
|
42
39
|
overflow: auto;
|
|
43
40
|
padding: 0 0.5rem;
|
|
@@ -66,7 +63,7 @@
|
|
|
66
63
|
.dismiss-text {
|
|
67
64
|
align-items: center;
|
|
68
65
|
display: flex;
|
|
69
|
-
gap:
|
|
66
|
+
gap: 0.25rem;
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
|
|
@@ -77,9 +74,9 @@
|
|
|
77
74
|
align-items: center;
|
|
78
75
|
border: none;
|
|
79
76
|
display: flex;
|
|
80
|
-
gap:
|
|
77
|
+
gap: 0.25rem;
|
|
81
78
|
justify-content: center;
|
|
82
|
-
margin-right:
|
|
79
|
+
margin-right: 0.5rem !important;
|
|
83
80
|
padding: calc(0.4rem - 1px);
|
|
84
81
|
|
|
85
82
|
/* stylelint-disable max-nesting-depth */
|
|
@@ -88,17 +85,11 @@
|
|
|
88
85
|
padding: 0;
|
|
89
86
|
text-align: center;
|
|
90
87
|
}
|
|
91
|
-
|
|
92
|
-
/* stylelint-disable-next-line selector-class-pattern */
|
|
93
|
-
.p-icon--info--notification {
|
|
94
|
-
@extend %icon;
|
|
95
|
-
@include vf-icon-info-coloured-themed;
|
|
96
|
-
}
|
|
97
88
|
/* stylelint-enable max-nesting-depth */
|
|
98
89
|
}
|
|
99
90
|
}
|
|
100
91
|
|
|
101
|
-
@media screen and (max-width:
|
|
92
|
+
@media screen and (max-width: 620px) {
|
|
102
93
|
align-items: flex-start;
|
|
103
94
|
flex-direction: column;
|
|
104
95
|
gap: 0.5rem;
|
|
@@ -106,7 +97,7 @@
|
|
|
106
97
|
}
|
|
107
98
|
}
|
|
108
99
|
|
|
109
|
-
@media screen and (max-width:
|
|
100
|
+
@media screen and (max-width: 620px) {
|
|
110
101
|
bottom: 2rem;
|
|
111
102
|
left: 0;
|
|
112
103
|
margin: 1.5rem auto;
|
|
@@ -35,6 +35,7 @@ const PreloadedList = () => {
|
|
|
35
35
|
toastNotify.info("Your changes are syncing in the background");
|
|
36
36
|
toastNotify.failure("Save failed", new Error("500 Internal Server Error"), "Please try again.");
|
|
37
37
|
toastNotify.toggleListView();
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
39
|
}, []);
|
|
39
40
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
41
|
style: {
|
|
@@ -7,7 +7,7 @@ export type FilterTypes = ValueOf<typeof NotificationSeverity>;
|
|
|
7
7
|
export declare const severityOrder: readonly ["positive", "caution", "negative", "information"];
|
|
8
8
|
export declare const iconLookup: {
|
|
9
9
|
readonly positive: "success";
|
|
10
|
-
readonly information: "
|
|
10
|
+
readonly information: "information";
|
|
11
11
|
readonly caution: "warning";
|
|
12
12
|
readonly negative: "error";
|
|
13
13
|
};
|
|
@@ -20,8 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
20
|
const severityOrder = exports.severityOrder = ["positive", "caution", "negative", "information"];
|
|
21
21
|
const iconLookup = exports.iconLookup = {
|
|
22
22
|
positive: _Icon.ICONS.success,
|
|
23
|
-
|
|
24
|
-
information: "info--notification",
|
|
23
|
+
information: _Icon.ICONS.information,
|
|
25
24
|
caution: _Icon.ICONS.warning,
|
|
26
25
|
negative: _Icon.ICONS.error
|
|
27
26
|
};
|
|
@@ -39,6 +38,7 @@ const ToastNotificationList = _ref => {
|
|
|
39
38
|
const preferReducedMotion = (0, _hooks.usePrefersReducedMotion)();
|
|
40
39
|
(0, _react.useLayoutEffect)(() => {
|
|
41
40
|
adjustScrollPosition();
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
42
|
}, [notifications]);
|
|
43
43
|
|
|
44
44
|
// this layout effect is used to maintain scroll position of the
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
@import "vanilla-framework/scss/settings";
|
|
2
|
-
@import "vanilla-framework/scss/build";
|
|
3
|
-
|
|
4
1
|
.toast-animate {
|
|
5
2
|
position: relative;
|
|
6
3
|
z-index: 101;
|
|
@@ -13,21 +10,21 @@
|
|
|
13
10
|
position: absolute;
|
|
14
11
|
right: 0;
|
|
15
12
|
|
|
16
|
-
@media screen and (min-width:
|
|
13
|
+
@media screen and (min-width: 620px) and (max-width: 1036px) {
|
|
17
14
|
width: 500px;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
@media screen and (min-width:
|
|
17
|
+
@media screen and (min-width: 1036px) {
|
|
21
18
|
width: 600px;
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
.toast-notification {
|
|
26
|
-
box-shadow: 0 0
|
|
23
|
+
box-shadow: 0 0 2rem 0.5rem rgb(0 0 0 / 15%);
|
|
27
24
|
overflow: hidden;
|
|
28
25
|
z-index: 101;
|
|
29
26
|
|
|
30
|
-
@media screen and (max-width:
|
|
27
|
+
@media screen and (max-width: 620px) {
|
|
31
28
|
left: 0;
|
|
32
29
|
margin: 1.5rem auto;
|
|
33
30
|
max-width: 400px;
|
|
@@ -37,7 +34,7 @@
|
|
|
37
34
|
|
|
38
35
|
.toast-notification-list {
|
|
39
36
|
background-color: white;
|
|
40
|
-
box-shadow: 0 0
|
|
37
|
+
box-shadow: 0 0 2rem 0.5rem rgb(0 0 0 / 22%);
|
|
41
38
|
max-height: calc(100vh - 4.5rem);
|
|
42
39
|
overflow: auto;
|
|
43
40
|
padding: 0 0.5rem;
|
|
@@ -66,7 +63,7 @@
|
|
|
66
63
|
.dismiss-text {
|
|
67
64
|
align-items: center;
|
|
68
65
|
display: flex;
|
|
69
|
-
gap:
|
|
66
|
+
gap: 0.25rem;
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
|
|
@@ -77,9 +74,9 @@
|
|
|
77
74
|
align-items: center;
|
|
78
75
|
border: none;
|
|
79
76
|
display: flex;
|
|
80
|
-
gap:
|
|
77
|
+
gap: 0.25rem;
|
|
81
78
|
justify-content: center;
|
|
82
|
-
margin-right:
|
|
79
|
+
margin-right: 0.5rem !important;
|
|
83
80
|
padding: calc(0.4rem - 1px);
|
|
84
81
|
|
|
85
82
|
/* stylelint-disable max-nesting-depth */
|
|
@@ -88,17 +85,11 @@
|
|
|
88
85
|
padding: 0;
|
|
89
86
|
text-align: center;
|
|
90
87
|
}
|
|
91
|
-
|
|
92
|
-
/* stylelint-disable-next-line selector-class-pattern */
|
|
93
|
-
.p-icon--info--notification {
|
|
94
|
-
@extend %icon;
|
|
95
|
-
@include vf-icon-info-coloured-themed;
|
|
96
|
-
}
|
|
97
88
|
/* stylelint-enable max-nesting-depth */
|
|
98
89
|
}
|
|
99
90
|
}
|
|
100
91
|
|
|
101
|
-
@media screen and (max-width:
|
|
92
|
+
@media screen and (max-width: 620px) {
|
|
102
93
|
align-items: flex-start;
|
|
103
94
|
flex-direction: column;
|
|
104
95
|
gap: 0.5rem;
|
|
@@ -106,7 +97,7 @@
|
|
|
106
97
|
}
|
|
107
98
|
}
|
|
108
99
|
|
|
109
|
-
@media screen and (max-width:
|
|
100
|
+
@media screen and (max-width: 620px) {
|
|
110
101
|
bottom: 2rem;
|
|
111
102
|
left: 0;
|
|
112
103
|
margin: 1.5rem auto;
|
|
@@ -26,6 +26,7 @@ var PreloadedList = () => {
|
|
|
26
26
|
toastNotify.info("Your changes are syncing in the background");
|
|
27
27
|
toastNotify.failure("Save failed", new Error("500 Internal Server Error"), "Please try again.");
|
|
28
28
|
toastNotify.toggleListView();
|
|
29
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
30
|
}, []);
|
|
30
31
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
32
|
style: {
|
|
@@ -7,7 +7,7 @@ export type FilterTypes = ValueOf<typeof NotificationSeverity>;
|
|
|
7
7
|
export declare const severityOrder: readonly ["positive", "caution", "negative", "information"];
|
|
8
8
|
export declare const iconLookup: {
|
|
9
9
|
readonly positive: "success";
|
|
10
|
-
readonly information: "
|
|
10
|
+
readonly information: "information";
|
|
11
11
|
readonly caution: "warning";
|
|
12
12
|
readonly negative: "error";
|
|
13
13
|
};
|
|
@@ -13,8 +13,7 @@ import "./Toast.scss";
|
|
|
13
13
|
export var severityOrder = ["positive", "caution", "negative", "information"];
|
|
14
14
|
export var iconLookup = {
|
|
15
15
|
positive: ICONS.success,
|
|
16
|
-
|
|
17
|
-
information: "info--notification",
|
|
16
|
+
information: ICONS.information,
|
|
18
17
|
caution: ICONS.warning,
|
|
19
18
|
negative: ICONS.error
|
|
20
19
|
};
|
|
@@ -32,6 +31,7 @@ var ToastNotificationList = _ref => {
|
|
|
32
31
|
var preferReducedMotion = usePrefersReducedMotion();
|
|
33
32
|
useLayoutEffect(() => {
|
|
34
33
|
adjustScrollPosition();
|
|
34
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
35
|
}, [notifications]);
|
|
36
36
|
|
|
37
37
|
// this layout effect is used to maintain scroll position of the
|