@ttoss/forms 0.17.8 → 0.17.10

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/esm/index.js CHANGED
@@ -255,6 +255,9 @@ var FormFieldRadio = ({
255
255
  ...sx
256
256
  },
257
257
  children: [label && /* @__PURE__ */jsx7(Label3, {
258
+ sx: {
259
+ marginBottom: "md"
260
+ },
258
261
  children: label
259
262
  }), /* @__PURE__ */jsx7(Box2, {
260
263
  children: options.map(option => {
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { FieldValues, FieldPath, FieldPathValue, UseControllerReturn } from 'rea
4
4
  export * from 'react-hook-form';
5
5
  import * as yup from 'yup';
6
6
  export { yup };
7
+ import * as react_jsx_runtime from 'react/jsx-runtime';
7
8
  import * as React from 'react';
8
9
  import { BoxProps, FlexProps, CheckboxProps, InputProps, InputPasswordProps, RadioProps, SelectProps, TextareaProps } from '@ttoss/ui';
9
10
 
@@ -13,7 +14,7 @@ declare const Form: <TFieldValues extends FieldValues = FieldValues>({ children,
13
14
  sx?: BoxProps['sx'];
14
15
  } & {
15
16
  children: React.ReactNode | React.ReactNode[];
16
- } & react_hook_form.UseFormReturn<TFieldValues, any>) => JSX.Element;
17
+ } & react_hook_form.UseFormReturn<TFieldValues, any>) => react_jsx_runtime.JSX.Element;
17
18
 
18
19
  type FormFieldProps = {
19
20
  sx?: FlexProps['sx'];
@@ -28,24 +29,24 @@ type FormFieldCompleteProps<TFieldValues extends FieldValues = FieldValues, TNam
28
29
  defaultValue?: FieldPathValue<TFieldValues, TName>;
29
30
  render: (props: UseControllerReturn<TFieldValues, TName>) => React.ReactElement;
30
31
  } & FormFieldProps;
31
- declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, id: idProp, name, defaultValue, sx, render, ...formFieldProps }: FormFieldCompleteProps<TFieldValues, TName>) => JSX.Element;
32
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, id: idProp, name, defaultValue, sx, render, ...formFieldProps }: FormFieldCompleteProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
32
33
 
33
34
  declare const FormFieldCheckbox: <TFieldValues extends FieldValues = FieldValues>({ label, name, sx, ...checkboxProps }: {
34
35
  label?: string | undefined;
35
36
  name: FieldPath<TFieldValues>;
36
- } & CheckboxProps) => JSX.Element;
37
+ } & CheckboxProps) => react_jsx_runtime.JSX.Element;
37
38
 
38
39
  type FormFieldInputProps<TName> = {
39
40
  label?: string;
40
41
  name: TName;
41
42
  } & InputProps & FormFieldProps;
42
- declare const FormFieldInput: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, name, tooltip, onTooltipClick, sx, defaultValue, ...inputProps }: FormFieldInputProps<TName>) => JSX.Element;
43
+ declare const FormFieldInput: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, name, tooltip, onTooltipClick, sx, defaultValue, ...inputProps }: FormFieldInputProps<TName>) => react_jsx_runtime.JSX.Element;
43
44
 
44
45
  type FormFieldPasswordProps<TName> = {
45
46
  label?: string;
46
47
  name: TName;
47
48
  } & InputPasswordProps & FormFieldProps;
48
- declare const FormFieldPassword: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, name, tooltip, onTooltipClick, sx, defaultValue, ...inputProps }: FormFieldPasswordProps<TName>) => JSX.Element;
49
+ declare const FormFieldPassword: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, name, tooltip, onTooltipClick, sx, defaultValue, ...inputProps }: FormFieldPasswordProps<TName>) => react_jsx_runtime.JSX.Element;
49
50
 
