@ttoss/forms 0.31.11 → 0.31.12

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-HIARJN6N.js";
3
+ import { FormField, FormFieldCNPJ, FormFieldPatternFormat, __name, isCnpjValid } from "../chunk-6UITFJYC.js";
4
4
 
5
5
  // src/Brazil/FormFieldPhone.tsx
6
6
  import { Input } 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 { Form, __name, useForm, yupResolver } from "../chunk-HIARJN6N.js";
3
+ import { Form, __name, useForm, yupResolver } from "../chunk-6UITFJYC.js";
4
4
 
5
5
  // src/MultistepForm/MultistepForm.tsx
6
6
  import { Flex as Flex6 } from "@ttoss/ui";
@@ -544,6 +544,7 @@ var FormFieldRadioCard = /* @__PURE__ */__name(({
544
544
 
545
545
  // src/FormFieldRadioCardIcony.tsx
546
546
  import { Box as Box3, Flex as Flex4, Text as Text2 } from "@ttoss/ui";
547
+ import { Tag } from "@ttoss/ui";
547
548
  import * as React5 from "react";
548
549
  var FormFieldRadioCardIcony = /* @__PURE__ */__name(({
549
550
  label,
@@ -575,6 +576,7 @@ var FormFieldRadioCardIcony = /* @__PURE__ */__name(({
575
576
  const key = `form-field-radio-card-${name}-${option.value}`;
576
577
  const isSelected = field.value === option.value;
577
578
  const IconComponent = option.icon;
579
+ const tag = option.tag;
578
580
  return /* @__PURE__ */React5.createElement(Box3, {
579
581
  key,
580
582
  onClick: /* @__PURE__ */__name(() => {
@@ -586,7 +588,7 @@ var FormFieldRadioCardIcony = /* @__PURE__ */__name(({
586
588
  border: isSelected ? "lg" : "md",
587
589
  borderColor: isSelected ? "input.background.accent.default" : "input.border.muted.default",
588
590
  borderRadius: "md",
589
- backgroundColor: "transparent",
591
+ backgroundColor: isSelected ? "feedback.background.positive.default" : "transparent",
590
592
  display: "flex",
591
593
  flexDirection: "column",
592
594
  alignItems: "center",
@@ -618,7 +620,15 @@ var FormFieldRadioCardIcony = /* @__PURE__ */__name(({
618
620
  fontSize: "md",
619
621
  color: "text.secondary"
620
622
  }
621
- }, option.description)));
623
+ }, option.description)), tag?.label && /* @__PURE__ */React5.createElement(Tag, {
624
+ variant: tag?.variant,
625
+ sx: {
626
+ px: "3",
627
+ mt: "2",
628
+ fontWeight: "semibold",
629
+ fontSize: "sm"
630
+ }
631
+ }, tag.label));
622
632
  }));
623
633
  }, "render")
624
634
  });
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
- import { 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 } from "./chunk-HIARJN6N.js";
2
+ import { 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 } from "./chunk-6UITFJYC.js";
3
3
  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
@@ -125,6 +125,10 @@ type FormRadioOption = {
125
125
  size?: number;
126
126
  className?: string;
127
127
  }>;
128
+ tag?: {
129
+ label: string;
130
+ variant?: 'accent' | 'positive' | 'caution' | 'muted' | 'negative' | 'primary' | 'secondary' | 'default';
131
+ };
128
132
  };
129
133
  declare const FormFieldRadioCardIcony: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, name, direction, width, sx, options, tooltip, }: {
130
134
  options: FormRadioOption[];
@@ -162,4 +166,4 @@ type FormGroupProps = {
162
166
  } & BoxProps;
163
167
  declare const FormGroup: (props: FormGroupProps) => react_jsx_runtime.JSX.Element;
164
168
 
165
- export { Form, FormErrorMessage, FormField, FormFieldCheckbox, FormFieldCreditCardNumber, FormFieldCurrencyInput, FormFieldInput, FormFieldNumericFormat, FormFieldPassword, FormFieldRadio, FormFieldRadioCard, FormFieldRadioCardIcony, FormFieldSelect, FormFieldSwitch, FormFieldTextarea, FormGroup, useFormGroup };
169
+ export { Form, FormErrorMessage, FormField, FormFieldCheckbox, FormFieldCreditCardNumber, FormFieldCurrencyInput, FormFieldInput, FormFieldNumericFormat, FormFieldPassword, FormFieldRadio, FormFieldRadioCard, FormFieldRadioCardIcony, FormFieldSelect, FormFieldSwitch, FormFieldTextarea, FormGroup, type FormRadioOption, useFormGroup };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/forms",
3
- "version": "0.31.11",
3
+ "version": "0.31.12",
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.19",
43
- "@ttoss/ui": "^5.10.4"
43
+ "@ttoss/ui": "^5.10.5"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/jest": "^30.0.0",
@@ -51,11 +51,11 @@
51
51
  "tsup": "^8.5.0",
52
52
  "yup": "^1.6.1",
53
53
  "@ttoss/config": "^1.35.9",
54
+ "@ttoss/i18n-cli": "^0.7.35",
54
55
  "@ttoss/react-i18n": "^2.0.19",
55
- "@ttoss/test-utils": "^3.0.1",
56
56
  "@ttoss/react-icons": "^0.5.0",
57
- "@ttoss/ui": "^5.10.4",
58
- "@ttoss/i18n-cli": "^0.7.35"
57
+ "@ttoss/test-utils": "^3.0.1",
58
+ "@ttoss/ui": "^5.10.5"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public",