Skip to content

Commit 6d91be6

Browse files
authored
Merge branch 'main' into use-media-hydration-safe
2 parents 90f177d + 5516f3f commit 6d91be6

File tree

3 files changed

+99
-110
lines changed

3 files changed

+99
-110
lines changed

packages/react/src/ActionList/ActionList.features.stories.tsx

Lines changed: 86 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
ProjectIcon,
3131
} from '@primer/octicons-react'
3232
import {KeybindingHint} from '../KeybindingHint'
33-
import {FeatureFlags} from '../FeatureFlags'
3433
import classes from './ActionList.features.stories.module.css'
3534

3635
export default {
@@ -393,17 +392,15 @@ export const WithDynamicContent = () => {
393392
const [isTrue, setIsTrue] = React.useState(false)
394393

395394
return (
396-
<FeatureFlags flags={{primer_react_action_list_item_as_button: true}}>
397-
<ActionList>
398-
<ActionList.Item
399-
onSelect={() => {
400-
setIsTrue(!isTrue)
401-
}}
402-
>
403-
Activated? {isTrue ? 'Yes' : 'No'}
404-
</ActionList.Item>
405-
</ActionList>
406-
</FeatureFlags>
395+
<ActionList>
396+
<ActionList.Item
397+
onSelect={() => {
398+
setIsTrue(!isTrue)
399+
}}
400+
>
401+
Activated? {isTrue ? 'Yes' : 'No'}
402+
</ActionList.Item>
403+
</ActionList>
407404
)
408405
}
409406

@@ -922,87 +919,83 @@ export const WithTrailingAction = () => {
922919
}, [])
923920

