feat: add shadcn/ui + Tailwind CSS v4 + Huge Icons foundation

- Install tailwindcss, @tailwindcss/postcss, clsx, tailwind-merge, class-variance-authority
- Install @hugeicons/react for icons
- Install Radix UI primitives (switch, tabs, label, separator, select, dialog, checkbox, dropdown-menu, popover)
- Install sonner for toast notifications
- Create postcss.config.js with Tailwind v4 PostCSS plugin
- Create jsconfig.json with @ path alias for src/admin
- Create components.json for shadcn configuration
- Update webpack.config.js with @ resolve alias
- Create globals.css with Tailwind v4 CSS-first config + shadcn CSS variables
- Create cn() utility in lib/utils.js
- Create 17 shadcn UI components (button, input, label, checkbox, switch, tabs, alert, separator, badge, textarea, dialog, sonner, table, skeleton, select, dropdown-menu, popover)
- Create async confirm() utility replacing SweetAlert2
- Create toast utility wrapping sonner
This commit is contained in:
dwindown
2026-04-19 12:27:20 +07:00
parent fe9efdfeec
commit 862abc8d74
32 changed files with 6315 additions and 31 deletions

View File

@@ -0,0 +1,29 @@
import * as PopoverPrimitive from '@radix-ui/react-popover';
import { cn } from '@/lib/utils';
function Popover({ ...props }) {
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
}
function PopoverTrigger({ ...props }) {
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
}
function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
return (
<PopoverPrimitive.Portal>
<PopoverPrimitive.Content
data-slot="popover-content"
align={align}
sideOffset={sideOffset}
className={cn(
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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}
/>
</PopoverPrimitive.Portal>
);
}
export { Popover, PopoverTrigger, PopoverContent };