@khanacademy/wonder-blocks-search-field 1.0.3 → 1.0.6

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,30 @@
1
1
  # @khanacademy/wonder-blocks-search-field
2
2
 
3
+ ## 1.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [83486dba]
8
+ - @khanacademy/wonder-blocks-icon@1.2.29
9
+ - @khanacademy/wonder-blocks-icon-button@3.4.8
10
+
11
+ ## 1.0.5
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [5f4a4297]
16
+ - Updated dependencies [2b96fd59]
17
+ - @khanacademy/wonder-blocks-core@4.3.2
18
+ - @khanacademy/wonder-blocks-icon@1.2.28
19
+ - @khanacademy/wonder-blocks-icon-button@3.4.7
20
+ - @khanacademy/wonder-blocks-typography@1.1.32
21
+
22
+ ## 1.0.4
23
+
24
+ ### Patch Changes
25
+
26
+ - b3960766: Made SearchField not anonymous
27
+
3
28
  ## 1.0.3
4
29
 
5
30
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -15,7 +15,7 @@ const defaultLabels = {
15
15
  };
16
16
 
17
17
  const _excluded = ["clearAriaLabel", "disabled", "light", "id", "value", "placeholder", "style", "testId", "onClick", "onChange", "onFocus", "onBlur"];
18
- const SearchField = React.forwardRef((props, ref) => {
18
+ const SearchField = React.forwardRef(function SearchField(props, ref) {
19
19
  const {
20
20
  clearAriaLabel = defaultLabels.clearSearch,
21
21
  disabled = false,
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 = 24);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 26);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ([
@@ -119,15 +119,15 @@ __webpack_require__.r(__webpack_exports__);
119
119
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10);
120
120
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
121
121
  /* harmony import */ var history__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
122
- /* harmony import */ var mini_create_react_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19);
122
+ /* harmony import */ var mini_create_react_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21);
123
123
  /* harmony import */ var tiny_invariant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5);
124
124
  /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
125
- /* harmony import */ var path_to_regexp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14);
125
+ /* harmony import */ var path_to_regexp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(15);
126
126
  /* harmony import */ var path_to_regexp__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(path_to_regexp__WEBPACK_IMPORTED_MODULE_7__);
127
- /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(32);
127
+ /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16);
128
128
  /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_is__WEBPACK_IMPORTED_MODULE_8__);
129
129
  /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7);
130
- /* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(20);
130
+ /* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(22);
131
131
  /* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_10__);
132
132
 
133
133
 
@@ -806,8 +806,8 @@ function _extends() {
806
806
  /* unused harmony export parsePath */
807
807
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return createPath; });
808
808
  /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
809
- /* harmony import */ var resolve_pathname__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
810
- /* harmony import */ var value_equal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22);
809
+ /* harmony import */ var resolve_pathname__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
810
+ /* harmony import */ var value_equal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
811
811
  /* harmony import */ var tiny_invariant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
812
812
 
813
813
 
@@ -1736,7 +1736,7 @@ function createMemoryHistory(props) {
1736
1736
 
1737
1737
  "use strict";
1738
1738
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inheritsLoose; });
1739
- /* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
1739
+ /* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
1740
1740
 
1741
1741
  function _inheritsLoose(subClass, superClass) {
1742
1742
  subClass.prototype = Object.create(superClass.prototype);
@@ -1819,7 +1819,7 @@ module.exports = require("aphrodite");
1819
1819
  if (false) { var throwOnDirectAccess, ReactIs; } else {
1820
1820
  // By explicitly using `prop-types` you are opting into new production behavior.
1821
1821
  // http://fb.me/prop-types-in-prod
1822
- module.exports = __webpack_require__(28)();
1822
+ module.exports = __webpack_require__(30)();
1823
1823
  }
1824
1824
 
1825
1825
 
@@ -1836,16 +1836,17 @@ module.exports = require("@khanacademy/wonder-blocks-icon");
1836
1836
  module.exports = require("@khanacademy/wonder-blocks-color");
1837
1837
 
1838
1838
  /***/ }),
1839
- /* 13 */
1839
+ /* 13 */,
1840
+ /* 14 */
1840
1841
  /***/ (function(module, exports) {
1841
1842
 
1842
1843
  module.exports = require("@khanacademy/wonder-blocks-typography");
1843
1844
 
1844
1845
  /***/ }),
