Skip to content

Commit 98b75dc

Browse files
authored
Merge branch 'main' into bump-prim-v10
2 parents 47b8f7f + 6e3b057 commit 98b75dc

File tree

77 files changed

+648
-1181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+648
-1181
lines changed

.changeset/chilled-nails-juggle.md

-5
This file was deleted.

.changeset/clever-bears-jog.md

-5
This file was deleted.

.changeset/cyan-eggs-sort.md

-5
This file was deleted.

.changeset/eight-bears-worry.md

-5
This file was deleted.

.changeset/famous-laws-confess.md

-5
This file was deleted.

.changeset/flat-sheep-look.md

-5
This file was deleted.

.changeset/gentle-stingrays-search.md

-5
This file was deleted.

.changeset/nervous-guests-cheer.md

-5
This file was deleted.

.changeset/nice-boxes-sell.md

-5
This file was deleted.

.changeset/plenty-planes-fix.md

-5
This file was deleted.

.changeset/popular-moose-end.md

-5
This file was deleted.

.changeset/selfish-flowers-approve.md

-5
This file was deleted.

.changeset/sixty-starfishes-grab.md

-5
This file was deleted.

.changeset/slimy-chefs-divide.md

-5
This file was deleted.

.changeset/tiny-fireants-deny.md

-5
This file was deleted.

.changeset/tricky-scissors-walk.md

-5
This file was deleted.

e2e/components/NavList.test.ts

+112
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,116 @@ test.describe('NavList', () => {
3030
})
3131
}
3232
})
33+
34+
test.describe('With Title and Heading', () => {
35+
for (const theme of themes) {
36+
test.describe(theme, () => {
37+
test('default @vrt', async ({page}) => {
38+
await visit(page, {
39+
id: 'components-navlist-devonly--with-group-title-and-heading',
40+
globals: {
41+
colorScheme: theme,
42+
},
43+
})
44+
45+
// Default state
46+
expect(await page.screenshot()).toMatchSnapshot(`NavList.With Title and Heading.${theme}.png`)
47+
})
48+
49+
test('axe @aat', async ({page}) => {
50+
await visit(page, {
51+
id: 'components-navlist-devonly--with-group-title-and-heading',
52+
globals: {
53+
colorScheme: theme,
54+
},
55+
})
56+
await expect(page).toHaveNoViolations()
57+
})
58+
})
59+
}
60+
})
61+
62+
test.describe('Simple', () => {
63+
for (const theme of themes) {
64+
test.describe(theme, () => {
65+
test('default @vrt', async ({page}) => {
66+
await visit(page, {
67+
id: 'components-navlist--simple',
68+
globals: {
69+
colorScheme: theme,
70+
},
71+
})
72+
73+
// Default state
74+
expect(await page.screenshot()).toMatchSnapshot(`NavList.Simple.${theme}.png`)
75+
})
76+
77+
test('axe @aat', async ({page}) => {
78+
await visit(page, {
79+
id: 'components-navlist--simple',
80+
globals: {
81+
colorScheme: theme,
82+
},
83+
})
84+
await expect(page).toHaveNoViolations()
85+
})
86+
})
87+
}
88+
})
89+
90+
test.describe('With Group', () => {
91+
for (const theme of themes) {
92+
test.describe(theme, () => {
93+
test('default @vrt', async ({page}) => {
94+
await visit(page, {
95+
id: 'components-navlist--with-group',
96+
globals: {
97+
colorScheme: theme,
98+
},
99+
})
100+
101+
// Default state
102+
expect(await page.screenshot()).toMatchSnapshot(`NavList.With Group.${theme}.png`)
103+
})
104+
105+
test('axe @aat', async ({page}) => {
106+
await visit(page, {
107+
id: 'components-navlist--with-group',
108+
globals: {
109+
colorScheme: theme,
110+
},
111+
})
112+
await expect(page).toHaveNoViolations()
113+
})
114+
})
115+
}
116+
})
117+
118+
test.describe('With Sub Items', () => {
119+
for (const theme of themes) {
120+
test.describe(theme, () => {
121+
test('default @vrt', async ({page}) => {
122+
await visit(page, {
123+
id: 'components-navlist--with-sub-items',
124+
globals: {
125+
colorScheme: theme,
126+
},
127+
})
128+
129+
// Default state
130+
expect(await page.screenshot()).toMatchSnapshot(`NavList.With Sub Items.${theme}.png`)
131+
})
132+
133+
test('axe @aat', async ({page}) => {
134+
await visit(page, {
135+
id: 'components-navlist--with-sub-items',
136+
globals: {
137+
colorScheme: theme,
138+
},
139+
})
140+
await expect(page).toHaveNoViolations()
141+
})
142+
})
143+
}
144+
})
33145
})

