From 06b6a7668df7fa8a4a4b5f17e03e77fc8a8bb814 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Thu, 15 Feb 2024 12:13:15 +0300 Subject: [PATCH] Migrated tabmenu --- components/lib/theme/aura/tabmenu/index.js | 98 +++++++++++++++++++++- components/lib/theme/aura/tabview/index.js | 5 -- 2 files changed, 94 insertions(+), 9 deletions(-) diff --git a/components/lib/theme/aura/tabmenu/index.js b/components/lib/theme/aura/tabmenu/index.js index 024b6b227..b62ecd0aa 100644 --- a/components/lib/theme/aura/tabmenu/index.js +++ b/components/lib/theme/aura/tabmenu/index.js @@ -1,11 +1,101 @@ export default { variables: { colorScheme: { - light: {}, - dark: {}, - }, + light: { + nav: { + background: '{surface.0}', + borderColor: '{surface.200}' + }, + header: { + borderColor: '{surface.200}', + textColor: '{surface.500}', + textColorHover: '{surface.700}' + } + }, + dark: { + nav: { + background: '{surface.900}', + borderColor: '{surface.700}' + }, + header: { + borderColor: '{surface.700}', + textColor: '{surface.400}', + textColorHover: '{surface.0}' + } + } + } }, css: ` +.p-tabmenu { + overflow-x: auto; +} -`, +.p-tabmenu-nav { + display: flex; + margin: 0; + padding: 0; + list-style-type: none; + flex: 1 1 auto; + background: var(--p-tabmenu-nav-background); + border: 1px solid var(--p-tabmenu-nav-border-color); + border-width: 0 0 1px 0; + position: relative; +} + +.p-tabmenuitem .p-menuitem-link { + cursor: pointer; + user-select: none; + display: flex; + align-items: center; + text-decoration: none; + position: relative; + overflow: hidden; + border-style: solid; + border-width: 0 0 1px 0; + border-color: transparent transparent var(--p-tabmenu-header-border-color) transparent; + color: var(--p-tabmenu-header-text-color); + padding: 1rem 1.125rem; + font-weight: 600; + border-top-right-radius: var(--p-rounded-base); + border-top-left-radius: var(--p-rounded-base); + transition: color var(--p-transition-duration), outline-color var(--p-transition-duration); + margin: 0 0 -1px 0; + outline-color: transparent; +} + +.p-tabmenuitem .p-menuitem-link:focus-visible { + outline: var(--p-focus-ring-width) var(--p-focus-ring-style) var(--p-focus-ring-color); + outline-offset: -1px; +} + +.p-tabmenuitem .p-menuitem-icon { + margin-right: 0.5rem; +} + +.p-tabmenu-nav .p-menuitem-text { + line-height: 1; +} + +.p-tabmenuitem:not(.p-highlight):not(.p-disabled):hover .p-menuitem-link { + color: var(--p-tabmenu-header-text-color-hover); +} + +.p-tabmenuitem.p-highlight .p-menuitem-link { + color: var(--p-primary-color); +} + +.p-tabmenu-ink-bar { + z-index: 1; + display: block; + position: absolute; + bottom: -1px; + height: 1px; + background-color: var(--p-primary-color); + transition: 250ms cubic-bezier(0.35, 0, 0.25, 1); +} + +.p-tabmenu::-webkit-scrollbar { + display: none; +} +` }; diff --git a/components/lib/theme/aura/tabview/index.js b/components/lib/theme/aura/tabview/index.js index e30edd46e..ff0206d3d 100644 --- a/components/lib/theme/aura/tabview/index.js +++ b/components/lib/theme/aura/tabview/index.js @@ -108,11 +108,6 @@ export default { color: var(--p-primary-color); } -.p-tabview-ink-bar { - display: none; - z-index: 1; -} - .p-tabview-title { line-height: 1; white-space: nowrap;