2024-04-19 13:51:57 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-tabs {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tablist {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabs-scrollable > .p-tablist {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tablist-viewport {
|
|
|
|
overflow-x: auto;
|
|
|
|
overflow-y: hidden;
|
|
|
|
scroll-behavior: smooth;
|
|
|
|
scrollbar-width: none;
|
|
|
|
overscroll-behavior: contain auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tablist-viewport::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tablist-tab-list {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('tabs.tab.list.background')};
|
|
|
|
border: 1px solid ${dt('tabs.tab.list.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
|
|
|
}
|
|
|
|
|
2024-05-04 11:47:06 +00:00
|
|
|
.p-tablist-nav-button {
|
2024-05-01 08:26:48 +00:00
|
|
|
all: unset;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
z-index: 2;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('tabs.nav.button.background')};
|
|
|
|
color: ${dt('tabs.nav.button.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 2.5rem;
|
|
|
|
transition: color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
|
2024-05-04 11:47:06 +00:00
|
|
|
box-shadow: ${dt('tabs.nav.button.box.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
2024-05-04 11:47:06 +00:00
|
|
|
.p-tablist-nav-button:focus-visible {
|
2024-05-01 08:26:48 +00:00
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: ${dt('focus.ring.offset')};
|
|
|
|
}
|
|
|
|
|
2024-05-04 11:47:06 +00:00
|
|
|
.p-tablist-nav-button:hover {
|
|
|
|
color: ${dt('tabs.nav.button.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tablist-prev-button {
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tablist-next-button {
|
|
|
|
right: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tab {
|
|
|
|
cursor: pointer;
|
|
|
|
border-style: solid;
|
|
|
|
border-width: 0 0 1px 0;
|
2024-05-04 11:47:06 +00:00
|
|
|
border-color: transparent transparent ${dt('tabs.tab.border.color')} transparent;
|
|
|
|
color: ${dt('tabs.tab.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
background: ${dt('tabs.nav.background')};
|
|
|
|
padding: 1rem 1.125rem;
|
|
|
|
font-weight: 600;
|
|
|
|
border-top-right-radius: ${dt('rounded.base')};
|
|
|
|
border-top-left-radius: ${dt('rounded.base')};
|
|
|
|
transition: color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
|
|
|
|
margin: 0 0 -1px 0;
|
|
|
|
outline-color: transparent;
|
|
|
|
line-height: 1;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tab:not(.p-disabled):focus-visible {
|
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: -1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tab:not(.p-tab-active):not(.p-disabled):hover {
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('tabs.tab.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tab-active {
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('tabs.tab.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabpanels {
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('tabs.tab.panel.background')};
|
|
|
|
color: ${dt('tabs.tab.panel.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
padding: 0.875rem 1.125rem 1.125rem 1.125rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tablist-active-bar {
|
|
|
|
z-index: 1;
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
bottom: -1px;
|
|
|
|
height: 1px;
|
2024-05-04 11:47:06 +00:00
|
|
|
background-color: ${dt('tabs.tab.active.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-04-19 13:51:57 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => [
|
|
|
|
'p-tabs p-component',
|
|
|
|
{
|
2024-04-29 09:57:14 +00:00
|
|
|
'p-tabs-scrollable': props.scrollable
|
2024-04-19 13:51:57 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'tabs',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2024-04-19 13:51:57 +00:00
|
|
|
classes
|
|
|
|
});
|