-
Notifications
You must be signed in to change notification settings - Fork 646
chore(ActionList): Remove the CSS modules feature flag from the ActionList/List component #6019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
790fdd0
Remove the CSS modules feature flag from the ActionList/List component
jonrohan 251601f
Remove the extra VRT runs with the CSS module flags enabled (#6016)
jonrohan 7601861
primer_react_select_panel_order_selected_at_top off by default (#6024)
francinelucca d2eda00
Release tracking (#6011)
primer[bot] dd71678
Fix extra padding on SelectPanel with groups (#6009)
francinelucca 95035a2
refactor: update tests to vitest, move all component tests to folders…
joshblack 776de1b
chore(ActionList): Remove the CSS modules feature flag from the Actio…
jonrohan dfa203d
chore(ActionList): Remove the CSS modules feature flag from the Actio…
jonrohan 00d9b1d
Remove the CSS modules feature flag from Pagination component (#5997)
jamieshark dbd7115
chore(Token): Remove the CSS modules feature flag from the Token comp…
jonrohan fc1926e
Merge branch 'main' into css_modules_remove_flag/actionlist_list
jonrohan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': minor | ||
| --- | ||
|
|
||
| Remove the CSS modules feature flag from the ActionList/List component |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,5 @@ | ||||||||||||||||||||
| import React from 'react' | ||||||||||||||||||||
| import type {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/polymorphic' | ||||||||||||||||||||
| import styled from 'styled-components' | ||||||||||||||||||||
| import type {SxProp} from '../sx' | ||||||||||||||||||||
| import sx, {merge} from '../sx' | ||||||||||||||||||||
| import {ActionListContainerContext} from './ActionListContainerContext' | ||||||||||||||||||||
| import {defaultSxProp} from '../utils/defaultSxProp' | ||||||||||||||||||||
| import {useSlots} from '../hooks/useSlots' | ||||||||||||||||||||
|
|
@@ -12,24 +9,14 @@ import {ListContext, type ActionListProps} from './shared' | |||||||||||||||||||
| import {useProvidedRefOrCreate} from '../hooks' | ||||||||||||||||||||
| import {FocusKeys, useFocusZone} from '../hooks/useFocusZone' | ||||||||||||||||||||
| import {clsx} from 'clsx' | ||||||||||||||||||||
| import {useFeatureFlag} from '../FeatureFlags' | ||||||||||||||||||||
| import classes from './ActionList.module.css' | ||||||||||||||||||||
| import {actionListCssModulesFlag} from './featureflag' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| const ListBox = styled.ul<SxProp>(sx) | ||||||||||||||||||||
| import {BoxWithFallback} from '../internal/components/BoxWithFallback' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export const List = React.forwardRef<HTMLUListElement, ActionListProps>( | ||||||||||||||||||||
| ( | ||||||||||||||||||||
| {variant = 'inset', selectionVariant, showDividers = false, role, sx: sxProp = defaultSxProp, className, ...props}, | ||||||||||||||||||||
| forwardedRef, | ||||||||||||||||||||
| ): JSX.Element => { | ||||||||||||||||||||
| const styles = { | ||||||||||||||||||||
| margin: 0, | ||||||||||||||||||||
| paddingInlineStart: 0, // reset ul styles | ||||||||||||||||||||
| paddingTop: variant === 'inset' ? 2 : 0, | ||||||||||||||||||||
| paddingBottom: variant === 'inset' || variant === 'horizontal-inset' ? 2 : 0, | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| const [slots, childrenWithoutSlots] = useSlots(props.children, { | ||||||||||||||||||||
| heading: Heading, | ||||||||||||||||||||
| }) | ||||||||||||||||||||
|
|
@@ -59,8 +46,6 @@ export const List = React.forwardRef<HTMLUListElement, ActionListProps>( | |||||||||||||||||||
| focusOutBehavior: listRole === 'menu' ? 'wrap' : undefined, | ||||||||||||||||||||
| }) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| const enabled = useFeatureFlag(actionListCssModulesFlag) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| return ( | ||||||||||||||||||||
| <ListContext.Provider | ||||||||||||||||||||
| value={{ | ||||||||||||||||||||
|
|
@@ -72,45 +57,19 @@ export const List = React.forwardRef<HTMLUListElement, ActionListProps>( | |||||||||||||||||||
| }} | ||||||||||||||||||||
| > | ||||||||||||||||||||
| {slots.heading} | ||||||||||||||||||||
| {enabled ? ( | ||||||||||||||||||||
| sxProp !== defaultSxProp ? ( | ||||||||||||||||||||
| <ListBox | ||||||||||||||||||||
| sx={merge(styles, sxProp as SxProp)} | ||||||||||||||||||||
| className={clsx(classes.ActionList, className)} | ||||||||||||||||||||
| role={listRole} | ||||||||||||||||||||
| aria-labelledby={ariaLabelledBy} | ||||||||||||||||||||
| ref={listRef} | ||||||||||||||||||||
| data-dividers={showDividers} | ||||||||||||||||||||
| data-variant={variant} | ||||||||||||||||||||
| {...props} | ||||||||||||||||||||
| > | ||||||||||||||||||||
| {childrenWithoutSlots} | ||||||||||||||||||||
| </ListBox> | ||||||||||||||||||||
| ) : ( | ||||||||||||||||||||
| <ul | ||||||||||||||||||||
| className={clsx(classes.ActionList, className)} | ||||||||||||||||||||
| role={listRole} | ||||||||||||||||||||
| aria-labelledby={ariaLabelledBy} | ||||||||||||||||||||
| ref={listRef} | ||||||||||||||||||||
| data-dividers={showDividers} | ||||||||||||||||||||
| data-variant={variant} | ||||||||||||||||||||
| {...props} | ||||||||||||||||||||
| > | ||||||||||||||||||||
| {childrenWithoutSlots} | ||||||||||||||||||||
| </ul> | ||||||||||||||||||||
| ) | ||||||||||||||||||||
| ) : ( | ||||||||||||||||||||
| <ListBox | ||||||||||||||||||||
| sx={merge(styles, sxProp as SxProp)} | ||||||||||||||||||||
| role={listRole} | ||||||||||||||||||||
| aria-labelledby={ariaLabelledBy} | ||||||||||||||||||||
| {...props} | ||||||||||||||||||||
| ref={listRef} | ||||||||||||||||||||
| className={className} | ||||||||||||||||||||
| > | ||||||||||||||||||||
| {childrenWithoutSlots} | ||||||||||||||||||||
| </ListBox> | ||||||||||||||||||||
| )} | ||||||||||||||||||||
| <BoxWithFallback | ||||||||||||||||||||
| as="ul" | ||||||||||||||||||||
| sx={sxProp} | ||||||||||||||||||||
|
||||||||||||||||||||
| sx={sxProp} | |
| sx={merge( | |
| { | |
| margin: 0, | |
| paddingInlineStart: 0, | |
| ...(variant === 'inset' && {paddingY: 2}), | |
| }, | |
| sxProp, | |
| )} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The forwarded ref (
forwardedReforlistRef) is no longer passed toBoxWithFallback, which may break focus management and other ref-dependent logic. Passref={listRef}(orforwardedRef) to ensure ref forwarding works correctly.