@@ -12,25 +12,21 @@ import {TabContainerElement} from '@github/tab-container-element'
1212import type { IconProps } from '@primer/octicons-react'
1313import { createComponent } from '../../utils/create-component'
1414import {
15- StyledUnderlineItemList ,
16- StyledUnderlineWrapper ,
15+ UnderlineItemList ,
16+ UnderlineWrapper ,
1717 UnderlineItem ,
1818 type UnderlineItemProps ,
1919} from '../../internal/components/UnderlineTabbedInterface'
2020import Box , { type BoxProps } from '../../Box'
2121import { useId } from '../../hooks'
2222import { invariant } from '../../utils/invariant'
23- import { merge , type BetterSystemStyleObject , type SxProp } from '../../sx'
23+ import { type SxProp } from '../../sx'
2424import { defaultSxProp } from '../../utils/defaultSxProp'
2525import { useResizeObserver , type ResizeObserverEntry } from '../../hooks/useResizeObserver'
2626import useIsomorphicLayoutEffect from '../../utils/useIsomorphicLayoutEffect'
27- import { useFeatureFlag } from '../../FeatureFlags'
2827import classes from './UnderlinePanels.module.css'
29- import { toggleStyledComponent } from '../../internal/utils/toggleStyledComponent'
3028import { clsx } from 'clsx'
3129
32- const CSS_MODULES_FEATURE_FLAG = 'primer_react_css_modules_ga'
33-
3430export type UnderlinePanelsProps = {
3531 /**
3632 * Tabs (UnderlinePanels.Tab) and panels (UnderlinePanels.Panel) to render
@@ -82,12 +78,6 @@ export type PanelProps = Omit<BoxProps, 'as'>
8278
8379const TabContainerComponent = createComponent ( TabContainerElement , 'tab-container' )
8480
85- const StyledTabContainerComponent = toggleStyledComponent (
86- CSS_MODULES_FEATURE_FLAG ,
87- 'tab-container' ,
88- TabContainerComponent ,
89- )
90-
9181const UnderlinePanels : FC < UnderlinePanelsProps > = ( {
9282 'aria-label' : ariaLabel ,
9383 'aria-labelledby' : ariaLabelledBy ,
@@ -139,8 +129,6 @@ const UnderlinePanels: FC<UnderlinePanelsProps> = ({
139129
140130 const tabsHaveIcons = tabs . some ( tab => React . isValidElement ( tab ) && tab . props . icon )
141131
142- const enabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
143-
144132 // this is a workaround to get the list's width on the first render
145133 const [ listWidth , setListWidth ] = useState ( 0 )
146134 useIsomorphicLayoutEffect ( ( ) => {
@@ -164,7 +152,7 @@ const UnderlinePanels: FC<UnderlinePanelsProps> = ({
164152 setIconsVisible ( wrapperWidth > listWidth )
165153 } ,
166154 wrapperRef ,
167- [ enabled ] ,
155+ [ ] ,
168156 )
169157
170158 if ( __DEV__ ) {
@@ -182,53 +170,22 @@ const UnderlinePanels: FC<UnderlinePanelsProps> = ({
182170 )
183171 }
184172
185- if ( enabled ) {
186- return (
187- < StyledTabContainerComponent >
188- < StyledUnderlineWrapper
189- ref = { wrapperRef }
190- slot = "tablist-wrapper"
191- data-icons-visible = { iconsVisible }
192- sx = { sxProp }
193- className = { clsx ( className , classes . StyledUnderlineWrapper ) }
194- { ...props }
195- >
196- < StyledUnderlineItemList ref = { listRef } aria-label = { ariaLabel } aria-labelledby = { ariaLabelledBy } role = "tablist" >
197- { tabs }
198- </ StyledUnderlineItemList >
199- </ StyledUnderlineWrapper >
200- { tabPanels }
201- </ StyledTabContainerComponent >
202- )
203- }
204-
205173 return (
206- < StyledTabContainerComponent >
207- < StyledUnderlineWrapper
174+ < TabContainerComponent >
175+ < UnderlineWrapper
208176 ref = { wrapperRef }
209177 slot = "tablist-wrapper"
210178 data-icons-visible = { iconsVisible }
211- sx = { merge < BetterSystemStyleObject > (
212- {
213- width : '100%' ,
214- overflowX : 'auto' ,
215- overflowY : 'hidden' ,
216- '-webkit-overflow-scrolling' : 'auto' ,
217- '&[data-icons-visible="false"] [data-component="icon"]' : {
218- display : 'none' ,
219- } ,
220- } ,
221- sxProp as SxProp ,
222- ) }
223- className = { className }
179+ sx = { sxProp }
180+ className = { clsx ( className , classes . StyledUnderlineWrapper ) }
224181 { ...props }
225182 >
226- < StyledUnderlineItemList ref = { listRef } aria-label = { ariaLabel } aria-labelledby = { ariaLabelledBy } role = "tablist" >
183+ < UnderlineItemList ref = { listRef } aria-label = { ariaLabel } aria-labelledby = { ariaLabelledBy } role = "tablist" >
227184 { tabs }
228- </ StyledUnderlineItemList >
229- </ StyledUnderlineWrapper >
185+ </ UnderlineItemList >
186+ </ UnderlineWrapper >
230187 { tabPanels }
231- </ StyledTabContainerComponent >
188+ </ TabContainerComponent >
232189 )
233190}
234191
0 commit comments