@mlw-packages/react-components 1.7.9 → 1.7.11
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/dist/index.css +65 -49
- package/dist/index.d.mts +12 -15
- package/dist/index.d.ts +12 -15
- package/dist/index.js +619 -512
- package/dist/index.mjs +551 -444
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -566,6 +566,7 @@ __export(index_exports, {
|
|
|
566
566
|
CopyButton: () => CopyButton,
|
|
567
567
|
DateTimePicker: () => DateTimePicker,
|
|
568
568
|
DayView: () => DayView,
|
|
569
|
+
DebouncedInput: () => DebouncedInput,
|
|
569
570
|
DefaultEndHour: () => DefaultEndHour,
|
|
570
571
|
DefaultStartHour: () => DefaultStartHour,
|
|
571
572
|
DestructiveDialog: () => DestructiveDialog,
|
|
@@ -827,7 +828,7 @@ function cn(...inputs) {
|
|
|
827
828
|
var import_react = require("@phosphor-icons/react");
|
|
828
829
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
829
830
|
var buttonVariantsBase = (0, import_class_variance_authority.cva)(
|
|
830
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive active:scale-95",
|
|
831
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive [&:not(.no-active-animation)]:active:scale-95",
|
|
831
832
|
{
|
|
832
833
|
variants: {
|
|
833
834
|
variant: {
|
|
@@ -1062,7 +1063,7 @@ var LabelBase_default = LabelBase;
|
|
|
1062
1063
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1063
1064
|
var ErrorMessage = ({ error }) => {
|
|
1064
1065
|
if (!error) return null;
|
|
1065
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-sm text-destructive
|
|
1066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-sm text-destructive", children: error });
|
|
1066
1067
|
};
|
|
1067
1068
|
var ErrorMessage_default = ErrorMessage;
|
|
1068
1069
|
|
|
@@ -1446,7 +1447,7 @@ function Combobox({
|
|
|
1446
1447
|
},
|
|
1447
1448
|
[selected, onChange]
|
|
1448
1449
|
);
|
|
1449
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("flex flex-col
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("flex flex-col w-full min-w-[150px]", className), children: [
|
|
1450
1451
|
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LabelBase_default, { className: labelClassname, children: label }),
|
|
1451
1452
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1452
1453
|
ComboboxBase,
|
|
@@ -2128,7 +2129,7 @@ function Select({
|
|
|
2128
2129
|
className
|
|
2129
2130
|
}) {
|
|
2130
2131
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "data-testid": testIds.root ?? "select-root", children: [
|
|
2131
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: cn("
|
|
2132
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: cn("block text-sm font-medium", labelClassname), children: label }) : null,
|
|
2132
2133
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2133
2134
|
SelectBase,
|
|
2134
2135
|
{
|
|
@@ -2197,7 +2198,21 @@ function Select({
|
|
|
2197
2198
|
|
|
2198
2199
|
// src/components/selects/AvatarSelect.tsx
|
|
2199
2200
|
var import_react15 = require("react");
|
|
2201
|
+
var import_react16 = require("@phosphor-icons/react");
|
|
2200
2202
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2203
|
+
var DEFAULT_COLORS = [
|
|
2204
|
+
"bg-purple-100 text-purple-700",
|
|
2205
|
+
"bg-green-100 text-green-700",
|
|
2206
|
+
"bg-blue-100 text-blue-700"
|
|
2207
|
+
];
|
|
2208
|
+
var getColor = (value, colors2 = DEFAULT_COLORS) => {
|
|
2209
|
+
let hash = 0;
|
|
2210
|
+
for (let i = 0; i < value.length; i++) {
|
|
2211
|
+
hash = value.charCodeAt(i) + ((hash << 5) - hash);
|
|
2212
|
+
}
|
|
2213
|
+
const index = Math.abs(hash) % colors2.length;
|
|
2214
|
+
return colors2[index];
|
|
2215
|
+
};
|
|
2201
2216
|
var Square = ({
|
|
2202
2217
|
className,
|
|
2203
2218
|
children
|
|
@@ -2224,13 +2239,18 @@ function AvatarSelect({
|
|
|
2224
2239
|
selected,
|
|
2225
2240
|
label,
|
|
2226
2241
|
labelClassname,
|
|
2227
|
-
className
|
|
2242
|
+
className,
|
|
2243
|
+
colors: colors2
|
|
2228
2244
|
}) {
|
|
2245
|
+
const [open, setOpen] = (0, import_react15.useState)(false);
|
|
2229
2246
|
const id = (0, import_react15.useId)();
|
|
2247
|
+
const allItems = items || (groupItems ? Object.values(groupItems).flat() : []);
|
|
2248
|
+
const selectedItem = allItems.find((item) => item.value === selected);
|
|
2230
2249
|
const renderItem = (item) => {
|
|
2231
2250
|
const avatarContent = item.avatar ?? item.label.charAt(0).toUpperCase();
|
|
2251
|
+
const colorClass = item.avatarClassName ?? getColor(item.value, colors2);
|
|
2232
2252
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2233
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Square, { className:
|
|
2253
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Square, { className: colorClass, children: avatarContent }),
|
|
2234
2254
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate", children: item.label })
|
|
2235
2255
|
] });
|
|
2236
2256
|
};
|
|
@@ -2243,95 +2263,95 @@ function AvatarSelect({
|
|
|
2243
2263
|
children: label
|
|
2244
2264
|
}
|
|
2245
2265
|
) : null,
|
|
2246
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
" [&>span]:flex [&>span]:items-center [&>span]:gap-2 [&>span_[data-square]]:shrink-0",
|
|
2259
|
-
error && "border-red-500",
|
|
2260
|
-
className
|
|
2261
|
-
),
|
|
2262
|
-
"data-testid": testIds.trigger ?? "avatar-select-trigger",
|
|
2263
|
-
disabled,
|
|
2264
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2265
|
-
SelectValueBase,
|
|
2266
|
-
{
|
|
2267
|
-
placeholder,
|
|
2268
|
-
"data-testid": testIds.value ?? "avatar-select-value"
|
|
2269
|
-
}
|
|
2270
|
-
)
|
|
2271
|
-
}
|
|
2266
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PopoverBase, { open, onOpenChange: setOpen, children: [
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2268
|
+
ButtonBase,
|
|
2269
|
+
{
|
|
2270
|
+
id,
|
|
2271
|
+
variant: "select",
|
|
2272
|
+
role: "combobox",
|
|
2273
|
+
"aria-expanded": open,
|
|
2274
|
+
className: cn(
|
|
2275
|
+
"w-full justify-between px-3 font-normal",
|
|
2276
|
+
error && "border-red-500",
|
|
2277
|
+
className
|
|
2272
2278
|
),
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
+
disabled,
|
|
2280
|
+
"data-testid": testIds.trigger ?? "avatar-select-trigger",
|
|
2281
|
+
children: [
|
|
2282
|
+
selectedItem ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "flex items-center gap-2 truncate", children: renderItem(selectedItem) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-muted-foreground", children: placeholder }),
|
|
2283
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react16.CaretDownIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
2284
|
+
]
|
|
2285
|
+
}
|
|
2286
|
+
) }),
|
|
2287
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2288
|
+
PopoverContentBase,
|
|
2289
|
+
{
|
|
2290
|
+
className: "w-[--radix-popover-trigger-width] p-0",
|
|
2291
|
+
align: "start",
|
|
2292
|
+
"data-testid": testIds.content ?? "avatar-select-content",
|
|
2293
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CommandBase, { children: [
|
|
2294
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommandInputBase, { placeholder: "Search..." }),
|
|
2295
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CommandListBase, { children: [
|
|
2296
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommandEmptyBase, { children: "No results found." }),
|
|
2297
|
+
groupItems ? Object.keys(groupItems).map((key) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommandGroupBase, { heading: key, children: groupItems[key].map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2298
|
+
CommandItemBase,
|
|
2279
2299
|
{
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
)
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
"
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
)
|
|
2324
|
-
}
|
|
2325
|
-
)
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
),
|
|
2300
|
+
value: item.label,
|
|
2301
|
+
onSelect: () => {
|
|
2302
|
+
onChange(item.value);
|
|
2303
|
+
setOpen(false);
|
|
2304
|
+
},
|
|
2305
|
+
"data-testid": testIds.item?.(String(item.value)) ?? `avatar-select-item-${item.value}`,
|
|
2306
|
+
children: [
|
|
2307
|
+
renderItem(item),
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2309
|
+
import_react16.CheckIcon,
|
|
2310
|
+
{
|
|
2311
|
+
className: cn(
|
|
2312
|
+
"ml-auto h-4 w-4",
|
|
2313
|
+
selected === item.value ? "opacity-100" : "opacity-0"
|
|
2314
|
+
)
|
|
2315
|
+
}
|
|
2316
|
+
)
|
|
2317
|
+
]
|
|
2318
|
+
},
|
|
2319
|
+
item.value
|
|
2320
|
+
)) }, key)) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CommandGroupBase, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2321
|
+
CommandItemBase,
|
|
2322
|
+
{
|
|
2323
|
+
value: item.label,
|
|
2324
|
+
onSelect: () => {
|
|
2325
|
+
onChange(item.value);
|
|
2326
|
+
setOpen(false);
|
|
2327
|
+
},
|
|
2328
|
+
"data-testid": testIds.item?.(String(item.value)) ?? `avatar-select-item-${item.value}`,
|
|
2329
|
+
children: [
|
|
2330
|
+
renderItem(item),
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2332
|
+
import_react16.CheckIcon,
|
|
2333
|
+
{
|
|
2334
|
+
className: cn(
|
|
2335
|
+
"ml-auto h-4 w-4",
|
|
2336
|
+
selected === item.value ? "opacity-100" : "opacity-0"
|
|
2337
|
+
)
|
|
2338
|
+
}
|
|
2339
|
+
)
|
|
2340
|
+
]
|
|
2341
|
+
},
|
|
2342
|
+
item.value
|
|
2343
|
+
)) })
|
|
2344
|
+
] })
|
|
2345
|
+
] })
|
|
2346
|
+
}
|
|
2347
|
+
)
|
|
2348
|
+
] }),
|
|
2329
2349
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ErrorMessage_default, { error })
|
|
2330
2350
|
] });
|
|
2331
2351
|
}
|
|
2332
2352
|
|
|
2333
2353
|
// src/components/charts/Chart.tsx
|
|
2334
|
-
var
|
|
2354
|
+
var import_react21 = require("react");
|
|
2335
2355
|
var import_recharts = require("recharts");
|
|
2336
2356
|
|
|
2337
2357
|
// src/components/charts/utils/helpers.ts
|
|
@@ -2478,7 +2498,7 @@ var resolveChartMargins = (margins, chartMargins, showLabels) => {
|
|
|
2478
2498
|
var import_sonner = require("sonner");
|
|
2479
2499
|
|
|
2480
2500
|
// src/components/charts/components/controls/PeriodsDropdown.tsx
|
|
2481
|
-
var
|
|
2501
|
+
var import_react17 = require("react");
|
|
2482
2502
|
var import_framer_motion6 = require("framer-motion");
|
|
2483
2503
|
var import_ssr = require("@phosphor-icons/react/dist/ssr");
|
|
2484
2504
|
var import_ssr2 = require("@phosphor-icons/react/dist/ssr");
|
|
@@ -2501,11 +2521,11 @@ function PeriodsDropdown({
|
|
|
2501
2521
|
activePeriods
|
|
2502
2522
|
}) {
|
|
2503
2523
|
const periods = processedData.map((d) => String(d.name));
|
|
2504
|
-
const [open, setOpen] = (0,
|
|
2505
|
-
const wrapperRef = (0,
|
|
2506
|
-
const firstItemRef = (0,
|
|
2507
|
-
const listRef = (0,
|
|
2508
|
-
(0,
|
|
2524
|
+
const [open, setOpen] = (0, import_react17.useState)(false);
|
|
2525
|
+
const wrapperRef = (0, import_react17.useRef)(null);
|
|
2526
|
+
const firstItemRef = (0, import_react17.useRef)(null);
|
|
2527
|
+
const listRef = (0, import_react17.useRef)(null);
|
|
2528
|
+
(0, import_react17.useEffect)(() => {
|
|
2509
2529
|
const handleClickOutside = (e) => {
|
|
2510
2530
|
if (!wrapperRef.current) return;
|
|
2511
2531
|
if (!wrapperRef.current.contains(e.target)) setOpen(false);
|
|
@@ -2520,7 +2540,7 @@ function PeriodsDropdown({
|
|
|
2520
2540
|
document.removeEventListener("keydown", handleEscape);
|
|
2521
2541
|
};
|
|
2522
2542
|
}, []);
|
|
2523
|
-
(0,
|
|
2543
|
+
(0, import_react17.useEffect)(() => {
|
|
2524
2544
|
if (open && firstItemRef.current) {
|
|
2525
2545
|
firstItemRef.current.focus();
|
|
2526
2546
|
}
|
|
@@ -2613,7 +2633,7 @@ var PeriodsDropdown_default = PeriodsDropdown;
|
|
|
2613
2633
|
|
|
2614
2634
|
// src/components/charts/components/controls/ShowOnly.tsx
|
|
2615
2635
|
var import_framer_motion7 = require("framer-motion");
|
|
2616
|
-
var
|
|
2636
|
+
var import_react18 = require("@phosphor-icons/react");
|
|
2617
2637
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2618
2638
|
var ShowOnly = ({
|
|
2619
2639
|
showOnlyHighlighted,
|
|
@@ -2642,10 +2662,10 @@ var ShowOnly = ({
|
|
|
2642
2662
|
!hasHighlights ? "opacity-60 cursor-not-allowed pointer-events-none" : showOnlyHighlighted ? "bg-primary/10 text-primary shadow-sm border border-primary/20" : "bg-transparent text-muted-foreground border border-transparent hover:bg-muted/10 hover:text-foreground"
|
|
2643
2663
|
),
|
|
2644
2664
|
children: showOnlyHighlighted ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2645
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2665
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react18.EyeSlash, { size: 16, weight: "regular" }),
|
|
2646
2666
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "sr-only", children: "Exibir todos" })
|
|
2647
2667
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2648
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2668
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react18.Eye, { size: 16, weight: "bold" }),
|
|
2649
2669
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "sr-only", children: "Mostrar somente destacados" })
|
|
2650
2670
|
] })
|
|
2651
2671
|
}
|
|
@@ -2863,9 +2883,9 @@ var CloseAllButton = ({
|
|
|
2863
2883
|
var CloseAllButton_default = CloseAllButton;
|
|
2864
2884
|
|
|
2865
2885
|
// src/components/charts/components/tooltips/DraggableTooltip.tsx
|
|
2866
|
-
var
|
|
2886
|
+
var import_react19 = __toESM(require("react"));
|
|
2867
2887
|
var import_framer_motion9 = require("framer-motion");
|
|
2868
|
-
var
|
|
2888
|
+
var import_react20 = require("@phosphor-icons/react");
|
|
2869
2889
|
var import_ssr5 = require("@phosphor-icons/react/dist/ssr");
|
|
2870
2890
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2871
2891
|
var ALIGNMENT_THRESHOLD = 25;
|
|
@@ -2944,12 +2964,12 @@ var DraggableTooltipComponent = ({
|
|
|
2944
2964
|
valueFormatter: valueFormatter2,
|
|
2945
2965
|
categoryFormatter
|
|
2946
2966
|
}) => {
|
|
2947
|
-
const visibleKeys = (0,
|
|
2967
|
+
const visibleKeys = (0, import_react19.useMemo)(
|
|
2948
2968
|
() => showOnlyHighlighted && highlightedSeries && highlightedSeries.size > 0 ? dataKeys.filter((k) => highlightedSeries.has(k)) : dataKeys,
|
|
2949
2969
|
[showOnlyHighlighted, highlightedSeries, dataKeys]
|
|
2950
2970
|
);
|
|
2951
|
-
const TotalDisplay =
|
|
2952
|
-
const total = (0,
|
|
2971
|
+
const TotalDisplay = import_react19.default.memo(({ data: data2, visibleKeys: visibleKeys2, valueFormatter: localformatter }) => {
|
|
2972
|
+
const total = (0, import_react19.useMemo)(() => {
|
|
2953
2973
|
const numeric = visibleKeys2.map((k) => data2[k]).filter((v) => typeof v === "number");
|
|
2954
2974
|
return numeric.reduce((s, v) => s + (v || 0), 0);
|
|
2955
2975
|
}, [data2, visibleKeys2]);
|
|
@@ -2971,14 +2991,14 @@ var DraggableTooltipComponent = ({
|
|
|
2971
2991
|
)
|
|
2972
2992
|
] });
|
|
2973
2993
|
});
|
|
2974
|
-
const [localPos, setLocalPos] = (0,
|
|
2975
|
-
const [dragging, setDragging] = (0,
|
|
2976
|
-
const offsetRef = (0,
|
|
2977
|
-
const lastMouse = (0,
|
|
2978
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
2979
|
-
const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = (0,
|
|
2980
|
-
(0,
|
|
2981
|
-
const getAllTooltips = (0,
|
|
2994
|
+
const [localPos, setLocalPos] = (0, import_react19.useState)(position);
|
|
2995
|
+
const [dragging, setDragging] = (0, import_react19.useState)(false);
|
|
2996
|
+
const offsetRef = (0, import_react19.useRef)({ x: 0, y: 0 });
|
|
2997
|
+
const lastMouse = (0, import_react19.useRef)({ x: 0, y: 0 });
|
|
2998
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react19.useState)([]);
|
|
2999
|
+
const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = (0, import_react19.useState)(0);
|
|
3000
|
+
(0, import_react19.useEffect)(() => setLocalPos(position), [position]);
|
|
3001
|
+
const getAllTooltips = (0, import_react19.useCallback)(() => {
|
|
2982
3002
|
const response = [];
|
|
2983
3003
|
const ev = new CustomEvent("requestGlobalTooltips", {
|
|
2984
3004
|
detail: { requesterId: id, response }
|
|
@@ -2986,7 +3006,7 @@ var DraggableTooltipComponent = ({
|
|
|
2986
3006
|
window.dispatchEvent(ev);
|
|
2987
3007
|
return response;
|
|
2988
3008
|
}, [id]);
|
|
2989
|
-
const updateAlignmentGuides = (0,
|
|
3009
|
+
const updateAlignmentGuides = (0, import_react19.useCallback)(
|
|
2990
3010
|
(currentPosition) => {
|
|
2991
3011
|
const allTooltips = getAllTooltips();
|
|
2992
3012
|
const otherTooltips = allTooltips.filter((t) => t.id !== id);
|
|
@@ -3035,7 +3055,7 @@ var DraggableTooltipComponent = ({
|
|
|
3035
3055
|
},
|
|
3036
3056
|
[getAllTooltips, id]
|
|
3037
3057
|
);
|
|
3038
|
-
const snapToGuides = (0,
|
|
3058
|
+
const snapToGuides = (0, import_react19.useCallback)(
|
|
3039
3059
|
(position2) => {
|
|
3040
3060
|
const snappedPosition = { ...position2 };
|
|
3041
3061
|
let hasSnapped = false;
|
|
@@ -3082,7 +3102,7 @@ var DraggableTooltipComponent = ({
|
|
|
3082
3102
|
},
|
|
3083
3103
|
[alignmentGuides]
|
|
3084
3104
|
);
|
|
3085
|
-
(0,
|
|
3105
|
+
(0, import_react19.useEffect)(() => {
|
|
3086
3106
|
let rafId = null;
|
|
3087
3107
|
const handleMouseMove = (e) => {
|
|
3088
3108
|
if (!dragging) return;
|
|
@@ -3124,7 +3144,7 @@ var DraggableTooltipComponent = ({
|
|
|
3124
3144
|
document.body.style.userSelect = "";
|
|
3125
3145
|
};
|
|
3126
3146
|
}, [dragging, snapToGuides, updateAlignmentGuides, id, onPositionChange]);
|
|
3127
|
-
(0,
|
|
3147
|
+
(0, import_react19.useEffect)(() => {
|
|
3128
3148
|
const handleCloseAll = () => onClose(id);
|
|
3129
3149
|
const handleRequestTooltipCount = () => {
|
|
3130
3150
|
window.dispatchEvent(
|
|
@@ -3155,7 +3175,7 @@ var DraggableTooltipComponent = ({
|
|
|
3155
3175
|
});
|
|
3156
3176
|
};
|
|
3157
3177
|
}, [id, localPos, onClose]);
|
|
3158
|
-
(0,
|
|
3178
|
+
(0, import_react19.useEffect)(() => {
|
|
3159
3179
|
if (dragging) return;
|
|
3160
3180
|
let total = 0;
|
|
3161
3181
|
const timeoutId = setTimeout(() => {
|
|
@@ -3173,7 +3193,7 @@ var DraggableTooltipComponent = ({
|
|
|
3173
3193
|
}, 0);
|
|
3174
3194
|
return () => clearTimeout(timeoutId);
|
|
3175
3195
|
}, [localPos, dragging]);
|
|
3176
|
-
(0,
|
|
3196
|
+
(0, import_react19.useEffect)(() => {
|
|
3177
3197
|
const recount = () => {
|
|
3178
3198
|
if (dragging) return;
|
|
3179
3199
|
let total = 0;
|
|
@@ -3191,7 +3211,7 @@ var DraggableTooltipComponent = ({
|
|
|
3191
3211
|
window.addEventListener("recountTooltips", recount);
|
|
3192
3212
|
return () => window.removeEventListener("recountTooltips", recount);
|
|
3193
3213
|
}, [dragging]);
|
|
3194
|
-
const handleMouseDownLocal = (0,
|
|
3214
|
+
const handleMouseDownLocal = (0, import_react19.useCallback)(
|
|
3195
3215
|
(e) => {
|
|
3196
3216
|
e.preventDefault();
|
|
3197
3217
|
e.stopPropagation();
|
|
@@ -3202,7 +3222,7 @@ var DraggableTooltipComponent = ({
|
|
|
3202
3222
|
},
|
|
3203
3223
|
[id, onMouseDown]
|
|
3204
3224
|
);
|
|
3205
|
-
const handleTouchStartLocal = (0,
|
|
3225
|
+
const handleTouchStartLocal = (0, import_react19.useCallback)(
|
|
3206
3226
|
(e) => {
|
|
3207
3227
|
e.stopPropagation();
|
|
3208
3228
|
const touch = e.touches[0];
|
|
@@ -3217,7 +3237,7 @@ var DraggableTooltipComponent = ({
|
|
|
3217
3237
|
},
|
|
3218
3238
|
[id, onMouseDown]
|
|
3219
3239
|
);
|
|
3220
|
-
const handleCloseClick = (0,
|
|
3240
|
+
const handleCloseClick = (0, import_react19.useCallback)(
|
|
3221
3241
|
(e) => {
|
|
3222
3242
|
e.stopPropagation();
|
|
3223
3243
|
onClose(id);
|
|
@@ -3333,7 +3353,7 @@ var DraggableTooltipComponent = ({
|
|
|
3333
3353
|
onTouchStart: handleTouchStartLocal,
|
|
3334
3354
|
style: { touchAction: "none" },
|
|
3335
3355
|
children: [
|
|
3336
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3356
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react20.DotsSixVerticalIcon, { size: 16 }),
|
|
3337
3357
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-1", children: title && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center gap-2 pb-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "font-bold text-foreground text-base", children: title }) }) }),
|
|
3338
3358
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3339
3359
|
"button",
|
|
@@ -3363,7 +3383,7 @@ var DraggableTooltipComponent = ({
|
|
|
3363
3383
|
] }) }),
|
|
3364
3384
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "p-3 pt-2 space-y-2", children: [
|
|
3365
3385
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: dataLabel }),
|
|
3366
|
-
(0,
|
|
3386
|
+
(0, import_react19.useMemo)(
|
|
3367
3387
|
() => visibleKeys.map((key) => {
|
|
3368
3388
|
const value = data[key];
|
|
3369
3389
|
if (value === void 0) return null;
|
|
@@ -3481,7 +3501,7 @@ var DraggableTooltipComponent = ({
|
|
|
3481
3501
|
)
|
|
3482
3502
|
] });
|
|
3483
3503
|
};
|
|
3484
|
-
var DraggableTooltip =
|
|
3504
|
+
var DraggableTooltip = import_react19.default.memo(DraggableTooltipComponent);
|
|
3485
3505
|
DraggableTooltip.displayName = "DraggableTooltip";
|
|
3486
3506
|
var DraggableTooltip_default = DraggableTooltip;
|
|
3487
3507
|
|
|
@@ -3825,14 +3845,14 @@ var pillLabelRenderer_default = renderPillLabel;
|
|
|
3825
3845
|
|
|
3826
3846
|
// src/components/charts/Chart.tsx
|
|
3827
3847
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3828
|
-
var
|
|
3848
|
+
var DEFAULT_COLORS2 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
3829
3849
|
var Chart = ({
|
|
3830
3850
|
data,
|
|
3831
3851
|
series,
|
|
3832
3852
|
className,
|
|
3833
3853
|
height = 350,
|
|
3834
3854
|
width = "100%",
|
|
3835
|
-
colors: colors2 =
|
|
3855
|
+
colors: colors2 = DEFAULT_COLORS2,
|
|
3836
3856
|
gridColor,
|
|
3837
3857
|
showGrid = true,
|
|
3838
3858
|
showTooltip = true,
|
|
@@ -3855,7 +3875,7 @@ var Chart = ({
|
|
|
3855
3875
|
formatBR = false,
|
|
3856
3876
|
chartMargin
|
|
3857
3877
|
}) => {
|
|
3858
|
-
const smartConfig = (0,
|
|
3878
|
+
const smartConfig = (0, import_react21.useMemo)(() => {
|
|
3859
3879
|
const resolvedXAxisKey = typeof xAxis === "string" ? xAxis : xAxis && xAxis.dataKey || detectXAxis(data);
|
|
3860
3880
|
const xAxisConfig2 = typeof xAxis === "string" ? {
|
|
3861
3881
|
dataKey: resolvedXAxisKey,
|
|
@@ -3879,12 +3899,12 @@ var Chart = ({
|
|
|
3879
3899
|
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
3880
3900
|
}, [data, xAxis, labelMap]);
|
|
3881
3901
|
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
3882
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
3883
|
-
const [highlightedSeries, setHighlightedSeries] = (0,
|
|
3902
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react21.useState)([]);
|
|
3903
|
+
const [highlightedSeries, setHighlightedSeries] = (0, import_react21.useState)(
|
|
3884
3904
|
/* @__PURE__ */ new Set()
|
|
3885
3905
|
);
|
|
3886
|
-
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0,
|
|
3887
|
-
(0,
|
|
3906
|
+
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0, import_react21.useState)(false);
|
|
3907
|
+
(0, import_react21.useEffect)(() => {
|
|
3888
3908
|
if (highlightedSeries.size === 0 && showOnlyHighlighted) {
|
|
3889
3909
|
setShowOnlyHighlighted(false);
|
|
3890
3910
|
}
|
|
@@ -3893,9 +3913,9 @@ var Chart = ({
|
|
|
3893
3913
|
...item,
|
|
3894
3914
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
3895
3915
|
}));
|
|
3896
|
-
const wrapperRef = (0,
|
|
3897
|
-
const [measuredWidth, setMeasuredWidth] = (0,
|
|
3898
|
-
(0,
|
|
3916
|
+
const wrapperRef = (0, import_react21.useRef)(null);
|
|
3917
|
+
const [measuredWidth, setMeasuredWidth] = (0, import_react21.useState)(null);
|
|
3918
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
3899
3919
|
const el = wrapperRef.current;
|
|
3900
3920
|
if (!el) return;
|
|
3901
3921
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -3922,7 +3942,7 @@ var Chart = ({
|
|
|
3922
3942
|
);
|
|
3923
3943
|
}
|
|
3924
3944
|
const allKeys = seriesOrder.map((s) => s.key).filter(Boolean);
|
|
3925
|
-
const generateColors = (0,
|
|
3945
|
+
const generateColors = (0, import_react21.useCallback)(
|
|
3926
3946
|
(dataKeys) => {
|
|
3927
3947
|
const colorMap = {};
|
|
3928
3948
|
const allColors = generateAdditionalColors(colors2, dataKeys.length);
|
|
@@ -3933,25 +3953,25 @@ var Chart = ({
|
|
|
3933
3953
|
},
|
|
3934
3954
|
[colors2, mapperConfig]
|
|
3935
3955
|
);
|
|
3936
|
-
const finalColors = (0,
|
|
3956
|
+
const finalColors = (0, import_react21.useMemo)(
|
|
3937
3957
|
() => generateColors(allKeys),
|
|
3938
3958
|
[generateColors, allKeys]
|
|
3939
3959
|
);
|
|
3940
|
-
const adaptDataForTooltip = (0,
|
|
3960
|
+
const adaptDataForTooltip = (0, import_react21.useCallback)(
|
|
3941
3961
|
(universalData) => ({
|
|
3942
3962
|
...universalData,
|
|
3943
3963
|
name: String(universalData[xAxisConfig.dataKey] || "N/A")
|
|
3944
3964
|
}),
|
|
3945
3965
|
[xAxisConfig.dataKey]
|
|
3946
3966
|
);
|
|
3947
|
-
const activePeriods = (0,
|
|
3967
|
+
const activePeriods = (0, import_react21.useMemo)(
|
|
3948
3968
|
() => activeTooltips.map((t) => adaptDataForTooltip(t.data).name),
|
|
3949
3969
|
[activeTooltips, adaptDataForTooltip]
|
|
3950
3970
|
);
|
|
3951
|
-
(0,
|
|
3971
|
+
(0, import_react21.useEffect)(() => {
|
|
3952
3972
|
window.dispatchEvent(new Event("recountTooltips"));
|
|
3953
3973
|
}, [activeTooltips.length]);
|
|
3954
|
-
const toggleHighlight = (0,
|
|
3974
|
+
const toggleHighlight = (0, import_react21.useCallback)((key) => {
|
|
3955
3975
|
setHighlightedSeries((prev) => {
|
|
3956
3976
|
const next = new Set(prev);
|
|
3957
3977
|
if (next.has(key)) next.delete(key);
|
|
@@ -3959,7 +3979,7 @@ var Chart = ({
|
|
|
3959
3979
|
return next;
|
|
3960
3980
|
});
|
|
3961
3981
|
}, []);
|
|
3962
|
-
const maxDataValue = (0,
|
|
3982
|
+
const maxDataValue = (0, import_react21.useMemo)(() => {
|
|
3963
3983
|
let max = 0;
|
|
3964
3984
|
const numericKeys = allKeys;
|
|
3965
3985
|
for (const row of processedData) {
|
|
@@ -3971,7 +3991,7 @@ var Chart = ({
|
|
|
3971
3991
|
}
|
|
3972
3992
|
return max;
|
|
3973
3993
|
}, [processedData, allKeys]);
|
|
3974
|
-
const minDataValue = (0,
|
|
3994
|
+
const minDataValue = (0, import_react21.useMemo)(() => {
|
|
3975
3995
|
let min = 0;
|
|
3976
3996
|
const numericKeys = allKeys;
|
|
3977
3997
|
for (const row of processedData) {
|
|
@@ -3984,7 +4004,7 @@ var Chart = ({
|
|
|
3984
4004
|
}
|
|
3985
4005
|
return min;
|
|
3986
4006
|
}, [processedData, allKeys]);
|
|
3987
|
-
const niceMax = (0,
|
|
4007
|
+
const niceMax = (0, import_react21.useMemo)(() => {
|
|
3988
4008
|
let padding = 0.08;
|
|
3989
4009
|
if (maxDataValue > 1e6) padding = 0.05;
|
|
3990
4010
|
if (maxDataValue > 1e7) padding = 0.03;
|
|
@@ -3992,7 +4012,7 @@ var Chart = ({
|
|
|
3992
4012
|
const padded = maxDataValue * (1 + padding);
|
|
3993
4013
|
return niceCeil(padded);
|
|
3994
4014
|
}, [maxDataValue]);
|
|
3995
|
-
const computedWidth = (0,
|
|
4015
|
+
const computedWidth = (0, import_react21.useMemo)(() => {
|
|
3996
4016
|
if (typeof width === "number") return width;
|
|
3997
4017
|
const points = Math.max(1, processedData.length);
|
|
3998
4018
|
const barCount = series?.bar?.length ?? 0;
|
|
@@ -4021,7 +4041,7 @@ var Chart = ({
|
|
|
4021
4041
|
series?.area?.length,
|
|
4022
4042
|
niceMax
|
|
4023
4043
|
]);
|
|
4024
|
-
const toggleTooltip = (0,
|
|
4044
|
+
const toggleTooltip = (0, import_react21.useCallback)(
|
|
4025
4045
|
(tooltipId, data2, basePosition) => {
|
|
4026
4046
|
const existingIndex = activeTooltips.findIndex((t) => t.id === tooltipId);
|
|
4027
4047
|
if (existingIndex !== -1) {
|
|
@@ -4050,7 +4070,7 @@ var Chart = ({
|
|
|
4050
4070
|
},
|
|
4051
4071
|
[activeTooltips, maxTooltips]
|
|
4052
4072
|
);
|
|
4053
|
-
const handleChartClick = (0,
|
|
4073
|
+
const handleChartClick = (0, import_react21.useCallback)(
|
|
4054
4074
|
(e) => {
|
|
4055
4075
|
if (!enableDraggableTooltips) return;
|
|
4056
4076
|
const ev = e;
|
|
@@ -4068,7 +4088,7 @@ var Chart = ({
|
|
|
4068
4088
|
},
|
|
4069
4089
|
[enableDraggableTooltips, xAxisConfig.dataKey, toggleTooltip]
|
|
4070
4090
|
);
|
|
4071
|
-
const handleBarClick = (0,
|
|
4091
|
+
const handleBarClick = (0, import_react21.useCallback)(
|
|
4072
4092
|
(data2, index, event) => {
|
|
4073
4093
|
if (!enableDraggableTooltips) return;
|
|
4074
4094
|
event.stopPropagation();
|
|
@@ -4082,7 +4102,7 @@ var Chart = ({
|
|
|
4082
4102
|
},
|
|
4083
4103
|
[enableDraggableTooltips, xAxisConfig.dataKey, toggleTooltip]
|
|
4084
4104
|
);
|
|
4085
|
-
const handleSeriesClick = (0,
|
|
4105
|
+
const handleSeriesClick = (0, import_react21.useCallback)(
|
|
4086
4106
|
(...args) => {
|
|
4087
4107
|
if (args.length >= 3) {
|
|
4088
4108
|
const [data2, index, event] = args;
|
|
@@ -4093,7 +4113,7 @@ var Chart = ({
|
|
|
4093
4113
|
},
|
|
4094
4114
|
[handleBarClick, handleChartClick]
|
|
4095
4115
|
);
|
|
4096
|
-
const onTooltipPositionChange = (0,
|
|
4116
|
+
const onTooltipPositionChange = (0, import_react21.useCallback)(
|
|
4097
4117
|
(id, position) => {
|
|
4098
4118
|
setActiveTooltips(
|
|
4099
4119
|
(prev) => prev.map((t) => t.id === id ? { ...t, position } : t)
|
|
@@ -4101,11 +4121,11 @@ var Chart = ({
|
|
|
4101
4121
|
},
|
|
4102
4122
|
[]
|
|
4103
4123
|
);
|
|
4104
|
-
const titleClassName = (0,
|
|
4124
|
+
const titleClassName = (0, import_react21.useMemo)(
|
|
4105
4125
|
() => "text-xl font-semibold text-foreground mb-3",
|
|
4106
4126
|
[]
|
|
4107
4127
|
);
|
|
4108
|
-
const finalValueFormatter = (0,
|
|
4128
|
+
const finalValueFormatter = (0, import_react21.useMemo)(() => {
|
|
4109
4129
|
const nf = new Intl.NumberFormat("pt-BR", {
|
|
4110
4130
|
minimumFractionDigits: 2,
|
|
4111
4131
|
maximumFractionDigits: 2
|
|
@@ -4145,7 +4165,7 @@ var Chart = ({
|
|
|
4145
4165
|
};
|
|
4146
4166
|
return builtIn;
|
|
4147
4167
|
}, [valueFormatter2, formatBR]);
|
|
4148
|
-
const yTickFormatter = (0,
|
|
4168
|
+
const yTickFormatter = (0, import_react21.useMemo)(() => {
|
|
4149
4169
|
const nf = new Intl.NumberFormat("pt-BR", {
|
|
4150
4170
|
minimumFractionDigits: 2,
|
|
4151
4171
|
maximumFractionDigits: 2
|
|
@@ -4183,7 +4203,7 @@ var Chart = ({
|
|
|
4183
4203
|
const measuredInner = measuredWidth ? Math.max(0, measuredWidth - 32) : void 0;
|
|
4184
4204
|
const effectiveChartWidth = typeof width === "number" ? width : measuredInner ?? computedWidth;
|
|
4185
4205
|
const chartInnerWidth = effectiveChartWidth - finalChartLeftMargin - finalChartRightMargin;
|
|
4186
|
-
const openTooltipForPeriod = (0,
|
|
4206
|
+
const openTooltipForPeriod = (0, import_react21.useCallback)(
|
|
4187
4207
|
(periodName) => {
|
|
4188
4208
|
if (!enableDraggableTooltips) return;
|
|
4189
4209
|
const row = processedData.find((r) => String(r.name) === periodName);
|
|
@@ -4622,16 +4642,16 @@ var Chart = ({
|
|
|
4622
4642
|
var Chart_default = Chart;
|
|
4623
4643
|
|
|
4624
4644
|
// src/components/charts/BarChart.tsx
|
|
4625
|
-
var
|
|
4645
|
+
var import_react22 = require("react");
|
|
4626
4646
|
var import_recharts2 = require("recharts");
|
|
4627
4647
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4628
|
-
var
|
|
4648
|
+
var DEFAULT_COLORS3 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
4629
4649
|
var BarChart = ({
|
|
4630
4650
|
data,
|
|
4631
4651
|
className,
|
|
4632
4652
|
height = 350,
|
|
4633
4653
|
width = 900,
|
|
4634
|
-
colors: colors2 =
|
|
4654
|
+
colors: colors2 = DEFAULT_COLORS3,
|
|
4635
4655
|
gridColor,
|
|
4636
4656
|
showGrid = true,
|
|
4637
4657
|
showTooltip = true,
|
|
@@ -4654,7 +4674,7 @@ var BarChart = ({
|
|
|
4654
4674
|
containerPaddingLeft,
|
|
4655
4675
|
16
|
|
4656
4676
|
);
|
|
4657
|
-
const smartConfig = (0,
|
|
4677
|
+
const smartConfig = (0, import_react22.useMemo)(() => {
|
|
4658
4678
|
const providedMapper = yAxis ?? mapper;
|
|
4659
4679
|
if (autoDetect === true || xAxis == null || providedMapper == null) {
|
|
4660
4680
|
const detectedXAxis = detectXAxis(data);
|
|
@@ -4704,14 +4724,14 @@ var BarChart = ({
|
|
|
4704
4724
|
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
4705
4725
|
}, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
|
|
4706
4726
|
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
4707
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
4708
|
-
const [isDragging, setIsDragging] = (0,
|
|
4709
|
-
const [dragOffset, setDragOffset] = (0,
|
|
4727
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react22.useState)([]);
|
|
4728
|
+
const [isDragging, setIsDragging] = (0, import_react22.useState)(null);
|
|
4729
|
+
const [dragOffset, setDragOffset] = (0, import_react22.useState)({
|
|
4710
4730
|
x: 0,
|
|
4711
4731
|
y: 0
|
|
4712
4732
|
});
|
|
4713
|
-
const [globalTooltipCount, setGlobalTooltipCount] = (0,
|
|
4714
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
4733
|
+
const [globalTooltipCount, setGlobalTooltipCount] = (0, import_react22.useState)(0);
|
|
4734
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react22.useState)([]);
|
|
4715
4735
|
const processedData = data.map((item) => ({
|
|
4716
4736
|
...item,
|
|
4717
4737
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
@@ -4734,7 +4754,7 @@ var BarChart = ({
|
|
|
4734
4754
|
// Garantir que tem a propriedade 'name'
|
|
4735
4755
|
};
|
|
4736
4756
|
};
|
|
4737
|
-
const maxDataValue = (0,
|
|
4757
|
+
const maxDataValue = (0, import_react22.useMemo)(() => {
|
|
4738
4758
|
let max = 0;
|
|
4739
4759
|
const keys = Object.keys(mapperConfig);
|
|
4740
4760
|
for (const row of processedData) {
|
|
@@ -4747,7 +4767,7 @@ var BarChart = ({
|
|
|
4747
4767
|
}
|
|
4748
4768
|
return max;
|
|
4749
4769
|
}, [processedData, mapperConfig]);
|
|
4750
|
-
const niceMax = (0,
|
|
4770
|
+
const niceMax = (0, import_react22.useMemo)(() => {
|
|
4751
4771
|
let padding2 = 0.08;
|
|
4752
4772
|
if (maxDataValue > 1e6) padding2 = 0.05;
|
|
4753
4773
|
if (maxDataValue > 1e7) padding2 = 0.03;
|
|
@@ -4788,7 +4808,7 @@ var BarChart = ({
|
|
|
4788
4808
|
const GUIDE_THRESHOLD2 = 60;
|
|
4789
4809
|
const STRONG_SNAP_THRESHOLD2 = 35;
|
|
4790
4810
|
const PRECISION_SNAP_THRESHOLD2 = 8;
|
|
4791
|
-
const updateAlignmentGuides = (0,
|
|
4811
|
+
const updateAlignmentGuides = (0, import_react22.useCallback)(
|
|
4792
4812
|
(draggedTooltipId, currentPosition) => {
|
|
4793
4813
|
if (!isDragging) return;
|
|
4794
4814
|
const getAllTooltips = () => {
|
|
@@ -4852,7 +4872,7 @@ var BarChart = ({
|
|
|
4852
4872
|
},
|
|
4853
4873
|
[isDragging, activeTooltips]
|
|
4854
4874
|
);
|
|
4855
|
-
const snapToGuides = (0,
|
|
4875
|
+
const snapToGuides = (0, import_react22.useCallback)(
|
|
4856
4876
|
(position) => {
|
|
4857
4877
|
const snappedPosition = { ...position };
|
|
4858
4878
|
let hasSnapped = false;
|
|
@@ -4914,7 +4934,7 @@ var BarChart = ({
|
|
|
4914
4934
|
setIsDragging(tooltipId);
|
|
4915
4935
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
4916
4936
|
};
|
|
4917
|
-
(0,
|
|
4937
|
+
(0, import_react22.useEffect)(() => {
|
|
4918
4938
|
let rafId;
|
|
4919
4939
|
let lastMousePosition = { x: 0, y: 0 };
|
|
4920
4940
|
const handleGlobalMouseMove = (e) => {
|
|
@@ -4972,7 +4992,7 @@ var BarChart = ({
|
|
|
4972
4992
|
updateAlignmentGuides,
|
|
4973
4993
|
snapToGuides
|
|
4974
4994
|
]);
|
|
4975
|
-
(0,
|
|
4995
|
+
(0, import_react22.useEffect)(() => {
|
|
4976
4996
|
const handleCloseAllTooltips = () => {
|
|
4977
4997
|
setActiveTooltips([]);
|
|
4978
4998
|
setGlobalTooltipCount(0);
|
|
@@ -4982,7 +5002,7 @@ var BarChart = ({
|
|
|
4982
5002
|
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips);
|
|
4983
5003
|
};
|
|
4984
5004
|
}, []);
|
|
4985
|
-
(0,
|
|
5005
|
+
(0, import_react22.useEffect)(() => {
|
|
4986
5006
|
const handleTooltipCountRequest = () => {
|
|
4987
5007
|
window.dispatchEvent(
|
|
4988
5008
|
new CustomEvent("tooltipCountResponse", {
|
|
@@ -5021,7 +5041,7 @@ var BarChart = ({
|
|
|
5021
5041
|
);
|
|
5022
5042
|
};
|
|
5023
5043
|
}, [activeTooltips]);
|
|
5024
|
-
(0,
|
|
5044
|
+
(0, import_react22.useEffect)(() => {
|
|
5025
5045
|
if (isDragging) return;
|
|
5026
5046
|
let totalCount = 0;
|
|
5027
5047
|
const handleCountResponse = (event) => {
|
|
@@ -5287,7 +5307,7 @@ var BarChart = ({
|
|
|
5287
5307
|
var BarChart_default = BarChart;
|
|
5288
5308
|
|
|
5289
5309
|
// src/components/charts/LineChart.tsx
|
|
5290
|
-
var
|
|
5310
|
+
var import_react23 = require("react");
|
|
5291
5311
|
var import_recharts3 = require("recharts");
|
|
5292
5312
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5293
5313
|
var defaultData = [
|
|
@@ -5295,13 +5315,13 @@ var defaultData = [
|
|
|
5295
5315
|
{ name: "B", value: 200 },
|
|
5296
5316
|
{ name: "C", value: 150 }
|
|
5297
5317
|
];
|
|
5298
|
-
var
|
|
5318
|
+
var DEFAULT_COLORS4 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
5299
5319
|
var CustomLineChart = ({
|
|
5300
5320
|
data = defaultData,
|
|
5301
5321
|
className,
|
|
5302
5322
|
height = 300,
|
|
5303
5323
|
width = "100%",
|
|
5304
|
-
colors: colors2 =
|
|
5324
|
+
colors: colors2 = DEFAULT_COLORS4,
|
|
5305
5325
|
gridColor,
|
|
5306
5326
|
showGrid = true,
|
|
5307
5327
|
showTooltip = true,
|
|
@@ -5321,14 +5341,14 @@ var CustomLineChart = ({
|
|
|
5321
5341
|
containerPaddingLeft,
|
|
5322
5342
|
16
|
|
5323
5343
|
);
|
|
5324
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
5325
|
-
const [isDragging, setIsDragging] = (0,
|
|
5326
|
-
const [dragOffset, setDragOffset] = (0,
|
|
5344
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react23.useState)([]);
|
|
5345
|
+
const [isDragging, setIsDragging] = (0, import_react23.useState)(null);
|
|
5346
|
+
const [dragOffset, setDragOffset] = (0, import_react23.useState)({
|
|
5327
5347
|
x: 0,
|
|
5328
5348
|
y: 0
|
|
5329
5349
|
});
|
|
5330
|
-
const [globalTooltipCount, setGlobalTooltipCount] = (0,
|
|
5331
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
5350
|
+
const [globalTooltipCount, setGlobalTooltipCount] = (0, import_react23.useState)(0);
|
|
5351
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react23.useState)([]);
|
|
5332
5352
|
const generateColors = (dataKeys2) => {
|
|
5333
5353
|
const colorMap = {};
|
|
5334
5354
|
const allColors = generateAdditionalColors(colors2, dataKeys2.length);
|
|
@@ -5337,12 +5357,12 @@ var CustomLineChart = ({
|
|
|
5337
5357
|
});
|
|
5338
5358
|
return colorMap;
|
|
5339
5359
|
};
|
|
5340
|
-
const dataKeys = (0,
|
|
5360
|
+
const dataKeys = (0, import_react23.useMemo)(
|
|
5341
5361
|
() => data.length > 0 ? Object.keys(data[0]).filter((key) => key !== "name") : [],
|
|
5342
5362
|
[data]
|
|
5343
5363
|
);
|
|
5344
5364
|
const finalColors = generateColors(dataKeys);
|
|
5345
|
-
const maxDataValue = (0,
|
|
5365
|
+
const maxDataValue = (0, import_react23.useMemo)(() => {
|
|
5346
5366
|
let max = 0;
|
|
5347
5367
|
for (const row of data) {
|
|
5348
5368
|
const r = row;
|
|
@@ -5354,7 +5374,7 @@ var CustomLineChart = ({
|
|
|
5354
5374
|
}
|
|
5355
5375
|
return max;
|
|
5356
5376
|
}, [data, dataKeys]);
|
|
5357
|
-
const niceMax = (0,
|
|
5377
|
+
const niceMax = (0, import_react23.useMemo)(() => {
|
|
5358
5378
|
let padding2 = 0.08;
|
|
5359
5379
|
if (maxDataValue > 1e6) padding2 = 0.05;
|
|
5360
5380
|
if (maxDataValue > 1e7) padding2 = 0.03;
|
|
@@ -5430,10 +5450,10 @@ var CustomLineChart = ({
|
|
|
5430
5450
|
const handleChartBackgroundClick = () => {
|
|
5431
5451
|
setActiveTooltips([]);
|
|
5432
5452
|
};
|
|
5433
|
-
const handleCloseAllTooltips = (0,
|
|
5453
|
+
const handleCloseAllTooltips = (0, import_react23.useCallback)(() => {
|
|
5434
5454
|
window.dispatchEvent(new CustomEvent("closeAllTooltips"));
|
|
5435
5455
|
}, []);
|
|
5436
|
-
const updateAlignmentGuides = (0,
|
|
5456
|
+
const updateAlignmentGuides = (0, import_react23.useCallback)(
|
|
5437
5457
|
(draggedTooltipId, draggedPosition) => {
|
|
5438
5458
|
const SNAP_THRESHOLD = 15;
|
|
5439
5459
|
const draggedTooltip = activeTooltips.find(
|
|
@@ -5514,7 +5534,7 @@ var CustomLineChart = ({
|
|
|
5514
5534
|
},
|
|
5515
5535
|
[activeTooltips]
|
|
5516
5536
|
);
|
|
5517
|
-
const snapToGuides = (0,
|
|
5537
|
+
const snapToGuides = (0, import_react23.useCallback)(
|
|
5518
5538
|
(position) => {
|
|
5519
5539
|
const SNAP_DISTANCE = 10;
|
|
5520
5540
|
const snappedPosition = { ...position };
|
|
@@ -5542,7 +5562,7 @@ var CustomLineChart = ({
|
|
|
5542
5562
|
setIsDragging(tooltipId);
|
|
5543
5563
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
5544
5564
|
};
|
|
5545
|
-
(0,
|
|
5565
|
+
(0, import_react23.useEffect)(() => {
|
|
5546
5566
|
let rafId;
|
|
5547
5567
|
let lastMousePosition = { x: 0, y: 0 };
|
|
5548
5568
|
const handleGlobalMouseMove = (e) => {
|
|
@@ -5589,7 +5609,7 @@ var CustomLineChart = ({
|
|
|
5589
5609
|
updateAlignmentGuides,
|
|
5590
5610
|
snapToGuides
|
|
5591
5611
|
]);
|
|
5592
|
-
(0,
|
|
5612
|
+
(0, import_react23.useEffect)(() => {
|
|
5593
5613
|
const handleCloseAllTooltips2 = () => {
|
|
5594
5614
|
setActiveTooltips([]);
|
|
5595
5615
|
setGlobalTooltipCount(0);
|
|
@@ -5599,7 +5619,7 @@ var CustomLineChart = ({
|
|
|
5599
5619
|
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips2);
|
|
5600
5620
|
};
|
|
5601
5621
|
}, []);
|
|
5602
|
-
(0,
|
|
5622
|
+
(0, import_react23.useEffect)(() => {
|
|
5603
5623
|
const handleTooltipCountRequest = () => {
|
|
5604
5624
|
window.dispatchEvent(
|
|
5605
5625
|
new CustomEvent("tooltipCountResponse", {
|
|
@@ -5643,7 +5663,7 @@ var CustomLineChart = ({
|
|
|
5643
5663
|
);
|
|
5644
5664
|
};
|
|
5645
5665
|
}, [activeTooltips]);
|
|
5646
|
-
(0,
|
|
5666
|
+
(0, import_react23.useEffect)(() => {
|
|
5647
5667
|
if (isDragging) return;
|
|
5648
5668
|
let totalCount = 0;
|
|
5649
5669
|
const handleCountResponse = (event) => {
|
|
@@ -5867,7 +5887,7 @@ var defaultData2 = [
|
|
|
5867
5887
|
{ name: "Suporte", value: 1e3 },
|
|
5868
5888
|
{ name: "Outros", value: 800 }
|
|
5869
5889
|
];
|
|
5870
|
-
var
|
|
5890
|
+
var DEFAULT_COLORS5 = [
|
|
5871
5891
|
"#55af7d",
|
|
5872
5892
|
// verde do projeto
|
|
5873
5893
|
"#8e68ff",
|
|
@@ -5925,7 +5945,7 @@ var CustomPieChart = ({
|
|
|
5925
5945
|
centerX = "50%",
|
|
5926
5946
|
centerY = "50%"
|
|
5927
5947
|
}) => {
|
|
5928
|
-
const finalColors = colors2 ||
|
|
5948
|
+
const finalColors = colors2 || DEFAULT_COLORS5;
|
|
5929
5949
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("w-full rounded-lg bg-card p-4", className), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_recharts4.ResponsiveContainer, { width, height, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_recharts4.PieChart, { children: [
|
|
5930
5950
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5931
5951
|
import_recharts4.Pie,
|
|
@@ -5965,13 +5985,13 @@ var CustomPieChart = ({
|
|
|
5965
5985
|
var PieChart_default = CustomPieChart;
|
|
5966
5986
|
|
|
5967
5987
|
// src/components/charts/hooks/useChartHighlights.tsx
|
|
5968
|
-
var
|
|
5988
|
+
var import_react24 = require("react");
|
|
5969
5989
|
var useChartHighlights = () => {
|
|
5970
|
-
const [highlightedSeries, setHighlightedSeries] = (0,
|
|
5990
|
+
const [highlightedSeries, setHighlightedSeries] = (0, import_react24.useState)(
|
|
5971
5991
|
/* @__PURE__ */ new Set()
|
|
5972
5992
|
);
|
|
5973
|
-
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0,
|
|
5974
|
-
const toggleHighlight = (0,
|
|
5993
|
+
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0, import_react24.useState)(false);
|
|
5994
|
+
const toggleHighlight = (0, import_react24.useCallback)((key) => {
|
|
5975
5995
|
setHighlightedSeries((prev) => {
|
|
5976
5996
|
const next = new Set(prev);
|
|
5977
5997
|
if (next.has(key)) {
|
|
@@ -5982,17 +6002,17 @@ var useChartHighlights = () => {
|
|
|
5982
6002
|
return next;
|
|
5983
6003
|
});
|
|
5984
6004
|
}, []);
|
|
5985
|
-
const clearHighlights = (0,
|
|
6005
|
+
const clearHighlights = (0, import_react24.useCallback)(() => {
|
|
5986
6006
|
setHighlightedSeries(/* @__PURE__ */ new Set());
|
|
5987
6007
|
setShowOnlyHighlighted(false);
|
|
5988
6008
|
}, []);
|
|
5989
|
-
const isHighlighted = (0,
|
|
6009
|
+
const isHighlighted = (0, import_react24.useCallback)(
|
|
5990
6010
|
(key) => {
|
|
5991
6011
|
return highlightedSeries.has(key);
|
|
5992
6012
|
},
|
|
5993
6013
|
[highlightedSeries]
|
|
5994
6014
|
);
|
|
5995
|
-
const getSeriesStyle = (0,
|
|
6015
|
+
const getSeriesStyle = (0, import_react24.useCallback)(
|
|
5996
6016
|
(key) => {
|
|
5997
6017
|
const hasHighlights = highlightedSeries.size > 0;
|
|
5998
6018
|
const isSeriesHighlighted = highlightedSeries.has(key);
|
|
@@ -6130,7 +6150,7 @@ function Badge({
|
|
|
6130
6150
|
}
|
|
6131
6151
|
|
|
6132
6152
|
// src/components/ui/data/CalendarBase.tsx
|
|
6133
|
-
var
|
|
6153
|
+
var import_react25 = require("@phosphor-icons/react");
|
|
6134
6154
|
var import_react_day_picker = require("react-day-picker");
|
|
6135
6155
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
6136
6156
|
function CalendarBase({
|
|
@@ -6175,8 +6195,8 @@ function CalendarBase({
|
|
|
6175
6195
|
...classNames
|
|
6176
6196
|
},
|
|
6177
6197
|
components: {
|
|
6178
|
-
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6179
|
-
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6198
|
+
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react25.CaretLeftIcon, { className: "h-4 w-4" }),
|
|
6199
|
+
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react25.CaretRightIcon, { className: "h-4 w-4" })
|
|
6180
6200
|
},
|
|
6181
6201
|
...props
|
|
6182
6202
|
}
|
|
@@ -6254,7 +6274,7 @@ CardFooterBase.displayName = "CardFooter";
|
|
|
6254
6274
|
// src/components/ui/data/FileUploader.tsx
|
|
6255
6275
|
var React18 = __toESM(require("react"));
|
|
6256
6276
|
var import_framer_motion10 = require("framer-motion");
|
|
6257
|
-
var
|
|
6277
|
+
var import_react26 = require("@phosphor-icons/react");
|
|
6258
6278
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6259
6279
|
var formatFileSize = (bytes) => {
|
|
6260
6280
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -6270,38 +6290,38 @@ var getFileTypeIcon = (file) => {
|
|
|
6270
6290
|
const extension = getFileExtension(file.name).toLowerCase();
|
|
6271
6291
|
const mimeType = file.type.toLowerCase();
|
|
6272
6292
|
if (extension === "pdf" || mimeType === "application/pdf") {
|
|
6273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FilePdfIcon, { size: 20, className: "text-red-500" });
|
|
6274
6294
|
}
|
|
6275
6295
|
if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
|
|
6276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileDocIcon, { size: 20, className: "text-blue-500" });
|
|
6277
6297
|
}
|
|
6278
6298
|
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
|
|
6279
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileXlsIcon, { size: 20, className: "text-green-500" });
|
|
6280
6300
|
}
|
|
6281
6301
|
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
|
|
6282
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FilePptIcon, { size: 20, className: "text-orange-500" });
|
|
6283
6303
|
}
|
|
6284
6304
|
if (extension === "csv" || mimeType === "text/csv") {
|
|
6285
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileCsvIcon, { size: 20, className: "text-green-600" });
|
|
6286
6306
|
}
|
|
6287
6307
|
if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
|
|
6288
6308
|
extension
|
|
6289
6309
|
) || mimeType.includes("text")) {
|
|
6290
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileTextIcon, { size: 20, className: "text-gray-500" });
|
|
6291
6311
|
}
|
|
6292
6312
|
if (mimeType.startsWith("image/")) {
|
|
6293
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileImageIcon, { size: 20, className: "text-purple-500" });
|
|
6294
6314
|
}
|
|
6295
6315
|
if (mimeType.startsWith("video/")) {
|
|
6296
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileVideoIcon, { size: 20, className: "text-pink-500" });
|
|
6297
6317
|
}
|
|
6298
6318
|
if (mimeType.startsWith("audio/")) {
|
|
6299
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileAudioIcon, { size: 20, className: "text-indigo-500" });
|
|
6300
6320
|
}
|
|
6301
6321
|
if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
6302
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileZipIcon, { size: 20, className: "text-yellow-600" });
|
|
6303
6323
|
}
|
|
6304
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.FileIcon, { size: 20, className: "text-muted-foreground" });
|
|
6305
6325
|
};
|
|
6306
6326
|
var createImagePreview = (file) => {
|
|
6307
6327
|
return new Promise((resolve) => {
|
|
@@ -6531,7 +6551,7 @@ var FileUploader = React18.forwardRef(
|
|
|
6531
6551
|
color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
|
|
6532
6552
|
},
|
|
6533
6553
|
transition: { duration: 0.3 },
|
|
6534
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6554
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.CloudArrowUpIcon, { size: 64 })
|
|
6535
6555
|
}
|
|
6536
6556
|
)
|
|
6537
6557
|
}
|
|
@@ -6573,7 +6593,7 @@ var FileUploader = React18.forwardRef(
|
|
|
6573
6593
|
),
|
|
6574
6594
|
transition: { duration: 0.3 },
|
|
6575
6595
|
children: [
|
|
6576
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6596
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.CheckIcon, { size: 16, className: "text-emerald-500" }) }),
|
|
6577
6597
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
6578
6598
|
import_framer_motion10.motion.span,
|
|
6579
6599
|
{
|
|
@@ -6675,7 +6695,7 @@ var FileUploader = React18.forwardRef(
|
|
|
6675
6695
|
handleRemoveFile(file.id);
|
|
6676
6696
|
},
|
|
6677
6697
|
className: "",
|
|
6678
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6698
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react26.XIcon, { size: 12 })
|
|
6679
6699
|
}
|
|
6680
6700
|
)
|
|
6681
6701
|
]
|
|
@@ -6799,7 +6819,7 @@ AlertDialogCancelBase.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
|
6799
6819
|
|
|
6800
6820
|
// src/components/ui/feedback/DestructiveDialog.tsx
|
|
6801
6821
|
var React20 = __toESM(require("react"));
|
|
6802
|
-
var
|
|
6822
|
+
var import_react27 = require("@phosphor-icons/react");
|
|
6803
6823
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6804
6824
|
var DestructiveDialog = ({
|
|
6805
6825
|
title,
|
|
@@ -6819,7 +6839,7 @@ var DestructiveDialog = ({
|
|
|
6819
6839
|
className: cn("border border-destructive bg-background", className),
|
|
6820
6840
|
children: [
|
|
6821
6841
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-start gap-4", children: [
|
|
6822
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex items-center justify-center w-10 h-10 rounded-full ring-1 ring-destructive/30", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6842
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex items-center justify-center w-10 h-10 rounded-full ring-1 ring-destructive/30", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react27.XCircleIcon, { className: "w-6 h-6 text-destructive" }) }),
|
|
6823
6843
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex-1", children: [
|
|
6824
6844
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AlertDialogTitleBase, { className: "text-lg sm:text-xl font-semibold text-destructive", children: title }),
|
|
6825
6845
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AlertDialogDescriptionBase, { className: "mt-2 text-sm text-muted-foreground", children: description })
|
|
@@ -7028,7 +7048,7 @@ LoadingBase.displayName = "LoadingBase";
|
|
|
7028
7048
|
// src/components/ui/feedback/ModalBase.tsx
|
|
7029
7049
|
var React22 = __toESM(require("react"));
|
|
7030
7050
|
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"));
|
|
7031
|
-
var
|
|
7051
|
+
var import_react28 = require("@phosphor-icons/react");
|
|
7032
7052
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
7033
7053
|
var ModalBase = DialogPrimitive2.Root;
|
|
7034
7054
|
var ModalTriggerBase = DialogPrimitive2.Trigger;
|
|
@@ -7101,7 +7121,7 @@ var ModalContentBase = React22.forwardRef(
|
|
|
7101
7121
|
children: [
|
|
7102
7122
|
children,
|
|
7103
7123
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(DialogPrimitive2.Close, { className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-md bg-muted/10 p-1.5 opacity-80 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none z-10 hover:bg-muted/20 transition-colors", children: [
|
|
7104
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7124
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react28.XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4 text-foreground" }),
|
|
7105
7125
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "sr-only", children: "Close" })
|
|
7106
7126
|
] })
|
|
7107
7127
|
]
|
|
@@ -7425,7 +7445,7 @@ function SkeletonBase({
|
|
|
7425
7445
|
}
|
|
7426
7446
|
|
|
7427
7447
|
// src/components/ui/feedback/SonnerBase.tsx
|
|
7428
|
-
var
|
|
7448
|
+
var import_react29 = require("@phosphor-icons/react");
|
|
7429
7449
|
var import_sonner2 = require("sonner");
|
|
7430
7450
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7431
7451
|
var iconBaseClass = "w-5 h-auto";
|
|
@@ -7477,23 +7497,23 @@ var Toaster = ({ testId, ...props }) => {
|
|
|
7477
7497
|
};
|
|
7478
7498
|
var toast2 = {
|
|
7479
7499
|
success: (message) => import_sonner2.toast.success(message, {
|
|
7480
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7500
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react29.CheckCircleIcon, { className: `${iconBaseClass} text-green-600`, weight: "fill" }),
|
|
7481
7501
|
className: "sonner-success"
|
|
7482
7502
|
}),
|
|
7483
7503
|
error: (message) => import_sonner2.toast.error(message, {
|
|
7484
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7504
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react29.XCircleIcon, { className: `${iconBaseClass} text-red-600`, weight: "fill" }),
|
|
7485
7505
|
className: "sonner-error"
|
|
7486
7506
|
}),
|
|
7487
7507
|
warning: (message) => import_sonner2.toast.warning(message, {
|
|
7488
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7508
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react29.WarningIcon, { className: `${iconBaseClass} text-yellow-600`, weight: "fill" }),
|
|
7489
7509
|
className: "sonner-WarningIcon"
|
|
7490
7510
|
}),
|
|
7491
7511
|
info: (message) => import_sonner2.toast.info(message, {
|
|
7492
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7512
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react29.InfoIcon, { className: `${iconBaseClass} text-blue-600`, weight: "fill" }),
|
|
7493
7513
|
className: "sonner-InfoIcon"
|
|
7494
7514
|
}),
|
|
7495
7515
|
loading: (message) => (0, import_sonner2.toast)(message, {
|
|
7496
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7516
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react29.SpinnerIcon, { className: `${iconBaseClass} animate-spin text-neutral-500`, weight: "fill" }),
|
|
7497
7517
|
className: "sonner-loading"
|
|
7498
7518
|
})
|
|
7499
7519
|
};
|
|
@@ -7501,7 +7521,7 @@ var toast2 = {
|
|
|
7501
7521
|
// src/components/ui/form/CheckBoxBase.tsx
|
|
7502
7522
|
var React24 = __toESM(require("react"));
|
|
7503
7523
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
7504
|
-
var
|
|
7524
|
+
var import_react30 = require("@phosphor-icons/react");
|
|
7505
7525
|
var import_framer_motion11 = require("framer-motion");
|
|
7506
7526
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
7507
7527
|
var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkbox-base", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
@@ -7509,20 +7529,35 @@ var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkb
|
|
|
7509
7529
|
{
|
|
7510
7530
|
ref,
|
|
7511
7531
|
className: cn(
|
|
7512
|
-
"peer h-4 w-4 shrink-0 rounded-md border border-primary shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground transition-colors",
|
|
7532
|
+
"peer h-4 w-4 shrink-0 rounded-md border border-primary shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground transition-colors",
|
|
7513
7533
|
className
|
|
7514
7534
|
),
|
|
7515
7535
|
"data-testid": dataTestId,
|
|
7516
7536
|
...props,
|
|
7517
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.
|
|
7537
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7518
7538
|
import_framer_motion11.motion.div,
|
|
7519
7539
|
{
|
|
7520
7540
|
initial: { scale: 0, opacity: 0, rotate: -90 },
|
|
7521
7541
|
animate: { scale: 1, opacity: 1, rotate: 0 },
|
|
7522
7542
|
exit: { scale: 0, opacity: 0, rotate: 90 },
|
|
7523
7543
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
7524
|
-
className: "flex items-center justify-center text-current",
|
|
7525
|
-
children:
|
|
7544
|
+
className: "flex items-center justify-center text-current group",
|
|
7545
|
+
children: [
|
|
7546
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7547
|
+
import_react30.CheckIcon,
|
|
7548
|
+
{
|
|
7549
|
+
className: "h-4 w-4 hidden group-data-[state=checked]:block",
|
|
7550
|
+
weight: "bold"
|
|
7551
|
+
}
|
|
7552
|
+
),
|
|
7553
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7554
|
+
import_react30.MinusIcon,
|
|
7555
|
+
{
|
|
7556
|
+
className: "h-4 w-4 hidden group-data-[state=indeterminate]:block",
|
|
7557
|
+
weight: "bold"
|
|
7558
|
+
}
|
|
7559
|
+
)
|
|
7560
|
+
]
|
|
7526
7561
|
}
|
|
7527
7562
|
) })
|
|
7528
7563
|
}
|
|
@@ -7532,7 +7567,7 @@ CheckboxBase.displayName = CheckboxPrimitive.Root.displayName;
|
|
|
7532
7567
|
// src/components/ui/form/CollapsibleBase.tsx
|
|
7533
7568
|
var React25 = __toESM(require("react"));
|
|
7534
7569
|
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
|
|
7535
|
-
var
|
|
7570
|
+
var import_react31 = require("@phosphor-icons/react");
|
|
7536
7571
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7537
7572
|
var CollapsibleBase = React25.forwardRef(({ ...props }, ref) => {
|
|
7538
7573
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CollapsiblePrimitive.Root, { ref, "data-slot": "collapsible", ...props });
|
|
@@ -7554,7 +7589,7 @@ var CollapsibleTriggerBase = React25.forwardRef(({ className, children, leftIcon
|
|
|
7554
7589
|
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "flex-shrink-0 [&>svg]:size-4", children: leftIcon }),
|
|
7555
7590
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children })
|
|
7556
7591
|
] }),
|
|
7557
|
-
showCaret && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "caret-icon flex-shrink-0 transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7592
|
+
showCaret && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "caret-icon flex-shrink-0 transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react31.CaretUpDownIcon, { className: "h-4 w-4" }) })
|
|
7558
7593
|
]
|
|
7559
7594
|
}
|
|
7560
7595
|
);
|
|
@@ -7635,7 +7670,7 @@ HoverCardContentBase.displayName = HoverCardPrimitive.Content.displayName;
|
|
|
7635
7670
|
// src/components/ui/form/Input-OTP-Base.tsx
|
|
7636
7671
|
var React27 = __toESM(require("react"));
|
|
7637
7672
|
var import_input_otp = require("input-otp");
|
|
7638
|
-
var
|
|
7673
|
+
var import_react32 = require("@phosphor-icons/react");
|
|
7639
7674
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7640
7675
|
function InputOTPBase({
|
|
7641
7676
|
className,
|
|
@@ -7690,7 +7725,7 @@ function InputOTPSlotBase({
|
|
|
7690
7725
|
);
|
|
7691
7726
|
}
|
|
7692
7727
|
function InputOTPSeparatorBase({ ...props }) {
|
|
7693
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react32.MinusIcon, {}) });
|
|
7694
7729
|
}
|
|
7695
7730
|
|
|
7696
7731
|
// src/components/ui/form/SliderBase.tsx
|
|
@@ -7778,7 +7813,7 @@ SlideBase.displayName = "SlideBase";
|
|
|
7778
7813
|
|
|
7779
7814
|
// src/components/ui/form/SmallButtons.tsx
|
|
7780
7815
|
var React29 = __toESM(require("react"));
|
|
7781
|
-
var
|
|
7816
|
+
var import_react33 = require("@phosphor-icons/react");
|
|
7782
7817
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
7783
7818
|
var EditButton = React29.forwardRef(
|
|
7784
7819
|
({
|
|
@@ -7809,7 +7844,7 @@ var EditButton = React29.forwardRef(
|
|
|
7809
7844
|
),
|
|
7810
7845
|
...props,
|
|
7811
7846
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7812
|
-
|
|
7847
|
+
import_react33.PencilSimpleIcon,
|
|
7813
7848
|
{
|
|
7814
7849
|
size: iconSize,
|
|
7815
7850
|
color: iconColor,
|
|
@@ -7849,7 +7884,7 @@ var ChangeButton = React29.forwardRef(
|
|
|
7849
7884
|
),
|
|
7850
7885
|
...props,
|
|
7851
7886
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7852
|
-
|
|
7887
|
+
import_react33.ArrowsLeftRightIcon,
|
|
7853
7888
|
{
|
|
7854
7889
|
size: iconSize,
|
|
7855
7890
|
color: iconColor,
|
|
@@ -7889,7 +7924,7 @@ var SaveButton = React29.forwardRef(
|
|
|
7889
7924
|
),
|
|
7890
7925
|
...props,
|
|
7891
7926
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7892
|
-
|
|
7927
|
+
import_react33.FloppyDiskIcon,
|
|
7893
7928
|
{
|
|
7894
7929
|
size: iconSize,
|
|
7895
7930
|
color: iconColor,
|
|
@@ -7929,7 +7964,7 @@ var AddButton = React29.forwardRef(
|
|
|
7929
7964
|
),
|
|
7930
7965
|
...props,
|
|
7931
7966
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7932
|
-
|
|
7967
|
+
import_react33.PlusIcon,
|
|
7933
7968
|
{
|
|
7934
7969
|
size: iconSize,
|
|
7935
7970
|
color: iconColor,
|
|
@@ -7969,7 +8004,7 @@ var CloseButton = React29.forwardRef(
|
|
|
7969
8004
|
),
|
|
7970
8005
|
...props,
|
|
7971
8006
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7972
|
-
|
|
8007
|
+
import_react33.XIcon,
|
|
7973
8008
|
{
|
|
7974
8009
|
size: iconSize,
|
|
7975
8010
|
color: iconColor,
|
|
@@ -8001,7 +8036,7 @@ var DownloadButton = ({
|
|
|
8001
8036
|
),
|
|
8002
8037
|
...props,
|
|
8003
8038
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8004
|
-
|
|
8039
|
+
import_react33.DownloadSimpleIcon,
|
|
8005
8040
|
{
|
|
8006
8041
|
size: 18,
|
|
8007
8042
|
className: "transition-transform duration-300 group-hover:translate-y-0.5"
|
|
@@ -8030,7 +8065,7 @@ var UploadButton = ({
|
|
|
8030
8065
|
),
|
|
8031
8066
|
...props,
|
|
8032
8067
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8033
|
-
|
|
8068
|
+
import_react33.UploadSimpleIcon,
|
|
8034
8069
|
{
|
|
8035
8070
|
size: 18,
|
|
8036
8071
|
className: "transition-transform duration-300 group-hover:-translate-y-0.5"
|
|
@@ -8059,7 +8094,7 @@ var CopyButton = ({
|
|
|
8059
8094
|
),
|
|
8060
8095
|
...props,
|
|
8061
8096
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8062
|
-
|
|
8097
|
+
import_react33.CopyIcon,
|
|
8063
8098
|
{
|
|
8064
8099
|
size: 18,
|
|
8065
8100
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -8088,7 +8123,7 @@ var RefreshButton = ({
|
|
|
8088
8123
|
),
|
|
8089
8124
|
...props,
|
|
8090
8125
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8091
|
-
|
|
8126
|
+
import_react33.ArrowClockwiseIcon,
|
|
8092
8127
|
{
|
|
8093
8128
|
size: 18,
|
|
8094
8129
|
className: "transition-transform duration-500 group-hover:rotate-180"
|
|
@@ -8117,7 +8152,7 @@ var SearchButton = ({
|
|
|
8117
8152
|
),
|
|
8118
8153
|
...props,
|
|
8119
8154
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8120
|
-
|
|
8155
|
+
import_react33.MagnifyingGlassIcon,
|
|
8121
8156
|
{
|
|
8122
8157
|
size: 18,
|
|
8123
8158
|
className: "transition-transform duration-200 group-hover:scale-110 group-hover:-rotate-12"
|
|
@@ -8146,7 +8181,7 @@ var BackButton = ({
|
|
|
8146
8181
|
),
|
|
8147
8182
|
...props,
|
|
8148
8183
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8149
|
-
|
|
8184
|
+
import_react33.ArrowLeftIcon,
|
|
8150
8185
|
{
|
|
8151
8186
|
size: 18,
|
|
8152
8187
|
className: "transition-transform duration-300 group-hover:-translate-x-1"
|
|
@@ -8175,7 +8210,7 @@ var SettingsButton = ({
|
|
|
8175
8210
|
),
|
|
8176
8211
|
...props,
|
|
8177
8212
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8178
|
-
|
|
8213
|
+
import_react33.GearIcon,
|
|
8179
8214
|
{
|
|
8180
8215
|
size: 18,
|
|
8181
8216
|
className: "transition-transform duration-500 group-hover:rotate-90"
|
|
@@ -8204,7 +8239,7 @@ var NotificationButton = ({
|
|
|
8204
8239
|
),
|
|
8205
8240
|
...props,
|
|
8206
8241
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8207
|
-
|
|
8242
|
+
import_react33.BellIcon,
|
|
8208
8243
|
{
|
|
8209
8244
|
size: 18,
|
|
8210
8245
|
className: "transition-transform duration-300 group-hover:scale-110 group-hover:-rotate-12"
|
|
@@ -8233,7 +8268,7 @@ var MoreButton = ({
|
|
|
8233
8268
|
),
|
|
8234
8269
|
...props,
|
|
8235
8270
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8236
|
-
|
|
8271
|
+
import_react33.DotsThreeIcon,
|
|
8237
8272
|
{
|
|
8238
8273
|
size: 18,
|
|
8239
8274
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -8262,7 +8297,7 @@ var CheckButton = ({
|
|
|
8262
8297
|
),
|
|
8263
8298
|
...props,
|
|
8264
8299
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8265
|
-
|
|
8300
|
+
import_react33.CheckIcon,
|
|
8266
8301
|
{
|
|
8267
8302
|
size: 18,
|
|
8268
8303
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -8298,7 +8333,7 @@ var FilterButton = ({
|
|
|
8298
8333
|
),
|
|
8299
8334
|
...props,
|
|
8300
8335
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8301
|
-
|
|
8336
|
+
import_react33.FunnelIcon,
|
|
8302
8337
|
{
|
|
8303
8338
|
size: iconSize,
|
|
8304
8339
|
color: iconColor,
|
|
@@ -8337,7 +8372,7 @@ var LikeButton = ({
|
|
|
8337
8372
|
),
|
|
8338
8373
|
...props,
|
|
8339
8374
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8340
|
-
|
|
8375
|
+
import_react33.HeartIcon,
|
|
8341
8376
|
{
|
|
8342
8377
|
size: iconSize,
|
|
8343
8378
|
color: iconColor,
|
|
@@ -8376,7 +8411,7 @@ var FavoriteButton = ({
|
|
|
8376
8411
|
),
|
|
8377
8412
|
...props,
|
|
8378
8413
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8379
|
-
|
|
8414
|
+
import_react33.StarIcon,
|
|
8380
8415
|
{
|
|
8381
8416
|
size: iconSize,
|
|
8382
8417
|
color: iconColor,
|
|
@@ -8414,14 +8449,14 @@ var VisibilityButton = ({
|
|
|
8414
8449
|
),
|
|
8415
8450
|
...props,
|
|
8416
8451
|
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8417
|
-
|
|
8452
|
+
import_react33.EyeIcon,
|
|
8418
8453
|
{
|
|
8419
8454
|
size: iconSize,
|
|
8420
8455
|
color: iconColor,
|
|
8421
8456
|
className: "transition-opacity duration-200"
|
|
8422
8457
|
}
|
|
8423
8458
|
) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8424
|
-
|
|
8459
|
+
import_react33.EyeSlashIcon,
|
|
8425
8460
|
{
|
|
8426
8461
|
size: iconSize,
|
|
8427
8462
|
color: iconColor,
|
|
@@ -8461,14 +8496,14 @@ var LockButton = ({
|
|
|
8461
8496
|
),
|
|
8462
8497
|
...props,
|
|
8463
8498
|
children: isLocked ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8464
|
-
|
|
8499
|
+
import_react33.LockIcon,
|
|
8465
8500
|
{
|
|
8466
8501
|
size: iconSize,
|
|
8467
8502
|
color: iconColor,
|
|
8468
8503
|
className: "transition-all duration-200 group-hover:scale-110"
|
|
8469
8504
|
}
|
|
8470
8505
|
) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8471
|
-
|
|
8506
|
+
import_react33.LockOpenIcon,
|
|
8472
8507
|
{
|
|
8473
8508
|
size: iconSize,
|
|
8474
8509
|
color: iconColor,
|
|
@@ -8514,7 +8549,7 @@ SwitchBase.displayName = SwitchPrimitives.Root.displayName;
|
|
|
8514
8549
|
// src/components/ui/form/TextAreaBase.tsx
|
|
8515
8550
|
var React31 = __toESM(require("react"));
|
|
8516
8551
|
var import_framer_motion12 = require("framer-motion");
|
|
8517
|
-
var
|
|
8552
|
+
var import_react34 = require("@phosphor-icons/react");
|
|
8518
8553
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
8519
8554
|
var TextAreaBase = React31.forwardRef(
|
|
8520
8555
|
({ className, clearable = false, onClear, ...props }, ref) => {
|
|
@@ -8611,7 +8646,7 @@ var TextAreaBase = React31.forwardRef(
|
|
|
8611
8646
|
),
|
|
8612
8647
|
disabled: props.disabled,
|
|
8613
8648
|
"aria-label": "Limpar texto",
|
|
8614
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react34.TrashIcon, { size: 16, weight: "regular" })
|
|
8615
8650
|
}
|
|
8616
8651
|
) }),
|
|
8617
8652
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
@@ -8689,7 +8724,7 @@ TextAreaBase.displayName = "TextAreaBase";
|
|
|
8689
8724
|
// src/components/ui/layout/CarouselBase.tsx
|
|
8690
8725
|
var React32 = __toESM(require("react"));
|
|
8691
8726
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
8692
|
-
var
|
|
8727
|
+
var import_react35 = require("@phosphor-icons/react");
|
|
8693
8728
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
8694
8729
|
var CarouselContext = React32.createContext(null);
|
|
8695
8730
|
function useCarousel() {
|
|
@@ -8850,7 +8885,7 @@ function CarouselPreviousBase({
|
|
|
8850
8885
|
onClick: scrollPrev,
|
|
8851
8886
|
...props,
|
|
8852
8887
|
children: [
|
|
8853
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8888
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.ArrowLeftIcon, {}),
|
|
8854
8889
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: "Previous slide" })
|
|
8855
8890
|
]
|
|
8856
8891
|
}
|
|
@@ -8880,7 +8915,7 @@ function CarouselNextBase({
|
|
|
8880
8915
|
onClick: scrollNext,
|
|
8881
8916
|
...props,
|
|
8882
8917
|
children: [
|
|
8883
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8918
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.ArrowRightIcon, {}),
|
|
8884
8919
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: "Next slide" })
|
|
8885
8920
|
]
|
|
8886
8921
|
}
|
|
@@ -9063,7 +9098,7 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
|
|
|
9063
9098
|
|
|
9064
9099
|
// src/components/ui/navigation/BreadcrumbBase.tsx
|
|
9065
9100
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
9066
|
-
var
|
|
9101
|
+
var import_react36 = require("@phosphor-icons/react");
|
|
9067
9102
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
9068
9103
|
function BreadcrumbBase({ ...props }) {
|
|
9069
9104
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
@@ -9132,7 +9167,7 @@ function BreadcrumbSeparatorBase({
|
|
|
9132
9167
|
"aria-hidden": "true",
|
|
9133
9168
|
className: cn("[&>svg]:size-3.5", className),
|
|
9134
9169
|
...props,
|
|
9135
|
-
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9170
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react36.CaretRightIcon, {})
|
|
9136
9171
|
}
|
|
9137
9172
|
);
|
|
9138
9173
|
}
|
|
@@ -9149,7 +9184,7 @@ function BreadcrumbEllipsisBase({
|
|
|
9149
9184
|
className: cn("flex size-9 items-center justify-center", className),
|
|
9150
9185
|
...props,
|
|
9151
9186
|
children: [
|
|
9152
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9187
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react36.DotsThreeIcon, { className: "size-4" }),
|
|
9153
9188
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "sr-only", children: "More" })
|
|
9154
9189
|
]
|
|
9155
9190
|
}
|
|
@@ -9158,7 +9193,7 @@ function BreadcrumbEllipsisBase({
|
|
|
9158
9193
|
|
|
9159
9194
|
// src/components/ui/navigation/NavigationMenuBase.tsx
|
|
9160
9195
|
var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"));
|
|
9161
|
-
var
|
|
9196
|
+
var import_react37 = require("@phosphor-icons/react");
|
|
9162
9197
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
9163
9198
|
function NavigationMenuBase({
|
|
9164
9199
|
className,
|
|
@@ -9226,7 +9261,7 @@ function NavigationMenuTriggerBase({
|
|
|
9226
9261
|
children: [
|
|
9227
9262
|
children,
|
|
9228
9263
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9229
|
-
|
|
9264
|
+
import_react37.CaretDownIcon,
|
|
9230
9265
|
{
|
|
9231
9266
|
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
9232
9267
|
"aria-hidden": "true"
|
|
@@ -9329,7 +9364,7 @@ function useIsMobile() {
|
|
|
9329
9364
|
var React37 = __toESM(require("react"));
|
|
9330
9365
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
9331
9366
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
9332
|
-
var
|
|
9367
|
+
var import_react38 = require("@phosphor-icons/react");
|
|
9333
9368
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
9334
9369
|
var SheetBase = SheetPrimitive.Root;
|
|
9335
9370
|
var SheetTriggerBase = SheetPrimitive.Trigger;
|
|
@@ -9373,7 +9408,7 @@ var SheetContentBase = React37.forwardRef(({ side = "right", className, children
|
|
|
9373
9408
|
...props,
|
|
9374
9409
|
children: [
|
|
9375
9410
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
9376
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
9411
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react38.XIcon, { className: "h-4 w-4" }),
|
|
9377
9412
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "sr-only", children: "Close" })
|
|
9378
9413
|
] }),
|
|
9379
9414
|
children
|
|
@@ -9430,7 +9465,7 @@ var SheetDescriptionBase = React37.forwardRef(({ className, ...props }, ref) =>
|
|
|
9430
9465
|
SheetDescriptionBase.displayName = SheetPrimitive.Description.displayName;
|
|
9431
9466
|
|
|
9432
9467
|
// src/components/ui/navigation/SidebarBase.tsx
|
|
9433
|
-
var
|
|
9468
|
+
var import_react39 = require("@phosphor-icons/react");
|
|
9434
9469
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
9435
9470
|
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
9436
9471
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -9624,7 +9659,7 @@ var SidebarTriggerBase = React38.forwardRef(({ className, onClick, ...props }, r
|
|
|
9624
9659
|
...props,
|
|
9625
9660
|
children: [
|
|
9626
9661
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "sr-only", children: "Toggle SidebarBase" }),
|
|
9627
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9662
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react39.SidebarSimpleIcon, {})
|
|
9628
9663
|
]
|
|
9629
9664
|
}
|
|
9630
9665
|
) });
|
|
@@ -10118,11 +10153,11 @@ function DrawerDescriptionBase({
|
|
|
10118
10153
|
}
|
|
10119
10154
|
|
|
10120
10155
|
// src/hooks/use-universal-tooltip.tsx
|
|
10121
|
-
var
|
|
10156
|
+
var import_react40 = require("react");
|
|
10122
10157
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
10123
|
-
var UniversalTooltipContext = (0,
|
|
10158
|
+
var UniversalTooltipContext = (0, import_react40.createContext)(null);
|
|
10124
10159
|
var useUniversalTooltip = () => {
|
|
10125
|
-
const context = (0,
|
|
10160
|
+
const context = (0, import_react40.useContext)(UniversalTooltipContext);
|
|
10126
10161
|
if (!context) {
|
|
10127
10162
|
throw new Error("useUniversalTooltip deve ser usado dentro de UniversalTooltipProvider");
|
|
10128
10163
|
}
|
|
@@ -10130,7 +10165,7 @@ var useUniversalTooltip = () => {
|
|
|
10130
10165
|
};
|
|
10131
10166
|
var useTooltip = () => {
|
|
10132
10167
|
const { addTooltip, removeTooltip, startDrag } = useUniversalTooltip();
|
|
10133
|
-
const createTooltip = (0,
|
|
10168
|
+
const createTooltip = (0, import_react40.useCallback)((element, content, options) => {
|
|
10134
10169
|
const rect = element.getBoundingClientRect();
|
|
10135
10170
|
let position;
|
|
10136
10171
|
switch (options?.position || "auto") {
|
|
@@ -10160,7 +10195,7 @@ var useTooltip = () => {
|
|
|
10160
10195
|
metadata: options?.metadata
|
|
10161
10196
|
});
|
|
10162
10197
|
}, [addTooltip]);
|
|
10163
|
-
const handleElementMouseDown = (0,
|
|
10198
|
+
const handleElementMouseDown = (0, import_react40.useCallback)((tooltipId, event) => {
|
|
10164
10199
|
const rect = event.target.getBoundingClientRect();
|
|
10165
10200
|
const offset = {
|
|
10166
10201
|
x: event.clientX - rect.left,
|
|
@@ -10319,7 +10354,7 @@ var import_date_fns = require("date-fns");
|
|
|
10319
10354
|
// src/components/picker/calendar.tsx
|
|
10320
10355
|
var React40 = __toESM(require("react"));
|
|
10321
10356
|
var import_react_day_picker2 = require("react-day-picker");
|
|
10322
|
-
var
|
|
10357
|
+
var import_react41 = require("@phosphor-icons/react");
|
|
10323
10358
|
var import_framer_motion14 = require("framer-motion");
|
|
10324
10359
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
10325
10360
|
function CalendarBase2({
|
|
@@ -10345,60 +10380,64 @@ function CalendarBase2({
|
|
|
10345
10380
|
"rounded-md border bg-background p-3 overflow-hidden flex flex-col",
|
|
10346
10381
|
className
|
|
10347
10382
|
),
|
|
10348
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "relative flex-1 flex flex-col min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_framer_motion14.AnimatePresence, { initial: false, mode: "wait", custom: direction, children: /* @__PURE__ */ (0, import_jsx_runtime63.
|
|
10383
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "relative flex-1 flex flex-col min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_framer_motion14.AnimatePresence, { initial: false, mode: "wait", custom: direction, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
10349
10384
|
"div",
|
|
10350
10385
|
{
|
|
10351
10386
|
className: "w-full h-full flex flex-col",
|
|
10352
|
-
children:
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10387
|
+
children: [
|
|
10388
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center justify-end mb-2 -mt-1" }),
|
|
10389
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10390
|
+
import_react_day_picker2.DayPicker,
|
|
10391
|
+
{
|
|
10392
|
+
showOutsideDays,
|
|
10393
|
+
month,
|
|
10394
|
+
onMonthChange: handleMonthChange,
|
|
10395
|
+
className: "w-full h-full flex flex-col",
|
|
10396
|
+
classNames: {
|
|
10397
|
+
months: "flex flex-col sm:flex-row gap-3 sm:gap-4 w-full",
|
|
10398
|
+
month: "flex-1 min-w-0",
|
|
10399
|
+
caption: "flex items-center justify-between gap-2 pr-1 min-h-[2.25rem] mb-2",
|
|
10400
|
+
caption_label: "text-[clamp(0.85rem,1.4vw,1.125rem)] sm:text-[clamp(0.9rem,1.6vw,1.125rem)] font-semibold capitalize text-left",
|
|
10401
|
+
nav: "flex items-center gap-2",
|
|
10402
|
+
nav_button: cn(
|
|
10403
|
+
buttonVariantsBase({ variant: "outline" }),
|
|
10404
|
+
"h-8 w-8 sm:h-9 sm:w-9 md:h-10 md:w-10 flex items-center justify-center p-0 rounded-md transition-transform duration-150 ease-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/40 active:scale-95"
|
|
10405
|
+
),
|
|
10406
|
+
nav_button_previous: "",
|
|
10407
|
+
nav_button_next: "",
|
|
10408
|
+
table: "w-full min-w-0 flex-1 grid grid-rows-[auto_1fr] gap-2",
|
|
10409
|
+
head_row: "grid grid-cols-7 gap-1 mb-1",
|
|
10410
|
+
head_cell: "text-muted-foreground rounded-md font-semibold text-[clamp(0.575rem,1.2vw,0.75rem)] sm:text-[clamp(0.65rem,1.1vw,0.825rem)] text-center pb-1 uppercase tracking-wider",
|
|
10411
|
+
row: "grid grid-cols-7 gap-1",
|
|
10412
|
+
cell: cn(
|
|
10413
|
+
"min-w-0 h-9 sm:h-10 md:h-10 p-0 relative flex items-center justify-center",
|
|
10414
|
+
"[&:has([aria-selected].day-range-end)]:rounded-r-lg",
|
|
10415
|
+
"[&:has([aria-selected].day-range-start)]:rounded-l-lg",
|
|
10416
|
+
"[&:has([aria-selected].day-outside)]:bg-muted/50",
|
|
10417
|
+
"[&:has([aria-selected])]:bg-muted"
|
|
10418
|
+
),
|
|
10419
|
+
day: cn(
|
|
10420
|
+
buttonVariantsBase({ variant: "ghost" }),
|
|
10421
|
+
"w-full h-full p-0 m-0 flex items-center justify-center text-[clamp(0.775rem,1.2vw,0.95rem)] sm:text-sm",
|
|
10422
|
+
"aria-selected:opacity-100 hover:bg-muted transition-all duration-150 ease-out active:scale-95"
|
|
10423
|
+
),
|
|
10424
|
+
day_selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90 font-semibold hover:text-white",
|
|
10425
|
+
day_today: "bg-muted text-foreground font-bold ring-2 ring-primary/30 ring-inset",
|
|
10426
|
+
day_outside: "text-muted-foreground/40 opacity-60 aria-selected:bg-muted/50 aria-selected:text-foreground",
|
|
10427
|
+
day_disabled: "text-muted-foreground/30 opacity-40 cursor-not-allowed",
|
|
10428
|
+
day_range_middle: "aria-selected:bg-muted aria-selected:text-foreground",
|
|
10429
|
+
day_hidden: "invisible",
|
|
10430
|
+
button: "p-0 m-0 border-0 outline-none focus:ring-0",
|
|
10431
|
+
...classNames
|
|
10432
|
+
},
|
|
10433
|
+
components: {
|
|
10434
|
+
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react41.CaretLeftIcon, { className: "h-4 w-4" }),
|
|
10435
|
+
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react41.CaretRightIcon, { className: "h-4 w-4" })
|
|
10436
|
+
},
|
|
10437
|
+
...props
|
|
10438
|
+
}
|
|
10439
|
+
)
|
|
10440
|
+
]
|
|
10402
10441
|
},
|
|
10403
10442
|
month.toISOString()
|
|
10404
10443
|
) }) })
|
|
@@ -10409,15 +10448,15 @@ CalendarBase2.displayName = "CalendarBase";
|
|
|
10409
10448
|
|
|
10410
10449
|
// src/components/picker/DateTimePicker.tsx
|
|
10411
10450
|
var import_locale = require("date-fns/locale");
|
|
10412
|
-
var
|
|
10451
|
+
var import_react44 = require("react");
|
|
10413
10452
|
|
|
10414
10453
|
// src/components/picker/TimePicker.tsx
|
|
10415
10454
|
var import_framer_motion15 = require("framer-motion");
|
|
10416
10455
|
var React42 = __toESM(require("react"));
|
|
10417
10456
|
|
|
10418
10457
|
// src/components/picker/TimePickerInput.tsx
|
|
10419
|
-
var
|
|
10420
|
-
var
|
|
10458
|
+
var import_react42 = require("@phosphor-icons/react");
|
|
10459
|
+
var import_react43 = __toESM(require("react"));
|
|
10421
10460
|
|
|
10422
10461
|
// src/components/picker/utils/time-picker-utils.ts
|
|
10423
10462
|
function isValidHour(value) {
|
|
@@ -10560,7 +10599,7 @@ function display12HourValue(hours) {
|
|
|
10560
10599
|
|
|
10561
10600
|
// src/components/picker/TimePickerInput.tsx
|
|
10562
10601
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
10563
|
-
var TimePickerInput =
|
|
10602
|
+
var TimePickerInput = import_react43.default.forwardRef(
|
|
10564
10603
|
({
|
|
10565
10604
|
className,
|
|
10566
10605
|
type = "tel",
|
|
@@ -10579,10 +10618,10 @@ var TimePickerInput = import_react42.default.forwardRef(
|
|
|
10579
10618
|
label,
|
|
10580
10619
|
...props
|
|
10581
10620
|
}, ref) => {
|
|
10582
|
-
const [flag, setFlag] =
|
|
10583
|
-
const [prevIntKey, setPrevIntKey] =
|
|
10584
|
-
const [isFocused, setIsFocused] =
|
|
10585
|
-
|
|
10621
|
+
const [flag, setFlag] = import_react43.default.useState(false);
|
|
10622
|
+
const [prevIntKey, setPrevIntKey] = import_react43.default.useState("0");
|
|
10623
|
+
const [isFocused, setIsFocused] = import_react43.default.useState(false);
|
|
10624
|
+
import_react43.default.useEffect(() => {
|
|
10586
10625
|
if (flag) {
|
|
10587
10626
|
const timer = setTimeout(() => {
|
|
10588
10627
|
setFlag(false);
|
|
@@ -10590,7 +10629,7 @@ var TimePickerInput = import_react42.default.forwardRef(
|
|
|
10590
10629
|
return () => clearTimeout(timer);
|
|
10591
10630
|
}
|
|
10592
10631
|
}, [flag]);
|
|
10593
|
-
const calculatedValue =
|
|
10632
|
+
const calculatedValue = import_react43.default.useMemo(() => {
|
|
10594
10633
|
return getDateByType(date, picker);
|
|
10595
10634
|
}, [date, picker]);
|
|
10596
10635
|
const calculateNewValue = (key) => {
|
|
@@ -10679,7 +10718,7 @@ var TimePickerInput = import_react42.default.forwardRef(
|
|
|
10679
10718
|
),
|
|
10680
10719
|
tabIndex: -1,
|
|
10681
10720
|
"aria-label": `Incrementar ${getPickerLabel().toLowerCase()}`,
|
|
10682
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react42.CaretUpIcon, { size: 14, className: "sm:w-4 sm:h-4" })
|
|
10683
10722
|
}
|
|
10684
10723
|
),
|
|
10685
10724
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative", children: [
|
|
@@ -10746,7 +10785,7 @@ var TimePickerInput = import_react42.default.forwardRef(
|
|
|
10746
10785
|
),
|
|
10747
10786
|
tabIndex: -1,
|
|
10748
10787
|
"aria-label": `Decrementar ${getPickerLabel().toLowerCase()}`,
|
|
10749
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10788
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react42.CaretDownIcon, { size: 14, className: "sm:w-4 sm:h-4" })
|
|
10750
10789
|
}
|
|
10751
10790
|
)
|
|
10752
10791
|
]
|
|
@@ -10855,7 +10894,7 @@ function TimePicker({
|
|
|
10855
10894
|
}
|
|
10856
10895
|
|
|
10857
10896
|
// src/components/picker/DateTimePicker.tsx
|
|
10858
|
-
var
|
|
10897
|
+
var import_react45 = require("@phosphor-icons/react");
|
|
10859
10898
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
10860
10899
|
function DateTimePicker({
|
|
10861
10900
|
label,
|
|
@@ -10870,9 +10909,9 @@ function DateTimePicker({
|
|
|
10870
10909
|
className,
|
|
10871
10910
|
error
|
|
10872
10911
|
}) {
|
|
10873
|
-
const [internalDate, setInternalDate] = (0,
|
|
10874
|
-
const [open, setOpen] = (0,
|
|
10875
|
-
const [timePickerOpen, setTimePickerOpen] = (0,
|
|
10912
|
+
const [internalDate, setInternalDate] = (0, import_react44.useState)(date);
|
|
10913
|
+
const [open, setOpen] = (0, import_react44.useState)(false);
|
|
10914
|
+
const [timePickerOpen, setTimePickerOpen] = (0, import_react44.useState)(false);
|
|
10876
10915
|
const handleSelect = (newDay) => {
|
|
10877
10916
|
if (!newDay) return;
|
|
10878
10917
|
if (!internalDate) {
|
|
@@ -10903,10 +10942,10 @@ function DateTimePicker({
|
|
|
10903
10942
|
if (!timeFormat) return "dd MMMM yyyy";
|
|
10904
10943
|
return `dd MMMM yyyy - ${timeFormat}`;
|
|
10905
10944
|
};
|
|
10906
|
-
(0,
|
|
10945
|
+
(0, import_react44.useEffect)(() => {
|
|
10907
10946
|
setInternalDate(date);
|
|
10908
10947
|
}, [date, open]);
|
|
10909
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: cn("
|
|
10948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: cn("w-full sm:w-auto", className), children: [
|
|
10910
10949
|
label && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LabelBase_default, { children: label }),
|
|
10911
10950
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(PopoverBase, { open, onOpenChange: setOpen, children: [
|
|
10912
10951
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
@@ -10920,7 +10959,7 @@ function DateTimePicker({
|
|
|
10920
10959
|
{
|
|
10921
10960
|
variant: "outline",
|
|
10922
10961
|
className: cn(
|
|
10923
|
-
"w-full justify-start text-left min-w-0 overflow-hidden ",
|
|
10962
|
+
"w-full justify-start text-left min-w-0 overflow-hidden no-active-animation",
|
|
10924
10963
|
!date && "text-muted-foreground"
|
|
10925
10964
|
),
|
|
10926
10965
|
children: [
|
|
@@ -10934,7 +10973,7 @@ function DateTimePicker({
|
|
|
10934
10973
|
children: date ? (0, import_date_fns.format)(date, getDisplayFormat(), { locale: import_locale.ptBR }) : "Selecione uma data"
|
|
10935
10974
|
}
|
|
10936
10975
|
),
|
|
10937
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
10976
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react45.CalendarBlankIcon, { className: "flex-shrink-0 w-5 h-5 sm:w-6 sm:h-6" })
|
|
10938
10977
|
]
|
|
10939
10978
|
}
|
|
10940
10979
|
)
|
|
@@ -10965,7 +11004,7 @@ function DateTimePicker({
|
|
|
10965
11004
|
className: cn("w-full", hideTime && "border-0")
|
|
10966
11005
|
}
|
|
10967
11006
|
),
|
|
10968
|
-
!hideTime && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex justify-center w-full ", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
11007
|
+
!hideTime && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex justify-center w-full border-b border-r border-l", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
10969
11008
|
PopoverBase,
|
|
10970
11009
|
{
|
|
10971
11010
|
open: timePickerOpen,
|
|
@@ -10981,10 +11020,10 @@ function DateTimePicker({
|
|
|
10981
11020
|
"text-sm sm:text-base font-semibold w-full",
|
|
10982
11021
|
"bg-background hover:bg-accent",
|
|
10983
11022
|
"transition-all duration-200",
|
|
10984
|
-
"shadow-sm hover:shadow-md active
|
|
11023
|
+
"shadow-sm hover:shadow-md no-active-animation"
|
|
10985
11024
|
),
|
|
10986
11025
|
children: [
|
|
10987
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11026
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react45.ClockIcon, { className: "text-primary flex-shrink-0 w-4 h-4 sm:w-5 sm:h-5" }),
|
|
10988
11027
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-black truncate", children: internalDate ? (0, import_date_fns.format)(internalDate, getTimeFormat() || "HH:mm", {
|
|
10989
11028
|
locale: import_locale.ptBR
|
|
10990
11029
|
}) : "00:00" })
|
|
@@ -11016,7 +11055,7 @@ function DateTimePicker({
|
|
|
11016
11055
|
size: "sm",
|
|
11017
11056
|
variant: "destructive",
|
|
11018
11057
|
onClick: () => setTimePickerOpen(false),
|
|
11019
|
-
className: "w-full text-xs sm:text-sm min-h-[36px] sm:min-h-[40px]",
|
|
11058
|
+
className: "w-full text-xs sm:text-sm min-h-[36px] sm:min-h-[40px] no-active-animation",
|
|
11020
11059
|
children: "Fechar"
|
|
11021
11060
|
}
|
|
11022
11061
|
)
|
|
@@ -11025,7 +11064,16 @@ function DateTimePicker({
|
|
|
11025
11064
|
)
|
|
11026
11065
|
]
|
|
11027
11066
|
}
|
|
11028
|
-
) })
|
|
11067
|
+
) }),
|
|
11068
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
11069
|
+
ButtonBase,
|
|
11070
|
+
{
|
|
11071
|
+
variant: "destructive",
|
|
11072
|
+
className: "rounded-t-none no-active-animation",
|
|
11073
|
+
onClick: () => setOpen(false),
|
|
11074
|
+
children: "Fechar"
|
|
11075
|
+
}
|
|
11076
|
+
)
|
|
11029
11077
|
] })
|
|
11030
11078
|
}
|
|
11031
11079
|
)
|
|
@@ -11038,7 +11086,7 @@ var React43 = __toESM(require("react"));
|
|
|
11038
11086
|
var import_react_day_picker3 = require("react-day-picker");
|
|
11039
11087
|
var import_pt_BR = __toESM(require("date-fns/locale/pt-BR"));
|
|
11040
11088
|
var import_date_fns2 = require("date-fns");
|
|
11041
|
-
var
|
|
11089
|
+
var import_react46 = require("@phosphor-icons/react");
|
|
11042
11090
|
var import_framer_motion16 = require("framer-motion");
|
|
11043
11091
|
var import_ssr7 = require("@phosphor-icons/react/dist/ssr");
|
|
11044
11092
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
@@ -11066,7 +11114,7 @@ function RangePicker({
|
|
|
11066
11114
|
onChange?.(void 0);
|
|
11067
11115
|
};
|
|
11068
11116
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(PopoverBase, { open, onOpenChange: setOpen, children: [
|
|
11069
|
-
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11117
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(PopoverTriggerBase, { asChild: true, className: cn(error && "border-red-500"), children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11070
11118
|
import_framer_motion16.motion.div,
|
|
11071
11119
|
{
|
|
11072
11120
|
whileTap: { scale: 0.97 },
|
|
@@ -11076,12 +11124,18 @@ function RangePicker({
|
|
|
11076
11124
|
ButtonBase,
|
|
11077
11125
|
{
|
|
11078
11126
|
variant: "outline",
|
|
11079
|
-
className:
|
|
11127
|
+
className: cn(
|
|
11128
|
+
"w-full justify-start text-left min-w-0 overflow-hidden",
|
|
11129
|
+
!range && "text-muted-foreground"
|
|
11130
|
+
),
|
|
11080
11131
|
children: [
|
|
11081
11132
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11082
11133
|
import_framer_motion16.motion.span,
|
|
11083
11134
|
{
|
|
11084
|
-
className:
|
|
11135
|
+
className: cn(
|
|
11136
|
+
"truncate flex-1",
|
|
11137
|
+
!range && "text-muted-foreground"
|
|
11138
|
+
),
|
|
11085
11139
|
transition: { duration: 0.2 },
|
|
11086
11140
|
animate: controls,
|
|
11087
11141
|
children: range?.from && range?.to ? `${(0, import_date_fns2.format)(range.from, "P", {
|
|
@@ -11094,7 +11148,7 @@ function RangePicker({
|
|
|
11094
11148
|
{
|
|
11095
11149
|
animate: open ? { rotate: 8, scale: 1.15 } : { rotate: 0, scale: 1 },
|
|
11096
11150
|
transition: { type: "spring", stiffness: 300, damping: 18 },
|
|
11097
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react46.CalendarBlankIcon, { className: "flex-shrink-0 w-5 h-5 sm:w-6 sm:h-6" })
|
|
11098
11152
|
}
|
|
11099
11153
|
)
|
|
11100
11154
|
]
|
|
@@ -11171,8 +11225,8 @@ function RangePicker({
|
|
|
11171
11225
|
day_hidden: "invisible"
|
|
11172
11226
|
},
|
|
11173
11227
|
components: {
|
|
11174
|
-
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11175
|
-
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11228
|
+
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react46.CaretLeftIcon, { className: "h-4 w-4" }),
|
|
11229
|
+
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react46.CaretRightIcon, { className: "h-4 w-4" })
|
|
11176
11230
|
}
|
|
11177
11231
|
}
|
|
11178
11232
|
)
|
|
@@ -11244,7 +11298,7 @@ RangePicker.displayName = "RangePicker";
|
|
|
11244
11298
|
|
|
11245
11299
|
// src/components/ui/navigation/ContextMenuBase.tsx
|
|
11246
11300
|
var ContextMenuPrimitive = __toESM(require("@radix-ui/react-context-menu"));
|
|
11247
|
-
var
|
|
11301
|
+
var import_react47 = require("@phosphor-icons/react");
|
|
11248
11302
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
11249
11303
|
function ContextMenuBase(props) {
|
|
11250
11304
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
@@ -11286,7 +11340,7 @@ function ContextMenuSubTriggerBase({
|
|
|
11286
11340
|
...props,
|
|
11287
11341
|
children: [
|
|
11288
11342
|
children,
|
|
11289
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11343
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react47.CaretRightIcon, { className: "ml-auto" })
|
|
11290
11344
|
]
|
|
11291
11345
|
}
|
|
11292
11346
|
);
|
|
@@ -11381,7 +11435,7 @@ function ContextMenuCheckboxItemBase({
|
|
|
11381
11435
|
checked,
|
|
11382
11436
|
...props,
|
|
11383
11437
|
children: [
|
|
11384
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11438
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react47.CheckIcon, { className: "size-4" }) }) }),
|
|
11385
11439
|
children
|
|
11386
11440
|
]
|
|
11387
11441
|
}
|
|
@@ -11406,7 +11460,7 @@ function ContextMenuRadioItemBase({
|
|
|
11406
11460
|
),
|
|
11407
11461
|
...props,
|
|
11408
11462
|
children: [
|
|
11409
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11463
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react47.CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
11410
11464
|
children
|
|
11411
11465
|
]
|
|
11412
11466
|
}
|
|
@@ -11455,8 +11509,8 @@ function ContextMenuShortcutBase({
|
|
|
11455
11509
|
}
|
|
11456
11510
|
|
|
11457
11511
|
// src/components/ui/CodeBlock.tsx
|
|
11458
|
-
var
|
|
11459
|
-
var
|
|
11512
|
+
var import_react48 = require("@phosphor-icons/react");
|
|
11513
|
+
var import_react49 = __toESM(require("react"));
|
|
11460
11514
|
var import_react_syntax_highlighter = require("react-syntax-highlighter");
|
|
11461
11515
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
11462
11516
|
var CodeBlock = ({
|
|
@@ -11468,11 +11522,11 @@ var CodeBlock = ({
|
|
|
11468
11522
|
breadcrumb = [],
|
|
11469
11523
|
showStats = true
|
|
11470
11524
|
}) => {
|
|
11471
|
-
const [copied, setCopied] =
|
|
11472
|
-
const [activeTab, setActiveTab] =
|
|
11473
|
-
const [isExpanded, setIsExpanded] =
|
|
11525
|
+
const [copied, setCopied] = import_react49.default.useState(false);
|
|
11526
|
+
const [activeTab, setActiveTab] = import_react49.default.useState(0);
|
|
11527
|
+
const [isExpanded, setIsExpanded] = import_react49.default.useState(false);
|
|
11474
11528
|
const tabsExist = tabs.length > 0;
|
|
11475
|
-
const cssVars =
|
|
11529
|
+
const cssVars = import_react49.default.useMemo(
|
|
11476
11530
|
() => ({
|
|
11477
11531
|
container: {
|
|
11478
11532
|
backgroundColor: "hsl(var(--card))",
|
|
@@ -11537,12 +11591,12 @@ var CodeBlock = ({
|
|
|
11537
11591
|
case "jsx":
|
|
11538
11592
|
case "typescript":
|
|
11539
11593
|
case "tsx":
|
|
11540
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.CodeIcon, { size: "1em", className: "text-yellow-400" });
|
|
11541
11595
|
case "bash":
|
|
11542
11596
|
case "shell":
|
|
11543
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.TerminalIcon, { size: "1em", className: "text-green-400" });
|
|
11544
11598
|
default:
|
|
11545
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.FileArchiveIcon, { size: "1em", className: "text-blue-400" });
|
|
11546
11600
|
}
|
|
11547
11601
|
};
|
|
11548
11602
|
const getCodeStats = (source) => {
|
|
@@ -11567,8 +11621,8 @@ var CodeBlock = ({
|
|
|
11567
11621
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-3 h-3 rounded-full bg-green-500" })
|
|
11568
11622
|
] }),
|
|
11569
11623
|
breadcrumb.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center min-w-0", children: [
|
|
11570
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11571
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
11624
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.FolderIcon, { size: "1em", style: cssVars.icon }),
|
|
11625
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react49.default.Fragment, { children: [
|
|
11572
11626
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11573
11627
|
"span",
|
|
11574
11628
|
{
|
|
@@ -11578,7 +11632,7 @@ var CodeBlock = ({
|
|
|
11578
11632
|
}
|
|
11579
11633
|
),
|
|
11580
11634
|
index < breadcrumb.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11581
|
-
|
|
11635
|
+
import_react48.ArrowRightIcon,
|
|
11582
11636
|
{
|
|
11583
11637
|
size: "0.75em",
|
|
11584
11638
|
style: cssVars.icon,
|
|
@@ -11609,7 +11663,7 @@ var CodeBlock = ({
|
|
|
11609
11663
|
onClick: () => setIsExpanded(!isExpanded),
|
|
11610
11664
|
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
11611
11665
|
title: "Toggle fullscreen",
|
|
11612
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11666
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.ArrowsOutIcon, { size: "1em", style: cssVars.icon })
|
|
11613
11667
|
}
|
|
11614
11668
|
),
|
|
11615
11669
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
@@ -11618,7 +11672,7 @@ var CodeBlock = ({
|
|
|
11618
11672
|
onClick: downloadCode,
|
|
11619
11673
|
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
11620
11674
|
title: "Download code",
|
|
11621
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11675
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.DownloadIcon, { size: "1em", style: cssVars.icon })
|
|
11622
11676
|
}
|
|
11623
11677
|
),
|
|
11624
11678
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
@@ -11628,12 +11682,12 @@ var CodeBlock = ({
|
|
|
11628
11682
|
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
11629
11683
|
title: "Copy code",
|
|
11630
11684
|
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11631
|
-
|
|
11685
|
+
import_react48.CheckIcon,
|
|
11632
11686
|
{
|
|
11633
11687
|
size: "1em",
|
|
11634
11688
|
style: { color: "hsl(var(--primary))" }
|
|
11635
11689
|
}
|
|
11636
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11690
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.CopyIcon, { size: "1em", style: cssVars.icon })
|
|
11637
11691
|
}
|
|
11638
11692
|
)
|
|
11639
11693
|
] })
|
|
@@ -11746,7 +11800,7 @@ var CodeBlock = ({
|
|
|
11746
11800
|
] })
|
|
11747
11801
|
] }),
|
|
11748
11802
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
11749
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11803
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.GearIcon, { size: "0.75em", style: cssVars.icon }),
|
|
11750
11804
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: "UTF-8" })
|
|
11751
11805
|
] })
|
|
11752
11806
|
]
|
|
@@ -11825,22 +11879,74 @@ function StatusIndicator({
|
|
|
11825
11879
|
}
|
|
11826
11880
|
|
|
11827
11881
|
// src/components/ui/form/DebouncedInput.tsx
|
|
11828
|
-
var
|
|
11829
|
-
var
|
|
11882
|
+
var import_react50 = require("react");
|
|
11883
|
+
var import_react51 = require("@phosphor-icons/react");
|
|
11830
11884
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
11885
|
+
function DebouncedInput({
|
|
11886
|
+
value: initialValue,
|
|
11887
|
+
onChange,
|
|
11888
|
+
debounce = 500,
|
|
11889
|
+
label,
|
|
11890
|
+
labelClassname,
|
|
11891
|
+
leftIcon,
|
|
11892
|
+
rightIcon,
|
|
11893
|
+
showLoadingIndicator = false,
|
|
11894
|
+
className,
|
|
11895
|
+
error,
|
|
11896
|
+
...props
|
|
11897
|
+
}) {
|
|
11898
|
+
const [value, setValue] = (0, import_react50.useState)(initialValue);
|
|
11899
|
+
const [isDebouncing, setIsDebouncing] = (0, import_react50.useState)(false);
|
|
11900
|
+
(0, import_react50.useEffect)(() => {
|
|
11901
|
+
setValue(initialValue);
|
|
11902
|
+
}, [initialValue]);
|
|
11903
|
+
(0, import_react50.useEffect)(() => {
|
|
11904
|
+
if (value !== initialValue) {
|
|
11905
|
+
setIsDebouncing(true);
|
|
11906
|
+
}
|
|
11907
|
+
const timeout = setTimeout(() => {
|
|
11908
|
+
onChange(value);
|
|
11909
|
+
setIsDebouncing(false);
|
|
11910
|
+
}, debounce);
|
|
11911
|
+
return () => {
|
|
11912
|
+
clearTimeout(timeout);
|
|
11913
|
+
setIsDebouncing(false);
|
|
11914
|
+
};
|
|
11915
|
+
}, [debounce, initialValue, onChange, value]);
|
|
11916
|
+
const renderRightIcon = () => {
|
|
11917
|
+
if (showLoadingIndicator && isDebouncing) {
|
|
11918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react51.CircleNotchIcon, { className: "h-4 w-4 animate-spin text-muted-foreground" });
|
|
11919
|
+
}
|
|
11920
|
+
return rightIcon;
|
|
11921
|
+
};
|
|
11922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
11923
|
+
InputBase,
|
|
11924
|
+
{
|
|
11925
|
+
...props,
|
|
11926
|
+
label,
|
|
11927
|
+
labelClassname,
|
|
11928
|
+
leftIcon,
|
|
11929
|
+
rightIcon: renderRightIcon(),
|
|
11930
|
+
className: cn("transition-all duration-200", className),
|
|
11931
|
+
value,
|
|
11932
|
+
onChange: (e) => setValue(e.target.value),
|
|
11933
|
+
error
|
|
11934
|
+
}
|
|
11935
|
+
);
|
|
11936
|
+
}
|
|
11831
11937
|
|
|
11832
11938
|
// src/components/event-calendar/AgendaView.tsx
|
|
11833
11939
|
var import_date_fns3 = require("date-fns");
|
|
11834
11940
|
var import_locale2 = require("date-fns/locale");
|
|
11835
|
-
var
|
|
11836
|
-
var
|
|
11941
|
+
var import_react52 = require("react");
|
|
11942
|
+
var import_react53 = require("@phosphor-icons/react");
|
|
11837
11943
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
11838
11944
|
function AgendaView({
|
|
11839
11945
|
currentDate,
|
|
11840
11946
|
events,
|
|
11841
11947
|
onEventSelect
|
|
11842
11948
|
}) {
|
|
11843
|
-
const days = (0,
|
|
11949
|
+
const days = (0, import_react52.useMemo)(() => {
|
|
11844
11950
|
console.log("Agenda view updating with date:", currentDate.toISOString());
|
|
11845
11951
|
return Array.from(
|
|
11846
11952
|
{ length: AgendaDaysToShow },
|
|
@@ -11856,9 +11962,9 @@ function AgendaView({
|
|
|
11856
11962
|
(day) => getAgendaEventsForDay(events, day).length > 0
|
|
11857
11963
|
);
|
|
11858
11964
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "border-border/70 border-t px-4", children: !hasEvents ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex min-h-[70svh] flex-col items-center justify-center py-16 text-center", children: [
|
|
11859
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
11860
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("h3", { className: "font-medium text-lg", children: "
|
|
11861
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: "text-muted-foreground", children: "
|
|
11965
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_react53.CalendarIcon, { className: "mb-2 text-muted-foreground/50", size: 32 }),
|
|
11966
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("h3", { className: "font-medium text-lg", children: "Nenhum evento encontrado" }),
|
|
11967
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: "text-muted-foreground", children: "N\xE3o h\xE1 eventos agendados para este per\xEDodo." })
|
|
11862
11968
|
] }) : days.map((day) => {
|
|
11863
11969
|
const dayEvents = getAgendaEventsForDay(events, day);
|
|
11864
11970
|
if (dayEvents.length === 0) return null;
|
|
@@ -11897,11 +12003,11 @@ function AgendaView({
|
|
|
11897
12003
|
// src/components/event-calendar/CalendarDND.tsx
|
|
11898
12004
|
var import_core = require("@dnd-kit/core");
|
|
11899
12005
|
var import_date_fns4 = require("date-fns");
|
|
11900
|
-
var
|
|
12006
|
+
var import_react55 = require("react");
|
|
11901
12007
|
|
|
11902
12008
|
// src/components/event-calendar/hooks.ts
|
|
11903
|
-
var
|
|
11904
|
-
var CalendarDndContext = (0,
|
|
12009
|
+
var import_react54 = require("react");
|
|
12010
|
+
var CalendarDndContext = (0, import_react54.createContext)({
|
|
11905
12011
|
activeEvent: null,
|
|
11906
12012
|
activeId: null,
|
|
11907
12013
|
activeView: null,
|
|
@@ -11911,7 +12017,7 @@ var CalendarDndContext = (0, import_react53.createContext)({
|
|
|
11911
12017
|
isMultiDay: false,
|
|
11912
12018
|
multiDayWidth: null
|
|
11913
12019
|
});
|
|
11914
|
-
var useCalendarDnd = () => (0,
|
|
12020
|
+
var useCalendarDnd = () => (0, import_react54.useContext)(CalendarDndContext);
|
|
11915
12021
|
|
|
11916
12022
|
// src/components/event-calendar/CalendarDND.tsx
|
|
11917
12023
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
@@ -11919,17 +12025,17 @@ function CalendarDndProvider({
|
|
|
11919
12025
|
children,
|
|
11920
12026
|
onEventUpdate
|
|
11921
12027
|
}) {
|
|
11922
|
-
const [activeEvent, setActiveEvent] = (0,
|
|
11923
|
-
const [activeId, setActiveId] = (0,
|
|
11924
|
-
const [activeView, setActiveView] = (0,
|
|
12028
|
+
const [activeEvent, setActiveEvent] = (0, import_react55.useState)(null);
|
|
12029
|
+
const [activeId, setActiveId] = (0, import_react55.useState)(null);
|
|
12030
|
+
const [activeView, setActiveView] = (0, import_react55.useState)(
|
|
11925
12031
|
null
|
|
11926
12032
|
);
|
|
11927
|
-
const [currentTime, setCurrentTime] = (0,
|
|
11928
|
-
const [eventHeight, setEventHeight] = (0,
|
|
11929
|
-
const [isMultiDay, setIsMultiDay] = (0,
|
|
11930
|
-
const [multiDayWidth, setMultiDayWidth] = (0,
|
|
11931
|
-
const [dragHandlePosition, setDragHandlePosition] = (0,
|
|
11932
|
-
const eventDimensions = (0,
|
|
12033
|
+
const [currentTime, setCurrentTime] = (0, import_react55.useState)(null);
|
|
12034
|
+
const [eventHeight, setEventHeight] = (0, import_react55.useState)(null);
|
|
12035
|
+
const [isMultiDay, setIsMultiDay] = (0, import_react55.useState)(false);
|
|
12036
|
+
const [multiDayWidth, setMultiDayWidth] = (0, import_react55.useState)(null);
|
|
12037
|
+
const [dragHandlePosition, setDragHandlePosition] = (0, import_react55.useState)(null);
|
|
12038
|
+
const eventDimensions = (0, import_react55.useRef)({ height: 0 });
|
|
11933
12039
|
const sensors = (0, import_core.useSensors)(
|
|
11934
12040
|
(0, import_core.useSensor)(import_core.MouseSensor, {
|
|
11935
12041
|
// Require the mouse to move by 5px before activating
|
|
@@ -11951,7 +12057,7 @@ function CalendarDndProvider({
|
|
|
11951
12057
|
}
|
|
11952
12058
|
})
|
|
11953
12059
|
);
|
|
11954
|
-
const dndContextId = (0,
|
|
12060
|
+
const dndContextId = (0, import_react55.useId)();
|
|
11955
12061
|
const handleDragStart = (event) => {
|
|
11956
12062
|
const { active } = event;
|
|
11957
12063
|
if (!active.data.current) {
|
|
@@ -12143,7 +12249,7 @@ var DefaultEndHour = 10;
|
|
|
12143
12249
|
|
|
12144
12250
|
// src/components/event-calendar/DayView.tsx
|
|
12145
12251
|
var import_date_fns5 = require("date-fns");
|
|
12146
|
-
var
|
|
12252
|
+
var import_react56 = require("react");
|
|
12147
12253
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
12148
12254
|
function DayView({
|
|
12149
12255
|
currentDate,
|
|
@@ -12151,14 +12257,14 @@ function DayView({
|
|
|
12151
12257
|
onEventSelect,
|
|
12152
12258
|
onEventCreate
|
|
12153
12259
|
}) {
|
|
12154
|
-
const hours = (0,
|
|
12260
|
+
const hours = (0, import_react56.useMemo)(() => {
|
|
12155
12261
|
const dayStart = (0, import_date_fns5.startOfDay)(currentDate);
|
|
12156
12262
|
return (0, import_date_fns5.eachHourOfInterval)({
|
|
12157
12263
|
end: (0, import_date_fns5.addHours)(dayStart, EndHour - 1),
|
|
12158
12264
|
start: (0, import_date_fns5.addHours)(dayStart, StartHour)
|
|
12159
12265
|
});
|
|
12160
12266
|
}, [currentDate]);
|
|
12161
|
-
const dayEvents = (0,
|
|
12267
|
+
const dayEvents = (0, import_react56.useMemo)(() => {
|
|
12162
12268
|
return events.filter((event) => {
|
|
12163
12269
|
const eventStart = new Date(event.start);
|
|
12164
12270
|
const eventEnd = new Date(event.end);
|
|
@@ -12167,17 +12273,17 @@ function DayView({
|
|
|
12167
12273
|
(a, b) => new Date(a.start).getTime() - new Date(b.start).getTime()
|
|
12168
12274
|
);
|
|
12169
12275
|
}, [currentDate, events]);
|
|
12170
|
-
const allDayEvents = (0,
|
|
12276
|
+
const allDayEvents = (0, import_react56.useMemo)(() => {
|
|
12171
12277
|
return dayEvents.filter((event) => {
|
|
12172
12278
|
return event.allDay || isMultiDayEvent(event);
|
|
12173
12279
|
});
|
|
12174
12280
|
}, [dayEvents]);
|
|
12175
|
-
const timeEvents = (0,
|
|
12281
|
+
const timeEvents = (0, import_react56.useMemo)(() => {
|
|
12176
12282
|
return dayEvents.filter((event) => {
|
|
12177
12283
|
return !event.allDay && !isMultiDayEvent(event);
|
|
12178
12284
|
});
|
|
12179
12285
|
}, [dayEvents]);
|
|
12180
|
-
const positionedEvents = (0,
|
|
12286
|
+
const positionedEvents = (0, import_react56.useMemo)(() => {
|
|
12181
12287
|
const result = [];
|
|
12182
12288
|
const dayStart = (0, import_date_fns5.startOfDay)(currentDate);
|
|
12183
12289
|
const sortedEvents = [...timeEvents].sort((a, b) => {
|
|
@@ -12274,7 +12380,7 @@ function DayView({
|
|
|
12274
12380
|
"div",
|
|
12275
12381
|
{
|
|
12276
12382
|
className: "relative h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
|
|
12277
|
-
children: index > 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: (0, import_date_fns5.format)(hour, "
|
|
12383
|
+
children: index > 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: (0, import_date_fns5.format)(hour, "HH:mm") })
|
|
12278
12384
|
},
|
|
12279
12385
|
hour.toString()
|
|
12280
12386
|
)) }),
|
|
@@ -12358,7 +12464,7 @@ function DayView({
|
|
|
12358
12464
|
var import_core2 = require("@dnd-kit/core");
|
|
12359
12465
|
var import_utilities = require("@dnd-kit/utilities");
|
|
12360
12466
|
var import_date_fns6 = require("date-fns");
|
|
12361
|
-
var
|
|
12467
|
+
var import_react57 = require("react");
|
|
12362
12468
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
12363
12469
|
function DraggableEvent({
|
|
12364
12470
|
event,
|
|
@@ -12373,8 +12479,8 @@ function DraggableEvent({
|
|
|
12373
12479
|
"aria-hidden": ariaHidden
|
|
12374
12480
|
}) {
|
|
12375
12481
|
const { activeId } = useCalendarDnd();
|
|
12376
|
-
const elementRef = (0,
|
|
12377
|
-
const [dragHandlePosition, setDragHandlePosition] = (0,
|
|
12482
|
+
const elementRef = (0, import_react57.useRef)(null);
|
|
12483
|
+
const [dragHandlePosition, setDragHandlePosition] = (0, import_react57.useState)(null);
|
|
12378
12484
|
const eventStart = new Date(event.start);
|
|
12379
12485
|
const eventEnd = new Date(event.end);
|
|
12380
12486
|
const isMultiDayEvent2 = isMultiDay || event.allDay || (0, import_date_fns6.differenceInDays)(eventEnd, eventStart) >= 1;
|
|
@@ -12499,9 +12605,9 @@ function DroppableCell({
|
|
|
12499
12605
|
// src/components/event-calendar/EventCalendar.tsx
|
|
12500
12606
|
var import_date_fns7 = require("date-fns");
|
|
12501
12607
|
var import_locale3 = require("date-fns/locale");
|
|
12502
|
-
var
|
|
12608
|
+
var import_react58 = require("react");
|
|
12503
12609
|
var import_sonner3 = require("sonner");
|
|
12504
|
-
var
|
|
12610
|
+
var import_react59 = require("@phosphor-icons/react");
|
|
12505
12611
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
12506
12612
|
function EventCalendar({
|
|
12507
12613
|
events = [],
|
|
@@ -12511,11 +12617,11 @@ function EventCalendar({
|
|
|
12511
12617
|
className,
|
|
12512
12618
|
initialView = "month"
|
|
12513
12619
|
}) {
|
|
12514
|
-
const [currentDate, setCurrentDate] = (0,
|
|
12515
|
-
const [view, setView] = (0,
|
|
12516
|
-
const [isFading, setIsFading] = (0,
|
|
12620
|
+
const [currentDate, setCurrentDate] = (0, import_react58.useState)(/* @__PURE__ */ new Date());
|
|
12621
|
+
const [view, setView] = (0, import_react58.useState)(initialView);
|
|
12622
|
+
const [isFading, setIsFading] = (0, import_react58.useState)(false);
|
|
12517
12623
|
const FADE_DURATION = 220;
|
|
12518
|
-
const changeView = (0,
|
|
12624
|
+
const changeView = (0, import_react58.useCallback)(
|
|
12519
12625
|
(next) => {
|
|
12520
12626
|
if (next === view) return;
|
|
12521
12627
|
setIsFading(true);
|
|
@@ -12526,12 +12632,12 @@ function EventCalendar({
|
|
|
12526
12632
|
},
|
|
12527
12633
|
[view]
|
|
12528
12634
|
);
|
|
12529
|
-
const [isPaging, setIsPaging] = (0,
|
|
12530
|
-
const [pageDirection, setPageDirection] = (0,
|
|
12635
|
+
const [isPaging, setIsPaging] = (0, import_react58.useState)(false);
|
|
12636
|
+
const [pageDirection, setPageDirection] = (0, import_react58.useState)(
|
|
12531
12637
|
null
|
|
12532
12638
|
);
|
|
12533
12639
|
const PAGE_DURATION = 200;
|
|
12534
|
-
const pageTransition = (0,
|
|
12640
|
+
const pageTransition = (0, import_react58.useCallback)(
|
|
12535
12641
|
(applyDateChange, direction) => {
|
|
12536
12642
|
setIsPaging(true);
|
|
12537
12643
|
setPageDirection(direction);
|
|
@@ -12545,11 +12651,11 @@ function EventCalendar({
|
|
|
12545
12651
|
},
|
|
12546
12652
|
[]
|
|
12547
12653
|
);
|
|
12548
|
-
const [isEventDialogOpen, setIsEventDialogOpen] = (0,
|
|
12549
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
12654
|
+
const [isEventDialogOpen, setIsEventDialogOpen] = (0, import_react58.useState)(false);
|
|
12655
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react58.useState)(
|
|
12550
12656
|
null
|
|
12551
12657
|
);
|
|
12552
|
-
(0,
|
|
12658
|
+
(0, import_react58.useEffect)(() => {
|
|
12553
12659
|
const handleKeyDown = (e) => {
|
|
12554
12660
|
if (isEventDialogOpen || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLElement && e.target.isContentEditable) {
|
|
12555
12661
|
return;
|
|
@@ -12684,7 +12790,7 @@ function EventCalendar({
|
|
|
12684
12790
|
position: "bottom-left"
|
|
12685
12791
|
});
|
|
12686
12792
|
};
|
|
12687
|
-
const viewTitle = (0,
|
|
12793
|
+
const viewTitle = (0, import_react58.useMemo)(() => {
|
|
12688
12794
|
const capitalize = (s) => s && s.length > 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
12689
12795
|
if (view === "month") {
|
|
12690
12796
|
return capitalize((0, import_date_fns7.format)(currentDate, "MMMM yyyy", { locale: import_locale3.ptBR }));
|
|
@@ -12750,7 +12856,7 @@ function EventCalendar({
|
|
|
12750
12856
|
variant: "outline",
|
|
12751
12857
|
children: [
|
|
12752
12858
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
12753
|
-
|
|
12859
|
+
import_react59.CalendarIcon,
|
|
12754
12860
|
{
|
|
12755
12861
|
"aria-hidden": "true",
|
|
12756
12862
|
className: "min-[480px]:hidden",
|
|
@@ -12769,7 +12875,7 @@ function EventCalendar({
|
|
|
12769
12875
|
onClick: handlePrevious,
|
|
12770
12876
|
size: "icon",
|
|
12771
12877
|
variant: "ghost",
|
|
12772
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
12878
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react59.CaretLeft, { "aria-hidden": "true", size: 16 })
|
|
12773
12879
|
}
|
|
12774
12880
|
),
|
|
12775
12881
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
@@ -12779,7 +12885,7 @@ function EventCalendar({
|
|
|
12779
12885
|
onClick: handleNext,
|
|
12780
12886
|
size: "icon",
|
|
12781
12887
|
variant: "ghost",
|
|
12782
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
12888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react59.CaretRight, { "aria-hidden": "true", size: 16 })
|
|
12783
12889
|
}
|
|
12784
12890
|
)
|
|
12785
12891
|
] }),
|
|
@@ -12814,7 +12920,7 @@ function EventCalendar({
|
|
|
12814
12920
|
})() })
|
|
12815
12921
|
] }),
|
|
12816
12922
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
12817
|
-
|
|
12923
|
+
import_react59.ArrowDownIcon,
|
|
12818
12924
|
{
|
|
12819
12925
|
"aria-hidden": "true",
|
|
12820
12926
|
className: "-me-1 opacity-60",
|
|
@@ -12854,7 +12960,7 @@ function EventCalendar({
|
|
|
12854
12960
|
size: "sm",
|
|
12855
12961
|
children: [
|
|
12856
12962
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
12857
|
-
|
|
12963
|
+
import_react59.PlusIcon,
|
|
12858
12964
|
{
|
|
12859
12965
|
"aria-hidden": "true",
|
|
12860
12966
|
className: "sm:-ms-1 opacity-60",
|
|
@@ -12936,11 +13042,11 @@ function EventCalendar({
|
|
|
12936
13042
|
|
|
12937
13043
|
// src/components/event-calendar/EventDialog.tsx
|
|
12938
13044
|
var import_date_fns8 = require("date-fns");
|
|
12939
|
-
var
|
|
13045
|
+
var import_react60 = require("react");
|
|
12940
13046
|
var import_react_radio_group = require("@radix-ui/react-radio-group");
|
|
12941
13047
|
var import_framer_motion17 = require("framer-motion");
|
|
12942
13048
|
var import_locale4 = require("date-fns/locale");
|
|
12943
|
-
var
|
|
13049
|
+
var import_react61 = require("@phosphor-icons/react");
|
|
12944
13050
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
12945
13051
|
function EventDialog({
|
|
12946
13052
|
event,
|
|
@@ -12949,21 +13055,21 @@ function EventDialog({
|
|
|
12949
13055
|
onSave,
|
|
12950
13056
|
onDelete
|
|
12951
13057
|
}) {
|
|
12952
|
-
const [title, setTitle] = (0,
|
|
12953
|
-
const [description, setDescription] = (0,
|
|
12954
|
-
const [startDate, setStartDate] = (0,
|
|
12955
|
-
const [endDate, setEndDate] = (0,
|
|
12956
|
-
const [startTime, setStartTime] = (0,
|
|
12957
|
-
const [endTime, setEndTime] = (0,
|
|
12958
|
-
const [allDay, setAllDay] = (0,
|
|
12959
|
-
const [location, setLocation] = (0,
|
|
12960
|
-
const [color, setColor] = (0,
|
|
12961
|
-
const [error, setError] = (0,
|
|
12962
|
-
const [startDateOpen, setStartDateOpen] = (0,
|
|
12963
|
-
const [endDateOpen, setEndDateOpen] = (0,
|
|
12964
|
-
(0,
|
|
13058
|
+
const [title, setTitle] = (0, import_react60.useState)("");
|
|
13059
|
+
const [description, setDescription] = (0, import_react60.useState)("");
|
|
13060
|
+
const [startDate, setStartDate] = (0, import_react60.useState)(/* @__PURE__ */ new Date());
|
|
13061
|
+
const [endDate, setEndDate] = (0, import_react60.useState)(/* @__PURE__ */ new Date());
|
|
13062
|
+
const [startTime, setStartTime] = (0, import_react60.useState)(`${DefaultStartHour}:00`);
|
|
13063
|
+
const [endTime, setEndTime] = (0, import_react60.useState)(`${DefaultEndHour}:00`);
|
|
13064
|
+
const [allDay, setAllDay] = (0, import_react60.useState)(false);
|
|
13065
|
+
const [location, setLocation] = (0, import_react60.useState)("");
|
|
13066
|
+
const [color, setColor] = (0, import_react60.useState)("sky");
|
|
13067
|
+
const [error, setError] = (0, import_react60.useState)(null);
|
|
13068
|
+
const [startDateOpen, setStartDateOpen] = (0, import_react60.useState)(false);
|
|
13069
|
+
const [endDateOpen, setEndDateOpen] = (0, import_react60.useState)(false);
|
|
13070
|
+
(0, import_react60.useEffect)(() => {
|
|
12965
13071
|
}, [event]);
|
|
12966
|
-
const resetForm = (0,
|
|
13072
|
+
const resetForm = (0, import_react60.useCallback)(() => {
|
|
12967
13073
|
setTitle("");
|
|
12968
13074
|
setDescription("");
|
|
12969
13075
|
setStartDate(/* @__PURE__ */ new Date());
|
|
@@ -12975,12 +13081,12 @@ function EventDialog({
|
|
|
12975
13081
|
setColor("sky");
|
|
12976
13082
|
setError(null);
|
|
12977
13083
|
}, []);
|
|
12978
|
-
const formatTimeForInput = (0,
|
|
13084
|
+
const formatTimeForInput = (0, import_react60.useCallback)((date) => {
|
|
12979
13085
|
const hours = date.getHours().toString().padStart(2, "0");
|
|
12980
13086
|
const minutes = Math.floor(date.getMinutes() / 15) * 15;
|
|
12981
13087
|
return `${hours}:${minutes.toString().padStart(2, "0")}`;
|
|
12982
13088
|
}, []);
|
|
12983
|
-
(0,
|
|
13089
|
+
(0, import_react60.useEffect)(() => {
|
|
12984
13090
|
if (event) {
|
|
12985
13091
|
setTitle(event.title || "");
|
|
12986
13092
|
setDescription(event.description || "");
|
|
@@ -12998,7 +13104,7 @@ function EventDialog({
|
|
|
12998
13104
|
resetForm();
|
|
12999
13105
|
}
|
|
13000
13106
|
}, [event, formatTimeForInput, resetForm]);
|
|
13001
|
-
const timeOptions = (0,
|
|
13107
|
+
const timeOptions = (0, import_react60.useMemo)(() => {
|
|
13002
13108
|
const options = [];
|
|
13003
13109
|
for (let hour = StartHour; hour <= EndHour; hour++) {
|
|
13004
13110
|
for (let minute = 0; minute < 60; minute += 15) {
|
|
@@ -13187,7 +13293,7 @@ function EventDialog({
|
|
|
13187
13293
|
}
|
|
13188
13294
|
),
|
|
13189
13295
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
13190
|
-
|
|
13296
|
+
import_react61.CalendarIcon,
|
|
13191
13297
|
{
|
|
13192
13298
|
"aria-hidden": "true",
|
|
13193
13299
|
className: "shrink-0 text-muted-foreground/80",
|
|
@@ -13266,7 +13372,7 @@ function EventDialog({
|
|
|
13266
13372
|
}
|
|
13267
13373
|
),
|
|
13268
13374
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
13269
|
-
|
|
13375
|
+
import_react61.CalendarIcon,
|
|
13270
13376
|
{
|
|
13271
13377
|
"aria-hidden": "true",
|
|
13272
13378
|
className: "shrink-0 text-muted-foreground/80",
|
|
@@ -13324,7 +13430,7 @@ function EventDialog({
|
|
|
13324
13430
|
allDay ? "bg-primary border-transparent text-white" : " border border-input"
|
|
13325
13431
|
),
|
|
13326
13432
|
children: [
|
|
13327
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
13433
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react61.CalendarIcon, { size: 14, "aria-hidden": "true" }),
|
|
13328
13434
|
"Dia inteiro"
|
|
13329
13435
|
]
|
|
13330
13436
|
}
|
|
@@ -13383,7 +13489,7 @@ function EventDialog({
|
|
|
13383
13489
|
onClick: handleDelete,
|
|
13384
13490
|
size: "icon",
|
|
13385
13491
|
variant: "outline",
|
|
13386
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
13492
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react61.TrashIcon, { "aria-hidden": "true", size: 16 })
|
|
13387
13493
|
}
|
|
13388
13494
|
),
|
|
13389
13495
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-1 justify-end gap-2", children: [
|
|
@@ -13398,10 +13504,10 @@ function EventDialog({
|
|
|
13398
13504
|
|
|
13399
13505
|
// src/components/event-calendar/EventItem.tsx
|
|
13400
13506
|
var import_date_fns9 = require("date-fns");
|
|
13401
|
-
var
|
|
13507
|
+
var import_react62 = require("react");
|
|
13402
13508
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
13403
13509
|
var formatTimeWithOptionalMinutes = (date) => {
|
|
13404
|
-
return (0, import_date_fns9.format)(date,
|
|
13510
|
+
return (0, import_date_fns9.format)(date, "HH:mm");
|
|
13405
13511
|
};
|
|
13406
13512
|
function EventWrapper({
|
|
13407
13513
|
event,
|
|
@@ -13461,15 +13567,15 @@ function EventItem({
|
|
|
13461
13567
|
onTouchStart
|
|
13462
13568
|
}) {
|
|
13463
13569
|
const eventColor = event.color;
|
|
13464
|
-
const displayStart = (0,
|
|
13570
|
+
const displayStart = (0, import_react62.useMemo)(() => {
|
|
13465
13571
|
return currentTime || new Date(event.start);
|
|
13466
13572
|
}, [currentTime, event.start]);
|
|
13467
|
-
const displayEnd = (0,
|
|
13573
|
+
const displayEnd = (0, import_react62.useMemo)(() => {
|
|
13468
13574
|
return currentTime ? new Date(
|
|
13469
13575
|
new Date(currentTime).getTime() + (new Date(event.end).getTime() - new Date(event.start).getTime())
|
|
13470
13576
|
) : new Date(event.end);
|
|
13471
13577
|
}, [currentTime, event.start, event.end]);
|
|
13472
|
-
const durationMinutes = (0,
|
|
13578
|
+
const durationMinutes = (0, import_react62.useMemo)(() => {
|
|
13473
13579
|
return (0, import_date_fns9.differenceInMinutes)(displayEnd, displayStart);
|
|
13474
13580
|
}, [displayStart, displayEnd]);
|
|
13475
13581
|
const getEventTime = () => {
|
|
@@ -13592,9 +13698,9 @@ function EventItem({
|
|
|
13592
13698
|
// src/components/event-calendar/EventsPopUp.tsx
|
|
13593
13699
|
var import_date_fns10 = require("date-fns");
|
|
13594
13700
|
var import_locale5 = require("date-fns/locale");
|
|
13595
|
-
var
|
|
13701
|
+
var import_react63 = require("react");
|
|
13596
13702
|
var import_framer_motion18 = require("framer-motion");
|
|
13597
|
-
var
|
|
13703
|
+
var import_react64 = require("@phosphor-icons/react");
|
|
13598
13704
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
13599
13705
|
function EventsPopup({
|
|
13600
13706
|
date,
|
|
@@ -13603,8 +13709,8 @@ function EventsPopup({
|
|
|
13603
13709
|
onClose,
|
|
13604
13710
|
onEventSelect
|
|
13605
13711
|
}) {
|
|
13606
|
-
const popupRef = (0,
|
|
13607
|
-
(0,
|
|
13712
|
+
const popupRef = (0, import_react63.useRef)(null);
|
|
13713
|
+
(0, import_react63.useEffect)(() => {
|
|
13608
13714
|
const handleClickOutside = (event) => {
|
|
13609
13715
|
if (popupRef.current && !popupRef.current.contains(event.target)) {
|
|
13610
13716
|
onClose();
|
|
@@ -13615,7 +13721,7 @@ function EventsPopup({
|
|
|
13615
13721
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
13616
13722
|
};
|
|
13617
13723
|
}, [onClose]);
|
|
13618
|
-
(0,
|
|
13724
|
+
(0, import_react63.useEffect)(() => {
|
|
13619
13725
|
const handleEscKey = (event) => {
|
|
13620
13726
|
if (event.key === "Escape") {
|
|
13621
13727
|
onClose();
|
|
@@ -13630,7 +13736,7 @@ function EventsPopup({
|
|
|
13630
13736
|
onEventSelect(event);
|
|
13631
13737
|
onClose();
|
|
13632
13738
|
};
|
|
13633
|
-
const adjustedPosition = (0,
|
|
13739
|
+
const adjustedPosition = (0, import_react63.useMemo)(() => {
|
|
13634
13740
|
const positionCopy = { ...position };
|
|
13635
13741
|
if (popupRef.current) {
|
|
13636
13742
|
const rect = popupRef.current.getBoundingClientRect();
|
|
@@ -13670,15 +13776,15 @@ function EventsPopup({
|
|
|
13670
13776
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
13671
13777
|
"button",
|
|
13672
13778
|
{
|
|
13673
|
-
"aria-label": "
|
|
13779
|
+
"aria-label": "Fechar",
|
|
13674
13780
|
className: "rounded-full p-1 hover:bg-muted",
|
|
13675
13781
|
onClick: onClose,
|
|
13676
13782
|
type: "button",
|
|
13677
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
13783
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react64.XIcon, { className: "h-4 w-4" })
|
|
13678
13784
|
}
|
|
13679
13785
|
)
|
|
13680
13786
|
] }),
|
|
13681
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "space-y-2 p-3", children: events.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "py-2 text-muted-foreground text-sm", children: "
|
|
13787
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "space-y-2 p-3", children: events.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "py-2 text-muted-foreground text-sm", children: "Nenhum evento" }) : events.map((event) => {
|
|
13682
13788
|
const eventStart = new Date(event.start);
|
|
13683
13789
|
const eventEnd = new Date(event.end);
|
|
13684
13790
|
const isFirstDay = (0, import_date_fns10.isSameDay)(date, eventStart);
|
|
@@ -13708,11 +13814,12 @@ function EventsPopup({
|
|
|
13708
13814
|
|
|
13709
13815
|
// src/components/event-calendar/hooks/use-current-time-indicator.ts
|
|
13710
13816
|
var import_date_fns11 = require("date-fns");
|
|
13711
|
-
var
|
|
13817
|
+
var import_locale6 = require("date-fns/locale");
|
|
13818
|
+
var import_react65 = require("react");
|
|
13712
13819
|
function useCurrentTimeIndicator(currentDate, view) {
|
|
13713
|
-
const [currentTimePosition, setCurrentTimePosition] = (0,
|
|
13714
|
-
const [currentTimeVisible, setCurrentTimeVisible] = (0,
|
|
13715
|
-
(0,
|
|
13820
|
+
const [currentTimePosition, setCurrentTimePosition] = (0, import_react65.useState)(0);
|
|
13821
|
+
const [currentTimeVisible, setCurrentTimeVisible] = (0, import_react65.useState)(false);
|
|
13822
|
+
(0, import_react65.useEffect)(() => {
|
|
13716
13823
|
const calculateTimePosition = () => {
|
|
13717
13824
|
const now = /* @__PURE__ */ new Date();
|
|
13718
13825
|
const hours = now.getHours();
|
|
@@ -13725,8 +13832,8 @@ function useCurrentTimeIndicator(currentDate, view) {
|
|
|
13725
13832
|
if (view === "day") {
|
|
13726
13833
|
isCurrentTimeVisible = (0, import_date_fns11.isSameDay)(now, currentDate);
|
|
13727
13834
|
} else if (view === "week") {
|
|
13728
|
-
const startOfWeekDate = (0, import_date_fns11.startOfWeek)(currentDate, {
|
|
13729
|
-
const endOfWeekDate = (0, import_date_fns11.endOfWeek)(currentDate, {
|
|
13835
|
+
const startOfWeekDate = (0, import_date_fns11.startOfWeek)(currentDate, { locale: import_locale6.ptBR });
|
|
13836
|
+
const endOfWeekDate = (0, import_date_fns11.endOfWeek)(currentDate, { locale: import_locale6.ptBR });
|
|
13730
13837
|
isCurrentTimeVisible = (0, import_date_fns11.isWithinInterval)(now, {
|
|
13731
13838
|
end: endOfWeekDate,
|
|
13732
13839
|
start: startOfWeekDate
|
|
@@ -13743,15 +13850,15 @@ function useCurrentTimeIndicator(currentDate, view) {
|
|
|
13743
13850
|
}
|
|
13744
13851
|
|
|
13745
13852
|
// src/components/event-calendar/hooks/use-event-visibility.ts
|
|
13746
|
-
var
|
|
13853
|
+
var import_react66 = require("react");
|
|
13747
13854
|
function useEventVisibility({
|
|
13748
13855
|
eventHeight,
|
|
13749
13856
|
eventGap
|
|
13750
13857
|
}) {
|
|
13751
|
-
const contentRef = (0,
|
|
13752
|
-
const observerRef = (0,
|
|
13753
|
-
const [contentHeight, setContentHeight] = (0,
|
|
13754
|
-
(0,
|
|
13858
|
+
const contentRef = (0, import_react66.useRef)(null);
|
|
13859
|
+
const observerRef = (0, import_react66.useRef)(null);
|
|
13860
|
+
const [contentHeight, setContentHeight] = (0, import_react66.useState)(null);
|
|
13861
|
+
(0, import_react66.useLayoutEffect)(() => {
|
|
13755
13862
|
if (!contentRef.current) return;
|
|
13756
13863
|
const updateHeight = () => {
|
|
13757
13864
|
if (contentRef.current) {
|
|
@@ -13771,7 +13878,7 @@ function useEventVisibility({
|
|
|
13771
13878
|
}
|
|
13772
13879
|
};
|
|
13773
13880
|
}, []);
|
|
13774
|
-
const getVisibleEventCount = (0,
|
|
13881
|
+
const getVisibleEventCount = (0, import_react66.useMemo)(() => {
|
|
13775
13882
|
return (totalEvents) => {
|
|
13776
13883
|
if (!contentHeight) return totalEvents;
|
|
13777
13884
|
const maxEvents = Math.floor(contentHeight / (eventHeight + eventGap));
|
|
@@ -13790,8 +13897,8 @@ function useEventVisibility({
|
|
|
13790
13897
|
|
|
13791
13898
|
// src/components/event-calendar/MonthView.tsx
|
|
13792
13899
|
var import_date_fns12 = require("date-fns");
|
|
13793
|
-
var
|
|
13794
|
-
var
|
|
13900
|
+
var import_locale7 = require("date-fns/locale");
|
|
13901
|
+
var import_react67 = require("react");
|
|
13795
13902
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
13796
13903
|
function MonthView({
|
|
13797
13904
|
currentDate,
|
|
@@ -13799,21 +13906,21 @@ function MonthView({
|
|
|
13799
13906
|
onEventSelect,
|
|
13800
13907
|
onEventCreate
|
|
13801
13908
|
}) {
|
|
13802
|
-
const days = (0,
|
|
13909
|
+
const days = (0, import_react67.useMemo)(() => {
|
|
13803
13910
|
const monthStart = (0, import_date_fns12.startOfMonth)(currentDate);
|
|
13804
13911
|
const monthEnd = (0, import_date_fns12.endOfMonth)(monthStart);
|
|
13805
13912
|
const calendarStart = (0, import_date_fns12.startOfWeek)(monthStart, { weekStartsOn: 0 });
|
|
13806
13913
|
const calendarEnd = (0, import_date_fns12.endOfWeek)(monthEnd, { weekStartsOn: 0 });
|
|
13807
13914
|
return (0, import_date_fns12.eachDayOfInterval)({ end: calendarEnd, start: calendarStart });
|
|
13808
13915
|
}, [currentDate]);
|
|
13809
|
-
const weekdays = (0,
|
|
13916
|
+
const weekdays = (0, import_react67.useMemo)(() => {
|
|
13810
13917
|
return Array.from({ length: 7 }).map((_, i) => {
|
|
13811
13918
|
const date = (0, import_date_fns12.addDays)((0, import_date_fns12.startOfWeek)(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
|
|
13812
|
-
const short = (0, import_date_fns12.format)(date, "EEE", { locale:
|
|
13919
|
+
const short = (0, import_date_fns12.format)(date, "EEE", { locale: import_locale7.ptBR });
|
|
13813
13920
|
return short.charAt(0).toUpperCase() + short.slice(1);
|
|
13814
13921
|
});
|
|
13815
13922
|
}, []);
|
|
13816
|
-
const weeks = (0,
|
|
13923
|
+
const weeks = (0, import_react67.useMemo)(() => {
|
|
13817
13924
|
const result = [];
|
|
13818
13925
|
let week = [];
|
|
13819
13926
|
for (let i = 0; i < days.length; i++) {
|
|
@@ -13829,12 +13936,12 @@ function MonthView({
|
|
|
13829
13936
|
e.stopPropagation();
|
|
13830
13937
|
onEventSelect(event);
|
|
13831
13938
|
};
|
|
13832
|
-
const [isMounted, setIsMounted] = (0,
|
|
13939
|
+
const [isMounted, setIsMounted] = (0, import_react67.useState)(false);
|
|
13833
13940
|
const { contentRef, getVisibleEventCount } = useEventVisibility({
|
|
13834
13941
|
eventGap: EventGap,
|
|
13835
13942
|
eventHeight: EventHeight
|
|
13836
13943
|
});
|
|
13837
|
-
(0,
|
|
13944
|
+
(0, import_react67.useEffect)(() => {
|
|
13838
13945
|
setIsMounted(true);
|
|
13839
13946
|
}, []);
|
|
13840
13947
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "contents", "data-slot": "month-view", children: [
|
|
@@ -13909,7 +14016,7 @@ function MonthView({
|
|
|
13909
14016
|
view: "month",
|
|
13910
14017
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { "aria-hidden": true, className: "invisible", children: [
|
|
13911
14018
|
!event.allDay && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { children: [
|
|
13912
|
-
(0, import_date_fns12.format)(new Date(event.start), "
|
|
14019
|
+
(0, import_date_fns12.format)(new Date(event.start), "HH:mm"),
|
|
13913
14020
|
" "
|
|
13914
14021
|
] }),
|
|
13915
14022
|
event.title
|
|
@@ -13949,7 +14056,7 @@ function MonthView({
|
|
|
13949
14056
|
"aria-label": `Show ${remainingCount} more events on ${(0, import_date_fns12.format)(
|
|
13950
14057
|
day,
|
|
13951
14058
|
"PPP",
|
|
13952
|
-
{ locale:
|
|
14059
|
+
{ locale: import_locale7.ptBR }
|
|
13953
14060
|
)}`,
|
|
13954
14061
|
children: [
|
|
13955
14062
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { className: "font-medium", children: [
|
|
@@ -13969,7 +14076,7 @@ function MonthView({
|
|
|
13969
14076
|
"--event-height": `${EventHeight}px`
|
|
13970
14077
|
},
|
|
13971
14078
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "space-y-2", children: [
|
|
13972
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "font-medium text-sm", children: (0, import_date_fns12.format)(day, "EEE d", { locale:
|
|
14079
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "font-medium text-sm", children: (0, import_date_fns12.format)(day, "EEE d", { locale: import_locale7.ptBR }) }),
|
|
13973
14080
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "space-y-1", children: sortEvents(allEvents).map((event) => {
|
|
13974
14081
|
const eventStart = new Date(event.start);
|
|
13975
14082
|
const eventEnd = new Date(event.end);
|
|
@@ -14090,8 +14197,8 @@ function addHoursToDate(date, hours) {
|
|
|
14090
14197
|
|
|
14091
14198
|
// src/components/event-calendar/WeekView.tsx
|
|
14092
14199
|
var import_date_fns14 = require("date-fns");
|
|
14093
|
-
var
|
|
14094
|
-
var
|
|
14200
|
+
var import_locale8 = require("date-fns/locale");
|
|
14201
|
+
var import_react68 = require("react");
|
|
14095
14202
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
14096
14203
|
function WeekView({
|
|
14097
14204
|
currentDate,
|
|
@@ -14099,23 +14206,23 @@ function WeekView({
|
|
|
14099
14206
|
onEventSelect,
|
|
14100
14207
|
onEventCreate
|
|
14101
14208
|
}) {
|
|
14102
|
-
const days = (0,
|
|
14209
|
+
const days = (0, import_react68.useMemo)(() => {
|
|
14103
14210
|
const weekStart2 = (0, import_date_fns14.startOfWeek)(currentDate, { weekStartsOn: 0 });
|
|
14104
14211
|
const weekEnd = (0, import_date_fns14.endOfWeek)(currentDate, { weekStartsOn: 0 });
|
|
14105
14212
|
return (0, import_date_fns14.eachDayOfInterval)({ end: weekEnd, start: weekStart2 });
|
|
14106
14213
|
}, [currentDate]);
|
|
14107
|
-
const weekStart = (0,
|
|
14214
|
+
const weekStart = (0, import_react68.useMemo)(
|
|
14108
14215
|
() => (0, import_date_fns14.startOfWeek)(currentDate, { weekStartsOn: 0 }),
|
|
14109
14216
|
[currentDate]
|
|
14110
14217
|
);
|
|
14111
|
-
const hours = (0,
|
|
14218
|
+
const hours = (0, import_react68.useMemo)(() => {
|
|
14112
14219
|
const dayStart = (0, import_date_fns14.startOfDay)(currentDate);
|
|
14113
14220
|
return (0, import_date_fns14.eachHourOfInterval)({
|
|
14114
14221
|
end: (0, import_date_fns14.addHours)(dayStart, EndHour - 1),
|
|
14115
14222
|
start: (0, import_date_fns14.addHours)(dayStart, StartHour)
|
|
14116
14223
|
});
|
|
14117
14224
|
}, [currentDate]);
|
|
14118
|
-
const allDayEvents = (0,
|
|
14225
|
+
const allDayEvents = (0, import_react68.useMemo)(() => {
|
|
14119
14226
|
return events.filter((event) => {
|
|
14120
14227
|
return event.allDay || isMultiDayEvent(event);
|
|
14121
14228
|
}).filter((event) => {
|
|
@@ -14126,7 +14233,7 @@ function WeekView({
|
|
|
14126
14233
|
);
|
|
14127
14234
|
});
|
|
14128
14235
|
}, [events, days]);
|
|
14129
|
-
const processedDayEvents = (0,
|
|
14236
|
+
const processedDayEvents = (0, import_react68.useMemo)(() => {
|
|
14130
14237
|
const result = days.map((day) => {
|
|
14131
14238
|
const dayEvents = events.filter((event) => {
|
|
14132
14239
|
if (event.allDay || isMultiDayEvent(event)) return false;
|
|
@@ -14219,11 +14326,11 @@ function WeekView({
|
|
|
14219
14326
|
"data-today": (0, import_date_fns14.isToday)(day) || void 0,
|
|
14220
14327
|
children: [
|
|
14221
14328
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { "aria-hidden": "true", className: "sm:hidden", children: [
|
|
14222
|
-
(0, import_date_fns14.format)(day, "EEE", { locale:
|
|
14329
|
+
(0, import_date_fns14.format)(day, "EEE", { locale: import_locale8.ptBR })[0],
|
|
14223
14330
|
" ",
|
|
14224
|
-
(0, import_date_fns14.format)(day, "d", { locale:
|
|
14331
|
+
(0, import_date_fns14.format)(day, "d", { locale: import_locale8.ptBR })
|
|
14225
14332
|
] }),
|
|
14226
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "max-sm:hidden", children: (0, import_date_fns14.format)(day, "EEE dd", { locale:
|
|
14333
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "max-sm:hidden", children: (0, import_date_fns14.format)(day, "EEE dd", { locale: import_locale8.ptBR }) })
|
|
14227
14334
|
]
|
|
14228
14335
|
},
|
|
14229
14336
|
day.toString()
|
|
@@ -14282,7 +14389,7 @@ function WeekView({
|
|
|
14282
14389
|
"div",
|
|
14283
14390
|
{
|
|
14284
14391
|
className: "relative min-h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
|
|
14285
|
-
children: index > 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: (0, import_date_fns14.format)(hour, "
|
|
14392
|
+
children: index > 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: (0, import_date_fns14.format)(hour, "HH:mm") })
|
|
14286
14393
|
},
|
|
14287
14394
|
hour.toString()
|
|
14288
14395
|
)) }),
|
|
@@ -14372,13 +14479,13 @@ function WeekView({
|
|
|
14372
14479
|
}
|
|
14373
14480
|
|
|
14374
14481
|
// src/hooks/use-drag.tsx
|
|
14375
|
-
var
|
|
14482
|
+
var import_react69 = require("react");
|
|
14376
14483
|
var useDrag = (options = {}) => {
|
|
14377
|
-
const [isDragging, setIsDragging] = (0,
|
|
14378
|
-
const [positions, setPositions] = (0,
|
|
14379
|
-
const dragStartPos = (0,
|
|
14380
|
-
const dragId = (0,
|
|
14381
|
-
const handleMouseDown = (0,
|
|
14484
|
+
const [isDragging, setIsDragging] = (0, import_react69.useState)(null);
|
|
14485
|
+
const [positions, setPositions] = (0, import_react69.useState)({});
|
|
14486
|
+
const dragStartPos = (0, import_react69.useRef)(null);
|
|
14487
|
+
const dragId = (0, import_react69.useRef)(null);
|
|
14488
|
+
const handleMouseDown = (0, import_react69.useCallback)((id, e) => {
|
|
14382
14489
|
e.preventDefault();
|
|
14383
14490
|
const currentPosition = positions[id] || { top: 0, left: 0 };
|
|
14384
14491
|
dragStartPos.current = {
|
|
@@ -14391,7 +14498,7 @@ var useDrag = (options = {}) => {
|
|
|
14391
14498
|
setIsDragging(id);
|
|
14392
14499
|
options.onDragStart?.(id);
|
|
14393
14500
|
}, [positions, options]);
|
|
14394
|
-
const handleMouseMove = (0,
|
|
14501
|
+
const handleMouseMove = (0, import_react69.useCallback)((e) => {
|
|
14395
14502
|
if (!isDragging || !dragStartPos.current || !dragId.current) return;
|
|
14396
14503
|
const deltaX = e.clientX - dragStartPos.current.x;
|
|
14397
14504
|
const deltaY = e.clientY - dragStartPos.current.y;
|
|
@@ -14407,7 +14514,7 @@ var useDrag = (options = {}) => {
|
|
|
14407
14514
|
}));
|
|
14408
14515
|
options.onDrag?.(dragId.current, newPosition);
|
|
14409
14516
|
}, [isDragging, options]);
|
|
14410
|
-
const handleMouseUp = (0,
|
|
14517
|
+
const handleMouseUp = (0, import_react69.useCallback)(() => {
|
|
14411
14518
|
if (dragId.current) {
|
|
14412
14519
|
options.onDragEnd?.(dragId.current);
|
|
14413
14520
|
}
|
|
@@ -14415,7 +14522,7 @@ var useDrag = (options = {}) => {
|
|
|
14415
14522
|
dragStartPos.current = null;
|
|
14416
14523
|
dragId.current = null;
|
|
14417
14524
|
}, [options]);
|
|
14418
|
-
(0,
|
|
14525
|
+
(0, import_react69.useEffect)(() => {
|
|
14419
14526
|
if (isDragging) {
|
|
14420
14527
|
document.addEventListener("mousemove", handleMouseMove);
|
|
14421
14528
|
document.addEventListener("mouseup", handleMouseUp);
|
|
@@ -14427,16 +14534,16 @@ var useDrag = (options = {}) => {
|
|
|
14427
14534
|
};
|
|
14428
14535
|
}
|
|
14429
14536
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
14430
|
-
const setPosition = (0,
|
|
14537
|
+
const setPosition = (0, import_react69.useCallback)((id, position) => {
|
|
14431
14538
|
setPositions((prev) => ({
|
|
14432
14539
|
...prev,
|
|
14433
14540
|
[id]: position
|
|
14434
14541
|
}));
|
|
14435
14542
|
}, []);
|
|
14436
|
-
const getPosition = (0,
|
|
14543
|
+
const getPosition = (0, import_react69.useCallback)((id) => {
|
|
14437
14544
|
return positions[id] || { top: 0, left: 0 };
|
|
14438
14545
|
}, [positions]);
|
|
14439
|
-
const isElementDragging = (0,
|
|
14546
|
+
const isElementDragging = (0, import_react69.useCallback)((id) => {
|
|
14440
14547
|
return isDragging === id;
|
|
14441
14548
|
}, [isDragging]);
|
|
14442
14549
|
return {
|