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
17 changes: 17 additions & 0 deletions apps/website/pages/components/image/code.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Head from "next/head";
import type { ReactElement } from "react";
import ImageCodePage from "screens/components/image/code/ImageCodePage";
import ImagePageLayout from "screens/components/image/ImagePageLayout";

const Code = () => (
<>
<Head>
<title>Image code — Halstack Design System</title>
</Head>
<ImageCodePage />
</>
);

Code.getLayout = (page: ReactElement) => <ImagePageLayout>{page}</ImagePageLayout>;

export default Code;
24 changes: 10 additions & 14 deletions apps/website/pages/components/image/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import Head from "next/head";
import type { ReactElement } from "react";
import ImagePageLayout from "screens/components/image/ImagePageLayout";
import ImageCodePage from "screens/components/image/code/ImageCodePage";
import ImageOverviewPage from "screens/components/image/overview/ImageOverviewPage";

const Index = () => {
return (
<>
<Head>
<title>Image — Halstack Design System</title>
</Head>
<ImageCodePage></ImageCodePage>
</>
);
};
const Index = () => (
<>
<Head>
<title>Image — Halstack Design System</title>
</Head>
<ImageOverviewPage />
</>
);

Index.getLayout = function getLayout(page: ReactElement) {
return <ImagePageLayout>{page}</ImagePageLayout>;
};
Index.getLayout = (page: ReactElement) => <ImagePageLayout>{page}</ImagePageLayout>;

export default Index;
21 changes: 0 additions & 21 deletions apps/website/pages/components/image/usage.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions apps/website/screens/components/image/ImagePageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import { ReactNode } from "react";

