@astryxdesign/cli 0.7.10-canary.6d8e4c3 → 0.7.10-canary.88e2232
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.
|
@@ -64,6 +64,26 @@ export const docs = {
|
|
|
64
64
|
},
|
|
65
65
|
],
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
id: 'upgrade',
|
|
69
|
+
title: 'Upgrade',
|
|
70
|
+
content: [
|
|
71
|
+
{
|
|
72
|
+
type: 'prose',
|
|
73
|
+
text: 'Upgrade every Astryx package your app lists in one command, to the same release. Each theme names the exact Core release it works with, so a theme left on an older release no longer matches the new Core.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: 'code',
|
|
77
|
+
lang: 'bash',
|
|
78
|
+
label: 'Terminal',
|
|
79
|
+
code: `{@pm install @astryxdesign/core@latest @astryxdesign/theme-neutral@latest @astryxdesign/cli@latest}\n{@command upgrade --from <old Core version> --apply}`,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: 'prose',
|
|
83
|
+
text: "Add every other Astryx package your app lists to the same command, and pass the Core version you had before to `--from`. If your package manager holds new releases back, exempt the whole `@astryxdesign/*` scope; in pnpm, `minimumReleaseAgeExclude: ['@astryxdesign/*']`. Exempting only some of its packages installs packages from different releases side by side.",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
67
87
|
{
|
|
68
88
|
id: 'install-once',
|
|
69
89
|
title: 'Install once, use everywhere',
|
|
@@ -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: 'useSnapPaging',
|
|
7
|
+
name: 'useSnapPaging — Onboarding Pages',
|
|
8
|
+
displayName: 'useSnapPaging — Onboarding Pages',
|
|
9
|
+
description:
|
|
10
|
+
"Onboarding cards in a Carousel with hasSnap={useSnapPaging()}: under a finger or a trackpad swipe, each flick moves one view and rests on a card's start edge. A switch picks one view or one card per flick through the hook's pages option.",
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Carousel', 'Card', 'Layout', 'Switch', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
7
|
+
import {Carousel} from '@astryxdesign/core/Carousel';
|
|
8
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
9
|
+
import {useSnapPaging} from '@astryxdesign/core/SnapPaging';
|
|
10
|
+
import {Switch} from '@astryxdesign/core/Switch';
|
|
11
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
12
|
+
|
|
13
|
+
const SCREENS = [
|
|
14
|
+
{title: 'Welcome', body: 'Swipe to see what is new.'},
|
|
15
|
+
{title: 'Shared albums', body: 'Invite friends to add their photos.'},
|
|
16
|
+
{title: 'Memories', body: 'See a day from years ago.'},
|
|
17
|
+
{title: 'Search', body: 'Find a photo by what is in it.'},
|
|
18
|
+
{title: 'All set', body: 'Your library is ready.'},
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export default function CarouselSnapPaging() {
|
|
22
|
+
const [isOneCard, setIsOneCard] = useState(false);
|
|
23
|
+
// A flick moves one view, or one card with {pages: 'item'}.
|
|
24
|
+
const paging = useSnapPaging({pages: isOneCard ? 'item' : 'view'});
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Stack direction="vertical" gap={3} style={{maxWidth: 520, padding: 8}}>
|
|
28
|
+
<Switch
|
|
29
|
+
label="One card per flick"
|
|
30
|
+
value={isOneCard}
|
|
31
|
+
onChange={setIsOneCard}
|
|
32
|
+
/>
|
|
33
|
+
<Carousel gap={2} hasSnap={paging} aria-label="Onboarding">
|
|
34
|
+
{SCREENS.map(screen => (
|
|
35
|
+
<Card key={screen.title} width={220} minHeight={160}>
|
|
36
|
+
<Stack direction="vertical" gap={1}>
|
|
37
|
+
<Text type="body" weight="bold">
|
|
38
|
+
{screen.title}
|
|
39
|
+
</Text>
|
|
40
|
+
<Text type="body" color="secondary">
|
|
41
|
+
{screen.body}
|
|
42
|
+
</Text>
|
|
43
|
+
</Stack>
|
|
44
|
+
</Card>
|
|
45
|
+
))}
|
|
46
|
+
</Carousel>
|
|
47
|
+
</Stack>
|
|
48
|
+
);
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.10-canary.
|
|
3
|
+
"version": "0.7.10-canary.88e2232",
|
|
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,30 +124,18 @@
|
|
|
124
124
|
"zod": "^4.4.3"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"@astryxdesign/
|
|
128
|
-
"@astryxdesign/core": "0.7.10-canary.6d8e4c3",
|
|
129
|
-
"@astryxdesign/lab": "0.7.10-canary.6d8e4c3",
|
|
130
|
-
"@astryxdesign/theme-neutral": "0.7.10-canary.6d8e4c3"
|
|
127
|
+
"@astryxdesign/core": "0.7.10-canary.88e2232"
|
|
131
128
|
},
|
|
132
129
|
"peerDependenciesMeta": {
|
|
133
|
-
"@astryxdesign/charts": {
|
|
134
|
-
"optional": true
|
|
135
|
-
},
|
|
136
130
|
"@astryxdesign/core": {
|
|
137
131
|
"optional": true
|
|
138
|
-
},
|
|
139
|
-
"@astryxdesign/lab": {
|
|
140
|
-
"optional": true
|
|
141
|
-
},
|
|
142
|
-
"@astryxdesign/theme-neutral": {
|
|
143
|
-
"optional": true
|
|
144
132
|
}
|
|
145
133
|
},
|
|
146
134
|
"devDependencies": {
|
|
147
|
-
"@astryxdesign/charts": "0.7.10-canary.
|
|
148
|
-
"@astryxdesign/core": "0.7.10-canary.
|
|
149
|
-
"@astryxdesign/lab": "0.7.10-canary.
|
|
150
|
-
"@astryxdesign/theme-neutral": "0.7.10-canary.
|
|
135
|
+
"@astryxdesign/charts": "0.7.10-canary.88e2232",
|
|
136
|
+
"@astryxdesign/core": "0.7.10-canary.88e2232",
|
|
137
|
+
"@astryxdesign/lab": "0.7.10-canary.88e2232",
|
|
138
|
+
"@astryxdesign/theme-neutral": "0.7.10-canary.88e2232",
|
|
151
139
|
"@heroicons/react": "^2.2.0",
|
|
152
140
|
"@stylexjs/stylex": "^0.19.0",
|
|
153
141
|
"@types/babel__core": "^7.20.5",
|