-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(patterns): add documentation for Page component (#1529)
* docs(patterns): add documentation for Page component * docs(patterns): add Page with Message sample * docs(patterns): add side nav link and changeset * docs(patterns): fix background props formatting
- Loading branch information
Showing
5 changed files
with
447 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@bigcommerce/docs': patch | ||
--- | ||
|
||
Added Page pattern component documentation |
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,106 @@ | ||
import React from 'react'; | ||
|
||
import { Code, NextLink, Prop, PropTable, PropTableWrapper } from '../components'; | ||
|
||
const pageProps: Prop[] = [ | ||
{ | ||
name: 'header', | ||
types: <NextLink href="/header">Header</NextLink>, | ||
description: ( | ||
<> | ||
Pass in an optional <NextLink href="/header">Header</NextLink> component for displaying the | ||
page title and description. | ||
</> | ||
), | ||
}, | ||
{ | ||
name: 'message', | ||
types: <NextLink href="/message?props=inline-message">MessageProps</NextLink>, | ||
description: ( | ||
<> | ||
An optional <Code primary>Message</Code> component for displaying alerts or notifications. | ||
</> | ||
), | ||
}, | ||
{ | ||
name: 'background', | ||
types: ( | ||
<NextLink href={{ hash: 'props', query: { props: 'background-props' } }}>Background</NextLink> | ||
), | ||
description: 'The background settings for the page, determining background color or image.', | ||
}, | ||
{ | ||
name: 'actionBar', | ||
types: <NextLink href="/action-bar">ActionBar</NextLink>, | ||
description: ( | ||
<> | ||
Pass in an optional <NextLink href="/action-bar">ActionBar</NextLink> component for | ||
displaying action buttons at the bottom. | ||
</> | ||
), | ||
}, | ||
]; | ||
|
||
export const PagePropsTable: React.FC<PropTableWrapper> = (props) => ( | ||
<PropTable propList={pageProps} title="Page" {...props} /> | ||
); | ||
|
||
const backgroundProps: Prop[] = [ | ||
{ | ||
name: 'src', | ||
types: 'string', | ||
description: 'The URL of the background image.', | ||
required: true, | ||
}, | ||
{ | ||
name: 'backgroundSize', | ||
types: ['auto', 'length', 'cover', 'contain', 'initial', 'inherit'], | ||
defaultValue: 'contain', | ||
description: ( | ||
<> | ||
Defines the size of the background image. Same as the{' '} | ||
<Code highlight={false}>background-size</Code> CSS property. | ||
</> | ||
), | ||
}, | ||
{ | ||
name: 'backgroundPosition', | ||
types: [ | ||
'left top', | ||
'left center', | ||
'left bottom', | ||
'right top', | ||
'right center', | ||
'right bottom', | ||
'center top', | ||
'center center', | ||
'center bottom', | ||
'x% y%', | ||
'x-pos y-pos', | ||
'initial', | ||
'inherit', | ||
], | ||
defaultValue: 'top right', | ||
description: ( | ||
<> | ||
Sets the position of the background image. Same as the{' '} | ||
<Code highlight={false}>background-position</Code> CSS property. | ||
</> | ||
), | ||
}, | ||
{ | ||
name: 'backgroundRepeat', | ||
defaultValue: 'no-repeat', | ||
types: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'initial', 'inherit'], | ||
description: ( | ||
<> | ||
Specifies if/how the background image repeats. Same as the{' '} | ||
<Code highlight={false}>background-repeat</Code> CSS property. | ||
</> | ||
), | ||
}, | ||
]; | ||
|
||
export const BackgroundPropsTable: React.FC<PropTableWrapper> = (props) => ( | ||
<PropTable propList={backgroundProps} title="Page[Background]" {...props} /> | ||
); |
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
Oops, something went wrong.