lecom-ui 2.5.9 → 2.6.0

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.
@@ -0,0 +1,63 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils.js';
3
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
4
+ import { cva } from 'class-variance-authority';
5
+ import { Minus, Check } from 'lucide-react';
6
+
7
+ const checkboxVariants = cva(
8
+ "peer relative h-5 w-5 shrink-0 rounded border-2 border-grey-400 transition-all hover:border-grey-500 active:border-grey-700 disabled:cursor-not-allowed disabled:border-grey-300 focus-visible:outline-none focus-visible:before:absolute focus-visible:before:-z-10 focus-visible:before:top-1/2 focus-visible:before:left-1/2 focus-visible:before:transform focus-visible:before:-translate-x-1/2 focus-visible:before:-translate-y-1/2 focus-visible:before:w-10 focus-visible:before:h-10 focus-visible:before:rounded-full focus-visible:before:bg-blue-100",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 data-[state=checked]:text-white data-[state=checked]:hover:bg-blue-700 data-[state=checked]:hover:border-blue-700 data-[state=checked]:active:bg-blue-800 data-[state=checked]:active:border-blue-800 data-[state=checked]:disabled:bg-blue-400 data-[state=checked]:disabled:border-blue-400"
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ variant: "default"
17
+ }
18
+ }
19
+ );
20
+ const Checkbox = React.forwardRef(
21
+ ({
22
+ className,
23
+ variant,
24
+ checked,
25
+ disabled,
26
+ children,
27
+ indeterminate,
28
+ ...props
29
+ }, ref) => {
30
+ const id = React.useId();
31
+ return /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2" }, /* @__PURE__ */ React.createElement(
32
+ CheckboxPrimitive.Root,
33
+ {
34
+ ref,
35
+ className: cn(
36
+ checkboxVariants({ variant, className }),
37
+ indeterminate && "indeterminate"
38
+ ),
39
+ checked,
40
+ disabled,
41
+ ...props,
42
+ id
43
+ },
44
+ /* @__PURE__ */ React.createElement(
45
+ CheckboxPrimitive.Indicator,
46
+ {
47
+ className: cn("flex items-center justify-center")
48
+ },
49
+ indeterminate ? /* @__PURE__ */ React.createElement(Minus, { className: "h-4 w-4" }) : /* @__PURE__ */ React.createElement(Check, { className: "h-4 w-4" })
50
+ )
51
+ ), /* @__PURE__ */ React.createElement(
52
+ "label",
53
+ {
54
+ htmlFor: id,
55
+ className: "body-medium-400 leading-none cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-50 transition-opacity"
56
+ },
57
+ children
58
+ ));
59
+ }
60
+ );
61
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
62
+
63
+ export { Checkbox };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
4
5
  import { ColumnDef } from '@tanstack/react-table';
5
6
  import * as DialogPrimitive from '@radix-ui/react-dialog';
6
7
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
@@ -44,6 +45,14 @@ declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttribu
44
45
  declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
45
46
  declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
46
47
 
48
+ declare const checkboxVariants: (props?: ({
49
+ variant?: "default" | null | undefined;
50
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
51
+ interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {
52
+ indeterminate?: boolean;
53
+ }
54
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
55
+
47
56
  type Transparent = 'transparent';
48
57
  type Black = 'black';
49
58
  type White = 'white';
@@ -514,4 +523,4 @@ declare const fonts: {
514
523
  ibm: string[];
515
524
  };
516
525
 
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 };
526
+ export { type BgColor, Button, type ButtonProps, CadastroFacil, type CadastroFacilProps, type CalloutNotificationProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, 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
@@ -1,5 +1,6 @@
1
1
  export { Button, buttonVariants } from './components/Button/Button.js';
2
2
  export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './components/Card/Card.js';
3
+ export { Checkbox } from './components/Checkbox/Checkbox.js';
3
4
  export { CadastroFacil } from './components/CustomIcon/Icons/CadastroFacil.js';
4
5
  export { LogoLecom } from './components/CustomIcon/Icons/LogoLecom.js';
5
6
  export { ModoTeste } from './components/CustomIcon/Icons/ModoTeste.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "2.5.9",
3
+ "version": "2.6.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",