Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/nav-list-item-gaps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

NavList: Graduate item gaps to the default experience.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions packages/react/src/ActionList/ActionList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -600,19 +600,6 @@ describe('ActionList with role="tree"', () => {

expect(container.querySelector('[data-component="ActionList"]')).not.toHaveAttribute('data-item-gap')
})

it('does not set data-item-gap on a standalone ActionList even when the primer_react_action_list_item_gap feature flag is enabled', () => {
const {container} = HTMLRender(
<FeatureFlags flags={{primer_react_action_list_item_gap: true}}>
<ActionList aria-label="Links">
<ActionList.LinkItem href="#">Home</ActionList.LinkItem>
<ActionList.LinkItem href="#">About</ActionList.LinkItem>
</ActionList>
</FeatureFlags>,
)

expect(container.querySelector('[data-component="ActionList"]')).not.toHaveAttribute('data-item-gap')
})
})

describe('ActionList forwarded ref (primer_react_merged_forwarded_refs)', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/ActionList/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef as React.RefObject<HTMLElement>)
const readRef = mergedRefEnabled ? listRef : providedOrCreatedRef
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef
const itemGapFlag = useFeatureFlag('primer_react_action_list_item_gap')
const itemGapEnabled = itemGapFlag && !disableItemGap && container === 'NavList'

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > sets Description title for button-semantics items (tooltip path)

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > should not be navigatable with arrow keys if `disableFocusZone` is true

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > list and its sub-components support classname

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > divider should support a custom `className`

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > should be navigatable with arrow keys for certain roles

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > should warn when selected is provided without a selectionVariant on parent

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > renders with the custom className

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionBar/ActionBar.test.tsx > ActionBar.Menu returnFocusRef > returns focus to anchor button when returnFocusRef is not provided

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performSyncWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:26135:20

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionBar/ActionBar.test.tsx > ActionBar.Menu returnFocusRef > returns focus to returnFocusRef when menu item is selected

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performSyncWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:26135:20

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-18)

[@primer/react (chromium)] src/ActionBar/ActionBar.test.tsx > ActionBar.Menu returnFocusRef > returns focus to returnFocusRef when menu is closed

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ renderWithHooks ../../node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ updateForwardRef ../../node_modules/react-dom/cjs/react-dom.development.js:19245:20 ❯ beginWork ../../node_modules/react-dom/cjs/react-dom.development.js:21675:16 ❯ beginWork$1 ../../node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork ../../node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync ../../node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync ../../node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError ../../node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performSyncWorkOnRoot ../../node_modules/react-dom/cjs/react-dom.development.js:26135:20

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > sets Description title for button-semantics items (tooltip path)

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > should not be navigatable with arrow keys if `disableFocusZone` is true

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > list and its sub-components support classname

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > divider should support a custom `className`

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > should be navigatable with arrow keys for certain roles

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > should warn when selected is provided without a selectionVariant on parent

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionList/ActionList.test.tsx > ActionList > renders with the custom className

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionBar/ActionBar.test.tsx > ActionBar.Menu returnFocusRef > returns focus to anchor button when returnFocusRef is not provided

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionBar/ActionBar.test.tsx > ActionBar.Menu returnFocusRef > returns focus to returnFocusRef when menu item is selected

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

Check failure on line 55 in packages/react/src/ActionList/List.tsx

View workflow job for this annotation

GitHub Actions / test (react-19)

[@primer/react (chromium)] src/ActionBar/ActionBar.test.tsx > ActionBar.Menu returnFocusRef > returns focus to returnFocusRef when menu is closed

ReferenceError: itemGapFlag is not defined ❯ UnwrappedList src/ActionList/List.tsx:55:26 ❯ Object.react_stack_bottom_frame node_modules/react-dom/cjs/react-dom-client.development.js:28571:20 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:8030:22 ❯ updateForwardRef node_modules/react-dom/cjs/react-dom-client.development.js:10123:19 ❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:12536:18 ❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:1045:30 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:19176:22 ❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:19004:41 ❯ renderRootSync node_modules/react-dom/cjs/react-dom-client.development.js:18985:11 ❯ performWorkOnRoot node_modules/react-dom/cjs/react-dom-client.development.js:18094:35

