eai-frontend-components 2.0.80 → 2.0.81

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.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,24 @@ 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
+ const inner = (jsx("div", { ref: ref, className: 'text-zinc-500 truncate', children: text }));
10121
+ if (!isTruncated)
10122
+ return inner;
10123
+ return (jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: inner }), jsx(TooltipContent, { children: text })] }) }));
10124
+ };
10107
10125
  const LabelWithTitle = ({ title, value, value2, required, showCopyIcon = false, className, isLoading, hoverAction, }) => {
10108
10126
  const handleCopy = () => {
10109
10127
  if (showCopyIcon && value) {
@@ -10114,7 +10132,7 @@ const LabelWithTitle = ({ title, value, value2, required, showCopyIcon = false,
10114
10132
  });
10115
10133
  }
10116
10134
  };
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("div", { className: 'text-zinc-500 truncate', children: value }) }), value2 && (jsx("div", { className: 'grid flex-1 items-center pt-1', children: isLoading ? jsx(Skeleton, { className: 'h-5 w-full rounded-lg' }) : jsx("div", { className: 'text-zinc-500 truncate', children: 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 })] }) }) }))] }) }) }));
10135
+ 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
10136
  };
10119
10137
 
10120
10138
  const NotFound = () => {