Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c0531e7
chore: remove remaining styled-system components:
francinelucca Oct 3, 2025
375cc73
minor fixes
francinelucca Oct 3, 2025
0ae93e7
fixes
francinelucca Oct 3, 2025
5420180
re-add file
francinelucca Oct 3, 2025
a891a19
format
francinelucca Oct 3, 2025
794628b
fix tests
francinelucca Oct 3, 2025
6a9da25
Update version of @primer/react and change message
francinelucca Oct 3, 2025
9eb678e
tooltip
francinelucca Oct 3, 2025
a0e187e
Merge branch 'chore/remove-styled-system' of github.com:primer/react …
francinelucca Oct 3, 2025
bb8340e
format
francinelucca Oct 3, 2025
cebcc49
change color
francinelucca Oct 3, 2025
865a922
remove unused import
francinelucca Oct 3, 2025
ace1d27
tooltip classes
francinelucca Oct 3, 2025
634dbad
item migration
francinelucca Oct 3, 2025
54f59cd
format
francinelucca Oct 3, 2025
ab8d2ac
remove unused import
francinelucca Oct 3, 2025
aac29d7
type fix
francinelucca Oct 3, 2025
ab804c2
remove needless disables
francinelucca Oct 3, 2025
eb2196f
remove needless disables
francinelucca Oct 3, 2025
ae92cb4
forward as
francinelucca Oct 3, 2025
9ceb936
type fix?
francinelucca Oct 3, 2025
548f739
type fixes
francinelucca Oct 3, 2025
f876873
remove sx
liuliu-dev Oct 3, 2025
5cbd7ab
export in styled-react and remove sx from stories
liuliu-dev Oct 3, 2025
55dd0ac
line height
liuliu-dev Oct 3, 2025
ff011f4
changeset
liuliu-dev Oct 3, 2025
dbb553f
margin left
liuliu-dev Oct 3, 2025
d9d3bf3
classname
liuliu-dev Oct 3, 2025
96d5d92
lint fix
liuliu-dev Oct 3, 2025
f1ffe0d
remove Box
liuliu-dev Oct 3, 2025
b3659c1
vrt test fix
liuliu-dev Oct 3, 2025
d854b46
Merge branch 'chore/remove-styled-system' of https://github.com/prime…
liuliu-dev Oct 3, 2025
dd81e9d
Merge branch 'chore/remove-styled-system' into liuliu/removex-sx-in-d…
liuliu-dev Oct 3, 2025
69cfa2f
export
liuliu-dev Oct 3, 2025
e79a5ac
Merge branch 'liuliu/removex-sx-in-deprecated-actionlist' of https://…
liuliu-dev Oct 3, 2025
2013b64
check ref type
liuliu-dev Oct 3, 2025
edccc60
update snapshots
liuliu-dev Oct 3, 2025
16f8460
styled?
liuliu-dev Oct 3, 2025
91e48dc
tooltip fix?
liuliu-dev Oct 4, 2025
72bc381
revert unneeded changes
francinelucca Oct 6, 2025
0c70caf
revert unneeded changes
francinelucca Oct 6, 2025
3660b63
revert changes
francinelucca Oct 6, 2025
1f90ea0
revert changes
francinelucca Oct 6, 2025
4af66c1
revert changes
francinelucca Oct 6, 2025
f11be38
revert unneeded changes
francinelucca Oct 6, 2025
60d2933
Merge branch 'main' into liuliu/removex-sx-in-deprecated-actionlist
francinelucca Oct 6, 2025
f1fb735
Merge branch 'main' into liuliu/removex-sx-in-deprecated-actionlist
francinelucca Oct 6, 2025
f542c92
fix visual regressions in Actions story
llastflowers Oct 6, 2025
53792e0
fix visual regressions in Complex List stories
llastflowers Oct 6, 2025
96995d1
fix regression in Item.tsx that was visible in Multi Select story
llastflowers Oct 6, 2025
0c217c9
hardcode line-height for consistency
llastflowers Oct 6, 2025
7864e98
fix border color discrepancy
llastflowers Oct 6, 2025
845ed0f
Merge branch 'main' into liuliu/removex-sx-in-deprecated-actionlist
llastflowers Oct 6, 2025
80915d6
fix lint problem
llastflowers Oct 6, 2025
1627f96
update merge conflict fix
llastflowers Oct 6, 2025
31fac89
move octicons to deprecated
francinelucca Oct 7, 2025
8bcca65
Merge branch 'main' into liuliu/removex-sx-in-deprecated-actionlist
francinelucca Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/afraid-teams-throw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@primer/react': major
'@primer/styled-react': minor
---

