Skip to content

Commit

Permalink
build: card component
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwaxhello committed May 23, 2024
1 parent a24888b commit 4934ad8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions packages/components-react/src/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// export const Card = () => (
// <section className="frameless-card-section">
// <div className="frameless-card-group">
// <div className="frameless-card"></div>
// </div>
// </section>
// );

import clsx from 'clsx';
import { HTMLAttributes, PropsWithChildren } from 'react';
import '@frameless/components-css/card/index.scss';

// ensures that this component is flexible, can accept standard HTML attributes, and conditionally applies styles based on the background prop.
interface CardIllustrationProps extends HTMLAttributes<HTMLElement> {
background?: boolean;
}

export const CardIllustrations = ({
background,
children,
className,
...restProps
}: PropsWithChildren<CardIllustrationProps>) => (
<div
{...restProps}
className={clsx(['frameless-card-test'], background, ['card__illustration--background'], className)}
>
{children}
</div>
);

export const CardContent = (props: PropsWithChildren<HTMLAttributes<HTMLElement>>) => (
<div className={clsx(['frameless-card-content'])} {...props} />
);

0 comments on commit 4934ad8

Please sign in to comment.