@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.
Files changed (146) hide show
  1. package/README.md +18 -18
  2. package/api/component/__fixtures__/resolutions/modules.txt +1 -1
  3. package/api/doctor/doctor.mjs +3 -7
  4. package/api/experimental.d.mts +2 -0
  5. package/api/experimental.mjs +10 -0
  6. package/api/icon/_adapter.d.mts +10 -0
  7. package/api/icon/_adapter.mjs +31 -2
  8. package/api/icon/_authoring.d.mts +2 -1
  9. package/api/icon/_authoring.mjs +91 -6
  10. package/api/icon/_options.mjs +1 -0
  11. package/api/icon/_records.d.mts +18 -0
  12. package/api/icon/_records.mjs +26 -0
  13. package/api/icon/add/add.mjs +7 -1
  14. package/api/icon/definitions/definitions.d.mts +12 -0
  15. package/api/icon/definitions/definitions.mjs +83 -0
  16. package/api/icon/icon.doc.mjs +5 -4
  17. package/api/icon/icon.mjs +5 -16
  18. package/api/icon/icon.type.d.mts +29 -2
  19. package/api/icon/icon.type.mjs +17 -3
  20. package/api/icon/iconAdd.doc.mjs +1 -1
  21. package/api/icon/iconMap.doc.mjs +2 -2
  22. package/api/icon/iconNewSet.doc.mjs +8 -2
  23. package/api/icon/map/map.mjs +21 -2
  24. package/api/icon/new-set/new-set.mjs +14 -2
  25. package/api/icon/search/search.mjs +2 -15
  26. package/api/icon/use/use.mjs +4 -3
  27. package/api/integration/validate-integration.mjs +6 -1
  28. package/api/integration/validate-integration.type.d.mts +12 -0
  29. package/api/integration/validate-integration.type.mjs +5 -0
  30. package/api/theme-edit/_adapter.d.mts +96 -0
  31. package/api/theme-edit/_adapter.mjs +1039 -0
  32. package/api/theme-edit/_catalog.d.mts +59 -0
  33. package/api/theme-edit/_catalog.mjs +564 -0
  34. package/api/theme-edit/_check.d.mts +49 -0
  35. package/api/theme-edit/_check.mjs +842 -0
  36. package/api/theme-edit/_color.d.mts +35 -0
  37. package/api/theme-edit/_color.mjs +125 -0
  38. package/api/theme-edit/_compiler.d.mts +61 -0
  39. package/api/theme-edit/_compiler.mjs +522 -0
  40. package/api/theme-edit/_css-properties.d.mts +10 -0
  41. package/api/theme-edit/_css-properties.mjs +556 -0
  42. package/api/theme-edit/_parts.d.mts +111 -0
  43. package/api/theme-edit/_parts.mjs +409 -0
  44. package/api/theme-edit/_png.d.mts +40 -0
  45. package/api/theme-edit/_png.mjs +187 -0
  46. package/api/theme-edit/_preview.d.mts +86 -0
  47. package/api/theme-edit/_preview.mjs +564 -0
  48. package/api/theme-edit/_project.d.mts +83 -0
  49. package/api/theme-edit/_project.mjs +289 -0
  50. package/api/theme-edit/_settings.d.mts +222 -0
  51. package/api/theme-edit/_settings.mjs +848 -0
  52. package/api/theme-edit/_tables.d.mts +130 -0
  53. package/api/theme-edit/_tables.mjs +697 -0
  54. package/api/theme-edit/theme-edit.d.mts +89 -0
  55. package/api/theme-edit/theme-edit.mjs +119 -0
  56. package/api/theme-edit/theme-edit.type.d.mts +270 -0
  57. package/api/theme-edit/theme-edit.type.mjs +155 -0
  58. package/api/theme-edit/themeEditExplain.doc.d.mts +6 -0
  59. package/api/theme-edit/themeEditExplain.doc.mjs +88 -0
  60. package/api/theme-edit/themeEditNew.doc.d.mts +6 -0
  61. package/api/theme-edit/themeEditNew.doc.mjs +89 -0
  62. package/api/theme-edit/themeEditPreview.doc.d.mts +6 -0
  63. package/api/theme-edit/themeEditPreview.doc.mjs +96 -0
  64. package/api/theme-edit/themeEditReset.doc.d.mts +6 -0
  65. package/api/theme-edit/themeEditReset.doc.mjs +161 -0
  66. package/api/theme-edit/themeEditSet.doc.d.mts +6 -0
  67. package/api/theme-edit/themeEditSet.doc.mjs +165 -0
  68. package/api/theme-edit/themeEditShow.doc.d.mts +6 -0
  69. package/api/theme-edit/themeEditShow.doc.mjs +86 -0
  70. package/api/theme-edit/themeEditUndo.doc.d.mts +6 -0
  71. package/api/theme-edit/themeEditUndo.doc.mjs +80 -0
  72. package/assets/docs/color.doc.mjs +5 -5
  73. package/assets/docs/tree/icon-sets.doc.mjs +6 -2
  74. package/assets/docs/tree/tokens-border.doc.mjs +1 -1
  75. package/assets/docs/tree/tokens-color.doc.mjs +2 -2
  76. package/assets/docs/tree/tokens-data.doc.mjs +2 -2
  77. package/assets/docs/tree/tokens-duration.doc.mjs +1 -1
  78. package/assets/docs/tree/tokens-ease.doc.mjs +1 -1
  79. package/assets/docs/tree/tokens-focus.doc.mjs +1 -1
  80. package/assets/docs/tree/tokens-font-weight.doc.mjs +1 -1
  81. package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
  82. package/assets/docs/tree/tokens-shadow.doc.mjs +1 -1
  83. package/assets/docs/tree/tokens-size.doc.mjs +1 -1
  84. package/assets/docs/tree/tokens-spacing.doc.mjs +1 -1
  85. package/assets/docs/tree/tokens-syntax.doc.mjs +1 -1
  86. package/assets/docs/tree/tokens-text-size.doc.mjs +1 -1
  87. package/assets/docs/tree/tokens-type-scale.doc.mjs +1 -1
  88. package/assets/docs/tree/tokens-typography.doc.mjs +1 -1
  89. package/assets/icons/definitions/bank.doc.mjs +1 -1
  90. package/assets/icons/definitions/save.doc.mjs +1 -1
  91. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +2 -1
  92. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +2 -1
  93. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider03RtlDirection.doc.mjs +2 -1
  94. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.doc.mjs +2 -1
  95. package/assets/templates/blocks/components/Text/useTruncationHookUsage.doc.mjs +14 -0
  96. package/assets/templates/blocks/components/Text/useTruncationHookUsage.tsx +112 -0
  97. package/authoring/doctypes/_schema.d.mts +1 -0
  98. package/authoring/doctypes/_schema.mjs +1 -0
  99. package/authoring/doctypes/command/command.doc.mjs +7 -0
  100. package/authoring/doctypes/command/type.ts +3 -0
  101. package/authoring/doctypes/icon-set/parse.d.mts +7 -0
  102. package/authoring/doctypes/icon-set/parse.mjs +18 -8
  103. package/clients/cli/commands/doctor.mjs +33 -3
  104. package/clients/cli/commands/experimental/icon.mjs +67 -14
  105. package/clients/cli/commands/experimental/index.mjs +2 -0
  106. package/clients/cli/commands/experimental/theme.mjs +542 -0
  107. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +7 -1
  108. package/clients/cli/commands/experimental-icon.doc.mjs +3 -2
  109. package/clients/cli/commands/experimental-theme-add.doc.mjs +78 -0
  110. package/clients/cli/commands/experimental-theme-compile.doc.mjs +97 -0
  111. package/clients/cli/commands/experimental-theme-eject.doc.mjs +71 -0
  112. package/clients/cli/commands/experimental-theme-explain.doc.mjs +84 -0
  113. package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -0
  114. package/clients/cli/commands/experimental-theme-new.doc.mjs +66 -0
  115. package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +73 -0
  116. package/clients/cli/commands/experimental-theme-palette.doc.mjs +37 -0
  117. package/clients/cli/commands/experimental-theme-preview.doc.mjs +76 -0
  118. package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -0
  119. package/clients/cli/commands/experimental-theme-reset.doc.mjs +103 -0
  120. package/clients/cli/commands/experimental-theme-set.doc.mjs +121 -0
  121. package/clients/cli/commands/experimental-theme-show.doc.mjs +66 -0
  122. package/clients/cli/commands/experimental-theme-targets.doc.mjs +61 -0
  123. package/clients/cli/commands/experimental-theme-template.doc.mjs +61 -0
  124. package/clients/cli/commands/experimental-theme-undo.doc.mjs +55 -0
  125. package/clients/cli/commands/experimental-theme-use.doc.mjs +55 -0
  126. package/clients/cli/commands/experimental-theme.doc.mjs +66 -0
  127. package/clients/cli/commands/experimental.doc.mjs +10 -3
  128. package/clients/cli/commands/theme.mjs +101 -34
  129. package/clients/cli/index.mjs +16 -0
  130. package/clients/cli/lib/define-command.mjs +3 -0
  131. package/foundation/discovery/icon-set-checks.d.mts +16 -1
  132. package/foundation/discovery/icon-set-checks.mjs +68 -7
  133. package/foundation/discovery/icon-set-discovery.d.mts +21 -6
  134. package/foundation/discovery/icon-set-discovery.mjs +17 -8
  135. package/foundation/discovery/template-icon-meanings.d.mts +39 -0
  136. package/foundation/discovery/template-icon-meanings.mjs +95 -0
  137. package/foundation/discovery/theming-targets.d.mts +6 -0
  138. package/foundation/discovery/theming-targets.mjs +33 -0
  139. package/foundation/response/error-codes.d.mts +12 -1
  140. package/foundation/response/error-codes.doc.mjs +66 -0
  141. package/foundation/response/error-codes.mjs +55 -0
  142. package/foundation/response/response-types.doc.mjs +43 -0
  143. package/foundation/text/template-meanings-line.d.mts +16 -0
  144. package/foundation/text/template-meanings-line.mjs +37 -0
  145. package/foundation/xle/browser.d.mts +2 -2
  146. package/package.json +6 -6
