@astryxdesign/cli 0.7.13 → 0.7.14-canary.d08ce65
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 +18 -18
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/api/doctor/doctor.mjs +3 -7
- package/api/experimental.d.mts +2 -0
- package/api/experimental.mjs +10 -0
- package/api/icon/_adapter.d.mts +10 -0
- package/api/icon/_adapter.mjs +31 -2
- package/api/icon/_authoring.d.mts +2 -1
- package/api/icon/_authoring.mjs +91 -6
- package/api/icon/_options.mjs +1 -0
- package/api/icon/_records.d.mts +18 -0
- package/api/icon/_records.mjs +26 -0
- package/api/icon/add/add.mjs +7 -1
- package/api/icon/definitions/definitions.d.mts +12 -0
- package/api/icon/definitions/definitions.mjs +83 -0
- package/api/icon/icon.doc.mjs +5 -4
- package/api/icon/icon.mjs +5 -16
- package/api/icon/icon.type.d.mts +29 -2
- package/api/icon/icon.type.mjs +17 -3
- package/api/icon/iconAdd.doc.mjs +1 -1
- package/api/icon/iconMap.doc.mjs +2 -2
- package/api/icon/iconNewSet.doc.mjs +8 -2
- package/api/icon/map/map.mjs +21 -2
- package/api/icon/new-set/new-set.mjs +14 -2
- package/api/icon/search/search.mjs +2 -15
- package/api/icon/use/use.mjs +4 -3
- package/api/integration/validate-integration.mjs +6 -1
- package/api/integration/validate-integration.type.d.mts +12 -0
- package/api/integration/validate-integration.type.mjs +5 -0
- package/api/theme-edit/_adapter.d.mts +96 -0
- package/api/theme-edit/_adapter.mjs +1039 -0
- package/api/theme-edit/_catalog.d.mts +59 -0
- package/api/theme-edit/_catalog.mjs +564 -0
- package/api/theme-edit/_check.d.mts +49 -0
- package/api/theme-edit/_check.mjs +842 -0
- package/api/theme-edit/_color.d.mts +35 -0
- package/api/theme-edit/_color.mjs +125 -0
- package/api/theme-edit/_compiler.d.mts +61 -0
- package/api/theme-edit/_compiler.mjs +522 -0
- package/api/theme-edit/_css-properties.d.mts +10 -0
- package/api/theme-edit/_css-properties.mjs +556 -0
- package/api/theme-edit/_parts.d.mts +111 -0
- package/api/theme-edit/_parts.mjs +409 -0
- package/api/theme-edit/_png.d.mts +40 -0
- package/api/theme-edit/_png.mjs +187 -0
- package/api/theme-edit/_preview.d.mts +86 -0
- package/api/theme-edit/_preview.mjs +564 -0
- package/api/theme-edit/_project.d.mts +83 -0
- package/api/theme-edit/_project.mjs +289 -0
- package/api/theme-edit/_settings.d.mts +222 -0
- package/api/theme-edit/_settings.mjs +848 -0
- package/api/theme-edit/_tables.d.mts +130 -0
- package/api/theme-edit/_tables.mjs +697 -0
- package/api/theme-edit/theme-edit.d.mts +89 -0
- package/api/theme-edit/theme-edit.mjs +119 -0
- package/api/theme-edit/theme-edit.type.d.mts +270 -0
- package/api/theme-edit/theme-edit.type.mjs +155 -0
- package/api/theme-edit/themeEditExplain.doc.d.mts +6 -0
- package/api/theme-edit/themeEditExplain.doc.mjs +88 -0
- package/api/theme-edit/themeEditNew.doc.d.mts +6 -0
- package/api/theme-edit/themeEditNew.doc.mjs +89 -0
- package/api/theme-edit/themeEditPreview.doc.d.mts +6 -0
- package/api/theme-edit/themeEditPreview.doc.mjs +96 -0
- package/api/theme-edit/themeEditReset.doc.d.mts +6 -0
- package/api/theme-edit/themeEditReset.doc.mjs +161 -0
- package/api/theme-edit/themeEditSet.doc.d.mts +6 -0
- package/api/theme-edit/themeEditSet.doc.mjs +165 -0
- package/api/theme-edit/themeEditShow.doc.d.mts +6 -0
- package/api/theme-edit/themeEditShow.doc.mjs +86 -0
- package/api/theme-edit/themeEditUndo.doc.d.mts +6 -0
- package/api/theme-edit/themeEditUndo.doc.mjs +80 -0
- package/assets/docs/color.doc.mjs +5 -5
- package/assets/docs/tree/icon-sets.doc.mjs +6 -2
- package/assets/docs/tree/tokens-border.doc.mjs +1 -1
- package/assets/docs/tree/tokens-color.doc.mjs +2 -2
- package/assets/docs/tree/tokens-data.doc.mjs +2 -2
- package/assets/docs/tree/tokens-duration.doc.mjs +1 -1
- package/assets/docs/tree/tokens-ease.doc.mjs +1 -1
- package/assets/docs/tree/tokens-focus.doc.mjs +1 -1
- package/assets/docs/tree/tokens-font-weight.doc.mjs +1 -1
- package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
- package/assets/docs/tree/tokens-shadow.doc.mjs +1 -1
- package/assets/docs/tree/tokens-size.doc.mjs +1 -1
- package/assets/docs/tree/tokens-spacing.doc.mjs +1 -1
- package/assets/docs/tree/tokens-syntax.doc.mjs +1 -1
- package/assets/docs/tree/tokens-text-size.doc.mjs +1 -1
- package/assets/docs/tree/tokens-type-scale.doc.mjs +1 -1
- package/assets/docs/tree/tokens-typography.doc.mjs +1 -1
- package/assets/icons/definitions/bank.doc.mjs +1 -1
- package/assets/icons/definitions/save.doc.mjs +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider03RtlDirection.doc.mjs +2 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.doc.mjs +2 -1
- package/assets/templates/blocks/components/Text/useTruncationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Text/useTruncationHookUsage.tsx +112 -0
- package/authoring/doctypes/_schema.d.mts +1 -0
- package/authoring/doctypes/_schema.mjs +1 -0
- package/authoring/doctypes/command/command.doc.mjs +7 -0
- package/authoring/doctypes/command/type.ts +3 -0
- package/authoring/doctypes/icon-set/parse.d.mts +7 -0
- package/authoring/doctypes/icon-set/parse.mjs +18 -8
- package/clients/cli/commands/doctor.mjs +33 -3
- package/clients/cli/commands/experimental/icon.mjs +67 -14
- package/clients/cli/commands/experimental/index.mjs +2 -0
- package/clients/cli/commands/experimental/theme.mjs +542 -0
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +7 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-add.doc.mjs +78 -0
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +97 -0
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +71 -0
- package/clients/cli/commands/experimental-theme-explain.doc.mjs +84 -0
- package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -0
- package/clients/cli/commands/experimental-theme-new.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +73 -0
- package/clients/cli/commands/experimental-theme-palette.doc.mjs +37 -0
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +76 -0
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme-reset.doc.mjs +103 -0
- package/clients/cli/commands/experimental-theme-set.doc.mjs +121 -0
- package/clients/cli/commands/experimental-theme-show.doc.mjs +66 -0
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +61 -0
- package/clients/cli/commands/experimental-theme-template.doc.mjs +61 -0
- package/clients/cli/commands/experimental-theme-undo.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme-use.doc.mjs +55 -0
- package/clients/cli/commands/experimental-theme.doc.mjs +66 -0
- package/clients/cli/commands/experimental.doc.mjs +10 -3
- package/clients/cli/commands/theme.mjs +101 -34
- package/clients/cli/index.mjs +16 -0
- package/clients/cli/lib/define-command.mjs +3 -0
- package/foundation/discovery/icon-set-checks.d.mts +16 -1
- package/foundation/discovery/icon-set-checks.mjs +68 -7
- package/foundation/discovery/icon-set-discovery.d.mts +21 -6
- package/foundation/discovery/icon-set-discovery.mjs +17 -8
- package/foundation/discovery/template-icon-meanings.d.mts +39 -0
- package/foundation/discovery/template-icon-meanings.mjs +95 -0
- package/foundation/discovery/theming-targets.d.mts +6 -0
- package/foundation/discovery/theming-targets.mjs +33 -0
- package/foundation/response/error-codes.d.mts +12 -1
- package/foundation/response/error-codes.doc.mjs +66 -0
- package/foundation/response/error-codes.mjs +55 -0
- package/foundation/response/response-types.doc.mjs +43 -0
- package/foundation/text/template-meanings-line.d.mts +16 -0
- package/foundation/text/template-meanings-line.mjs +37 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +6 -6
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file FunctionDoc for `themeEditShow()` / `astryx experimental theme show`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'function',
|
|
8
|
+
kind: 'api',
|
|
9
|
+
name: 'themeEditShow',
|
|
10
|
+
namespace: 'cli/api',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
displayName: 'themeEditShow()',
|
|
13
|
+
summary:
|
|
14
|
+
'Every setting, key values, problems the theme caused, and the theme-building page with every component.',
|
|
15
|
+
description:
|
|
16
|
+
'Lists every setting with where it applies and its source (dial, token or property), the resolved value of key tokens in each mode, contrast problems this theme caused versus its base, and font notes. Writes two self-contained HTML files: preview.html (the sample app page) and sheet.html (the theme-building page: every component grouped, each variant side by side, overlays open, and real template pages, with an auto/light/dark switch; the same page `preview` makes). --group limits the sheet to one group. Experimental: it may change or be removed in a patch release.',
|
|
17
|
+
importPath: '@astryxdesign/cli/api/experimental',
|
|
18
|
+
signature: 'themeEditShow(theme: string, options?: object): Promise<object>',
|
|
19
|
+
keywords: [
|
|
20
|
+
'theme',
|
|
21
|
+
'experimental theme',
|
|
22
|
+
'show',
|
|
23
|
+
'design tokens',
|
|
24
|
+
'type-checked',
|
|
25
|
+
],
|
|
26
|
+
params: [
|
|
27
|
+
{
|
|
28
|
+
name: 'theme',
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'The theme name.',
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'options.group',
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Only one group on the sheet.',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'options.png',
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
description: 'Also take PNG pictures.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'options.cwd',
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'The app folder.',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
returns: [
|
|
50
|
+
{
|
|
51
|
+
type: 'themeEdit.show',
|
|
52
|
+
description:
|
|
53
|
+
'Every setting and the parts it styles, key resolved values per mode, contrast problems, notes, both pages, template pages left out, and any pictures.',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
throws: [
|
|
57
|
+
{
|
|
58
|
+
code: 'ERR_INVALID_ARGUMENT',
|
|
59
|
+
when: 'an unknown group',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
code: 'ERR_UNKNOWN_THEME',
|
|
63
|
+
when: 'the theme does not exist; the suggestion is the `new` command',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
code: 'ERR_PROJECT_REQUIRED',
|
|
67
|
+
when: '@astryxdesign/core is not installed in the folder',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
code: 'ERR_THEME_INVALID',
|
|
71
|
+
when: 'the theme does not build (the change is undone)',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
code: 'ERR_RENDER_FAILED',
|
|
75
|
+
when: "the components or the preview do not render with the project's React",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
examples: [
|
|
79
|
+
{
|
|
80
|
+
label: 'Everything',
|
|
81
|
+
code: 'await themeEditShow(...)',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
command: 'experimental theme show',
|
|
85
|
+
related: ['themeBuild'],
|
|
86
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/** @file FunctionDoc for `themeEditUndo()` / `astryx experimental theme undo`. */
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @file FunctionDoc for `themeEditUndo()` / `astryx experimental theme undo`. */
|
|
4
|
+
|
|
5
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
6
|
+
export const doc = {
|
|
7
|
+
type: 'function',
|
|
8
|
+
kind: 'api',
|
|
9
|
+
name: 'themeEditUndo',
|
|
10
|
+
namespace: 'cli/api',
|
|
11
|
+
stability: 'experimental',
|
|
12
|
+
displayName: 'themeEditUndo()',
|
|
13
|
+
summary: 'Put the theme back as it was before its last change.',
|
|
14
|
+
description:
|
|
15
|
+
'Steps back one change: the settings file, the theme source and the build go back to how they were before the last set, unset, or base or mode change, and the preview is rewritten. The result names what was undone and how many earlier steps are left. Experimental: it may change or be removed in a patch release.',
|
|
16
|
+
importPath: '@astryxdesign/cli/api/experimental',
|
|
17
|
+
signature: 'themeEditUndo(theme: string, options?: object): Promise<object>',
|
|
18
|
+
keywords: [
|
|
19
|
+
'theme',
|
|
20
|
+
'experimental theme',
|
|
21
|
+
'undo',
|
|
22
|
+
'design tokens',
|
|
23
|
+
'type-checked',
|
|
24
|
+
],
|
|
25
|
+
params: [
|
|
26
|
+
{
|
|
27
|
+
name: 'theme',
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'The theme name.',
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'options.png',
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
description: 'Also take PNG pictures of the preview.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'options.cwd',
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'The app folder.',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
returns: [
|
|
44
|
+
{
|
|
45
|
+
type: 'themeEdit.undo',
|
|
46
|
+
description:
|
|
47
|
+
'What was undone, the settings count now, the undo steps left, and the preview.',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
throws: [
|
|
51
|
+
{
|
|
52
|
+
code: 'ERR_THEME_NOTHING_TO_UNDO',
|
|
53
|
+
when: 'there is no earlier change',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
code: 'ERR_UNKNOWN_THEME',
|
|
57
|
+
when: 'the theme does not exist; the suggestion is the `new` command',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
code: 'ERR_PROJECT_REQUIRED',
|
|
61
|
+
when: '@astryxdesign/core is not installed in the folder',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
code: 'ERR_THEME_INVALID',
|
|
65
|
+
when: 'the theme does not build (the change is undone)',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
code: 'ERR_RENDER_FAILED',
|
|
69
|
+
when: "the components or the preview do not render with the project's React",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
examples: [
|
|
73
|
+
{
|
|
74
|
+
label: 'Step back',
|
|
75
|
+
code: 'await themeEditUndo(...)',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
command: 'experimental theme undo',
|
|
79
|
+
related: ['themeBuild'],
|
|
80
|
+
};
|
|
@@ -13,18 +13,18 @@ export const docs = {
|
|
|
13
13
|
sections: [
|
|
14
14
|
{
|
|
15
15
|
title: 'Overview',
|
|
16
|
-
|
|
16
|
+
category: 'foundations',
|
|
17
17
|
content: [
|
|
18
18
|
{
|
|
19
19
|
type: 'prose',
|
|
20
|
-
text: 'Colors are semantic: tokens describe purpose, not appearance. Every color adapts automatically between light and dark modes via CSS light-dark(). Themes override the resolved values, so your code never references raw hex colors.',
|
|
20
|
+
text: 'Colors are semantic: tokens describe purpose, not appearance. Every color adapts automatically between light and dark modes via CSS light-dark(). Themes override the resolved values, so your code never references raw hex colors. Each theme defines its own values: `{@command theme list}` shows the themes that are available.',
|
|
21
21
|
},
|
|
22
22
|
],
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
id: 'surface-colors',
|
|
26
26
|
title: 'Color Tokens',
|
|
27
|
-
|
|
27
|
+
category: 'foundations',
|
|
28
28
|
content: [
|
|
29
29
|
{
|
|
30
30
|
type: 'prose',
|
|
@@ -40,7 +40,7 @@ export const docs = {
|
|
|
40
40
|
{
|
|
41
41
|
id: 'usage',
|
|
42
42
|
title: 'Use color tokens in StyleX',
|
|
43
|
-
|
|
43
|
+
category: 'foundations',
|
|
44
44
|
content: [
|
|
45
45
|
{
|
|
46
46
|
type: 'prose',
|
|
@@ -68,7 +68,7 @@ const styles = stylex.create({
|
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
title: 'Best Practices',
|
|
71
|
-
|
|
71
|
+
category: 'foundations',
|
|
72
72
|
content: [
|
|
73
73
|
{
|
|
74
74
|
type: 'list',
|
|
@@ -143,7 +143,7 @@ astryx experimental icon add --variant solid --from @heroicons/react/24/solid --
|
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
type: 'prose',
|
|
146
|
-
text: 'A library whose icons are data (objects or SVG strings) has no components to find:
|
|
146
|
+
text: 'A library whose icons are data (objects or SVG strings) has no components to find: write an adapter (see library shapes) and pass it, as in `experimental icon new-set fa --from @acme/glyph-data --adapter ./src/adapt.js#adapt`; every data export then becomes an icon through the adapter. When every icon export shares a leading word, such as `feather` in `featherEye` and `featherSun`, ids and export names leave it out: `featherEye` becomes id `eye`, exported as `EyeIcon`. The prefix is read over icon-like exports only: SCREAMING_CASE constants (`README`, `VERSION`), number and boolean exports, and, next to components or icon objects, plain strings are never icons. Components named `…Provider` or `…Context` are never icons either, and neither is a pack: an object whose keys are all other exports of the module, such as `fas` next to `faXmark`. Leave out any other export that is not an icon with `--exclude meta,version`: the data file keeps the list in `exclude`, so a refresh leaves them out too. When a library exports one icon under several names (`Trash2` and `Trash`), the icon is recorded once and its other names become words, so `experimental icon trash-2` finds it and `experimental icon map delete trash-2` maps it. `experimental icon add` reads the prefix the same way, and reuses the icon an export already has, so its commands need no `--id`.',
|
|
147
147
|
},
|
|
148
148
|
],
|
|
149
149
|
},
|
|
@@ -241,7 +241,7 @@ for (const [name, Icon] of Object.entries(icons)) {
|
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
type: 'prose',
|
|
244
|
-
text: 'An export that is not a component goes through your adapter: a function in your package that turns it into one.
|
|
244
|
+
text: 'An export that is not a component goes through your adapter: a function in your package that turns it into one. Pass it to `experimental icon new-set` as `--adapter ./src/adapt.js#adapt`, which declares it in the data file as `"adapter": {"module": "./src/adapt.js", "export": "adapt"}`; with `--from`, every data export becomes an icon through it, and `experimental icon add` writes `export const RocketIcon = adaptIcon(RocketIconSource);`:',
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
type: 'code',
|
|
@@ -308,6 +308,10 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
|
|
|
308
308
|
type: 'prose',
|
|
309
309
|
text: 'The other Astryx definitions your set leaves unmapped are not issues: a library need not draw every definition. They are listed under "Unmapped icon definitions (optional)", and in the JSON as the validate result\'s `iconSets`: for each set, `unmappedDefinitions` (each `{name, description, words}`) and `suggestions` (each `{definition, icon}`, for any unmapped definition one of your icons fits). They are never counted and never fail a check.',
|
|
310
310
|
},
|
|
311
|
+
{
|
|
312
|
+
type: 'prose',
|
|
313
|
+
text: 'Templates use more meanings than the built-in ones, such as `document` and `share`. A copied template shows a placeholder for each meaning your set does not map. To see which, run `astryx experimental icon --definitions` in your package: each definition shows how many templates use it and whether your set maps it. `new-set`, `add`, and `map` end with a line that names the template meanings the set still leaves unmapped, most used first, and `integration check` lists them under "Template icon meanings not mapped" (in the JSON, each set\'s `templateMeanings.unmapped`, each `{definition, templates}`). This list never fails a check.',
|
|
314
|
+
},
|
|
311
315
|
{
|
|
312
316
|
type: 'prose',
|
|
313
317
|
text: 'An export fails only when the reader proves it absent; what it cannot judge it does not fail either. An icon export whose module is an `exports` target you have not built yet; an icon or adapter export it cannot prove either way (behind a re-export it cannot follow, bound to a default or namespace import, or imported from a package that is not installed); and a theme map or theme-map entry it cannot read are listed under "Not checked", and in the JSON as each set\'s `unchecked` (each `{icon}`, `{adapter}`, or `{entry}`, with its `reason`). Build the package, install the package it imports from, export the icon by name, or write the entry as a binding or element to have it checked. An export your built module lacks is still an error.',
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
export const doc = {
|
|
5
5
|
type: 'block',
|
|
6
6
|
exampleFor: 'InternationalizationProvider',
|
|
7
|
-
name: '
|
|
7
|
+
name: 'Load a shipped Astryx locale catalog',
|
|
8
8
|
displayName: 'Internationalization Provider — Shipped Locale',
|
|
9
|
+
registry: {slug: 'shipped-locale'},
|
|
9
10
|
description:
|
|
10
11
|
'Load a locale catalog shipped by Astryx and re-render InternationalizationProvider with a new locale to update Astryx strings live.',
|
|
11
12
|
isReady: true,
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
export const doc = {
|
|
5
5
|
type: 'block',
|
|
6
6
|
exampleFor: 'InternationalizationProvider',
|
|
7
|
-
name: '
|
|
7
|
+
name: 'Override one Astryx string',
|
|
8
8
|
displayName: 'Internationalization Provider — Overrides',
|
|
9
|
+
registry: {slug: 'overrides'},
|
|
9
10
|
description:
|
|
10
11
|
'Override a small number of Astryx strings without providing a full locale catalog.',
|
|
11
12
|
isReady: true,
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
export const doc = {
|
|
5
5
|
type: 'block',
|
|
6
6
|
exampleFor: 'InternationalizationProvider',
|
|
7
|
-
name: '
|
|
7
|
+
name: 'Mirror the layout for right-to-left text',
|
|
8
8
|
displayName: 'Internationalization Provider — RTL Direction',
|
|
9
|
+
registry: {slug: 'rtl-direction'},
|
|
9
10
|
description:
|
|
10
11
|
'Toggle text direction with the `dir` prop and watch Astryx components mirror. Pagination flips its prev/next chevrons under RTL. The `dir` prop is passed to both `InternationalizationProvider` (so Astryx components pick it up) and the `VStack` (so the DOM subtree mirrors); both channels stay in sync with no extra wrapper.',
|
|
11
12
|
isReady: true,
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
export const doc = {
|
|
5
5
|
type: 'block',
|
|
6
6
|
exampleFor: 'InternationalizationProvider',
|
|
7
|
-
name: '
|
|
7
|
+
name: 'Show Calendar and DateInput in another calendar',
|
|
8
8
|
displayName: 'Internationalization Provider — Calendar',
|
|
9
|
+
registry: {slug: 'calendar'},
|
|
9
10
|
description:
|
|
10
11
|
'Set the `calendar` prop and the `Calendar` and `DateInput` inside the provider show that calendar system. The value stays a Gregorian ISO date. Japanese and Buddhist dates work in every browser; calendars such as Persian or Hebrew also need `Temporal` or a polyfill.',
|
|
11
12
|
isReady: true,
|
|
@@ -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: 'useTruncation',
|
|
7
|
+
name: 'useTruncation — Tooltip on Cut-Off Text',
|
|
8
|
+
displayName: 'useTruncation — Tooltip on Cut-Off Text',
|
|
9
|
+
description:
|
|
10
|
+
'A narrow table column shows the full path in a Tooltip only where useTruncation reports the text is cut off; the short path shows none. One cell clamped to two lines shows the multi-line case.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Table', 'Tooltip'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useTruncation} from '@astryxdesign/core/Text';
|
|
6
|
+
import {Tooltip} from '@astryxdesign/core/Tooltip';
|
|
7
|
+
import {
|
|
8
|
+
Table,
|
|
9
|
+
TableBody,
|
|
10
|
+
TableCell,
|
|
11
|
+
TableHeader,
|
|
12
|
+
TableHeaderCell,
|
|
13
|
+
TableRow,
|
|
14
|
+
} from '@astryxdesign/core/Table';
|
|
15
|
+
|
|
16
|
+
interface FileAsset {
|
|
17
|
+
name: string;
|
|
18
|
+
path: string;
|
|
19
|
+
mode: 'single' | 'clamped' | 'short';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const FILES: FileAsset[] = [
|
|
23
|
+
{
|
|
24
|
+
name: 'build',
|
|
25
|
+
path: 'artifacts/release/build-20261103-120344/index.html',
|
|
26
|
+
mode: 'single',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'bundle',
|
|
30
|
+
path: 'reports/coverage/packages/core/src/components/Calendar/index.html',
|
|
31
|
+
mode: 'clamped',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'readme',
|
|
35
|
+
path: 'README.md',
|
|
36
|
+
mode: 'short',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
function TruncatedCell({children}: {children: string}) {
|
|
41
|
+
const truncation = useTruncation({maxLines: 1});
|
|
42
|
+
return (
|
|
43
|
+
<Tooltip
|
|
44
|
+
content={truncation.fullText}
|
|
45
|
+
placement="above"
|
|
46
|
+
isEnabled={truncation.isTruncated}>
|
|
47
|
+
<span
|
|
48
|
+
ref={truncation.ref}
|
|
49
|
+
tabIndex={truncation.isTruncated ? 0 : undefined}
|
|
50
|
+
style={{
|
|
51
|
+
display: 'block',
|
|
52
|
+
maxWidth: 120,
|
|
53
|
+
overflow: 'hidden',
|
|
54
|
+
textOverflow: 'ellipsis',
|
|
55
|
+
whiteSpace: 'nowrap',
|
|
56
|
+
}}>
|
|
57
|
+
{children}
|
|
58
|
+
</span>
|
|
59
|
+
</Tooltip>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function ClampedCell({children}: {children: string}) {
|
|
64
|
+
const truncation = useTruncation({maxLines: 2});
|
|
65
|
+
return (
|
|
66
|
+
<Tooltip
|
|
67
|
+
content={truncation.fullText}
|
|
68
|
+
placement="above"
|
|
69
|
+
isEnabled={truncation.isTruncated}>
|
|
70
|
+
<span
|
|
71
|
+
ref={truncation.ref}
|
|
72
|
+
tabIndex={truncation.isTruncated ? 0 : undefined}
|
|
73
|
+
style={{
|
|
74
|
+
display: '-webkit-box',
|
|
75
|
+
WebkitLineClamp: 2,
|
|
76
|
+
WebkitBoxOrient: 'vertical',
|
|
77
|
+
overflow: 'hidden',
|
|
78
|
+
maxWidth: 120,
|
|
79
|
+
wordBreak: 'break-all',
|
|
80
|
+
}}>
|
|
81
|
+
{children}
|
|
82
|
+
</span>
|
|
83
|
+
</Tooltip>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default function UseTruncationHookUsage() {
|
|
88
|
+
return (
|
|
89
|
+
<Table>
|
|
90
|
+
<TableHeader>
|
|
91
|
+
<TableRow>
|
|
92
|
+
<TableHeaderCell>Asset</TableHeaderCell>
|
|
93
|
+
<TableHeaderCell>Path</TableHeaderCell>
|
|
94
|
+
</TableRow>
|
|
95
|
+
</TableHeader>
|
|
96
|
+
<TableBody>
|
|
97
|
+
{FILES.map(file => (
|
|
98
|
+
<TableRow key={file.name}>
|
|
99
|
+
<TableCell>{file.name}</TableCell>
|
|
100
|
+
<TableCell>
|
|
101
|
+
{file.mode === 'clamped' ? (
|
|
102
|
+
<ClampedCell>{file.path}</ClampedCell>
|
|
103
|
+
) : (
|
|
104
|
+
<TruncatedCell>{file.path}</TruncatedCell>
|
|
105
|
+
)}
|
|
106
|
+
</TableCell>
|
|
107
|
+
</TableRow>
|
|
108
|
+
))}
|
|
109
|
+
</TableBody>
|
|
110
|
+
</Table>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
@@ -514,6 +514,7 @@ export const CommandDocKindSchema: z.ZodObject<{
|
|
|
514
514
|
same: "same";
|
|
515
515
|
refuse: "refuse";
|
|
516
516
|
}>>;
|
|
517
|
+
replaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
517
518
|
related: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
518
519
|
notes: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
519
520
|
type: z.ZodLiteral<"prose">;
|
|
@@ -594,6 +594,7 @@ export const CommandDocKindSchema = z
|
|
|
594
594
|
.array(z.object({code: z.number(), when: z.string()}).passthrough())
|
|
595
595
|
.optional(),
|
|
596
596
|
outsideProject: z.enum(['same', 'refuse', 'own']).optional(),
|
|
597
|
+
replaces: z.array(z.string()).optional(),
|
|
597
598
|
related: z.array(z.string()).optional(),
|
|
598
599
|
notes: z.array(ReferenceContentBlockSchema).optional(),
|
|
599
600
|
})
|
|
@@ -209,6 +209,13 @@ export const doc = {
|
|
|
209
209
|
type: 'string',
|
|
210
210
|
description: 'Deprecation notice — a DEP-* id and the replacement.',
|
|
211
211
|
},
|
|
212
|
+
{
|
|
213
|
+
name: 'replaces',
|
|
214
|
+
type: 'string[]',
|
|
215
|
+
stability: 'experimental',
|
|
216
|
+
description:
|
|
217
|
+
'The commands this command is meant to replace, by command path (`theme build`). Help shows them as one line ("Will replace: astryx theme build"), and a later deprecation of those commands reads this list. It marks nothing as deprecated.',
|
|
218
|
+
},
|
|
212
219
|
{
|
|
213
220
|
name: 'related',
|
|
214
221
|
type: 'string[]',
|
|
@@ -97,6 +97,9 @@ export interface CommandDoc extends AuthoredDocGraphFields {
|
|
|
97
97
|
outsideProject?: CommandOutsideProject;
|
|
98
98
|
/** Deprecation notice — a DEP-* id and the replacement. */
|
|
99
99
|
deprecated?: string;
|
|
100
|
+
/** The commands this command is meant to replace, by command path (`theme build`). Help shows them as one line ("Will replace: astryx theme build"), and a later deprecation of those commands reads this list. It marks nothing as deprecated.
|
|
101
|
+
* @experimental May change or be removed in a patch release. */
|
|
102
|
+
replaces?: string[];
|
|
100
103
|
/** Related command names; the CLI links each to its doc. */
|
|
101
104
|
related?: string[];
|
|
102
105
|
/** Freeform prose/notes. */
|