Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): update pogress circle page to use new layout #728

Merged
merged 1 commit into from
Feb 22, 2022
Merged
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
130 changes: 87 additions & 43 deletions packages/docs/pages/progress-circle.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,99 @@
import { H1, Panel, ProgressCircle, Text } from '@bigcommerce/big-design';
import React from 'react';
import React, { Fragment } from 'react';

import { Code, CodePreview, PageNavigation } from '../components';
import { Code, CodePreview, ContentRoutingTabs, GuidelinesTable, List } from '../components';
import { ProgressCirclePropTable } from '../PropTables';

const ProgressCirclePage = () => {
const items = [
{
id: 'examples',
title: 'Examples',
render: () => (
<>
<Panel header="Determinant">
<Text>
Determinant Progress represents a known amount of time or completeness for a task. A{' '}
<Code primary>percent</Code> prop needs to be passed to render a determinate progress.
</Text>

<CodePreview>
{/* jsx-to-string:start */}
<ProgressCircle error={false} percent={50} size="large" />
{/* jsx-to-string:end */}
</CodePreview>
</Panel>
<Panel header="Indeterminant">
<Text>
Indeterminant Progress represents an unknown amount of time for a task to complete. Component will render
an indeterminant progress when missing a <Code primary>percent</Code> prop.
</Text>

<CodePreview>
{/* jsx-to-string:start */}
<ProgressCircle size="large" />
{/* jsx-to-string:end */}
</CodePreview>
</Panel>
</>
),
},
{
id: 'props',
title: 'Props',
render: () => <ProgressCirclePropTable />,
},
];

return (
<>
<H1>ProgressCircle</H1>

<PageNavigation items={items} />
<Panel header="Overview" headerId="overview">
<Text>
Progress indicators give the user system visibility when a front end action triggers a need from the back end.
</Text>
<Text bold>When to use:</Text>
<List>
<List.Item>Progress indicators can be combined with additional status feedback.</List.Item>
<List.Item>Use when there is a greater than one second waiting time.</List.Item>
</List>

<Text>Loader</Text>
<List>
<List.Item>
Use when there is indeterminant progress, where there is an unknown amount of time for a task to complete.
</List.Item>
</List>

<Text>Circular progress</Text>
<List>
<List.Item>
Use when there is determinant progress, where there is a known amount of time for a task to complete.
</List.Item>
</List>
</Panel>

<Panel header="Implementation" headerId="implementation">
<ContentRoutingTabs
id="implementation"
routes={[
{
id: 'determinant',
title: 'Determinant',
render: () => (
<Fragment key="determinant">
<Text>
Determinant Progress represents a known amount of time or completeness for a task. A{' '}
<Code primary>percent</Code> prop needs to be passed to render a determinate progress.
</Text>

<CodePreview>
{/* jsx-to-string:start */}
<ProgressCircle error={false} percent={50} size="large" />
{/* jsx-to-string:end */}
</CodePreview>
</Fragment>
),
},
{
id: 'indeterminant',
title: 'Indeterminant',
render: () => (
<Fragment key="indeterminant">
<Text>
Indeterminant Progress represents an unknown amount of time for a task to complete. Component will
render an indeterminant progress when missing a <Code primary>percent</Code> prop.
</Text>

<CodePreview>
{/* jsx-to-string:start */}
<ProgressCircle size="large" />
{/* jsx-to-string:end */}
</CodePreview>
</Fragment>
),
},
]}
/>
</Panel>

<Panel header="Props" headerId="pros">
<ProgressCirclePropTable renderPanel={false} />
</Panel>

<Panel header="Do's and Don'ts" headerId="guidelines">
<GuidelinesTable
recommended={[
<>Status feedback should be clear and direct. Limit verbiage and information.</>,
<>If progress is determinate, use a percentage to reflect the completeness of the action.</>,
]}
discouraged={[
<>Don’t use if an action is not triggering a back end action.</>,
<>Don’t use to indicate the completeness of a user-dependent task.</>,
]}
/>
</Panel>
</>
);
};
Expand Down