Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/components/Dropdown/MenuItem/MenuItemButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const MenuItemButton = ({
children,
className,
isActive,
isDisabled,
style,
prefix,
suffix,
Expand Down Expand Up @@ -45,11 +46,13 @@ const MenuItemButton = ({
"neeto-ui-dropdown__popup-menu-item-btn",
className,
{
"neeto-ui-dropdown__popup-menu-item-btn": isActive,
"neeto-ui-dropdown__popup-menu-item-btn--active": isActive,
"neeto-ui-dropdown__popup-menu-item-btn--disabled": isDisabled,
"neeto-ui-dropdown__popup-menu-item-btn--style-danger":
style === ITEM_BTN_STYLES.danger,
}
)}
disabled={isDisabled}
{...otherProps}
{...elementSpecificProps}
>
Expand Down Expand Up @@ -82,6 +85,10 @@ MenuItemButton.propTypes = {
* To specify the active state of the MenuItem.
*/
isActive: PropTypes.bool,
/**
* To specify whether the MenuItem is disabled.
*/
isDisabled: PropTypes.bool,
/**
* To specify an internal route to which the button points to.
*/
Expand Down
12 changes: 6 additions & 6 deletions lib/styles/components/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,18 @@
outline-color: transparent;
border-radius: 0;

&.disabled {
&--disabled {
cursor: not-allowed;
color: rgb(var(--neeto-ui-gray-500));
opacity: 0.5;
}

&:hover,
&:focus {
&:hover:not(:disabled):not(.neeto-ui-dropdown__popup-menu-item-btn--active),
&:focus:not(:disabled):not(.neeto-ui-dropdown__popup-menu-item-btn--active){
background-color: rgb(var(--neeto-ui-gray-200));
}

&.active {
background-color: rgb(var(--neeto-ui-gray-800));
&--active {
background-color: rgb(var(--neeto-ui-primary-500));
color: rgb(var(--neeto-ui-white));
}

Expand Down
2 changes: 2 additions & 0 deletions stories/Components/Dropdown.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export const Default = (args) => {
{listItems.map((item, idx) => (
<MenuItem.Button key={idx}>{item}</MenuItem.Button>
))}
<MenuItem.Button isActive>Active</MenuItem.Button>
<MenuItem.Button isDisabled>Disabled</MenuItem.Button>
<Divider />
<MenuItem.Button style="danger">Delete</MenuItem.Button>
</Menu>
Expand Down