-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/component-types-t-z
- Loading branch information
Showing
7 changed files
with
492 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
packages/paste-website/src/pages/components/progress-bar/api.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
export const meta = { | ||
title: 'Progress Bar - API', | ||
package: '@twilio-paste/progress-bar', | ||
description: 'A Progress Bar communicates the completion status of a process or task.', | ||
slug: '/components/progress-bar/api', | ||
}; | ||
|
||
import Changelog from '@twilio-paste/progress-bar/CHANGELOG.md'; // I don't know why this is needed but if you remove it the page fails to render | ||
import packageJson from '@twilio-paste/progress-bar/package.json'; | ||
|
||
import {SidebarCategoryRoutes} from '../../../constants'; | ||
import ComponentPageLayout from '../../../layouts/ComponentPageLayout'; | ||
import {getFeature, getNavigationData, getComponentApi} from '../../../utils/api'; | ||
|
||
export default ComponentPageLayout; | ||
|
||
export const getStaticProps = async () => { | ||
const navigationData = await getNavigationData(); | ||
const feature = await getFeature('Progress Bar'); | ||
const {componentApi, componentApiTocData} = getComponentApi('@twilio-paste/progress-bar'); | ||
return { | ||
props: { | ||
data: { | ||
...packageJson, | ||
...feature, | ||
}, | ||
componentApi, | ||
mdxHeadings: [...mdxHeadings, ...componentApiTocData], | ||
navigationData, | ||
pageHeaderData: { | ||
categoryRoute: SidebarCategoryRoutes.COMPONENTS, | ||
githubUrl: 'https://github.com/twilio-labs/paste/tree/main/packages/paste-core/components/progress-bar', | ||
storybookUrl: '/?path=/story/components-progressbar--default', | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
## Installation | ||
|
||
```bash | ||
yarn add @twilio-paste/progress-bar - or - yarn add @twilio-paste/core | ||
``` | ||
|
||
## Usage | ||
|
||
|
||
```jsx | ||
import {ProgressBar, ProgressBarLabel} from '@twilio-paste/core/progress-bar'; | ||
import {Box} from '@twilio-paste/core/box'; | ||
import {HelpText} from '@twilio-paste/core/help-text'; | ||
import {useUID} from '@twilio-paste/core/uid-library'; | ||
|
||
const AlertDialogExample = () => { | ||
const progressBarId = useUID(); | ||
const helpTextId = useUID(); | ||
|
||
return ( | ||
<Box> | ||
<ProgressBarLabel htmlFor={progressBarId}>Downloading more RAM</ProgressBarLabel> | ||
<ProgressBar id={progressBarId} aria-describedby={helpTextId} isIndeterminate /> | ||
<HelpText id={helpTextId}>Increasing your RAM helps your computer run faster.</HelpText> | ||
</Box> | ||
); | ||
}; | ||
``` | ||
|
||
## Props | ||
|
||
<PropsTable componentApi={props.componentApi} /> | ||
|
||
|
Oops, something went wrong.