@astryxdesign/cli 0.7.6 → 0.7.7-canary.1d04d40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'useListFocus',
|
|
7
|
+
name: 'useListFocus — Recent Files',
|
|
8
|
+
displayName: 'useListFocus — Recent Files',
|
|
9
|
+
description:
|
|
10
|
+
'A "Recent files" list of buttons with keyboard navigation from useListFocus: ArrowUp and ArrowDown move between rows, Home and End jump to the first and last row, focus wraps at the ends, and only one row is in the tab order.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Card', 'Button', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
6
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
7
|
+
import {useListFocus} from '@astryxdesign/core/hooks';
|
|
8
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
9
|
+
|
|
10
|
+
const RECENT_FILES = [
|
|
11
|
+
'Q3 roadmap.pdf',
|
|
12
|
+
'Budget 2026.xlsx',
|
|
13
|
+
'Offsite notes.docx',
|
|
14
|
+
'Launch checklist.md',
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export default function UseListFocusHookUsage() {
|
|
18
|
+
const {listRef, handleKeyDown, handleFocus} = useListFocus({
|
|
19
|
+
itemSelector: 'button',
|
|
20
|
+
orientation: 'vertical',
|
|
21
|
+
wrap: true,
|
|
22
|
+
hasHomeEnd: true,
|
|
23
|
+
hasRovingTabIndex: true,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Card width={320} padding={2}>
|
|
28
|
+
<VStack
|
|
29
|
+
ref={listRef}
|
|
30
|
+
role="toolbar"
|
|
31
|
+
aria-label="Recent files"
|
|
32
|
+
aria-orientation="vertical"
|
|
33
|
+
gap={1}
|
|
34
|
+
onKeyDown={handleKeyDown}
|
|
35
|
+
onFocus={handleFocus}>
|
|
36
|
+
{RECENT_FILES.map(name => (
|
|
37
|
+
<Button key={name} label={name} variant="ghost" />
|
|
38
|
+
))}
|
|
39
|
+
</VStack>
|
|
40
|
+
</Card>
|
|
41
|
+
);
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7-canary.1d04d40",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -124,10 +124,10 @@
|
|
|
124
124
|
"zod": "^4.4.3"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"@astryxdesign/charts": "
|
|
128
|
-
"@astryxdesign/core": "
|
|
129
|
-
"@astryxdesign/lab": "
|
|
130
|
-
"@astryxdesign/theme-neutral": "
|
|
127
|
+
"@astryxdesign/charts": "0.7.7-canary.1d04d40",
|
|
128
|
+
"@astryxdesign/core": "0.7.7-canary.1d04d40",
|
|
129
|
+
"@astryxdesign/lab": "0.7.7-canary.1d04d40",
|
|
130
|
+
"@astryxdesign/theme-neutral": "0.7.7-canary.1d04d40"
|
|
131
131
|
},
|
|
132
132
|
"peerDependenciesMeta": {
|
|
133
133
|
"@astryxdesign/charts": {
|
|
@@ -144,10 +144,10 @@
|
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
"devDependencies": {
|
|
147
|
-
"@astryxdesign/charts": "
|
|
148
|
-
"@astryxdesign/core": "
|
|
149
|
-
"@astryxdesign/lab": "
|
|
150
|
-
"@astryxdesign/theme-neutral": "
|
|
147
|
+
"@astryxdesign/charts": "0.7.7-canary.1d04d40",
|
|
148
|
+
"@astryxdesign/core": "0.7.7-canary.1d04d40",
|
|
149
|
+
"@astryxdesign/lab": "0.7.7-canary.1d04d40",
|
|
150
|
+
"@astryxdesign/theme-neutral": "0.7.7-canary.1d04d40",
|
|
151
151
|
"@heroicons/react": "^2.2.0",
|
|
152
152
|
"@stylexjs/stylex": "^0.19.0",
|
|
153
153
|
"@types/babel__core": "^7.20.5",
|