@lets-events/react 11.0.3 → 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 +6 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +105 -102
- package/dist/index.mjs +75 -72
- package/package.json +1 -1
- package/src/components/TextField.tsx +62 -55
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
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
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
|
@@ -2699,7 +2699,7 @@ type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, "color">
|
|
|
2699
2699
|
};
|
|
2700
2700
|
declare const maskFormat: typeof format;
|
|
2701
2701
|
declare const maskUnformat: typeof unformat;
|
|
2702
|
-
declare const TextField:
|
|
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
|
@@ -2699,7 +2699,7 @@ type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, "color">
|
|
|
2699
2699
|
};
|
|
2700
2700
|
declare const maskFormat: typeof format;
|
|
2701
2701
|
declare const maskUnformat: typeof unformat;
|
|
2702
|
-
declare const TextField:
|
|
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,71 +2747,73 @@ var InputAddon = styled(TextStyle, {
|
|
|
2746
2747
|
});
|
|
2747
2748
|
var maskFormat = import_mask.format;
|
|
2748
2749
|
var maskUnformat = import_mask.unformat;
|
|
2749
|
-
var TextField = (
|
|
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
|
-
}
|
|
2793
|
-
}, props), {
|
|
2794
|
-
style: addon ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" } : void 0,
|
|
2795
|
-
children: [
|
|
2796
|
-
children,
|
|
2797
|
-
isValid2 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2798
|
-
TextFieldSlot,
|
|
2799
|
-
{
|
|
2800
|
-
position: "flex-end",
|
|
2801
|
-
name,
|
|
2802
|
-
color,
|
|
2803
|
-
typography,
|
|
2804
|
-
fontWeight,
|
|
2805
|
-
textAlign,
|
|
2806
|
-
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
|
+
}
|
|
2807
2793
|
}
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
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
|
+
);
|
|
2814
2817
|
function TextFieldSlot(_a) {
|
|
2815
2818
|
var _b = _a, {
|
|
2816
2819
|
children,
|
|
@@ -3518,7 +3521,7 @@ function DropdownMenuItem(_a) {
|
|
|
3518
3521
|
}
|
|
3519
3522
|
|
|
3520
3523
|
// src/components/Badge.tsx
|
|
3521
|
-
var
|
|
3524
|
+
var import_react3 = __toESM(require("react"));
|
|
3522
3525
|
var import_themes12 = require("@radix-ui/themes");
|
|
3523
3526
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3524
3527
|
var BadgeStyled = styled(import_themes12.Badge, {
|
|
@@ -3625,9 +3628,9 @@ var BadgeStyled = styled(import_themes12.Badge, {
|
|
|
3625
3628
|
});
|
|
3626
3629
|
function Badge(_a) {
|
|
3627
3630
|
var _b = _a, { asChild, children } = _b, props = __objRest(_b, ["asChild", "children"]);
|
|
3628
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BadgeStyled, __spreadProps(__spreadValues({}, props), { children:
|
|
3629
|
-
if (
|
|
3630
|
-
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 });
|
|
3631
3634
|
}
|
|
3632
3635
|
return child;
|
|
3633
3636
|
}) }));
|
|
@@ -3702,12 +3705,12 @@ function Modal(_a) {
|
|
|
3702
3705
|
}
|
|
3703
3706
|
|
|
3704
3707
|
// src/components/Calendar/index.tsx
|
|
3705
|
-
var
|
|
3708
|
+
var import_react5 = require("react");
|
|
3706
3709
|
|
|
3707
3710
|
// src/hooks/useOnClickOutside.tsx
|
|
3708
|
-
var
|
|
3711
|
+
var import_react4 = require("react");
|
|
3709
3712
|
function useOnClickOutside(ref, handler) {
|
|
3710
|
-
(0,
|
|
3713
|
+
(0, import_react4.useEffect)(() => {
|
|
3711
3714
|
const listener = (event) => {
|
|
3712
3715
|
if (!ref.current || ref.current.contains(event.target)) {
|
|
3713
3716
|
return;
|
|
@@ -7844,15 +7847,15 @@ function Calendar(_a) {
|
|
|
7844
7847
|
"setSelected",
|
|
7845
7848
|
"position"
|
|
7846
7849
|
]);
|
|
7847
|
-
const [inputValue, setInputValue] = (0,
|
|
7848
|
-
const [showContainer, setShowCalendar] = (0,
|
|
7849
|
-
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);
|
|
7850
7853
|
useOnClickOutside(dropdownRef, () => {
|
|
7851
7854
|
setShowCalendar(false);
|
|
7852
7855
|
});
|
|
7853
7856
|
const today = /* @__PURE__ */ new Date();
|
|
7854
7857
|
const maxDate = addYears(today, 20);
|
|
7855
|
-
(0,
|
|
7858
|
+
(0, import_react5.useEffect)(() => {
|
|
7856
7859
|
if (selected) {
|
|
7857
7860
|
setInputValue(format2(selected, "dd/MM/yyyy"));
|
|
7858
7861
|
} else {
|
|
@@ -7929,7 +7932,7 @@ function Calendar(_a) {
|
|
|
7929
7932
|
}
|
|
7930
7933
|
|
|
7931
7934
|
// src/components/TimePicker.tsx
|
|
7932
|
-
var
|
|
7935
|
+
var import_react6 = require("react");
|
|
7933
7936
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
7934
7937
|
var TimePickerStyled = styled("div", {
|
|
7935
7938
|
position: "relative",
|
|
@@ -8033,14 +8036,14 @@ function TimePicker({
|
|
|
8033
8036
|
setSelected,
|
|
8034
8037
|
position = "bottom"
|
|
8035
8038
|
}) {
|
|
8036
|
-
const [hours, setHours] = (0,
|
|
8037
|
-
const [minutes, setMinutes] = (0,
|
|
8038
|
-
const [rawHours, setRawHours] = (0,
|
|
8039
|
-
const [rawMinutes, setRawMinutes] = (0,
|
|
8040
|
-
const [isOpen, setIsOpen] = (0,
|
|
8041
|
-
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);
|
|
8042
8045
|
useOnClickOutside(dropdownRef, () => setIsOpen(false));
|
|
8043
|
-
const handleIncrement = (0,
|
|
8046
|
+
const handleIncrement = (0, import_react6.useCallback)(
|
|
8044
8047
|
(type) => {
|
|
8045
8048
|
if (type === "hours") {
|
|
8046
8049
|
const next = (parseInt(hours) + 1) % 24;
|
|
@@ -8054,7 +8057,7 @@ function TimePicker({
|
|
|
8054
8057
|
},
|
|
8055
8058
|
[hours, minutes]
|
|
8056
8059
|
);
|
|
8057
|
-
const handleDecrement = (0,
|
|
8060
|
+
const handleDecrement = (0, import_react6.useCallback)(
|
|
8058
8061
|
(type) => {
|
|
8059
8062
|
if (type === "hours") {
|
|
8060
8063
|
const prev = (parseInt(hours) - 1 + 24) % 24;
|
|
@@ -8576,7 +8579,7 @@ function Switch(props) {
|
|
|
8576
8579
|
}
|
|
8577
8580
|
|
|
8578
8581
|
// src/components/Step.tsx
|
|
8579
|
-
var
|
|
8582
|
+
var import_react7 = __toESM(require("react"));
|
|
8580
8583
|
var import_themes16 = require("@radix-ui/themes");
|
|
8581
8584
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
8582
8585
|
var StepStyled = styled("div", {
|
|
@@ -8692,9 +8695,9 @@ function StepList(_a) {
|
|
|
8692
8695
|
"children",
|
|
8693
8696
|
"currentStep"
|
|
8694
8697
|
]);
|
|
8695
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children:
|
|
8696
|
-
if (
|
|
8697
|
-
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 });
|
|
8698
8701
|
}
|
|
8699
8702
|
return child;
|
|
8700
8703
|
}) }));
|
|
@@ -8751,7 +8754,7 @@ function Card(_a) {
|
|
|
8751
8754
|
|
|
8752
8755
|
// src/components/TextareaField.tsx
|
|
8753
8756
|
var import_themes18 = require("@radix-ui/themes");
|
|
8754
|
-
var
|
|
8757
|
+
var import_react8 = require("react");
|
|
8755
8758
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
8756
8759
|
var TextareaFieldStyle = styled(import_themes18.TextArea, {
|
|
8757
8760
|
display: "flex",
|
|
@@ -8810,8 +8813,8 @@ var TextareaLimitIndicator = styled("div", {
|
|
|
8810
8813
|
});
|
|
8811
8814
|
function TextareaField(_a) {
|
|
8812
8815
|
var _b = _a, { maxLength } = _b, props = __objRest(_b, ["maxLength"]);
|
|
8813
|
-
const inputRef = (0,
|
|
8814
|
-
const badgeRef = (0,
|
|
8816
|
+
const inputRef = (0, import_react8.useRef)(null);
|
|
8817
|
+
const badgeRef = (0, import_react8.useRef)(null);
|
|
8815
8818
|
if (!maxLength) {
|
|
8816
8819
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextareaContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextareaFieldStyle, __spreadProps(__spreadValues({}, props), { ref: inputRef })) });
|
|
8817
8820
|
}
|
|
@@ -8834,12 +8837,12 @@ function TextareaField(_a) {
|
|
|
8834
8837
|
}
|
|
8835
8838
|
|
|
8836
8839
|
// src/components/Toast/components/ToastItem.tsx
|
|
8837
|
-
var
|
|
8840
|
+
var import_react10 = require("react");
|
|
8838
8841
|
|
|
8839
8842
|
// src/components/Toast/styles/index.ts
|
|
8840
|
-
var
|
|
8843
|
+
var import_react9 = require("@stitches/react");
|
|
8841
8844
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
8842
|
-
var slideIn = (0,
|
|
8845
|
+
var slideIn = (0, import_react9.keyframes)({
|
|
8843
8846
|
from: {
|
|
8844
8847
|
transform: "translateX(calc(100% + 25px))",
|
|
8845
8848
|
opacity: 0
|
|
@@ -8849,7 +8852,7 @@ var slideIn = (0, import_react8.keyframes)({
|
|
|
8849
8852
|
opacity: 1
|
|
8850
8853
|
}
|
|
8851
8854
|
});
|
|
8852
|
-
var slideOut = (0,
|
|
8855
|
+
var slideOut = (0, import_react9.keyframes)({
|
|
8853
8856
|
from: {
|
|
8854
8857
|
transform: "translateX(0)",
|
|
8855
8858
|
opacity: 1
|
|
@@ -8859,7 +8862,7 @@ var slideOut = (0, import_react8.keyframes)({
|
|
|
8859
8862
|
opacity: 0
|
|
8860
8863
|
}
|
|
8861
8864
|
});
|
|
8862
|
-
var swipeOut = (0,
|
|
8865
|
+
var swipeOut = (0, import_react9.keyframes)({
|
|
8863
8866
|
from: {
|
|
8864
8867
|
transform: "translateX(var(--radix-toast-swipe-end-x))",
|
|
8865
8868
|
opacity: 1
|
|
@@ -8965,7 +8968,7 @@ function ToastItem({
|
|
|
8965
8968
|
toast,
|
|
8966
8969
|
onRemove
|
|
8967
8970
|
}) {
|
|
8968
|
-
const [open, setOpen] = (0,
|
|
8971
|
+
const [open, setOpen] = (0, import_react10.useState)(true);
|
|
8969
8972
|
const handleOpenChange = (open2) => {
|
|
8970
8973
|
setOpen(open2);
|
|
8971
8974
|
if (!open2) {
|
|
@@ -8989,17 +8992,17 @@ function ToastItem({
|
|
|
8989
8992
|
}
|
|
8990
8993
|
|
|
8991
8994
|
// src/components/Toast/components/ToastProvider.tsx
|
|
8992
|
-
var
|
|
8995
|
+
var import_react11 = require("react");
|
|
8993
8996
|
var ToastPrimitive2 = __toESM(require("@radix-ui/react-toast"));
|
|
8994
8997
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
8995
|
-
var ToastContext = (0,
|
|
8998
|
+
var ToastContext = (0, import_react11.createContext)(null);
|
|
8996
8999
|
function ToastProvider({
|
|
8997
9000
|
children,
|
|
8998
9001
|
defaultDuration = 5e3,
|
|
8999
9002
|
maxToasts = 5,
|
|
9000
9003
|
swipeDirection = "right"
|
|
9001
9004
|
}) {
|
|
9002
|
-
const [toasts, setToasts] = (0,
|
|
9005
|
+
const [toasts, setToasts] = (0, import_react11.useState)([]);
|
|
9003
9006
|
const addToast = (toastData) => {
|
|
9004
9007
|
const id = Math.random().toString(36).substr(2, 9);
|
|
9005
9008
|
const newToast = __spreadProps(__spreadValues({
|
|
@@ -9035,9 +9038,9 @@ function ToastProvider({
|
|
|
9035
9038
|
}
|
|
9036
9039
|
|
|
9037
9040
|
// src/components/Toast/hooks/useToast.ts
|
|
9038
|
-
var
|
|
9041
|
+
var import_react12 = require("react");
|
|
9039
9042
|
var useToast = () => {
|
|
9040
|
-
const context = (0,
|
|
9043
|
+
const context = (0, import_react12.useContext)(ToastContext);
|
|
9041
9044
|
if (!context) {
|
|
9042
9045
|
throw new Error("useToast deve ser usado dentro de um ToastProvider");
|
|
9043
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,71 +2661,73 @@ var InputAddon = styled(TextStyle, {
|
|
|
2660
2661
|
});
|
|
2661
2662
|
var maskFormat = format;
|
|
2662
2663
|
var maskUnformat = unformat;
|
|
2663
|
-
var TextField = (
|
|
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
|
-
}
|
|
2707
|
-
}, props), {
|
|
2708
|
-
style: addon ? { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px" } : void 0,
|
|
2709
|
-
children: [
|
|
2710
|
-
children,
|
|
2711
|
-
isValid2 && /* @__PURE__ */ jsx7(
|
|
2712
|
-
TextFieldSlot,
|
|
2713
|
-
{
|
|
2714
|
-
position: "flex-end",
|
|
2715
|
-
name,
|
|
2716
|
-
color,
|
|
2717
|
-
typography,
|
|
2718
|
-
fontWeight,
|
|
2719
|
-
textAlign,
|
|
2720
|
-
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
|
+
}
|
|
2721
2707
|
}
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
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
|
+
);
|
|
2728
2731
|
function TextFieldSlot(_a) {
|
|
2729
2732
|
var _b = _a, {
|
|
2730
2733
|
children,
|
|
@@ -3432,7 +3435,7 @@ function DropdownMenuItem(_a) {
|
|
|
3432
3435
|
}
|
|
3433
3436
|
|
|
3434
3437
|
// src/components/Badge.tsx
|
|
3435
|
-
import
|
|
3438
|
+
import React2 from "react";
|
|
3436
3439
|
import { Badge as BadgeRadix } from "@radix-ui/themes";
|
|
3437
3440
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
3438
3441
|
var BadgeStyled = styled(BadgeRadix, {
|
|
@@ -3539,9 +3542,9 @@ var BadgeStyled = styled(BadgeRadix, {
|
|
|
3539
3542
|
});
|
|
3540
3543
|
function Badge(_a) {
|
|
3541
3544
|
var _b = _a, { asChild, children } = _b, props = __objRest(_b, ["asChild", "children"]);
|
|
3542
|
-
return /* @__PURE__ */ jsx12(BadgeStyled, __spreadProps(__spreadValues({}, props), { children:
|
|
3543
|
-
if (
|
|
3544
|
-
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 });
|
|
3545
3548
|
}
|
|
3546
3549
|
return child;
|
|
3547
3550
|
}) }));
|
|
@@ -8490,7 +8493,7 @@ function Switch(props) {
|
|
|
8490
8493
|
}
|
|
8491
8494
|
|
|
8492
8495
|
// src/components/Step.tsx
|
|
8493
|
-
import
|
|
8496
|
+
import React5 from "react";
|
|
8494
8497
|
import { Box as Box2, Tabs as StepRadix } from "@radix-ui/themes";
|
|
8495
8498
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
8496
8499
|
var StepStyled = styled("div", {
|
|
@@ -8606,9 +8609,9 @@ function StepList(_a) {
|
|
|
8606
8609
|
"children",
|
|
8607
8610
|
"currentStep"
|
|
8608
8611
|
]);
|
|
8609
|
-
return /* @__PURE__ */ jsx18(StepListStyled, __spreadProps(__spreadValues({}, props), { children:
|
|
8610
|
-
if (
|
|
8611
|
-
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 });
|
|
8612
8615
|
}
|
|
8613
8616
|
return child;
|
|
8614
8617
|
}) }));
|
package/package.json
CHANGED
|
@@ -202,64 +202,71 @@ const InputAddon = styled(TextStyle, {
|
|
|
202
202
|
export const maskFormat = format;
|
|
203
203
|
export const maskUnformat = unformat;
|
|
204
204
|
|
|
205
|
-
export const TextField = (
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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;
|
|
219
222
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
+
return (
|
|
224
|
+
<Flex gap={"0"} css={{ width: "100%" }}>
|
|
225
|
+
{!!addon && <InputAddon typography="labelSmall">{addon}</InputAddon>}
|
|
223
226
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
if (
|
|
236
|
-
|
|
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
|
|
237
250
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
</TextFieldSlot>
|
|
258
|
-
)}
|
|
259
|
-
</TextFieldStyled>
|
|
260
|
-
</Flex>
|
|
261
|
-
);
|
|
262
|
-
};
|
|
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
|
+
);
|
|
263
270
|
|
|
264
271
|
export function TextFieldSlot({
|
|
265
272
|
children,
|