-
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.
chore(example-text, blockquote): add docs (#4167)
- Loading branch information
Showing
14 changed files
with
638 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@twilio-paste/blockquote": minor | ||
"@twilio-paste/core": minor | ||
--- | ||
|
||
[Blockquote] add default bottom margin of space-70 to Blockquote, add marginBottom prop for the option to remove bottom margin when necessary. |
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
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,8 @@ | ||
{ | ||
"name": "@twilio-paste-core/blockquote", | ||
"version": "0.0.0", | ||
"private": true, | ||
"sideEffects": false, | ||
"main": "../dist/blockquote.js", | ||
"types": "../dist/blockquote.d.ts" | ||
} |
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
65 changes: 65 additions & 0 deletions
65
packages/paste-website/src/pages/components/blockquote/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,65 @@ | ||
import Changelog from '@twilio-paste/blockquote/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/blockquote/package.json'; | ||
|
||
import {SidebarCategoryRoutes} from '../../../constants'; | ||
import ComponentPageLayout from '../../../layouts/ComponentPageLayout'; | ||
import {getFeature, getNavigationData, getComponentApi} from '../../../utils/api'; | ||
|
||
export const meta = { | ||
title: 'Blockquote - Components', | ||
package: '@twilio-paste/blockquote', | ||
description: packageJson.description, | ||
slug: '/components/blockquote/api', | ||
}; | ||
|
||
export default ComponentPageLayout; | ||
|
||
export const getStaticProps = async () => { | ||
const navigationData = await getNavigationData(); | ||
const feature = await getFeature('Blockquote'); | ||
const {componentApi, componentApiTocData} = getComponentApi('@twilio-paste/blockquote'); | ||
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/blockquote', | ||
storybookUrl: '/?path=/story/components-blockquote--default', | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
## Installation | ||
|
||
```bash | ||
yarn add @twilio-paste/blockquote - or - yarn add @twilio-paste/core | ||
``` | ||
|
||
## Usage | ||
|
||
```jsx | ||
import { Blockquote, BlockquoteContent, BlockquoteCitation } from '@twilio-paste/core/blockquote'; | ||
|
||
const BlockquoteExample = () => { | ||
return ( | ||
<Blockquote url="#"> | ||
<BlockquoteContent> | ||
With AI-driven products, the design process is no longer just about aesthetics. It’s about designing for the | ||
human experience as a whole. | ||
</BlockquoteContent> | ||
<BlockquoteCitation author="Google" source="People + AI Guidebook" /> | ||
</Blockquote> | ||
); | ||
}; | ||
``` | ||
|
||
## Props | ||
|
||
<PropsTable componentApi={props.componentApi} /> |
36 changes: 36 additions & 0 deletions
36
packages/paste-website/src/pages/components/blockquote/changelog.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,36 @@ | ||
import {SidebarCategoryRoutes} from '../../../constants'; | ||
import Changelog from '@twilio-paste/blockquote/CHANGELOG.md'; | ||
import packageJson from '@twilio-paste/blockquote/package.json'; | ||
import ComponentPageLayout from '../../../layouts/ComponentPageLayout'; | ||
import {getFeature, getNavigationData} from '../../../utils/api'; | ||
|
||
export const meta = { | ||
title: 'Blockquote - Components', | ||
package: '@twilio-paste/blockquote', | ||
description: packageJson.description, | ||
slug: '/components/blockquote/changelog', | ||
}; | ||
|
||
export default ComponentPageLayout; | ||
|
||
export const getStaticProps = async () => { | ||
const navigationData = await getNavigationData(); | ||
const feature = await getFeature('Blockquote'); | ||
return { | ||
props: { | ||
data: { | ||
...packageJson, | ||
...feature, | ||
}, | ||
navigationData, | ||
mdxHeadings, | ||
pageHeaderData: { | ||
categoryRoute: SidebarCategoryRoutes.COMPONENTS, | ||
githubUrl: 'https://github.com/twilio-labs/paste/tree/main/packages/paste-core/components/blockquote', | ||
storybookUrl: '/?path=/story/components-blockquote--default', | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
<Changelog /> |
Oops, something went wrong.