@lets-events/react 12.3.2 → 12.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +201 -41
- package/dist/index.d.ts +201 -41
- package/dist/index.js +191 -162
- package/dist/index.mjs +131 -102
- package/package.json +1 -1
- package/src/components/Card.tsx +14 -2
- package/src/components/Drawer/index.tsx +43 -106
- package/src/components/Drawer/styledComponents.ts +56 -5
- package/src/styles/index.ts +9 -6
package/dist/index.js
CHANGED
|
@@ -149,7 +149,7 @@ var require_react_is_development = __commonJS({
|
|
|
149
149
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
150
150
|
var Element = REACT_ELEMENT_TYPE;
|
|
151
151
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
152
|
-
var
|
|
152
|
+
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
153
153
|
var Lazy = REACT_LAZY_TYPE;
|
|
154
154
|
var Memo = REACT_MEMO_TYPE;
|
|
155
155
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -208,7 +208,7 @@ var require_react_is_development = __commonJS({
|
|
|
208
208
|
exports2.ContextProvider = ContextProvider;
|
|
209
209
|
exports2.Element = Element;
|
|
210
210
|
exports2.ForwardRef = ForwardRef;
|
|
211
|
-
exports2.Fragment =
|
|
211
|
+
exports2.Fragment = Fragment6;
|
|
212
212
|
exports2.Lazy = Lazy;
|
|
213
213
|
exports2.Memo = Memo;
|
|
214
214
|
exports2.Portal = Portal;
|
|
@@ -1352,6 +1352,9 @@ var {
|
|
|
1352
1352
|
lineHeights,
|
|
1353
1353
|
radii,
|
|
1354
1354
|
space
|
|
1355
|
+
},
|
|
1356
|
+
media: {
|
|
1357
|
+
md: "(max-width: 690px)"
|
|
1355
1358
|
}
|
|
1356
1359
|
});
|
|
1357
1360
|
|
|
@@ -8138,9 +8141,6 @@ function Calendar(_a) {
|
|
|
8138
8141
|
] })) });
|
|
8139
8142
|
}
|
|
8140
8143
|
|
|
8141
|
-
// src/components/Drawer/index.tsx
|
|
8142
|
-
var import_react9 = require("react");
|
|
8143
|
-
|
|
8144
8144
|
// src/components/Drawer/styledComponents.ts
|
|
8145
8145
|
var DrawerOverlayStyled = styled("div", {
|
|
8146
8146
|
position: "fixed",
|
|
@@ -8149,27 +8149,69 @@ var DrawerOverlayStyled = styled("div", {
|
|
|
8149
8149
|
width: "100vw",
|
|
8150
8150
|
height: "100vh",
|
|
8151
8151
|
background: "rgba(0, 0, 0, 0.4)",
|
|
8152
|
-
|
|
8152
|
+
transition: "opacity 200ms ease",
|
|
8153
|
+
variants: {
|
|
8154
|
+
open: {
|
|
8155
|
+
true: {
|
|
8156
|
+
opacity: "1"
|
|
8157
|
+
},
|
|
8158
|
+
false: {
|
|
8159
|
+
pointerEvents: "none",
|
|
8160
|
+
opacity: "0"
|
|
8161
|
+
}
|
|
8162
|
+
}
|
|
8163
|
+
}
|
|
8164
|
+
});
|
|
8165
|
+
var DrawerWrapper = styled("div", {
|
|
8166
|
+
position: "absolute",
|
|
8167
|
+
top: 0,
|
|
8168
|
+
right: 0,
|
|
8169
|
+
height: "100vh",
|
|
8170
|
+
overflow: "hidden",
|
|
8171
|
+
variants: {
|
|
8172
|
+
open: {
|
|
8173
|
+
true: {},
|
|
8174
|
+
false: {
|
|
8175
|
+
pointerEvents: "none"
|
|
8176
|
+
}
|
|
8177
|
+
}
|
|
8178
|
+
}
|
|
8153
8179
|
});
|
|
8154
8180
|
var DrawerContainerStyled = styled("div", {
|
|
8155
8181
|
position: "absolute",
|
|
8156
8182
|
top: 0,
|
|
8157
8183
|
right: 0,
|
|
8158
|
-
|
|
8159
|
-
height: "100%",
|
|
8184
|
+
height: "100vh",
|
|
8160
8185
|
background: "$neutral50",
|
|
8161
8186
|
display: "flex",
|
|
8162
8187
|
flexDirection: "column",
|
|
8163
8188
|
boxShadow: "-4px 0 12px rgba(0, 0, 0, 0.2)",
|
|
8164
|
-
|
|
8165
|
-
|
|
8189
|
+
overflowY: "auto",
|
|
8190
|
+
width: "100%",
|
|
8191
|
+
boxSizing: "border-box",
|
|
8192
|
+
"@md": {
|
|
8193
|
+
minWidth: "100vw",
|
|
8194
|
+
maxWidth: "100vw"
|
|
8195
|
+
},
|
|
8196
|
+
transition: "transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)",
|
|
8197
|
+
paddingBottom: "1.5rem",
|
|
8198
|
+
variants: {
|
|
8199
|
+
open: {
|
|
8200
|
+
true: {
|
|
8201
|
+
transform: "translateX(0) scale(1)"
|
|
8202
|
+
},
|
|
8203
|
+
false: {
|
|
8204
|
+
transform: "translateX(110%) scale(0.98)"
|
|
8205
|
+
}
|
|
8206
|
+
}
|
|
8207
|
+
}
|
|
8166
8208
|
});
|
|
8167
8209
|
var DrawerHeaderDiv = styled("div", {
|
|
8168
8210
|
display: "flex",
|
|
8169
8211
|
justifyContent: "space-between",
|
|
8170
8212
|
alignItems: "center",
|
|
8171
8213
|
borderBottom: "1px solid $neutral300",
|
|
8172
|
-
padding: "
|
|
8214
|
+
padding: "1.5rem 1rem",
|
|
8173
8215
|
position: "relative"
|
|
8174
8216
|
});
|
|
8175
8217
|
var DrawerHeaderTitle = styled("h2", {
|
|
@@ -8202,82 +8244,59 @@ function Drawer({
|
|
|
8202
8244
|
children,
|
|
8203
8245
|
goBackIcon,
|
|
8204
8246
|
goBackAction,
|
|
8205
|
-
zIndex
|
|
8247
|
+
zIndex = 1e3
|
|
8206
8248
|
}) {
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
}
|
|
8240
|
-
if ((_a = drawerContainerRef.current) == null ? void 0 : _a.contains(target)) {
|
|
8241
|
-
return;
|
|
8242
|
-
}
|
|
8243
|
-
const isDropdownOpen = target.closest("[data-radix-popper-content-wrapper]") || target.closest('[role="dialog"]') || target.closest('[data-state="open"]') || target.closest("[data-radix-dropdown-menu-content]") || target.closest("[data-radix-dropdown-menu-root]") || target.closest("[data-radix-dropdown-menu-trigger]") || target.closest("[data-radix-dropdown-menu-portal]") || target.closest("[data-radix-dropdown-menu-item]") || target.closest("[data-radix-dropdown-menu-checkbox-item]") || target.closest("[data-radix-dropdown-menu-radio-item]") || target.closest("[data-radix-dropdown-menu-separator]") || target.closest("[data-radix-dropdown-menu-label]") || target.closest("[data-radix-dropdown-menu-group]") || target.closest("[data-radix-dropdown-menu-sub]") || target.closest("[data-radix-dropdown-menu-sub-trigger]") || target.closest("[data-radix-dropdown-menu-sub-content]") || target.closest("[data-radix-dropdown-menu-radio-group]");
|
|
8244
|
-
const shouldPreventClose = isDropdownOpen || target.closest("[data-radix-dropdown-menu-root]") || target.closest("[data-radix-dropdown-menu-trigger]") || target.closest("[data-radix-dropdown-menu-content]") || target.closest("[data-radix-dropdown-menu-portal]") || target.closest("[data-radix-dropdown-menu-item]") || target.closest("[data-radix-dropdown-menu-checkbox-item]") || target.closest("[data-radix-dropdown-menu-radio-item]") || target.closest("[data-radix-dropdown-menu-separator]") || target.closest("[data-radix-dropdown-menu-label]") || target.closest("[data-radix-dropdown-menu-group]") || target.closest("[data-radix-dropdown-menu-sub]") || target.closest("[data-radix-dropdown-menu-sub-trigger]") || target.closest("[data-radix-dropdown-menu-sub-content]") || target.closest("[data-radix-dropdown-menu-radio-group]");
|
|
8245
|
-
if (!shouldPreventClose) {
|
|
8246
|
-
onClose == null ? void 0 : onClose();
|
|
8247
|
-
}
|
|
8248
|
-
});
|
|
8249
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8250
|
-
DrawerOverlayStyled,
|
|
8251
|
-
{
|
|
8252
|
-
css: {
|
|
8253
|
-
zIndex
|
|
8254
|
-
},
|
|
8255
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
8256
|
-
DrawerContainerStyled,
|
|
8257
|
-
{
|
|
8258
|
-
ref: drawerContainerRef,
|
|
8259
|
-
style: {
|
|
8260
|
-
width: width != null ? width : "34.25rem",
|
|
8261
|
-
backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"]
|
|
8262
|
-
},
|
|
8263
|
-
children: [
|
|
8264
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DrawerHeaderDiv, { children: [
|
|
8265
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex2, { gap: 8, align: "center", children: [
|
|
8266
|
-
goBackIcon && goBackIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
|
|
8267
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderTitle, { children: title })
|
|
8249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
8250
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8251
|
+
DrawerOverlayStyled,
|
|
8252
|
+
{
|
|
8253
|
+
css: {
|
|
8254
|
+
zIndex
|
|
8255
|
+
},
|
|
8256
|
+
onClick: onClose,
|
|
8257
|
+
open: isOpen
|
|
8258
|
+
}
|
|
8259
|
+
),
|
|
8260
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8261
|
+
DrawerWrapper,
|
|
8262
|
+
{
|
|
8263
|
+
css: {
|
|
8264
|
+
zIndex: zIndex + 1,
|
|
8265
|
+
width: width != null ? width : "34.25rem"
|
|
8266
|
+
},
|
|
8267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
8268
|
+
DrawerContainerStyled,
|
|
8269
|
+
{
|
|
8270
|
+
open: isOpen,
|
|
8271
|
+
css: {
|
|
8272
|
+
backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"]
|
|
8273
|
+
},
|
|
8274
|
+
children: [
|
|
8275
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DrawerHeaderDiv, { children: [
|
|
8276
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex2, { gap: 8, align: "center", children: [
|
|
8277
|
+
goBackIcon && goBackIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
|
|
8278
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderTitle, { children: title })
|
|
8279
|
+
] }),
|
|
8280
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
|
|
8268
8281
|
] }),
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8282
|
+
isOpen ? children : null,
|
|
8283
|
+
isOpen ? children : null,
|
|
8284
|
+
isOpen ? children : null,
|
|
8285
|
+
isOpen ? children : null,
|
|
8286
|
+
isOpen ? children : null,
|
|
8287
|
+
isOpen ? children : null,
|
|
8288
|
+
isOpen ? children : null,
|
|
8289
|
+
isOpen ? children : null
|
|
8290
|
+
]
|
|
8291
|
+
}
|
|
8292
|
+
)
|
|
8293
|
+
}
|
|
8294
|
+
)
|
|
8295
|
+
] });
|
|
8277
8296
|
}
|
|
8278
8297
|
|
|
8279
8298
|
// src/components/TimePicker.tsx
|
|
8280
|
-
var
|
|
8299
|
+
var import_react9 = require("react");
|
|
8281
8300
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
8282
8301
|
var TimePickerStyled = styled("div", {
|
|
8283
8302
|
position: "relative",
|
|
@@ -8400,14 +8419,14 @@ function TimePicker({
|
|
|
8400
8419
|
hasError,
|
|
8401
8420
|
expand = false
|
|
8402
8421
|
}) {
|
|
8403
|
-
const [hours, setHours] = (0,
|
|
8404
|
-
const [minutes, setMinutes] = (0,
|
|
8405
|
-
const [rawHours, setRawHours] = (0,
|
|
8406
|
-
const [rawMinutes, setRawMinutes] = (0,
|
|
8407
|
-
const [isOpen, setIsOpen] = (0,
|
|
8408
|
-
const dropdownRef = (0,
|
|
8422
|
+
const [hours, setHours] = (0, import_react9.useState)("00");
|
|
8423
|
+
const [minutes, setMinutes] = (0, import_react9.useState)("00");
|
|
8424
|
+
const [rawHours, setRawHours] = (0, import_react9.useState)("00");
|
|
8425
|
+
const [rawMinutes, setRawMinutes] = (0, import_react9.useState)("00");
|
|
8426
|
+
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
8427
|
+
const dropdownRef = (0, import_react9.useRef)(null);
|
|
8409
8428
|
useOnClickOutside(dropdownRef, () => setIsOpen(false));
|
|
8410
|
-
const handleIncrement = (0,
|
|
8429
|
+
const handleIncrement = (0, import_react9.useCallback)(
|
|
8411
8430
|
(type) => {
|
|
8412
8431
|
if (type === "hours") {
|
|
8413
8432
|
const next = (parseInt(hours) + 1) % 24;
|
|
@@ -8421,7 +8440,7 @@ function TimePicker({
|
|
|
8421
8440
|
},
|
|
8422
8441
|
[hours, minutes]
|
|
8423
8442
|
);
|
|
8424
|
-
const handleDecrement = (0,
|
|
8443
|
+
const handleDecrement = (0, import_react9.useCallback)(
|
|
8425
8444
|
(type) => {
|
|
8426
8445
|
if (type === "hours") {
|
|
8427
8446
|
const prev = (parseInt(hours) - 1 + 24) % 24;
|
|
@@ -8945,7 +8964,7 @@ function Switch(props) {
|
|
|
8945
8964
|
}
|
|
8946
8965
|
|
|
8947
8966
|
// src/components/Step.tsx
|
|
8948
|
-
var
|
|
8967
|
+
var import_react10 = __toESM(require("react"));
|
|
8949
8968
|
var import_themes15 = require("@radix-ui/themes");
|
|
8950
8969
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
8951
8970
|
var StepStyled = styled("div", {
|
|
@@ -9061,9 +9080,9 @@ function StepList(_a) {
|
|
|
9061
9080
|
"children",
|
|
9062
9081
|
"currentStep"
|
|
9063
9082
|
]);
|
|
9064
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children:
|
|
9065
|
-
if (
|
|
9066
|
-
return
|
|
9083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children: import_react10.default.Children.map(children, (child) => {
|
|
9084
|
+
if (import_react10.default.isValidElement(child) && child.type === StepTrigger) {
|
|
9085
|
+
return import_react10.default.cloneElement(child, { currentStep });
|
|
9067
9086
|
}
|
|
9068
9087
|
return child;
|
|
9069
9088
|
}) }));
|
|
@@ -9118,13 +9137,23 @@ var CardStyled = styled(import_themes16.Card, {
|
|
|
9118
9137
|
}
|
|
9119
9138
|
});
|
|
9120
9139
|
function Card(_a) {
|
|
9121
|
-
var _b = _a, {
|
|
9122
|
-
|
|
9140
|
+
var _b = _a, {
|
|
9141
|
+
asChild,
|
|
9142
|
+
children,
|
|
9143
|
+
padding,
|
|
9144
|
+
radius
|
|
9145
|
+
} = _b, props = __objRest(_b, [
|
|
9146
|
+
"asChild",
|
|
9147
|
+
"children",
|
|
9148
|
+
"padding",
|
|
9149
|
+
"radius"
|
|
9150
|
+
]);
|
|
9151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyled, __spreadProps(__spreadValues({}, props), { css: { padding, borderRadius: radius }, children }));
|
|
9123
9152
|
}
|
|
9124
9153
|
|
|
9125
9154
|
// src/components/TextareaField.tsx
|
|
9126
9155
|
var import_themes17 = require("@radix-ui/themes");
|
|
9127
|
-
var
|
|
9156
|
+
var import_react11 = __toESM(require("react"));
|
|
9128
9157
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
9129
9158
|
var TextareaFieldStyle = styled(import_themes17.TextArea, {
|
|
9130
9159
|
display: "flex",
|
|
@@ -9189,11 +9218,11 @@ var TextareaLimitIndicator = styled("div", {
|
|
|
9189
9218
|
padding: "$4"
|
|
9190
9219
|
}
|
|
9191
9220
|
});
|
|
9192
|
-
var TextareaField =
|
|
9221
|
+
var TextareaField = import_react11.default.forwardRef((_a, forwardedRef) => {
|
|
9193
9222
|
var _b = _a, { maxLength, color } = _b, props = __objRest(_b, ["maxLength", "color"]);
|
|
9194
|
-
const inputRef = (0,
|
|
9195
|
-
const [remaining, setRemaining] = (0,
|
|
9196
|
-
(0,
|
|
9223
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
9224
|
+
const [remaining, setRemaining] = (0, import_react11.useState)(maxLength);
|
|
9225
|
+
(0, import_react11.useEffect)(() => {
|
|
9197
9226
|
var _a2;
|
|
9198
9227
|
if (maxLength && inputRef.current) {
|
|
9199
9228
|
setRemaining(maxLength - ((_a2 = inputRef.current.value.length) != null ? _a2 : 0));
|
|
@@ -9228,12 +9257,12 @@ var TextareaField = import_react12.default.forwardRef((_a, forwardedRef) => {
|
|
|
9228
9257
|
});
|
|
9229
9258
|
|
|
9230
9259
|
// src/components/Toast/components/ToastItem.tsx
|
|
9231
|
-
var
|
|
9260
|
+
var import_react13 = require("react");
|
|
9232
9261
|
|
|
9233
9262
|
// src/components/Toast/styles/index.ts
|
|
9234
|
-
var
|
|
9263
|
+
var import_react12 = require("@stitches/react");
|
|
9235
9264
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
9236
|
-
var slideIn = (0,
|
|
9265
|
+
var slideIn = (0, import_react12.keyframes)({
|
|
9237
9266
|
from: {
|
|
9238
9267
|
transform: "translateX(calc(100% + 25px))",
|
|
9239
9268
|
opacity: 0
|
|
@@ -9243,7 +9272,7 @@ var slideIn = (0, import_react13.keyframes)({
|
|
|
9243
9272
|
opacity: 1
|
|
9244
9273
|
}
|
|
9245
9274
|
});
|
|
9246
|
-
var slideOut = (0,
|
|
9275
|
+
var slideOut = (0, import_react12.keyframes)({
|
|
9247
9276
|
from: {
|
|
9248
9277
|
transform: "translateX(0)",
|
|
9249
9278
|
opacity: 1
|
|
@@ -9253,7 +9282,7 @@ var slideOut = (0, import_react13.keyframes)({
|
|
|
9253
9282
|
opacity: 0
|
|
9254
9283
|
}
|
|
9255
9284
|
});
|
|
9256
|
-
var swipeOut = (0,
|
|
9285
|
+
var swipeOut = (0, import_react12.keyframes)({
|
|
9257
9286
|
from: {
|
|
9258
9287
|
transform: "translateX(var(--radix-toast-swipe-end-x))",
|
|
9259
9288
|
opacity: 1
|
|
@@ -9359,7 +9388,7 @@ function ToastItem({
|
|
|
9359
9388
|
toast,
|
|
9360
9389
|
onRemove
|
|
9361
9390
|
}) {
|
|
9362
|
-
const [open, setOpen] = (0,
|
|
9391
|
+
const [open, setOpen] = (0, import_react13.useState)(true);
|
|
9363
9392
|
const handleOpenChange = (open2) => {
|
|
9364
9393
|
setOpen(open2);
|
|
9365
9394
|
if (!open2) {
|
|
@@ -9383,17 +9412,17 @@ function ToastItem({
|
|
|
9383
9412
|
}
|
|
9384
9413
|
|
|
9385
9414
|
// src/components/Toast/components/ToastProvider.tsx
|
|
9386
|
-
var
|
|
9415
|
+
var import_react14 = require("react");
|
|
9387
9416
|
var ToastPrimitive2 = __toESM(require("@radix-ui/react-toast"));
|
|
9388
9417
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
9389
|
-
var ToastContext = (0,
|
|
9418
|
+
var ToastContext = (0, import_react14.createContext)(null);
|
|
9390
9419
|
function ToastProvider({
|
|
9391
9420
|
children,
|
|
9392
9421
|
defaultDuration = 5e3,
|
|
9393
9422
|
maxToasts = 5,
|
|
9394
9423
|
swipeDirection = "right"
|
|
9395
9424
|
}) {
|
|
9396
|
-
const [toasts, setToasts] = (0,
|
|
9425
|
+
const [toasts, setToasts] = (0, import_react14.useState)([]);
|
|
9397
9426
|
const addToast = (toastData) => {
|
|
9398
9427
|
const id = Math.random().toString(36).substr(2, 9);
|
|
9399
9428
|
const newToast = __spreadProps(__spreadValues({
|
|
@@ -9429,9 +9458,9 @@ function ToastProvider({
|
|
|
9429
9458
|
}
|
|
9430
9459
|
|
|
9431
9460
|
// src/components/Toast/hooks/useToast.ts
|
|
9432
|
-
var
|
|
9461
|
+
var import_react15 = require("react");
|
|
9433
9462
|
var useToast = () => {
|
|
9434
|
-
const context = (0,
|
|
9463
|
+
const context = (0, import_react15.useContext)(ToastContext);
|
|
9435
9464
|
if (!context) {
|
|
9436
9465
|
throw new Error("useToast deve ser usado dentro de um ToastProvider");
|
|
9437
9466
|
}
|
|
@@ -9489,11 +9518,11 @@ function Tooltip({
|
|
|
9489
9518
|
}
|
|
9490
9519
|
|
|
9491
9520
|
// src/components/MultiSelect/index.tsx
|
|
9492
|
-
var
|
|
9521
|
+
var import_react16 = __toESM(require("react"));
|
|
9493
9522
|
var import_themes19 = require("@radix-ui/themes");
|
|
9494
9523
|
var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
|
|
9495
9524
|
var import_free_solid_svg_icons3 = require("@fortawesome/free-solid-svg-icons");
|
|
9496
|
-
var
|
|
9525
|
+
var import_react17 = require("react");
|
|
9497
9526
|
|
|
9498
9527
|
// src/components/MultiSelect/styledComponents.ts
|
|
9499
9528
|
var import_themes18 = require("@radix-ui/themes");
|
|
@@ -9643,7 +9672,7 @@ var ButtonSelectAllStyled = styled("button", {
|
|
|
9643
9672
|
|
|
9644
9673
|
// src/components/MultiSelect/index.tsx
|
|
9645
9674
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9646
|
-
var MultiSelect =
|
|
9675
|
+
var MultiSelect = import_react16.default.forwardRef(
|
|
9647
9676
|
({
|
|
9648
9677
|
placeholder,
|
|
9649
9678
|
value: selectedValues = [],
|
|
@@ -9661,24 +9690,24 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9661
9690
|
selectedAllText,
|
|
9662
9691
|
selectedScroll = false
|
|
9663
9692
|
}, fowardedRef) => {
|
|
9664
|
-
const [isOpen, setIsOpen] = (0,
|
|
9665
|
-
const triggerRef = (0,
|
|
9666
|
-
const [allOptionsSelected, setAllOptionsSelected] = (0,
|
|
9667
|
-
const labelByValue = (0,
|
|
9693
|
+
const [isOpen, setIsOpen] = (0, import_react16.useState)(false);
|
|
9694
|
+
const triggerRef = (0, import_react16.useRef)(null);
|
|
9695
|
+
const [allOptionsSelected, setAllOptionsSelected] = (0, import_react16.useState)(false);
|
|
9696
|
+
const labelByValue = (0, import_react17.useMemo)(() => {
|
|
9668
9697
|
return options.reduce((prev, curr) => {
|
|
9669
9698
|
return __spreadProps(__spreadValues({}, prev), {
|
|
9670
9699
|
[curr.value]: curr.label
|
|
9671
9700
|
});
|
|
9672
9701
|
}, {});
|
|
9673
9702
|
}, [options]);
|
|
9674
|
-
const handleRemove = (0,
|
|
9703
|
+
const handleRemove = (0, import_react16.useCallback)(
|
|
9675
9704
|
(value) => {
|
|
9676
9705
|
const newValue = selectedValues.filter((v) => v !== value);
|
|
9677
9706
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
9678
9707
|
},
|
|
9679
9708
|
[selectedValues, onValueChange]
|
|
9680
9709
|
);
|
|
9681
|
-
const handleSelectAll = (0,
|
|
9710
|
+
const handleSelectAll = (0, import_react16.useCallback)(
|
|
9682
9711
|
(e) => {
|
|
9683
9712
|
e.preventDefault();
|
|
9684
9713
|
e.stopPropagation();
|
|
@@ -9693,7 +9722,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9693
9722
|
},
|
|
9694
9723
|
[selectedValues, options, onValueChange]
|
|
9695
9724
|
);
|
|
9696
|
-
const text = (0,
|
|
9725
|
+
const text = (0, import_react17.useMemo)(() => {
|
|
9697
9726
|
if (selectedValues.length > 0 && singleSelect) {
|
|
9698
9727
|
const value = selectedValues[0];
|
|
9699
9728
|
return labelByValue[value];
|
|
@@ -9704,7 +9733,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9704
9733
|
onValueChange == null ? void 0 : onValueChange([v]);
|
|
9705
9734
|
setIsOpen(false);
|
|
9706
9735
|
};
|
|
9707
|
-
const handleToggle = (0,
|
|
9736
|
+
const handleToggle = (0, import_react16.useCallback)(
|
|
9708
9737
|
(e) => {
|
|
9709
9738
|
e.preventDefault();
|
|
9710
9739
|
e.stopPropagation();
|
|
@@ -10143,7 +10172,7 @@ var TextAreaFormField = (_a) => {
|
|
|
10143
10172
|
|
|
10144
10173
|
// src/components/FormFields/TextFormField.tsx
|
|
10145
10174
|
var import_react_hook_form2 = require("react-hook-form");
|
|
10146
|
-
var
|
|
10175
|
+
var import_react18 = require("react");
|
|
10147
10176
|
var import_mask2 = require("@react-input/mask");
|
|
10148
10177
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
10149
10178
|
var TextFormField = (_a) => {
|
|
@@ -10166,7 +10195,7 @@ var TextFormField = (_a) => {
|
|
|
10166
10195
|
"onChange",
|
|
10167
10196
|
"valueFormatter"
|
|
10168
10197
|
]);
|
|
10169
|
-
const handleValidate = (0,
|
|
10198
|
+
const handleValidate = (0, import_react18.useCallback)(
|
|
10170
10199
|
(value) => {
|
|
10171
10200
|
var _a2;
|
|
10172
10201
|
if (value === void 0 || value === null || !required && value.trim() === "")
|
|
@@ -10188,7 +10217,7 @@ var TextFormField = (_a) => {
|
|
|
10188
10217
|
const haveError = !!fieldError;
|
|
10189
10218
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
10190
10219
|
const { value: formValue, onChange: formChange } = field;
|
|
10191
|
-
const formattedValue = (0,
|
|
10220
|
+
const formattedValue = (0, import_react18.useMemo)(() => {
|
|
10192
10221
|
let value = formValue;
|
|
10193
10222
|
if (valueFormatter) value = valueFormatter.format(value);
|
|
10194
10223
|
if (mask) value = (0, import_mask2.format)(value != null ? value : "", mask);
|
|
@@ -10783,7 +10812,7 @@ function StateFormField({
|
|
|
10783
10812
|
}
|
|
10784
10813
|
|
|
10785
10814
|
// src/components/FormFields/AddressFormFields/CityFormField.tsx
|
|
10786
|
-
var
|
|
10815
|
+
var import_react19 = require("react");
|
|
10787
10816
|
var import_react_hook_form7 = require("react-hook-form");
|
|
10788
10817
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
10789
10818
|
function CityFormField({
|
|
@@ -10796,9 +10825,9 @@ function CityFormField({
|
|
|
10796
10825
|
}) {
|
|
10797
10826
|
const { control, watch } = (0, import_react_hook_form7.useFormContext)();
|
|
10798
10827
|
const selectedState = watch(stateName);
|
|
10799
|
-
const [cities, setCities] = (0,
|
|
10800
|
-
const [loading, setLoading] = (0,
|
|
10801
|
-
(0,
|
|
10828
|
+
const [cities, setCities] = (0, import_react19.useState)([]);
|
|
10829
|
+
const [loading, setLoading] = (0, import_react19.useState)(false);
|
|
10830
|
+
(0, import_react19.useEffect)(() => {
|
|
10802
10831
|
if (!isBrazil) {
|
|
10803
10832
|
setCities([]);
|
|
10804
10833
|
return;
|
|
@@ -11186,10 +11215,10 @@ var EmailFormField = ({
|
|
|
11186
11215
|
var import_react_hook_form12 = require("react-hook-form");
|
|
11187
11216
|
|
|
11188
11217
|
// src/components/RichEditor/RichEditor.tsx
|
|
11189
|
-
var
|
|
11218
|
+
var import_react21 = require("react");
|
|
11190
11219
|
|
|
11191
11220
|
// src/components/RichEditor/QuillComponent.tsx
|
|
11192
|
-
var
|
|
11221
|
+
var import_react20 = require("react");
|
|
11193
11222
|
var import_react_quilljs = require("react-quilljs");
|
|
11194
11223
|
|
|
11195
11224
|
// src/utils/uploadService.ts
|
|
@@ -12258,12 +12287,12 @@ var QuillComponent = ({
|
|
|
12258
12287
|
onCharacterCountChange,
|
|
12259
12288
|
maxLength
|
|
12260
12289
|
}) => {
|
|
12261
|
-
const [showVideoModal, setShowVideoModal] = (0,
|
|
12262
|
-
const [videoUrl, setVideoUrl] = (0,
|
|
12263
|
-
const [showLinkModal, setShowLinkModal] = (0,
|
|
12264
|
-
const [linkUrl, setLinkUrl] = (0,
|
|
12265
|
-
const videoModalRef = (0,
|
|
12266
|
-
const linkModalRef = (0,
|
|
12290
|
+
const [showVideoModal, setShowVideoModal] = (0, import_react20.useState)(false);
|
|
12291
|
+
const [videoUrl, setVideoUrl] = (0, import_react20.useState)("");
|
|
12292
|
+
const [showLinkModal, setShowLinkModal] = (0, import_react20.useState)(false);
|
|
12293
|
+
const [linkUrl, setLinkUrl] = (0, import_react20.useState)("");
|
|
12294
|
+
const videoModalRef = (0, import_react20.useRef)(null);
|
|
12295
|
+
const linkModalRef = (0, import_react20.useRef)(null);
|
|
12267
12296
|
const { addToast, removeToast } = useToast();
|
|
12268
12297
|
const formatHTML = (html) => {
|
|
12269
12298
|
const parser = new DOMParser();
|
|
@@ -12327,7 +12356,7 @@ var QuillComponent = ({
|
|
|
12327
12356
|
placeholder,
|
|
12328
12357
|
readOnly: disabled
|
|
12329
12358
|
});
|
|
12330
|
-
const handleImageUpload = (0,
|
|
12359
|
+
const handleImageUpload = (0, import_react20.useCallback)(
|
|
12331
12360
|
(file) => __async(null, null, function* () {
|
|
12332
12361
|
if (disabled || !quill || !uploadConfig) return;
|
|
12333
12362
|
try {
|
|
@@ -12359,7 +12388,7 @@ var QuillComponent = ({
|
|
|
12359
12388
|
}),
|
|
12360
12389
|
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
12361
12390
|
);
|
|
12362
|
-
(0,
|
|
12391
|
+
(0, import_react20.useEffect)(() => {
|
|
12363
12392
|
if (quill && value) {
|
|
12364
12393
|
const currentContent = quill.root.innerHTML;
|
|
12365
12394
|
if (currentContent !== value) {
|
|
@@ -12373,7 +12402,7 @@ var QuillComponent = ({
|
|
|
12373
12402
|
}
|
|
12374
12403
|
}
|
|
12375
12404
|
}, [quill, value]);
|
|
12376
|
-
(0,
|
|
12405
|
+
(0, import_react20.useEffect)(() => {
|
|
12377
12406
|
if (quill) {
|
|
12378
12407
|
quill.on("text-change", (delta, oldDelta, source) => {
|
|
12379
12408
|
if (source === "user") {
|
|
@@ -12428,7 +12457,7 @@ var QuillComponent = ({
|
|
|
12428
12457
|
}, 2e3);
|
|
12429
12458
|
}
|
|
12430
12459
|
}, [quill, onChange, handleImageUpload, onCharacterCountChange]);
|
|
12431
|
-
(0,
|
|
12460
|
+
(0, import_react20.useEffect)(() => {
|
|
12432
12461
|
if (quill) {
|
|
12433
12462
|
quill.enable(!disabled);
|
|
12434
12463
|
if (!disabled) {
|
|
@@ -12439,11 +12468,11 @@ var QuillComponent = ({
|
|
|
12439
12468
|
}
|
|
12440
12469
|
}
|
|
12441
12470
|
}, [quill, disabled]);
|
|
12442
|
-
const handleLinkCancel = (0,
|
|
12471
|
+
const handleLinkCancel = (0, import_react20.useCallback)(() => {
|
|
12443
12472
|
setLinkUrl("");
|
|
12444
12473
|
setShowLinkModal(false);
|
|
12445
12474
|
}, []);
|
|
12446
|
-
const handleLinkSubmit = (0,
|
|
12475
|
+
const handleLinkSubmit = (0, import_react20.useCallback)(() => {
|
|
12447
12476
|
if (!linkUrl.trim() || !quill) return;
|
|
12448
12477
|
const url = linkUrl.trim();
|
|
12449
12478
|
const selection = quill.getSelection();
|
|
@@ -12458,11 +12487,11 @@ var QuillComponent = ({
|
|
|
12458
12487
|
setLinkUrl("");
|
|
12459
12488
|
setShowLinkModal(false);
|
|
12460
12489
|
}, [linkUrl, quill]);
|
|
12461
|
-
const handleVideoCancel = (0,
|
|
12490
|
+
const handleVideoCancel = (0, import_react20.useCallback)(() => {
|
|
12462
12491
|
setVideoUrl("");
|
|
12463
12492
|
setShowVideoModal(false);
|
|
12464
12493
|
}, []);
|
|
12465
|
-
const handleVideoSubmit = (0,
|
|
12494
|
+
const handleVideoSubmit = (0, import_react20.useCallback)(() => {
|
|
12466
12495
|
var _a, _b;
|
|
12467
12496
|
if (!videoUrl.trim() || !quill) return;
|
|
12468
12497
|
let processedUrl = videoUrl.trim();
|
|
@@ -12495,7 +12524,7 @@ var QuillComponent = ({
|
|
|
12495
12524
|
setVideoUrl("");
|
|
12496
12525
|
setShowVideoModal(false);
|
|
12497
12526
|
}, [videoUrl, quill]);
|
|
12498
|
-
(0,
|
|
12527
|
+
(0, import_react20.useEffect)(() => {
|
|
12499
12528
|
const handleClickOutside = (event) => {
|
|
12500
12529
|
if (showVideoModal && videoModalRef.current && !videoModalRef.current.contains(event.target)) {
|
|
12501
12530
|
handleVideoCancel();
|
|
@@ -12657,8 +12686,8 @@ var QuillComponent_default = QuillComponent;
|
|
|
12657
12686
|
// src/components/RichEditor/RichEditor.tsx
|
|
12658
12687
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12659
12688
|
var RichEditor = (props) => {
|
|
12660
|
-
const [isClient, setIsClient] = (0,
|
|
12661
|
-
(0,
|
|
12689
|
+
const [isClient, setIsClient] = (0, import_react21.useState)(false);
|
|
12690
|
+
(0, import_react21.useEffect)(() => {
|
|
12662
12691
|
setIsClient(typeof window !== "undefined");
|
|
12663
12692
|
}, []);
|
|
12664
12693
|
if (!isClient) return null;
|
|
@@ -12667,7 +12696,7 @@ var RichEditor = (props) => {
|
|
|
12667
12696
|
var RichEditor_default = RichEditor;
|
|
12668
12697
|
|
|
12669
12698
|
// src/components/FormFields/RichEditorFormField.tsx
|
|
12670
|
-
var
|
|
12699
|
+
var import_react22 = require("react");
|
|
12671
12700
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12672
12701
|
var RichEditorFormField = (_a) => {
|
|
12673
12702
|
var _b = _a, {
|
|
@@ -12702,7 +12731,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12702
12731
|
},
|
|
12703
12732
|
defaultValue: ""
|
|
12704
12733
|
});
|
|
12705
|
-
const [caracterQuantity, setCaracterQuantity] = (0,
|
|
12734
|
+
const [caracterQuantity, setCaracterQuantity] = (0, import_react22.useState)(maxLength);
|
|
12706
12735
|
const handleCharacterCountChange = (count) => {
|
|
12707
12736
|
if (maxLength !== void 0) {
|
|
12708
12737
|
setCaracterQuantity(Math.max(0, maxLength - count));
|
|
@@ -12750,7 +12779,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12750
12779
|
|
|
12751
12780
|
// src/components/FormFields/CalendarFormField.tsx
|
|
12752
12781
|
var import_react_hook_form13 = require("react-hook-form");
|
|
12753
|
-
var
|
|
12782
|
+
var import_react23 = require("react");
|
|
12754
12783
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12755
12784
|
var CalendarFormField = (_a) => {
|
|
12756
12785
|
var _b = _a, {
|
|
@@ -12774,7 +12803,7 @@ var CalendarFormField = (_a) => {
|
|
|
12774
12803
|
"allowPastDates",
|
|
12775
12804
|
"maxYearsFromNow"
|
|
12776
12805
|
]);
|
|
12777
|
-
const handleValidate = (0,
|
|
12806
|
+
const handleValidate = (0, import_react23.useCallback)(
|
|
12778
12807
|
(value) => {
|
|
12779
12808
|
var _a2;
|
|
12780
12809
|
if (value === void 0 || value === null) {
|
|
@@ -12829,7 +12858,7 @@ var CalendarFormField = (_a) => {
|
|
|
12829
12858
|
|
|
12830
12859
|
// src/components/FormFields/TimePickerFormField.tsx
|
|
12831
12860
|
var import_react_hook_form14 = require("react-hook-form");
|
|
12832
|
-
var
|
|
12861
|
+
var import_react24 = require("react");
|
|
12833
12862
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12834
12863
|
var TimePickerFormField = (_a) => {
|
|
12835
12864
|
var _b = _a, {
|
|
@@ -12847,7 +12876,7 @@ var TimePickerFormField = (_a) => {
|
|
|
12847
12876
|
"validationErrorMessage",
|
|
12848
12877
|
"rules"
|
|
12849
12878
|
]);
|
|
12850
|
-
const handleValidate = (0,
|
|
12879
|
+
const handleValidate = (0, import_react24.useCallback)(
|
|
12851
12880
|
(value) => {
|
|
12852
12881
|
var _a2;
|
|
12853
12882
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -12899,11 +12928,11 @@ var TimePickerFormField = (_a) => {
|
|
|
12899
12928
|
};
|
|
12900
12929
|
|
|
12901
12930
|
// src/hooks/useImageUpload.ts
|
|
12902
|
-
var
|
|
12931
|
+
var import_react25 = require("react");
|
|
12903
12932
|
var useImageUpload = (options) => {
|
|
12904
|
-
const [isUploading, setIsUploading] = (0,
|
|
12905
|
-
const [progress, setProgress] = (0,
|
|
12906
|
-
const [error, setError] = (0,
|
|
12933
|
+
const [isUploading, setIsUploading] = (0, import_react25.useState)(false);
|
|
12934
|
+
const [progress, setProgress] = (0, import_react25.useState)(null);
|
|
12935
|
+
const [error, setError] = (0, import_react25.useState)(null);
|
|
12907
12936
|
const {
|
|
12908
12937
|
onSuccess,
|
|
12909
12938
|
onError,
|
|
@@ -12913,7 +12942,7 @@ var useImageUpload = (options) => {
|
|
|
12913
12942
|
allowedTypes = ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
|
12914
12943
|
uploadConfig
|
|
12915
12944
|
} = options;
|
|
12916
|
-
const validateFile = (0,
|
|
12945
|
+
const validateFile = (0, import_react25.useCallback)(
|
|
12917
12946
|
(file) => {
|
|
12918
12947
|
if (!allowedTypes.includes(file.type)) {
|
|
12919
12948
|
const errorMsg = "Tipo de arquivo n\xE3o suportado";
|
|
@@ -12931,7 +12960,7 @@ var useImageUpload = (options) => {
|
|
|
12931
12960
|
},
|
|
12932
12961
|
[allowedTypes, maxFileSize, onError]
|
|
12933
12962
|
);
|
|
12934
|
-
const uploadFile = (0,
|
|
12963
|
+
const uploadFile = (0, import_react25.useCallback)(
|
|
12935
12964
|
(file) => __async(null, null, function* () {
|
|
12936
12965
|
if (!validateFile(file)) {
|
|
12937
12966
|
return null;
|
|
@@ -12984,7 +13013,7 @@ var useImageUpload = (options) => {
|
|
|
12984
13013
|
}),
|
|
12985
13014
|
[validateFile, onSuccess, onError, onProgress]
|
|
12986
13015
|
);
|
|
12987
|
-
const reset = (0,
|
|
13016
|
+
const reset = (0, import_react25.useCallback)(() => {
|
|
12988
13017
|
setIsUploading(false);
|
|
12989
13018
|
setProgress(null);
|
|
12990
13019
|
setError(null);
|