Skip to content

Commit 41d8707

Browse files
committed
docs: update menu
1 parent 4b44542 commit 41d8707

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

website/data/components/context-menu.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ pointer is pen or touch.
7171
Earlier, we mentioned that each menu part has a `data-part` attribute added to
7272
them to select and style them in the DOM.
7373

74-
### Focused item state
74+
### Highlighted item state
7575

76-
When an item is focused, via keyboard navigation or pointer, it is given a
77-
`data-focus` attribute.
76+
When an item is highlighted, via keyboard navigation or pointer, it is given a
77+
`data-highlighted` attribute.
7878

7979
```css
80-
[data-part="item"][data-focus] {
81-
/* styles for focused state */
80+
[data-part="item"][data-highlighted] {
81+
/* styles for highlighted state */
8282
}
8383

84-
[data-part="item"][data-type="radio|checkbox"][data-focus] {
85-
/* styles for focused state */
84+
[data-part="item"][data-type="radio|checkbox"][data-highlighted] {
85+
/* styles for highlighted state */
8686
}
8787
```
8888

@@ -114,10 +114,10 @@ When using arrows within the menu, you can style it using css variables.
114114

115115
### Checked option item state
116116

117-
When an option item is checked, it is given a `data-checked` attribute.
117+
When an option item is checked, it is given a `data-state` attribute.
118118

119119
```css
120-
[data-part="item"][data-type="radio|checkbox"][data-checked] {
120+
[data-part="item"][data-type="radio|checkbox"][data-state="checked"] {
121121
/* styles for checked state */
122122
}
123123
```

website/data/components/menu.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ menu items. To achieve this:
9999
<div {...api.getContentProps()}>
100100
{/* ... */}
101101
<hr {...api.getSeparatorProps()} />
102-
<p {...api.getLabelProps({ htmlFor: "account" })}>Accounts</p>
103-
<div {...api.getGroupProps({ id: "account" })}>
104-
<button {...api.getItemProps({ id: "account-1" })}>Account 1</button>
105-
<button {...api.getItemProps({ id: "account-2" })}>Account 2</button>
102+
<p {...api.getItemGroupLabelProps({ htmlFor: "account" })}>Accounts</p>
103+
<div {...api.getItemGroupProps({ id: "account" })}>
104+
<button {...api.getItemProps({ value: "account-1" })}>Account 1</button>
105+
<button {...api.getItemProps({ value: "account-2" })}>Account 2</button>
106106
</div>
107107
</div>
108108
//...

website/data/snippets/react/menu/option-items.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function Menu() {
2424

2525
const api = menu.connect(service, normalizeProps)
2626

27-
const radios = menuOptionData.order.map((item) => ({
27+
const radios = data.order.map((item) => ({
2828
type: "radio",
2929
name: "order",
3030
value: item.value,
@@ -33,7 +33,7 @@ export function Menu() {
3333
onCheckedChange: (checked) => setOrder(checked ? item.value : ""),
3434
}))
3535

36-
const checkboxes = menuOptionData.type.map((item) => ({
36+
const checkboxes = data.type.map((item) => ({
3737
type: "checkbox",
3838
name: "type",
3939
value: item.value,

0 commit comments

Comments
 (0)