@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.js
CHANGED
|
@@ -896,6 +896,8 @@ __export(index_exports, {
|
|
|
896
896
|
ContainerStyled: () => ContainerStyled,
|
|
897
897
|
CountryFormField: () => CountryFormField,
|
|
898
898
|
Divider: () => Divider,
|
|
899
|
+
DoubleCalendar: () => DoubleCalendar,
|
|
900
|
+
DoubleCalendarFormField: () => DoubleCalendarFormField,
|
|
899
901
|
Drawer: () => Drawer,
|
|
900
902
|
DropdownMenu: () => DropdownMenu2,
|
|
901
903
|
DropdownMenuItem: () => DropdownMenuItem,
|
|
@@ -7858,7 +7860,8 @@ var CalendarFooterStyled = styled("div", {
|
|
|
7858
7860
|
borderTop: "2px solid $neutral100",
|
|
7859
7861
|
padding: "$4 $16",
|
|
7860
7862
|
display: "flex",
|
|
7861
|
-
|
|
7863
|
+
gap: "1rem",
|
|
7864
|
+
justifyContent: "flex-end",
|
|
7862
7865
|
alignItems: "center",
|
|
7863
7866
|
height: "3rem"
|
|
7864
7867
|
});
|
|
@@ -7869,7 +7872,7 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
7869
7872
|
color: "$dark500"
|
|
7870
7873
|
},
|
|
7871
7874
|
".rdp-root": {
|
|
7872
|
-
padding: "$8"
|
|
7875
|
+
padding: "0 $8"
|
|
7873
7876
|
},
|
|
7874
7877
|
".rdp-today .rdp-day_button": {
|
|
7875
7878
|
color: "$brand500",
|
|
@@ -7879,8 +7882,8 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
7879
7882
|
color: "$dark400"
|
|
7880
7883
|
},
|
|
7881
7884
|
".rdp-day_button": {
|
|
7882
|
-
height: "
|
|
7883
|
-
width: "
|
|
7885
|
+
height: "28px",
|
|
7886
|
+
width: "28px",
|
|
7884
7887
|
borderRadius: "$sm",
|
|
7885
7888
|
fontSize: "$14",
|
|
7886
7889
|
color: "$text",
|
|
@@ -7898,9 +7901,10 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
7898
7901
|
borderColor: "transparent"
|
|
7899
7902
|
},
|
|
7900
7903
|
".rdp-nav": {
|
|
7904
|
+
position: "absolute",
|
|
7905
|
+
width: "98%",
|
|
7901
7906
|
display: "flex",
|
|
7902
|
-
justifyContent: "space-between"
|
|
7903
|
-
width: "100%"
|
|
7907
|
+
justifyContent: "space-between"
|
|
7904
7908
|
},
|
|
7905
7909
|
".rdp-nav .rdp-chevron": {
|
|
7906
7910
|
display: "none"
|
|
@@ -7936,8 +7940,15 @@ var DayPickerWrapperStyled = styled("div", {
|
|
|
7936
7940
|
backgroundColor: "transparent",
|
|
7937
7941
|
cursor: "pointer"
|
|
7938
7942
|
},
|
|
7943
|
+
".rdp-months": {
|
|
7944
|
+
display: "flex",
|
|
7945
|
+
columnGap: "$16",
|
|
7946
|
+
alignItems: "flex-start",
|
|
7947
|
+
paddingTop: "$12"
|
|
7948
|
+
},
|
|
7939
7949
|
".rdp-month": {
|
|
7940
|
-
marginTop: "
|
|
7950
|
+
marginTop: "0",
|
|
7951
|
+
paddingTop: "$6"
|
|
7941
7952
|
},
|
|
7942
7953
|
".rdp-month_caption": {
|
|
7943
7954
|
display: "flex",
|
|
@@ -8141,8 +8152,138 @@ function Calendar(_a) {
|
|
|
8141
8152
|
] })) });
|
|
8142
8153
|
}
|
|
8143
8154
|
|
|
8144
|
-
// src/components/
|
|
8155
|
+
// src/components/DoubleCalendar/index.tsx
|
|
8145
8156
|
var import_react9 = require("react");
|
|
8157
|
+
var import_react_day_picker2 = require("react-day-picker");
|
|
8158
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
8159
|
+
function DoubleCalendar(_a) {
|
|
8160
|
+
var _b = _a, {
|
|
8161
|
+
action,
|
|
8162
|
+
actionText,
|
|
8163
|
+
calendarLayout,
|
|
8164
|
+
selected,
|
|
8165
|
+
setSelected,
|
|
8166
|
+
position = "bottom",
|
|
8167
|
+
hasError,
|
|
8168
|
+
expand,
|
|
8169
|
+
allowPastDates = false,
|
|
8170
|
+
maxYearsFromNow = 20
|
|
8171
|
+
} = _b, props = __objRest(_b, [
|
|
8172
|
+
"action",
|
|
8173
|
+
"actionText",
|
|
8174
|
+
"calendarLayout",
|
|
8175
|
+
"selected",
|
|
8176
|
+
"setSelected",
|
|
8177
|
+
"position",
|
|
8178
|
+
"hasError",
|
|
8179
|
+
"expand",
|
|
8180
|
+
"allowPastDates",
|
|
8181
|
+
"maxYearsFromNow"
|
|
8182
|
+
]);
|
|
8183
|
+
const [startValue, setStartValue] = (0, import_react9.useState)("");
|
|
8184
|
+
const [endValue, setEndValue] = (0, import_react9.useState)("");
|
|
8185
|
+
const [showContainer, setShowCalendar] = (0, import_react9.useState)(false);
|
|
8186
|
+
const initialSelectedRef = (0, import_react9.useRef)(void 0);
|
|
8187
|
+
const dropdownRef = (0, import_react9.useRef)(null);
|
|
8188
|
+
useOnClickOutside(dropdownRef, () => {
|
|
8189
|
+
setShowCalendar(false);
|
|
8190
|
+
});
|
|
8191
|
+
const today = /* @__PURE__ */ new Date();
|
|
8192
|
+
const maxDate = addYears(today, maxYearsFromNow);
|
|
8193
|
+
(0, import_react9.useEffect)(() => {
|
|
8194
|
+
if (selected && selected.from) {
|
|
8195
|
+
setStartValue(format2(selected.from, "dd/MM/yyyy"));
|
|
8196
|
+
} else {
|
|
8197
|
+
setStartValue("");
|
|
8198
|
+
}
|
|
8199
|
+
if (selected && selected.to) {
|
|
8200
|
+
setEndValue(format2(selected.to, "dd/MM/yyyy"));
|
|
8201
|
+
} else {
|
|
8202
|
+
setEndValue("");
|
|
8203
|
+
}
|
|
8204
|
+
}, [selected]);
|
|
8205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(CalendarStyled, __spreadProps(__spreadValues({}, props), { expand, ref: dropdownRef, children: [
|
|
8206
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8207
|
+
CalendarButtonStyled,
|
|
8208
|
+
{
|
|
8209
|
+
expand,
|
|
8210
|
+
type: "button",
|
|
8211
|
+
onClick: () => setShowCalendar((prev) => {
|
|
8212
|
+
const next = !prev;
|
|
8213
|
+
if (!prev) initialSelectedRef.current = selected;
|
|
8214
|
+
return next;
|
|
8215
|
+
}),
|
|
8216
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "flex", gap: "8px", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8217
|
+
TextField,
|
|
8218
|
+
{
|
|
8219
|
+
placeholder: "00/00/0000 - 00/00/0000",
|
|
8220
|
+
type: "text",
|
|
8221
|
+
value: `${startValue || "00/00/0000"} - ${endValue || "00/00/0000"}`,
|
|
8222
|
+
readOnly: true,
|
|
8223
|
+
inputMode: "numeric",
|
|
8224
|
+
textAlign: "right",
|
|
8225
|
+
color: hasError ? "error" : "default",
|
|
8226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TextFieldSlot, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon_default, { name: "calendar", size: "xl" }) })
|
|
8227
|
+
}
|
|
8228
|
+
) })
|
|
8229
|
+
}
|
|
8230
|
+
),
|
|
8231
|
+
showContainer && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(CalendarContentStyled, { position, children: [
|
|
8232
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DayPickerWrapperStyled, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8233
|
+
import_react_day_picker2.DayPicker,
|
|
8234
|
+
{
|
|
8235
|
+
mode: "range",
|
|
8236
|
+
numberOfMonths: 2,
|
|
8237
|
+
captionLayout: calendarLayout,
|
|
8238
|
+
selected,
|
|
8239
|
+
onSelect: setSelected,
|
|
8240
|
+
required: true,
|
|
8241
|
+
locale: ptBR,
|
|
8242
|
+
disabled: allowPastDates ? void 0 : { before: today },
|
|
8243
|
+
fromMonth: allowPastDates ? void 0 : today,
|
|
8244
|
+
toMonth: maxDate
|
|
8245
|
+
}
|
|
8246
|
+
) }) }),
|
|
8247
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(CalendarFooterStyled, { children: [
|
|
8248
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { textAlign: "center", padding: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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"}` }) }),
|
|
8249
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8250
|
+
Button,
|
|
8251
|
+
{
|
|
8252
|
+
style: { margin: "0 0.5rem" },
|
|
8253
|
+
variant: "text",
|
|
8254
|
+
color: "neutral",
|
|
8255
|
+
type: "button",
|
|
8256
|
+
onClick: () => {
|
|
8257
|
+
setSelected(initialSelectedRef.current);
|
|
8258
|
+
setShowCalendar(false);
|
|
8259
|
+
},
|
|
8260
|
+
size: "medium",
|
|
8261
|
+
fontWeight: "regular",
|
|
8262
|
+
children: "Cancelar"
|
|
8263
|
+
}
|
|
8264
|
+
),
|
|
8265
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8266
|
+
Button,
|
|
8267
|
+
{
|
|
8268
|
+
style: { margin: "0 0.5rem" },
|
|
8269
|
+
variant: "text",
|
|
8270
|
+
color: "brand",
|
|
8271
|
+
type: "button",
|
|
8272
|
+
onClick: () => {
|
|
8273
|
+
setShowCalendar(false);
|
|
8274
|
+
},
|
|
8275
|
+
size: "medium",
|
|
8276
|
+
fontWeight: "medium",
|
|
8277
|
+
children: actionText != null ? actionText : "Aplicar"
|
|
8278
|
+
}
|
|
8279
|
+
)
|
|
8280
|
+
] })
|
|
8281
|
+
] })
|
|
8282
|
+
] })) });
|
|
8283
|
+
}
|
|
8284
|
+
|
|
8285
|
+
// src/components/Drawer/index.tsx
|
|
8286
|
+
var import_react10 = require("react");
|
|
8146
8287
|
|
|
8147
8288
|
// src/components/Drawer/styledComponents.ts
|
|
8148
8289
|
var DrawerOverlayStyled = styled("div", {
|
|
@@ -8237,7 +8378,7 @@ var GoBackButtonStyled = styled("button", {
|
|
|
8237
8378
|
});
|
|
8238
8379
|
|
|
8239
8380
|
// src/components/Drawer/index.tsx
|
|
8240
|
-
var
|
|
8381
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
8241
8382
|
function Drawer({
|
|
8242
8383
|
isOpen,
|
|
8243
8384
|
onClose,
|
|
@@ -8249,7 +8390,7 @@ function Drawer({
|
|
|
8249
8390
|
goBackAction,
|
|
8250
8391
|
zIndex = 1e3
|
|
8251
8392
|
}) {
|
|
8252
|
-
(0,
|
|
8393
|
+
(0, import_react10.useEffect)(() => {
|
|
8253
8394
|
if (isOpen) {
|
|
8254
8395
|
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
8255
8396
|
document.body.style.overflow = "hidden";
|
|
@@ -8263,8 +8404,8 @@ function Drawer({
|
|
|
8263
8404
|
document.body.style.paddingRight = "";
|
|
8264
8405
|
};
|
|
8265
8406
|
}, [isOpen]);
|
|
8266
|
-
return /* @__PURE__ */ (0,
|
|
8267
|
-
/* @__PURE__ */ (0,
|
|
8407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
8408
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8268
8409
|
DrawerOverlayStyled,
|
|
8269
8410
|
{
|
|
8270
8411
|
css: {
|
|
@@ -8274,15 +8415,16 @@ function Drawer({
|
|
|
8274
8415
|
open: isOpen
|
|
8275
8416
|
}
|
|
8276
8417
|
),
|
|
8277
|
-
/* @__PURE__ */ (0,
|
|
8418
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8278
8419
|
DrawerWrapper,
|
|
8279
8420
|
{
|
|
8280
8421
|
css: {
|
|
8281
8422
|
zIndex: zIndex + 1,
|
|
8282
|
-
width: width != null ? width : "34.25rem"
|
|
8423
|
+
width: width != null ? width : "34.25rem",
|
|
8424
|
+
maxWidth: "100%"
|
|
8283
8425
|
},
|
|
8284
8426
|
open: isOpen,
|
|
8285
|
-
children: /* @__PURE__ */ (0,
|
|
8427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
8286
8428
|
DrawerContainerStyled,
|
|
8287
8429
|
{
|
|
8288
8430
|
open: isOpen,
|
|
@@ -8290,12 +8432,12 @@ function Drawer({
|
|
|
8290
8432
|
backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"]
|
|
8291
8433
|
},
|
|
8292
8434
|
children: [
|
|
8293
|
-
/* @__PURE__ */ (0,
|
|
8294
|
-
/* @__PURE__ */ (0,
|
|
8295
|
-
goBackIcon && goBackIcon && /* @__PURE__ */ (0,
|
|
8296
|
-
/* @__PURE__ */ (0,
|
|
8435
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DrawerHeaderDiv, { children: [
|
|
8436
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Flex2, { gap: 8, align: "center", children: [
|
|
8437
|
+
goBackIcon && goBackIcon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
|
|
8438
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DrawerHeaderTitle, { children: title })
|
|
8297
8439
|
] }),
|
|
8298
|
-
/* @__PURE__ */ (0,
|
|
8440
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
|
|
8299
8441
|
] }),
|
|
8300
8442
|
isOpen ? children : null
|
|
8301
8443
|
]
|
|
@@ -8307,8 +8449,8 @@ function Drawer({
|
|
|
8307
8449
|
}
|
|
8308
8450
|
|
|
8309
8451
|
// src/components/TimePicker.tsx
|
|
8310
|
-
var
|
|
8311
|
-
var
|
|
8452
|
+
var import_react11 = require("react");
|
|
8453
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
8312
8454
|
var TimePickerStyled = styled("div", {
|
|
8313
8455
|
position: "relative",
|
|
8314
8456
|
width: "fit-content",
|
|
@@ -8430,14 +8572,14 @@ function TimePicker({
|
|
|
8430
8572
|
hasError,
|
|
8431
8573
|
expand = false
|
|
8432
8574
|
}) {
|
|
8433
|
-
const [hours, setHours] = (0,
|
|
8434
|
-
const [minutes, setMinutes] = (0,
|
|
8435
|
-
const [rawHours, setRawHours] = (0,
|
|
8436
|
-
const [rawMinutes, setRawMinutes] = (0,
|
|
8437
|
-
const [isOpen, setIsOpen] = (0,
|
|
8438
|
-
const dropdownRef = (0,
|
|
8575
|
+
const [hours, setHours] = (0, import_react11.useState)("00");
|
|
8576
|
+
const [minutes, setMinutes] = (0, import_react11.useState)("00");
|
|
8577
|
+
const [rawHours, setRawHours] = (0, import_react11.useState)("00");
|
|
8578
|
+
const [rawMinutes, setRawMinutes] = (0, import_react11.useState)("00");
|
|
8579
|
+
const [isOpen, setIsOpen] = (0, import_react11.useState)(false);
|
|
8580
|
+
const dropdownRef = (0, import_react11.useRef)(null);
|
|
8439
8581
|
useOnClickOutside(dropdownRef, () => setIsOpen(false));
|
|
8440
|
-
const handleIncrement = (0,
|
|
8582
|
+
const handleIncrement = (0, import_react11.useCallback)(
|
|
8441
8583
|
(type) => {
|
|
8442
8584
|
if (type === "hours") {
|
|
8443
8585
|
const next = (parseInt(hours) + 1) % 24;
|
|
@@ -8451,7 +8593,7 @@ function TimePicker({
|
|
|
8451
8593
|
},
|
|
8452
8594
|
[hours, minutes]
|
|
8453
8595
|
);
|
|
8454
|
-
const handleDecrement = (0,
|
|
8596
|
+
const handleDecrement = (0, import_react11.useCallback)(
|
|
8455
8597
|
(type) => {
|
|
8456
8598
|
if (type === "hours") {
|
|
8457
8599
|
const prev = (parseInt(hours) - 1 + 24) % 24;
|
|
@@ -8465,14 +8607,14 @@ function TimePicker({
|
|
|
8465
8607
|
},
|
|
8466
8608
|
[hours, minutes]
|
|
8467
8609
|
);
|
|
8468
|
-
return /* @__PURE__ */ (0,
|
|
8469
|
-
/* @__PURE__ */ (0,
|
|
8610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TimePickerStyled, { ref: dropdownRef, expand, children: [
|
|
8611
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8470
8612
|
TimePickerButtonStyled,
|
|
8471
8613
|
{
|
|
8472
8614
|
type: "button",
|
|
8473
8615
|
onClick: () => setIsOpen((prev) => !prev),
|
|
8474
8616
|
expand,
|
|
8475
|
-
children: /* @__PURE__ */ (0,
|
|
8617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8476
8618
|
TextField,
|
|
8477
8619
|
{
|
|
8478
8620
|
value: selected,
|
|
@@ -8482,18 +8624,18 @@ function TimePicker({
|
|
|
8482
8624
|
typography: "labelSmall",
|
|
8483
8625
|
fontWeight: "regular",
|
|
8484
8626
|
color: hasError ? "error" : "default",
|
|
8485
|
-
children: /* @__PURE__ */ (0,
|
|
8627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TextFieldSlot, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon_default, { name: "clock", size: "xl" }) })
|
|
8486
8628
|
}
|
|
8487
8629
|
)
|
|
8488
8630
|
}
|
|
8489
8631
|
),
|
|
8490
|
-
isOpen && /* @__PURE__ */ (0,
|
|
8632
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
8491
8633
|
TimePickerDropdownStyled,
|
|
8492
8634
|
{
|
|
8493
8635
|
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" },
|
|
8494
8636
|
children: [
|
|
8495
|
-
/* @__PURE__ */ (0,
|
|
8496
|
-
["hours", "minutes"].map((unit) => /* @__PURE__ */ (0,
|
|
8637
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TimerPickerContentStyled, { children: [
|
|
8638
|
+
["hours", "minutes"].map((unit) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
8497
8639
|
Box,
|
|
8498
8640
|
{
|
|
8499
8641
|
style: {
|
|
@@ -8502,13 +8644,13 @@ function TimePicker({
|
|
|
8502
8644
|
flexDirection: "column"
|
|
8503
8645
|
},
|
|
8504
8646
|
children: [
|
|
8505
|
-
/* @__PURE__ */ (0,
|
|
8647
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8506
8648
|
TimePickerIconButton,
|
|
8507
8649
|
{
|
|
8508
8650
|
type: "button",
|
|
8509
8651
|
variant: "text",
|
|
8510
8652
|
onClick: () => handleIncrement(unit),
|
|
8511
|
-
children: /* @__PURE__ */ (0,
|
|
8653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
8512
8654
|
"svg",
|
|
8513
8655
|
{
|
|
8514
8656
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8517,14 +8659,14 @@ function TimePicker({
|
|
|
8517
8659
|
viewBox: "0 0 32 32",
|
|
8518
8660
|
fill: "none",
|
|
8519
8661
|
children: [
|
|
8520
|
-
/* @__PURE__ */ (0,
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8521
8663
|
"path",
|
|
8522
8664
|
{
|
|
8523
8665
|
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",
|
|
8524
8666
|
fill: "white"
|
|
8525
8667
|
}
|
|
8526
8668
|
),
|
|
8527
|
-
/* @__PURE__ */ (0,
|
|
8669
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8528
8670
|
"path",
|
|
8529
8671
|
{
|
|
8530
8672
|
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",
|
|
@@ -8536,7 +8678,7 @@ function TimePicker({
|
|
|
8536
8678
|
)
|
|
8537
8679
|
}
|
|
8538
8680
|
),
|
|
8539
|
-
/* @__PURE__ */ (0,
|
|
8681
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8540
8682
|
InputStyled,
|
|
8541
8683
|
{
|
|
8542
8684
|
inputMode: "numeric",
|
|
@@ -8574,13 +8716,13 @@ function TimePicker({
|
|
|
8574
8716
|
}
|
|
8575
8717
|
}
|
|
8576
8718
|
),
|
|
8577
|
-
/* @__PURE__ */ (0,
|
|
8719
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8578
8720
|
TimePickerIconButton,
|
|
8579
8721
|
{
|
|
8580
8722
|
type: "button",
|
|
8581
8723
|
variant: "text",
|
|
8582
8724
|
onClick: () => handleDecrement(unit),
|
|
8583
|
-
children: /* @__PURE__ */ (0,
|
|
8725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
8584
8726
|
"svg",
|
|
8585
8727
|
{
|
|
8586
8728
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8589,14 +8731,14 @@ function TimePicker({
|
|
|
8589
8731
|
viewBox: "0 0 32 32",
|
|
8590
8732
|
fill: "none",
|
|
8591
8733
|
children: [
|
|
8592
|
-
/* @__PURE__ */ (0,
|
|
8734
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8593
8735
|
"path",
|
|
8594
8736
|
{
|
|
8595
8737
|
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",
|
|
8596
8738
|
fill: "white"
|
|
8597
8739
|
}
|
|
8598
8740
|
),
|
|
8599
|
-
/* @__PURE__ */ (0,
|
|
8741
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8600
8742
|
"path",
|
|
8601
8743
|
{
|
|
8602
8744
|
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",
|
|
@@ -8612,9 +8754,9 @@ function TimePicker({
|
|
|
8612
8754
|
},
|
|
8613
8755
|
unit
|
|
8614
8756
|
)),
|
|
8615
|
-
/* @__PURE__ */ (0,
|
|
8757
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: ":" })
|
|
8616
8758
|
] }),
|
|
8617
|
-
/* @__PURE__ */ (0,
|
|
8759
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TimePickerFooterStyled, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8618
8760
|
Button,
|
|
8619
8761
|
{
|
|
8620
8762
|
type: "button",
|
|
@@ -8637,7 +8779,7 @@ function TimePicker({
|
|
|
8637
8779
|
|
|
8638
8780
|
// src/components/Alert.tsx
|
|
8639
8781
|
var import_themes13 = require("@radix-ui/themes");
|
|
8640
|
-
var
|
|
8782
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
8641
8783
|
var AlertDialogSimpleStyled = styled(import_themes13.AlertDialog.Content, {
|
|
8642
8784
|
fontFamily: "$default",
|
|
8643
8785
|
lineHeight: "$base",
|
|
@@ -8751,19 +8893,19 @@ function Alert(_a) {
|
|
|
8751
8893
|
"completAlert",
|
|
8752
8894
|
"simpleAlert"
|
|
8753
8895
|
]);
|
|
8754
|
-
return /* @__PURE__ */ (0,
|
|
8755
|
-
simpleAlert && /* @__PURE__ */ (0,
|
|
8756
|
-
/* @__PURE__ */ (0,
|
|
8757
|
-
/* @__PURE__ */ (0,
|
|
8758
|
-
/* @__PURE__ */ (0,
|
|
8759
|
-
simpleAlert.cancel && /* @__PURE__ */ (0,
|
|
8896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
8897
|
+
simpleAlert && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_themes13.Theme, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_themes13.AlertDialog.Root, { children: [
|
|
8898
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_themes13.AlertDialog.Trigger, { children: trigger }),
|
|
8899
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(AlertDialogSimpleStyled, __spreadProps(__spreadValues({}, props), { children: [
|
|
8900
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AlertDialogDescriptionStyled, { children: simpleAlert.description }),
|
|
8901
|
+
simpleAlert.cancel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_themes13.AlertDialog.Cancel, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "text", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon_default, { name: "close" }) }) })
|
|
8760
8902
|
] })) })
|
|
8761
8903
|
] }) }),
|
|
8762
|
-
completAlert && /* @__PURE__ */ (0,
|
|
8763
|
-
/* @__PURE__ */ (0,
|
|
8764
|
-
/* @__PURE__ */ (0,
|
|
8765
|
-
/* @__PURE__ */ (0,
|
|
8766
|
-
color === "success" && /* @__PURE__ */ (0,
|
|
8904
|
+
completAlert && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_themes13.Theme, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_themes13.AlertDialog.Root, { children: [
|
|
8905
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_themes13.AlertDialog.Trigger, { children: trigger }),
|
|
8906
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(AlertDialogCompleteStyled, { children: [
|
|
8907
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(AlertDialogRowStyled, { className: "le-alert-dialog-row", children: [
|
|
8908
|
+
color === "success" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
8767
8909
|
"svg",
|
|
8768
8910
|
{
|
|
8769
8911
|
width: "56",
|
|
@@ -8772,18 +8914,18 @@ function Alert(_a) {
|
|
|
8772
8914
|
fill: "none",
|
|
8773
8915
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8774
8916
|
children: [
|
|
8775
|
-
/* @__PURE__ */ (0,
|
|
8917
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { clipPath: "url(#clip0_1428_9995)", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8776
8918
|
"path",
|
|
8777
8919
|
{
|
|
8778
8920
|
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",
|
|
8779
8921
|
fill: "#1E8535"
|
|
8780
8922
|
}
|
|
8781
8923
|
) }),
|
|
8782
|
-
/* @__PURE__ */ (0,
|
|
8924
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("clipPath", { id: "clip0_1428_9995", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
8783
8925
|
]
|
|
8784
8926
|
}
|
|
8785
8927
|
),
|
|
8786
|
-
color === "error" && /* @__PURE__ */ (0,
|
|
8928
|
+
color === "error" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
8787
8929
|
"svg",
|
|
8788
8930
|
{
|
|
8789
8931
|
width: "56",
|
|
@@ -8792,18 +8934,18 @@ function Alert(_a) {
|
|
|
8792
8934
|
fill: "none",
|
|
8793
8935
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8794
8936
|
children: [
|
|
8795
|
-
/* @__PURE__ */ (0,
|
|
8937
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { clipPath: "url(#clip0_1428_10022)", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8796
8938
|
"path",
|
|
8797
8939
|
{
|
|
8798
8940
|
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",
|
|
8799
8941
|
fill: "#AD1F2B"
|
|
8800
8942
|
}
|
|
8801
8943
|
) }),
|
|
8802
|
-
/* @__PURE__ */ (0,
|
|
8944
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("clipPath", { id: "clip0_1428_10022", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
8803
8945
|
]
|
|
8804
8946
|
}
|
|
8805
8947
|
),
|
|
8806
|
-
color === "warning" && /* @__PURE__ */ (0,
|
|
8948
|
+
color === "warning" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
8807
8949
|
"svg",
|
|
8808
8950
|
{
|
|
8809
8951
|
width: "56",
|
|
@@ -8812,18 +8954,18 @@ function Alert(_a) {
|
|
|
8812
8954
|
fill: "none",
|
|
8813
8955
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8814
8956
|
children: [
|
|
8815
|
-
/* @__PURE__ */ (0,
|
|
8957
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { clipPath: "url(#clip0_1428_10038)", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8816
8958
|
"path",
|
|
8817
8959
|
{
|
|
8818
8960
|
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",
|
|
8819
8961
|
fill: "#CC9A06"
|
|
8820
8962
|
}
|
|
8821
8963
|
) }),
|
|
8822
|
-
/* @__PURE__ */ (0,
|
|
8964
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("clipPath", { id: "clip0_1428_10038", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { width: "56", height: "56", fill: "white" }) }) })
|
|
8823
8965
|
]
|
|
8824
8966
|
}
|
|
8825
8967
|
),
|
|
8826
|
-
color === "info" && /* @__PURE__ */ (0,
|
|
8968
|
+
color === "info" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
8827
8969
|
"svg",
|
|
8828
8970
|
{
|
|
8829
8971
|
width: "40",
|
|
@@ -8832,35 +8974,35 @@ function Alert(_a) {
|
|
|
8832
8974
|
fill: "none",
|
|
8833
8975
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8834
8976
|
children: [
|
|
8835
|
-
/* @__PURE__ */ (0,
|
|
8977
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { clipPath: "url(#clip0_1645_46)", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8836
8978
|
"path",
|
|
8837
8979
|
{
|
|
8838
8980
|
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",
|
|
8839
8981
|
fill: "#9FB6C7"
|
|
8840
8982
|
}
|
|
8841
8983
|
) }),
|
|
8842
|
-
/* @__PURE__ */ (0,
|
|
8984
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("clipPath", { id: "clip0_1645_46", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("rect", { width: "40", height: "40", fill: "white" }) }) })
|
|
8843
8985
|
]
|
|
8844
8986
|
}
|
|
8845
8987
|
),
|
|
8846
|
-
completAlert.title && /* @__PURE__ */ (0,
|
|
8847
|
-
/* @__PURE__ */ (0,
|
|
8848
|
-
completAlert.subtitle && /* @__PURE__ */ (0,
|
|
8988
|
+
completAlert.title && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AlertDialogTitleStyled, { children: completAlert.title }),
|
|
8989
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(AlertDialogDescriptionStyled, { children: [
|
|
8990
|
+
completAlert.subtitle && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8849
8991
|
Text,
|
|
8850
8992
|
{
|
|
8851
8993
|
css: {
|
|
8852
8994
|
fontSize: "$16"
|
|
8853
8995
|
},
|
|
8854
8996
|
asChild: true,
|
|
8855
|
-
children: /* @__PURE__ */ (0,
|
|
8997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { children: completAlert.subtitle })
|
|
8856
8998
|
}
|
|
8857
8999
|
),
|
|
8858
9000
|
completAlert.description
|
|
8859
9001
|
] })
|
|
8860
9002
|
] }),
|
|
8861
|
-
completAlert.onAction || completAlert.cancel ? /* @__PURE__ */ (0,
|
|
8862
|
-
/* @__PURE__ */ (0,
|
|
8863
|
-
completAlert.onAction && /* @__PURE__ */ (0,
|
|
9003
|
+
completAlert.onAction || completAlert.cancel ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AlertDialoghrStyled, {}) : null,
|
|
9004
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AlertDialogRowStyled, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Flex2, { gap: "10", justify: "end", width: "100%", children: [
|
|
9005
|
+
completAlert.onAction && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_themes13.AlertDialog.Action, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8864
9006
|
Button,
|
|
8865
9007
|
{
|
|
8866
9008
|
variant: "contained",
|
|
@@ -8868,7 +9010,7 @@ function Alert(_a) {
|
|
|
8868
9010
|
children: completAlert.actionText || "Salvar"
|
|
8869
9011
|
}
|
|
8870
9012
|
) }),
|
|
8871
|
-
completAlert.cancel && /* @__PURE__ */ (0,
|
|
9013
|
+
completAlert.cancel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_themes13.AlertDialog.Cancel, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "outlined", color: "neutral", children: completAlert.cancelText || "Cancelar" }) })
|
|
8872
9014
|
] }) })
|
|
8873
9015
|
] })
|
|
8874
9016
|
] }) })
|
|
@@ -8877,7 +9019,7 @@ function Alert(_a) {
|
|
|
8877
9019
|
|
|
8878
9020
|
// src/components/Switch.tsx
|
|
8879
9021
|
var import_themes14 = require("@radix-ui/themes");
|
|
8880
|
-
var
|
|
9022
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
8881
9023
|
var SwitchStyled = styled(import_themes14.Switch, {
|
|
8882
9024
|
all: "unset",
|
|
8883
9025
|
borderRadius: "$full",
|
|
@@ -8971,13 +9113,13 @@ var SwitchStyled = styled(import_themes14.Switch, {
|
|
|
8971
9113
|
}
|
|
8972
9114
|
});
|
|
8973
9115
|
function Switch(props) {
|
|
8974
|
-
return /* @__PURE__ */ (0,
|
|
9116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SwitchStyled, __spreadValues({ color: "brand", defaultChecked: true }, props));
|
|
8975
9117
|
}
|
|
8976
9118
|
|
|
8977
9119
|
// src/components/Step.tsx
|
|
8978
|
-
var
|
|
9120
|
+
var import_react12 = __toESM(require("react"));
|
|
8979
9121
|
var import_themes15 = require("@radix-ui/themes");
|
|
8980
|
-
var
|
|
9122
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
8981
9123
|
var StepStyled = styled("div", {
|
|
8982
9124
|
fontFamily: "$default",
|
|
8983
9125
|
color: "$gray100",
|
|
@@ -9050,7 +9192,7 @@ var StepListStyled = styled(import_themes15.Tabs.List, {
|
|
|
9050
9192
|
});
|
|
9051
9193
|
function Step(_a) {
|
|
9052
9194
|
var _b = _a, { children, defaultValue } = _b, props = __objRest(_b, ["children", "defaultValue"]);
|
|
9053
|
-
return /* @__PURE__ */ (0,
|
|
9195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_themes15.Tabs.Root, { defaultValue: String(defaultValue), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StepStyled, __spreadProps(__spreadValues({}, props), { children })) });
|
|
9054
9196
|
}
|
|
9055
9197
|
function StepTrigger(_a) {
|
|
9056
9198
|
var _b = _a, {
|
|
@@ -9063,7 +9205,7 @@ function StepTrigger(_a) {
|
|
|
9063
9205
|
"currentStep"
|
|
9064
9206
|
]);
|
|
9065
9207
|
const isActiveOrPrevious = currentStep !== void 0 && value <= currentStep;
|
|
9066
|
-
return /* @__PURE__ */ (0,
|
|
9208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
9067
9209
|
StepTriggerStyled,
|
|
9068
9210
|
__spreadProps(__spreadValues({
|
|
9069
9211
|
"data-filled": isActiveOrPrevious,
|
|
@@ -9081,7 +9223,7 @@ function StepContent(_a) {
|
|
|
9081
9223
|
"value",
|
|
9082
9224
|
"children"
|
|
9083
9225
|
]);
|
|
9084
|
-
return /* @__PURE__ */ (0,
|
|
9226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_themes15.Tabs.Content, __spreadProps(__spreadValues({ value: String(value) }, props), { children }));
|
|
9085
9227
|
}
|
|
9086
9228
|
function StepList(_a) {
|
|
9087
9229
|
var _b = _a, {
|
|
@@ -9091,9 +9233,9 @@ function StepList(_a) {
|
|
|
9091
9233
|
"children",
|
|
9092
9234
|
"currentStep"
|
|
9093
9235
|
]);
|
|
9094
|
-
return /* @__PURE__ */ (0,
|
|
9095
|
-
if (
|
|
9096
|
-
return
|
|
9236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children: import_react12.default.Children.map(children, (child) => {
|
|
9237
|
+
if (import_react12.default.isValidElement(child) && child.type === StepTrigger) {
|
|
9238
|
+
return import_react12.default.cloneElement(child, { currentStep });
|
|
9097
9239
|
}
|
|
9098
9240
|
return child;
|
|
9099
9241
|
}) }));
|
|
@@ -9104,12 +9246,12 @@ function StepWrapper(_a) {
|
|
|
9104
9246
|
} = _b, props = __objRest(_b, [
|
|
9105
9247
|
"children"
|
|
9106
9248
|
]);
|
|
9107
|
-
return /* @__PURE__ */ (0,
|
|
9249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_themes15.Box, __spreadProps(__spreadValues({}, props), { children }));
|
|
9108
9250
|
}
|
|
9109
9251
|
|
|
9110
9252
|
// src/components/Card.tsx
|
|
9111
9253
|
var import_themes16 = require("@radix-ui/themes");
|
|
9112
|
-
var
|
|
9254
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
9113
9255
|
var CardStyled = styled(import_themes16.Card, {
|
|
9114
9256
|
borderRadius: "$2xl",
|
|
9115
9257
|
border: "1px solid $dark100",
|
|
@@ -9159,7 +9301,7 @@ function Card(_a) {
|
|
|
9159
9301
|
"padding",
|
|
9160
9302
|
"radius"
|
|
9161
9303
|
]);
|
|
9162
|
-
return /* @__PURE__ */ (0,
|
|
9304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
9163
9305
|
CardStyled,
|
|
9164
9306
|
__spreadProps(__spreadValues({}, props), {
|
|
9165
9307
|
css: __spreadValues({ padding, borderRadius: radius }, props.css),
|
|
@@ -9170,8 +9312,8 @@ function Card(_a) {
|
|
|
9170
9312
|
|
|
9171
9313
|
// src/components/TextareaField.tsx
|
|
9172
9314
|
var import_themes17 = require("@radix-ui/themes");
|
|
9173
|
-
var
|
|
9174
|
-
var
|
|
9315
|
+
var import_react13 = __toESM(require("react"));
|
|
9316
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
9175
9317
|
var TextareaFieldStyle = styled(import_themes17.TextArea, {
|
|
9176
9318
|
display: "flex",
|
|
9177
9319
|
flex: 1,
|
|
@@ -9235,11 +9377,11 @@ var TextareaLimitIndicator = styled("div", {
|
|
|
9235
9377
|
padding: "$4"
|
|
9236
9378
|
}
|
|
9237
9379
|
});
|
|
9238
|
-
var TextareaField =
|
|
9239
|
-
var _b = _a, { maxLength, color } = _b, props = __objRest(_b, ["maxLength", "color"]);
|
|
9240
|
-
const inputRef = (0,
|
|
9241
|
-
const [remaining, setRemaining] = (0,
|
|
9242
|
-
(0,
|
|
9380
|
+
var TextareaField = import_react13.default.forwardRef((_a, forwardedRef) => {
|
|
9381
|
+
var _b = _a, { maxLength, color, simpleLayout = false } = _b, props = __objRest(_b, ["maxLength", "color", "simpleLayout"]);
|
|
9382
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
9383
|
+
const [remaining, setRemaining] = (0, import_react13.useState)(maxLength);
|
|
9384
|
+
(0, import_react13.useEffect)(() => {
|
|
9243
9385
|
var _a2;
|
|
9244
9386
|
if (maxLength && inputRef.current) {
|
|
9245
9387
|
setRemaining(maxLength - ((_a2 = inputRef.current.value.length) != null ? _a2 : 0));
|
|
@@ -9252,34 +9394,37 @@ var TextareaField = import_react12.default.forwardRef((_a, forwardedRef) => {
|
|
|
9252
9394
|
}
|
|
9253
9395
|
(_a2 = props.onInput) == null ? void 0 : _a2.call(props, e);
|
|
9254
9396
|
};
|
|
9255
|
-
return /* @__PURE__ */ (0,
|
|
9256
|
-
/* @__PURE__ */ (0,
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Flex2, { direction: "column", align: "end", style: { position: "relative" }, children: [
|
|
9398
|
+
maxLength && simpleLayout && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Badge, { size: "sm", color: "grey", style: { position: "absolute", right: 0, top: "-1.75rem" }, children: remaining }),
|
|
9399
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(TextareaContainer, { color, children: [
|
|
9400
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
9401
|
+
TextareaFieldStyle,
|
|
9402
|
+
__spreadValues({
|
|
9403
|
+
rows: 4,
|
|
9404
|
+
ref: (r) => {
|
|
9405
|
+
if (!r) return;
|
|
9406
|
+
inputRef.current = r;
|
|
9407
|
+
if (forwardedRef) {
|
|
9408
|
+
if (typeof forwardedRef === "function") forwardedRef(r);
|
|
9409
|
+
else forwardedRef.current = r;
|
|
9410
|
+
}
|
|
9411
|
+
},
|
|
9412
|
+
onInput: handleInput,
|
|
9413
|
+
maxLength
|
|
9414
|
+
}, props)
|
|
9415
|
+
),
|
|
9416
|
+
maxLength && !simpleLayout && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TextareaLimitIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { typography: "badgeMedium", children: remaining }) })
|
|
9417
|
+
] })
|
|
9273
9418
|
] });
|
|
9274
9419
|
});
|
|
9275
9420
|
|
|
9276
9421
|
// src/components/Toast/components/ToastItem.tsx
|
|
9277
|
-
var
|
|
9422
|
+
var import_react15 = require("react");
|
|
9278
9423
|
|
|
9279
9424
|
// src/components/Toast/styles/index.ts
|
|
9280
|
-
var
|
|
9425
|
+
var import_react14 = require("@stitches/react");
|
|
9281
9426
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
9282
|
-
var slideIn = (0,
|
|
9427
|
+
var slideIn = (0, import_react14.keyframes)({
|
|
9283
9428
|
from: {
|
|
9284
9429
|
transform: "translateX(calc(100% + 25px))",
|
|
9285
9430
|
opacity: 0
|
|
@@ -9289,7 +9434,7 @@ var slideIn = (0, import_react13.keyframes)({
|
|
|
9289
9434
|
opacity: 1
|
|
9290
9435
|
}
|
|
9291
9436
|
});
|
|
9292
|
-
var slideOut = (0,
|
|
9437
|
+
var slideOut = (0, import_react14.keyframes)({
|
|
9293
9438
|
from: {
|
|
9294
9439
|
transform: "translateX(0)",
|
|
9295
9440
|
opacity: 1
|
|
@@ -9299,7 +9444,7 @@ var slideOut = (0, import_react13.keyframes)({
|
|
|
9299
9444
|
opacity: 0
|
|
9300
9445
|
}
|
|
9301
9446
|
});
|
|
9302
|
-
var swipeOut = (0,
|
|
9447
|
+
var swipeOut = (0, import_react14.keyframes)({
|
|
9303
9448
|
from: {
|
|
9304
9449
|
transform: "translateX(var(--radix-toast-swipe-end-x))",
|
|
9305
9450
|
opacity: 1
|
|
@@ -9400,19 +9545,19 @@ var ToastClose = styled(ToastPrimitive.Close, {
|
|
|
9400
9545
|
});
|
|
9401
9546
|
|
|
9402
9547
|
// src/components/Toast/components/ToastItem.tsx
|
|
9403
|
-
var
|
|
9548
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
9404
9549
|
function ToastItem({
|
|
9405
9550
|
toast,
|
|
9406
9551
|
onRemove
|
|
9407
9552
|
}) {
|
|
9408
|
-
const [open, setOpen] = (0,
|
|
9553
|
+
const [open, setOpen] = (0, import_react15.useState)(true);
|
|
9409
9554
|
const handleOpenChange = (open2) => {
|
|
9410
9555
|
setOpen(open2);
|
|
9411
9556
|
if (!open2) {
|
|
9412
9557
|
onRemove(toast.id);
|
|
9413
9558
|
}
|
|
9414
9559
|
};
|
|
9415
|
-
return /* @__PURE__ */ (0,
|
|
9560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
9416
9561
|
ToastRoot,
|
|
9417
9562
|
{
|
|
9418
9563
|
type: toast.type,
|
|
@@ -9420,26 +9565,26 @@ function ToastItem({
|
|
|
9420
9565
|
open,
|
|
9421
9566
|
onOpenChange: handleOpenChange,
|
|
9422
9567
|
children: [
|
|
9423
|
-
(toast == null ? void 0 : toast.icon) && /* @__PURE__ */ (0,
|
|
9424
|
-
/* @__PURE__ */ (0,
|
|
9425
|
-
/* @__PURE__ */ (0,
|
|
9568
|
+
(toast == null ? void 0 : toast.icon) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon_default, { name: toast.icon, size: "xl" }),
|
|
9569
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text, { typography: "bodyS", fontWeight: "medium", children: toast.message }) }),
|
|
9570
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ToastClose, { "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon_default, { name: "xmark", size: "md" }) })
|
|
9426
9571
|
]
|
|
9427
9572
|
}
|
|
9428
9573
|
);
|
|
9429
9574
|
}
|
|
9430
9575
|
|
|
9431
9576
|
// src/components/Toast/components/ToastProvider.tsx
|
|
9432
|
-
var
|
|
9577
|
+
var import_react16 = require("react");
|
|
9433
9578
|
var ToastPrimitive2 = __toESM(require("@radix-ui/react-toast"));
|
|
9434
|
-
var
|
|
9435
|
-
var ToastContext = (0,
|
|
9579
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
9580
|
+
var ToastContext = (0, import_react16.createContext)(null);
|
|
9436
9581
|
function ToastProvider({
|
|
9437
9582
|
children,
|
|
9438
9583
|
defaultDuration = 5e3,
|
|
9439
9584
|
maxToasts = 5,
|
|
9440
9585
|
swipeDirection = "right"
|
|
9441
9586
|
}) {
|
|
9442
|
-
const [toasts, setToasts] = (0,
|
|
9587
|
+
const [toasts, setToasts] = (0, import_react16.useState)([]);
|
|
9443
9588
|
const addToast = (toastData) => {
|
|
9444
9589
|
const id = Math.random().toString(36).substr(2, 9);
|
|
9445
9590
|
const newToast = __spreadProps(__spreadValues({
|
|
@@ -9467,17 +9612,17 @@ function ToastProvider({
|
|
|
9467
9612
|
removeToast,
|
|
9468
9613
|
removeAllToasts
|
|
9469
9614
|
};
|
|
9470
|
-
return /* @__PURE__ */ (0,
|
|
9615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ToastContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(ToastPrimitive2.Provider, { swipeDirection, children: [
|
|
9471
9616
|
children,
|
|
9472
|
-
toasts.map((toast) => /* @__PURE__ */ (0,
|
|
9473
|
-
/* @__PURE__ */ (0,
|
|
9617
|
+
toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ToastItem, { toast, onRemove: removeToast }, toast.id)),
|
|
9618
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ToastViewport, {})
|
|
9474
9619
|
] }) });
|
|
9475
9620
|
}
|
|
9476
9621
|
|
|
9477
9622
|
// src/components/Toast/hooks/useToast.ts
|
|
9478
|
-
var
|
|
9623
|
+
var import_react17 = require("react");
|
|
9479
9624
|
var useToast = () => {
|
|
9480
|
-
const context = (0,
|
|
9625
|
+
const context = (0, import_react17.useContext)(ToastContext);
|
|
9481
9626
|
if (!context) {
|
|
9482
9627
|
throw new Error("useToast deve ser usado dentro de um ToastProvider");
|
|
9483
9628
|
}
|
|
@@ -9486,7 +9631,7 @@ var useToast = () => {
|
|
|
9486
9631
|
|
|
9487
9632
|
// src/components/Tooltip/index.tsx
|
|
9488
9633
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
9489
|
-
var
|
|
9634
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9490
9635
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
9491
9636
|
var TooltipRoot = TooltipPrimitive.Root;
|
|
9492
9637
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
@@ -9525,21 +9670,21 @@ function Tooltip({
|
|
|
9525
9670
|
delayDuration = 200,
|
|
9526
9671
|
side = "top"
|
|
9527
9672
|
}) {
|
|
9528
|
-
return /* @__PURE__ */ (0,
|
|
9529
|
-
/* @__PURE__ */ (0,
|
|
9530
|
-
/* @__PURE__ */ (0,
|
|
9531
|
-
typeof content === "string" ? /* @__PURE__ */ (0,
|
|
9532
|
-
/* @__PURE__ */ (0,
|
|
9673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TooltipRoot, { delayDuration, children: [
|
|
9674
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children }),
|
|
9675
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TooltipContent, { side, sideOffset: 5, children: [
|
|
9676
|
+
typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "tooltip", children: content }) : content,
|
|
9677
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipArrow, {})
|
|
9533
9678
|
] })
|
|
9534
9679
|
] }) });
|
|
9535
9680
|
}
|
|
9536
9681
|
|
|
9537
9682
|
// src/components/MultiSelect/index.tsx
|
|
9538
|
-
var
|
|
9683
|
+
var import_react18 = __toESM(require("react"));
|
|
9539
9684
|
var import_themes19 = require("@radix-ui/themes");
|
|
9540
9685
|
var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
|
|
9541
9686
|
var import_free_solid_svg_icons3 = require("@fortawesome/free-solid-svg-icons");
|
|
9542
|
-
var
|
|
9687
|
+
var import_react19 = require("react");
|
|
9543
9688
|
|
|
9544
9689
|
// src/components/MultiSelect/styledComponents.ts
|
|
9545
9690
|
var import_themes18 = require("@radix-ui/themes");
|
|
@@ -9688,8 +9833,8 @@ var ButtonSelectAllStyled = styled("button", {
|
|
|
9688
9833
|
});
|
|
9689
9834
|
|
|
9690
9835
|
// src/components/MultiSelect/index.tsx
|
|
9691
|
-
var
|
|
9692
|
-
var MultiSelect =
|
|
9836
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
9837
|
+
var MultiSelect = import_react18.default.forwardRef(
|
|
9693
9838
|
({
|
|
9694
9839
|
placeholder,
|
|
9695
9840
|
value: selectedValues = [],
|
|
@@ -9707,24 +9852,24 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9707
9852
|
selectedAllText,
|
|
9708
9853
|
selectedScroll = false
|
|
9709
9854
|
}, fowardedRef) => {
|
|
9710
|
-
const [isOpen, setIsOpen] = (0,
|
|
9711
|
-
const triggerRef = (0,
|
|
9712
|
-
const [allOptionsSelected, setAllOptionsSelected] = (0,
|
|
9713
|
-
const labelByValue = (0,
|
|
9855
|
+
const [isOpen, setIsOpen] = (0, import_react18.useState)(false);
|
|
9856
|
+
const triggerRef = (0, import_react18.useRef)(null);
|
|
9857
|
+
const [allOptionsSelected, setAllOptionsSelected] = (0, import_react18.useState)(false);
|
|
9858
|
+
const labelByValue = (0, import_react19.useMemo)(() => {
|
|
9714
9859
|
return options.reduce((prev, curr) => {
|
|
9715
9860
|
return __spreadProps(__spreadValues({}, prev), {
|
|
9716
9861
|
[curr.value]: curr.label
|
|
9717
9862
|
});
|
|
9718
9863
|
}, {});
|
|
9719
9864
|
}, [options]);
|
|
9720
|
-
const handleRemove = (0,
|
|
9865
|
+
const handleRemove = (0, import_react18.useCallback)(
|
|
9721
9866
|
(value) => {
|
|
9722
9867
|
const newValue = selectedValues.filter((v) => v !== value);
|
|
9723
9868
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
9724
9869
|
},
|
|
9725
9870
|
[selectedValues, onValueChange]
|
|
9726
9871
|
);
|
|
9727
|
-
const handleSelectAll = (0,
|
|
9872
|
+
const handleSelectAll = (0, import_react18.useCallback)(
|
|
9728
9873
|
(e) => {
|
|
9729
9874
|
e.preventDefault();
|
|
9730
9875
|
e.stopPropagation();
|
|
@@ -9739,7 +9884,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9739
9884
|
},
|
|
9740
9885
|
[selectedValues, options, onValueChange]
|
|
9741
9886
|
);
|
|
9742
|
-
const text = (0,
|
|
9887
|
+
const text = (0, import_react19.useMemo)(() => {
|
|
9743
9888
|
if (selectedValues.length > 0 && singleSelect) {
|
|
9744
9889
|
const value = selectedValues[0];
|
|
9745
9890
|
return labelByValue[value];
|
|
@@ -9750,7 +9895,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9750
9895
|
onValueChange == null ? void 0 : onValueChange([v]);
|
|
9751
9896
|
setIsOpen(false);
|
|
9752
9897
|
};
|
|
9753
|
-
const handleToggle = (0,
|
|
9898
|
+
const handleToggle = (0, import_react18.useCallback)(
|
|
9754
9899
|
(e) => {
|
|
9755
9900
|
e.preventDefault();
|
|
9756
9901
|
e.stopPropagation();
|
|
@@ -9759,9 +9904,9 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9759
9904
|
},
|
|
9760
9905
|
[disabled]
|
|
9761
9906
|
);
|
|
9762
|
-
return /* @__PURE__ */ (0,
|
|
9763
|
-
/* @__PURE__ */ (0,
|
|
9764
|
-
/* @__PURE__ */ (0,
|
|
9907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_themes19.Theme, { style: width !== "100%" ? { width } : void 0, children: [
|
|
9908
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_themes19.DropdownMenu.Root, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
9909
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_themes19.DropdownMenu.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
9765
9910
|
StyledTrigger,
|
|
9766
9911
|
{
|
|
9767
9912
|
ref: (r) => {
|
|
@@ -9777,7 +9922,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9777
9922
|
style: width !== "100%" ? { width } : void 0,
|
|
9778
9923
|
onClick: handleToggle,
|
|
9779
9924
|
children: [
|
|
9780
|
-
/* @__PURE__ */ (0,
|
|
9925
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9781
9926
|
StyledText,
|
|
9782
9927
|
{
|
|
9783
9928
|
typography: "labelMedium",
|
|
@@ -9785,7 +9930,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9785
9930
|
children: text
|
|
9786
9931
|
}
|
|
9787
9932
|
),
|
|
9788
|
-
/* @__PURE__ */ (0,
|
|
9933
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9789
9934
|
import_react_fontawesome3.FontAwesomeIcon,
|
|
9790
9935
|
{
|
|
9791
9936
|
icon: isOpen ? import_free_solid_svg_icons3.faChevronUp : import_free_solid_svg_icons3.faChevronDown,
|
|
@@ -9796,14 +9941,14 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9796
9941
|
]
|
|
9797
9942
|
}
|
|
9798
9943
|
) }),
|
|
9799
|
-
/* @__PURE__ */ (0,
|
|
9944
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9800
9945
|
StyledContent,
|
|
9801
9946
|
{
|
|
9802
9947
|
css: {
|
|
9803
9948
|
width: "100%",
|
|
9804
9949
|
zIndex: zIndex === "auto" ? 999999 : zIndex
|
|
9805
9950
|
},
|
|
9806
|
-
children: !singleSelect ? /* @__PURE__ */ (0,
|
|
9951
|
+
children: !singleSelect ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9807
9952
|
CheckboxGroup,
|
|
9808
9953
|
{
|
|
9809
9954
|
value: selectedValues,
|
|
@@ -9813,7 +9958,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9813
9958
|
setAllOptionsSelected(false);
|
|
9814
9959
|
}
|
|
9815
9960
|
},
|
|
9816
|
-
children: /* @__PURE__ */ (0,
|
|
9961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
9817
9962
|
StyledFlexWithMaxHeight,
|
|
9818
9963
|
{
|
|
9819
9964
|
direction: "column",
|
|
@@ -9821,7 +9966,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9821
9966
|
hasMaxHeight: !!maxHeight,
|
|
9822
9967
|
style: maxHeight ? { maxHeight } : void 0,
|
|
9823
9968
|
children: [
|
|
9824
|
-
selectedAllOptions && /* @__PURE__ */ (0,
|
|
9969
|
+
selectedAllOptions && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
9825
9970
|
ButtonSelectAllStyled,
|
|
9826
9971
|
{
|
|
9827
9972
|
css: itemStyle,
|
|
@@ -9830,30 +9975,30 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9830
9975
|
},
|
|
9831
9976
|
type: "button",
|
|
9832
9977
|
children: [
|
|
9833
|
-
/* @__PURE__ */ (0,
|
|
9834
|
-
/* @__PURE__ */ (0,
|
|
9978
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: allOptionsSelected ? "checked" : "" }),
|
|
9979
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { typography: "labelSmall", children: selectedAllText ? selectedAllText : "Selecionar Todos" })
|
|
9835
9980
|
]
|
|
9836
9981
|
}
|
|
9837
9982
|
),
|
|
9838
|
-
options.map(({ value, label }, i) => /* @__PURE__ */ (0,
|
|
9983
|
+
options.map(({ value, label }, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { typography: "labelSmall", children: label }) }, i))
|
|
9839
9984
|
]
|
|
9840
9985
|
}
|
|
9841
9986
|
)
|
|
9842
9987
|
}
|
|
9843
|
-
) : /* @__PURE__ */ (0,
|
|
9988
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9844
9989
|
StyledFlexWithMaxHeight,
|
|
9845
9990
|
{
|
|
9846
9991
|
direction: "column",
|
|
9847
9992
|
gap: 8,
|
|
9848
9993
|
hasMaxHeight: !!maxHeight,
|
|
9849
9994
|
style: maxHeight ? { maxHeight } : void 0,
|
|
9850
|
-
children: options.map(({ value, label }, i) => /* @__PURE__ */ (0,
|
|
9995
|
+
children: options.map(({ value, label }, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(StyledItem2, { onClick: () => handleItemClick(value), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { typography: "labelSmall", children: label }) }, i))
|
|
9851
9996
|
}
|
|
9852
9997
|
)
|
|
9853
9998
|
}
|
|
9854
9999
|
)
|
|
9855
10000
|
] }),
|
|
9856
|
-
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */ (0,
|
|
10001
|
+
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9857
10002
|
StyledFlexSelectedItems,
|
|
9858
10003
|
{
|
|
9859
10004
|
direction: selectedOrientation,
|
|
@@ -9861,14 +10006,14 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9861
10006
|
align: selectedOrientation === "column" ? "start" : "center",
|
|
9862
10007
|
justify: "start",
|
|
9863
10008
|
css: __spreadValues({}, selectedScroll && { maxHeight: maxHeight || "400px" }),
|
|
9864
|
-
children: selectedValues.map((value) => /* @__PURE__ */ (0,
|
|
10009
|
+
children: selectedValues.map((value) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
9865
10010
|
Flex2,
|
|
9866
10011
|
{
|
|
9867
10012
|
gap: 4,
|
|
9868
10013
|
align: "center",
|
|
9869
10014
|
css: { flexWrap: "wrap" },
|
|
9870
10015
|
children: [
|
|
9871
|
-
/* @__PURE__ */ (0,
|
|
10016
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9872
10017
|
CloseBtnStyled,
|
|
9873
10018
|
{
|
|
9874
10019
|
onClick: (e) => {
|
|
@@ -9876,10 +10021,10 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9876
10021
|
handleRemove(value);
|
|
9877
10022
|
},
|
|
9878
10023
|
type: "button",
|
|
9879
|
-
children: /* @__PURE__ */ (0,
|
|
10024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons3.faSquareXmark, size: "sm" })
|
|
9880
10025
|
}
|
|
9881
10026
|
),
|
|
9882
|
-
/* @__PURE__ */ (0,
|
|
10027
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9883
10028
|
Text,
|
|
9884
10029
|
{
|
|
9885
10030
|
typography: "captionMedium",
|
|
@@ -9907,7 +10052,7 @@ var Divider = styled("div", {
|
|
|
9907
10052
|
|
|
9908
10053
|
// src/components/Grid.tsx
|
|
9909
10054
|
var import_themes20 = require("@radix-ui/themes");
|
|
9910
|
-
var
|
|
10055
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
9911
10056
|
var GridStyled = styled(import_themes20.Grid, {
|
|
9912
10057
|
display: "grid",
|
|
9913
10058
|
variants: {
|
|
@@ -10029,12 +10174,12 @@ var GridStyled = styled(import_themes20.Grid, {
|
|
|
10029
10174
|
});
|
|
10030
10175
|
function Grid(_a) {
|
|
10031
10176
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
10032
|
-
return /* @__PURE__ */ (0,
|
|
10177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
10033
10178
|
}
|
|
10034
10179
|
|
|
10035
10180
|
// src/components/Container.tsx
|
|
10036
10181
|
var import_themes21 = require("@radix-ui/themes");
|
|
10037
|
-
var
|
|
10182
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10038
10183
|
var ContainerStyled = styled(import_themes21.Container, {
|
|
10039
10184
|
variants: {
|
|
10040
10185
|
size: {
|
|
@@ -10064,12 +10209,12 @@ var ContainerStyled = styled(import_themes21.Container, {
|
|
|
10064
10209
|
});
|
|
10065
10210
|
function Container(_a) {
|
|
10066
10211
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
10067
|
-
return /* @__PURE__ */ (0,
|
|
10212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ContainerStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
10068
10213
|
}
|
|
10069
10214
|
|
|
10070
10215
|
// src/components/Section.tsx
|
|
10071
10216
|
var import_themes22 = require("@radix-ui/themes");
|
|
10072
|
-
var
|
|
10217
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10073
10218
|
var SectionStyled = styled(import_themes22.Section, {
|
|
10074
10219
|
variants: {
|
|
10075
10220
|
size: {
|
|
@@ -10093,26 +10238,26 @@ var SectionStyled = styled(import_themes22.Section, {
|
|
|
10093
10238
|
});
|
|
10094
10239
|
function Section(_a) {
|
|
10095
10240
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
10096
|
-
return /* @__PURE__ */ (0,
|
|
10241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SectionStyled, __spreadProps(__spreadValues({}, props), { children }));
|
|
10097
10242
|
}
|
|
10098
10243
|
|
|
10099
10244
|
// src/components/FormFields/subComponents/ErrorFormMessage.tsx
|
|
10100
10245
|
var import_free_solid_svg_icons4 = require("@fortawesome/free-solid-svg-icons");
|
|
10101
10246
|
var import_react_fontawesome4 = require("@fortawesome/react-fontawesome");
|
|
10102
|
-
var
|
|
10247
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10103
10248
|
var ErrorFormMessage = ({ message: message2 }) => {
|
|
10104
10249
|
if (!message2) return null;
|
|
10105
10250
|
if (typeof message2 !== "string") {
|
|
10106
10251
|
return null;
|
|
10107
10252
|
}
|
|
10108
|
-
return /* @__PURE__ */ (0,
|
|
10109
|
-
/* @__PURE__ */ (0,
|
|
10110
|
-
/* @__PURE__ */ (0,
|
|
10253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Flex2, { justify: "start", align: "center", gap: 6, children: [
|
|
10254
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_fontawesome4.FontAwesomeIcon, { icon: import_free_solid_svg_icons4.faXmarkCircle, color: colors.error600, size: "1x" }),
|
|
10255
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { typography: "bodyXS", fontWeight: "medium", color: "error600", children: message2 })
|
|
10111
10256
|
] });
|
|
10112
10257
|
};
|
|
10113
10258
|
|
|
10114
10259
|
// src/components/FormFields/subComponents/FormLabel.tsx
|
|
10115
|
-
var
|
|
10260
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
10116
10261
|
var FormLabel = ({
|
|
10117
10262
|
name,
|
|
10118
10263
|
label,
|
|
@@ -10120,7 +10265,7 @@ var FormLabel = ({
|
|
|
10120
10265
|
required
|
|
10121
10266
|
}) => {
|
|
10122
10267
|
if (!label) return null;
|
|
10123
|
-
return /* @__PURE__ */ (0,
|
|
10268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
10124
10269
|
Text,
|
|
10125
10270
|
{
|
|
10126
10271
|
typography: "labelMedium",
|
|
@@ -10129,7 +10274,7 @@ var FormLabel = ({
|
|
|
10129
10274
|
id: `${name}-label`,
|
|
10130
10275
|
children: [
|
|
10131
10276
|
label,
|
|
10132
|
-
!required && /* @__PURE__ */ (0,
|
|
10277
|
+
!required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { color: "dark500", children: " (opcional)" })
|
|
10133
10278
|
]
|
|
10134
10279
|
}
|
|
10135
10280
|
);
|
|
@@ -10137,7 +10282,7 @@ var FormLabel = ({
|
|
|
10137
10282
|
|
|
10138
10283
|
// src/components/FormFields/TextAreaFormField.tsx
|
|
10139
10284
|
var import_react_hook_form = require("react-hook-form");
|
|
10140
|
-
var
|
|
10285
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
10141
10286
|
var TextAreaFormField = (_a) => {
|
|
10142
10287
|
var _b = _a, {
|
|
10143
10288
|
name,
|
|
@@ -10145,14 +10290,16 @@ var TextAreaFormField = (_a) => {
|
|
|
10145
10290
|
required,
|
|
10146
10291
|
placeholder,
|
|
10147
10292
|
validate,
|
|
10148
|
-
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio."
|
|
10293
|
+
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
10294
|
+
simpleLayout = false
|
|
10149
10295
|
} = _b, props = __objRest(_b, [
|
|
10150
10296
|
"name",
|
|
10151
10297
|
"label",
|
|
10152
10298
|
"required",
|
|
10153
10299
|
"placeholder",
|
|
10154
10300
|
"validate",
|
|
10155
|
-
"validationErrorMessage"
|
|
10301
|
+
"validationErrorMessage",
|
|
10302
|
+
"simpleLayout"
|
|
10156
10303
|
]);
|
|
10157
10304
|
var _a2;
|
|
10158
10305
|
const {
|
|
@@ -10165,8 +10312,8 @@ var TextAreaFormField = (_a) => {
|
|
|
10165
10312
|
required: required ? validationErrorMessage : false,
|
|
10166
10313
|
validate
|
|
10167
10314
|
};
|
|
10168
|
-
return /* @__PURE__ */ (0,
|
|
10169
|
-
/* @__PURE__ */ (0,
|
|
10315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Flex2, { direction: "column", children: [
|
|
10316
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10170
10317
|
FormLabel,
|
|
10171
10318
|
{
|
|
10172
10319
|
name,
|
|
@@ -10175,23 +10322,24 @@ var TextAreaFormField = (_a) => {
|
|
|
10175
10322
|
haveError
|
|
10176
10323
|
}
|
|
10177
10324
|
),
|
|
10178
|
-
/* @__PURE__ */ (0,
|
|
10325
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10179
10326
|
TextareaField,
|
|
10180
10327
|
__spreadProps(__spreadValues(__spreadValues({}, props), register(name, validationRules)), {
|
|
10181
10328
|
placeholder,
|
|
10182
10329
|
color: haveError ? "error" : "default",
|
|
10330
|
+
simpleLayout,
|
|
10183
10331
|
"aria-labelledby": `${name}-label`
|
|
10184
10332
|
})
|
|
10185
10333
|
),
|
|
10186
|
-
/* @__PURE__ */ (0,
|
|
10334
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
10187
10335
|
] });
|
|
10188
10336
|
};
|
|
10189
10337
|
|
|
10190
10338
|
// src/components/FormFields/TextFormField.tsx
|
|
10191
10339
|
var import_react_hook_form2 = require("react-hook-form");
|
|
10192
|
-
var
|
|
10340
|
+
var import_react20 = require("react");
|
|
10193
10341
|
var import_mask2 = require("@react-input/mask");
|
|
10194
|
-
var
|
|
10342
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
10195
10343
|
var TextFormField = (_a) => {
|
|
10196
10344
|
var _b = _a, {
|
|
10197
10345
|
name,
|
|
@@ -10212,7 +10360,7 @@ var TextFormField = (_a) => {
|
|
|
10212
10360
|
"onChange",
|
|
10213
10361
|
"valueFormatter"
|
|
10214
10362
|
]);
|
|
10215
|
-
const handleValidate = (0,
|
|
10363
|
+
const handleValidate = (0, import_react20.useCallback)(
|
|
10216
10364
|
(value) => {
|
|
10217
10365
|
var _a2;
|
|
10218
10366
|
if (value === void 0 || value === null || !required && value.trim() === "")
|
|
@@ -10234,7 +10382,7 @@ var TextFormField = (_a) => {
|
|
|
10234
10382
|
const haveError = !!fieldError;
|
|
10235
10383
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
10236
10384
|
const { value: formValue, onChange: formChange } = field;
|
|
10237
|
-
const formattedValue = (0,
|
|
10385
|
+
const formattedValue = (0, import_react20.useMemo)(() => {
|
|
10238
10386
|
let value = formValue;
|
|
10239
10387
|
if (valueFormatter) value = valueFormatter.format(value);
|
|
10240
10388
|
if (mask) value = (0, import_mask2.format)(value != null ? value : "", mask);
|
|
@@ -10246,8 +10394,8 @@ var TextFormField = (_a) => {
|
|
|
10246
10394
|
if (valueFormatter) value = valueFormatter.unformat(value);
|
|
10247
10395
|
formChange(value);
|
|
10248
10396
|
};
|
|
10249
|
-
return /* @__PURE__ */ (0,
|
|
10250
|
-
label && /* @__PURE__ */ (0,
|
|
10397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex2, { direction: "column", children: [
|
|
10398
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10251
10399
|
FormLabel,
|
|
10252
10400
|
{
|
|
10253
10401
|
name,
|
|
@@ -10256,7 +10404,7 @@ var TextFormField = (_a) => {
|
|
|
10256
10404
|
haveError
|
|
10257
10405
|
}
|
|
10258
10406
|
),
|
|
10259
|
-
/* @__PURE__ */ (0,
|
|
10407
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10260
10408
|
TextField,
|
|
10261
10409
|
__spreadProps(__spreadValues(__spreadValues({
|
|
10262
10410
|
mask,
|
|
@@ -10267,13 +10415,13 @@ var TextFormField = (_a) => {
|
|
|
10267
10415
|
value: formattedValue
|
|
10268
10416
|
})
|
|
10269
10417
|
),
|
|
10270
|
-
/* @__PURE__ */ (0,
|
|
10418
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
10271
10419
|
] });
|
|
10272
10420
|
};
|
|
10273
10421
|
|
|
10274
10422
|
// src/components/FormFields/Form.tsx
|
|
10275
10423
|
var import_react_hook_form3 = require("react-hook-form");
|
|
10276
|
-
var
|
|
10424
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
10277
10425
|
var Form = (_a) => {
|
|
10278
10426
|
var _b = _a, {
|
|
10279
10427
|
onSubmit,
|
|
@@ -10285,7 +10433,7 @@ var Form = (_a) => {
|
|
|
10285
10433
|
const formMethods = (0, import_react_hook_form3.useForm)(__spreadValues({
|
|
10286
10434
|
mode: "onTouched"
|
|
10287
10435
|
}, props));
|
|
10288
|
-
return /* @__PURE__ */ (0,
|
|
10436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_hook_form3.FormProvider, __spreadProps(__spreadValues({}, formMethods), { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("form", { onSubmit: formMethods.handleSubmit(onSubmit), children: (() => {
|
|
10289
10437
|
if (typeof children === "function") {
|
|
10290
10438
|
return children(formMethods);
|
|
10291
10439
|
}
|
|
@@ -10295,7 +10443,7 @@ var Form = (_a) => {
|
|
|
10295
10443
|
|
|
10296
10444
|
// src/components/FormFields/MultiSelectFormField.tsx
|
|
10297
10445
|
var import_react_hook_form4 = require("react-hook-form");
|
|
10298
|
-
var
|
|
10446
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
10299
10447
|
var MultiSelectFormField = (_a) => {
|
|
10300
10448
|
var _b = _a, {
|
|
10301
10449
|
name,
|
|
@@ -10326,8 +10474,8 @@ var MultiSelectFormField = (_a) => {
|
|
|
10326
10474
|
const handleChange = (v) => {
|
|
10327
10475
|
onChange(v);
|
|
10328
10476
|
};
|
|
10329
|
-
return /* @__PURE__ */ (0,
|
|
10330
|
-
/* @__PURE__ */ (0,
|
|
10477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Flex2, { direction: "column", children: [
|
|
10478
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10331
10479
|
FormLabel,
|
|
10332
10480
|
{
|
|
10333
10481
|
name,
|
|
@@ -10336,7 +10484,7 @@ var MultiSelectFormField = (_a) => {
|
|
|
10336
10484
|
haveError
|
|
10337
10485
|
}
|
|
10338
10486
|
),
|
|
10339
|
-
/* @__PURE__ */ (0,
|
|
10487
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10340
10488
|
MultiSelect,
|
|
10341
10489
|
__spreadValues({
|
|
10342
10490
|
value,
|
|
@@ -10348,7 +10496,7 @@ var MultiSelectFormField = (_a) => {
|
|
|
10348
10496
|
maxHeight
|
|
10349
10497
|
}, rest)
|
|
10350
10498
|
),
|
|
10351
|
-
/* @__PURE__ */ (0,
|
|
10499
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
10352
10500
|
] });
|
|
10353
10501
|
};
|
|
10354
10502
|
|
|
@@ -10366,13 +10514,13 @@ var minMaxLength = (min, max, errorMsg) => (value) => {
|
|
|
10366
10514
|
};
|
|
10367
10515
|
|
|
10368
10516
|
// src/components/FormFields/PhoneFormField.tsx
|
|
10369
|
-
var
|
|
10517
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10370
10518
|
var PhoneFormField = ({
|
|
10371
10519
|
name,
|
|
10372
10520
|
label,
|
|
10373
10521
|
required
|
|
10374
10522
|
}) => {
|
|
10375
|
-
return /* @__PURE__ */ (0,
|
|
10523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10376
10524
|
TextFormField,
|
|
10377
10525
|
{
|
|
10378
10526
|
name,
|
|
@@ -10402,7 +10550,7 @@ var PhoneFormField = ({
|
|
|
10402
10550
|
|
|
10403
10551
|
// src/components/FormFields/CPFFormField.tsx
|
|
10404
10552
|
var import_react_hook_form5 = require("react-hook-form");
|
|
10405
|
-
var
|
|
10553
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
10406
10554
|
var isValidCPF = (cpf) => {
|
|
10407
10555
|
cpf = cpf.replace(/[^\d]+/g, "");
|
|
10408
10556
|
if (cpf.length !== 11 || /^(\d)\1{10}$/.test(cpf)) return false;
|
|
@@ -10428,8 +10576,8 @@ var CPFFormField = ({
|
|
|
10428
10576
|
}) => {
|
|
10429
10577
|
const { control, setValue } = (0, import_react_hook_form5.useFormContext)();
|
|
10430
10578
|
const foreigner = (0, import_react_hook_form5.useWatch)({ name: "foreigner", control });
|
|
10431
|
-
return /* @__PURE__ */ (0,
|
|
10432
|
-
/* @__PURE__ */ (0,
|
|
10579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Flex2, { direction: "column", children: [
|
|
10580
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10433
10581
|
TextFormField,
|
|
10434
10582
|
{
|
|
10435
10583
|
name,
|
|
@@ -10447,7 +10595,7 @@ var CPFFormField = ({
|
|
|
10447
10595
|
disabled: foreigner
|
|
10448
10596
|
}
|
|
10449
10597
|
),
|
|
10450
|
-
/* @__PURE__ */ (0,
|
|
10598
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10451
10599
|
CheckboxGroup,
|
|
10452
10600
|
{
|
|
10453
10601
|
value: foreigner ? ["true"] : [],
|
|
@@ -10459,14 +10607,14 @@ var CPFFormField = ({
|
|
|
10459
10607
|
setValue(name, "");
|
|
10460
10608
|
}
|
|
10461
10609
|
},
|
|
10462
|
-
children: /* @__PURE__ */ (0,
|
|
10610
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CheckboxItem, { value: "true", children: foreignerLabel })
|
|
10463
10611
|
}
|
|
10464
10612
|
)
|
|
10465
10613
|
] });
|
|
10466
10614
|
};
|
|
10467
10615
|
|
|
10468
10616
|
// src/components/FormFields/CNPJFormField.tsx
|
|
10469
|
-
var
|
|
10617
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10470
10618
|
var matchesNonDigit = new RegExp(/\D+/g);
|
|
10471
10619
|
var getWeights = (size, start, end) => {
|
|
10472
10620
|
const weights = [];
|
|
@@ -10515,7 +10663,7 @@ var CNPJFormField = ({
|
|
|
10515
10663
|
placeholder,
|
|
10516
10664
|
validationErrorMessage
|
|
10517
10665
|
}) => {
|
|
10518
|
-
return /* @__PURE__ */ (0,
|
|
10666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10519
10667
|
TextFormField,
|
|
10520
10668
|
{
|
|
10521
10669
|
name,
|
|
@@ -10536,7 +10684,7 @@ var CNPJFormField = ({
|
|
|
10536
10684
|
};
|
|
10537
10685
|
|
|
10538
10686
|
// src/components/FormFields/BirthDateFormField.tsx
|
|
10539
|
-
var
|
|
10687
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
10540
10688
|
var isValidDate = (day, month, year) => {
|
|
10541
10689
|
const date = new Date(year, month - 1, day);
|
|
10542
10690
|
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day;
|
|
@@ -10573,7 +10721,7 @@ var BirthDateFormField = ({
|
|
|
10573
10721
|
language
|
|
10574
10722
|
}) => {
|
|
10575
10723
|
const inputPlaceholder = placeholder || (language === "pt-BR" ? "DD/MM/AAAA" : "MM/DD/YYYY");
|
|
10576
|
-
return /* @__PURE__ */ (0,
|
|
10724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10577
10725
|
TextFormField,
|
|
10578
10726
|
{
|
|
10579
10727
|
name,
|
|
@@ -10594,7 +10742,7 @@ var BirthDateFormField = ({
|
|
|
10594
10742
|
};
|
|
10595
10743
|
|
|
10596
10744
|
// src/components/FormFields/IdentityDocumentNumberFormField.tsx
|
|
10597
|
-
var
|
|
10745
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
10598
10746
|
var IdentityDocumentNumberFormField = ({
|
|
10599
10747
|
name,
|
|
10600
10748
|
label,
|
|
@@ -10602,7 +10750,7 @@ var IdentityDocumentNumberFormField = ({
|
|
|
10602
10750
|
placeholder,
|
|
10603
10751
|
validationErrorMessage
|
|
10604
10752
|
}) => {
|
|
10605
|
-
return /* @__PURE__ */ (0,
|
|
10753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
10606
10754
|
TextFormField,
|
|
10607
10755
|
{
|
|
10608
10756
|
name,
|
|
@@ -10631,7 +10779,7 @@ function getNestedValue(obj, path) {
|
|
|
10631
10779
|
}
|
|
10632
10780
|
|
|
10633
10781
|
// src/components/FormFields/SelectFormField.tsx
|
|
10634
|
-
var
|
|
10782
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
10635
10783
|
var SelectFormField = ({
|
|
10636
10784
|
name,
|
|
10637
10785
|
label,
|
|
@@ -10652,8 +10800,8 @@ var SelectFormField = ({
|
|
|
10652
10800
|
const validationRules = __spreadValues({
|
|
10653
10801
|
required: required ? validationErrorMessage : false
|
|
10654
10802
|
}, validation);
|
|
10655
|
-
return /* @__PURE__ */ (0,
|
|
10656
|
-
/* @__PURE__ */ (0,
|
|
10803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Flex2, { direction: "column", children: [
|
|
10804
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10657
10805
|
FormLabel,
|
|
10658
10806
|
{
|
|
10659
10807
|
name,
|
|
@@ -10662,7 +10810,7 @@ var SelectFormField = ({
|
|
|
10662
10810
|
haveError
|
|
10663
10811
|
}
|
|
10664
10812
|
),
|
|
10665
|
-
/* @__PURE__ */ (0,
|
|
10813
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10666
10814
|
import_react_hook_form6.Controller,
|
|
10667
10815
|
{
|
|
10668
10816
|
control,
|
|
@@ -10671,14 +10819,14 @@ var SelectFormField = ({
|
|
|
10671
10819
|
defaultValue: defaultValue || "",
|
|
10672
10820
|
render: ({ field: { value, onChange } }) => {
|
|
10673
10821
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
10674
|
-
return /* @__PURE__ */ (0,
|
|
10822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10675
10823
|
DropdownMenu2,
|
|
10676
10824
|
{
|
|
10677
10825
|
placeholder: (selectedOption == null ? void 0 : selectedOption.label) || placeholder,
|
|
10678
10826
|
fontWeight: "regular",
|
|
10679
10827
|
typography: "labelLarge",
|
|
10680
10828
|
color: haveError ? "error" : "default",
|
|
10681
|
-
children: options.map((option, index) => /* @__PURE__ */ (0,
|
|
10829
|
+
children: options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10682
10830
|
DropdownMenuItem,
|
|
10683
10831
|
{
|
|
10684
10832
|
value: option.value,
|
|
@@ -10694,7 +10842,7 @@ var SelectFormField = ({
|
|
|
10694
10842
|
}
|
|
10695
10843
|
}
|
|
10696
10844
|
),
|
|
10697
|
-
/* @__PURE__ */ (0,
|
|
10845
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
10698
10846
|
] });
|
|
10699
10847
|
};
|
|
10700
10848
|
|
|
@@ -10727,7 +10875,7 @@ function useCountries(language = "pt-BR") {
|
|
|
10727
10875
|
}
|
|
10728
10876
|
|
|
10729
10877
|
// src/components/FormFields/AddressFormFields/CountryFormField.tsx
|
|
10730
|
-
var
|
|
10878
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
10731
10879
|
function CountryFormField({
|
|
10732
10880
|
name,
|
|
10733
10881
|
label,
|
|
@@ -10735,7 +10883,7 @@ function CountryFormField({
|
|
|
10735
10883
|
language = "pt-BR"
|
|
10736
10884
|
}) {
|
|
10737
10885
|
const countries2 = useCountries(language);
|
|
10738
|
-
return /* @__PURE__ */ (0,
|
|
10886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Flex2, { direction: "column", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10739
10887
|
SelectFormField,
|
|
10740
10888
|
{
|
|
10741
10889
|
label,
|
|
@@ -10748,7 +10896,7 @@ function CountryFormField({
|
|
|
10748
10896
|
}
|
|
10749
10897
|
|
|
10750
10898
|
// src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx
|
|
10751
|
-
var
|
|
10899
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
10752
10900
|
var PostalCodeFormField = ({
|
|
10753
10901
|
name,
|
|
10754
10902
|
label,
|
|
@@ -10757,7 +10905,7 @@ var PostalCodeFormField = ({
|
|
|
10757
10905
|
validationErrorMessage,
|
|
10758
10906
|
onChange
|
|
10759
10907
|
}) => {
|
|
10760
|
-
return /* @__PURE__ */ (0,
|
|
10908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10761
10909
|
TextFormField,
|
|
10762
10910
|
{
|
|
10763
10911
|
name,
|
|
@@ -10810,14 +10958,14 @@ var brazilianStates = [
|
|
|
10810
10958
|
];
|
|
10811
10959
|
|
|
10812
10960
|
// src/components/FormFields/AddressFormFields/StateFormField.tsx
|
|
10813
|
-
var
|
|
10961
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
10814
10962
|
function StateFormField({
|
|
10815
10963
|
name,
|
|
10816
10964
|
label,
|
|
10817
10965
|
required,
|
|
10818
10966
|
isBrazil
|
|
10819
10967
|
}) {
|
|
10820
|
-
return /* @__PURE__ */ (0,
|
|
10968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: isBrazil ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
10821
10969
|
SelectFormField,
|
|
10822
10970
|
{
|
|
10823
10971
|
name,
|
|
@@ -10825,13 +10973,13 @@ function StateFormField({
|
|
|
10825
10973
|
required,
|
|
10826
10974
|
label
|
|
10827
10975
|
}
|
|
10828
|
-
) : /* @__PURE__ */ (0,
|
|
10976
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TextFormField, { name, required, label }) });
|
|
10829
10977
|
}
|
|
10830
10978
|
|
|
10831
10979
|
// src/components/FormFields/AddressFormFields/CityFormField.tsx
|
|
10832
|
-
var
|
|
10980
|
+
var import_react21 = require("react");
|
|
10833
10981
|
var import_react_hook_form7 = require("react-hook-form");
|
|
10834
|
-
var
|
|
10982
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
10835
10983
|
function CityFormField({
|
|
10836
10984
|
name,
|
|
10837
10985
|
label,
|
|
@@ -10842,9 +10990,9 @@ function CityFormField({
|
|
|
10842
10990
|
}) {
|
|
10843
10991
|
const { control, watch } = (0, import_react_hook_form7.useFormContext)();
|
|
10844
10992
|
const selectedState = watch(stateName);
|
|
10845
|
-
const [cities, setCities] = (0,
|
|
10846
|
-
const [loading, setLoading] = (0,
|
|
10847
|
-
(0,
|
|
10993
|
+
const [cities, setCities] = (0, import_react21.useState)([]);
|
|
10994
|
+
const [loading, setLoading] = (0, import_react21.useState)(false);
|
|
10995
|
+
(0, import_react21.useEffect)(() => {
|
|
10848
10996
|
if (!isBrazil) {
|
|
10849
10997
|
setCities([]);
|
|
10850
10998
|
return;
|
|
@@ -10883,13 +11031,13 @@ function CityFormField({
|
|
|
10883
11031
|
}
|
|
10884
11032
|
fetchCities();
|
|
10885
11033
|
}, [selectedState, isBrazil]);
|
|
10886
|
-
return /* @__PURE__ */ (0,
|
|
11034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: isBrazil && cities.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10887
11035
|
import_react_hook_form7.Controller,
|
|
10888
11036
|
{
|
|
10889
11037
|
name,
|
|
10890
11038
|
control,
|
|
10891
11039
|
rules: { required },
|
|
10892
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
11040
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10893
11041
|
SelectFormField,
|
|
10894
11042
|
__spreadProps(__spreadValues({
|
|
10895
11043
|
label,
|
|
@@ -10903,7 +11051,7 @@ function CityFormField({
|
|
|
10903
11051
|
})
|
|
10904
11052
|
)
|
|
10905
11053
|
}
|
|
10906
|
-
) : /* @__PURE__ */ (0,
|
|
11054
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10907
11055
|
TextFormField,
|
|
10908
11056
|
{
|
|
10909
11057
|
name,
|
|
@@ -10915,7 +11063,7 @@ function CityFormField({
|
|
|
10915
11063
|
}
|
|
10916
11064
|
|
|
10917
11065
|
// src/components/FormFields/AddressFormFields/index.tsx
|
|
10918
|
-
var
|
|
11066
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
10919
11067
|
function getNestedValue2(obj, path) {
|
|
10920
11068
|
return path.split(".").reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
|
|
10921
11069
|
}
|
|
@@ -10965,8 +11113,8 @@ function AddressFormFields({
|
|
|
10965
11113
|
console.error("Erro ao buscar CEP");
|
|
10966
11114
|
});
|
|
10967
11115
|
};
|
|
10968
|
-
return /* @__PURE__ */ (0,
|
|
10969
|
-
/* @__PURE__ */ (0,
|
|
11116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AddressContainerStyled, { layout, children: [
|
|
11117
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
10970
11118
|
FormLabel,
|
|
10971
11119
|
{
|
|
10972
11120
|
name,
|
|
@@ -10975,7 +11123,7 @@ function AddressFormFields({
|
|
|
10975
11123
|
haveError
|
|
10976
11124
|
}
|
|
10977
11125
|
),
|
|
10978
|
-
/* @__PURE__ */ (0,
|
|
11126
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
10979
11127
|
CountryFormField,
|
|
10980
11128
|
{
|
|
10981
11129
|
name: `${name}.country`,
|
|
@@ -10984,7 +11132,7 @@ function AddressFormFields({
|
|
|
10984
11132
|
language: "pt-BR"
|
|
10985
11133
|
}
|
|
10986
11134
|
),
|
|
10987
|
-
isBrazil ? /* @__PURE__ */ (0,
|
|
11135
|
+
isBrazil ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
10988
11136
|
PostalCodeFormField,
|
|
10989
11137
|
{
|
|
10990
11138
|
name: `${name}.zip_code`,
|
|
@@ -10994,7 +11142,7 @@ function AddressFormFields({
|
|
|
10994
11142
|
validationErrorMessage: "CEP inv\xE1lido",
|
|
10995
11143
|
onChange: handleCEPChange
|
|
10996
11144
|
}
|
|
10997
|
-
) : /* @__PURE__ */ (0,
|
|
11145
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
10998
11146
|
TextFormField,
|
|
10999
11147
|
{
|
|
11000
11148
|
name: `${name}.zip_code`,
|
|
@@ -11002,7 +11150,7 @@ function AddressFormFields({
|
|
|
11002
11150
|
required
|
|
11003
11151
|
}
|
|
11004
11152
|
),
|
|
11005
|
-
/* @__PURE__ */ (0,
|
|
11153
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11006
11154
|
StateFormField,
|
|
11007
11155
|
{
|
|
11008
11156
|
name: `${name}.state`,
|
|
@@ -11011,7 +11159,7 @@ function AddressFormFields({
|
|
|
11011
11159
|
isBrazil
|
|
11012
11160
|
}
|
|
11013
11161
|
),
|
|
11014
|
-
/* @__PURE__ */ (0,
|
|
11162
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11015
11163
|
CityFormField,
|
|
11016
11164
|
{
|
|
11017
11165
|
name: `${name}.city`,
|
|
@@ -11021,8 +11169,8 @@ function AddressFormFields({
|
|
|
11021
11169
|
isBrazil
|
|
11022
11170
|
}
|
|
11023
11171
|
),
|
|
11024
|
-
/* @__PURE__ */ (0,
|
|
11025
|
-
/* @__PURE__ */ (0,
|
|
11172
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextFormField, { name: `${name}.street`, label: "Rua", required }),
|
|
11173
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11026
11174
|
TextFormField,
|
|
11027
11175
|
{
|
|
11028
11176
|
name: `${name}.number`,
|
|
@@ -11030,7 +11178,7 @@ function AddressFormFields({
|
|
|
11030
11178
|
required
|
|
11031
11179
|
}
|
|
11032
11180
|
),
|
|
11033
|
-
/* @__PURE__ */ (0,
|
|
11181
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11034
11182
|
TextFormField,
|
|
11035
11183
|
{
|
|
11036
11184
|
name: `${name}.neighborhood`,
|
|
@@ -11038,13 +11186,13 @@ function AddressFormFields({
|
|
|
11038
11186
|
required
|
|
11039
11187
|
}
|
|
11040
11188
|
),
|
|
11041
|
-
/* @__PURE__ */ (0,
|
|
11189
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextFormField, { name: `${name}.complement`, label: "Complemento" })
|
|
11042
11190
|
] });
|
|
11043
11191
|
}
|
|
11044
11192
|
|
|
11045
11193
|
// src/components/FormFields/RadioGroupFormField.tsx
|
|
11046
11194
|
var import_react_hook_form9 = require("react-hook-form");
|
|
11047
|
-
var
|
|
11195
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
11048
11196
|
var RadioGroupFormField = ({
|
|
11049
11197
|
name,
|
|
11050
11198
|
label,
|
|
@@ -11066,8 +11214,8 @@ var RadioGroupFormField = ({
|
|
|
11066
11214
|
const validationRules = {
|
|
11067
11215
|
required: required ? validationErrorMessage : false
|
|
11068
11216
|
};
|
|
11069
|
-
return /* @__PURE__ */ (0,
|
|
11070
|
-
/* @__PURE__ */ (0,
|
|
11217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Flex2, { direction: "column", children: [
|
|
11218
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11071
11219
|
FormLabel,
|
|
11072
11220
|
{
|
|
11073
11221
|
name,
|
|
@@ -11076,14 +11224,14 @@ var RadioGroupFormField = ({
|
|
|
11076
11224
|
haveError
|
|
11077
11225
|
}
|
|
11078
11226
|
),
|
|
11079
|
-
/* @__PURE__ */ (0,
|
|
11227
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11080
11228
|
import_react_hook_form9.Controller,
|
|
11081
11229
|
{
|
|
11082
11230
|
name,
|
|
11083
11231
|
control,
|
|
11084
11232
|
defaultValue: defaultValue || "",
|
|
11085
11233
|
rules: validationRules,
|
|
11086
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0,
|
|
11234
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11087
11235
|
RadioGroup,
|
|
11088
11236
|
{
|
|
11089
11237
|
value,
|
|
@@ -11091,21 +11239,21 @@ var RadioGroupFormField = ({
|
|
|
11091
11239
|
color: haveError ? "error" : color,
|
|
11092
11240
|
fontWeight,
|
|
11093
11241
|
disabled,
|
|
11094
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
11095
|
-
/* @__PURE__ */ (0,
|
|
11242
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("label", { children: [
|
|
11243
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RadioItem, { value: option.value }),
|
|
11096
11244
|
option.label
|
|
11097
11245
|
] }, option.value))
|
|
11098
11246
|
}
|
|
11099
11247
|
)
|
|
11100
11248
|
}
|
|
11101
11249
|
),
|
|
11102
|
-
/* @__PURE__ */ (0,
|
|
11250
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
11103
11251
|
] });
|
|
11104
11252
|
};
|
|
11105
11253
|
|
|
11106
11254
|
// src/components/FormFields/CheckboxGroupFormField.tsx
|
|
11107
11255
|
var import_react_hook_form10 = require("react-hook-form");
|
|
11108
|
-
var
|
|
11256
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
11109
11257
|
var CheckboxGroupFormField = ({
|
|
11110
11258
|
name,
|
|
11111
11259
|
label,
|
|
@@ -11128,8 +11276,8 @@ var CheckboxGroupFormField = ({
|
|
|
11128
11276
|
required: required ? validationErrorMessage : false,
|
|
11129
11277
|
validate: required ? (value) => (value == null ? void 0 : value.length) > 0 || validationErrorMessage : void 0
|
|
11130
11278
|
};
|
|
11131
|
-
return /* @__PURE__ */ (0,
|
|
11132
|
-
/* @__PURE__ */ (0,
|
|
11279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Flex2, { direction: "column", children: [
|
|
11280
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11133
11281
|
FormLabel,
|
|
11134
11282
|
{
|
|
11135
11283
|
name,
|
|
@@ -11138,14 +11286,14 @@ var CheckboxGroupFormField = ({
|
|
|
11138
11286
|
haveError
|
|
11139
11287
|
}
|
|
11140
11288
|
),
|
|
11141
|
-
/* @__PURE__ */ (0,
|
|
11289
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11142
11290
|
import_react_hook_form10.Controller,
|
|
11143
11291
|
{
|
|
11144
11292
|
name,
|
|
11145
11293
|
control,
|
|
11146
11294
|
rules: validationRules,
|
|
11147
11295
|
defaultValue,
|
|
11148
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
11296
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11149
11297
|
CheckboxGroup,
|
|
11150
11298
|
{
|
|
11151
11299
|
name,
|
|
@@ -11154,7 +11302,7 @@ var CheckboxGroupFormField = ({
|
|
|
11154
11302
|
color: haveError ? "error" : color,
|
|
11155
11303
|
fontWeight,
|
|
11156
11304
|
disabled,
|
|
11157
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
11305
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
11158
11306
|
CheckboxItem,
|
|
11159
11307
|
{
|
|
11160
11308
|
value: option.value,
|
|
@@ -11167,13 +11315,13 @@ var CheckboxGroupFormField = ({
|
|
|
11167
11315
|
)
|
|
11168
11316
|
}
|
|
11169
11317
|
),
|
|
11170
|
-
/* @__PURE__ */ (0,
|
|
11318
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
11171
11319
|
] });
|
|
11172
11320
|
};
|
|
11173
11321
|
|
|
11174
11322
|
// src/components/FormFields/SwitchFormField.tsx
|
|
11175
11323
|
var import_react_hook_form11 = require("react-hook-form");
|
|
11176
|
-
var
|
|
11324
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
11177
11325
|
var SwitchFormField = ({
|
|
11178
11326
|
name,
|
|
11179
11327
|
label,
|
|
@@ -11187,15 +11335,15 @@ var SwitchFormField = ({
|
|
|
11187
11335
|
if (watch) {
|
|
11188
11336
|
watchForm(name);
|
|
11189
11337
|
}
|
|
11190
|
-
return /* @__PURE__ */ (0,
|
|
11191
|
-
/* @__PURE__ */ (0,
|
|
11192
|
-
/* @__PURE__ */ (0,
|
|
11338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Flex2, { justify: "between", style: { margin: "1rem 0" }, children: [
|
|
11339
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text, { typography: "labelMedium", fontWeight: "regular", children: label }),
|
|
11340
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11193
11341
|
import_react_hook_form11.Controller,
|
|
11194
11342
|
{
|
|
11195
11343
|
control,
|
|
11196
11344
|
name,
|
|
11197
11345
|
defaultValue,
|
|
11198
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
11346
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
11199
11347
|
Switch,
|
|
11200
11348
|
{
|
|
11201
11349
|
checked: field.value,
|
|
@@ -11208,14 +11356,14 @@ var SwitchFormField = ({
|
|
|
11208
11356
|
};
|
|
11209
11357
|
|
|
11210
11358
|
// src/components/FormFields/EmailFormField.tsx
|
|
11211
|
-
var
|
|
11359
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
11212
11360
|
var EmailFormField = ({
|
|
11213
11361
|
name,
|
|
11214
11362
|
label,
|
|
11215
11363
|
required,
|
|
11216
11364
|
placeholder
|
|
11217
11365
|
}) => {
|
|
11218
|
-
return /* @__PURE__ */ (0,
|
|
11366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
11219
11367
|
TextFormField,
|
|
11220
11368
|
{
|
|
11221
11369
|
name,
|
|
@@ -11232,10 +11380,10 @@ var EmailFormField = ({
|
|
|
11232
11380
|
var import_react_hook_form12 = require("react-hook-form");
|
|
11233
11381
|
|
|
11234
11382
|
// src/components/RichEditor/RichEditor.tsx
|
|
11235
|
-
var
|
|
11383
|
+
var import_react23 = require("react");
|
|
11236
11384
|
|
|
11237
11385
|
// src/components/RichEditor/QuillComponent.tsx
|
|
11238
|
-
var
|
|
11386
|
+
var import_react22 = require("react");
|
|
11239
11387
|
var import_react_quilljs = require("react-quilljs");
|
|
11240
11388
|
|
|
11241
11389
|
// src/utils/uploadService.ts
|
|
@@ -12291,7 +12439,7 @@ var QuillEditor = styled("div", {
|
|
|
12291
12439
|
});
|
|
12292
12440
|
|
|
12293
12441
|
// src/components/RichEditor/QuillComponent.tsx
|
|
12294
|
-
var
|
|
12442
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12295
12443
|
var QuillComponent = ({
|
|
12296
12444
|
value = "",
|
|
12297
12445
|
onChange,
|
|
@@ -12304,12 +12452,12 @@ var QuillComponent = ({
|
|
|
12304
12452
|
onCharacterCountChange,
|
|
12305
12453
|
maxLength
|
|
12306
12454
|
}) => {
|
|
12307
|
-
const [showVideoModal, setShowVideoModal] = (0,
|
|
12308
|
-
const [videoUrl, setVideoUrl] = (0,
|
|
12309
|
-
const [showLinkModal, setShowLinkModal] = (0,
|
|
12310
|
-
const [linkUrl, setLinkUrl] = (0,
|
|
12311
|
-
const videoModalRef = (0,
|
|
12312
|
-
const linkModalRef = (0,
|
|
12455
|
+
const [showVideoModal, setShowVideoModal] = (0, import_react22.useState)(false);
|
|
12456
|
+
const [videoUrl, setVideoUrl] = (0, import_react22.useState)("");
|
|
12457
|
+
const [showLinkModal, setShowLinkModal] = (0, import_react22.useState)(false);
|
|
12458
|
+
const [linkUrl, setLinkUrl] = (0, import_react22.useState)("");
|
|
12459
|
+
const videoModalRef = (0, import_react22.useRef)(null);
|
|
12460
|
+
const linkModalRef = (0, import_react22.useRef)(null);
|
|
12313
12461
|
const { addToast, removeToast } = useToast();
|
|
12314
12462
|
const formatHTML = (html) => {
|
|
12315
12463
|
const parser = new DOMParser();
|
|
@@ -12373,7 +12521,7 @@ var QuillComponent = ({
|
|
|
12373
12521
|
placeholder,
|
|
12374
12522
|
readOnly: disabled
|
|
12375
12523
|
});
|
|
12376
|
-
const handleImageUpload = (0,
|
|
12524
|
+
const handleImageUpload = (0, import_react22.useCallback)(
|
|
12377
12525
|
(file) => __async(null, null, function* () {
|
|
12378
12526
|
if (disabled || !quill || !uploadConfig) return;
|
|
12379
12527
|
try {
|
|
@@ -12405,7 +12553,7 @@ var QuillComponent = ({
|
|
|
12405
12553
|
}),
|
|
12406
12554
|
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
12407
12555
|
);
|
|
12408
|
-
(0,
|
|
12556
|
+
(0, import_react22.useEffect)(() => {
|
|
12409
12557
|
if (quill && value) {
|
|
12410
12558
|
const currentContent = quill.root.innerHTML;
|
|
12411
12559
|
if (currentContent !== value) {
|
|
@@ -12419,7 +12567,7 @@ var QuillComponent = ({
|
|
|
12419
12567
|
}
|
|
12420
12568
|
}
|
|
12421
12569
|
}, [quill, value]);
|
|
12422
|
-
(0,
|
|
12570
|
+
(0, import_react22.useEffect)(() => {
|
|
12423
12571
|
if (quill) {
|
|
12424
12572
|
quill.on("text-change", (delta, oldDelta, source) => {
|
|
12425
12573
|
if (source === "user") {
|
|
@@ -12474,7 +12622,7 @@ var QuillComponent = ({
|
|
|
12474
12622
|
}, 2e3);
|
|
12475
12623
|
}
|
|
12476
12624
|
}, [quill, onChange, handleImageUpload, onCharacterCountChange]);
|
|
12477
|
-
(0,
|
|
12625
|
+
(0, import_react22.useEffect)(() => {
|
|
12478
12626
|
if (quill) {
|
|
12479
12627
|
quill.enable(!disabled);
|
|
12480
12628
|
if (!disabled) {
|
|
@@ -12485,11 +12633,11 @@ var QuillComponent = ({
|
|
|
12485
12633
|
}
|
|
12486
12634
|
}
|
|
12487
12635
|
}, [quill, disabled]);
|
|
12488
|
-
const handleLinkCancel = (0,
|
|
12636
|
+
const handleLinkCancel = (0, import_react22.useCallback)(() => {
|
|
12489
12637
|
setLinkUrl("");
|
|
12490
12638
|
setShowLinkModal(false);
|
|
12491
12639
|
}, []);
|
|
12492
|
-
const handleLinkSubmit = (0,
|
|
12640
|
+
const handleLinkSubmit = (0, import_react22.useCallback)(() => {
|
|
12493
12641
|
if (!linkUrl.trim() || !quill) return;
|
|
12494
12642
|
const url = linkUrl.trim();
|
|
12495
12643
|
const selection = quill.getSelection();
|
|
@@ -12504,11 +12652,11 @@ var QuillComponent = ({
|
|
|
12504
12652
|
setLinkUrl("");
|
|
12505
12653
|
setShowLinkModal(false);
|
|
12506
12654
|
}, [linkUrl, quill]);
|
|
12507
|
-
const handleVideoCancel = (0,
|
|
12655
|
+
const handleVideoCancel = (0, import_react22.useCallback)(() => {
|
|
12508
12656
|
setVideoUrl("");
|
|
12509
12657
|
setShowVideoModal(false);
|
|
12510
12658
|
}, []);
|
|
12511
|
-
const handleVideoSubmit = (0,
|
|
12659
|
+
const handleVideoSubmit = (0, import_react22.useCallback)(() => {
|
|
12512
12660
|
var _a, _b;
|
|
12513
12661
|
if (!videoUrl.trim() || !quill) return;
|
|
12514
12662
|
let processedUrl = videoUrl.trim();
|
|
@@ -12541,7 +12689,7 @@ var QuillComponent = ({
|
|
|
12541
12689
|
setVideoUrl("");
|
|
12542
12690
|
setShowVideoModal(false);
|
|
12543
12691
|
}, [videoUrl, quill]);
|
|
12544
|
-
(0,
|
|
12692
|
+
(0, import_react22.useEffect)(() => {
|
|
12545
12693
|
const handleClickOutside = (event) => {
|
|
12546
12694
|
if (showVideoModal && videoModalRef.current && !videoModalRef.current.contains(event.target)) {
|
|
12547
12695
|
handleVideoCancel();
|
|
@@ -12553,9 +12701,9 @@ var QuillComponent = ({
|
|
|
12553
12701
|
document.addEventListener("mousedown", handleClickOutside);
|
|
12554
12702
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
12555
12703
|
}, [showVideoModal, showLinkModal, handleVideoCancel, handleLinkCancel]);
|
|
12556
|
-
return /* @__PURE__ */ (0,
|
|
12557
|
-
/* @__PURE__ */ (0,
|
|
12558
|
-
showVideoModal && /* @__PURE__ */ (0,
|
|
12704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(QuillContainer, { className, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(QuillEditor, { style: { position: "relative" }, children: [
|
|
12705
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { ref: quillRef }),
|
|
12706
|
+
showVideoModal && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12559
12707
|
"div",
|
|
12560
12708
|
{
|
|
12561
12709
|
ref: videoModalRef,
|
|
@@ -12572,15 +12720,15 @@ var QuillComponent = ({
|
|
|
12572
12720
|
zIndex: 1e3,
|
|
12573
12721
|
width: "fit-content"
|
|
12574
12722
|
},
|
|
12575
|
-
children: /* @__PURE__ */ (0,
|
|
12576
|
-
/* @__PURE__ */ (0,
|
|
12723
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Flex2, { gap: 8, align: "center", children: [
|
|
12724
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12577
12725
|
Text,
|
|
12578
12726
|
{
|
|
12579
12727
|
style: { fontSize: "14px", fontWeight: "500", color: "#333" },
|
|
12580
12728
|
children: "V\xEDdeo:"
|
|
12581
12729
|
}
|
|
12582
12730
|
),
|
|
12583
|
-
/* @__PURE__ */ (0,
|
|
12731
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12584
12732
|
"input",
|
|
12585
12733
|
{
|
|
12586
12734
|
type: "text",
|
|
@@ -12604,7 +12752,7 @@ var QuillComponent = ({
|
|
|
12604
12752
|
autoFocus: true
|
|
12605
12753
|
}
|
|
12606
12754
|
),
|
|
12607
|
-
/* @__PURE__ */ (0,
|
|
12755
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12608
12756
|
"button",
|
|
12609
12757
|
{
|
|
12610
12758
|
onClick: handleVideoSubmit,
|
|
@@ -12625,7 +12773,7 @@ var QuillComponent = ({
|
|
|
12625
12773
|
] })
|
|
12626
12774
|
}
|
|
12627
12775
|
),
|
|
12628
|
-
showLinkModal && /* @__PURE__ */ (0,
|
|
12776
|
+
showLinkModal && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12629
12777
|
"div",
|
|
12630
12778
|
{
|
|
12631
12779
|
ref: linkModalRef,
|
|
@@ -12642,15 +12790,15 @@ var QuillComponent = ({
|
|
|
12642
12790
|
zIndex: 1e3,
|
|
12643
12791
|
width: "fit-content"
|
|
12644
12792
|
},
|
|
12645
|
-
children: /* @__PURE__ */ (0,
|
|
12646
|
-
/* @__PURE__ */ (0,
|
|
12793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Flex2, { gap: 8, align: "center", children: [
|
|
12794
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12647
12795
|
Text,
|
|
12648
12796
|
{
|
|
12649
12797
|
style: { fontSize: "14px", fontWeight: "500", color: "#333" },
|
|
12650
12798
|
children: "Link:"
|
|
12651
12799
|
}
|
|
12652
12800
|
),
|
|
12653
|
-
/* @__PURE__ */ (0,
|
|
12801
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12654
12802
|
"input",
|
|
12655
12803
|
{
|
|
12656
12804
|
type: "text",
|
|
@@ -12675,7 +12823,7 @@ var QuillComponent = ({
|
|
|
12675
12823
|
autoFocus: true
|
|
12676
12824
|
}
|
|
12677
12825
|
),
|
|
12678
|
-
/* @__PURE__ */ (0,
|
|
12826
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12679
12827
|
"button",
|
|
12680
12828
|
{
|
|
12681
12829
|
onClick: handleLinkSubmit,
|
|
@@ -12701,20 +12849,20 @@ var QuillComponent = ({
|
|
|
12701
12849
|
var QuillComponent_default = QuillComponent;
|
|
12702
12850
|
|
|
12703
12851
|
// src/components/RichEditor/RichEditor.tsx
|
|
12704
|
-
var
|
|
12852
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12705
12853
|
var RichEditor = (props) => {
|
|
12706
|
-
const [isClient, setIsClient] = (0,
|
|
12707
|
-
(0,
|
|
12854
|
+
const [isClient, setIsClient] = (0, import_react23.useState)(false);
|
|
12855
|
+
(0, import_react23.useEffect)(() => {
|
|
12708
12856
|
setIsClient(typeof window !== "undefined");
|
|
12709
12857
|
}, []);
|
|
12710
12858
|
if (!isClient) return null;
|
|
12711
|
-
return /* @__PURE__ */ (0,
|
|
12859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ToastProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(QuillComponent_default, __spreadValues({}, props)) }) });
|
|
12712
12860
|
};
|
|
12713
12861
|
var RichEditor_default = RichEditor;
|
|
12714
12862
|
|
|
12715
12863
|
// src/components/FormFields/RichEditorFormField.tsx
|
|
12716
|
-
var
|
|
12717
|
-
var
|
|
12864
|
+
var import_react24 = require("react");
|
|
12865
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12718
12866
|
var RichEditorFormField = (_a) => {
|
|
12719
12867
|
var _b = _a, {
|
|
12720
12868
|
name,
|
|
@@ -12748,7 +12896,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12748
12896
|
},
|
|
12749
12897
|
defaultValue: ""
|
|
12750
12898
|
});
|
|
12751
|
-
const [caracterQuantity, setCaracterQuantity] = (0,
|
|
12899
|
+
const [caracterQuantity, setCaracterQuantity] = (0, import_react24.useState)(maxLength);
|
|
12752
12900
|
const handleCharacterCountChange = (count) => {
|
|
12753
12901
|
if (maxLength !== void 0) {
|
|
12754
12902
|
setCaracterQuantity(Math.max(0, maxLength - count));
|
|
@@ -12757,9 +12905,9 @@ var RichEditorFormField = (_a) => {
|
|
|
12757
12905
|
const fieldError = fieldState.error;
|
|
12758
12906
|
const haveError = !!fieldError;
|
|
12759
12907
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
12760
|
-
return /* @__PURE__ */ (0,
|
|
12761
|
-
maxLength ? /* @__PURE__ */ (0,
|
|
12762
|
-
label && /* @__PURE__ */ (0,
|
|
12908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Flex2, { direction: "column", children: [
|
|
12909
|
+
maxLength ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Flex2, { direction: "row", justify: "between", children: [
|
|
12910
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12763
12911
|
FormLabel,
|
|
12764
12912
|
{
|
|
12765
12913
|
name,
|
|
@@ -12768,8 +12916,8 @@ var RichEditorFormField = (_a) => {
|
|
|
12768
12916
|
haveError
|
|
12769
12917
|
}
|
|
12770
12918
|
),
|
|
12771
|
-
/* @__PURE__ */ (0,
|
|
12772
|
-
] }) : /* @__PURE__ */ (0,
|
|
12919
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Badge, { color: "grey", size: "xs", children: caracterQuantity })
|
|
12920
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_jsx_runtime54.Fragment, { children: label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12773
12921
|
FormLabel,
|
|
12774
12922
|
{
|
|
12775
12923
|
name,
|
|
@@ -12778,7 +12926,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12778
12926
|
haveError
|
|
12779
12927
|
}
|
|
12780
12928
|
) }),
|
|
12781
|
-
/* @__PURE__ */ (0,
|
|
12929
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12782
12930
|
RichEditor_default,
|
|
12783
12931
|
__spreadProps(__spreadValues({}, props), {
|
|
12784
12932
|
value: field.value,
|
|
@@ -12790,14 +12938,14 @@ var RichEditorFormField = (_a) => {
|
|
|
12790
12938
|
simpleVersion
|
|
12791
12939
|
})
|
|
12792
12940
|
),
|
|
12793
|
-
/* @__PURE__ */ (0,
|
|
12941
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
12794
12942
|
] });
|
|
12795
12943
|
};
|
|
12796
12944
|
|
|
12797
12945
|
// src/components/FormFields/CalendarFormField.tsx
|
|
12798
12946
|
var import_react_hook_form13 = require("react-hook-form");
|
|
12799
|
-
var
|
|
12800
|
-
var
|
|
12947
|
+
var import_react25 = require("react");
|
|
12948
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12801
12949
|
var CalendarFormField = (_a) => {
|
|
12802
12950
|
var _b = _a, {
|
|
12803
12951
|
name,
|
|
@@ -12820,7 +12968,7 @@ var CalendarFormField = (_a) => {
|
|
|
12820
12968
|
"allowPastDates",
|
|
12821
12969
|
"maxYearsFromNow"
|
|
12822
12970
|
]);
|
|
12823
|
-
const handleValidate = (0,
|
|
12971
|
+
const handleValidate = (0, import_react25.useCallback)(
|
|
12824
12972
|
(value) => {
|
|
12825
12973
|
var _a2;
|
|
12826
12974
|
if (value === void 0 || value === null) {
|
|
@@ -12846,8 +12994,8 @@ var CalendarFormField = (_a) => {
|
|
|
12846
12994
|
const handleCalendarChange = (date) => {
|
|
12847
12995
|
setSelected(date);
|
|
12848
12996
|
};
|
|
12849
|
-
return /* @__PURE__ */ (0,
|
|
12850
|
-
label && /* @__PURE__ */ (0,
|
|
12997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
|
|
12998
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12851
12999
|
FormLabel,
|
|
12852
13000
|
{
|
|
12853
13001
|
name,
|
|
@@ -12856,7 +13004,7 @@ var CalendarFormField = (_a) => {
|
|
|
12856
13004
|
haveError
|
|
12857
13005
|
}
|
|
12858
13006
|
),
|
|
12859
|
-
/* @__PURE__ */ (0,
|
|
13007
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12860
13008
|
Calendar,
|
|
12861
13009
|
__spreadValues({
|
|
12862
13010
|
selected,
|
|
@@ -12869,14 +13017,83 @@ var CalendarFormField = (_a) => {
|
|
|
12869
13017
|
maxYearsFromNow
|
|
12870
13018
|
}, calendarProps)
|
|
12871
13019
|
),
|
|
12872
|
-
/* @__PURE__ */ (0,
|
|
13020
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
12873
13021
|
] });
|
|
12874
13022
|
};
|
|
12875
13023
|
|
|
12876
|
-
// src/components/FormFields/
|
|
13024
|
+
// src/components/FormFields/DoubleCalendarFormField.tsx
|
|
13025
|
+
var import_react26 = require("react");
|
|
12877
13026
|
var import_react_hook_form14 = require("react-hook-form");
|
|
12878
|
-
var
|
|
12879
|
-
var
|
|
13027
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
13028
|
+
var DoubleCalendarFormField = (_a) => {
|
|
13029
|
+
var _b = _a, {
|
|
13030
|
+
name,
|
|
13031
|
+
label,
|
|
13032
|
+
required,
|
|
13033
|
+
validate,
|
|
13034
|
+
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
13035
|
+
rules,
|
|
13036
|
+
allowPastDates,
|
|
13037
|
+
maxYearsFromNow = 20
|
|
13038
|
+
} = _b, calendarProps = __objRest(_b, [
|
|
13039
|
+
"name",
|
|
13040
|
+
"label",
|
|
13041
|
+
"required",
|
|
13042
|
+
"validate",
|
|
13043
|
+
"validationErrorMessage",
|
|
13044
|
+
"rules",
|
|
13045
|
+
"allowPastDates",
|
|
13046
|
+
"maxYearsFromNow"
|
|
13047
|
+
]);
|
|
13048
|
+
const handleValidate = (0, import_react26.useCallback)(
|
|
13049
|
+
(value) => {
|
|
13050
|
+
var _a2;
|
|
13051
|
+
if (value === void 0 || value === null) {
|
|
13052
|
+
if (required) return validationErrorMessage;
|
|
13053
|
+
return true;
|
|
13054
|
+
}
|
|
13055
|
+
return (_a2 = validate == null ? void 0 : validate(value)) != null ? _a2 : true;
|
|
13056
|
+
},
|
|
13057
|
+
[validate, required, validationErrorMessage]
|
|
13058
|
+
);
|
|
13059
|
+
const { field, fieldState } = (0, import_react_hook_form14.useController)({
|
|
13060
|
+
name,
|
|
13061
|
+
rules: __spreadValues({
|
|
13062
|
+
required: required ? validationErrorMessage : false,
|
|
13063
|
+
validate: handleValidate
|
|
13064
|
+
}, rules),
|
|
13065
|
+
defaultValue: void 0
|
|
13066
|
+
});
|
|
13067
|
+
const fieldError = fieldState.error;
|
|
13068
|
+
const haveError = !!fieldError;
|
|
13069
|
+
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
13070
|
+
const { value: selected, onChange: setSelected } = field;
|
|
13071
|
+
const handleCalendarChange = (range) => {
|
|
13072
|
+
setSelected(range);
|
|
13073
|
+
};
|
|
13074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
|
|
13075
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormLabel, { name, label, required, haveError }),
|
|
13076
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13077
|
+
DoubleCalendar,
|
|
13078
|
+
__spreadValues({
|
|
13079
|
+
selected,
|
|
13080
|
+
setSelected: (value) => {
|
|
13081
|
+
const newValue = typeof value === "function" ? value(selected) : value;
|
|
13082
|
+
handleCalendarChange(newValue);
|
|
13083
|
+
},
|
|
13084
|
+
hasError: haveError,
|
|
13085
|
+
allowPastDates,
|
|
13086
|
+
maxYearsFromNow
|
|
13087
|
+
}, calendarProps)
|
|
13088
|
+
),
|
|
13089
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
13090
|
+
] });
|
|
13091
|
+
};
|
|
13092
|
+
|
|
13093
|
+
// src/components/FormFields/TimePickerFormField.tsx
|
|
13094
|
+
var import_react_hook_form15 = require("react-hook-form");
|
|
13095
|
+
var import_react27 = require("react");
|
|
13096
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
12880
13097
|
var TimePickerFormField = (_a) => {
|
|
12881
13098
|
var _b = _a, {
|
|
12882
13099
|
name,
|
|
@@ -12893,7 +13110,7 @@ var TimePickerFormField = (_a) => {
|
|
|
12893
13110
|
"validationErrorMessage",
|
|
12894
13111
|
"rules"
|
|
12895
13112
|
]);
|
|
12896
|
-
const handleValidate = (0,
|
|
13113
|
+
const handleValidate = (0, import_react27.useCallback)(
|
|
12897
13114
|
(value) => {
|
|
12898
13115
|
var _a2;
|
|
12899
13116
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -12904,7 +13121,7 @@ var TimePickerFormField = (_a) => {
|
|
|
12904
13121
|
},
|
|
12905
13122
|
[validate, required, validationErrorMessage]
|
|
12906
13123
|
);
|
|
12907
|
-
const { field, fieldState } = (0,
|
|
13124
|
+
const { field, fieldState } = (0, import_react_hook_form15.useController)({
|
|
12908
13125
|
name,
|
|
12909
13126
|
rules: __spreadValues({
|
|
12910
13127
|
required: required ? validationErrorMessage : false,
|
|
@@ -12919,8 +13136,8 @@ var TimePickerFormField = (_a) => {
|
|
|
12919
13136
|
const handleTimePickerChange = (time) => {
|
|
12920
13137
|
setSelected(time);
|
|
12921
13138
|
};
|
|
12922
|
-
return /* @__PURE__ */ (0,
|
|
12923
|
-
label && /* @__PURE__ */ (0,
|
|
13139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Flex2, { direction: "column", style: { flex: "1" }, children: [
|
|
13140
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12924
13141
|
FormLabel,
|
|
12925
13142
|
{
|
|
12926
13143
|
name,
|
|
@@ -12929,7 +13146,7 @@ var TimePickerFormField = (_a) => {
|
|
|
12929
13146
|
haveError
|
|
12930
13147
|
}
|
|
12931
13148
|
),
|
|
12932
|
-
/* @__PURE__ */ (0,
|
|
13149
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
12933
13150
|
TimePicker,
|
|
12934
13151
|
__spreadValues({
|
|
12935
13152
|
selected,
|
|
@@ -12940,16 +13157,16 @@ var TimePickerFormField = (_a) => {
|
|
|
12940
13157
|
hasError: haveError
|
|
12941
13158
|
}, timePickerProps)
|
|
12942
13159
|
),
|
|
12943
|
-
/* @__PURE__ */ (0,
|
|
13160
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ErrorFormMessage, { message: errorMsg })
|
|
12944
13161
|
] });
|
|
12945
13162
|
};
|
|
12946
13163
|
|
|
12947
13164
|
// src/hooks/useImageUpload.ts
|
|
12948
|
-
var
|
|
13165
|
+
var import_react28 = require("react");
|
|
12949
13166
|
var useImageUpload = (options) => {
|
|
12950
|
-
const [isUploading, setIsUploading] = (0,
|
|
12951
|
-
const [progress, setProgress] = (0,
|
|
12952
|
-
const [error, setError] = (0,
|
|
13167
|
+
const [isUploading, setIsUploading] = (0, import_react28.useState)(false);
|
|
13168
|
+
const [progress, setProgress] = (0, import_react28.useState)(null);
|
|
13169
|
+
const [error, setError] = (0, import_react28.useState)(null);
|
|
12953
13170
|
const {
|
|
12954
13171
|
onSuccess,
|
|
12955
13172
|
onError,
|
|
@@ -12959,7 +13176,7 @@ var useImageUpload = (options) => {
|
|
|
12959
13176
|
allowedTypes = ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
|
12960
13177
|
uploadConfig
|
|
12961
13178
|
} = options;
|
|
12962
|
-
const validateFile = (0,
|
|
13179
|
+
const validateFile = (0, import_react28.useCallback)(
|
|
12963
13180
|
(file) => {
|
|
12964
13181
|
if (!allowedTypes.includes(file.type)) {
|
|
12965
13182
|
const errorMsg = "Tipo de arquivo n\xE3o suportado";
|
|
@@ -12977,7 +13194,7 @@ var useImageUpload = (options) => {
|
|
|
12977
13194
|
},
|
|
12978
13195
|
[allowedTypes, maxFileSize, onError]
|
|
12979
13196
|
);
|
|
12980
|
-
const uploadFile = (0,
|
|
13197
|
+
const uploadFile = (0, import_react28.useCallback)(
|
|
12981
13198
|
(file) => __async(null, null, function* () {
|
|
12982
13199
|
if (!validateFile(file)) {
|
|
12983
13200
|
return null;
|
|
@@ -13030,7 +13247,7 @@ var useImageUpload = (options) => {
|
|
|
13030
13247
|
}),
|
|
13031
13248
|
[validateFile, onSuccess, onError, onProgress]
|
|
13032
13249
|
);
|
|
13033
|
-
const reset = (0,
|
|
13250
|
+
const reset = (0, import_react28.useCallback)(() => {
|
|
13034
13251
|
setIsUploading(false);
|
|
13035
13252
|
setProgress(null);
|
|
13036
13253
|
setError(null);
|
|
@@ -13079,6 +13296,8 @@ var useImageUpload = (options) => {
|
|
|
13079
13296
|
ContainerStyled,
|
|
13080
13297
|
CountryFormField,
|
|
13081
13298
|
Divider,
|
|
13299
|
+
DoubleCalendar,
|
|
13300
|
+
DoubleCalendarFormField,
|
|
13082
13301
|
Drawer,
|
|
13083
13302
|
DropdownMenu,
|
|
13084
13303
|
DropdownMenuItem,
|