924921
return (
925-
<FeatureFlags flags={{primer_react_action_list_item_as_button: true}}>
926-
<ActionList>
927-
<ActionList.Item>
928-
<ActionList.LeadingVisual>
929-
<FileDirectoryIcon />
930-
</ActionList.LeadingVisual>
931-
Item 1 (with default TrailingAction)
932-
<ActionList.TrailingAction label="Expand sidebar" icon={ArrowLeftIcon} />
933-
</ActionList.Item>
934-
<ActionList.Item>
935-
Item 2 (with link TrailingAction)
936-
<ActionList.TrailingAction as="a" href="#" label="Some action 1" icon={ArrowRightIcon} />
937-
</ActionList.Item>
938-
<ActionList.Item>
939-
Item 3<ActionList.Description>This is an inline description.</ActionList.Description>
940-
<ActionList.TrailingAction label="Some action 2" icon={BookIcon} />
941-
</ActionList.Item>
942-
<ActionList.Item>
943-
Item 4<ActionList.Description variant="block">This is a block description.</ActionList.Description>
944-
<ActionList.TrailingAction label="Some action 3" icon={BookIcon} />
945-
</ActionList.Item>
946-
<ActionList.Item>
947-
Item 5<ActionList.Description variant="block">This is a block description.</ActionList.Description>
948-
<ActionList.TrailingAction label="Some action 4" />
949-
</ActionList.Item>
950-
<ActionList.Item>
951-
Item 6
952-
<ActionList.TrailingAction href="#" as="a" label="Some action 5" />
953-
</ActionList.Item>
954-
<ActionList.Item>
955-
Icon button loading state
956-
<ActionList.Description>
957-
Shows how IconButton maintains width and centers spinner when loading
958-
</ActionList.Description>
959-
<ActionList.TrailingAction label="Process item" icon={ArrowRightIcon} loading />
960-
</ActionList.Item>
961-
<ActionList.Item>
962-
Icon button with transitions
963-
<ActionList.Description>
964-
Automatically toggles loading state every 2.5 seconds to show transitions
965-
</ActionList.Description>
966-
<ActionList.TrailingAction label="Toggle loading" icon={ArrowRightIcon} loading={loadingState} />
967-
</ActionList.Item>
968-
<ActionList.Item>
969-
Text button loading state
970-
<ActionList.Description>
971-
Shows how text button aligns spinner to the right and preserves width
972-
</ActionList.Description>
973-
<ActionList.TrailingAction label="Save changes" loading />
974-
</ActionList.Item>
975-
<ActionList.Item>
976-
Text button with transitions
977-
<ActionList.Description>
978-
Automatically toggles loading state every 2.5 seconds to show transitions
979-
</ActionList.Description>
980-
<ActionList.TrailingAction label="Apply settings" loading={loadingState} />
981-
</ActionList.Item>
982-
<ActionList.LinkItem href="#">
983-
LinkItem 1
984-
<ActionList.Description>
985-
with TrailingAction this is a long description and should not cause horizontal scroll on smaller screen
986-
sizes
987-
</ActionList.Description>
988-
<ActionList.TrailingAction label="Another action" />
989-
</ActionList.LinkItem>
990-
<ActionList.LinkItem href="#">
991-
LinkItem 2
992-
<ActionList.Description>
993-
with TrailingVisual this is a long description and should not cause horizontal scroll on smaller screen
994-
sizes
995-
</ActionList.Description>
996-
<ActionList.TrailingVisual>
997-
<TableIcon />
998-
</ActionList.TrailingVisual>
999-
</ActionList.LinkItem>
1000-
<ActionList.Item inactiveText="Unavailable due to an outage">
1001-
Inactive Item<ActionList.Description>With TrailingAction</ActionList.Description>
1002-
<ActionList.TrailingAction as="a" href="#" label="Some action 8" icon={ArrowRightIcon} />
1003-
</ActionList.Item>
1004-
</ActionList>
1005-
</FeatureFlags>
922+
<ActionList>
923+
<ActionList.Item>
924+
<ActionList.LeadingVisual>
925+
<FileDirectoryIcon />
926+
</ActionList.LeadingVisual>
927+
Item 1 (with default TrailingAction)
928+
<ActionList.TrailingAction label="Expand sidebar" icon={ArrowLeftIcon} />
929+
</ActionList.Item>
930+
<ActionList.Item>
931+
Item 2 (with link TrailingAction)
932+
<ActionList.TrailingAction as="a" href="#" label="Some action 1" icon={ArrowRightIcon} />
933+
</ActionList.Item>
934+
<ActionList.Item>
935+
Item 3<ActionList.Description>This is an inline description.</ActionList.Description>
936+
<ActionList.TrailingAction label="Some action 2" icon={BookIcon} />
937+
</ActionList.Item>
938+
<ActionList.Item>
939+
Item 4<ActionList.Description variant="block">This is a block description.</ActionList.Description>
940+
<ActionList.TrailingAction label="Some action 3" icon={BookIcon} />
941+
</ActionList.Item>
942+
<ActionList.Item>
943+
Item 5<ActionList.Description variant="block">This is a block description.</ActionList.Description>
944+
<ActionList.TrailingAction label="Some action 4" />
945+
</ActionList.Item>
946+
<ActionList.Item>
947+
Item 6
948+
<ActionList.TrailingAction href="#" as="a" label="Some action 5" />
949+
</ActionList.Item>
950+
<ActionList.Item>
951+
Icon button loading state
952+
<ActionList.Description>
953+
Shows how IconButton maintains width and centers spinner when loading
954+
</ActionList.Description>
955+
<ActionList.TrailingAction label="Process item" icon={ArrowRightIcon} loading />
956+
</ActionList.Item>
957+
<ActionList.Item>
958+
Icon button with transitions
959+
<ActionList.Description>
960+
Automatically toggles loading state every 2.5 seconds to show transitions
961+
</ActionList.Description>
962+
<ActionList.TrailingAction label="Toggle loading" icon={ArrowRightIcon} loading={loadingState} />
963+
</ActionList.Item>
964+
<ActionList.Item>
965+
Text button loading state
966+
<ActionList.Description>
967+
Shows how text button aligns spinner to the right and preserves width
968+
</ActionList.Description>
969+
<ActionList.TrailingAction label="Save changes" loading />
970+
</ActionList.Item>
971+
<ActionList.Item>
972+
Text button with transitions
973+
<ActionList.Description>
974+
Automatically toggles loading state every 2.5 seconds to show transitions
975+
</ActionList.Description>
976+
<ActionList.TrailingAction label="Apply settings" loading={loadingState} />
977+
</ActionList.Item>
978+
<ActionList.LinkItem href="#">
979+
LinkItem 1
980+
<ActionList.Description>
981+
with TrailingAction this is a long description and should not cause horizontal scroll on smaller screen sizes
982+
</ActionList.Description>
983+
<ActionList.TrailingAction label="Another action" />
984+
</ActionList.LinkItem>
985+
<ActionList.LinkItem href="#">
986+
LinkItem 2
987+
<ActionList.Description>
988+
with TrailingVisual this is a long description and should not cause horizontal scroll on smaller screen sizes
989+
</ActionList.Description>
990+
<ActionList.TrailingVisual>
991+
<TableIcon />
992+
</ActionList.TrailingVisual>
993+
</ActionList.LinkItem>
994+
<ActionList.Item inactiveText="Unavailable due to an outage">
995+
Inactive Item<ActionList.Description>With TrailingAction</ActionList.Description>
996+
<ActionList.TrailingAction as="a" href="#" label="Some action 8" icon={ArrowRightIcon} />
997+
</ActionList.Item>
998+
</ActionList>
1006999
)
10071000
}
10081001