1845
- /* 14 */
1846
+ /* 15 */
1846
1847
  /***/ (function(module, exports, __webpack_require__) {
1847
1848
 
1848
- var isarray = __webpack_require__(31)
1849
+ var isarray = __webpack_require__(33)
1849
1850
 
1850
1851
  /**
1851
1852
  * Expose `pathToRegexp`.
@@ -2274,7 +2275,19 @@ function pathToRegexp (path, keys, options) {
2274
2275
 
2275
2276
 
2276
2277
  /***/ }),
2277
- /* 15 */
2278
+ /* 16 */
2279
+ /***/ (function(module, exports, __webpack_require__) {
2280
+
2281
+ "use strict";
2282
+
2283
+
2284
+ if (true) {
2285
+ module.exports = __webpack_require__(34);
2286
+ } else {}
2287
+
2288
+
2289
+ /***/ }),
2290
+ /* 17 */
2278
2291
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2279
2292
 
2280
2293
  "use strict";
@@ -2282,13 +2295,13 @@ function pathToRegexp (path, keys, options) {
2282
2295
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2283
2296
  /* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
2284
2297
  /* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(aphrodite__WEBPACK_IMPORTED_MODULE_1__);
2285
- /* harmony import */ var _khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
2298
+ /* harmony import */ var _khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
2286
2299
  /* harmony import */ var _khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_typography__WEBPACK_IMPORTED_MODULE_2__);
2287
2300
  /* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8);
2288
2301
  /* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__);
2289
- /* harmony import */ var _khanacademy_wonder_blocks_icon_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16);
2302
+ /* harmony import */ var _khanacademy_wonder_blocks_icon_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18);
2290
2303
  /* harmony import */ var _khanacademy_wonder_blocks_icon_button__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_icon_button__WEBPACK_IMPORTED_MODULE_4__);
2291
- /* harmony import */ var _khanacademy_wonder_blocks_form__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17);
2304
+ /* harmony import */ var _khanacademy_wonder_blocks_form__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(19);
2292
2305
  /* harmony import */ var _khanacademy_wonder_blocks_form__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_form__WEBPACK_IMPORTED_MODULE_5__);
2293
2306
  /* harmony import */ var _khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(11);
2294
2307
  /* harmony import */ var _khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_icon__WEBPACK_IMPORTED_MODULE_6__);
@@ -2296,7 +2309,7 @@ function pathToRegexp (path, keys, options) {
2296
2309
  /* harmony import */ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_7__);
2297
2310
  /* harmony import */ var _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6);
2298
2311
  /* harmony import */ var _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_8__);
2299
- /* harmony import */ var _util_constants_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23);
2312
+ /* harmony import */ var _util_constants_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25);
2300
2313
  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); }
2301
2314
 
2302
2315
 
@@ -2331,7 +2344,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2331
2344
  * />
