@lets-events/react 11.7.5 → 11.7.7

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
 
2
2
 
3
- > @lets-events/react@11.7.5 build
3
+ > @lets-events/react@11.7.7 build
4
4
  > tsup src/index.tsx --format esm,cjs --dts --external react
5
5
 
6
6
  CLI Building entry: src/index.tsx
@@ -9,12 +9,12 @@
9
9
  CLI Target: es6
10
10
  ESM Build start
11
11
  CJS Build start
12
- ESM dist/index.mjs 319.89 KB
13
- ESM ⚡️ Build success in 375ms
14
- CJS dist/index.js 332.01 KB
15
- CJS ⚡️ Build success in 375ms
12
+ ESM dist/index.mjs 321.38 KB
13
+ ESM ⚡️ Build success in 276ms
14
+ CJS dist/index.js 333.60 KB
15
+ CJS ⚡️ Build success in 277ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 6308ms
18
- DTS dist/index.d.mts 374.48 KB
19
- DTS dist/index.d.ts 374.48 KB
17
+ DTS ⚡️ Build success in 4801ms
18
+ DTS dist/index.d.mts 374.51 KB
19
+ DTS dist/index.d.ts 374.51 KB
20
20
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 11.7.7
4
+
5
+ ### Patch Changes
6
+
7
+ - BirthdateForm Validation
8
+
9
+ ## 11.7.6
10
+
11
+ ### Patch Changes
12
+
13
+ - maxLength to TextField
14
+
3
15
  ## 11.7.5
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -2685,6 +2685,7 @@ type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
2685
2685
  children?: React__default.ReactNode;
2686
2686
  isValid?: boolean;
2687
2687
  name?: string;
2688
+ maxLength?: number;
2688
2689
  typography?: string;
2689
2690
  fontWeight?: "regular" | "medium" | "semibold" | "bold";
2690
2691
  textAlign?: "left" | "right" | "center";
package/dist/index.d.ts CHANGED
@@ -2685,6 +2685,7 @@ type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
2685
2685
  children?: React__default.ReactNode;
2686
2686
  isValid?: boolean;
2687
2687
  name?: string;
2688
+ maxLength?: number;
2688
2689
  typography?: string;
2689
2690
  fontWeight?: "regular" | "medium" | "semibold" | "bold";
2690
2691
  textAlign?: "left" | "right" | "center";
package/dist/index.js CHANGED
@@ -2812,6 +2812,22 @@ var InputAddon = styled(TextStyle, {
2812
2812
  }
2813
2813
  }
2814
2814
  });
2815
+ var TextFieldLimitIndicator = styled("div", {
2816
+ width: "fit-content",
2817
+ display: "flex",
2818
+ justifyContent: "flex-end",
2819
+ position: "absolute",
2820
+ top: "0.5rem",
2821
+ right: "1rem",
2822
+ span: {
2823
+ color: "$neutral700",
2824
+ borderRadius: "$2xs",
2825
+ padding: "$4",
2826
+ fontSize: "$labelSmall",
2827
+ backgroundColor: "$neutral200",
2828
+ fontFamily: "$default"
2829
+ }
2830
+ });
2815
2831
  var maskFormat = import_mask.format;
2816
2832
  var maskUnformat = import_mask.unformat;
