Skip to content

Commit 60d65ea

Browse files
committed
docs: update
1 parent 41d8707 commit 60d65ea

File tree

4 files changed

+37
-9
lines changed

4 files changed

+37
-9
lines changed

website/data/components/checkbox.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ to them to select and style them in the DOM.
133133

134134
### Checked state
135135

136-
When the checkbox input is checked, the `data-checked` attribute is added to the
136+
When the checkbox input is checked, the `data-state` attribute is added to the
137137
root, control and label parts.
138138

139139
```css

website/data/components/combobox.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ label, control and input parts.
363363

364364
### Selected State
365365

366-
When a combobox item is selected, the `data-selected` attribute is added to the
366+
When a combobox item is selected, the `data-state` attribute is added to the
367367
item part.
368368

369369
```css

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
```tsx
22
import * as menu from "@zag-js/menu"
33
import { normalizeProps, useMachine } from "@zag-js/solid"
4-
import { createMemo, createUniqueId, For } from "solid-js"
4+
import { createMemo, createSignal, createUniqueId, For } from "solid-js"
5+
6+
const data = {
7+
order: [
8+
{ label: "Ascending", value: "asc" },
9+
{ label: "Descending", value: "desc" },
10+
{ label: "None", value: "none" },
11+
],
12+
type: [
13+
{ label: "Email", value: "email" },
14+
{ label: "Phone", value: "phone" },
15+
{ label: "Address", value: "address" },
16+
],
17+
}
518

619
export function Menu() {
720
const service = useMachine(menu.machine, { id: createUniqueId() })
@@ -12,7 +25,7 @@ export function Menu() {
1225
const [type, setType] = createSignal([])
1326

1427
const radios = createMemo(() =>
15-
menuOptionData.order.map((item) => ({
28+
data.order.map((item) => ({
1629
type: "radio",
1730
value: item.value,
1831
label: item.label,
@@ -23,7 +36,7 @@ export function Menu() {
2336
)
2437

2538
const checkboxes = createMemo(() =>
26-
menuOptionData.type.map((item) => ({
39+
data.type.map((item) => ({
2740
type: "checkbox",
2841
value: item.value,
2942
label: item.label,

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,30 @@
22
<script setup>
33
import * as menu from "@zag-js/menu"
44
import { normalizeProps, useMachine } from "@zag-js/vue"
5-
import { computed } from "vue"
6-
import { data } from "./data"
5+
import { computed, ref } from "vue"
6+
7+
const data = {
8+
order: [
9+
{ label: "Ascending", value: "asc" },
10+
{ label: "Descending", value: "desc" },
11+
{ label: "None", value: "none" },
12+
],
13+
type: [
14+
{ label: "Email", value: "email" },
15+
{ label: "Phone", value: "phone" },
16+
{ label: "Address", value: "address" },
17+
],
18+
}
19+
20+
const orderRef = ref("")
21+
const typeRef = ref([])
722
823
const service = useMachine(menu.machine, { id: "1" })
924
1025
const api = computed(() => menu.connect(service, normalizeProps))
1126
1227
const radios = computed(() =>
13-
menuOptionData.order.map((item) => ({
28+
data.order.map((item) => ({
1429
label: item.label,
1530
id: item.value,
1631
type: "radio",
@@ -23,7 +38,7 @@
2338
)
2439
2540
const checkboxes = computed(() =>
26-
menuOptionData.type.map((item) => ({
41+
data.type.map((item) => ({
2742
id: item.value,
2843
label: item.label,
2944
type: "checkbox",

0 commit comments

Comments
 (0)