@khanacademy/wonder-blocks-banner 4.1.0 → 4.1.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/CHANGELOG.md +14 -0
- package/dist/es/index.js +1 -1
- package/dist/index.js +23 -12
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-banner
|
|
2
2
|
|
|
3
|
+
## 4.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ee8d95a: Rollback rollup version from v4 to v2 to prevent an issue with CJS builds in unit tests
|
|
8
|
+
- Updated dependencies [ee8d95a]
|
|
9
|
+
- @khanacademy/wonder-blocks-button@7.1.1
|
|
10
|
+
- @khanacademy/wonder-blocks-core@12.1.1
|
|
11
|
+
- @khanacademy/wonder-blocks-icon@5.1.1
|
|
12
|
+
- @khanacademy/wonder-blocks-icon-button@6.1.1
|
|
13
|
+
- @khanacademy/wonder-blocks-link@7.1.1
|
|
14
|
+
- @khanacademy/wonder-blocks-tokens@4.2.1
|
|
15
|
+
- @khanacademy/wonder-blocks-typography@3.1.1
|
|
16
|
+
|
|
3
17
|
## 4.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/es/index.js
CHANGED
|
@@ -55,7 +55,7 @@ const Banner = props => {
|
|
|
55
55
|
icon
|
|
56
56
|
} = props;
|
|
57
57
|
const renderActions = () => {
|
|
58
|
-
return actions == null ?
|
|
58
|
+
return actions == null ? void 0 : actions.filter(Boolean).map((action, i) => {
|
|
59
59
|
if (action.type === "custom") {
|
|
60
60
|
return React.createElement(View, {
|
|
61
61
|
style: styles.action,
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,10 @@ var successIcon = require('@phosphor-icons/core/regular/smiley.svg');
|
|
|
15
15
|
var warningIcon = require('@phosphor-icons/core/regular/warning.svg');
|
|
16
16
|
var criticalIcon = require('@phosphor-icons/core/regular/warning-circle.svg');
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
+
|
|
20
|
+
function _interopNamespace(e) {
|
|
21
|
+
if (e && e.__esModule) return e;
|
|
19
22
|
var n = Object.create(null);
|
|
20
23
|
if (e) {
|
|
21
24
|
Object.keys(e).forEach(function (k) {
|
|
@@ -28,37 +31,45 @@ function _interopNamespaceDefault(e) {
|
|
|
28
31
|
}
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
|
-
n
|
|
34
|
+
n["default"] = e;
|
|
32
35
|
return Object.freeze(n);
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
var React__namespace = /*#__PURE__*/
|
|
38
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
39
|
+
var xIcon__default = /*#__PURE__*/_interopDefaultLegacy(xIcon);
|
|
40
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
41
|
+
var IconButton__default = /*#__PURE__*/_interopDefaultLegacy(IconButton);
|
|
42
|
+
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
43
|
+
var infoIcon__default = /*#__PURE__*/_interopDefaultLegacy(infoIcon);
|
|
44
|
+
var successIcon__default = /*#__PURE__*/_interopDefaultLegacy(successIcon);
|
|
45
|
+
var warningIcon__default = /*#__PURE__*/_interopDefaultLegacy(warningIcon);
|
|
46
|
+
var criticalIcon__default = /*#__PURE__*/_interopDefaultLegacy(criticalIcon);
|
|
36
47
|
|
|
37
48
|
const getValuesForKind = kind => {
|
|
38
49
|
switch (kind) {
|
|
39
50
|
case "success":
|
|
40
51
|
return {
|
|
41
52
|
color: wonderBlocksTokens.semanticColor.status.success.foreground,
|
|
42
|
-
icon:
|
|
53
|
+
icon: successIcon__default["default"],
|
|
43
54
|
role: "status"
|
|
44
55
|
};
|
|
45
56
|
case "warning":
|
|
46
57
|
return {
|
|
47
58
|
color: wonderBlocksTokens.semanticColor.status.warning.foreground,
|
|
48
|
-
icon:
|
|
59
|
+
icon: warningIcon__default["default"],
|
|
49
60
|
role: "alert",
|
|
50
61
|
ariaLive: "polite"
|
|
51
62
|
};
|
|
52
63
|
case "critical":
|
|
53
64
|
return {
|
|
54
65
|
color: wonderBlocksTokens.semanticColor.status.critical.foreground,
|
|
55
|
-
icon:
|
|
66
|
+
icon: criticalIcon__default["default"],
|
|
56
67
|
role: "alert"
|
|
57
68
|
};
|
|
58
69
|
default:
|
|
59
70
|
return {
|
|
60
71
|
color: wonderBlocksTokens.semanticColor.status.notice.foreground,
|
|
61
|
-
icon:
|
|
72
|
+
icon: infoIcon__default["default"],
|
|
62
73
|
role: "status"
|
|
63
74
|
};
|
|
64
75
|
}
|
|
@@ -76,7 +87,7 @@ const Banner = props => {
|
|
|
76
87
|
icon
|
|
77
88
|
} = props;
|
|
78
89
|
const renderActions = () => {
|
|
79
|
-
return actions == null ?
|
|
90
|
+
return actions == null ? void 0 : actions.filter(Boolean).map((action, i) => {
|
|
80
91
|
if (action.type === "custom") {
|
|
81
92
|
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
82
93
|
style: styles.action,
|
|
@@ -89,7 +100,7 @@ const Banner = props => {
|
|
|
89
100
|
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
90
101
|
style: styles.action,
|
|
91
102
|
key: action.title
|
|
92
|
-
}, React__namespace.createElement(
|
|
103
|
+
}, React__namespace.createElement(Link__default["default"], {
|
|
93
104
|
kind: "primary",
|
|
94
105
|
href: action.href,
|
|
95
106
|
onClick: handleClick,
|
|
@@ -101,7 +112,7 @@ const Banner = props => {
|
|
|
101
112
|
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
102
113
|
style: styles.action,
|
|
103
114
|
key: action.title
|
|
104
|
-
}, React__namespace.createElement(
|
|
115
|
+
}, React__namespace.createElement(Button__default["default"], {
|
|
105
116
|
kind: "tertiary",
|
|
106
117
|
size: "small",
|
|
107
118
|
"aria-label": (_action$ariaLabel2 = action.ariaLabel) != null ? _action$ariaLabel2 : action.title,
|
|
@@ -140,8 +151,8 @@ const Banner = props => {
|
|
|
140
151
|
style: styles.actionsContainer
|
|
141
152
|
}, renderActions())), onDismiss ? React__namespace.createElement(wonderBlocksCore.View, {
|
|
142
153
|
style: styles.dismissContainer
|
|
143
|
-
}, React__namespace.createElement(
|
|
144
|
-
icon:
|
|
154
|
+
}, React__namespace.createElement(IconButton__default["default"], {
|
|
155
|
+
icon: xIcon__default["default"],
|
|
145
156
|
kind: "tertiary",
|
|
146
157
|
onClick: onDismiss,
|
|
147
158
|
style: styles.dismiss,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-banner",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Banner components for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@babel/runtime": "^7.24.5",
|
|
16
|
-
"@khanacademy/wonder-blocks-button": "7.1.
|
|
17
|
-
"@khanacademy/wonder-blocks-core": "12.1.
|
|
18
|
-
"@khanacademy/wonder-blocks-icon": "5.1.
|
|
19
|
-
"@khanacademy/wonder-blocks-icon-button": "6.1.
|
|
20
|
-
"@khanacademy/wonder-blocks-link": "7.1.
|
|
21
|
-
"@khanacademy/wonder-blocks-tokens": "4.2.
|
|
22
|
-
"@khanacademy/wonder-blocks-typography": "3.1.
|
|
16
|
+
"@khanacademy/wonder-blocks-button": "7.1.1",
|
|
17
|
+
"@khanacademy/wonder-blocks-core": "12.1.1",
|
|
18
|
+
"@khanacademy/wonder-blocks-icon": "5.1.1",
|
|
19
|
+
"@khanacademy/wonder-blocks-icon-button": "6.1.1",
|
|
20
|
+
"@khanacademy/wonder-blocks-link": "7.1.1",
|
|
21
|
+
"@khanacademy/wonder-blocks-tokens": "4.2.1",
|
|
22
|
+
"@khanacademy/wonder-blocks-typography": "3.1.1"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@phosphor-icons/core": "^2.0.2",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react": "18.2.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@khanacademy/wb-dev-build-settings": "2.1.
|
|
30
|
+
"@khanacademy/wb-dev-build-settings": "2.1.1"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"test": "echo \"Error: no test specified\" && exit 1"
|