@ttoss/forms 0.14.17 → 0.14.19

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
@@ -35,8 +35,8 @@ import { Box as Box2, Label } from "@ttoss/ui";
35
35
 
36
36
  // src/ErrorMessage.tsx
37
37
  import { useFormContext } from "react-hook-form";
38
+ import { HelpText } from "@ttoss/ui";
38
39
  import { ErrorMessage as HookFormErrorMessage } from "@hookform/error-message";
39
- import { Text } from "@ttoss/ui";
40
40
  import { jsx as jsx2 } from "react/jsx-runtime";
41
41
  var ErrorMessage = ({
42
42
  name
@@ -49,13 +49,8 @@ var ErrorMessage = ({
49
49
  return /* @__PURE__ */jsx2(HookFormErrorMessage, {
50
50
  errors,
51
51
  name,
52
- as: /* @__PURE__ */jsx2(Text, {
53
- variant: "text.error",
54
- role: "alert",
55
- sx: {
56
- fontFamily: "caption",
57
- fontSize: "xs"
58
- }
52
+ as: /* @__PURE__ */jsx2(HelpText, {
53
+ negative: true
59
54
  })
60
55
  });
61
56
  };
@@ -139,7 +134,7 @@ var FormFieldCheckbox = ({
139
134
  };
140
135
 
141
136
  // src/FormFieldInput.tsx
142
- import { Box as Box4, Icon, Input, Label as Label3, Text as Text2 } from "@ttoss/ui";
137
+ import { Box as Box4, Icon, Input, Label as Label3, Text } from "@ttoss/ui";
143
138
  import { useController as useController3 } from "react-hook-form";
144
139
  import React3 from "react";
145
140
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
@@ -180,7 +175,7 @@ var FormFieldInput = ({
180
175
  },
181
176
  "aria-disabled": inputProps.disabled,
182
177
  htmlFor: id,
183
- children: [label, tooltipIcon && /* @__PURE__ */jsx5(Text2, {
178
+ children: [label, tooltipIcon && /* @__PURE__ */jsx5(Text, {
184
179
  sx: {
185
180
  marginLeft: "md",
186
181
  fontSize: "xs",
@@ -190,7 +185,7 @@ var FormFieldInput = ({
190
185
  children: /* @__PURE__ */jsx5(Icon, {
191
186
  icon: tooltipIcon
192
187
  })
193
- }), showCharacterCounter && /* @__PURE__ */jsx5(Text2, {
188
+ }), showCharacterCounter && /* @__PURE__ */jsx5(Text, {
194
189
  sx: {
195
190
  marginLeft: "auto",
196
191
  fontSize: "xs",
package/dist/index.js CHANGED
@@ -84,8 +84,8 @@ var import_ui3 = require("@ttoss/ui");
84
84
 
85
85
  // src/ErrorMessage.tsx
86
86
  var import_react_hook_form2 = require("react-hook-form");
87
- var import_error_message = require("@hookform/error-message");
88
87
  var import_ui2 = require("@ttoss/ui");
88
+ var import_error_message = require("@hookform/error-message");
89
89
  var import_jsx_runtime2 = require("react/jsx-runtime");
90
90
  var ErrorMessage = ({
91
91
  name
@@ -98,13 +98,8 @@ var ErrorMessage = ({
98
98
  return /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_error_message.ErrorMessage, {
99
99
  errors,
100
100
  name,
101
- as: /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.Text, {
102
- variant: "text.error",
103
- role: "alert",
104
- sx: {
105
- fontFamily: "caption",
106
- fontSize: "xs"
107
- }
101
+ as: /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_ui2.HelpText, {
102
+ negative: true
108
103
  })
109
104
  });
110
105
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/forms",
3
- "version": "0.14.17",
3
+ "version": "0.14.19",
4
4
  "license": "UNLICENSED",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -31,7 +31,7 @@
31
31
  "devDependencies": {
32
32
  "@ttoss/config": "^1.29.2",
33
33
  "@ttoss/test-utils": "^1.20.9",
34
- "@ttoss/ui": "^1.31.4",
34
+ "@ttoss/ui": "^1.31.6",
35
35
  "@types/jest": "^29.5.0",
36
36
  "jest": "^29.5.0",
37
37
  "react": "^18.2.0",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "f26363085030df7edfb2bcbf44aefed304d2b328"
44
+ "gitHead": "ce34db105b7f475a90660d77b194d6ea33b71960"
45
45
  }
@@ -1,6 +1,6 @@
1
1
  import { FieldName, FieldValues, useFormContext } from 'react-hook-form';
2
+ import { HelpText } from '@ttoss/ui';
2
3
  import { ErrorMessage as HookFormErrorMessage } from '@hookform/error-message';
3
- import { Text } from '@ttoss/ui';
4
4
 
5
5
  export const ErrorMessage = <TFieldValues extends FieldValues = FieldValues>({
6
6
  name,
@@ -15,13 +15,7 @@ export const ErrorMessage = <TFieldValues extends FieldValues = FieldValues>({
15
15
  <HookFormErrorMessage
16
16
  errors={errors}
17
17
  name={name as any}
18
- as={
19
- <Text
20
- variant="text.error"
21
- role="alert"
22
- sx={{ fontFamily: 'caption', fontSize: 'xs' }}
23
- />
24
- }
18
+ as={<HelpText negative />}
25
19
  />
26
20
  );
27
21
  };