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

const Code = () => {
return (
<>
<Head>
<title>Bleed Code — Halstack Design System</title>
</Head>
<BleedCodePage />
</>
);
};

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

export default Code;
8 changes: 3 additions & 5 deletions apps/website/pages/components/bleed/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import Head from "next/head";
import type { ReactElement } from "react";
import BleedPageLayout from "screens/components/bleed/BleedPageLayout";
import BleedCodePage from "screens/components/bleed/code/BleedCodePage";
import BleedOverviewPage from "screens/components/bleed/overview/BleedOverviewPage";

const Index = () => {
return (
<>
<Head>
<title>Bleed — Halstack Design System</title>
</Head>
<BleedCodePage></BleedCodePage>
<BleedOverviewPage />
</>
);
};

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

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

This file was deleted.

21 changes: 0 additions & 21 deletions apps/website/pages/components/bleed/usage.tsx

This file was deleted.

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

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

return (
Expand All @@ -17,7 +16,7 @@ const BleedPageHeading = ({ children }: { children: ReactNode }) => {
<DxcFlex direction="column" gap="2rem">
<ComponentHeading name="Bleed" />
<DxcParagraph>Bleed layout applies negative spacing scale to its child nodes.</DxcParagraph>
<TabsPageHeading tabs={tabs}></TabsPageHeading>
<TabsPageHeading tabs={tabs} />
</DxcFlex>
</PageHeading>
{children}
Expand Down
76 changes: 36 additions & 40 deletions apps/website/screens/components/bleed/code/BleedCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import basicUsage from "./examples/basicUsage";
import customSizes from "./examples/customSides";
import StatusBadge from "@/common/StatusBadge";

const coreSpacingTokensTypeString = `'0rem' | '0.125rem' | '0.25rem' | '0.5rem' | '0.75rem' | '1rem' | '1.5rem' | '2rem' | '2.5rem' | '3rem' | '3.5rem' | '4rem' | '5rem' | '6rem' | '7rem'`;

const sections = [
{
title: "Props",
Expand All @@ -22,72 +20,72 @@ const sections = [
<th>Default</th>
</tr>
<tr>
<td>space</td>
<td>bottom</td>
<td>
<TableCode>{coreSpacingTokensTypeString}</TableCode>
<TableCode>string</TableCode>
</td>
<td>Applies the spacing scale to all sides.</td>
<td>Applies the spacing scale to the bottom side.</td>
<td>-</td>
</tr>
<tr>
<td>horizontal</td>
<td>
<TableCode>{coreSpacingTokensTypeString}</TableCode>
<DxcFlex direction="column" gap="0.25rem" alignItems="baseline">
<StatusBadge status="required" />
children
</DxcFlex>
</td>
<td>Applies the spacing scale to the left and right sides.</td>
<td>
<TableCode>React.ReactNode</TableCode>
</td>
<td>Custom content inside the bleed.</td>
<td>-</td>
</tr>
<tr>
<td>vertical</td>
<td>horizontal</td>
<td>
<TableCode>{coreSpacingTokensTypeString}</TableCode>
<TableCode>string</TableCode>
</td>
<td>Applies the spacing scale to the top and bottom sides.</td>
<td>Applies the spacing scale to the left and right sides.</td>
<td>-</td>
</tr>
<tr>
<td>top</td>
<td>left</td>
<td>
<TableCode>{coreSpacingTokensTypeString}</TableCode>
<TableCode>string</TableCode>
</td>
<td>Applies the spacing scale to the top side.</td>
<td>Applies the spacing scale to the left side.</td>
<td>-</td>
</tr>
<tr>
<td>right</td>
<td>
<TableCode>{coreSpacingTokensTypeString}</TableCode>
<TableCode>string</TableCode>
</td>
<td>Applies the spacing scale to the right side.</td>
<td>-</td>
</tr>
<tr>
<td>bottom</td>
<td>space</td>
<td>
<TableCode>{coreSpacingTokensTypeString}</TableCode>
<TableCode>string</TableCode>
</td>
<td>Applies the spacing scale to the bottom side.</td>
<td>Applies the spacing scale to all sides.</td>
<td>-</td>
</tr>
<tr>
<td>left</td>
<td>top</td>
<td>
<TableCode>{coreSpacingTokensTypeString}</TableCode>
<TableCode>string</TableCode>
</td>
<td>Applies the spacing scale to the left side.</td>
<td>Applies the spacing scale to the top side.</td>
<td>-</td>
</tr>
<tr>
<td>vertical</td>
<td>
<DxcFlex direction="column" gap="0.25rem" alignItems="baseline">
<StatusBadge status="required" />
children
</DxcFlex>
</td>
<td>
<TableCode>React.ReactNode</TableCode>
<TableCode>string</TableCode>
</td>
<td>Custom content inside the bleed.</td>
<td>Applies the spacing scale to the top and bottom sides.</td>
<td>-</td>
</tr>
</DxcTable>
Expand All @@ -108,15 +106,13 @@ const sections = [
},
];

const BleedTableCodePage = () => {
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/bleed/TableCode/BleedTableCodePage.tsx" />
</DxcFlex>
);
};
const BleedCodePage = () => (
<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/bleed/code/BleedCodePage.tsx" />
</DxcFlex>
);

export default BleedTableCodePage;
export default BleedCodePage;
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Placeholder from "@/common/Placeholder";

const code = `() => {
return (
<DxcInset space="2rem">
<DxcFlex direction="column" gap="2rem">
<Placeholder height="50px" />
<DxcBleed space="1.5rem">
<Placeholder height="50px" />
<DxcInset space="var(--spacing-padding-xl)">
<DxcFlex direction="column" gap="var(--spacing-padding-xl)">
<Placeholder height="var(--height-xxl)" />
<DxcBleed space="var(--spacing-padding-l)">
<Placeholder height="var(--height-xxl)" />
</DxcBleed>
<Placeholder height="50px" />
<Placeholder height="var(--height-xxl)" />
</DxcFlex>
</DxcInset>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Placeholder from "@/common/Placeholder";

const code = `() => {
return (
<DxcInset space="2rem">
<DxcFlex direction="column" gap="2rem">
<Placeholder height="50px" />
<DxcBleed top="0.5rem" right="1rem" bottom="1.5rem" left="1.5rem">
<Placeholder height="50px" />
<DxcInset space="var(--spacing-padding-xl)">
<DxcFlex direction="column" gap="var(--spacing-padding-xl)">
<Placeholder height="var(--height-xxl)" />
<DxcBleed top="var(--spacing-padding-xs)" right="var(--spacing-padding-m)" bottom="var(--spacing-padding-l)" left="var(--spacing-padding-l)">
<Placeholder height="var(--height-xxl)" />
</DxcBleed>
<Placeholder height="50px" />
<Placeholder height="var(--height-xxl)" />
</DxcFlex>
</DxcInset>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { DxcBulletedList, DxcFlex, DxcLink, DxcParagraph } from "@dxc-technology/halstack-react";
import QuickNavContainerLayout from "@/common/QuickNavContainerLayout";
import QuickNavContainer from "@/common/QuickNavContainer";
import DocFooter from "@/common/DocFooter";
import Link from "next/link";

const sections = [
{
title: "Introduction",
content: (
<>
<DxcParagraph>
The bleed component is a container that applies negative margins around its content, allowing elements to
extend beyond their usual boundaries. This can be useful for aligning content seamlessly and creating dynamic,
edge-to-edge layouts. It provides customizable spacing options, offering greater design flexibility while
maintaining visual coherence.
</DxcParagraph>
</>
),
},
{
title: "Best practices",
content: (
<DxcBulletedList>
<DxcBulletedList.Item>
<strong>Enhance visual flow:</strong> use the bleed component to create smooth transitions between sections,
removing unwanted spacing restrictions.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<strong>Maintain balance and aesthetics:</strong> choose appropriate spacing values to ensure a
well-proportioned and visually appealing design.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<strong>Avoid unnecessary clutter:</strong> excessive use of the Inset component may lead to a fragmented or
overcrowded layout.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<strong>Ensure consistency with design tokens:</strong> whenever possible, use the design tokens provided by
the Halstack Design System, to maintain visual and functional consistency across applications, even though the
component allows custom values.
</DxcBulletedList.Item>
<DxcBulletedList.Item>
<strong>Combine with other layout techniques:</strong> use this component alongside{" "}
<Link href="/components/flex" passHref legacyBehavior>
<DxcLink>flex</DxcLink>
</Link>{" "}
and{" "}
<Link href="/components/grid" passHref legacyBehavior>
<DxcLink>grid</DxcLink>
</Link>{" "}
components to create consistent and semantic layouts.
</DxcBulletedList.Item>
</DxcBulletedList>
),
},
];

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

export default BleedOverviewPage;
36 changes: 0 additions & 36 deletions apps/website/screens/components/bleed/specs/BleedSpecsPage.tsx

This file was deleted.

Binary file not shown.
Loading