@astryxdesign/cli 0.7.6-canary.4cb7f27 → 0.7.6-canary.4d56e6b
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/README.md +2 -2
- package/api/component/detail/showcase/showcase.mjs +9 -3
- package/api/search/_adapter.d.mts +3 -1
- package/api/search/_adapter.mjs +19 -19
- package/api/template/copy/copy.mjs +13 -7
- package/api/template/show/show.mjs +12 -8
- package/api/template/skeleton/skeleton.mjs +14 -5
- package/api/template/template.d.mts +1 -1
- package/api/template/template.doc.mjs +2 -2
- package/api/template/template.mjs +1 -0
- package/api/template/template.type.d.mts +2 -0
- package/api/template/template.type.mjs +2 -0
- package/assets/docs/motion.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.tsx +12 -12
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsx +14 -10
- package/assets/templates/blocks/components/Hooks/useCollatorHookUsage.doc.mjs +20 -0
- package/assets/templates/blocks/components/Hooks/useCollatorHookUsage.tsx +55 -0
- package/assets/templates/blocks/components/Hooks/usePressFeedbackHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Hooks/usePressFeedbackHookUsage.tsx +41 -0
- package/assets/templates/blocks/components/Hooks/useTranslatorHookUsage.doc.mjs +22 -0
- package/assets/templates/blocks/components/Hooks/useTranslatorHookUsage.tsx +88 -0
- package/assets/templates/blocks/components/Toast/useToastHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Toast/useToastHookUsage.tsx +65 -0
- package/clients/cli/commands/template.mjs +29 -3
- package/foundation/discovery/package-tsconfig.mjs +34 -0
- package/foundation/discovery/template-adapter.d.mts +76 -1
- package/foundation/discovery/template-adapter.mjs +418 -13
- package/foundation/discovery/template-icons.mjs +7 -89
- package/foundation/discovery/template-source-tree.d.mts +48 -0
- package/foundation/discovery/template-source-tree.mjs +159 -0
- package/foundation/fs/read-record.d.mts +4 -1
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/response/response-types.doc.mjs +2 -2
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -503,9 +503,9 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
503
503
|
| `gap-report.categories` | The fixed gap category values and human-readable labels; when a loaded integration names its own issues URL, meta.destinations lists every destination ({to, default, issuesUrl}) and meta.ask tells an agent to ask the person. |
|
|
504
504
|
| `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals; without --to, when a loaded integration names its own issues URL, destinations and ask as on gap-report.categories. |
|
|
505
505
|
| `template.list` | The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list. |
|
|
506
|
-
| `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media).
|
|
506
|
+
| `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media), and demoContentReplaced (how many Astryx docs-only demo content elements were replaced with a Text placeholder for your own content). |
|
|
507
507
|
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. The envelope's package names the npm package that owns the template. |
|
|
508
|
-
| `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), notes (setup notes naming what the template needs that the project lacks — missing packages, missing StyleX compiler; empty when satisfied), missingPackages (external package names the template imports that are not in the project), and installCommand (a ready-to-run install command with the detected package manager and workspace version ranges; null when nothing is missing, or when several lockfiles leave the package manager undetermined). The envelope's package names the npm package that owns the template.
|
|
508
|
+
| `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), demoContentReplaced (how many Astryx docs-only demo content elements were replaced with a Text placeholder), notes (setup notes naming what the template needs that the project lacks — missing packages, missing StyleX compiler; empty when satisfied), missingPackages (external package names the template imports that are not in the project), and installCommand (a ready-to-run install command with the detected package manager and workspace version ranges; null when nothing is missing, or when several lockfiles leave the package manager undetermined). The envelope's package names the npm package that owns the template. |
|
|
509
509
|
| `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
|
|
510
510
|
| `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. The envelope's package is @astryxdesign/core, the only package that ships hooks. |
|
|
511
511
|
| `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file `component.detail.showcase` leaf — a component's hero showcase source
|
|
4
|
+
* @file `component.detail.showcase` leaf — a component's hero showcase source,
|
|
5
|
+
* with each demo-content element replaced by a placeholder.
|
|
5
6
|
*
|
|
6
7
|
* @input a component name (+ cwd / package scope) or an explicit "no match"
|
|
7
8
|
* @output the `component.detail.showcase` envelope
|
|
@@ -11,7 +12,10 @@
|
|
|
11
12
|
import * as fs from 'node:fs';
|
|
12
13
|
import {AstryxError} from '../../../error.mjs';
|
|
13
14
|
import {ERROR_CODES} from '../../../../foundation/response/error-codes.mjs';
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
findShowcase,
|
|
17
|
+
replaceDemoContent,
|
|
18
|
+
} from '../../../template/template.mjs';
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* Resolve and read a component's showcase block into the
|
|
@@ -41,7 +45,9 @@ export async function componentDetailShowcase(componentName, {cwd, name, package
|
|
|
41
45
|
data: {
|
|
42
46
|
component: componentName,
|
|
43
47
|
aspectRatio: /** @type {number} */ (match.aspectRatio),
|
|
44
|
-
source:
|
|
48
|
+
// Handed-out source, not a copy: demo content becomes the placeholder a
|
|
49
|
+
// copy writes, and fixture media stays.
|
|
50
|
+
source: replaceDemoContent(fs.readFileSync(match.filePath, 'utf-8')).source,
|
|
45
51
|
},
|
|
46
52
|
};
|
|
47
53
|
}
|
|
@@ -31,7 +31,9 @@ export function gatherCandidates(options: {
|
|
|
31
31
|
* folder, for the same `type`, ranks the candidates an earlier search
|
|
32
32
|
* gathered when none of the files that gather read, and none of the folders
|
|
33
33
|
* it listed or probed, changed since (each is checked by its change time and
|
|
34
|
-
* size, so an edited doc in a linked package is seen on the next call).
|
|
34
|
+
* size, so an edited doc in a linked package is seen on the next call). That
|
|
35
|
+
* holds for a gather that is still running too, so searches that start
|
|
36
|
+
* together (a docs site's search right after it starts) share one gather. A
|
|
35
37
|
* long-running caller (a docs site's search, an agent harness) then pays the
|
|
36
38
|
* gather once. A one-shot `astryx search` gathers once, as before.
|
|
37
39
|
* @param {{cwd?: string, type?: string}} options
|
package/api/search/_adapter.mjs
CHANGED
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
import {readFileSync} from 'node:fs';
|
|
10
10
|
import * as path from 'node:path';
|
|
11
11
|
import {requireCoreDir} from '../../foundation/fs/paths.mjs';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
reusedWhileUnchanged,
|
|
14
|
+
unchangedSince,
|
|
15
|
+
} from '../../foundation/fs/read-record.mjs';
|
|
13
16
|
import {isOutsideProject} from '../../foundation/env/project-scope.mjs';
|
|
14
17
|
import {coreDirOrThrow} from '../error.mjs';
|
|
15
18
|
import {CORELESS_DOMAINS} from './_query.mjs';
|
|
@@ -95,7 +98,7 @@ export async function gatherCandidates(options) {
|
|
|
95
98
|
|
|
96
99
|
/**
|
|
97
100
|
* @typedef {Awaited<ReturnType<typeof gatherCandidates>>} Gathered
|
|
98
|
-
* @type {Map<string, {
|
|
101
|
+
* @type {Map<string, (options?: {fresh?: boolean}) => Promise<Gathered>>}
|
|
99
102
|
*/
|
|
100
103
|
const gathered = new Map();
|
|
101
104
|
|
|
@@ -104,30 +107,27 @@ const gathered = new Map();
|
|
|
104
107
|
* folder, for the same `type`, ranks the candidates an earlier search
|
|
105
108
|
* gathered when none of the files that gather read, and none of the folders
|
|
106
109
|
* it listed or probed, changed since (each is checked by its change time and
|
|
107
|
-
* size, so an edited doc in a linked package is seen on the next call).
|
|
110
|
+
* size, so an edited doc in a linked package is seen on the next call). That
|
|
111
|
+
* holds for a gather that is still running too, so searches that start
|
|
112
|
+
* together (a docs site's search right after it starts) share one gather. A
|
|
108
113
|
* long-running caller (a docs site's search, an agent harness) then pays the
|
|
109
114
|
* gather once. A one-shot `astryx search` gathers once, as before.
|
|
110
115
|
* @param {{cwd?: string, type?: string}} options
|
|
111
116
|
* @returns {Promise<Gathered>}
|
|
112
117
|
*/
|
|
113
|
-
export
|
|
118
|
+
export function gatherCandidatesReused(options) {
|
|
114
119
|
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (gathered.get(key)?.value === value) gathered.delete(key);
|
|
125
|
-
throw error;
|
|
120
|
+
const type = options.type;
|
|
121
|
+
const key = `${cwd}\0${type ?? ''}`;
|
|
122
|
+
let gather = gathered.get(key);
|
|
123
|
+
if (!gather) {
|
|
124
|
+
gather = reusedWhileUnchanged(
|
|
125
|
+
() => gatherCandidates({cwd, type}),
|
|
126
|
+
unchangedSince,
|
|
127
|
+
);
|
|
128
|
+
gathered.set(key, gather);
|
|
126
129
|
}
|
|
127
|
-
|
|
128
|
-
// the gather ran shows as a change on the next call.
|
|
129
|
-
gathered.set(key, {reads: seen, value});
|
|
130
|
-
return value;
|
|
130
|
+
return gather();
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
/**
|
|
@@ -18,7 +18,10 @@ import {
|
|
|
18
18
|
} from '../../../foundation/fs/path-safety.mjs';
|
|
19
19
|
import {AstryxError, writeFailed} from '../../error.mjs';
|
|
20
20
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
pkgOf,
|
|
23
|
+
replaceTemplateDemos,
|
|
24
|
+
} from '../../../foundation/discovery/template-adapter.mjs';
|
|
22
25
|
import {analyzeTemplateNeeds} from '../../../foundation/discovery/template-needs.mjs';
|
|
23
26
|
import {
|
|
24
27
|
NO_ICON_SETS,
|
|
@@ -89,12 +92,14 @@ export function templateCopy(
|
|
|
89
92
|
);
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
// leaves nothing behind.
|
|
95
|
-
const {
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
// Replace docs-only demo content and demo media references so the
|
|
96
|
+
// scaffolded file renders without anything only Astryx's previews provide.
|
|
97
|
+
// Read before any write, so a failure below leaves nothing behind.
|
|
98
|
+
const {
|
|
99
|
+
source: withMedia,
|
|
100
|
+
demoContentReplaced,
|
|
101
|
+
demoMediaReplaced,
|
|
102
|
+
} = replaceTemplateDemos(fs.readFileSync(match.filePath, 'utf-8'));
|
|
98
103
|
// Icons follow the project's icon set (AST-084 FR9). An icon with no match
|
|
99
104
|
// keeps its import, so its library stays a needed dependency below.
|
|
100
105
|
const {source: outputSource, icons} = mapTemplateIcons(
|
|
@@ -127,6 +132,7 @@ export function templateCopy(
|
|
|
127
132
|
fileName: outputFileName,
|
|
128
133
|
filesCopied: 1,
|
|
129
134
|
demoMediaReplaced,
|
|
135
|
+
demoContentReplaced,
|
|
130
136
|
notes,
|
|
131
137
|
missingPackages: missing,
|
|
132
138
|
installCommand,
|
|
@@ -12,9 +12,9 @@ import * as fs from 'node:fs';
|
|
|
12
12
|
import {AstryxError} from '../../error.mjs';
|
|
13
13
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
componentsInSource,
|
|
16
16
|
pkgOf,
|
|
17
|
-
|
|
17
|
+
replaceTemplateDemos,
|
|
18
18
|
} from '../../../foundation/discovery/template-adapter.mjs';
|
|
19
19
|
import {
|
|
20
20
|
NO_ICON_SETS,
|
|
@@ -38,11 +38,14 @@ export function templateShow(match, {iconSets = NO_ICON_SETS} = {}) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// The source template.copy writes (spec:AST-028 FR7): a template printed and
|
|
41
|
-
// pasted must not keep a media path only Astryx's previews
|
|
42
|
-
// caller is told how many it replaced, the way the copy
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
// pasted must not keep demo content or a media path only Astryx's previews
|
|
42
|
+
// serve, and the caller is told how many it replaced, the way the copy
|
|
43
|
+
// receipt tells it.
|
|
44
|
+
const {
|
|
45
|
+
source: withMedia,
|
|
46
|
+
demoContentReplaced,
|
|
47
|
+
demoMediaReplaced,
|
|
48
|
+
} = replaceTemplateDemos(fs.readFileSync(match.filePath, 'utf-8'));
|
|
46
49
|
// Icons follow the project's icon set, as template.copy writes them.
|
|
47
50
|
const {source, icons} = mapTemplateIcons(withMedia, iconSets, match.icons);
|
|
48
51
|
|
|
@@ -53,9 +56,10 @@ export function templateShow(match, {iconSets = NO_ICON_SETS} = {}) {
|
|
|
53
56
|
template: match.dirName,
|
|
54
57
|
description: match.description,
|
|
55
58
|
type: match.type,
|
|
56
|
-
components:
|
|
59
|
+
components: componentsInSource(source),
|
|
57
60
|
source,
|
|
58
61
|
demoMediaReplaced,
|
|
62
|
+
demoContentReplaced,
|
|
59
63
|
...(icons ? {icons} : {}),
|
|
60
64
|
},
|
|
61
65
|
};
|
|
@@ -5,13 +5,18 @@
|
|
|
5
5
|
* spatial annotations) plus the components a resolved template composes.
|
|
6
6
|
*
|
|
7
7
|
* @position api/template/skeleton — derives a compact layout reference from the
|
|
8
|
-
* resolved match's source
|
|
8
|
+
* resolved match's source, with demo content replaced as a copy replaces it;
|
|
9
|
+
* the template dispatcher routes `--skeleton` here.
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import * as fs from 'node:fs';
|
|
12
13
|
import {AstryxError} from '../../error.mjs';
|
|
13
14
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
componentsInSource,
|
|
17
|
+
pkgOf,
|
|
18
|
+
replaceTemplateDemos,
|
|
19
|
+
} from '../../../foundation/discovery/template-adapter.mjs';
|
|
15
20
|
|
|
16
21
|
const STRUCTURAL = new Set([
|
|
17
22
|
'AppShell',
|
|
@@ -242,15 +247,19 @@ export function templateSkeleton(match, templates) {
|
|
|
242
247
|
ERROR_CODES.ERR_NO_SOURCE,
|
|
243
248
|
);
|
|
244
249
|
}
|
|
245
|
-
|
|
250
|
+
// The skeleton outlines the source that template.show returns, so it never
|
|
251
|
+
// names demo content that a copy replaces.
|
|
252
|
+
const {source} = replaceTemplateDemos(
|
|
253
|
+
fs.readFileSync(match.filePath, 'utf-8'),
|
|
254
|
+
);
|
|
246
255
|
return {
|
|
247
256
|
type: 'template.skeleton',
|
|
248
257
|
package: pkgOf(match),
|
|
249
258
|
data: {
|
|
250
259
|
template: match.dirName,
|
|
251
260
|
description: match.description,
|
|
252
|
-
components:
|
|
253
|
-
skeleton: extractSkeleton(
|
|
261
|
+
components: componentsInSource(source),
|
|
262
|
+
skeleton: extractSkeleton(source),
|
|
254
263
|
},
|
|
255
264
|
};
|
|
256
265
|
}
|
|
@@ -41,4 +41,4 @@ export function template(name?: string, options?: {
|
|
|
41
41
|
export type DiscoveredTemplate = import("../../foundation/discovery/template-adapter.mjs").DiscoveredTemplate;
|
|
42
42
|
export type TemplateDiscoveryError = import("../../foundation/discovery/template-adapter.mjs").TemplateDiscoveryError;
|
|
43
43
|
export type TemplateDocModule = import("../../foundation/discovery/template-adapter.mjs").TemplateDocModule;
|
|
44
|
-
export { discoverAll, discoverAll as discoverTemplates, discoverAllWithErrors, discoverCoreTemplates, discoverIntegrationTemplatesForOne, stripTemplateAssetRefs, replaceDemoMedia, listTemplates, findRelatedBlocks, findShowcase, extractComponents, pkgOf } from "../../foundation/discovery/template-adapter.mjs";
|
|
44
|
+
export { discoverAll, discoverAll as discoverTemplates, discoverAllWithErrors, discoverCoreTemplates, discoverIntegrationTemplatesForOne, stripTemplateAssetRefs, replaceDemoMedia, replaceDemoContent, listTemplates, findRelatedBlocks, findShowcase, extractComponents, pkgOf } from "../../foundation/discovery/template-adapter.mjs";
|
|
@@ -115,7 +115,7 @@ export const doc = {
|
|
|
115
115
|
{
|
|
116
116
|
type: 'template.show',
|
|
117
117
|
description:
|
|
118
|
-
"The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and `demoMediaReplaced` — how many Astryx demo media references (images, posters, videos) in the source were replaced with placeholders for you to swap for your own media.",
|
|
118
|
+
"The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and `demoMediaReplaced` — how many Astryx demo media references (images, posters, videos) in the source were replaced with placeholders for you to swap for your own media, and `demoContentReplaced` — how many Astryx docs-only demo content elements were replaced with a `<Text>` placeholder for your own content.",
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
type: 'template.skeleton',
|
|
@@ -125,7 +125,7 @@ export const doc = {
|
|
|
125
125
|
{
|
|
126
126
|
type: 'template.copy',
|
|
127
127
|
description:
|
|
128
|
-
'A receipt after scaffolding the template into the project: the template id, output directory, written file name, file count, `demoMediaReplaced` — how many Astryx demo media references were replaced with placeholders, `notes` — setup notes naming what the template needs that the project lacks (missing packages, missing StyleX compiler; empty when satisfied), `missingPackages` — external package names the template imports that are not in the project, and `installCommand` — a ready-to-run install command with the detected package manager and workspace version ranges (null when nothing is missing, or when several lockfiles leave the package manager undetermined; `missingPackages` still names the packages).',
|
|
128
|
+
'A receipt after scaffolding the template into the project: the template id, output directory, written file name, file count, `demoMediaReplaced` — how many Astryx demo media references were replaced with placeholders, `demoContentReplaced` — how many Astryx docs-only demo content elements were replaced with a `<Text>` placeholder, `notes` — setup notes naming what the template needs that the project lacks (missing packages, missing StyleX compiler; empty when satisfied), `missingPackages` — external package names the template imports that are not in the project, and `installCommand` — a ready-to-run install command with the detected package manager and workspace version ranges (null when nothing is missing, or when several lockfiles leave the package manager undetermined; `missingPackages` still names the packages).',
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
type: 'template.cdn',
|
|
@@ -72,6 +72,7 @@ export type TemplateShowResponse = {
|
|
|
72
72
|
components: string[];
|
|
73
73
|
source: string;
|
|
74
74
|
demoMediaReplaced: number;
|
|
75
|
+
demoContentReplaced: number;
|
|
75
76
|
icons?: TemplateIconsReport | undefined;
|
|
76
77
|
};
|
|
77
78
|
};
|
|
@@ -106,6 +107,7 @@ export type TemplateCopyResponse = {
|
|
|
106
107
|
fileName: string;
|
|
107
108
|
filesCopied: number;
|
|
108
109
|
demoMediaReplaced: number;
|
|
110
|
+
demoContentReplaced: number;
|
|
109
111
|
notes: string[];
|
|
110
112
|
missingPackages: string[];
|
|
111
113
|
installCommand: string | null;
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
* @property {string[]} data.components
|
|
56
56
|
* @property {string} data.source
|
|
57
57
|
* @property {number} data.demoMediaReplaced Astryx demo media references (images, posters, videos) replaced in the returned source: images with a neutral placeholder, videos with an empty source. Swap in your own media at those points; no media is installed. 0 when the template carried none.
|
|
58
|
+
* @property {number} data.demoContentReplaced Astryx docs-only demo content elements (such as a playing card's face in a motion example) replaced in the returned source with a `<Text>Card content</Text>` placeholder. Put your own content there. 0 when the template carried none.
|
|
58
59
|
* @property {TemplateIconsReport} [data.icons] Experimental, present only when the project sets `experimental.iconSet`: how the template's icons follow the project's icon set, each icon `mapped` (source and target) or `kept`, and the icon-set state. It may change or be removed in a patch release.
|
|
59
60
|
*/
|
|
60
61
|
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
* @property {string} data.fileName
|
|
82
83
|
* @property {number} data.filesCopied
|
|
83
84
|
* @property {number} data.demoMediaReplaced Astryx demo media references (images, posters, videos) replaced in the written file: images with a neutral placeholder, videos with an empty source. Swap in your own media at those points; no media is installed. 0 when the template carried none.
|
|
85
|
+
* @property {number} data.demoContentReplaced Astryx docs-only demo content elements (such as a playing card's face in a motion example) replaced in the written file with a `<Text>Card content</Text>` placeholder. Put your own content there. 0 when the template carried none.
|
|
84
86
|
* @property {string[]} data.notes Setup notes: what the template needs that the project lacks (missing packages, missing StyleX compiler). Each note is one actionable line. Empty when the template needs nothing the project lacks.
|
|
85
87
|
* @property {string[]} data.missingPackages External package names the template imports that are not in the project's dependencies. Empty when none are missing.
|
|
86
88
|
* @property {string | null} data.installCommand A ready-to-run install command for the missing packages, using the project's package manager and the CLI workspace's version ranges. Null when no packages are missing, or when several lockfiles leave the package manager undetermined; missingPackages still names the packages.
|
|
@@ -109,7 +109,7 @@ export const docs = {
|
|
|
109
109
|
content: [
|
|
110
110
|
{
|
|
111
111
|
type: 'prose',
|
|
112
|
-
text: 'Some users experience motion sensitivity; animation that feels polished to one person can cause discomfort for another. Astryx components
|
|
112
|
+
text: 'Some users experience motion sensitivity; animation that feels polished to one person can cause discomfort for another. When the OS reduced-motion setting is on, Astryx components change at once under a mouse or trackpad, and under a finger they cross-fade instead of moving: opacity only, in 200 ms or less. A value that changes in place, such as a progress fill, takes its new value at once under any pointer. Do the same in your own animations with `@media (prefers-reduced-motion: reduce)`, adding `(pointer: coarse)` for the touch cross-fade.',
|
|
113
113
|
},
|
|
114
114
|
],
|
|
115
115
|
},
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
6
|
import {BottomSheet} from '@astryxdesign/core/BottomSheet';
|
|
7
7
|
import {Button} from '@astryxdesign/core/Button';
|
|
8
|
-
import {
|
|
8
|
+
import {CheckboxList, CheckboxListItem} from '@astryxdesign/core/CheckboxList';
|
|
9
9
|
import {Divider} from '@astryxdesign/core/Divider';
|
|
10
10
|
import {Heading} from '@astryxdesign/core/Heading';
|
|
11
11
|
import {Section} from '@astryxdesign/core/Section';
|
|
@@ -25,23 +25,23 @@ export default function BottomSheetShowcase() {
|
|
|
25
25
|
<VStack gap={4}>
|
|
26
26
|
<Heading level={3}>Filters</Heading>
|
|
27
27
|
<Divider />
|
|
28
|
-
<
|
|
29
|
-
<
|
|
28
|
+
<CheckboxList label="Filters" isLabelHidden>
|
|
29
|
+
<CheckboxListItem
|
|
30
30
|
label="In stock"
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
isChecked={inStock}
|
|
32
|
+
onCheck={setInStock}
|
|
33
33
|
/>
|
|
34
|
-
<
|
|
34
|
+
<CheckboxListItem
|
|
35
35
|
label="On sale"
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
isChecked={onSale}
|
|
37
|
+
onCheck={setOnSale}
|
|
38
38
|
/>
|
|
39
|
-
<
|
|
39
|
+
<CheckboxListItem
|
|
40
40
|
label="Free shipping"
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
isChecked={freeShipping}
|
|
42
|
+
onCheck={setFreeShipping}
|
|
43
43
|
/>
|
|
44
|
-
</
|
|
44
|
+
</CheckboxList>
|
|
45
45
|
<Button label="Apply" onClick={() => setIsOpen(false)} />
|
|
46
46
|
</VStack>
|
|
47
47
|
</Section>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
6
|
import {BottomSheet} from '@astryxdesign/core/BottomSheet';
|
|
7
7
|
import {Button} from '@astryxdesign/core/Button';
|
|
8
|
-
import {
|
|
8
|
+
import {CheckboxList, CheckboxListItem} from '@astryxdesign/core/CheckboxList';
|
|
9
9
|
import {Divider} from '@astryxdesign/core/Divider';
|
|
10
10
|
import {Heading} from '@astryxdesign/core/Heading';
|
|
11
11
|
import {Section} from '@astryxdesign/core/Section';
|
|
@@ -175,19 +175,23 @@ function NotificationChannelsSheet({
|
|
|
175
175
|
<Text type="supporting" color="secondary">
|
|
176
176
|
Choose any combination. You can change these preferences later.
|
|
177
177
|
</Text>
|
|
178
|
-
<
|
|
179
|
-
<
|
|
180
|
-
|
|
178
|
+
<CheckboxList label="Notification channels" isLabelHidden>
|
|
179
|
+
<CheckboxListItem
|
|
180
|
+
label="Email"
|
|
181
|
+
isChecked={email}
|
|
182
|
+
onCheck={setEmail}
|
|
183
|
+
/>
|
|
184
|
+
<CheckboxListItem
|
|
181
185
|
label="Push notifications"
|
|
182
|
-
|
|
183
|
-
|
|
186
|
+
isChecked={pushNotifications}
|
|
187
|
+
onCheck={setPushNotifications}
|
|
184
188
|
/>
|
|
185
|
-
<
|
|
189
|
+
<CheckboxListItem
|
|
186
190
|
label="Text messages"
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
isChecked={textMessages}
|
|
192
|
+
onCheck={setTextMessages}
|
|
189
193
|
/>
|
|
190
|
-
</
|
|
194
|
+
</CheckboxList>
|
|
191
195
|
<HStack gap={2} hAlign="end">
|
|
192
196
|
<Button label="Back" variant="secondary" onClick={onBack} />
|
|
193
197
|
<Button label="Finish" onClick={onFinish} />
|
|
@@ -0,0 +1,20 @@
|
|
|
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: 'useCollator',
|
|
7
|
+
name: 'useCollator — Locale-aware Name Sort',
|
|
8
|
+
displayName: 'useCollator — Locale-aware Name Sort',
|
|
9
|
+
description:
|
|
10
|
+
'A list of names sorted 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.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'InternationalizationProvider',
|
|
15
|
+
'Card',
|
|
16
|
+
'SegmentedControl',
|
|
17
|
+
'List',
|
|
18
|
+
'Layout',
|
|
19
|
+
],
|
|
20
|
+
};
|