mirror of https://github.com/portainer/portainer
add card component (#9022)
parent
3a49dbf803
commit
6b5940e00e
|
@ -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<Props>) {
|
||||
return <Card>{children}</Card>;
|
||||
}
|
||||
|
||||
export const Primary: Story<PropsWithChildren<Props>> = Template.bind({});
|
||||
Primary.args = {};
|
|
@ -0,0 +1,19 @@
|
|||
import clsx from 'clsx';
|
||||
import { PropsWithChildren } from 'react';
|
||||
|
||||
export interface Props {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function Card({ className, children }: PropsWithChildren<Props>) {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
className,
|
||||
'rounded border border-solid border-gray-5 bg-gray-neutral-3 p-5 th-highcontrast:border-white th-highcontrast:bg-black th-dark:border-legacy-grey-3 th-dark:bg-gray-iron-11'
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export { Card } from './Card';
|
Loading…
Reference in New Issue