Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PRC ActionList implementation to have similar semantics to PVC. #2878

Merged
merged 193 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
0e207af
Render ActionList.Group header inside list, use li for semantic HTML …
radglob Feb 8, 2023
6344ed5
Update snapshots.
radglob Feb 8, 2023
6526784
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Feb 8, 2023
05ac57b
Fix snapshot. No idea why this isn't being generated correctly.
radglob Feb 9, 2023
bd171e0
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Feb 14, 2023
ea9dbd5
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Feb 16, 2023
50ac681
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Feb 17, 2023
7e75d38
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Feb 21, 2023
e16d3e1
Separate Heading from ActionList.Group.
radglob Feb 21, 2023
0305f30
removed usage of actionlist.group.
radglob Feb 27, 2023
5abca39
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Feb 27, 2023
e2f1f4f
Fix type errors.
radglob Feb 27, 2023
301e0cb
Create modern-coins-destroy.md
radglob Feb 27, 2023
cd0cc3e
Fix ActionList.docs.json to fix components build CI step.
radglob Feb 27, 2023
7b300a1
Update generated/components.json
radglob Feb 27, 2023
a02012b
test(vrt): update snapshots
radglob Feb 27, 2023
72e0578
test(vrt): update snapshots
radglob Feb 28, 2023
fdec15a
Update snapshots.
radglob Feb 28, 2023
72c1903
Merge branch 'fix-actionlist-semantics' of github.com:primer/react in…
radglob Feb 28, 2023
62fe375
Update themePreval snapshot and cache bust file.
radglob Feb 28, 2023
cb07272
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Feb 28, 2023
ae0cbde
Updated snapshots.
radglob Feb 28, 2023
235e4cf
Revert padding on ActionList.
radglob Feb 28, 2023
a713875
test(vrt): update snapshots
radglob Feb 28, 2023
03a49be
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Feb 28, 2023
09c981e
Merge branch 'fix-actionlist-semantics' of github.com:primer/react in…
radglob Feb 28, 2023
50ed220
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 1, 2023
dfdeb21
Make sure lists are surrounded by a div, fix accessibility issues in …
radglob Mar 1, 2023
836dccc
Updated snapshots, fix linting error.
radglob Mar 1, 2023
beedc53
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 1, 2023
9f45d63
Update docs.
radglob Mar 1, 2023
ddada04
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 1, 2023
baf0235
Update generated/components.json
radglob Mar 1, 2023
b205adc
Fix linting issues.
radglob Mar 1, 2023
5ab7a96
Merge branch 'fix-actionlist-semantics' of github.com:primer/react in…
radglob Mar 1, 2023
ee31582
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 3, 2023
691f632
Fixing some issues after the previous merge.
radglob Mar 3, 2023
db85f3c
Fix ActionMenu feature stories.
radglob Mar 3, 2023
68d9668
Updated snapshots that shouldn't be different from main.
radglob Mar 3, 2023
7cc2e0d
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 6, 2023
7eb0160
disable axe check
langermank Mar 6, 2023
1f384a1
Merge branch 'fix-actionlist-semantics' of https://github.com/primer/…
langermank Mar 6, 2023
9c32d37
Update changeset to major patch instead of minor.
radglob Mar 6, 2023
4755be0
re-gen test
langermank Mar 6, 2023
f75b611
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 6, 2023
1530571
Add missing selectionVariant to Groups and Descriptions ActionMenu st…
radglob Mar 6, 2023
2eae060
test(vrt): update snapshots
joshblack Mar 6, 2023
5cc653a
Fix styling of ActionList to match prod.
radglob Mar 6, 2023
86b955a
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 6, 2023
b457cff
Fix linting errors in ActionList.
radglob Mar 6, 2023
bf59217
test(vrt): update snapshots
radglob Mar 6, 2023
9c8af24
Reduce padding between ActionLists in ActionMenu example.
radglob Mar 7, 2023
941af96
refactor(DataTable): update optional type signatures (#2987)
joshblack Mar 6, 2023
4b626cc
Textarea stories (#2988)
langermank Mar 6, 2023
d22bc37
Pagination design updates (#2702)
mperrotti Mar 6, 2023
15f0f66
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 7, 2023
c6b0976
Make sure ActionList.Heading titles are bolded correctly.
radglob Mar 7, 2023
30c74a0
Updated snapshots.
radglob Mar 7, 2023
80ce1d5
Revert title font weight to semibold.
radglob Mar 7, 2023
0d7ea4f
Update snapshots.
radglob Mar 7, 2023
1c11a1b
test(vrt): update snapshots
radglob Mar 7, 2023
cdc2c2f
Passing sxProps to ActionList.Heading through ActionList.
radglob Mar 7, 2023
261b457
More snapshot fiddling.
radglob Mar 7, 2023
7ef1e60
Formatting.
radglob Mar 7, 2023
c3437ef
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 7, 2023
9b9f50c
Use margin and padding to get spacing correct.
radglob Mar 7, 2023
e8ea8e3
Fix aat tests.
radglob Mar 8, 2023
546cc76
Update snapshots.
radglob Mar 8, 2023
fcc6357
I think this should get the ActionMenu example back to what is expected.
radglob Mar 8, 2023
7f673a9
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 8, 2023
8fde87c
Revert "test(vrt): update snapshots"
radglob Mar 8, 2023
12c9f96
Revert "test(vrt): update snapshots"
radglob Mar 8, 2023
f9b5d3c
Revert "test(vrt): update snapshots"
radglob Mar 8, 2023
9fb5825
Revert "test(vrt): update snapshots"
radglob Mar 8, 2023
46709ef
Revert "test(vrt): update snapshots"
radglob Mar 8, 2023
6ca7bab
Revert "test(vrt): update snapshots"
radglob Mar 8, 2023
e287134
Revert "test(vrt): update snapshots"
radglob Mar 8, 2023
8cb3d67
Fix underlinenav.
radglob Mar 8, 2023
0c92cc6
Updated snapshots.
radglob Mar 8, 2023
0c60b9b
test(vrt): update snapshots
radglob Mar 8, 2023
af0b9f1
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 8, 2023
cebf9fa
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 9, 2023
3c19902
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 9, 2023
966da0e
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 10, 2023
888ffa9
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 10, 2023
38bc0a2
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 10, 2023
ebc4008
Dialog v2: Move files, reformat stories and add e2e tests (#2984)
broccolinisoup Mar 13, 2023
cc3416c
feat(project): add warning, invariant utilities and dev-expression pl…
joshblack Mar 13, 2023
6c0b791
chore(deps-dev): bump mdast-util-to-string from 3.1.0 to 3.1.1 (#3018)
dependabot[bot] Mar 13, 2023
a025937
chore(deps-dev): bump jscodeshift from 0.13.0 to 0.14.0 (#3015)
dependabot[bot] Mar 13, 2023
4cfa3ec
chore(deps-dev): bump @babel/cli from 7.19.3 to 7.21.0 (#3016)
dependabot[bot] Mar 13, 2023
52fb5ff
Add argTypes for HeadingPlayground ActionList story.
radglob Mar 13, 2023
2a0e190
Add aria-busy declaration in relevant story instead of in component.
radglob Mar 13, 2023
5f23c94
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 13, 2023
d01b74b
Update snapshots.
radglob Mar 13, 2023
5572566
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 14, 2023
c3f79b1
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 14, 2023
894d53c
Recalculate autocomplete suggestions if the input data changes while …
iansan5653 Mar 14, 2023
00b238a
docs(DataTable): add reference stories for row actions (#2978)
joshblack Mar 14, 2023
f6901ad
chore(deps): update babel dependencies (#3005)
joshblack Mar 14, 2023
cef6c4f
feat(DataTable): add support for alphanumeric, datatable, and custom …
joshblack Mar 14, 2023
8bd4e51
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 15, 2023
fe27ff5
Add new usage instructions to changeset.
radglob Mar 15, 2023
c5d9e26
Move ActionList.Group to versioned deprecated directory.
radglob Mar 15, 2023
c7d6d29
Fix references in deprecated ActionList.Group.
radglob Mar 15, 2023
d9bc0f1
Fix themePreval snapshot.
radglob Mar 15, 2023
07bf237
Update src/ActionList/ActionList.stories.tsx
radglob Mar 15, 2023
0ce6f16
Update src/ActionList/ActionList.stories.tsx
radglob Mar 15, 2023
1fc5dcc
Heading playground only uses heading props.
radglob Mar 15, 2023
8325c8b
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 16, 2023
c62c625
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 16, 2023
70db32e
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 16, 2023
d0969db
Merge branch 'main' into fix-actionlist-semantics
radglob Mar 16, 2023
df73ce7
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 27, 2023
306ebc6
Merge branch 'fix-actionlist-semantics' of github.com:primer/react in…
radglob Mar 27, 2023
224ce30
Use Box instead of styled elements for ActionList.Heading.
radglob Mar 27, 2023
fadaee5
Remove presentation role and aria-hidden from ActionList.Heading.
radglob Mar 27, 2023
40c8728
Updated snapshot.
radglob Mar 27, 2023
f5073a6
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 28, 2023
8231162
Use restricted as prop instead of headingLevel.
radglob Mar 30, 2023
ed52365
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 31, 2023
2980871
Use slots and contexts to allow developers to declare Heading like a …
radglob Mar 31, 2023
19317fe
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Mar 31, 2023
fa82cbe
Linting.
radglob Mar 31, 2023
c684a53
Add @deprecated tag to ActionList.Group as first step towards depreca…
radglob Apr 3, 2023
fa1cb76
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Apr 3, 2023
4dad983
Fix type errors in ActionMenu and ActionList stories.
radglob Apr 3, 2023
2eaadca
Formatting.
radglob Apr 3, 2023
e9d05f3
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Apr 4, 2023
f38339e
Updated snapshots.
radglob Apr 4, 2023
f43bffc
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 4, 2023
e83010e
Updating snapshots with --no-cache flag.
radglob Apr 5, 2023
83b566a
Update docs, fix missing Group export on ActionList.
radglob Apr 6, 2023
6e5b85c
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Apr 6, 2023
bac295d
Terminate comment correctly.
radglob Apr 6, 2023
5730a4c
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Apr 6, 2023
75b2bbd
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 7, 2023
b9bdd8e
Regenerate ActionMenu e2e tests.
radglob Apr 7, 2023
d71c2ff
Add padding to fix snapshot diff.
radglob Apr 10, 2023
28254cc
Change padding again.
radglob Apr 10, 2023
111f825
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Apr 10, 2023
b9f6aaf
Remove extra padding.
radglob Apr 10, 2023
4b2d18c
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Apr 10, 2023
7d3c524
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 10, 2023
d8a4f61
Add small amount of margin (not padding) to fix snapshot diff.
radglob Apr 10, 2023
5b87b00
Less margin.
radglob Apr 10, 2023
afc5c9d
More margin, actually.
radglob Apr 10, 2023
788fe34
I think this should work.
radglob Apr 10, 2023
1b8bee7
I think this is the correct margin, something else is off.
radglob Apr 10, 2023
c7c867f
.
radglob Apr 10, 2023
5037114
These snapshot comparisons are confusing me.
radglob Apr 10, 2023
3bb7ee8
Just a little more margin.
radglob Apr 10, 2023
83fafb3
Ugh.
radglob Apr 10, 2023
8c86d3f
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 10, 2023
b762d4f
test(vrt): update snapshots
radglob Apr 10, 2023
4e36d22
Slightly less margin.
radglob Apr 10, 2023
903037e
More tweaking.
radglob Apr 10, 2023
e8d6662
More tweaking.
radglob Apr 10, 2023
7aa36bf
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 11, 2023
7b0ea4b
Disable animations on actionmenu test to see if it helps generate the…
radglob Apr 11, 2023
fb50425
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 11, 2023
8dd1ef4
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 11, 2023
80350f4
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 11, 2023
df8cdce
test(vrt): update snapshots
radglob Apr 11, 2023
fa4b6cc
Don't animate Multiple Sections e2e test.
radglob Apr 11, 2023
7ab0d36
Format file.
radglob Apr 11, 2023
81a1730
test(vrt): update snapshots
radglob Apr 11, 2023
7078a00
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Apr 14, 2023
70e869d
Revert snapshots to match main.
radglob Apr 14, 2023
49ad824
Update snapshots again.
radglob Apr 14, 2023
d6e3b7d
Build snapshots without cache.
radglob Apr 14, 2023
183a234
Merge branch 'main' into fix-actionlist-semantics
radglob Apr 17, 2023
2ac346c
Remove lingering references to headingProps.
radglob Apr 20, 2023
665ec03
Update generated/components.json
radglob Apr 20, 2023
38ee183
chore(deps): bump react-intersection-observer from 9.4.1 to 9.4.3 (#3…
dependabot[bot] Apr 17, 2023
88be73f
chore(deps-dev): bump jest-fail-on-console from 3.0.2 to 3.1.1 (#3180)
dependabot[bot] Apr 17, 2023
dbb3950
chore(deps-dev): bump unist-util-find-before from 3.0.0 to 3.0.1 (#3179)
dependabot[bot] Apr 17, 2023
b65da55
fix(PageLayout): update Pane to warn instead of error (#3160)
joshblack Apr 17, 2023
4f158d4
Refactor(PageLayout): use Playwright for interaction tests instead of…
radglob Apr 17, 2023
a2154aa
Delete docs migration-related code (#3187)
colebemis Apr 17, 2023
1cc0e32
Docs(Tooltip): Adds `defaultValue` of tooltip direction to documentat…
edersonlucas Apr 18, 2023
87ce3fd
chore(project): update test-e2e docker image (#3183)
joshblack Apr 18, 2023
8898058
feat(project): add subpath pattern to package.json to restrict intern…
joshblack Apr 18, 2023
4e77baa
Ensure disabled invisible buttons have the right text color. (#3185)
radglob Apr 18, 2023
bbf270b
Refactor(Overlay): move files to folder. (#3191)
radglob Apr 18, 2023
7dcb133
Refactor(Text): move files to directory, add storybook and e2e tests.…
radglob Apr 18, 2023
6313e9d
Reduce ❌ for forks (#2283)
jsoref Apr 18, 2023
f54e5c0
Setup snapshots for visual regression for experimental/Button2 (#3181)
siddharthkp Apr 19, 2023
4a1fa09
Version Packages (#3106)
primer-css Apr 19, 2023
d97027f
Bug fix: `ButtonGroup` borders (#3198)
langermank Apr 20, 2023
d5534a2
Refactor(Portal): move stories into Portal directory. (#3188)
radglob Apr 20, 2023
831c0d3
Use SSR-compatible slot implementation in ActionList/NavList (#3173)
colebemis Apr 20, 2023
72cd916
Merge branch 'main' of github.com:primer/react into fix-actionlist-se…
radglob Apr 20, 2023
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
39 changes: 39 additions & 0 deletions .changeset/modern-coins-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
"@primer/react": major
---

Update PRC ActionList implementation to have similar semantics to PVC.
* Removes `ActionList.Group`.
* Adds `ActionList.Heading` to be used for labelling children in an `ActionList`.
* Adds `heading` slot to `ActionList` for adding headings that label internal lists correctly.

ActionList.Groups inside an ActionList generated inaccessible markup. Previous usage:
```
<ActionList>
<ActionList.Group title="Actions">
<ActionList.Item>Create</ActionList.Item>
<ActionList.Item>Read</ActionList.Item>
<ActionList.Item>Update</ActionList.Item>
<ActionList.Item>Delete</ActionList.Item>
</ActionList.Group>
<ActionList.Group>
...
</ActionList.Group>
</ActionList>
```

Instead, use `ActionList`s and stack them as needed.
```
<div>
<ActionList>
<ActionList.Heading title="Actions" />
<ActionList.Item>Create</ActionList.Item>
<ActionList.Item>Read</ActionList.Item>
<ActionList.Item>Update</ActionList.Item>
<ActionList.Item>Delete</ActionList.Item>
</ActionList>
<ActionList>
...
</ActionList>
</div>
```
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.
17 changes: 9 additions & 8 deletions docs/content/ActionList.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ When you want to add links to the List instead of actions, use `ActionList.LinkI
</ActionList>
```

### With groups
### With headings

```javascript live noinline
const SelectFields = () => {
Expand All @@ -196,29 +196,30 @@ const SelectFields = () => {
}

return (
<ActionList selectionVariant="multiple">
<ActionList.Group title="Visible fields">
<>
<ActionList selectionVariant="multiple">
<ActionList.Heading title="Visible fields" />
{visibleOptions.map(option => (
<ActionList.Item key={option.text} selected={true} onSelect={() => toggle(option.text)}>
{option.text}
</ActionList.Item>
))}
</ActionList.Group>
<ActionList.Group
title="Hidden fields"
</ActionList>
<ActionList
selectionVariant={
/** selectionVariant override on Group: disable selection if there are no options */
hiddenOptions.length ? 'multiple' : false
}
>
<ActionList.Heading title="Hidden fields" />
{hiddenOptions.map((option, index) => (
<ActionList.Item key={option.text} selected={false} onSelect={() => toggle(option.text)}>
{option.text}
</ActionList.Item>
))}
{hiddenOptions.length === 0 && <ActionList.Item disabled>No hidden fields</ActionList.Item>}
</ActionList.Group>
</ActionList>
</ActionList>
</>
)
}

Expand Down
101 changes: 49 additions & 52 deletions docs/content/ActionMenu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,65 +110,62 @@ You can choose to have a different _anchor_ for the Menu depending on the applic
</ActionMenu>
```

### With Groups
### Divided into sections

```jsx live
<ActionMenu>
<ActionMenu.Button>Open column menu</ActionMenu.Button>

<ActionMenu.Overlay>
<ActionList showDividers>
<ActionList.Group title="Live query">
<ActionList.Item>
<ActionList.LeadingVisual>
<SearchIcon />
</ActionList.LeadingVisual>
repo:github/memex,github/github
</ActionList.Item>
</ActionList.Group>
<ActionList.Divider />
<ActionList.Group title="Layout" variant="subtle">
<ActionList.Item>
<ActionList.LeadingVisual>
<NoteIcon />
</ActionList.LeadingVisual>
Table
<ActionList.Description variant="block">
Information-dense table optimized for operations across teams
</ActionList.Description>
</ActionList.Item>
<ActionList.Item role="listitem">
<ActionList.LeadingVisual>
<ProjectIcon />
</ActionList.LeadingVisual>
Board
<ActionList.Description variant="block">Kanban-style board focused on visual states</ActionList.Description>
</ActionList.Item>
</ActionList.Group>
<ActionList.Divider />
<ActionList.Group>
<ActionList.Item>
<ActionList.LeadingVisual>
<FilterIcon />
</ActionList.LeadingVisual>
Save sort and filters to current view
</ActionList.Item>
<ActionList.Item>
<ActionList.LeadingVisual>
<FilterIcon />
</ActionList.LeadingVisual>
Save sort and filters to new view
</ActionList.Item>
</ActionList.Group>
<ActionList.Divider />
<ActionList.Group>
<ActionList.Item>
<ActionList.LeadingVisual>
<GearIcon />
</ActionList.LeadingVisual>
View settings
</ActionList.Item>
</ActionList.Group>
<ActionList.Heading title="Live query" />
<ActionList.Item>
<ActionList.LeadingVisual>
<SearchIcon />
</ActionList.LeadingVisual>
repo:github/memex,github/github
</ActionList.Item>
</ActionList>
<ActionList showDividers>
<ActionList.Heading title="Layout" variant="subtle" />
<ActionList.Item>
<ActionList.LeadingVisual>
<NoteIcon />
</ActionList.LeadingVisual>
Table
<ActionList.Description variant="block">
Information-dense table optimized for operations across teams
</ActionList.Description>
</ActionList.Item>
<ActionList.Item role="listitem">
<ActionList.LeadingVisual>
<ProjectIcon />
</ActionList.LeadingVisual>
Board
<ActionList.Description variant="block">Kanban-style board focused on visual states</ActionList.Description>
</ActionList.Item>
</ActionList>
<ActionList showDividers>
<ActionList.Item>
<ActionList.LeadingVisual>
<FilterIcon />
</ActionList.LeadingVisual>
Save sort and filters to current view
</ActionList.Item>
<ActionList.Item>
<ActionList.LeadingVisual>
<FilterIcon />
</ActionList.LeadingVisual>
Save sort and filters to new view
</ActionList.Item>
</ActionList>
<ActionList>
<ActionList.Item>
<ActionList.LeadingVisual>
<GearIcon />
</ActionList.LeadingVisual>
View settings
</ActionList.Item>
</ActionList>
</ActionMenu.Overlay>
</ActionMenu>
Expand Down
60 changes: 36 additions & 24 deletions e2e/components/ActionMenu.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('ActionMenu', () => {
})

// Default state
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(`ActionMenu.Default.${theme}.png`)
expect(await page.screenshot()).toMatchSnapshot(`ActionMenu.Default.${theme}.png`)
})

test('axe @aat', async ({page}) => {
Expand Down Expand Up @@ -43,9 +43,7 @@ test.describe('ActionMenu', () => {
})

// Default state
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`ActionMenu.Links And Actions.${theme}.png`,
)
expect(await page.screenshot()).toMatchSnapshot(`ActionMenu.Links And Actions.${theme}.png`)
})

test('axe @aat', async ({page}) => {
Expand Down Expand Up @@ -73,9 +71,7 @@ test.describe('ActionMenu', () => {
})

// Default state
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`ActionMenu.Multi Select.${theme}.png`,
)
expect(await page.screenshot()).toMatchSnapshot(`ActionMenu.Multi Select.${theme}.png`)
})

test('axe @aat', async ({page}) => {
Expand Down Expand Up @@ -103,9 +99,7 @@ test.describe('ActionMenu', () => {
})

// Default state
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`ActionMenu.Single Select.${theme}.png`,
)
expect(await page.screenshot()).toMatchSnapshot(`ActionMenu.Single Select.${theme}.png`)
})

test('axe @aat', async ({page}) => {
Expand Down Expand Up @@ -133,9 +127,7 @@ test.describe('ActionMenu', () => {
})

// Default state
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`ActionMenu.Controlled Menu.${theme}.png`,
)
expect(await page.screenshot()).toMatchSnapshot(`ActionMenu.Controlled Menu.${theme}.png`)
})

test('axe @aat', async ({page}) => {
Expand Down Expand Up @@ -163,9 +155,7 @@ test.describe('ActionMenu', () => {
})

// Default state
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`ActionMenu.Custom Anchor.${theme}.png`,
)
expect(await page.screenshot()).toMatchSnapshot(`ActionMenu.Custom Anchor.${theme}.png`)
})

test('axe @aat', async ({page}) => {
Expand Down Expand Up @@ -193,9 +183,7 @@ test.describe('ActionMenu', () => {
})

// Default state
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`ActionMenu.Custom Overlay Props.${theme}.png`,
)
expect(await page.screenshot()).toMatchSnapshot(`ActionMenu.Custom Overlay Props.${theme}.png`)
})

test('axe @aat', async ({page}) => {
Expand Down Expand Up @@ -235,13 +223,37 @@ test.describe('ActionMenu', () => {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'aria-required-children': {
enabled: false,
},
await expect(page).toHaveNoViolations()
})
})
}
})

test.describe('Multiple Sections', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-actionmenu-examples--multiple-sections',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`ActionMenu.Multiple Sections.${theme}.png`,
)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-actionmenu-examples--multiple-sections',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations()
})
})
}
Expand Down
44 changes: 15 additions & 29 deletions generated/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"props": [
{
"name": "children",
"type": "ActionList.Item[] | ActionList.LinkItem[] | ActionList.Group[]",
"type": "ActionList.Item[] | ActionList.LinkItem[] | ActionList.Divider[]",
"defaultValue": "",
"required": true,
"description": ""
Expand Down Expand Up @@ -423,48 +423,34 @@
]
},
{
"name": "ActionList.Group",
"name": "ActionList.Heading",
"props": [
{
"name": "children",
"type": "ActionList.Item[] | ActionList.LinkItem[]",
"defaultValue": "",
"required": true,
"name": "variant",
"type": "'subtle' | 'filled'",
"defaultValue": "subtle",
"description": ""
},
{
"name": "title",
"type": "string",
"defaultValue": "",
"description": "Title of the group."
"required": true,
"description": ""
},
{
"name": "auxiliaryText",
"name": "subtitle",
"type": "string",
"defaultValue": "",
"description": "Secondary text that provides additional information about the group."
},
{
"name": "variant",
"type": "'filled' | 'subtle'",
"defaultValue": "'subtle'",
"description": "`inline` descriptions are positioned beside primary text. `block` descriptions are positioned below primary text."
},
{
"name": "selectionVariant",
"type": "'single' | 'multiple' | false",
"defaultValue": "",
"description": "Set `selectionVariant` at the group level."
},
{
"name": "role",
"type": "AriaRole",
"defaultValue": "",
"description": "ARIA role describing the function of the list inside the group. `listbox` and `menu` are a common values."
"required": false,
"description": ""
},
{
"name": "sx",
"type": "SystemStyleObject"
"name": "headingLevel",
"type": "'1' | '2' | '3' | '4' | '5' | '6'",
"defaultValue": "3",
"required": false,
"description": ""
}
]
}
Expand Down
Loading