@khanacademy/wonder-blocks-clickable 2.3.0 → 2.3.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @khanacademy/wonder-blocks-clickable
2
2
 
3
+ ## 2.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 5b8ba5da: Remove the default value of aria-label ""
8
+
9
+ ## 2.3.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [6ee20af9]
14
+ - @khanacademy/wonder-blocks-core@4.4.0
15
+
3
16
  ## 2.3.0
4
17
 
5
18
  ### Minor Changes
package/dist/es/index.js CHANGED
@@ -491,8 +491,7 @@ class Clickable extends React.Component {
491
491
  }
492
492
  Clickable.defaultProps = {
493
493
  light: false,
494
- disabled: false,
495
- "aria-label": ""
494
+ disabled: false
496
495
  };
497
496
  const styles = StyleSheet.create({
498
497
  reset: {
package/dist/index.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 10);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 11);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ([
@@ -1057,7 +1057,7 @@ function (module, __webpack_exports__, __webpack_require__) {
1057
1057
  /* fade */
1058
1058
  "a"])(white, 0.5),
1059
1059
  // Brand
1060
- darkBlue: "#0a2a66",
1060
+ darkBlue: "#0b2149",
1061
1061
  teal: "#14bf96",
1062
1062
  lightBlue: "#37c5fd",
1063
1063
  pink: "#fa50ae"
@@ -1132,29 +1132,53 @@ module.exports = require("react-router-dom");
1132
1132
  /* 6 */
1133
1133
  /***/ (function(module, exports) {
1134
1134
 
1135
- module.exports = require("@khanacademy/wonder-blocks-core");
1135
+ function _extends() {
1136
+ module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
1137
+ for (var i = 1; i < arguments.length; i++) {
1138
+ var source = arguments[i];
1139
+
1140
+ for (var key in source) {
1141
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1142
+ target[key] = source[key];
1143
+ }
1144
+ }
1145
+ }
1146
+
1147
+ return target;
1148
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
1149
+ return _extends.apply(this, arguments);
1150
+ }
1151
+
1152
+ module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
1136
1153
 
1137
1154
  /***/ }),
1138
1155
  /* 7 */
1156
+ /***/ (function(module, exports) {
1157
+
1158
+ module.exports = require("@khanacademy/wonder-blocks-core");
1159
+
1160
+ /***/ }),
1161
+ /* 8 */
1139
1162
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1140
1163
 
1141
1164
  "use strict";
1142
1165
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Clickable; });
1143
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1144
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1145
- /* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
1146
- /* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(aphrodite__WEBPACK_IMPORTED_MODULE_1__);
1147
- /* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
1148
- /* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
1149
- /* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9);
1150
- /* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router__WEBPACK_IMPORTED_MODULE_3__);
1151
- /* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6);
1152
- /* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_4__);
1153
- /* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3);
1154
- /* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__);
1155
- /* harmony import */ var _util_get_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4);
1156
- /* harmony import */ var _util_is_client_side_url_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1);
1157
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1166
+ /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
1167
+ /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
1168
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
1169
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1170
+ /* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
1171
+ /* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(aphrodite__WEBPACK_IMPORTED_MODULE_2__);
1172
+ /* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
1173
+ /* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
1174
+ /* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
1175
+ /* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router__WEBPACK_IMPORTED_MODULE_4__);
1176
+ /* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
1177
+ /* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_5__);
1178
+ /* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3);
1179
+ /* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6__);
1180
+ /* harmony import */ var _util_get_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4);
1181
+ /* harmony import */ var _util_is_client_side_url_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1);
1158
1182
 
1159
1183
 
1160
1184
 
@@ -1164,9 +1188,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
1164
1188
 
1165
1189
 
1166
1190
 
