@astryxdesign/cli 0.7.10-canary.a789c8c → 0.7.10-canary.b8ae86f

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: '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.a789c8c",
3
+ "version": "0.7.10-canary.b8ae86f",
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": "0.7.10-canary.a789c8c",
128
- "@astryxdesign/core": "0.7.10-canary.a789c8c",
129
- "@astryxdesign/lab": "0.7.10-canary.a789c8c",
130
- "@astryxdesign/theme-neutral": "0.7.10-canary.a789c8c"
127
+ "@astryxdesign/charts": "0.7.10-canary.b8ae86f",
128
+ "@astryxdesign/core": "0.7.10-canary.b8ae86f",
129
+ "@astryxdesign/lab": "0.7.10-canary.b8ae86f",
130
+ "@astryxdesign/theme-neutral": "0.7.10-canary.b8ae86f"
131
131
  },
132
132
  "peerDependenciesMeta": {
133
133
  "@astryxdesign/charts": {
@@ -144,10 +144,10 @@
144
144
  }
145
145
  },
146
146
  "devDependencies": {
147
- "@astryxdesign/charts": "0.7.10-canary.a789c8c",
148
- "@astryxdesign/core": "0.7.10-canary.a789c8c",
149
- "@astryxdesign/lab": "0.7.10-canary.a789c8c",
150
- "@astryxdesign/theme-neutral": "0.7.10-canary.a789c8c",
147
+ "@astryxdesign/charts": "0.7.10-canary.b8ae86f",
148
+ "@astryxdesign/core": "0.7.10-canary.b8ae86f",
149
+ "@astryxdesign/lab": "0.7.10-canary.b8ae86f",
150
+ "@astryxdesign/theme-neutral": "0.7.10-canary.b8ae86f",
151
151
  "@heroicons/react": "^2.2.0",
152
152
  "@stylexjs/stylex": "^0.19.0",
153
153
  "@types/babel__core": "^7.20.5",