-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(MenuItemSubMenuIcon): allow to use props relative to isSplit…
… is true or false
- Loading branch information
1 parent
688ba88
commit d7a01b2
Showing
2 changed files
with
49 additions
and
32 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
25 changes: 22 additions & 3 deletions
25
.../src/components/Menu/MenuItem/components/MenuItemSubMenuIcon/MenuItemSubMenuIcon.types.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 |
---|---|---|
@@ -1,6 +1,25 @@ | ||
export interface MenuItemSubMenuIconProps { | ||
isSplit?: boolean; | ||
label?: string; | ||
export interface SplitMenuItemSubMenuIconProps { | ||
/** | ||
* Determines whether the submenu icon is split from the main menu item. | ||
* When true, clicking the main menu item and the submenu icon trigger different actions. | ||
*/ | ||
isSplit?: true; | ||
/** | ||
* Indicates if the split submenu is currently active. | ||
*/ | ||
active?: boolean; | ||
/** | ||
* Whether the split submenu icon is disabled. | ||
*/ | ||
disabled?: boolean; | ||
} | ||
|
||
export interface SimpleMenuItemSubMenuIconProps { | ||
isSplit?: false; | ||
/** | ||
* Label for the submenu icon, used for accessibility. | ||
*/ | ||
label?: string; | ||
} | ||
|
||
export type MenuItemSubMenuIconProps = SimpleMenuItemSubMenuIconProps | SplitMenuItemSubMenuIconProps; |