mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-08-30 18:10:28 +08:00
a3c4c6c8e8
* chore: add @base-ui-components/react dependency and update pnpm-lock.yaml * feat: add custom hook useMediaQuery for responsive design * refactor: streamline button component code for improved readability * refactor: enhance ScrollArea component with viewport className prop and improve className organization * refactor: replace Dialog component with ResponsiveDialog for improved responsiveness and UI consistency * feat: introduce ResponsiveDialog component for enhanced mobile and desktop dialog handling * refactor: update Next.js configuration to use TypeScript type for NextConfig * refactor: replace Dialog with ResponsiveDialog in CardsChat component for improved UI consistency and responsiveness * refactor: replace Dialog with ResponsiveDialog in ShareDialog component for improved UI consistency and responsiveness * refactor: replace Dialog with ResponsiveDialog in FigmaExportDialog component for improved UI consistency and responsiveness. - Use `Scrollarea` for cleaner scrollbar and structure it a bit different, so scrollbar's doesn't overflow beyond dialog. * refactor: replace Dialog with ResponsiveDialog in ThemeSaveDialog component for improved UI consistency and responsiveness * refactor: replace Dialog with ResponsiveDialog in PodcastEmptyPlaceholder component for improved UI consistency and responsiveness * refactor: replace Dialog with ResponsiveDialog in ChatImagePreview component for improved UI consistency and responsiveness * feat: add Tabs component based on BaseUI with customizable TabsList, TabsTrigger, TabsContent, and TabsIndicator for improved UI navigation * refactor: replace Dialog with ResponsiveDialog in CssImportDialog component for improved UI consistency and responsiveness * refactor: replace Dialog with ResponsiveDialog in AuthDialog component for improved UI consistency and responsiveness * refactor: replace Dialog with ResponsiveDialog in MCPDialog component for improved UI consistency and responsiveness - Replace `Tabs` component with new Base UI based `Tabs` component * refactor: update Tabs and Select components in CodePanel for improved UI consistency - Replace old Tabs component with new Base UI based Tabs component - Add TabsIndicator for enhanced visual feedback - Adjust SelectContent z-index for better layering * refactor: replace Dialog with ResponsiveDialog in CodePanelDialog component for improved UI consistency and responsiveness - fix: accessibility issue cased by missing title and description for dialog * refactor: replace Dialog with ResponsiveDialog in ContrastChecker component for improved UI consistency and responsiveness - Disable `Issues` button, when there's no issue - Sticky Header for each section for better messaging for each section especially on mobile * refactor: adjust layout and spacing in FigmaExportDialog for improved visual consistency - Update margin and padding for better alignment of elements - Remove unnecessary line breaks to streamline the code * refactor: adjust layout and spacing in GetProDialog and AIChatDemo components for improved visual consistency - Update positioning of elements in GetProDialog for better alignment - Remove unnecessary inset from AIChatDemo for cleaner layout * refactor: enhance layout in CodePanelDialog for improved responsiveness - Adjust max-height for better display on smaller screens - Maintain overall visual consistency with other dialog components * refactor: enhance CodePanel layout with additional ScrollBar orientations - Add horizontal and vertical ScrollBars for improved navigation within code panels - Adjust padding in CodePanelDialog for better spacing and visual consistency * refactor: clean up TabsIndicator component by removing commented code - Remove unnecessary commented-out code for better readability - Streamline TabsIndicator implementation for improved clarity * refactor: update ResponsiveDialog components to use isDesktop for breakpoint detection - Replace isMobile with isDesktop in ResponsiveDialog components for improved clarity - Ensure consistent behavior across dialog and drawer implementations based on desktop view * refactor: enhance ResponsiveDialogContent with additional props for customization (v1.4) update - Introduce closeButtonClassName and dragHandleClassName props for better styling control - Update context initialization to allow null values for improved type safety - Refactor ResponsiveDialogContent to streamline rendering logic and improve readability * refactor: reorganize imports and clean up AuthDialog component for improved readability - Rearranged import statements for better structure - Removed unnecessary props from ResponsiveDialogContent for cleaner layout - Enhanced overall code clarity and maintainability * refactor: reorganize imports in MCPDialog for improved clarity and consistency - Rearranged import statements for better structure - Cleaned up component imports to enhance readability - Maintained overall code organization for future maintainability * refactor: reorganize imports and enhance layout in various dialog components for improved readability - Cleaned up and rearranged import statements for better structure - Updated ResponsiveDialogContent and ResponsiveDialogHeader for consistent padding and spacing - Enhanced overall layout and visual consistency across multiple dialog components * refactor: add iOS detection to adjust repositioning of inputs in ResponsiveDialog
54 lines
1.9 KiB
TypeScript
54 lines
1.9 KiB
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import { Slot } from "@radix-ui/react-slot";
|
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
const buttonVariants = cva(
|
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus:outline-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
{
|
|
variants: {
|
|
variant: {
|
|
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
outline:
|
|
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
link: "text-primary underline-offset-4 hover:underline",
|
|
accent: "bg-accent text-accent-foreground shadow-sm hover:bg-accent/80",
|
|
},
|
|
size: {
|
|
default: "h-9 px-4 py-2",
|
|
sm: "h-8 rounded-md px-3 text-xs",
|
|
lg: "h-10 rounded-md px-8",
|
|
icon: "h-9 w-9",
|
|
},
|
|
},
|
|
defaultVariants: {
|
|
variant: "default",
|
|
size: "default",
|
|
},
|
|
}
|
|
);
|
|
|
|
export interface ButtonProps
|
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
VariantProps<typeof buttonVariants> {
|
|
asChild?: boolean;
|
|
}
|
|
|
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
const Comp = asChild ? Slot : "button";
|
|
return (
|
|
<Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
|
|
);
|
|
}
|
|
);
|
|
Button.displayName = "Button";
|
|
|
|
export { Button, buttonVariants };
|