-
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.
- Loading branch information
Showing
10 changed files
with
602 additions
and
3 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
Empty file.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
214 changes: 214 additions & 0 deletions
214
packages/paste-website/src/component-examples/PageHeaderExamples.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,214 @@ | ||
export const defaultPageHeaderExample = ` | ||
const PageHeaderExample = () => { | ||
return ( | ||
<PageHeader size="default"> | ||
<PageHeaderSetting> | ||
<Breadcrumb> | ||
<BreadcrumbItem href="#">Manage billing</BreadcrumbItem> | ||
</Breadcrumb> | ||
</PageHeaderSetting> | ||
<PageHeaderDetails> | ||
<PageHeaderKeyword> | ||
<Badge as="span" variant="new"> | ||
<NewIcon decorative /> | ||
Beta | ||
</Badge> | ||
</PageHeaderKeyword> | ||
<PageHeaderHeading>Subscriptions</PageHeaderHeading> | ||
<PageHeaderActions> | ||
<ButtonGroup> | ||
<Button variant="primary">Add a subscription <ArrowForwardIcon decorative /></Button> | ||
</ButtonGroup> | ||
</PageHeaderActions> | ||
<PageHeaderParagraph>Manage your subscriptions here. Costs listed here may exclude taxes, fees, support fees, expert services costs, and certain other products.</PageHeaderParagraph> | ||
</PageHeaderDetails> | ||
<PageHeaderInPageNavigation> | ||
<InPageNavigation aria-label="get started"> | ||
<InPageNavigationItem href="#" currentPage> | ||
Subscriptions | ||
</InPageNavigationItem> | ||
<InPageNavigationItem href="#">Recurring items</InPageNavigationItem> | ||
</InPageNavigation> | ||
</PageHeaderInPageNavigation> | ||
</PageHeader> | ||
); | ||
}; | ||
render( | ||
<PageHeaderExample /> | ||
) | ||
`.trim(); | ||
|
||
export const interruptedPageHeaderExample = ` | ||
const PageHeaderExample = () => { | ||
return ( | ||
<PageHeader size="default"> | ||
<PageHeaderSetting> | ||
<Anchor href="#" display="inline-flex" alignItems="center"><ArrowBackIcon decorative />Return to Flex</Anchor> | ||
</PageHeaderSetting> | ||
<PageHeaderDetails> | ||
<PageHeaderHeading>Getting started with Segment</PageHeaderHeading> | ||
<PageHeaderMeta><Anchor href="#">Download the help guide PDF</Anchor></PageHeaderMeta> | ||
</PageHeaderDetails> | ||
</PageHeader> | ||
); | ||
}; | ||
render( | ||
<PageHeaderExample /> | ||
) | ||
`.trim(); | ||
|
||
export const compactPageHeaderExample = ` | ||
const PageHeaderExample = () => { | ||
return ( | ||
<Box maxWidth="size50" borderStyle="solid" padding="space50" borderWidth="borderWidth10" borderColor="colorBorderDecorative10Weaker" borderRadius="borderRadius20"> | ||
<PageHeader size="compact"> | ||
<PageHeaderDetails> | ||
<PageHeaderPrefix><Avatar name="parker smith" size="sizeIcon100" icon={UserIcon} /></PageHeaderPrefix> | ||
<PageHeaderHeading>Parker Smith</PageHeaderHeading> | ||
<PageHeaderActions> | ||
<ButtonGroup> | ||
<Button variant="secondary" size="small">Edit</Button> | ||
<Button variant="secondary" size="small"><MoreIcon decorative={false} title="more menu" /></Button> | ||
</ButtonGroup> | ||
</PageHeaderActions> | ||
<PageHeaderMeta> | ||
Customer since June 11, 2009 | ||
<StatusBadge variant="ConnectivityAvailable"> | ||
Online | ||
</StatusBadge> | ||
</PageHeaderMeta> | ||
</PageHeaderDetails> | ||
<PageHeaderInPageNavigation> | ||
<InPageNavigation aria-label="get started"> | ||
<InPageNavigationItem href="#" currentPage> | ||
Customer details | ||
</InPageNavigationItem> | ||
<InPageNavigationItem href="#">Customer history</InPageNavigationItem> | ||
</InPageNavigation> | ||
</PageHeaderInPageNavigation> | ||
</PageHeader> | ||
</Box> | ||
); | ||
}; | ||
render( | ||
<PageHeaderExample /> | ||
) | ||
`.trim(); | ||
|
||
export const objectDetailsPageHeaderExample = ` | ||
const PageHeaderExample = () => { | ||
return ( | ||
<PageHeader size="default"> | ||
<PageHeaderSetting> | ||
<Breadcrumb> | ||
<BreadcrumbItem href="#">Voice</BreadcrumbItem> | ||
<BreadcrumbItem href="#">Calls</BreadcrumbItem> | ||
</Breadcrumb> | ||
</PageHeaderSetting> | ||
<PageHeaderDetails> | ||
<PageHeaderHeading>Call details</PageHeaderHeading> | ||
<PageHeaderActions> | ||
<Button variant="secondary">Give call quality feedback</Button> | ||
</PageHeaderActions> | ||
</PageHeaderDetails> | ||
<PageHeaderInPageNavigation> | ||
<InPageNavigation aria-label="get started"> | ||
<InPageNavigationItem href="#" currentPage> | ||
Overview | ||
</InPageNavigationItem> | ||
<InPageNavigationItem href="#">Insights summary</InPageNavigationItem> | ||
</InPageNavigation> | ||
</PageHeaderInPageNavigation> | ||
</PageHeader> | ||
); | ||
}; | ||
render( | ||
<PageHeaderExample /> | ||
) | ||
`.trim(); | ||
|
||
export const objectsListPageHeaderExample = ` | ||
const PageHeaderExample = () => { | ||
return ( | ||
<PageHeader size="default"> | ||
<PageHeaderSetting> | ||
<Breadcrumb> | ||
<BreadcrumbItem href="#">Phone numbers</BreadcrumbItem> | ||
<BreadcrumbItem href="#">Manage</BreadcrumbItem> | ||
</Breadcrumb> | ||
</PageHeaderSetting> | ||
<PageHeaderDetails> | ||
<PageHeaderHeading>Verified caller IDs</PageHeaderHeading> | ||
<PageHeaderActions> | ||
<Button variant="primary">Add caller ID</Button> | ||
</PageHeaderActions> | ||
<PageHeaderParagraph>Use numbers you own as caller ID or the "To" number for outbound calls and messages. Phone numbers you buy from Twilio or port to Twilio can always be used as caller IDs.</PageHeaderParagraph> | ||
</PageHeaderDetails> | ||
</PageHeader> | ||
); | ||
}; | ||
render( | ||
<PageHeaderExample /> | ||
) | ||
`.trim(); | ||
|
||
export const settingsPageHeaderExample = ` | ||
const PageHeaderExample = () => { | ||
return ( | ||
<PageHeader size="default"> | ||
<PageHeaderSetting> | ||
<Breadcrumb> | ||
<BreadcrumbItem href="#">Phone numbers</BreadcrumbItem> | ||
<BreadcrumbItem href="#">Manage</BreadcrumbItem> | ||
</Breadcrumb> | ||
</PageHeaderSetting> | ||
<PageHeaderDetails> | ||
<PageHeaderHeading>Billing settings</PageHeaderHeading> | ||
<PageHeaderParagraph>Use numbers you own as caller ID or the "To" number for outbound calls and messages. Phone numbers you buy from Twilio or port to Twilio can always be used as caller IDs.</PageHeaderParagraph> | ||
</PageHeaderDetails> | ||
<PageHeaderInPageNavigation> | ||
<InPageNavigation aria-label="get started"> | ||
<InPageNavigationItem href="#" currentPage> | ||
Invoicing | ||
</InPageNavigationItem> | ||
<InPageNavigationItem href="#">Service address</InPageNavigationItem> | ||
<InPageNavigationItem href="#">Tax information</InPageNavigationItem> | ||
</InPageNavigation> | ||
</PageHeaderInPageNavigation> | ||
</PageHeader> | ||
); | ||
}; | ||
render( | ||
<PageHeaderExample /> | ||
) | ||
`.trim(); | ||
|
||
export const wizardPageHeaderExample = ` | ||
const PageHeaderExample = () => { | ||
return ( | ||
<PageHeader size="default"> | ||
<PageHeaderSetting> | ||
<Breadcrumb> | ||
<BreadcrumbItem href="#">Breadcrumb</BreadcrumbItem> | ||
<BreadcrumbItem href="#">Breadcrumb</BreadcrumbItem> | ||
</Breadcrumb> | ||
<ProgressSteps> | ||
<ProgressStepComplete as="div">Select warehouse type</ProgressStepComplete> | ||
<ProgressStepSeparator /> | ||
<ProgressStepCurrent as="div">Connect warehouse</ProgressStepCurrent> | ||
<ProgressStepSeparator /> | ||
<ProgressStepIncomplete as="div">Set sync schedule</ProgressStepIncomplete> | ||
</ProgressSteps> | ||
</PageHeaderSetting> | ||
<PageHeaderDetails> | ||
<PageHeaderKeyword>Add warehouse</PageHeaderKeyword> | ||
<PageHeaderHeading>Connect Azure SQL data warehouse</PageHeaderHeading> | ||
<PageHeaderParagraph>Follow the steps below to start setting up Azure SQL data warehouse.</PageHeaderParagraph> | ||
</PageHeaderDetails> | ||
</PageHeader> | ||
); | ||
}; | ||
render( | ||
<PageHeaderExample /> | ||
) | ||
`.trim(); |
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
105 changes: 105 additions & 0 deletions
105
packages/paste-website/src/pages/components/page-header/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,105 @@ | ||
export const meta = { | ||
title: 'Page Header', | ||
package: '@twilio-paste/page-header', | ||
description: 'Page Header is a layout component that wraps all top-level components on a page.', | ||
slug: '/components/page-header/api', | ||
}; | ||
|
||
import Changelog from '@twilio-paste/page-header/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/page-header/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('Page header'); | ||
const {componentApi, componentApiTocData} = getComponentApi('@twilio-paste/page-header'); | ||
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/page-header', | ||
storybookUrl: '/?path=/story/components-page-header--default', | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
## Installation | ||
|
||
```bash | ||
yarn add @twilio-paste/page-header - or - yarn add @twilio-paste/core | ||
``` | ||
|
||
## Usage | ||
|
||
```jsx | ||
import { | ||
PageHeader, | ||
PageHeaderActions, | ||
PageHeaderDetails, | ||
PageHeaderHeading, | ||
PageHeaderInPageNavigation, | ||
PageHeaderKeyword, | ||
PageHeaderMeta, | ||
PageHeaderParagraph, | ||
PageHeaderPrefix, | ||
PageHeaderSetting, | ||
} from '@twilio-paste/core/page-header'; | ||
|
||
const MyPageHeader = () => { | ||
return ( | ||
<PageHeader size="default"> | ||
<PageHeaderSetting> | ||
<Breadcrumb> | ||
<BreadcrumbItem href="#">Breadcrumb</BreadcrumbItem> | ||
<BreadcrumbItem href="#">Breadcrumb</BreadcrumbItem> | ||
</Breadcrumb> | ||
</PageHeaderSetting> | ||
<PageHeaderDetails> | ||
<PageHeaderKeyword>Wizard title</PageHeaderKeyword> | ||
<PageHeaderPrefix> | ||
<Avatar size="sizeIcon90" name="Avatar Name" /> | ||
</PageHeaderPrefix> | ||
<PageHeaderHeading>Page title</PageHeaderHeading> | ||
<PageHeaderActions> | ||
<ButtonGroup> | ||
<Button variant="secondary">Action</Button> | ||
<Button variant="secondary">Action</Button> | ||
</ButtonGroup> | ||
</PageHeaderActions> | ||
<PageHeaderMeta> | ||
<Badge variant="success" as="span"> | ||
Badge | ||
</Badge> | ||
Meta | ||
<Anchor href="#">Meta</Anchor> | ||
</PageHeaderMeta> | ||
<PageHeaderParagraph>Paragraph text</PageHeaderParagraph> | ||
</PageHeaderDetails> | ||
<PageHeaderInPageNavigation> | ||
<InPageNavigation aria-label="get started"> | ||
<InPageNavigationItem href="#" currentPage> | ||
Label | ||
</InPageNavigationItem> | ||
<InPageNavigationItem href="#">Label</InPageNavigationItem> | ||
<InPageNavigationItem href="#">Label</InPageNavigationItem> | ||
</InPageNavigation> | ||
</PageHeaderInPageNavigation> | ||
</PageHeader> | ||
); | ||
}; | ||
``` | ||
## Props | ||
<PropsTable componentApi={props.componentApi} /> |
37 changes: 37 additions & 0 deletions
37
packages/paste-website/src/pages/components/page-header/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,37 @@ | ||
export const meta = { | ||
title: 'Page Header', | ||
package: '@twilio-paste/page-header', | ||
description: 'Page Header is a layout component that wraps all top-level components on a page.', | ||
slug: '/components/page-header/changelog', | ||
}; | ||
|
||
import Changelog from '@twilio-paste/page-header/CHANGELOG.md'; | ||
import packageJson from '@twilio-paste/page-header/package.json'; | ||
|
||
import {SidebarCategoryRoutes} from '../../../constants'; | ||
import ComponentPageLayout from '../../../layouts/ComponentPageLayout'; | ||
import {getFeature, getNavigationData} from '../../../utils/api'; | ||
|
||
export default ComponentPageLayout; | ||
|
||
export const getStaticProps = async () => { | ||
const navigationData = await getNavigationData(); | ||
const feature = await getFeature('Page header'); | ||
return { | ||
props: { | ||
data: { | ||
...packageJson, | ||
...feature, | ||
}, | ||
navigationData, | ||
mdxHeadings, | ||
pageHeaderData: { | ||
categoryRoute: SidebarCategoryRoutes.COMPONENTS, | ||
githubUrl: 'https://github.com/twilio-labs/paste/tree/main/packages/paste-core/components/page-header', | ||
storybookUrl: '/?path=/story/components-page-header--default', | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
<Changelog /> |
Oops, something went wrong.
569be77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
paste-remix – ./
remix.twilio.design
paste-remix-theta.vercel.app
paste-remix-twilio.vercel.app
paste-remix-git-main-twilio.vercel.app