lecom-ui 2.5.6 → 2.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.
@@ -18,10 +18,24 @@ function DataTable({
18
18
  sorting
19
19
  }
20
20
  });
21
- return /* @__PURE__ */ React.createElement("div", { className: "bg-white rounded-[8px]" }, /* @__PURE__ */ React.createElement(Table, null, /* @__PURE__ */ React.createElement(TableHeader, { className: "[&_tr]:border-b-[1.5px] [&_tr]:border-grey-400" }, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => /* @__PURE__ */ React.createElement(TableHead, { key: header.id }, header.isPlaceholder ? null : flexRender(
22
- header.column.columnDef.header,
23
- header.getContext()
24
- )))))), /* @__PURE__ */ React.createElement(TableBody, null, table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React.createElement(
21
+ const getMetaStyle = (header) => {
22
+ const meta = header.column.columnDef.meta;
23
+ if (!meta) {
24
+ return {};
25
+ }
26
+ return meta["style"] ?? {};
27
+ };
28
+ return /* @__PURE__ */ React.createElement("div", { className: "bg-white rounded-[8px] py-0 px-2" }, /* @__PURE__ */ React.createElement(Table, null, /* @__PURE__ */ React.createElement(TableHeader, { className: "[&_tr]:border-b-[1.5px] [&_tr]:border-grey-400" }, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => /* @__PURE__ */ React.createElement(
29
+ TableHead,
30
+ {
31
+ key: header.id,
32
+ style: getMetaStyle(header)
33
+ },
34
+ header.isPlaceholder ? null : flexRender(
35
+ header.column.columnDef.header,
36
+ header.getContext()
37
+ )
38
+ ))))), /* @__PURE__ */ React.createElement(TableBody, null, table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React.createElement(
25
39
  TableRow,
26
40
  {
27
41
  key: row.id,
@@ -0,0 +1,128 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils.js';
3
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
4
+ import { ChevronRight, Check, Circle } from 'lucide-react';
5
+
6
+ const DropdownMenu = DropdownMenuPrimitive.Root;
7
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
8
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
9
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
10
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
11
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
13
+ DropdownMenuPrimitive.SubTrigger,
14
+ {
15
+ ref,
16
+ className: cn(
17
+ "flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
18
+ inset && "pl-8",
19
+ className
20
+ ),
21
+ ...props
22
+ },
23
+ children,
24
+ /* @__PURE__ */ React.createElement(ChevronRight, { className: "ml-auto" })
25
+ ));
26
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
27
+ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
28
+ DropdownMenuPrimitive.SubContent,
29
+ {
30
+ ref,
31
+ className: cn(
32
+ "z-50 min-w-[8rem] overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
33
+ className
34
+ ),
35
+ ...props
36
+ }
37
+ ));
38
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
39
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
40
+ DropdownMenuPrimitive.Content,
41
+ {
42
+ ref,
43
+ sideOffset,
44
+ className: cn(
45
+ "z-50 min-w-[8rem] overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
46
+ className
47
+ ),
48
+ ...props
49
+ }
50
+ )));
51
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
52
+ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React.createElement(
53
+ DropdownMenuPrimitive.Item,
54
+ {
55
+ ref,
56
+ className: cn(
57
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
58
+ inset && "pl-8",
59
+ className
60
+ ),
61
+ ...props
62
+ }
63
+ ));
64
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
65
+ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React.createElement(
66
+ DropdownMenuPrimitive.CheckboxItem,
67
+ {
68
+ ref,
69
+ className: cn(
70
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
71
+ className
72
+ ),
73
+ checked,
74
+ ...props
75
+ },
76
+ /* @__PURE__ */ React.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement(Check, { className: "h-4 w-4" }))),
77
+ children
78
+ ));
79
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
80
+ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
81
+ DropdownMenuPrimitive.RadioItem,
82
+ {
83
+ ref,
84
+ className: cn(
85
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
86
+ className
87
+ ),
88
+ ...props
89
+ },
90
+ /* @__PURE__ */ React.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement(Circle, { className: "h-2 w-2 fill-current" }))),
91
+ children
92
+ ));
93
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
94
+ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React.createElement(
95
+ DropdownMenuPrimitive.Label,
96
+ {
97
+ ref,
98
+ className: cn(
99
+ "px-2 py-1.5 text-sm font-semibold",
100
+ inset && "pl-8",
101
+ className
102
+ ),
103
+ ...props
104
+ }
105
+ ));
106
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
107
+ const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
108
+ DropdownMenuPrimitive.Separator,
109
+ {
110
+ ref,
111
+ className: cn("-mx-1 my-1 h-px bg-muted", className),
112
+ ...props
113
+ }
114
+ ));
115
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
116
+ const DropdownMenuShortcut = ({
117
+ className,
118
+ ...props
119
+ }) => /* @__PURE__ */ React.createElement(
120
+ "span",
121
+ {
122
+ className: cn("ml-auto text-xs tracking-widest opacity-60", className),
123
+ ...props
124
+ }
125
+ );
126
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
127
+
128
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
  import { ColumnDef } from '@tanstack/react-table';
