feat: 修改样式
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import { Slot } from '@radix-ui/react-slot';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
import * as React from 'react';
|
||||
|
||||
import { cn } from '@workspace/airo-ui/lib/utils';
|
||||
|
||||
const buttonVariants = cva(
|
||||
'px-6 rounded-full inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors 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-[#0F2C53] text-primary-foreground shadow hover:bg-[#225BA9]',
|
||||
primary: 'bg-[#A8D4ED] text-primary-foreground shadow hover:bg-[#225BA9] ',
|
||||
danger: 'bg-[#F8BFD2] text-primary-foreground shadow hover:bg-[#FF4248]',
|
||||
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',
|
||||
},
|
||||
size: {
|
||||
default: 'h-8 min-w-[100px]',
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
size: 'default',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
export interface ButtonProps
|
||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
VariantProps<typeof buttonVariants> {
|
||||
asChild?: boolean;
|
||||
}
|
||||
|
||||
const AiroButton = 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} />
|
||||
);
|
||||
},
|
||||
);
|
||||
AiroButton.displayName = 'AiroButton';
|
||||
|
||||
export { AiroButton, buttonVariants };
|
||||
@@ -148,7 +148,11 @@ export function ProList<TData, TValue extends Record<string, unknown>>({
|
||||
<div className='flex flex-1 items-center justify-end gap-2'>
|
||||
{params && params?.length > 0 && (
|
||||
<>
|
||||
<Button variant='outline' className='h-8 w-8 bg-[#D9D9D9] p-2' onClick={fetchData}>
|
||||
<Button
|
||||
variant='outline'
|
||||
className='h-8 w-8 rounded-full bg-[#D9D9D9] p-2'
|
||||
onClick={fetchData}
|
||||
>
|
||||
<RefreshCcw className='h-4 w-4 text-[#848484]' />
|
||||
</Button>
|
||||
</>
|
||||
|
||||
@@ -7,8 +7,8 @@ const config = {
|
||||
content: [
|
||||
'app/**/*.{ts,tsx}',
|
||||
'components/**/*.{ts,tsx}',
|
||||
'../../packages/ui/src/components/**/*.{ts,tsx}',
|
||||
'../../packages/ui/src/custom-components/**/*.{ts,tsx}',
|
||||
'../../packages/airo-ui/src/components/**/*.{ts,tsx}',
|
||||
'../../packages/airo-ui/src/custom-components/**/*.{ts,tsx}',
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
|
||||
Reference in New Issue
Block a user