lecom-ui 4.5.6 → 4.5.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.
|
@@ -6,13 +6,14 @@ import { NotificationContent } from './NotificationContent.js';
|
|
|
6
6
|
import { NotificationIcon } from './NotificationIcon.js';
|
|
7
7
|
|
|
8
8
|
const NotificationCallout = ({ ...props }) => {
|
|
9
|
-
const defaultCollapsed = props.
|
|
9
|
+
const defaultCollapsed = props.defaultCollapsed ?? false;
|
|
10
10
|
const [isCollapsed, setIsCollapsed] = React.useState(defaultCollapsed);
|
|
11
11
|
const [shouldCollapse, setShouldCollapse] = React.useState(false);
|
|
12
12
|
const [contentHeight, setContentHeight] = React.useState(0);
|
|
13
13
|
const [lineHeight, setLineHeight] = React.useState(0);
|
|
14
14
|
const refCollapse = React.useRef(null);
|
|
15
15
|
const contentRef = React.useRef(null);
|
|
16
|
+
const getIsCollapsed = () => props.isCollapsed !== void 0 ? props.isCollapsed : isCollapsed;
|
|
16
17
|
React.useEffect(() => {
|
|
17
18
|
if (contentRef.current) {
|
|
18
19
|
const computedStyle = window.getComputedStyle(contentRef.current);
|
|
@@ -42,16 +43,16 @@ const NotificationCallout = ({ ...props }) => {
|
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
const getCollapseClass = () => {
|
|
45
|
-
if (
|
|
46
|
+
if (getIsCollapsed() && !props.title)
|
|
46
47
|
return "max-h-6 overflow-hidden line-clamp-1";
|
|
47
|
-
if (
|
|
48
|
+
if (getIsCollapsed() && props.title) return "max-h-0 overflow-hidden";
|
|
48
49
|
return "no-collapse";
|
|
49
50
|
};
|
|
50
51
|
return /* @__PURE__ */ React.createElement(
|
|
51
52
|
NotificationBase,
|
|
52
53
|
{
|
|
53
54
|
variant: defaultVariant,
|
|
54
|
-
className: cn(getGridColumns(),
|
|
55
|
+
className: cn(getGridColumns(), getIsCollapsed() && "place-items-center"),
|
|
55
56
|
dataTestId: "notification-callout"
|
|
56
57
|
},
|
|
57
58
|
/* @__PURE__ */ React.createElement(NotificationIcon, { variant: defaultVariant }),
|
|
@@ -63,7 +64,7 @@ const NotificationCallout = ({ ...props }) => {
|
|
|
63
64
|
ref: contentRef,
|
|
64
65
|
className: cn(
|
|
65
66
|
"transition-all duration-300",
|
|
66
|
-
|
|
67
|
+
getIsCollapsed() && getCollapseClass()
|
|
67
68
|
)
|
|
68
69
|
}
|
|
69
70
|
), props.action),
|
|
@@ -11,7 +11,8 @@ const Upload = ({
|
|
|
11
11
|
onFilesSelected,
|
|
12
12
|
className,
|
|
13
13
|
accept,
|
|
14
|
-
multiple
|
|
14
|
+
multiple,
|
|
15
|
+
id
|
|
15
16
|
}) => {
|
|
16
17
|
const [files, setFiles] = React.useState([]);
|
|
17
18
|
const { t } = useTranslation();
|
|
@@ -100,7 +101,7 @@ const Upload = ({
|
|
|
100
101
|
{
|
|
101
102
|
type: "file",
|
|
102
103
|
hidden: true,
|
|
103
|
-
id
|
|
104
|
+
id,
|
|
104
105
|
onChange: handleFileChange,
|
|
105
106
|
accept: accept || "*",
|
|
106
107
|
multiple: !!multiple
|
package/dist/index.d.ts
CHANGED
|
@@ -540,9 +540,9 @@ interface HeaderProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<
|
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
declare const inputVariants: (props?: ({
|
|
543
|
-
variant?: "
|
|
544
|
-
size?: "
|
|
545
|
-
radius?: "
|
|
543
|
+
variant?: "default" | "filled" | "borderless" | null | undefined;
|
|
544
|
+
size?: "default" | "small" | "large" | null | undefined;
|
|
545
|
+
radius?: "default" | "small" | "large" | null | undefined;
|
|
546
546
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
547
547
|
interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size' | 'sufix' | 'prefix'>, VariantProps<typeof inputVariants> {
|
|
548
548
|
sufix?: React$1.ReactNode;
|
|
@@ -605,6 +605,7 @@ interface CalloutNotificationProps extends BaseNotificationProps {
|
|
|
605
605
|
fullWidth?: boolean;
|
|
606
606
|
isCollapsed?: boolean;
|
|
607
607
|
action?: React$1.ReactNode;
|
|
608
|
+
defaultCollapsed?: boolean;
|
|
608
609
|
}
|
|
609
610
|
interface InlineNotificationProps extends BaseNotificationProps {
|
|
610
611
|
type: 'inline';
|
|
@@ -756,9 +757,10 @@ interface UploadProps {
|
|
|
756
757
|
className?: string;
|
|
757
758
|
accept?: string;
|
|
758
759
|
multiple?: boolean;
|
|
760
|
+
id?: string;
|
|
759
761
|
}
|
|
760
762
|
declare const Upload: {
|
|
761
|
-
({ onFilesSelected, className, accept, multiple, }: UploadProps): React$1.JSX.Element;
|
|
763
|
+
({ onFilesSelected, className, accept, multiple, id, }: UploadProps): React$1.JSX.Element;
|
|
762
764
|
displayName: string;
|
|
763
765
|
};
|
|
764
766
|
|
|
@@ -785,4 +787,4 @@ declare const fonts: {
|
|
|
785
787
|
};
|
|
786
788
|
|
|
787
789
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Button, CadastroFacil, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ErrorEmptyDisplay, Input, Layout, LogoLecom, LogoLecomBrand, ModoTeste, Notification, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, Rpa, ScrollArea, ScrollBar, Skeleton, Spin, Switch, TOAST_REMOVE_DELAY, Tag, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Translations, TypeMessageNotification, Typography, Upload, accordionVariants, buttonVariants, colors, fonts, getPositionClass, initializeI18n, inputVariants, notificationVariants, reducer, tagVariants, toast, typographyVariants, useIsMobile, useNotificationToast, usePagination, useSidebar };
|
|
788
|
-
export type { BgColor, BuildCellSelect, BuildColumns, BuildHeaderSelect, ButtonProps, CadastroFacilProps, CalloutNotificationProps, CheckboxProps, CheckedCell, CheckedCellChange, CheckedHeader, CheckedHeaderChange, Color, ColorToken, Column, ColumnRender, ColumnSort, ColumnTitle, CustomStyles$1 as CustomStyles, DataTableProps, ErrorEmptyDisplayProps, FillColor, Fonts, Header, HeaderProps, InlineNotificationProps, InputProps, LayoutProps, LogoLecomBrandProps, LogoLecomProps, Meta, ModoTesteProps, NotificationProps, PaginationProps, Row, RpaProps, SideBarProps, SpinProps, TagProps, TextColor, ToastNotificationProps, ToasterToast, TooltipContentProps, TypographyProps, UploadProps, UsePaginationItem };
|
|
790
|
+
export type { BgColor, BuildCellSelect, BuildColumns, BuildHeaderSelect, ButtonProps, CadastroFacilProps, CalloutNotificationProps, CheckboxProps, CheckedCell, CheckedCellChange, CheckedHeader, CheckedHeaderChange, Color, ColorToken, Column, ColumnRender, ColumnSort, ColumnTitle, CustomStyles$1 as CustomStyles, DataTableProps, ErrorEmptyDisplayProps, File, FillColor, Fonts, Header, HeaderProps, InlineNotificationProps, InputProps, LayoutProps, LogoLecomBrandProps, LogoLecomProps, Meta, ModoTesteProps, NotificationProps, PaginationProps, Row, RpaProps, SideBarProps, SpinProps, TagProps, TextColor, ToastNotificationProps, ToasterToast, TooltipContentProps, TypographyProps, UploadProps, UsePaginationItem };
|