11import React from 'react'
2- import Box from '../Box'
3- import { get } from '../constants'
4- import type { Theme } from '../ThemeProvider'
52import type { SxProp } from '../sx'
6- import { merge } from '../sx'
73import { clsx } from 'clsx'
8- import { useFeatureFlag } from '../FeatureFlags'
94import classes from './ActionList.module.css'
105import { defaultSxProp } from '../utils/defaultSxProp'
11- import { actionListCssModulesFlag } from './featureflag '
6+ import { BoxWithFallback } from '../internal/components/BoxWithFallback '
127
138export type ActionListDividerProps = SxProp & {
149 className ?: string
@@ -18,38 +13,13 @@ export type ActionListDividerProps = SxProp & {
1813 * Visually separates `Item`s or `Group`s in an `ActionList`.
1914 */
2015export const Divider : React . FC < React . PropsWithChildren < ActionListDividerProps > > = ( { sx = defaultSxProp , className} ) => {
21- const enabled = useFeatureFlag ( actionListCssModulesFlag )
22- if ( enabled ) {
23- if ( sx !== defaultSxProp ) {
24- return (
25- < Box
26- className = { clsx ( className , classes . Divider ) }
27- as = "li"
28- aria-hidden = "true"
29- sx = { sx }
30- data-component = "ActionList.Divider"
31- />
32- )
33- }
34- return < li className = { clsx ( className , classes . Divider ) } aria-hidden = "true" data-component = "ActionList.Divider" />
35- }
3616 return (
37- < Box
17+ < BoxWithFallback
18+ className = { clsx ( className , classes . Divider ) }
3819 as = "li"
3920 aria-hidden = "true"
40- sx = { merge (
41- {
42- height : 1 ,
43- backgroundColor : 'actionListItem.inlineDivider' ,
44- marginTop : ( theme : Theme ) => `calc(${ get ( 'space.2' ) ( theme ) } - 1px)` ,
45- marginBottom : 2 ,
46- listStyle : 'none' , // hide the ::marker inserted by browser's stylesheet
47- } ,
48- sx as SxProp ,
49- ) }
50- className = { className }
21+ sx = { sx }
5122 data-component = "ActionList.Divider"
5223 />
5324 )
5425}
55- Divider . displayName = 'ActionList.Divider'
0 commit comments