let enableFocusZone = false
if (enableFocusZoneFromContainer !== undefined) enableFocusZone = enableFocusZoneFromContainer
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/FeatureFlags/DefaultFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const DefaultFeatureFlags = FeatureFlagScope.create({
primer_react_select_panel_order_selected_at_top: false,
primer_react_styled_react_use_primer_theme_providers: false,
primer_react_action_list_group_heading_trailing_action: false,
primer_react_action_list_item_gap: false,
primer_react_timeline_list_semantics: false,
primer_react_merged_forwarded_refs: false,
primer_react_button_loading_disabled_styles: false,
Expand Down
41 changes: 19 additions & 22 deletions packages/react/src/NavList/NavList.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import Octicon from '../Octicon'
import VisuallyHidden from '../_VisuallyHidden'
import {ReactRouterLikeLink} from '../Pagination/mocks/ReactRouterLink'
import {FeatureFlags} from '../FeatureFlags'

const meta: Meta = {
title: 'Components/NavList/Features',
Expand Down Expand Up @@ -622,32 +621,30 @@
</NavList>
)

export const WithItemGap: StoryFn = () => (
<FeatureFlags flags={{primer_react_action_list_item_gap: true}}>
<PageLayout>
<PageLayout.Pane position="start">
<NavList>
<NavList.Item href="#" aria-current="page">
Home
</NavList.Item>
<NavList.Item defaultOpen href="#">
About
<NavList.SubNav>
<NavList.Item href="#">Team</NavList.Item>
<NavList.Item href="#">History</NavList.Item>
</NavList.SubNav>
</NavList.Item>
<NavList.Item href="#">Contact</NavList.Item>
</NavList>
</PageLayout.Pane>
</PageLayout>
</FeatureFlags>
export const WithGapBetweenItems: StoryFn = () => (
<PageLayout>
<PageLayout.Pane position="start">
<NavList>
<NavList.Item href="#" aria-current="page">
Home
</NavList.Item>
<NavList.Item defaultOpen href="#">
About
<NavList.SubNav>
<NavList.Item href="#">Team</NavList.Item>
<NavList.Item href="#">History</NavList.Item>
</NavList.SubNav>
</NavList.Item>
<NavList.Item href="#">Contact</NavList.Item>
</NavList>
</PageLayout.Pane>
</PageLayout>
)

WithItemGap.storyName = 'With gap between items (behind feature flag)'
WithGapBetweenItems.storyName = 'With gap between items'

export const WithoutItemGap: StoryFn = () => (
<FeatureFlags flags={{primer_react_action_list_item_gap: true}}>

Check failure on line 647 in packages/react/src/NavList/NavList.features.stories.tsx

View workflow job for this annotation

GitHub Actions / lint

'FeatureFlags' is not defined
<PageLayout>
<PageLayout.Pane position="start">
<NavList disableItemGap>
Expand Down
59 changes: 11 additions & 48 deletions packages/react/src/NavList/NavList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import {NavList, type NavListGroupHeadingProps} from './NavList'
import {ReactRouterLikeLink} from '../Pagination/mocks/ReactRouterLink'
import {implementsClassName} from '../utils/testing'
import {FeatureFlags} from '../FeatureFlags'
import {asSlot} from '../utils/as-slot'

type NextJSLinkProps = {href: string; children: React.ReactNode}
Expand Down Expand Up @@ -601,8 +600,8 @@
expect(queryByRole('link', {name: 'Item 4'})).toHaveAttribute('href', '#item4')
})

describe('item gap feature flag', () => {
it('does not set data-item-gap on the underlying ActionList by default', () => {
describe('item gaps', () => {
it('sets data-item-gap on the underlying ActionList by default', () => {
const {container} = render(
<NavList>
<NavList.Item href="#" aria-current="page">
Expand All @@ -612,60 +611,24 @@
</NavList>,
)

expect(container.querySelector('[data-component="ActionList"]')).not.toHaveAttribute('data-item-gap')
})

it('sets data-item-gap on the underlying ActionList when the primer_react_action_list_item_gap feature flag is enabled', () => {
const {container} = render(
<FeatureFlags flags={{primer_react_action_list_item_gap: true}}>
<NavList>
<NavList.Item href="#" aria-current="page">
Home
</NavList.Item>
<NavList.Item href="#">About</NavList.Item>
</NavList>
</FeatureFlags>,
)

expect(container.querySelector('[data-component="ActionList"]')).toHaveAttribute('data-item-gap', '')
})

it('does not set data-item-gap when disableItemGap is set and the feature flag is enabled', () => {
it('does not set data-item-gap when disableItemGap is set', () => {
const {container} = render(
<FeatureFlags flags={{primer_react_action_list_item_gap: true}}>
<NavList disableItemGap>
<NavList.Item href="#" aria-current="page">
Home
</NavList.Item>
<NavList.Item href="#">About</NavList.Item>
</NavList>
</FeatureFlags>,
<NavList disableItemGap>
<NavList.Item href="#" aria-current="page">
Home
</NavList.Item>
<NavList.Item href="#">About</NavList.Item>
</NavList>,
)

expect(container.querySelector('[data-component="ActionList"]')).not.toHaveAttribute('data-item-gap')
expect(container.querySelector('nav')).not.toHaveAttribute('disableitemgap')
})

it('adds a gap between a parent item and the first item of its expanded sub-nav when the feature flag is enabled', () => {
const {container} = render(
<FeatureFlags flags={{primer_react_action_list_item_gap: true}}>
<NavList>
<NavList.Item defaultOpen href="#">
Item 1
<NavList.SubNav>
<NavList.Item href="#">Sub item 1</NavList.Item>
</NavList.SubNav>
</NavList.Item>
</NavList>
</FeatureFlags>,
)

const subGroup = container.querySelector('ul[aria-labelledby]')
expect(subGroup).not.toBeNull()
expect(getComputedStyle(subGroup as HTMLElement).marginBlockStart).toBe('2px')
})

it('does not add a gap before a sub-nav when the feature flag is disabled', () => {
it('adds a gap between a parent item and the first item of its expanded sub-nav by default', () => {
const {container} = render(
<NavList>
<NavList.Item defaultOpen href="#">
Expand All @@ -679,12 +642,12 @@

const subGroup = container.querySelector('ul[aria-labelledby]')
expect(subGroup).not.toBeNull()
expect(getComputedStyle(subGroup as HTMLElement).marginBlockStart).toBe('0px')
expect(getComputedStyle(subGroup as HTMLElement).marginBlockStart).toBe('2px')
})

it('does not add a gap before a sub-nav when disableItemGap is set and the feature flag is enabled', () => {
const {container} = render(
<FeatureFlags flags={{primer_react_action_list_item_gap: true}}>

Check failure on line 650 in packages/react/src/NavList/NavList.test.tsx

View workflow job for this annotation

GitHub Actions / lint

'FeatureFlags' is not defined
<NavList disableItemGap>
<NavList.Item defaultOpen href="#">
Item 1
Expand Down
Loading