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/wizard/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 WizardPageLayout from "screens/components/wizard/WizardPageLayout";
import WizardCodePage from "screens/components/wizard/code/WizardCodePage";

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

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

export default Code;
24 changes: 10 additions & 14 deletions apps/website/pages/components/wizard/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 WizardPageLayout from "screens/components/wizard/WizardPageLayout";
import WizardCodePage from "screens/components/wizard/code/WizardCodePage";
import WizardOverviewPage from "screens/components/wizard/overview/WizardOverviewPage";

const Index = () => {
return (
<>
<Head>
<title>Wizard — Halstack Design System</title>
</Head>
<WizardCodePage></WizardCodePage>
</>
);
};
const Index = () => (
<>
<Head>
<title>Wizard — Halstack Design System</title>
</Head>
<WizardOverviewPage />
</>
);

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

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

This file was deleted.

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

This file was deleted.

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

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

return (
Expand All @@ -21,7 +20,7 @@ const WizardPageHeading = ({ children }: { children: ReactNode }) => {
with several bullet points where the user need to interact with the content of each step during the
workflow.
</DxcParagraph>
<TabsPageHeading tabs={tabs}></TabsPageHeading>
<TabsPageHeading tabs={tabs} />
</DxcFlex>
</PageHeading>
{children}
Expand Down
86 changes: 45 additions & 41 deletions apps/website/screens/components/wizard/code/WizardCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ import Example from "@/common/example/Example";
import controlled from "./examples/controlled";
import uncontrolled from "./examples/uncontrolled";
import icons from "./examples/icons";
import TableCode from "@/common/TableCode";
import TableCode, { ExtendedTableCode } from "@/common/TableCode";
import StatusBadge from "@/common/StatusBadge";

const stepsType = `{
label: string;
description?: string;
disabled?: boolean;
icon?: string |
(React.ReactNode &
React.SVGProps<SVGSVGElement>);
valid?: boolean;
}[]`;

const sections = [
{
title: "Props",
Expand All @@ -24,6 +34,17 @@ const sections = [
</tr>
</thead>
<tbody>
<tr>
<td>currentStep</td>
<td>
<TableCode>number</TableCode>
</td>
<td>
Defines which step is marked as the current. The numeration starts at 0. If undefined, the component will
be uncontrolled and the step will be managed internally by the component.
</td>
<td>-</td>
</tr>
<tr>
<td>defaultCurrentStep</td>
<td>
Expand All @@ -35,13 +56,13 @@ const sections = [
</td>
</tr>
<tr>
<td>currentStep</td>
<td>margin</td>
<td>
<TableCode>number</TableCode>
<TableCode>'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin</TableCode>
</td>
<td>
Defines which step is marked as the current. The numeration starts at 0. If undefined, the component will
be uncontrolled and the step will be managed internally by the component.
Size of the margin to be applied to the component. You can pass an object with 'top', 'bottom', 'left' and
'right' properties in order to specify different margin sizes.
</td>
<td>-</td>
</tr>
Expand All @@ -55,6 +76,16 @@ const sections = [
<TableCode>'horizontal'</TableCode>
</td>
</tr>
<tr>
<td>onStepClick</td>
<td>
<TableCode>{"(currentStep: number) => void"}</TableCode>
</td>
<td>
This function will be called when the user clicks a step. The step number will be passed as a parameter.
</td>
<td>-</td>
</tr>
<tr>
<td>
<DxcFlex direction="column" gap="0.25rem" alignItems="baseline">
Expand All @@ -63,11 +94,7 @@ const sections = [
</DxcFlex>
</td>
<td>
<TableCode>
{
"{ label: string; description?: string; icon?: string | (React.ReactNode & React.SVGProps <SVGSVGElement>); disabled?: boolean; valid?: boolean; }[]"
}
</TableCode>
<ExtendedTableCode>{stepsType}</ExtendedTableCode>
</td>
<td>
An array of objects representing the steps. Each of them has the following properties:
Expand Down Expand Up @@ -95,27 +122,6 @@ const sections = [
</td>
<td>-</td>
</tr>
<tr>
<td>onStepClick</td>
<td>
<TableCode>{"(currentStep: number) => void"}</TableCode>
</td>
<td>
This function will be called when the user clicks a step. The step number will be passed as a parameter.
</td>
<td>-</td>
</tr>
<tr>
<td>margin</td>
<td>
<TableCode>'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin</TableCode>
</td>
<td>
Size of the margin to be applied to the component. You can pass an object with 'top', 'bottom', 'left' and
'right' properties in order to specify different margin sizes.
</td>
<td>-</td>
</tr>
<tr>
<td>tabIndex</td>
<td>
Expand Down Expand Up @@ -151,15 +157,13 @@ const sections = [
},
];

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

export default WizardCodePage;
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const code = `() => {
},
{
label: "Policy",
valid: true,
valid: false,
},
{
label: "Payment",
Expand Down
Loading