Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/website/screens/theme-generator/componentsRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
BadgePreview,
BreadcrumbsPreview,
ButtonPreview,
CardPreview,
CheckboxPreview,
ChipPreview,
ContextualMenuPreview,
Expand Down Expand Up @@ -77,6 +78,7 @@ export const componentsRegistry = {
"/components/badge": BadgePreview,
"/components/chip": ChipPreview,
"/components/status-light": StatusLightPreview,
"/components/card": CardPreview,
};

export const examplesRegistry = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { DxcCard, DxcContainer, DxcFlex, DxcParagraph } from "@dxc-technology/halstack-react";
import { ReactEventHandler } from "react";

interface ImagePropsType {
alt: string;
caption?: string;
height?: string;
lazyLoading?: boolean;
objectFit?: "contain" | "cover" | "fill" | "none" | "scale-down";
objectPosition?: string;
onError?: ReactEventHandler<HTMLImageElement>;
onLoad?: ReactEventHandler<HTMLImageElement>;
sizes?: string;
src: string;
srcSet?: string;
width?: string;
}

const image: ImagePropsType = {
alt: "Example image",
width: "100%",
height: "250px",
objectFit: "cover",
src: "https://picsum.photos/id/11/1920/1080",
};

const paragraphContent = (
<DxcContainer maxWidth="500px">
<DxcParagraph>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sit amet nisi a neque scelerisque ultrices vitae
pellentesque nunc.
</DxcParagraph>
</DxcContainer>
);

const CardPreview = () => {
return (
<DxcFlex gap="var(--spacing-gap-ml)" wrap="wrap">
<DxcCard onClick={() => {}} image={image} selectable onSelectionChange={() => {}}>
{paragraphContent}
</DxcCard>
<DxcCard onClick={() => {}} image={image} selectable selected>
{paragraphContent}
</DxcCard>
<DxcCard onClick={() => {}} mode="outlined" image={image}>
{paragraphContent}
</DxcCard>
</DxcFlex>
);
};

export default CardPreview;
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { DxcChip, DxcFlex } from "@dxc-technology/halstack-react";
const ChipPreview = () => {
return (
<DxcFlex gap="var(--spacing-gap-ml)" wrap="wrap">
<DxcChip label="Task Completed" />
<DxcChip label="High Priority" prefix={{ icon: "priority_high", color: "primary" }} />
<DxcChip label="Archived" disabled />
<DxcChip prefix="palette" label="Art" selected={true} onClick={() => {}} />
<DxcChip prefix="palette" label="Art" selected={false} onClick={() => {}} />
<DxcChip mode="dismissible" label="Music" prefix="music_note" onClick={() => {}} />
</DxcFlex>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export { default as AvatarPreview } from "./AvatarPreview";
export { default as BadgePreview } from "./BadgePreview";
export { default as BreadcrumbsPreview } from "./BreadcrumbsPreview";
export { default as ButtonPreview } from "./ButtonPreview";
export { default as CardPreview } from "./CardPreview";
export { default as CheckboxPreview } from "./CheckboxPreview";
export { default as ChipPreview } from "./ChipPreview";
export { default as ContextualMenuPreview } from "./ContextualMenuPreview";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const componentsExceptions = [
"/components/application-layout",
"/components/bleed",
"/components/bulleted-list",
"/components/card",
"/components/container",
"/components/dialog",
"/components/flex",
Expand Down
Loading