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/container/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 ContainerCodePage from "screens/components/container/code/ContainerCodePage";
import ContainerPageLayout from "screens/components/container/ContainerPageLayout";

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

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

export default Code;
26 changes: 11 additions & 15 deletions apps/website/pages/components/container/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 ContainerCodePage from "screens/components/container/code/ContainerCodePage";
import ContainerOverviewPage from "screens/components/container/overview/ContainerOverviewPage";
import ContainerPageLayout from "screens/components/container/ContainerPageLayout";

const Usage = () => {
return (
<>
<Head>
<title>Container — Halstack Design System</title>
</Head>
<ContainerCodePage></ContainerCodePage>
</>
);
};
const Index = () => (
<>
<Head>
<title>Container — Halstack Design System</title>
</Head>
<ContainerOverviewPage />
</>
);

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

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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { ReactNode } from "react";

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

return (
Expand All @@ -16,11 +16,9 @@ const ContainerPageHeading = ({ children }: { children: ReactNode }) => {
<DxcFlex direction="column" gap="2rem">
<ComponentHeading name="Container" />
<DxcParagraph>
The container component represents the box model inside the Halstack Design System. Is a general-purpose
container that allows for controlled use of our design tokens. Being generic in nature can be "over-used",
so it's important to consider situations where more specific and expressive components could be used.
The container component represents the box model inside the Halstack Design System.
</DxcParagraph>
<TabsPageHeading tabs={tabs}></TabsPageHeading>
<TabsPageHeading tabs={tabs} />
</DxcFlex>
</PageHeading>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,13 @@ const sections = [
},
];

const ContainerCodePage = () => {
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/container/code/ContainerCodePage.tsx" />
</DxcFlex>
);
};
const ContainerCodePage = () => (
<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/container/code/ContainerCodePage.tsx" />
</DxcFlex>
);

export default ContainerCodePage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { DxcParagraph, DxcFlex, DxcBulletedList, DxcLink, DxcInset } from "@dxc-technology/halstack-react";
import DocFooter from "@/common/DocFooter";
import QuickNavContainer from "@/common/QuickNavContainer";
import QuickNavContainerLayout from "@/common/QuickNavContainerLayout";
import Link from "next/link";

const sections = [
{
title: "Introduction",
content: (
<>
<DxcParagraph>
The Halstack's container component provides a structured way to manage layout and spacing within the Halstack
Design System. It allows for controlled use of design tokens such as spacing, borders, and shadows, ensuring
consistency across the UI.
</DxcParagraph>
<DxcParagraph>
Being generic in nature, it can be overused, so it's important to consider situations where more specific and
expressive components could be used.
</DxcParagraph>
</>
),
},
{
title: "The box model",
content: (
<>
<DxcParagraph>
Everything in CSS has a box around it. Understanding these boxes is key to being able to create more complex
layouts for your application.
</DxcParagraph>
<DxcParagraph>
Below, we share a series of essential links to help you understand and use the container component correctly.
If you are not acquainted with these concepts, we strongly recommend taking a moment to review them:
</DxcParagraph>
<DxcBulletedList>
<DxcBulletedList.Item>
<DxcLink href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_box_model" newWindow>
MDN web docs: CSS box model
</DxcLink>
<DxcInset top="0.5rem" bottom="0.5rem">
<DxcBulletedList type="circle">
<DxcBulletedList.Item>
<DxcLink
href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Backgrounds_and_borders"
newWindow
>
Backgrounds and borders
</DxcLink>
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<DxcLink
href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Overflowing_content"
newWindow
>
Overflowing content
</DxcLink>
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<DxcLink
href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Sizing_items_in_CSS"
newWindow
>
Sizing items in CSS
</DxcLink>
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<DxcLink href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning" newWindow>
Positioning
</DxcLink>
</DxcBulletedList.Item>
</DxcBulletedList>
</DxcInset>
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<DxcLink href="https://web.dev/learn/css/box-model" newWindow>
Google web.dev: Box model
</DxcLink>
</DxcBulletedList.Item>
</DxcBulletedList>
</>
),
},
{
title: "Best practices",
content: (
<DxcBulletedList>
<DxcBulletedList.Item>
Use a container to group and organize related content within a specific section of a page or layout.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Set size, spacing, and margins that are consistent by applying the box model properties.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Control the depth of the different elements of your UI by customizing the container's box shadow.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Customize border styles of the container to match the rest of your interface design.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<strong>
Don't use the container to build components without first ensuring that there isn't a more specific,
semantic Halstack component that could be used instead.
</strong>
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<strong>
Don't use the container to create complex layouts when more suitable components are available.
</strong>{" "}
Use the{" "}
<Link href="/components/flex" passHref legacyBehavior>
<DxcLink>flex</DxcLink>
</Link>{" "}
and{" "}
<Link href="/components/grid" passHref legacyBehavior>
<DxcLink>grid</DxcLink>
</Link>{" "}
components to create those layouts.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
Whenever possible, <strong>try to use the design tokens</strong> provided by the Halstack Design System, even
though the component allows any value.
</DxcBulletedList.Item>
</DxcBulletedList>
),
},
];

const ContainerOverviewPage = () => (
<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/container/overview/ContainerOverviewPage.tsx" />
</DxcFlex>
);

export default ContainerOverviewPage;
135 changes: 0 additions & 135 deletions apps/website/screens/components/container/usage/ContainerUsagePage.tsx

This file was deleted.

Loading