From 6b5940e00e882e1b85debfedfcb2744030e31365 Mon Sep 17 00:00:00 2001 From: Matt Hook Date: Wed, 31 May 2023 13:18:05 +1200 Subject: [PATCH] add card component (#9022) --- app/react/components/Card/Card.stories.tsx | 18 ++++++++++++++++++ app/react/components/Card/Card.tsx | 19 +++++++++++++++++++ app/react/components/Card/index.ts | 1 + 3 files changed, 38 insertions(+) create mode 100644 app/react/components/Card/Card.stories.tsx create mode 100644 app/react/components/Card/Card.tsx create mode 100644 app/react/components/Card/index.ts diff --git a/app/react/components/Card/Card.stories.tsx b/app/react/components/Card/Card.stories.tsx new file mode 100644 index 000000000..985a9972c --- /dev/null +++ b/app/react/components/Card/Card.stories.tsx @@ -0,0 +1,18 @@ +import { Meta, Story } from '@storybook/react'; +import { PropsWithChildren } from 'react'; + +import { Card, Props } from './Card'; + +export default { + component: Card, + title: 'Components/Card/Card', +} as Meta; + +function Template({ + children, +}: JSX.IntrinsicAttributes & PropsWithChildren) { + return {children}; +} + +export const Primary: Story> = Template.bind({}); +Primary.args = {}; diff --git a/app/react/components/Card/Card.tsx b/app/react/components/Card/Card.tsx new file mode 100644 index 000000000..1839f649e --- /dev/null +++ b/app/react/components/Card/Card.tsx @@ -0,0 +1,19 @@ +import clsx from 'clsx'; +import { PropsWithChildren } from 'react'; + +export interface Props { + className?: string; +} + +export function Card({ className, children }: PropsWithChildren) { + return ( +
+ {children} +
+ ); +} diff --git a/app/react/components/Card/index.ts b/app/react/components/Card/index.ts new file mode 100644 index 000000000..1e15afd14 --- /dev/null +++ b/app/react/components/Card/index.ts @@ -0,0 +1 @@ +export { Card } from './Card';