5
5
  import * as DialogPrimitive from '@radix-ui/react-dialog';
6
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
6
7
  import { CustomStyles as CustomStyles$2 } from '@/components/Button';
7
8
  import * as PopoverPrimitive from '@radix-ui/react-popover';
8
9
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
@@ -237,6 +238,31 @@ declare const DialogFooter: {
237
238
  declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
238
239
  declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
239
240
 
241
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
242
+ declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
243
+ declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
244
+ declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
245
+ declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
246
+ declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
247
+ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
248
+ inset?: boolean;
249
+ } & React.RefAttributes<HTMLDivElement>>;
250
+ declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
251
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
252
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
253
+ inset?: boolean;
254
+ } & React.RefAttributes<HTMLDivElement>>;
255
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
256
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
257
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
258
+ inset?: boolean;
259
+ } & React.RefAttributes<HTMLDivElement>>;
260
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
261
+ declare const DropdownMenuShortcut: {
262
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
263
+ displayName: string;
264
+ };
265
+
240
266
  interface HelpMenuItem {
241
267
  icon?: React.ReactNode;
242
268
  description?: string;
@@ -488,4 +514,4 @@ declare const fonts: {
488
514
  ibm: string[];
489
515
  };
490
516
 
491
- export { type BgColor, Button, type ButtonProps, CadastroFacil, type CadastroFacilProps, type CalloutNotificationProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type Color, type ColorToken, type CustomStyles$1 as CustomStyles, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type FillColor, type Fonts, type HeaderProps, type InlineNotificationProps, Layout, type LayoutProps, LogoLecom, LogoLecomBrand, type LogoLecomBrandProps, type LogoLecomProps, ModoTeste, type ModoTesteProps, Notification, type NotificationProps, Popover, PopoverContent, PopoverTrigger, Rpa, type RpaProps, type SideBarProps, Skeleton, TOAST_REMOVE_DELAY, Tag, type TagProps, type TextColor, type ToastNotificationProps, type ToasterToast, Tooltip, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TypeMessageNotification, Typography, type TypographyProps, buttonVariants, colors, fonts, getPositionClass, notificationVariants, reducer, tagVariants, toast, typographyVariants, useNotificationToast };
517
+ export { type BgColor, Button, type ButtonProps, CadastroFacil, type CadastroFacilProps, type CalloutNotificationProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type Color, type ColorToken, type CustomStyles$1 as CustomStyles, 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, type FillColor, type Fonts, type HeaderProps, type InlineNotificationProps, Layout, type LayoutProps, LogoLecom, LogoLecomBrand, type LogoLecomBrandProps, type LogoLecomProps, ModoTeste, type ModoTesteProps, Notification, type NotificationProps, Popover, PopoverContent, PopoverTrigger, Rpa, type RpaProps, type SideBarProps, Skeleton, TOAST_REMOVE_DELAY, Tag, type TagProps, type TextColor, type ToastNotificationProps, type ToasterToast, Tooltip, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TypeMessageNotification, Typography, type TypographyProps, buttonVariants, colors, fonts, getPositionClass, notificationVariants, reducer, tagVariants, toast, typographyVariants, useNotificationToast };
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export { Rpa } from './components/CustomIcon/Icons/Rpa.js';
7
7
  export { LogoLecomBrand } from './components/CustomIcon/Icons/LogoLecomBrand.js';
8
8
  export { DataTable } from './components/DataTable/DataTable.js';
9
9
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './components/Dialog/Dialog.js';
10
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './components/DropdownMenu/DropdownMenu.js';
10
11
  export { Layout } from './components/Layout/Layout.js';
11
12
  export { Notification, TypeMessageNotification, getPositionClass, notificationVariants } from './components/Notification/Notification.js';
12
13
  export { TOAST_REMOVE_DELAY, reducer, toast, useNotificationToast } from './components/Notification/useNotificationToast.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "2.5.6",
3
+ "version": "2.5.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",