From ccbd7839b90099b9b54c81c19a8a12ac6ced05a1 Mon Sep 17 00:00:00 2001 From: Ola Date: Fri, 21 May 2021 21:23:51 +0200 Subject: [PATCH] WIP: update tabs component --- src/molecules/tabs/Tabs.html | 16 ++++++++++------ src/molecules/tabs/Tabs.js | 20 +++++++++++++++++--- src/molecules/tabs/Tabs.vue | 10 ++++++++-- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/molecules/tabs/Tabs.html b/src/molecules/tabs/Tabs.html index e7ae6f20..b9d917ae 100644 --- a/src/molecules/tabs/Tabs.html +++ b/src/molecules/tabs/Tabs.html @@ -7,8 +7,8 @@ :key="`${tab.id}-tab-trigger`" :id="`${tab.id}-tab-trigger`" :aria-controls="`${tab.id}-tab`" - :aria-selected="tab.isActive || 'false'" - :aria-expanded="tab.isActive || 'false'" + :aria-selected="`${tab.isActive}`" + :aria-expanded="`${tab.isActive}`" type="button" role="tab" :ref="`button_${i}`" @@ -21,20 +21,24 @@ name="button" :tab="tab" > - {{ tab.name }} + + {{ tab.name }} + - + + +
- +
diff --git a/src/molecules/tabs/Tabs.js b/src/molecules/tabs/Tabs.js index 26774f7d..b88a0271 100644 --- a/src/molecules/tabs/Tabs.js +++ b/src/molecules/tabs/Tabs.js @@ -10,13 +10,27 @@ export default { config: { base: { tabs: [ - 'lg:flex', 'lg:flex-wrap', 'justify-center' + 'flex', 'flex-wrap' ], 'tabs__nav-button': [ - 'text-gray-600', 'py-4', 'px-6', 'block', 'hover:text-blue-500' + 'relative', + 'flex', 'w-full', 'items-center', + 'text-gray-600', 'py-4', 'px-6', 'hover:text-blue-500' ], 'tabs__nav-button--active': [ - 'text-gray-600', 'py-4', 'px-6', 'block', 'hover:text-blue-500', 'text-blue-500', 'border-b-2', 'font-medium', 'border-blue-500' + 'relative', + 'flex', 'w-full', 'items-center', + 'py-4', 'px-6', + 'text-gray-600', 'hover:text-blue-500', 'text-blue-500', 'border-b-2', 'font-medium', 'border-blue-500' + ], + 'tabs__nav-icon': [ + 'relative', + 'ml-auto' + ], + 'tabs__nav-icon--active': [ + 'relative', + 'ml-auto', + 'transform rotate-180' ], tabs__content: [ 'py-4' diff --git a/src/molecules/tabs/Tabs.vue b/src/molecules/tabs/Tabs.vue index 7f43547f..a9ffaae2 100644 --- a/src/molecules/tabs/Tabs.vue +++ b/src/molecules/tabs/Tabs.vue @@ -3,10 +3,16 @@