Skip to content

Commit 40cb5e6

Browse files
committed
wip: menu component
1 parent 8ca4354 commit 40cb5e6

File tree

19 files changed

+2742
-876
lines changed

19 files changed

+2742
-876
lines changed

.changeset/add-menu-component.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@guardian/stand': patch
3+
---
4+
5+
Add Menu component

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
"import": "./dist/favicon.js",
5050
"require": "./dist/favicon.cjs"
5151
},
52+
"./menu": {
53+
"types": "./dist/types/menu.d.ts",
54+
"import": "./dist/menu.js",
55+
"require": "./dist/menu.cjs"
56+
},
5257
"./TopBar": {
5358
"types": "./dist/types/TopBar.d.ts",
5459
"import": "./dist/TopBar.js",
@@ -97,6 +102,7 @@
97102
"./component/typography.css": "./dist/styleD/build/css/component/typography.css",
98103
"./component/icon.css": "./dist/styleD/build/css/component/icon.css",
99104
"./component/favicon.css": "./dist/styleD/build/css/component/favicon.css",
105+
"./component/menu.css": "./dist/styleD/build/css/component/menu.css",
100106
"./component/TopBar.css": "./dist/styleD/build/css/component/TopBar.css"
101107
},
102108
"//typesVersions": "Provides backward compatibility for TypeScript moduleResolution: node - maps subpath imports to correct type definition files. When adding new components with their own entry points, ensure to add them here.",
@@ -140,6 +146,9 @@
140146
],
141147
"utils": [
142148
"./dist/types/utils.d.ts"
149+
],
150+
"menu": [
151+
"./dist/types/menu.d.ts"
143152
]
144153
}
145154
},
@@ -182,6 +191,7 @@
182191
"@guardian/tsconfig": "1.0.1",
183192
"@material-design-icons/svg": "^0.14.15",
184193
"@playwright/experimental-ct-react17": "^1.58.2",
194+
"@react-aria/focus": "3.21.5",
185195
"@rollup/plugin-commonjs": "29.0.0",
186196
"@rollup/plugin-node-resolve": "16.0.3",
187197
"@rollup/plugin-typescript": "12.3.0",
@@ -228,14 +238,15 @@
228238
"peerDependencies": {
229239
"@emotion/react": ">=11.11.4 <=11.14.0",
230240
"@guardian/prosemirror-invisibles": "3.1.1",
241+
"@react-aria/focus": "^3.21.5",
231242
"prosemirror-dropcursor": "1.8.2",
232243
"prosemirror-history": "1.4.1",
233244
"prosemirror-keymap": "1.2.2",
234245
"prosemirror-model": "1.25.0",
235246
"prosemirror-state": "1.4.3",
236247
"prosemirror-view": "1.37.2",
237248
"react": "^17.0.2 || ^18.0.0 || ^19.0.0",
238-
"react-aria-components": ">= 1.13.0 <= 1.15.1",
249+
"react-aria-components": ">= 1.13.0 <= 1.16.0",
239250
"react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0",
240251
"typescript": ">=5.0.0 <=5.9.3"
241252
},
@@ -246,6 +257,9 @@
246257
"@guardian/prosemirror-invisibles": {
247258
"optional": true
248259
},
260+
"@react-aria/focus": {
261+
"optional": true
262+
},
249263
"prosemirror-dropcursor": {
250264
"optional": true
251265
},

pnpm-lock.yaml

Lines changed: 884 additions & 870 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const input = {
3737
typography: 'src/typography.ts',
3838
icon: 'src/icon.ts',
3939
favicon: 'src/favicon.ts',
40+
menu: 'src/menu.ts',
4041
TopBar: 'src/TopBar.ts',
4142
// editorial components
4243
byline: 'src/byline.ts',

scripts/deps-matrix-versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"react": ["17.0.2", "18.0.0", "19.0.0"],
33
"emotion": ["11.11.4", "11.14.0"],
44
"typescript": ["~5.0", "~5.1", "~5.9"],
5-
"react-aria-components": ["1.13.0", "1.15.1"],
5+
"react-aria-components": ["1.13.0", "1.16.0"],
66
"exclude": [
77
{
88
"react": "19.0.0",

src/components/button/styles.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,25 @@ export const buttonStyles = (
5050
padding: 0;
5151
`}
5252
53-
&[data-hovered] {
53+
&[data-hovered], &:hover {
5454
background: ${theme[variant].shared[':hover'].backgroundColor};
5555
border: ${theme[variant].shared[':hover'].border};
5656
}
5757
58-
&[data-pressed] {
58+
&[data-pressed],
59+
&:active {
5960
background: ${theme[variant].shared[':active'].backgroundColor};
6061
border: ${theme[variant].shared[':active'].border};
6162
}
6263
63-
&[data-focus-visible] {
64+
&[data-focus-visible],
65+
&:focus-visible {
6466
outline: ${theme.shared[':focus-visible'].outline};
6567
outline-offset: ${theme.shared[':focus-visible']['outline-offset']};
6668
}
6769
68-
&[data-disabled] {
70+
&[data-disabled],
71+
&:disabled {
6972
cursor: ${theme.shared[':disabled'].cursor};
7073
color: ${theme[variant].shared[':disabled'].color};
7174
background: ${theme[variant].shared[':disabled'].backgroundColor};

0 commit comments

Comments
 (0)