mtxuilib 0.1.347 → 0.1.349

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.
@@ -1,2 +1,6 @@
1
- import type { InputProps } from "../types";
2
- export declare const SearchInput: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
1
+ interface SearchInputProps {
2
+ value?: string;
3
+ onChange?: (value?: string) => void;
4
+ }
5
+ export declare const SearchInput: (props: SearchInputProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Icons } from "mtxuilib/icons/icons";
4
- import { useFormContext } from "react-hook-form";
5
4
  import { Input } from "../../input";
6
5
  export const SearchInput = (props) => {
7
- const { name } = props;
8
- const form = useFormContext();
9
- return (_jsxs("div", { className: "relative ml-auto flex-1 md:grow-0", children: [_jsx(Icons.search, { className: "text-muted-foreground absolute left-2.5 top-2.5 h-4 w-4" }), _jsx(Input, { type: "search", placeholder: "Search...", className: "bg-background w-full rounded-lg pl-8 md:w-[200px] lg:w-[336px]", ...form.register(name), ...props })] }));
6
+ const { value = "", onChange, ...rest } = props;
7
+ const handleChange = (e) => {
8
+ onChange?.(e.target.value);
9
+ };
10
+ return (_jsxs("div", { className: "relative ml-auto flex-1 md:grow-0", children: [_jsx(Icons.search, { className: "text-muted-foreground absolute left-2.5 top-2.5 h-4 w-4" }), _jsx(Input, { type: "search", placeholder: "Search...", className: "bg-background w-full rounded-lg pl-8 md:w-[200px] lg:w-[336px]", ...rest, value: value, onChange: handleChange })] }));
10
11
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mtxuilib",
3
3
  "private": false,
4
- "version": "0.1.347",
4
+ "version": "0.1.349",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },