Skip to content

Commit 776de1b

Browse files
jonrohanprimer[bot]
andcommitted
chore(ActionList): Remove the CSS modules feature flag from the ActionList.Divider component (#6022)
Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com>
1 parent 95035a2 commit 776de1b

File tree

3 files changed

+11
-44
lines changed

3 files changed

+11
-44
lines changed

.changeset/curvy-lions-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': minor
3+
---
4+
5+
Remove the CSS modules feature flag from the ActionList.Divider component
Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import React from 'react'
2-
import Box from '../Box'
3-
import {get} from '../constants'
4-
import type {Theme} from '../ThemeProvider'
52
import type {SxProp} from '../sx'
6-
import {merge} from '../sx'
73
import {clsx} from 'clsx'
8-
import {useFeatureFlag} from '../FeatureFlags'
94
import classes from './ActionList.module.css'
105
import {defaultSxProp} from '../utils/defaultSxProp'
11-
import {actionListCssModulesFlag} from './featureflag'
6+
import {BoxWithFallback} from '../internal/components/BoxWithFallback'
127

138
export 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
*/
2015
export 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'

packages/react/src/NavList/__snapshots__/NavList.test.tsx.snap

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,6 @@ exports[`NavList renders a simple list 1`] = `
440440
`;
441441

442442
exports[`NavList renders with groups 1`] = `
443-
.c0 {
444-
height: 1px;
445-
background-color: var(--borderColor-muted,var(--color-action-list-item-inline-divider,rgba(208,215,222,0.48)));
446-
margin-top: calc(8px - 1px);
447-
margin-bottom: 8px;
448-
list-style: none;
449-
}
450-
451443
.c0:first-child {
452444
display: none;
453445
}
@@ -821,7 +813,7 @@ exports[`NavList renders with groups 1`] = `
821813
>
822814
<li
823815
aria-hidden="true"
824-
class="c0"
816+
class="c0 Divider"
825817
data-component="ActionList.Divider"
826818
/>
827819
<li
@@ -876,7 +868,7 @@ exports[`NavList renders with groups 1`] = `
876868
</li>
877869
<li
878870
aria-hidden="true"
879-
class="c0"
871+
class="c0 Divider"
880872
data-component="ActionList.Divider"
881873
/>
882874
<li

0 commit comments

Comments
 (0)