50
51
  type FormRadioOption$1 = {
51
52
  value: string | number;
@@ -55,7 +56,7 @@ declare const FormFieldRadio: <TFieldValues extends FieldValues = FieldValues>({
55
56
  label?: string | undefined;
56
57
  name: FieldPath<TFieldValues>;
57
58
  options: FormRadioOption$1[];
58
- } & RadioProps) => JSX.Element;
59
+ } & RadioProps) => react_jsx_runtime.JSX.Element;
59
60
 
60
61
  type FormRadioOption = {
61
62
  value: string | number;
@@ -72,12 +73,12 @@ type FormFieldSelectProps<TFieldValues extends FieldValues, TName extends FieldP
72
73
  options: FormRadioOption[];
73
74
  defaultValue?: FieldPathValue<TFieldValues, TName>;
74
75
  };
75
- declare const FormFieldSelect: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, name, options, sx, ...selectProps }: FormFieldSelectProps<TFieldValues, TName>) => JSX.Element;
76
+ declare const FormFieldSelect: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, name, options, sx, ...selectProps }: FormFieldSelectProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
76
77
 
77
78
  declare const FormFieldTextarea: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, name, sx, ...textareaProps }: {
78
79
  label?: string | undefined;
79
80
  name: TName;
80
- } & TextareaProps) => JSX.Element;
81
+ } & TextareaProps) => react_jsx_runtime.JSX.Element;
81
82
 
82
83
  declare const useFormGroup: () => {
83
84
  level: number | undefined;
@@ -87,6 +88,6 @@ type FormGroupProps = {
87
88
  title?: string;
88
89
  direction?: 'column' | 'row';
89
90
  } & BoxProps;
90
- declare const FormGroup: (props: FormGroupProps) => JSX.Element;
91
+ declare const FormGroup: (props: FormGroupProps) => react_jsx_runtime.JSX.Element;
91
92
 
92
93
  export { Form, FormField, FormFieldCheckbox, FormFieldInput, FormFieldPassword, FormFieldRadio, FormFieldSelect, FormFieldTextarea, FormGroup, useFormGroup };
package/dist/index.js CHANGED
@@ -307,6 +307,9 @@ var FormFieldRadio = ({
307
307
  ...sx
308
308
  },
309
309
  children: [label && /* @__PURE__ */(0, import_jsx_runtime7.jsx)(import_ui7.Label, {
310
+ sx: {
311
+ marginBottom: "md"
312
+ },
310
313
  children: label
311
314
  }), /* @__PURE__ */(0, import_jsx_runtime7.jsx)(import_ui7.Box, {
312
315
  children: options.map(option => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/forms",
3
- "version": "0.17.8",
3
+ "version": "0.17.10",
4
4
  "license": "UNLICENSED",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
25
- "@ttoss/ui": "^1.36.7"
25
+ "@ttoss/ui": "^1.36.9"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/jest": "^29.5.1",
29
- "@types/react": "^18.2.5",
29
+ "@types/react": "^18.2.6",
30
30
  "jest": "^29.5.0",
31
31
  "react": "^18.2.0",
32
32
  "react-hook-form": "^7.43.9",
@@ -34,8 +34,8 @@
34
34
  "tsup": "^6.7.0",
35
35
  "yup": "^1.1.1",
36
36
  "@ttoss/config": "^1.30.0",
37
- "@ttoss/test-utils": "^1.23.0",
38
- "@ttoss/ui": "^1.36.7"
37
+ "@ttoss/test-utils": "^1.23.1",
38
+ "@ttoss/ui": "^1.36.9"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -27,9 +27,9 @@ export const FormFieldRadio = <TFieldValues extends FieldValues = FieldValues>({
27
27
 
28
28
  return (
29
29
  <Flex sx={{ flexDirection: 'column', width: '100%', ...sx }}>
30
- {label && <Label>{label}</Label>}
30
+ {label && <Label sx={{ marginBottom: 'md' }}>{label}</Label>}
31
31
  <Box>
32
- {options.map((option) => {
32
+ {options.map((option: FormRadioOption) => {
33
33
  const id = `form-field-radio-${name}-${option.value}`;
34
34
 
35
35
  return (