@astryxdesign/cli 0.7.6-canary.fda92ac → 0.7.6

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @xds/cli
2
2
 
3
+ # 0.7.6
4
+
5
+ #### New Features
6
+
7
+ - When a template imports Astryx's docs-only demo content, `astryx template <name> <path>`, `astryx template <name>`, `astryx template <name> --skeleton`, and `astryx component <Name> --showcase` replace each demo-content element with a marked `<Text>Card content</Text>` placeholder and remove the demo-content import, so the code they hand out never imports a module that only Astryx's own previews have. The placeholder uses the file's own Astryx `Text` import when that import is in scope, and otherwise imports `Text`, under an alias when the file already uses that name. `template.copy` and `template.show` gain `demoContentReplaced` (0 when the template carried none), their text output says how many elements became placeholders, and the `components` that `template.show` and `template.skeleton` list are the components of the returned source. No shipped template uses demo content yet, so every current template is copied, shown, and outlined exactly as before. The docsite's shadcn install of a block or page applies the same replacement and also replaces demo media, each with a marked placeholder: a placeholder image for an image and a `data:,placeholder-video-add-your-own` source for a video. The item's description says how many references and elements were replaced. The adjacent `.astryx/<item>.json` receipt keeps its current shape, so every released `astryx upgrade` still reads it. (#9430)
8
+ - A theme's `motion` takes two knobs beside the duration scale: `tempo` (0.75–1.5) scales every motion duration, and `character` (`'crisp'`, `'standard'` or `'expressive'`) sets the new `--ease-entrance` and `--ease-move` tokens; `--ease-exit` stays the same at every character. Their types, `ThemeMotionConfig`, `ThemeMotionKnobs` and `MotionCharacter`, are exported. A theme without them renders exactly as before; a duration scale and explicit tokens win over the knobs, Spinner's and Skeleton's loops keep their timing under every tempo, and the press release fade follows tempo up to the 200 ms Reduce Motion cap under the person's setting. Springs don't read the knobs yet. The motion, token and theme-authoring docs and the theme template describe the knobs. (#8661)
9
+
10
+ #### Fixes
11
+
12
+ - BottomSheet checklist examples use CheckboxList so the whole row toggles, not just the label (#9533)
13
+ - The motion guide now says that under Reduce Motion, components cross-fade under a finger and change at once under a mouse, and that a value changing in place, such as a progress fill, takes its new value at once under any pointer (design:reduced-motion DR1–DR3). (#8615)
14
+ - Published packages no longer include repository test and benchmark files, reducing install size without changing exports. (#9153)
15
+
16
+ #### Performance
17
+
18
+ - Calling `integrationComponentConflicts()` or `integrationCheck()` from `@astryxdesign/cli/api` more than once in one process now reads each TypeScript file a package's `tsconfig.json` includes once while the file is unchanged, instead of on every call. A single `astryx doctor integration components` or `astryx integration check` run is unchanged. (#9422)
19
+ - `search()` shares a catalog gather that is still running: searches that start together in one long-running process, such as a docs site's search right after it starts, now gather once instead of once each (#9460)
20
+
21
+ #### Documentation
22
+
23
+ - A new `useCollator — Locale-aware Name Sort` example block sorts a list of names with the compare function from `useCollator`: accented and lowercase names land where a reader expects, and switching the provider locale to Swedish moves Å and Ö after Z. Copy it with `astryx template useCollatorHookUsage <path>`. (#9510)
24
+ - A new `usePressFeedback — Pressable Card` example block shows the hook on an Astryx Card: the hook's marker and the `interactionOverlayStyles.backgroundImage` overlay go straight on the Card, so pressing the card darkens it the way every Astryx pressable does, under a finger or a mouse (Enter or Space flips it), and `focusOutlineStyles.focusVisible` gives keyboard users the shared Astryx focus ring on it. Copy it with `astryx template usePressFeedbackHookUsage <path>`; the docs-only playing card it shows becomes a `<Text>` placeholder for your own content. (#9431)
25
+ - A new `useToast — Settings Saved` example block calls the function from `useToast` on a settings form: Save shows a "Settings saved" toast with an Undo action, its `uniqueID` makes a second Save replace the toast instead of stacking another, and a failed save shows an error toast instead. Copy it with `astryx template useToastHookUsage <path>`. (#9512)
26
+ - A new `useTranslator — Load More Footer` example block gets a list footer's "Load more" label and its "Showing 3 of 9" count from the function `useTranslator` returns. The app's own message keys are supplied per locale through `InternationalizationProvider`, so switching the provider to French changes both strings. Copy it with `astryx template useTranslatorHookUsage <path>`. (#9573)
27
+
28
+ #### Other Changes
29
+
30
+ - Preserved the v0.7.5 upgrade codemod registry when the release outputs returned to main (#9086), so the v0.7.6 CLI continues to offer that migration.
31
+
32
+ #### Contributors
33
+
34
+ Thanks to everyone who contributed to this release:
35
+
36
+ - @cixzhang
37
+ - @divyanshudhruv
38
+ - @kyu-rong
39
+ - @MannXo
40
+ - @parinith-web
41
+ - @vjeux
42
+
43
+ ---
44
+
3
45
  # 0.7.5
4
46
 
5
47
  #### Experimental APIs
@@ -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: 'usePressFeedback',
7
+ name: 'usePressFeedback — Pressable Card',
8
+ displayName: 'usePressFeedback — Pressable Card',
9
+ description:
10
+ 'A Card made pressable with usePressFeedback: its marker and the interactionOverlayStyles backgroundImage overlay go straight on the Card, so a press darkens the card the way every Astryx pressable does; focusOutlineStyles.focusVisible gives it the shared Astryx focus ring for keyboard focus; and a click, Enter or Space flips it.',
11
+ isReady: true,
12
+ aspectRatio: 4 / 3,
13
+ componentsUsed: ['Card'],
14
+ };
@@ -0,0 +1,41 @@
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 {usePressFeedback} from '@astryxdesign/core/hooks';
8
+ import {
9
+ focusOutlineStyles,
10
+ interactionOverlayStyles,
11
+ } from '@astryxdesign/core/utils';
12
+ import {PlayingCardContents} from '@astryx-docs/demo-content';
13
+
14
+ export default function UsePressFeedbackHookUsage() {
15
+ const pressable = usePressFeedback();
16
+ const [isFaceUp, setIsFaceUp] = useState(true);
17
+ const flip = () => setIsFaceUp(faceUp => !faceUp);
18
+
19
+ return (
20
+ <Card
21
+ {...pressable}
22
+ xstyle={[
23
+ interactionOverlayStyles.backgroundImage,
24
+ focusOutlineStyles.focusVisible,
25
+ ]}
26
+ width={160}
27
+ role="button"
28
+ tabIndex={0}
29
+ aria-label="Flip card"
30
+ aria-pressed={!isFaceUp}
31
+ onClick={flip}
32
+ onKeyDown={event => {
33
+ if (event.key === 'Enter' || event.key === ' ') {
34
+ event.preventDefault();
35
+ flip();
36
+ }
37
+ }}>
38
+ <PlayingCardContents rank="Q" suit="hearts" faceDown={!isFaceUp} />
39
+ </Card>
40
+ );
41
+ }
@@ -0,0 +1,22 @@
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: 'useTranslator',
7
+ name: 'useTranslator — Load More Footer',
8
+ displayName: 'useTranslator — Load More Footer',
9
+ description:
10
+ 'A "Load more" footer under a list that gets its button label and its "Showing 3 of 9" count from the function useTranslator returns, with app message keys supplied per locale through InternationalizationProvider, so switching the provider to French changes both strings.',
11
+ isReady: true,
12
+ aspectRatio: 4 / 3,
13
+ componentsUsed: [
14
+ 'InternationalizationProvider',
15
+ 'Card',
16
+ 'SegmentedControl',
17
+ 'List',
18
+ 'Text',
19
+ 'Button',
20
+ 'Layout',
21
+ ],
22
+ };
@@ -0,0 +1,88 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {Button} from '@astryxdesign/core/Button';
7
+ import {Card} from '@astryxdesign/core/Card';
8
+ import {
9
+ InternationalizationProvider,
10
+ useTranslator,
11
+ type MessagesByLocale,
12
+ } from '@astryxdesign/core/i18n';
13
+ import {HStack, VStack} from '@astryxdesign/core/Layout';
14
+ import {List, ListItem} from '@astryxdesign/core/List';
15
+ import {
16
+ SegmentedControl,
17
+ SegmentedControlItem,
18
+ } from '@astryxdesign/core/SegmentedControl';
19
+ import {Text} from '@astryxdesign/core/Text';
20
+
21
+ type Locale = 'en' | 'fr';
22
+
23
+ const MESSAGES: MessagesByLocale = {
24
+ en: {
25
+ '@myapp.invoices.loadMore': {defaultMessage: 'Load more'},
26
+ '@myapp.invoices.showing': {
27
+ defaultMessage: 'Showing {shown, number} of {total, number}',
28
+ },
29
+ },
30
+ fr: {
31
+ '@myapp.invoices.loadMore': {defaultMessage: 'Charger plus'},
32
+ '@myapp.invoices.showing': {
33
+ defaultMessage: '{shown, number} sur {total, number} affichées',
34
+ },
35
+ },
36
+ };
37
+
38
+ const INVOICES = Array.from({length: 9}, (_, index) => `INV-${1001 + index}`);
39
+ const PAGE_SIZE = 3;
40
+
41
+ function InvoiceList() {
42
+ const translate = useTranslator();
43
+ const [shownCount, setShownCount] = useState(PAGE_SIZE);
44
+ const total = INVOICES.length;
45
+
46
+ return (
47
+ <VStack gap={3}>
48
+ <List density="compact" hasDividers>
49
+ {INVOICES.slice(0, shownCount).map(invoice => (
50
+ <ListItem key={invoice} label={invoice} />
51
+ ))}
52
+ </List>
53
+ <HStack gap={2} hAlign="between" vAlign="center">
54
+ <Text type="supporting">
55
+ {translate('@myapp.invoices.showing', {shown: shownCount, total})}
56
+ </Text>
57
+ <Button
58
+ label={translate('@myapp.invoices.loadMore')}
59
+ size="sm"
60
+ isDisabled={shownCount >= total}
61
+ onClick={() => setShownCount(count => count + PAGE_SIZE)}
62
+ />
63
+ </HStack>
64
+ </VStack>
65
+ );
66
+ }
67
+
68
+ export default function UseTranslatorHookUsage() {
69
+ const [locale, setLocale] = useState<Locale>('en');
70
+
71
+ return (
72
+ <InternationalizationProvider locale={locale} messages={MESSAGES}>
73
+ <Card width={360} padding={4}>
74
+ <VStack gap={3}>
75
+ <SegmentedControl
76
+ label="Language"
77
+ value={locale}
78
+ onChange={nextLocale => setLocale(nextLocale as Locale)}
79
+ size="sm">
80
+ <SegmentedControlItem value="en" label="English" />
81
+ <SegmentedControlItem value="fr" label="Français" />
82
+ </SegmentedControl>
83
+ <InvoiceList />
84
+ </VStack>
85
+ </Card>
86
+ </InternationalizationProvider>
87
+ );
88
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.6-canary.fda92ac",
3
+ "version": "0.7.6",
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.6-canary.fda92ac",
128
- "@astryxdesign/core": "0.7.6-canary.fda92ac",
129
- "@astryxdesign/lab": "0.7.6-canary.fda92ac",
130
- "@astryxdesign/theme-neutral": "0.7.6-canary.fda92ac"
127
+ "@astryxdesign/charts": "*",
128
+ "@astryxdesign/core": "*",
129
+ "@astryxdesign/lab": "*",
130
+ "@astryxdesign/theme-neutral": "*"
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.6-canary.fda92ac",
148
- "@astryxdesign/core": "0.7.6-canary.fda92ac",
149
- "@astryxdesign/lab": "0.7.6-canary.fda92ac",
150
- "@astryxdesign/theme-neutral": "0.7.6-canary.fda92ac",
147
+ "@astryxdesign/charts": "*",
148
+ "@astryxdesign/core": "*",
149
+ "@astryxdesign/lab": "*",
150
+ "@astryxdesign/theme-neutral": "*",
151
151
  "@heroicons/react": "^2.2.0",
152
152
  "@stylexjs/stylex": "^0.19.0",
153
153
  "@types/babel__core": "^7.20.5",