soda-heroui 0.7.7 → 0.7.9
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/components/FormCheckbox.d.ts +7 -7
- package/dist/components/FormCheckboxGroup.d.ts +7 -7
- package/dist/components/FormInput.d.ts +7 -7
- package/dist/components/FormInputOtp.d.ts +7 -7
- package/dist/components/FormNumberInput.d.ts +7 -7
- package/dist/components/FormPagination.d.ts +7 -7
- package/dist/components/FormRadioGroup.d.ts +7 -7
- package/dist/components/FormSwitch.d.ts +7 -7
- package/dist/components/FormTextarea.d.ts +7 -7
- package/package.json +4 -4
- package/src/components/FormCheckbox.tsx +13 -8
- package/src/components/FormCheckboxGroup.tsx +21 -9
- package/src/components/FormInput.tsx +18 -8
- package/src/components/FormInputOtp.tsx +21 -9
- package/src/components/FormNumberInput.tsx +21 -9
- package/src/components/FormPagination.tsx +21 -9
- package/src/components/FormRadioGroup.tsx +21 -9
- package/src/components/FormSwitch.tsx +14 -9
- package/src/components/FormTextarea.tsx +21 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormCheckbox<FieldValue extends boolean | null | undefined = boolean | null | undefined>({ field, ...rest }: FormCheckboxProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, CheckboxProps, MergeWithAs } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormCheckboxProps<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, CheckboxProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormCheckbox<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input">({ field, ...rest }: FormCheckboxProps<FieldValue, AsComponent>): ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormCheckboxGroup<FieldValue extends string[] | null | undefined = string[] | null | undefined>({ field, ...rest }: FormCheckboxGroupProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, CheckboxGroupProps, MergeWithAs } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormCheckboxGroupProps<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div"> = MergeWithAs<ComponentPropsWithoutRef<"div">, ComponentPropsWithoutRef<AsComponent>, CheckboxGroupProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormCheckboxGroup<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div">({ field, ...rest }: FormCheckboxGroupProps<FieldValue, AsComponent>): ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormInput<FieldValue extends string | null | undefined = string | null | undefined>({ field, ...rest }: FormInputProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, InputProps, MergeWithAs } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormInputProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, InputProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormInput<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input">({ field, ...rest }: FormInputProps<FieldValue, AsComponent>): ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormInputOtp<FieldValue extends string | null | undefined = string | null | undefined>({ field, ...rest }: FormInputOtpProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, InputOtpProps, MergeWithAs } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormInputOtpProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, InputOtpProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormInputOtp<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input">({ field, ...rest }: FormInputOtpProps<FieldValue, AsComponent>): ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormNumberInput<FieldValue extends number | null | undefined = number | null | undefined>({ field, ...rest }: FormNumberInputProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, MergeWithAs, NumberInputProps } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormNumberInputProps<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, NumberInputProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormNumberInput<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "input">({ field, ...rest }: FormNumberInputProps<FieldValue, AsComponent>): ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormPagination<FieldValue extends number | null | undefined = number | null | undefined>({ field, ...rest }: FormPaginationProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, MergeWithAs, PaginationProps } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormPaginationProps<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "nav"> = MergeWithAs<ComponentPropsWithoutRef<"nav">, ComponentPropsWithoutRef<AsComponent>, PaginationProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormPagination<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "nav">({ field, ...rest }: FormPaginationProps<FieldValue, AsComponent>): ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormRadioGroup<FieldValue extends string | null | undefined = string | null | undefined>({ field, ...rest }: FormRadioGroupProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, MergeWithAs, RadioGroupProps } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormRadioGroupProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "div"> = MergeWithAs<ComponentPropsWithoutRef<"div">, ComponentPropsWithoutRef<AsComponent>, RadioGroupProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormRadioGroup<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "div">({ field, ...rest }: FormRadioGroupProps<FieldValue, AsComponent>): ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormSwitch<FieldValue extends boolean | null | undefined = boolean | null | undefined>({ field, ...rest }: FormSwitchProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, MergeWithAs, SwitchProps } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormSwitchProps<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, SwitchProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormSwitch<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input">({ field, ...rest }: FormSwitchProps<FieldValue, AsComponent>): ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare function FormTextarea<FieldValue extends string | null | undefined = string | null | undefined>({ field, ...rest }: FormTextareaProps<FieldValue>): ReactNode;
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, MergeWithAs, TextAreaProps } from "@heroui/react";
|
|
3
|
+
import { Field } from "soda-tanstack-form";
|
|
4
|
+
export type FormTextareaProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "textarea"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, TextAreaProps, AsComponent> & {
|
|
5
|
+
field: Field<FieldValue>;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormTextarea<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "textarea">({ field, ...rest }: FormTextareaProps<FieldValue, AsComponent>): ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soda-heroui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@internationalized/date": "^3.7.0",
|
|
39
39
|
"@tanstack/react-form": "^1.3.0",
|
|
40
|
+
"deepsea-tools": "5.37.0",
|
|
40
41
|
"soda-type": "6.3.0",
|
|
41
|
-
"soda-
|
|
42
|
-
"soda-
|
|
43
|
-
"deepsea-tools": "5.36.0"
|
|
42
|
+
"soda-hooks": "6.10.11",
|
|
43
|
+
"soda-tanstack-form": "0.2.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { Checkbox } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, Checkbox, CheckboxProps, MergeWithAs } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormCheckboxProps<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"input">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
CheckboxProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormCheckbox<FieldValue extends boolean | null | undefined = boolean | null | undefined>({
|
|
18
|
+
export function FormCheckbox<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input">({
|
|
14
19
|
field,
|
|
15
20
|
...rest
|
|
16
|
-
}: FormCheckboxProps<FieldValue>): ReactNode {
|
|
21
|
+
}: FormCheckboxProps<FieldValue, AsComponent>): ReactNode {
|
|
17
22
|
return (
|
|
18
23
|
<Checkbox
|
|
19
24
|
isSelected={field.state.value ?? false}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { CheckboxGroup } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, CheckboxGroup, CheckboxGroupProps, MergeWithAs } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormCheckboxGroupProps<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"div">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
CheckboxGroupProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormCheckboxGroup<FieldValue extends string[] | null | undefined = string[] | null | undefined>({
|
|
18
|
+
export function FormCheckboxGroup<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div">({
|
|
14
19
|
field,
|
|
15
20
|
...rest
|
|
16
|
-
}: FormCheckboxGroupProps<FieldValue>): ReactNode {
|
|
17
|
-
return
|
|
21
|
+
}: FormCheckboxGroupProps<FieldValue, AsComponent>): ReactNode {
|
|
22
|
+
return (
|
|
23
|
+
<CheckboxGroup<AsComponent>
|
|
24
|
+
value={field.state.value ?? []}
|
|
25
|
+
onValueChange={field.handleChange as (value: string[]) => void}
|
|
26
|
+
{...getFieldProps(field)}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
18
30
|
}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { Input } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, Input, InputProps, MergeWithAs } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormInputProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"input">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
InputProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormInput<FieldValue extends string | null | undefined = string | null | undefined
|
|
14
|
-
|
|
18
|
+
export function FormInput<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input">({
|
|
19
|
+
field,
|
|
20
|
+
...rest
|
|
21
|
+
}: FormInputProps<FieldValue, AsComponent>): ReactNode {
|
|
22
|
+
return (
|
|
23
|
+
<Input<AsComponent> value={field.state.value ?? ""} onValueChange={field.handleChange as (value: string) => void} {...getFieldProps(field)} {...rest} />
|
|
24
|
+
)
|
|
15
25
|
}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { InputOtp } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, InputOtp, InputOtpProps, MergeWithAs } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormInputOtpProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"input">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
InputOtpProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormInputOtp<FieldValue extends string | null | undefined = string | null | undefined>({
|
|
18
|
+
export function FormInputOtp<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input">({
|
|
14
19
|
field,
|
|
15
20
|
...rest
|
|
16
|
-
}: FormInputOtpProps<FieldValue>): ReactNode {
|
|
17
|
-
return
|
|
21
|
+
}: FormInputOtpProps<FieldValue, AsComponent>): ReactNode {
|
|
22
|
+
return (
|
|
23
|
+
<InputOtp<AsComponent>
|
|
24
|
+
value={field.state.value ?? ""}
|
|
25
|
+
onValueChange={field.handleChange as (value: string) => void}
|
|
26
|
+
{...getFieldProps(field)}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
18
30
|
}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { NumberInput } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, MergeWithAs, NumberInput, NumberInputProps } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormNumberInputProps<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "input"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"input">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
NumberInputProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormNumberInput<FieldValue extends number | null | undefined = number | null | undefined>({
|
|
18
|
+
export function FormNumberInput<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "input">({
|
|
14
19
|
field,
|
|
15
20
|
...rest
|
|
16
|
-
}: FormNumberInputProps<FieldValue>): ReactNode {
|
|
17
|
-
return
|
|
21
|
+
}: FormNumberInputProps<FieldValue, AsComponent>): ReactNode {
|
|
22
|
+
return (
|
|
23
|
+
<NumberInput<AsComponent>
|
|
24
|
+
value={field.state.value ?? 0}
|
|
25
|
+
onValueChange={field.handleChange as (value: number) => void}
|
|
26
|
+
{...getFieldProps(field)}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
18
30
|
}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { Pagination } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, MergeWithAs, Pagination, PaginationProps } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormPaginationProps<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "nav"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"nav">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
PaginationProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormPagination<FieldValue extends number | null | undefined = number | null | undefined>({
|
|
18
|
+
export function FormPagination<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "nav">({
|
|
14
19
|
field,
|
|
15
20
|
...rest
|
|
16
|
-
}: FormPaginationProps<FieldValue>): ReactNode {
|
|
17
|
-
return
|
|
21
|
+
}: FormPaginationProps<FieldValue, AsComponent>): ReactNode {
|
|
22
|
+
return (
|
|
23
|
+
<Pagination<AsComponent>
|
|
24
|
+
page={field.state.value ?? 1}
|
|
25
|
+
onPageChange={field.handleChange as (value: number) => void as any}
|
|
26
|
+
{...getFieldProps(field, true)}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
18
30
|
}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { RadioGroup } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, MergeWithAs, RadioGroup, RadioGroupProps } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormRadioGroupProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "div"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"div">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
RadioGroupProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormRadioGroup<FieldValue extends string | null | undefined = string | null | undefined>({
|
|
18
|
+
export function FormRadioGroup<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "div">({
|
|
14
19
|
field,
|
|
15
20
|
...rest
|
|
16
|
-
}: FormRadioGroupProps<FieldValue>): ReactNode {
|
|
17
|
-
return
|
|
21
|
+
}: FormRadioGroupProps<FieldValue, AsComponent>): ReactNode {
|
|
22
|
+
return (
|
|
23
|
+
<RadioGroup<AsComponent>
|
|
24
|
+
value={field.state.value ?? ""}
|
|
25
|
+
onValueChange={field.handleChange as (value: string) => void}
|
|
26
|
+
{...getFieldProps(field)}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
18
30
|
}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { Switch } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, MergeWithAs, Switch, SwitchProps } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormSwitchProps<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"input">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
SwitchProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormSwitch<FieldValue extends boolean | null | undefined = boolean | null | undefined>({
|
|
18
|
+
export function FormSwitch<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input">({
|
|
14
19
|
field,
|
|
15
20
|
...rest
|
|
16
|
-
}: FormSwitchProps<FieldValue>): ReactNode {
|
|
21
|
+
}: FormSwitchProps<FieldValue, AsComponent>): ReactNode {
|
|
17
22
|
return (
|
|
18
|
-
<Switch
|
|
23
|
+
<Switch<AsComponent>
|
|
19
24
|
isSelected={field.state.value ?? false}
|
|
20
25
|
onValueChange={field.handleChange as (value: boolean) => void}
|
|
21
26
|
{...getFieldProps(field, true)}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from "react"
|
|
4
|
-
import { Textarea } from "@heroui/react"
|
|
5
|
-
import {
|
|
6
|
-
import { StrictOmit } from "soda-type"
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react"
|
|
4
|
+
import { As, MergeWithAs, TextAreaProps, Textarea } from "@heroui/react"
|
|
5
|
+
import { Field } from "soda-tanstack-form"
|
|
7
6
|
|
|
8
7
|
import { getFieldProps } from "../utils/getFieldProps"
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
|
|
9
|
+
export type FormTextareaProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "textarea"> = MergeWithAs<
|
|
10
|
+
ComponentPropsWithoutRef<"input">,
|
|
11
|
+
ComponentPropsWithoutRef<AsComponent>,
|
|
12
|
+
TextAreaProps,
|
|
13
|
+
AsComponent
|
|
14
|
+
> & {
|
|
15
|
+
field: Field<FieldValue>
|
|
16
|
+
}
|
|
12
17
|
|
|
13
|
-
export function FormTextarea<FieldValue extends string | null | undefined = string | null | undefined>({
|
|
18
|
+
export function FormTextarea<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "textarea">({
|
|
14
19
|
field,
|
|
15
20
|
...rest
|
|
16
|
-
}: FormTextareaProps<FieldValue>): ReactNode {
|
|
17
|
-
return
|
|
21
|
+
}: FormTextareaProps<FieldValue, AsComponent>): ReactNode {
|
|
22
|
+
return (
|
|
23
|
+
<Textarea<AsComponent>
|
|
24
|
+
value={field.state.value ?? ""}
|
|
25
|
+
onValueChange={field.handleChange as (value: string) => void}
|
|
26
|
+
{...getFieldProps(field)}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
18
30
|
}
|