2817
2833
  var TextField = import_react2.default.forwardRef(
@@ -2825,7 +2841,8 @@ var TextField = import_react2.default.forwardRef(
2825
2841
  fontWeight,
2826
2842
  addon,
2827
2843
  textAlign = "left",
2828
- mask
2844
+ mask,
2845
+ maxLength
2829
2846
  } = _b, props = __objRest(_b, [
2830
2847
  "children",
2831
2848
  "isValid",
@@ -2835,47 +2852,70 @@ var TextField = import_react2.default.forwardRef(
2835
2852
  "fontWeight",
2836
2853
  "addon",
2837
2854
  "textAlign",
2838
- "mask"
2855
+ "mask",
2856
+ "maxLength"
2839
2857
  ]);
2840
2858
  const maskRef = mask ? (0, import_mask.useMask)(mask) : void 0;
2841
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Flex2, { gap: "0", css: { width: "100%" }, children: [
2842
- !!addon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InputAddon, { color, typography: "labelSmall", children: addon }),
2843
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2844
- TextFieldStyled,
2845
- __spreadProps(__spreadValues({
2846
- color,
2847
- isValid: isValid2,
2848
- name,
2849
- typography,
2850
- fontWeight,
2851
- textAlign,
2852
- ref: (r) => {
2853
- if (!r) return;
2854
- if (maskRef) maskRef.current = r;
2855
- if (fowardedRef) {
2856
- if (typeof fowardedRef === "function") fowardedRef(r);
2857
- else fowardedRef.current = r;
2858
- }
2859
- }
2860
- }, props), {
2861
- style: addon ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" } : void 0,
2862
- children: [
2863
- children,
2864
- isValid2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2865
- TextFieldSlot,
2866
- {
2867
- position: "flex-end",
2868
- name,
2869
- color,
2870
- typography,
2871
- fontWeight,
2872
- textAlign,
2873
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon_default, { name: "check" })
2859
+ const inputRef = import_react2.default.useRef(null);
2860
+ const badgeRef = import_react2.default.useRef(null);
2861
+ const updateCharCountBadge = () => {
2862
+ var _a2, _b2;
2863
+ if (!maxLength || !badgeRef.current) return;
2864
+ const currentLength = (_b2 = (_a2 = inputRef.current) == null ? void 0 : _a2.value.length) != null ? _b2 : 0;
2865
+ badgeRef.current.textContent = String(maxLength - currentLength);
2866
+ };
2867
+ const handleInput = (e) => {
2868
+ var _a2;
2869
+ updateCharCountBadge();
2870
+ (_a2 = props.onInput) == null ? void 0 : _a2.call(props, e);
2871
+ };
2872
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Flex2, { direction: "column", css: { width: "100%" }, children: [
2873
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Flex2, { gap: "0", css: { width: "100%", position: "relative" }, children: [
2874
+ !!addon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InputAddon, { color, typography: "labelSmall", children: addon }),
2875
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2876
+ TextFieldStyled,
2877
+ __spreadProps(__spreadValues({
2878
+ color,
2879
+ isValid: isValid2,
2880
+ name,
2881
+ typography,
2882
+ fontWeight,
2883
+ textAlign,
2884
+ maxLength,
2885
+ ref: (r) => {
2886
+ if (!r) return;
2887
+ inputRef.current = r;
2888
+ if (maskRef) maskRef.current = r;
2889
+ if (fowardedRef) {
2890
+ if (typeof fowardedRef === "function") fowardedRef(r);
2891
+ else fowardedRef.current = r;
2874
2892
  }
2875
- )
2876
- ]
2877
- })
2878
- )
2893
+ },
2894
+ onInput: handleInput
2895
+ }, props), {
2896
+ style: addon ? {
2897
+ borderTopLeftRadius: "0px",
2898
+ borderBottomLeftRadius: "0px"
2899
+ } : void 0,
2900
+ children: [
2901
+ children,
2902
+ isValid2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2903
+ TextFieldSlot,
2904
+ {
2905
+ position: "flex-end",
2906
+ name,
2907
+ color,
2908
+ typography,
2909
+ fontWeight,
2910
+ textAlign,
2911
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon_default, { name: "check" })
2912
+ }
2913
+ )
2914
+ ]
2915
+ })
2916
+ )
2917
+ ] }),
2918
+ maxLength && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TextFieldLimitIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { ref: badgeRef, children: maxLength }) })
2879
2919
  ] });
2880
2920
  }
2881
2921
  );
@@ -10160,16 +10200,18 @@ var isValidDate = (day, month, year) => {
10160
10200
  return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day;
10161
10201
  };
