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/spinner/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 SpinnerCodePage from "screens/components/spinner/code/SpinnerCodePage";
import SpinnerPageLayout from "screens/components/spinner/SpinnerPageLayout";

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

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

export default Code;
24 changes: 10 additions & 14 deletions apps/website/pages/components/spinner/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 SpinnerCodePage from "screens/components/spinner/code/SpinnerCodePage";
import SpinnerOverviewPage from "screens/components/spinner/overview/SpinnerOverviewPage";
import SpinnerPageLayout from "screens/components/spinner/SpinnerPageLayout";

const Index = () => {
return (
<>
<Head>
<title>Spinner — Halstack Design System</title>
</Head>
<SpinnerCodePage></SpinnerCodePage>
</>
);
};
const Index = () => (
<>
<Head>
<title>Spinner — Halstack Design System</title>
</Head>
<SpinnerOverviewPage />
</>
);

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

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

This file was deleted.

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

This file was deleted.

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

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

return (
Expand All @@ -17,9 +16,9 @@ const SpinnerPageHeading = ({ children }: { children: ReactNode }) => {
<DxcFlex direction="column" gap="2rem">
<ComponentHeading name="Spinner" />
<DxcParagraph>
Loading spinner is a waiting indicator in the user interface to communicate users an ongoing proccess.
Loading spinner is a waiting indicator in the user interface to communicate users an ongoing process.
</DxcParagraph>
<TabsPageHeading tabs={tabs}></TabsPageHeading>
<TabsPageHeading tabs={tabs} />
</DxcFlex>
</PageHeading>
{children}
Expand Down
70 changes: 35 additions & 35 deletions apps/website/screens/components/spinner/code/SpinnerCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ const sections = [
</tr>
</thead>
<tbody>
<tr>
<td>ariaLabel</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
Specifies a string to be used as the accessible name for the component when no <Code>label</Code> is
provided or the <Code>mode</Code> is set to small.
</td>
<td>
<TableCode>'Spinner'</TableCode>
</td>
</tr>
<tr>
<td>label</td>
<td>
Expand All @@ -34,25 +47,25 @@ const sections = [
<td>-</td>
</tr>
<tr>
<td>mode</td>
<td>margin</td>
<td>
<TableCode>'large' | 'small' | 'overlay' </TableCode>
<TableCode>'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin</TableCode>
</td>
<td>The different variants of the components.</td>
<td>
<TableCode>'large'</TableCode>
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>value</td>
<td>mode</td>
<td>
<TableCode>number</TableCode>
<TableCode>'large' | 'small' | 'overlay' </TableCode>
</td>
<td>The different variants of the components.</td>
<td>
The value of the progress indicator. If it's received the component is determinate, otherwise is
indeterminate.
<TableCode>'large'</TableCode>
</td>
<td>-</td>
</tr>
<tr>
<td>showValue</td>
Expand All @@ -65,27 +78,16 @@ const sections = [
</td>
</tr>
<tr>
<td>margin</td>
<td>value</td>
<td>
<TableCode>'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin</TableCode>
<TableCode>number</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.
The value of the progress indicator. If it's received the component is determinate, otherwise is
indeterminate.
</td>
<td>-</td>
</tr>
<tr>
<td>ariaLabel</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
Specifies a string to be used as the name for the spinner element when no `label` is provided or the
`mode` is set to small.
</td>
<td>'Spinner'</td>
</tr>
</tbody>
</DxcTable>
),
Expand All @@ -105,15 +107,13 @@ const sections = [
},
];

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

export default SpinnerUsagePage;
export default SpinnerCodePage;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DxcSpinner, DxcInset } from "@dxc-technology/halstack-react";
const code = `() => {
return (
<DxcInset space="2rem">
<DxcSpinner />
<DxcSpinner label="Loading..." />
</DxcInset>
);
}`;
Expand Down
Loading