@a2v2ai/uikit 0.0.31 → 0.0.34

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.
@@ -4,7 +4,7 @@ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
4
  import { Check, Minus } from "lucide-react";
5
5
  import { cva } from "class-variance-authority";
6
6
  import { cn } from "../lib/utils";
7
- const checkboxVariants = cva("peer shrink-0 border border-grey-300 bg-white ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-600 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent-600 data-[state=checked]:border-accent-600 data-[state=checked]:text-white data-[state=indeterminate]:bg-accent-600 data-[state=indeterminate]:border-accent-600 data-[state=indeterminate]:text-white", {
7
+ const checkboxVariants = cva("peer shrink-0 border border-grey-300 bg-white ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-600 focus-visible:ring-offset-2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent-600 data-[state=checked]:border-accent-600 data-[state=checked]:text-white data-[state=indeterminate]:bg-accent-600 data-[state=indeterminate]:border-accent-600 data-[state=indeterminate]:text-white", {
8
8
  variants: {
9
9
  size: {
10
10
  small: "size-4 rounded-[4px]",
@@ -9,7 +9,7 @@ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
9
9
  const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
10
10
  const DropdownMenuSub = DropdownMenuPrimitive.Sub;
11
11
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
- const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-grey-100 data-[state=open]:bg-grey-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto" })] })));
12
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-grey-100 data-[state=open]:bg-grey-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto" })] })));
13
13
  DropdownMenuSubTrigger.displayName =
14
14
  DropdownMenuPrimitive.SubTrigger.displayName;
15
15
  const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-lg border border-grey-200 bg-white p-1 text-main-950 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", className), ...props })));
@@ -17,7 +17,7 @@ DropdownMenuSubContent.displayName =
17
17
  DropdownMenuPrimitive.SubContent.displayName;
18
18
  const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-lg border border-grey-200 bg-white p-1 text-main-950 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", className), ...props }) })));
19
19
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
20
- const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", inset && "pl-8", className), ...props })));
20
+ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", inset && "pl-8", className), ...props })));
21
21
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
22
22
  const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "size-4" }) }) }), children] })));
23
23
  DropdownMenuCheckboxItem.displayName =
@@ -8,7 +8,7 @@ const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
8
8
  return (_jsx(RadioGroupPrimitive.Root, { className: cn("grid gap-2", className), ...props, ref: ref }));
9
9
  });
10
10
  RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
11
- const radioGroupItemVariants = cva("aspect-square rounded-full border border-grey-300 bg-white text-main-950 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-main-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-main-950", {
11
+ const radioGroupItemVariants = cva("aspect-square rounded-full border border-grey-300 bg-white text-main-950 ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-main-950 focus-visible:ring-offset-2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-main-950", {
12
12
  variants: {
13
13
  size: {
14
14
  small: "size-4",
package/Select/Select.js CHANGED
@@ -10,7 +10,7 @@ import {} from "../lib/typography-types";
10
10
  const Select = SelectPrimitive.Root;
11
11
  const SelectGroup = SelectPrimitive.Group;
12
12
  const SelectValue = SelectPrimitive.Value;
13
- const selectTriggerVariants = cva("flex w-full items-center justify-between whitespace-nowrap border bg-white text-main-950 ring-offset-white placeholder:text-grey-400 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", {
13
+ const selectTriggerVariants = cva("flex w-full items-center justify-between whitespace-nowrap border bg-white text-main-950 ring-offset-white placeholder:text-grey-400 focus:outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", {
14
14
  variants: {
15
15
  size: {
16
16
  small: "h-8 px-3 text-sm rounded-md",
package/Tabs/Tabs.js CHANGED
@@ -17,7 +17,7 @@ const tabsListVariants = cva("inline-flex items-center justify-center rounded-lg
17
17
  });
18
18
  const TabsList = React.forwardRef(({ className, variant, ...props }, ref) => (_jsx(TabsPrimitive.List, { ref: ref, className: cn(tabsListVariants({ variant }), className), ...props })));
19
19
  TabsList.displayName = TabsPrimitive.List.displayName;
20
- const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.Trigger, { ref: ref, className: cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-main-950 data-[state=active]:shadow-sm", className), ...props })));
20
+ const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.Trigger, { ref: ref, className: cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-950 focus-visible:ring-offset-2 cursor-pointer disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-main-950 data-[state=active]:shadow-sm", className), ...props })));
21
21
  TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
22
22
  const TabsContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.Content, { ref: ref, className: cn("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-950 focus-visible:ring-offset-2", className), ...props })));
23
23
  TabsContent.displayName = TabsPrimitive.Content.displayName;
@@ -12,6 +12,7 @@ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextArea
12
12
  label?: string;
13
13
  labelVariant?: TextVariant;
14
14
  labelColor?: TextColor;
15
+ error?: string;
15
16
  }
16
17
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
17
18
  export { Textarea, textareaVariants };
@@ -3,6 +3,7 @@ import * as React from "react";
3
3
  import { cva } from "class-variance-authority";
4
4
  import { cn } from "../lib/utils";
5
5
  import { Label } from "../Label/Label";
6
+ import { Typography } from "../Typography/Typography";
6
7
  import {} from "../lib/typography-types";
7
8
  const textareaVariants = cva("flex min-h-[80px] w-full rounded-lg border bg-white px-3 py-2 text-sm font-normal font-sans transition-colors placeholder:text-grey-400 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-grey-50", {
8
9
  variants: {
@@ -22,8 +23,9 @@ const textareaVariants = cva("flex min-h-[80px] w-full rounded-lg border bg-whit
22
23
  resize: "vertical",
23
24
  },
24
25
  });
25
- const Textarea = React.forwardRef(({ className, variant, resize, label, labelVariant = "body2", labelColor = "main-800", id, ...props }, ref) => {
26
- return (_jsxs("div", { className: "flex flex-col gap-2 w-full", children: [label && (_jsx(Label, { htmlFor: id, variant: labelVariant, color: labelColor, children: label })), _jsx("textarea", { id: id, className: cn(textareaVariants({ variant, resize }), className), ref: ref, ...props })] }));
26
+ const Textarea = React.forwardRef(({ className, variant, resize, label, labelVariant = "body2", labelColor = "main-800", error, id, ...props }, ref) => {
27
+ const computedVariant = error ? "error" : variant;
28
+ return (_jsxs("div", { className: "flex flex-col gap-2 w-full", children: [label && (_jsx(Label, { htmlFor: id, variant: labelVariant, color: labelColor, children: label })), _jsx("textarea", { id: id, className: cn(textareaVariants({ variant: computedVariant, resize }), className), ref: ref, ...props }), error && (_jsx(Typography, { variant: "caption", color: "error-600", className: "mt-1", children: error }))] }));
27
29
  });
28
30
  Textarea.displayName = "Textarea";
29
31
  export { Textarea, textareaVariants };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2v2ai/uikit",
3
- "version": "0.0.31",
3
+ "version": "0.0.34",
4
4
  "type": "module",
5
5
  "author": "Arulraj V & abofficial1997@gmail.com",
6
6
  "description": "A React UI component library built with shadcn/ui and Tailwind CSS",