lecom-ui 5.2.35 → 5.2.37
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/components/TagInput/TagInput.js +47 -0
- package/dist/index.d.ts +18 -2
- package/dist/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cn } from '../../lib/utils.js';
|
|
3
|
+
import { X } from 'lucide-react';
|
|
4
|
+
import { inputVariants } from '../Input/Input.js';
|
|
5
|
+
import { Tag } from '../Tag/Tag.js';
|
|
6
|
+
import { Typography } from '../Typography/Typography.js';
|
|
7
|
+
|
|
8
|
+
const TagInput = ({
|
|
9
|
+
value,
|
|
10
|
+
onRemove,
|
|
11
|
+
placeholder = "Nenhum item selecionado",
|
|
12
|
+
disabled = false,
|
|
13
|
+
readOnly = false,
|
|
14
|
+
className = "",
|
|
15
|
+
size = "default",
|
|
16
|
+
variant = "default",
|
|
17
|
+
radius = "default",
|
|
18
|
+
...props
|
|
19
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: cn(
|
|
23
|
+
inputVariants({ size, variant, radius }),
|
|
24
|
+
"flex flex-wrap items-start min-h-10 gap-1 py-2 px-3",
|
|
25
|
+
disabled && "opacity-50 pointer-events-none",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
tabIndex: 0,
|
|
29
|
+
"aria-disabled": disabled,
|
|
30
|
+
...props
|
|
31
|
+
},
|
|
32
|
+
value.length === 0 && /* @__PURE__ */ React.createElement(Typography, { variant: "body-small-400", className: "text-grey-400" }, placeholder),
|
|
33
|
+
value.map((item) => /* @__PURE__ */ React.createElement(Tag, { key: item.value, color: "blue" }, /* @__PURE__ */ React.createElement(Typography, { variant: "body-small-400", className: "text-blue-600" }, item.label), !readOnly && /* @__PURE__ */ React.createElement(
|
|
34
|
+
X,
|
|
35
|
+
{
|
|
36
|
+
className: "w-4 h-4 cursor-pointer",
|
|
37
|
+
onClick: (e) => {
|
|
38
|
+
e.stopPropagation();
|
|
39
|
+
onRemove(item.value);
|
|
40
|
+
},
|
|
41
|
+
"aria-label": `Remover ${item.label}`,
|
|
42
|
+
tabIndex: 0
|
|
43
|
+
}
|
|
44
|
+
)))
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export { TagInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -1052,6 +1052,22 @@ declare const DrawerFooter: {
|
|
|
1052
1052
|
declare const DrawerTitle: React$1.ForwardRefExoticComponent<React$1.ComponentPropsWithoutRef<typeof Drawer$1.Title> & React$1.RefAttributes<React$1.ElementRef<typeof Drawer$1.Title>>>;
|
|
1053
1053
|
declare const DrawerDescription: React$1.ForwardRefExoticComponent<React$1.ComponentPropsWithoutRef<typeof Drawer$1.Description> & React$1.RefAttributes<React$1.ElementRef<typeof Drawer$1.Description>>>;
|
|
1054
1054
|
|
|
1055
|
+
type TagItem = {
|
|
1056
|
+
label: string;
|
|
1057
|
+
value: string | number;
|
|
1058
|
+
};
|
|
1059
|
+
interface TagInputProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1060
|
+
value: TagItem[];
|
|
1061
|
+
onRemove: (value: string | number) => void;
|
|
1062
|
+
placeholder?: string;
|
|
1063
|
+
disabled?: boolean;
|
|
1064
|
+
readOnly?: boolean;
|
|
1065
|
+
size?: 'small' | 'default' | 'large';
|
|
1066
|
+
variant?: 'default' | 'filled' | 'borderless';
|
|
1067
|
+
radius?: 'small' | 'default' | 'large' | 'full';
|
|
1068
|
+
}
|
|
1069
|
+
declare const TagInput: React$1.FC<TagInputProps>;
|
|
1070
|
+
|
|
1055
1071
|
declare const Sheet: React$1.FC<DialogPrimitive.DialogProps>;
|
|
1056
1072
|
declare const SheetTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1057
1073
|
declare const SheetClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1074,5 +1090,5 @@ declare const SheetFooter: {
|
|
|
1074
1090
|
declare const SheetTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
1075
1091
|
declare const SheetDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
1076
1092
|
|
|
1077
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CadastroFacil, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogScroll, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ErrorEmptyDisplay, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, Layout, LogoLecom, LogoLecomBrand, ModoTeste, MultiSelect, Notification, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, Rpa, SairModoTeste, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Spin, Switch, TOAST_REMOVE_DELAY, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, ToggleGroup, ToggleGroupItem, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Translations, TypeMessageNotification, Typography, Upload, accordionVariants, buttonVariants, colors, fonts, initializeI18n, inputVariants, notificationVariants, reducer, tagVariants, textareaVariants, toast, typographyVariants, useFormField, useIsMobile, useNotificationToast, usePagination, useSidebar };
|
|
1078
|
-
export type { BgColor, BuildCellSelect, BuildColumns, BuildHeaderSelect, ButtonProps, CadastroFacilProps, CalloutNotificationProps, ChartConfig, CheckboxProps, CheckedCell, CheckedCellChange, CheckedHeader, CheckedHeaderChange, Color, ColorToken, Column, ColumnRender, ColumnSort, ColumnSortClient, ColumnTitle, CustomStyles$1 as CustomStyles, DataTableProps, DialogContentProps, ErrorEmptyDisplayProps, File, FillColor, Fonts, Header, HeaderProps, InlineNotificationProps, InputProps, LayoutProps, LogoLecomBrandProps, LogoLecomProps, Meta, ModoTesteProps, NotificationProps, PaginationProps, Row, RpaProps, SideBarProps, SpinProps, TableProps, TagProps, TextColor, TextareaProps, ToastNotificationProps, ToasterToast, TooltipContentProps, TypographyProps, UploadProps, UsePaginationItem };
|
|
1093
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CadastroFacil, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogScroll, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ErrorEmptyDisplay, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, Layout, LogoLecom, LogoLecomBrand, ModoTeste, MultiSelect, Notification, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, Rpa, SairModoTeste, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Spin, Switch, TOAST_REMOVE_DELAY, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TagInput, Textarea, ToggleGroup, ToggleGroupItem, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Translations, TypeMessageNotification, Typography, Upload, accordionVariants, buttonVariants, colors, fonts, initializeI18n, inputVariants, notificationVariants, reducer, tagVariants, textareaVariants, toast, typographyVariants, useFormField, useIsMobile, useNotificationToast, usePagination, useSidebar };
|
|
1094
|
+
export type { BgColor, BuildCellSelect, BuildColumns, BuildHeaderSelect, ButtonProps, CadastroFacilProps, CalloutNotificationProps, ChartConfig, CheckboxProps, CheckedCell, CheckedCellChange, CheckedHeader, CheckedHeaderChange, Color, ColorToken, Column, ColumnRender, ColumnSort, ColumnSortClient, ColumnTitle, CustomStyles$1 as CustomStyles, DataTableProps, DialogContentProps, ErrorEmptyDisplayProps, File, FillColor, Fonts, Header, HeaderProps, InlineNotificationProps, InputProps, LayoutProps, LogoLecomBrandProps, LogoLecomProps, Meta, ModoTesteProps, NotificationProps, PaginationProps, Row, RpaProps, SideBarProps, SpinProps, TableProps, TagItem, TagProps, TextColor, TextareaProps, ToastNotificationProps, ToasterToast, TooltipContentProps, TypographyProps, UploadProps, UsePaginationItem };
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,7 @@ export { fonts } from './tokens/fonts.js';
|
|
|
43
43
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from './components/Tabs/Tabs.js';
|
|
44
44
|
export { Textarea, textareaVariants } from './components/Textarea/Textarea.js';
|
|
45
45
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './components/Drawer/Drawer.js';
|
|
46
|
+
export { TagInput } from './components/TagInput/TagInput.js';
|
|
46
47
|
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger } from './components/Sheet/Sheet.js';
|
|
47
48
|
export { Bar, BarChart, CartesianGrid, Label, LabelList, XAxis, YAxis } from 'recharts';
|
|
48
49
|
export { z as zod } from 'zod';
|
package/package.json
CHANGED