@mlw-packages/react-components 1.9.7 → 1.9.8
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 +195 -14
- package/dist/index.d.mts +95 -2
- package/dist/index.d.ts +95 -2
- package/dist/index.js +334 -237
- package/dist/index.mjs +335 -239
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1891,9 +1891,9 @@ var InputBase = React33__namespace.forwardRef(
|
|
|
1891
1891
|
"div",
|
|
1892
1892
|
{
|
|
1893
1893
|
className: cn(
|
|
1894
|
-
"flex items-center rounded-md transition h-9
|
|
1894
|
+
"flex items-center rounded-md transition h-9 bg-background overflow-hidden",
|
|
1895
1895
|
type !== "file" && "border border-input",
|
|
1896
|
-
error ? "border-destructive focus:ring-1 focus:ring-destructive" : "border-input
|
|
1896
|
+
error ? "border-destructive focus:ring-1 focus:ring-destructive" : "border-input"
|
|
1897
1897
|
),
|
|
1898
1898
|
children: [
|
|
1899
1899
|
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center px-2", children: leftIcon }),
|
|
@@ -1977,87 +1977,130 @@ var CommandInputBase = React33__namespace.forwardRef(({ className, testid: dataT
|
|
|
1977
1977
|
}
|
|
1978
1978
|
));
|
|
1979
1979
|
CommandInputBase.displayName = cmdk.Command.Input.displayName;
|
|
1980
|
-
var
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2009
|
-
const
|
|
2010
|
-
|
|
1980
|
+
var CommandDebouncedInputBase = React33__namespace.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1981
|
+
"div",
|
|
1982
|
+
{
|
|
1983
|
+
className: "flex items-center border-b px-3 border-border",
|
|
1984
|
+
"cmdk-input-wrapper": "",
|
|
1985
|
+
children: [
|
|
1986
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 text-primary" }),
|
|
1987
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1988
|
+
cmdk.Command.Input,
|
|
1989
|
+
{
|
|
1990
|
+
ref,
|
|
1991
|
+
className: cn(
|
|
1992
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none text-primary placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
1993
|
+
className
|
|
1994
|
+
),
|
|
1995
|
+
"data-testid": dataTestId,
|
|
1996
|
+
...props
|
|
1997
|
+
}
|
|
1998
|
+
)
|
|
1999
|
+
]
|
|
2000
|
+
}
|
|
2001
|
+
));
|
|
2002
|
+
CommandDebouncedInputBase.displayName = cmdk.Command.Input.displayName;
|
|
2003
|
+
var CommandListBase = React33__namespace.forwardRef(
|
|
2004
|
+
({ className, testid: dataTestId = "command-list", onEndReached, ...props }, ref) => {
|
|
2005
|
+
const listRef = React33__namespace.useRef(null);
|
|
2006
|
+
React33__namespace.useEffect(() => {
|
|
2007
|
+
const element = listRef.current;
|
|
2008
|
+
if (!element) return;
|
|
2009
|
+
const handleWheel = (e) => {
|
|
2010
|
+
const target = e.currentTarget;
|
|
2011
|
+
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
2012
|
+
const isScrollingDown = e.deltaY > 0;
|
|
2013
|
+
const isScrollingUp = e.deltaY < 0;
|
|
2014
|
+
const isAtBottom = scrollTop + clientHeight >= scrollHeight - 1;
|
|
2015
|
+
const isAtTop = scrollTop <= 1;
|
|
2016
|
+
if (isScrollingDown && isAtBottom && onEndReached) {
|
|
2017
|
+
onEndReached();
|
|
2018
|
+
}
|
|
2019
|
+
if (isScrollingDown && !isAtBottom || isScrollingUp && !isAtTop) {
|
|
2020
|
+
e.stopPropagation();
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
2023
|
+
const handleScroll = (e) => {
|
|
2024
|
+
const target = e.currentTarget;
|
|
2025
|
+
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
2026
|
+
const isAtBottom = scrollTop + clientHeight >= scrollHeight - 1;
|
|
2027
|
+
if (isAtBottom && onEndReached) {
|
|
2028
|
+
onEndReached();
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
let touchStartY = 0;
|
|
2032
|
+
const handleTouchStart = (e) => {
|
|
2033
|
+
touchStartY = e.touches[0].clientY;
|
|
2011
2034
|
e.stopPropagation();
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
"
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
willChange: "scroll-position",
|
|
2055
|
-
transform: "translateZ(0)"
|
|
2035
|
+
};
|
|
2036
|
+
const handleTouchMove = (e) => {
|
|
2037
|
+
const target = e.currentTarget;
|
|
2038
|
+
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
2039
|
+
const touchCurrentY = e.touches[0].clientY;
|
|
2040
|
+
const touchDeltaY = touchStartY - touchCurrentY;
|
|
2041
|
+
const isScrollingDown = touchDeltaY > 0;
|
|
2042
|
+
const isScrollingUp = touchDeltaY < 0;
|
|
2043
|
+
const isAtBottom = scrollTop + clientHeight >= scrollHeight - 1;
|
|
2044
|
+
const isAtTop = scrollTop <= 1;
|
|
2045
|
+
if (isScrollingDown && isAtBottom && onEndReached) {
|
|
2046
|
+
onEndReached();
|
|
2047
|
+
}
|
|
2048
|
+
if (isScrollingDown && !isAtBottom || isScrollingUp && !isAtTop) {
|
|
2049
|
+
e.stopPropagation();
|
|
2050
|
+
} else if (isScrollingDown && isAtBottom || isScrollingUp && isAtTop) {
|
|
2051
|
+
e.preventDefault();
|
|
2052
|
+
}
|
|
2053
|
+
};
|
|
2054
|
+
element.addEventListener("wheel", handleWheel, { passive: false });
|
|
2055
|
+
element.addEventListener("scroll", handleScroll);
|
|
2056
|
+
element.addEventListener("touchstart", handleTouchStart, {
|
|
2057
|
+
passive: false
|
|
2058
|
+
});
|
|
2059
|
+
element.addEventListener("touchmove", handleTouchMove, {
|
|
2060
|
+
passive: false
|
|
2061
|
+
});
|
|
2062
|
+
return () => {
|
|
2063
|
+
element.removeEventListener("wheel", handleWheel);
|
|
2064
|
+
element.removeEventListener("scroll", handleScroll);
|
|
2065
|
+
element.removeEventListener("touchmove", handleTouchMove);
|
|
2066
|
+
element.removeEventListener("touchstart", handleTouchStart);
|
|
2067
|
+
};
|
|
2068
|
+
}, [onEndReached]);
|
|
2069
|
+
const combinedRef = React33__namespace.useCallback(
|
|
2070
|
+
(node) => {
|
|
2071
|
+
listRef.current = node;
|
|
2072
|
+
if (typeof ref === "function") {
|
|
2073
|
+
ref(node);
|
|
2074
|
+
} else if (ref) {
|
|
2075
|
+
ref.current = node;
|
|
2076
|
+
}
|
|
2056
2077
|
},
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2078
|
+
[ref]
|
|
2079
|
+
);
|
|
2080
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2081
|
+
cmdk.Command.List,
|
|
2082
|
+
{
|
|
2083
|
+
ref: combinedRef,
|
|
2084
|
+
className: cn(
|
|
2085
|
+
"max-h-[300px] overflow-y-auto overflow-x-hidden scroll-smooth [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",
|
|
2086
|
+
className
|
|
2087
|
+
),
|
|
2088
|
+
"data-testid": dataTestId,
|
|
2089
|
+
style: {
|
|
2090
|
+
overscrollBehavior: "contain",
|
|
2091
|
+
WebkitOverflowScrolling: "touch",
|
|
2092
|
+
touchAction: "pan-y",
|
|
2093
|
+
scrollbarWidth: "thin",
|
|
2094
|
+
scrollbarColor: "hsl(var(--muted)) transparent",
|
|
2095
|
+
overflowY: "auto",
|
|
2096
|
+
willChange: "scroll-position",
|
|
2097
|
+
transform: "translateZ(0)"
|
|
2098
|
+
},
|
|
2099
|
+
...props
|
|
2100
|
+
}
|
|
2101
|
+
);
|
|
2102
|
+
}
|
|
2103
|
+
);
|
|
2061
2104
|
CommandListBase.displayName = cmdk.Command.List.displayName;
|
|
2062
2105
|
var CommandEmptyBase = React33__namespace.forwardRef(({ testid: dataTestId = "command-empty", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2063
2106
|
cmdk.Command.Empty,
|
|
@@ -7323,58 +7366,62 @@ function StatusIndicator({
|
|
|
7323
7366
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children })
|
|
7324
7367
|
] });
|
|
7325
7368
|
}
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7369
|
+
var DebouncedInput = React33.forwardRef(
|
|
7370
|
+
({
|
|
7371
|
+
value: initialValue,
|
|
7372
|
+
onChange,
|
|
7373
|
+
debounce: debounce2 = 500,
|
|
7374
|
+
label,
|
|
7375
|
+
labelClassname,
|
|
7376
|
+
leftIcon,
|
|
7377
|
+
rightIcon,
|
|
7378
|
+
showLoadingIndicator = false,
|
|
7379
|
+
className,
|
|
7380
|
+
error,
|
|
7381
|
+
...props
|
|
7382
|
+
}, ref) => {
|
|
7383
|
+
const [value, setValue] = React33.useState(initialValue);
|
|
7384
|
+
const [isDebouncing, setIsDebouncing] = React33.useState(false);
|
|
7385
|
+
React33.useEffect(() => {
|
|
7386
|
+
setValue(initialValue);
|
|
7387
|
+
}, [initialValue]);
|
|
7388
|
+
React33.useEffect(() => {
|
|
7389
|
+
if (value !== initialValue) {
|
|
7390
|
+
setIsDebouncing(true);
|
|
7391
|
+
}
|
|
7392
|
+
const timeout = setTimeout(() => {
|
|
7393
|
+
onChange(value);
|
|
7394
|
+
setIsDebouncing(false);
|
|
7395
|
+
}, debounce2);
|
|
7396
|
+
return () => {
|
|
7397
|
+
clearTimeout(timeout);
|
|
7398
|
+
setIsDebouncing(false);
|
|
7399
|
+
};
|
|
7400
|
+
}, [debounce2, initialValue, onChange, value]);
|
|
7401
|
+
const renderRightIcon = () => {
|
|
7402
|
+
if (showLoadingIndicator && isDebouncing) {
|
|
7403
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.CircleNotchIcon, { className: "h-4 w-4 animate-spin text-muted-foreground" });
|
|
7404
|
+
}
|
|
7405
|
+
return rightIcon;
|
|
7355
7406
|
};
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
error
|
|
7375
|
-
}
|
|
7376
|
-
);
|
|
7377
|
-
}
|
|
7407
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7408
|
+
InputBase,
|
|
7409
|
+
{
|
|
7410
|
+
...props,
|
|
7411
|
+
ref,
|
|
7412
|
+
label,
|
|
7413
|
+
labelClassname,
|
|
7414
|
+
leftIcon,
|
|
7415
|
+
rightIcon: renderRightIcon(),
|
|
7416
|
+
className: cn("transition-all duration-200", className),
|
|
7417
|
+
value,
|
|
7418
|
+
onChange: (e) => setValue(e.target.value),
|
|
7419
|
+
error
|
|
7420
|
+
}
|
|
7421
|
+
);
|
|
7422
|
+
}
|
|
7423
|
+
);
|
|
7424
|
+
DebouncedInput.displayName = "DebouncedInput";
|
|
7378
7425
|
function useCheckboxTree(initialTree) {
|
|
7379
7426
|
const initialCheckedNodes = React33.useMemo(() => {
|
|
7380
7427
|
const checkedSet = /* @__PURE__ */ new Set();
|
|
@@ -9144,19 +9191,19 @@ function getEventColorClassesAgenda(color) {
|
|
|
9144
9191
|
const eventColor = color || "sky";
|
|
9145
9192
|
switch (eventColor) {
|
|
9146
9193
|
case "sky":
|
|
9147
|
-
return "bg-sky-
|
|
9194
|
+
return "bg-sky-100 hover:bg-sky-200 text-sky-900 border dark:bg-sky-500/30 dark:hover:bg-sky-500/40 dark:text-sky-50 dark:border-sky-400/40 shadow-sky-500/15 hover:shadow-sky-500/25 transition-all duration-200";
|
|
9148
9195
|
case "amber":
|
|
9149
|
-
return "bg-amber-
|
|
9196
|
+
return "bg-amber-100 hover:bg-amber-200 text-amber-900 border dark:bg-amber-500/30 dark:hover:bg-amber-500/40 dark:text-amber-50 dark:border-amber-400/40 shadow-amber-500/15 hover:shadow-amber-500/25 transition-all duration-200";
|
|
9150
9197
|
case "violet":
|
|
9151
|
-
return "bg-violet-
|
|
9198
|
+
return "bg-violet-100 hover:bg-violet-200 text-violet-900 border dark:bg-violet-500/30 dark:hover:bg-violet-500/40 dark:text-violet-50 dark:border-violet-400/40 shadow-violet-500/15 hover:shadow-violet-500/25 transition-all duration-200";
|
|
9152
9199
|
case "rose":
|
|
9153
|
-
return "bg-rose-
|
|
9200
|
+
return "bg-rose-100 hover:bg-rose-200 text-rose-900 border dark:bg-rose-500/30 dark:hover:bg-rose-500/40 dark:text-rose-50 dark:border-rose-400/40 shadow-rose-500/15 hover:shadow-rose-500/25 transition-all duration-200";
|
|
9154
9201
|
case "emerald":
|
|
9155
|
-
return "bg-emerald-
|
|
9202
|
+
return "bg-emerald-100 hover:bg-emerald-200 text-emerald-900 border dark:bg-emerald-500/30 dark:hover:bg-emerald-500/40 dark:text-emerald-50 dark:border-emerald-400/40 shadow-emerald-500/15 hover:shadow-emerald-500/25 transition-all duration-200";
|
|
9156
9203
|
case "orange":
|
|
9157
|
-
return "bg-orange-
|
|
9204
|
+
return "bg-orange-100 hover:bg-orange-200 text-orange-900 border dark:bg-orange-500/30 dark:hover:bg-orange-500/40 dark:text-orange-50 dark:border-orange-400/40 shadow-orange-500/15 hover:shadow-orange-500/25 transition-all duration-200";
|
|
9158
9205
|
default:
|
|
9159
|
-
return "bg-sky-
|
|
9206
|
+
return "bg-sky-100 hover:bg-sky-200 text-sky-900 border dark:bg-sky-500/30 dark:hover:bg-sky-500/40 dark:text-sky-50 dark:border-sky-400/40 shadow-sky-500/15 hover:shadow-sky-500/25 transition-all duration-200";
|
|
9160
9207
|
}
|
|
9161
9208
|
}
|
|
9162
9209
|
function getBorderRadiusClassesAgenda(isFirstDay, isLastDay) {
|
|
@@ -9175,7 +9222,7 @@ function isMultiDayEventAgenda(event) {
|
|
|
9175
9222
|
const eventStart = getEventStartDate(event);
|
|
9176
9223
|
const eventEnd = getEventEndDate(event);
|
|
9177
9224
|
if (!eventStart || !eventEnd) return !!event.allDay;
|
|
9178
|
-
return event.allDay ||
|
|
9225
|
+
return event.allDay || !dateFns.isSameDay(eventStart, eventEnd);
|
|
9179
9226
|
}
|
|
9180
9227
|
function getEventsForDayAgenda(events, day) {
|
|
9181
9228
|
return events.filter((event) => {
|
|
@@ -9331,12 +9378,13 @@ function EventWrapper({
|
|
|
9331
9378
|
return void 0;
|
|
9332
9379
|
})();
|
|
9333
9380
|
const isEventInPast = displayEnd ? dateFns.isPast(displayEnd) : false;
|
|
9334
|
-
const colorClasses = hasValidTimeForWrapper ? getEventColorClassesAgenda(event.color) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
|
|
9381
|
+
const colorClasses = hasValidTimeForWrapper ? getEventColorClassesAgenda(event.color) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none ";
|
|
9335
9382
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9336
9383
|
"button",
|
|
9337
9384
|
{
|
|
9338
9385
|
className: cn(
|
|
9339
|
-
"flex w-full select-none
|
|
9386
|
+
"flex w-full select-none px-3 py-1 text-left font-medium outline-none transition-transform duration-150 ease-out backdrop-blur-sm focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:border-ring data-dragging:cursor-grabbing data-past-event:line-through data-dragging:shadow-lg sm:px-3 rounded-lg shadow-sm hover:shadow-md border ",
|
|
9387
|
+
className?.includes("overflow-visible") ? "" : "overflow-hidden",
|
|
9340
9388
|
colorClasses,
|
|
9341
9389
|
getBorderRadiusClassesAgenda(isFirstDay, isLastDay),
|
|
9342
9390
|
className
|
|
@@ -9961,7 +10009,7 @@ function Select({
|
|
|
9961
10009
|
]
|
|
9962
10010
|
}
|
|
9963
10011
|
),
|
|
9964
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsxRuntime.jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: pagination && pagination > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10012
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsxRuntime.jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", className: "border-border", children: pagination && pagination > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9965
10013
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9966
10014
|
"div",
|
|
9967
10015
|
{
|
|
@@ -10459,7 +10507,7 @@ function MonthViewAgenda({
|
|
|
10459
10507
|
"div",
|
|
10460
10508
|
{
|
|
10461
10509
|
className: tailwindMerge.twMerge(
|
|
10462
|
-
`mt-1 inline-flex w-6 h-6 sm:w-7 sm:h-7 items-center justify-center rounded-
|
|
10510
|
+
`mt-1 inline-flex w-6 h-6 sm:w-7 sm:h-7 items-center justify-center border rounded-md text-xs sm:text-sm font-semibold text-muted-foreground`,
|
|
10463
10511
|
dateFns.isToday(day) ? "bg-blue-500 text-white" : ""
|
|
10464
10512
|
),
|
|
10465
10513
|
children: dateFns.format(day, "d")
|
|
@@ -10492,21 +10540,19 @@ function MonthViewAgenda({
|
|
|
10492
10540
|
isLastDay,
|
|
10493
10541
|
onClick: (e) => handleEventClick(event, e),
|
|
10494
10542
|
view: "month",
|
|
10495
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
10496
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] opacity-80", children: "\u2192" }),
|
|
10497
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", children: event.title })
|
|
10498
|
-
] })
|
|
10543
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 truncate text-[12px] text-foreground" })
|
|
10499
10544
|
}
|
|
10500
10545
|
)
|
|
10501
10546
|
},
|
|
10502
10547
|
`spanning-${event.id}-${day.toISOString().slice(0, 10)}`
|
|
10503
10548
|
);
|
|
10504
10549
|
}
|
|
10550
|
+
const isMultiDay = !isLastDay;
|
|
10505
10551
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10506
10552
|
"div",
|
|
10507
10553
|
{
|
|
10508
10554
|
"aria-hidden": isHidden ? "true" : void 0,
|
|
10509
|
-
className: "aria-hidden:hidden",
|
|
10555
|
+
className: "aria-hidden:hidden relative",
|
|
10510
10556
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10511
10557
|
EventItemAgenda,
|
|
10512
10558
|
{
|
|
@@ -10515,9 +10561,16 @@ function MonthViewAgenda({
|
|
|
10515
10561
|
isLastDay,
|
|
10516
10562
|
onClick: (e) => handleEventClick(event, e),
|
|
10517
10563
|
view: "month",
|
|
10518
|
-
|
|
10564
|
+
className: isMultiDay ? "overflow-visible" : "",
|
|
10565
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 sm:gap-2 truncate text-[12px] text-foreground relative z-10", children: [
|
|
10519
10566
|
!event.allDay && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-normal opacity-80 text-[10px] sm:text-[11px] bg-white/10 px-1 py-0.5 rounded-full", children: dateFns.format(eventStart, "HH:mm") }),
|
|
10520
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10567
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10568
|
+
"span",
|
|
10569
|
+
{
|
|
10570
|
+
className: `font-medium text-xs sm:text-sm ${isMultiDay ? "whitespace-nowrap" : "truncate"}`,
|
|
10571
|
+
children: event.title
|
|
10572
|
+
}
|
|
10573
|
+
)
|
|
10521
10574
|
] })
|
|
10522
10575
|
}
|
|
10523
10576
|
)
|
|
@@ -13283,13 +13336,13 @@ function getEventColorClasses(color) {
|
|
|
13283
13336
|
}
|
|
13284
13337
|
function getBorderRadiusClasses(isFirstDay, isLastDay) {
|
|
13285
13338
|
if (isFirstDay && isLastDay) {
|
|
13286
|
-
return "rounded";
|
|
13339
|
+
return "rounded-lg";
|
|
13287
13340
|
}
|
|
13288
13341
|
if (isFirstDay) {
|
|
13289
|
-
return "rounded-l rounded-r-none";
|
|
13342
|
+
return "rounded-l-lg rounded-r-none";
|
|
13290
13343
|
}
|
|
13291
13344
|
if (isLastDay) {
|
|
13292
|
-
return "rounded-r rounded-l-none";
|
|
13345
|
+
return "rounded-r-lg rounded-l-none";
|
|
13293
13346
|
}
|
|
13294
13347
|
return "rounded-none";
|
|
13295
13348
|
}
|
|
@@ -15123,7 +15176,7 @@ var DraggableTooltipComponent = ({
|
|
|
15123
15176
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15124
15177
|
framerMotion.motion.div,
|
|
15125
15178
|
{
|
|
15126
|
-
className: "fixed pointer-events-none z-
|
|
15179
|
+
className: "fixed pointer-events-none z-[9998]",
|
|
15127
15180
|
variants: guideVariants,
|
|
15128
15181
|
initial: "hidden",
|
|
15129
15182
|
animate: "visible",
|
|
@@ -15145,7 +15198,7 @@ var DraggableTooltipComponent = ({
|
|
|
15145
15198
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15146
15199
|
framerMotion.motion.div,
|
|
15147
15200
|
{
|
|
15148
|
-
className: "fixed pointer-events-none z-
|
|
15201
|
+
className: "fixed pointer-events-none z-[9999]",
|
|
15149
15202
|
variants: guideDotVariants,
|
|
15150
15203
|
initial: "hidden",
|
|
15151
15204
|
animate: "visible",
|
|
@@ -15185,7 +15238,7 @@ var DraggableTooltipComponent = ({
|
|
|
15185
15238
|
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15186
15239
|
framerMotion.motion.div,
|
|
15187
15240
|
{
|
|
15188
|
-
className: "fixed bg-card border border-border rounded-lg shadow-lg z-
|
|
15241
|
+
className: "fixed bg-card border border-border rounded-lg shadow-lg z-[10000] min-w-80 select-none",
|
|
15189
15242
|
variants: tooltipVariants,
|
|
15190
15243
|
initial: "hidden",
|
|
15191
15244
|
animate: "visible",
|
|
@@ -15417,7 +15470,7 @@ var RechartTooltipWithTotal = ({
|
|
|
15417
15470
|
{
|
|
15418
15471
|
role: "dialog",
|
|
15419
15472
|
"aria-label": `Tooltip ${label ?? ""}`,
|
|
15420
|
-
className: "bg-card border border-border rounded-lg p-3 shadow-2xl max-w-xs z-
|
|
15473
|
+
className: "bg-card border border-border rounded-lg p-3 shadow-2xl max-w-xs z-[10000]",
|
|
15421
15474
|
style: { minWidth: 220 },
|
|
15422
15475
|
children: [
|
|
15423
15476
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between mb-2", children: [
|
|
@@ -15530,7 +15583,7 @@ var TooltipSimple = ({
|
|
|
15530
15583
|
{
|
|
15531
15584
|
role: "dialog",
|
|
15532
15585
|
"aria-label": `Tooltip ${label ?? ""}`,
|
|
15533
|
-
className: "bg-card border border-border rounded-lg p-3 shadow-2xl max-w-[280px] z-
|
|
15586
|
+
className: "bg-card border border-border rounded-lg p-3 shadow-2xl max-w-[280px] z-[10000]",
|
|
15534
15587
|
style: { minWidth: 220 },
|
|
15535
15588
|
children: [
|
|
15536
15589
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between gap-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
@@ -15719,7 +15772,7 @@ var SystemTooltip = ({
|
|
|
15719
15772
|
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15720
15773
|
framerMotion.motion.div,
|
|
15721
15774
|
{
|
|
15722
|
-
className: "fixed bg-card/95 backdrop-blur-md border border-border/50 rounded-xl shadow-2xl z-
|
|
15775
|
+
className: "fixed bg-card/95 backdrop-blur-md border border-border/50 rounded-xl shadow-2xl z-[10000] w-80 overflow-hidden",
|
|
15723
15776
|
variants: tooltipVariants2,
|
|
15724
15777
|
initial: "hidden",
|
|
15725
15778
|
animate: "visible",
|
|
@@ -15794,7 +15847,9 @@ var SystemTooltip = ({
|
|
|
15794
15847
|
"div",
|
|
15795
15848
|
{
|
|
15796
15849
|
className: "group flex items-center justify-between p-2 rounded-lg bg-emerald-500/5 border border-emerald-500/10 hover:border-emerald-500/30 transition-all cursor-pointer",
|
|
15797
|
-
onClick: () => setExpandedId(
|
|
15850
|
+
onClick: () => setExpandedId(
|
|
15851
|
+
expandedId === conn.id ? null : conn.id
|
|
15852
|
+
),
|
|
15798
15853
|
children: [
|
|
15799
15854
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium truncate", children: conn.name }) }),
|
|
15800
15855
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15856,7 +15911,9 @@ var SystemTooltip = ({
|
|
|
15856
15911
|
"div",
|
|
15857
15912
|
{
|
|
15858
15913
|
className: "group flex items-center justify-between p-2 rounded-lg bg-blue-500/5 border border-blue-500/10 hover:border-blue-500/30 transition-all cursor-pointer",
|
|
15859
|
-
onClick: () => setExpandedId(
|
|
15914
|
+
onClick: () => setExpandedId(
|
|
15915
|
+
expandedId === conn.id ? null : conn.id
|
|
15916
|
+
),
|
|
15860
15917
|
children: [
|
|
15861
15918
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium truncate", children: conn.name }) }),
|
|
15862
15919
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15917,6 +15974,35 @@ var SystemTooltip = ({
|
|
|
15917
15974
|
) });
|
|
15918
15975
|
};
|
|
15919
15976
|
var SystemTooltip_default = SystemTooltip;
|
|
15977
|
+
|
|
15978
|
+
// src/components/ui/charts/components/tooltips/systemTooltipUtils.ts
|
|
15979
|
+
function processNeo4jData(integrations, targetSystemName) {
|
|
15980
|
+
const connections = [];
|
|
15981
|
+
integrations.forEach((integration) => {
|
|
15982
|
+
const origemNome = integration.origem.properties.nome;
|
|
15983
|
+
const destinoNome = integration.destino.properties.nome;
|
|
15984
|
+
if (origemNome === targetSystemName) {
|
|
15985
|
+
connections.push({
|
|
15986
|
+
id: integration.r.elementId,
|
|
15987
|
+
name: destinoNome,
|
|
15988
|
+
type: "saida",
|
|
15989
|
+
integration: integration.r.properties
|
|
15990
|
+
});
|
|
15991
|
+
}
|
|
15992
|
+
if (destinoNome === targetSystemName) {
|
|
15993
|
+
connections.push({
|
|
15994
|
+
id: integration.r.elementId,
|
|
15995
|
+
name: origemNome,
|
|
15996
|
+
type: "entrada",
|
|
15997
|
+
integration: integration.r.properties
|
|
15998
|
+
});
|
|
15999
|
+
}
|
|
16000
|
+
});
|
|
16001
|
+
return {
|
|
16002
|
+
name: targetSystemName,
|
|
16003
|
+
connections
|
|
16004
|
+
};
|
|
16005
|
+
}
|
|
15920
16006
|
var Brush = ({
|
|
15921
16007
|
data,
|
|
15922
16008
|
legend,
|
|
@@ -16621,7 +16707,7 @@ var NoData = ({
|
|
|
16621
16707
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16622
16708
|
"svg",
|
|
16623
16709
|
{
|
|
16624
|
-
className: "w-full h-
|
|
16710
|
+
className: "w-full h-full opacity-40",
|
|
16625
16711
|
viewBox: `0 0 900 ${h}`,
|
|
16626
16712
|
preserveAspectRatio: "none",
|
|
16627
16713
|
children: [
|
|
@@ -17391,6 +17477,16 @@ var Chart = ({
|
|
|
17391
17477
|
// horizontal removido
|
|
17392
17478
|
// orderBy removido
|
|
17393
17479
|
}) => {
|
|
17480
|
+
const usesFullHeight = typeof height === "string" && (height === "100%" || height === "100vh") || typeof className === "string" && /\bh-full\b/.test(className || "");
|
|
17481
|
+
const responsiveHeight = usesFullHeight ? "100%" : height;
|
|
17482
|
+
const wrapperClass = cn(
|
|
17483
|
+
"w-full min-w-0 rounded-lg border-border",
|
|
17484
|
+
className,
|
|
17485
|
+
"overflow-hidden"
|
|
17486
|
+
);
|
|
17487
|
+
const wrapperStyle = usesFullHeight ? void 0 : {
|
|
17488
|
+
height: typeof responsiveHeight === "number" ? `${responsiveHeight}px` : responsiveHeight
|
|
17489
|
+
};
|
|
17394
17490
|
const { xAxisConfig, mapperConfig } = React33.useMemo(() => {
|
|
17395
17491
|
return fnSmartConfig({ xAxis, data, labelMap });
|
|
17396
17492
|
}, [data, xAxis, labelMap]);
|
|
@@ -17534,6 +17630,10 @@ var Chart = ({
|
|
|
17534
17630
|
maxTooltips,
|
|
17535
17631
|
effectiveChartWidth
|
|
17536
17632
|
});
|
|
17633
|
+
const legendSpace = showLegend ? 44 : 0;
|
|
17634
|
+
const xAxisLabelSpace = xAxisLabel ? 18 : 0;
|
|
17635
|
+
const brushSpace = timeSeriesConfig?.height ? 200 : 0;
|
|
17636
|
+
const bottomMargin = 10 + legendSpace + xAxisLabelSpace + brushSpace;
|
|
17537
17637
|
if (!data && !isLoading) return null;
|
|
17538
17638
|
if (isLoading) {
|
|
17539
17639
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -17557,16 +17657,13 @@ var Chart = ({
|
|
|
17557
17657
|
}
|
|
17558
17658
|
);
|
|
17559
17659
|
}
|
|
17560
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17561
|
-
|
|
17562
|
-
|
|
17563
|
-
|
|
17564
|
-
|
|
17565
|
-
|
|
17566
|
-
|
|
17567
|
-
),
|
|
17568
|
-
children: [
|
|
17569
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0 py-1", children: [
|
|
17660
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: wrapperRef, className: wrapperClass, style: wrapperStyle, children: [
|
|
17661
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
17662
|
+
"div",
|
|
17663
|
+
{
|
|
17664
|
+
className: "rounded-lg bg-card relative w-full max-w-full min-w-0 py-1",
|
|
17665
|
+
style: usesFullHeight ? { height: "100%" } : void 0,
|
|
17666
|
+
children: [
|
|
17570
17667
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17571
17668
|
ChartHeader,
|
|
17572
17669
|
{
|
|
@@ -17628,16 +17725,15 @@ var Chart = ({
|
|
|
17628
17725
|
)
|
|
17629
17726
|
}
|
|
17630
17727
|
),
|
|
17631
|
-
/* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height
|
|
17728
|
+
/* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: responsiveHeight, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17632
17729
|
recharts.ComposedChart,
|
|
17633
17730
|
{
|
|
17634
17731
|
data: processedData,
|
|
17635
|
-
height,
|
|
17636
17732
|
margin: {
|
|
17637
17733
|
top: 10,
|
|
17638
17734
|
right: finalChartRightMargin,
|
|
17639
17735
|
left: finalChartLeftMargin,
|
|
17640
|
-
bottom:
|
|
17736
|
+
bottom: bottomMargin
|
|
17641
17737
|
},
|
|
17642
17738
|
onClick: handleChartClick,
|
|
17643
17739
|
children: [
|
|
@@ -17918,67 +18014,67 @@ var Chart = ({
|
|
|
17918
18014
|
]
|
|
17919
18015
|
}
|
|
17920
18016
|
) })
|
|
17921
|
-
]
|
|
17922
|
-
|
|
17923
|
-
|
|
17924
|
-
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
|
|
17931
|
-
|
|
17932
|
-
|
|
17933
|
-
|
|
17934
|
-
|
|
17935
|
-
|
|
17936
|
-
|
|
17937
|
-
|
|
17938
|
-
|
|
17939
|
-
|
|
17940
|
-
|
|
17941
|
-
|
|
17942
|
-
|
|
17943
|
-
|
|
17944
|
-
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17951
|
-
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17956
|
-
|
|
17957
|
-
|
|
17958
|
-
|
|
17959
|
-
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
17963
|
-
|
|
17964
|
-
|
|
17965
|
-
|
|
17966
|
-
|
|
17967
|
-
|
|
17968
|
-
|
|
17969
|
-
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
|
|
17974
|
-
|
|
17975
|
-
|
|
17976
|
-
|
|
17977
|
-
|
|
17978
|
-
|
|
17979
|
-
|
|
17980
|
-
|
|
17981
|
-
);
|
|
18017
|
+
]
|
|
18018
|
+
}
|
|
18019
|
+
),
|
|
18020
|
+
enableDraggableTooltips && activeTooltips.map((tooltip) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
18021
|
+
DraggableTooltip_default,
|
|
18022
|
+
{
|
|
18023
|
+
id: tooltip.id,
|
|
18024
|
+
data: adaptDataForTooltip(tooltip.data, xAxisConfig.dataKey),
|
|
18025
|
+
position: tooltip.position,
|
|
18026
|
+
title,
|
|
18027
|
+
dataKeys: allKeys,
|
|
18028
|
+
finalColors,
|
|
18029
|
+
highlightedSeries,
|
|
18030
|
+
toggleHighlight,
|
|
18031
|
+
showOnlyHighlighted,
|
|
18032
|
+
onClose: (id) => setActiveTooltips((prev) => prev.filter((t) => t.id !== id)),
|
|
18033
|
+
onPositionChange: onTooltipPositionChange,
|
|
18034
|
+
periodLabel,
|
|
18035
|
+
dataLabel: "Dados do Per\xEDodo",
|
|
18036
|
+
valueFormatter: finalValueFormatter,
|
|
18037
|
+
categoryFormatter,
|
|
18038
|
+
globalTooltipCount: activeTooltips.length,
|
|
18039
|
+
onCloseAll: () => window.dispatchEvent(new Event("closeAllTooltips")),
|
|
18040
|
+
closeAllButtonPosition: "top-center",
|
|
18041
|
+
closeAllButtonVariant: "floating"
|
|
18042
|
+
},
|
|
18043
|
+
tooltip.id
|
|
18044
|
+
)),
|
|
18045
|
+
enableDraggableTooltips && activeTooltips.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18046
|
+
CloseAllButton_default,
|
|
18047
|
+
{
|
|
18048
|
+
count: activeTooltips.length,
|
|
18049
|
+
onCloseAll: () => window.dispatchEvent(new Event("closeAllTooltips")),
|
|
18050
|
+
position: "top-center",
|
|
18051
|
+
variant: "floating"
|
|
18052
|
+
}
|
|
18053
|
+
),
|
|
18054
|
+
timeSeriesConfig && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18055
|
+
Brush_default,
|
|
18056
|
+
{
|
|
18057
|
+
legend: timeSeriesLegend,
|
|
18058
|
+
data,
|
|
18059
|
+
startIndex,
|
|
18060
|
+
endIndex,
|
|
18061
|
+
onMouseDown: handleMouseDown,
|
|
18062
|
+
brushRef,
|
|
18063
|
+
xAxisKey: xAxisConfig.dataKey,
|
|
18064
|
+
seriesOrder,
|
|
18065
|
+
finalColors,
|
|
18066
|
+
brushHeight: timeSeriesConfig.height,
|
|
18067
|
+
brushColor: timeSeriesConfig.brushColor,
|
|
18068
|
+
miniChartOpacity: timeSeriesConfig.miniChartOpacity,
|
|
18069
|
+
showGrid,
|
|
18070
|
+
gridColor,
|
|
18071
|
+
margin: {
|
|
18072
|
+
left: finalChartLeftMargin,
|
|
18073
|
+
right: finalChartRightMargin
|
|
18074
|
+
}
|
|
18075
|
+
}
|
|
18076
|
+
)
|
|
18077
|
+
] });
|
|
17982
18078
|
};
|
|
17983
18079
|
var Chart_default = Chart;
|
|
17984
18080
|
var DEFAULT_COLORS3 = ["#0d1136", "#666655", "#1a1a1a"];
|
|
@@ -19092,6 +19188,7 @@ exports.isValidHour = isValidHour;
|
|
|
19092
19188
|
exports.isValidMinuteOrSecond = isValidMinuteOrSecond;
|
|
19093
19189
|
exports.niceCeil = niceCeil;
|
|
19094
19190
|
exports.normalizeAttendDate = normalizeAttendDate;
|
|
19191
|
+
exports.processNeo4jData = processNeo4jData;
|
|
19095
19192
|
exports.renderInsideBarLabel = renderInsideBarLabel;
|
|
19096
19193
|
exports.renderPillLabel = pillLabelRenderer_default;
|
|
19097
19194
|
exports.resolveChartMargins = resolveChartMargins;
|