feat: refactor UI components and introduce new ones

- Updated toggle component to use new radix-ui import and improved styles.
- Refactored tooltip component to align with new radix-ui structure and enhanced styles.
- Added button group component for better button organization.
- Introduced chart component with responsive design and tooltip functionality.
- Created empty state components for better user experience.
- Developed field components for form handling with improved accessibility.
- Added input group component for better input management.
- Introduced item components for structured content display.
- Created keyboard shortcut components for better user interaction.
- Added spinner component for loading states.
This commit is contained in:
암냥 2026-01-18 14:19:08 +09:00
commit 4f7b579fac
No known key found for this signature in database
55 changed files with 2036 additions and 718 deletions

View file

@ -1,12 +1,8 @@
import * as React from "react"
import {
ChevronLeftIcon,
ChevronRightIcon,
MoreHorizontalIcon,
} from "lucide-react"
import { cn } from "@/lib/utils"
import { Button, buttonVariants } from "@/components/ui/button"
import { Button } from "@/components/ui/button"
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
return (
@ -14,7 +10,10 @@ function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
role="navigation"
aria-label="pagination"
data-slot="pagination"
className={cn("mx-auto flex w-full justify-center", className)}
className={cn(
"mx-auto flex w-full justify-center",
className
)}
{...props}
/>
)
@ -27,7 +26,7 @@ function PaginationContent({
return (
<ul
data-slot="pagination-content"
className={cn("flex flex-row items-center gap-1", className)}
className={cn("gap-1 flex items-center", className)}
{...props}
/>
)
@ -49,19 +48,19 @@ function PaginationLink({
...props
}: PaginationLinkProps) {
return (
<a
aria-current={isActive ? "page" : undefined}
data-slot="pagination-link"
data-active={isActive}
className={cn(
buttonVariants({
variant: isActive ? "outline" : "ghost",
size,
}),
className
)}
{...props}
/>
<Button
asChild
variant={isActive ? "outline" : "ghost"}
size={size}
className={cn(className)}
>
<a
aria-current={isActive ? "page" : undefined}
data-slot="pagination-link"
data-active={isActive}
{...props}
/>
</Button>
)
}
@ -73,11 +72,13 @@ function PaginationPrevious({
<PaginationLink
aria-label="Go to previous page"
size="default"
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
className={cn("pl-2!", className)}
{...props}
>
<ChevronLeftIcon />
<span className="hidden sm:block">Previous</span>
<ChevronLeftIcon data-icon="inline-start" />
<span className="hidden sm:block">
Previous
</span>
</PaginationLink>
)
}
@ -90,11 +91,11 @@ function PaginationNext({
<PaginationLink
aria-label="Go to next page"
size="default"
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
className={cn("pr-2!", className)}
{...props}
>
<span className="hidden sm:block">Next</span>
<ChevronRightIcon />
<ChevronRightIcon data-icon="inline-end" />
</PaginationLink>
)
}
@ -107,10 +108,14 @@ function PaginationEllipsis({
<span
aria-hidden
data-slot="pagination-ellipsis"
className={cn("flex size-9 items-center justify-center", className)}
className={cn(
"size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-4 flex items-center justify-center",
className
)}
{...props}
>
<MoreHorizontalIcon className="size-4" />
<MoreHorizontalIcon
/>
<span className="sr-only">More pages</span>
</span>
)
@ -119,9 +124,9 @@ function PaginationEllipsis({
export {
Pagination,
PaginationContent,
PaginationLink,
PaginationItem,
PaginationPrevious,
PaginationNext,
PaginationEllipsis,
PaginationItem,
PaginationLink,
PaginationNext,
PaginationPrevious,
}