New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MenuButton: Creating component using compose #13812
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e8270ad:
|
Asset size changes
Over Tolerance (1024 B) Over Baseline Below Baseline New Removed 1 kB = 1000 B Baseline commit: 5622cd353f0dc368f8ffe4d59af2ee40c60f5053 (build) |
import { ButtonProps, ButtonTokens } from '../Button/Button.types'; | ||
|
||
export interface MenuButtonProps extends Omit<ButtonProps, 'icon' | 'iconPosition' | 'loader'> { | ||
/** |
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.
Out of curiosity, why can't a menu button have an icon to the left?
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.
I wanted to omit extra icons when having a MenuButton
besides the menuIcon
itself.
This brings a good point of discussion though:
- Should we allow the
menuIcon
to be on the left as well? - Should we allow for an
icon
besides themenuIcon
? - If so, should we allow that
icon
to be able to exist before and after the content or just before?
packages/react-button/src/components/MenuButton/MenuButton.types.tsx
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.tsx
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.tsx
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.tsx
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.tsx
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButtonBase.tsx
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButtonBase.tsx
Outdated
Show resolved
Hide resolved
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
packages/react-button/src/components/MenuButton/MenuButton.scss
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/useMenuButton.ts
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.ts
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.ts
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.ts
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.ts
Outdated
Show resolved
Hide resolved
packages/react-button/src/components/MenuButton/MenuButton.types.ts
Outdated
Show resolved
Hide resolved
… slot to mergeSlotProp call.
Hello @khmakoto! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
🎉 Handy links: |
🎉 Handy links: |
Pull request checklist
$ yarn change
Description of changes
This is a first stab at a
MenuButton
component usingcompose
. At the moment I'm making using ofContextualMenu
to build this but only on the opinionated version and we can swap it for whatever once we have a more refined newMenu
component.Focus areas to test
(optional)