@khanacademy/wonder-blocks-banner 4.0.8 → 4.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Khan Academy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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 ? void 0 : actions.filter(Boolean).map((action, i) => {
58
+ return actions == null ? undefined : 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,10 +15,7 @@ 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 _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;
18
+ function _interopNamespaceDefault(e) {
22
19
  var n = Object.create(null);
23
20
  if (e) {
24
21
  Object.keys(e).forEach(function (k) {
@@ -31,45 +28,37 @@ function _interopNamespace(e) {
31
28
  }
32
29
  });
33
30
  }
34
- n["default"] = e;
31
+ n.default = e;
35
32
  return Object.freeze(n);
36
33
  }
37
34
 
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);
35
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
47
36
 
48
37
  const getValuesForKind = kind => {
49
38
  switch (kind) {
50
39
  case "success":
51
40
  return {
52
41
  color: wonderBlocksTokens.semanticColor.status.success.foreground,
53
- icon: successIcon__default["default"],
42
+ icon: successIcon,
54
43
  role: "status"
55
44
  };
56
45
  case "warning":
57
46
  return {
58
47
  color: wonderBlocksTokens.semanticColor.status.warning.foreground,
59
- icon: warningIcon__default["default"],
48
+ icon: warningIcon,
60
49
  role: "alert",
61
50
  ariaLive: "polite"
62
51
  };
63
52
  case "critical":
64
53
  return {
65
54
  color: wonderBlocksTokens.semanticColor.status.critical.foreground,
66
- icon: criticalIcon__default["default"],
55
+ icon: criticalIcon,
67
56
  role: "alert"
68
57
  };
69
58
  default:
70
59
  return {
71
60
  color: wonderBlocksTokens.semanticColor.status.notice.foreground,
72
- icon: infoIcon__default["default"],
61
+ icon: infoIcon,
73
62
  role: "status"
74
63
  };
75
64
  }
@@ -87,7 +76,7 @@ const Banner = props => {
87
76
  icon
88
77
  } = props;
89
78
  const renderActions = () => {
90
- return actions == null ? void 0 : actions.filter(Boolean).map((action, i) => {
79
+ return actions == null ? undefined : actions.filter(Boolean).map((action, i) => {
91
80
  if (action.type === "custom") {
92
81
  return React__namespace.createElement(wonderBlocksCore.View, {
93
82
  style: styles.action,
@@ -100,7 +89,7 @@ const Banner = props => {
100
89
  return React__namespace.createElement(wonderBlocksCore.View, {
101
90
  style: styles.action,
102
91
  key: action.title
103
- }, React__namespace.createElement(Link__default["default"], {
92
+ }, React__namespace.createElement(Link, {
104
93
  kind: "primary",
105
94
  href: action.href,
106
95
  onClick: handleClick,
@@ -112,7 +101,7 @@ const Banner = props => {
112
101
  return React__namespace.createElement(wonderBlocksCore.View, {
113
102
  style: styles.action,
114
103
  key: action.title
115
- }, React__namespace.createElement(Button__default["default"], {
104
+ }, React__namespace.createElement(Button, {
116
105
  kind: "tertiary",
117
106
  size: "small",
118
107
  "aria-label": (_action$ariaLabel2 = action.ariaLabel) != null ? _action$ariaLabel2 : action.title,
@@ -151,8 +140,8 @@ const Banner = props => {
151
140
  style: styles.actionsContainer
152
141
  }, renderActions())), onDismiss ? React__namespace.createElement(wonderBlocksCore.View, {
153
142
  style: styles.dismissContainer
154
- }, React__namespace.createElement(IconButton__default["default"], {
155
- icon: xIcon__default["default"],
143
+ }, React__namespace.createElement(IconButton, {
144
+ icon: xIcon,
156
145
  kind: "tertiary",
157
146
  onClick: onDismiss,
158
147
  style: styles.dismiss,
package/package.json CHANGED
@@ -1,29 +1,25 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-banner",
3
- "version": "4.0.8",
3
+ "version": "4.1.0",
4
4
  "design": "v1",
5
5
  "description": "Banner components for Wonder Blocks.",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/es/index.js",
8
8
  "types": "dist/index.d.ts",
9
- "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1",
11
- "prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
12
- },
13
9
  "author": "",
14
10
  "license": "MIT",
15
11
  "publishConfig": {
16
12
  "access": "public"
17
13
  },
18
14
  "dependencies": {
19
- "@babel/runtime": "^7.18.6",
20
- "@khanacademy/wonder-blocks-button": "^7.0.7",
21
- "@khanacademy/wonder-blocks-core": "^11.1.0",
22
- "@khanacademy/wonder-blocks-icon": "^5.0.5",
23
- "@khanacademy/wonder-blocks-icon-button": "^6.0.8",
24
- "@khanacademy/wonder-blocks-link": "^7.0.7",
25
- "@khanacademy/wonder-blocks-tokens": "^4.1.0",
26
- "@khanacademy/wonder-blocks-typography": "^3.0.5"
15
+ "@babel/runtime": "^7.24.5",
16
+ "@khanacademy/wonder-blocks-button": "7.1.0",
17
+ "@khanacademy/wonder-blocks-core": "12.1.0",
18
+ "@khanacademy/wonder-blocks-icon": "5.1.0",
19
+ "@khanacademy/wonder-blocks-icon-button": "6.1.0",
20
+ "@khanacademy/wonder-blocks-link": "7.1.0",
21
+ "@khanacademy/wonder-blocks-tokens": "4.2.0",
22
+ "@khanacademy/wonder-blocks-typography": "3.1.0"
27
23
  },
28
24
  "peerDependencies": {
29
25
  "@phosphor-icons/core": "^2.0.2",
@@ -31,6 +27,9 @@
31
27
  "react": "18.2.0"
32
28
  },
33
29
  "devDependencies": {
34
- "@khanacademy/wb-dev-build-settings": "^2.0.0"
30
+ "@khanacademy/wb-dev-build-settings": "2.1.0"
31
+ },
32
+ "scripts": {
33
+ "test": "echo \"Error: no test specified\" && exit 1"
35
34
  }
36
35
  }