packages/react/src/FeatureFlags/DefaultFeatureFlags.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {FeatureFlagScope} from './FeatureFlagScope'
22

33
export const DefaultFeatureFlags = FeatureFlagScope.create({
4-
primer_react_action_list_item_as_button: false,
54
primer_react_breadcrumbs_overflow_menu: false,
65
primer_react_css_has_selector_perf: false,
76
primer_react_overlay_overflow: false,

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

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {describe, it, expect, vi} from 'vitest'
22
import {render, fireEvent, act} from '@testing-library/react'
33
import React from 'react'
44
import {NavList} from './NavList'
5-
import {FeatureFlags} from '../FeatureFlags'
65
import {ReactRouterLikeLink} from '../Pagination/mocks/ReactRouterLink'
76
import {implementsClassName} from '../utils/testing'
87

@@ -255,21 +254,19 @@ describe('NavList.Item with NavList.SubNav', () => {
255254
describe('TrailingAction', () => {
256255
function NavListWithSubNavAndTrailingAction() {
257256
return (
258-
<FeatureFlags flags={{primer_react_action_list_item_as_button: true}}>
259-
<NavList>
260-
<NavList.Item href="#">
261-
Item
262-
<NavList.TrailingAction label="This should not be rendered" />
263-
<NavList.SubNav>
264-
<NavList.Item href="#">
265-
Sub Item 1
266-
<NavList.TrailingAction label="Trailing Action for Sub Item 1" />
267-
</NavList.Item>
268-
<NavList.Item href="#">Sub Item 2</NavList.Item>
269-
</NavList.SubNav>
270-
</NavList.Item>
271-
</NavList>
272-
</FeatureFlags>
257+
<NavList>
258+
<NavList.Item href="#">
259+
Item
260+
<NavList.TrailingAction label="This should not be rendered" />
261+
<NavList.SubNav>
262+
<NavList.Item href="#">
263+
Sub Item 1
264+
<NavList.TrailingAction label="Trailing Action for Sub Item 1" />
265+
</NavList.Item>
266+
<NavList.Item href="#">Sub Item 2</NavList.Item>
267+
</NavList.SubNav>
268+
</NavList.Item>
269+
</NavList>
273270
)
274271
}
275272

0 commit comments

Comments
 (0)