@@ -11,12 +11,15 @@ import {useId} from '../hooks/useId'
1111import { ListContext , type ActionListProps } from './shared'
1212import { useProvidedRefOrCreate } from '../hooks'
1313import { FocusKeys , useFocusZone } from '../hooks/useFocusZone'
14+ import { clsx } from 'clsx'
15+ import { useFeatureFlag } from '../FeatureFlags'
16+ import classes from './ActionList.module.css'
1417
1518const ListBox = styled . ul < SxProp > ( sx )
1619
1720export const List = React . forwardRef < HTMLUListElement , ActionListProps > (
1821 (
19- { variant = 'inset' , selectionVariant, showDividers = false , role, sx : sxProp = defaultSxProp , ...props } ,
22+ { variant = 'inset' , selectionVariant, showDividers = false , role, sx : sxProp = defaultSxProp , className , ...props } ,
2023 forwardedRef ,
2124 ) : JSX . Element => {
2225 const styles = {
@@ -54,6 +57,8 @@ export const List = React.forwardRef<HTMLUListElement, ActionListProps>(
5457 focusOutBehavior : listRole === 'menu' ? 'wrap' : undefined ,
5558 } )
5659
60+ const enabled = useFeatureFlag ( 'primer_react_css_modules_team' )
61+
5762 return (
5863 < ListContext . Provider
5964 value = { {
@@ -65,15 +70,45 @@ export const List = React.forwardRef<HTMLUListElement, ActionListProps>(
6570 } }
6671 >
6772 { slots . heading }
68- < ListBox
69- sx = { merge ( styles , sxProp as SxProp ) }
70- role = { listRole }
71- aria-labelledby = { ariaLabelledBy }
72- { ...props }
73- ref = { listRef }
74- >
75- { childrenWithoutSlots }
76- </ ListBox >
73+ { enabled ? (
74+ sxProp !== defaultSxProp ? (
75+ < ListBox
76+ sx = { merge ( styles , sxProp as SxProp ) }
77+ className = { clsx ( classes . ActionList , className ) }
78+ role = { listRole }
79+ aria-labelledby = { ariaLabelledBy }
80+ ref = { listRef }
81+ data-dividers = { showDividers }
82+ data-variant = { variant }
83+ { ...props }
84+ >
85+ { childrenWithoutSlots }
86+ </ ListBox >
87+ ) : (
88+ < ul
89+ className = { clsx ( classes . ActionList , className ) }
90+ role = { listRole }
91+ aria-labelledby = { ariaLabelledBy }
92+ ref = { listRef }
93+ data-dividers = { showDividers }
94+ data-variant = { variant }
95+ { ...props }
96+ >
97+ { childrenWithoutSlots }
98+ </ ul >
99+ )
100+ ) : (
101+ < ListBox
102+ sx = { merge ( styles , sxProp as SxProp ) }
103+ role = { listRole }
104+ aria-labelledby = { ariaLabelledBy }
105+ { ...props }
106+ ref = { listRef }
107+ className = { className }
108+ >
109+ { childrenWithoutSlots }
110+ </ ListBox >
111+ ) }
77112 </ ListContext . Provider >
78113 )
79114 } ,
0 commit comments