const ImagePageHeading = ({ children }: { children: ReactNode }) => {
const tabs = [
{ label: "Code", path: "/components/image" },
{ label: "Usage", path: "/components/image/usage" },
{ label: "Overview", path: "/components/image" },
{ label: "Code", path: "/components/image/code" },
];

return (
<DxcFlex direction="column" gap="3rem">
<PageHeading>
<DxcFlex direction="column" gap="2rem">
<ComponentHeading name="Image" />
<DxcParagraph>The Image component is used to embed images in Halstack-based user interfaces.</DxcParagraph>
<TabsPageHeading tabs={tabs}></TabsPageHeading>
<DxcParagraph>The image component is used to embed images in Halstack-based user interfaces.</DxcParagraph>
<TabsPageHeading tabs={tabs} />
</DxcFlex>
</PageHeading>
{children}
Expand Down
120 changes: 59 additions & 61 deletions apps/website/screens/components/image/code/ImageCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ const sections = [
</td>
<td>-</td>
</tr>
<tr>
<td>height</td>
<td>
<TableCode>string</TableCode>
</td>
<td>Sets the rendered height of the image.</td>
<td>-</td>
</tr>
<tr>
<td>lazyLoading</td>
<td>
Expand All @@ -67,110 +75,102 @@ const sections = [
</td>
</tr>
<tr>
<td>objectFit</td>
<td>
<DxcFlex direction="column" gap="0.25rem" alignItems="baseline">
<StatusBadge status="required" />
src
</DxcFlex>
</td>
<td>
<TableCode>string</TableCode>
</td>
<td>URL of the image.</td>
<td>-</td>
</tr>
<tr>
<td>srcSet</td>
<td>
<TableCode>string</TableCode>
<TableCode>'contain' | 'cover' | 'fill' | 'none' | 'scale-down'</TableCode>
</td>
<td>
List of one or more strings separated by commas indicating a set of possible images for the user agent to
use. See{" "}
<DxcLink newWindow href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset">
Sets the <Code>object-fit</Code> CSS property. See{" "}
<DxcLink newWindow href="https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit">
MDN
</DxcLink>{" "}
for further information.
</td>
<td>-</td>
<td>
<TableCode>'fill'</TableCode>
</td>
</tr>
<tr>
<td>sizes</td>
<td>objectPosition</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
One or more strings separated by commas, indicating a set of source sizes. If the <Code>srcSet</Code>{" "}
attribute is absent or contains no values with a width descriptor, then this attribute has no effect. See{" "}
<DxcLink newWindow href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes">
Sets the <Code>object-position</Code> CSS property. See{" "}
<DxcLink newWindow href="https://developer.mozilla.org/en-US/docs/Web/CSS/object-position">
MDN
</DxcLink>{" "}
for further information.
</td>
<td>-</td>
<td>
<TableCode>'50% 50%'</TableCode>
</td>
</tr>
<tr>
<td>width</td>
<td>onError</td>
<td>
<TableCode>string</TableCode>
<TableCode>{"React.ReactEventHandler <HTMLImageElement>"}</TableCode>
</td>
<td>Sets the rendered width of the image.</td>
<td>This function will be called when the image fails to load.</td>
<td>-</td>
</tr>
<tr>
<td>height</td>
<td>onLoad</td>
<td>
<TableCode>string</TableCode>
<TableCode>{"React.ReactEventHandler <HTMLImageElement>"}</TableCode>
</td>
<td>Sets the rendered height of the image.</td>
<td>This function will be called when the image is loaded.</td>
<td>-</td>
</tr>
<tr>
<td>objectFit</td>
<td>sizes</td>
<td>
<TableCode>'contain' | 'cover' | 'fill' | 'none' | 'scale-down'</TableCode>
<TableCode>string</TableCode>
</td>
<td>
Sets the <Code>object-fit</Code> CSS property. See{" "}
<DxcLink newWindow href="https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit">
One or more strings separated by commas, indicating a set of source sizes. If the <Code>srcSet</Code>{" "}
attribute is absent or contains no values with a width descriptor, then this attribute has no effect. See{" "}
<DxcLink newWindow href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes">
MDN
</DxcLink>{" "}
for further information.
</td>
<td>-</td>
</tr>
<tr>
<td>
<TableCode>'fill'</TableCode>
<DxcFlex direction="column" gap="0.25rem" alignItems="baseline">
<StatusBadge status="required" />
src
</DxcFlex>
</td>
<td>
<TableCode>string</TableCode>
</td>
<td>URL of the image.</td>
<td>-</td>
</tr>
<tr>
<td>objectPosition</td>
<td>srcSet</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
Sets the <Code>object-position</Code> CSS property. See{" "}
<DxcLink newWindow href="https://developer.mozilla.org/en-US/docs/Web/CSS/object-position">
List of one or more strings separated by commas indicating a set of possible images for the user agent to
use. See{" "}
<DxcLink newWindow href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset">
MDN
</DxcLink>{" "}
for further information.
</td>
<td>
<TableCode>'50% 50%'</TableCode>
</td>
</tr>
<tr>
<td>onLoad</td>
<td>
<TableCode>{"React.ReactEventHandler <HTMLImageElement>"}</TableCode>
</td>
<td>This function will be called when the image is loaded.</td>
<td>-</td>
</tr>
<tr>
<td>onError</td>
<td>width</td>
<td>
<TableCode>{"React.ReactEventHandler <HTMLImageElement>"}</TableCode>
<TableCode>string</TableCode>
</td>
<td>This function will be called when the image fails to load.</td>
<td>Sets the rendered width of the image.</td>
<td>-</td>
</tr>
</DxcTable>
Expand All @@ -187,15 +187,13 @@ const sections = [
},
];

const ImageCodePage = () => {
return (
<DxcFlex direction="column" gap="4rem">
<QuickNavContainerLayout>
<QuickNavContainer sections={sections} startHeadingLevel={2}></QuickNavContainer>
</QuickNavContainerLayout>
<DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/apps/website/screens/components/image/code/ImageCodePage.tsx" />
</DxcFlex>
);
};
const ImageCodePage = () => (
<DxcFlex direction="column" gap="4rem">
<QuickNavContainerLayout>
<QuickNavContainer sections={sections} startHeadingLevel={2} />
</QuickNavContainerLayout>
<DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/apps/website/screens/components/image/code/ImageCodePage.tsx" />
</DxcFlex>
);

export default ImageCodePage;
Loading