10162
10202
  var isValidBirthDate = (value, language) => {
10163
- const [part1, part2, part3] = value.split("/").map(Number);
10164
- let day = 0, month = 0, year = 0;
10203
+ if (!/^\d{8}$/.test(value)) return false;
10204
+ let day = 0;
10205
+ let month = 0;
10206
+ let year = 0;
10165
10207
  if (language === "en") {
10166
- month = part1;
10167
- day = part2;
10168
- year = part3;
10208
+ month = Number(value.slice(0, 2));
10209
+ day = Number(value.slice(2, 4));
10210
+ year = Number(value.slice(4));
10169
10211
  } else {
10170
- day = part1;
10171
- month = part2;
10172
- year = part3;
10212
+ day = Number(value.slice(0, 2));
10213
+ month = Number(value.slice(2, 4));
10214
+ year = Number(value.slice(4));
10173
10215
  }
10174
10216
  if (!isValidDate(day, month, year)) return false;
10175
10217
  const today = /* @__PURE__ */ new Date();
@@ -10188,7 +10230,7 @@ var BirthDateFormField = ({
10188
10230
  validationErrorMessage,
10189
10231
  language
10190
10232
  }) => {
10191
- const inputPlaceholder = placeholder || (language === "en" ? "MM/DD/YYYY" : "DD/MM/AAAA");
10233
+ const inputPlaceholder = placeholder || (language === "pt-BR" ? "DD/MM/AAAA" : "MM/DD/YYYY");
10192
10234
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
10193
10235
  TextFormField,
10194
10236
  {
package/dist/index.mjs CHANGED
@@ -2705,6 +2705,22 @@ var InputAddon = styled(TextStyle, {
2705
2705
  }
2706
2706
  }
2707
2707
  });
2708
+ var TextFieldLimitIndicator = styled("div", {
2709
+ width: "fit-content",
2710
+ display: "flex",
2711
+ justifyContent: "flex-end",
2712
+ position: "absolute",
2713
+ top: "0.5rem",
2714
+ right: "1rem",
2715
+ span: {
2716
+ color: "$neutral700",
2717
+ borderRadius: "$2xs",
2718
+ padding: "$4",
2719
+ fontSize: "$labelSmall",
2720
+ backgroundColor: "$neutral200",
2721
+ fontFamily: "$default"
2722
+ }
2723
+ });
2708
2724
  var maskFormat = format;
2709
2725
  var maskUnformat = unformat;
2710
2726
  var TextField = React.forwardRef(
@@ -2718,7 +2734,8 @@ var TextField = React.forwardRef(
2718
2734
  fontWeight,
2719
2735
  addon,
2720
2736
  textAlign = "left",
2721
- mask
2737
+ mask,
2738
+ maxLength
2722
2739
  } = _b, props = __objRest(_b, [
2723
2740
  "children",
2724
2741
  "isValid",
@@ -2728,47 +2745,70 @@ var TextField = React.forwardRef(
2728
2745
  "fontWeight",
2729
2746
  "addon",
2730
2747
  "textAlign",
2731
- "mask"
2748
+ "mask",
2749
+ "maxLength"
2732
2750
  ]);
2733
2751
  const maskRef = mask ? useMask(mask) : void 0;
2734
- return /* @__PURE__ */ jsxs(Flex2, { gap: "0", css: { width: "100%" }, children: [
2735
- !!addon && /* @__PURE__ */ jsx7(InputAddon, { color, typography: "labelSmall", children: addon }),
2736
- /* @__PURE__ */ jsxs(
2737
- TextFieldStyled,
2738
- __spreadProps(__spreadValues({
2739
- color,
2740
- isValid: isValid2,
2741
- name,
2742
- typography,
2743
- fontWeight,
2744
- textAlign,
2745
- ref: (r) => {
2746
- if (!r) return;
2747
- if (maskRef) maskRef.current = r;
2748
- if (fowardedRef) {
2749
- if (typeof fowardedRef === "function") fowardedRef(r);
2750
- else fowardedRef.current = r;
2751
- }
2752
- }
2753
- }, props), {
2754
- style: addon ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" } : void 0,
2755
- children: [
2756
- children,
2757
- isValid2 && /* @__PURE__ */ jsx7(
2758
- TextFieldSlot,
2759
- {
2760
- position: "flex-end",
2761
- name,
2762
- color,
2763
- typography,
2764
- fontWeight,
2765
- textAlign,
2766
- children: /* @__PURE__ */ jsx7(Icon_default, { name: "check" })
2752
+ const inputRef = React.useRef(null);
2753
+ const badgeRef = React.useRef(null);
2754
+ const updateCharCountBadge = () => {
2755
+ var _a2, _b2;
2756
+ if (!maxLength || !badgeRef.current) return;
2757
+ const currentLength = (_b2 = (_a2 = inputRef.current) == null ? void 0 : _a2.value.length) != null ? _b2 : 0;
2758
+ badgeRef.current.textContent = String(maxLength - currentLength);
2759
+ };
2760
+ const handleInput = (e) => {
2761
+ var _a2;
2762
+ updateCharCountBadge();
2763
+ (_a2 = props.onInput) == null ? void 0 : _a2.call(props, e);
2764
+ };
2765
+ return /* @__PURE__ */ jsxs(Flex2, { direction: "column", css: { width: "100%" }, children: [
2766
+ /* @__PURE__ */ jsxs(Flex2, { gap: "0", css: { width: "100%", position: "relative" }, children: [
2767
+ !!addon && /* @__PURE__ */ jsx7(InputAddon, { color, typography: "labelSmall", children: addon }),
2768
+ /* @__PURE__ */ jsxs(
2769
+ TextFieldStyled,
2770
+ __spreadProps(__spreadValues({
2771
+ color,
2772
+ isValid: isValid2,
2773
+ name,
2774
+ typography,
2775
+ fontWeight,
2776
+ textAlign,
2777
+ maxLength,
2778
+ ref: (r) => {
2779
+ if (!r) return;
2780
+ inputRef.current = r;
2781
+ if (maskRef) maskRef.current = r;
2782
+ if (fowardedRef) {
2783
+ if (typeof fowardedRef === "function") fowardedRef(r);
2784
+ else fowardedRef.current = r;
2767
2785
  }
2768
- )
2769
- ]
2770
- })
2771
- )
2786
+ },
2787
+ onInput: handleInput
2788
+ }, props), {
2789
+ style: addon ? {
2790
+ borderTopLeftRadius: "0px",
2791
+ borderBottomLeftRadius: "0px"
2792
+ } : void 0,
2793
+ children: [
2794
+ children,
2795
+ isValid2 && /* @__PURE__ */ jsx7(
2796
+ TextFieldSlot,
2797
+ {
2798
+ position: "flex-end",
2799
+ name,
2800
+ color,
2801
+ typography,
2802
+ fontWeight,
2803
+ textAlign,
2804
+ children: /* @__PURE__ */ jsx7(Icon_default, { name: "check" })
2805
+ }
2806
+ )
2807
+ ]
2808
+ })
2809
+ )
2810
+ ] }),
2811
+ maxLength && /* @__PURE__ */ jsx7(TextFieldLimitIndicator, { children: /* @__PURE__ */ jsx7("span", { ref: badgeRef, children: maxLength }) })
2772
2812
  ] });
2773
2813
  }
2774
2814
  );
@@ -10066,16 +10106,18 @@ var isValidDate = (day, month, year) => {
10066
10106
  return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day;
10067
10107
  };
10068
10108
  var isValidBirthDate = (value, language) => {
10069
- const [part1, part2, part3] = value.split("/").map(Number);
10070
- let day = 0, month = 0, year = 0;
10109
+ if (!/^\d{8}$/.test(value)) return false;
10110
+ let day = 0;
10111
+ let month = 0;
10112
+ let year = 0;
10071
10113
  if (language === "en") {
10072
- month = part1;
10073
- day = part2;
10074
- year = part3;
10114
+ month = Number(value.slice(0, 2));
10115
+ day = Number(value.slice(2, 4));
10116
+ year = Number(value.slice(4));
10075
10117
  } else {
10076
- day = part1;
10077
- month = part2;
10078
- year = part3;
10118
+ day = Number(value.slice(0, 2));
10119
+ month = Number(value.slice(2, 4));
10120
+ year = Number(value.slice(4));
10079
10121
  }
10080
10122
  if (!isValidDate(day, month, year)) return false;
10081
10123
  const today = /* @__PURE__ */ new Date();
@@ -10094,7 +10136,7 @@ var BirthDateFormField = ({
10094
10136
  validationErrorMessage,
10095
10137
  language
10096
10138
  }) => {
10097
- const inputPlaceholder = placeholder || (language === "en" ? "MM/DD/YYYY" : "DD/MM/AAAA");
10139
+ const inputPlaceholder = placeholder || (language === "pt-BR" ? "DD/MM/AAAA" : "MM/DD/YYYY");
10098
10140
  return /* @__PURE__ */ jsx39(
10099
10141
  TextFormField,
10100
10142
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "11.7.5",
3
+ "version": "11.7.7",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -19,21 +19,20 @@ const isValidDate = (day: number, month: number, year: number): boolean => {
19
19
  date.getDate() === day
20
20
  );
21
21
  };
22
-
23
22
  const isValidBirthDate = (value: string, language: Language): boolean => {
24
- const [part1, part2, part3] = value.split("/").map(Number);
25
- let day = 0,
26
- month = 0,
27
- year = 0;
23
+ if (!/^\d{8}$/.test(value)) return false;
28
24
 
25
+ let day = 0;
26
+ let month = 0;
27
+ let year = 0;
29
28
  if (language === "en") {
30
- month = part1;
31
- day = part2;
32
- year = part3;
29
+ month = Number(value.slice(0, 2));
30
+ day = Number(value.slice(2, 4));
31
+ year = Number(value.slice(4));
33
32
  } else {
34
- day = part1;
35
- month = part2;
36
- year = part3;
33
+ day = Number(value.slice(0, 2));
34
+ month = Number(value.slice(2, 4));
35
+ year = Number(value.slice(4));
37
36
  }
38
37
 
39
38
  if (!isValidDate(day, month, year)) return false;
@@ -63,7 +62,7 @@ export const BirthDateFormField = ({
63
62
  language,
64
63
  }: BirthDateFormFieldProps) => {
65
64
  const inputPlaceholder =
66
- placeholder || (language === "en" ? "MM/DD/YYYY" : "DD/MM/AAAA");
65
+ placeholder || (language === "pt-BR" ? "DD/MM/AAAA" : "MM/DD/YYYY");
67
66
 
68
67
  return (
69
68
  <TextFormField
@@ -168,6 +168,7 @@ export type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
168
168
  children?: React.ReactNode;
169
169
  isValid?: boolean;
170
170
  name?: string;
171
+ maxLength?: number;
171
172
  typography?: string;
172
173
  fontWeight?: "regular" | "medium" | "semibold" | "bold";
173
174
  textAlign?: "left" | "right" | "center";
@@ -215,6 +216,22 @@ const InputAddon = styled(TextStyle, {
215
216
  },
216
217
  },
217
218
  });
219
+ const TextFieldLimitIndicator = styled("div", {
220
+ width: "fit-content",
221
+ display: "flex",
222
+ justifyContent: "flex-end",
223
+ position: "absolute",
224
+ top: "0.5rem",
225
+ right: "1rem",
226
+ span: {
227
+ color: "$neutral700",
228
+ borderRadius: "$2xs",
229
+ padding: "$4",
230
+ fontSize: "$labelSmall",
231
+ backgroundColor: "$neutral200",
232
+ fontFamily: "$default",
233
+ },
234
+ });
218
235
  export const maskFormat = format;
219
236
  export const maskUnformat = unformat;
220
237
 
@@ -230,52 +247,84 @@ export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
230
247
  addon,
231
248
  textAlign = "left",
232
249
  mask,
250
+ maxLength,
233
251
  ...props
234
252
  },
235
253
  fowardedRef
236
254
  ) => {
237
255
  const maskRef = mask ? useMask(mask) : undefined;
256
+ const inputRef = React.useRef<HTMLInputElement>(null);
257
+ const badgeRef = React.useRef<HTMLSpanElement>(null);
258
+
259
+ const updateCharCountBadge = () => {
260
+ if (!maxLength || !badgeRef.current) return;
261
+ const currentLength = inputRef.current?.value.length ?? 0;
262
+ badgeRef.current.textContent = String(maxLength - currentLength);
263
+ };
264
+
265
+ const handleInput = (e: React.FormEvent<HTMLInputElement>) => {
266
+ updateCharCountBadge();
267
+ props.onInput?.(e);
268
+ };
269
+
238
270
  return (
239
- <Flex gap={"0"} css={{ width: "100%" }}>
240
- {!!addon && <InputAddon color={color} typography="labelSmall">{addon}</InputAddon>}
271
+ <Flex direction="column" css={{ width: "100%" }}>
272
+ <Flex gap={"0"} css={{ width: "100%", position: "relative" }}>
273
+ {!!addon && (
274
+ <InputAddon color={color} typography="labelSmall">
275
+ {addon}
276
+ </InputAddon>
277
+ )}
241
278
 
242
- <TextFieldStyled
243
- color={color}
244
- isValid={isValid}
245
- name={name}
246
- typography={typography}
247
- fontWeight={fontWeight}
248
- textAlign={textAlign}
249
- ref={(r) => {
250
- if (!r) return;
251
- if (maskRef) maskRef.current = r;
279
+ <TextFieldStyled
280
+ color={color}
281
+ isValid={isValid}
282
+ name={name}
283
+ typography={typography}
284
+ fontWeight={fontWeight}
285
+ textAlign={textAlign}
286
+ maxLength={maxLength}
287
+ ref={(r) => {
288
+ if (!r) return;
289
+ inputRef.current = r;
290
+ if (maskRef) maskRef.current = r;
252
291
 
253
- if (fowardedRef) {
254
- if (typeof fowardedRef === "function") fowardedRef(r);
255
- else fowardedRef.current = r;
292
+ if (fowardedRef) {
293
+ if (typeof fowardedRef === "function") fowardedRef(r);
294
+ else fowardedRef.current = r;
295
+ }
296
+ }}
297
+ onInput={handleInput}
298
+ {...props}
299
+ style={
300
+ addon
301
+ ? {
302
+ borderTopLeftRadius: "0px",
303
+ borderBottomLeftRadius: "0px",
304
+ }
305
+ : undefined
256
306
  }
257
- }}
258
- {...props}
259
- style={
260
- addon
261
- ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" }
262
- : undefined
263
- }
264
- >
265
- {children}
266
- {isValid && (
267
- <TextFieldSlot
268
- position="flex-end"
269
- name={name}
270
- color={color as TextFieldSlotProps["color"]}
271
- typography={typography}
272
- fontWeight={fontWeight}
273
- textAlign={textAlign}
274
- >
275
- <Icon name="check" />
276
- </TextFieldSlot>
277
- )}
278
- </TextFieldStyled>
307
+ >
308
+ {children}
309
+ {isValid && (
310
+ <TextFieldSlot
311
+ position="flex-end"
312
+ name={name}
313
+ color={color as TextFieldSlotProps["color"]}
314
+ typography={typography}
315
+ fontWeight={fontWeight}
316
+ textAlign={textAlign}
317
+ >
318
+ <Icon name="check" />
319
+ </TextFieldSlot>
320
+ )}
321
+ </TextFieldStyled>
322
+ </Flex>
323
+ {maxLength && (
324
+ <TextFieldLimitIndicator>
325
+ <span ref={badgeRef}>{maxLength}</span>
326
+ </TextFieldLimitIndicator>
327
+ )}
279
328
  </Flex>
280
329
  );
281
330
  }