From 1ac74452639d61bc93857181c802946f966b5abe Mon Sep 17 00:00:00 2001 From: Edouard Wautier <4435185+Duncid@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:04:08 +0100 Subject: [PATCH] Adding Variant prop to AssistantCard --- sparkle/src/components/AssistantCard.tsx | 14 +++++++++++++- sparkle/src/stories/AssistantCard.stories.tsx | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sparkle/src/components/AssistantCard.tsx b/sparkle/src/components/AssistantCard.tsx index 9eec2b83971e..dfde7bd7fc8f 100644 --- a/sparkle/src/components/AssistantCard.tsx +++ b/sparkle/src/components/AssistantCard.tsx @@ -6,6 +6,7 @@ import { CardActionButton, MiniButtonProps, } from "@sparkle/components/"; +import { CardVariantType } from "@sparkle/components/Card"; import { MoreIcon } from "@sparkle/icons/"; import { cn } from "@sparkle/lib/utils"; @@ -16,6 +17,7 @@ interface BaseAssistantCardProps { subtitle?: string; className?: string; onClick?: () => void; + variant?: CardVariantType; } type AssistantCardMore = Omit; @@ -37,7 +39,16 @@ export const AssistantCard = React.forwardRef< AssistantCardProps >( ( - { className, onClick, title, description, pictureUrl, subtitle, action }, + { + className, + onClick, + title, + description, + pictureUrl, + subtitle, + action, + variant = "primary", + }, ref ) => { return ( @@ -47,6 +58,7 @@ export const AssistantCard = React.forwardRef< className={cn("s-flex s-flex-col s-gap-3", className)} onClick={onClick} action={action} + variant={variant} >
diff --git a/sparkle/src/stories/AssistantCard.stories.tsx b/sparkle/src/stories/AssistantCard.stories.tsx index aa0779616c3f..4271a0fced68 100644 --- a/sparkle/src/stories/AssistantCard.stories.tsx +++ b/sparkle/src/stories/AssistantCard.stories.tsx @@ -90,6 +90,7 @@ export const AssistantCardExample = () => ( description="Showing a custom action element" onClick={() => console.log("AssistantCard clicked")} action={ console.log("hello")} />} + variant="secondary" />