@@ -87,11 +87,11 @@ export function DynamicTabs(
8787 const orientation : string = 'horizontal' ; // TODO: Get orientation from tab block options
8888 const position : string = 'start' ; // TODO: Get position from tab block options
8989
90- const description = null ; //'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; // null; // TODO: Get description from tabs
90+ const description = null ; // TODO: Get description from tabs
9191
9292 // To avoid issue with hydration, we only use the state from localStorage
9393 // once the component has been mounted.
94- // Otherwise because of the streaming/suspense approach, tabs can be first-rendered at different time
94+ // Otherwise because of the streaming/suspense approach, tabs can be first-rendered at different time
9595 // and get stuck into an inconsistent state.
9696 const mounted = useIsMounted ( ) ;
9797 const active = mounted ? activeState : tabs [ 0 ] ;
@@ -158,8 +158,6 @@ export function DynamicTabs(
158158 orientation === 'vertical' && position === 'end' && 'md:flex-row-reverse' ,
159159
160160 style
161- // We need to inset the tabs container to make edge-to-edge scrolling work, since this container has overflow:hidden
162- // Also important to put this after the `style` to override those.
163161 ) }
164162 >
165163 < div
@@ -168,34 +166,17 @@ export function DynamicTabs(
168166 'group/tabs' ,
169167 'flex' ,
170168 tabs . length > 3 ? 'md:flex-wrap' : '' ,
171-
172169 'overflow-x-auto' ,
173170 'md:overflow-hidden' ,
174- // 'items-end',
175-
176171 'gap-x-1' ,
177172 'flex-row' ,
178-
179173 orientation === 'vertical' && 'gap-1.5 md:max-w-[40%] md:flex-col' ,
180174 'snap-x' ,
181175 'snap-mandatory' ,
182176 '-mb-px' ,
183-
184177 'peer' ,
185-
186178 orientation === 'vertical' && position === 'start' && 'md:-mr-px md:mb-0' ,
187179 orientation === 'vertical' && position === 'end' && 'md:-ml-px md:mb-0'
188-
189- // We need to inset the tablist to make edge-to-edge scrolling work.
190- // '-mx-4',
191- // 'px-4',
192- // 'scroll-px-4',
193- // 'sm:-mx-6',
194- // 'sm:px-6',
195- // 'sm:scroll-px-6',
196- // 'md:mx-0',
197- // 'md:px-0',
198- // 'md:scroll-px-0',
199180 ) }
200181 >
201182 { tabs . map ( ( tab ) => (
@@ -213,7 +194,7 @@ export function DynamicTabs(
213194 < button
214195 type = "button"
215196 role = "tab"
216- aria-orientation = { orientation }
197+ aria-orientation = { orientation as 'horizontal' | 'vertical' }
217198 aria-selected = { active . id === tab . id }
218199 aria-controls = { getTabPanelId ( tab . id ) }
219200 id = { getTabButtonId ( tab . id ) }
@@ -223,14 +204,12 @@ export function DynamicTabs(
223204 className = { tcls (
224205 hashLinkButtonWrapperStyles ,
225206 description ? 'p-4' : 'px-4 py-1.5' ,
226-
227207 'grow' ,
228208 'transition-colors' ,
229209 'text-left' ,
230210 'flex' ,
231211 'flex-col' ,
232212 'gap-1' ,
233-
234213 'rounded-md' ,
235214 'straight-corners:rounded-none' ,
236215 'circular-corners:rounded-2xl' ,
@@ -343,9 +322,6 @@ export function DynamicTabs(
343322 'bg-tint-base' ,
344323 position === 'start' && '!rounded-tl-none' ,
345324 position === 'end' && '!rounded-tr-none' ,
346- // index === 0 && active.id === tab.id
347- // ? '!rounded-tl-none'
348- // : '[.peer:has(.tab:first-child:hover)~&]:rounded-tl-none',
349325 'transition-all' ,
350326 'ring-1' ,
351327 'ring-inset' ,
@@ -398,7 +374,6 @@ function getTabByTitle(input: TabsInput, state: TabsState): TabsItem | null {
398374 } ;
399375 } )
400376 . filter ( ( { score } ) => score >= 0 )
401- // .sortBy(({ score }) => -score)
402377 . sort ( ( { score : a } , { score : b } ) => b - a )
403378 . map ( ( { item } ) => item ) [ 0 ] ?? null
404379 ) ;
0 commit comments