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/badge/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 BadgePageLayout from "screens/components/badge/BadgePageLayout";
import BadgeCodePage from "screens/components/badge/code/BadgeCodePage";

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

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

export default Code;
8 changes: 3 additions & 5 deletions apps/website/pages/components/badge/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 BadgePageLayout from "screens/components/badge/BadgePageLayout";
import BadgeCodePage from "screens/components/badge/code/BadgeCodePage";
import BadgeOverviewPage from "screens/components/badge/overview/BadgeOverviewPage";

const Index = () => {
return (
<>
<Head>
<title>Badge — Halstack Design System</title>
</Head>
<BadgeCodePage></BadgeCodePage>
<BadgeOverviewPage />
</>
);
};

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

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

This file was deleted.

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

This file was deleted.

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

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

return (
Expand All @@ -21,7 +20,7 @@ const BadgePageHeading = ({ children }: { children: ReactNode }) => {
It offers a quick overview of a category or status and is frequently used to display numerical or status
data.
</DxcParagraph>
<TabsPageHeading tabs={tabs}></TabsPageHeading>
<TabsPageHeading tabs={tabs} />
</DxcFlex>
</PageHeading>
{children}
Expand Down
78 changes: 39 additions & 39 deletions apps/website/screens/components/badge/code/BadgeCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ const sections = [
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td>color</td>
<td>
<TableCode>'grey' | 'blue' | 'green' | 'orange' | 'red' | 'yellow' | 'purple'</TableCode>
</td>
<td>Affects the visual style of the badge. It can be used following semantic purposes or not.</td>
<td>
<TableCode>'grey'</TableCode>
</td>
</tr>
<tr>
<td>icon</td>
<td>
<TableCode>string | {"(React.ReactNode & React.SVGProps <SVGSVGElement>)"}</TableCode>
</td>
<td>
<DxcLink newWindow href="https://fonts.google.com/icons">
Material Symbol
</DxcLink>{" "}
name or SVG element as the icon that will be placed next to the badge label. When using Material Symbols,
replace spaces with underscores. By default they are outlined, if you want it to be filled prefix the symbol
name with <TableCode>"filled_"</TableCode>.
</td>
<td>-</td>
</tr>
<tr>
<td>label</td>
<td>
Expand Down Expand Up @@ -51,51 +76,26 @@ const sections = [
</td>
</tr>
<tr>
<td>title</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
Text representing advisory information related to the badge. Under the hood, this prop also serves as an
accessible label for the component.
</td>
<td>-</td>
</tr>
<tr>
<td>color</td>
<td>size</td>
<td>
<TableCode>'grey' | 'blue' | 'green' | 'orange' | 'red' | 'yellow' | 'purple'</TableCode>
<TableCode>'small' | 'medium' | 'large'</TableCode>
</td>
<td>Affects the visual style of the badge. It can be used following semantic purposes or not.</td>
<td>Size of the component.</td>
<td>
<TableCode>'grey'</TableCode>
<TableCode>'medium'</TableCode>
</td>
</tr>
<tr>
<td>icon</td>
<td>title</td>
<td>
<TableCode>string | {"(React.ReactNode & React.SVGProps <SVGSVGElement>)"}</TableCode>
<TableCode>string</TableCode>
</td>
<td>
<DxcLink newWindow href="https://fonts.google.com/icons">
Material Symbol
</DxcLink>{" "}
name or SVG element as the icon that will be placed next to the badge label. When using Material Symbols,
replace spaces with underscores. By default they are outlined, if you want it to be filled prefix the symbol
name with <TableCode>"filled_"</TableCode>.
Text representing advisory information related to the badge. Under the hood, this prop also serves as an
accessible label for the component.
</td>
<td>-</td>
</tr>
<tr>
<td>size</td>
<td>
<TableCode>'small' | 'medium' | 'large'</TableCode>
</td>
<td>Size of the component.</td>
<td>
<TableCode>'medium'</TableCode>
</td>
</tr>
</DxcTable>
),
},
Expand All @@ -106,19 +106,19 @@ const sections = [
title: "Contextual",
content: <Example example={contextual} defaultIsVisible />,
},
{
title: "Notification",
content: <Example example={notification} defaultIsVisible />,
},
{
title: "Icons",
content: <Example example={icons} defaultIsVisible />,
},
{
title: "Notification",
content: <Example example={notification} defaultIsVisible />,
},
],
},
];

const BadgeTableCodePage = () => {
const BadgeCodePage = () => {
return (
<DxcFlex direction="column" gap="4rem">
<QuickNavContainerLayout>
Expand All @@ -129,4 +129,4 @@ const BadgeTableCodePage = () => {
);
};

export default BadgeTableCodePage;
export default BadgeCodePage;
Loading