1167
- const StyledAnchor = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_4__["addStyle"])("a");
1168
- const StyledButton = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_4__["addStyle"])("button");
1169
- const StyledLink = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_4__["addStyle"])(react_router_dom__WEBPACK_IMPORTED_MODULE_2__["Link"]);
1191
+ const StyledAnchor = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_5__["addStyle"])("a");
1192
+ const StyledButton = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_5__["addStyle"])("button");
1193
+ const StyledLink = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_5__["addStyle"])(react_router_dom__WEBPACK_IMPORTED_MODULE_3__["Link"]);
1170
1194
  /**
1171
1195
  * A component to turn any custom component into a clickable one.
1172
1196
  *
@@ -1201,31 +1225,31 @@ const StyledLink = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODU
1201
1225
  * ```
1202
1226
  */
1203
1227
 
1204
- class Clickable extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
1228
+ class Clickable extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
1205
1229
  constructor(...args) {
1206
1230
  super(...args);
1207
1231
 
1208
1232
  this.getCorrectTag = (clickableState, router, commonProps) => {
1209
1233
  const activeHref = this.props.href && !this.props.disabled;
1210
- const useClient = router && !this.props.skipClientNav && Object(_util_is_client_side_url_js__WEBPACK_IMPORTED_MODULE_7__[/* isClientSideUrl */ "a"])(this.props.href || ""); // NOTE: checking this.props.href here is redundant, but flow
1234
+ const useClient = router && !this.props.skipClientNav && Object(_util_is_client_side_url_js__WEBPACK_IMPORTED_MODULE_8__[/* isClientSideUrl */ "a"])(this.props.href || ""); // NOTE: checking this.props.href here is redundant, but flow
1211
1235
  // needs it to refine this.props.href to a string.
1212
1236
 
1213
1237
  if (activeHref && useClient && this.props.href) {
1214
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](StyledLink, _extends({}, commonProps, {
1238
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledLink, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, commonProps, {
1215
1239
  to: this.props.href,
1216
1240
  role: this.props.role,
1217
1241
  target: this.props.target || undefined,
1218
1242
  "aria-disabled": this.props.disabled ? "true" : undefined
1219
1243
  }), this.props.children(clickableState));
1220
1244
  } else if (activeHref && !useClient) {
1221
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](StyledAnchor, _extends({}, commonProps, {
1245
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledAnchor, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, commonProps, {
1222
1246
  href: this.props.href,
1223
1247
  role: this.props.role,
1224
1248
  target: this.props.target || undefined,
1225
1249
  "aria-disabled": this.props.disabled ? "true" : undefined
1226
1250
  }), this.props.children(clickableState));
1227
1251
  } else {
1228
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](StyledButton, _extends({}, commonProps, {
1252
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledButton, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, commonProps, {
1229
1253
  type: "button",
1230
1254
  "aria-disabled": this.props.disabled
1231
1255
  }), this.props.children(clickableState));
@@ -1250,12 +1274,12 @@ class Clickable extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
1250
1274
  disabled,
1251
1275
  ...restProps
1252
1276
  } = this.props;
1253
- const ClickableBehavior = Object(_util_get_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(href, skipClientNav, router);
1277
+ const ClickableBehavior = Object(_util_get_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(href, skipClientNav, router);
1254
1278
 
1255
1279
  const getStyle = state => [styles.reset, styles.link, !hideDefaultFocusRing && state.focused && (light ? styles.focusedLight : styles.focused), disabled && styles.disabled, style];
1256
1280
 
1257
1281
  if (beforeNav) {
1258
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](ClickableBehavior, {
1282
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](ClickableBehavior, {
1259
1283
  href: href,
1260
1284
  onClick: onClick,
1261
1285
  beforeNav: beforeNav,
@@ -1269,7 +1293,7 @@ class Clickable extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
1269
1293
  ...childrenProps
1270
1294
  }));
1271
1295
  } else {
1272
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](ClickableBehavior, {
1296
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](ClickableBehavior, {
1273
1297
  href: href,
1274
1298
  onClick: onClick,
1275
1299
  safeWithNav: safeWithNav,
@@ -1286,17 +1310,16 @@ class Clickable extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
1286
1310
  }
1287
1311
 
1288
1312
  render() {
1289
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react_router__WEBPACK_IMPORTED_MODULE_3__["__RouterContext"].Consumer, null, router => this.renderClickableBehavior(router));
1313
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](react_router__WEBPACK_IMPORTED_MODULE_4__["__RouterContext"].Consumer, null, router => this.renderClickableBehavior(router));
1290
1314
  }
1291
1315
 
1292
1316
  } // Source: https://gist.github.com/MoOx/9137295
1293
1317
 
1294
1318
  Clickable.defaultProps = {
1295
1319
  light: false,
1296
- disabled: false,
1297
- "aria-label": ""
1320
+ disabled: false
1298
1321
  };
1299
- const styles = aphrodite__WEBPACK_IMPORTED_MODULE_1__["StyleSheet"].create({
1322
+ const styles = aphrodite__WEBPACK_IMPORTED_MODULE_2__["StyleSheet"].create({
1300
1323
  reset: {
1301
1324
  border: "none",
1302
1325
  margin: 0,
@@ -1330,43 +1353,43 @@ const styles = aphrodite__WEBPACK_IMPORTED_MODULE_1__["StyleSheet"].create({
1330
1353
  },
1331
1354
  focused: {
1332
1355
  ":focus": {
1333
- outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.blue}`
1356
+ outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6___default.a.blue}`
1334
1357
  }
1335
1358
  },
1336
1359
  focusedLight: {
1337
- outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.white}`
1360
+ outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6___default.a.white}`
1338
1361
  },
1339
1362
  disabled: {
1340
- color: _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.offBlack32,
1363
+ color: _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6___default.a.offBlack32,
1341
1364
  cursor: "not-allowed",
1342
1365
  ":focus": {
1343
1366
  outline: "none"
1344
1367
  },
1345
1368
  ":focus-visible": {
1346
- outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.blue}`
1369
+ outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_6___default.a.blue}`
1347
1370
  }
1348
1371
  }
1349
1372
  });
1350
1373
 
1351
1374
  /***/ }),
1352
- /* 8 */
1375
+ /* 9 */
1353
1376
  /***/ (function(module, exports) {
1354
1377
 
1355
1378
  module.exports = require("aphrodite");
1356
1379
 
1357
1380
  /***/ }),
1358
- /* 9 */
1381
+ /* 10 */
1359
1382
  /***/ (function(module, exports) {
1360
1383
 
1361
1384
  module.exports = require("react-router");
1362
1385
 
1363
1386
  /***/ }),
1364
- /* 10 */
1387
+ /* 11 */
1365
1388
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1366
1389
 
1367
1390
  "use strict";
1368
1391
  __webpack_require__.r(__webpack_exports__);
1369
- /* harmony import */ var _components_clickable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
1392
+ /* harmony import */ var _components_clickable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
1370
1393
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _components_clickable_js__WEBPACK_IMPORTED_MODULE_0__["a"]; });
1371
1394
 
1372
1395
  /* harmony import */ var _components_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
package/docs.md CHANGED
@@ -1,7 +1,5 @@
1
- The Clickable component allows you to turn any custom component into a clickable one with consistent behavior and accesibility features.
1
+ Documentation for `@khanacademy/wonder-blocks-clickable` is now in Storybook.
2
2
 
3
- **Clickable allows your components to:**
4
- - Handle mouse / touch / keyboard events
5
- - Match the standard behavior of the given role
6
- - Apply custom styles based on pressed / focused / hovered state
7
- - Perform Client Side Navigation when `href` is passed and the component is a descendent of a react-router `Router`
3
+ Visit the [Storybook
4
+ Clickable](https://khan.github.io/wonder-blocks/?path=/docs/clickable) docs on
5
+ GitHub Pages.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-clickable",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "design": "v1",
5
5
  "description": "Clickable component for Wonder-Blocks.",
6
6
  "main": "dist/index.js",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.18.6",
19
- "@khanacademy/wonder-blocks-core": "^4.3.2"
19
+ "@khanacademy/wonder-blocks-core": "^4.4.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "aphrodite": "^1.2.5",