2332
2345
  * ```
2333
2346
  */
2334
- const SearchField = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["forwardRef"]((props, ref) => {
2347
+ const SearchField = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["forwardRef"](function SearchField(props, ref) {
2335
2348
  const {
2336
2349
  clearAriaLabel = _util_constants_js__WEBPACK_IMPORTED_MODULE_9__[/* defaultLabels */ "a"].clearSearch,
2337
2350
  disabled = false,
@@ -2448,13 +2461,13 @@ const styles = aphrodite__WEBPACK_IMPORTED_MODULE_1__["StyleSheet"].create({
2448
2461
  /* harmony default export */ __webpack_exports__["a"] = (SearchField);
2449
2462
 
2450
2463
  /***/ }),
2451
- /* 16 */
2464
+ /* 18 */
2452
2465
  /***/ (function(module, exports) {
2453
2466
 
2454
2467
  module.exports = require("@khanacademy/wonder-blocks-icon-button");
2455
2468
 
2456
2469
  /***/ }),
2457
- /* 17 */
2470
+ /* 19 */
2458
2471
  /***/ (function(module, exports, __webpack_require__) {
2459
2472
 
2460
2473
  module.exports =
@@ -2742,7 +2755,7 @@ function (module, exports) {
2742
2755
 
2743
2756
  /***/
2744
2757
  function (module, exports) {
2745
- module.exports = __webpack_require__(13);
2758
+ module.exports = __webpack_require__(14);
2746
2759
  /***/
2747
2760
  },
2748
2761
  /* 5 */
@@ -2811,7 +2824,7 @@ function (module, __webpack_exports__, __webpack_require__) {
2811
2824
 
2812
2825
  /***/
2813
2826
  function (module, exports) {
2814
- module.exports = __webpack_require__(25);
2827
+ module.exports = __webpack_require__(27);
2815
2828
  /***/
2816
2829
  },
2817
2830
  /* 8 */
@@ -2859,8 +2872,22 @@ function (module, __webpack_exports__, __webpack_require__) {
2859
2872
  * ☑️ A nicely styled checkbox for all your checking needs. Can optionally take
2860
2873
  * label and description props.
2861
2874
  *
2875
+ * If used by itself, a checkbox provides two options - checked and unchecked.
2876
+ * A group of checkboxes can be used to allow a user to select multiple values
2877
+ * from a list of options.
2878
+ *
2862
2879
  * If you want a whole group of Checkbox[es] that are related, see the Choice
2863
2880
  * and CheckboxGroup components.
2881
+ *
2882
+ * ### Usage
2883
+ *
2884
+ * ```jsx
2885
+ * import {Checkbox} from "@khanacademy/wonder-blocks-form";
2886
+ *
2887
+ * const [checked, setChecked] = React.useState(false);
2888
+ *
2889
+ * <Checkbox checked={checked} onChange={setChecked} />
2890
+ * ```
2864
2891
  */
2865
2892
 
2866
2893
 
@@ -3978,7 +4005,7 @@ function (module, __webpack_exports__, __webpack_require__) {
3978
4005
 
3979
4006
  /***/
3980
4007
  function (module, exports) {
3981
- module.exports = __webpack_require__(26);
4008
+ module.exports = __webpack_require__(28);
3982
4009
  /***/
3983
4010
  },
3984
4011
  /* 17 */
@@ -4703,7 +4730,7 @@ function (module, __webpack_exports__, __webpack_require__) {
4703
4730
  ]);
4704
4731
 
4705
4732
  /***/ }),
4706
- /* 18 */
4733
+ /* 20 */
4707
4734
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4708
4735
 
4709
4736
  "use strict";
@@ -4718,7 +4745,7 @@ function _setPrototypeOf(o, p) {
4718
4745
  }
4719
4746
 
4720
4747
  /***/ }),
4721
- /* 19 */
4748
+ /* 21 */
4722
4749
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4723
4750
 
4724
4751
  "use strict";
@@ -4902,16 +4929,16 @@ var index = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext || create
4902
4929
 
4903
4930
  /* harmony default export */ __webpack_exports__["a"] = (index);
4904
4931
 
4905
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(30)))
4932
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(32)))
4906
4933
 
4907
4934
  /***/ }),
4908
- /* 20 */
4935
+ /* 22 */
4909
4936
  /***/ (function(module, exports, __webpack_require__) {
4910
4937
 
4911
4938
  "use strict";
4912
4939
 
4913
4940
 
4914
- var reactIs = __webpack_require__(34);
4941
+ var reactIs = __webpack_require__(16);
4915
4942
 
4916
4943
  /**
4917
4944
  * Copyright 2015, Yahoo! Inc.
@@ -5015,7 +5042,7 @@ module.exports = hoistNonReactStatics;
5015
5042
 
5016
5043
 
5017
5044
  /***/ }),
5018
- /* 21 */
5045
+ /* 23 */
5019
5046
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5020
5047
 
5021
5048
  "use strict";
@@ -5097,7 +5124,7 @@ function resolvePathname(to, from) {
5097
5124
 
5098
5125
 
5099
5126
  /***/ }),
5100
- /* 22 */
5127
+ /* 24 */
5101
5128
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5102
5129
 
5103
5130
  "use strict";
@@ -5140,7 +5167,7 @@ function valueEqual(a, b) {
5140
5167
 
5141
5168
 
5142
5169
  /***/ }),
5143
- /* 23 */
5170
+ /* 25 */
5144
5171
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5145
5172
 
5146
5173
  "use strict";
@@ -5151,17 +5178,17 @@ const defaultLabels = {
5151
5178
  };
5152
5179
 
5153
5180
  /***/ }),
5154
- /* 24 */
5181
+ /* 26 */
5155
5182
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5156
5183
 
5157
5184
  "use strict";
5158
5185
  __webpack_require__.r(__webpack_exports__);
5159
- /* harmony import */ var _components_search_field_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
5186
+ /* harmony import */ var _components_search_field_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
5160
5187
 
5161
5188
  /* harmony default export */ __webpack_exports__["default"] = (_components_search_field_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
5162
5189
 
5163
5190
  /***/ }),
5164
- /* 25 */
5191
+ /* 27 */
5165
5192
  /***/ (function(module, exports, __webpack_require__) {
5166
5193
 
5167
5194
  module.exports =
@@ -6053,7 +6080,7 @@ function (module, __webpack_exports__, __webpack_require__) {
6053
6080
  ]);
6054
6081
 
6055
6082
  /***/ }),
6056
- /* 26 */
6083
+ /* 28 */
6057
6084
  /***/ (function(module, exports, __webpack_require__) {
6058
6085
 
6059
6086
  module.exports =
@@ -6443,18 +6470,19 @@ function (module, __webpack_exports__, __webpack_require__) {
6443
6470
  * 3. Keyup (spacebar/enter) -> focus state
6444
6471
  *
6445
6472
  * Warning: The event handlers returned (onClick, onMouseEnter, onMouseLeave,
6446
- * onMouseDown, onMouseUp, onDragStart, onTouchStart, onTouchEnd, onTouchCancel, onKeyDown,
6447
- * onKeyUp, onFocus, onBlur, tabIndex) should be passed on to the component
6448
- * that has the ClickableBehavior. You cannot override these handlers without
6449
- * potentially breaking the functionality of ClickableBehavior.
6473
+ * onMouseDown, onMouseUp, onDragStart, onTouchStart, onTouchEnd, onTouchCancel,
6474
+ * onKeyDown, onKeyUp, onFocus, onBlur, tabIndex) should be passed on to the
6475
+ * component that has the ClickableBehavior. You cannot override these handlers
6476
+ * without potentially breaking the functionality of ClickableBehavior.
6450
6477
  *
6451
- * There are internal props triggerOnEnter and triggerOnSpace that can be set
6452
- * to false if one of those keys shouldn't count as a click on this component.
6453
- * Be careful about setting those to false -- make certain that the component
6478
+ * There are internal props triggerOnEnter and triggerOnSpace that can be set to
6479
+ * false if one of those keys shouldn't count as a click on this component. Be
6480
+ * careful about setting those to false -- make certain that the component
6454
6481
  * shouldn't process that key.
6455
6482
  *
6456
- * See [this document](https://docs.google.com/document/d/1DG5Rg2f0cawIL5R8UqnPQpd7pbdObk8OyjO5ryYQmBM/edit#)
6457
- * for a more thorough explanation of expected behaviors and potential cavaets.
6483
+ * See [this
6484
+ document](https://docs.google.com/document/d/1DG5Rg2f0cawIL5R8UqnPQpd7pbdObk8OyjO5ryYQmBM/edit#)
6485
+ for a more thorough explanation of expected behaviors and potential cavaets.
6458
6486
  *
6459
6487
  * `ClickableBehavior` accepts a function as `children` which is passed state
6460
6488
  * and an object containing event handlers and some other props. The `children`
@@ -6462,32 +6490,30 @@ function (module, __webpack_exports__, __webpack_require__) {
6462
6490
  *
6463
6491
  * Example:
6464
6492
  *
6465
- * ```js
6466
- * class MyClickableComponent extends React.Component<Props> {
6467
- * render(): React.Node {
6468
- * const ClickableBehavior = getClickableBehavior();
6469
- * return <ClickableBehavior
6470
- * disabled={this.props.disabled}
6471
- * onClick={this.props.onClick}
6472
- * >
6473
- * {({hovered}, childrenProps) =>
6474
- * <RoundRect
6475
- * textcolor='white'
6476
- * backgroundColor={hovered ? 'red' : 'blue'}}
6477
- * {...childrenProps}
6478
- * >
6479
- * {this.props.children}
6480
- * </RoundRect>
6481
- * }
6482
- * </ClickableBehavior>
6483
- * }
6493
+ * ```jsx
6494
+ * function MyClickableComponent(props: Props) {
6495
+ * const ClickableBehavior = getClickableBehavior();
6496
+ *
6497
+ * return (
6498
+ * <ClickableBehavior disabled={props.disabled} onClick={props.onClick}>
6499
+ * {({hovered}, childrenProps) => (
6500
+ * <RoundRect
6501
+ * textcolor="white"
6502
+ * backgroundColor={hovered ? "red" : "blue"}
6503
+ * {...childrenProps}
6504
+ * >
6505
+ * {props.children}
6506
+ * </RoundRect>
6507
+ * )}
6508
+ * </ClickableBehavior>
6509
+ * );
6484
6510
  * }
6485
6511
  * ```
6486
6512
  *
6487
- * This follows a pattern called [Function as Child Components]
6488
- * (https://medium.com/merrickchristensen/function-as-child-components-5f3920a9ace9).
6513
+ * This follows a pattern called [Function as Child
6514
+ * Components](https://medium.com/merrickchristensen/function-as-child-components-5f3920a9ace9).
6489
6515
  *
6490
- * WARNING: Do not use this component directly, use getClickableBehavior
6516
+ * **WARNING:** Do not use this component directly, use getClickableBehavior
6491
6517
  * instead. getClickableBehavior takes three arguments (href, directtNav, and
6492
6518
  * router) and returns either the default ClickableBehavior or a react-router
6493
6519
  * aware version.
@@ -6495,9 +6521,9 @@ function (module, __webpack_exports__, __webpack_require__) {
6495
6521
  * The react-router aware version is returned if `router` is a react-router-dom
6496
6522
  * router, `skipClientNav` is not `true`, and `href` is an internal URL.
6497
6523
  *
6498
- * The `router` can be accessed via __RouterContext (imported from 'react-router')
6499
- * from a component rendered as a descendant of a BrowserRouter.
6500
- * See https://reacttraining.com/react-router/web/guides/basic-components.
6524
+ * The `router` can be accessed via __RouterContext (imported from
6525
+ 'react-router') from a component rendered as a descendant of a BrowserRouter.
6526
+ See https://reacttraining.com/react-router/web/guides/basic-components.
6501
6527
  */
6502
6528
 
6503
6529
  class ClickableBehavior extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
@@ -6864,100 +6890,6 @@ function (module, __webpack_exports__, __webpack_require__) {
6864
6890
  },
6865
6891
  /* 3 */
6866
6892
 
6867
- /***/
6868
- function (module, __webpack_exports__, __webpack_require__) {
6869
- "use strict";
6870
- /* harmony export (binding) */
6871
-
6872
- __webpack_require__.d(__webpack_exports__, "a", function () {
6873
- return getClickableBehavior;
6874
- });
6875
- /* harmony import */
6876
-
6877
-
6878
- var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
6879
- /* harmony import */
6880
-
6881
-
6882
- var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6883
- /* harmony import */
6884
-
6885
-
6886
- var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
6887
- /* harmony import */
6888
-
6889
-
6890
- var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);
6891
- /* harmony import */
6892
-
6893
-
6894
- var _components_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
6895
- /* harmony import */
6896
-
6897
-
6898
- var _is_client_side_url_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1);
6899
- /**
6900
- * Returns either the default ClickableBehavior or a react-router aware version.
6901
- *
6902
- * The react-router aware version is returned if `router` is a react-router-dom
6903
- * router, `skipClientNav` is not `true`, and `href` is an internal URL.
6904
- *
6905
- * The `router` can be accessed via __RouterContext (imported from 'react-router')
6906
- * from a component rendered as a descendant of a BrowserRouter.
6907
- * See https://reacttraining.com/react-router/web/guides/basic-components.
6908
- */
6909
-
6910
-
6911
- const ClickableBehaviorWithRouter = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["withRouter"])(_components_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_2__[
6912
- /* default */
6913
- "a"]);
6914
-
6915
- function getClickableBehavior(
6916
- /**
6917
- * The URL to navigate to.
6918
- */
6919
- href,
6920
- /**
6921
- * Should we skip using the react router and go to the page directly.
6922
- */
6923
- skipClientNav,
6924
- /**
6925
- * router object added to the React context object by react-router-dom.
6926
- */
6927
- router) {
6928
- if (router && skipClientNav !== true && href && Object(_is_client_side_url_js__WEBPACK_IMPORTED_MODULE_3__[
6929
- /* isClientSideUrl */
6930
- "a"])(href)) {
6931
- // We cast to `any` here since the type of ClickableBehaviorWithRouter
6932
- // is slightly different from the return type of this function.
6933
- // TODO(WB-1037): Always return the wrapped version once all routes have
6934
- // been ported to the app-shell in webapp.
6935
- return ClickableBehaviorWithRouter;
6936
- }
6937
-
6938
- return _components_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_2__[
6939
- /* default */
6940
- "a"];
6941
- }
6942
- /***/
6943
-
6944
- },
6945
- /* 4 */
6946
-
6947
- /***/
6948
- function (module, exports) {
6949
- module.exports = __webpack_require__(27);
6950
- /***/
6951
- },
6952
- /* 5 */
6953
-
6954
- /***/
6955
- function (module, exports) {
6956
- module.exports = __webpack_require__(8);
6957
- /***/
6958
- },
6959
- /* 6 */
6960
-
6961
6893
  /***/
