FR: #4048 - Add color customization to the chatbot (#4885)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
Diego Romero-Lovo
2024-06-26 04:51:00 -05:00
committed by GitHub
parent 8fa6cb5e03
commit 4c0a31d38b
38 changed files with 379 additions and 18 deletions

View File

@@ -1,3 +1,4 @@
import type { CSSProperties } from 'react'
import React from 'react'
import { type VariantProps, cva } from 'class-variance-authority'
import classNames from 'classnames'
@@ -29,15 +30,17 @@ const buttonVariants = cva(
export type ButtonProps = {
loading?: boolean
styleCss?: CSSProperties
} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, loading, children, ...props }, ref) => {
({ className, variant, size, loading, styleCss, children, ...props }, ref) => {
return (
<button
type='button'
className={classNames(buttonVariants({ variant, size, className }))}
ref={ref}
style={styleCss}
{...props}
>
{children}