@deftui/addons 0.2.1 → 0.2.3

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,9 +1,10 @@
1
- import { Options } from "./types.mjs";
1
+ import { OnValueChange, Options } from "./types.mjs";
2
2
  import { Combobox } from "@deftui/react";
3
3
  import { ComponentProps } from "react";
4
4
  type Props<V extends string> = {
5
5
  options: Options<V>;
6
6
  emptyLabel?: string;
7
+ onChange?: OnValueChange;
7
8
  } & Omit<ComponentProps<typeof Combobox>, "items" | "children"> & Pick<ComponentProps<typeof Combobox.Input>, "size" | "placeholder" | "showClear" | "className">;
8
9
  export declare function RHFCombobox<V extends string>(props: Props<V>): import("react").JSX.Element;
9
10
  export {};
@@ -5,6 +5,7 @@ function RHFCombobox(props) {
5
5
  const { options, size, placeholder, showClear, className, emptyLabel, ...rootProps } = props;
6
6
  return /* @__PURE__ */ jsxs(Combobox, {
7
7
  ...rootProps,
8
+ onValueChange: rootProps.onChange,
8
9
  items: options,
9
10
  children: [/* @__PURE__ */ jsx(Combobox.Input, {
10
11
  size,
@@ -1,8 +1,9 @@
1
- import { Options } from "./types.mjs";
1
+ import { OnValueChange, Options } from "./types.mjs";
2
2
  import { Select } from "@deftui/react";
3
3
  import { ComponentProps } from "react";
4
4
  type Props<V extends string> = {
5
5
  options: Options<V>;
6
+ onChange?: OnValueChange;
6
7
  } & Omit<ComponentProps<typeof Select>, "items" | "children"> & Pick<ComponentProps<typeof Select.Trigger>, "size" | "className"> & Pick<ComponentProps<typeof Select.Value>, "placeholder" | "className">;
7
8
  export declare function RHFSelect<V extends string>(props: Props<V>): import("react").JSX.Element;
8
9
  export {};
@@ -5,6 +5,7 @@ function RHFSelect(props) {
5
5
  const { options, size, placeholder, className, ...rootProps } = props;
6
6
  return /* @__PURE__ */ jsxs(Select, {
7
7
  ...rootProps,
8
+ onValueChange: rootProps.onChange,
8
9
  items: options,
9
10
  children: [/* @__PURE__ */ jsx(Select.Trigger, {
10
11
  size,
@@ -2,4 +2,5 @@ export type Options<V extends string> = readonly {
2
2
  label: string;
3
3
  value: V;
4
4
  disabled?: boolean;
5
- }[];
5
+ }[];
6
+ export type OnValueChange = ((value: unknown, eventDetails: unknown) => void) | undefined;
package/dist/router.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { NavigationGroup, NavigationItem, NavigationMeta, NavigationOptions } from "./tanstack-router/types.mjs";
2
1
  import { collectNavigation } from "./tanstack-router/collect.mjs";
2
+ import { NavigationGroup, NavigationItem, NavigationMeta, NavigationOptions } from "./tanstack-router/types.mjs";
3
3
  export { type NavigationGroup, type NavigationItem, type NavigationMeta, type NavigationOptions, collectNavigation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftui/addons",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/KiriRainCat/deftui.git",
@@ -40,16 +40,16 @@
40
40
  "fix": "vp check --fix"
41
41
  },
42
42
  "devDependencies": {
43
- "@deftui/react": "^0.2.1",
43
+ "@deftui/react": "^0.2.3",
44
44
  "@tanstack/react-router": "^1.170.46",
45
45
  "@types/react": "^19.3.0",
46
46
  "@types/react-dom": "^19.3.0",
47
- "lucide-react": "^1.66.0",
47
+ "lucide-react": "^1.70.0",
48
48
  "react-hook-form": "^7.91.0",
49
49
  "vite-plus": "catalog:"
50
50
  },
51
51
  "peerDependencies": {
52
- "@deftui/react": "^0.2.1",
52
+ "@deftui/react": "^0.2.3",
53
53
  "@tanstack/react-router": "^1.170.0",
54
54
  "react": "^19.0.0",
55
55
  "react-dom": "^19.0.0",