6962
6894
  function (module, exports) {
6963
6895
  module.exports =
@@ -7413,6 +7345,100 @@ function (module, exports) {
7413
7345
  /***/
7414
7346
 
7415
7347
  },
7348
+ /* 4 */
7349
+
7350
+ /***/
7351
+ function (module, __webpack_exports__, __webpack_require__) {
7352
+ "use strict";
7353
+ /* harmony export (binding) */
7354
+
7355
+ __webpack_require__.d(__webpack_exports__, "a", function () {
7356
+ return getClickableBehavior;
7357
+ });
7358
+ /* harmony import */
7359
+
7360
+
7361
+ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
7362
+ /* harmony import */
7363
+
7364
+
7365
+ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7366
+ /* harmony import */
7367
+
7368
+
7369
+ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
7370
+ /* harmony import */
7371
+
7372
+
7373
+ var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);
7374
+ /* harmony import */
7375
+
7376
+
7377
+ var _components_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
7378
+ /* harmony import */
7379
+
7380
+
7381
+ var _is_client_side_url_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1);
7382
+ /**
7383
+ * Returns either the default ClickableBehavior or a react-router aware version.
7384
+ *
7385
+ * The react-router aware version is returned if `router` is a react-router-dom
7386
+ * router, `skipClientNav` is not `true`, and `href` is an internal URL.
7387
+ *
7388
+ * The `router` can be accessed via __RouterContext (imported from 'react-router')
7389
+ * from a component rendered as a descendant of a BrowserRouter.
7390
+ * See https://reacttraining.com/react-router/web/guides/basic-components.
7391
+ */
7392
+
7393
+
7394
+ const ClickableBehaviorWithRouter = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_1__["withRouter"])(_components_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_2__[
7395
+ /* default */
7396
+ "a"]);
7397
+
7398
+ function getClickableBehavior(
7399
+ /**
7400
+ * The URL to navigate to.
7401
+ */
7402
+ href,
7403
+ /**
7404
+ * Should we skip using the react router and go to the page directly.
7405
+ */
7406
+ skipClientNav,
7407
+ /**
7408
+ * router object added to the React context object by react-router-dom.
7409
+ */
7410
+ router) {
7411
+ if (router && skipClientNav !== true && href && Object(_is_client_side_url_js__WEBPACK_IMPORTED_MODULE_3__[
7412
+ /* isClientSideUrl */
7413
+ "a"])(href)) {
7414
+ // We cast to `any` here since the type of ClickableBehaviorWithRouter
7415
+ // is slightly different from the return type of this function.
7416
+ // TODO(WB-1037): Always return the wrapped version once all routes have
7417
+ // been ported to the app-shell in webapp.
7418
+ return ClickableBehaviorWithRouter;
7419
+ }
7420
+
7421
+ return _components_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_2__[
7422
+ /* default */
7423
+ "a"];
7424
+ }
7425
+ /***/
7426
+
7427
+ },
7428
+ /* 5 */
7429
+
7430
+ /***/
7431
+ function (module, exports) {
7432
+ module.exports = __webpack_require__(29);
7433
+ /***/
7434
+ },
7435
+ /* 6 */
7436
+
7437
+ /***/
7438
+ function (module, exports) {
7439
+ module.exports = __webpack_require__(8);
7440
+ /***/
7441
+ },
7416
7442
  /* 7 */
