mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 10:16:01 +00:00
* feat: Add reusable UI components and fix GitHub repository display * style: Fix linting issues in UI components * fix: Add close icon to GitHub Connection Required dialog * fix: Add CloseButton component to fix white background issue in dialog close icons * Fix close button styling in dialog components to address ghost white issue in dark mode * fix: update icon color to tertiary for consistency The icon color was changed from `text-bolt-elements-icon-info` to `text-bolt-elements-icon-tertiary` * fix: improve repository selection dialog tab styling for dark mode - Update tab menu styling to prevent white background in dark mode - Use explicit color values for better dark/light mode compatibility - Improve hover and active states for better visual hierarchy - Remove unused Tabs imports --------- Co-authored-by: KevIsDev <zennerd404@gmail.com>
54 lines
2.1 KiB
TypeScript
54 lines
2.1 KiB
TypeScript
'use client';
|
|
|
|
import * as React from 'react';
|
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
import { classNames } from '~/utils/classNames';
|
|
|
|
const badgeVariants = cva(
|
|
'inline-flex items-center gap-1 transition-colors focus:outline-none focus:ring-2 focus:ring-bolt-elements-ring focus:ring-offset-2',
|
|
{
|
|
variants: {
|
|
variant: {
|
|
default:
|
|
'border-transparent bg-bolt-elements-background text-bolt-elements-textPrimary hover:bg-bolt-elements-background/80',
|
|
secondary:
|
|
'border-transparent bg-bolt-elements-background text-bolt-elements-textSecondary hover:bg-bolt-elements-background/80',
|
|
destructive: 'border-transparent bg-red-500/10 text-red-500 hover:bg-red-500/20',
|
|
outline: 'text-bolt-elements-textPrimary',
|
|
primary: 'bg-purple-500/10 text-purple-600 dark:text-purple-400',
|
|
success: 'bg-green-500/10 text-green-600 dark:text-green-400',
|
|
warning: 'bg-yellow-500/10 text-yellow-600 dark:text-yellow-400',
|
|
danger: 'bg-red-500/10 text-red-600 dark:text-red-400',
|
|
info: 'bg-blue-500/10 text-blue-600 dark:text-blue-400',
|
|
subtle:
|
|
'border border-bolt-elements-borderColor/30 dark:border-bolt-elements-borderColor-dark/30 bg-white/50 dark:bg-bolt-elements-background-depth-4/50 backdrop-blur-sm text-bolt-elements-textSecondary dark:text-bolt-elements-textSecondary-dark',
|
|
},
|
|
size: {
|
|
default: 'rounded-full px-2.5 py-0.5 text-xs font-semibold',
|
|
sm: 'rounded-full px-1.5 py-0.5 text-xs',
|
|
md: 'rounded-md px-2 py-1 text-xs font-medium',
|
|
lg: 'rounded-md px-2.5 py-1.5 text-sm',
|
|
},
|
|
},
|
|
defaultVariants: {
|
|
variant: 'default',
|
|
size: 'default',
|
|
},
|
|
},
|
|
);
|
|
|
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
icon?: string;
|
|
}
|
|
|
|
function Badge({ className, variant, size, icon, children, ...props }: BadgeProps) {
|
|
return (
|
|
<div className={classNames(badgeVariants({ variant, size }), className)} {...props}>
|
|
{icon && <span className={icon} />}
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export { Badge, badgeVariants };
|