@react-spectrum/searchfield 3.8.18 → 3.8.20
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/dist/SearchField.main.js +9 -1
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +10 -2
- package/dist/SearchField.module.js +10 -2
- package/dist/SearchField.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/SearchField.tsx +8 -4
package/dist/SearchField.main.js
CHANGED
|
@@ -48,7 +48,15 @@ const $111fe330b4c1f3ac$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $anRgD$react
|
|
|
48
48
|
"data-testid": "searchicon"
|
|
49
49
|
});
|
|
50
50
|
let { icon: icon = defaultIcon, isDisabled: isDisabled, UNSAFE_className: UNSAFE_className, placeholder: placeholder, ...otherProps } = props;
|
|
51
|
-
|
|
51
|
+
let hasWarned = (0, $anRgD$react.useRef)(false);
|
|
52
|
+
(0, $anRgD$react.useEffect)(()=>{
|
|
53
|
+
if (placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
|
|
54
|
+
console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');
|
|
55
|
+
hasWarned.current = true;
|
|
56
|
+
}
|
|
57
|
+
}, [
|
|
58
|
+
placeholder
|
|
59
|
+
]);
|
|
52
60
|
let state = (0, $anRgD$reactstatelysearchfield.useSearchFieldState)(props);
|
|
53
61
|
let inputRef = (0, $anRgD$react.useRef)(null);
|
|
54
62
|
let { clearButtonProps: clearButtonProps, ...result } = (0, $anRgD$reactariasearchfield.useSearchField)(props, state, inputRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAkBM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAAsB;IAChH,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,4BACF,0DAAC,CAAA,GAAA,yDAAQ;QAAE,eAAY;;IAGzB,IAAI,QACF,OAAO,yBACP,UAAU,oBACV,gBAAgB,eAChB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,eAAe,QAAQ,GAAG,CAAC,QAAQ,KAAK,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAkBM,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAAsB;IAChH,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,4BACF,0DAAC,CAAA,GAAA,yDAAQ;QAAE,eAAY;;IAGzB,IAAI,QACF,OAAO,yBACP,UAAU,oBACV,gBAAgB,eAChB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,eAAe,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YAC9E,QAAQ,IAAI,CAAC;YACb,UAAU,OAAO,GAAG;QACtB;IACF,GAAG;QAAC;KAAY;IAEhB,IAAI,QAAQ,CAAA,GAAA,kDAAkB,EAAE;IAChC,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,oBAAC,gBAAgB,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,0CAAa,EAAE,OAAO,OAAO;IAEjE,IAAI,4BACF,0DAAC,CAAA,GAAA,sCAAU;QACR,GAAG,gBAAgB;QACpB,cAAA;QACA,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;QAGJ,YAAY;;IAGhB,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,OAAO,SAAS,GAAG,YAAY,SAAQ;IAEvF,qBACE,0DAAC,CAAA,GAAA,2CAAY;QACV,GAAG,UAAU;QACb,GAAG,MAAM;QACV,iBAAiB;QACjB,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,mBACA,sBACA;YACE,eAAe;YACf,YAAY,MAAM,OAAO;YACzB,4BAA4B,oBAAoB,aAAa,CAAC;YAC9D,0BAA0B,oBAAoB,WAAW,CAAC;QAC5D,GACA;QAGJ,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACnC,KAAK;QACL,UAAU;QACV,YAAY;QACZ,MAAM;QACN,iBAAiB,AAAC,MAAM,KAAK,KAAK,MAAM,CAAC,MAAM,UAAU,GAAI,cAAc;;AAEjF","sources":["packages/@react-spectrum/searchfield/src/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useSlotProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport React, {forwardRef, ReactElement, Ref, useEffect, useRef} from 'react';\nimport {SpectrumSearchFieldProps} from '@react-types/searchfield';\nimport styles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSearchField} from '@react-aria/searchfield';\nimport {useSearchFieldState} from '@react-stately/searchfield';\n\n/**\n * A SearchField is a text field designed for searches.\n */\nexport const SearchField = forwardRef(function SearchField(props: SpectrumSearchFieldProps, ref: Ref<TextFieldRef>) {\n props = useSlotProps(props, 'searchfield');\n props = useProviderProps(props);\n props = useFormProps(props);\n let defaultIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = defaultIcon,\n isDisabled,\n UNSAFE_className,\n placeholder,\n ...otherProps\n } = props;\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');\n hasWarned.current = true;\n }\n }, [placeholder]);\n\n let state = useSearchFieldState(props);\n let inputRef = useRef<HTMLInputElement>(null);\n let {clearButtonProps, ...result} = useSearchField(props, state, inputRef);\n\n let clearButton = (\n <ClearButton\n {...clearButtonProps}\n preventFocus\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let validationState = props.validationState || (result.isInvalid ? 'invalid' : undefined);\n\n return (\n <TextFieldBase\n {...otherProps}\n {...result}\n validationState={validationState}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Search',\n 'spectrum-Textfield',\n {\n 'is-disabled': isDisabled,\n 'is-quiet': props.isQuiet,\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n UNSAFE_className\n )\n }\n inputClassName={classNames(styles, 'spectrum-Search-input')}\n ref={ref}\n inputRef={inputRef}\n isDisabled={isDisabled}\n icon={icon}\n wrapperChildren={(state.value !== '' && !props.isReadOnly) ? clearButton : undefined} />\n );\n}) as (props: SpectrumSearchFieldProps & {ref?: Ref<TextFieldRef>}) => ReactElement;\n"],"names":[],"version":3,"file":"SearchField.main.js.map"}
|
package/dist/SearchField.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import $kYtTO$search_vars_cssmodulejs from "./search_vars_css.mjs";
|
|
|
3
3
|
import {useSlotProps as $kYtTO$useSlotProps, classNames as $kYtTO$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import {ClearButton as $kYtTO$ClearButton} from "@react-spectrum/button";
|
|
5
5
|
import $kYtTO$spectrumiconsuiMagnifier from "@spectrum-icons/ui/Magnifier";
|
|
6
|
-
import $kYtTO$react, {forwardRef as $kYtTO$forwardRef, useRef as $kYtTO$useRef} from "react";
|
|
6
|
+
import $kYtTO$react, {forwardRef as $kYtTO$forwardRef, useRef as $kYtTO$useRef, useEffect as $kYtTO$useEffect} from "react";
|
|
7
7
|
import {TextFieldBase as $kYtTO$TextFieldBase} from "@react-spectrum/textfield";
|
|
8
8
|
import {useFormProps as $kYtTO$useFormProps} from "@react-spectrum/form";
|
|
9
9
|
import {useProviderProps as $kYtTO$useProviderProps} from "@react-spectrum/provider";
|
|
@@ -42,7 +42,15 @@ const $a6a4ace9217ce6df$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $kYtTO$forwa
|
|
|
42
42
|
"data-testid": "searchicon"
|
|
43
43
|
});
|
|
44
44
|
let { icon: icon = defaultIcon, isDisabled: isDisabled, UNSAFE_className: UNSAFE_className, placeholder: placeholder, ...otherProps } = props;
|
|
45
|
-
|
|
45
|
+
let hasWarned = (0, $kYtTO$useRef)(false);
|
|
46
|
+
(0, $kYtTO$useEffect)(()=>{
|
|
47
|
+
if (placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
|
|
48
|
+
console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');
|
|
49
|
+
hasWarned.current = true;
|
|
50
|
+
}
|
|
51
|
+
}, [
|
|
52
|
+
placeholder
|
|
53
|
+
]);
|
|
46
54
|
let state = (0, $kYtTO$useSearchFieldState)(props);
|
|
47
55
|
let inputRef = (0, $kYtTO$useRef)(null);
|
|
48
56
|
let { clearButtonProps: clearButtonProps, ...result } = (0, $kYtTO$useSearchField)(props, state, inputRef);
|
|
@@ -3,7 +3,7 @@ import $kYtTO$search_vars_cssmodulejs from "./search_vars_css.module.js";
|
|
|
3
3
|
import {useSlotProps as $kYtTO$useSlotProps, classNames as $kYtTO$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import {ClearButton as $kYtTO$ClearButton} from "@react-spectrum/button";
|
|
5
5
|
import $kYtTO$spectrumiconsuiMagnifier from "@spectrum-icons/ui/Magnifier";
|
|
6
|
-
import $kYtTO$react, {forwardRef as $kYtTO$forwardRef, useRef as $kYtTO$useRef} from "react";
|
|
6
|
+
import $kYtTO$react, {forwardRef as $kYtTO$forwardRef, useRef as $kYtTO$useRef, useEffect as $kYtTO$useEffect} from "react";
|
|
7
7
|
import {TextFieldBase as $kYtTO$TextFieldBase} from "@react-spectrum/textfield";
|
|
8
8
|
import {useFormProps as $kYtTO$useFormProps} from "@react-spectrum/form";
|
|
9
9
|
import {useProviderProps as $kYtTO$useProviderProps} from "@react-spectrum/provider";
|
|
@@ -42,7 +42,15 @@ const $a6a4ace9217ce6df$export$b94867ecbd698f21 = /*#__PURE__*/ (0, $kYtTO$forwa
|
|
|
42
42
|
"data-testid": "searchicon"
|
|
43
43
|
});
|
|
44
44
|
let { icon: icon = defaultIcon, isDisabled: isDisabled, UNSAFE_className: UNSAFE_className, placeholder: placeholder, ...otherProps } = props;
|
|
45
|
-
|
|
45
|
+
let hasWarned = (0, $kYtTO$useRef)(false);
|
|
46
|
+
(0, $kYtTO$useEffect)(()=>{
|
|
47
|
+
if (placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
|
|
48
|
+
console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');
|
|
49
|
+
hasWarned.current = true;
|
|
50
|
+
}
|
|
51
|
+
}, [
|
|
52
|
+
placeholder
|
|
53
|
+
]);
|
|
46
54
|
let state = (0, $kYtTO$useSearchFieldState)(props);
|
|
47
55
|
let inputRef = (0, $kYtTO$useRef)(null);
|
|
48
56
|
let { clearButtonProps: clearButtonProps, ...result } = (0, $kYtTO$useSearchField)(props, state, inputRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAkBM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAAsB;IAChH,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,4BACF,gCAAC,CAAA,GAAA,+BAAQ;QAAE,eAAY;;IAGzB,IAAI,QACF,OAAO,yBACP,UAAU,oBACV,gBAAgB,eAChB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,eAAe,QAAQ,GAAG,CAAC,QAAQ,KAAK,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAkBM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAAY,KAA+B,EAAE,GAAsB;IAChH,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,4BACF,gCAAC,CAAA,GAAA,+BAAQ;QAAE,eAAY;;IAGzB,IAAI,QACF,OAAO,yBACP,UAAU,oBACV,gBAAgB,eAChB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,eAAe,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YAC9E,QAAQ,IAAI,CAAC;YACb,UAAU,OAAO,GAAG;QACtB;IACF,GAAG;QAAC;KAAY;IAEhB,IAAI,QAAQ,CAAA,GAAA,0BAAkB,EAAE;IAChC,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,oBAAC,gBAAgB,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,qBAAa,EAAE,OAAO,OAAO;IAEjE,IAAI,4BACF,gCAAC,CAAA,GAAA,kBAAU;QACR,GAAG,gBAAgB;QACpB,cAAA;QACA,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAK,GACL;QAGJ,YAAY;;IAGhB,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,OAAO,SAAS,GAAG,YAAY,SAAQ;IAEvF,qBACE,gCAAC,CAAA,GAAA,oBAAY;QACV,GAAG,UAAU;QACb,GAAG,MAAM;QACV,iBAAiB;QACjB,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAK,GACL,mBACA,sBACA;YACE,eAAe;YACf,YAAY,MAAM,OAAO;YACzB,4BAA4B,oBAAoB,aAAa,CAAC;YAC9D,0BAA0B,oBAAoB,WAAW,CAAC;QAC5D,GACA;QAGJ,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QACnC,KAAK;QACL,UAAU;QACV,YAAY;QACZ,MAAM;QACN,iBAAiB,AAAC,MAAM,KAAK,KAAK,MAAM,CAAC,MAAM,UAAU,GAAI,cAAc;;AAEjF","sources":["packages/@react-spectrum/searchfield/src/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, useSlotProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport React, {forwardRef, ReactElement, Ref, useEffect, useRef} from 'react';\nimport {SpectrumSearchFieldProps} from '@react-types/searchfield';\nimport styles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSearchField} from '@react-aria/searchfield';\nimport {useSearchFieldState} from '@react-stately/searchfield';\n\n/**\n * A SearchField is a text field designed for searches.\n */\nexport const SearchField = forwardRef(function SearchField(props: SpectrumSearchFieldProps, ref: Ref<TextFieldRef>) {\n props = useSlotProps(props, 'searchfield');\n props = useProviderProps(props);\n props = useFormProps(props);\n let defaultIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = defaultIcon,\n isDisabled,\n UNSAFE_className,\n placeholder,\n ...otherProps\n } = props;\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');\n hasWarned.current = true;\n }\n }, [placeholder]);\n\n let state = useSearchFieldState(props);\n let inputRef = useRef<HTMLInputElement>(null);\n let {clearButtonProps, ...result} = useSearchField(props, state, inputRef);\n\n let clearButton = (\n <ClearButton\n {...clearButtonProps}\n preventFocus\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let validationState = props.validationState || (result.isInvalid ? 'invalid' : undefined);\n\n return (\n <TextFieldBase\n {...otherProps}\n {...result}\n validationState={validationState}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-Search',\n 'spectrum-Textfield',\n {\n 'is-disabled': isDisabled,\n 'is-quiet': props.isQuiet,\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n UNSAFE_className\n )\n }\n inputClassName={classNames(styles, 'spectrum-Search-input')}\n ref={ref}\n inputRef={inputRef}\n isDisabled={isDisabled}\n icon={icon}\n wrapperChildren={(state.value !== '' && !props.isReadOnly) ? clearButton : undefined} />\n );\n}) as (props: SpectrumSearchFieldProps & {ref?: Ref<TextFieldRef>}) => ReactElement;\n"],"names":[],"version":3,"file":"SearchField.module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAyBA;;GAEG;AACH,OAAO,MAAM,
|
|
1
|
+
{"mappings":";;;AAyBA;;GAEG;AACH,OAAO,MAAM,aAqEP,CAAC,KAAK,EAAE,wBAAwB,GAAG;IAAC,GAAG,CAAC,EAAE,IAAI,YAAY,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;AClFpF,YAAY,EAAC,wBAAwB,EAAC,MAAM,0BAA0B,CAAC","sources":["packages/@react-spectrum/searchfield/src/packages/@react-spectrum/searchfield/src/SearchField.tsx","packages/@react-spectrum/searchfield/src/packages/@react-spectrum/searchfield/src/index.ts","packages/@react-spectrum/searchfield/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {SearchField} from './SearchField';\nexport type {SpectrumSearchFieldProps} from '@react-types/searchfield';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/searchfield",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.20",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"url": "https://github.com/adobe/react-spectrum"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@react-aria/searchfield": "^3.8.
|
|
44
|
-
"@react-spectrum/button": "^3.
|
|
45
|
-
"@react-spectrum/form": "^3.7.
|
|
46
|
-
"@react-spectrum/textfield": "^3.
|
|
47
|
-
"@react-spectrum/utils": "^3.12.
|
|
48
|
-
"@react-stately/searchfield": "^3.5.
|
|
49
|
-
"@react-types/searchfield": "^3.6.
|
|
50
|
-
"@react-types/textfield": "^3.12.
|
|
51
|
-
"@spectrum-icons/ui": "^3.6.
|
|
43
|
+
"@react-aria/searchfield": "^3.8.8",
|
|
44
|
+
"@react-spectrum/button": "^3.17.1",
|
|
45
|
+
"@react-spectrum/form": "^3.7.18",
|
|
46
|
+
"@react-spectrum/textfield": "^3.14.1",
|
|
47
|
+
"@react-spectrum/utils": "^3.12.8",
|
|
48
|
+
"@react-stately/searchfield": "^3.5.15",
|
|
49
|
+
"@react-types/searchfield": "^3.6.5",
|
|
50
|
+
"@react-types/textfield": "^3.12.5",
|
|
51
|
+
"@spectrum-icons/ui": "^3.6.19",
|
|
52
52
|
"@swc/helpers": "^0.5.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "2c58ed3ddd9be9100af9b1d0cfd137fcdc95ba2d"
|
|
67
67
|
}
|
package/src/SearchField.tsx
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import {classNames, useSlotProps} from '@react-spectrum/utils';
|
|
14
14
|
import {ClearButton} from '@react-spectrum/button';
|
|
15
15
|
import Magnifier from '@spectrum-icons/ui/Magnifier';
|
|
16
|
-
import React, {forwardRef, ReactElement, Ref, useRef} from 'react';
|
|
16
|
+
import React, {forwardRef, ReactElement, Ref, useEffect, useRef} from 'react';
|
|
17
17
|
import {SpectrumSearchFieldProps} from '@react-types/searchfield';
|
|
18
18
|
import styles from '@adobe/spectrum-css-temp/components/search/vars.css';
|
|
19
19
|
import {TextFieldBase} from '@react-spectrum/textfield';
|
|
@@ -42,9 +42,13 @@ export const SearchField = forwardRef(function SearchField(props: SpectrumSearch
|
|
|
42
42
|
...otherProps
|
|
43
43
|
} = props;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
let hasWarned = useRef(false);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
|
|
48
|
+
console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');
|
|
49
|
+
hasWarned.current = true;
|
|
50
|
+
}
|
|
51
|
+
}, [placeholder]);
|
|
48
52
|
|
|
49
53
|
let state = useSearchFieldState(props);
|
|
50
54
|
let inputRef = useRef<HTMLInputElement>(null);
|