7417
7443
 
7418
7444
  /***/
@@ -7442,7 +7468,7 @@ function (module, __webpack_exports__, __webpack_require__) {
7442
7468
  /* harmony import */
7443
7469
 
7444
7470
 
7445
- var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
7471
+ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
7446
7472
  /* harmony import */
7447
7473
 
7448
7474
 
@@ -7458,7 +7484,7 @@ function (module, __webpack_exports__, __webpack_require__) {
7458
7484
  /* harmony import */
7459
7485
 
7460
7486
 
7461
- var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5);
7487
+ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6);
7462
7488
  /* harmony import */
7463
7489
 
7464
7490
 
@@ -7466,7 +7492,7 @@ function (module, __webpack_exports__, __webpack_require__) {
7466
7492
  /* harmony import */
7467
7493
 
7468
7494
 
7469
- var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6);
7495
+ var _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3);
7470
7496
  /* harmony import */
7471
7497
 
7472
7498
 
@@ -7474,7 +7500,7 @@ function (module, __webpack_exports__, __webpack_require__) {
7474
7500
  /* harmony import */
7475
7501
 
7476
7502
 
7477
- var _util_get_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3);
7503
+ var _util_get_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4);
7478
7504
  /* harmony import */
7479
7505
 
7480
7506
 
@@ -7504,11 +7530,20 @@ function (module, __webpack_exports__, __webpack_require__) {
7504
7530
  /**
7505
7531
  * A component to turn any custom component into a clickable one.
7506
7532
  *
7507
- * Works by wrapping ClickableBehavior around the child element and styling the
7508
- * child appropriately and encapsulates routing logic which can be customized.
7509
- * Expects a function which returns an element as it's child.
7533
+ * Works by wrapping `ClickableBehavior` around the child element and styling
7534
+ * the child appropriately and encapsulates routing logic which can be
7535
+ * customized. Expects a function which returns an element as its child.
7536
+ *
7537
+ * Clickable allows your components to:
7538
+ *
7539
+ * - Handle mouse / touch / keyboard events
7540
+ * - Match the standard behavior of the given role
7541
+ * - Apply custom styles based on pressed / focused / hovered state
7542
+ * - Perform Client Side Navigation when href is passed and the component is a
7543
+ * descendent of a react-router Router.
7544
+ *
7545
+ * ### Usage
7510
7546
  *
7511
- * Example usage:
7512
7547
  * ```jsx
7513
7548
  * <Clickable onClick={() => alert("You clicked me!")}>
7514
7549
  * {({hovered, focused, pressed}) =>
@@ -7581,7 +7616,7 @@ function (module, __webpack_exports__, __webpack_require__) {
7581
7616
  /* default */
7582
7617
  "a"])(href, skipClientNav, router);