Remove sx from deprecated ActionList component.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
overflow: hidden;
}

.Header {
/* stylelint-disable-next-line primer/box-shadow */
box-shadow: 0 1px 0 var(--borderColor-default);
z-index: 1;
}

.Container {
display: flex;
height: 100%;
Expand Down
11 changes: 2 additions & 9 deletions packages/react/src/FilteredActionList/FilteredActionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import {scrollIntoView, FocusKeys} from '@primer/behaviors'
import type {KeyboardEventHandler} from 'react'
import type React from 'react'
import {useCallback, useEffect, useRef, useState} from 'react'
import styled from 'styled-components'
import type {TextInputProps} from '../TextInput'
import TextInput from '../TextInput'
import {get} from '../constants'
import {ActionList} from '../ActionList'
import type {GroupedListProps, ListPropsBase, ItemInput, RenderItemFn} from './'
import {useFocusZone} from '../hooks/useFocusZone'
Expand Down Expand Up @@ -49,11 +47,6 @@ export interface FilteredActionListProps extends Partial<Omit<GroupedListProps,
onSelectAllChange?: (checked: boolean) => void
}

const StyledHeader = styled.div`
box-shadow: 0 1px 0 ${get('colors.border.default')};
z-index: 1;
`

export function FilteredActionList({
loading = false,
placeholderText,
Expand Down Expand Up @@ -346,7 +339,7 @@ export function FilteredActionList({

return (
<div ref={inputAndListContainerRef} className={clsx(className, classes.Root)} data-testid="filtered-action-list">
<StyledHeader>
<div className={classes.Header}>
<TextInput
ref={inputRef}
block
Expand All @@ -368,7 +361,7 @@ export function FilteredActionList({
className={clsx(textInputClassName, {[classes.FullScreenTextInput]: fullScreenOnNarrow})}
{...restTextInputProps}
/>
</StyledHeader>
</div>
<VisuallyHidden id={inputDescriptionTextId}>Items will be filtered as you type</VisuallyHidden>
{onSelectAllChange !== undefined && (
<div className={classes.SelectAllContainer}>
Expand Down
8 changes: 8 additions & 0 deletions packages/react/src/deprecated/ActionList/Divider.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.Divider {
height: var(--borderWidth-thin);
/* stylelint-disable-next-line primer/colors */
background: var(--borderColor-muted);
/* stylelint-disable-next-line primer/spacing */
margin-top: calc(var(--base-size-8) - 1px);
margin-bottom: var(--base-size-8);
}
14 changes: 3 additions & 11 deletions packages/react/src/deprecated/ActionList/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import styled from 'styled-components'
import {get} from '../../constants'

export const StyledDivider = styled.div`
height: 1px;
background: ${get('colors.border.muted')};
margin-top: calc(${get('space.2')} - 1px);
margin-bottom: ${get('space.2')};
`
import classes from './Divider.module.css'

/**
* Visually separates `Item`s or `Group`s in an `ActionList`.
* Visually separates `Items or `Groups in an `ActionList`.
*/
export function Divider(): JSX.Element {
return <StyledDivider />
return <div data-component="ActionList.Divider" className={classes.Divider} />
}

/**
Expand Down
13 changes: 3 additions & 10 deletions packages/react/src/deprecated/ActionList/Group.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import type React from 'react'
import styled from 'styled-components'
import type {SxProp} from '../../sx'
import sx from '../../sx'
import type {HeaderProps} from './Header'
import {Header} from './Header'

/**
* Contract for props passed to the `Group` component.
*/
export interface GroupProps extends React.ComponentPropsWithoutRef<'div'>, SxProp {
export interface GroupProps extends React.ComponentPropsWithoutRef<'div'> {
/**
* Props for a `Header` to render in the `Group`.
*/
Expand All @@ -30,18 +27,14 @@ export interface GroupProps extends React.ComponentPropsWithoutRef<'div'>, SxPro
showItemDividers?: boolean
}

const StyledGroup = styled.div`
${sx}
`

/**
* Collects related `Items` in an `ActionList`.
*/
export function Group({header, items, ...props}: GroupProps): JSX.Element {
return (
<StyledGroup {...props}>
<div {...props}>
{header && <Header {...header} />}
{items}
</StyledGroup>
</div>
)
}
25 changes: 25 additions & 0 deletions packages/react/src/deprecated/ActionList/Header.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.Header {
/* 6px vertical padding + 20px line height = 32px total height
*
* TODO: When rem-based spacing on a 4px scale lands, replace
* hardcoded '6px' with 'calc((${get('space.s32')} - ${get('space.20')}) / 2)'.
*/
/* stylelint-disable-next-line primer/spacing */
padding: 6px var(--base-size-16);
font-size: var(--text-body-size-small);
font-weight: var(--text-title-weight-large);
color: var(--fgColor-muted);

&:where([data-filled]) {
background: var(--bgColor-muted);
margin: var(--base-size-8) 0;
/* stylelint-disable-next-line primer/colors */
border-top: var(--borderWidth-thin) solid var(--bgColor-neutral-muted);
/* stylelint-disable-next-line primer/colors */
border-bottom: var(--borderWidth-thin) solid var(--bgColor-neutral-muted);

&:first-child {
margin-top: 0;
}
}
}
48 changes: 12 additions & 36 deletions packages/react/src/deprecated/ActionList/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import type React from 'react'
import styled, {css} from 'styled-components'
import {get} from '../../constants'
import type {SxProp} from '../../sx'
import sx from '../../sx'
import {clsx} from 'clsx'
import classes from './Header.module.css'

/**
* Contract for props passed to the `Header` component.
*/
export interface HeaderProps extends React.ComponentPropsWithoutRef<'div'>, SxProp {
export interface HeaderProps extends React.ComponentPropsWithoutRef<'div'> {
/**
* Style variations. Usage is discretionary.
*
Expand All @@ -27,35 +25,6 @@ export interface HeaderProps extends React.ComponentPropsWithoutRef<'div'>, SxPr
auxiliaryText?: string
}

export const StyledHeader = styled.div<{variant: HeaderProps['variant']} & SxProp>`
{
/* 6px vertical padding + 20px line height = 32px total height
*
* TODO: When rem-based spacing on a 4px scale lands, replace
* hardcoded '6px' with 'calc((${get('space.s32')} - ${get('space.20')}) / 2)'.
*/
}
padding: 6px ${get('space.3')};
font-size: ${get('fontSizes.0')};
font-weight: ${get('fontWeights.bold')};
color: ${get('colors.fg.muted')};

${({variant}) =>
variant === 'filled' &&
css`
background: ${get('colors.canvas.subtle')};
margin: ${get('space.2')} 0;
border-top: 1px solid ${get('colors.neutral.muted')};
border-bottom: 1px solid ${get('colors.neutral.muted')};

&:first-child {
margin-top: 0;
}
`}

${sx}
`

/**
* Displays the name and description of a `Group`.
*/
Expand All @@ -64,12 +33,19 @@ export function Header({
title,
auxiliaryText,
children: _children,
className,
...props
}: HeaderProps): JSX.Element {
return (
<StyledHeader role="heading" variant={variant} {...props}>
<div
role="heading"
className={clsx(className, classes.Header)}
data-filled={variant === 'filled' ? '' : undefined}
data-component="ActionList.Header"
{...props}
>
{title}
{auxiliaryText && <span>{auxiliaryText}</span>}
</StyledHeader>
</div>
)
}
Loading
Loading