1- import { Heading } from '../../core/Typography'
2- import { twMerge } from 'tailwind-merge'
3- import IngressText from '../../pageComponents/shared/portableText/IngressText'
4- import { getColorForTabsTheme } from './tabThemes'
51import { Tabs } from '@core/Tabs'
2+ import type { PortableTextBlock } from '@portabletext/types'
63import { forwardRef , useId , useRef } from 'react'
7- import TabsKeyNumberItem from './TabsKeyNumberItem'
4+ import { twMerge } from 'tailwind-merge'
5+ import { Heading } from '../../core/Typography'
86import Blocks from '../../pageComponents/shared/portableText/Blocks'
7+ import IngressText from '../../pageComponents/shared/portableText/IngressText'
8+ import type { TabItem } from './TabsBlock.types'
99import TabsInfoPanelItem from './TabsInfoPanelItem'
10- import { PortableTextBlock } from '@portabletext/types '
11- import { TabItem } from './TabsBlock.types '
10+ import TabsKeyNumberItem from './TabsKeyNumberItem '
11+ import { getColorForTabsTheme } from './tabThemes '
1212
1313const { TabList, Tab, TabPanel } = Tabs
1414
@@ -53,21 +53,16 @@ const TabsBlock = forwardRef<HTMLDivElement, TabsBlockProps>(function TabsBlock(
5353 ) }
5454 >
5555 < div
56- className = { `flex
57- flex-col
58- gap-6
59- max-w-viewport
60- mx-auto
61- ${
62- tabPanelVariant === 'tabsKeyNumbers'
63- ? `px-layout-sm lg:px-layout-md pb-page-content`
64- : `lg:mx-layout-sm ${ theme ?. backgroundUtility } rounded-md`
65- }
56+ className = { `mx-auto flex max-w-viewport flex-col gap-6 ${
57+ tabPanelVariant === 'tabsKeyNumbers'
58+ ? `px-layout-sm pb-page-content lg:px-layout-md`
59+ : `lg:mx-layout-sm ${ theme ?. backgroundUtility } rounded-md`
60+ }
6661 ` }
6762 >
6863 < div
6964 className = { `${
70- tabPanelVariant === 'tabsInfoPanel' && ! hideTitle ? `lg:pt-20 pl-layout-sm max-w-innerColumn ` : ``
65+ tabPanelVariant === 'tabsInfoPanel' && ! hideTitle ? `max-w-innerColumn pl-layout-sm lg:pt-20 ` : ``
7166 } `}
7267 >
7368 { title && (
@@ -79,11 +74,7 @@ const TabsBlock = forwardRef<HTMLDivElement, TabsBlockProps>(function TabsBlock(
7974 < Tabs
8075 defaultValue = { tabList [ 0 ] ?. id }
8176 { ...( hideTitle && { 'aria-labelledby' : headingId } ) }
82- className = { `w-full
83- flex
84- flex-col
85- items-center
86- ${ tabPanelVariant === 'tabsInfoPanel' ? 'mt-4' : '' }
77+ className = { `flex w-full flex-col items-center ${ tabPanelVariant === 'tabsInfoPanel' ? 'mt-4' : '' }
8778 ` }
8879 >
8980 < TabList ref = { tabsListRef } >
@@ -105,19 +96,15 @@ const TabsBlock = forwardRef<HTMLDivElement, TabsBlockProps>(function TabsBlock(
10596 className = { `${
10697 tabPanelVariant === 'tabsKeyNumbers'
10798 ? 'w-full py-14 max-lg:px-layout-sm'
108- : 'w -full h -full rounded-md overflow-hidden'
99+ : 'h -full w -full overflow-hidden rounded-md '
109100 } `}
110101 >
111102 { tabItem . panel ?. type === 'tabsKeyNumbers' && tabItem . panel ?. items && (
112103 < ul
113104 { ...( title && hideTitle && { 'aria-labelledby' : headingId } ) }
114- className = { `
115- flex
116- flex-col
117- md:grid
118- md:grid-cols-2
119- ${ tabItem . panel ?. items ?. length < 4 ? '3xl:grid-flow-col 3xl:auto-cols-fr' : '' }
120- gap-6` }
105+ className = { `flex flex-col md:grid md:grid-cols-2 ${
106+ tabItem . panel ?. items ?. length < 4 ? '3xl:auto-cols-fr 3xl:grid-flow-col' : ''
107+ } gap-6`}
121108 >
122109 { tabItem . panel ?. items ?. map ( ( tabsKeyNumber : any ) => {
123110 return (
@@ -137,7 +124,7 @@ const TabsBlock = forwardRef<HTMLDivElement, TabsBlockProps>(function TabsBlock(
137124 < TabsInfoPanelItem theme = { designOptions . theme ?. value } { ...tabItem . panel } />
138125 ) }
139126 { tabItem . panel ?. type === 'tabsKeyNumbers' && tabItem ?. panel ?. disclaimer && (
140- < Blocks value = { tabItem ?. panel ?. disclaimer } className = "italic text-sm mt-6 " />
127+ < Blocks value = { tabItem ?. panel ?. disclaimer } className = "mt-6 text-sm italic " />
141128 ) }
142129 </ TabPanel >
143130 )
0 commit comments