From de9df1e3509ec1f7e0fc42e867cab22d09456124 Mon Sep 17 00:00:00 2001 From: llastflowers Date: Tue, 23 Sep 2025 15:22:09 -0700 Subject: [PATCH 01/50] remove sx from docs --- .../react/src/ActionList/ActionList.docs.json | 56 ------------------- packages/react/src/ActionList/Divider.tsx | 3 +- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/packages/react/src/ActionList/ActionList.docs.json b/packages/react/src/ActionList/ActionList.docs.json index 6afbe71c766..ccaf7865466 100644 --- a/packages/react/src/ActionList/ActionList.docs.json +++ b/packages/react/src/ActionList/ActionList.docs.json @@ -36,11 +36,6 @@ "type": "AriaRole", "defaultValue": "", "description": "ARIA role describing the function of the list. `listbox` and `menu` are a common values." - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ], "subcomponents": [ @@ -113,11 +108,6 @@ "required": false, "description": "id to attach to the root element of the Item", "defaultValue": "" - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ] }, @@ -144,11 +134,6 @@ "required": false, "description": "", "defaultValue": "" - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ] }, @@ -183,11 +168,6 @@ "required": false, "description": "Text describing why the item is inactive. This may be used when an item's usual functionality\nis unavailable due to a system error such as a database outage.", "defaultValue": "" - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ], "passthrough": { @@ -204,11 +184,6 @@ "defaultValue": "", "required": true, "description": "Icon (or similar) positioned before item text." - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ] }, @@ -221,11 +196,6 @@ "defaultValue": "", "required": true, "description": "Visual positioned after item text." - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ] }, @@ -282,11 +252,6 @@ "defaultValue": "'inline'", "description": "`inline` descriptions are positioned beside primary text. `block` descriptions are positioned below primary text." }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true - }, { "name": "className", "type": "string | undefined", @@ -337,11 +302,6 @@ "defaultValue": "h3", "required": false, "description": "The level of the heading and it is only required (enforce by runtime warning) for lists. (i.e. not required for ActionMenu or listbox roles)" - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ] }, @@ -385,22 +345,6 @@ "type": "AriaRole", "defaultValue": "", "description": "ARIA role describing the function of the list inside the group. `listbox` and `menu` are a common values." - }, - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true - } - ] - }, - { - "filePath": "/Users/mperrotti/work-dir/react/packages/react/src/ActionList/Divider.tsx", - "name": "ActionList.Divider", - "props": [ - { - "name": "sx", - "type": "SystemStyleObject", - "deprecated": true } ] } diff --git a/packages/react/src/ActionList/Divider.tsx b/packages/react/src/ActionList/Divider.tsx index 5caa365a49c..e6622594278 100644 --- a/packages/react/src/ActionList/Divider.tsx +++ b/packages/react/src/ActionList/Divider.tsx @@ -4,7 +4,7 @@ import {clsx} from 'clsx' import classes from './ActionList.module.css' import {BoxWithFallback} from '../internal/components/BoxWithFallback' -export type ActionListDividerProps = SxProp & { +export type ActionListDividerProps = { className?: string } @@ -17,7 +17,6 @@ export const Divider: React.FC> className={clsx(className, classes.Divider)} as="li" aria-hidden="true" - sx={sx} data-component="ActionList.Divider" /> ) From 91be929ea9cde4718ff2428ae956c63a9ed862e9 Mon Sep 17 00:00:00 2001 From: llastflowers Date: Tue, 23 Sep 2025 15:22:31 -0700 Subject: [PATCH 02/50] remove sx from ActionList/Divider --- packages/react/src/ActionList/Divider.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react/src/ActionList/Divider.tsx b/packages/react/src/ActionList/Divider.tsx index e6622594278..4576332fd2d 100644 --- a/packages/react/src/ActionList/Divider.tsx +++ b/packages/react/src/ActionList/Divider.tsx @@ -1,5 +1,4 @@ import type React from 'react' -import type {SxProp} from '../sx' import {clsx} from 'clsx' import classes from './ActionList.module.css' import {BoxWithFallback} from '../internal/components/BoxWithFallback' @@ -11,7 +10,7 @@ export type ActionListDividerProps = { /** * Visually separates `Item`s or `Group`s in an `ActionList`. */ -export const Divider: React.FC> = ({sx, className}) => { +export const Divider: React.FC> = ({className}) => { return ( Date: Tue, 23 Sep 2025 15:23:16 -0700 Subject: [PATCH 03/50] remove sx from ActionList/Description --- packages/react/src/ActionList/Description.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/react/src/ActionList/Description.tsx b/packages/react/src/ActionList/Description.tsx index c4624c6f061..cb1e7bd425d 100644 --- a/packages/react/src/ActionList/Description.tsx +++ b/packages/react/src/ActionList/Description.tsx @@ -1,6 +1,5 @@ import React from 'react' import Truncate from '../Truncate' -import type {SxProp} from '../sx' import {ItemContext} from './shared' import classes from './ActionList.module.css' import {BoxWithFallback} from '../internal/components/BoxWithFallback' @@ -20,11 +19,10 @@ export type ActionListDescriptionProps = { * Whether the inline description should truncate the text on overflow. */ truncate?: boolean -} & SxProp +} export const Description: React.FC> = ({ variant = 'inline', - sx, className, truncate, ...props @@ -47,7 +45,6 @@ export const Description: React.FC Date: Tue, 23 Sep 2025 15:30:25 -0700 Subject: [PATCH 04/50] remove sx from ActionList/Group --- packages/react/src/ActionList/Group.tsx | 32 ++++++++----------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/packages/react/src/ActionList/Group.tsx b/packages/react/src/ActionList/Group.tsx index 5fbb20ed254..10fec9a3934 100644 --- a/packages/react/src/ActionList/Group.tsx +++ b/packages/react/src/ActionList/Group.tsx @@ -1,6 +1,5 @@ import React from 'react' import {useId} from '../hooks/useId' -import type {SxProp} from '../sx' import {ListContext, type ActionListProps} from './shared' import type {ActionListHeadingProps} from './Heading' import {useSlots} from '../hooks/useSlots' @@ -8,14 +7,13 @@ import {invariant} from '../utils/invariant' import {clsx} from 'clsx' import classes from './ActionList.module.css' import groupClasses from './Group.module.css' -import {BoxWithFallback} from '../internal/components/BoxWithFallback' type HeadingProps = { as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' className?: string children: React.ReactNode id?: string -} & SxProp +} const Heading: React.FC> = ({ as: Component = 'h3', @@ -25,10 +23,9 @@ const Heading: React.FC> ...rest }) => { return ( - // Box is temporary to support lingering sx usage - + {children} - + ) } @@ -58,12 +55,11 @@ export type ActionListGroupProps = React.HTMLAttributes & { * Secondary text which provides additional information about a `Group`. */ auxiliaryText?: string -} & SxProp & { - /** - * Whether multiple Items or a single Item can be selected in the Group. Overrides value on ActionList root. - */ - selectionVariant?: ActionListProps['selectionVariant'] | false - } + /** + * Whether multiple Items or a single Item can be selected in the Group. Overrides value on ActionList root. + */ + selectionVariant?: ActionListProps['selectionVariant'] | false +} type ContextProps = Pick & {groupHeadingId: string | undefined} export const GroupContext = React.createContext({ @@ -101,12 +97,7 @@ export const Group: React.FC> = ({ } return ( - +
  • {title && !slots.groupHeading ? ( // Escape hatch: supports old API in a non breaking way @@ -126,13 +117,12 @@ export const Group: React.FC> = ({ {slots.groupHeading ? childrenWithoutSlots : props.children} - +
  • ) } export type ActionListGroupHeadingProps = Pick & Omit & - SxProp & React.HTMLAttributes & { as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' headingWrapElement?: 'div' | 'li' @@ -156,7 +146,6 @@ export const GroupHeading: React.FC { @@ -208,7 +197,6 @@ export const GroupHeading: React.FC {_internalBackwardCompatibleTitle ?? children} From bc4c9f5230e8de38487b4ef003322c816a9cecd7 Mon Sep 17 00:00:00 2001 From: llastflowers Date: Tue, 23 Sep 2025 15:36:32 -0700 Subject: [PATCH 05/50] remove sx from ActionList/Heading --- packages/react/src/ActionList/Heading.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react/src/ActionList/Heading.tsx b/packages/react/src/ActionList/Heading.tsx index 55f858f6db2..a59e9be08ca 100644 --- a/packages/react/src/ActionList/Heading.tsx +++ b/packages/react/src/ActionList/Heading.tsx @@ -1,5 +1,4 @@ import React, {forwardRef} from 'react' -import type {SxProp} from '../sx' import {useRefObjectAsForwardedRef} from '../hooks' import type {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/polymorphic' import {default as HeadingComponent} from '../Heading' @@ -17,7 +16,7 @@ export type ActionListHeadingProps = { size?: HeadingVariants visuallyHidden?: boolean className?: string -} & SxProp +} export const Heading = forwardRef(({as, size, children, visuallyHidden = false, className, ...props}, forwardedRef) => { const innerRef = React.useRef(null) From 4ded00ee10e6792e8f475ca1845087a434545925 Mon Sep 17 00:00:00 2001 From: llastflowers Date: Mon, 29 Sep 2025 11:56:12 -0700 Subject: [PATCH 06/50] re-remove sx and BoxWithFallback from ActionList/Item.tsx --- packages/react/src/ActionList/Item.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/react/src/ActionList/Item.tsx b/packages/react/src/ActionList/Item.tsx index 65408b623b4..de12e491d8c 100644 --- a/packages/react/src/ActionList/Item.tsx +++ b/packages/react/src/ActionList/Item.tsx @@ -15,7 +15,6 @@ import {invariant} from '../utils/invariant' import VisuallyHidden from '../_VisuallyHidden' import classes from './ActionList.module.css' import {clsx} from 'clsx' -import {BoxWithFallback} from '../internal/components/BoxWithFallback' import {fixedForwardRef} from '../utils/modern-polymorphic' type ActionListSubItemProps = { @@ -57,7 +56,6 @@ const UnwrappedItem = ( selected = undefined, active = false, onSelect: onSelectUser, - sx: sxProp, id, role, loading, @@ -246,10 +244,8 @@ const UnwrappedItem = ( trailingVisualId, }} > - ( {!inactive && !loading && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction} {slots.subItem} - + ) } From 06f10ffb26998fd0b31e1738d17274d08a991b5a Mon Sep 17 00:00:00 2001 From: llastflowers Date: Mon, 29 Sep 2025 11:56:36 -0700 Subject: [PATCH 07/50] re-remove sx and BoxWithFallback from ActionList/List.tsx --- packages/react/src/ActionList/List.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/react/src/ActionList/List.tsx b/packages/react/src/ActionList/List.tsx index 97ead828fea..c5c3860f6fb 100644 --- a/packages/react/src/ActionList/List.tsx +++ b/packages/react/src/ActionList/List.tsx @@ -9,7 +9,6 @@ import {useProvidedRefOrCreate} from '../hooks' import {FocusKeys, useFocusZone} from '../hooks/useFocusZone' import {clsx} from 'clsx' import classes from './ActionList.module.css' -import {BoxWithFallback} from '../internal/components/BoxWithFallback' const UnwrappedList = ( props: ActionListProps, @@ -67,8 +66,7 @@ const UnwrappedList = ( }} > {slots.heading} - ( {...restProps} > {childrenWithoutSlots} - + ) } From 9f092484578b276741d2fa6fab5aefd077feb47b Mon Sep 17 00:00:00 2001 From: llastflowers Date: Mon, 29 Sep 2025 11:58:31 -0700 Subject: [PATCH 08/50] re-remove sx and BoxWithFallback from ActionList/LinkItem.tsx --- packages/react/src/ActionList/LinkItem.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react/src/ActionList/LinkItem.tsx b/packages/react/src/ActionList/LinkItem.tsx index 06b3cbcd035..cb18077eaf0 100644 --- a/packages/react/src/ActionList/LinkItem.tsx +++ b/packages/react/src/ActionList/LinkItem.tsx @@ -21,12 +21,12 @@ type LinkProps = { // LinkItem does not support selected, loading, variants, etc. export type ActionListLinkItemProps = Pick< ActionListItemProps, - 'active' | 'children' | 'sx' | 'inactiveText' | 'variant' | 'size' + 'active' | 'children' | 'inactiveText' | 'variant' | 'size' > & LinkProps export const LinkItem = React.forwardRef( - ({sx, active, inactiveText, variant, size, as: Component, className, ...props}, forwardedRef) => { + ({active, inactiveText, variant, size, as: Component, className, ...props}, forwardedRef) => { return ( { const clickHandler = (event: React.MouseEvent) => { onClick && onClick(event) From 6d2152646224cccf4068d7ed37383a3fc44cd8b7 Mon Sep 17 00:00:00 2001 From: "Brittany L. Houtz" <55068883+llastflowers@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:00:27 -0700 Subject: [PATCH 09/50] Change ActionList component to major version Update ActionList component and related components to no longer support sx/styled-components --- .changeset/eleven-cameras-hammer.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/eleven-cameras-hammer.md diff --git a/.changeset/eleven-cameras-hammer.md b/.changeset/eleven-cameras-hammer.md new file mode 100644 index 00000000000..f3ca0df772b --- /dev/null +++ b/.changeset/eleven-cameras-hammer.md @@ -0,0 +1,5 @@ +--- +"@primer/react": major +--- + +Update ActionList component and related components to no longer support sx/styled-components From f46759a2f0979324a3cc9c5b8e97e82c973b70cc Mon Sep 17 00:00:00 2001 From: llastflowers Date: Mon, 29 Sep 2025 12:10:31 -0700 Subject: [PATCH 10/50] remove BWF from ActionList/Description.tsx --- packages/react/src/ActionList/Description.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/react/src/ActionList/Description.tsx b/packages/react/src/ActionList/Description.tsx index cb1e7bd425d..3a326e9c10d 100644 --- a/packages/react/src/ActionList/Description.tsx +++ b/packages/react/src/ActionList/Description.tsx @@ -2,7 +2,6 @@ import React from 'react' import Truncate from '../Truncate' import {ItemContext} from './shared' import classes from './ActionList.module.css' -import {BoxWithFallback} from '../internal/components/BoxWithFallback' import {clsx} from 'clsx' export type ActionListDescriptionProps = { @@ -43,14 +42,13 @@ export const Description: React.FC {props.children} -
    + ) } else { return ( From efeb72497d25e614a6551d5eec876c4ee66d8189 Mon Sep 17 00:00:00 2001 From: llastflowers Date: Mon, 29 Sep 2025 12:15:07 -0700 Subject: [PATCH 11/50] remove BWF from ActionList/Divider.tsx --- packages/react/src/ActionList/Divider.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/react/src/ActionList/Divider.tsx b/packages/react/src/ActionList/Divider.tsx index 4576332fd2d..3e5168d11bb 100644 --- a/packages/react/src/ActionList/Divider.tsx +++ b/packages/react/src/ActionList/Divider.tsx @@ -1,22 +1,14 @@ import type React from 'react' import {clsx} from 'clsx' import classes from './ActionList.module.css' -import {BoxWithFallback} from '../internal/components/BoxWithFallback' export type ActionListDividerProps = { className?: string } /** - * Visually separates `Item`s or `Group`s in an `ActionList`. + * Visually separates `Items or `Groups in an `ActionList`. */ export const Divider: React.FC> = ({className}) => { - return ( -