@khanacademy/wonder-blocks-search-field 5.0.3 → 5.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
@@ -40,7 +40,7 @@ const SearchField = React.forwardRef(function SearchField(props, ref) {
40
40
  const handleClear = () => {
41
41
  var _innerRef$current;
42
42
  onChange("");
43
- innerRef == null ? void 0 : (_innerRef$current = innerRef.current) == null ? void 0 : _innerRef$current.focus();
43
+ innerRef == null || (_innerRef$current = innerRef.current) == null || _innerRef$current.focus();
44
44
  };
45
45
  const maybeRenderClearIconButton = () => {
46
46
  if (!value.length || disabled) {
package/dist/index.js CHANGED
@@ -13,10 +13,7 @@ var wonderBlocksForm = require('@khanacademy/wonder-blocks-form');
13
13
  var wonderBlocksIcon = require('@khanacademy/wonder-blocks-icon');
14
14
  var wonderBlocksTokens = require('@khanacademy/wonder-blocks-tokens');
15
15
 
16
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
-
18
- function _interopNamespace(e) {
19
- if (e && e.__esModule) return e;
16
+ function _interopNamespaceDefault(e) {
20
17
  var n = Object.create(null);
21
18
  if (e) {
22
19
  Object.keys(e).forEach(function (k) {
@@ -29,16 +26,11 @@ function _interopNamespace(e) {
29
26
  }
30
27
  });
31
28
  }
32
- n["default"] = e;
29
+ n.default = e;
33
30
  return Object.freeze(n);
34
31
  }
35
32
 
36
- var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
37
- var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose);
38
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
39
- var xIcon__default = /*#__PURE__*/_interopDefaultLegacy(xIcon);
40
- var magnifyingGlassIcon__default = /*#__PURE__*/_interopDefaultLegacy(magnifyingGlassIcon);
41
- var IconButton__default = /*#__PURE__*/_interopDefaultLegacy(IconButton);
33
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
42
34
 
43
35
  const defaultLabels = {
44
36
  clearSearch: "Clear search"
@@ -64,19 +56,19 @@ const SearchField = React__namespace.forwardRef(function SearchField(props, ref)
64
56
  onFocus,
65
57
  onBlur
66
58
  } = props,
67
- otherProps = _objectWithoutPropertiesLoose__default["default"](props, _excluded);
59
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
68
60
  const innerRef = React__namespace.useRef(null);
69
61
  const handleClear = () => {
70
62
  var _innerRef$current;
71
63
  onChange("");
72
- innerRef == null ? void 0 : (_innerRef$current = innerRef.current) == null ? void 0 : _innerRef$current.focus();
64
+ innerRef == null || (_innerRef$current = innerRef.current) == null || _innerRef$current.focus();
73
65
  };
74
66
  const maybeRenderClearIconButton = () => {
75
67
  if (!value.length || disabled) {
76
68
  return null;
77
69
  }
78
- return React__namespace.createElement(IconButton__default["default"], {
79
- icon: xIcon__default["default"],
70
+ return React__namespace.createElement(IconButton, {
71
+ icon: xIcon,
80
72
  size: "small",
81
73
  kind: "tertiary",
82
74
  onClick: handleClear,
@@ -90,12 +82,12 @@ const SearchField = React__namespace.forwardRef(function SearchField(props, ref)
90
82
  onClick: onClick,
91
83
  style: [styles.inputContainer, style]
92
84
  }, React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
93
- icon: magnifyingGlassIcon__default["default"],
85
+ icon: magnifyingGlassIcon,
94
86
  size: "small",
95
87
  color: disabled ? wonderBlocksTokens.semanticColor.action.disabled.default : wonderBlocksTokens.semanticColor.icon.primary,
96
88
  style: styles.searchIcon,
97
89
  "aria-hidden": "true"
98
- }), React__namespace.createElement(wonderBlocksForm.TextField, _extends__default["default"]({
90
+ }), React__namespace.createElement(wonderBlocksForm.TextField, _extends({
99
91
  id: uniqueId,
100
92
  type: "text",
101
93
  autoFocus: autoFocus,
package/package.json CHANGED
@@ -1,28 +1,24 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-search-field",
3
- "version": "5.0.3",
3
+ "version": "5.1.0",
4
4
  "design": "v1",
5
5
  "description": "Search Field 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-core": "^12.0.0",
21
- "@khanacademy/wonder-blocks-form": "^7.0.2",
22
- "@khanacademy/wonder-blocks-icon": "^5.0.6",
23
- "@khanacademy/wonder-blocks-icon-button": "^6.0.9",
24
- "@khanacademy/wonder-blocks-tokens": "^4.1.0",
25
- "@khanacademy/wonder-blocks-typography": "^3.0.6"
15
+ "@babel/runtime": "^7.24.5",
16
+ "@khanacademy/wonder-blocks-core": "12.1.0",
17
+ "@khanacademy/wonder-blocks-form": "7.1.0",
18
+ "@khanacademy/wonder-blocks-icon": "5.1.0",
19
+ "@khanacademy/wonder-blocks-icon-button": "6.1.0",
20
+ "@khanacademy/wonder-blocks-tokens": "4.2.0",
21
+ "@khanacademy/wonder-blocks-typography": "3.1.0"
26
22
  },
27
23
  "peerDependencies": {
28
24
  "@phosphor-icons/core": "^2.0.2",
@@ -30,6 +26,9 @@
30
26
  "react": "18.2.0"
31
27
  },
32
28
  "devDependencies": {
33
- "@khanacademy/wb-dev-build-settings": "^2.0.0"
29
+ "@khanacademy/wb-dev-build-settings": "2.1.0"
30
+ },
31
+ "scripts": {
32
+ "test": "echo \"Error: no test specified\" && exit 1"
34
33
  }
35
34
  }