This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
feat(menu): Vertical Pointing Menu #123
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eb7eff2
feat(menu): Vertical Pointing variant
miroslavstastny 44961d8
Merge remote-tracking branch 'origin/master' into feat/menu-vertical-…
miroslavstastny e240cf6
feat(menu): Horizontal Pointing start variant
miroslavstastny 19eb7f5
Merge branch 'master' into feat/menu-vertical-pointing
kuzhelov 41fba1a
- changelog
miroslavstastny 7d9efb0
Merge remote-tracking branch 'origin/master' into feat/menu-vertical-…
miroslavstastny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
14 changes: 14 additions & 0 deletions
14
docs/src/examples/components/Menu/Variations/MenuExamplePointingStart.shorthand.tsx
This file contains hidden or 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,14 @@ | ||
| 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' }, | ||
| ] | ||
|
|
||
| const MenuExamplePointingStart = () => ( | ||
| <Menu defaultActiveIndex={0} items={items} pointing="start" /> | ||
| ) | ||
|
|
||
| export default MenuExamplePointingStart |
14 changes: 14 additions & 0 deletions
14
docs/src/examples/components/Menu/Variations/MenuExamplePointingStartPrimary.shorthand.tsx
This file contains hidden or 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,14 @@ | ||
| 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' }, | ||
| ] | ||
|
|
||
| const MenuExamplePointingStartPrimary = () => ( | ||
| <Menu defaultActiveIndex={0} items={items} pointing="start" type="primary" /> | ||
| ) | ||
|
|
||
| export default MenuExamplePointingStartPrimary |
14 changes: 14 additions & 0 deletions
14
docs/src/examples/components/Menu/Variations/MenuExampleVerticalPointing.shorthand.tsx
This file contains hidden or 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,14 @@ | ||
| 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' }, | ||
| ] | ||
|
|
||
| const MenuExampleVerticalPointing = () => ( | ||
| <Menu defaultActiveIndex={0} items={items} vertical pointing /> | ||
| ) | ||
|
|
||
| export default MenuExampleVerticalPointing |
14 changes: 14 additions & 0 deletions
14
docs/src/examples/components/Menu/Variations/MenuExampleVerticalPointingEnd.shorthand.tsx
This file contains hidden or 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,14 @@ | ||
| 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' }, | ||
| ] | ||
|
|
||
| const MenuExampleVerticalPointingEnd = () => ( | ||
| <Menu defaultActiveIndex={0} items={items} vertical pointing="end" /> | ||
| ) | ||
|
|
||
| export default MenuExampleVerticalPointingEnd |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
the fact that string value for
pointingtakes effect only for vertical menu seems to be a bit confusing. Maybe we should consider to introduce analog for horizontal one? At the same time, with that we, probably, will need to aknowledge that for horizontal one default value would be ratherend, as menu item's arrow is expected to point down by default: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.
Currently we have no use for horizontal
pointingin Teams theme. Instead of adding it now, I would prefer adding it when there is a real requirement for that.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.
And once we want to add support for
topandbottomin pointing, I think it would make more sense to usestartandendjust for vertical andtopandbottomfor horizontal.I understand you would like the properties to be universally valid across variants, but from user's POV it could be confusing. The whole library should consistently use top, end, bottom, start as direction.
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.
actually, cannot say that I completely agree with that. Let me, please, share my thoughts.
While it could be a reasonable choice for some components, for other ones it seems to be not. For the sake of example, suppose that we would have a
Layoutcomponent similar to the one that currently exists, but with added capability to render elements vertically. In that casestartandend, from user's POV, would make perfect sense to me - more than that, it would be much easier for me to change direction fromhorizontaltovertical,and with that be sure that all the inner composition of elements remains to be valid, i.e.
startone is still the first one in Layout's columnendone is rendered as last element in columnIf it would be about having four properties from two different groups, it would be much more work for me as user, without any good reason (from user's perspective) for that.
Agree that it is generally better to rely on requirements while deciding whether something should be introduced or not, but at the same time I think that when it is about breaking consistency from client's perspective (because, frankly, for me as a consumer it would be a point of sincere astonishment that
startandendvalues ofpointingare applied only for vertical menu, while for horizontal one it is easily imaginable how those could be applied), and, at the same time, it is not hard to introduce fix - maybe it would be better to consider to introduce this change even if it is not mentioned in requirements.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.
Ok, PR updated, horizontal pointing menu now honours
start/endas well.