-
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
11 changed files
with
407 additions
and
10 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,6 @@ | ||
--- | ||
"@twilio-paste/side-panel": patch | ||
"@twilio-paste/core": patch | ||
--- | ||
|
||
[Side Panel] Fix positioning of close button when no header actions are being used by adding justifyContent="space-between" |
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
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
84 changes: 84 additions & 0 deletions
84
packages/paste-website/src/pages/components/side-panel/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,84 @@ | ||
export const meta = { | ||
title: 'Side Panel - API', | ||
package: '@twilio-paste/side-panel', | ||
description: | ||
'Side Panel is a container that pushes the main page content when open.', | ||
slug: '/components/side-panel/api', | ||
}; | ||
|
||
import Changelog from '@twilio-paste/side-panel/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/side-panel/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('Side Panel'); | ||
const {componentApi, componentApiTocData} = getComponentApi('@twilio-paste/side-panel'); | ||
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/side-panel', | ||
storybookUrl: '/?path=/story/components-side-panel--default', | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
## Installation | ||
|
||
```bash | ||
yarn add @twilio-paste/side-panel - or - yarn add @twilio-paste/core | ||
``` | ||
|
||
## Usage | ||
|
||
```jsx | ||
import { | ||
SidePanelContainer, | ||
SidePanel, | ||
SidePanelHeader, | ||
SidePanelHeaderActions, | ||
SidePanelBody, | ||
SidePanelPushContentWrapper, | ||
SidePanelButton, | ||
} from '@twilio-paste/core/side-panel'; | ||
|
||
const SideModalExample: React.FC = () => { | ||
const [isOpen, setIsOpen] = React.useState(true); | ||
return ( | ||
<SidePanelContainer isOpen={isOpen} setIsOpen={setIsOpen}> | ||
<SidePanel> | ||
<SidePanelHeader> | ||
Heading goes here. | ||
<SidePanelHeaderActions> | ||
Actions go here. | ||
</SidePanelHeaderActions> | ||
</SidePanelHeader> | ||
<SidePanelBody> | ||
Side Panel content goes here. | ||
</SidePanelBody> | ||
</SidePanel> | ||
<SidePanelPushContentWrapper> | ||
<SidePanelButton variant="secondary">Toggle Side Panel</SidePanelButton> | ||
</SidePanelPushContentWrapper> | ||
</SidePanelContainer> | ||
); | ||
}; | ||
``` | ||
|
||
## Props | ||
|
||
<PropsTable componentApi={props.componentApi} /> |
38 changes: 38 additions & 0 deletions
38
packages/paste-website/src/pages/components/side-panel/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,38 @@ | ||
export const meta = { | ||
title: 'Side Panel - Changelog', | ||
package: '@twilio-paste/side-panel', | ||
description: | ||
'Side Panel is a container that pushes the main page content when open.', | ||
slug: '/components/side-panel/changelog', | ||
}; | ||
|
||
import Changelog from '@twilio-paste/side-panel/CHANGELOG.md'; | ||
import packageJson from '@twilio-paste/side-panel/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('Side Panel'); | ||
return { | ||
props: { | ||
data: { | ||
...packageJson, | ||
...feature, | ||
}, | ||
navigationData, | ||
mdxHeadings, | ||
pageHeaderData: { | ||
categoryRoute: SidebarCategoryRoutes.COMPONENTS, | ||
githubUrl: 'https://github.com/twilio-labs/paste/tree/main/packages/paste-core/components/side-panel', | ||
storybookUrl: '/?path=/story/components-side-panel--default', | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
<Changelog /> |
Oops, something went wrong.