@lets-events/react 11.0.2 → 11.0.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,5 +1,5 @@
1
1
 
2
- > @lets-events/react@11.0.2 build
2
+ > @lets-events/react@11.0.4 build
3
3
  > tsup src/index.tsx --format esm,cjs --dts --external react
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist\index.mjs 275.12 KB
12
- ESM ⚡️ Build success in 224ms
13
- CJS dist\index.js 283.47 KB
14
- CJS ⚡️ Build success in 225ms
11
+ ESM dist\index.mjs 275.57 KB
12
+ ESM ⚡️ Build success in 232ms
13
+ CJS dist\index.js 283.95 KB
14
+ CJS ⚡️ Build success in 232ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 3530ms
17
- DTS dist\index.d.mts 338.30 KB
18
- DTS dist\index.d.ts 338.30 KB
16
+ DTS ⚡️ Build success in 3634ms
17
+ DTS dist\index.d.mts 338.33 KB
18
+ DTS dist\index.d.ts 338.33 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 11.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - fix textfield ref
8
+
9
+ ## 11.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - fix textfield ref
14
+
3
15
  ## 11.0.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1926,7 +1926,7 @@ type AvatarProps = ComponentProps<typeof AvatarStyled> & {
1926
1926
  };
1927
1927
  declare function Avatar({ asChild, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
1928
1928
 
1929
- declare const TextFieldStyled: _stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<TextField$1.RootProps & react.RefAttributes<HTMLInputElement>>, {
1929
+ declare const TextFieldStyled: _stitches_react_types_styled_component.StyledComponent<react__default.ForwardRefExoticComponent<TextField$1.RootProps & react__default.RefAttributes<HTMLInputElement>>, {
1930
1930
  color?: "default" | "error" | undefined;
1931
1931
  typography?: "tooltip" | "displayLarge" | "displayMedium" | "displaySmall" | "headline1" | "headline2" | "headline3" | "headline4" | "headline5" | "headline6" | "headline7" | "headline8" | "bodyXL" | "bodyL" | "bodyM" | "bodyS" | "bodyXS" | "bodyXXS" | "badgeLarge" | "badgeMedium" | "badgeSmall" | "badgeExtraSmall" | "popoversRegular" | "captionLarge" | "captionMedium" | "captionSmall" | "buttonLarge" | "buttonMedium" | "buttonSmall" | "buttonExtraSmall" | "labelLarge" | "labelMedium" | "labelSmall" | "labelExtraSmall" | undefined;
1932
1932
  fontWeight?: "bold" | "medium" | "regular" | "semibold" | undefined;
@@ -2302,7 +2302,7 @@ declare const TextFieldStyled: _stitches_react_types_styled_component.StyledComp
2302
2302
  transition: "transitions";
2303
2303
  zIndex: "zIndices";
2304
2304
  }, {}>>;
2305
- declare const TextFieldSlotStyled: _stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<TextField$1.SlotProps & react.RefAttributes<HTMLDivElement>>, {
2305
+ declare const TextFieldSlotStyled: _stitches_react_types_styled_component.StyledComponent<react__default.ForwardRefExoticComponent<TextField$1.SlotProps & react__default.RefAttributes<HTMLDivElement>>, {
2306
2306
  typography?: "tooltip" | "displayLarge" | "displayMedium" | "displaySmall" | "headline1" | "headline2" | "headline3" | "headline4" | "headline5" | "headline6" | "headline7" | "headline8" | "bodyXL" | "bodyL" | "bodyM" | "bodyS" | "bodyXS" | "bodyXXS" | "badgeLarge" | "badgeMedium" | "badgeSmall" | "badgeExtraSmall" | "popoversRegular" | "captionLarge" | "captionMedium" | "captionSmall" | "buttonLarge" | "buttonMedium" | "buttonSmall" | "buttonExtraSmall" | "labelLarge" | "labelMedium" | "labelSmall" | "labelExtraSmall" | undefined;
2307
2307
  fontWeight?: "bold" | "medium" | "regular" | "semibold" | undefined;
2308
2308
  textAlign?: "left" | "right" | "center" | undefined;
@@ -2679,27 +2679,27 @@ declare const TextFieldSlotStyled: _stitches_react_types_styled_component.Styled
2679
2679
  type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
2680
2680
  addon?: ReactNode;
2681
2681
  placeholder?: string;
2682
- children?: React.ReactNode;
2682
+ children?: react__default.ReactNode;
2683
2683
  isValid?: boolean;
2684
2684
  name?: string;
2685
2685
  typography?: string;
2686
- fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold';
2687
- textAlign?: 'left' | 'right' | 'center';
2686
+ fontWeight?: "regular" | "medium" | "semibold" | "bold";
2687
+ textAlign?: "left" | "right" | "center";
2688
2688
  mask?: MaskOptions;
2689
2689
  };
2690
- type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, 'color'> & {
2690
+ type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, "color"> & {
2691
2691
  placeholder?: string;
2692
- children?: React.ReactNode;
2693
- position?: 'flex-start' | 'flex-end';
2692
+ children?: react__default.ReactNode;
2693
+ position?: "flex-start" | "flex-end";
2694
2694
  onClick?: () => void;
2695
- color?: 'error' | 'success' | undefined;
2695
+ color?: "error" | "success" | undefined;
2696
2696
  typography?: string;
2697
- fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold';
2698
- textAlign?: 'left' | 'right' | 'center';
2697
+ fontWeight?: "regular" | "medium" | "semibold" | "bold";
2698
+ textAlign?: "left" | "right" | "center";
2699
2699
  };
2700
2700
  declare const maskFormat: typeof format;
2701
2701
  declare const maskUnformat: typeof unformat;
2702
- declare function TextField({ children, isValid, name, color, typography, fontWeight, addon, textAlign, mask, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
2702
+ declare const TextField: react__default.ForwardRefExoticComponent<Omit<TextFieldProps, "ref"> & react__default.RefAttributes<HTMLInputElement>>;
2703
2703
  declare function TextFieldSlot({ children, position, onClick, typography, fontWeight, textAlign, ...props }: TextFieldSlotProps): react_jsx_runtime.JSX.Element;
2704
2704
 
2705
2705
  declare const RadioGroupStyled: _stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<RadioGroup$1.RootProps & react.RefAttributes<HTMLDivElement>>, {
package/dist/index.d.ts CHANGED
@@ -1926,7 +1926,7 @@ type AvatarProps = ComponentProps<typeof AvatarStyled> & {
1926
1926
  };
1927
1927
  declare function Avatar({ asChild, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
1928
1928
 
1929
- declare const TextFieldStyled: _stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<TextField$1.RootProps & react.RefAttributes<HTMLInputElement>>, {
1929
+ declare const TextFieldStyled: _stitches_react_types_styled_component.StyledComponent<react__default.ForwardRefExoticComponent<TextField$1.RootProps & react__default.RefAttributes<HTMLInputElement>>, {
1930
1930
  color?: "default" | "error" | undefined;
1931
1931
  typography?: "tooltip" | "displayLarge" | "displayMedium" | "displaySmall" | "headline1" | "headline2" | "headline3" | "headline4" | "headline5" | "headline6" | "headline7" | "headline8" | "bodyXL" | "bodyL" | "bodyM" | "bodyS" | "bodyXS" | "bodyXXS" | "badgeLarge" | "badgeMedium" | "badgeSmall" | "badgeExtraSmall" | "popoversRegular" | "captionLarge" | "captionMedium" | "captionSmall" | "buttonLarge" | "buttonMedium" | "buttonSmall" | "buttonExtraSmall" | "labelLarge" | "labelMedium" | "labelSmall" | "labelExtraSmall" | undefined;
1932
1932
  fontWeight?: "bold" | "medium" | "regular" | "semibold" | undefined;
@@ -2302,7 +2302,7 @@ declare const TextFieldStyled: _stitches_react_types_styled_component.StyledComp
2302
2302
  transition: "transitions";
2303
2303
  zIndex: "zIndices";
2304
2304
  }, {}>>;
2305
- declare const TextFieldSlotStyled: _stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<TextField$1.SlotProps & react.RefAttributes<HTMLDivElement>>, {
2305
+ declare const TextFieldSlotStyled: _stitches_react_types_styled_component.StyledComponent<react__default.ForwardRefExoticComponent<TextField$1.SlotProps & react__default.RefAttributes<HTMLDivElement>>, {
2306
2306
  typography?: "tooltip" | "displayLarge" | "displayMedium" | "displaySmall" | "headline1" | "headline2" | "headline3" | "headline4" | "headline5" | "headline6" | "headline7" | "headline8" | "bodyXL" | "bodyL" | "bodyM" | "bodyS" | "bodyXS" | "bodyXXS" | "badgeLarge" | "badgeMedium" | "badgeSmall" | "badgeExtraSmall" | "popoversRegular" | "captionLarge" | "captionMedium" | "captionSmall" | "buttonLarge" | "buttonMedium" | "buttonSmall" | "buttonExtraSmall" | "labelLarge" | "labelMedium" | "labelSmall" | "labelExtraSmall" | undefined;
2307
2307
  fontWeight?: "bold" | "medium" | "regular" | "semibold" | undefined;
2308
2308
  textAlign?: "left" | "right" | "center" | undefined;
@@ -2679,27 +2679,27 @@ declare const TextFieldSlotStyled: _stitches_react_types_styled_component.Styled
2679
2679
  type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
2680
2680
  addon?: ReactNode;
2681
2681
  placeholder?: string;
2682
- children?: React.ReactNode;
2682
+ children?: react__default.ReactNode;
2683
2683
  isValid?: boolean;
2684
2684
  name?: string;
2685
2685
  typography?: string;
2686
- fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold';
2687
- textAlign?: 'left' | 'right' | 'center';
2686
+ fontWeight?: "regular" | "medium" | "semibold" | "bold";
2687
+ textAlign?: "left" | "right" | "center";
2688
2688
  mask?: MaskOptions;
2689
2689
  };
2690
- type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, 'color'> & {
2690
+ type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, "color"> & {
2691
2691
  placeholder?: string;
2692
- children?: React.ReactNode;
2693
- position?: 'flex-start' | 'flex-end';
2692
+ children?: react__default.ReactNode;
2693
+ position?: "flex-start" | "flex-end";
2694
2694
  onClick?: () => void;
2695
- color?: 'error' | 'success' | undefined;
2695
+ color?: "error" | "success" | undefined;
2696
2696
  typography?: string;
2697
- fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold';
2698
- textAlign?: 'left' | 'right' | 'center';
2697
+ fontWeight?: "regular" | "medium" | "semibold" | "bold";
2698
+ textAlign?: "left" | "right" | "center";
2699
2699
  };
2700
2700
  declare const maskFormat: typeof format;
2701
2701
  declare const maskUnformat: typeof unformat;
2702
- declare function TextField({ children, isValid, name, color, typography, fontWeight, addon, textAlign, mask, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
2702
+ declare const TextField: react__default.ForwardRefExoticComponent<Omit<TextFieldProps, "ref"> & react__default.RefAttributes<HTMLInputElement>>;
2703
2703
  declare function TextFieldSlot({ children, position, onClick, typography, fontWeight, textAlign, ...props }: TextFieldSlotProps): react_jsx_runtime.JSX.Element;
2704
2704
 
2705
2705
  declare const RadioGroupStyled: _stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<RadioGroup$1.RootProps & react.RefAttributes<HTMLDivElement>>, {
package/dist/index.js CHANGED
@@ -2472,6 +2472,7 @@ function Avatar(_a) {
2472
2472
  }
2473
2473
 
2474
2474
  // src/components/TextField.tsx
2475
+ var import_react2 = __toESM(require("react"));
2475
2476
  var import_themes7 = require("@radix-ui/themes");
2476
2477
 
2477
2478
  // src/components/Flex.tsx
@@ -2746,62 +2747,73 @@ var InputAddon = styled(TextStyle, {
2746
2747
  });
2747
2748
  var maskFormat = import_mask.format;
2748
2749
  var maskUnformat = import_mask.unformat;
2749
- function TextField(_a) {
2750
- var _b = _a, {
2751
- children,
2752
- isValid: isValid2,
2753
- name,
2754
- color,
2755
- typography,
2756
- fontWeight,
2757
- addon,
2758
- textAlign = "left",
2759
- mask
2760
- } = _b, props = __objRest(_b, [
2761
- "children",
2762
- "isValid",
2763
- "name",
2764
- "color",
2765
- "typography",
2766
- "fontWeight",
2767
- "addon",
2768
- "textAlign",
2769
- "mask"
2770
- ]);
2771
- const maskRef = mask ? (0, import_mask.useMask)(mask) : void 0;
2772
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Flex2, { gap: "0", css: { width: "100%" }, children: [
2773
- !!addon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InputAddon, { typography: "labelSmall", children: addon }),
2774
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2775
- TextFieldStyled,
2776
- __spreadProps(__spreadValues({
2777
- color,
2778
- isValid: isValid2,
2779
- name,
2780
- typography,
2781
- fontWeight,
2782
- textAlign,
2783
- ref: maskRef
2784
- }, props), {
2785
- style: addon ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" } : void 0,
2786
- children: [
2787
- children,
2788
- isValid2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2789
- TextFieldSlot,
2790
- {
2791
- position: "flex-end",
2792
- name,
2793
- color,
2794
- typography,
2795
- fontWeight,
2796
- textAlign,
2797
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon_default, { name: "check" })
2750
+ var TextField = import_react2.default.forwardRef(
2751
+ (_a, fowardedRef) => {
2752
+ var _b = _a, {
2753
+ children,
2754
+ isValid: isValid2,
2755
+ name,
2756
+ color,
2757
+ typography,
2758
+ fontWeight,
2759
+ addon,
2760
+ textAlign = "left",
2761
+ mask
2762
+ } = _b, props = __objRest(_b, [
2763
+ "children",
2764
+ "isValid",
2765
+ "name",
2766
+ "color",
2767
+ "typography",
2768
+ "fontWeight",
2769
+ "addon",
2770
+ "textAlign",
2771
+ "mask"
2772
+ ]);
2773
+ const maskRef = mask ? (0, import_mask.useMask)(mask) : void 0;
2774
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Flex2, { gap: "0", css: { width: "100%" }, children: [
2775
+ !!addon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InputAddon, { typography: "labelSmall", children: addon }),
2776
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2777
+ TextFieldStyled,
2778
+ __spreadProps(__spreadValues({
2779
+ color,
2780
+ isValid: isValid2,
2781
+ name,
2782
+ typography,
2783
+ fontWeight,
2784
+ textAlign,
2785
+ ref: (r) => {
2786
+ if (!r) return;
2787
+ if (maskRef) maskRef.current = r;
2788
+ if (fowardedRef) {
2789
+ if (typeof fowardedRef === "function") fowardedRef(r);
2790
+ else {
2791
+ fowardedRef.current = r;
2792
+ }
2798
2793
  }
2799
- )
2800
- ]
2801
- })
2802
- )
2803
- ] });
2804
- }
2794
+ }
2795
+ }, props), {
2796
+ style: addon ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" } : void 0,
2797
+ children: [
2798
+ children,
2799
+ isValid2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2800
+ TextFieldSlot,
2801
+ {
2802
+ position: "flex-end",
2803
+ name,
2804
+ color,
2805
+ typography,
2806
+ fontWeight,
2807
+ textAlign,
2808
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon_default, { name: "check" })
2809
+ }
2810
+ )
2811
+ ]
2812
+ })
2813
+ )
2814
+ ] });
2815
+ }
2816
+ );
2805
2817
  function TextFieldSlot(_a) {
2806
2818
  var _b = _a, {
2807
2819
  children,
@@ -3509,7 +3521,7 @@ function DropdownMenuItem(_a) {
3509
3521
  }
3510
3522
 
3511
3523
  // src/components/Badge.tsx
3512
- var import_react2 = __toESM(require("react"));
3524
+ var import_react3 = __toESM(require("react"));
3513
3525
  var import_themes12 = require("@radix-ui/themes");
3514
3526
  var import_jsx_runtime12 = require("react/jsx-runtime");
3515
3527
  var BadgeStyled = styled(import_themes12.Badge, {
@@ -3616,9 +3628,9 @@ var BadgeStyled = styled(import_themes12.Badge, {
3616
3628
  });
3617
3629
  function Badge(_a) {
3618
3630
  var _b = _a, { asChild, children } = _b, props = __objRest(_b, ["asChild", "children"]);
3619
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BadgeStyled, __spreadProps(__spreadValues({}, props), { children: import_react2.default.Children.map(children, (child) => {
3620
- if (import_react2.default.isValidElement(child)) {
3621
- return import_react2.default.cloneElement(child, { size: props.size });
3631
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BadgeStyled, __spreadProps(__spreadValues({}, props), { children: import_react3.default.Children.map(children, (child) => {
3632
+ if (import_react3.default.isValidElement(child)) {
3633
+ return import_react3.default.cloneElement(child, { size: props.size });
3622
3634
  }
3623
3635
  return child;
3624
3636
  }) }));
@@ -3693,12 +3705,12 @@ function Modal(_a) {
3693
3705
  }
3694
3706
 
3695
3707
  // src/components/Calendar/index.tsx
3696
- var import_react4 = require("react");
3708
+ var import_react5 = require("react");
3697
3709
 
3698
3710
  // src/hooks/useOnClickOutside.tsx
3699
- var import_react3 = require("react");
3711
+ var import_react4 = require("react");
3700
3712
  function useOnClickOutside(ref, handler) {
3701
- (0, import_react3.useEffect)(() => {
3713
+ (0, import_react4.useEffect)(() => {
3702
3714
  const listener = (event) => {
3703
3715
  if (!ref.current || ref.current.contains(event.target)) {
3704
3716
  return;
@@ -7835,15 +7847,15 @@ function Calendar(_a) {
7835
7847
  "setSelected",
7836
7848
  "position"
7837
7849
  ]);
7838
- const [inputValue, setInputValue] = (0, import_react4.useState)("");
7839
- const [showContainer, setShowCalendar] = (0, import_react4.useState)(false);
7840
- const dropdownRef = (0, import_react4.useRef)(null);
7850
+ const [inputValue, setInputValue] = (0, import_react5.useState)("");
7851
+ const [showContainer, setShowCalendar] = (0, import_react5.useState)(false);
7852
+ const dropdownRef = (0, import_react5.useRef)(null);
7841
7853
  useOnClickOutside(dropdownRef, () => {
7842
7854
  setShowCalendar(false);
7843
7855
  });
7844
7856
  const today = /* @__PURE__ */ new Date();
7845
7857
  const maxDate = addYears(today, 20);
7846
- (0, import_react4.useEffect)(() => {
7858
+ (0, import_react5.useEffect)(() => {
7847
7859
  if (selected) {
7848
7860
  setInputValue(format2(selected, "dd/MM/yyyy"));
7849
7861
  } else {
@@ -7920,7 +7932,7 @@ function Calendar(_a) {
7920
7932
  }
7921
7933
 
7922
7934
  // src/components/TimePicker.tsx
7923
- var import_react5 = require("react");
7935
+ var import_react6 = require("react");
7924
7936
  var import_jsx_runtime15 = require("react/jsx-runtime");
7925
7937
  var TimePickerStyled = styled("div", {
7926
7938
  position: "relative",
@@ -8024,14 +8036,14 @@ function TimePicker({
8024
8036
  setSelected,
8025
8037
  position = "bottom"
8026
8038
  }) {
8027
- const [hours, setHours] = (0, import_react5.useState)("00");
8028
- const [minutes, setMinutes] = (0, import_react5.useState)("00");
8029
- const [rawHours, setRawHours] = (0, import_react5.useState)("00");
8030
- const [rawMinutes, setRawMinutes] = (0, import_react5.useState)("00");
8031
- const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
8032
- const dropdownRef = (0, import_react5.useRef)(null);
8039
+ const [hours, setHours] = (0, import_react6.useState)("00");
8040
+ const [minutes, setMinutes] = (0, import_react6.useState)("00");
8041
+ const [rawHours, setRawHours] = (0, import_react6.useState)("00");
8042
+ const [rawMinutes, setRawMinutes] = (0, import_react6.useState)("00");
8043
+ const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
8044
+ const dropdownRef = (0, import_react6.useRef)(null);
8033
8045
  useOnClickOutside(dropdownRef, () => setIsOpen(false));
8034
- const handleIncrement = (0, import_react5.useCallback)(
8046
+ const handleIncrement = (0, import_react6.useCallback)(
8035
8047
  (type) => {
8036
8048
  if (type === "hours") {
8037
8049
  const next = (parseInt(hours) + 1) % 24;
@@ -8045,7 +8057,7 @@ function TimePicker({
8045
8057
  },
8046
8058
  [hours, minutes]
8047
8059
  );
8048
- const handleDecrement = (0, import_react5.useCallback)(
8060
+ const handleDecrement = (0, import_react6.useCallback)(
8049
8061
  (type) => {
8050
8062
  if (type === "hours") {
8051
8063
  const prev = (parseInt(hours) - 1 + 24) % 24;
@@ -8567,7 +8579,7 @@ function Switch(props) {
8567
8579
  }
8568
8580
 
8569
8581
  // src/components/Step.tsx
8570
- var import_react6 = __toESM(require("react"));
8582
+ var import_react7 = __toESM(require("react"));
8571
8583
  var import_themes16 = require("@radix-ui/themes");
8572
8584
  var import_jsx_runtime18 = require("react/jsx-runtime");
8573
8585
  var StepStyled = styled("div", {
@@ -8683,9 +8695,9 @@ function StepList(_a) {
8683
8695
  "children",
8684
8696
  "currentStep"
8685
8697
  ]);
8686
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children: import_react6.default.Children.map(children, (child) => {
8687
- if (import_react6.default.isValidElement(child) && child.type === StepTrigger) {
8688
- return import_react6.default.cloneElement(child, { currentStep });
8698
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children: import_react7.default.Children.map(children, (child) => {
8699
+ if (import_react7.default.isValidElement(child) && child.type === StepTrigger) {
8700
+ return import_react7.default.cloneElement(child, { currentStep });
8689
8701
  }
8690
8702
  return child;
8691
8703
  }) }));
@@ -8742,7 +8754,7 @@ function Card(_a) {
8742
8754
 
8743
8755
  // src/components/TextareaField.tsx
8744
8756
  var import_themes18 = require("@radix-ui/themes");
8745
- var import_react7 = require("react");
8757
+ var import_react8 = require("react");
8746
8758
  var import_jsx_runtime20 = require("react/jsx-runtime");
8747
8759
  var TextareaFieldStyle = styled(import_themes18.TextArea, {
8748
8760
  display: "flex",
@@ -8801,8 +8813,8 @@ var TextareaLimitIndicator = styled("div", {
8801
8813
  });
8802
8814
  function TextareaField(_a) {
8803
8815
  var _b = _a, { maxLength } = _b, props = __objRest(_b, ["maxLength"]);
8804
- const inputRef = (0, import_react7.useRef)(null);
8805
- const badgeRef = (0, import_react7.useRef)(null);
8816
+ const inputRef = (0, import_react8.useRef)(null);
8817
+ const badgeRef = (0, import_react8.useRef)(null);
8806
8818
  if (!maxLength) {
8807
8819
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextareaContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextareaFieldStyle, __spreadProps(__spreadValues({}, props), { ref: inputRef })) });
8808
8820
  }
@@ -8825,12 +8837,12 @@ function TextareaField(_a) {
8825
8837
  }
8826
8838
 
8827
8839
  // src/components/Toast/components/ToastItem.tsx
8828
- var import_react9 = require("react");
8840
+ var import_react10 = require("react");
8829
8841
 
8830
8842
  // src/components/Toast/styles/index.ts
8831
- var import_react8 = require("@stitches/react");
8843
+ var import_react9 = require("@stitches/react");
8832
8844
  var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
8833
- var slideIn = (0, import_react8.keyframes)({
8845
+ var slideIn = (0, import_react9.keyframes)({
8834
8846
  from: {
8835
8847
  transform: "translateX(calc(100% + 25px))",
8836
8848
  opacity: 0
@@ -8840,7 +8852,7 @@ var slideIn = (0, import_react8.keyframes)({
8840
8852
  opacity: 1
8841
8853
  }
8842
8854
  });
8843
- var slideOut = (0, import_react8.keyframes)({
8855
+ var slideOut = (0, import_react9.keyframes)({
8844
8856
  from: {
8845
8857
  transform: "translateX(0)",
8846
8858
  opacity: 1
@@ -8850,7 +8862,7 @@ var slideOut = (0, import_react8.keyframes)({
8850
8862
  opacity: 0
8851
8863
  }
8852
8864
  });
8853
- var swipeOut = (0, import_react8.keyframes)({
8865
+ var swipeOut = (0, import_react9.keyframes)({
8854
8866
  from: {
8855
8867
  transform: "translateX(var(--radix-toast-swipe-end-x))",
8856
8868
  opacity: 1
@@ -8956,7 +8968,7 @@ function ToastItem({
8956
8968
  toast,
8957
8969
  onRemove
8958
8970
  }) {
8959
- const [open, setOpen] = (0, import_react9.useState)(true);
8971
+ const [open, setOpen] = (0, import_react10.useState)(true);
8960
8972
  const handleOpenChange = (open2) => {
8961
8973
  setOpen(open2);
8962
8974
  if (!open2) {
@@ -8980,17 +8992,17 @@ function ToastItem({
8980
8992
  }
8981
8993
 
8982
8994
  // src/components/Toast/components/ToastProvider.tsx
8983
- var import_react10 = require("react");
8995
+ var import_react11 = require("react");
8984
8996
  var ToastPrimitive2 = __toESM(require("@radix-ui/react-toast"));
8985
8997
  var import_jsx_runtime22 = require("react/jsx-runtime");
8986
- var ToastContext = (0, import_react10.createContext)(null);
8998
+ var ToastContext = (0, import_react11.createContext)(null);
8987
8999
  function ToastProvider({
8988
9000
  children,
8989
9001
  defaultDuration = 5e3,
8990
9002
  maxToasts = 5,
8991
9003
  swipeDirection = "right"
8992
9004
  }) {
8993
- const [toasts, setToasts] = (0, import_react10.useState)([]);
9005
+ const [toasts, setToasts] = (0, import_react11.useState)([]);
8994
9006
  const addToast = (toastData) => {
8995
9007
  const id = Math.random().toString(36).substr(2, 9);
8996
9008
  const newToast = __spreadProps(__spreadValues({
@@ -9026,9 +9038,9 @@ function ToastProvider({
9026
9038
  }
9027
9039
 
9028
9040
  // src/components/Toast/hooks/useToast.ts
9029
- var import_react11 = require("react");
9041
+ var import_react12 = require("react");
9030
9042
  var useToast = () => {
9031
- const context = (0, import_react11.useContext)(ToastContext);
9043
+ const context = (0, import_react12.useContext)(ToastContext);
9032
9044
  if (!context) {
9033
9045
  throw new Error("useToast deve ser usado dentro de um ToastProvider");
9034
9046
  }
package/dist/index.mjs CHANGED
@@ -2386,6 +2386,7 @@ function Avatar(_a) {
2386
2386
  }
2387
2387
 
2388
2388
  // src/components/TextField.tsx
2389
+ import React from "react";
2389
2390
  import { TextField as TextFieldRadix } from "@radix-ui/themes";
2390
2391
 
2391
2392
  // src/components/Flex.tsx
@@ -2660,62 +2661,73 @@ var InputAddon = styled(TextStyle, {
2660
2661
  });
2661
2662
  var maskFormat = format;
2662
2663
  var maskUnformat = unformat;
2663
- function TextField(_a) {
2664
- var _b = _a, {
2665
- children,
2666
- isValid: isValid2,
2667
- name,
2668
- color,
2669
- typography,
2670
- fontWeight,
2671
- addon,
2672
- textAlign = "left",
2673
- mask
2674
- } = _b, props = __objRest(_b, [
2675
- "children",
2676
- "isValid",
2677
- "name",
2678
- "color",
2679
- "typography",
2680
- "fontWeight",
2681
- "addon",
2682
- "textAlign",
2683
- "mask"
2684
- ]);
2685
- const maskRef = mask ? useMask(mask) : void 0;
2686
- return /* @__PURE__ */ jsxs(Flex2, { gap: "0", css: { width: "100%" }, children: [
2687
- !!addon && /* @__PURE__ */ jsx7(InputAddon, { typography: "labelSmall", children: addon }),
2688
- /* @__PURE__ */ jsxs(
2689
- TextFieldStyled,
2690
- __spreadProps(__spreadValues({
2691
- color,
2692
- isValid: isValid2,
2693
- name,
2694
- typography,
2695
- fontWeight,
2696
- textAlign,
2697
- ref: maskRef
2698
- }, props), {
2699
- style: addon ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" } : void 0,
2700
- children: [
2701
- children,
2702
- isValid2 && /* @__PURE__ */ jsx7(
2703
- TextFieldSlot,
2704
- {
2705
- position: "flex-end",
2706
- name,
2707
- color,
2708
- typography,
2709
- fontWeight,
2710
- textAlign,
2711
- children: /* @__PURE__ */ jsx7(Icon_default, { name: "check" })
2664
+ var TextField = React.forwardRef(
2665
+ (_a, fowardedRef) => {
2666
+ var _b = _a, {
2667
+ children,
2668
+ isValid: isValid2,
2669
+ name,
2670
+ color,
2671
+ typography,
2672
+ fontWeight,
2673
+ addon,
2674
+ textAlign = "left",
2675
+ mask
2676
+ } = _b, props = __objRest(_b, [
2677
+ "children",
2678
+ "isValid",
2679
+ "name",
2680
+ "color",
2681
+ "typography",
2682
+ "fontWeight",
2683
+ "addon",
2684
+ "textAlign",
2685
+ "mask"
2686
+ ]);
2687
+ const maskRef = mask ? useMask(mask) : void 0;
2688
+ return /* @__PURE__ */ jsxs(Flex2, { gap: "0", css: { width: "100%" }, children: [
2689
+ !!addon && /* @__PURE__ */ jsx7(InputAddon, { typography: "labelSmall", children: addon }),
2690
+ /* @__PURE__ */ jsxs(
2691
+ TextFieldStyled,
2692
+ __spreadProps(__spreadValues({
2693
+ color,
2694
+ isValid: isValid2,
2695
+ name,
2696
+ typography,
2697
+ fontWeight,
2698
+ textAlign,
2699
+ ref: (r) => {
2700
+ if (!r) return;
2701
+ if (maskRef) maskRef.current = r;
2702
+ if (fowardedRef) {
2703
+ if (typeof fowardedRef === "function") fowardedRef(r);
2704
+ else {
2705
+ fowardedRef.current = r;
2706
+ }
2712
2707
  }
2713
- )
2714
- ]
2715
- })
2716
- )
2717
- ] });
2718
- }
2708
+ }
2709
+ }, props), {
2710
+ style: addon ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" } : void 0,
2711
+ children: [
2712
+ children,
2713
+ isValid2 && /* @__PURE__ */ jsx7(
2714
+ TextFieldSlot,
2715
+ {
2716
+ position: "flex-end",
2717
+ name,
2718
+ color,
2719
+ typography,
2720
+ fontWeight,
2721
+ textAlign,
2722
+ children: /* @__PURE__ */ jsx7(Icon_default, { name: "check" })
2723
+ }
2724
+ )
2725
+ ]
2726
+ })
2727
+ )
2728
+ ] });
2729
+ }
2730
+ );
2719
2731
  function TextFieldSlot(_a) {
2720
2732
  var _b = _a, {
2721
2733
  children,
@@ -3423,7 +3435,7 @@ function DropdownMenuItem(_a) {
3423
3435
  }
3424
3436
 
3425
3437
  // src/components/Badge.tsx
3426
- import React from "react";
3438
+ import React2 from "react";
3427
3439
  import { Badge as BadgeRadix } from "@radix-ui/themes";
3428
3440
  import { jsx as jsx12 } from "react/jsx-runtime";
3429
3441
  var BadgeStyled = styled(BadgeRadix, {
@@ -3530,9 +3542,9 @@ var BadgeStyled = styled(BadgeRadix, {
3530
3542
  });
3531
3543
  function Badge(_a) {
3532
3544
  var _b = _a, { asChild, children } = _b, props = __objRest(_b, ["asChild", "children"]);
3533
- return /* @__PURE__ */ jsx12(BadgeStyled, __spreadProps(__spreadValues({}, props), { children: React.Children.map(children, (child) => {
3534
- if (React.isValidElement(child)) {
3535
- return React.cloneElement(child, { size: props.size });
3545
+ return /* @__PURE__ */ jsx12(BadgeStyled, __spreadProps(__spreadValues({}, props), { children: React2.Children.map(children, (child) => {
3546
+ if (React2.isValidElement(child)) {
3547
+ return React2.cloneElement(child, { size: props.size });
3536
3548
  }
3537
3549
  return child;
3538
3550
  }) }));
@@ -8481,7 +8493,7 @@ function Switch(props) {
8481
8493
  }
8482
8494
 
8483
8495
  // src/components/Step.tsx
8484
- import React4 from "react";
8496
+ import React5 from "react";
8485
8497
  import { Box as Box2, Tabs as StepRadix } from "@radix-ui/themes";
8486
8498
  import { jsx as jsx18 } from "react/jsx-runtime";
8487
8499
  var StepStyled = styled("div", {
@@ -8597,9 +8609,9 @@ function StepList(_a) {
8597
8609
  "children",
8598
8610
  "currentStep"
8599
8611
  ]);
8600
- return /* @__PURE__ */ jsx18(StepListStyled, __spreadProps(__spreadValues({}, props), { children: React4.Children.map(children, (child) => {
8601
- if (React4.isValidElement(child) && child.type === StepTrigger) {
8602
- return React4.cloneElement(child, { currentStep });
8612
+ return /* @__PURE__ */ jsx18(StepListStyled, __spreadProps(__spreadValues({}, props), { children: React5.Children.map(children, (child) => {
8613
+ if (React5.isValidElement(child) && child.type === StepTrigger) {
8614
+ return React5.cloneElement(child, { currentStep });
8603
8615
  }
8604
8616
  return child;
8605
8617
  }) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "11.0.2",
3
+ "version": "11.0.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1,89 +1,89 @@
1
- import { ComponentProps, ReactNode } from 'react'
2
- import { styled } from '../styles'
3
- import { TextField as TextFieldRadix } from '@radix-ui/themes'
4
- import Icon from './Icon'
5
- import { typographyValues } from '../types/typographyValues'
6
- import { TextStyle } from './Text'
7
- import { Flex } from './Flex'
8
- import { format, MaskOptions, useMask, unformat } from '@react-input/mask'
1
+ import React, { ComponentProps, ReactNode } from "react";
2
+ import { styled } from "../styles";
3
+ import { TextField as TextFieldRadix } from "@radix-ui/themes";
4
+ import Icon from "./Icon";
5
+ import { typographyValues } from "../types/typographyValues";
6
+ import { TextStyle } from "./Text";
7
+ import { Flex } from "./Flex";
8
+ import { format, MaskOptions, useMask, unformat } from "@react-input/mask";
9
9
 
10
10
  export const TextFieldStyled = styled(TextFieldRadix.Root, {
11
- height: '$40',
12
- fontFamily: '$default',
13
- borderRadius: '$sm',
14
- boxSizing: 'border-box',
15
- color: '$dark500',
16
- border: '1px solid $dark300',
17
- position: 'relative',
18
- display: 'flex',
19
- width: '100%',
20
- alignItems: 'center',
21
- padding: '0 $14',
22
- gap: '$14',
11
+ height: "$40",
12
+ fontFamily: "$default",
13
+ borderRadius: "$sm",
14
+ boxSizing: "border-box",
15
+ color: "$dark500",
16
+ border: "1px solid $dark300",
17
+ position: "relative",
18
+ display: "flex",
19
+ width: "100%",
20
+ alignItems: "center",
21
+ padding: "0 $14",
22
+ gap: "$14",
23
23
  input: {
24
24
  order: 1,
25
- outline: 'none',
26
- border: 'none',
25
+ outline: "none",
26
+ border: "none",
27
27
  margin: 0,
28
- width: '100%',
29
- font: 'inherit',
30
- textAlign: 'left',
28
+ width: "100%",
29
+ font: "inherit",
30
+ textAlign: "left",
31
31
  },
32
32
 
33
- '&:has(input:focus)': {
34
- border: '2px solid $brand300',
33
+ "&:has(input:focus)": {
34
+ border: "2px solid $brand300",
35
35
  },
36
- '&:has(input:disabled)': {
37
- backgroundColor: '$dark100',
38
- color: '$dark400',
39
- border: '1px solid $dark200',
40
- cursor: 'not-allowed',
36
+ "&:has(input:disabled)": {
37
+ backgroundColor: "$dark100",
38
+ color: "$dark400",
39
+ border: "1px solid $dark200",
40
+ cursor: "not-allowed",
41
41
  },
42
42
 
43
43
  variants: {
44
44
  color: {
45
45
  default: {
46
- color: '$dark400',
47
- border: '1px solid $dark200',
48
- '&:has(input:focus)': {
49
- border: '2px solid $brand300',
46
+ color: "$dark400",
47
+ border: "1px solid $dark200",
48
+ "&:has(input:focus)": {
49
+ border: "2px solid $brand300",
50
50
  },
51
- '&:has(input:disabled)': {
52
- backgroundColor: '$dark100',
53
- color: '$dark400',
54
- border: '1px solid $dark200',
55
- cursor: 'not-allowed',
51
+ "&:has(input:disabled)": {
52
+ backgroundColor: "$dark100",
53
+ color: "$dark400",
54
+ border: "1px solid $dark200",
55
+ cursor: "not-allowed",
56
56
  },
57
57
  },
58
58
  error: {
59
- border: '1px solid $error400',
60
- color: '$error400',
61
- 'input::placeholder': {
62
- color: '$error400',
59
+ border: "1px solid $error400",
60
+ color: "$error400",
61
+ "input::placeholder": {
62
+ color: "$error400",
63
63
  },
64
- '&:has(input:focus)': {
65
- border: '2px solid $error400',
64
+ "&:has(input:focus)": {
65
+ border: "2px solid $error400",
66
66
  },
67
- '&:has(input:disabled)': {
68
- backgroundColor: '$error50',
69
- color: '$error300',
70
- border: '1px solid $error100',
71
- cursor: 'not-allowed',
67
+ "&:has(input:disabled)": {
68
+ backgroundColor: "$error50",
69
+ color: "$error300",
70
+ border: "1px solid $error100",
71
+ cursor: "not-allowed",
72
72
  },
73
73
  },
74
74
  },
75
75
 
76
76
  typography: typographyValues,
77
77
  fontWeight: {
78
- regular: { fontWeight: '$regular' },
79
- medium: { fontWeight: '$medium' },
80
- semibold: { fontWeight: '$semibold' },
81
- bold: { fontWeight: '$bold' },
78
+ regular: { fontWeight: "$regular" },
79
+ medium: { fontWeight: "$medium" },
80
+ semibold: { fontWeight: "$semibold" },
81
+ bold: { fontWeight: "$bold" },
82
82
  },
83
83
  textAlign: {
84
- left: { textAlign: 'left' },
85
- center: { textAlign: 'center' },
86
- right: { textAlign: 'right' },
84
+ left: { textAlign: "left" },
85
+ center: { textAlign: "center" },
86
+ right: { textAlign: "right" },
87
87
  },
88
88
  isValid: {
89
89
  true: {},
@@ -95,171 +95,186 @@ export const TextFieldStyled = styled(TextFieldRadix.Root, {
95
95
  {
96
96
  isValid: false,
97
97
  css: {
98
- border: '1px solid $error400',
99
- color: '$error400',
100
- backgroundColor: '$error50',
98
+ border: "1px solid $error400",
99
+ color: "$error400",
100
+ backgroundColor: "$error50",
101
101
  input: {
102
- '&::placeholder': {
103
- color: '$error400',
102
+ "&::placeholder": {
103
+ color: "$error400",
104
104
  },
105
- backgroundColor: '$error50',
105
+ backgroundColor: "$error50",
106
106
  },
107
- '&:has(input:focus)': {
108
- border: '2px solid $error400',
107
+ "&:has(input:focus)": {
108
+ border: "2px solid $error400",
109
109
  },
110
- '&:has(input:disabled)': {
110
+ "&:has(input:disabled)": {
111
111
  input: {
112
- backgroundColor: '$error50',
112
+ backgroundColor: "$error50",
113
113
  },
114
- backgroundColor: '$error50',
115
- color: '$error300',
116
- border: '1px solid $error100',
117
- cursor: 'not-allowed',
114
+ backgroundColor: "$error50",
115
+ color: "$error300",
116
+ border: "1px solid $error100",
117
+ cursor: "not-allowed",
118
118
  },
119
119
  },
120
120
  },
121
121
  {
122
122
  isValid: true,
123
123
  css: {
124
- '&:has(input:focus)': {
125
- border: '2px solid $success500',
124
+ "&:has(input:focus)": {
125
+ border: "2px solid $success500",
126
126
  },
127
- '&:has(input:disabled)': {
128
- backgroundColor: '$dark100',
129
- color: '$dark400',
130
- border: '1px solid $dark200',
131
- cursor: 'not-allowed',
127
+ "&:has(input:disabled)": {
128
+ backgroundColor: "$dark100",
129
+ color: "$dark400",
130
+ border: "1px solid $dark200",
131
+ cursor: "not-allowed",
132
132
  },
133
133
  },
134
134
  },
135
135
  ],
136
- })
136
+ });
137
137
 
138
138
  export const TextFieldSlotStyled = styled(TextFieldRadix.Slot, {
139
- display: 'flex',
140
- alignItems: 'center',
141
- justifyContent: 'center',
139
+ display: "flex",
140
+ alignItems: "center",
141
+ justifyContent: "center",
142
142
  padding: 4,
143
143
 
144
144
  variants: {
145
145
  typography: typographyValues,
146
146
  fontWeight: {
147
- regular: { fontWeight: '$regular' },
148
- medium: { fontWeight: '$medium' },
149
- semibold: { fontWeight: '$semibold' },
150
- bold: { fontWeight: '$bold' },
147
+ regular: { fontWeight: "$regular" },
148
+ medium: { fontWeight: "$medium" },
149
+ semibold: { fontWeight: "$semibold" },
150
+ bold: { fontWeight: "$bold" },
151
151
  },
152
152
  textAlign: {
153
- left: { textAlign: 'left' },
154
- right: { textAlign: 'right' },
155
- center: { textAlign: 'center' },
153
+ left: { textAlign: "left" },
154
+ right: { textAlign: "right" },
155
+ center: { textAlign: "center" },
156
156
  },
157
157
  },
158
- })
158
+ });
159
159
 
160
160
  export type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
161
- addon?: ReactNode
162
- placeholder?: string
163
- children?: React.ReactNode
164
- isValid?: boolean
165
- name?: string
166
- typography?: string
167
- fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold'
168
- textAlign?: 'left' | 'right' | 'center'
169
- mask?: MaskOptions
170
- }
161
+ addon?: ReactNode;
162
+ placeholder?: string;
163
+ children?: React.ReactNode;
164
+ isValid?: boolean;
165
+ name?: string;
166
+ typography?: string;
167
+ fontWeight?: "regular" | "medium" | "semibold" | "bold";
168
+ textAlign?: "left" | "right" | "center";
169
+ mask?: MaskOptions;
170
+ };
171
171
 
172
172
  export type TextFieldSlotProps = Omit<
173
173
  ComponentProps<typeof TextFieldStyled>,
174
- 'color'
174
+ "color"
175
175
  > & {
176
- placeholder?: string
177
- children?: React.ReactNode
178
- position?: 'flex-start' | 'flex-end'
179
- onClick?: () => void
180
- color?: 'error' | 'success' | undefined
181
- typography?: string
182
- fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold'
183
- textAlign?: 'left' | 'right' | 'center'
184
- }
176
+ placeholder?: string;
177
+ children?: React.ReactNode;
178
+ position?: "flex-start" | "flex-end";
179
+ onClick?: () => void;
180
+ color?: "error" | "success" | undefined;
181
+ typography?: string;
182
+ fontWeight?: "regular" | "medium" | "semibold" | "bold";
183
+ textAlign?: "left" | "right" | "center";
184
+ };
185
185
 
186
186
  const InputAddon = styled(TextStyle, {
187
- boxSizing: 'border-box',
188
- border: '1px solid $dark300',
189
- height: '$40',
190
- padding: '0 $12',
191
- margin: '0 auto',
187
+ boxSizing: "border-box",
188
+ border: "1px solid $dark300",
189
+ height: "$40",
190
+ padding: "0 $12",
191
+ margin: "0 auto",
192
192
 
193
- color: '$dark600',
194
- whiteSpace: 'nowrap',
195
- borderRadius: '$sm 0px 0px $sm',
196
- borderRightWidth: '0px',
197
- display: 'flex',
198
- flexWrap: 'nowrap',
199
- alignItems: 'center',
193
+ color: "$dark600",
194
+ whiteSpace: "nowrap",
195
+ borderRadius: "$sm 0px 0px $sm",
196
+ borderRightWidth: "0px",
197
+ display: "flex",
198
+ flexWrap: "nowrap",
199
+ alignItems: "center",
200
200
  lineHeight: 1,
201
- })
202
- export const maskFormat = format
203
- export const maskUnformat = unformat
201
+ });
202
+ export const maskFormat = format;
203
+ export const maskUnformat = unformat;
204
204
 
205
- export function TextField({
206
- children,
207
- isValid,
208
- name,
209
- color,
210
- typography,
211
- fontWeight,
212
- addon,
213
- textAlign = 'left',
214
- mask,
215
- ...props
216
- }: TextFieldProps) {
217
- const maskRef = mask ? useMask(mask) : undefined
205
+ export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
206
+ (
207
+ {
208
+ children,
209
+ isValid,
210
+ name,
211
+ color,
212
+ typography,
213
+ fontWeight,
214
+ addon,
215
+ textAlign = "left",
216
+ mask,
217
+ ...props
218
+ },
219
+ fowardedRef
220
+ ) => {
221
+ const maskRef = mask ? useMask(mask) : undefined;
218
222
 
219
- return (
220
- <Flex gap={'0'} css={{ width: '100%' }}>
221
- {!!addon && <InputAddon typography="labelSmall">{addon}</InputAddon>}
223
+ return (
224
+ <Flex gap={"0"} css={{ width: "100%" }}>
225
+ {!!addon && <InputAddon typography="labelSmall">{addon}</InputAddon>}
222
226
 
223
- <TextFieldStyled
224
- color={color}
225
- isValid={isValid}
226
- name={name}
227
- typography={typography}
228
- fontWeight={fontWeight}
229
- textAlign={textAlign}
230
- ref={maskRef}
231
- {...props}
232
- style={
233
- addon
234
- ? { borderTopLeftRadius: '0px', borderBottomLeftRadius: '0px' }
235
- : undefined
236
- }
237
- >
238
- {children}
239
- {isValid && (
240
- <TextFieldSlot
241
- position="flex-end"
242
- name={name}
243
- color={color as TextFieldSlotProps['color']}
244
- typography={typography}
245
- fontWeight={fontWeight}
246
- textAlign={textAlign}
247
- >
248
- <Icon name="check" />
249
- </TextFieldSlot>
250
- )}
251
- </TextFieldStyled>
252
- </Flex>
253
- )
254
- }
227
+ <TextFieldStyled
228
+ color={color}
229
+ isValid={isValid}
230
+ name={name}
231
+ typography={typography}
232
+ fontWeight={fontWeight}
233
+ textAlign={textAlign}
234
+ ref={(r) => {
235
+ if (!r) return;
236
+ if (maskRef) maskRef.current = r;
237
+
238
+ if (fowardedRef) {
239
+ if (typeof fowardedRef === "function") fowardedRef(r);
240
+ else {
241
+ fowardedRef.current = r;
242
+ }
243
+ }
244
+ }}
245
+ {...props}
246
+ style={
247
+ addon
248
+ ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" }
249
+ : undefined
250
+ }
251
+ >
252
+ {children}
253
+ {isValid && (
254
+ <TextFieldSlot
255
+ position="flex-end"
256
+ name={name}
257
+ color={color as TextFieldSlotProps["color"]}
258
+ typography={typography}
259
+ fontWeight={fontWeight}
260
+ textAlign={textAlign}
261
+ >
262
+ <Icon name="check" />
263
+ </TextFieldSlot>
264
+ )}
265
+ </TextFieldStyled>
266
+ </Flex>
267
+ );
268
+ }
269
+ );
255
270
 
256
271
  export function TextFieldSlot({
257
272
  children,
258
- position = 'flex-start',
273
+ position = "flex-start",
259
274
  onClick,
260
- typography = 'bodyXS',
261
- fontWeight = 'regular',
262
- textAlign = 'right',
275
+ typography = "bodyXS",
276
+ fontWeight = "regular",
277
+ textAlign = "right",
263
278
  ...props
264
279
  }: TextFieldSlotProps) {
265
280
  const sharedStyles = {
@@ -268,17 +283,17 @@ export function TextFieldSlot({
268
283
  textAlign,
269
284
  ...props,
270
285
  color: undefined,
271
- }
286
+ };
272
287
 
273
288
  return onClick ? (
274
289
  <TextFieldSlotStyled
275
290
  {...sharedStyles}
276
291
  style={{
277
- float: position === 'flex-start' ? 'left' : 'right',
278
- order: position === 'flex-start' ? 0 : 2,
292
+ float: position === "flex-start" ? "left" : "right",
293
+ order: position === "flex-start" ? 0 : 2,
279
294
  textAlign,
280
295
  zIndex: 2,
281
- cursor: 'pointer',
296
+ cursor: "pointer",
282
297
  }}
283
298
  onClick={() => onClick()}
284
299
  >
@@ -288,12 +303,12 @@ export function TextFieldSlot({
288
303
  <TextFieldSlotStyled
289
304
  {...sharedStyles}
290
305
  style={{
291
- float: position === 'flex-start' ? 'left' : 'right',
292
- order: position === 'flex-start' ? 0 : 2,
306
+ float: position === "flex-start" ? "left" : "right",
307
+ order: position === "flex-start" ? 0 : 2,
293
308
  textAlign,
294
309
  }}
295
310
  >
296
311
  {children}
297
312
  </TextFieldSlotStyled>
298
- )
313
+ );
299
314
  }