diff --git a/docs/components/banners/hero.tsx b/docs/components/banners/hero.tsx index d073385..f6238f9 100644 --- a/docs/components/banners/hero.tsx +++ b/docs/components/banners/hero.tsx @@ -1,6 +1,7 @@ import { Button } from '@openlite/ui' import Link from 'next/link' import InstallCommand from '../install-command' +import { Arrow } from '../icons/arrow' export function Hero() { return ( @@ -23,6 +24,7 @@ export function Hero() { diff --git a/docs/components/demo.tsx b/docs/components/demo.tsx new file mode 100644 index 0000000..b71552d --- /dev/null +++ b/docs/components/demo.tsx @@ -0,0 +1,71 @@ +'use client' + +import { useState } from 'react' +import { + Button, + Card, + CardContent, + Input, + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from '@openlite/ui' +import { AlertDemo } from './examples/alert' +import { MultipleComponentDemo } from './examples/multiple-components' +import { TableDemo } from './examples/table' + +export default function Component() { + const [activeTab, setActiveTab] = useState('account') + + return ( +
+ + +
+ + + + + Account + Password + + +

Login

+

Make changes to your account here. Click save when you're done.

+
+
+ + +
+
+ + +
+ +
+
+ +

Create Account

+

Make changes to your account here. Click save when you're done.

+
+
+ + +
+
+ + +
+ +
+
+
+
+
+ +
+ +
+ ) +} diff --git a/docs/components/examples.tsx b/docs/components/examples.tsx deleted file mode 100644 index d1ff5e8..0000000 --- a/docs/components/examples.tsx +++ /dev/null @@ -1,155 +0,0 @@ -'use client' - -import { useState } from 'react' -import { - Avatar, - AvatarFallback, - AvatarImage, - Badge, - Button, - Card, - CardContent, - CardHeader, - CardTitle, - Checkbox, - Input, - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, - Slider, - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, - Tabs, - TabsContent, - TabsList, - TabsTrigger, -} from '@openlite/ui' - -export default function Component() { - const [activeTab, setActiveTab] = useState('account') - - return ( -
-
- -
-
- -
- - - AC - - - - BC - - +1 -
- - Badge -
- -
-
- -
- - - Notification - - -

This is a notification!

-
-
- - - -
- -
-
-
- - - - - - Account - Password - - -

Account

-

Make changes to your account here. Click save when you're done.

-
-
- - -
-
- - -
- -
-
- -

Password

-

Change your password here.

-
-
-
-
- - - - - - - - Id - Name - Title - Email - Role - - - - {[ - { id: 1, name: 'Lindsay Walton', title: 'Front-end Developer', email: 'lindsay.walton@example.com', role: 'Member' }, - { id: 2, name: 'Courtney Henry', title: 'Designer', email: 'courtney.henry@example.com', role: 'Admin' }, - { id: 3, name: 'Tom Cook', title: 'Director of Product', email: 'tom.cook@example.com', role: 'Member' }, - { id: 4, name: 'Whitney Francis', title: 'Copywriter', email: 'whitney.francis@example.com', role: 'Admin' }, - { id: 5, name: 'Leonard Krasner', title: 'Senior Designer', email: 'leonard.krasner@example.com', role: 'Owner' }, - ].map(person => ( - - - {person.id} - {person.name} - {person.title} - {person.email} - {person.role} - - ))} - -
-
-
-
-
- ) -} diff --git a/docs/components/examples/alert.tsx b/docs/components/examples/alert.tsx new file mode 100644 index 0000000..5bb8367 --- /dev/null +++ b/docs/components/examples/alert.tsx @@ -0,0 +1,13 @@ +import { Alert, AlertDescription, AlertTitle } from '@openlite/ui' +import { Chat } from '../icons/chat' + +export function AlertDemo() { + return ( + + + + You have a notification + Lorem ipsum dolor sit amet consectetur adipisicing elit. Est, asperiores. + + ) +} diff --git a/docs/components/examples/dialog.tsx b/docs/components/examples/dialog.tsx new file mode 100644 index 0000000..3e4fb35 --- /dev/null +++ b/docs/components/examples/dialog.tsx @@ -0,0 +1,47 @@ +import { + Button, + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, + Input, + Label, +} from '@openlite/ui' +import { Copy } from '../icons/copy' + +export function DialogDemo() { + return ( + + + + + + + Share link music + + Anyone who has this link will be able to view this. + + +
+
+ + +
+ +
+ +
+
+ ) +} diff --git a/docs/components/examples/multiple-components.tsx b/docs/components/examples/multiple-components.tsx new file mode 100644 index 0000000..4b92464 --- /dev/null +++ b/docs/components/examples/multiple-components.tsx @@ -0,0 +1,126 @@ +import { + Avatar, + AvatarFallback, + AvatarImage, + Badge, + Button, + Card, + CardContent, + Carousel, + CarouselContent, + CarouselItem, + CarouselNext, + CarouselPrevious, + Input, + + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, + Skeleton, + Slider, + + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from '@openlite/ui' +import Image from 'next/image' +import { ArrowLeft } from '../icons/arrow-left' +import { ArrowRight } from '../icons/arrow-right' + +import { Search } from '../icons/search' +import { DialogDemo } from './dialog' +import { ProgressDemo } from './progress' + +const items = [ + 'https://picsum.photos/100/100?random=1', + 'https://picsum.photos/100/100?random=2', + 'https://picsum.photos/100/100?random=3', + 'https://picsum.photos/100/100?random=4', + 'https://picsum.photos/100/100?random=5', + 'https://picsum.photos/100/100?random=6', +] + +export function MultipleComponentDemo() { + return ( + + +
+ +
+ + + AC + + + + BC + +
+ + Badge +
+ + +
+
+
+
+ + +
+ + + + + + +

Like a prayer - Maddona

+
+
+
+ + +
+
+ + +
+
+ + + {items.map((_, index) => ( + +
+ Isla bonitas +
+
+ ))} +
+ + + + + + +
+
+
+
+ ) +} diff --git a/docs/components/examples/progress.tsx b/docs/components/examples/progress.tsx new file mode 100644 index 0000000..006c8a4 --- /dev/null +++ b/docs/components/examples/progress.tsx @@ -0,0 +1,13 @@ +import { useEffect, useState } from 'react' +import { Progress } from '@openlite/ui' + +export function ProgressDemo() { + const [progress, setProgress] = useState(13) + + useEffect(() => { + const timer = setTimeout(() => setProgress(66), 500) + return () => clearTimeout(timer) + }, []) + + return +} diff --git a/docs/components/examples/table.tsx b/docs/components/examples/table.tsx new file mode 100644 index 0000000..0329fdb --- /dev/null +++ b/docs/components/examples/table.tsx @@ -0,0 +1,50 @@ +import { + Card, + CardContent, + Checkbox, + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from '@openlite/ui' + +export function TableDemo() { + return ( + + + + + + + Id + Name + Title + Email + Role + + + + {[ + { id: 1, name: 'Lindsay Walton', title: 'Front-end Developer', email: 'lindsay.walton@example.com', role: 'Member' }, + { id: 2, name: 'Courtney Henry', title: 'Designer', email: 'courtney.henry@example.com', role: 'Admin' }, + { id: 3, name: 'Tom Cook', title: 'Director of Product', email: 'tom.cook@example.com', role: 'Member' }, + { id: 4, name: 'Whitney Francis', title: 'Copywriter', email: 'whitney.francis@example.com', role: 'Admin' }, + { id: 5, name: 'Leonard Krasner', title: 'Senior Designer', email: 'leonard.krasner@example.com', role: 'Owner' }, + ].map(person => ( + + + {person.id} + {person.name} + {person.title} + {person.email} + {person.role} + + ))} + +
+
+
+ ) +} diff --git a/docs/components/header.tsx b/docs/components/header.tsx index 72d71b5..9593d82 100644 --- a/docs/components/header.tsx +++ b/docs/components/header.tsx @@ -25,7 +25,7 @@ function LinkRepo({ classes }: { classes: string }) { return (
-
diff --git a/docs/components/main.tsx b/docs/components/main.tsx index cf16559..1aada97 100644 --- a/docs/components/main.tsx +++ b/docs/components/main.tsx @@ -1,11 +1,11 @@ import { Hero } from './banners/hero' -import Examples from './examples' +import Demos from './demo' export default function Main() { return (
- +
) } diff --git a/docs/next.config.mjs b/docs/next.config.mjs index 74e58aa..4f3b0fd 100644 --- a/docs/next.config.mjs +++ b/docs/next.config.mjs @@ -6,6 +6,7 @@ const withMDX = createMDX() const config = { reactStrictMode: true, eslint: { ignoreDuringBuilds: true }, + images: { remotePatterns: [{ protocol: 'https', hostname: 'picsum.photos' }] }, } export default withMDX(config) diff --git a/docs/public/example-gerzon.jpeg b/docs/public/example-gerzon.jpeg new file mode 100644 index 0000000..d09307b Binary files /dev/null and b/docs/public/example-gerzon.jpeg differ diff --git a/src/components/forms/input/input.tsx b/src/components/forms/input/input.tsx index bbc1996..15e1ed4 100644 --- a/src/components/forms/input/input.tsx +++ b/src/components/forms/input/input.tsx @@ -3,21 +3,17 @@ import { cn, input } from '@/tailwind' import type { VariantProps } from '@/tailwind' export interface Comp extends HTMLInputElement {} -export interface Props extends React.InputHTMLAttributes, - VariantProps { - labelText?: string -} +export interface Props extends React.InputHTMLAttributes, VariantProps {} -const Input = React.forwardRef(({ className, rounded, icons, variant, labelText, type, ...props }, ref) => { +const Input = React.forwardRef(({ className, rounded, border, type, ...props }, ref) => { return (
-
) diff --git a/src/components/forms/select/select-trigger.tsx b/src/components/forms/select/select-trigger.tsx index c4eead7..c026f5b 100644 --- a/src/components/forms/select/select-trigger.tsx +++ b/src/components/forms/select/select-trigger.tsx @@ -16,7 +16,7 @@ const SelectTrigger = React.forwardRef(({ className, variant, child > {children} - + diff --git a/src/plugins/animations.ts b/src/plugins/animations.ts index 061a22d..902a64e 100644 --- a/src/plugins/animations.ts +++ b/src/plugins/animations.ts @@ -1,7 +1,7 @@ export const animations = { animation: { 'pulse': 'pulse 1s ease-in-out', - 'pop': 'pop 0.6s ease-out', + 'pop-in': 'pop 0.6s ease-out', 'pulse-fade-in': 'pulse-fade-in 0.3s ease-out', 'dialog-in': 'dialog-in 0.3s ease-out', 'dialog-out': 'dialog-out 0.3s ease-out', diff --git a/src/plugins/components/button.ts b/src/plugins/components/button.ts index 622d10d..68efa5b 100644 --- a/src/plugins/components/button.ts +++ b/src/plugins/components/button.ts @@ -25,7 +25,7 @@ export const button = cva( }, outline: { none: 'border-0', - default: 'border boder-default bg-transparent text-foreground hover:text-default-foreground hover:bg-default', + default: 'border border-default-300 bg-transparent text-foreground hover:bg-default-200', primary: 'border border-primary bg-transparent text-foreground hover:text-primary-foreground hover:bg-primary', error: 'border border-error bg-transparent text-foreground hover:text-error-foreground hover:bg-error', success: 'border border-success bg-transparent text-foreground hover:text-success-foreground hover:bg-success', diff --git a/src/plugins/components/dialog.ts b/src/plugins/components/dialog.ts index 8cea6e4..775dedd 100644 --- a/src/plugins/components/dialog.ts +++ b/src/plugins/components/dialog.ts @@ -34,7 +34,7 @@ export const dialogPortal = cva('') * // button elements * */ -export const dialogOverlay = cva('fixed inset-0 z-50 bg-black/80 data-[state=open]:dialog-in data-[state=closed]:dialog-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0') +export const dialogOverlay = cva('fixed inset-0 z-50 bg-default-200/50 data-[state=open]:animate-dialog-in data-[state=closed]:animate-dialog-out') /** * DialogClose wrapper **Class Variants** component @@ -70,7 +70,7 @@ export const dialogTrigger = cva('') * // button elements * */ -export const dialogContent = cva('fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%] w-full max-w-lg p-6 shadow-medium rounded-medium bg-default duration-200') +export const dialogContent = cva('fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-dialog-in data-[state=closed]:animate-dialog-out sm:rounded-lg') /** * DialogHeader wrapper **Class Variants** component @@ -106,7 +106,7 @@ export const dialogFooter = cva('flex flex-col-reverse sm:flex-row sm:justify-en * // button elements * */ -export const dialogTitle = cva('text-large font-medium leading-none tracking-tight') +export const dialogTitle = cva('text-large font-medium leading-none tracking-tight text-foreground') /** * DialogDescription wrapper **Class Variants** component diff --git a/src/plugins/components/input.ts b/src/plugins/components/input.ts index 4f5ad69..d9405c3 100644 --- a/src/plugins/components/input.ts +++ b/src/plugins/components/input.ts @@ -8,31 +8,24 @@ import { cva } from 'class-variance-authority' * @example * */ -export const input = cva('h-10 w-full transition-colors rounded-medium border-2 bg-transparent px-4 py-2 text-medium ring-offset-background file:border-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0', { +export const input = cva('h-10 w-full transition-colors bg-transparent px-4 py-2 text-medium ring-offset-background file:border-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0', { variants: { - variant: { - default: 'border-default/30 focus-visible:border-default transition-border durations-500', - primary: 'border-primary/30 focus-visible:border-primary transition-border durations-500', - success: 'border-success/30 focus-visible:border-success transition-border durations-500', - warn: 'border-warn/30 focus-visible:border-warn transition-border durations-500', - error: 'border-error/30 focus-visible:border-error transition-border durations-500', - }, - icons: { - none: '', - left: 'pl-10', - right: 'pr-10', - both: 'px-10', - }, rounded: { none: 'rounded-none', - small: 'rounded-small', - medium: 'rounded-medium', - large: 'rounded-large', + sm: 'rounded-small', + md: 'rounded-medium', + lg: 'rounded-large', + }, + + border: { + none: 'border-none', + sm: 'border', + md: 'border-2', + lg: 'border-4', }, }, defaultVariants: { - variant: 'default', - icons: 'none', - rounded: 'none', + rounded: 'md', + border: 'sm', }, }) diff --git a/src/plugins/components/progress.ts b/src/plugins/components/progress.ts index 148b87d..1a7f0b3 100644 --- a/src/plugins/components/progress.ts +++ b/src/plugins/components/progress.ts @@ -11,7 +11,7 @@ import { cva } from 'class-variance-authority' *
*/ -export const progress = cva('relative bg-default w-96 overflow-hidden rounded-full', { +export const progress = cva('relative bg-default-300 md:min-w-96 overflow-hidden rounded-full', { variants: { size: { sm: 'h-2', @@ -37,6 +37,7 @@ export const progress = cva('relative bg-default w-96 overflow-hidden rounded-fu export const progressIndicator = cva('h-full relative w-full flex-1 transition-all rounded-full', { variants: { variant: { + default: 'bg-default', primary: 'bg-primary', success: 'bg-success', warn: 'bg-warn', @@ -44,6 +45,6 @@ export const progressIndicator = cva('h-full relative w-full flex-1 transition-a }, }, defaultVariants: { - variant: 'primary', + variant: 'default', }, }) diff --git a/src/plugins/components/select.ts b/src/plugins/components/select.ts index 6a7026a..c7e6202 100644 --- a/src/plugins/components/select.ts +++ b/src/plugins/components/select.ts @@ -46,7 +46,7 @@ export const selectValue = cva('') * // SelectTrigger elements * */ -export const selectTrigger = cva('flex relative h-10 w-64 items-center justify-between rounded-medium px-3 py-2 text-small ring-offset-transparent focus:outline-none focus:ring-2 focus:ring-transparent focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', { +export const selectTrigger = cva('flex relative w-96 items-center justify-between rounded-medium px-3 py-2 text-small ring-offset-transparent focus:outline-none focus:ring-2 focus:ring-transparent focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', { variants: { variant: { none: 'border-none', diff --git a/src/plugins/components/skeleton.ts b/src/plugins/components/skeleton.ts index a9c9287..fc02a62 100644 --- a/src/plugins/components/skeleton.ts +++ b/src/plugins/components/skeleton.ts @@ -10,7 +10,7 @@ import { cva } from 'class-variance-authority' * // Skeleton elements * */ -export const skeleton = cva('animate-pulse-infinite bg-default', { +export const skeleton = cva('animate-pulse bg-default-300', { variants: { rounded: { none: 'rounded-none', diff --git a/src/plugins/components/table.ts b/src/plugins/components/table.ts index ea89b21..89fbe15 100644 --- a/src/plugins/components/table.ts +++ b/src/plugins/components/table.ts @@ -22,7 +22,7 @@ export const table = cva('w-full caption-bottom text-small rounded-lg overflow-h * // TableHeader elements * */ -export const tableHeader = cva('[&_tr]:border-b [&_tr]:border-default') +export const tableHeader = cva('[&_tr]:border-b') /** * Table wrapper **Class Variants** component @@ -46,7 +46,7 @@ export const tableBody = cva('&_tr:last-child]:border-0') * // TableFooter elements * */ -export const tableFooter = cva('border-t bg-default/50 font-medium [&>tr]:last:border-b-0') +export const tableFooter = cva('border-t font-medium [&>tr]:last:border-b-0') /** * Table wrapper **Class Variants** component @@ -58,7 +58,7 @@ export const tableFooter = cva('border-t bg-default/50 font-medium [&>tr]:last:b * // TableRow elements * */ -export const tableRow = cva('border-b transition-colors hover:bg-default/30 border-b-default') +export const tableRow = cva('border-b transition-colors hover:bg-default-100') /** * Table wrapper **Class Variants** component @@ -70,7 +70,7 @@ export const tableRow = cva('border-b transition-colors hover:bg-default/30 bord * // TableHead elements * */ -export const tableHead = cva('h-12 px-4 text-left align-middle font-medium text-default-foreground [&:has([role=checkbox])]:pr-0') +export const tableHead = cva('h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0') /** * Table wrapper **Class Variants** component @@ -94,4 +94,4 @@ export const tableCell = cva('p-4 align-middle [&:has([role=checkbox])]:pr-0') * // TableCaption elements * */ -export const tableCaption = cva('mt-4 text-sm text-default-foreground') +export const tableCaption = cva('mt-4 text-small text-default-foreground') diff --git a/src/plugins/components/tooltip.ts b/src/plugins/components/tooltip.ts index 362fd53..33c651a 100644 --- a/src/plugins/components/tooltip.ts +++ b/src/plugins/components/tooltip.ts @@ -22,7 +22,7 @@ export const tooltip = cva('') * // Tooltip elements * */ -export const tooltipTrigger = cva('px-2 py-1 text-white hover:animate-pop') +export const tooltipTrigger = cva('px-2 py-1 hover:animate-pop-in text-foreground') /** * Tooltip wrapper **Class Variants** component @@ -45,4 +45,4 @@ export const tooltipProvider = cva('') * // Tooltip elements * */ -export const tooltipContent = cva('z-50 w-fit max-w-72 px-2 py-1 !text-foreground bg-background border border-default rounded-medium text-small shadow-small animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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') +export const tooltipContent = cva('z-50 w-fit max-w-72 px-2 py-1 bg-background border rounded-medium text-small')