@khanacademy/wonder-blocks-search-field 5.1.34 → 5.1.35
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 +18 -0
- package/dist/es/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-search-field
|
|
2
2
|
|
|
3
|
+
## 5.1.35
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- eafcfa3: Replaces `semanticColor.icon` with `semanticColor.core.foreground` tokens
|
|
8
|
+
- Updated dependencies [956f8bd]
|
|
9
|
+
- Updated dependencies [eafcfa3]
|
|
10
|
+
- Updated dependencies [956f8bd]
|
|
11
|
+
- Updated dependencies [956f8bd]
|
|
12
|
+
- Updated dependencies [eafcfa3]
|
|
13
|
+
- Updated dependencies [b42b694]
|
|
14
|
+
- Updated dependencies [956f8bd]
|
|
15
|
+
- @khanacademy/wonder-blocks-form@7.2.5
|
|
16
|
+
- @khanacademy/wonder-blocks-tokens@12.0.0
|
|
17
|
+
- @khanacademy/wonder-blocks-icon@5.2.12
|
|
18
|
+
- @khanacademy/wonder-blocks-icon-button@10.3.13
|
|
19
|
+
- @khanacademy/wonder-blocks-typography@4.2.14
|
|
20
|
+
|
|
3
21
|
## 5.1.34
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -12,6 +12,6 @@ import { semanticColor, border, spacing } from '@khanacademy/wonder-blocks-token
|
|
|
12
12
|
|
|
13
13
|
const defaultLabels={clearSearch:"Clear search"};
|
|
14
14
|
|
|
15
|
-
const SearchField=React.forwardRef(function SearchField(props,ref){const{clearAriaLabel=defaultLabels.clearSearch,autoFocus,disabled=false,id,value,placeholder,style,testId,error,instantValidation=true,validate,onValidate,onClick,onChange,onFocus,onBlur,...otherProps}=props;const innerRef=React.useRef(null);const handleClear=()=>{onChange("");innerRef?.current?.focus();};const maybeRenderClearIconButton=()=>{if(!value.length||disabled){return null}return jsx(IconButton,{icon:xIcon,size:"small",kind:"tertiary",actionType:"neutral",onClick:handleClear,style:styles.dismissIcon,"aria-label":clearAriaLabel})};return jsx(Id,{id:id,children:uniqueId=>jsxs(View,{onClick:onClick,style:[styles.inputContainer,style],children:[jsx(PhosphorIcon,{icon:magnifyingGlassIcon,size:"small",color:disabled?semanticColor.
|
|
15
|
+
const SearchField=React.forwardRef(function SearchField(props,ref){const{clearAriaLabel=defaultLabels.clearSearch,autoFocus,disabled=false,id,value,placeholder,style,testId,error,instantValidation=true,validate,onValidate,onClick,onChange,onFocus,onBlur,...otherProps}=props;const innerRef=React.useRef(null);const handleClear=()=>{onChange("");innerRef?.current?.focus();};const maybeRenderClearIconButton=()=>{if(!value.length||disabled){return null}return jsx(IconButton,{icon:xIcon,size:"small",kind:"tertiary",actionType:"neutral",onClick:handleClear,style:styles.dismissIcon,"aria-label":clearAriaLabel})};return jsx(Id,{id:id,children:uniqueId=>jsxs(View,{onClick:onClick,style:[styles.inputContainer,style],children:[jsx(PhosphorIcon,{icon:magnifyingGlassIcon,size:"small",color:disabled?semanticColor.core.foreground.disabled.default:semanticColor.core.foreground.neutral.default,style:styles.searchIcon,"aria-hidden":"true"}),jsx(TextField,{id:uniqueId,type:"text",autoFocus:autoFocus,disabled:disabled,instantValidation:instantValidation,validate:validate,onValidate:onValidate,onChange:onChange,onFocus:onFocus,onBlur:onBlur,placeholder:placeholder,error:error,ref:node=>{if(ref){ref.current=node;}innerRef.current=node;},value:value,style:[styles.inputStyleReset,styles$1.LabelMedium],testId:testId,...otherProps}),maybeRenderClearIconButton()]})})});const styles=StyleSheet.create({inputContainer:{boxSizing:"border-box",flexDirection:"row",borderRadius:border.radius.radius_040,alignItems:"center",height:40},searchIcon:{marginLeft:spacing.xSmall_8,marginRight:spacing.xSmall_8,position:"absolute"},dismissIcon:{margin:0,position:"absolute",right:spacing.xxxSmall_4},inputStyleReset:{display:"flex",flex:1,width:"100%",paddingLeft:spacing.xLarge_32,paddingRight:spacing.large_24+spacing.medium_16}});
|
|
16
16
|
|
|
17
17
|
export { SearchField as default };
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,6 @@ var IconButton__default = /*#__PURE__*/_interopDefaultLegacy(IconButton);
|
|
|
39
39
|
|
|
40
40
|
const defaultLabels={clearSearch:"Clear search"};
|
|
41
41
|
|
|
42
|
-
const SearchField=React__namespace.forwardRef(function SearchField(props,ref){const{clearAriaLabel=defaultLabels.clearSearch,autoFocus,disabled=false,id,value,placeholder,style,testId,error,instantValidation=true,validate,onValidate,onClick,onChange,onFocus,onBlur,...otherProps}=props;const innerRef=React__namespace.useRef(null);const handleClear=()=>{onChange("");innerRef?.current?.focus();};const maybeRenderClearIconButton=()=>{if(!value.length||disabled){return null}return jsxRuntime.jsx(IconButton__default["default"],{icon:xIcon__default["default"],size:"small",kind:"tertiary",actionType:"neutral",onClick:handleClear,style:styles.dismissIcon,"aria-label":clearAriaLabel})};return jsxRuntime.jsx(wonderBlocksCore.Id,{id:id,children:uniqueId=>jsxRuntime.jsxs(wonderBlocksCore.View,{onClick:onClick,style:[styles.inputContainer,style],children:[jsxRuntime.jsx(wonderBlocksIcon.PhosphorIcon,{icon:magnifyingGlassIcon__default["default"],size:"small",color:disabled?wonderBlocksTokens.semanticColor.
|
|
42
|
+
const SearchField=React__namespace.forwardRef(function SearchField(props,ref){const{clearAriaLabel=defaultLabels.clearSearch,autoFocus,disabled=false,id,value,placeholder,style,testId,error,instantValidation=true,validate,onValidate,onClick,onChange,onFocus,onBlur,...otherProps}=props;const innerRef=React__namespace.useRef(null);const handleClear=()=>{onChange("");innerRef?.current?.focus();};const maybeRenderClearIconButton=()=>{if(!value.length||disabled){return null}return jsxRuntime.jsx(IconButton__default["default"],{icon:xIcon__default["default"],size:"small",kind:"tertiary",actionType:"neutral",onClick:handleClear,style:styles.dismissIcon,"aria-label":clearAriaLabel})};return jsxRuntime.jsx(wonderBlocksCore.Id,{id:id,children:uniqueId=>jsxRuntime.jsxs(wonderBlocksCore.View,{onClick:onClick,style:[styles.inputContainer,style],children:[jsxRuntime.jsx(wonderBlocksIcon.PhosphorIcon,{icon:magnifyingGlassIcon__default["default"],size:"small",color:disabled?wonderBlocksTokens.semanticColor.core.foreground.disabled.default:wonderBlocksTokens.semanticColor.core.foreground.neutral.default,style:styles.searchIcon,"aria-hidden":"true"}),jsxRuntime.jsx(wonderBlocksForm.TextField,{id:uniqueId,type:"text",autoFocus:autoFocus,disabled:disabled,instantValidation:instantValidation,validate:validate,onValidate:onValidate,onChange:onChange,onFocus:onFocus,onBlur:onBlur,placeholder:placeholder,error:error,ref:node=>{if(ref){ref.current=node;}innerRef.current=node;},value:value,style:[styles.inputStyleReset,wonderBlocksTypography.styles.LabelMedium],testId:testId,...otherProps}),maybeRenderClearIconButton()]})})});const styles=aphrodite.StyleSheet.create({inputContainer:{boxSizing:"border-box",flexDirection:"row",borderRadius:wonderBlocksTokens.border.radius.radius_040,alignItems:"center",height:40},searchIcon:{marginLeft:wonderBlocksTokens.spacing.xSmall_8,marginRight:wonderBlocksTokens.spacing.xSmall_8,position:"absolute"},dismissIcon:{margin:0,position:"absolute",right:wonderBlocksTokens.spacing.xxxSmall_4},inputStyleReset:{display:"flex",flex:1,width:"100%",paddingLeft:wonderBlocksTokens.spacing.xLarge_32,paddingRight:wonderBlocksTokens.spacing.large_24+wonderBlocksTokens.spacing.medium_16}});
|
|
43
43
|
|
|
44
44
|
module.exports = SearchField;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-search-field",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.35",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Search Field components for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@khanacademy/wonder-blocks-core": "12.3.0",
|
|
16
|
-
"@khanacademy/wonder-blocks-form": "7.2.
|
|
17
|
-
"@khanacademy/wonder-blocks-icon": "5.2.
|
|
18
|
-
"@khanacademy/wonder-blocks-icon-button": "10.3.
|
|
19
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
20
|
-
"@khanacademy/wonder-blocks-typography": "4.2.
|
|
16
|
+
"@khanacademy/wonder-blocks-form": "7.2.5",
|
|
17
|
+
"@khanacademy/wonder-blocks-icon": "5.2.12",
|
|
18
|
+
"@khanacademy/wonder-blocks-icon-button": "10.3.13",
|
|
19
|
+
"@khanacademy/wonder-blocks-tokens": "12.0.0",
|
|
20
|
+
"@khanacademy/wonder-blocks-typography": "4.2.14"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@phosphor-icons/core": "^2.0.2",
|