Skip to content

Commit

Permalink
feat(ui): card component
Browse files Browse the repository at this point in the history
  • Loading branch information
stakbucks committed Sep 15, 2024
1 parent ae3eca6 commit c52553f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/ui/src/components/card/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ComponentProps, ReactNode } from 'react';
import { wrapperStyle } from './cardStyle.css';

export interface CardProps extends ComponentProps<'div'> {
children: ReactNode | ReactNode[];
}

export function Card({ children, ...rest }: CardProps) {
return (
<div className={wrapperStyle} {...rest}>
{children}
</div>
);
}
13 changes: 13 additions & 0 deletions packages/ui/src/components/card/cardStyle.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { style } from '@vanilla-extract/css';
import { colors, radius, spacings } from '../../foundations';

export const wrapperStyle = style({
width: '100%',
backgroundColor: colors.white100,
border: `1px solid ${colors.neutral300}`,
padding: `${spacings.xl} ${spacings.md}`,
gap: spacings.xl,
borderRadius: radius.xl,
display: 'flex',
flexDirection: 'column',
});
2 changes: 2 additions & 0 deletions packages/ui/src/components/card/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { Card } from './Card';
export type { CardProps } from './Card';
2 changes: 2 additions & 0 deletions packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export { Button } from './button';
export type { ButtonProps } from './button';
export { Bubble } from './bubble';
export type { BubbleProps } from './bubble';
export { Card } from './card';
export type { CardProps } from './card';
export { ImageButton } from './image-button';
export type { ImageButtonProps } from './image-button';
export { CTAButton, isVariantOne } from './cta-button';
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export {
WheelPickerItem,
BottomSheet,
Chip,
Card,
TextField,
Agreement,
} from './components';
Expand All @@ -30,6 +31,7 @@ export type {
WheelPickerItemProps,
BottomSheetProps,
ChipProps,
CardProps,
TextFieldProps,
AgreementProps,
AgreementItemProps,
Expand Down

0 comments on commit c52553f

Please sign in to comment.