@ttoss/forms 0.33.3 → 0.33.4

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,6 +1,6 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import * as React from 'react';
3
- import { FormField, FormFieldCNPJ, FormFieldPatternFormat, __name, isCnpjValid } from "../chunk-LSSFZMBY.js";
3
+ import { FormField, FormFieldCNPJ, FormFieldPatternFormat, __name, isCnpjValid } from "../chunk-TS4CHDPS.js";
4
4
 
5
5
  // src/Brazil/FormFieldPhone.tsx
6
6
  import { Input } from "@ttoss/ui";
@@ -1,7 +1,7 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import * as React from 'react';
3
- import { Form, useForm, yupResolver } from "../chunk-EOMFHI2R.js";
4
- import { __name } from "../chunk-LSSFZMBY.js";
3
+ import { Form, useForm, yupResolver } from "../chunk-LTFTNMQO.js";
4
+ import { __name } from "../chunk-TS4CHDPS.js";
5
5
 
6
6
  // src/MultistepForm/MultistepForm.tsx
7
7
  import { Flex as Flex6 } from "@ttoss/ui";
@@ -1,6 +1,6 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import * as React from 'react';
3
- import { FormErrorMessage, FormField, FormFieldPatternFormat, __name, isCnpjValid } from "./chunk-LSSFZMBY.js";
3
+ import { FormErrorMessage, FormField, FormFieldPatternFormat, __name, isCnpjValid } from "./chunk-TS4CHDPS.js";
4
4
 
5
5
  // src/Form.tsx
6
6
  import { Box } from "@ttoss/ui";
@@ -102,20 +102,20 @@ var FormField = /* @__PURE__ */__name(({
102
102
  })
103
103
  };
104
104
  if (label && isCheckboxOrSwitch(child)) {
105
- return /* @__PURE__ */React2.createElement(Flex, {
105
+ return /* @__PURE__ */React2.createElement(Label, {
106
+ "aria-disabled": disabled,
107
+ htmlFor: id,
108
+ tooltip: labelTooltip,
106
109
  sx: {
107
110
  flexDirection: "row",
108
- alignItems: "center"
111
+ alignItems: "center",
112
+ cursor: disabled ? "not-allowed" : "pointer"
109
113
  }
110
114
  }, /* @__PURE__ */React2.createElement(Flex, {
111
115
  sx: {
112
116
  position: "relative"
113
117
  }
114
- }, /* @__PURE__ */React2.cloneElement(child, mergeProps)), /* @__PURE__ */React2.createElement(Label, {
115
- "aria-disabled": disabled,
116
- htmlFor: id,
117
- tooltip: labelTooltip
118
- }, label));
118
+ }, /* @__PURE__ */React2.cloneElement(child, mergeProps)), label);
119
119
  }
120
120
  return /* @__PURE__ */React2.createElement(Flex, {
121
121
  sx: {
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
- import { Controller, Form, FormFieldCheckbox, FormFieldCreditCardNumber, FormFieldCurrencyInput, FormFieldInput, FormFieldNumericFormat, FormFieldPassword, FormFieldRadio, FormFieldRadioCard, FormFieldRadioCardIcony, FormFieldSelect, FormFieldSwitch, FormFieldTextarea, FormGroup, FormProvider, useController, useFieldArray, useForm, useFormContext, useFormGroup, useFormState, useWatch, yup, yupResolver } from "./chunk-EOMFHI2R.js";
3
- import { FormErrorMessage, FormField, FormFieldPatternFormat } from "./chunk-LSSFZMBY.js";
2
+ import { Controller, Form, FormFieldCheckbox, FormFieldCreditCardNumber, FormFieldCurrencyInput, FormFieldInput, FormFieldNumericFormat, FormFieldPassword, FormFieldRadio, FormFieldRadioCard, FormFieldRadioCardIcony, FormFieldSelect, FormFieldSwitch, FormFieldTextarea, FormGroup, FormProvider, useController, useFieldArray, useForm, useFormContext, useFormGroup, useFormState, useWatch, yup, yupResolver } from "./chunk-LTFTNMQO.js";
3
+ import { FormErrorMessage, FormField, FormFieldPatternFormat } from "./chunk-TS4CHDPS.js";
4
4
  export { Controller, Form, FormErrorMessage, FormField, FormFieldCheckbox, FormFieldCreditCardNumber, FormFieldCurrencyInput, FormFieldInput, FormFieldNumericFormat, FormFieldPassword, FormFieldPatternFormat, FormFieldRadio, FormFieldRadioCard, FormFieldRadioCardIcony, FormFieldSelect, FormFieldSwitch, FormFieldTextarea, FormGroup, FormProvider, useController, useFieldArray, useForm, useFormContext, useFormGroup, useFormState, useWatch, yup, yupResolver };
package/dist/index.d.ts CHANGED
@@ -23,7 +23,9 @@ declare const FormErrorMessage: <TFieldValues extends FieldValues = FieldValues>
23
23
  disabled?: boolean;
24
24
  }) => react_jsx_runtime.JSX.Element;
25
25
 
26
- type FormFieldCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = FormFieldProps<TFieldValues, TName> & Omit<CheckboxProps, 'name'>;
26
+ type FormFieldCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<FormFieldProps<TFieldValues, TName>, 'defaultValue'> & Omit<CheckboxProps, 'name' | 'defaultValue'> & {
27
+ defaultValue?: boolean;
28
+ };
27
29
  declare const FormFieldCheckbox: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ defaultValue, disabled, ...props }: FormFieldCheckboxProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
28
30
 
29
31
  type FormFieldCreditCardNumberProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = FormFieldPatternFormatProps<TFieldValues, TName>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/forms",
3
- "version": "0.33.3",
3
+ "version": "0.33.4",
4
4
  "license": "MIT",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -40,7 +40,7 @@
40
40
  "peerDependencies": {
41
41
  "react": ">=16.8.0",
42
42
  "@ttoss/react-i18n": "^2.0.24",
43
- "@ttoss/ui": "^6.0.3"
43
+ "@ttoss/ui": "^6.0.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/jest": "^30.0.0",
@@ -52,10 +52,10 @@
52
52
  "yup": "^1.7.1",
53
53
  "@ttoss/config": "^1.35.12",
54
54
  "@ttoss/i18n-cli": "^0.7.38",
55
+ "@ttoss/react-i18n": "^2.0.24",
55
56
  "@ttoss/react-icons": "^0.5.5",
56
57
  "@ttoss/test-utils": "^4.0.1",
57
- "@ttoss/react-i18n": "^2.0.24",
58
- "@ttoss/ui": "^6.0.3"
58
+ "@ttoss/ui": "^6.0.4"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public",