diff --git a/examples/with-vitejs/index.html b/examples/with-vitejs/index.html index bcd079d..5225671 100644 --- a/examples/with-vitejs/index.html +++ b/examples/with-vitejs/index.html @@ -1,12 +1,12 @@ - + Vite + React + TS - +
diff --git a/examples/with-vitejs/src/App.tsx b/examples/with-vitejs/src/App.tsx index e3320bd..8a6a92c 100644 --- a/examples/with-vitejs/src/App.tsx +++ b/examples/with-vitejs/src/App.tsx @@ -1,5 +1,5 @@ import { useState } from 'react' -import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, ScrollArea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@openui-org/react' +import { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, ScrollArea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@openui-org/react' import reactLogo from './assets/react.svg' import viteLogo from '/vite.svg' import imgPrueba from '/bghome.png' @@ -10,9 +10,15 @@ function App() { return ( <> - + + Hola + + Lorem ipsum dolor sit amet consectetur, adipisicing elit. Voluptatem, tenetur? + + , React.ComponentPropsWithoutRef & VariantProps ->(({ variant, size, className, ...props }, ref) => ( +>(({ size, className, ...props }, ref) => ( )) diff --git a/packages/react/src/components/menu.tsx b/packages/react/src/components/menu.tsx index 4d80209..a49aa1b 100644 --- a/packages/react/src/components/menu.tsx +++ b/packages/react/src/components/menu.tsx @@ -20,7 +20,7 @@ const Menubar = React.forwardRef< - + @@ -193,7 +193,7 @@ const MenubarSeparator = React.forwardRef< >(({ className, ...props }, ref) => ( )) diff --git a/packages/react/src/components/select.tsx b/packages/react/src/components/select.tsx index 9de8ed5..a7be464 100644 --- a/packages/react/src/components/select.tsx +++ b/packages/react/src/components/select.tsx @@ -16,7 +16,7 @@ const SelectTrigger = React.forwardRef< span]:line-clamp-1', className, )} {...props} @@ -74,7 +74,7 @@ const SelectContent = React.forwardRef< (({ className, ...props }, ref) => ( )) @@ -118,12 +118,12 @@ const SelectItem = React.forwardRef< - + @@ -135,9 +135,10 @@ SelectItem.displayName = SelectPrimitive.Item.displayName const SelectSeparator = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ ...props }, ref) => ( +>(({ className, ...props }, ref) => ( )) diff --git a/packages/react/src/components/separator.tsx b/packages/react/src/components/separator.tsx index 25b3feb..61ba3f6 100644 --- a/packages/react/src/components/separator.tsx +++ b/packages/react/src/components/separator.tsx @@ -16,7 +16,7 @@ const Separator = React.forwardRef< decorative={decorative} orientation={orientation} className={cn( - 'shrink-0 bg-black', + 'shrink-0 bg-border', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className, )} diff --git a/packages/react/src/components/sheet.tsx b/packages/react/src/components/sheet.tsx index 2184bbd..8d9e1ff 100644 --- a/packages/react/src/components/sheet.tsx +++ b/packages/react/src/components/sheet.tsx @@ -8,14 +8,16 @@ interface SheetContentProps extends React.ComponentPropsWithoutRef {} const sheetVariants = cva( - 'fixed z-50 gap-4 bg-dark-900 p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500', + 'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500', { variants: { side: { - top: 'inset-x-0 top-0 border-b border-dark-700/50 data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top', - bottom: 'inset-x-0 bottom-0 border-t border-dark-700/50 data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom', - left: 'inset-y-0 left-0 h-full w-3/4 border-r border-dark-700/50 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm', - right: 'inset-y-0 right-0 h-full w-3/4 border-l border-dark-700/50 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm', + top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top', + bottom: + 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom', + left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm', + right: + 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm', }, }, defaultVariants: { @@ -95,7 +97,7 @@ SheetFooter.displayName = 'SheetFooter' const SheetTitle = React.forwardRef, React.ComponentPropsWithoutRef>(({ className, ...props }, ref) => ( )) @@ -105,7 +107,7 @@ SheetTitle.displayName = SheetPrimitive.Title.displayName const SheetDescription = React.forwardRef, React.ComponentPropsWithoutRef>(({ className, ...props }, ref) => ( )) diff --git a/packages/react/src/components/table.tsx b/packages/react/src/components/table.tsx index 11a91ae..0b17ac0 100644 --- a/packages/react/src/components/table.tsx +++ b/packages/react/src/components/table.tsx @@ -21,7 +21,7 @@ const TableHeader = React.forwardRef< HTMLTableSectionElement, React.HTMLAttributes >(({ className, ...props }, ref) => ( - + )) TableHeader.displayName = 'TableHeader' @@ -32,7 +32,7 @@ const TableBody = React.forwardRef< >(({ className, ...props }, ref) => ( )) @@ -46,7 +46,7 @@ const TableFooter = React.forwardRef< tr]:last:border-b-0', + 'border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className, )} {...props} @@ -62,7 +62,7 @@ const TableRow = React.forwardRef< [role=checkbox]]:translate-y-[2px]', + 'h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0', className, )} {...props} @@ -109,7 +109,7 @@ const TableCaption = React.forwardRef< >(({ className, ...props }, ref) => ( )) diff --git a/packages/react/src/components/tooltip.tsx b/packages/react/src/components/tooltip.tsx index d8766c2..c09a3fc 100644 --- a/packages/react/src/components/tooltip.tsx +++ b/packages/react/src/components/tooltip.tsx @@ -1,24 +1,13 @@ import * as React from 'react' import * as TooltipPrimitive from '@radix-ui/react-tooltip' + import { cn } from '../lib/cn' -import { Button } from './button' const TooltipProvider = TooltipPrimitive.Provider const Tooltip = TooltipPrimitive.Root -function TooltipTrigger({ - className, - ...props -}: React.ButtonHTMLAttributes) { - return ( - -