@astryxdesign/cli 0.7.13 → 0.7.14-canary.108f354

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 (164) 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 +12 -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 +116 -0
  31. package/api/theme-edit/_adapter.mjs +1683 -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 +845 -0
  36. package/api/theme-edit/_color.d.mts +29 -0
  37. package/api/theme-edit/_color.mjs +300 -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 +121 -0
  47. package/api/theme-edit/_preview.mjs +720 -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 +861 -0
  52. package/api/theme-edit/_tables.d.mts +132 -0
  53. package/api/theme-edit/_tables.mjs +700 -0
  54. package/api/theme-edit/theme-edit.d.mts +93 -0
  55. package/api/theme-edit/theme-edit.mjs +145 -0
  56. package/api/theme-edit/theme-edit.type.d.mts +413 -0
  57. package/api/theme-edit/theme-edit.type.mjs +233 -0
  58. package/api/theme-edit/themeEditHow.doc.d.mts +6 -0
  59. package/api/theme-edit/themeEditHow.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/themeEditPreviewAdd.doc.d.mts +6 -0
  63. package/api/theme-edit/themeEditPreviewAdd.doc.mjs +100 -0
  64. package/api/theme-edit/themeEditPreviewApp.doc.d.mts +6 -0
  65. package/api/theme-edit/themeEditPreviewApp.doc.mjs +84 -0
  66. package/api/theme-edit/themeEditPreviewList.doc.d.mts +6 -0
  67. package/api/theme-edit/themeEditPreviewList.doc.mjs +53 -0
  68. package/api/theme-edit/themeEditPreviewRemove.doc.d.mts +6 -0
  69. package/api/theme-edit/themeEditPreviewRemove.doc.mjs +66 -0
  70. package/api/theme-edit/themeEditSet.doc.d.mts +6 -0
  71. package/api/theme-edit/themeEditSet.doc.mjs +165 -0
  72. package/api/theme-edit/themeEditShow.doc.d.mts +6 -0
  73. package/api/theme-edit/themeEditShow.doc.mjs +86 -0
  74. package/api/theme-edit/themeEditUndo.doc.d.mts +6 -0
  75. package/api/theme-edit/themeEditUndo.doc.mjs +124 -0
  76. package/assets/docs/color.doc.mjs +5 -5
  77. package/assets/docs/tree/icon-sets.doc.mjs +6 -2
  78. package/assets/docs/tree/tokens-border.doc.mjs +1 -1
  79. package/assets/docs/tree/tokens-color.doc.mjs +2 -2
  80. package/assets/docs/tree/tokens-data.doc.mjs +2 -2
  81. package/assets/docs/tree/tokens-duration.doc.mjs +1 -1
  82. package/assets/docs/tree/tokens-ease.doc.mjs +1 -1
  83. package/assets/docs/tree/tokens-focus.doc.mjs +1 -1
  84. package/assets/docs/tree/tokens-font-weight.doc.mjs +1 -1
  85. package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
  86. package/assets/docs/tree/tokens-shadow.doc.mjs +1 -1
  87. package/assets/docs/tree/tokens-size.doc.mjs +1 -1
  88. package/assets/docs/tree/tokens-spacing.doc.mjs +1 -1
  89. package/assets/docs/tree/tokens-syntax.doc.mjs +1 -1
  90. package/assets/docs/tree/tokens-text-size.doc.mjs +1 -1
  91. package/assets/docs/tree/tokens-type-scale.doc.mjs +1 -1
  92. package/assets/docs/tree/tokens-typography.doc.mjs +1 -1
  93. package/assets/icons/definitions/bank.doc.mjs +1 -1
  94. package/assets/icons/definitions/save.doc.mjs +1 -1
  95. package/assets/preview-app/README.md +6 -0
  96. package/assets/preview-app/css.d.ts +5 -0
  97. package/assets/preview-app/gitignore +1 -0
  98. package/assets/preview-app/next.config.mjs +6 -0
  99. package/assets/preview-app/package.json +23 -0
  100. package/assets/preview-app/src/app/globals.css +5 -0
  101. package/assets/preview-app/src/app/layout.tsx +21 -0
  102. package/assets/preview-app/src/app/page.tsx +94 -0
  103. package/assets/preview-app/src/app/providers.tsx +16 -0
  104. package/assets/preview-app/tsconfig.json +27 -0
  105. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +2 -1
  106. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +2 -1
  107. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider03RtlDirection.doc.mjs +2 -1
  108. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider04Calendar.doc.mjs +2 -1
  109. package/assets/templates/blocks/components/Text/useTruncationHookUsage.doc.mjs +14 -0
  110. package/assets/templates/blocks/components/Text/useTruncationHookUsage.tsx +112 -0
  111. package/authoring/doctypes/_schema.d.mts +1 -0
  112. package/authoring/doctypes/_schema.mjs +1 -0
  113. package/authoring/doctypes/command/command.doc.mjs +7 -0
  114. package/authoring/doctypes/command/type.ts +3 -0
  115. package/authoring/doctypes/icon-set/parse.d.mts +7 -0
  116. package/authoring/doctypes/icon-set/parse.mjs +18 -8
  117. package/clients/cli/commands/doctor.mjs +33 -3
  118. package/clients/cli/commands/experimental/icon.mjs +67 -14
  119. package/clients/cli/commands/experimental/index.mjs +2 -0
  120. package/clients/cli/commands/experimental/theme.mjs +684 -0
  121. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +7 -1
  122. package/clients/cli/commands/experimental-icon.doc.mjs +3 -2
  123. package/clients/cli/commands/experimental-theme-add.doc.mjs +78 -0
  124. package/clients/cli/commands/experimental-theme-compile.doc.mjs +97 -0
  125. package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +84 -0
  126. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +66 -0
  127. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +121 -0
  128. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +66 -0
  129. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +104 -0
  130. package/clients/cli/commands/experimental-theme-editor.doc.mjs +49 -0
  131. package/clients/cli/commands/experimental-theme-eject.doc.mjs +71 -0
  132. package/clients/cli/commands/experimental-theme-list.doc.mjs +49 -0
  133. package/clients/cli/commands/experimental-theme-palette-generate.doc.mjs +73 -0
  134. package/clients/cli/commands/experimental-theme-palette.doc.mjs +37 -0
  135. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +86 -0
  136. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +66 -0
  137. package/clients/cli/commands/experimental-theme-preview-list.doc.mjs +48 -0
  138. package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +59 -0
  139. package/clients/cli/commands/experimental-theme-preview.doc.mjs +40 -0
  140. package/clients/cli/commands/experimental-theme-remove.doc.mjs +55 -0
  141. package/clients/cli/commands/experimental-theme-targets.doc.mjs +61 -0
  142. package/clients/cli/commands/experimental-theme-template.doc.mjs +61 -0
  143. package/clients/cli/commands/experimental-theme-use.doc.mjs +55 -0
  144. package/clients/cli/commands/experimental-theme.doc.mjs +57 -0
  145. package/clients/cli/commands/experimental.doc.mjs +10 -3
  146. package/clients/cli/commands/theme.mjs +101 -34
  147. package/clients/cli/index.mjs +18 -0
  148. package/clients/cli/lib/define-command.mjs +3 -0
  149. package/foundation/discovery/icon-set-checks.d.mts +16 -1
  150. package/foundation/discovery/icon-set-checks.mjs +68 -7
  151. package/foundation/discovery/icon-set-discovery.d.mts +21 -6
  152. package/foundation/discovery/icon-set-discovery.mjs +17 -8
  153. package/foundation/discovery/template-icon-meanings.d.mts +39 -0
  154. package/foundation/discovery/template-icon-meanings.mjs +95 -0
  155. package/foundation/discovery/theming-targets.d.mts +6 -0
  156. package/foundation/discovery/theming-targets.mjs +33 -0
  157. package/foundation/response/error-codes.d.mts +12 -1
  158. package/foundation/response/error-codes.doc.mjs +66 -0
  159. package/foundation/response/error-codes.mjs +55 -0
  160. package/foundation/response/response-types.doc.mjs +55 -0
  161. package/foundation/text/template-meanings-line.d.mts +16 -0
  162. package/foundation/text/template-meanings-line.mjs +37 -0
  163. package/foundation/xle/browser.d.mts +2 -2
  164. package/package.json +6 -6
