eai-frontend-components 2.0.80 → 2.0.82
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.d.ts +1 -1
- package/dist/index.esm.js +17 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -105,7 +105,7 @@ declare const BreadcrumbEllipsis: {
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
declare const buttonVariants: (props?: ({
|
|
108
|
-
variant?: "
|
|
108
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "link" | "primary" | "ghost" | null | undefined;
|
|
109
109
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
110
110
|
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
111
111
|
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
3
|
import { ChevronDown, MoreHorizontal, ChevronRight, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, ArrowLeft, ArrowRight, Check, X, Search, Circle, CalendarIcon, ChevronLeft, ChevronUp, PanelLeft, CircleX, CalendarDays, CircleHelp, Paintbrush, ChevronsUpDown, LoaderCircle, CheckIcon, EyeOff, Eye, Copy, BarChart2, LogOut, MoveUp, MoveDown, ArrowUpDown, Filter } from 'lucide-react';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
|
-
import React__default, { useState, useEffect, createContext, useContext, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import React__default, { useState, useEffect, createContext, useContext, useRef, useLayoutEffect, forwardRef, useImperativeHandle } from 'react';
|
|
6
6
|
import clsx$1, { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
@@ -10104,6 +10104,21 @@ const Header = ({ splittedPath, modules, pages, isLoading, combobox, }) => {
|
|
|
10104
10104
|
return (jsxs("header", { className: 'flex flex-col justify-between items-center w-full', children: [jsxs("div", { className: 'flex justify-between items-center py-3 px-5 w-full', children: [jsxs("div", { className: 'flex items-center gap-x-2 h-[40px]', children: [jsx(SidebarTrigger, { className: 'p-5' }), jsx("div", { className: 'p-2', children: jsx(Breadcrumb, { children: jsx(BreadcrumbList, { children: renderBreadcrumbItens() }) }) })] }), jsx("div", { className: 'flex items-center', children: combobox })] }), jsx(LoadingBar, { ref: refProgressLoading, color: getColorLoadingBar(), height: 7 })] }));
|
|
10105
10105
|
};
|
|
10106
10106
|
|
|
10107
|
+
const TruncatedText = ({ text }) => {
|
|
10108
|
+
const ref = useRef(null);
|
|
10109
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
10110
|
+
useLayoutEffect(() => {
|
|
10111
|
+
const el = ref.current;
|
|
10112
|
+
if (!el)
|
|
10113
|
+
return;
|
|
10114
|
+
const check = () => setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
10115
|
+
check();
|
|
10116
|
+
const observer = new ResizeObserver(check);
|
|
10117
|
+
observer.observe(el);
|
|
10118
|
+
return () => observer.disconnect();
|
|
10119
|
+
}, [text]);
|
|
10120
|
+
return (jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("div", { ref: ref, className: 'text-zinc-500 truncate', children: text }) }), isTruncated && jsx(TooltipContent, { children: text })] }) }));
|
|
10121
|
+
};
|
|
10107
10122
|
const LabelWithTitle = ({ title, value, value2, required, showCopyIcon = false, className, isLoading, hoverAction, }) => {
|
|
10108
10123
|
const handleCopy = () => {
|
|
10109
10124
|
if (showCopyIcon && value) {
|
|
@@ -10114,7 +10129,7 @@ const LabelWithTitle = ({ title, value, value2, required, showCopyIcon = false,
|
|
|
10114
10129
|
});
|
|
10115
10130
|
}
|
|
10116
10131
|
};
|
|
10117
|
-
return (jsx("div", { className: cn('flex group', className), children: jsx("div", { className: cn('flex flex-col text-sm w-full', showCopyIcon || hoverAction ? 'p-1 rounded-md transition-colors group-hover:bg-sidebar-accent' : 'p-1'), children: jsxs("div", { className: 'relative', children: [jsxs("div", { className: 'flex items-center text-sm font-medium gap-0.5', children: [jsx("span", { className: 'text-default truncate', children: title }), required && jsx("div", { className: 'text-red-500 truncate', children: "*" })] }), jsx("div", { className: 'grid flex-1 items-center pt-1', children: isLoading ? jsx(Skeleton, { className: 'h-5 w-full rounded-lg' }) : jsx(
|
|
10132
|
+
return (jsx("div", { className: cn('flex group', className), children: jsx("div", { className: cn('flex flex-col text-sm w-full', showCopyIcon || hoverAction ? 'p-1 rounded-md transition-colors group-hover:bg-sidebar-accent' : 'p-1'), children: jsxs("div", { className: 'relative', children: [jsxs("div", { className: 'flex items-center text-sm font-medium gap-0.5', children: [jsx("span", { className: 'text-default truncate', children: title }), required && jsx("div", { className: 'text-red-500 truncate', children: "*" })] }), jsx("div", { className: 'grid flex-1 items-center pt-1', children: isLoading ? jsx(Skeleton, { className: 'h-5 w-full rounded-lg' }) : jsx(TruncatedText, { text: value }) }), value2 && (jsx("div", { className: 'grid flex-1 items-center pt-1', children: isLoading ? jsx(Skeleton, { className: 'h-5 w-full rounded-lg' }) : jsx(TruncatedText, { text: value2 }) })), showCopyIcon && (jsx("div", { className: cn('absolute top-1/2 right-0 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100'), children: jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx(Button, { variant: 'ghost', type: 'button', className: cn('p-1 h-10 w-8 bg-sidebar-accent'), onClick: handleCopy, children: jsx(Copy, { size: 16 }) }) }), jsx(TooltipContent, { children: "Copiar" })] }) }) })), hoverAction && (jsx("div", { className: cn('absolute top-1/2 right-0 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100'), children: jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx(Button, { variant: 'ghost', type: 'button', className: cn('p-1 h-10 w-8 bg-sidebar-accent'), onClick: hoverAction.onClick, children: hoverAction.icon }) }), jsx(TooltipContent, { children: hoverAction.tooltip })] }) }) }))] }) }) }));
|
|
10118
10133
|
};
|
|
10119
10134
|
|
|
10120
10135
|
const NotFound = () => {
|