7583
7618
 
7584
- const getStyle = state => [styles.reset, styles.link, !hideDefaultFocusRing && state.focused && (light ? styles.focusedLight : styles.focused), style];
7619
+ const getStyle = state => [styles.reset, styles.link, !hideDefaultFocusRing && state.focused && (light ? styles.focusedLight : styles.focused), disabled && styles.disabled, style];
7585
7620
 
7586
7621
  if (beforeNav) {
7587
7622
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](ClickableBehavior, {
@@ -7659,10 +7694,22 @@ function (module, __webpack_exports__, __webpack_require__) {
7659
7694
  cursor: "pointer"
7660
7695
  },
7661
7696
  focused: {
7662
- outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.blue}`
7697
+ ":focus": {
7698
+ outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.blue}`
7699
+ }
7663
7700
  },
7664
7701
  focusedLight: {
7665
7702
  outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.white}`
7703
+ },
7704
+ disabled: {
7705
+ color: _khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.offBlack32,
7706
+ cursor: "not-allowed",
7707
+ ":focus": {
7708
+ outline: "none"
7709
+ },
7710
+ ":focus-visible": {
7711
+ outline: `solid 2px ${_khanacademy_wonder_blocks_color__WEBPACK_IMPORTED_MODULE_5___default.a.blue}`
7712
+ }
7666
7713
  }
7667
7714
  });
7668
7715
  /***/
@@ -7711,7 +7758,7 @@ function (module, __webpack_exports__, __webpack_require__) {
7711
7758
  /* harmony import */
7712
7759
 
7713
7760
 
7714
- var _util_get_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
7761
+ var _util_get_clickable_behavior_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
7715
7762
  /* harmony reexport (safe) */
7716
7763
 
7717
7764
 
@@ -7735,7 +7782,7 @@ function (module, __webpack_exports__, __webpack_require__) {
7735
7782
  ]);
7736
7783
 
7737
7784
  /***/ }),
7738
- /* 27 */
7785
+ /* 29 */
7739
7786
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
7740
7787
 
7741
7788
  "use strict";
@@ -8051,7 +8098,7 @@ if (false) { var ariaCurrentType; }
8051
8098
 
8052
8099
 
8053
8100
  /***/ }),
8054
- /* 28 */
8101
+ /* 30 */
8055
8102
  /***/ (function(module, exports, __webpack_require__) {
8056
8103
 
8057
8104
  "use strict";
@@ -8064,7 +8111,7 @@ if (false) { var ariaCurrentType; }
8064
8111
 
8065
8112
 
8066
8113
 
8067
- var ReactPropTypesSecret = __webpack_require__(29);
8114
+ var ReactPropTypesSecret = __webpack_require__(31);
8068
8115
 
8069
8116
  function emptyFunction() {}
8070
8117
  function emptyFunctionWithReset() {}
@@ -8122,7 +8169,7 @@ module.exports = function() {
8122
8169
 
8123
8170
 
8124
8171
  /***/ }),
8125
- /* 29 */
8172
+ /* 31 */
8126
8173
  /***/ (function(module, exports, __webpack_require__) {
8127
8174
 
8128
8175
  "use strict";
@@ -8141,7 +8188,7 @@ module.exports = ReactPropTypesSecret;
8141
8188
 
8142
8189
 
8143
8190
  /***/ }),
8144
- /* 30 */
8191
+ /* 32 */
8145
8192
  /***/ (function(module, exports) {
8146
8193
 
8147
8194
  var g;
@@ -8167,7 +8214,7 @@ module.exports = g;
8167
8214
 
8168
8215
 
8169
8216
  /***/ }),
8170
- /* 31 */
8217
+ /* 33 */
8171
8218
  /***/ (function(module, exports) {
8172
8219
 
8173
8220
  module.exports = Array.isArray || function (arr) {
@@ -8176,19 +8223,7 @@ module.exports = Array.isArray || function (arr) {
8176
8223
 
8177
8224
 
8178
8225
  /***/ }),
8179
- /* 32 */
8180
- /***/ (function(module, exports, __webpack_require__) {
8181
-
8182
- "use strict";
8183
-
8184
-
8185
- if (true) {
8186
- module.exports = __webpack_require__(33);
8187
- } else {}
8188
-
8189
-
8190
- /***/ }),
8191
- /* 33 */
8226
+ /* 34 */
8192
8227
  /***/ (function(module, exports, __webpack_require__) {
8193
8228
 
8194
8229
  "use strict";
@@ -8209,39 +8244,5 @@ exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return
8209
8244
  exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
8210
8245
 
8211
8246
 
8212
- /***/ }),
8213
- /* 34 */
8214
- /***/ (function(module, exports, __webpack_require__) {
8215
-
8216
- "use strict";
8217
-
8218
-
8219
- if (true) {
8220
- module.exports = __webpack_require__(35);
8221
- } else {}
8222
-
8223
-
8224
- /***/ }),
8225
- /* 35 */
8226
- /***/ (function(module, exports, __webpack_require__) {
8227
-
8228
- "use strict";
8229
- /** @license React v16.12.0
8230
- * react-is.production.min.js
8231
- *
8232
- * Copyright (c) Facebook, Inc. and its affiliates.
8233
- *
8234
- * This source code is licensed under the MIT license found in the
8235
- * LICENSE file in the root directory of this source tree.
8236
- */
8237
-
8238
- Object.defineProperty(exports,"__esModule",{value:!0});
8239
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):
8240
- 60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function z(a){return y(a)===m}
8241
- exports.typeOf=y;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
8242
- exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h};
8243
- exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p};
8244
-
8245
-
8246
8247
  /***/ })
8247
8248
  /******/ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-search-field",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "design": "v1",
5
5
  "description": "Search Field components for Wonder Blocks.",
6
6
  "main": "dist/index.js",
@@ -17,11 +17,11 @@
17
17
  "dependencies": {
18
18
  "@babel/runtime": "^7.16.3",
19
19
  "@khanacademy/wonder-blocks-color": "^1.1.20",
20
- "@khanacademy/wonder-blocks-core": "^4.3.1",
21
- "@khanacademy/wonder-blocks-icon": "^1.2.27",
22
- "@khanacademy/wonder-blocks-icon-button": "^3.4.6",
20
+ "@khanacademy/wonder-blocks-core": "^4.3.2",
21
+ "@khanacademy/wonder-blocks-icon": "^1.2.29",
22
+ "@khanacademy/wonder-blocks-icon-button": "^3.4.8",
23
23
  "@khanacademy/wonder-blocks-spacing": "^3.0.5",
24
- "@khanacademy/wonder-blocks-typography": "^1.1.31"
24
+ "@khanacademy/wonder-blocks-typography": "^1.1.32"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "aphrodite": "^1.2.5",
@@ -108,7 +108,10 @@ type Props = {|
108
108
  * ```
109
109
  */
110
110
  const SearchField: React.AbstractComponent<Props, HTMLInputElement> =
111
- React.forwardRef<Props, HTMLInputElement>((props: Props, ref) => {
111
+ React.forwardRef<Props, HTMLInputElement>(function SearchField(
112
+ props: Props,
113
+ ref,
114
+ ) {
112
115
  const {
113
116
  clearAriaLabel = defaultLabels.clearSearch,
114
117
  disabled = false,