@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.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +105 -93
- package/dist/index.mjs +75 -63
- package/package.json +1 -1
- package/src/components/TextField.tsx +201 -186
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @lets-events/react@11.0.
|
|
2
|
+
> @lets-events/react@11.0.4 build
|
|
3
3
|
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist\index.mjs [22m[32m275.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist\index.js [22m[32m283.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m275.57 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 232ms
|
|
13
|
+
[32mCJS[39m [1mdist\index.js [22m[32m283.95 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 232ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist\index.d.mts [22m[32m338.
|
|
18
|
-
[32mDTS[39m [1mdist\index.d.ts [22m[32m338.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 3634ms
|
|
17
|
+
[32mDTS[39m [1mdist\index.d.mts [22m[32m338.33 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist\index.d.ts [22m[32m338.33 KB[39m
|
package/CHANGELOG.md
CHANGED
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<
|
|
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<
|
|
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?:
|
|
2682
|
+
children?: react__default.ReactNode;
|
|
2683
2683
|
isValid?: boolean;
|
|
2684
2684
|
name?: string;
|
|
2685
2685
|
typography?: string;
|
|
2686
|
-
fontWeight?:
|
|
2687
|
-
textAlign?:
|
|
2686
|
+
fontWeight?: "regular" | "medium" | "semibold" | "bold";
|
|
2687
|
+
textAlign?: "left" | "right" | "center";
|
|
2688
2688
|
mask?: MaskOptions;
|
|
2689
2689
|
};
|
|
2690
|
-
type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>,
|
|
2690
|
+
type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, "color"> & {
|
|
2691
2691
|
placeholder?: string;
|
|
2692
|
-
children?:
|
|
2693
|
-
position?:
|
|
2692
|
+
children?: react__default.ReactNode;
|
|
2693
|
+
position?: "flex-start" | "flex-end";
|
|
2694
2694
|
onClick?: () => void;
|
|
2695
|
-
color?:
|
|
2695
|
+
color?: "error" | "success" | undefined;
|
|
2696
2696
|
typography?: string;
|
|
2697
|
-
fontWeight?:
|
|
2698
|
-
textAlign?:
|
|
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
|
|
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<
|
|
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<
|
|
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?:
|
|
2682
|
+
children?: react__default.ReactNode;
|
|
2683
2683
|
isValid?: boolean;
|
|
2684
2684
|
name?: string;
|
|
2685
2685
|
typography?: string;
|
|
2686
|
-
fontWeight?:
|
|
2687
|
-
textAlign?:
|
|
2686
|
+
fontWeight?: "regular" | "medium" | "semibold" | "bold";
|
|
2687
|
+
textAlign?: "left" | "right" | "center";
|
|
2688
2688
|
mask?: MaskOptions;
|
|
2689
2689
|
};
|
|
2690
|
-
type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>,
|
|
2690
|
+
type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, "color"> & {
|
|
2691
2691
|
placeholder?: string;
|
|
2692
|
-
children?:
|
|
2693
|
-
position?:
|
|
2692
|
+
children?: react__default.ReactNode;
|
|
2693
|
+
position?: "flex-start" | "flex-end";
|
|
2694
2694
|
onClick?: () => void;
|
|
2695
|
-
color?:
|
|
2695
|
+
color?: "error" | "success" | undefined;
|
|
2696
2696
|
typography?: string;
|
|
2697
|
-
fontWeight?:
|
|
2698
|
-
textAlign?:
|
|
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
|
|
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
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
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
|
|
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:
|
|
3620
|
-
if (
|
|
3621
|
-
return
|
|
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
|
|
3708
|
+
var import_react5 = require("react");
|
|
3697
3709
|
|
|
3698
3710
|
// src/hooks/useOnClickOutside.tsx
|
|
3699
|
-
var
|
|
3711
|
+
var import_react4 = require("react");
|
|
3700
3712
|
function useOnClickOutside(ref, handler) {
|
|
3701
|
-
(0,
|
|
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,
|
|
7839
|
-
const [showContainer, setShowCalendar] = (0,
|
|
7840
|
-
const dropdownRef = (0,
|
|
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,
|
|
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
|
|
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,
|
|
8028
|
-
const [minutes, setMinutes] = (0,
|
|
8029
|
-
const [rawHours, setRawHours] = (0,
|
|
8030
|
-
const [rawMinutes, setRawMinutes] = (0,
|
|
8031
|
-
const [isOpen, setIsOpen] = (0,
|
|
8032
|
-
const dropdownRef = (0,
|
|
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,
|
|
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,
|
|
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
|
|
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:
|
|
8687
|
-
if (
|
|
8688
|
-
return
|
|
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
|
|
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,
|
|
8805
|
-
const badgeRef = (0,
|
|
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
|
|
8840
|
+
var import_react10 = require("react");
|
|
8829
8841
|
|
|
8830
8842
|
// src/components/Toast/styles/index.ts
|
|
8831
|
-
var
|
|
8843
|
+
var import_react9 = require("@stitches/react");
|
|
8832
8844
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
8833
|
-
var slideIn = (0,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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
|
|
9041
|
+
var import_react12 = require("react");
|
|
9030
9042
|
var useToast = () => {
|
|
9031
|
-
const context = (0,
|
|
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
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
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
|
|
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:
|
|
3534
|
-
if (
|
|
3535
|
-
return
|
|
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
|
|
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:
|
|
8601
|
-
if (
|
|
8602
|
-
return
|
|
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,89 +1,89 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from
|
|
2
|
-
import { styled } from
|
|
3
|
-
import { TextField as TextFieldRadix } from
|
|
4
|
-
import Icon from
|
|
5
|
-
import { typographyValues } from
|
|
6
|
-
import { TextStyle } from
|
|
7
|
-
import { Flex } from
|
|
8
|
-
import { format, MaskOptions, useMask, unformat } from
|
|
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:
|
|
12
|
-
fontFamily:
|
|
13
|
-
borderRadius:
|
|
14
|
-
boxSizing:
|
|
15
|
-
color:
|
|
16
|
-
border:
|
|
17
|
-
position:
|
|
18
|
-
display:
|
|
19
|
-
width:
|
|
20
|
-
alignItems:
|
|
21
|
-
padding:
|
|
22
|
-
gap:
|
|
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:
|
|
26
|
-
border:
|
|
25
|
+
outline: "none",
|
|
26
|
+
border: "none",
|
|
27
27
|
margin: 0,
|
|
28
|
-
width:
|
|
29
|
-
font:
|
|
30
|
-
textAlign:
|
|
28
|
+
width: "100%",
|
|
29
|
+
font: "inherit",
|
|
30
|
+
textAlign: "left",
|
|
31
31
|
},
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
border:
|
|
33
|
+
"&:has(input:focus)": {
|
|
34
|
+
border: "2px solid $brand300",
|
|
35
35
|
},
|
|
36
|
-
|
|
37
|
-
backgroundColor:
|
|
38
|
-
color:
|
|
39
|
-
border:
|
|
40
|
-
cursor:
|
|
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:
|
|
47
|
-
border:
|
|
48
|
-
|
|
49
|
-
border:
|
|
46
|
+
color: "$dark400",
|
|
47
|
+
border: "1px solid $dark200",
|
|
48
|
+
"&:has(input:focus)": {
|
|
49
|
+
border: "2px solid $brand300",
|
|
50
50
|
},
|
|
51
|
-
|
|
52
|
-
backgroundColor:
|
|
53
|
-
color:
|
|
54
|
-
border:
|
|
55
|
-
cursor:
|
|
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:
|
|
60
|
-
color:
|
|
61
|
-
|
|
62
|
-
color:
|
|
59
|
+
border: "1px solid $error400",
|
|
60
|
+
color: "$error400",
|
|
61
|
+
"input::placeholder": {
|
|
62
|
+
color: "$error400",
|
|
63
63
|
},
|
|
64
|
-
|
|
65
|
-
border:
|
|
64
|
+
"&:has(input:focus)": {
|
|
65
|
+
border: "2px solid $error400",
|
|
66
66
|
},
|
|
67
|
-
|
|
68
|
-
backgroundColor:
|
|
69
|
-
color:
|
|
70
|
-
border:
|
|
71
|
-
cursor:
|
|
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:
|
|
79
|
-
medium: { fontWeight:
|
|
80
|
-
semibold: { fontWeight:
|
|
81
|
-
bold: { fontWeight:
|
|
78
|
+
regular: { fontWeight: "$regular" },
|
|
79
|
+
medium: { fontWeight: "$medium" },
|
|
80
|
+
semibold: { fontWeight: "$semibold" },
|
|
81
|
+
bold: { fontWeight: "$bold" },
|
|
82
82
|
},
|
|
83
83
|
textAlign: {
|
|
84
|
-
left: { textAlign:
|
|
85
|
-
center: { textAlign:
|
|
86
|
-
right: { textAlign:
|
|
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:
|
|
99
|
-
color:
|
|
100
|
-
backgroundColor:
|
|
98
|
+
border: "1px solid $error400",
|
|
99
|
+
color: "$error400",
|
|
100
|
+
backgroundColor: "$error50",
|
|
101
101
|
input: {
|
|
102
|
-
|
|
103
|
-
color:
|
|
102
|
+
"&::placeholder": {
|
|
103
|
+
color: "$error400",
|
|
104
104
|
},
|
|
105
|
-
backgroundColor:
|
|
105
|
+
backgroundColor: "$error50",
|
|
106
106
|
},
|
|
107
|
-
|
|
108
|
-
border:
|
|
107
|
+
"&:has(input:focus)": {
|
|
108
|
+
border: "2px solid $error400",
|
|
109
109
|
},
|
|
110
|
-
|
|
110
|
+
"&:has(input:disabled)": {
|
|
111
111
|
input: {
|
|
112
|
-
backgroundColor:
|
|
112
|
+
backgroundColor: "$error50",
|
|
113
113
|
},
|
|
114
|
-
backgroundColor:
|
|
115
|
-
color:
|
|
116
|
-
border:
|
|
117
|
-
cursor:
|
|
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
|
-
|
|
125
|
-
border:
|
|
124
|
+
"&:has(input:focus)": {
|
|
125
|
+
border: "2px solid $success500",
|
|
126
126
|
},
|
|
127
|
-
|
|
128
|
-
backgroundColor:
|
|
129
|
-
color:
|
|
130
|
-
border:
|
|
131
|
-
cursor:
|
|
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:
|
|
140
|
-
alignItems:
|
|
141
|
-
justifyContent:
|
|
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:
|
|
148
|
-
medium: { fontWeight:
|
|
149
|
-
semibold: { fontWeight:
|
|
150
|
-
bold: { fontWeight:
|
|
147
|
+
regular: { fontWeight: "$regular" },
|
|
148
|
+
medium: { fontWeight: "$medium" },
|
|
149
|
+
semibold: { fontWeight: "$semibold" },
|
|
150
|
+
bold: { fontWeight: "$bold" },
|
|
151
151
|
},
|
|
152
152
|
textAlign: {
|
|
153
|
-
left: { textAlign:
|
|
154
|
-
right: { textAlign:
|
|
155
|
-
center: { textAlign:
|
|
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?:
|
|
168
|
-
textAlign?:
|
|
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
|
-
|
|
174
|
+
"color"
|
|
175
175
|
> & {
|
|
176
|
-
placeholder?: string
|
|
177
|
-
children?: React.ReactNode
|
|
178
|
-
position?:
|
|
179
|
-
onClick?: () => void
|
|
180
|
-
color?:
|
|
181
|
-
typography?: string
|
|
182
|
-
fontWeight?:
|
|
183
|
-
textAlign?:
|
|
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:
|
|
188
|
-
border:
|
|
189
|
-
height:
|
|
190
|
-
padding:
|
|
191
|
-
margin:
|
|
187
|
+
boxSizing: "border-box",
|
|
188
|
+
border: "1px solid $dark300",
|
|
189
|
+
height: "$40",
|
|
190
|
+
padding: "0 $12",
|
|
191
|
+
margin: "0 auto",
|
|
192
192
|
|
|
193
|
-
color:
|
|
194
|
-
whiteSpace:
|
|
195
|
-
borderRadius:
|
|
196
|
-
borderRightWidth:
|
|
197
|
-
display:
|
|
198
|
-
flexWrap:
|
|
199
|
-
alignItems:
|
|
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
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
220
|
-
|
|
221
|
-
|
|
223
|
+
return (
|
|
224
|
+
<Flex gap={"0"} css={{ width: "100%" }}>
|
|
225
|
+
{!!addon && <InputAddon typography="labelSmall">{addon}</InputAddon>}
|
|
222
226
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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 =
|
|
273
|
+
position = "flex-start",
|
|
259
274
|
onClick,
|
|
260
|
-
typography =
|
|
261
|
-
fontWeight =
|
|
262
|
-
textAlign =
|
|
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 ===
|
|
278
|
-
order: position ===
|
|
292
|
+
float: position === "flex-start" ? "left" : "right",
|
|
293
|
+
order: position === "flex-start" ? 0 : 2,
|
|
279
294
|
textAlign,
|
|
280
295
|
zIndex: 2,
|
|
281
|
-
cursor:
|
|
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 ===
|
|
292
|
-
order: position ===
|
|
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
|
}
|