@@ -0,0 +1,53 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditPreviewList()` / `astryx experimental theme preview list`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc = {
7
+ type: 'function',
8
+ kind: 'api',
9
+ name: 'themeEditPreviewList',
10
+ namespace: 'cli/api',
11
+ stability: 'experimental',
12
+ displayName: 'themeEditPreviewList()',
13
+ summary: 'The pages of the theme preview in the app.',
14
+ description:
15
+ 'Lists the pages of the theme preview, in nav order, with the theme they wear and the route folder. With no preview, and with no routes folder (app/ or src/app/) for one, the list is empty. Experimental: it may change or be removed in a patch release.',
16
+ importPath: '@astryxdesign/cli/api/experimental',
17
+ signature: 'themeEditPreviewList(options?: object): Promise<object>',
18
+ keywords: ['theme', 'experimental theme', 'preview', 'theme preview'],
19
+ params: [
20
+ {
21
+ name: 'options.path',
22
+ type: 'string',
23
+ description:
24
+ 'The folder of the preview route, when it is not in the default place.',
25
+ },
26
+ {
27
+ name: 'options.cwd',
28
+ type: 'string',
29
+ description: 'The project folder.',
30
+ },
31
+ ],
32
+ returns: [
33
+ {
34
+ type: 'themeEdit.previewList',
35
+ description:
36
+ 'The route folder (null with no preview), the theme, and the pages.',
37
+ },
38
+ ],
39
+ throws: [
40
+ {
41
+ code: 'ERR_PROJECT_REQUIRED',
42
+ when: 'no package.json in the folder or above it',
43
+ },
44
+ ],
45
+ examples: [
46
+ {
47
+ label: 'Every page',
48
+ code: 'await themeEditPreviewList(...)',
49
+ },
50
+ ],
51
+ command: 'experimental theme preview list',
52
+ related: ['themeEditShow'],
53
+ };
@@ -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 `themeEditPreviewRemove()` / `astryx experimental theme preview remove`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -0,0 +1,66 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditPreviewRemove()` / `astryx experimental theme preview remove`. */
4
+
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc = {
7
+ type: 'function',
8
+ kind: 'api',
9
+ name: 'themeEditPreviewRemove',
10
+ namespace: 'cli/api',
11
+ stability: 'experimental',
12
+ displayName: 'themeEditPreviewRemove()',
13
+ summary: 'Remove one page from the theme preview, or the whole preview.',
14
+ description:
15
+ 'Removes one page and its nav item, and rewrites the route. With no page, or for the last page, it removes the whole preview: only the files the preview wrote (theme-preview.json lists them) are deleted, and the folder only when nothing else is in it. A path in theme-preview.json that leads outside the route folder is refused before anything is deleted. Experimental: it may change or be removed in a patch release.',
16
+ importPath: '@astryxdesign/cli/api/experimental',
17
+ signature:
18
+ 'themeEditPreviewRemove(page?: string, options?: object): Promise<object>',
19
+ keywords: ['theme', 'experimental theme', 'preview', 'theme preview'],
20
+ params: [
21
+ {
22
+ name: 'page',
23
+ type: 'string',
24
+ description: 'The page to remove; none removes the whole preview.',
25
+ },
26
+ {
27
+ name: 'options.path',
28
+ type: 'string',
29
+ description:
30
+ 'The folder of the preview route, when it is not in the default place.',
31
+ },
32
+ {
33
+ name: 'options.cwd',
34
+ type: 'string',
35
+ description: 'The project folder.',
36
+ },
37
+ ],
38
+ returns: [
39
+ {
40
+ type: 'themeEdit.previewRemove',
41
+ description: 'The files deleted and the pages left.',
42
+ },
43
+ ],
44
+ throws: [
45
+ {
46
+ code: 'ERR_PATH_TRAVERSAL',
47
+ when: 'theme-preview.json names a file outside the route folder; nothing is deleted',
48
+ },
49
+ {
50
+ code: 'ERR_NOT_FOUND',
51
+ when: 'there is no preview, or it has no such page',
52
+ },
53
+ {
54
+ code: 'ERR_PROJECT_REQUIRED',
55
+ when: 'no package.json in the folder or above it',
56
+ },
57
+ ],
58
+ examples: [
59
+ {
60
+ label: 'One page',
61
+ code: 'await themeEditPreviewRemove(...)',
62
+ },
63
+ ],
64
+ command: 'experimental theme preview remove',
65
+ related: ['themeEditShow'],
66
+ };
@@ -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 editor 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 editor 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; `how --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 editor how --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 editor 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 editor show`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -0,0 +1,86 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditShow()` / `astryx experimental theme editor 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 editor 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 editor undo`. */
5
+ /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
6
+ export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -0,0 +1,124 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @file FunctionDoc for `themeEditUndo()` / `astryx experimental theme editor 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:
14
+ 'Put the theme back as it was before its last change, or remove one setting.',
15
+ description:
16
+ '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. When the settings file is damaged (not valid JSON), the step back restores the settings from before the last change without reading it. With `thing`, it removes that one setting instead, wherever it is in the settings, so it goes back to the value of the base theme; name it the way it was set, with the same `on`, `when`, `state`, `mode` and `only`. Experimental: it may change or be removed in a patch release.',
17
+ importPath: '@astryxdesign/cli/api/experimental',
18
+ signature: 'themeEditUndo(theme: string, options?: object): Promise<object>',
19
+ keywords: [
20
+ 'theme',
21
+ 'experimental theme',
22
+ 'undo',
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.thing',
35
+ type: 'string',
36
+ description:
37
+ "Remove this one setting (a dial, a token, or a CSS property) instead of stepping back one change; it goes back to the base theme's value.",
38
+ },
39
+ {
40
+ name: 'options.value',
41
+ type: 'string',
42
+ description:
43
+ 'With `thing` `headings`: which half to remove, `weight` or `tracking` (default `weight`).',
44
+ },
45
+ {
46
+ name: 'options.on',
47
+ type: 'string',
48
+ description: 'With `thing`: the part, family or role it was set on.',
49
+ },
50
+ {
51
+ name: 'options.when',
52
+ type: 'string',
53
+ description:
54
+ 'With `thing`: the variant it was set for (`<prop>:<value>`).',
55
+ },
56
+ {
57
+ name: 'options.state',
58
+ type: 'string',
59
+ description: 'With `thing`: the state it was set for.',
60
+ },
61
+ {
62
+ name: 'options.mode',
63
+ type: 'string',
64
+ description:
65
+ 'With `thing`: the color mode it was set for, `light` or `dark`.',
66
+ },
67
+ {
68
+ name: 'options.only',
69
+ type: 'boolean',
70
+ description: 'With `thing`: it was set with `only`.',
71
+ },
72
+ {
73
+ name: 'options.png',
74
+ type: 'boolean',
75
+ description: 'Also take PNG pictures of the preview.',
76
+ },
77
+ {
78
+ name: 'options.cwd',
79
+ type: 'string',
80
+ description: 'The app folder.',
81
+ },
82
+ ],
83
+ returns: [
84
+ {
85
+ type: 'themeEdit.undo',
86
+ description:
87
+ 'What was undone, the settings count now, the undo steps left, and the preview.',
88
+ },
89
+ ],
90
+ throws: [
91
+ {
92
+ code: 'ERR_THEME_NOTHING_TO_UNDO',
93
+ when: 'there is no earlier change',
94
+ },
95
+ {
96
+ code: 'ERR_THEME_NOT_SET',
97
+ when: 'with `thing`: the theme does not set it that way; the error lists the settings it has for that thing',
98
+ },
99
+ {
100
+ code: 'ERR_UNKNOWN_THEME',
101
+ when: 'the theme does not exist; the suggestion is the `new` command',
102
+ },
103
+ {
104
+ code: 'ERR_PROJECT_REQUIRED',
105
+ when: '@astryxdesign/core is not installed in the folder',
106
+ },
107
+ {
108
+ code: 'ERR_THEME_INVALID',
109
+ when: 'the theme does not build (the change is undone)',
110
+ },
111
+ {
112
+ code: 'ERR_RENDER_FAILED',
113
+ when: "the components or the preview do not render with the project's React",
114
+ },
115
+ ],
116
+ examples: [
117
+ {
118
+ label: 'Step back',
119
+ code: 'await themeEditUndo(...)',
120
+ },
121
+ ],
122
+ command: 'experimental theme editor undo',
123
+ related: ['themeBuild'],
124
+ };
@@ -13,18 +13,18 @@ export const docs = {
13
13
  sections: [
14
14
  {
15
15
  title: 'Overview',
16
- category: 'foundations',
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
- category: 'foundations',
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
- category: 'foundations',
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
- category: 'foundations',
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: create the set, declare an `adapter` in its data file (see library shapes), and run the command again; 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`.',
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. Declare it in the data file, `"adapter": {"module": "./src/adapt.js", "export": "adapt"}`, and `experimental icon add` writes `export const RocketIcon = adaptIcon(RocketIconSource);`:',
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.',
@@ -30,7 +30,7 @@ export const docs = {
30
30
  "type": "table",
31
31
  "headers": [
32
32
  "Token",
33
- "Value"
33
+ "Core default"
34
34
  ],
35
35
  "rows": [
36
36
  [
@@ -79,8 +79,8 @@ export const docs = {
79
79
  "type": "table",
80
80
  "headers": [
81
81
  "Token",
82
- "Light",
83
- "Dark"
82
+ "Core default (light)",
83
+ "Core default (dark)"
84
84
  ],
85
85
  "rows": [
86
86
  [
@@ -30,8 +30,8 @@ export const docs = {
30
30
  "type": "table",
31
31
  "headers": [
32
32
  "Token",
33
- "Light",
34
- "Dark"
33
+ "Core default (light)",
34
+ "Core default (dark)"
35
35
  ],
36
36
  "rows": [
37
37
  [
@@ -30,7 +30,7 @@ export const docs = {
30
30
  "type": "table",
31
31
  "headers": [
32
32
  "Token",
33
- "Value"
33
+ "Core default"
34
34
  ],
35
35
  "rows": [
36
36
  [
@@ -30,7 +30,7 @@ export const docs = {
30
30
  "type": "table",
31
31
  "headers": [
32
32
  "Token",
33
- "Value"
33
+ "Core default"
34
34
  ],
35
35
  "rows": [
36
36
  [
@@ -30,7 +30,7 @@ export const docs = {
30
30
  "type": "table",
31
31
  "headers": [
32
32
  "Token",
33
- "Value"
33
+ "Core default"
34
34
  ],
35
35
  "rows": [
36
36
  [