@lets-events/react 12.3.9 → 12.4.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 +9 -9
- package/CHANGELOG.md +18 -0
- package/dist/index.d.mts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.js +564 -345
- package/dist/index.mjs +537 -320
- package/package.json +1 -1
- package/src/components/Calendar/styledComponents.ts +18 -9
- package/src/components/DoubleCalendar/index.tsx +166 -0
- package/src/components/Drawer/index.tsx +1 -0
- package/src/components/FormFields/DoubleCalendarFormField.tsx +90 -0
- package/src/components/FormFields/TextAreaFormField.tsx +2 -0
- package/src/components/TextareaField.tsx +35 -24
- package/src/index.tsx +2 -0
- package/dist/index.css +0 -171
package/dist/index.mjs
CHANGED
|
@@ -7746,7 +7746,8 @@ var CalendarFooterStyled = styled("div", {
|
|
|
7746
7746
|
borderTop: "2px solid $neutral100",
|
|
7747
7747
|
padding: "$4 $16",
|
|
7748
7748
|
display: "flex",
|
|
7749
|
-
|
|
7749
|
+
gap: "1rem",
|
|
7750
|
+
justifyContent: "flex-end",
|
|
7750
7751
|
alignItems: "center",
|
|
7751
7752
|
height: "3rem"
|
|
7752
7753
|
});
|
|
@@ -7757,7 +7758,7 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
7757
7758
|
color: "$dark500"
|
|
7758
7759
|
},
|
|
7759
7760
|
".rdp-root": {
|
|
7760
|
-
padding: "$8"
|
|
7761
|
+
padding: "0 $8"
|
|
7761
7762
|
},
|
|
7762
7763
|
".rdp-today .rdp-day_button": {
|
|
7763
7764
|
color: "$brand500",
|
|
@@ -7767,8 +7768,8 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
7767
7768
|
color: "$dark400"
|
|
7768
7769
|
},
|
|
7769
7770
|
".rdp-day_button": {
|
|
7770
|
-
height: "
|
|
7771
|
-
width: "
|
|
7771
|
+
height: "28px",
|
|
7772
|
+
width: "28px",
|
|
7772
7773
|
borderRadius: "$sm",
|
|
7773
7774
|
fontSize: "$14",
|
|
7774
7775
|
color: "$text",
|
|
@@ -7786,9 +7787,10 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
7786
7787
|
borderColor: "transparent"
|
|
7787
7788
|
},
|
|
7788
7789
|
".rdp-nav": {
|
|
7790
|
+
position: "absolute",
|
|
7791
|
+
width: "98%",
|
|
7789
7792
|
display: "flex",
|
|
7790
|
-
justifyContent: "space-between"
|
|
7791
|
-
width: "100%"
|
|
7793
|
+
justifyContent: "space-between"
|
|
7792
7794
|
},
|
|
7793
7795
|
".rdp-nav .rdp-chevron": {
|
|
7794
7796
|
display: "none"
|
|
@@ -7824,8 +7826,15 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
7824
7826
|
backgroundColor: "transparent",
|
|
7825
7827
|
cursor: "pointer"
|
|
7826
7828
|
},
|
|
7829
|
+
".rdp-months": {
|
|
7830
|
+
display: "flex",
|
|
7831
|
+
columnGap: "$16",
|
|
7832
|
+
alignItems: "flex-start",
|
|
7833
|
+
paddingTop: "$12"
|
|
7834
|
+
},
|
|
7827
7835
|
".rdp-month": {
|
|
7828
|
-
marginTop: "
|
|
7836
|
+
marginTop: "0",
|
|
7837
|
+
paddingTop: "$6"
|
|
7829
7838
|
},
|
|
7830
7839
|
".rdp-month_caption": {
|
|
7831
7840
|
display: "flex",
|
|
@@ -8029,8 +8038,138 @@ function Calendar(_a) {
|
|
|
8029
8038
|
] })) });
|
|
8030
8039
|
}
|
|
8031
8040
|
|
|
8041
|
+
// src/components/DoubleCalendar/index.tsx
|
|
8042
|
+
import { useRef as useRef4, useEffect as useEffect4, useState as useState3 } from "react";
|
|
8043
|
+
import { DayPicker as DayPicker2 } from "react-day-picker";
|
|
8044
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
8045
|
+
function DoubleCalendar(_a) {
|
|
8046
|
+
var _b = _a, {
|
|
8047
|
+
action,
|
|
8048
|
+
actionText,
|
|
8049
|
+
calendarLayout,
|
|
8050
|
+
selected,
|
|
8051
|
+
setSelected,
|
|
8052
|
+
position = "bottom",
|
|
8053
|
+
hasError,
|
|
8054
|
+
expand,
|
|
8055
|
+
allowPastDates = false,
|
|
8056
|
+
maxYearsFromNow = 20
|
|
8057
|
+
} = _b, props = __objRest(_b, [
|
|
8058
|
+
"action",
|
|
8059
|
+
"actionText",
|
|
8060
|
+
"calendarLayout",
|
|
8061
|
+
"selected",
|
|
8062
|
+
"setSelected",
|
|
8063
|
+
"position",
|
|
8064
|
+
"hasError",
|
|
8065
|
+
"expand",
|
|
8066
|
+
"allowPastDates",
|
|
8067
|
+
"maxYearsFromNow"
|
|
8068
|
+
]);
|
|
8069
|
+
const [startValue, setStartValue] = useState3("");
|
|
8070
|
+
const [endValue, setEndValue] = useState3("");
|
|
8071
|
+
const [showContainer, setShowCalendar] = useState3(false);
|
|
8072
|
+
const initialSelectedRef = useRef4(void 0);
|
|
8073
|
+
const dropdownRef = useRef4(null);
|
|
8074
|
+
useOnClickOutside(dropdownRef, () => {
|
|
8075
|
+
setShowCalendar(false);
|
|
8076
|
+
});
|
|
8077
|
+
const today = /* @__PURE__ */ new Date();
|
|
8078
|
+
const maxDate = addYears(today, maxYearsFromNow);
|
|
8079
|
+
useEffect4(() => {
|
|
8080
|
+
if (selected && selected.from) {
|
|
8081
|
+
setStartValue(format2(selected.from, "dd/MM/yyyy"));
|
|
8082
|
+
} else {
|
|
8083
|
+
setStartValue("");
|
|
8084
|
+
}
|
|
8085
|
+
if (selected && selected.to) {
|
|
8086
|
+
setEndValue(format2(selected.to, "dd/MM/yyyy"));
|
|
8087
|
+
} else {
|
|
8088
|
+
setEndValue("");
|
|
8089
|
+
}
|
|
8090
|
+
}, [selected]);
|
|
8091
|
+
return /* @__PURE__ */ jsx16("div", { children: /* @__PURE__ */ jsxs7(CalendarStyled, __spreadProps(__spreadValues({}, props), { expand, ref: dropdownRef, children: [
|
|
8092
|
+
/* @__PURE__ */ jsx16(
|
|
8093
|
+
CalendarButtonStyled,
|
|
8094
|
+
{
|
|
8095
|
+
expand,
|
|
8096
|
+
type: "button",
|
|
8097
|
+
onClick: () => setShowCalendar((prev) => {
|
|
8098
|
+
const next = !prev;
|
|
8099
|
+
if (!prev) initialSelectedRef.current = selected;
|
|
8100
|
+
return next;
|
|
8101
|
+
}),
|
|
8102
|
+
children: /* @__PURE__ */ jsx16("div", { style: { display: "flex", gap: "8px", width: "100%" }, children: /* @__PURE__ */ jsx16(
|
|
8103
|
+
TextField,
|
|
8104
|
+
{
|
|
8105
|
+
placeholder: "00/00/0000 - 00/00/0000",
|
|
8106
|
+
type: "text",
|
|
8107
|
+
value: `${startValue || "00/00/0000"} - ${endValue || "00/00/0000"}`,
|
|
8108
|
+
readOnly: true,
|
|
8109
|
+
inputMode: "numeric",
|
|
8110
|
+
textAlign: "right",
|
|
8111
|
+
color: hasError ? "error" : "default",
|
|
8112
|
+
children: /* @__PURE__ */ jsx16(TextFieldSlot, { children: /* @__PURE__ */ jsx16(Icon_default, { name: "calendar", size: "xl" }) })
|
|
8113
|
+
}
|
|
8114
|
+
) })
|
|
8115
|
+
}
|
|
8116
|
+
),
|
|
8117
|
+
showContainer && /* @__PURE__ */ jsxs7(CalendarContentStyled, { position, children: [
|
|
8118
|
+
/* @__PURE__ */ jsx16(Box, { children: /* @__PURE__ */ jsx16(DayPickerWrapperStyled, { children: /* @__PURE__ */ jsx16(
|
|
8119
|
+
DayPicker2,
|
|
8120
|
+
{
|
|
8121
|
+
mode: "range",
|
|
8122
|
+
numberOfMonths: 2,
|
|
8123
|
+
captionLayout: calendarLayout,
|
|
8124
|
+
selected,
|
|
8125
|
+
onSelect: setSelected,
|
|
8126
|
+
required: true,
|
|
8127
|
+
locale: ptBR,
|
|
8128
|
+
disabled: allowPastDates ? void 0 : { before: today },
|
|
8129
|
+
fromMonth: allowPastDates ? void 0 : today,
|
|
8130
|
+
toMonth: maxDate
|
|
8131
|
+
}
|
|
8132
|
+
) }) }),
|
|
8133
|
+
action && /* @__PURE__ */ jsxs7(CalendarFooterStyled, { children: [
|
|
8134
|
+
/* @__PURE__ */ jsx16("div", { style: { textAlign: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx16("span", { children: `${(selected == null ? void 0 : selected.from) ? format2(selected.from, "dd/MM/yyyy") : "00/00/0000"} \u2014 ${(selected == null ? void 0 : selected.to) ? format2(selected.to, "dd/MM/yyyy") : "00/00/0000"}` }) }),
|
|
8135
|
+
/* @__PURE__ */ jsx16(
|
|
8136
|
+
Button,
|
|
8137
|
+
{
|
|
8138
|
+
style: { margin: "0 0.5rem" },
|
|
8139
|
+
variant: "text",
|
|
8140
|
+
color: "neutral",
|
|
8141
|
+
type: "button",
|
|
8142
|
+
onClick: () => {
|
|
8143
|
+
setSelected(initialSelectedRef.current);
|
|
8144
|
+
setShowCalendar(false);
|
|
8145
|
+
},
|
|
8146
|
+
size: "medium",
|
|
8147
|
+
fontWeight: "regular",
|
|
8148
|
+
children: "Cancelar"
|
|
8149
|
+
}
|
|
8150
|
+
),
|
|
8151
|
+
/* @__PURE__ */ jsx16(
|
|
8152
|
+
Button,
|
|
8153
|
+
{
|
|
8154
|
+
style: { margin: "0 0.5rem" },
|
|
8155
|
+
variant: "text",
|
|
8156
|
+
color: "brand",
|
|
8157
|
+
type: "button",
|
|
8158
|
+
onClick: () => {
|
|
8159
|
+
setShowCalendar(false);
|
|
8160
|
+
},
|
|
8161
|
+
size: "medium",
|
|
8162
|
+
fontWeight: "medium",
|
|
8163
|
+
children: actionText != null ? actionText : "Aplicar"
|
|
8164
|
+
}
|
|
8165
|
+
)
|
|
8166
|
+
] })
|
|
8167
|
+
] })
|
|
8168
|
+
] })) });
|
|
8169
|
+
}
|
|
8170
|
+
|
|
8032
8171
|
// src/components/Drawer/index.tsx
|
|
8033
|
-
import { useEffect as
|
|
8172
|
+
import { useEffect as useEffect5 } from "react";
|
|
8034
8173
|
|
|
8035
8174
|
// src/components/Drawer/styledComponents.ts
|
|
8036
8175
|
var DrawerOverlayStyled = styled("div", {
|
|
@@ -8125,7 +8264,7 @@ var GoBackButtonStyled = styled("button", {
|
|
|
8125
8264
|
});
|
|
8126
8265
|
|
|
8127
8266
|
// src/components/Drawer/index.tsx
|
|
8128
|
-
import { Fragment, jsx as
|
|
8267
|
+
import { Fragment, jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
8129
8268
|
function Drawer({
|
|
8130
8269
|
isOpen,
|
|
8131
8270
|
onClose,
|
|
@@ -8137,7 +8276,7 @@ function Drawer({
|
|
|
8137
8276
|
goBackAction,
|
|
8138
8277
|
zIndex = 1e3
|
|
8139
8278
|
}) {
|
|
8140
|
-
|
|
8279
|
+
useEffect5(() => {
|
|
8141
8280
|
if (isOpen) {
|
|
8142
8281
|
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
8143
8282
|
document.body.style.overflow = "hidden";
|
|
@@ -8151,8 +8290,8 @@ function Drawer({
|
|
|
8151
8290
|
document.body.style.paddingRight = "";
|
|
8152
8291
|
};
|
|
8153
8292
|
}, [isOpen]);
|
|
8154
|
-
return /* @__PURE__ */
|
|
8155
|
-
/* @__PURE__ */
|
|
8293
|
+
return /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
8294
|
+
/* @__PURE__ */ jsx17(
|
|
8156
8295
|
DrawerOverlayStyled,
|
|
8157
8296
|
{
|
|
8158
8297
|
css: {
|
|
@@ -8162,15 +8301,16 @@ function Drawer({
|
|
|
8162
8301
|
open: isOpen
|
|
8163
8302
|
}
|
|
8164
8303
|
),
|
|
8165
|
-
/* @__PURE__ */
|
|
8304
|
+
/* @__PURE__ */ jsx17(
|
|
8166
8305
|
DrawerWrapper,
|
|
8167
8306
|
{
|
|
8168
8307
|
css: {
|
|
8169
8308
|
zIndex: zIndex + 1,
|
|
8170
|
-
width: width != null ? width : "34.25rem"
|
|
8309
|
+
width: width != null ? width : "34.25rem",
|
|
8310
|
+
maxWidth: "100%"
|
|
8171
8311
|
},
|
|
8172
8312
|
open: isOpen,
|
|
8173
|
-
children: /* @__PURE__ */
|
|
8313
|
+
children: /* @__PURE__ */ jsxs8(
|
|
8174
8314
|
DrawerContainerStyled,
|
|
8175
8315
|
{
|
|
8176
8316
|
open: isOpen,
|
|
@@ -8178,12 +8318,12 @@ function Drawer({
|
|
|
8178
8318
|
backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"]
|
|
8179
8319
|
},
|
|
8180
8320
|
children: [
|
|
8181
|
-
/* @__PURE__ */
|
|
8182
|
-
/* @__PURE__ */
|
|
8183
|
-
goBackIcon && goBackIcon && /* @__PURE__ */
|
|
8184
|
-
/* @__PURE__ */
|
|
8321
|
+
/* @__PURE__ */ jsxs8(DrawerHeaderDiv, { children: [
|
|
8322
|
+
/* @__PURE__ */ jsxs8(Flex2, { gap: 8, align: "center", children: [
|
|
8323
|
+
goBackIcon && goBackIcon && /* @__PURE__ */ jsx17(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
|
|
8324
|
+
/* @__PURE__ */ jsx17(DrawerHeaderTitle, { children: title })
|
|
8185
8325
|
] }),
|
|
8186
|
-
/* @__PURE__ */
|
|
8326
|
+
/* @__PURE__ */ jsx17(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ jsx17(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
|
|
8187
8327
|
] }),
|
|
8188
8328
|
isOpen ? children : null
|
|
8189
8329
|
]
|
|
@@ -8195,8 +8335,8 @@ function Drawer({
|
|
|
8195
8335
|
}
|
|
8196
8336
|
|
|
8197
8337
|
// src/components/TimePicker.tsx
|
|
8198
|
-
import { useCallback, useRef as
|
|
8199
|
-
import { jsx as
|
|
8338
|
+
import { useCallback, useRef as useRef6, useState as useState4 } from "react";
|
|
8339
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
8200
8340
|
var TimePickerStyled = styled("div", {
|
|
8201
8341
|
position: "relative",
|
|
8202
8342
|
width: "fit-content",
|
|
@@ -8318,12 +8458,12 @@ function TimePicker({
|
|
|
8318
8458
|
hasError,
|
|
8319
8459
|
expand = false
|
|
8320
8460
|
}) {
|
|
8321
|
-
const [hours, setHours] =
|
|
8322
|
-
const [minutes, setMinutes] =
|
|
8323
|
-
const [rawHours, setRawHours] =
|
|
8324
|
-
const [rawMinutes, setRawMinutes] =
|
|
8325
|
-
const [isOpen, setIsOpen] =
|
|
8326
|
-
const dropdownRef =
|
|
8461
|
+
const [hours, setHours] = useState4("00");
|
|
8462
|
+
const [minutes, setMinutes] = useState4("00");
|
|
8463
|
+
const [rawHours, setRawHours] = useState4("00");
|
|
8464
|
+
const [rawMinutes, setRawMinutes] = useState4("00");
|
|
8465
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
8466
|
+
const dropdownRef = useRef6(null);
|
|
8327
8467
|
useOnClickOutside(dropdownRef, () => setIsOpen(false));
|
|
8328
8468
|
const handleIncrement = useCallback(
|
|
8329
8469
|
(type) => {
|
|
@@ -8353,14 +8493,14 @@ function TimePicker({
|
|
|
8353
8493
|
},
|
|
8354
8494
|
[hours, minutes]
|
|
8355
8495
|
);
|
|
8356
|
-
return /* @__PURE__ */
|
|
8357
|
-
/* @__PURE__ */
|
|
8496
|
+
return /* @__PURE__ */ jsxs9(TimePickerStyled, { ref: dropdownRef, expand, children: [
|
|
8497
|
+
/* @__PURE__ */ jsx18(
|
|
8358
8498
|
TimePickerButtonStyled,
|
|
8359
8499
|
{
|
|
8360
8500
|
type: "button",
|
|
8361
8501
|
onClick: () => setIsOpen((prev) => !prev),
|
|
8362
8502
|
expand,
|
|
8363
|
-
children: /* @__PURE__ */
|
|
8503
|
+
children: /* @__PURE__ */ jsx18(
|
|
8364
8504
|
TextField,
|
|
8365
8505
|
{
|
|
8366
8506
|
value: selected,
|
|
@@ -8370,18 +8510,18 @@ function TimePicker({
|
|
|
8370
8510
|
typography: "labelSmall",
|
|
8371
8511
|
fontWeight: "regular",
|
|
8372
8512
|
color: hasError ? "error" : "default",
|
|
8373
|
-
children: /* @__PURE__ */
|
|
8513
|
+
children: /* @__PURE__ */ jsx18(TextFieldSlot, { children: /* @__PURE__ */ jsx18(Icon_default, { name: "clock", size: "xl" }) })
|
|
8374
8514
|
}
|
|
8375
8515
|
)
|
|
8376
8516
|
}
|
|
8377
8517
|
),
|
|
8378
|
-
isOpen && /* @__PURE__ */
|
|
8518
|
+
isOpen && /* @__PURE__ */ jsxs9(
|
|
8379
8519
|
TimePickerDropdownStyled,
|
|
8380
8520
|
{
|
|
8381
8521
|
style: position === "top" ? { bottom: "110%", left: "0" } : position === "top-right" ? { bottom: "110%", right: "0" } : position === "bottom-right" ? { top: "110%", right: "0" } : { top: "110%", left: "0" },
|
|
8382
8522
|
children: [
|
|
8383
|
-
/* @__PURE__ */
|
|
8384
|
-
["hours", "minutes"].map((unit) => /* @__PURE__ */
|
|
8523
|
+
/* @__PURE__ */ jsxs9(TimerPickerContentStyled, { children: [
|
|
8524
|
+
["hours", "minutes"].map((unit) => /* @__PURE__ */ jsxs9(
|
|
8385
8525
|
Box,
|
|
8386
8526
|
{
|
|
8387
8527
|
style: {
|
|
@@ -8390,13 +8530,13 @@ function TimePicker({
|
|
|
8390
8530
|
flexDirection: "column"
|
|
8391
8531
|
},
|
|
8392
8532
|
children: [
|
|
8393
|
-
/* @__PURE__ */
|
|
8533
|
+
/* @__PURE__ */ jsx18(
|
|
8394
8534
|
TimePickerIconButton,
|
|
8395
8535
|
{
|
|
8396
8536
|
type: "button",
|
|
8397
8537
|
variant: "text",
|
|
8398
8538
|
onClick: () => handleIncrement(unit),
|
|
8399
|
-
children: /* @__PURE__ */
|
|
8539
|
+
children: /* @__PURE__ */ jsxs9(
|
|
8400
8540
|
"svg",
|
|
8401
8541
|
{
|
|
8402
8542
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8405,14 +8545,14 @@ function TimePicker({
|
|
|
8405
8545
|
viewBox: "0 0 32 32",
|
|
8406
8546
|
fill: "none",
|
|
8407
8547
|
children: [
|
|
8408
|
-
/* @__PURE__ */
|
|
8548
|
+
/* @__PURE__ */ jsx18(
|
|
8409
8549
|
"path",
|
|
8410
8550
|
{
|
|
8411
8551
|
d: "M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",
|
|
8412
8552
|
fill: "white"
|
|
8413
8553
|
}
|
|
8414
8554
|
),
|
|
8415
|
-
/* @__PURE__ */
|
|
8555
|
+
/* @__PURE__ */ jsx18(
|
|
8416
8556
|
"path",
|
|
8417
8557
|
{
|
|
8418
8558
|
d: "M16.7063 12.2937C16.3157 11.9031 15.6813 11.9031 15.2907 12.2937L10.2907 17.2937C9.9001 17.6843 9.9001 18.3187 10.2907 18.7093C10.6813 19.1 11.3157 19.1 11.7063 18.7093L16.0001 14.4156L20.2938 18.7062C20.6845 19.0968 21.3188 19.0968 21.7095 18.7062C22.1001 18.3156 22.1001 17.6812 21.7095 17.2906L16.7095 12.2906L16.7063 12.2937Z",
|
|
@@ -8424,7 +8564,7 @@ function TimePicker({
|
|
|
8424
8564
|
)
|
|
8425
8565
|
}
|
|
8426
8566
|
),
|
|
8427
|
-
/* @__PURE__ */
|
|
8567
|
+
/* @__PURE__ */ jsx18(
|
|
8428
8568
|
InputStyled,
|
|
8429
8569
|
{
|
|
8430
8570
|
inputMode: "numeric",
|
|
@@ -8462,13 +8602,13 @@ function TimePicker({
|
|
|
8462
8602
|
}
|
|
8463
8603
|
}
|
|
8464
8604
|
),
|
|
8465
|
-
/* @__PURE__ */
|
|
8605
|
+
/* @__PURE__ */ jsx18(
|
|
8466
8606
|
TimePickerIconButton,
|
|
8467
8607
|
{
|
|
8468
8608
|
type: "button",
|
|
8469
8609
|
variant: "text",
|
|
8470
8610
|
onClick: () => handleDecrement(unit),
|
|
8471
|
-
children: /* @__PURE__ */
|
|
8611
|
+
children: /* @__PURE__ */ jsxs9(
|
|
8472
8612
|
"svg",
|
|
8473
8613
|
{
|
|
8474
8614
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8477,14 +8617,14 @@ function TimePicker({
|
|
|
8477
8617
|
viewBox: "0 0 32 32",
|
|
8478
8618
|
fill: "none",
|
|
8479
8619
|
children: [
|
|
8480
|
-
/* @__PURE__ */
|
|
8620
|
+
/* @__PURE__ */ jsx18(
|
|
8481
8621
|
"path",
|
|
8482
8622
|
{
|
|
8483
8623
|
d: "M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",
|
|
8484
8624
|
fill: "white"
|
|
8485
8625
|
}
|
|
8486
8626
|
),
|
|
8487
|
-
/* @__PURE__ */
|
|
8627
|
+
/* @__PURE__ */ jsx18(
|
|
8488
8628
|
"path",
|
|
8489
8629
|
{
|
|
8490
8630
|
d: "M15.2937 19.7063C15.6843 20.0969 16.3187 20.0969 16.7093 19.7063L21.7093 14.7063C22.0999 14.3157 22.0999 13.6813 21.7093 13.2907C21.3187 12.9 20.6843 12.9 20.2937 13.2907L15.9999 17.5844L11.7062 13.2938C11.3155 12.9032 10.6812 12.9032 10.2905 13.2938C9.8999 13.6844 9.8999 14.3188 10.2905 14.7094L15.2905 19.7094L15.2937 19.7063Z",
|
|
@@ -8500,9 +8640,9 @@ function TimePicker({
|
|
|
8500
8640
|
},
|
|
8501
8641
|
unit
|
|
8502
8642
|
)),
|
|
8503
|
-
/* @__PURE__ */
|
|
8643
|
+
/* @__PURE__ */ jsx18(Text, { children: ":" })
|
|
8504
8644
|
] }),
|
|
8505
|
-
/* @__PURE__ */
|
|
8645
|
+
/* @__PURE__ */ jsx18(TimePickerFooterStyled, { children: /* @__PURE__ */ jsx18(
|
|
8506
8646
|
Button,
|
|
8507
8647
|
{
|
|
8508
8648
|
type: "button",
|
|
@@ -8525,7 +8665,7 @@ function TimePicker({
|
|
|
8525
8665
|
|
|
8526
8666
|
// src/components/Alert.tsx
|
|
8527
8667
|
import { Theme as Theme2, AlertDialog } from "@radix-ui/themes";
|
|
8528
|
-
import { Fragment as Fragment2, jsx as
|
|
8668
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
8529
8669
|
var AlertDialogSimpleStyled = styled(AlertDialog.Content, {
|
|
8530
8670
|
fontFamily: "$default",
|
|
8531
8671
|
lineHeight: "$base",
|
|
@@ -8639,19 +8779,19 @@ function Alert(_a) {
|
|
|
8639
8779
|
"completAlert",
|
|
8640
8780
|
"simpleAlert"
|
|
8641
8781
|
]);
|
|
8642
|
-
return /* @__PURE__ */
|
|
8643
|
-
simpleAlert && /* @__PURE__ */
|
|
8644
|
-
/* @__PURE__ */
|
|
8645
|
-
/* @__PURE__ */
|
|
8646
|
-
/* @__PURE__ */
|
|
8647
|
-
simpleAlert.cancel && /* @__PURE__ */
|
|
8782
|
+
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
8783
|
+
simpleAlert && /* @__PURE__ */ jsx19(Theme2, { children: /* @__PURE__ */ jsxs10(AlertDialog.Root, { children: [
|
|
8784
|
+
/* @__PURE__ */ jsx19(AlertDialog.Trigger, { children: trigger }),
|
|
8785
|
+
/* @__PURE__ */ jsx19(Fragment2, { children: /* @__PURE__ */ jsxs10(AlertDialogSimpleStyled, __spreadProps(__spreadValues({}, props), { children: [
|
|
8786
|
+
/* @__PURE__ */ jsx19(AlertDialogDescriptionStyled, { children: simpleAlert.description }),
|
|
8787
|
+
simpleAlert.cancel && /* @__PURE__ */ jsx19(AlertDialog.Cancel, { children: /* @__PURE__ */ jsx19(Button, { variant: "text", children: /* @__PURE__ */ jsx19(Icon_default, { name: "close" }) }) })
|
|
8648
8788
|
] })) })
|
|
8649
8789
|
] }) }),
|
|
8650
|
-
completAlert && /* @__PURE__ */
|
|
8651
|
-
/* @__PURE__ */
|
|
8652
|
-
/* @__PURE__ */
|
|
8653
|
-
/* @__PURE__ */
|
|
8654
|
-
color === "success" && /* @__PURE__ */
|
|
8790
|
+
completAlert && /* @__PURE__ */ jsx19(Theme2, { children: /* @__PURE__ */ jsxs10(AlertDialog.Root, { children: [
|
|
8791
|
+
/* @__PURE__ */ jsx19(AlertDialog.Trigger, { children: trigger }),
|
|
8792
|
+
/* @__PURE__ */ jsxs10(AlertDialogCompleteStyled, { children: [
|
|
8793
|
+
/* @__PURE__ */ jsxs10(AlertDialogRowStyled, { className: "le-alert-dialog-row", children: [
|
|
8794
|
+
color === "success" && /* @__PURE__ */ jsxs10(
|
|
8655
8795
|
"svg",
|
|
8656
8796
|
{
|
|
8657
8797
|
width: "56",
|
|
@@ -8660,18 +8800,18 @@ function Alert(_a) {
|
|
|
8660
8800
|
fill: "none",
|
|
8661
8801
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8662
8802
|
children: [
|
|
8663
|
-
/* @__PURE__ */
|
|
8803
|
+
/* @__PURE__ */ jsx19("g", { clipPath: "url(#clip0_1428_9995)", children: /* @__PURE__ */ jsx19(
|
|
8664
8804
|
"path",
|
|
8665
8805
|
{
|
|
8666
8806
|
d: "M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM40.3594 22.8594L26.3594 36.8594C25.3312 37.8875 23.6688 37.8875 22.6516 36.8594L15.6516 29.8594C14.6234 28.8312 14.6234 27.1688 15.6516 26.1516C16.6797 25.1344 18.3422 25.1234 19.3594 26.1516L24.5 31.2922L36.6406 19.1406C37.6688 18.1125 39.3312 18.1125 40.3484 19.1406C41.3656 20.1688 41.3766 21.8312 40.3484 22.8484L40.3594 22.8594Z",
|
|
8667
8807
|
fill: "#1E8535"
|
|
8668
8808
|
}
|
|
8669
8809
|
) }),
|
|
8670
|
-
/* @__PURE__ */
|
|
8810
|
+
/* @__PURE__ */ jsx19("defs", { children: /* @__PURE__ */ jsx19("clipPath", { id: "clip0_1428_9995", children: /* @__PURE__ */ jsx19("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
8671
8811
|
]
|
|
8672
8812
|
}
|
|
8673
8813
|
),
|
|
8674
|
-
color === "error" && /* @__PURE__ */
|
|
8814
|
+
color === "error" && /* @__PURE__ */ jsxs10(
|
|
8675
8815
|
"svg",
|
|
8676
8816
|
{
|
|
8677
8817
|
width: "56",
|
|
@@ -8680,18 +8820,18 @@ function Alert(_a) {
|
|
|
8680
8820
|
fill: "none",
|
|
8681
8821
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8682
8822
|
children: [
|
|
8683
|
-
/* @__PURE__ */
|
|
8823
|
+
/* @__PURE__ */ jsx19("g", { clipPath: "url(#clip0_1428_10022)", children: /* @__PURE__ */ jsx19(
|
|
8684
8824
|
"path",
|
|
8685
8825
|
{
|
|
8686
8826
|
d: "M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM19.1406 19.1406C20.1687 18.1125 21.8312 18.1125 22.8484 19.1406L27.9891 24.2812L33.1297 19.1406C34.1578 18.1125 35.8203 18.1125 36.8375 19.1406C37.8547 20.1687 37.8656 21.8312 36.8375 22.8484L31.6969 27.9891L36.8375 33.1297C37.8656 34.1578 37.8656 35.8203 36.8375 36.8375C35.8094 37.8547 34.1469 37.8656 33.1297 36.8375L27.9891 31.6969L22.8484 36.8375C21.8203 37.8656 20.1578 37.8656 19.1406 36.8375C18.1234 35.8094 18.1125 34.1469 19.1406 33.1297L24.2812 27.9891L19.1406 22.8484C18.1125 21.8203 18.1125 20.1578 19.1406 19.1406Z",
|
|
8687
8827
|
fill: "#AD1F2B"
|
|
8688
8828
|
}
|
|
8689
8829
|
) }),
|
|
8690
|
-
/* @__PURE__ */
|
|
8830
|
+
/* @__PURE__ */ jsx19("defs", { children: /* @__PURE__ */ jsx19("clipPath", { id: "clip0_1428_10022", children: /* @__PURE__ */ jsx19("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
8691
8831
|
]
|
|
8692
8832
|
}
|
|
8693
8833
|
),
|
|
8694
|
-
color === "warning" && /* @__PURE__ */
|
|
8834
|
+
color === "warning" && /* @__PURE__ */ jsxs10(
|
|
8695
8835
|
"svg",
|
|
8696
8836
|
{
|
|
8697
8837
|
width: "56",
|
|
@@ -8700,18 +8840,18 @@ function Alert(_a) {
|
|
|
8700
8840
|
fill: "none",
|
|
8701
8841
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8702
8842
|
children: [
|
|
8703
|
-
/* @__PURE__ */
|
|
8843
|
+
/* @__PURE__ */ jsx19("g", { clipPath: "url(#clip0_1428_10038)", children: /* @__PURE__ */ jsx19(
|
|
8704
8844
|
"path",
|
|
8705
8845
|
{
|
|
8706
8846
|
d: "M28 56C35.4261 56 42.548 53.05 47.799 47.799C53.05 42.548 56 35.4261 56 28C56 20.5739 53.05 13.452 47.799 8.20101C42.548 2.94999 35.4261 0 28 0C20.5739 0 13.452 2.94999 8.20101 8.20101C2.94999 13.452 0 20.5739 0 28C0 35.4261 2.94999 42.548 8.20101 47.799C13.452 53.05 20.5739 56 28 56ZM28 14C29.4547 14 30.625 15.1703 30.625 16.625V28.875C30.625 30.3297 29.4547 31.5 28 31.5C26.5453 31.5 25.375 30.3297 25.375 28.875V16.625C25.375 15.1703 26.5453 14 28 14ZM24.5 38.5C24.5 37.5717 24.8687 36.6815 25.5251 36.0251C26.1815 35.3688 27.0717 35 28 35C28.9283 35 29.8185 35.3688 30.4749 36.0251C31.1313 36.6815 31.5 37.5717 31.5 38.5C31.5 39.4283 31.1313 40.3185 30.4749 40.9749C29.8185 41.6312 28.9283 42 28 42C27.0717 42 26.1815 41.6312 25.5251 40.9749C24.8687 40.3185 24.5 39.4283 24.5 38.5Z",
|
|
8707
8847
|
fill: "#CC9A06"
|
|
8708
8848
|
}
|
|
8709
8849
|
) }),
|
|
8710
|
-
/* @__PURE__ */
|
|
8850
|
+
/* @__PURE__ */ jsx19("defs", { children: /* @__PURE__ */ jsx19("clipPath", { id: "clip0_1428_10038", children: /* @__PURE__ */ jsx19("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
8711
8851
|
]
|
|
8712
8852
|
}
|
|
8713
8853
|
),
|
|
8714
|
-
color === "info" && /* @__PURE__ */
|
|
8854
|
+
color === "info" && /* @__PURE__ */ jsxs10(
|
|
8715
8855
|
"svg",
|
|
8716
8856
|
{
|
|
8717
8857
|
width: "40",
|
|
@@ -8720,35 +8860,35 @@ function Alert(_a) {
|
|
|
8720
8860
|
fill: "none",
|
|
8721
8861
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8722
8862
|
children: [
|
|
8723
|
-
/* @__PURE__ */
|
|
8863
|
+
/* @__PURE__ */ jsx19("g", { clipPath: "url(#clip0_1645_46)", children: /* @__PURE__ */ jsx19(
|
|
8724
8864
|
"path",
|
|
8725
8865
|
{
|
|
8726
8866
|
d: "M20 40C25.3043 40 30.3914 37.8929 34.1421 34.1421C37.8929 30.3914 40 25.3043 40 20C40 14.6957 37.8929 9.60859 34.1421 5.85786C30.3914 2.10714 25.3043 0 20 0C14.6957 0 9.60859 2.10714 5.85786 5.85786C2.10714 9.60859 0 14.6957 0 20C0 25.3043 2.10714 30.3914 5.85786 34.1421C9.60859 37.8929 14.6957 40 20 40ZM20 10C21.0391 10 21.875 10.8359 21.875 11.875V20.625C21.875 21.6641 21.0391 22.5 20 22.5C18.9609 22.5 18.125 21.6641 18.125 20.625V11.875C18.125 10.8359 18.9609 10 20 10ZM17.5 27.5C17.5 26.837 17.7634 26.2011 18.2322 25.7322C18.7011 25.2634 19.337 25 20 25C20.663 25 21.2989 25.2634 21.7678 25.7322C22.2366 26.2011 22.5 26.837 22.5 27.5C22.5 28.163 22.2366 28.7989 21.7678 29.2678C21.2989 29.7366 20.663 30 20 30C19.337 30 18.7011 29.7366 18.2322 29.2678C17.7634 28.7989 17.5 28.163 17.5 27.5Z",
|
|
8727
8867
|
fill: "#9FB6C7"
|
|
8728
8868
|
}
|
|
8729
8869
|
) }),
|
|
8730
|
-
/* @__PURE__ */
|
|
8870
|
+
/* @__PURE__ */ jsx19("defs", { children: /* @__PURE__ */ jsx19("clipPath", { id: "clip0_1645_46", children: /* @__PURE__ */ jsx19("rect", { width: "40", height: "40", fill: "white" }) }) })
|
|
8731
8871
|
]
|
|
8732
8872
|
}
|
|
8733
8873
|
),
|
|
8734
|
-
completAlert.title && /* @__PURE__ */
|
|
8735
|
-
/* @__PURE__ */
|
|
8736
|
-
completAlert.subtitle && /* @__PURE__ */
|
|
8874
|
+
completAlert.title && /* @__PURE__ */ jsx19(AlertDialogTitleStyled, { children: completAlert.title }),
|
|
8875
|
+
/* @__PURE__ */ jsxs10(AlertDialogDescriptionStyled, { children: [
|
|
8876
|
+
completAlert.subtitle && /* @__PURE__ */ jsx19(
|
|
8737
8877
|
Text,
|
|
8738
8878
|
{
|
|
8739
8879
|
css: {
|
|
8740
8880
|
fontSize: "$16"
|
|
8741
8881
|
},
|
|
8742
8882
|
asChild: true,
|
|
8743
|
-
children: /* @__PURE__ */
|
|
8883
|
+
children: /* @__PURE__ */ jsx19("h2", { children: completAlert.subtitle })
|
|
8744
8884
|
}
|
|
8745
8885
|
),
|
|
8746
8886
|
completAlert.description
|
|
8747
8887
|
] })
|
|
8748
8888
|
] }),
|
|
8749
|
-
completAlert.onAction || completAlert.cancel ? /* @__PURE__ */
|
|
8750
|
-
/* @__PURE__ */
|
|
8751
|
-
completAlert.onAction && /* @__PURE__ */
|
|
8889
|
+
completAlert.onAction || completAlert.cancel ? /* @__PURE__ */ jsx19(AlertDialoghrStyled, {}) : null,
|
|
8890
|
+
/* @__PURE__ */ jsx19(AlertDialogRowStyled, { children: /* @__PURE__ */ jsxs10(Flex2, { gap: "10", justify: "end", width: "100%", children: [
|
|
8891
|
+
completAlert.onAction && /* @__PURE__ */ jsx19(AlertDialog.Action, { children: /* @__PURE__ */ jsx19(
|
|
8752
8892
|
Button,
|
|
8753
8893
|
{
|
|
8754
8894
|
variant: "contained",
|
|
@@ -8756,7 +8896,7 @@ function Alert(_a) {
|
|
|
8756
8896
|
children: completAlert.actionText || "Salvar"
|
|
8757
8897
|
}
|
|
8758
8898
|
) }),
|
|
8759
|
-
completAlert.cancel && /* @__PURE__ */
|
|
8899
|
+
completAlert.cancel && /* @__PURE__ */ jsx19(AlertDialog.Cancel, { children: /* @__PURE__ */ jsx19(Button, { variant: "outlined", color: "neutral", children: completAlert.cancelText || "Cancelar" }) })
|
|
8760
8900
|
] }) })
|
|
8761
8901
|
] })
|
|
8762
8902
|
] }) })
|
|
@@ -8765,7 +8905,7 @@ function Alert(_a) {
|
|
|
8765
8905
|
|
|
8766
8906
|
// src/components/Switch.tsx
|
|
8767
8907
|
import { Switch as RadixSwitch } from "@radix-ui/themes";
|
|
8768
|
-
import { jsx as
|
|
8908
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
8769
8909
|
var SwitchStyled = styled(RadixSwitch, {
|
|
8770
8910
|
all: "unset",
|
|
8771
8911
|
borderRadius: "$full",
|
|
@@ -8859,13 +8999,13 @@ var SwitchStyled = styled(RadixSwitch, {
|
|
|
8859
8999
|
}
|
|
8860
9000
|
});
|
|
8861
9001
|
function Switch(props) {
|
|
8862
|
-
return /* @__PURE__ */
|
|
9002
|
+
return /* @__PURE__ */ jsx20(SwitchStyled, __spreadValues({ color: "brand", defaultChecked: true }, props));
|
|
8863
9003
|
}
|
|
8864
9004
|
|
|
8865
9005
|
// src/components/Step.tsx
|
|
8866
|
-
import
|
|
9006
|
+
import React8 from "react";
|
|
8867
9007
|
import { Box as Box2, Tabs as StepRadix } from "@radix-ui/themes";
|
|
8868
|
-
import { jsx as
|
|
9008
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
8869
9009
|
var StepStyled = styled("div", {
|
|
8870
9010
|
fontFamily: "$default",
|
|
8871
9011
|
color: "$gray100",
|
|
@@ -8938,7 +9078,7 @@ var StepListStyled = styled(StepRadix.List, {
|
|
|
8938
9078
|
});
|
|
8939
9079
|
function Step(_a) {
|
|
8940
9080
|
var _b = _a, { children, defaultValue } = _b, props = __objRest(_b, ["children", "defaultValue"]);
|
|
8941
|
-
return /* @__PURE__ */
|
|
9081
|
+
return /* @__PURE__ */ jsx21(StepRadix.Root, { defaultValue: String(defaultValue), children: /* @__PURE__ */ jsx21(StepStyled, __spreadProps(__spreadValues({}, props), { children })) });
|
|
8942
9082
|
}
|
|
8943
9083
|
function StepTrigger(_a) {
|
|
8944
9084
|
var _b = _a, {
|
|
@@ -8951,7 +9091,7 @@ function StepTrigger(_a) {
|
|
|
8951
9091
|
"currentStep"
|
|
8952
9092
|
]);
|
|
8953
9093
|
const isActiveOrPrevious = currentStep !== void 0 && value <= currentStep;
|
|
8954
|
-
return /* @__PURE__ */
|
|
9094
|
+
return /* @__PURE__ */ jsx21(
|
|
8955
9095
|
StepTriggerStyled,
|
|
8956
9096
|
__spreadProps(__spreadValues({
|
|
8957
9097
|
"data-filled": isActiveOrPrevious,
|
|
@@ -8969,7 +9109,7 @@ function StepContent(_a) {
|
|
|
8969
9109
|
"value",
|
|
8970
9110
|
"children"
|
|
8971
9111
|
]);
|
|
8972
|
-
return /* @__PURE__ */
|
|
9112
|
+
return /* @__PURE__ */ jsx21(StepRadix.Content, __spreadProps(__spreadValues({ value: String(value) }, props), { children }));
|
|
8973
9113
|
}
|
|
8974
9114
|
function StepList(_a) {
|
|
8975
9115
|
var _b = _a, {
|
|
@@ -8979,9 +9119,9 @@ function StepList(_a) {
|
|
|
8979
9119
|
"children",
|
|
8980
9120
|
"currentStep"
|
|
8981
9121
|
]);
|
|
8982
|
-
return /* @__PURE__ */
|
|
8983
|
-
if (
|
|
8984
|
-
return
|
|
9122
|
+
return /* @__PURE__ */ jsx21(StepListStyled, __spreadProps(__spreadValues({}, props), { children: React8.Children.map(children, (child) => {
|
|
9123
|
+
if (React8.isValidElement(child) && child.type === StepTrigger) {
|
|
9124
|
+
return React8.cloneElement(child, { currentStep });
|
|
8985
9125
|
}
|
|
8986
9126
|
return child;
|
|
8987
9127
|
}) }));
|
|
@@ -8992,12 +9132,12 @@ function StepWrapper(_a) {
|
|
|
8992
9132
|
} = _b, props = __objRest(_b, [
|
|
8993
9133
|
"children"
|
|
8994
9134
|
]);
|
|
8995
|
-
return /* @__PURE__ */
|
|
9135
|
+
return /* @__PURE__ */ jsx21(Box2, __spreadProps(__spreadValues({}, props), { children }));
|
|
8996
9136
|
}
|
|
8997
9137
|
|
|
8998
9138
|
// src/components/Card.tsx
|
|
8999
9139
|
import { Card as CardRadix } from "@radix-ui/themes";
|
|
9000
|
-
import { jsx as
|
|
9140
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
9001
9141
|
var CardStyled = styled(CardRadix, {
|
|
9002
9142
|
borderRadius: "$2xl",
|
|
9003
9143
|
border: "1px solid $dark100",
|
|
@@ -9047,7 +9187,7 @@ function Card(_a) {
|
|
|
9047
9187
|
"padding",
|
|
9048
9188
|
"radius"
|
|
9049
9189
|
]);
|
|
9050
|
-
return /* @__PURE__ */
|
|
9190
|
+
return /* @__PURE__ */ jsx22(
|
|
9051
9191
|
CardStyled,
|
|
9052
9192
|
__spreadProps(__spreadValues({}, props), {
|
|
9053
9193
|
css: __spreadValues({ padding, borderRadius: radius }, props.css),
|
|
@@ -9058,8 +9198,8 @@ function Card(_a) {
|
|
|
9058
9198
|
|
|
9059
9199
|
// src/components/TextareaField.tsx
|
|
9060
9200
|
import { TextArea as TextAreaRadix } from "@radix-ui/themes";
|
|
9061
|
-
import
|
|
9062
|
-
import { jsx as
|
|
9201
|
+
import React9, { useRef as useRef7, useState as useState5, useEffect as useEffect6 } from "react";
|
|
9202
|
+
import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
9063
9203
|
var TextareaFieldStyle = styled(TextAreaRadix, {
|
|
9064
9204
|
display: "flex",
|
|
9065
9205
|
flex: 1,
|
|
@@ -9123,11 +9263,11 @@ var TextareaLimitIndicator = styled("div", {
|
|
|
9123
9263
|
padding: "$4"
|
|
9124
9264
|
}
|
|
9125
9265
|
});
|
|
9126
|
-
var TextareaField =
|
|
9127
|
-
var _b = _a, { maxLength, color } = _b, props = __objRest(_b, ["maxLength", "color"]);
|
|
9128
|
-
const inputRef =
|
|
9129
|
-
const [remaining, setRemaining] =
|
|
9130
|
-
|
|
9266
|
+
var TextareaField = React9.forwardRef((_a, forwardedRef) => {
|
|
9267
|
+
var _b = _a, { maxLength, color, simpleLayout = false } = _b, props = __objRest(_b, ["maxLength", "color", "simpleLayout"]);
|
|
9268
|
+
const inputRef = useRef7(null);
|
|
9269
|
+
const [remaining, setRemaining] = useState5(maxLength);
|
|
9270
|
+
useEffect6(() => {
|
|
9131
9271
|
var _a2;
|
|
9132
9272
|
if (maxLength && inputRef.current) {
|
|
9133
9273
|
setRemaining(maxLength - ((_a2 = inputRef.current.value.length) != null ? _a2 : 0));
|
|
@@ -9140,29 +9280,32 @@ var TextareaField = React8.forwardRef((_a, forwardedRef) => {
|
|
|
9140
9280
|
}
|
|
9141
9281
|
(_a2 = props.onInput) == null ? void 0 : _a2.call(props, e);
|
|
9142
9282
|
};
|
|
9143
|
-
return /* @__PURE__ */
|
|
9144
|
-
/* @__PURE__ */
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9283
|
+
return /* @__PURE__ */ jsxs11(Flex2, { direction: "column", align: "end", style: { position: "relative" }, children: [
|
|
9284
|
+
maxLength && simpleLayout && /* @__PURE__ */ jsx23(Badge, { size: "sm", color: "grey", style: { position: "absolute", right: 0, top: "-1.75rem" }, children: remaining }),
|
|
9285
|
+
/* @__PURE__ */ jsxs11(TextareaContainer, { color, children: [
|
|
9286
|
+
/* @__PURE__ */ jsx23(
|
|
9287
|
+
TextareaFieldStyle,
|
|
9288
|
+
__spreadValues({
|
|
9289
|
+
rows: 4,
|
|
9290
|
+
ref: (r) => {
|
|
9291
|
+
if (!r) return;
|
|
9292
|
+
inputRef.current = r;
|
|
9293
|
+
if (forwardedRef) {
|
|
9294
|
+
if (typeof forwardedRef === "function") forwardedRef(r);
|
|
9295
|
+
else forwardedRef.current = r;
|
|
9296
|
+
}
|
|
9297
|
+
},
|
|
9298
|
+
onInput: handleInput,
|
|
9299
|
+
maxLength
|
|
9300
|
+
}, props)
|
|
9301
|
+
),
|
|
9302
|
+
maxLength && !simpleLayout && /* @__PURE__ */ jsx23(TextareaLimitIndicator, { children: /* @__PURE__ */ jsx23(Text, { typography: "badgeMedium", children: remaining }) })
|
|
9303
|
+
] })
|
|
9161
9304
|
] });
|
|
9162
9305
|
});
|
|
9163
9306
|
|
|
9164
9307
|
// src/components/Toast/components/ToastItem.tsx
|
|
9165
|
-
import { useState as
|
|
9308
|
+
import { useState as useState6 } from "react";
|
|
9166
9309
|
|
|
9167
9310
|
// src/components/Toast/styles/index.ts
|
|
9168
9311
|
import { keyframes as keyframes2 } from "@stitches/react";
|
|
@@ -9288,19 +9431,19 @@ var ToastClose = styled(ToastPrimitive.Close, {
|
|
|
9288
9431
|
});
|
|
9289
9432
|
|
|
9290
9433
|
// src/components/Toast/components/ToastItem.tsx
|
|
9291
|
-
import { jsx as
|
|
9434
|
+
import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
9292
9435
|
function ToastItem({
|
|
9293
9436
|
toast,
|
|
9294
9437
|
onRemove
|
|
9295
9438
|
}) {
|
|
9296
|
-
const [open, setOpen] =
|
|
9439
|
+
const [open, setOpen] = useState6(true);
|
|
9297
9440
|
const handleOpenChange = (open2) => {
|
|
9298
9441
|
setOpen(open2);
|
|
9299
9442
|
if (!open2) {
|
|
9300
9443
|
onRemove(toast.id);
|
|
9301
9444
|
}
|
|
9302
9445
|
};
|
|
9303
|
-
return /* @__PURE__ */
|
|
9446
|
+
return /* @__PURE__ */ jsxs12(
|
|
9304
9447
|
ToastRoot,
|
|
9305
9448
|
{
|
|
9306
9449
|
type: toast.type,
|
|
@@ -9308,18 +9451,18 @@ function ToastItem({
|
|
|
9308
9451
|
open,
|
|
9309
9452
|
onOpenChange: handleOpenChange,
|
|
9310
9453
|
children: [
|
|
9311
|
-
(toast == null ? void 0 : toast.icon) && /* @__PURE__ */
|
|
9312
|
-
/* @__PURE__ */
|
|
9313
|
-
/* @__PURE__ */
|
|
9454
|
+
(toast == null ? void 0 : toast.icon) && /* @__PURE__ */ jsx24(Icon_default, { name: toast.icon, size: "xl" }),
|
|
9455
|
+
/* @__PURE__ */ jsx24("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsx24(Text, { typography: "bodyS", fontWeight: "medium", children: toast.message }) }),
|
|
9456
|
+
/* @__PURE__ */ jsx24(ToastClose, { "aria-label": "Close", children: /* @__PURE__ */ jsx24(Icon_default, { name: "xmark", size: "md" }) })
|
|
9314
9457
|
]
|
|
9315
9458
|
}
|
|
9316
9459
|
);
|
|
9317
9460
|
}
|
|
9318
9461
|
|
|
9319
9462
|
// src/components/Toast/components/ToastProvider.tsx
|
|
9320
|
-
import { createContext, useState as
|
|
9463
|
+
import { createContext, useState as useState7 } from "react";
|
|
9321
9464
|
import * as ToastPrimitive2 from "@radix-ui/react-toast";
|
|
9322
|
-
import { jsx as
|
|
9465
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
9323
9466
|
var ToastContext = createContext(null);
|
|
9324
9467
|
function ToastProvider({
|
|
9325
9468
|
children,
|
|
@@ -9327,7 +9470,7 @@ function ToastProvider({
|
|
|
9327
9470
|
maxToasts = 5,
|
|
9328
9471
|
swipeDirection = "right"
|
|
9329
9472
|
}) {
|
|
9330
|
-
const [toasts, setToasts] =
|
|
9473
|
+
const [toasts, setToasts] = useState7([]);
|
|
9331
9474
|
const addToast = (toastData) => {
|
|
9332
9475
|
const id = Math.random().toString(36).substr(2, 9);
|
|
9333
9476
|
const newToast = __spreadProps(__spreadValues({
|
|
@@ -9355,10 +9498,10 @@ function ToastProvider({
|
|
|
9355
9498
|
removeToast,
|
|
9356
9499
|
removeAllToasts
|
|
9357
9500
|
};
|
|
9358
|
-
return /* @__PURE__ */
|
|
9501
|
+
return /* @__PURE__ */ jsx25(ToastContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs13(ToastPrimitive2.Provider, { swipeDirection, children: [
|
|
9359
9502
|
children,
|
|
9360
|
-
toasts.map((toast) => /* @__PURE__ */
|
|
9361
|
-
/* @__PURE__ */
|
|
9503
|
+
toasts.map((toast) => /* @__PURE__ */ jsx25(ToastItem, { toast, onRemove: removeToast }, toast.id)),
|
|
9504
|
+
/* @__PURE__ */ jsx25(ToastViewport, {})
|
|
9362
9505
|
] }) });
|
|
9363
9506
|
}
|
|
9364
9507
|
|
|
@@ -9374,7 +9517,7 @@ var useToast = () => {
|
|
|
9374
9517
|
|
|
9375
9518
|
// src/components/Tooltip/index.tsx
|
|
9376
9519
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
9377
|
-
import { jsx as
|
|
9520
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9378
9521
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
9379
9522
|
var TooltipRoot = TooltipPrimitive.Root;
|
|
9380
9523
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
@@ -9413,17 +9556,17 @@ function Tooltip({
|
|
|
9413
9556
|
delayDuration = 200,
|
|
9414
9557
|
side = "top"
|
|
9415
9558
|
}) {
|
|
9416
|
-
return /* @__PURE__ */
|
|
9417
|
-
/* @__PURE__ */
|
|
9418
|
-
/* @__PURE__ */
|
|
9419
|
-
typeof content === "string" ? /* @__PURE__ */
|
|
9420
|
-
/* @__PURE__ */
|
|
9559
|
+
return /* @__PURE__ */ jsx26(TooltipProvider, { children: /* @__PURE__ */ jsxs14(TooltipRoot, { delayDuration, children: [
|
|
9560
|
+
/* @__PURE__ */ jsx26(TooltipTrigger, { asChild: true, children }),
|
|
9561
|
+
/* @__PURE__ */ jsxs14(TooltipContent, { side, sideOffset: 5, children: [
|
|
9562
|
+
typeof content === "string" ? /* @__PURE__ */ jsx26(Text, { typography: "tooltip", children: content }) : content,
|
|
9563
|
+
/* @__PURE__ */ jsx26(TooltipArrow, {})
|
|
9421
9564
|
] })
|
|
9422
9565
|
] }) });
|
|
9423
9566
|
}
|
|
9424
9567
|
|
|
9425
9568
|
// src/components/MultiSelect/index.tsx
|
|
9426
|
-
import
|
|
9569
|
+
import React10, { useCallback as useCallback2, useRef as useRef8, useState as useState8 } from "react";
|
|
9427
9570
|
import { DropdownMenu as DropdownMenu4, Theme as Theme3 } from "@radix-ui/themes";
|
|
9428
9571
|
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
9429
9572
|
import {
|
|
@@ -9580,8 +9723,8 @@ var ButtonSelectAllStyled = styled("button", {
|
|
|
9580
9723
|
});
|
|
9581
9724
|
|
|
9582
9725
|
// src/components/MultiSelect/index.tsx
|
|
9583
|
-
import { jsx as
|
|
9584
|
-
var MultiSelect =
|
|
9726
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9727
|
+
var MultiSelect = React10.forwardRef(
|
|
9585
9728
|
({
|
|
9586
9729
|
placeholder,
|
|
9587
9730
|
value: selectedValues = [],
|
|
@@ -9599,9 +9742,9 @@ var MultiSelect = React9.forwardRef(
|
|
|
9599
9742
|
selectedAllText,
|
|
9600
9743
|
selectedScroll = false
|
|
9601
9744
|
}, fowardedRef) => {
|
|
9602
|
-
const [isOpen, setIsOpen] =
|
|
9603
|
-
const triggerRef =
|
|
9604
|
-
const [allOptionsSelected, setAllOptionsSelected] =
|
|
9745
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
9746
|
+
const triggerRef = useRef8(null);
|
|
9747
|
+
const [allOptionsSelected, setAllOptionsSelected] = useState8(false);
|
|
9605
9748
|
const labelByValue = useMemo2(() => {
|
|
9606
9749
|
return options.reduce((prev, curr) => {
|
|
9607
9750
|
return __spreadProps(__spreadValues({}, prev), {
|
|
@@ -9651,9 +9794,9 @@ var MultiSelect = React9.forwardRef(
|
|
|
9651
9794
|
},
|
|
9652
9795
|
[disabled]
|
|
9653
9796
|
);
|
|
9654
|
-
return /* @__PURE__ */
|
|
9655
|
-
/* @__PURE__ */
|
|
9656
|
-
/* @__PURE__ */
|
|
9797
|
+
return /* @__PURE__ */ jsxs15(Theme3, { style: width !== "100%" ? { width } : void 0, children: [
|
|
9798
|
+
/* @__PURE__ */ jsxs15(DropdownMenu4.Root, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
9799
|
+
/* @__PURE__ */ jsx27(DropdownMenu4.Trigger, { children: /* @__PURE__ */ jsxs15(
|
|
9657
9800
|
StyledTrigger,
|
|
9658
9801
|
{
|
|
9659
9802
|
ref: (r) => {
|
|
@@ -9669,7 +9812,7 @@ var MultiSelect = React9.forwardRef(
|
|
|
9669
9812
|
style: width !== "100%" ? { width } : void 0,
|
|
9670
9813
|
onClick: handleToggle,
|
|
9671
9814
|
children: [
|
|
9672
|
-
/* @__PURE__ */
|
|
9815
|
+
/* @__PURE__ */ jsx27(
|
|
9673
9816
|
StyledText,
|
|
9674
9817
|
{
|
|
9675
9818
|
typography: "labelMedium",
|
|
@@ -9677,7 +9820,7 @@ var MultiSelect = React9.forwardRef(
|
|
|
9677
9820
|
children: text
|
|
9678
9821
|
}
|
|
9679
9822
|
),
|
|
9680
|
-
/* @__PURE__ */
|
|
9823
|
+
/* @__PURE__ */ jsx27(
|
|
9681
9824
|
FontAwesomeIcon3,
|
|
9682
9825
|
{
|
|
9683
9826
|
icon: isOpen ? faChevronUp2 : faChevronDown2,
|
|
@@ -9688,14 +9831,14 @@ var MultiSelect = React9.forwardRef(
|
|
|
9688
9831
|
]
|
|
9689
9832
|
}
|
|
9690
9833
|
) }),
|
|
9691
|
-
/* @__PURE__ */
|
|
9834
|
+
/* @__PURE__ */ jsx27(
|
|
9692
9835
|
StyledContent,
|
|
9693
9836
|
{
|
|
9694
9837
|
css: {
|
|
9695
9838
|
width: "100%",
|
|
9696
9839
|
zIndex: zIndex === "auto" ? 999999 : zIndex
|
|
9697
9840
|
},
|
|
9698
|
-
children: !singleSelect ? /* @__PURE__ */
|
|
9841
|
+
children: !singleSelect ? /* @__PURE__ */ jsx27(
|
|
9699
9842
|
CheckboxGroup,
|
|
9700
9843
|
{
|
|
9701
9844
|
value: selectedValues,
|
|
@@ -9705,7 +9848,7 @@ var MultiSelect = React9.forwardRef(
|
|
|
9705
9848
|
setAllOptionsSelected(false);
|
|
9706
9849
|
}
|
|
9707
9850
|
},
|
|
9708
|
-
children: /* @__PURE__ */
|
|
9851
|
+
children: /* @__PURE__ */ jsxs15(
|
|
9709
9852
|
StyledFlexWithMaxHeight,
|
|
9710
9853
|
{
|
|
9711
9854
|
direction: "column",
|
|
@@ -9713,7 +9856,7 @@ var MultiSelect = React9.forwardRef(
|
|
|
9713
9856
|
hasMaxHeight: !!maxHeight,
|
|
9714
9857
|
style: maxHeight ? { maxHeight } : void 0,
|
|
9715
9858
|
children: [
|
|
9716
|
-
selectedAllOptions && /* @__PURE__ */
|
|
9859
|
+
selectedAllOptions && /* @__PURE__ */ jsxs15(
|
|
9717
9860
|
ButtonSelectAllStyled,
|
|
9718
9861
|
{
|
|
9719
9862
|
css: itemStyle,
|
|
@@ -9722,30 +9865,30 @@ var MultiSelect = React9.forwardRef(
|
|
|
9722
9865
|
},
|
|
9723
9866
|
type: "button",
|
|
9724
9867
|
children: [
|
|
9725
|
-
/* @__PURE__ */
|
|
9726
|
-
/* @__PURE__ */
|
|
9868
|
+
/* @__PURE__ */ jsx27("div", { className: allOptionsSelected ? "checked" : "" }),
|
|
9869
|
+
/* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: selectedAllText ? selectedAllText : "Selecionar Todos" })
|
|
9727
9870
|
]
|
|
9728
9871
|
}
|
|
9729
9872
|
),
|
|
9730
|
-
options.map(({ value, label }, i) => /* @__PURE__ */
|
|
9873
|
+
options.map(({ value, label }, i) => /* @__PURE__ */ jsx27(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: label }) }, i))
|
|
9731
9874
|
]
|
|
9732
9875
|
}
|
|
9733
9876
|
)
|
|
9734
9877
|
}
|
|
9735
|
-
) : /* @__PURE__ */
|
|
9878
|
+
) : /* @__PURE__ */ jsx27(
|
|
9736
9879
|
StyledFlexWithMaxHeight,
|
|
9737
9880
|
{
|
|
9738
9881
|
direction: "column",
|
|
9739
9882
|
gap: 8,
|
|
9740
9883
|
hasMaxHeight: !!maxHeight,
|
|
9741
9884
|
style: maxHeight ? { maxHeight } : void 0,
|
|
9742
|
-
children: options.map(({ value, label }, i) => /* @__PURE__ */
|
|
9885
|
+
children: options.map(({ value, label }, i) => /* @__PURE__ */ jsx27(StyledItem2, { onClick: () => handleItemClick(value), children: /* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: label }) }, i))
|
|
9743
9886
|
}
|
|
9744
9887
|
)
|
|
9745
9888
|
}
|
|
9746
9889
|
)
|
|
9747
9890
|
] }),
|
|
9748
|
-
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */
|
|
9891
|
+
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */ jsx27(
|
|
9749
9892
|
StyledFlexSelectedItems,
|
|
9750
9893
|
{
|
|
9751
9894
|
direction: selectedOrientation,
|
|
@@ -9753,14 +9896,14 @@ var MultiSelect = React9.forwardRef(
|
|
|
9753
9896
|
align: selectedOrientation === "column" ? "start" : "center",
|
|
9754
9897
|
justify: "start",
|
|
9755
9898
|
css: __spreadValues({}, selectedScroll && { maxHeight: maxHeight || "400px" }),
|
|
9756
|
-
children: selectedValues.map((value) => /* @__PURE__ */
|
|
9899
|
+
children: selectedValues.map((value) => /* @__PURE__ */ jsxs15(
|
|
9757
9900
|
Flex2,
|
|
9758
9901
|
{
|
|
9759
9902
|
gap: 4,
|
|
9760
9903
|
align: "center",
|
|
9761
9904
|
css: { flexWrap: "wrap" },
|
|
9762
9905
|
children: [
|
|
9763
|
-
/* @__PURE__ */
|
|
9906
|
+
/* @__PURE__ */ jsx27(
|
|
9764
9907
|
CloseBtnStyled,
|
|
9765
9908
|
{
|
|
9766
9909
|
onClick: (e) => {
|
|
@@ -9768,10 +9911,10 @@ var MultiSelect = React9.forwardRef(
|
|
|
9768
9911
|
handleRemove(value);
|
|
9769
9912
|
},
|
|
9770
9913
|
type: "button",
|
|
9771
|
-
children: /* @__PURE__ */
|
|
9914
|
+
children: /* @__PURE__ */ jsx27(FontAwesomeIcon3, { icon: faSquareXmark, size: "sm" })
|
|
9772
9915
|
}
|
|
9773
9916
|
),
|
|
9774
|
-
/* @__PURE__ */
|
|
9917
|
+
/* @__PURE__ */ jsx27(
|
|
9775
9918
|
Text,
|
|
9776
9919
|
{
|
|
9777
9920
|
typography: "captionMedium",
|
|
@@ -9799,7 +9942,7 @@ var Divider = styled("div", {
|
|
|
9799
9942
|
|
|
9800
9943
|
// src/components/Grid.tsx
|
|
9801
9944
|
import { Grid as GridRadix } from "@radix-ui/themes";
|
|
9802
|
-
import { jsx as
|
|
9945
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
9803
9946
|
var GridStyled = styled(GridRadix, {
|
|
9804
9947
|
display: "grid",
|
|
9805
9948
|
variants: {
|
|
@@ -9921,12 +10064,12 @@ var GridStyled = styled(GridRadix, {
|
|
|
9921
10064
|
});
|
|
9922
10065
|
function Grid(_a) {
|
|
9923
10066
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
9924
|
-
return /* @__PURE__ */
|
|
10067
|
+
return /* @__PURE__ */ jsx28(GridStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
9925
10068
|
}
|
|
9926
10069
|
|
|
9927
10070
|
// src/components/Container.tsx
|
|
9928
10071
|
import { Container as ContainerRadix } from "@radix-ui/themes";
|
|
9929
|
-
import { jsx as
|
|
10072
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
9930
10073
|
var ContainerStyled = styled(ContainerRadix, {
|
|
9931
10074
|
variants: {
|
|
9932
10075
|
size: {
|
|
@@ -9956,12 +10099,12 @@ var ContainerStyled = styled(ContainerRadix, {
|
|
|
9956
10099
|
});
|
|
9957
10100
|
function Container(_a) {
|
|
9958
10101
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
9959
|
-
return /* @__PURE__ */
|
|
10102
|
+
return /* @__PURE__ */ jsx29(ContainerStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
9960
10103
|
}
|
|
9961
10104
|
|
|
9962
10105
|
// src/components/Section.tsx
|
|
9963
10106
|
import { Section as SectionRadix } from "@radix-ui/themes";
|
|
9964
|
-
import { jsx as
|
|
10107
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
9965
10108
|
var SectionStyled = styled(SectionRadix, {
|
|
9966
10109
|
variants: {
|
|
9967
10110
|
size: {
|
|
@@ -9985,26 +10128,26 @@ var SectionStyled = styled(SectionRadix, {
|
|
|
9985
10128
|
});
|
|
9986
10129
|
function Section(_a) {
|
|
9987
10130
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
9988
|
-
return /* @__PURE__ */
|
|
10131
|
+
return /* @__PURE__ */ jsx30(SectionStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
9989
10132
|
}
|
|
9990
10133
|
|
|
9991
10134
|
// src/components/FormFields/subComponents/ErrorFormMessage.tsx
|
|
9992
10135
|
import { faXmarkCircle } from "@fortawesome/free-solid-svg-icons";
|
|
9993
10136
|
import { FontAwesomeIcon as FontAwesomeIcon4 } from "@fortawesome/react-fontawesome";
|
|
9994
|
-
import { jsx as
|
|
10137
|
+
import { jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
9995
10138
|
var ErrorFormMessage = ({ message: message2 }) => {
|
|
9996
10139
|
if (!message2) return null;
|
|
9997
10140
|
if (typeof message2 !== "string") {
|
|
9998
10141
|
return null;
|
|
9999
10142
|
}
|
|
10000
|
-
return /* @__PURE__ */
|
|
10001
|
-
/* @__PURE__ */
|
|
10002
|
-
/* @__PURE__ */
|
|
10143
|
+
return /* @__PURE__ */ jsxs16(Flex2, { justify: "start", align: "center", gap: 6, children: [
|
|
10144
|
+
/* @__PURE__ */ jsx31(FontAwesomeIcon4, { icon: faXmarkCircle, color: colors.error600, size: "1x" }),
|
|
10145
|
+
/* @__PURE__ */ jsx31(Text, { typography: "bodyXS", fontWeight: "medium", color: "error600", children: message2 })
|
|
10003
10146
|
] });
|
|
10004
10147
|
};
|
|
10005
10148
|
|
|
10006
10149
|
// src/components/FormFields/subComponents/FormLabel.tsx
|
|
10007
|
-
import { jsx as
|
|
10150
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10008
10151
|
var FormLabel = ({
|
|
10009
10152
|
name,
|
|
10010
10153
|
label,
|
|
@@ -10012,7 +10155,7 @@ var FormLabel = ({
|
|
|
10012
10155
|
required
|
|
10013
10156
|
}) => {
|
|
10014
10157
|
if (!label) return null;
|
|
10015
|
-
return /* @__PURE__ */
|
|
10158
|
+
return /* @__PURE__ */ jsxs17(
|
|
10016
10159
|
Text,
|
|
10017
10160
|
{
|
|
10018
10161
|
typography: "labelMedium",
|
|
@@ -10021,7 +10164,7 @@ var FormLabel = ({
|
|
|
10021
10164
|
id: `${name}-label`,
|
|
10022
10165
|
children: [
|
|
10023
10166
|
label,
|
|
10024
|
-
!required && /* @__PURE__ */
|
|
10167
|
+
!required && /* @__PURE__ */ jsx32(Text, { color: "dark500", children: " (opcional)" })
|
|
10025
10168
|
]
|
|
10026
10169
|
}
|
|
10027
10170
|
);
|
|
@@ -10029,7 +10172,7 @@ var FormLabel = ({
|
|
|
10029
10172
|
|
|
10030
10173
|
// src/components/FormFields/TextAreaFormField.tsx
|
|
10031
10174
|
import { useFormContext } from "react-hook-form";
|
|
10032
|
-
import { jsx as
|
|
10175
|
+
import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
10033
10176
|
var TextAreaFormField = (_a) => {
|
|
10034
10177
|
var _b = _a, {
|
|
10035
10178
|
name,
|
|
@@ -10037,14 +10180,16 @@ var TextAreaFormField = (_a) => {
|
|
|
10037
10180
|
required,
|
|
10038
10181
|
placeholder,
|
|
10039
10182
|
validate,
|
|
10040
|
-
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio."
|
|
10183
|
+
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
10184
|
+
simpleLayout = false
|
|
10041
10185
|
} = _b, props = __objRest(_b, [
|
|
10042
10186
|
"name",
|
|
10043
10187
|
"label",
|
|
10044
10188
|
"required",
|
|
10045
10189
|
"placeholder",
|
|
10046
10190
|
"validate",
|
|
10047
|
-
"validationErrorMessage"
|
|
10191
|
+
"validationErrorMessage",
|
|
10192
|
+
"simpleLayout"
|
|
10048
10193
|
]);
|
|
10049
10194
|
var _a2;
|
|
10050
10195
|
const {
|
|
@@ -10057,8 +10202,8 @@ var TextAreaFormField = (_a) => {
|
|
|
10057
10202
|
required: required ? validationErrorMessage : false,
|
|
10058
10203
|
validate
|
|
10059
10204
|
};
|
|
10060
|
-
return /* @__PURE__ */
|
|
10061
|
-
/* @__PURE__ */
|
|
10205
|
+
return /* @__PURE__ */ jsxs18(Flex2, { direction: "column", children: [
|
|
10206
|
+
/* @__PURE__ */ jsx33(
|
|
10062
10207
|
FormLabel,
|
|
10063
10208
|
{
|
|
10064
10209
|
name,
|
|
@@ -10067,15 +10212,16 @@ var TextAreaFormField = (_a) => {
|
|
|
10067
10212
|
haveError
|
|
10068
10213
|
}
|
|
10069
10214
|
),
|
|
10070
|
-
/* @__PURE__ */
|
|
10215
|
+
/* @__PURE__ */ jsx33(
|
|
10071
10216
|
TextareaField,
|
|
10072
10217
|
__spreadProps(__spreadValues(__spreadValues({}, props), register(name, validationRules)), {
|
|
10073
10218
|
placeholder,
|
|
10074
10219
|
color: haveError ? "error" : "default",
|
|
10220
|
+
simpleLayout,
|
|
10075
10221
|
"aria-labelledby": `${name}-label`
|
|
10076
10222
|
})
|
|
10077
10223
|
),
|
|
10078
|
-
/* @__PURE__ */
|
|
10224
|
+
/* @__PURE__ */ jsx33(ErrorFormMessage, { message: errorMsg })
|
|
10079
10225
|
] });
|
|
10080
10226
|
};
|
|
10081
10227
|
|
|
@@ -10085,7 +10231,7 @@ import {
|
|
|
10085
10231
|
} from "react-hook-form";
|
|
10086
10232
|
import { useCallback as useCallback3, useMemo as useMemo3 } from "react";
|
|
10087
10233
|
import { format as format3, unformat as unformat2 } from "@react-input/mask";
|
|
10088
|
-
import { jsx as
|
|
10234
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
10089
10235
|
var TextFormField = (_a) => {
|
|
10090
10236
|
var _b = _a, {
|
|
10091
10237
|
name,
|
|
@@ -10140,8 +10286,8 @@ var TextFormField = (_a) => {
|
|
|
10140
10286
|
if (valueFormatter) value = valueFormatter.unformat(value);
|
|
10141
10287
|
formChange(value);
|
|
10142
10288
|
};
|
|
10143
|
-
return /* @__PURE__ */
|
|
10144
|
-
label && /* @__PURE__ */
|
|
10289
|
+
return /* @__PURE__ */ jsxs19(Flex2, { direction: "column", children: [
|
|
10290
|
+
label && /* @__PURE__ */ jsx34(
|
|
10145
10291
|
FormLabel,
|
|
10146
10292
|
{
|
|
10147
10293
|
name,
|
|
@@ -10150,7 +10296,7 @@ var TextFormField = (_a) => {
|
|
|
10150
10296
|
haveError
|
|
10151
10297
|
}
|
|
10152
10298
|
),
|
|
10153
|
-
/* @__PURE__ */
|
|
10299
|
+
/* @__PURE__ */ jsx34(
|
|
10154
10300
|
TextField,
|
|
10155
10301
|
__spreadProps(__spreadValues(__spreadValues({
|
|
10156
10302
|
mask,
|
|
@@ -10161,7 +10307,7 @@ var TextFormField = (_a) => {
|
|
|
10161
10307
|
value: formattedValue
|
|
10162
10308
|
})
|
|
10163
10309
|
),
|
|
10164
|
-
/* @__PURE__ */
|
|
10310
|
+
/* @__PURE__ */ jsx34(ErrorFormMessage, { message: errorMsg })
|
|
10165
10311
|
] });
|
|
10166
10312
|
};
|
|
10167
10313
|
|
|
@@ -10170,7 +10316,7 @@ import {
|
|
|
10170
10316
|
FormProvider,
|
|
10171
10317
|
useForm
|
|
10172
10318
|
} from "react-hook-form";
|
|
10173
|
-
import { jsx as
|
|
10319
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
10174
10320
|
var Form = (_a) => {
|
|
10175
10321
|
var _b = _a, {
|
|
10176
10322
|
onSubmit,
|
|
@@ -10182,7 +10328,7 @@ var Form = (_a) => {
|
|
|
10182
10328
|
const formMethods = useForm(__spreadValues({
|
|
10183
10329
|
mode: "onTouched"
|
|
10184
10330
|
}, props));
|
|
10185
|
-
return /* @__PURE__ */
|
|
10331
|
+
return /* @__PURE__ */ jsx35(FormProvider, __spreadProps(__spreadValues({}, formMethods), { children: /* @__PURE__ */ jsx35("form", { onSubmit: formMethods.handleSubmit(onSubmit), children: (() => {
|
|
10186
10332
|
if (typeof children === "function") {
|
|
10187
10333
|
return children(formMethods);
|
|
10188
10334
|
}
|
|
@@ -10192,7 +10338,7 @@ var Form = (_a) => {
|
|
|
10192
10338
|
|
|
10193
10339
|
// src/components/FormFields/MultiSelectFormField.tsx
|
|
10194
10340
|
import { useController as useController2 } from "react-hook-form";
|
|
10195
|
-
import { jsx as
|
|
10341
|
+
import { jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
10196
10342
|
var MultiSelectFormField = (_a) => {
|
|
10197
10343
|
var _b = _a, {
|
|
10198
10344
|
name,
|
|
@@ -10223,8 +10369,8 @@ var MultiSelectFormField = (_a) => {
|
|
|
10223
10369
|
const handleChange = (v) => {
|
|
10224
10370
|
onChange(v);
|
|
10225
10371
|
};
|
|
10226
|
-
return /* @__PURE__ */
|
|
10227
|
-
/* @__PURE__ */
|
|
10372
|
+
return /* @__PURE__ */ jsxs20(Flex2, { direction: "column", children: [
|
|
10373
|
+
/* @__PURE__ */ jsx36(
|
|
10228
10374
|
FormLabel,
|
|
10229
10375
|
{
|
|
10230
10376
|
name,
|
|
@@ -10233,7 +10379,7 @@ var MultiSelectFormField = (_a) => {
|
|
|
10233
10379
|
haveError
|
|
10234
10380
|
}
|
|
10235
10381
|
),
|
|
10236
|
-
/* @__PURE__ */
|
|
10382
|
+
/* @__PURE__ */ jsx36(
|
|
10237
10383
|
MultiSelect,
|
|
10238
10384
|
__spreadValues({
|
|
10239
10385
|
value,
|
|
@@ -10245,7 +10391,7 @@ var MultiSelectFormField = (_a) => {
|
|
|
10245
10391
|
maxHeight
|
|
10246
10392
|
}, rest)
|
|
10247
10393
|
),
|
|
10248
|
-
/* @__PURE__ */
|
|
10394
|
+
/* @__PURE__ */ jsx36(ErrorFormMessage, { message: errorMsg })
|
|
10249
10395
|
] });
|
|
10250
10396
|
};
|
|
10251
10397
|
|
|
@@ -10263,13 +10409,13 @@ var minMaxLength = (min, max, errorMsg) => (value) => {
|
|
|
10263
10409
|
};
|
|
10264
10410
|
|
|
10265
10411
|
// src/components/FormFields/PhoneFormField.tsx
|
|
10266
|
-
import { jsx as
|
|
10412
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
10267
10413
|
var PhoneFormField = ({
|
|
10268
10414
|
name,
|
|
10269
10415
|
label,
|
|
10270
10416
|
required
|
|
10271
10417
|
}) => {
|
|
10272
|
-
return /* @__PURE__ */
|
|
10418
|
+
return /* @__PURE__ */ jsx37(
|
|
10273
10419
|
TextFormField,
|
|
10274
10420
|
{
|
|
10275
10421
|
name,
|
|
@@ -10299,7 +10445,7 @@ var PhoneFormField = ({
|
|
|
10299
10445
|
|
|
10300
10446
|
// src/components/FormFields/CPFFormField.tsx
|
|
10301
10447
|
import { useFormContext as useFormContext3, useWatch } from "react-hook-form";
|
|
10302
|
-
import { jsx as
|
|
10448
|
+
import { jsx as jsx38, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
10303
10449
|
var isValidCPF = (cpf) => {
|
|
10304
10450
|
cpf = cpf.replace(/[^\d]+/g, "");
|
|
10305
10451
|
if (cpf.length !== 11 || /^(\d)\1{10}$/.test(cpf)) return false;
|
|
@@ -10325,8 +10471,8 @@ var CPFFormField = ({
|
|
|
10325
10471
|
}) => {
|
|
10326
10472
|
const { control, setValue } = useFormContext3();
|
|
10327
10473
|
const foreigner = useWatch({ name: "foreigner", control });
|
|
10328
|
-
return /* @__PURE__ */
|
|
10329
|
-
/* @__PURE__ */
|
|
10474
|
+
return /* @__PURE__ */ jsxs21(Flex2, { direction: "column", children: [
|
|
10475
|
+
/* @__PURE__ */ jsx38(
|
|
10330
10476
|
TextFormField,
|
|
10331
10477
|
{
|
|
10332
10478
|
name,
|
|
@@ -10344,7 +10490,7 @@ var CPFFormField = ({
|
|
|
10344
10490
|
disabled: foreigner
|
|
10345
10491
|
}
|
|
10346
10492
|
),
|
|
10347
|
-
/* @__PURE__ */
|
|
10493
|
+
/* @__PURE__ */ jsx38(
|
|
10348
10494
|
CheckboxGroup,
|
|
10349
10495
|
{
|
|
10350
10496
|
value: foreigner ? ["true"] : [],
|
|
@@ -10356,14 +10502,14 @@ var CPFFormField = ({
|
|
|
10356
10502
|
setValue(name, "");
|
|
10357
10503
|
}
|
|
10358
10504
|
},
|
|
10359
|
-
children: /* @__PURE__ */
|
|
10505
|
+
children: /* @__PURE__ */ jsx38(CheckboxItem, { value: "true", children: foreignerLabel })
|
|
10360
10506
|
}
|
|
10361
10507
|
)
|
|
10362
10508
|
] });
|
|
10363
10509
|
};
|
|
10364
10510
|
|
|
10365
10511
|
// src/components/FormFields/CNPJFormField.tsx
|
|
10366
|
-
import { jsx as
|
|
10512
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
10367
10513
|
var matchesNonDigit = new RegExp(/\D+/g);
|
|
10368
10514
|
var getWeights = (size, start, end) => {
|
|
10369
10515
|
const weights = [];
|
|
@@ -10412,7 +10558,7 @@ var CNPJFormField = ({
|
|
|
10412
10558
|
placeholder,
|
|
10413
10559
|
validationErrorMessage
|
|
10414
10560
|
}) => {
|
|
10415
|
-
return /* @__PURE__ */
|
|
10561
|
+
return /* @__PURE__ */ jsx39(
|
|
10416
10562
|
TextFormField,
|
|
10417
10563
|
{
|
|
10418
10564
|
name,
|
|
@@ -10433,7 +10579,7 @@ var CNPJFormField = ({
|
|
|
10433
10579
|
};
|
|
10434
10580
|
|
|
10435
10581
|
// src/components/FormFields/BirthDateFormField.tsx
|
|
10436
|
-
import { jsx as
|
|
10582
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
10437
10583
|
var isValidDate = (day, month, year) => {
|
|
10438
10584
|
const date = new Date(year, month - 1, day);
|
|
10439
10585
|
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day;
|
|
@@ -10470,7 +10616,7 @@ var BirthDateFormField = ({
|
|
|
10470
10616
|
language
|
|
10471
10617
|
}) => {
|
|
10472
10618
|
const inputPlaceholder = placeholder || (language === "pt-BR" ? "DD/MM/AAAA" : "MM/DD/YYYY");
|
|
10473
|
-
return /* @__PURE__ */
|
|
10619
|
+
return /* @__PURE__ */ jsx40(
|
|
10474
10620
|
TextFormField,
|
|
10475
10621
|
{
|
|
10476
10622
|
name,
|
|
@@ -10491,7 +10637,7 @@ var BirthDateFormField = ({
|
|
|
10491
10637
|
};
|
|
10492
10638
|
|
|
10493
10639
|
// src/components/FormFields/IdentityDocumentNumberFormField.tsx
|
|
10494
|
-
import { jsx as
|
|
10640
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
10495
10641
|
var IdentityDocumentNumberFormField = ({
|
|
10496
10642
|
name,
|
|
10497
10643
|
label,
|
|
@@ -10499,7 +10645,7 @@ var IdentityDocumentNumberFormField = ({
|
|
|
10499
10645
|
placeholder,
|
|
10500
10646
|
validationErrorMessage
|
|
10501
10647
|
}) => {
|
|
10502
|
-
return /* @__PURE__ */
|
|
10648
|
+
return /* @__PURE__ */ jsx41(
|
|
10503
10649
|
TextFormField,
|
|
10504
10650
|
{
|
|
10505
10651
|
name,
|
|
@@ -10528,7 +10674,7 @@ function getNestedValue(obj, path) {
|
|
|
10528
10674
|
}
|
|
10529
10675
|
|
|
10530
10676
|
// src/components/FormFields/SelectFormField.tsx
|
|
10531
|
-
import { jsx as
|
|
10677
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
10532
10678
|
var SelectFormField = ({
|
|
10533
10679
|
name,
|
|
10534
10680
|
label,
|
|
@@ -10549,8 +10695,8 @@ var SelectFormField = ({
|
|
|
10549
10695
|
const validationRules = __spreadValues({
|
|
10550
10696
|
required: required ? validationErrorMessage : false
|
|
10551
10697
|
}, validation);
|
|
10552
|
-
return /* @__PURE__ */
|
|
10553
|
-
/* @__PURE__ */
|
|
10698
|
+
return /* @__PURE__ */ jsxs22(Flex2, { direction: "column", children: [
|
|
10699
|
+
/* @__PURE__ */ jsx42(
|
|
10554
10700
|
FormLabel,
|
|
10555
10701
|
{
|
|
10556
10702
|
name,
|
|
@@ -10559,7 +10705,7 @@ var SelectFormField = ({
|
|
|
10559
10705
|
haveError
|
|
10560
10706
|
}
|
|
10561
10707
|
),
|
|
10562
|
-
/* @__PURE__ */
|
|
10708
|
+
/* @__PURE__ */ jsx42(
|
|
10563
10709
|
Controller,
|
|
10564
10710
|
{
|
|
10565
10711
|
control,
|
|
@@ -10568,14 +10714,14 @@ var SelectFormField = ({
|
|
|
10568
10714
|
defaultValue: defaultValue || "",
|
|
10569
10715
|
render: ({ field: { value, onChange } }) => {
|
|
10570
10716
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
10571
|
-
return /* @__PURE__ */
|
|
10717
|
+
return /* @__PURE__ */ jsx42(
|
|
10572
10718
|
DropdownMenu2,
|
|
10573
10719
|
{
|
|
10574
10720
|
placeholder: (selectedOption == null ? void 0 : selectedOption.label) || placeholder,
|
|
10575
10721
|
fontWeight: "regular",
|
|
10576
10722
|
typography: "labelLarge",
|
|
10577
10723
|
color: haveError ? "error" : "default",
|
|
10578
|
-
children: options.map((option, index) => /* @__PURE__ */
|
|
10724
|
+
children: options.map((option, index) => /* @__PURE__ */ jsx42(
|
|
10579
10725
|
DropdownMenuItem,
|
|
10580
10726
|
{
|
|
10581
10727
|
value: option.value,
|
|
@@ -10591,7 +10737,7 @@ var SelectFormField = ({
|
|
|
10591
10737
|
}
|
|
10592
10738
|
}
|
|
10593
10739
|
),
|
|
10594
|
-
/* @__PURE__ */
|
|
10740
|
+
/* @__PURE__ */ jsx42(ErrorFormMessage, { message: errorMsg })
|
|
10595
10741
|
] });
|
|
10596
10742
|
};
|
|
10597
10743
|
|
|
@@ -10624,7 +10770,7 @@ function useCountries(language = "pt-BR") {
|
|
|
10624
10770
|
}
|
|
10625
10771
|
|
|
10626
10772
|
// src/components/FormFields/AddressFormFields/CountryFormField.tsx
|
|
10627
|
-
import { jsx as
|
|
10773
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
10628
10774
|
function CountryFormField({
|
|
10629
10775
|
name,
|
|
10630
10776
|
label,
|
|
@@ -10632,7 +10778,7 @@ function CountryFormField({
|
|
|
10632
10778
|
language = "pt-BR"
|
|
10633
10779
|
}) {
|
|
10634
10780
|
const countries2 = useCountries(language);
|
|
10635
|
-
return /* @__PURE__ */
|
|
10781
|
+
return /* @__PURE__ */ jsx43(Flex2, { direction: "column", children: /* @__PURE__ */ jsx43(
|
|
10636
10782
|
SelectFormField,
|
|
10637
10783
|
{
|
|
10638
10784
|
label,
|
|
@@ -10645,7 +10791,7 @@ function CountryFormField({
|
|
|
10645
10791
|
}
|
|
10646
10792
|
|
|
10647
10793
|
// src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx
|
|
10648
|
-
import { jsx as
|
|
10794
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
10649
10795
|
var PostalCodeFormField = ({
|
|
10650
10796
|
name,
|
|
10651
10797
|
label,
|
|
@@ -10654,7 +10800,7 @@ var PostalCodeFormField = ({
|
|
|
10654
10800
|
validationErrorMessage,
|
|
10655
10801
|
onChange
|
|
10656
10802
|
}) => {
|
|
10657
|
-
return /* @__PURE__ */
|
|
10803
|
+
return /* @__PURE__ */ jsx44(
|
|
10658
10804
|
TextFormField,
|
|
10659
10805
|
{
|
|
10660
10806
|
name,
|
|
@@ -10707,14 +10853,14 @@ var brazilianStates = [
|
|
|
10707
10853
|
];
|
|
10708
10854
|
|
|
10709
10855
|
// src/components/FormFields/AddressFormFields/StateFormField.tsx
|
|
10710
|
-
import { Fragment as Fragment3, jsx as
|
|
10856
|
+
import { Fragment as Fragment3, jsx as jsx45 } from "react/jsx-runtime";
|
|
10711
10857
|
function StateFormField({
|
|
10712
10858
|
name,
|
|
10713
10859
|
label,
|
|
10714
10860
|
required,
|
|
10715
10861
|
isBrazil
|
|
10716
10862
|
}) {
|
|
10717
|
-
return /* @__PURE__ */
|
|
10863
|
+
return /* @__PURE__ */ jsx45(Fragment3, { children: isBrazil ? /* @__PURE__ */ jsx45(
|
|
10718
10864
|
SelectFormField,
|
|
10719
10865
|
{
|
|
10720
10866
|
name,
|
|
@@ -10722,13 +10868,13 @@ function StateFormField({
|
|
|
10722
10868
|
required,
|
|
10723
10869
|
label
|
|
10724
10870
|
}
|
|
10725
|
-
) : /* @__PURE__ */
|
|
10871
|
+
) : /* @__PURE__ */ jsx45(TextFormField, { name, required, label }) });
|
|
10726
10872
|
}
|
|
10727
10873
|
|
|
10728
10874
|
// src/components/FormFields/AddressFormFields/CityFormField.tsx
|
|
10729
|
-
import { useEffect as
|
|
10875
|
+
import { useEffect as useEffect7, useState as useState9 } from "react";
|
|
10730
10876
|
import { useFormContext as useFormContext5, Controller as Controller2 } from "react-hook-form";
|
|
10731
|
-
import { Fragment as Fragment4, jsx as
|
|
10877
|
+
import { Fragment as Fragment4, jsx as jsx46 } from "react/jsx-runtime";
|
|
10732
10878
|
function CityFormField({
|
|
10733
10879
|
name,
|
|
10734
10880
|
label,
|
|
@@ -10739,9 +10885,9 @@ function CityFormField({
|
|
|
10739
10885
|
}) {
|
|
10740
10886
|
const { control, watch } = useFormContext5();
|
|
10741
10887
|
const selectedState = watch(stateName);
|
|
10742
|
-
const [cities, setCities] =
|
|
10743
|
-
const [loading, setLoading] =
|
|
10744
|
-
|
|
10888
|
+
const [cities, setCities] = useState9([]);
|
|
10889
|
+
const [loading, setLoading] = useState9(false);
|
|
10890
|
+
useEffect7(() => {
|
|
10745
10891
|
if (!isBrazil) {
|
|
10746
10892
|
setCities([]);
|
|
10747
10893
|
return;
|
|
@@ -10780,13 +10926,13 @@ function CityFormField({
|
|
|
10780
10926
|
}
|
|
10781
10927
|
fetchCities();
|
|
10782
10928
|
}, [selectedState, isBrazil]);
|
|
10783
|
-
return /* @__PURE__ */
|
|
10929
|
+
return /* @__PURE__ */ jsx46(Fragment4, { children: isBrazil && cities.length > 0 ? /* @__PURE__ */ jsx46(
|
|
10784
10930
|
Controller2,
|
|
10785
10931
|
{
|
|
10786
10932
|
name,
|
|
10787
10933
|
control,
|
|
10788
10934
|
rules: { required },
|
|
10789
|
-
render: ({ field }) => /* @__PURE__ */
|
|
10935
|
+
render: ({ field }) => /* @__PURE__ */ jsx46(
|
|
10790
10936
|
SelectFormField,
|
|
10791
10937
|
__spreadProps(__spreadValues({
|
|
10792
10938
|
label,
|
|
@@ -10800,7 +10946,7 @@ function CityFormField({
|
|
|
10800
10946
|
})
|
|
10801
10947
|
)
|
|
10802
10948
|
}
|
|
10803
|
-
) : /* @__PURE__ */
|
|
10949
|
+
) : /* @__PURE__ */ jsx46(
|
|
10804
10950
|
TextFormField,
|
|
10805
10951
|
{
|
|
10806
10952
|
name,
|
|
@@ -10812,7 +10958,7 @@ function CityFormField({
|
|
|
10812
10958
|
}
|
|
10813
10959
|
|
|
10814
10960
|
// src/components/FormFields/AddressFormFields/index.tsx
|
|
10815
|
-
import { jsx as
|
|
10961
|
+
import { jsx as jsx47, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
10816
10962
|
function getNestedValue2(obj, path) {
|
|
10817
10963
|
return path.split(".").reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
|
|
10818
10964
|
}
|
|
@@ -10862,8 +11008,8 @@ function AddressFormFields({
|
|
|
10862
11008
|
console.error("Erro ao buscar CEP");
|
|
10863
11009
|
});
|
|
10864
11010
|
};
|
|
10865
|
-
return /* @__PURE__ */
|
|
10866
|
-
/* @__PURE__ */
|
|
11011
|
+
return /* @__PURE__ */ jsxs23(AddressContainerStyled, { layout, children: [
|
|
11012
|
+
/* @__PURE__ */ jsx47(
|
|
10867
11013
|
FormLabel,
|
|
10868
11014
|
{
|
|
10869
11015
|
name,
|
|
@@ -10872,7 +11018,7 @@ function AddressFormFields({
|
|
|
10872
11018
|
haveError
|
|
10873
11019
|
}
|
|
10874
11020
|
),
|
|
10875
|
-
/* @__PURE__ */
|
|
11021
|
+
/* @__PURE__ */ jsx47(
|
|
10876
11022
|
CountryFormField,
|
|
10877
11023
|
{
|
|
10878
11024
|
name: `${name}.country`,
|
|
@@ -10881,7 +11027,7 @@ function AddressFormFields({
|
|
|
10881
11027
|
language: "pt-BR"
|
|
10882
11028
|
}
|
|
10883
11029
|
),
|
|
10884
|
-
isBrazil ? /* @__PURE__ */
|
|
11030
|
+
isBrazil ? /* @__PURE__ */ jsx47(
|
|
10885
11031
|
PostalCodeFormField,
|
|
10886
11032
|
{
|
|
10887
11033
|
name: `${name}.zip_code`,
|
|
@@ -10891,7 +11037,7 @@ function AddressFormFields({
|
|
|
10891
11037
|
validationErrorMessage: "CEP inv\xE1lido",
|
|
10892
11038
|
onChange: handleCEPChange
|
|
10893
11039
|
}
|
|
10894
|
-
) : /* @__PURE__ */
|
|
11040
|
+
) : /* @__PURE__ */ jsx47(
|
|
10895
11041
|
TextFormField,
|
|
10896
11042
|
{
|
|
10897
11043
|
name: `${name}.zip_code`,
|
|
@@ -10899,7 +11045,7 @@ function AddressFormFields({
|
|
|
10899
11045
|
required
|
|
10900
11046
|
}
|
|
10901
11047
|
),
|
|
10902
|
-
/* @__PURE__ */
|
|
11048
|
+
/* @__PURE__ */ jsx47(
|
|
10903
11049
|
StateFormField,
|
|
10904
11050
|
{
|
|
10905
11051
|
name: `${name}.state`,
|
|
@@ -10908,7 +11054,7 @@ function AddressFormFields({
|
|
|
10908
11054
|
isBrazil
|
|
10909
11055
|
}
|
|
10910
11056
|
),
|
|
10911
|
-
/* @__PURE__ */
|
|
11057
|
+
/* @__PURE__ */ jsx47(
|
|
10912
11058
|
CityFormField,
|
|
10913
11059
|
{
|
|
10914
11060
|
name: `${name}.city`,
|
|
@@ -10918,8 +11064,8 @@ function AddressFormFields({
|
|
|
10918
11064
|
isBrazil
|
|
10919
11065
|
}
|
|
10920
11066
|
),
|
|
10921
|
-
/* @__PURE__ */
|
|
10922
|
-
/* @__PURE__ */
|
|
11067
|
+
/* @__PURE__ */ jsx47(TextFormField, { name: `${name}.street`, label: "Rua", required }),
|
|
11068
|
+
/* @__PURE__ */ jsx47(
|
|
10923
11069
|
TextFormField,
|
|
10924
11070
|
{
|
|
10925
11071
|
name: `${name}.number`,
|
|
@@ -10927,7 +11073,7 @@ function AddressFormFields({
|
|
|
10927
11073
|
required
|
|
10928
11074
|
}
|
|
10929
11075
|
),
|
|
10930
|
-
/* @__PURE__ */
|
|
11076
|
+
/* @__PURE__ */ jsx47(
|
|
10931
11077
|
TextFormField,
|
|
10932
11078
|
{
|
|
10933
11079
|
name: `${name}.neighborhood`,
|
|
@@ -10935,13 +11081,13 @@ function AddressFormFields({
|
|
|
10935
11081
|
required
|
|
10936
11082
|
}
|
|
10937
11083
|
),
|
|
10938
|
-
/* @__PURE__ */
|
|
11084
|
+
/* @__PURE__ */ jsx47(TextFormField, { name: `${name}.complement`, label: "Complemento" })
|
|
10939
11085
|
] });
|
|
10940
11086
|
}
|
|
10941
11087
|
|
|
10942
11088
|
// src/components/FormFields/RadioGroupFormField.tsx
|
|
10943
11089
|
import { Controller as Controller3, useFormContext as useFormContext7 } from "react-hook-form";
|
|
10944
|
-
import { jsx as
|
|
11090
|
+
import { jsx as jsx48, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
10945
11091
|
var RadioGroupFormField = ({
|
|
10946
11092
|
name,
|
|
10947
11093
|
label,
|
|
@@ -10963,8 +11109,8 @@ var RadioGroupFormField = ({
|
|
|
10963
11109
|
const validationRules = {
|
|
10964
11110
|
required: required ? validationErrorMessage : false
|
|
10965
11111
|
};
|
|
10966
|
-
return /* @__PURE__ */
|
|
10967
|
-
/* @__PURE__ */
|
|
11112
|
+
return /* @__PURE__ */ jsxs24(Flex2, { direction: "column", children: [
|
|
11113
|
+
/* @__PURE__ */ jsx48(
|
|
10968
11114
|
FormLabel,
|
|
10969
11115
|
{
|
|
10970
11116
|
name,
|
|
@@ -10973,14 +11119,14 @@ var RadioGroupFormField = ({
|
|
|
10973
11119
|
haveError
|
|
10974
11120
|
}
|
|
10975
11121
|
),
|
|
10976
|
-
/* @__PURE__ */
|
|
11122
|
+
/* @__PURE__ */ jsx48(
|
|
10977
11123
|
Controller3,
|
|
10978
11124
|
{
|
|
10979
11125
|
name,
|
|
10980
11126
|
control,
|
|
10981
11127
|
defaultValue: defaultValue || "",
|
|
10982
11128
|
rules: validationRules,
|
|
10983
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */
|
|
11129
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ jsx48(
|
|
10984
11130
|
RadioGroup,
|
|
10985
11131
|
{
|
|
10986
11132
|
value,
|
|
@@ -10988,21 +11134,21 @@ var RadioGroupFormField = ({
|
|
|
10988
11134
|
color: haveError ? "error" : color,
|
|
10989
11135
|
fontWeight,
|
|
10990
11136
|
disabled,
|
|
10991
|
-
children: options.map((option) => /* @__PURE__ */
|
|
10992
|
-
/* @__PURE__ */
|
|
11137
|
+
children: options.map((option) => /* @__PURE__ */ jsxs24("label", { children: [
|
|
11138
|
+
/* @__PURE__ */ jsx48(RadioItem, { value: option.value }),
|
|
10993
11139
|
option.label
|
|
10994
11140
|
] }, option.value))
|
|
10995
11141
|
}
|
|
10996
11142
|
)
|
|
10997
11143
|
}
|
|
10998
11144
|
),
|
|
10999
|
-
/* @__PURE__ */
|
|
11145
|
+
/* @__PURE__ */ jsx48(ErrorFormMessage, { message: errorMsg })
|
|
11000
11146
|
] });
|
|
11001
11147
|
};
|
|
11002
11148
|
|
|
11003
11149
|
// src/components/FormFields/CheckboxGroupFormField.tsx
|
|
11004
11150
|
import { Controller as Controller4, useFormContext as useFormContext8 } from "react-hook-form";
|
|
11005
|
-
import { jsx as
|
|
11151
|
+
import { jsx as jsx49, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
11006
11152
|
var CheckboxGroupFormField = ({
|
|
11007
11153
|
name,
|
|
11008
11154
|
label,
|
|
@@ -11025,8 +11171,8 @@ var CheckboxGroupFormField = ({
|
|
|
11025
11171
|
required: required ? validationErrorMessage : false,
|
|
11026
11172
|
validate: required ? (value) => (value == null ? void 0 : value.length) > 0 || validationErrorMessage : void 0
|
|
11027
11173
|
};
|
|
11028
|
-
return /* @__PURE__ */
|
|
11029
|
-
/* @__PURE__ */
|
|
11174
|
+
return /* @__PURE__ */ jsxs25(Flex2, { direction: "column", children: [
|
|
11175
|
+
/* @__PURE__ */ jsx49(
|
|
11030
11176
|
FormLabel,
|
|
11031
11177
|
{
|
|
11032
11178
|
name,
|
|
@@ -11035,14 +11181,14 @@ var CheckboxGroupFormField = ({
|
|
|
11035
11181
|
haveError
|
|
11036
11182
|
}
|
|
11037
11183
|
),
|
|
11038
|
-
/* @__PURE__ */
|
|
11184
|
+
/* @__PURE__ */ jsx49(
|
|
11039
11185
|
Controller4,
|
|
11040
11186
|
{
|
|
11041
11187
|
name,
|
|
11042
11188
|
control,
|
|
11043
11189
|
rules: validationRules,
|
|
11044
11190
|
defaultValue,
|
|
11045
|
-
render: ({ field }) => /* @__PURE__ */
|
|
11191
|
+
render: ({ field }) => /* @__PURE__ */ jsx49(
|
|
11046
11192
|
CheckboxGroup,
|
|
11047
11193
|
{
|
|
11048
11194
|
name,
|
|
@@ -11051,7 +11197,7 @@ var CheckboxGroupFormField = ({
|
|
|
11051
11197
|
color: haveError ? "error" : color,
|
|
11052
11198
|
fontWeight,
|
|
11053
11199
|
disabled,
|
|
11054
|
-
children: options.map((option) => /* @__PURE__ */
|
|
11200
|
+
children: options.map((option) => /* @__PURE__ */ jsx49(
|
|
11055
11201
|
CheckboxItem,
|
|
11056
11202
|
{
|
|
11057
11203
|
value: option.value,
|
|
@@ -11064,13 +11210,13 @@ var CheckboxGroupFormField = ({
|
|
|
11064
11210
|
)
|
|
11065
11211
|
}
|
|
11066
11212
|
),
|
|
11067
|
-
/* @__PURE__ */
|
|
11213
|
+
/* @__PURE__ */ jsx49(ErrorFormMessage, { message: errorMsg })
|
|
11068
11214
|
] });
|
|
11069
11215
|
};
|
|
11070
11216
|
|
|
11071
11217
|
// src/components/FormFields/SwitchFormField.tsx
|
|
11072
11218
|
import { useFormContext as useFormContext9, Controller as Controller5 } from "react-hook-form";
|
|
11073
|
-
import { jsx as
|
|
11219
|
+
import { jsx as jsx50, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11074
11220
|
var SwitchFormField = ({
|
|
11075
11221
|
name,
|
|
11076
11222
|
label,
|
|
@@ -11084,15 +11230,15 @@ var SwitchFormField = ({
|
|
|
11084
11230
|
if (watch) {
|
|
11085
11231
|
watchForm(name);
|
|
11086
11232
|
}
|
|
11087
|
-
return /* @__PURE__ */
|
|
11088
|
-
/* @__PURE__ */
|
|
11089
|
-
/* @__PURE__ */
|
|
11233
|
+
return /* @__PURE__ */ jsxs26(Flex2, { justify: "between", style: { margin: "1rem 0" }, children: [
|
|
11234
|
+
/* @__PURE__ */ jsx50(Text, { typography: "labelMedium", fontWeight: "regular", children: label }),
|
|
11235
|
+
/* @__PURE__ */ jsx50(
|
|
11090
11236
|
Controller5,
|
|
11091
11237
|
{
|
|
11092
11238
|
control,
|
|
11093
11239
|
name,
|
|
11094
11240
|
defaultValue,
|
|
11095
|
-
render: ({ field }) => /* @__PURE__ */
|
|
11241
|
+
render: ({ field }) => /* @__PURE__ */ jsx50(
|
|
11096
11242
|
Switch,
|
|
11097
11243
|
{
|
|
11098
11244
|
checked: field.value,
|
|
@@ -11105,14 +11251,14 @@ var SwitchFormField = ({
|
|
|
11105
11251
|
};
|
|
11106
11252
|
|
|
11107
11253
|
// src/components/FormFields/EmailFormField.tsx
|
|
11108
|
-
import { jsx as
|
|
11254
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
11109
11255
|
var EmailFormField = ({
|
|
11110
11256
|
name,
|
|
11111
11257
|
label,
|
|
11112
11258
|
required,
|
|
11113
11259
|
placeholder
|
|
11114
11260
|
}) => {
|
|
11115
|
-
return /* @__PURE__ */
|
|
11261
|
+
return /* @__PURE__ */ jsx51(
|
|
11116
11262
|
TextFormField,
|
|
11117
11263
|
{
|
|
11118
11264
|
name,
|
|
@@ -11129,10 +11275,10 @@ var EmailFormField = ({
|
|
|
11129
11275
|
import { useController as useController3 } from "react-hook-form";
|
|
11130
11276
|
|
|
11131
11277
|
// src/components/RichEditor/RichEditor.tsx
|
|
11132
|
-
import { useEffect as
|
|
11278
|
+
import { useEffect as useEffect9, useState as useState11 } from "react";
|
|
11133
11279
|
|
|
11134
11280
|
// src/components/RichEditor/QuillComponent.tsx
|
|
11135
|
-
import { useState as
|
|
11281
|
+
import { useState as useState10, useRef as useRef9, useEffect as useEffect8, useCallback as useCallback4 } from "react";
|
|
11136
11282
|
import { useQuill } from "react-quilljs";
|
|
11137
11283
|
|
|
11138
11284
|
// src/utils/uploadService.ts
|
|
@@ -12188,7 +12334,7 @@ var QuillEditor = styled("div", {
|
|
|
12188
12334
|
});
|
|
12189
12335
|
|
|
12190
12336
|
// src/components/RichEditor/QuillComponent.tsx
|
|
12191
|
-
import { jsx as
|
|
12337
|
+
import { jsx as jsx52, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12192
12338
|
var QuillComponent = ({
|
|
12193
12339
|
value = "",
|
|
12194
12340
|
onChange,
|
|
@@ -12201,12 +12347,12 @@ var QuillComponent = ({
|
|
|
12201
12347
|
onCharacterCountChange,
|
|
12202
12348
|
maxLength
|
|
12203
12349
|
}) => {
|
|
12204
|
-
const [showVideoModal, setShowVideoModal] =
|
|
12205
|
-
const [videoUrl, setVideoUrl] =
|
|
12206
|
-
const [showLinkModal, setShowLinkModal] =
|
|
12207
|
-
const [linkUrl, setLinkUrl] =
|
|
12208
|
-
const videoModalRef =
|
|
12209
|
-
const linkModalRef =
|
|
12350
|
+
const [showVideoModal, setShowVideoModal] = useState10(false);
|
|
12351
|
+
const [videoUrl, setVideoUrl] = useState10("");
|
|
12352
|
+
const [showLinkModal, setShowLinkModal] = useState10(false);
|
|
12353
|
+
const [linkUrl, setLinkUrl] = useState10("");
|
|
12354
|
+
const videoModalRef = useRef9(null);
|
|
12355
|
+
const linkModalRef = useRef9(null);
|
|
12210
12356
|
const { addToast, removeToast } = useToast();
|
|
12211
12357
|
const formatHTML = (html) => {
|
|
12212
12358
|
const parser = new DOMParser();
|
|
@@ -12302,7 +12448,7 @@ var QuillComponent = ({
|
|
|
12302
12448
|
}),
|
|
12303
12449
|
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
12304
12450
|
);
|
|
12305
|
-
|
|
12451
|
+
useEffect8(() => {
|
|
12306
12452
|
if (quill && value) {
|
|
12307
12453
|
const currentContent = quill.root.innerHTML;
|
|
12308
12454
|
if (currentContent !== value) {
|
|
@@ -12316,7 +12462,7 @@ var QuillComponent = ({
|
|
|
12316
12462
|
}
|
|
12317
12463
|
}
|
|
12318
12464
|
}, [quill, value]);
|
|
12319
|
-
|
|
12465
|
+
useEffect8(() => {
|
|
12320
12466
|
if (quill) {
|
|
12321
12467
|
quill.on("text-change", (delta, oldDelta, source) => {
|
|
12322
12468
|
if (source === "user") {
|
|
@@ -12371,7 +12517,7 @@ var QuillComponent = ({
|
|
|
12371
12517
|
}, 2e3);
|
|
12372
12518
|
}
|
|
12373
12519
|
}, [quill, onChange, handleImageUpload, onCharacterCountChange]);
|
|
12374
|
-
|
|
12520
|
+
useEffect8(() => {
|
|
12375
12521
|
if (quill) {
|
|
12376
12522
|
quill.enable(!disabled);
|
|
12377
12523
|
if (!disabled) {
|
|
@@ -12438,7 +12584,7 @@ var QuillComponent = ({
|
|
|
12438
12584
|
setVideoUrl("");
|
|
12439
12585
|
setShowVideoModal(false);
|
|
12440
12586
|
}, [videoUrl, quill]);
|
|
12441
|
-
|
|
12587
|
+
useEffect8(() => {
|
|
12442
12588
|
const handleClickOutside = (event) => {
|
|
12443
12589
|
if (showVideoModal && videoModalRef.current && !videoModalRef.current.contains(event.target)) {
|
|
12444
12590
|
handleVideoCancel();
|
|
@@ -12450,9 +12596,9 @@ var QuillComponent = ({
|
|
|
12450
12596
|
document.addEventListener("mousedown", handleClickOutside);
|
|
12451
12597
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
12452
12598
|
}, [showVideoModal, showLinkModal, handleVideoCancel, handleLinkCancel]);
|
|
12453
|
-
return /* @__PURE__ */
|
|
12454
|
-
/* @__PURE__ */
|
|
12455
|
-
showVideoModal && /* @__PURE__ */
|
|
12599
|
+
return /* @__PURE__ */ jsx52(QuillContainer, { className, children: /* @__PURE__ */ jsxs27(QuillEditor, { style: { position: "relative" }, children: [
|
|
12600
|
+
/* @__PURE__ */ jsx52("div", { ref: quillRef }),
|
|
12601
|
+
showVideoModal && /* @__PURE__ */ jsx52(
|
|
12456
12602
|
"div",
|
|
12457
12603
|
{
|
|
12458
12604
|
ref: videoModalRef,
|
|
@@ -12469,15 +12615,15 @@ var QuillComponent = ({
|
|
|
12469
12615
|
zIndex: 1e3,
|
|
12470
12616
|
width: "fit-content"
|
|
12471
12617
|
},
|
|
12472
|
-
children: /* @__PURE__ */
|
|
12473
|
-
/* @__PURE__ */
|
|
12618
|
+
children: /* @__PURE__ */ jsxs27(Flex2, { gap: 8, align: "center", children: [
|
|
12619
|
+
/* @__PURE__ */ jsx52(
|
|
12474
12620
|
Text,
|
|
12475
12621
|
{
|
|
12476
12622
|
style: { fontSize: "14px", fontWeight: "500", color: "#333" },
|
|
12477
12623
|
children: "V\xEDdeo:"
|
|
12478
12624
|
}
|
|
12479
12625
|
),
|
|
12480
|
-
/* @__PURE__ */
|
|
12626
|
+
/* @__PURE__ */ jsx52(
|
|
12481
12627
|
"input",
|
|
12482
12628
|
{
|
|
12483
12629
|
type: "text",
|
|
@@ -12501,7 +12647,7 @@ var QuillComponent = ({
|
|
|
12501
12647
|
autoFocus: true
|
|
12502
12648
|
}
|
|
12503
12649
|
),
|
|
12504
|
-
/* @__PURE__ */
|
|
12650
|
+
/* @__PURE__ */ jsx52(
|
|
12505
12651
|
"button",
|
|
12506
12652
|
{
|
|
12507
12653
|
onClick: handleVideoSubmit,
|
|
@@ -12522,7 +12668,7 @@ var QuillComponent = ({
|
|
|
12522
12668
|
] })
|
|
12523
12669
|
}
|
|
12524
12670
|
),
|
|
12525
|
-
showLinkModal && /* @__PURE__ */
|
|
12671
|
+
showLinkModal && /* @__PURE__ */ jsx52(
|
|
12526
12672
|
"div",
|
|
12527
12673
|
{
|
|
12528
12674
|
ref: linkModalRef,
|
|
@@ -12539,15 +12685,15 @@ var QuillComponent = ({
|
|
|
12539
12685
|
zIndex: 1e3,
|
|
12540
12686
|
width: "fit-content"
|
|
12541
12687
|
},
|
|
12542
|
-
children: /* @__PURE__ */
|
|
12543
|
-
/* @__PURE__ */
|
|
12688
|
+
children: /* @__PURE__ */ jsxs27(Flex2, { gap: 8, align: "center", children: [
|
|
12689
|
+
/* @__PURE__ */ jsx52(
|
|
12544
12690
|
Text,
|
|
12545
12691
|
{
|
|
12546
12692
|
style: { fontSize: "14px", fontWeight: "500", color: "#333" },
|
|
12547
12693
|
children: "Link:"
|
|
12548
12694
|
}
|
|
12549
12695
|
),
|
|
12550
|
-
/* @__PURE__ */
|
|
12696
|
+
/* @__PURE__ */ jsx52(
|
|
12551
12697
|
"input",
|
|
12552
12698
|
{
|
|
12553
12699
|
type: "text",
|
|
@@ -12572,7 +12718,7 @@ var QuillComponent = ({
|
|
|
12572
12718
|
autoFocus: true
|
|
12573
12719
|
}
|
|
12574
12720
|
),
|
|
12575
|
-
/* @__PURE__ */
|
|
12721
|
+
/* @__PURE__ */ jsx52(
|
|
12576
12722
|
"button",
|
|
12577
12723
|
{
|
|
12578
12724
|
onClick: handleLinkSubmit,
|
|
@@ -12598,20 +12744,20 @@ var QuillComponent = ({
|
|
|
12598
12744
|
var QuillComponent_default = QuillComponent;
|
|
12599
12745
|
|
|
12600
12746
|
// src/components/RichEditor/RichEditor.tsx
|
|
12601
|
-
import { jsx as
|
|
12747
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
12602
12748
|
var RichEditor = (props) => {
|
|
12603
|
-
const [isClient, setIsClient] =
|
|
12604
|
-
|
|
12749
|
+
const [isClient, setIsClient] = useState11(false);
|
|
12750
|
+
useEffect9(() => {
|
|
12605
12751
|
setIsClient(typeof window !== "undefined");
|
|
12606
12752
|
}, []);
|
|
12607
12753
|
if (!isClient) return null;
|
|
12608
|
-
return /* @__PURE__ */
|
|
12754
|
+
return /* @__PURE__ */ jsx53("div", { children: /* @__PURE__ */ jsx53(ToastProvider, { children: /* @__PURE__ */ jsx53(QuillComponent_default, __spreadValues({}, props)) }) });
|
|
12609
12755
|
};
|
|
12610
12756
|
var RichEditor_default = RichEditor;
|
|
12611
12757
|
|
|
12612
12758
|
// src/components/FormFields/RichEditorFormField.tsx
|
|
12613
|
-
import { useState as
|
|
12614
|
-
import { Fragment as Fragment5, jsx as
|
|
12759
|
+
import { useState as useState12 } from "react";
|
|
12760
|
+
import { Fragment as Fragment5, jsx as jsx54, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
12615
12761
|
var RichEditorFormField = (_a) => {
|
|
12616
12762
|
var _b = _a, {
|
|
12617
12763
|
name,
|
|
@@ -12645,7 +12791,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12645
12791
|
},
|
|
12646
12792
|
defaultValue: ""
|
|
12647
12793
|
});
|
|
12648
|
-
const [caracterQuantity, setCaracterQuantity] =
|
|
12794
|
+
const [caracterQuantity, setCaracterQuantity] = useState12(maxLength);
|
|
12649
12795
|
const handleCharacterCountChange = (count) => {
|
|
12650
12796
|
if (maxLength !== void 0) {
|
|
12651
12797
|
setCaracterQuantity(Math.max(0, maxLength - count));
|
|
@@ -12654,9 +12800,9 @@ var RichEditorFormField = (_a) => {
|
|
|
12654
12800
|
const fieldError = fieldState.error;
|
|
12655
12801
|
const haveError = !!fieldError;
|
|
12656
12802
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
12657
|
-
return /* @__PURE__ */
|
|
12658
|
-
maxLength ? /* @__PURE__ */
|
|
12659
|
-
label && /* @__PURE__ */
|
|
12803
|
+
return /* @__PURE__ */ jsxs28(Flex2, { direction: "column", children: [
|
|
12804
|
+
maxLength ? /* @__PURE__ */ jsxs28(Flex2, { direction: "row", justify: "between", children: [
|
|
12805
|
+
label && /* @__PURE__ */ jsx54(
|
|
12660
12806
|
FormLabel,
|
|
12661
12807
|
{
|
|
12662
12808
|
name,
|
|
@@ -12665,8 +12811,8 @@ var RichEditorFormField = (_a) => {
|
|
|
12665
12811
|
haveError
|
|
12666
12812
|
}
|
|
12667
12813
|
),
|
|
12668
|
-
/* @__PURE__ */
|
|
12669
|
-
] }) : /* @__PURE__ */
|
|
12814
|
+
/* @__PURE__ */ jsx54(Badge, { color: "grey", size: "xs", children: caracterQuantity })
|
|
12815
|
+
] }) : /* @__PURE__ */ jsx54(Fragment5, { children: label && /* @__PURE__ */ jsx54(
|
|
12670
12816
|
FormLabel,
|
|
12671
12817
|
{
|
|
12672
12818
|
name,
|
|
@@ -12675,7 +12821,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12675
12821
|
haveError
|
|
12676
12822
|
}
|
|
12677
12823
|
) }),
|
|
12678
|
-
/* @__PURE__ */
|
|
12824
|
+
/* @__PURE__ */ jsx54(
|
|
12679
12825
|
RichEditor_default,
|
|
12680
12826
|
__spreadProps(__spreadValues({}, props), {
|
|
12681
12827
|
value: field.value,
|
|
@@ -12687,14 +12833,14 @@ var RichEditorFormField = (_a) => {
|
|
|
12687
12833
|
simpleVersion
|
|
12688
12834
|
})
|
|
12689
12835
|
),
|
|
12690
|
-
/* @__PURE__ */
|
|
12836
|
+
/* @__PURE__ */ jsx54(ErrorFormMessage, { message: errorMsg })
|
|
12691
12837
|
] });
|
|
12692
12838
|
};
|
|
12693
12839
|
|
|
12694
12840
|
// src/components/FormFields/CalendarFormField.tsx
|
|
12695
12841
|
import { useController as useController4 } from "react-hook-form";
|
|
12696
12842
|
import { useCallback as useCallback5 } from "react";
|
|
12697
|
-
import { jsx as
|
|
12843
|
+
import { jsx as jsx55, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
12698
12844
|
var CalendarFormField = (_a) => {
|
|
12699
12845
|
var _b = _a, {
|
|
12700
12846
|
name,
|
|
@@ -12743,8 +12889,8 @@ var CalendarFormField = (_a) => {
|
|
|
12743
12889
|
const handleCalendarChange = (date) => {
|
|
12744
12890
|
setSelected(date);
|
|
12745
12891
|
};
|
|
12746
|
-
return /* @__PURE__ */
|
|
12747
|
-
label && /* @__PURE__ */
|
|
12892
|
+
return /* @__PURE__ */ jsxs29(Flex2, { direction: "column", style: { flex: "1" }, children: [
|
|
12893
|
+
label && /* @__PURE__ */ jsx55(
|
|
12748
12894
|
FormLabel,
|
|
12749
12895
|
{
|
|
12750
12896
|
name,
|
|
@@ -12753,7 +12899,7 @@ var CalendarFormField = (_a) => {
|
|
|
12753
12899
|
haveError
|
|
12754
12900
|
}
|
|
12755
12901
|
),
|
|
12756
|
-
/* @__PURE__ */
|
|
12902
|
+
/* @__PURE__ */ jsx55(
|
|
12757
12903
|
Calendar,
|
|
12758
12904
|
__spreadValues({
|
|
12759
12905
|
selected,
|
|
@@ -12766,14 +12912,83 @@ var CalendarFormField = (_a) => {
|
|
|
12766
12912
|
maxYearsFromNow
|
|
12767
12913
|
}, calendarProps)
|
|
12768
12914
|
),
|
|
12769
|
-
/* @__PURE__ */
|
|
12915
|
+
/* @__PURE__ */ jsx55(ErrorFormMessage, { message: errorMsg })
|
|
12770
12916
|
] });
|
|
12771
12917
|
};
|
|
12772
12918
|
|
|
12773
|
-
// src/components/FormFields/
|
|
12774
|
-
import { useController as useController5 } from "react-hook-form";
|
|
12919
|
+
// src/components/FormFields/DoubleCalendarFormField.tsx
|
|
12775
12920
|
import { useCallback as useCallback6 } from "react";
|
|
12776
|
-
import {
|
|
12921
|
+
import { useController as useController5 } from "react-hook-form";
|
|
12922
|
+
import { jsx as jsx56, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
12923
|
+
var DoubleCalendarFormField = (_a) => {
|
|
12924
|
+
var _b = _a, {
|
|
12925
|
+
name,
|
|
12926
|
+
label,
|
|
12927
|
+
required,
|
|
12928
|
+
validate,
|
|
12929
|
+
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
12930
|
+
rules,
|
|
12931
|
+
allowPastDates,
|
|
12932
|
+
maxYearsFromNow = 20
|
|
12933
|
+
} = _b, calendarProps = __objRest(_b, [
|
|
12934
|
+
"name",
|
|
12935
|
+
"label",
|
|
12936
|
+
"required",
|
|
12937
|
+
"validate",
|
|
12938
|
+
"validationErrorMessage",
|
|
12939
|
+
"rules",
|
|
12940
|
+
"allowPastDates",
|
|
12941
|
+
"maxYearsFromNow"
|
|
12942
|
+
]);
|
|
12943
|
+
const handleValidate = useCallback6(
|
|
12944
|
+
(value) => {
|
|
12945
|
+
var _a2;
|
|
12946
|
+
if (value === void 0 || value === null) {
|
|
12947
|
+
if (required) return validationErrorMessage;
|
|
12948
|
+
return true;
|
|
12949
|
+
}
|
|
12950
|
+
return (_a2 = validate == null ? void 0 : validate(value)) != null ? _a2 : true;
|
|
12951
|
+
},
|
|
12952
|
+
[validate, required, validationErrorMessage]
|
|
12953
|
+
);
|
|
12954
|
+
const { field, fieldState } = useController5({
|
|
12955
|
+
name,
|
|
12956
|
+
rules: __spreadValues({
|
|
12957
|
+
required: required ? validationErrorMessage : false,
|
|
12958
|
+
validate: handleValidate
|
|
12959
|
+
}, rules),
|
|
12960
|
+
defaultValue: void 0
|
|
12961
|
+
});
|
|
12962
|
+
const fieldError = fieldState.error;
|
|
12963
|
+
const haveError = !!fieldError;
|
|
12964
|
+
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
12965
|
+
const { value: selected, onChange: setSelected } = field;
|
|
12966
|
+
const handleCalendarChange = (range) => {
|
|
12967
|
+
setSelected(range);
|
|
12968
|
+
};
|
|
12969
|
+
return /* @__PURE__ */ jsxs30(Flex2, { direction: "column", style: { flex: "1" }, children: [
|
|
12970
|
+
label && /* @__PURE__ */ jsx56(FormLabel, { name, label, required, haveError }),
|
|
12971
|
+
/* @__PURE__ */ jsx56(
|
|
12972
|
+
DoubleCalendar,
|
|
12973
|
+
__spreadValues({
|
|
12974
|
+
selected,
|
|
12975
|
+
setSelected: (value) => {
|
|
12976
|
+
const newValue = typeof value === "function" ? value(selected) : value;
|
|
12977
|
+
handleCalendarChange(newValue);
|
|
12978
|
+
},
|
|
12979
|
+
hasError: haveError,
|
|
12980
|
+
allowPastDates,
|
|
12981
|
+
maxYearsFromNow
|
|
12982
|
+
}, calendarProps)
|
|
12983
|
+
),
|
|
12984
|
+
/* @__PURE__ */ jsx56(ErrorFormMessage, { message: errorMsg })
|
|
12985
|
+
] });
|
|
12986
|
+
};
|
|
12987
|
+
|
|
12988
|
+
// src/components/FormFields/TimePickerFormField.tsx
|
|
12989
|
+
import { useController as useController6 } from "react-hook-form";
|
|
12990
|
+
import { useCallback as useCallback7 } from "react";
|
|
12991
|
+
import { jsx as jsx57, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
12777
12992
|
var TimePickerFormField = (_a) => {
|
|
12778
12993
|
var _b = _a, {
|
|
12779
12994
|
name,
|
|
@@ -12790,7 +13005,7 @@ var TimePickerFormField = (_a) => {
|
|
|
12790
13005
|
"validationErrorMessage",
|
|
12791
13006
|
"rules"
|
|
12792
13007
|
]);
|
|
12793
|
-
const handleValidate =
|
|
13008
|
+
const handleValidate = useCallback7(
|
|
12794
13009
|
(value) => {
|
|
12795
13010
|
var _a2;
|
|
12796
13011
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -12801,7 +13016,7 @@ var TimePickerFormField = (_a) => {
|
|
|
12801
13016
|
},
|
|
12802
13017
|
[validate, required, validationErrorMessage]
|
|
12803
13018
|
);
|
|
12804
|
-
const { field, fieldState } =
|
|
13019
|
+
const { field, fieldState } = useController6({
|
|
12805
13020
|
name,
|
|
12806
13021
|
rules: __spreadValues({
|
|
12807
13022
|
required: required ? validationErrorMessage : false,
|
|
@@ -12816,8 +13031,8 @@ var TimePickerFormField = (_a) => {
|
|
|
12816
13031
|
const handleTimePickerChange = (time) => {
|
|
12817
13032
|
setSelected(time);
|
|
12818
13033
|
};
|
|
12819
|
-
return /* @__PURE__ */
|
|
12820
|
-
label && /* @__PURE__ */
|
|
13034
|
+
return /* @__PURE__ */ jsxs31(Flex2, { direction: "column", style: { flex: "1" }, children: [
|
|
13035
|
+
label && /* @__PURE__ */ jsx57(
|
|
12821
13036
|
FormLabel,
|
|
12822
13037
|
{
|
|
12823
13038
|
name,
|
|
@@ -12826,7 +13041,7 @@ var TimePickerFormField = (_a) => {
|
|
|
12826
13041
|
haveError
|
|
12827
13042
|
}
|
|
12828
13043
|
),
|
|
12829
|
-
/* @__PURE__ */
|
|
13044
|
+
/* @__PURE__ */ jsx57(
|
|
12830
13045
|
TimePicker,
|
|
12831
13046
|
__spreadValues({
|
|
12832
13047
|
selected,
|
|
@@ -12837,16 +13052,16 @@ var TimePickerFormField = (_a) => {
|
|
|
12837
13052
|
hasError: haveError
|
|
12838
13053
|
}, timePickerProps)
|
|
12839
13054
|
),
|
|
12840
|
-
/* @__PURE__ */
|
|
13055
|
+
/* @__PURE__ */ jsx57(ErrorFormMessage, { message: errorMsg })
|
|
12841
13056
|
] });
|
|
12842
13057
|
};
|
|
12843
13058
|
|
|
12844
13059
|
// src/hooks/useImageUpload.ts
|
|
12845
|
-
import { useState as
|
|
13060
|
+
import { useState as useState13, useCallback as useCallback8 } from "react";
|
|
12846
13061
|
var useImageUpload = (options) => {
|
|
12847
|
-
const [isUploading, setIsUploading] =
|
|
12848
|
-
const [progress, setProgress] =
|
|
12849
|
-
const [error, setError] =
|
|
13062
|
+
const [isUploading, setIsUploading] = useState13(false);
|
|
13063
|
+
const [progress, setProgress] = useState13(null);
|
|
13064
|
+
const [error, setError] = useState13(null);
|
|
12850
13065
|
const {
|
|
12851
13066
|
onSuccess,
|
|
12852
13067
|
onError,
|
|
@@ -12856,7 +13071,7 @@ var useImageUpload = (options) => {
|
|
|
12856
13071
|
allowedTypes = ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
|
12857
13072
|
uploadConfig
|
|
12858
13073
|
} = options;
|
|
12859
|
-
const validateFile =
|
|
13074
|
+
const validateFile = useCallback8(
|
|
12860
13075
|
(file) => {
|
|
12861
13076
|
if (!allowedTypes.includes(file.type)) {
|
|
12862
13077
|
const errorMsg = "Tipo de arquivo n\xE3o suportado";
|
|
@@ -12874,7 +13089,7 @@ var useImageUpload = (options) => {
|
|
|
12874
13089
|
},
|
|
12875
13090
|
[allowedTypes, maxFileSize, onError]
|
|
12876
13091
|
);
|
|
12877
|
-
const uploadFile =
|
|
13092
|
+
const uploadFile = useCallback8(
|
|
12878
13093
|
(file) => __async(null, null, function* () {
|
|
12879
13094
|
if (!validateFile(file)) {
|
|
12880
13095
|
return null;
|
|
@@ -12927,7 +13142,7 @@ var useImageUpload = (options) => {
|
|
|
12927
13142
|
}),
|
|
12928
13143
|
[validateFile, onSuccess, onError, onProgress]
|
|
12929
13144
|
);
|
|
12930
|
-
const reset =
|
|
13145
|
+
const reset = useCallback8(() => {
|
|
12931
13146
|
setIsUploading(false);
|
|
12932
13147
|
setProgress(null);
|
|
12933
13148
|
setError(null);
|
|
@@ -12975,6 +13190,8 @@ export {
|
|
|
12975
13190
|
ContainerStyled,
|
|
12976
13191
|
CountryFormField,
|
|
12977
13192
|
Divider,
|
|
13193
|
+
DoubleCalendar,
|
|
13194
|
+
DoubleCalendarFormField,
|
|
12978
13195
|
Drawer,
|
|
12979
13196
|
DropdownMenu2 as DropdownMenu,
|
|
12980
13197
|
DropdownMenuItem,
|