@trackunit/react-form-components 0.0.150 → 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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-components",
3
- "version": "0.0.150",
3
+ "version": "0.0.152",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,9 +9,9 @@
9
9
  "dependencies": {
10
10
  "@trackunit/css-class-variance-utilities": "0.0.14",
11
11
  "@trackunit/i18n-library-translation": "0.0.79",
12
- "@trackunit/react-components": "0.1.163",
13
- "@trackunit/shared-utils": "0.0.8",
14
- "@trackunit/ui-icons": "0.0.76",
12
+ "@trackunit/react-components": "0.1.164",
13
+ "@trackunit/shared-utils": "0.0.9",
14
+ "@trackunit/ui-icons": "0.0.77",
15
15
  "date-fns": "2.29.3",
16
16
  "libphonenumber-js": "1.10.36",
17
17
  "react": "18.2.0",
@@ -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: ({ className, placeholder, value, widenInputOnFocus, showBorderWhenNotInFocus, disabled, onKeyUp, onChange, onFocus, onBlur, name, onClear, dataTestId, autoComplete, ...rest }: SearchProps) => JSX.Element;
61
+ export declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,6 +1,7 @@
1
1
  import { CommonProps } from "@trackunit/react-components";
2
+ import { Size } from "@trackunit/shared-utils";
2
3
  import * as React from "react";
3
- export type ToggleSize = "small" | "medium";
4
+ export type ToggleSize = Extract<Size, "small" | "medium">;
4
5
  export interface ToggleProps extends CommonProps {
5
6
  /**
6
7
  * id of the toggle.