examples/app-router/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type-check": "tsc --noEmit"
1111
},
1212
"dependencies": {
13-
"@primer/react": "37.7.2",
13+
"@primer/react": "37.8.0",
1414
"next": "^14.2.10",
1515
"react": "^18.3.1",
1616
"react-dom": "^18.3.1",

examples/codesandbox/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@typescript-eslint/eslint-plugin": "^7.11.0",
2121
"@typescript-eslint/parser": "^7.3.1",
2222
"@vitejs/plugin-react": "^4.3.3",
23-
"@primer/react": "37.7.2",
23+
"@primer/react": "37.8.0",
2424
"eslint": "^8.56.0",
2525
"eslint-plugin-react-hooks": "^4.6.0",
2626
"eslint-plugin-react-refresh": "^0.4.7",

examples/theming/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@primer/octicons-react": "^19.9.0",
14-
"@primer/react": "37.7.2",
14+
"@primer/react": "37.8.0",
1515
"clsx": "^1.2.1",
1616
"next": "^14.2.10",
1717
"react": "^18.3.1",

packages/react/CHANGELOG.md

+40

packages/react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@primer/react",
3-
"version": "37.7.2",
3+
"version": "37.8.0",
44
"description": "An implementation of GitHub's Primer Design System using React",
55
"main": "lib/index.js",
66
"module": "lib-esm/index.js",

packages/react/src/ActionList/Group.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export type ActionListGroupHeadingProps = Pick<ActionListGroupProps, 'variant' |
112112
SxProp &
113113
React.HTMLAttributes<HTMLElement> & {
114114
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
115+
headingWrapElement?: 'div' | 'li'
115116
_internalBackwardCompatibleTitle?: string
116117
}
117118

@@ -132,6 +133,7 @@ export const GroupHeading: React.FC<React.PropsWithChildren<ActionListGroupHeadi
132133
children,
133134
className,
134135
sx = defaultSxProp,
136+
headingWrapElement = 'div',
135137
...props
136138
}) => {
137139
const {variant: listVariant, role: listRole} = React.useContext(ListContext)
@@ -158,6 +160,7 @@ export const GroupHeading: React.FC<React.PropsWithChildren<ActionListGroupHeadi
158160
fontSize: 0,
159161
fontWeight: 'bold',
160162
color: 'fg.muted',
163+
listStyle: 'none',
161164
...(variant === 'filled' && {
162165
backgroundColor: 'canvas.subtle',
163166
marginX: 0,
@@ -186,13 +189,13 @@ export const GroupHeading: React.FC<React.PropsWithChildren<ActionListGroupHeadi
186189
<>
187190
{/* for listbox (SelectPanel) and menu (ActionMenu) roles, group titles are presentational. */}
188191
{listRole && listRole !== 'list' ? (
189-
<Box sx={styles} role="presentation" aria-hidden="true" {...props}>
192+
<Box sx={styles} role="presentation" aria-hidden="true" {...props} as={headingWrapElement}>
190193
<span id={groupHeadingId}>{_internalBackwardCompatibleTitle ?? children}</span>
191194
{auxiliaryText && <div className="ActionListGroupHeadingDescription">{auxiliaryText}</div>}
192195
</Box>
193196
) : (
194197
// for explicit (role="list" is passed as prop) and implicit list roles (ActionList ins rendered as list by default), group titles are proper heading tags.
195-
<Box sx={styles}>
198+
<Box sx={styles} as={headingWrapElement}>
196199
<Heading
197200
className={clsx(className, 'ActionListGroupHeading')}
198201
as={as || 'h3'}

0 commit comments

Comments
 (0)