2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-menubar {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
background: ${dt('menubar.background')};
|
|
|
|
border: 1px solid ${dt('menubar.border.color')};
|
2024-05-10 16:37:24 +00:00
|
|
|
border-radius: ${dt('menubar.border.radius')};
|
|
|
|
color: ${dt('menubar.color')};
|
|
|
|
padding: ${dt('menubar.padding')};
|
2024-05-11 08:40:04 +00:00
|
|
|
gap: ${dt('menubar.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-root-list,
|
|
|
|
.p-menubar-submenu {
|
2024-05-10 16:37:24 +00:00
|
|
|
display: flex;
|
2024-05-01 08:26:48 +00:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
list-style: none;
|
|
|
|
outline: 0 none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-root-list {
|
|
|
|
align-items: center;
|
|
|
|
flex-wrap: wrap;
|
2024-05-10 16:37:24 +00:00
|
|
|
gap: ${dt('menubar.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 16:37:24 +00:00
|
|
|
.p-menubar-root-list > .p-menubar-item > .p-menubar-item-content {
|
|
|
|
border-radius: ${dt('menubar.base.item.border.radius')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link {
|
|
|
|
padding: ${dt('menubar.base.item.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-item-content {
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: background ${dt('menubar.transition.duration')}, color ${dt('menubar.transition.duration')};
|
2024-05-10 16:37:24 +00:00
|
|
|
border-radius: ${dt('menubar.item.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('menubar.item.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-item-link {
|
|
|
|
cursor: pointer;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
color: inherit;
|
2024-05-10 16:37:24 +00:00
|
|
|
padding: ${dt('menubar.item.padding')};
|
|
|
|
gap: ${dt('menubar.item.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
user-select: none;
|
2024-05-10 16:37:24 +00:00
|
|
|
outline: 0 none;
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-item-label {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-item-icon {
|
|
|
|
color: ${dt('menubar.item.icon.color')};
|
2024-05-10 16:37:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-submenu-icon {
|
|
|
|
color: ${dt('menubar.submenu.icon.color')};
|
|
|
|
margin-left: auto;
|
|
|
|
font-size: ${dt('menubar.submenu.icon.size')};
|
|
|
|
width: ${dt('menubar.submenu.icon.size')};
|
|
|
|
height: ${dt('menubar.submenu.icon.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-item.p-focus > .p-menubar-item-content {
|
2024-05-05 15:51:29 +00:00
|
|
|
color: ${dt('menubar.item.focus.color')};
|
|
|
|
background: ${dt('menubar.item.focus.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 16:37:24 +00:00
|
|
|
.p-menubar-item.p-focus > .p-menubar-item-content .p-menubar-item-icon {
|
|
|
|
color: ${dt('menubar.item.icon.focus.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-menubar-item.p-focus > .p-menubar-item-content .p-menubar-submenu-icon {
|
2024-05-10 16:37:24 +00:00
|
|
|
color: ${dt('menubar.submenu.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover {
|
2024-05-05 15:51:29 +00:00
|
|
|
color: ${dt('menubar.item.focus.color')};
|
|
|
|
background: ${dt('menubar.item.focus.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 16:37:24 +00:00
|
|
|
.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover .p-menubar-item-icon {
|
|
|
|
color: ${dt('menubar.item.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 16:37:24 +00:00
|
|
|
.p-menubar-item:not(.p-disabled) > .p-menubar-item-content:hover .p-menubar-submenu-icon {
|
|
|
|
color: ${dt('menubar.submenu.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 16:37:24 +00:00
|
|
|
.p-menubar-item-active > .p-menubar-item-content {
|
|
|
|
color: ${dt('menubar.item.active.color')};
|
|
|
|
background: ${dt('menubar.item.active.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 16:37:24 +00:00
|
|
|
.p-menubar-item-active > .p-menubar-item-content .p-menubar-item-icon {
|
|
|
|
color: ${dt('menubar.item.icon.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 16:37:24 +00:00
|
|
|
.p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {
|
|
|
|
color: ${dt('menubar.submenu.icon.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-submenu {
|
|
|
|
display: none;
|
|
|
|
position: absolute;
|
|
|
|
min-width: 12.5rem;
|
|
|
|
z-index: 1;
|
2024-05-10 16:37:24 +00:00
|
|
|
background: ${dt('menubar.submenu.background')};
|
|
|
|
border: 1px solid ${dt('menubar.submenu.border.color')};
|
|
|
|
border-radius: ${dt('menubar.border.radius')};
|
|
|
|
box-shadow: ${dt('menubar.submenu.shadow')};
|
|
|
|
color: ${dt('menubar.submenu.color')};
|
|
|
|
flex-direction: column;
|
|
|
|
padding: ${dt('menubar.submenu.padding')};
|
|
|
|
gap: ${dt('menubar.submenu.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-submenu .p-menubar-separator {
|
|
|
|
border-top: 1px solid ${dt('menubar.separator.border.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-submenu .p-menubar-item {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-submenu > .p-menubar-item-active > .p-menubar-submenu {
|
|
|
|
display: block;
|
|
|
|
left: 100%;
|
|
|
|
top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-end {
|
|
|
|
margin-left: auto;
|
|
|
|
align-self: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-button {
|
|
|
|
display: none;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
cursor: pointer;
|
2024-05-10 16:37:24 +00:00
|
|
|
width: ${dt('menubar.mobile.button.size')};
|
|
|
|
height: ${dt('menubar.mobile.button.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
position: relative;
|
2024-05-10 16:37:24 +00:00
|
|
|
color: ${dt('menubar.mobile.button.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border: 0 none;
|
|
|
|
background: transparent;
|
2024-05-10 16:37:24 +00:00
|
|
|
border-radius: ${dt('menubar.mobile.button.border.radius')};
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: background ${dt('menubar.transition.duration')}, color ${dt('menubar.transition.duration')}, outline-color ${dt('menubar.transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-button:hover {
|
2024-05-10 16:37:24 +00:00
|
|
|
color: ${dt('menubar.mobile.button.hover.color')};
|
|
|
|
background: ${dt('menubar.mobile.button.hover.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-button:focus-visible {
|
2024-05-10 16:37:24 +00:00
|
|
|
box-shadow: ${dt('menubar.mobile.button.focus.ring.shadow')};
|
|
|
|
outline: ${dt('menubar.mobile.button.focus.ring.width')} ${dt('menubar.mobile.button.focus.ring.style')} ${dt('menubar.mobile.button.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('menubar.mobile.button.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-button {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-root-list {
|
|
|
|
position: absolute;
|
|
|
|
display: none;
|
|
|
|
width: 100%;
|
2024-05-10 16:37:24 +00:00
|
|
|
padding: ${dt('menubar.submenu.padding')};
|
|
|
|
background: ${dt('menubar.submenu.background')};
|
|
|
|
border: 1px solid ${dt('menubar.submenu.border.color')};
|
|
|
|
box-shadow: ${dt('menubar.submenu.shadow')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content {
|
|
|
|
border-radius: ${dt('menubar.item.border.radius')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link {
|
|
|
|
padding: ${dt('menubar.item.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile-active .p-menubar-root-list {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
top: 100%;
|
|
|
|
left: 0;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-root-list .p-menubar-item {
|
|
|
|
width: 100%;
|
|
|
|
position: static;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-root-list .p-menubar-separator {
|
2024-05-10 16:37:24 +00:00
|
|
|
border-top: 1px solid ${dt('menubar.separator.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content .p-menubar-submenu-icon {
|
|
|
|
margin-left: auto;
|
|
|
|
transition: transform 0.2s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-root-list > .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {
|
|
|
|
transform: rotate(-180deg);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-submenu .p-menubar-submenu-icon {
|
|
|
|
transition: transform 0.2s;
|
|
|
|
transform: rotate(90deg);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon {
|
|
|
|
transform: rotate(-90deg);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menubar-mobile .p-menubar-submenu {
|
|
|
|
width: 100%;
|
|
|
|
position: static;
|
|
|
|
box-shadow: none;
|
|
|
|
border: 0 none;
|
2024-05-10 16:37:24 +00:00
|
|
|
padding-left: ${dt('menubar.submenu.mobile.indent')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const inlineStyles = {
|
2024-05-10 08:57:09 +00:00
|
|
|
submenu: ({ instance, processedItem }) => ({ display: instance.isItemActive(processedItem) ? 'flex' : 'none' })
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance }) => [
|
|
|
|
'p-menubar p-component',
|
|
|
|
{
|
2023-11-15 10:20:49 +00:00
|
|
|
'p-menubar-mobile': instance.queryMatches,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-menubar-mobile-active': instance.mobileActive
|
|
|
|
}
|
|
|
|
],
|
|
|
|
start: 'p-menubar-start',
|
|
|
|
button: 'p-menubar-button',
|
2024-04-30 13:03:20 +00:00
|
|
|
rootList: 'p-menubar-root-list',
|
|
|
|
item: ({ instance, processedItem }) => [
|
2024-04-09 13:35:36 +00:00
|
|
|
'p-menubar-item',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-09 13:35:36 +00:00
|
|
|
'p-menubar-item-active': instance.isItemActive(processedItem),
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-focus': instance.isItemFocused(processedItem),
|
|
|
|
'p-disabled': instance.isItemDisabled(processedItem)
|
|
|
|
}
|
|
|
|
],
|
2024-04-30 13:03:20 +00:00
|
|
|
itemContent: 'p-menubar-item-content',
|
|
|
|
itemLink: 'p-menubar-item-link',
|
|
|
|
itemIcon: 'p-menubar-item-icon',
|
|
|
|
itemLabel: 'p-menubar-item-label',
|
2024-04-09 13:35:36 +00:00
|
|
|
submenuIcon: 'p-menubar-submenu-icon',
|
2024-04-09 13:43:12 +00:00
|
|
|
submenu: 'p-menubar-submenu',
|
2024-04-09 13:35:36 +00:00
|
|
|
separator: 'p-menubar-separator',
|
2023-10-02 10:46:09 +00:00
|
|
|
end: 'p-menubar-end'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'menubar',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|