diff --git a/CHANGELOG.md b/CHANGELOG.md index 844f1bff70..8491cd3687 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Add Button `disabled` prop @Bugaa92 ([#14](https://github.com/stardust-ui/react/pull/14)) - Add Label `icon`, `onIconClick` and `iconPosition` props @mnajdova ([#19](https://github.com/stardust-ui/react/pull/19)) - Add Menu `vertical` prop @miroslavstastny ([#21](https://github.com/stardust-ui/react/pull/21)) +- Add Menu support for `shape="pills" vertical` @miroslavstastny ([#36](https://github.com/stardust-ui/react/pull/36)) ### Documentation - Improve UX for "knobs" form on component examples @levithomason ([#20](https://github.com/stardust-ui/react/pull/20)) diff --git a/docs/src/examples/components/Menu/Variations/MenuExamplePillsPrimaryVertical.shorthand.tsx b/docs/src/examples/components/Menu/Variations/MenuExamplePillsPrimaryVertical.shorthand.tsx new file mode 100644 index 0000000000..3877ea0fe7 --- /dev/null +++ b/docs/src/examples/components/Menu/Variations/MenuExamplePillsPrimaryVertical.shorthand.tsx @@ -0,0 +1,16 @@ +import React from 'react' +import { Menu } from '@stardust-ui/react' + +const items = [ + { key: 'editorials', content: 'Editorials' }, + { key: 'review', content: 'Reviews' }, + { key: 'events', content: 'Upcoming Events' }, +] + +class MenuExamplePillsPrimaryVerticalShorthand extends React.Component { + render() { + return
+ } +} + +export default MenuExamplePillsPrimaryVerticalShorthand diff --git a/docs/src/examples/components/Menu/Variations/MenuExamplePillsPrimaryVertical.tsx b/docs/src/examples/components/Menu/Variations/MenuExamplePillsPrimaryVertical.tsx new file mode 100644 index 0000000000..f9de7c5a25 --- /dev/null +++ b/docs/src/examples/components/Menu/Variations/MenuExamplePillsPrimaryVertical.tsx @@ -0,0 +1,40 @@ +import React from 'react' +import _ from 'lodash' +import { Menu, MenuItem } from '@stardust-ui/react' + +const items = [ + { key: 'editorials', content: 'Editorials' }, + { key: 'review', content: 'Reviews' }, + { key: 'events', content: 'Upcoming Events' }, +] + +class MenuExamplePillsPrimaryVertical extends React.Component { + state = { activeIndex: 0 } + + handleItemClick = activeIndex => () => { + this.setState({ activeIndex }) + } + + render() { + const { activeIndex } = this.state + return ( + + ) + } +} + +export default MenuExamplePillsPrimaryVertical diff --git a/docs/src/examples/components/Menu/Variations/MenuExamplePillsVertical.shorthand.tsx b/docs/src/examples/components/Menu/Variations/MenuExamplePillsVertical.shorthand.tsx new file mode 100644 index 0000000000..e977c8d939 --- /dev/null +++ b/docs/src/examples/components/Menu/Variations/MenuExamplePillsVertical.shorthand.tsx @@ -0,0 +1,16 @@ +import React from 'react' +import { Menu } from '@stardust-ui/react' + +const items = [ + { key: 'editorials', content: 'Editorials' }, + { key: 'review', content: 'Reviews' }, + { key: 'events', content: 'Upcoming Events' }, +] + +class MenuExamplePillsVerticalShorthand extends React.Component { + render() { + return + } +} + +export default MenuExamplePillsVerticalShorthand diff --git a/docs/src/examples/components/Menu/Variations/MenuExamplePillsVertical.tsx b/docs/src/examples/components/Menu/Variations/MenuExamplePillsVertical.tsx new file mode 100644 index 0000000000..6234fc412e --- /dev/null +++ b/docs/src/examples/components/Menu/Variations/MenuExamplePillsVertical.tsx @@ -0,0 +1,39 @@ +import React from 'react' +import _ from 'lodash' +import { Menu, MenuItem } from '@stardust-ui/react' + +const items = [ + { key: 'editorials', content: 'Editorials' }, + { key: 'review', content: 'Reviews' }, + { key: 'events', content: 'Upcoming Events' }, +] + +class MenuExamplePillsVertical extends React.Component { + state = { activeIndex: 0 } + + handleItemClick = activeIndex => () => { + this.setState({ activeIndex }) + } + + render() { + const { activeIndex } = this.state + return ( + + ) + } +} + +export default MenuExamplePillsVertical diff --git a/docs/src/examples/components/Menu/Variations/index.tsx b/docs/src/examples/components/Menu/Variations/index.tsx index 0241617b6c..deef92481e 100644 --- a/docs/src/examples/components/Menu/Variations/index.tsx +++ b/docs/src/examples/components/Menu/Variations/index.tsx @@ -9,11 +9,21 @@ const Variations = () => ( description="A menu can adjust its appearance to de-emphasize its contents." examplePath="components/Menu/Variations/MenuExamplePills" /> +