Skip to content

Commit 843f1f9

Browse files
authored
docs: cascade select (#2964)
* docs: cascade select * chore: mark beta * chore: format
1 parent 0813036 commit 843f1f9

27 files changed

Lines changed: 1256 additions & 80 deletions

File tree

packages/docs/data/accessibility.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,46 @@
267267
}
268268
]
269269
},
270+
"cascade-select": {
271+
"keyboard": [
272+
{
273+
"keys": ["Space"],
274+
"description": "<span>When focus is on trigger, opens the cascade select and focuses the first item.<br />When focus is on the content, selects the highlighted item.</span>"
275+
},
276+
{
277+
"keys": ["Enter"],
278+
"description": "<span>When focus is on trigger, opens the cascade select and focuses the first item.<br />When focus is on content, selects the highlighted item.</span>"
279+
},
280+
{
281+
"keys": ["ArrowDown"],
282+
"description": "<span>When focus is on trigger, opens the cascade select.<br />When focus is on content, moves focus to the next item in the current level.</span>"
283+
},
284+
{
285+
"keys": ["ArrowUp"],
286+
"description": "<span>When focus is on trigger, opens the cascade select and focuses the last item.<br />When focus is on content, moves focus to the previous item in the current level.</span>"
287+
},
288+
{
289+
"keys": ["ArrowRight"],
290+
"description": "<span>When focus is on a branch item, expands the next level and moves focus into it.</span>"
291+
},
292+
{
293+
"keys": ["ArrowLeft"],
294+
"description": "<span>When focus is on a nested level, collapses it and moves focus back to the parent.<br />When focus is at the root level, closes the cascade select.</span>"
295+
},
296+
{
297+
"keys": ["Home"],
298+
"description": "<span>Moves focus to the first item in the current level.</span>"
299+
},
300+
{
301+
"keys": ["End"],
302+
"description": "<span>Moves focus to the last item in the current level.</span>"
303+
},
304+
{
305+
"keys": ["Esc"],
306+
"description": "<span>Closes the cascade select and moves focus to trigger.</span>"
307+
}
308+
]
309+
},
270310
"switch": {
271311
"keyboard": [
272312
{

packages/docs/data/css-vars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,4 +469,4 @@
469469
"--first-height": "The height of the first toast"
470470
}
471471
}
472-
}
472+
}

packages/docs/data/data-attr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2181,4 +2181,4 @@
21812181
"data-disabled": "Present when disabled"
21822182
}
21832183
}
2184-
}
2184+
}

