From c96eaff019e37c9007f39ce73bce2d3a2099d708 Mon Sep 17 00:00:00 2001 From: Taek Been Nam Date: Wed, 12 Jun 2024 16:51:18 -0400 Subject: [PATCH] update card story --- components/molecules/card/card.stories.tsx | 25 ++++-------- components/molecules/card/card.tsx | 44 +++++++--------------- 2 files changed, 22 insertions(+), 47 deletions(-) diff --git a/components/molecules/card/card.stories.tsx b/components/molecules/card/card.stories.tsx index 907c90e..6b3954c 100644 --- a/components/molecules/card/card.stories.tsx +++ b/components/molecules/card/card.stories.tsx @@ -9,23 +9,14 @@ const meta: Meta = { parameters: { layout: "centered", }, - args: { - intent: "neutral", - }, - argTypes: { - intent: { - options: ["primary", "secondary", "tertiary", "neutral"], - control: { type: "radio" }, - }, - }, }; export default meta; type Story = StoryObj; export const Default: Story = { - render: ({ intent }) => ( - + render: () => ( + “Lorem ipsum dolor sit amet, consec tetur adi piscing elit. Praesent tellus leo, vesti bulum a ipsum sed, suscipit sodales ex. Vestibulum id @@ -36,8 +27,8 @@ export const Default: Story = { }; export const WithHeader: Story = { - render: ({ intent }) => ( - + render: () => ( + “Lorem ipsum dolor sit amet, consec tetur adi piscing elit. Praesent @@ -49,8 +40,8 @@ export const WithHeader: Story = { }; export const WithAvatar: Story = { - render: ({ intent }) => ( - + render: () => ( + @@ -71,8 +62,8 @@ export const WithAvatar: Story = { }; export const WithAction: Story = { - render: ({ intent }) => ( - + render: () => ( + “Lorem ipsum dolor sit amet, consec tetur adi piscing elit. Praesent tellus leo, vesti bulum a ipsum sed, suscipit sodales ex. Vestibulum id diff --git a/components/molecules/card/card.tsx b/components/molecules/card/card.tsx index 37275d6..a7d4938 100644 --- a/components/molecules/card/card.tsx +++ b/components/molecules/card/card.tsx @@ -1,38 +1,22 @@ import { cn } from "@/lib/utils"; import React, { forwardRef } from "react"; -import { cva, type VariantProps } from "class-variance-authority"; -const cardVariants = cva( - "flex min-w-56 flex-col gap-4 p-6 shadow-md rounded-2xl", - { - variants: { - intent: { - primary: "bg-primary-90 text-neutral-10", - secondary: "bg-secondary-90 text-neutral-90", - tertiary: "bg-tertiary-90 text-neutral-90", - neutral: "bg-white text-neutral-90", - }, - }, - defaultVariants: { - intent: "neutral", - }, +const Card = forwardRef>( + ({ className, children, ...props }, ref) => { + return ( +
+ {children} +
+ ); }, ); - -const Card = forwardRef< - HTMLDivElement, - React.HTMLAttributes & VariantProps ->(({ className, intent, children, ...props }, ref) => { - return ( -
- {children} -
- ); -}); Card.displayName = "Card"; interface CardHeader extends React.HTMLAttributes {