@@ -27,6 +27,8 @@ import {SkeletonText} from '../experimental/Skeleton/SkeletonText'
27
27
import { toggleStyledComponent } from '../internal/utils/toggleStyledComponent'
28
28
import { useFeatureFlag } from '../FeatureFlags'
29
29
30
+ const CSS_MODULES_FEATURE_FLAG = 'primer_react_css_modules_staff'
31
+
30
32
// ----------------------------------------------------------------------------
31
33
// Context
32
34
@@ -78,7 +80,7 @@ export type TreeViewProps = {
78
80
const TOGGLE_ICON_SIZE = 12
79
81
80
82
const UlBox = toggleStyledComponent (
81
- 'primer_react_css_modules_team' ,
83
+ CSS_MODULES_FEATURE_FLAG ,
82
84
'ul' ,
83
85
styled . ul < SxProp > `
84
86
list-style: none;
@@ -338,7 +340,7 @@ const Root: React.FC<TreeViewProps> = ({
338
340
expandedStateCache . current = new Map ( )
339
341
}
340
342
341
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
343
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
342
344
343
345
return (
344
346
< RootContext . Provider
@@ -484,7 +486,7 @@ const Item = React.forwardRef<HTMLElement, TreeViewItemProps>(
484
486
slots . trailingVisual ? trailingVisualId : null ,
485
487
] . filter ( Boolean )
486
488
487
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
489
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
488
490
489
491
return (
490
492
< ItemContext . Provider
@@ -612,7 +614,7 @@ const Item = React.forwardRef<HTMLElement, TreeViewItemProps>(
612
614
613
615
/** Lines to indicate the depth of an item in a TreeView */
614
616
const LevelIndicatorLines : React . FC < { level : number } > = ( { level} ) => {
615
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
617
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
616
618
return (
617
619
< div style = { { width : '100%' , display : 'flex' } } >
618
620
{ Array . from ( { length : level - 1 } ) . map ( ( _ , index ) => (
@@ -767,7 +769,7 @@ function usePreviousValue<T>(value: T): T {
767
769
}
768
770
769
771
const StyledSkeletonItemContainer = toggleStyledComponent (
770
- 'primer_react_css_modules_team' ,
772
+ CSS_MODULES_FEATURE_FLAG ,
771
773
'span' ,
772
774
styled . span . attrs ( {
773
775
className : 'PRIVATE_TreeView-item-skeleton' ,
@@ -804,15 +806,15 @@ const StyledSkeletonItemContainer = toggleStyledComponent(
804
806
)
805
807
806
808
const StyledSkeletonText = toggleStyledComponent (
807
- 'primer_react_css_modules_team' ,
809
+ CSS_MODULES_FEATURE_FLAG ,
808
810
SkeletonText ,
809
811
styled ( SkeletonText ) `
810
812
width: var(--tree-item-loading-width, 67%);
811
813
` ,
812
814
)
813
815
814
816
const SkeletonItem = ( ) => {
815
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
817
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
816
818
return (
817
819
< StyledSkeletonItemContainer
818
820
className = { clsx (
@@ -835,7 +837,7 @@ type LoadingItemProps = {
835
837
836
838
const LoadingItem = React . forwardRef < HTMLElement , LoadingItemProps > ( ( { count} , ref ) => {
837
839
const itemId = useId ( )
838
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
840
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
839
841
840
842
if ( count ) {
841
843
return (
@@ -897,7 +899,7 @@ export type TreeViewVisualProps = {
897
899
}
898
900
899
901
const LeadingVisual : React . FC < TreeViewVisualProps > = props => {
900
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
902
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
901
903
const { isExpanded, leadingVisualId} = React . useContext ( ItemContext )
902
904
const children = typeof props . children === 'function' ? props . children ( { isExpanded} ) : props . children
903
905
return (
@@ -922,7 +924,7 @@ const LeadingVisual: React.FC<TreeViewVisualProps> = props => {
922
924
LeadingVisual . displayName = 'TreeView.LeadingVisual'
923
925
924
926
const TrailingVisual : React . FC < TreeViewVisualProps > = props => {
925
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
927
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
926
928
const { isExpanded, trailingVisualId} = React . useContext ( ItemContext )
927
929
const children = typeof props . children === 'function' ? props . children ( { isExpanded} ) : props . children
928
930
return (
@@ -950,7 +952,7 @@ TrailingVisual.displayName = 'TreeView.TrailingVisual'
950
952
// TreeView.LeadingAction
951
953
952
954
const LeadingAction : React . FC < TreeViewVisualProps > = props => {
953
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
955
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
954
956
const { isExpanded} = React . useContext ( ItemContext )
955
957
const children = typeof props . children === 'function' ? props . children ( { isExpanded} ) : props . children
956
958
return (
@@ -978,7 +980,7 @@ LeadingAction.displayName = 'TreeView.LeadingAction'
978
980
// TreeView.DirectoryIcon
979
981
980
982
const DirectoryIcon = ( ) => {
981
- const cssModulesEnabled = useFeatureFlag ( 'primer_react_css_modules_team' )
983
+ const cssModulesEnabled = useFeatureFlag ( CSS_MODULES_FEATURE_FLAG )
982
984
const { isExpanded} = React . useContext ( ItemContext )
983
985
const Icon = isExpanded ? FileDirectoryOpenFillIcon : FileDirectoryFillIcon
984
986
return (
0 commit comments