@@ -0,0 +1,88 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditExplain()` / `astryx experimental theme explain`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc = {
7
+ type: 'function',
8
+ kind: 'api',
9
+ name: 'themeEditExplain',
10
+ namespace: 'cli/api',
11
+ stability: 'experimental',
12
+ displayName: 'themeEditExplain()',
13
+ summary:
14
+ "Explain a part, family, setting or aspect; answer a question in plain words; read a picture's colors; or list what you can set.",
15
+ description:
16
+ 'One command for every question. A part (button, card; --list parts): what it reads for each aspect (text, background, border, corners, shadow, spacing, font, size) and under which variant or state, its variants (--when) and states (--state), the parts inside it (a token set --on the part reaches them), and its family. A family (inputs, containers, checks, menus): its members and whether styling one styles all. A setting: a dial\'s rungs and examples, a token\'s type, default and the parts that read it, or a CSS property and the parts that set it. An aspect (colors, text, background, border, corners, shadow, spacing, font, size): the dial and the whole-theme tokens most parts read for it. A question in plain words ("bold white text in the header", "glossy gradient header"): it finds the parts (header, nav links, banner, cards, inputs, buttons and their variants...) and aspects (text color, background, gradient, corners, border, shadow or bevel, spacing, font, bold, letter spacing) and answers with exact commands from what each part really reads: the direct property (always works) and the token route; a part with variants says a change without --when reaches every variant. A PNG picture: its main colors, biggest share first, with where each sits (a number after the file sets how many, default 14), or with --at the exact color at pixel points (no browser needed). --list dials|tokens|parts|families|properties lists what a change can name; a subject then filters the list. Experimental: it may change or be removed in a patch release.',
17
+ importPath: '@astryxdesign/cli/api/experimental',
18
+ signature:
19
+ 'themeEditExplain(subject?: string, options?: object): Promise<object>',
20
+ keywords: [
21
+ 'theme',
22
+ 'experimental theme',
23
+ 'explain',
24
+ 'design tokens',
25
+ 'type-checked',
26
+ ],
27
+ params: [
28
+ {
29
+ name: 'subject',
30
+ type: 'string',
31
+ description:
32
+ 'A part, family, setting, aspect, question, or PNG file; with `list`, a filter.',
33
+ },
34
+ {
35
+ name: 'options.list',
36
+ type: 'string',
37
+ description: 'dials, tokens, parts, families, or properties.',
38
+ },
39
+ {
40
+ name: 'options.at',
41
+ type: 'string[]',
42
+ description: 'With a picture: pixel points x,y.',
43
+ },
44
+ {
45
+ name: 'options.count',
46
+ type: 'number',
47
+ description: 'With a picture: how many main colors (default 14).',
48
+ },
49
+ {
50
+ name: 'options.cwd',
51
+ type: 'string',
52
+ description: 'The app folder.',
53
+ },
54
+ ],
55
+ returns: [
56
+ {
57
+ type: 'themeEdit.explain',
58
+ description:
59
+ '`kind` says which answer it is: part (variants, states, reads per aspect, parts inside, family), family (members), setting, aspect or question (answers with commands), picture (main colors or the color at points), or list (the items).',
60
+ },
61
+ ],
62
+ throws: [
63
+ {
64
+ code: 'ERR_MISSING_ARGUMENT',
65
+ when: 'nothing named',
66
+ },
67
+ {
68
+ code: 'ERR_INVALID_ARGUMENT',
69
+ when: 'an unknown --list kind, --at without a picture, a picture that is not a PNG, an odd count of numbers in --at, or a bad count',
70
+ },
71
+ {
72
+ code: 'ERR_FILE_NOT_FOUND',
73
+ when: 'the picture does not exist',
74
+ },
75
+ {
76
+ code: 'ERR_PROJECT_REQUIRED',
77
+ when: '@astryxdesign/core is not installed in the folder',
78
+ },
79
+ ],
80
+ examples: [
81
+ {
82
+ label: 'A part',
83
+ code: 'await themeEditExplain(...)',
84
+ },
85
+ ],
86
+ command: 'experimental theme explain',
87
+ related: ['themeBuild'],
88
+ };
@@ -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 `themeEditNew()` / `astryx experimental theme new`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -0,0 +1,89 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditNew()` / `astryx experimental theme new`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc = {
7
+ type: 'function',
8
+ kind: 'api',
9
+ name: 'themeEditNew',
10
+ namespace: 'cli/api',
11
+ stability: 'experimental',
12
+ displayName: 'themeEditNew()',
13
+ summary: 'Start a theme in themes/<theme>/, optionally on a built-in theme.',
14
+ description:
15
+ 'Makes themes/<theme>/ with <theme>.settings.json (the settings this command owns), the generated <theme>.settings.ts, <theme>.theme.ts (which extends it and is yours), and the built <theme>.css and <theme>.js (the same build as `astryx theme build`), then writes preview.html, the sample app page with the theme. --like builds on a built-in theme (neutral, stone, matcha, y2k, gothic, chocolate, butter; its package must be installed); without it the theme starts from Astryx defaults. Change the base later with `astryx experimental theme set <theme> base <theme|none>`. Afterwards, <theme>.theme.ts is yours: it extends the generated <theme>.settings.ts, and every later change rewrites only the settings files, so your own edits in <theme>.theme.ts survive. A theme name is lowercase letters, digits and dashes. Experimental: it may change or be removed in a patch release.',
16
+ importPath: '@astryxdesign/cli/api/experimental',
17
+ signature: 'themeEditNew(theme: string, options?: object): Promise<object>',
18
+ keywords: [
19
+ 'theme',
20
+ 'experimental theme',
21
+ 'new',
22
+ 'design tokens',
23
+ 'type-checked',
24
+ ],
25
+ params: [
26
+ {
27
+ name: 'theme',
28
+ type: 'string',
29
+ description: 'The theme name: lowercase letters, digits and dashes.',
30
+ required: true,
31
+ },
32
+ {
33
+ name: 'options.like',
34
+ type: 'string',
35
+ description: 'A built-in theme to build on.',
36
+ },
37
+ {
38
+ name: 'options.png',
39
+ type: 'boolean',
40
+ description: 'Also take PNG pictures of the preview.',
41
+ },
42
+ {
43
+ name: 'options.cwd',
44
+ type: 'string',
45
+ description: 'The app folder (default: the current directory).',
46
+ },
47
+ ],
48
+ returns: [
49
+ {
50
+ type: 'themeEdit.new',
51
+ description:
52
+ 'The theme, its base, the files written, contrast problems, and the preview.',
53
+ },
54
+ ],
55
+ throws: [
56
+ {
57
+ code: 'ERR_INVALID_ARGUMENT',
58
+ when: 'the name is not lowercase letters, digits and dashes',
59
+ },
60
+ {
61
+ code: 'ERR_FILE_EXISTS',
62
+ when: 'the theme, or files in its folder, already exist',
63
+ },
64
+ {
65
+ code: 'ERR_THEME_BAD_VALUE',
66
+ when: '`like` is not a built-in theme',
67
+ },
68
+ {
69
+ code: 'ERR_UNKNOWN_THEME',
70
+ when: 'the built-in theme is not installed; the suggestion is its install line',
71
+ },
72
+ {
73
+ code: 'ERR_PROJECT_REQUIRED',
74
+ when: '@astryxdesign/core is not installed in the folder',
75
+ },
76
+ {
77
+ code: 'ERR_THEME_INVALID',
78
+ when: 'the theme does not build',
79
+ },
80
+ ],
81
+ examples: [
82
+ {
83
+ label: 'Start on a built-in theme',
84
+ code: 'await themeEditNew(...)',
85
+ },
86
+ ],
87
+ command: 'experimental theme new',
88
+ related: ['themeBuild'],
89
+ };
@@ -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 `themeEditPreview()` / `astryx experimental theme preview`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -0,0 +1,96 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditPreview()` / `astryx experimental theme preview`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc = {
7
+ type: 'function',
8
+ kind: 'api',
9
+ name: 'themeEditPreview',
10
+ namespace: 'cli/api',
11
+ stability: 'experimental',
12
+ displayName: 'themeEditPreview()',
13
+ summary:
14
+ 'The theme-building page: every component grouped, overlays open, real template pages.',
15
+ description:
16
+ "Makes a page for building the theme: every component grouped (actions, inputs, selection, navigation, feedback, data, containers, overlays shown open), each variant side by side, plus the sample app page and real template pages (dashboard, form, settings; a template whose packages the app lacks is left out and named with its install line). Without --write, it renders the page with the theme to one self-contained HTML file in themes/<theme>/ (sheet.html, or sheet-<group>.html), with an auto/light/dark switch that needs no script. With --write <dir>, it writes theme-preview.tsx into the app instead (a real page using the app's own Astryx, with a light/dark switch) and the template pages beside it, for a route the app serves. --group limits it to one group. Experimental: it may change or be removed in a patch release.",
17
+ importPath: '@astryxdesign/cli/api/experimental',
18
+ signature:
19
+ 'themeEditPreview(theme: string, options?: object): Promise<object>',
20
+ keywords: [
21
+ 'theme',
22
+ 'experimental theme',
23
+ 'preview',
24
+ 'design tokens',
25
+ 'type-checked',
26
+ ],
27
+ params: [
28
+ {
29
+ name: 'theme',
30
+ type: 'string',
31
+ description: 'The theme name.',
32
+ required: true,
33
+ },
34
+ {
35
+ name: 'options.write',
36
+ type: 'string',
37
+ description: 'Write the page into the app, in this folder.',
38
+ },
39
+ {
40
+ name: 'options.group',
41
+ type: 'string',
42
+ description: 'Only one group.',
43
+ },
44
+ {
45
+ name: 'options.png',
46
+ type: 'boolean',
47
+ description: 'Also take PNG pictures of the HTML page.',
48
+ },
49
+ {
50
+ name: 'options.cwd',
51
+ type: 'string',
52
+ description: 'The app folder.',
53
+ },
54
+ ],
55
+ returns: [
56
+ {
57
+ type: 'themeEdit.preview',
58
+ description:
59
+ 'How the page was made (html or page), the files written, the component count, template pages left out, and any pictures.',
60
+ },
61
+ ],
62
+ throws: [
63
+ {
64
+ code: 'ERR_INVALID_ARGUMENT',
65
+ when: 'an unknown group, or --png with --write',
66
+ },
67
+ {
68
+ code: 'ERR_PATH_TRAVERSAL',
69
+ when: '--write is outside the current folder',
70
+ },
71
+ {
72
+ code: 'ERR_UNKNOWN_THEME',
73
+ when: 'the theme does not exist; the suggestion is the `new` command',
74
+ },
75
+ {
76
+ code: 'ERR_PROJECT_REQUIRED',
77
+ when: '@astryxdesign/core is not installed in the folder',
78
+ },
79
+ {
80
+ code: 'ERR_THEME_INVALID',
81
+ when: 'the theme does not build (the change is undone)',
82
+ },
83
+ {
84
+ code: 'ERR_RENDER_FAILED',
85
+ when: "the components or the preview do not render with the project's React",
86
+ },
87
+ ],
88
+ examples: [
89
+ {
90
+ label: 'One HTML file',
91
+ code: 'await themeEditPreview(...)',
92
+ },
93
+ ],
94
+ command: 'experimental theme preview',
95
+ related: ['themeBuild'],
96
+ };
@@ -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 `themeEditReset()` / `astryx experimental theme reset`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -0,0 +1,161 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditReset()` / `astryx experimental theme reset`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc = {
7
+ type: 'function',
8
+ kind: 'api',
9
+ name: 'themeEditReset',
10
+ namespace: 'cli/api',
11
+ stability: 'experimental',
12
+ displayName: 'themeEditReset()',
13
+ summary: "Return one setting to the base theme's value, rebuild, preview.",
14
+ description:
15
+ "Returns one setting to the base theme's value: the setting is removed, and the theme is rebuilt and previewed. Name it the way it was set: the same thing and the same --on, --when, --state, --mode and --only (`show` lists every setting that way). For the headings dial, name which half to reset: weight or tracking (default weight). A setting the theme does not have is refused and the error lists the settings it has for that thing. Experimental: it may change or be removed in a patch release.",
16
+ importPath: '@astryxdesign/cli/api/experimental',
17
+ signature:
18
+ 'themeEditReset(theme: string, thing: string, options?: object): Promise<object>',
19
+ keywords: [
20
+ 'theme',
21
+ 'experimental theme',
22
+ 'reset',
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: 'thing',
35
+ type: 'string',
36
+ description: 'The thing the setting changes.',
37
+ required: true,
38
+ },
39
+ {
40
+ name: 'options.value',
41
+ type: 'string',
42
+ description: 'For `headings`: `weight` or `tracking`.',
43
+ },
44
+ {
45
+ name: 'options.on',
46
+ type: 'string',
47
+ description: 'The part, family or role it was set on.',
48
+ },
49
+ {
50
+ name: 'options.when',
51
+ type: 'string',
52
+ description: 'The variant it was set for.',
53
+ },
54
+ {
55
+ name: 'options.state',
56
+ type: 'string',
57
+ description: 'The state it was set for.',
58
+ },
59
+ {
60
+ name: 'options.mode',
61
+ type: 'string',
62
+ description: 'The mode it was set for.',
63
+ },
64
+ {
65
+ name: 'options.only',
66
+ type: 'boolean',
67
+ description: 'Whether it was set with `--only`.',
68
+ },
69
+ {
70
+ name: 'options.png',
71
+ type: 'boolean',
72
+ description: 'Also take PNG pictures of the preview.',
73
+ },
74
+ {
75
+ name: 'options.cwd',
76
+ type: 'string',
77
+ description: 'The app folder.',
78
+ },
79
+ ],
80
+ returns: [
81
+ {
82
+ type: 'themeEdit.reset',
83
+ description:
84
+ 'The setting removed, resolved token changes, part styles changed, notes, contrast problems, and the preview.',
85
+ },
86
+ ],
87
+ throws: [
88
+ {
89
+ code: 'ERR_MISSING_ARGUMENT',
90
+ when: 'no thing or value, or --when/--state without --on',
91
+ },
92
+ {
93
+ code: 'ERR_THEME_UNKNOWN_PART',
94
+ when: '--on is not a part or a family',
95
+ },
96
+ {
97
+ code: 'ERR_THEME_UNKNOWN_VARIANT',
98
+ when: '--when names a prop or value the part does not have',
99
+ },
100
+ {
101
+ code: 'ERR_THEME_UNKNOWN_STATE',
102
+ when: '--state is not a state of the part',
103
+ },
104
+ {
105
+ code: 'ERR_THEME_UNKNOWN_TOKEN',
106
+ when: 'the token does not exist',
107
+ },
108
+ {
109
+ code: 'ERR_THEME_PRIVATE_TOKEN',
110
+ when: 'the variable is private to a component',
111
+ },
112
+ {
113
+ code: 'ERR_THEME_UNKNOWN_THING',
114
+ when: 'the thing is not a dial, a token or a CSS property',
115
+ },
116
+ {
117
+ code: 'ERR_THEME_BAD_VALUE',
118
+ when: 'the value does not fit the thing',
119
+ },
120
+ {
121
+ code: 'ERR_THEME_NO_MODE',
122
+ when: '--mode on something that cannot differ by mode',
123
+ },
124
+ {
125
+ code: 'ERR_THEME_NO_EFFECT',
126
+ when: 'the change could not take effect; the suggestions name what works',
127
+ },
128
+ {
129
+ code: 'ERR_THEME_NOT_SET',
130
+ when: '`reset` names a setting the theme does not have',
131
+ },
132
+ {
133
+ code: 'ERR_INVALID_ARGUMENT',
134
+ when: '--only on a part that is not a member of an always-alike family',
135
+ },
136
+ {
137
+ code: 'ERR_UNKNOWN_THEME',
138
+ when: 'the theme does not exist; the suggestion is the `new` command',
139
+ },
140
+ {
141
+ code: 'ERR_PROJECT_REQUIRED',
142
+ when: '@astryxdesign/core is not installed in the folder',
143
+ },
144
+ {
145
+ code: 'ERR_THEME_INVALID',
146
+ when: 'the theme does not build (the change is undone)',
147
+ },
148
+ {
149
+ code: 'ERR_RENDER_FAILED',
150
+ when: "the components or the preview do not render with the project's React",
151
+ },
152
+ ],
153
+ examples: [
154
+ {
155
+ label: 'Reset a whole-theme dial',
156
+ code: 'await themeEditReset(...)',
157
+ },
158
+ ],
159
+ command: 'experimental theme reset',
160
+ related: ['themeBuild'],
161
+ };
@@ -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 `themeEditSet()` / `astryx experimental theme set`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -0,0 +1,165 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditSet()` / `astryx experimental theme set`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc = {
7
+ type: 'function',
8
+ kind: 'api',
9
+ name: 'themeEditSet',
10
+ namespace: 'cli/api',
11
+ stability: 'experimental',
12
+ displayName: 'themeEditSet()',
13
+ summary:
14
+ 'Change one thing in a theme: checked against what the components read, built, previewed.',
15
+ description:
16
+ "Changes one thing. The thing is a dial (corners, spacing, accent, font, headings, surfaces, buttons, type, text-size, base, mode: big moves with named rungs; `more`/`less` step a rung), a design token by name (--color-background-body; `explain --list tokens`), or a CSS property on a part (background --on card; needs --on). Every change is CHECKED first against the installed Core: the part, the --when variant and value, the --state, the token's type (color, size, number, font, shadow; only colors and shadows may differ by mode), and whether the part, or a part inside it, actually reads the token for what you mean. A change that cannot take effect is REFUSED: exit 1, an error code, nothing written, and the suggestions lead with the command that works (the token the part really reads, or the property that sets it directly). Families: --on <family> styles every member; styling one member of an always-alike family (inputs, checks) styles the whole family unless --only. A setting on a part beats a whole-theme dial, and a dial never overwrites one. After building, a plain part setting that a more specific base-theme rule would beat (such as a heading level) is repeated on those variant keys, and the result says so. The result lists resolved token changes, part styles written, contrast problems this theme caused versus its base (text below 4.5:1), notes (accent text per mode, font loading), and writes themes/<theme>/preview.html. Values with spaces go in quotes: gradients, several shadows, font stacks. Dials: corners square|small|medium|large|round|pill|more|less|<size>; spacing tight|compact|medium|roomy|spacious|more|less; accent <color> (kept exact; accent text is made readable per mode); font <preset, open font, family or stack>; headings light|regular|medium|semibold|bold|heavy or tight|tighter|normal|wide; surfaces flat|outlined|raised|glass; buttons solid|outline|soft|caps; type compact|standard|editorial|display; text-size small|medium|large|larger|more|less|<number>; base <built-in theme>|none; mode both|light-only|dark-only. `astryx experimental theme explain --list dials` explains each. Experimental: it may change or be removed in a patch release.",
17
+ importPath: '@astryxdesign/cli/api/experimental',
18
+ signature:
19
+ 'themeEditSet(theme: string, thing: string, value: string, options?: object): Promise<object>',
20
+ keywords: [
21
+ 'theme',
22
+ 'experimental theme',
23
+ 'set',
24
+ 'design tokens',
25
+ 'type-checked',
26
+ ],
27
+ params: [
28
+ {
29
+ name: 'theme',
30
+ type: 'string',
31
+ description: 'The theme name.',
32
+ required: true,
33
+ },
34
+ {
35
+ name: 'thing',
36
+ type: 'string',
37
+ description: 'A dial, a design token, or a CSS property.',
38
+ required: true,
39
+ },
40
+ {
41
+ name: 'value',
42
+ type: 'string',
43
+ description:
44
+ "The value: a dial rung, `more`/`less`, or an exact value of the thing's type.",
45
+ required: true,
46
+ },
47
+ {
48
+ name: 'options.on',
49
+ type: 'string',
50
+ description: 'A part, a family, or for `font` a role.',
51
+ },
52
+ {
53
+ name: 'options.when',
54
+ type: 'string',
55
+ description: '`<prop>:<value>`: only that variant.',
56
+ },
57
+ {
58
+ name: 'options.state',
59
+ type: 'string',
60
+ description: 'Only that state.',
61
+ },
62
+ {
63
+ name: 'options.mode',
64
+ type: 'string',
65
+ description: '`light` or `dark`: only that color mode.',
66
+ },
67
+ {
68
+ name: 'options.only',
69
+ type: 'boolean',
70
+ description:
71
+ 'With a member of an always-alike family, style just that part.',
72
+ },
73
+ {
74
+ name: 'options.png',
75
+ type: 'boolean',
76
+ description: 'Also take PNG pictures of the preview.',
77
+ },
78
+ {
79
+ name: 'options.cwd',
80
+ type: 'string',
81
+ description: 'The app folder (default: the current directory).',
82
+ },
83
+ ],
84
+ returns: [
85
+ {
86
+ type: 'themeEdit.set',
87
+ description:
88
+ 'The setting written and the one it replaced, the parts and family it styles, resolved token changes, part styles written, part settings a dial kept, newly lifted variant keys, notes, contrast problems, build warnings, and the preview.',
89
+ },
90
+ ],
91
+ throws: [
92
+ {
93
+ code: 'ERR_MISSING_ARGUMENT',
94
+ when: 'no thing or value, or --when/--state without --on',
95
+ },
96
+ {
97
+ code: 'ERR_THEME_UNKNOWN_PART',
98
+ when: '--on is not a part or a family',
99
+ },
100
+ {
101
+ code: 'ERR_THEME_UNKNOWN_VARIANT',
102
+ when: '--when names a prop or value the part does not have',
103
+ },
104
+ {
105
+ code: 'ERR_THEME_UNKNOWN_STATE',
106
+ when: '--state is not a state of the part',
107
+ },
108
+ {
109
+ code: 'ERR_THEME_UNKNOWN_TOKEN',
110
+ when: 'the token does not exist',
111
+ },
112
+ {
113
+ code: 'ERR_THEME_PRIVATE_TOKEN',
114
+ when: 'the variable is private to a component',
115
+ },
116
+ {
117
+ code: 'ERR_THEME_UNKNOWN_THING',
118
+ when: 'the thing is not a dial, a token or a CSS property',
119
+ },
120
+ {
121
+ code: 'ERR_THEME_BAD_VALUE',
122
+ when: 'the value does not fit the thing',
123
+ },
124
+ {
125
+ code: 'ERR_THEME_NO_MODE',
126
+ when: '--mode on something that cannot differ by mode',
127
+ },
128
+ {
129
+ code: 'ERR_THEME_NO_EFFECT',
130
+ when: 'the change could not take effect; the suggestions name what works',
131
+ },
132
+ {
133
+ code: 'ERR_THEME_NOT_SET',
134
+ when: '`reset` names a setting the theme does not have',
135
+ },
136
+ {
137
+ code: 'ERR_INVALID_ARGUMENT',
138
+ when: '--only on a part that is not a member of an always-alike family',
139
+ },
140
+ {
141
+ code: 'ERR_UNKNOWN_THEME',
142
+ when: 'the theme does not exist; the suggestion is the `new` command',
143
+ },
144
+ {
145
+ code: 'ERR_PROJECT_REQUIRED',
146
+ when: '@astryxdesign/core is not installed in the folder',
147
+ },
148
+ {
149
+ code: 'ERR_THEME_INVALID',
150
+ when: 'the theme does not build (the change is undone)',
151
+ },
152
+ {
153
+ code: 'ERR_RENDER_FAILED',
154
+ when: "the components or the preview do not render with the project's React",
155
+ },
156
+ ],
157
+ examples: [
158
+ {
159
+ label: 'A big move with a dial',
160
+ code: 'await themeEditSet(...)',
161
+ },
162
+ ],
163
+ command: 'experimental theme set',
164
+ related: ['themeBuild'],
165
+ };
@@ -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 `themeEditShow()` / `astryx experimental theme show`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;