@lets-events/react 12.3.1 → 12.3.3
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +126 -158
- package/dist/index.mjs +66 -98
- package/package.json +1 -1
- package/src/components/Button/index.tsx +1 -1
- package/src/components/Card.tsx +14 -2
- package/src/components/Drawer/index.tsx +10 -86
- package/src/components/Drawer/styledComponents.ts +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @lets-events/react@12.3.
|
|
2
|
+
> @lets-events/react@12.3.3 build
|
|
3
3
|
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
[34mCLI[39m Target: es6
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist\index.mjs [22m[
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
14
|
-
[32mCJS[39m [1mdist\index.js [22m[
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m378.86 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 225ms
|
|
14
|
+
[32mCJS[39m [1mdist\index.js [22m[32m392.90 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 226ms
|
|
16
16
|
[34mDTS[39m Build start
|
|
17
|
-
[32mDTS[39m ⚡️ Build success in
|
|
18
|
-
[32mDTS[39m [1mdist\index.d.mts [22m[32m398.
|
|
19
|
-
[32mDTS[39m [1mdist\index.d.ts [22m[32m398.
|
|
17
|
+
[32mDTS[39m ⚡️ Build success in 4529ms
|
|
18
|
+
[32mDTS[39m [1mdist\index.d.mts [22m[32m398.74 KB[39m
|
|
19
|
+
[32mDTS[39m [1mdist\index.d.ts [22m[32m398.74 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -11428,8 +11428,10 @@ declare const CardStyled: _stitches_react_types_styled_component.StyledComponent
|
|
|
11428
11428
|
type CardProps = ComponentProps<typeof CardStyled> & {
|
|
11429
11429
|
children: React__default.ReactNode;
|
|
11430
11430
|
as?: ElementType;
|
|
11431
|
+
padding?: string;
|
|
11432
|
+
radius?: string;
|
|
11431
11433
|
};
|
|
11432
|
-
declare function Card({ asChild, children, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
11434
|
+
declare function Card({ asChild, children, padding, radius, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
11433
11435
|
|
|
11434
11436
|
declare const TextareaFieldStyle: _stitches_react_types_styled_component.StyledComponent<React__default.ForwardRefExoticComponent<_radix_ui_themes.TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>, {
|
|
11435
11437
|
typography?: "tooltip" | "displayLarge" | "displayMedium" | "displaySmall" | "headline1" | "headline2" | "headline3" | "headline4" | "headline5" | "headline6" | "headline7" | "headline8" | "bodyXL" | "bodyL" | "bodyM" | "bodyS" | "bodyXS" | "bodyXXS" | "badgeLarge" | "badgeMedium" | "badgeSmall" | "badgeExtraSmall" | "popoversRegular" | "captionLarge" | "captionMedium" | "captionSmall" | "buttonLarge" | "buttonMedium" | "buttonSmall" | "buttonExtraSmall" | "labelLarge" | "labelMedium" | "labelSmall" | "labelExtraSmall" | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -11428,8 +11428,10 @@ declare const CardStyled: _stitches_react_types_styled_component.StyledComponent
|
|
|
11428
11428
|
type CardProps = ComponentProps<typeof CardStyled> & {
|
|
11429
11429
|
children: React__default.ReactNode;
|
|
11430
11430
|
as?: ElementType;
|
|
11431
|
+
padding?: string;
|
|
11432
|
+
radius?: string;
|
|
11431
11433
|
};
|
|
11432
|
-
declare function Card({ asChild, children, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
11434
|
+
declare function Card({ asChild, children, padding, radius, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
11433
11435
|
|
|
11434
11436
|
declare const TextareaFieldStyle: _stitches_react_types_styled_component.StyledComponent<React__default.ForwardRefExoticComponent<_radix_ui_themes.TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>, {
|
|
11435
11437
|
typography?: "tooltip" | "displayLarge" | "displayMedium" | "displaySmall" | "headline1" | "headline2" | "headline3" | "headline4" | "headline5" | "headline6" | "headline7" | "headline8" | "bodyXL" | "bodyL" | "bodyM" | "bodyS" | "bodyXS" | "bodyXXS" | "badgeLarge" | "badgeMedium" | "badgeSmall" | "badgeExtraSmall" | "popoversRegular" | "captionLarge" | "captionMedium" | "captionSmall" | "buttonLarge" | "buttonMedium" | "buttonSmall" | "buttonExtraSmall" | "labelLarge" | "labelMedium" | "labelSmall" | "labelExtraSmall" | undefined;
|
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;
|
|
@@ -1877,7 +1877,7 @@ function Button(_a) {
|
|
|
1877
1877
|
return "md";
|
|
1878
1878
|
}
|
|
1879
1879
|
}, [size]);
|
|
1880
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonStyled, __spreadProps(__spreadValues({ as: Component, disabled: disabled || loading
|
|
1880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonStyled, __spreadProps(__spreadValues({ as: Component }, props), { disabled: disabled || loading, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SpinningDiv, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "circle-notch", size: spinnerSize }) }) : children }));
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
1883
1883
|
// src/components/ButtonGroup.tsx
|
|
@@ -8138,9 +8138,6 @@ function Calendar(_a) {
|
|
|
8138
8138
|
] })) });
|
|
8139
8139
|
}
|
|
8140
8140
|
|
|
8141
|
-
// src/components/Drawer/index.tsx
|
|
8142
|
-
var import_react9 = require("react");
|
|
8143
|
-
|
|
8144
8141
|
// src/components/Drawer/styledComponents.ts
|
|
8145
8142
|
var DrawerOverlayStyled = styled("div", {
|
|
8146
8143
|
position: "fixed",
|
|
@@ -8148,8 +8145,7 @@ var DrawerOverlayStyled = styled("div", {
|
|
|
8148
8145
|
right: 0,
|
|
8149
8146
|
width: "100vw",
|
|
8150
8147
|
height: "100vh",
|
|
8151
|
-
background: "rgba(0, 0, 0, 0.4)"
|
|
8152
|
-
zIndex: 1e3
|
|
8148
|
+
background: "rgba(0, 0, 0, 0.4)"
|
|
8153
8149
|
});
|
|
8154
8150
|
var DrawerContainerStyled = styled("div", {
|
|
8155
8151
|
position: "absolute",
|
|
@@ -8202,82 +8198,44 @@ function Drawer({
|
|
|
8202
8198
|
children,
|
|
8203
8199
|
goBackIcon,
|
|
8204
8200
|
goBackAction,
|
|
8205
|
-
zIndex
|
|
8201
|
+
zIndex = 1e3
|
|
8206
8202
|
}) {
|
|
8207
8203
|
if (!isOpen) return null;
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
className: currentElement.className,
|
|
8232
|
-
id: currentElement.id,
|
|
8233
|
-
attributes: Array.from(currentElement.attributes || []).map((attr) => ({
|
|
8234
|
-
name: attr.name,
|
|
8235
|
-
value: attr.value
|
|
8236
|
-
}))
|
|
8237
|
-
});
|
|
8238
|
-
currentElement = currentElement.parentElement;
|
|
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 })
|
|
8268
|
-
] }),
|
|
8269
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
|
|
8204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
8205
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8206
|
+
DrawerOverlayStyled,
|
|
8207
|
+
{
|
|
8208
|
+
css: {
|
|
8209
|
+
zIndex
|
|
8210
|
+
},
|
|
8211
|
+
onClick: onClose
|
|
8212
|
+
}
|
|
8213
|
+
),
|
|
8214
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
8215
|
+
DrawerContainerStyled,
|
|
8216
|
+
{
|
|
8217
|
+
style: {
|
|
8218
|
+
width: width != null ? width : "34.25rem",
|
|
8219
|
+
backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"],
|
|
8220
|
+
zIndex: zIndex + 1
|
|
8221
|
+
},
|
|
8222
|
+
children: [
|
|
8223
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DrawerHeaderDiv, { children: [
|
|
8224
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex2, { gap: 8, align: "center", children: [
|
|
8225
|
+
goBackIcon && goBackIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
|
|
8226
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderTitle, { children: title })
|
|
8270
8227
|
] }),
|
|
8271
|
-
children
|
|
8272
|
-
]
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8228
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
|
|
8229
|
+
] }),
|
|
8230
|
+
children
|
|
8231
|
+
]
|
|
8232
|
+
}
|
|
8233
|
+
)
|
|
8234
|
+
] });
|
|
8277
8235
|
}
|
|
8278
8236
|
|
|
8279
8237
|
// src/components/TimePicker.tsx
|
|
8280
|
-
var
|
|
8238
|
+
var import_react9 = require("react");
|
|
8281
8239
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
8282
8240
|
var TimePickerStyled = styled("div", {
|
|
8283
8241
|
position: "relative",
|
|
@@ -8400,14 +8358,14 @@ function TimePicker({
|
|
|
8400
8358
|
hasError,
|
|
8401
8359
|
expand = false
|
|
8402
8360
|
}) {
|
|
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,
|
|
8361
|
+
const [hours, setHours] = (0, import_react9.useState)("00");
|
|
8362
|
+
const [minutes, setMinutes] = (0, import_react9.useState)("00");
|
|
8363
|
+
const [rawHours, setRawHours] = (0, import_react9.useState)("00");
|
|
8364
|
+
const [rawMinutes, setRawMinutes] = (0, import_react9.useState)("00");
|
|
8365
|
+
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
8366
|
+
const dropdownRef = (0, import_react9.useRef)(null);
|
|
8409
8367
|
useOnClickOutside(dropdownRef, () => setIsOpen(false));
|
|
8410
|
-
const handleIncrement = (0,
|
|
8368
|
+
const handleIncrement = (0, import_react9.useCallback)(
|
|
8411
8369
|
(type) => {
|
|
8412
8370
|
if (type === "hours") {
|
|
8413
8371
|
const next = (parseInt(hours) + 1) % 24;
|
|
@@ -8421,7 +8379,7 @@ function TimePicker({
|
|
|
8421
8379
|
},
|
|
8422
8380
|
[hours, minutes]
|
|
8423
8381
|
);
|
|
8424
|
-
const handleDecrement = (0,
|
|
8382
|
+
const handleDecrement = (0, import_react9.useCallback)(
|
|
8425
8383
|
(type) => {
|
|
8426
8384
|
if (type === "hours") {
|
|
8427
8385
|
const prev = (parseInt(hours) - 1 + 24) % 24;
|
|
@@ -8945,7 +8903,7 @@ function Switch(props) {
|
|
|
8945
8903
|
}
|
|
8946
8904
|
|
|
8947
8905
|
// src/components/Step.tsx
|
|
8948
|
-
var
|
|
8906
|
+
var import_react10 = __toESM(require("react"));
|
|
8949
8907
|
var import_themes15 = require("@radix-ui/themes");
|
|
8950
8908
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
8951
8909
|
var StepStyled = styled("div", {
|
|
@@ -9061,9 +9019,9 @@ function StepList(_a) {
|
|
|
9061
9019
|
"children",
|
|
9062
9020
|
"currentStep"
|
|
9063
9021
|
]);
|
|
9064
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children:
|
|
9065
|
-
if (
|
|
9066
|
-
return
|
|
9022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children: import_react10.default.Children.map(children, (child) => {
|
|
9023
|
+
if (import_react10.default.isValidElement(child) && child.type === StepTrigger) {
|
|
9024
|
+
return import_react10.default.cloneElement(child, { currentStep });
|
|
9067
9025
|
}
|
|
9068
9026
|
return child;
|
|
9069
9027
|
}) }));
|
|
@@ -9118,13 +9076,23 @@ var CardStyled = styled(import_themes16.Card, {
|
|
|
9118
9076
|
}
|
|
9119
9077
|
});
|
|
9120
9078
|
function Card(_a) {
|
|
9121
|
-
var _b = _a, {
|
|
9122
|
-
|
|
9079
|
+
var _b = _a, {
|
|
9080
|
+
asChild,
|
|
9081
|
+
children,
|
|
9082
|
+
padding,
|
|
9083
|
+
radius
|
|
9084
|
+
} = _b, props = __objRest(_b, [
|
|
9085
|
+
"asChild",
|
|
9086
|
+
"children",
|
|
9087
|
+
"padding",
|
|
9088
|
+
"radius"
|
|
9089
|
+
]);
|
|
9090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyled, __spreadProps(__spreadValues({}, props), { css: { padding, borderRadius: radius }, children }));
|
|
9123
9091
|
}
|
|
9124
9092
|
|
|
9125
9093
|
// src/components/TextareaField.tsx
|
|
9126
9094
|
var import_themes17 = require("@radix-ui/themes");
|
|
9127
|
-
var
|
|
9095
|
+
var import_react11 = __toESM(require("react"));
|
|
9128
9096
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
9129
9097
|
var TextareaFieldStyle = styled(import_themes17.TextArea, {
|
|
9130
9098
|
display: "flex",
|
|
@@ -9189,11 +9157,11 @@ var TextareaLimitIndicator = styled("div", {
|
|
|
9189
9157
|
padding: "$4"
|
|
9190
9158
|
}
|
|
9191
9159
|
});
|
|
9192
|
-
var TextareaField =
|
|
9160
|
+
var TextareaField = import_react11.default.forwardRef((_a, forwardedRef) => {
|
|
9193
9161
|
var _b = _a, { maxLength, color } = _b, props = __objRest(_b, ["maxLength", "color"]);
|
|
9194
|
-
const inputRef = (0,
|
|
9195
|
-
const [remaining, setRemaining] = (0,
|
|
9196
|
-
(0,
|
|
9162
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
9163
|
+
const [remaining, setRemaining] = (0, import_react11.useState)(maxLength);
|
|
9164
|
+
(0, import_react11.useEffect)(() => {
|
|
9197
9165
|
var _a2;
|
|
9198
9166
|
if (maxLength && inputRef.current) {
|
|
9199
9167
|
setRemaining(maxLength - ((_a2 = inputRef.current.value.length) != null ? _a2 : 0));
|
|
@@ -9228,12 +9196,12 @@ var TextareaField = import_react12.default.forwardRef((_a, forwardedRef) => {
|
|
|
9228
9196
|
});
|
|
9229
9197
|
|
|
9230
9198
|
// src/components/Toast/components/ToastItem.tsx
|
|
9231
|
-
var
|
|
9199
|
+
var import_react13 = require("react");
|
|
9232
9200
|
|
|
9233
9201
|
// src/components/Toast/styles/index.ts
|
|
9234
|
-
var
|
|
9202
|
+
var import_react12 = require("@stitches/react");
|
|
9235
9203
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
9236
|
-
var slideIn = (0,
|
|
9204
|
+
var slideIn = (0, import_react12.keyframes)({
|
|
9237
9205
|
from: {
|
|
9238
9206
|
transform: "translateX(calc(100% + 25px))",
|
|
9239
9207
|
opacity: 0
|
|
@@ -9243,7 +9211,7 @@ var slideIn = (0, import_react13.keyframes)({
|
|
|
9243
9211
|
opacity: 1
|
|
9244
9212
|
}
|
|
9245
9213
|
});
|
|
9246
|
-
var slideOut = (0,
|
|
9214
|
+
var slideOut = (0, import_react12.keyframes)({
|
|
9247
9215
|
from: {
|
|
9248
9216
|
transform: "translateX(0)",
|
|
9249
9217
|
opacity: 1
|
|
@@ -9253,7 +9221,7 @@ var slideOut = (0, import_react13.keyframes)({
|
|
|
9253
9221
|
opacity: 0
|
|
9254
9222
|
}
|
|
9255
9223
|
});
|
|
9256
|
-
var swipeOut = (0,
|
|
9224
|
+
var swipeOut = (0, import_react12.keyframes)({
|
|
9257
9225
|
from: {
|
|
9258
9226
|
transform: "translateX(var(--radix-toast-swipe-end-x))",
|
|
9259
9227
|
opacity: 1
|
|
@@ -9359,7 +9327,7 @@ function ToastItem({
|
|
|
9359
9327
|
toast,
|
|
9360
9328
|
onRemove
|
|
9361
9329
|
}) {
|
|
9362
|
-
const [open, setOpen] = (0,
|
|
9330
|
+
const [open, setOpen] = (0, import_react13.useState)(true);
|
|
9363
9331
|
const handleOpenChange = (open2) => {
|
|
9364
9332
|
setOpen(open2);
|
|
9365
9333
|
if (!open2) {
|
|
@@ -9383,17 +9351,17 @@ function ToastItem({
|
|
|
9383
9351
|
}
|
|
9384
9352
|
|
|
9385
9353
|
// src/components/Toast/components/ToastProvider.tsx
|
|
9386
|
-
var
|
|
9354
|
+
var import_react14 = require("react");
|
|
9387
9355
|
var ToastPrimitive2 = __toESM(require("@radix-ui/react-toast"));
|
|
9388
9356
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
9389
|
-
var ToastContext = (0,
|
|
9357
|
+
var ToastContext = (0, import_react14.createContext)(null);
|
|
9390
9358
|
function ToastProvider({
|
|
9391
9359
|
children,
|
|
9392
9360
|
defaultDuration = 5e3,
|
|
9393
9361
|
maxToasts = 5,
|
|
9394
9362
|
swipeDirection = "right"
|
|
9395
9363
|
}) {
|
|
9396
|
-
const [toasts, setToasts] = (0,
|
|
9364
|
+
const [toasts, setToasts] = (0, import_react14.useState)([]);
|
|
9397
9365
|
const addToast = (toastData) => {
|
|
9398
9366
|
const id = Math.random().toString(36).substr(2, 9);
|
|
9399
9367
|
const newToast = __spreadProps(__spreadValues({
|
|
@@ -9429,9 +9397,9 @@ function ToastProvider({
|
|
|
9429
9397
|
}
|
|
9430
9398
|
|
|
9431
9399
|
// src/components/Toast/hooks/useToast.ts
|
|
9432
|
-
var
|
|
9400
|
+
var import_react15 = require("react");
|
|
9433
9401
|
var useToast = () => {
|
|
9434
|
-
const context = (0,
|
|
9402
|
+
const context = (0, import_react15.useContext)(ToastContext);
|
|
9435
9403
|
if (!context) {
|
|
9436
9404
|
throw new Error("useToast deve ser usado dentro de um ToastProvider");
|
|
9437
9405
|
}
|
|
@@ -9489,11 +9457,11 @@ function Tooltip({
|
|
|
9489
9457
|
}
|
|
9490
9458
|
|
|
9491
9459
|
// src/components/MultiSelect/index.tsx
|
|
9492
|
-
var
|
|
9460
|
+
var import_react16 = __toESM(require("react"));
|
|
9493
9461
|
var import_themes19 = require("@radix-ui/themes");
|
|
9494
9462
|
var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
|
|
9495
9463
|
var import_free_solid_svg_icons3 = require("@fortawesome/free-solid-svg-icons");
|
|
9496
|
-
var
|
|
9464
|
+
var import_react17 = require("react");
|
|
9497
9465
|
|
|
9498
9466
|
// src/components/MultiSelect/styledComponents.ts
|
|
9499
9467
|
var import_themes18 = require("@radix-ui/themes");
|
|
@@ -9643,7 +9611,7 @@ var ButtonSelectAllStyled = styled("button", {
|
|
|
9643
9611
|
|
|
9644
9612
|
// src/components/MultiSelect/index.tsx
|
|
9645
9613
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9646
|
-
var MultiSelect =
|
|
9614
|
+
var MultiSelect = import_react16.default.forwardRef(
|
|
9647
9615
|
({
|
|
9648
9616
|
placeholder,
|
|
9649
9617
|
value: selectedValues = [],
|
|
@@ -9661,24 +9629,24 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9661
9629
|
selectedAllText,
|
|
9662
9630
|
selectedScroll = false
|
|
9663
9631
|
}, fowardedRef) => {
|
|
9664
|
-
const [isOpen, setIsOpen] = (0,
|
|
9665
|
-
const triggerRef = (0,
|
|
9666
|
-
const [allOptionsSelected, setAllOptionsSelected] = (0,
|
|
9667
|
-
const labelByValue = (0,
|
|
9632
|
+
const [isOpen, setIsOpen] = (0, import_react16.useState)(false);
|
|
9633
|
+
const triggerRef = (0, import_react16.useRef)(null);
|
|
9634
|
+
const [allOptionsSelected, setAllOptionsSelected] = (0, import_react16.useState)(false);
|
|
9635
|
+
const labelByValue = (0, import_react17.useMemo)(() => {
|
|
9668
9636
|
return options.reduce((prev, curr) => {
|
|
9669
9637
|
return __spreadProps(__spreadValues({}, prev), {
|
|
9670
9638
|
[curr.value]: curr.label
|
|
9671
9639
|
});
|
|
9672
9640
|
}, {});
|
|
9673
9641
|
}, [options]);
|
|
9674
|
-
const handleRemove = (0,
|
|
9642
|
+
const handleRemove = (0, import_react16.useCallback)(
|
|
9675
9643
|
(value) => {
|
|
9676
9644
|
const newValue = selectedValues.filter((v) => v !== value);
|
|
9677
9645
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
9678
9646
|
},
|
|
9679
9647
|
[selectedValues, onValueChange]
|
|
9680
9648
|
);
|
|
9681
|
-
const handleSelectAll = (0,
|
|
9649
|
+
const handleSelectAll = (0, import_react16.useCallback)(
|
|
9682
9650
|
(e) => {
|
|
9683
9651
|
e.preventDefault();
|
|
9684
9652
|
e.stopPropagation();
|
|
@@ -9693,7 +9661,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9693
9661
|
},
|
|
9694
9662
|
[selectedValues, options, onValueChange]
|
|
9695
9663
|
);
|
|
9696
|
-
const text = (0,
|
|
9664
|
+
const text = (0, import_react17.useMemo)(() => {
|
|
9697
9665
|
if (selectedValues.length > 0 && singleSelect) {
|
|
9698
9666
|
const value = selectedValues[0];
|
|
9699
9667
|
return labelByValue[value];
|
|
@@ -9704,7 +9672,7 @@ var MultiSelect = import_react17.default.forwardRef(
|
|
|
9704
9672
|
onValueChange == null ? void 0 : onValueChange([v]);
|
|
9705
9673
|
setIsOpen(false);
|
|
9706
9674
|
};
|
|
9707
|
-
const handleToggle = (0,
|
|
9675
|
+
const handleToggle = (0, import_react16.useCallback)(
|
|
9708
9676
|
(e) => {
|
|
9709
9677
|
e.preventDefault();
|
|
9710
9678
|
e.stopPropagation();
|
|
@@ -10143,7 +10111,7 @@ var TextAreaFormField = (_a) => {
|
|
|
10143
10111
|
|
|
10144
10112
|
// src/components/FormFields/TextFormField.tsx
|
|
10145
10113
|
var import_react_hook_form2 = require("react-hook-form");
|
|
10146
|
-
var
|
|
10114
|
+
var import_react18 = require("react");
|
|
10147
10115
|
var import_mask2 = require("@react-input/mask");
|
|
10148
10116
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
10149
10117
|
var TextFormField = (_a) => {
|
|
@@ -10166,7 +10134,7 @@ var TextFormField = (_a) => {
|
|
|
10166
10134
|
"onChange",
|
|
10167
10135
|
"valueFormatter"
|
|
10168
10136
|
]);
|
|
10169
|
-
const handleValidate = (0,
|
|
10137
|
+
const handleValidate = (0, import_react18.useCallback)(
|
|
10170
10138
|
(value) => {
|
|
10171
10139
|
var _a2;
|
|
10172
10140
|
if (value === void 0 || value === null || !required && value.trim() === "")
|
|
@@ -10188,7 +10156,7 @@ var TextFormField = (_a) => {
|
|
|
10188
10156
|
const haveError = !!fieldError;
|
|
10189
10157
|
const errorMsg = fieldError == null ? void 0 : fieldError.message;
|
|
10190
10158
|
const { value: formValue, onChange: formChange } = field;
|
|
10191
|
-
const formattedValue = (0,
|
|
10159
|
+
const formattedValue = (0, import_react18.useMemo)(() => {
|
|
10192
10160
|
let value = formValue;
|
|
10193
10161
|
if (valueFormatter) value = valueFormatter.format(value);
|
|
10194
10162
|
if (mask) value = (0, import_mask2.format)(value != null ? value : "", mask);
|
|
@@ -10783,7 +10751,7 @@ function StateFormField({
|
|
|
10783
10751
|
}
|
|
10784
10752
|
|
|
10785
10753
|
// src/components/FormFields/AddressFormFields/CityFormField.tsx
|
|
10786
|
-
var
|
|
10754
|
+
var import_react19 = require("react");
|
|
10787
10755
|
var import_react_hook_form7 = require("react-hook-form");
|
|
10788
10756
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
10789
10757
|
function CityFormField({
|
|
@@ -10796,9 +10764,9 @@ function CityFormField({
|
|
|
10796
10764
|
}) {
|
|
10797
10765
|
const { control, watch } = (0, import_react_hook_form7.useFormContext)();
|
|
10798
10766
|
const selectedState = watch(stateName);
|
|
10799
|
-
const [cities, setCities] = (0,
|
|
10800
|
-
const [loading, setLoading] = (0,
|
|
10801
|
-
(0,
|
|
10767
|
+
const [cities, setCities] = (0, import_react19.useState)([]);
|
|
10768
|
+
const [loading, setLoading] = (0, import_react19.useState)(false);
|
|
10769
|
+
(0, import_react19.useEffect)(() => {
|
|
10802
10770
|
if (!isBrazil) {
|
|
10803
10771
|
setCities([]);
|
|
10804
10772
|
return;
|
|
@@ -11186,10 +11154,10 @@ var EmailFormField = ({
|
|
|
11186
11154
|
var import_react_hook_form12 = require("react-hook-form");
|
|
11187
11155
|
|
|
11188
11156
|
// src/components/RichEditor/RichEditor.tsx
|
|
11189
|
-
var
|
|
11157
|
+
var import_react21 = require("react");
|
|
11190
11158
|
|
|
11191
11159
|
// src/components/RichEditor/QuillComponent.tsx
|
|
11192
|
-
var
|
|
11160
|
+
var import_react20 = require("react");
|
|
11193
11161
|
var import_react_quilljs = require("react-quilljs");
|
|
11194
11162
|
|
|
11195
11163
|
// src/utils/uploadService.ts
|
|
@@ -12258,12 +12226,12 @@ var QuillComponent = ({
|
|
|
12258
12226
|
onCharacterCountChange,
|
|
12259
12227
|
maxLength
|
|
12260
12228
|
}) => {
|
|
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,
|
|
12229
|
+
const [showVideoModal, setShowVideoModal] = (0, import_react20.useState)(false);
|
|
12230
|
+
const [videoUrl, setVideoUrl] = (0, import_react20.useState)("");
|
|
12231
|
+
const [showLinkModal, setShowLinkModal] = (0, import_react20.useState)(false);
|
|
12232
|
+
const [linkUrl, setLinkUrl] = (0, import_react20.useState)("");
|
|
12233
|
+
const videoModalRef = (0, import_react20.useRef)(null);
|
|
12234
|
+
const linkModalRef = (0, import_react20.useRef)(null);
|
|
12267
12235
|
const { addToast, removeToast } = useToast();
|
|
12268
12236
|
const formatHTML = (html) => {
|
|
12269
12237
|
const parser = new DOMParser();
|
|
@@ -12327,7 +12295,7 @@ var QuillComponent = ({
|
|
|
12327
12295
|
placeholder,
|
|
12328
12296
|
readOnly: disabled
|
|
12329
12297
|
});
|
|
12330
|
-
const handleImageUpload = (0,
|
|
12298
|
+
const handleImageUpload = (0, import_react20.useCallback)(
|
|
12331
12299
|
(file) => __async(null, null, function* () {
|
|
12332
12300
|
if (disabled || !quill || !uploadConfig) return;
|
|
12333
12301
|
try {
|
|
@@ -12359,7 +12327,7 @@ var QuillComponent = ({
|
|
|
12359
12327
|
}),
|
|
12360
12328
|
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
12361
12329
|
);
|
|
12362
|
-
(0,
|
|
12330
|
+
(0, import_react20.useEffect)(() => {
|
|
12363
12331
|
if (quill && value) {
|
|
12364
12332
|
const currentContent = quill.root.innerHTML;
|
|
12365
12333
|
if (currentContent !== value) {
|
|
@@ -12373,7 +12341,7 @@ var QuillComponent = ({
|
|
|
12373
12341
|
}
|
|
12374
12342
|
}
|
|
12375
12343
|
}, [quill, value]);
|
|
12376
|
-
(0,
|
|
12344
|
+
(0, import_react20.useEffect)(() => {
|
|
12377
12345
|
if (quill) {
|
|
12378
12346
|
quill.on("text-change", (delta, oldDelta, source) => {
|
|
12379
12347
|
if (source === "user") {
|
|
@@ -12428,7 +12396,7 @@ var QuillComponent = ({
|
|
|
12428
12396
|
}, 2e3);
|
|
12429
12397
|
}
|
|
12430
12398
|
}, [quill, onChange, handleImageUpload, onCharacterCountChange]);
|
|
12431
|
-
(0,
|
|
12399
|
+
(0, import_react20.useEffect)(() => {
|
|
12432
12400
|
if (quill) {
|
|
12433
12401
|
quill.enable(!disabled);
|
|
12434
12402
|
if (!disabled) {
|
|
@@ -12439,11 +12407,11 @@ var QuillComponent = ({
|
|
|
12439
12407
|
}
|
|
12440
12408
|
}
|
|
12441
12409
|
}, [quill, disabled]);
|
|
12442
|
-
const handleLinkCancel = (0,
|
|
12410
|
+
const handleLinkCancel = (0, import_react20.useCallback)(() => {
|
|
12443
12411
|
setLinkUrl("");
|
|
12444
12412
|
setShowLinkModal(false);
|
|
12445
12413
|
}, []);
|
|
12446
|
-
const handleLinkSubmit = (0,
|
|
12414
|
+
const handleLinkSubmit = (0, import_react20.useCallback)(() => {
|
|
12447
12415
|
if (!linkUrl.trim() || !quill) return;
|
|
12448
12416
|
const url = linkUrl.trim();
|
|
12449
12417
|
const selection = quill.getSelection();
|
|
@@ -12458,11 +12426,11 @@ var QuillComponent = ({
|
|
|
12458
12426
|
setLinkUrl("");
|
|
12459
12427
|
setShowLinkModal(false);
|
|
12460
12428
|
}, [linkUrl, quill]);
|
|
12461
|
-
const handleVideoCancel = (0,
|
|
12429
|
+
const handleVideoCancel = (0, import_react20.useCallback)(() => {
|
|
12462
12430
|
setVideoUrl("");
|
|
12463
12431
|
setShowVideoModal(false);
|
|
12464
12432
|
}, []);
|
|
12465
|
-
const handleVideoSubmit = (0,
|
|
12433
|
+
const handleVideoSubmit = (0, import_react20.useCallback)(() => {
|
|
12466
12434
|
var _a, _b;
|
|
12467
12435
|
if (!videoUrl.trim() || !quill) return;
|
|
12468
12436
|
let processedUrl = videoUrl.trim();
|
|
@@ -12495,7 +12463,7 @@ var QuillComponent = ({
|
|
|
12495
12463
|
setVideoUrl("");
|
|
12496
12464
|
setShowVideoModal(false);
|
|
12497
12465
|
}, [videoUrl, quill]);
|
|
12498
|
-
(0,
|
|
12466
|
+
(0, import_react20.useEffect)(() => {
|
|
12499
12467
|
const handleClickOutside = (event) => {
|
|
12500
12468
|
if (showVideoModal && videoModalRef.current && !videoModalRef.current.contains(event.target)) {
|
|
12501
12469
|
handleVideoCancel();
|
|
@@ -12657,8 +12625,8 @@ var QuillComponent_default = QuillComponent;
|
|
|
12657
12625
|
// src/components/RichEditor/RichEditor.tsx
|
|
12658
12626
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12659
12627
|
var RichEditor = (props) => {
|
|
12660
|
-
const [isClient, setIsClient] = (0,
|
|
12661
|
-
(0,
|
|
12628
|
+
const [isClient, setIsClient] = (0, import_react21.useState)(false);
|
|
12629
|
+
(0, import_react21.useEffect)(() => {
|
|
12662
12630
|
setIsClient(typeof window !== "undefined");
|
|
12663
12631
|
}, []);
|
|
12664
12632
|
if (!isClient) return null;
|
|
@@ -12667,7 +12635,7 @@ var RichEditor = (props) => {
|
|
|
12667
12635
|
var RichEditor_default = RichEditor;
|
|
12668
12636
|
|
|
12669
12637
|
// src/components/FormFields/RichEditorFormField.tsx
|
|
12670
|
-
var
|
|
12638
|
+
var import_react22 = require("react");
|
|
12671
12639
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12672
12640
|
var RichEditorFormField = (_a) => {
|
|
12673
12641
|
var _b = _a, {
|
|
@@ -12702,7 +12670,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12702
12670
|
},
|
|
12703
12671
|
defaultValue: ""
|
|
12704
12672
|
});
|
|
12705
|
-
const [caracterQuantity, setCaracterQuantity] = (0,
|
|
12673
|
+
const [caracterQuantity, setCaracterQuantity] = (0, import_react22.useState)(maxLength);
|
|
12706
12674
|
const handleCharacterCountChange = (count) => {
|
|
12707
12675
|
if (maxLength !== void 0) {
|
|
12708
12676
|
setCaracterQuantity(Math.max(0, maxLength - count));
|
|
@@ -12750,7 +12718,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12750
12718
|
|
|
12751
12719
|
// src/components/FormFields/CalendarFormField.tsx
|
|
12752
12720
|
var import_react_hook_form13 = require("react-hook-form");
|
|
12753
|
-
var
|
|
12721
|
+
var import_react23 = require("react");
|
|
12754
12722
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12755
12723
|
var CalendarFormField = (_a) => {
|
|
12756
12724
|
var _b = _a, {
|
|
@@ -12774,7 +12742,7 @@ var CalendarFormField = (_a) => {
|
|
|
12774
12742
|
"allowPastDates",
|
|
12775
12743
|
"maxYearsFromNow"
|
|
12776
12744
|
]);
|
|
12777
|
-
const handleValidate = (0,
|
|
12745
|
+
const handleValidate = (0, import_react23.useCallback)(
|
|
12778
12746
|
(value) => {
|
|
12779
12747
|
var _a2;
|
|
12780
12748
|
if (value === void 0 || value === null) {
|
|
@@ -12829,7 +12797,7 @@ var CalendarFormField = (_a) => {
|
|
|
12829
12797
|
|
|
12830
12798
|
// src/components/FormFields/TimePickerFormField.tsx
|
|
12831
12799
|
var import_react_hook_form14 = require("react-hook-form");
|
|
12832
|
-
var
|
|
12800
|
+
var import_react24 = require("react");
|
|
12833
12801
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12834
12802
|
var TimePickerFormField = (_a) => {
|
|
12835
12803
|
var _b = _a, {
|
|
@@ -12847,7 +12815,7 @@ var TimePickerFormField = (_a) => {
|
|
|
12847
12815
|
"validationErrorMessage",
|
|
12848
12816
|
"rules"
|
|
12849
12817
|
]);
|
|
12850
|
-
const handleValidate = (0,
|
|
12818
|
+
const handleValidate = (0, import_react24.useCallback)(
|
|
12851
12819
|
(value) => {
|
|
12852
12820
|
var _a2;
|
|
12853
12821
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -12899,11 +12867,11 @@ var TimePickerFormField = (_a) => {
|
|
|
12899
12867
|
};
|
|
12900
12868
|
|
|
12901
12869
|
// src/hooks/useImageUpload.ts
|
|
12902
|
-
var
|
|
12870
|
+
var import_react25 = require("react");
|
|
12903
12871
|
var useImageUpload = (options) => {
|
|
12904
|
-
const [isUploading, setIsUploading] = (0,
|
|
12905
|
-
const [progress, setProgress] = (0,
|
|
12906
|
-
const [error, setError] = (0,
|
|
12872
|
+
const [isUploading, setIsUploading] = (0, import_react25.useState)(false);
|
|
12873
|
+
const [progress, setProgress] = (0, import_react25.useState)(null);
|
|
12874
|
+
const [error, setError] = (0, import_react25.useState)(null);
|
|
12907
12875
|
const {
|
|
12908
12876
|
onSuccess,
|
|
12909
12877
|
onError,
|
|
@@ -12913,7 +12881,7 @@ var useImageUpload = (options) => {
|
|
|
12913
12881
|
allowedTypes = ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
|
12914
12882
|
uploadConfig
|
|
12915
12883
|
} = options;
|
|
12916
|
-
const validateFile = (0,
|
|
12884
|
+
const validateFile = (0, import_react25.useCallback)(
|
|
12917
12885
|
(file) => {
|
|
12918
12886
|
if (!allowedTypes.includes(file.type)) {
|
|
12919
12887
|
const errorMsg = "Tipo de arquivo n\xE3o suportado";
|
|
@@ -12931,7 +12899,7 @@ var useImageUpload = (options) => {
|
|
|
12931
12899
|
},
|
|
12932
12900
|
[allowedTypes, maxFileSize, onError]
|
|
12933
12901
|
);
|
|
12934
|
-
const uploadFile = (0,
|
|
12902
|
+
const uploadFile = (0, import_react25.useCallback)(
|
|
12935
12903
|
(file) => __async(null, null, function* () {
|
|
12936
12904
|
if (!validateFile(file)) {
|
|
12937
12905
|
return null;
|
|
@@ -12984,7 +12952,7 @@ var useImageUpload = (options) => {
|
|
|
12984
12952
|
}),
|
|
12985
12953
|
[validateFile, onSuccess, onError, onProgress]
|
|
12986
12954
|
);
|
|
12987
|
-
const reset = (0,
|
|
12955
|
+
const reset = (0, import_react25.useCallback)(() => {
|
|
12988
12956
|
setIsUploading(false);
|
|
12989
12957
|
setProgress(null);
|
|
12990
12958
|
setError(null);
|
package/dist/index.mjs
CHANGED
|
@@ -143,7 +143,7 @@ var require_react_is_development = __commonJS({
|
|
|
143
143
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
144
144
|
var Element = REACT_ELEMENT_TYPE;
|
|
145
145
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
146
|
-
var
|
|
146
|
+
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
147
147
|
var Lazy = REACT_LAZY_TYPE;
|
|
148
148
|
var Memo = REACT_MEMO_TYPE;
|
|
149
149
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -202,7 +202,7 @@ var require_react_is_development = __commonJS({
|
|
|
202
202
|
exports.ContextProvider = ContextProvider;
|
|
203
203
|
exports.Element = Element;
|
|
204
204
|
exports.ForwardRef = ForwardRef;
|
|
205
|
-
exports.Fragment =
|
|
205
|
+
exports.Fragment = Fragment6;
|
|
206
206
|
exports.Lazy = Lazy;
|
|
207
207
|
exports.Memo = Memo;
|
|
208
208
|
exports.Portal = Portal;
|
|
@@ -1761,7 +1761,7 @@ function Button(_a) {
|
|
|
1761
1761
|
return "md";
|
|
1762
1762
|
}
|
|
1763
1763
|
}, [size]);
|
|
1764
|
-
return /* @__PURE__ */ jsx3(ButtonStyled, __spreadProps(__spreadValues({ as: Component, disabled: disabled || loading
|
|
1764
|
+
return /* @__PURE__ */ jsx3(ButtonStyled, __spreadProps(__spreadValues({ as: Component }, props), { disabled: disabled || loading, children: loading ? /* @__PURE__ */ jsx3(SpinningDiv, { children: /* @__PURE__ */ jsx3(Icon_default, { name: "circle-notch", size: spinnerSize }) }) : children }));
|
|
1765
1765
|
}
|
|
1766
1766
|
|
|
1767
1767
|
// src/components/ButtonGroup.tsx
|
|
@@ -8026,9 +8026,6 @@ function Calendar(_a) {
|
|
|
8026
8026
|
] })) });
|
|
8027
8027
|
}
|
|
8028
8028
|
|
|
8029
|
-
// src/components/Drawer/index.tsx
|
|
8030
|
-
import { useRef as useRef4 } from "react";
|
|
8031
|
-
|
|
8032
8029
|
// src/components/Drawer/styledComponents.ts
|
|
8033
8030
|
var DrawerOverlayStyled = styled("div", {
|
|
8034
8031
|
position: "fixed",
|
|
@@ -8036,8 +8033,7 @@ var DrawerOverlayStyled = styled("div", {
|
|
|
8036
8033
|
right: 0,
|
|
8037
8034
|
width: "100vw",
|
|
8038
8035
|
height: "100vh",
|
|
8039
|
-
background: "rgba(0, 0, 0, 0.4)"
|
|
8040
|
-
zIndex: 1e3
|
|
8036
|
+
background: "rgba(0, 0, 0, 0.4)"
|
|
8041
8037
|
});
|
|
8042
8038
|
var DrawerContainerStyled = styled("div", {
|
|
8043
8039
|
position: "absolute",
|
|
@@ -8080,7 +8076,7 @@ var GoBackButtonStyled = styled("button", {
|
|
|
8080
8076
|
});
|
|
8081
8077
|
|
|
8082
8078
|
// src/components/Drawer/index.tsx
|
|
8083
|
-
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
8079
|
+
import { Fragment, jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
8084
8080
|
function Drawer({
|
|
8085
8081
|
isOpen,
|
|
8086
8082
|
onClose,
|
|
@@ -8090,82 +8086,44 @@ function Drawer({
|
|
|
8090
8086
|
children,
|
|
8091
8087
|
goBackIcon,
|
|
8092
8088
|
goBackAction,
|
|
8093
|
-
zIndex
|
|
8089
|
+
zIndex = 1e3
|
|
8094
8090
|
}) {
|
|
8095
8091
|
if (!isOpen) return null;
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
className: currentElement.className,
|
|
8120
|
-
id: currentElement.id,
|
|
8121
|
-
attributes: Array.from(currentElement.attributes || []).map((attr) => ({
|
|
8122
|
-
name: attr.name,
|
|
8123
|
-
value: attr.value
|
|
8124
|
-
}))
|
|
8125
|
-
});
|
|
8126
|
-
currentElement = currentElement.parentElement;
|
|
8127
|
-
}
|
|
8128
|
-
if ((_a = drawerContainerRef.current) == null ? void 0 : _a.contains(target)) {
|
|
8129
|
-
return;
|
|
8130
|
-
}
|
|
8131
|
-
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]");
|
|
8132
|
-
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]");
|
|
8133
|
-
if (!shouldPreventClose) {
|
|
8134
|
-
onClose == null ? void 0 : onClose();
|
|
8135
|
-
}
|
|
8136
|
-
});
|
|
8137
|
-
return /* @__PURE__ */ jsx16(
|
|
8138
|
-
DrawerOverlayStyled,
|
|
8139
|
-
{
|
|
8140
|
-
css: {
|
|
8141
|
-
zIndex
|
|
8142
|
-
},
|
|
8143
|
-
children: /* @__PURE__ */ jsxs7(
|
|
8144
|
-
DrawerContainerStyled,
|
|
8145
|
-
{
|
|
8146
|
-
ref: drawerContainerRef,
|
|
8147
|
-
style: {
|
|
8148
|
-
width: width != null ? width : "34.25rem",
|
|
8149
|
-
backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"]
|
|
8150
|
-
},
|
|
8151
|
-
children: [
|
|
8152
|
-
/* @__PURE__ */ jsxs7(DrawerHeaderDiv, { children: [
|
|
8153
|
-
/* @__PURE__ */ jsxs7(Flex2, { gap: 8, align: "center", children: [
|
|
8154
|
-
goBackIcon && goBackIcon && /* @__PURE__ */ jsx16(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
|
|
8155
|
-
/* @__PURE__ */ jsx16(DrawerHeaderTitle, { children: title })
|
|
8156
|
-
] }),
|
|
8157
|
-
/* @__PURE__ */ jsx16(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ jsx16(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
|
|
8092
|
+
return /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
8093
|
+
/* @__PURE__ */ jsx16(
|
|
8094
|
+
DrawerOverlayStyled,
|
|
8095
|
+
{
|
|
8096
|
+
css: {
|
|
8097
|
+
zIndex
|
|
8098
|
+
},
|
|
8099
|
+
onClick: onClose
|
|
8100
|
+
}
|
|
8101
|
+
),
|
|
8102
|
+
/* @__PURE__ */ jsxs7(
|
|
8103
|
+
DrawerContainerStyled,
|
|
8104
|
+
{
|
|
8105
|
+
style: {
|
|
8106
|
+
width: width != null ? width : "34.25rem",
|
|
8107
|
+
backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"],
|
|
8108
|
+
zIndex: zIndex + 1
|
|
8109
|
+
},
|
|
8110
|
+
children: [
|
|
8111
|
+
/* @__PURE__ */ jsxs7(DrawerHeaderDiv, { children: [
|
|
8112
|
+
/* @__PURE__ */ jsxs7(Flex2, { gap: 8, align: "center", children: [
|
|
8113
|
+
goBackIcon && goBackIcon && /* @__PURE__ */ jsx16(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
|
|
8114
|
+
/* @__PURE__ */ jsx16(DrawerHeaderTitle, { children: title })
|
|
8158
8115
|
] }),
|
|
8159
|
-
children
|
|
8160
|
-
]
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8116
|
+
/* @__PURE__ */ jsx16(DrawerHeaderCloseButton, { onClick: onClose, children: /* @__PURE__ */ jsx16(Icon_default, { size: "xl", color: "$dark600", name: "xmark" }) })
|
|
8117
|
+
] }),
|
|
8118
|
+
children
|
|
8119
|
+
]
|
|
8120
|
+
}
|
|
8121
|
+
)
|
|
8122
|
+
] });
|
|
8165
8123
|
}
|
|
8166
8124
|
|
|
8167
8125
|
// src/components/TimePicker.tsx
|
|
8168
|
-
import { useCallback, useRef as
|
|
8126
|
+
import { useCallback, useRef as useRef4, useState as useState3 } from "react";
|
|
8169
8127
|
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
8170
8128
|
var TimePickerStyled = styled("div", {
|
|
8171
8129
|
position: "relative",
|
|
@@ -8293,7 +8251,7 @@ function TimePicker({
|
|
|
8293
8251
|
const [rawHours, setRawHours] = useState3("00");
|
|
8294
8252
|
const [rawMinutes, setRawMinutes] = useState3("00");
|
|
8295
8253
|
const [isOpen, setIsOpen] = useState3(false);
|
|
8296
|
-
const dropdownRef =
|
|
8254
|
+
const dropdownRef = useRef4(null);
|
|
8297
8255
|
useOnClickOutside(dropdownRef, () => setIsOpen(false));
|
|
8298
8256
|
const handleIncrement = useCallback(
|
|
8299
8257
|
(type) => {
|
|
@@ -8495,7 +8453,7 @@ function TimePicker({
|
|
|
8495
8453
|
|
|
8496
8454
|
// src/components/Alert.tsx
|
|
8497
8455
|
import { Theme as Theme2, AlertDialog } from "@radix-ui/themes";
|
|
8498
|
-
import { Fragment, jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
8456
|
+
import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
8499
8457
|
var AlertDialogSimpleStyled = styled(AlertDialog.Content, {
|
|
8500
8458
|
fontFamily: "$default",
|
|
8501
8459
|
lineHeight: "$base",
|
|
@@ -8609,10 +8567,10 @@ function Alert(_a) {
|
|
|
8609
8567
|
"completAlert",
|
|
8610
8568
|
"simpleAlert"
|
|
8611
8569
|
]);
|
|
8612
|
-
return /* @__PURE__ */ jsxs9(
|
|
8570
|
+
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
8613
8571
|
simpleAlert && /* @__PURE__ */ jsx18(Theme2, { children: /* @__PURE__ */ jsxs9(AlertDialog.Root, { children: [
|
|
8614
8572
|
/* @__PURE__ */ jsx18(AlertDialog.Trigger, { children: trigger }),
|
|
8615
|
-
/* @__PURE__ */ jsx18(
|
|
8573
|
+
/* @__PURE__ */ jsx18(Fragment2, { children: /* @__PURE__ */ jsxs9(AlertDialogSimpleStyled, __spreadProps(__spreadValues({}, props), { children: [
|
|
8616
8574
|
/* @__PURE__ */ jsx18(AlertDialogDescriptionStyled, { children: simpleAlert.description }),
|
|
8617
8575
|
simpleAlert.cancel && /* @__PURE__ */ jsx18(AlertDialog.Cancel, { children: /* @__PURE__ */ jsx18(Button, { variant: "text", children: /* @__PURE__ */ jsx18(Icon_default, { name: "close" }) }) })
|
|
8618
8576
|
] })) })
|
|
@@ -9006,13 +8964,23 @@ var CardStyled = styled(CardRadix, {
|
|
|
9006
8964
|
}
|
|
9007
8965
|
});
|
|
9008
8966
|
function Card(_a) {
|
|
9009
|
-
var _b = _a, {
|
|
9010
|
-
|
|
8967
|
+
var _b = _a, {
|
|
8968
|
+
asChild,
|
|
8969
|
+
children,
|
|
8970
|
+
padding,
|
|
8971
|
+
radius
|
|
8972
|
+
} = _b, props = __objRest(_b, [
|
|
8973
|
+
"asChild",
|
|
8974
|
+
"children",
|
|
8975
|
+
"padding",
|
|
8976
|
+
"radius"
|
|
8977
|
+
]);
|
|
8978
|
+
return /* @__PURE__ */ jsx21(CardStyled, __spreadProps(__spreadValues({}, props), { css: { padding, borderRadius: radius }, children }));
|
|
9011
8979
|
}
|
|
9012
8980
|
|
|
9013
8981
|
// src/components/TextareaField.tsx
|
|
9014
8982
|
import { TextArea as TextAreaRadix } from "@radix-ui/themes";
|
|
9015
|
-
import React8, { useRef as
|
|
8983
|
+
import React8, { useRef as useRef5, useState as useState4, useEffect as useEffect4 } from "react";
|
|
9016
8984
|
import { jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
9017
8985
|
var TextareaFieldStyle = styled(TextAreaRadix, {
|
|
9018
8986
|
display: "flex",
|
|
@@ -9079,7 +9047,7 @@ var TextareaLimitIndicator = styled("div", {
|
|
|
9079
9047
|
});
|
|
9080
9048
|
var TextareaField = React8.forwardRef((_a, forwardedRef) => {
|
|
9081
9049
|
var _b = _a, { maxLength, color } = _b, props = __objRest(_b, ["maxLength", "color"]);
|
|
9082
|
-
const inputRef =
|
|
9050
|
+
const inputRef = useRef5(null);
|
|
9083
9051
|
const [remaining, setRemaining] = useState4(maxLength);
|
|
9084
9052
|
useEffect4(() => {
|
|
9085
9053
|
var _a2;
|
|
@@ -9377,7 +9345,7 @@ function Tooltip({
|
|
|
9377
9345
|
}
|
|
9378
9346
|
|
|
9379
9347
|
// src/components/MultiSelect/index.tsx
|
|
9380
|
-
import React9, { useCallback as useCallback2, useRef as
|
|
9348
|
+
import React9, { useCallback as useCallback2, useRef as useRef6, useState as useState7 } from "react";
|
|
9381
9349
|
import { DropdownMenu as DropdownMenu4, Theme as Theme3 } from "@radix-ui/themes";
|
|
9382
9350
|
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
9383
9351
|
import {
|
|
@@ -9554,7 +9522,7 @@ var MultiSelect = React9.forwardRef(
|
|
|
9554
9522
|
selectedScroll = false
|
|
9555
9523
|
}, fowardedRef) => {
|
|
9556
9524
|
const [isOpen, setIsOpen] = useState7(false);
|
|
9557
|
-
const triggerRef =
|
|
9525
|
+
const triggerRef = useRef6(null);
|
|
9558
9526
|
const [allOptionsSelected, setAllOptionsSelected] = useState7(false);
|
|
9559
9527
|
const labelByValue = useMemo2(() => {
|
|
9560
9528
|
return options.reduce((prev, curr) => {
|
|
@@ -10661,14 +10629,14 @@ var brazilianStates = [
|
|
|
10661
10629
|
];
|
|
10662
10630
|
|
|
10663
10631
|
// src/components/FormFields/AddressFormFields/StateFormField.tsx
|
|
10664
|
-
import { Fragment as
|
|
10632
|
+
import { Fragment as Fragment3, jsx as jsx44 } from "react/jsx-runtime";
|
|
10665
10633
|
function StateFormField({
|
|
10666
10634
|
name,
|
|
10667
10635
|
label,
|
|
10668
10636
|
required,
|
|
10669
10637
|
isBrazil
|
|
10670
10638
|
}) {
|
|
10671
|
-
return /* @__PURE__ */ jsx44(
|
|
10639
|
+
return /* @__PURE__ */ jsx44(Fragment3, { children: isBrazil ? /* @__PURE__ */ jsx44(
|
|
10672
10640
|
SelectFormField,
|
|
10673
10641
|
{
|
|
10674
10642
|
name,
|
|
@@ -10682,7 +10650,7 @@ function StateFormField({
|
|
|
10682
10650
|
// src/components/FormFields/AddressFormFields/CityFormField.tsx
|
|
10683
10651
|
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
10684
10652
|
import { useFormContext as useFormContext5, Controller as Controller2 } from "react-hook-form";
|
|
10685
|
-
import { Fragment as
|
|
10653
|
+
import { Fragment as Fragment4, jsx as jsx45 } from "react/jsx-runtime";
|
|
10686
10654
|
function CityFormField({
|
|
10687
10655
|
name,
|
|
10688
10656
|
label,
|
|
@@ -10734,7 +10702,7 @@ function CityFormField({
|
|
|
10734
10702
|
}
|
|
10735
10703
|
fetchCities();
|
|
10736
10704
|
}, [selectedState, isBrazil]);
|
|
10737
|
-
return /* @__PURE__ */ jsx45(
|
|
10705
|
+
return /* @__PURE__ */ jsx45(Fragment4, { children: isBrazil && cities.length > 0 ? /* @__PURE__ */ jsx45(
|
|
10738
10706
|
Controller2,
|
|
10739
10707
|
{
|
|
10740
10708
|
name,
|
|
@@ -11086,7 +11054,7 @@ import { useController as useController3 } from "react-hook-form";
|
|
|
11086
11054
|
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
11087
11055
|
|
|
11088
11056
|
// src/components/RichEditor/QuillComponent.tsx
|
|
11089
|
-
import { useState as useState9, useRef as
|
|
11057
|
+
import { useState as useState9, useRef as useRef7, useEffect as useEffect6, useCallback as useCallback4 } from "react";
|
|
11090
11058
|
import { useQuill } from "react-quilljs";
|
|
11091
11059
|
|
|
11092
11060
|
// src/utils/uploadService.ts
|
|
@@ -12159,8 +12127,8 @@ var QuillComponent = ({
|
|
|
12159
12127
|
const [videoUrl, setVideoUrl] = useState9("");
|
|
12160
12128
|
const [showLinkModal, setShowLinkModal] = useState9(false);
|
|
12161
12129
|
const [linkUrl, setLinkUrl] = useState9("");
|
|
12162
|
-
const videoModalRef =
|
|
12163
|
-
const linkModalRef =
|
|
12130
|
+
const videoModalRef = useRef7(null);
|
|
12131
|
+
const linkModalRef = useRef7(null);
|
|
12164
12132
|
const { addToast, removeToast } = useToast();
|
|
12165
12133
|
const formatHTML = (html) => {
|
|
12166
12134
|
const parser = new DOMParser();
|
|
@@ -12565,7 +12533,7 @@ var RichEditor_default = RichEditor;
|
|
|
12565
12533
|
|
|
12566
12534
|
// src/components/FormFields/RichEditorFormField.tsx
|
|
12567
12535
|
import { useState as useState11 } from "react";
|
|
12568
|
-
import { Fragment as
|
|
12536
|
+
import { Fragment as Fragment5, jsx as jsx53, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12569
12537
|
var RichEditorFormField = (_a) => {
|
|
12570
12538
|
var _b = _a, {
|
|
12571
12539
|
name,
|
|
@@ -12620,7 +12588,7 @@ var RichEditorFormField = (_a) => {
|
|
|
12620
12588
|
}
|
|
12621
12589
|
),
|
|
12622
12590
|
/* @__PURE__ */ jsx53(Badge, { color: "grey", size: "xs", children: caracterQuantity })
|
|
12623
|
-
] }) : /* @__PURE__ */ jsx53(
|
|
12591
|
+
] }) : /* @__PURE__ */ jsx53(Fragment5, { children: label && /* @__PURE__ */ jsx53(
|
|
12624
12592
|
FormLabel,
|
|
12625
12593
|
{
|
|
12626
12594
|
name,
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ export function Button({ asChild, children, loading, ...props }: ButtonProps) {
|
|
|
32
32
|
}, [size]);
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<ButtonStyled as={Component} disabled={disabled || loading}
|
|
35
|
+
<ButtonStyled as={Component} {...props} disabled={disabled || loading}>
|
|
36
36
|
{loading ? (
|
|
37
37
|
<SpinningDiv>
|
|
38
38
|
<Icon name="circle-notch" size={spinnerSize} />
|
package/src/components/Card.tsx
CHANGED
|
@@ -45,8 +45,20 @@ export const CardStyled = styled(CardRadix, {
|
|
|
45
45
|
export type CardProps = ComponentProps<typeof CardStyled> & {
|
|
46
46
|
children: React.ReactNode;
|
|
47
47
|
as?: ElementType;
|
|
48
|
+
padding?: string;
|
|
49
|
+
radius?: string;
|
|
48
50
|
};
|
|
49
51
|
|
|
50
|
-
export function Card({
|
|
51
|
-
|
|
52
|
+
export function Card({
|
|
53
|
+
asChild,
|
|
54
|
+
children,
|
|
55
|
+
padding,
|
|
56
|
+
radius,
|
|
57
|
+
...props
|
|
58
|
+
}: CardProps) {
|
|
59
|
+
return (
|
|
60
|
+
<CardStyled {...props} css={{ padding, borderRadius: radius }}>
|
|
61
|
+
{children}
|
|
62
|
+
</CardStyled>
|
|
63
|
+
);
|
|
52
64
|
}
|
|
@@ -33,99 +33,23 @@ export function Drawer({
|
|
|
33
33
|
children,
|
|
34
34
|
goBackIcon,
|
|
35
35
|
goBackAction,
|
|
36
|
-
zIndex,
|
|
36
|
+
zIndex = 1000,
|
|
37
37
|
}: DrawerProps) {
|
|
38
38
|
if (!isOpen) return null;
|
|
39
|
-
const drawerContainerRef = useRef<HTMLDivElement>(null);
|
|
40
39
|
|
|
41
|
-
useOnClickOutside(drawerContainerRef, (event?: MouseEvent | TouchEvent) => {
|
|
42
|
-
if (!event || !drawerContainerRef.current) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
let target = event.target as Element;
|
|
47
|
-
|
|
48
|
-
if (target.tagName === "HTML" || target.tagName === "BODY") {
|
|
49
|
-
if (event instanceof MouseEvent) {
|
|
50
|
-
const actualElement = document.elementFromPoint(
|
|
51
|
-
event.clientX,
|
|
52
|
-
event.clientY
|
|
53
|
-
);
|
|
54
|
-
if (actualElement) {
|
|
55
|
-
target = actualElement;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
let currentElement: Element | null = target;
|
|
61
|
-
let hierarchy = [];
|
|
62
|
-
while (currentElement && currentElement !== document.body) {
|
|
63
|
-
hierarchy.push({
|
|
64
|
-
tagName: currentElement.tagName,
|
|
65
|
-
className: currentElement.className,
|
|
66
|
-
id: currentElement.id,
|
|
67
|
-
attributes: Array.from(currentElement.attributes || []).map((attr) => ({
|
|
68
|
-
name: attr.name,
|
|
69
|
-
value: attr.value,
|
|
70
|
-
})),
|
|
71
|
-
});
|
|
72
|
-
currentElement = currentElement.parentElement;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (drawerContainerRef.current?.contains(target)) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const isDropdownOpen =
|
|
79
|
-
target.closest("[data-radix-popper-content-wrapper]") ||
|
|
80
|
-
target.closest('[role="dialog"]') ||
|
|
81
|
-
target.closest('[data-state="open"]') ||
|
|
82
|
-
target.closest("[data-radix-dropdown-menu-content]") ||
|
|
83
|
-
target.closest("[data-radix-dropdown-menu-root]") ||
|
|
84
|
-
target.closest("[data-radix-dropdown-menu-trigger]") ||
|
|
85
|
-
target.closest("[data-radix-dropdown-menu-portal]") ||
|
|
86
|
-
target.closest("[data-radix-dropdown-menu-item]") ||
|
|
87
|
-
target.closest("[data-radix-dropdown-menu-checkbox-item]") ||
|
|
88
|
-
target.closest("[data-radix-dropdown-menu-radio-item]") ||
|
|
89
|
-
target.closest("[data-radix-dropdown-menu-separator]") ||
|
|
90
|
-
target.closest("[data-radix-dropdown-menu-label]") ||
|
|
91
|
-
target.closest("[data-radix-dropdown-menu-group]") ||
|
|
92
|
-
target.closest("[data-radix-dropdown-menu-sub]") ||
|
|
93
|
-
target.closest("[data-radix-dropdown-menu-sub-trigger]") ||
|
|
94
|
-
target.closest("[data-radix-dropdown-menu-sub-content]") ||
|
|
95
|
-
target.closest("[data-radix-dropdown-menu-radio-group]");
|
|
96
|
-
|
|
97
|
-
const shouldPreventClose =
|
|
98
|
-
isDropdownOpen ||
|
|
99
|
-
target.closest("[data-radix-dropdown-menu-root]") ||
|
|
100
|
-
target.closest("[data-radix-dropdown-menu-trigger]") ||
|
|
101
|
-
target.closest("[data-radix-dropdown-menu-content]") ||
|
|
102
|
-
target.closest("[data-radix-dropdown-menu-portal]") ||
|
|
103
|
-
target.closest("[data-radix-dropdown-menu-item]") ||
|
|
104
|
-
target.closest("[data-radix-dropdown-menu-checkbox-item]") ||
|
|
105
|
-
target.closest("[data-radix-dropdown-menu-radio-item]") ||
|
|
106
|
-
target.closest("[data-radix-dropdown-menu-separator]") ||
|
|
107
|
-
target.closest("[data-radix-dropdown-menu-label]") ||
|
|
108
|
-
target.closest("[data-radix-dropdown-menu-group]") ||
|
|
109
|
-
target.closest("[data-radix-dropdown-menu-sub]") ||
|
|
110
|
-
target.closest("[data-radix-dropdown-menu-sub-trigger]") ||
|
|
111
|
-
target.closest("[data-radix-dropdown-menu-sub-content]") ||
|
|
112
|
-
target.closest("[data-radix-dropdown-menu-radio-group]");
|
|
113
|
-
|
|
114
|
-
if (!shouldPreventClose) {
|
|
115
|
-
onClose?.();
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
40
|
return (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
41
|
+
<>
|
|
42
|
+
<DrawerOverlayStyled
|
|
43
|
+
css={{
|
|
44
|
+
zIndex,
|
|
45
|
+
}}
|
|
46
|
+
onClick={onClose}
|
|
47
|
+
/>
|
|
124
48
|
<DrawerContainerStyled
|
|
125
|
-
ref={drawerContainerRef}
|
|
126
49
|
style={{
|
|
127
50
|
width: width ?? "34.25rem",
|
|
128
51
|
backgroundColor: colors[backgroundColor ?? "neutral50"],
|
|
52
|
+
zIndex: zIndex + 1,
|
|
129
53
|
}}
|
|
130
54
|
>
|
|
131
55
|
<DrawerHeaderDiv>
|
|
@@ -143,6 +67,6 @@ export function Drawer({
|
|
|
143
67
|
</DrawerHeaderDiv>
|
|
144
68
|
{children}
|
|
145
69
|
</DrawerContainerStyled>
|
|
146
|
-
|
|
70
|
+
</>
|
|
147
71
|
);
|
|
148
72
|
}
|