@scaleflex/ui-tw 0.0.7 → 0.0.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/form/form.types.d.ts +8 -8
- package/form/index.d.ts +1 -0
- package/form/index.js +2 -1
- package/label/label.types.d.ts +1 -1
- package/package.json +2 -2
- /package/form/components/{form-field-input.component.d.ts → form-input-field.component.d.ts} +0 -0
- /package/form/components/{form-field-input.component.js → form-input-field.component.js} +0 -0
package/form/form.types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { FormMessageSize, SwitchLayout } from '@scaleflex/ui-tw/form/form.consta
|
|
|
2
2
|
import { InputProps } from '@scaleflex/ui-tw/input';
|
|
3
3
|
import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
|
|
4
4
|
import type { Values } from '@scaleflex/ui-tw/types/values';
|
|
5
|
-
import { ReactNode } from 'react';
|
|
5
|
+
import { ReactElement, ReactNode } from 'react';
|
|
6
6
|
import { ControllerRenderProps, type FieldPath, FieldValues, Path, UseControllerProps } from 'react-hook-form';
|
|
7
7
|
export type FormMessageSizeType = Values<typeof FormMessageSize>;
|
|
8
8
|
export type SwitchLayoutType = Values<typeof SwitchLayout>;
|
|
@@ -18,23 +18,23 @@ export interface FormFieldArgs {
|
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export interface FormFieldGroupProps<TFieldValues extends FieldValues, TName extends Path<TFieldValues>> extends UseControllerProps<TFieldValues, TName> {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
children: (field: ControllerRenderProps<TFieldValues, TName>, args?: FormFieldArgs) => ReactNode;
|
|
22
|
+
label?: ReactElement | string;
|
|
23
|
+
description?: ReactElement | string;
|
|
24
|
+
tooltip?: ReactElement | string;
|
|
24
25
|
size?: FormSizeType;
|
|
25
26
|
readOnly?: boolean;
|
|
26
27
|
highlight?: boolean;
|
|
27
28
|
horizontal?: boolean;
|
|
28
29
|
horizontalLabelWidth?: string;
|
|
29
|
-
children: (field: ControllerRenderProps<TFieldValues, TName>, args?: FormFieldArgs) => ReactNode;
|
|
30
30
|
}
|
|
31
31
|
export interface FormSwitchFieldProps<TFieldValues extends FieldValues, TName extends Path<TFieldValues>> extends UseControllerProps<TFieldValues, TName> {
|
|
32
|
-
label: string;
|
|
32
|
+
label: ReactElement | string;
|
|
33
33
|
size?: FormSizeType;
|
|
34
|
-
description?: string;
|
|
34
|
+
description?: ReactElement | string;
|
|
35
35
|
disabled?: boolean;
|
|
36
36
|
layout?: SwitchLayoutType;
|
|
37
|
-
tooltip?: string;
|
|
37
|
+
tooltip?: ReactElement | string;
|
|
38
38
|
}
|
|
39
39
|
export type FormInputFieldProps<TFieldValues extends FieldValues, TName extends Path<TFieldValues>> = Omit<FormFieldGroupProps<TFieldValues, TName>, 'children'> & {
|
|
40
40
|
inputProps?: InputProps;
|
package/form/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, useFormField, } from './form.component';
|
|
2
2
|
export { FormFieldGroup } from './components/form-field-group.component';
|
|
3
3
|
export { FormSwitchField } from './components/form-switch-field.component';
|
|
4
|
+
export { FormInputField } from './components/form-input-field.component';
|
package/form/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, useFormField } from './form.component';
|
|
2
2
|
export { FormFieldGroup } from './components/form-field-group.component';
|
|
3
|
-
export { FormSwitchField } from './components/form-switch-field.component';
|
|
3
|
+
export { FormSwitchField } from './components/form-switch-field.component';
|
|
4
|
+
export { FormInputField } from './components/form-input-field.component';
|
package/label/label.types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ComponentProps, ReactElement } from 'react';
|
|
|
4
4
|
export interface LabelProps extends Omit<ComponentProps<typeof LabelPrimitive.Root>, 'size'> {
|
|
5
5
|
size?: FormSizeType;
|
|
6
6
|
icon?: ReactElement;
|
|
7
|
-
tooltip?: string;
|
|
7
|
+
tooltip?: ReactElement | string;
|
|
8
8
|
}
|
|
9
9
|
export interface LabelIconProps extends ComponentProps<'span'>, Pick<LabelProps, 'size' | 'tooltip'> {
|
|
10
10
|
icon?: ReactElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/ui-tw",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"author": "scaleflex",
|
|
5
5
|
"repository": "github:scaleflex/ui",
|
|
6
6
|
"homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@radix-ui/react-slot": "^1.1.2",
|
|
18
18
|
"@radix-ui/react-switch": "^1.0.1",
|
|
19
19
|
"@radix-ui/react-tooltip": "^1.2.6",
|
|
20
|
-
"@scaleflex/icons-tw": "^0.0.
|
|
20
|
+
"@scaleflex/icons-tw": "^0.0.9",
|
|
21
21
|
"@types/lodash.merge": "^4.6.9",
|
|
22
22
|
"class-variance-authority": "^0.7.1",
|
|
23
23
|
"lodash.merge": "^4.6.2",
|
/package/form/components/{form-field-input.component.d.ts → form-input-field.component.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|