@khanacademy/wonder-blocks-banner 4.1.0 → 4.1.2
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 +41 -0
- package/dist/es/index.js +1 -2
- package/dist/index.js +23 -13
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-banner
|
|
2
2
|
|
|
3
|
+
## 4.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 762f749: Remove `kind="primary"` from Link instance"
|
|
8
|
+
- 5bd2a95: Internal `Link` refactor to use `semanticColor` tokens intead of `color`. Also moved the link colors to an object to prepare this for an upcoming theme integration"
|
|
9
|
+
- Updated dependencies [ed26d66]
|
|
10
|
+
- Updated dependencies [5655b9f]
|
|
11
|
+
- Updated dependencies [5655b9f]
|
|
12
|
+
- Updated dependencies [8f53293]
|
|
13
|
+
- Updated dependencies [beb09cd]
|
|
14
|
+
- Updated dependencies [5bd2a95]
|
|
15
|
+
- Updated dependencies [762f749]
|
|
16
|
+
- Updated dependencies [051f0f8]
|
|
17
|
+
- Updated dependencies [b6d77dc]
|
|
18
|
+
- Updated dependencies [e1b78db]
|
|
19
|
+
- Updated dependencies [8f53293]
|
|
20
|
+
- Updated dependencies [051f0f8]
|
|
21
|
+
- Updated dependencies [ca57826]
|
|
22
|
+
- @khanacademy/wonder-blocks-core@12.2.0
|
|
23
|
+
- @khanacademy/wonder-blocks-tokens@5.0.0
|
|
24
|
+
- @khanacademy/wonder-blocks-icon-button@6.1.2
|
|
25
|
+
- @khanacademy/wonder-blocks-button@7.1.2
|
|
26
|
+
- @khanacademy/wonder-blocks-link@8.0.0
|
|
27
|
+
- @khanacademy/wonder-blocks-icon@5.1.2
|
|
28
|
+
- @khanacademy/wonder-blocks-typography@3.1.2
|
|
29
|
+
|
|
30
|
+
## 4.1.1
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- ee8d95a: Rollback rollup version from v4 to v2 to prevent an issue with CJS builds in unit tests
|
|
35
|
+
- Updated dependencies [ee8d95a]
|
|
36
|
+
- @khanacademy/wonder-blocks-button@7.1.1
|
|
37
|
+
- @khanacademy/wonder-blocks-core@12.1.1
|
|
38
|
+
- @khanacademy/wonder-blocks-icon@5.1.1
|
|
39
|
+
- @khanacademy/wonder-blocks-icon-button@6.1.1
|
|
40
|
+
- @khanacademy/wonder-blocks-link@7.1.1
|
|
41
|
+
- @khanacademy/wonder-blocks-tokens@4.2.1
|
|
42
|
+
- @khanacademy/wonder-blocks-typography@3.1.1
|
|
43
|
+
|
|
3
44
|
## 4.1.0
|
|
4
45
|
|
|
5
46
|
### 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,
|
|
@@ -69,7 +69,6 @@ const Banner = props => {
|
|
|
69
69
|
style: styles.action,
|
|
70
70
|
key: action.title
|
|
71
71
|
}, React.createElement(Link, {
|
|
72
|
-
kind: "primary",
|
|
73
72
|
href: action.href,
|
|
74
73
|
onClick: handleClick,
|
|
75
74
|
"aria-label": (_action$ariaLabel = action.ariaLabel) != null ? _action$ariaLabel : action.title,
|
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,8 +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(
|
|
93
|
-
kind: "primary",
|
|
103
|
+
}, React__namespace.createElement(Link__default["default"], {
|
|
94
104
|
href: action.href,
|
|
95
105
|
onClick: handleClick,
|
|
96
106
|
"aria-label": (_action$ariaLabel = action.ariaLabel) != null ? _action$ariaLabel : action.title,
|
|
@@ -101,7 +111,7 @@ const Banner = props => {
|
|
|
101
111
|
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
102
112
|
style: styles.action,
|
|
103
113
|
key: action.title
|
|
104
|
-
}, React__namespace.createElement(
|
|
114
|
+
}, React__namespace.createElement(Button__default["default"], {
|
|
105
115
|
kind: "tertiary",
|
|
106
116
|
size: "small",
|
|
107
117
|
"aria-label": (_action$ariaLabel2 = action.ariaLabel) != null ? _action$ariaLabel2 : action.title,
|
|
@@ -140,8 +150,8 @@ const Banner = props => {
|
|
|
140
150
|
style: styles.actionsContainer
|
|
141
151
|
}, renderActions())), onDismiss ? React__namespace.createElement(wonderBlocksCore.View, {
|
|
142
152
|
style: styles.dismissContainer
|
|
143
|
-
}, React__namespace.createElement(
|
|
144
|
-
icon:
|
|
153
|
+
}, React__namespace.createElement(IconButton__default["default"], {
|
|
154
|
+
icon: xIcon__default["default"],
|
|
145
155
|
kind: "tertiary",
|
|
146
156
|
onClick: onDismiss,
|
|
147
157
|
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.2",
|
|
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.
|
|
18
|
-
"@khanacademy/wonder-blocks-icon": "5.1.
|
|
19
|
-
"@khanacademy/wonder-blocks-icon-button": "6.1.
|
|
20
|
-
"@khanacademy/wonder-blocks-link": "
|
|
21
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
22
|
-
"@khanacademy/wonder-blocks-typography": "3.1.
|
|
16
|
+
"@khanacademy/wonder-blocks-button": "7.1.2",
|
|
17
|
+
"@khanacademy/wonder-blocks-core": "12.2.0",
|
|
18
|
+
"@khanacademy/wonder-blocks-icon": "5.1.2",
|
|
19
|
+
"@khanacademy/wonder-blocks-icon-button": "6.1.2",
|
|
20
|
+
"@khanacademy/wonder-blocks-link": "8.0.0",
|
|
21
|
+
"@khanacademy/wonder-blocks-tokens": "5.0.0",
|
|
22
|
+
"@khanacademy/wonder-blocks-typography": "3.1.2"
|
|
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"
|