packages/frameworks/vanilla/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
"tsBuildInfoFile": "node_modules/.cache/.tsbuildinfo"
66
}
77
}
8-
Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
{
2-
"name": "@zag-js/cascade-select",
3-
"version": "1.34.0",
4-
"description": "Core logic for the cascade-select widget implemented as a state machine",
5-
"keywords": [
6-
"js",
7-
"machine",
8-
"xstate",
9-
"statechart",
10-
"component",
11-
"chakra ui",
12-
"cascade-select"
13-
],
14-
"author": "Abraham Aremu <anubra266@gmail.com>",
15-
"homepage": "https://github.com/chakra-ui/zag#readme",
16-
"license": "MIT",
17-
"main": "src/index.ts",
18-
"repository": "https://github.com/chakra-ui/zag/tree/main/packages/machines/cascade-select",
19-
"sideEffects": false,
20-
"files": [
21-
"dist"
22-
],
23-
"publishConfig": {
24-
"access": "public"
25-
},
26-
"bugs": {
27-
"url": "https://github.com/chakra-ui/zag/issues"
28-
},
29-
"dependencies": {
30-
"@zag-js/anatomy": "workspace:*",
31-
"@zag-js/collection": "workspace:*",
32-
"@zag-js/core": "workspace:*",
33-
"@zag-js/dismissable": "workspace:*",
34-
"@zag-js/dom-query": "workspace:*",
35-
"@zag-js/focus-visible": "workspace:*",
36-
"@zag-js/popper": "workspace:*",
37-
"@zag-js/rect-utils": "workspace:*",
38-
"@zag-js/types": "workspace:*",
39-
"@zag-js/utils": "workspace:*"
40-
},
41-
"devDependencies": {
42-
"clean-package": "2.2.0"
43-
},
44-
"clean-package": "../../../clean-package.config.json"
45-
}
2+
"name": "@zag-js/cascade-select",
3+
"version": "1.34.0",
4+
"description": "Core logic for the cascade-select widget implemented as a state machine",
5+
"keywords": [
6+
"js",
7+
"machine",
8+
"xstate",
9+
"statechart",
10+
"component",
11+
"chakra ui",
12+
"cascade-select"
13+
],
14+
"author": "Abraham Aremu <anubra266@gmail.com>",
15+
"homepage": "https://github.com/chakra-ui/zag#readme",
16+
"license": "MIT",
17+
"main": "src/index.ts",
18+
"repository": "https://github.com/chakra-ui/zag/tree/main/packages/machines/cascade-select",
19+
"sideEffects": false,
20+
"files": [
21+
"dist"
22+
],
23+
"publishConfig": {
24+
"access": "public"
25+
},
26+
"bugs": {
27+
"url": "https://github.com/chakra-ui/zag/issues"
28+
},
29+
"dependencies": {
30+
"@zag-js/anatomy": "workspace:*",
31+
"@zag-js/collection": "workspace:*",
32+
"@zag-js/core": "workspace:*",
33+
"@zag-js/dismissable": "workspace:*",
34+
"@zag-js/dom-query": "workspace:*",
35+
"@zag-js/focus-visible": "workspace:*",
36+
"@zag-js/popper": "workspace:*",
37+
"@zag-js/rect-utils": "workspace:*",
38+
"@zag-js/types": "workspace:*",
39+
"@zag-js/utils": "workspace:*"
40+
},
41+
"devDependencies": {
42+
"clean-package": "2.2.0"
43+
},
44+
"clean-package": "../../../clean-package.config.json"
45+
}
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
2-
"extends": "../../../tsconfig.json",
3-
"include": [
4-
"src",
5-
"**/*.ts"
6-
],
7-
"compilerOptions": {
8-
"rootDir": "src",
9-
"outDir": "dist"
10-
}
11-
}
2+
"extends": "../../../tsconfig.json",
3+
"include": ["src", "**/*.ts"],
4+
"compilerOptions": {
5+
"rootDir": "src",
6+
"outDir": "dist"
7+
}
8+
}

packages/machines/combobox/src/combobox.types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ export type ElementIds = Partial<{
9494
}>
9595

9696
export interface ComboboxProps<T extends CollectionItem = CollectionItem>
97-
extends DirectionProperty,
98-
CommonProperties,
99-
InteractOutsideHandlers {
97+
extends DirectionProperty, CommonProperties, InteractOutsideHandlers {
10098
/**
10199
* The controlled open state of the combobox
102100
*/

packages/machines/dialog/src/dialog.types.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ export type ElementIds = Partial<{
2525
}>
2626

2727
export interface DialogProps
28-
extends DirectionProperty,
29-
CommonProperties,
30-
DismissableElementHandlers,
31-
PersistentElementOptions {
28+
extends DirectionProperty, CommonProperties, DismissableElementHandlers, PersistentElementOptions {
3229
/**
3330
* The ids of the elements in the dialog. Useful for composition.
3431
*/

packages/machines/popover/src/popover.types.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ export type ElementIds = Partial<{
2727
}>
2828

2929
export interface PopoverProps
30-
extends CommonProperties,
31-
DirectionProperty,
32-
DismissableElementHandlers,
33-
PersistentElementOptions {
30+
extends CommonProperties, DirectionProperty, DismissableElementHandlers, PersistentElementOptions {
3431
/**
3532
* The ids of the elements in the popover. Useful for composition.
3633
*/

packages/types/src/jsx.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ export namespace JSX {
6060
isPrimary: boolean
6161
}
6262

63-
export interface FocusEvent<Target = Element, RelatedTarget = Element>
64-
extends SyntheticEvent<Target, NativeFocusEvent> {
63+
export interface FocusEvent<Target = Element, RelatedTarget = Element> extends SyntheticEvent<
64+
Target,
65+
NativeFocusEvent
66+
> {
6567
relatedTarget: (EventTarget & RelatedTarget) | null
6668
target: EventTarget & Target
6769
}

0 commit comments

Comments
 (0)