@trackunit/react-form-components 0.0.151 → 0.0.152
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/index.cjs.js +3 -3
- package/index.esm.js +3 -3
- package/package.json +1 -1
- package/src/components/Search/Search.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -14937,12 +14937,12 @@ const cvaSearch = cssClassVarianceUtilities.cvaMerge([
|
|
|
14937
14937
|
* @param {SearchProps} props - The props for the Search component
|
|
14938
14938
|
* @returns {JSX.Element} Search component
|
|
14939
14939
|
*/
|
|
14940
|
-
const Search = (_a) => {
|
|
14940
|
+
const Search = React.forwardRef((_a, ref) => {
|
|
14941
14941
|
var { className, placeholder = "Search", value, widenInputOnFocus, showBorderWhenNotInFocus = false, disabled, onKeyUp, onChange, onFocus, onBlur, name, onClear, dataTestId, autoComplete = "on" } = _a, rest = __rest(_a, ["className", "placeholder", "value", "widenInputOnFocus", "showBorderWhenNotInFocus", "disabled", "onKeyUp", "onChange", "onFocus", "onBlur", "name", "onClear", "dataTestId", "autoComplete"]);
|
|
14942
|
-
return (jsxRuntime.jsx(TextInput, Object.assign({}, rest, { dataTestId: dataTestId, name: name, className: cvaSearch({ className, border: showBorderWhenNotInFocus, widenOnFocus: widenInputOnFocus }), placeholder: placeholder, prefix: jsxRuntime.jsx(reactComponents.Icon, { name: "MagnifyingGlass", size: "medium" }), suffix: onClear ? (jsxRuntime.jsx("button", { "data-testid": dataTestId && `${dataTestId}_suffix_component`, onClick: () => {
|
|
14942
|
+
return (jsxRuntime.jsx(TextInput, Object.assign({}, rest, { ref: ref, dataTestId: dataTestId, name: name, className: cvaSearch({ className, border: showBorderWhenNotInFocus, widenOnFocus: widenInputOnFocus }), placeholder: placeholder, prefix: jsxRuntime.jsx(reactComponents.Icon, { name: "MagnifyingGlass", size: "medium" }), suffix: onClear ? (jsxRuntime.jsx("button", { "data-testid": dataTestId && `${dataTestId}_suffix_component`, onClick: () => {
|
|
14943
14943
|
onClear();
|
|
14944
14944
|
}, children: jsxRuntime.jsx(reactComponents.Icon, { name: "XMark", size: "small" }) })) : undefined, value: value, disabled: disabled, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, autoComplete: autoComplete })));
|
|
14945
|
-
};
|
|
14945
|
+
});
|
|
14946
14946
|
|
|
14947
14947
|
const cvaTextArea = cssClassVarianceUtilities.cvaMerge([
|
|
14948
14948
|
cvaInputBase(),
|
package/index.esm.js
CHANGED
|
@@ -14911,12 +14911,12 @@ const cvaSearch = cvaMerge([
|
|
|
14911
14911
|
* @param {SearchProps} props - The props for the Search component
|
|
14912
14912
|
* @returns {JSX.Element} Search component
|
|
14913
14913
|
*/
|
|
14914
|
-
const Search = (_a) => {
|
|
14914
|
+
const Search = forwardRef((_a, ref) => {
|
|
14915
14915
|
var { className, placeholder = "Search", value, widenInputOnFocus, showBorderWhenNotInFocus = false, disabled, onKeyUp, onChange, onFocus, onBlur, name, onClear, dataTestId, autoComplete = "on" } = _a, rest = __rest(_a, ["className", "placeholder", "value", "widenInputOnFocus", "showBorderWhenNotInFocus", "disabled", "onKeyUp", "onChange", "onFocus", "onBlur", "name", "onClear", "dataTestId", "autoComplete"]);
|
|
14916
|
-
return (jsx$1(TextInput, Object.assign({}, rest, { dataTestId: dataTestId, name: name, className: cvaSearch({ className, border: showBorderWhenNotInFocus, widenOnFocus: widenInputOnFocus }), placeholder: placeholder, prefix: jsx$1(Icon, { name: "MagnifyingGlass", size: "medium" }), suffix: onClear ? (jsx$1("button", { "data-testid": dataTestId && `${dataTestId}_suffix_component`, onClick: () => {
|
|
14916
|
+
return (jsx$1(TextInput, Object.assign({}, rest, { ref: ref, dataTestId: dataTestId, name: name, className: cvaSearch({ className, border: showBorderWhenNotInFocus, widenOnFocus: widenInputOnFocus }), placeholder: placeholder, prefix: jsx$1(Icon, { name: "MagnifyingGlass", size: "medium" }), suffix: onClear ? (jsx$1("button", { "data-testid": dataTestId && `${dataTestId}_suffix_component`, onClick: () => {
|
|
14917
14917
|
onClear();
|
|
14918
14918
|
}, children: jsx$1(Icon, { name: "XMark", size: "small" }) })) : undefined, value: value, disabled: disabled, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, autoComplete: autoComplete })));
|
|
14919
|
-
};
|
|
14919
|
+
});
|
|
14920
14920
|
|
|
14921
14921
|
const cvaTextArea = cvaMerge([
|
|
14922
14922
|
cvaInputBase(),
|
package/package.json
CHANGED
|
@@ -58,4 +58,4 @@ export interface SearchProps extends CommonProps, TextInputProps {
|
|
|
58
58
|
* @param {SearchProps} props - The props for the Search component
|
|
59
59
|
* @returns {JSX.Element} Search component
|
|
60
60
|
*/
|
|
61
|
-
export declare const Search:
|
|
61
|
+
export declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<HTMLInputElement>>;
|