@khanacademy/wonder-blocks-search-field 5.1.0 → 5.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 CHANGED
@@ -1,5 +1,41 @@
1
1
  # @khanacademy/wonder-blocks-search-field
2
2
 
3
+ ## 5.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 7bb37a2: Update component docs to include labelling guidelines
8
+ - 051f0f8: Rework action.disabled tokens to include properties per kind (border, background, foreground).
9
+ - Updated dependencies [ed26d66]
10
+ - Updated dependencies [5655b9f]
11
+ - Updated dependencies [5655b9f]
12
+ - Updated dependencies [8f53293]
13
+ - Updated dependencies [7bb37a2]
14
+ - Updated dependencies [051f0f8]
15
+ - Updated dependencies [e1b78db]
16
+ - Updated dependencies [8f53293]
17
+ - Updated dependencies [051f0f8]
18
+ - Updated dependencies [7bb37a2]
19
+ - @khanacademy/wonder-blocks-core@12.2.0
20
+ - @khanacademy/wonder-blocks-tokens@5.0.0
21
+ - @khanacademy/wonder-blocks-icon-button@6.1.2
22
+ - @khanacademy/wonder-blocks-form@7.1.2
23
+ - @khanacademy/wonder-blocks-icon@5.1.2
24
+ - @khanacademy/wonder-blocks-typography@3.1.2
25
+
26
+ ## 5.1.1
27
+
28
+ ### Patch Changes
29
+
30
+ - ee8d95a: Rollback rollup version from v4 to v2 to prevent an issue with CJS builds in unit tests
31
+ - Updated dependencies [ee8d95a]
32
+ - @khanacademy/wonder-blocks-core@12.1.1
33
+ - @khanacademy/wonder-blocks-form@7.1.1
34
+ - @khanacademy/wonder-blocks-icon@5.1.1
35
+ - @khanacademy/wonder-blocks-icon-button@6.1.1
36
+ - @khanacademy/wonder-blocks-tokens@4.2.1
37
+ - @khanacademy/wonder-blocks-typography@3.1.1
38
+
3
39
  ## 5.1.0
4
40
 
5
41
  ### Minor Changes
@@ -95,6 +95,14 @@ type Props = AriaProps & {
95
95
  * Search Field. A TextField with a search icon on its left side
96
96
  * and an X icon on its right side.
97
97
  *
98
+ * Make sure to provide a label for the field. This can be done by either:
99
+ * - (recommended) Using the **LabeledField** component to provide a label,
100
+ * description, and/or error message for the field
101
+ * - Using a `label` html tag with the `htmlFor` prop set to the unique id of
102
+ * the field
103
+ * - Using an `aria-label` attribute on the field
104
+ * - Using an `aria-labelledby` attribute on the field
105
+ *
98
106
  * ### Usage
99
107
  * ```jsx
100
108
  * import {SearchField} from "@khanacademy/wonder-blocks-search-field";
package/dist/es/index.js CHANGED
@@ -63,7 +63,7 @@ const SearchField = React.forwardRef(function SearchField(props, ref) {
63
63
  }, React.createElement(PhosphorIcon, {
64
64
  icon: magnifyingGlassIcon,
65
65
  size: "small",
66
- color: disabled ? semanticColor.action.disabled.default : semanticColor.icon.primary,
66
+ color: disabled ? semanticColor.icon.disabled : semanticColor.icon.primary,
67
67
  style: styles.searchIcon,
68
68
  "aria-hidden": "true"
69
69
  }), React.createElement(TextField, _extends({
package/dist/index.js CHANGED
@@ -13,7 +13,10 @@ 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 _interopNamespaceDefault(e) {
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;
17
20
  var n = Object.create(null);
18
21
  if (e) {
19
22
  Object.keys(e).forEach(function (k) {
@@ -26,11 +29,16 @@ function _interopNamespaceDefault(e) {
26
29
  }
27
30
  });
28
31
  }
29
- n.default = e;
32
+ n["default"] = e;
30
33
  return Object.freeze(n);
31
34
  }
32
35
 
33
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
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);
34
42
 
35
43
  const defaultLabels = {
36
44
  clearSearch: "Clear search"
@@ -56,7 +64,7 @@ const SearchField = React__namespace.forwardRef(function SearchField(props, ref)
56
64
  onFocus,
57
65
  onBlur
58
66
  } = props,
59
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
67
+ otherProps = _objectWithoutPropertiesLoose__default["default"](props, _excluded);
60
68
  const innerRef = React__namespace.useRef(null);
61
69
  const handleClear = () => {
62
70
  var _innerRef$current;
@@ -67,8 +75,8 @@ const SearchField = React__namespace.forwardRef(function SearchField(props, ref)
67
75
  if (!value.length || disabled) {
68
76
  return null;
69
77
  }
70
- return React__namespace.createElement(IconButton, {
71
- icon: xIcon,
78
+ return React__namespace.createElement(IconButton__default["default"], {
79
+ icon: xIcon__default["default"],
72
80
  size: "small",
73
81
  kind: "tertiary",
74
82
  onClick: handleClear,
@@ -82,12 +90,12 @@ const SearchField = React__namespace.forwardRef(function SearchField(props, ref)
82
90
  onClick: onClick,
83
91
  style: [styles.inputContainer, style]
84
92
  }, React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
85
- icon: magnifyingGlassIcon,
93
+ icon: magnifyingGlassIcon__default["default"],
86
94
  size: "small",
87
- color: disabled ? wonderBlocksTokens.semanticColor.action.disabled.default : wonderBlocksTokens.semanticColor.icon.primary,
95
+ color: disabled ? wonderBlocksTokens.semanticColor.icon.disabled : wonderBlocksTokens.semanticColor.icon.primary,
88
96
  style: styles.searchIcon,
89
97
  "aria-hidden": "true"
90
- }), React__namespace.createElement(wonderBlocksForm.TextField, _extends({
98
+ }), React__namespace.createElement(wonderBlocksForm.TextField, _extends__default["default"]({
91
99
  id: uniqueId,
92
100
  type: "text",
93
101
  autoFocus: autoFocus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-search-field",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
4
4
  "design": "v1",
5
5
  "description": "Search Field components for Wonder Blocks.",
6
6
  "main": "dist/index.js",
@@ -13,12 +13,12 @@
13
13
  },
14
14
  "dependencies": {
15
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"
16
+ "@khanacademy/wonder-blocks-core": "12.2.0",
17
+ "@khanacademy/wonder-blocks-form": "7.1.2",
18
+ "@khanacademy/wonder-blocks-icon": "5.1.2",
19
+ "@khanacademy/wonder-blocks-icon-button": "6.1.2",
20
+ "@khanacademy/wonder-blocks-tokens": "5.0.0",
21
+ "@khanacademy/wonder-blocks-typography": "3.1.2"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@phosphor-icons/core": "^2.0.2",
@@ -26,7 +26,7 @@
26
26
  "react": "18.2.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@khanacademy/wb-dev-build-settings": "2.1.0"
29
+ "@khanacademy/wb-dev-build-settings": "2.1.1"
30
30
  },
31
31
  "scripts": {
32
32
  "test": "echo \"Error: no test specified\" && exit 1"