@lets-events/react 12.4.1 → 12.5.1
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 +13 -8
- package/CHANGELOG.md +584 -572
- package/dist/index.d.mts +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.js +39 -45
- package/dist/index.mjs +39 -45
- package/package.json +49 -49
- package/src/components/DoubleCalendar/index.tsx +4 -0
- package/src/components/Drawer/index.tsx +3 -1
- package/src/components/FormFields/DoubleCalendarFormField.tsx +3 -0
- package/src/components/FormFields/TextAreaFormField.tsx +4 -2
- package/src/components/TextareaField.tsx +6 -28
package/dist/index.d.mts
CHANGED
|
@@ -4743,8 +4743,9 @@ type DoubleCalendarProps = ComponentProps<typeof CalendarStyled> & {
|
|
|
4743
4743
|
expand?: boolean;
|
|
4744
4744
|
allowPastDates?: boolean;
|
|
4745
4745
|
maxYearsFromNow?: number;
|
|
4746
|
+
disabled?: boolean;
|
|
4746
4747
|
};
|
|
4747
|
-
declare function DoubleCalendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, maxYearsFromNow, ...props }: DoubleCalendarProps): react_jsx_runtime.JSX.Element;
|
|
4748
|
+
declare function DoubleCalendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, maxYearsFromNow, disabled, ...props }: DoubleCalendarProps): react_jsx_runtime.JSX.Element;
|
|
4748
4749
|
|
|
4749
4750
|
declare const DrawerOverlayStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
4750
4751
|
open?: boolean | "false" | "true" | undefined;
|
|
@@ -5133,8 +5134,9 @@ type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
|
|
|
5133
5134
|
goBackIcon?: ReactNode;
|
|
5134
5135
|
goBackAction?: () => void;
|
|
5135
5136
|
zIndex?: number;
|
|
5137
|
+
clickOutsideAvailable?: boolean;
|
|
5136
5138
|
};
|
|
5137
|
-
declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, goBackIcon, goBackAction, zIndex, }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
5139
|
+
declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, goBackIcon, goBackAction, zIndex, clickOutsideAvailable, }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
5138
5140
|
|
|
5139
5141
|
declare const TimePickerStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
5140
5142
|
expand?: boolean | "true" | undefined;
|
|
@@ -12326,7 +12328,8 @@ declare const TextareaContainer: _stitches_react_types_styled_component.StyledCo
|
|
|
12326
12328
|
zIndex: "zIndices";
|
|
12327
12329
|
}, {}>>;
|
|
12328
12330
|
type TextareaFieldProps = Omit<ComponentProps<typeof TextareaFieldStyle>, "color"> & ComponentProps<typeof TextareaContainer> & {
|
|
12329
|
-
|
|
12331
|
+
maxLength?: number;
|
|
12332
|
+
top?: string;
|
|
12330
12333
|
};
|
|
12331
12334
|
declare const TextareaField: React__default.ForwardRefExoticComponent<Omit<TextareaFieldProps, "ref"> & React__default.RefAttributes<HTMLTextAreaElement>>;
|
|
12332
12335
|
|
|
@@ -15101,7 +15104,7 @@ type TextAreaFormFieldProps = TextareaFieldProps & {
|
|
|
15101
15104
|
validate?: (value: string) => boolean | string;
|
|
15102
15105
|
validationErrorMessage?: string;
|
|
15103
15106
|
};
|
|
15104
|
-
declare const TextAreaFormField: ({ name, label, required, placeholder, validate, validationErrorMessage,
|
|
15107
|
+
declare const TextAreaFormField: ({ name, label, required, placeholder, validate, validationErrorMessage, maxLength, top, ...props }: TextAreaFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15105
15108
|
|
|
15106
15109
|
type TextFormFieldProps = TextFieldProps & {
|
|
15107
15110
|
name: string;
|
|
@@ -15326,10 +15329,11 @@ type DoubleCalendarFormFieldProps = Omit<DoubleCalendarProps, "selected" | "setS
|
|
|
15326
15329
|
validate?: (value: DateRange) => boolean | string;
|
|
15327
15330
|
validationErrorMessage?: string;
|
|
15328
15331
|
rules?: Omit<RegisterOptions<FieldValues, string>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
15332
|
+
disabled?: boolean;
|
|
15329
15333
|
allowPastDates?: boolean;
|
|
15330
15334
|
maxYearsFromNow?: number;
|
|
15331
15335
|
};
|
|
15332
|
-
declare const DoubleCalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, allowPastDates, maxYearsFromNow, ...calendarProps }: DoubleCalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15336
|
+
declare const DoubleCalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, allowPastDates, maxYearsFromNow, disabled, ...calendarProps }: DoubleCalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15333
15337
|
|
|
15334
15338
|
type TimePickerFormFieldProps = Omit<TimePickerProps, "selected" | "setSelected"> & {
|
|
15335
15339
|
name: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -4743,8 +4743,9 @@ type DoubleCalendarProps = ComponentProps<typeof CalendarStyled> & {
|
|
|
4743
4743
|
expand?: boolean;
|
|
4744
4744
|
allowPastDates?: boolean;
|
|
4745
4745
|
maxYearsFromNow?: number;
|
|
4746
|
+
disabled?: boolean;
|
|
4746
4747
|
};
|
|
4747
|
-
declare function DoubleCalendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, maxYearsFromNow, ...props }: DoubleCalendarProps): react_jsx_runtime.JSX.Element;
|
|
4748
|
+
declare function DoubleCalendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, maxYearsFromNow, disabled, ...props }: DoubleCalendarProps): react_jsx_runtime.JSX.Element;
|
|
4748
4749
|
|
|
4749
4750
|
declare const DrawerOverlayStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
4750
4751
|
open?: boolean | "false" | "true" | undefined;
|
|
@@ -5133,8 +5134,9 @@ type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
|
|
|
5133
5134
|
goBackIcon?: ReactNode;
|
|
5134
5135
|
goBackAction?: () => void;
|
|
5135
5136
|
zIndex?: number;
|
|
5137
|
+
clickOutsideAvailable?: boolean;
|
|
5136
5138
|
};
|
|
5137
|
-
declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, goBackIcon, goBackAction, zIndex, }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
5139
|
+
declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, goBackIcon, goBackAction, zIndex, clickOutsideAvailable, }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
5138
5140
|
|
|
5139
5141
|
declare const TimePickerStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
5140
5142
|
expand?: boolean | "true" | undefined;
|
|
@@ -12326,7 +12328,8 @@ declare const TextareaContainer: _stitches_react_types_styled_component.StyledCo
|
|
|
12326
12328
|
zIndex: "zIndices";
|
|
12327
12329
|
}, {}>>;
|
|
12328
12330
|
type TextareaFieldProps = Omit<ComponentProps<typeof TextareaFieldStyle>, "color"> & ComponentProps<typeof TextareaContainer> & {
|
|
12329
|
-
|
|
12331
|
+
maxLength?: number;
|
|
12332
|
+
top?: string;
|
|
12330
12333
|
};
|
|
12331
12334
|
declare const TextareaField: React__default.ForwardRefExoticComponent<Omit<TextareaFieldProps, "ref"> & React__default.RefAttributes<HTMLTextAreaElement>>;
|
|
12332
12335
|
|
|
@@ -15101,7 +15104,7 @@ type TextAreaFormFieldProps = TextareaFieldProps & {
|
|
|
15101
15104
|
validate?: (value: string) => boolean | string;
|
|
15102
15105
|
validationErrorMessage?: string;
|
|
15103
15106
|
};
|
|
15104
|
-
declare const TextAreaFormField: ({ name, label, required, placeholder, validate, validationErrorMessage,
|
|
15107
|
+
declare const TextAreaFormField: ({ name, label, required, placeholder, validate, validationErrorMessage, maxLength, top, ...props }: TextAreaFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15105
15108
|
|
|
15106
15109
|
type TextFormFieldProps = TextFieldProps & {
|
|
15107
15110
|
name: string;
|
|
@@ -15326,10 +15329,11 @@ type DoubleCalendarFormFieldProps = Omit<DoubleCalendarProps, "selected" | "setS
|
|
|
15326
15329
|
validate?: (value: DateRange) => boolean | string;
|
|
15327
15330
|
validationErrorMessage?: string;
|
|
15328
15331
|
rules?: Omit<RegisterOptions<FieldValues, string>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
15332
|
+
disabled?: boolean;
|
|
15329
15333
|
allowPastDates?: boolean;
|
|
15330
15334
|
maxYearsFromNow?: number;
|
|
15331
15335
|
};
|
|
15332
|
-
declare const DoubleCalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, allowPastDates, maxYearsFromNow, ...calendarProps }: DoubleCalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15336
|
+
declare const DoubleCalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, allowPastDates, maxYearsFromNow, disabled, ...calendarProps }: DoubleCalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15333
15337
|
|
|
15334
15338
|
type TimePickerFormFieldProps = Omit<TimePickerProps, "selected" | "setSelected"> & {
|
|
15335
15339
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -8167,7 +8167,8 @@ function DoubleCalendar(_a) {
|
|
|
8167
8167
|
hasError,
|
|
8168
8168
|
expand,
|
|
8169
8169
|
allowPastDates = false,
|
|
8170
|
-
maxYearsFromNow = 20
|
|
8170
|
+
maxYearsFromNow = 20,
|
|
8171
|
+
disabled = false
|
|
8171
8172
|
} = _b, props = __objRest(_b, [
|
|
8172
8173
|
"action",
|
|
8173
8174
|
"actionText",
|
|
@@ -8178,7 +8179,8 @@ function DoubleCalendar(_a) {
|
|
|
8178
8179
|
"hasError",
|
|
8179
8180
|
"expand",
|
|
8180
8181
|
"allowPastDates",
|
|
8181
|
-
"maxYearsFromNow"
|
|
8182
|
+
"maxYearsFromNow",
|
|
8183
|
+
"disabled"
|
|
8182
8184
|
]);
|
|
8183
8185
|
const [startValue, setStartValue] = (0, import_react9.useState)("");
|
|
8184
8186
|
const [endValue, setEndValue] = (0, import_react9.useState)("");
|
|
@@ -8213,6 +8215,7 @@ function DoubleCalendar(_a) {
|
|
|
8213
8215
|
if (!prev) initialSelectedRef.current = selected;
|
|
8214
8216
|
return next;
|
|
8215
8217
|
}),
|
|
8218
|
+
disabled,
|
|
8216
8219
|
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "flex", gap: "8px", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8217
8220
|
TextField,
|
|
8218
8221
|
{
|
|
@@ -8223,6 +8226,7 @@ function DoubleCalendar(_a) {
|
|
|
8223
8226
|
inputMode: "numeric",
|
|
8224
8227
|
textAlign: "right",
|
|
8225
8228
|
color: hasError ? "error" : "default",
|
|
8229
|
+
disabled,
|
|
8226
8230
|
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TextFieldSlot, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon_default, { name: "calendar", size: "xl" }) })
|
|
8227
8231
|
}
|
|
8228
8232
|
) })
|
|
@@ -8388,7 +8392,8 @@ function Drawer({
|
|
|
8388
8392
|
children,
|
|
8389
8393
|
goBackIcon,
|
|
8390
8394
|
goBackAction,
|
|
8391
|
-
zIndex = 1e3
|
|
8395
|
+
zIndex = 1e3,
|
|
8396
|
+
clickOutsideAvailable = true
|
|
8392
8397
|
}) {
|
|
8393
8398
|
(0, import_react10.useEffect)(() => {
|
|
8394
8399
|
if (isOpen) {
|
|
@@ -8411,7 +8416,7 @@ function Drawer({
|
|
|
8411
8416
|
css: {
|
|
8412
8417
|
zIndex
|
|
8413
8418
|
},
|
|
8414
|
-
onClick: onClose,
|
|
8419
|
+
onClick: clickOutsideAvailable ? onClose : void 0,
|
|
8415
8420
|
open: isOpen
|
|
8416
8421
|
}
|
|
8417
8422
|
),
|
|
@@ -9363,22 +9368,8 @@ var TextareaContainer = styled("div", {
|
|
|
9363
9368
|
color: "default"
|
|
9364
9369
|
}
|
|
9365
9370
|
});
|
|
9366
|
-
var TextareaLimitIndicator = styled("div", {
|
|
9367
|
-
padding: "$12 $16",
|
|
9368
|
-
borderTop: "1px solid $neutral300",
|
|
9369
|
-
width: "100%",
|
|
9370
|
-
flex: 1,
|
|
9371
|
-
display: "flex",
|
|
9372
|
-
backgroundColor: "$dark50",
|
|
9373
|
-
span: {
|
|
9374
|
-
backgroundColor: "$neutral200",
|
|
9375
|
-
color: "$neutral700",
|
|
9376
|
-
borderRadius: "$2xs",
|
|
9377
|
-
padding: "$4"
|
|
9378
|
-
}
|
|
9379
|
-
});
|
|
9380
9371
|
var TextareaField = import_react13.default.forwardRef((_a, forwardedRef) => {
|
|
9381
|
-
var _b = _a, { maxLength, color,
|
|
9372
|
+
var _b = _a, { maxLength, color, top = "-1.75rem" } = _b, props = __objRest(_b, ["maxLength", "color", "top"]);
|
|
9382
9373
|
const inputRef = (0, import_react13.useRef)(null);
|
|
9383
9374
|
const [remaining, setRemaining] = (0, import_react13.useState)(maxLength);
|
|
9384
9375
|
(0, import_react13.useEffect)(() => {
|
|
@@ -9395,26 +9386,23 @@ var TextareaField = import_react13.default.forwardRef((_a, forwardedRef) => {
|
|
|
9395
9386
|
(_a2 = props.onInput) == null ? void 0 : _a2.call(props, e);
|
|
9396
9387
|
};
|
|
9397
9388
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Flex2, { direction: "column", align: "end", style: { position: "relative" }, children: [
|
|
9398
|
-
maxLength &&
|
|
9399
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
if (forwardedRef)
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
),
|
|
9416
|
-
maxLength && !simpleLayout && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TextareaLimitIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { typography: "badgeMedium", children: remaining }) })
|
|
9417
|
-
] })
|
|
9389
|
+
maxLength && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Badge, { size: "sm", color: "grey", style: { position: "absolute", right: 0, top: "-1.75rem" }, children: remaining }),
|
|
9390
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TextareaContainer, { color, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
9391
|
+
TextareaFieldStyle,
|
|
9392
|
+
__spreadValues({
|
|
9393
|
+
rows: 4,
|
|
9394
|
+
ref: (r) => {
|
|
9395
|
+
if (!r) return;
|
|
9396
|
+
inputRef.current = r;
|
|
9397
|
+
if (forwardedRef) {
|
|
9398
|
+
if (typeof forwardedRef === "function") forwardedRef(r);
|
|
9399
|
+
else forwardedRef.current = r;
|
|
9400
|
+
}
|
|
9401
|
+
},
|
|
9402
|
+
onInput: handleInput,
|
|
9403
|
+
maxLength
|
|
9404
|
+
}, props)
|
|
9405
|
+
) })
|
|
9418
9406
|
] });
|
|
9419
9407
|
});
|
|
9420
9408
|
|
|
@@ -10291,7 +10279,8 @@ var TextAreaFormField = (_a) => {
|
|
|
10291
10279
|
placeholder,
|
|
10292
10280
|
validate,
|
|
10293
10281
|
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
10294
|
-
|
|
10282
|
+
maxLength,
|
|
10283
|
+
top
|
|
10295
10284
|
} = _b, props = __objRest(_b, [
|
|
10296
10285
|
"name",
|
|
10297
10286
|
"label",
|
|
@@ -10299,7 +10288,8 @@ var TextAreaFormField = (_a) => {
|
|
|
10299
10288
|
"placeholder",
|
|
10300
10289
|
"validate",
|
|
10301
10290
|
"validationErrorMessage",
|
|
10302
|
-
"
|
|
10291
|
+
"maxLength",
|
|
10292
|
+
"top"
|
|
10303
10293
|
]);
|
|
10304
10294
|
var _a2;
|
|
10305
10295
|
const {
|
|
@@ -10327,8 +10317,9 @@ var TextAreaFormField = (_a) => {
|
|
|
10327
10317
|
__spreadProps(__spreadValues(__spreadValues({}, props), register(name, validationRules)), {
|
|
10328
10318
|
placeholder,
|
|
10329
10319
|
color: haveError ? "error" : "default",
|
|
10330
|
-
|
|
10331
|
-
|
|
10320
|
+
"aria-labelledby": `${name}-label`,
|
|
10321
|
+
maxLength,
|
|
10322
|
+
top
|
|
10332
10323
|
})
|
|
10333
10324
|
),
|
|
10334
10325
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
@@ -13034,7 +13025,8 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
13034
13025
|
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
13035
13026
|
rules,
|
|
13036
13027
|
allowPastDates,
|
|
13037
|
-
maxYearsFromNow = 20
|
|
13028
|
+
maxYearsFromNow = 20,
|
|
13029
|
+
disabled
|
|
13038
13030
|
} = _b, calendarProps = __objRest(_b, [
|
|
13039
13031
|
"name",
|
|
13040
13032
|
"label",
|
|
@@ -13043,7 +13035,8 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
13043
13035
|
"validationErrorMessage",
|
|
13044
13036
|
"rules",
|
|
13045
13037
|
"allowPastDates",
|
|
13046
|
-
"maxYearsFromNow"
|
|
13038
|
+
"maxYearsFromNow",
|
|
13039
|
+
"disabled"
|
|
13047
13040
|
]);
|
|
13048
13041
|
const handleValidate = (0, import_react26.useCallback)(
|
|
13049
13042
|
(value) => {
|
|
@@ -13081,6 +13074,7 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
13081
13074
|
const newValue = typeof value === "function" ? value(selected) : value;
|
|
13082
13075
|
handleCalendarChange(newValue);
|
|
13083
13076
|
},
|
|
13077
|
+
disabled,
|
|
13084
13078
|
hasError: haveError,
|
|
13085
13079
|
allowPastDates,
|
|
13086
13080
|
maxYearsFromNow
|
package/dist/index.mjs
CHANGED
|
@@ -8053,7 +8053,8 @@ function DoubleCalendar(_a) {
|
|
|
8053
8053
|
hasError,
|
|
8054
8054
|
expand,
|
|
8055
8055
|
allowPastDates = false,
|
|
8056
|
-
maxYearsFromNow = 20
|
|
8056
|
+
maxYearsFromNow = 20,
|
|
8057
|
+
disabled = false
|
|
8057
8058
|
} = _b, props = __objRest(_b, [
|
|
8058
8059
|
"action",
|
|
8059
8060
|
"actionText",
|
|
@@ -8064,7 +8065,8 @@ function DoubleCalendar(_a) {
|
|
|
8064
8065
|
"hasError",
|
|
8065
8066
|
"expand",
|
|
8066
8067
|
"allowPastDates",
|
|
8067
|
-
"maxYearsFromNow"
|
|
8068
|
+
"maxYearsFromNow",
|
|
8069
|
+
"disabled"
|
|
8068
8070
|
]);
|
|
8069
8071
|
const [startValue, setStartValue] = useState3("");
|
|
8070
8072
|
const [endValue, setEndValue] = useState3("");
|
|
@@ -8099,6 +8101,7 @@ function DoubleCalendar(_a) {
|
|
|
8099
8101
|
if (!prev) initialSelectedRef.current = selected;
|
|
8100
8102
|
return next;
|
|
8101
8103
|
}),
|
|
8104
|
+
disabled,
|
|
8102
8105
|
children: /* @__PURE__ */ jsx16("div", { style: { display: "flex", gap: "8px", width: "100%" }, children: /* @__PURE__ */ jsx16(
|
|
8103
8106
|
TextField,
|
|
8104
8107
|
{
|
|
@@ -8109,6 +8112,7 @@ function DoubleCalendar(_a) {
|
|
|
8109
8112
|
inputMode: "numeric",
|
|
8110
8113
|
textAlign: "right",
|
|
8111
8114
|
color: hasError ? "error" : "default",
|
|
8115
|
+
disabled,
|
|
8112
8116
|
children: /* @__PURE__ */ jsx16(TextFieldSlot, { children: /* @__PURE__ */ jsx16(Icon_default, { name: "calendar", size: "xl" }) })
|
|
8113
8117
|
}
|
|
8114
8118
|
) })
|
|
@@ -8274,7 +8278,8 @@ function Drawer({
|
|
|
8274
8278
|
children,
|
|
8275
8279
|
goBackIcon,
|
|
8276
8280
|
goBackAction,
|
|
8277
|
-
zIndex = 1e3
|
|
8281
|
+
zIndex = 1e3,
|
|
8282
|
+
clickOutsideAvailable = true
|
|
8278
8283
|
}) {
|
|
8279
8284
|
useEffect5(() => {
|
|
8280
8285
|
if (isOpen) {
|
|
@@ -8297,7 +8302,7 @@ function Drawer({
|
|
|
8297
8302
|
css: {
|
|
8298
8303
|
zIndex
|
|
8299
8304
|
},
|
|
8300
|
-
onClick: onClose,
|
|
8305
|
+
onClick: clickOutsideAvailable ? onClose : void 0,
|
|
8301
8306
|
open: isOpen
|
|
8302
8307
|
}
|
|
8303
8308
|
),
|
|
@@ -9249,22 +9254,8 @@ var TextareaContainer = styled("div", {
|
|
|
9249
9254
|
color: "default"
|
|
9250
9255
|
}
|
|
9251
9256
|
});
|
|
9252
|
-
var TextareaLimitIndicator = styled("div", {
|
|
9253
|
-
padding: "$12 $16",
|
|
9254
|
-
borderTop: "1px solid $neutral300",
|
|
9255
|
-
width: "100%",
|
|
9256
|
-
flex: 1,
|
|
9257
|
-
display: "flex",
|
|
9258
|
-
backgroundColor: "$dark50",
|
|
9259
|
-
span: {
|
|
9260
|
-
backgroundColor: "$neutral200",
|
|
9261
|
-
color: "$neutral700",
|
|
9262
|
-
borderRadius: "$2xs",
|
|
9263
|
-
padding: "$4"
|
|
9264
|
-
}
|
|
9265
|
-
});
|
|
9266
9257
|
var TextareaField = React9.forwardRef((_a, forwardedRef) => {
|
|
9267
|
-
var _b = _a, { maxLength, color,
|
|
9258
|
+
var _b = _a, { maxLength, color, top = "-1.75rem" } = _b, props = __objRest(_b, ["maxLength", "color", "top"]);
|
|
9268
9259
|
const inputRef = useRef7(null);
|
|
9269
9260
|
const [remaining, setRemaining] = useState5(maxLength);
|
|
9270
9261
|
useEffect6(() => {
|
|
@@ -9281,26 +9272,23 @@ var TextareaField = React9.forwardRef((_a, forwardedRef) => {
|
|
|
9281
9272
|
(_a2 = props.onInput) == null ? void 0 : _a2.call(props, e);
|
|
9282
9273
|
};
|
|
9283
9274
|
return /* @__PURE__ */ jsxs11(Flex2, { direction: "column", align: "end", style: { position: "relative" }, children: [
|
|
9284
|
-
maxLength &&
|
|
9285
|
-
/* @__PURE__ */
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
if (forwardedRef)
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
),
|
|
9302
|
-
maxLength && !simpleLayout && /* @__PURE__ */ jsx23(TextareaLimitIndicator, { children: /* @__PURE__ */ jsx23(Text, { typography: "badgeMedium", children: remaining }) })
|
|
9303
|
-
] })
|
|
9275
|
+
maxLength && /* @__PURE__ */ jsx23(Badge, { size: "sm", color: "grey", style: { position: "absolute", right: 0, top: "-1.75rem" }, children: remaining }),
|
|
9276
|
+
/* @__PURE__ */ jsx23(TextareaContainer, { color, children: /* @__PURE__ */ jsx23(
|
|
9277
|
+
TextareaFieldStyle,
|
|
9278
|
+
__spreadValues({
|
|
9279
|
+
rows: 4,
|
|
9280
|
+
ref: (r) => {
|
|
9281
|
+
if (!r) return;
|
|
9282
|
+
inputRef.current = r;
|
|
9283
|
+
if (forwardedRef) {
|
|
9284
|
+
if (typeof forwardedRef === "function") forwardedRef(r);
|
|
9285
|
+
else forwardedRef.current = r;
|
|
9286
|
+
}
|
|
9287
|
+
},
|
|
9288
|
+
onInput: handleInput,
|
|
9289
|
+
maxLength
|
|
9290
|
+
}, props)
|
|
9291
|
+
) })
|
|
9304
9292
|
] });
|
|
9305
9293
|
});
|
|
9306
9294
|
|
|
@@ -10181,7 +10169,8 @@ var TextAreaFormField = (_a) => {
|
|
|
10181
10169
|
placeholder,
|
|
10182
10170
|
validate,
|
|
10183
10171
|
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
10184
|
-
|
|
10172
|
+
maxLength,
|
|
10173
|
+
top
|
|
10185
10174
|
} = _b, props = __objRest(_b, [
|
|
10186
10175
|
"name",
|
|
10187
10176
|
"label",
|
|
@@ -10189,7 +10178,8 @@ var TextAreaFormField = (_a) => {
|
|
|
10189
10178
|
"placeholder",
|
|
10190
10179
|
"validate",
|
|
10191
10180
|
"validationErrorMessage",
|
|
10192
|
-
"
|
|
10181
|
+
"maxLength",
|
|
10182
|
+
"top"
|
|
10193
10183
|
]);
|
|
10194
10184
|
var _a2;
|
|
10195
10185
|
const {
|
|
@@ -10217,8 +10207,9 @@ var TextAreaFormField = (_a) => {
|
|
|
10217
10207
|
__spreadProps(__spreadValues(__spreadValues({}, props), register(name, validationRules)), {
|
|
10218
10208
|
placeholder,
|
|
10219
10209
|
color: haveError ? "error" : "default",
|
|
10220
|
-
|
|
10221
|
-
|
|
10210
|
+
"aria-labelledby": `${name}-label`,
|
|
10211
|
+
maxLength,
|
|
10212
|
+
top
|
|
10222
10213
|
})
|
|
10223
10214
|
),
|
|
10224
10215
|
/* @__PURE__ */ jsx33(ErrorFormMessage, { message: errorMsg })
|
|
@@ -12929,7 +12920,8 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
12929
12920
|
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
12930
12921
|
rules,
|
|
12931
12922
|
allowPastDates,
|
|
12932
|
-
maxYearsFromNow = 20
|
|
12923
|
+
maxYearsFromNow = 20,
|
|
12924
|
+
disabled
|
|
12933
12925
|
} = _b, calendarProps = __objRest(_b, [
|
|
12934
12926
|
"name",
|
|
12935
12927
|
"label",
|
|
@@ -12938,7 +12930,8 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
12938
12930
|
"validationErrorMessage",
|
|
12939
12931
|
"rules",
|
|
12940
12932
|
"allowPastDates",
|
|
12941
|
-
"maxYearsFromNow"
|
|
12933
|
+
"maxYearsFromNow",
|
|
12934
|
+
"disabled"
|
|
12942
12935
|
]);
|
|
12943
12936
|
const handleValidate = useCallback6(
|
|
12944
12937
|
(value) => {
|
|
@@ -12976,6 +12969,7 @@ var DoubleCalendarFormField = (_a) => {
|
|
|
12976
12969
|
const newValue = typeof value === "function" ? value(selected) : value;
|
|
12977
12970
|
handleCalendarChange(newValue);
|
|
12978
12971
|
},
|
|
12972
|
+
disabled,
|
|
12979
12973
|
hasError: haveError,
|
|
12980
12974
|
allowPastDates,
|
|
12981
12975
|
maxYearsFromNow
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lets-events/react",
|
|
3
|
-
"version": "12.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/index.mjs",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "tsup src/index.tsx --format esm,cjs --dts --external react",
|
|
10
|
-
"dev": "tsup src/index.tsx --format esm,cjs --dts --external react --watch",
|
|
11
|
-
"lint": "eslint src/**/*.ts --fix"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [],
|
|
14
|
-
"author": "",
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"type": "commonjs",
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@lets-events/eslint-config": "*",
|
|
19
|
-
"@lets-events/tokens": "*",
|
|
20
|
-
"@lets-events/ts-config": "*",
|
|
21
|
-
"@types/quill": "^2.0.10",
|
|
22
|
-
"@types/react": "^19.0.10",
|
|
23
|
-
"@types/react-dom": "^19.0.4",
|
|
24
|
-
"react": "^19.0.0",
|
|
25
|
-
"tsup": "^8.4.0",
|
|
26
|
-
"typescript": "^5.8.2"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@fortawesome/fontawesome-free": "^5.14.0",
|
|
30
|
-
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
31
|
-
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
32
|
-
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
33
|
-
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
34
|
-
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
35
|
-
"@radix-ui/react-toast": "^1.2.14",
|
|
36
|
-
"@radix-ui/react-tooltip": "^1.2.7",
|
|
37
|
-
"@radix-ui/themes": "^3.2.1",
|
|
38
|
-
"@react-input/mask": "^2.0.4",
|
|
39
|
-
"@stitches/react": "^1.2.8",
|
|
40
|
-
"aws-sdk": "^2.1692.0",
|
|
41
|
-
"dotenv": "^17.2.1",
|
|
42
|
-
"i18n-iso-countries": "^7.14.0",
|
|
43
|
-
"npm": "^11.4.2",
|
|
44
|
-
"quill": "^2.0.3",
|
|
45
|
-
"radix-ui": "^1.4.2",
|
|
46
|
-
"react-day-picker": "^9.6.7",
|
|
47
|
-
"react-hook-form": "^7.57.0",
|
|
48
|
-
"react-quilljs": "^2.0.5"
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@lets-events/react",
|
|
3
|
+
"version": "12.5.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsup src/index.tsx --format esm,cjs --dts --external react",
|
|
10
|
+
"dev": "tsup src/index.tsx --format esm,cjs --dts --external react --watch",
|
|
11
|
+
"lint": "eslint src/**/*.ts --fix"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"type": "commonjs",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@lets-events/eslint-config": "*",
|
|
19
|
+
"@lets-events/tokens": "*",
|
|
20
|
+
"@lets-events/ts-config": "*",
|
|
21
|
+
"@types/quill": "^2.0.10",
|
|
22
|
+
"@types/react": "^19.0.10",
|
|
23
|
+
"@types/react-dom": "^19.0.4",
|
|
24
|
+
"react": "^19.0.0",
|
|
25
|
+
"tsup": "^8.4.0",
|
|
26
|
+
"typescript": "^5.8.2"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@fortawesome/fontawesome-free": "^5.14.0",
|
|
30
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
31
|
+
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
32
|
+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
33
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
34
|
+
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
35
|
+
"@radix-ui/react-toast": "^1.2.14",
|
|
36
|
+
"@radix-ui/react-tooltip": "^1.2.7",
|
|
37
|
+
"@radix-ui/themes": "^3.2.1",
|
|
38
|
+
"@react-input/mask": "^2.0.4",
|
|
39
|
+
"@stitches/react": "^1.2.8",
|
|
40
|
+
"aws-sdk": "^2.1692.0",
|
|
41
|
+
"dotenv": "^17.2.1",
|
|
42
|
+
"i18n-iso-countries": "^7.14.0",
|
|
43
|
+
"npm": "^11.4.2",
|
|
44
|
+
"quill": "^2.0.3",
|
|
45
|
+
"radix-ui": "^1.4.2",
|
|
46
|
+
"react-day-picker": "^9.6.7",
|
|
47
|
+
"react-hook-form": "^7.57.0",
|
|
48
|
+
"react-quilljs": "^2.0.5"
|
|
49
|
+
}
|
|
50
50
|
}
|
|
@@ -28,6 +28,7 @@ export type DoubleCalendarProps = ComponentProps<typeof CalendarStyled> & {
|
|
|
28
28
|
expand?: boolean;
|
|
29
29
|
allowPastDates?: boolean;
|
|
30
30
|
maxYearsFromNow?: number;
|
|
31
|
+
disabled?: boolean;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
export function DoubleCalendar({
|
|
@@ -41,6 +42,7 @@ export function DoubleCalendar({
|
|
|
41
42
|
expand,
|
|
42
43
|
allowPastDates = false,
|
|
43
44
|
maxYearsFromNow = 20,
|
|
45
|
+
disabled = false,
|
|
44
46
|
...props
|
|
45
47
|
}: DoubleCalendarProps) {
|
|
46
48
|
const [startValue, setStartValue] = useState("");
|
|
@@ -83,6 +85,7 @@ export function DoubleCalendar({
|
|
|
83
85
|
return next;
|
|
84
86
|
})
|
|
85
87
|
}
|
|
88
|
+
disabled={disabled}
|
|
86
89
|
>
|
|
87
90
|
<div style={{ display: "flex", gap: "8px", width: "100%" }}>
|
|
88
91
|
<TextField
|
|
@@ -93,6 +96,7 @@ export function DoubleCalendar({
|
|
|
93
96
|
inputMode="numeric"
|
|
94
97
|
textAlign={"right"}
|
|
95
98
|
color={hasError ? "error" : "default"}
|
|
99
|
+
disabled={disabled}
|
|
96
100
|
>
|
|
97
101
|
<TextFieldSlot>
|
|
98
102
|
<Icon name="calendar" size={"xl"} />
|
|
@@ -23,6 +23,7 @@ export type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
|
|
|
23
23
|
goBackIcon?: ReactNode;
|
|
24
24
|
goBackAction?: () => void;
|
|
25
25
|
zIndex?: number;
|
|
26
|
+
clickOutsideAvailable?: boolean;
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export function Drawer({
|
|
@@ -35,6 +36,7 @@ export function Drawer({
|
|
|
35
36
|
goBackIcon,
|
|
36
37
|
goBackAction,
|
|
37
38
|
zIndex = 1000,
|
|
39
|
+
clickOutsideAvailable = true,
|
|
38
40
|
}: DrawerProps) {
|
|
39
41
|
useEffect(() => {
|
|
40
42
|
if (isOpen) {
|
|
@@ -60,7 +62,7 @@ export function Drawer({
|
|
|
60
62
|
css={{
|
|
61
63
|
zIndex,
|
|
62
64
|
}}
|
|
63
|
-
onClick={onClose}
|
|
65
|
+
onClick={clickOutsideAvailable ? onClose : undefined}
|
|
64
66
|
open={isOpen}
|
|
65
67
|
/>
|
|
66
68
|
<DrawerWrapper
|
|
@@ -18,6 +18,7 @@ export type DoubleCalendarFormFieldProps = Omit<
|
|
|
18
18
|
RegisterOptions<FieldValues, string>,
|
|
19
19
|
"valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled"
|
|
20
20
|
>;
|
|
21
|
+
disabled?: boolean;
|
|
21
22
|
allowPastDates?: boolean;
|
|
22
23
|
maxYearsFromNow?: number;
|
|
23
24
|
};
|
|
@@ -31,6 +32,7 @@ export const DoubleCalendarFormField = ({
|
|
|
31
32
|
rules,
|
|
32
33
|
allowPastDates,
|
|
33
34
|
maxYearsFromNow = 20,
|
|
35
|
+
disabled,
|
|
34
36
|
...calendarProps
|
|
35
37
|
}: DoubleCalendarFormFieldProps) => {
|
|
36
38
|
const handleValidate = useCallback(
|
|
@@ -76,6 +78,7 @@ export const DoubleCalendarFormField = ({
|
|
|
76
78
|
const newValue = typeof value === "function" ? value(selected) : value;
|
|
77
79
|
handleCalendarChange(newValue);
|
|
78
80
|
}}
|
|
81
|
+
disabled={disabled}
|
|
79
82
|
hasError={haveError}
|
|
80
83
|
allowPastDates={allowPastDates}
|
|
81
84
|
maxYearsFromNow={maxYearsFromNow}
|