-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(contentcard): first implementation
- Loading branch information
1 parent
19c0a39
commit 715d3b6
Showing
39 changed files
with
1,673 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/components/src/core/ContentCard/ContentCard.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { CardProps } from "@mui/material"; | ||
|
||
interface BaseContentCardProps extends CardProps { | ||
sdsType?: "wide" | "narrow"; | ||
overlineText?: string; | ||
titleText?: string; | ||
subtitleText?: string; | ||
metadataText?: string; | ||
boundingBox?: boolean; | ||
decorativeBorder?: boolean; | ||
children?: React.ReactNode; | ||
clickableCard?: boolean; | ||
buttonsPosition?: "left" | "right"; | ||
} | ||
|
||
export interface ImageContentCardProps extends BaseContentCardProps { | ||
visualElementType: "image"; | ||
image?: React.ReactNode; | ||
imagePosition?: "left" | "right"; | ||
imagePadding?: boolean; | ||
imageSize?: number; | ||
icon?: never; | ||
} | ||
|
||
export interface IconContentCardProps extends BaseContentCardProps { | ||
visualElementType: "icon"; | ||
icon?: React.ReactNode; | ||
image?: never; | ||
imageSize?: never; | ||
imagePosition?: never; | ||
imagePadding?: never; | ||
} | ||
|
||
export interface NoneContentCardProps extends BaseContentCardProps { | ||
visualElementType: "none"; | ||
icon?: never; | ||
image?: never; | ||
imagePosition?: never; | ||
imagePadding?: never; | ||
imageSize?: never; | ||
} | ||
|
||
export type ContentCardProps = | ||
| ImageContentCardProps | ||
| IconContentCardProps | ||
| NoneContentCardProps; | ||
|
||
export const CONTENT_CARD_DEFAULT_IMAGE_MEDIA_SIZE = 300; | ||
export const CONTENT_CARD_WIDE_TYPE_MIN_WIDTH_LOW_BOUNDARY = 595; | ||
export const CONTENT_CARD_WIDE_TYPE_MIN_WIDTH_HIGH_BOUNDARY = 605; |
Oops, something went wrong.